Skip to content

docs: Propose a supply view and offer, withdraw, supply hold actions - #240

Merged
scotwells merged 3 commits into
mainfrom
docs/capacity-supply-view
Nov 28, 2026
Merged

scotwells merged 3 commits into
mainfrom
docs/capacity-supply-view

Conversation

@scotwells

@scotwells scotwells commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Whether the name "supply hold" is right. It keeps the automatic quarantine in machine lifecycle distinct from this staff block.
  • Whether evidence alone can clear a supply hold, or a person must always confirm, and whether a second person is required.
  • Whether a supply hold with every check closed ends by itself or waits for staff to remove it.
  • Which roles may place a supply hold.
  • Whether the view separates "withdrawn" from "never offered".
  • The age at which counts show as stale, and whether the view lists classes given overlap.

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

  • CI validation passes on the head
  • A person reviews the open questions in the proposal

🤖 Generated with Claude Code

@scotwells
scotwells force-pushed the docs/capacity-supply-view branch 4 times, most recently from e3e6d1b to 041634e Compare November 28, 2026 15:47
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>
@scotwells
scotwells force-pushed the docs/capacity-supply-view branch from 041634e to 5ab57d0 Compare November 28, 2026 15:47
@scotwells
scotwells marked this pull request as ready for review November 28, 2026 17:13
@scotwells
scotwells requested a review from a team as a code owner November 28, 2026 17:13
@scotwells
scotwells requested review from ecv and kevwilliams November 28, 2026 17:13

@kevwilliams kevwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 quarantine from a caller lacking the quarantine permission, including removal.
  • Admission rules cover setBy and reviewedBy only. removedChecks[].removedBy and approvedBy get no stamping rule, and "removal of a finished block is allowed once openChecks is 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 CapacitySummary example uses apiVersion: fleet.datumapis.com/v1alpha1; every Fleet CRD on main is in metal.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.

@scotwells scotwells changed the title docs: Propose a supply view and offer, withdraw, quarantine actions docs: Propose a supply view and offer, withdraw, supply hold actions Nov 28, 2026
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>
@scotwells

Copy link
Copy Markdown
Contributor Author

Thanks, both. Every point from your reviews is addressed at 6341660, in two new commits so the delta is easy to read.

Kevin

  1. New hold blocks immediately. The allocator reads the hold itself and refuses the capacity until it has re-evaluated every required check as closed, or the projector has observed the hold at its current generation with none open. Missing or stale status never counts as none open. A new acceptance test covers a hold recorded just before an allocation pass.
  2. Name. The staff block is now a "supply hold", and a machine in it shows as Held. The lifecycle doc keeps "quarantine" for the automatic unknown-outcome block, and a new paragraph contrasts the two: a machine under both shows Recovery first. The name is provisional, so say if you prefer another.
  3. Failed release wipe. It does not close WipeVerified and does not count as finished. The check stays open until a later wipe the contract admits succeeds with verified evidence, or the server is retired and the hold ends with the capacity record.

Evan

  1. Who may set or clear a hold. Admission rejects any add, change or removal of the supply-hold part from a caller without the separate supply-hold permission, so a capacity operator's offer or withdraw write cannot touch it. A subresource with its own verb is named as the alternative.
  2. Stamping. removedBy and approvedBy follow the same rules as setBy and reviewedBy: stamped from the caller, a mismatch refused, approvedBy equal to removedBy refused, and both fixed once set.
  3. Removal with open checks. Removing a hold while any check is open is refused, with a test.
  4. Dependencies. Behaviour that relies on feat(capacity): Derive capacity status from commissioning #200 or feat(registration): Enable registered capacity #201 now says "proposed in feat(capacity): Derive capacity status from commissioning #200" or "proposed in feat(registration): Enable registered capacity #201".
  5. API group. The CapacitySummary example uses metal.datumapis.com, with the version marked provisional.
  6. Tests. Your two follow-up tests are added: a capacity-operator write cannot add, edit or remove a hold, and a new hold with no projected status blocks allocation.
  7. Open questions. The body now says questions 1 (who clears) and 4 (who places) must be settled before the doc leaves provisional.

All checks pass on 6341660.

@scotwells
scotwells requested review from ecv and kevwilliams November 28, 2026 17:39

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
  • removedBy and approvedBy are stamped from the caller, approvedBy equal to removedBy is 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 kevwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@scotwells
scotwells merged commit a8a21e5 into main Nov 28, 2026
6 checks passed
@scotwells
scotwells deleted the docs/capacity-supply-view branch November 28, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants