carlos / platform Public

claim-ack-refresh census: re-pin the ack refresh and regional check rows

New overlay plan14-root-reads-claim-ack-refresh.tsv, loaded last and
marked rev3=PROPOSED-claim-ack-refresh: acknowledgeOperation and
productionClaimRoster.Actor re-pinned at their classes, a new
declaration row for refreshAcknowledgement under acknowledgeOperation's
class, and the internal/host, hostbox and hostclaim envelopes. No
accepted-legacy row, so the seal stands. 9B8 is unchanged.

Ruling 6 pins sameVerifiedActor to VerifyRegional. The proposal note
gains an "Ack refresh" section.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 500741f4c4ebd8f2351bec74d87500511186f238 parent 7b80572
4 files changed, +48 −0
  • docs/superpowers/notes/census-proposal-claim-step8-readiness.md +29 −0
  • internal/host/claimstep8_ruling6_test.go +3 −0
  • internal/provision/plan14_root_reads_test.go +9 −0
  • internal/provision/testdata/plan14-root-reads-claim-ack-refresh.tsv +7 −0

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-claim-step8-readiness.md b/docs/superpowers/notes/census-proposal-claim-step8-readiness.md
index afe3d6dc9..df746f816 100644
--- a/docs/superpowers/notes/census-proposal-claim-step8-readiness.md
+++ b/docs/superpowers/notes/census-proposal-claim-step8-readiness.md
@@ -175,3 +175,32 @@ Tests:
With the rule removed, the accept case fails with the harness's exact error.
- `TestProcStatParent` covers comms containing `)` and newlines, and malformed lines.
+
+## Ack refresh
+
+Status: PROPOSED (G10 fix, 2026-10-20), awaiting a ruling. The harness's first claim-mode create on a freshly activated box never completed. The console's one in-request `Complete` ran before the box's ack, and its only retry is recovery at `started_at + 5 min`. The box's ack carried its first lease's 90 s expiry and was write-once, so every recovery saw an expired ack, got `ErrPending`, and the create stayed `creating`. Separately, the agent's regional worker pinned the roster-wide revision at startup, so the create's own actor hold stopped it with `ErrChanged` until the agent restarted.
+
+The re-pins are in a new overlay, `internal/provision/testdata/plan14-root-reads-claim-ack-refresh.tsv`, loaded last and marked `rev3=PROPOSED-claim-ack-refresh`. It adds no accepted-legacy row, so the seal stands.
+
+- **The hostclaim rule.** `AcknowledgeExecution` lets an existing ack be replaced only by one with the same op, enrollment, boot and controller, a lease ETag and a strictly later expiry. Byte-identical is still `ErrAckAlreadyApplied`. Anything else is still `ErrWrongState`, including an undecodable previous ack.
+- **The box refresh.** `acknowledgeOperation` hands an existing ack to `refreshAcknowledgement`. Once fewer than `ackRefreshBefore` (60 s, two-thirds of the lease TTL) remain, it writes a refreshed ack from the controller's current `Ready` state, under the same checks as the first ack.
+- **Same controller.** The root broker rotates the controller token on every renewal, so the slot that wrote the first ack identifies the controller, not the current token. The refreshed ack keeps the first ack's `ControllerID` and carries the current lease ETag and expiry. A restarted agent opens a new slot and leaves the old ack to expire.
+- **The regional check.** `claimRegionalEnrollment.VerifyRegional` compares the fresh actor with the startup actor field by field, ignoring only `Revision`. `productionClaimRoster.Actor` now also sets the row's `QuarantineRevision` on the actor, from the same roster read. That count only grows, so a box quarantined and readmitted since startup still never matches. `claimBoundIdentity` still pins the revision and is unchanged.
+
+Ruling 6: the refresh runs only in the claim participation loop (claims on, agent mode). `sameVerifiedActor` is called only from `VerifyRegional`, pinned in `TestStep8CensusChangesReachOnlyClaimMode`. Only the claim roster adapter sets `QuarantineRevision`; every other actor leaves it zero.
+
+| Unit | Change | Class |
+|---|---|---|
+| `internal/host/rootexecution_client.go` `productionClaimLocal.acknowledgeOperation` | hands an existing ack to the refresh (declaration) | authority C (unchanged) |
+| `internal/host/rootexecution_client.go` `productionClaimLocal.refreshAcknowledgement` | new: extends this controller's own ack (declaration) | authority C (new row, acknowledgeOperation's class) |
+| `internal/host/claimproduction.go` `productionClaimRoster.Actor` | the actor carries `QuarantineRevision`; same two reads | authority C,G,J4 (unchanged) |
+
+Envelopes re-pinned: `internal/host`, `internal/hostbox`, `internal/hostclaim`. 9B8: no record write changes; `TestPlan9B8RecordWriteCensus` passes unchanged.
+
+Tests:
+
+- `TestClaimAckRefreshCompletesCreateThroughRecovery` runs the production create through the real hostops controller, authority and control writer on a test clock. The console's in-request `Complete` gets `ErrPending`. The box acks 15 s in and keeps the ack usable at every 30 s tick, and recovery passes before five minutes leave the op and its registration alone. At `started_at + 5 min + 1 s` the create registration is expired but listed, both effects are complete and the hold is present. One recovery pass completes the create: the claim is serving with a stamp, and the sweep then settles the registration. With the first ack only, recovery gets `ErrPending` and the create stays stuck, as on the harness.
+- `TestClaimAckRefreshLeavesOtherControllersAlone` covers a refresh not yet due, a restarted controller, another boot, a lease that did not renew, a journalled ack naming another enrollment, op or controller, and a lease for another incarnation.
+- `TestClaimAckRefreshProductionClient` runs against the real root broker and RootClient. It waits for one real renewal, confirms the token rotated, and checks that the refreshed ack keeps the first controller ID.
+- `TestAcknowledgeExecutionExtendsOnlyTheSameLease` covers each hostclaim refusal.
+- `TestSameVerifiedActorIgnoresOnlyRevision`, `TestClaimRegionalEnrollmentSurvivesRosterRevision` and `TestClaimRegionalEnrollmentFieldChanges` cover the regional check, on the production roster adapter for the revision bump and a quarantine and readmission.
diff --git a/internal/host/claimstep8_ruling6_test.go b/internal/host/claimstep8_ruling6_test.go
index 67b6bb60f..bcd687137 100644
--- a/internal/host/claimstep8_ruling6_test.go
+++ b/internal/host/claimstep8_ruling6_test.go
@@ -77,6 +77,9 @@ func TestStep8CensusChangesReachOnlyClaimMode(t *testing.T) {
"migrateRootClaimAuthority": {"migrateClaimJournalsWith"},
"prepareRootRetryUnitDirectory": {"installActivationControl", "readClaimUnitSettings"},
"collector.routes": {"migrateRootClaimAuthority"},
+ // G10 (claim-ack-refresh): only the claim assembly's regional
+ // enrollment check ignores the roster revision.
+ "sameVerifiedActor": {"VerifyRegional"},
}
for name, w := range want {
got := slices.Compact(sortedCopy(callers[name]))
diff --git a/internal/provision/plan14_root_reads_test.go b/internal/provision/plan14_root_reads_test.go
index 6393914b7..79502a46e 100644
--- a/internal/provision/plan14_root_reads_test.go
+++ b/internal/provision/plan14_root_reads_test.go
@@ -999,6 +999,15 @@ func TestPlan14RootReadCensus(t *testing.T) {
if err = loadRootReadInventory(filepath.Join(root, "internal/provision/testdata/plan14-root-reads-claim-own-child.tsv"), &inv, true); err != nil {
t.Fatal(err)
}
+ // Census overlay claim-ack-refresh (G10: the box refreshes its own
+ // execution acknowledgement while the op waits on the console, and the
+ // regional enrollment check ignores the roster-wide revision but carries
+ // the row's quarantine revision), loaded last. PROPOSED, awaiting a
+ // ruling (docs/superpowers/notes/census-proposal-claim-step8-readiness.md,
+ // "Ack refresh"); no accepted-legacy row, so the seal stands.
+ if err = loadRootReadInventory(filepath.Join(root, "internal/provision/testdata/plan14-root-reads-claim-ack-refresh.tsv"), &inv, true); err != nil {
+ t.Fatal(err)
+ }
errs := append(compareRootReads(got, inv), checkRootReadLegacy(inv, seal)...)
errs = append(errs, checkRootReadDeclarations(got, inv)...)
if len(errs) > 0 {
diff --git a/internal/provision/testdata/plan14-root-reads-claim-ack-refresh.tsv b/internal/provision/testdata/plan14-root-reads-claim-ack-refresh.tsv
new file mode 100644
index 000000000..52e1289cf
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-claim-ack-refresh.tsv
@@ -0,0 +1,7 @@
+# Census overlay claim-ack-refresh (G10 fix, 2026-10-20): the box keeps its own execution acknowledgement fresh while a create, delete or purge waits on the console, and the regional enrollment check stops pinning the roster-wide revision. hostclaim.AcknowledgeExecution lets an ack be replaced only by one with the same op, enrollment, boot and controller, a lease ETag and a strictly later expiry. productionClaimRoster.Actor now also carries the row's QuarantineRevision on the actor, read from the same roster object; no new read. Classes unchanged; refreshAcknowledgement is a new declaration under acknowledgeOperation's authority and task.
+@coverage internal/host e65e013f2a3b196b4876cf358229c15d02c4ca9d564054371c9d17361eec508d
+@coverage internal/hostbox 7f872271f2ee9babee13d764a54c6603fb383b7ec01143ca03c73298be5fe6e5
+@coverage internal/hostclaim ab7011859f49b2282ddfbdd98817437852163bddb0e9cf81c12150b66b970afa
+internal/host/claimproduction.go productionClaimRoster.Actor authority C,G,J4 root-input;kept=C,G;scope=protected-decision-only;rev3=PROPOSED-claim-ack-refresh;basis=the same two reads; the verified actor also carries the roster row's QuarantineRevision, so the regional enrollment check can ignore the roster-wide revision and still refuse a box quarantined since startup file:Read@127,file:Read@674 f930f8c38f722d67f41ffe65bca4c2ef5f7ef6bb5959a7da24099fc20a1c35e8
+internal/host/rootexecution_client.go productionClaimLocal.acknowledgeOperation authority C rev3=PROPOSED-claim-ack-refresh;identity=agent uid carlos;basis=publishes only the required participant own active root-client tuple under claim CAS; checks host incarnation operation box enrollment; an existing acknowledgement is no longer left as is but handed to refreshAcknowledgement, which only extends this controller's own bf01c7d9ac473f9152af37d3117da67b1af63f6b2e61f32bc3d67e0f7662b767
+internal/host/rootexecution_client.go productionClaimLocal.refreshAcknowledgement authority C rev3=PROPOSED-claim-ack-refresh;identity=agent uid carlos;basis=extends only an acknowledgement this slot's controller wrote (same op, enrollment, boot and first controller id) once fewer than ackRefreshBefore (60 s) remain, from the controller's current Ready state under the first acknowledgement's checks, under claim CAS; hostclaim refuses anything but a strictly later expiry e236c26943abbab67d29451a9d7a0f880af1b6f97ed0a7c9df7238f91b353aff