Repository navigation
docs: Propose a supply view and offer, withdraw, supply hold actions - #240
Conversation
e3e6d1b to
041634e
Compare
Operators cannot see how many machines can be allocated or why the rest cannot. This proposes a per-site, per-pool supply view with offer, withdraw, and quarantine actions. Quarantine is a block on the capacity record with required checks, and custody is untouched. Each check is satisfied by work the device operations contract already admits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
041634e to
5ab57d0
Compare
kevwilliams
left a comment
There was a problem hiding this comment.
Hold: a new quarantine blocks nothing until the projector runs, so a suspect machine can still be allocated.
- The allocator decides from the projected open checks, and a fresh block has none. Fix: treat a block with no projected checks as blocking, or have the allocator read the block and its evidence itself, as the safety rules already claim.
- "Quarantine" already names the automatic unknown-outcome block in machine-lifecycle (L999, L1180, L1331). Rename the staff block or reconcile both docs.
- Say whether a failed release wipe counts as finished for WipeVerified, since the failed-wipe user story depends on it.
The allocator now reads the block on the capacity itself and refuses capacity that carries one until each required check is closed by evidence it re-evaluates, or the projector reports no open checks at the block's current generation. A hold recorded before any projector pass therefore blocks the next allocation pass. The staff block is renamed supply hold, shown as Held, so it no longer shares a name with the automatic quarantine in machine lifecycle. The text says how the two differ and that a machine under both shows Recovery first. A failed or unknown release wipe does not close WipeVerified and does not count as finished for the admission refusal. The check stays open until a later admitted wipe succeeds with verified evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ecv
left a comment
There was a problem hiding this comment.
Request changes.
The quarantine design has a safety hole and an authorization hole. Both sit at the centre of the proposal's claim that no action can make a suspect machine allocatable.
- Agree with kevwilliams: "The allocator reads the open checks: a block with none open does not block supply" means a freshly written block, before the projector has run, has no projected checks and blocks nothing. A suspect machine can be allocated in that window. Fix: the allocator treats a block with no projected status as blocking, or reads the block and its evidence itself, as the Safety rules already claim.
- Who may quarantine is not enforceable as written. The block is a field of the capacity spec, and Kubernetes RBAC cannot grant write on one spec field. The capacity operator, who may update the spec to offer or withdraw, could drop or edit the block in the same write. Name the mechanism: a subresource with its own verb, or admission that rejects any change to
quarantinefrom a caller lacking the quarantine permission, including removal. - Admission rules cover
setByandreviewedByonly.removedChecks[].removedByandapprovedByget no stamping rule, and "removal of a finished block is allowed onceopenChecksis empty" has no refusal case or acceptance test for removal while checks are open. Without both, the second-person rule on removing an unmeetable check is advisory. - Agree with kevwilliams on naming: machine-lifecycle already uses "quarantine" for the automatic unknown-outcome block (L999, L1180, L1331). Rename the staff block or reconcile both docs.
- Agree with kevwilliams: say whether a failed release wipe counts as finished for
WipeVerified, since the failed-wipe user story depends on it. - Registration and capacity behaviour is stated as existing ("the registration rules already require", "already computes", "the existing update permission") but on current main stage 1 denies every update of inventory-backed capacity and the projector and its role arrive in #200/#201, both open. The Summary says this once; the body text should say "proposed in #201" where it relies on it.
- The
CapacitySummaryexample usesapiVersion: fleet.datumapis.com/v1alpha1; every Fleet CRD on main is inmetal.datumapis.com. Use the real group or mark the example group provisional.
Follow-ups:
- Add an acceptance test that a capacity-operator write cannot add, edit or remove a quarantine, and one that a new block with no projected status blocks allocation.
- Open question 1 (who clears a quarantine) and 4 (who may quarantine) should be settled before the doc leaves provisional, since the hold above depends on them.
Kubernetes RBAC cannot grant write on one spec field, so the capacity operator could have dropped the block in a write that offers or withdraws. Admission now rejects any add, change, or removal of the supply hold part from a caller without its own permission. Removal entries are stamped from the caller like the other identity fields, and removing the block while a check is open is refused. The text now says where it relies on behavior only proposed in #200 and #201, and the summary example uses the API group that exists on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, both. Every point from your reviews is addressed at 6341660, in two new commits so the delta is easy to read. Kevin
Evan
All checks pass on 6341660. |
ecv
left a comment
There was a problem hiding this comment.
Approve.
Re-review at 6341660. Every point from the earlier hold is addressed:
- A supply hold the projector has not observed now blocks allocation; the allocator never trusts a missing or stale
openChecks, with an acceptance test for a hold placed just before an allocation pass. - Who may hold is enforced at admission with a separate permission checked by an authorization review (a subresource as the fallback), and a capacity-operator write that adds, edits or removes a hold is a required refusal test.
removedByandapprovedByare stamped from the caller,approvedByequal toremovedByis refused, and removing the block with checks open is refused.- The staff block is renamed to supply hold and distinguished from the lifecycle quarantine.
- A failed or unknown release wipe does not close
WipeVerified. - Behaviour from #200 and #201 is marked as proposed there, and the example uses
metal.datumapis.com.
kevwilliams
left a comment
There was a problem hiding this comment.
An unobserved supply hold now blocks allocation at once, the rename separates it from lifecycle quarantine, and a failed or unknown wipe keeps WipeVerified open.
Related to #120
Operators cannot see how many machines can be sold or why the rest cannot. This proposes a per-site, per-pool supply view and three actions: offer, withdraw and supply hold. No action can make a machine allocatable, because the capacity projector still derives availability from evidence.
A supply hold is a staff block on the capacity record. It never holds custody, and the allocator refuses held capacity itself without waiting for the projector.
Decisions for a person
Open questions 1 (who clears a supply hold) and 4 (who may place one) must be settled before the proposal leaves provisional.
Other open PRs (#243, #187, #186, #185, #183, #173) add rows to the same documentation index table. Whichever lands later rebases its row.
Test plan
🤖 Generated with Claude Code