region HA containment: census proposal and reaped-wake test
CI on 4b06ac42 failed two expected ways. The root-read census moved: AdoptHost's body (one new refusal, no new read) and the activator, hafresh and lease envelopes; proposal via make census-propose, for the cross-model reviewer. TestReapedWakeObligationSurvivesRestart re-woke right after a replicated wake's unclean marker; it now expects the owed marker to land first and the acquire to be held for the lease term.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/notes/census-proposal-ha-unclean-marker-waits.md+19 −0internal/activator/harelease_test.go+9 −3internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-ha-unclean-marker-waits.tsv+7 −0
CI passed — run details
Intent
<task-notification> <task-id>byum9c6ki</task-id> <tool-use-id>toolu_01EVLmGjYv1QD9DNKPNyxjMg</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/18c2ef37-6ec3-4dcd-8be8-7eed9ce0123f/tasks/byum9c6ki.output</output-file> <status>failed</status> <summary>Background command "Poll CI until the containment branch finishes" failed with exit code 1</summary> </task-notification>
<task-notification> <task-id>bfkr3ln0r</task-id> <tool-use-id>toolu_01Ke6HQ3Q3mKdgsneDAKzgTC</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/18c2ef37-6ec3-4dcd-8be8-7eed9ce0123f/tasks/bfkr3ln0r.output</output-file> <status>completed</status> <summary>Background command "Poll CI until the containment branch finishes" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>bt98vhl01</task-id> <tool-use-id>toolu_012yCo1hG5suKeDMAaSjsHzG</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/18c2ef37-6ec3-4dcd-8be8-7eed9ce0123f/tasks/bt98vhl01.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 1 on the generations spec" completed (exit code 0)</summary> </task-notification>
diff --git a/docs/superpowers/notes/census-proposal-ha-unclean-marker-waits.md b/docs/superpowers/notes/census-proposal-ha-unclean-marker-waits.md| new file mode 100644 |
| index 000000000..e8472c262 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-ha-unclean-marker-waits.md |
| @@ -0,0 +1,19 @@ |
| +# Census approval: ha-unclean-marker-waits |
| + |
| +Ruling `census-ruling-ha-unclean-marker-waits`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/activator/haadopt.go` `Service.AdoptHost` | body | unchanged (85) | Defers adoption, before any import, while the observed lock is an unclean release marker that is not settled and younger than a lease term (hafresh.MarkerOpensAt). No new read: it inspects the lock view the unit already read. Only adds a refusal. | |
| + |
| +Envelopes re-pinned: `internal/activator`, `internal/hafresh`, `internal/lease`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/activator/haadopt.go` `Service.AdoptHost`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Serialize through the existing host operation state. Read local route/revision/receipt plus configured lock/manifest/wake objects; use only restricted ordinary acquire, exact guarded restore, ordinary unclean release and verified readback for adoption. No process launch, local-copy reuse or secret access. B3: pass the optional shared durable termination proof adapter into the existing restricted finalizer acquire. The adapter validates the exact classified peer and current host lifetime, uses the acquire data-bucket client, and cannot bypass expiry or CAS. No new read in this unit. B4: A first scanner import may reuse its staging lock observation; the ordinary acquire still rereads and compares the exact ETag/generation and expiry. Existing receipt replay keeps its fresh read. No new read path or takeover authority.;rev3=census-ruling-region-ha-followups;basis=Attach a per-acquire termination proof observer to finalizer acquisitions so refusals retain alarms; avoid duplicate fallback observations. The observer receives the existing route and departure ref for paging; no new storage read or takeover authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Require local pool eligibility at entry and in HA acquisition proofs; supplied route only; termination, lifetime and emptiness checks remain. |
| + |
| +Seal: `55d66980f8db645c762b56e20b5eabba09d8e1f2ab79de5e089ff087ad677bc3` → `821598970e60a776d4a62138d5adbfa393cd30bc1ec1f266d290e5b6d4e12c42`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-ha-unclean-marker-waits.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/activator/harelease_test.go b/internal/activator/harelease_test.go| index 31b006482..87e95ea4d 100644 |
| --- a/internal/activator/harelease_test.go |
| +++ b/internal/activator/harelease_test.go |
| @@ -559,11 +559,17 @@ func TestReapedWakeObligationSurvivesRestart(t *testing.T) { |
| if n := len(lease.PendingObligations()); n != 1 { |
| t.Fatalf("the reaper's obligation was dropped: %d pending", n) |
| } |
| - if _, err := s2.b.Acquire(context.Background(), s2.rt); err != nil { |
| - t.Fatal(err) |
| + // The acquire settles the owed marker first. The reaped wake had |
| + // replicated, so its unclean marker is not settled and holds every box |
| + // for a lease term (region HA rev 6.7): the acquire is held, naming the |
| + // marker, and writes nothing more. |
| + _, err := s2.b.Acquire(context.Background(), s2.rt) |
| + var held *errLeaseHeld |
| + if !errors.As(err, &held) || !strings.HasPrefix(held.holder, hafresh.MarkerOwnerPrefix) || held.retryAfter < lease.LeaseTTL-time.Minute { |
| + t.Fatalf("acquire after the owed unclean marker: %v", err) |
| } |
| w := lockWriteLogOf(s) |
| - if len(w) < 2 || !isMarker(w[len(w)-2]) || !isHAHeld(w[len(w)-1], s2.b.self()) || len(lease.PendingObligations()) != 0 { |
| + if len(w) < 1 || !isMarker(w[len(w)-1]) || len(lease.PendingObligations()) != 0 { |
| t.Fatalf("writes %d, pending %d", len(w), len(lease.PendingObligations())) |
| } |
| } |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index ee4b1b063..0c07a0be7 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -197,3 +197,4 @@ plan14-root-reads-stateless-replicas-4-merge-main2.tsv 5889e1513a21733385ef3926d |
| plan14-root-reads-stateless-replicas-4-drill3.tsv d0773df1895af8ab5e402e9caceb90e571ea300eb19fd3b50abb2041783d1d08 |
| plan14-root-reads-stateless-replicas-4-r28.tsv 55d66980f8db645c762b56e20b5eabba09d8e1f2ab79de5e089ff087ad677bc3 |
| plan14-root-reads-stateless-replicas-4-merge-main3.tsv 55d66980f8db645c762b56e20b5eabba09d8e1f2ab79de5e089ff087ad677bc3 |
| +plan14-root-reads-ha-unclean-marker-waits.tsv 821598970e60a776d4a62138d5adbfa393cd30bc1ec1f266d290e5b6d4e12c42 |
diff --git a/internal/provision/testdata/plan14-root-reads-ha-unclean-marker-waits.tsv b/internal/provision/testdata/plan14-root-reads-ha-unclean-marker-waits.tsv| new file mode 100644 |
| index 000000000..ee24dea39 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-ha-unclean-marker-waits.tsv |
| @@ -0,0 +1,7 @@ |
| +# Census overlay ha-unclean-marker-waits, written by census-propose (#369). census-ruling-ha-unclean-marker-waits, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-ha-unclean-marker-waits.md. |
| +# 1 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy d75eee0e5e35babd3b520a4d04089f602b85d6a21bd54e6e44d310b2855695ce internal/activator/haadopt.go Service.AdoptHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Serialize through the existing host operation state. Read local route/revision/receipt plus configured lock/manifest/wake objects; use only restricted ordinary acquire, exact guarded restore, ordinary unclean release and verified readback for adoption. No process launch, local-copy reuse or secret access. B3: pass the optional shared durable termination proof adapter into the existing restricted finalizer acquire. The adapter validates the exact classified peer and current host lifetime, uses the acquire data-bucket client, and cannot bypass expiry or CAS. No new read in this unit. B4: A first scanner import may reuse its staging lock observation; the ordinary acquire still rereads and compares the exact ETag/generation and expiry. Existing receipt replay keeps its fresh read. No new read path or takeover authority.;rev3=census-ruling-region-ha-followups;basis=Attach a per-acquire termination proof observer to finalizer acquisitions so refusals retain alarms; avoid duplicate fallback observations. The observer receives the existing route and departure ref for paging; no new storage read or takeover authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Require local pool eligibility at entry and in HA acquisition proofs; supplied route only; termination, lifetime and emptiness checks remain.;rev3=census-ruling-ha-unclean-marker-waits;basis=Defers adoption, before any import, while the observed lock is an unclean release marker that is not settled and younger than a lease term (hafresh.MarkerOpensAt). No new read: it inspects the lock view the unit already read. Only adds a refusal. registry:AcquiredGeneration@2664,registry:AcquiredGeneration@3037,registry:AcquiredGeneration@3815,registry:AcquiredGeneration@4427,registry:AcquiredGeneration@4518,registry:AcquiredGeneration@5157,registry:AcquiredGeneration@5248,registry:DepartureIID@1912,registry:DepartureIID@6033,registry:DepartureRef@1876,registry:DepartureRef@6017,registry:ExpectedPair@8529,registry:Host@1074,registry:Host@1277,registry:Host@1373,registry:Host@1445,registry:Host@1514,registry:Host@1780,registry:Host@2155,registry:Host@2881,registry:Host@3218,registry:Host@3605,registry:Host@5846,registry:Host@6267,registry:Host@6452,registry:Host@7534,registry:Host@8291,registry:Host@8593,registry:Host@9156,registry:Host@976,registry:Lifetime@6069,registry:Lifetime@8498,registry:LockETag@6104,registry:LockGeneration@1948,registry:LockGeneration@6116,registry:Phase@2996,registry:Phase@3013,registry:Phase@3355,registry:Phase@3393,registry:Phase@3449,registry:Phase@4459,registry:Phase@4551,registry:Phase@5101,registry:Phase@5189,registry:Receipt@6093,registry:Revision@3237,registry:Revision@6081,registry:Sequence@3141,registry:Sequence@3161,registry:WakeDigest@3100,registry:WakeDigest@3122,whole:HAAdoption@3254,whole:HAAdoption@6408,whole:HAWakeImport@3083,whole:HAWakeImport@5988,whole:HAWakeImport@6004,whole:HAWakeImport@6012,whole:HAWakeImport@6286,whole:HAWakeImport@8300,whole:HAWakeImport@8602,whole:HAWakeImport@8694,whole:Pair@3231,whole:Pair@6280,whole:Pair@8535,whole:Pair@8555,whole:Route@1004,whole:Route@1243,whole:Route@1286,whole:Route@1293,whole:Route@138,whole:Route@174,whole:Route@2813,whole:Route@308,whole:Route@3515,whole:Route@4828,whole:Route@568,whole:Route@5935,whole:Route@646,whole:Route@7006,whole:Route@7047,whole:Route@7092,whole:Route@7247,whole:Route@7802,whole:Route@838,whole:Route@8387 57e100f7d2bdb0631df62171f72429dce94edeacf7a51b1310a51c78cdd89742 |
| +internal/activator/haadopt.go Service.AdoptHost legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Serialize through the existing host operation state. Read local route/revision/receipt plus configured lock/manifest/wake objects; use only restricted ordinary acquire, exact guarded restore, ordinary unclean release and verified readback for adoption. No process launch, local-copy reuse or secret access. B3: pass the optional shared durable termination proof adapter into the existing restricted finalizer acquire. The adapter validates the exact classified peer and current host lifetime, uses the acquire data-bucket client, and cannot bypass expiry or CAS. No new read in this unit. B4: A first scanner import may reuse its staging lock observation; the ordinary acquire still rereads and compares the exact ETag/generation and expiry. Existing receipt replay keeps its fresh read. No new read path or takeover authority.;rev3=census-ruling-region-ha-followups;basis=Attach a per-acquire termination proof observer to finalizer acquisitions so refusals retain alarms; avoid duplicate fallback observations. The observer receives the existing route and departure ref for paging; no new storage read or takeover authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Require local pool eligibility at entry and in HA acquisition proofs; supplied route only; termination, lifetime and emptiness checks remain.;rev3=census-ruling-ha-unclean-marker-waits;basis=Defers adoption, before any import, while the observed lock is an unclean release marker that is not settled and younger than a lease term (hafresh.MarkerOpensAt). No new read: it inspects the lock view the unit already read. Only adds a refusal. registry:AcquiredGeneration@2664,registry:AcquiredGeneration@3037,registry:AcquiredGeneration@3815,registry:AcquiredGeneration@4427,registry:AcquiredGeneration@4518,registry:AcquiredGeneration@5157,registry:AcquiredGeneration@5248,registry:DepartureIID@1912,registry:DepartureIID@6033,registry:DepartureRef@1876,registry:DepartureRef@6017,registry:ExpectedPair@8529,registry:Host@1074,registry:Host@1277,registry:Host@1373,registry:Host@1445,registry:Host@1514,registry:Host@1780,registry:Host@2155,registry:Host@2881,registry:Host@3218,registry:Host@3605,registry:Host@5846,registry:Host@6267,registry:Host@6452,registry:Host@7534,registry:Host@8291,registry:Host@8593,registry:Host@9156,registry:Host@976,registry:Lifetime@6069,registry:Lifetime@8498,registry:LockETag@6104,registry:LockGeneration@1948,registry:LockGeneration@6116,registry:Phase@2996,registry:Phase@3013,registry:Phase@3355,registry:Phase@3393,registry:Phase@3449,registry:Phase@4459,registry:Phase@4551,registry:Phase@5101,registry:Phase@5189,registry:Receipt@6093,registry:Revision@3237,registry:Revision@6081,registry:Sequence@3141,registry:Sequence@3161,registry:WakeDigest@3100,registry:WakeDigest@3122,whole:HAAdoption@3254,whole:HAAdoption@6408,whole:HAWakeImport@3083,whole:HAWakeImport@5988,whole:HAWakeImport@6004,whole:HAWakeImport@6012,whole:HAWakeImport@6286,whole:HAWakeImport@8300,whole:HAWakeImport@8602,whole:HAWakeImport@8694,whole:Pair@3231,whole:Pair@6280,whole:Pair@8535,whole:Pair@8555,whole:Route@1004,whole:Route@1243,whole:Route@1286,whole:Route@1293,whole:Route@138,whole:Route@174,whole:Route@2813,whole:Route@308,whole:Route@3515,whole:Route@4828,whole:Route@568,whole:Route@5935,whole:Route@646,whole:Route@7006,whole:Route@7047,whole:Route@7092,whole:Route@7247,whole:Route@7802,whole:Route@838,whole:Route@8387 57e100f7d2bdb0631df62171f72429dce94edeacf7a51b1310a51c78cdd89742 |
| +@coverage internal/activator 5beb4d1544451c8331013ede98a8fa9860ae9fa324c075d61893491771ab2fc5 |
| +@coverage internal/hafresh 511d4b2df62cd0d6ae89c20676b7f603f2062e1607718ee3b63b007226369b25 |
| +@coverage internal/lease 81b4ff457ea4c2fa9b2b964ee523ca70c59850e1a23f68bd2432c658af6ed7f3 |