Skip to content

feat(worker): operator surrender lane for unrecoverable ordinary release authority - #257

Merged
ruby-dlee merged 3 commits into
mainfrom
feat/worker-surrender-lane
Aug 19, 2026
Merged

feat(worker): operator surrender lane for unrecoverable ordinary release authority#257
ruby-dlee merged 3 commits into
mainfrom
feat/worker-surrender-lane

Conversation

@ruby-dlee

Copy link
Copy Markdown
Owner

Why

All four pilot worker slots are stranded in the same shape: assigned, VM deallocated by TTL, and no sanctioned exit. Their tasks were closed out locally (teardown consumed state/.meta before any receipt existed - the unimplemented D6 ordering), so authority-receipt can never mint a proof, release requires that proof, and withdraw only takes queued entries. The only remaining path was hand-editing controller state.

What

A refusal-first surrender command that replaces the hand edit:

  • runs the ordinary release authority FIRST and refuses when it succeeds (surrender cannot become the easy path)
  • requires dark compute: the live provider inventory must show the VM deallocated or stopped
  • requires --reason, --confirm-surrender, and the exact subscription confirmation (withdraw's bar)
  • refuses to replace an ordinary release proof, refuses while a pending provider action exists, and is idempotent on rerun
  • mints a fm.worker-release/v2 bundle whose five authority verdicts are 'surrendered' with a top-level surrender block (reason, the ordinary authority's refusal verbatim, power state, last execution digest); release_receipt rejects the 'surrendered' verdict, so the bundle cannot replay through ordinary release
  • downstream is untouched: reconcile drives deallocate/delete-compute/reset on the recorded proof exactly as for an ordinary release
  • the wrapper removes the task's locally staged provider credential keyed off the FM-SURRENDERED receipt, mirroring the withdraw lane

Verification

  • New unit surrender_lane drives the REAL wrapper end to end against the fixture provider: confirmation gates, dark-compute refusal against a running VM, a genuine ordinary-authority refusal, receipt-keyed credential cleanup, digest round-trip, release_receipt rejecting the bundle, idempotent rerun, and full reconcile convergence to zero workers with the queue entry complete.
  • New unit surrender_refuses_when_ordinary_authority_passes pins the success gate (module-level substitution of the attempt outcome only; the subprocess contract itself runs for real in surrender_lane).
  • Mutations, each turning the suite red and restored from the commit: authority-success gate removed; dark-compute gate removed; proof digest tampered; wrapper credential cleanup dropped; verdict flipped to 'proved'.
  • Full tests/fm-worker-lifecycle.test.sh green locally (12 units); bin/fm-lint.sh and fm-behavior-shards.sh --check 8 clean.

…ase authority

An assigned worker whose task lost its ordinary authority (local teardown
consumed state/<task>.meta before any receipt existed) had no sanctioned exit:
release requires a proof nothing can mint, withdraw only takes queued entries,
and the remaining path was hand-editing controller state. All four pilot slots
sit in exactly this shape.

surrender is the refusal-first replacement for that hand edit: it runs the
ordinary authority first and refuses when that succeeds, requires dark compute
(deallocated or stopped VM), an operator --reason, --confirm-surrender and the
exact subscription confirmation, refuses to replace an ordinary release proof,
and refuses while a pending provider action exists. The minted bundle keeps
the fm.worker-release/v2 shape the deallocate/delete-compute/reset machinery
fences on, with every authority verdict 'surrendered' (release_receipt rejects
that verdict, so the bundle cannot replay through ordinary release) plus a
surrender block recording the reason and the authority's refusal verbatim.
The wrapper removes the task's locally staged provider credential keyed off
the FM-SURRENDERED receipt, mirroring the withdraw lane.
Adversarial review of the surrender lane found the refusal surface thinner
than advertised. This commit closes every finding:

- F1: the controller's own execution records outrank operator judgment. When
  any recorded execution for the exact worker shows outcome_present,
  outcome_uncommitted_changes, or outcome_commits > 0, surrender refuses and
  names the execution; --confirm-discard-unlanded overrides deliberately and
  the discard list is recorded in the durable surrender block.
- F3: the authority-success gate fails closed. Only stderr carrying WORKER
  AUTHORITY REFUSED counts as a refusal; a broken tool (traceback, missing
  helper) raises instead of unlocking surrender.
- F6: the idempotent path re-verifies the stored proof binds the exact task
  generation before re-issuing it, and the rerun's --output is asserted equal
  to the stored proof.
- F4: a converged (complete) entry's refusal names the credential recovery
  (fm_cloud_state_remove) instead of a generic message; documented.
- F5: docs no longer call withdraw the only other queue mutation, state that
  surrender mints the release rather than adding a second exit, and the
  static contract now pins command_surrender, the fail-closed marker, the
  discard confirmation, and the doc paragraph's gates line.
- F2: a surrender_refusal_matrix unit pins every advertised gate at the
  command: malformed identity, pending provider action, converged-entry
  recovery, ordinary-proof non-replacement, foreign-generation stored proof,
  all three unlanded-evidence shapes, fail-closed tool breakage (subprocess
  boundary substituted, classification code real), and the ambiguous or
  missing-inventory worker.
@ruby-dlee
ruby-dlee force-pushed the feat/worker-surrender-lane branch from f28436d to a41d5fc Compare August 19, 2026 15:21
…it trail

The verification round found the override half of the unlanded-evidence gate
untested: a regression bricking --confirm-discard-unlanded, or dropping the
discarded_unlanded_executions record from the proof, shipped green. The e2e
surrender now injects a matching execution record into durable controller
state, proves the refusal names its digest, proceeds only with the discard
named, and asserts the proof records exactly that digest list.
@ruby-dlee
ruby-dlee merged commit 75f7fd1 into main Aug 19, 2026
13 checks passed
@ruby-dlee
ruby-dlee deleted the feat/worker-surrender-lane branch August 19, 2026 15:56
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.

1 participant