carlos / platform Public

ha: bound replacement retries and keep inventory waits responsive

Share replacement-record refusals between observations and identity walks, retain the verified incarnation, and use the persisted receiver summary page limit. Keep inventory-only waits on the 30-second callback cadence. Cover retry budgets, revision changes, concurrent callbacks and page persistence; refresh the root-read census proposal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 76ac4d91d621c5af7aa8d60b14a0b55f8313b560 parent c0708e0
9 files changed, +437 −38
  • docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md +7 −5
  • docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md +6 −4
  • internal/host/hadeparture_identity.go +107 −13
  • internal/host/hadepartures.go +19 −0
  • internal/host/hadepartures_rebind_test.go +224 −3
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv +15 −11
  • internal/registry/ha_journal.go +17 −1
  • internal/registry/ha_journal_test.go +41 −0

CI passed — run details

Intent

Human

<task-notification> <task-id>bk05mqmh4</task-id> <tool-use-id>toolu_0167HEw2fpxAm3LZTjoBtcJY</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22c9817b-87ae-432b-b6d2-3ebbc209af38/tasks/bk05mqmh4.output</output-file> <status>completed</status> <summary>Background command "Wait for B4 fix round 2" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>ac232706c4174e2eb</task-id> <tool-use-id>toolu_01ERXnW3K4hQFYcCkBKbSWKg</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22c9817b-87ae-432b-b6d2-3ebbc209af38/tasks/ac232706c4174e2eb.output</output-file> <status>completed</status> <summary>Agent "Opus review Task B4" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Task quality: Needs fixes.** Both findings are addressed as P16 directs, but there are 2 new Important items. One needs an implementer fix; the other needs your ruling. There are no new Critical items. Line numbers refer to c0708e05. I ran no suites. **Verdicts:** - **r2 Important (same-ref fixed-box recreation leaves the old departure open): ADDRESSED in the identity repository, but it can't happen in production yet** (`hadeparture_identity.go:78-109`, `registry/ha_identity_history.go:33,69-107`). The new-incarnation path and its old-iid lookups are described in the rebinding check below. The witness `TestDepartureSameRefRecreation/verified` completes the old departure without deleting the new edges object. - **r2 Minor 3 (C3 paged while only waiting for a fresh inventory): ADDRESSED** (`hadepartures_scan.go:133`). It pages only after 33 minutes (the backstop plus 10%), and the existing hourly limit applies after that. `TestDepartureInventoryWaitPageBound` covers it. **Rebinding authority check:** no risk found. - Unsigned, forged, wrong-account and wrong-region records are all refused. The region is now pinned to the receiver's own, not read from the record. - A record cannot pick its own iid: the ref-to-iid binding comes only from the fixed-box config or the group-ref derivation. - A duplicate iid is refused, including reuse of an iid from an earlier incarnation. - Old incarnations are never overwritten or deleted, and the database migration keeps every row. - Departures, proofs and successor validation all look up the exact iid, so the old box's records still resolve to the old binding. - Rebinding can only let completion advance without a delete. No path deletes a live box's edges file. **New Important:** 1. **An unthrottled S3 polling loop** (`hadeparture_identity.go:147`, called from `hadepartures.go:320` every 30 s). Once the config names a new iid but the stored record still names the old one, every tick re-reads the record, fails to verify it and drops the observation. That is about 120 GETs an hour per receiver, with no end. Before this fix, a known ref was never re-read. The fix is to cache the refusal with backoff and keep returning the current incarnation's observation. 2. **Nothing in production can publish the replacement record** (`boxid/record.go:41-61`). This is a gap in the ruling, not an implementer defect. `boxid.Publish` refuses to replace an existing record, so a recreated `leo` can't publish its own, and the witness only gets there with a test-only overwrite. Combined with item 1, updating the config on dev gives the polling loop but never the rebinding. You'd need to choose: either an operator step in the activation/5B card that replaces the record (verified, ETag-conditional), or a publisher change, which is outside this task. There are also 3 Minors: - Waiting for the inventory still escalates the retry backoff, so the first qualifying walk can be picked up up to 5 minutes late. - The region pinning now rejects identities from other cloud regions, which the report doesn't mention. - Until the operator updates the config, the recreated box's edges are credited to the old incarnation, which can delay suspicion. This should go in the activation card. The full write-up is in `.superpowers/sdd/2026-11-03-region-ha-p1b3b-duties/task-B4-review-r3.md`.</result> <usage><subagent_tokens>274133</subagent_tokens><tool_uses>7</tool_uses><duration_ms>135127</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bextg9lj6</task-id> <tool-use-id>toolu_01HsfTYAG4si2x2PmKJkvrkj</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22c9817b-87ae-432b-b6d2-3ebbc209af38/tasks/bextg9lj6.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on B4 fix 2 tip" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 13.8 g CO₂e (1,637,709 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-p1b3b-duties, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md b/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
index 1265336db..5ee2f98e7 100644
--- a/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
+++ b/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
@@ -1,6 +1,6 @@
# Census approval: region-ha-p1b3b-t
-Ruling `census-ruling-region-ha-p1b3b-t`. The independent reviewer approves or rejects every change below, 85 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-region-ha-p1b3b-t`. The independent reviewer approves or rejects every change below, 87 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
@@ -68,15 +68,16 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/activator/haduties.go:dutyRefusal`: reads +registry:HolderIID, +registry:HolderRef ×3, +registry:NotBefore; written legacy, accepted-legacy, frozen
- new `internal/activator/hawake.go:ExecBackend.TerminationLifetime`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
- new `internal/edge/wakeplacement.go:Edge.DutySnapshot`: reads +whole:Route; written legacy, accepted-legacy, frozen
-- new `internal/host/hadeparture_identity.go:departureIdentities.Observe`: reads +registry:Account, +registry:Digest ×2, +registry:IID ×3, +registry:Observation, +registry:Raw, +registry:Ref, +whole:HABoxIdentity ×2; written legacy, accepted-legacy, frozen
+- new `internal/host/hadeparture_identity.go:departureIdentities.Observe`: reads +registry:Account, +registry:Digest ×2, +registry:IID ×3, +registry:Observation, +registry:Raw, +registry:Ref, +whole:HABoxIdentity ×4; written legacy, accepted-legacy, frozen
- new `internal/host/hadeparture_identity.go:departureIdentities.Proof`: reads +registry:Raw; written legacy, accepted-legacy, frozen
- new `internal/host/hadeparture_identity.go:departureIdentities.Resolve`: reads +registry:Account, +registry:Digest ×2, +registry:IID ×2, +registry:Observation, +registry:Raw, +registry:Ref ×2, +registry:Region ×2; written legacy, accepted-legacy, frozen
- new `internal/host/hadeparture_identity.go:departureIdentities.Walk`: reads +file:Walk, +registry:Blocked ×13, +registry:Cursor ×3, +registry:Failed, +registry:Keys ×9, +registry:Offset ×6, +registry:StartedAt ×7, +whole:HAIdentityWalk ×2; written legacy, accepted-legacy, frozen
+- new `internal/host/hadeparture_identity.go:departureIdentities.loadReplacement`: reads +registry:IID, +registry:Raw, +whole:HABoxIdentity ×6; written legacy, accepted-legacy, frozen
- new `internal/host/hadeparture_identity.go:departureIdentities.verify`: reads +registry:Digest ×3, +registry:IID ×2, +registry:Observation ×2, +whole:HABoxIdentity ×8; written legacy, accepted-legacy, frozen
- new `internal/host/hadepartures.go:Controller.ackDeparture`: reads +registry:Phase; written legacy, accepted-legacy, frozen
- new `internal/host/hadepartures.go:Controller.enqueue`: reads +whole:HADeparture; written legacy, accepted-legacy, frozen
- new `internal/host/hadepartures.go:Controller.record`: reads +registry:Phase, +whole:HADeparture; written legacy, accepted-legacy, frozen
-- new `internal/host/hadepartures.go:Controller.step`: reads +file:Walk, +registry:Body, +registry:IID ×5, +registry:Key ×2, +registry:LastBlocked, +registry:ReceivedAt ×2, +whole:HADeparture ×3, +whole:HAPendingTermination ×6, +whole:HATerminationInbox; written legacy, accepted-legacy, frozen
+- new `internal/host/hadepartures.go:Controller.step`: reads +file:Walk, +registry:Body, +registry:IID ×5, +registry:Key ×2, +registry:LastBlocked, +registry:ReceivedAt ×2, +whole:HADeparture ×3, +whole:HAPendingTermination ×7, +whole:HATerminationInbox; written legacy, accepted-legacy, frozen
- new `internal/host/hadepartures_scan.go:Controller.ScanPass`: reads +registry:Cursor ×7, +registry:Generation ×4, +registry:Hosts ×8, +registry:InventoryGeneration, +registry:Lifetime, +registry:NotBefore ×5, +registry:Observed ×4, +registry:Phase ×7, +registry:RecordDigest ×2, +registry:Rescan ×7, +registry:Result ×3, +registry:Unresolved ×22, +registry:Version, +whole:HADeparture ×16, +whole:HADepartureHostScan ×14, +whole:HADepartureScan ×2; written legacy, accepted-legacy, frozen
- new `internal/host/hadepartures_scan.go:Controller.complete`: reads +registry:Cursor, +registry:DeleteUncertain ×3, +registry:Generation ×2, +registry:Hosts, +registry:InventoryGeneration, +registry:PermissionAlerted ×6, +registry:Phase ×9, +registry:Rescan, +registry:Version, +whole:HADeparture ×3, +whole:HADepartureHostScan, +whole:HADepartureScan; written legacy, accepted-legacy, frozen
- new `internal/host/hadepartures_scan.go:Controller.retryScan`: reads +whole:HADeparture; written legacy, accepted-legacy, frozen
@@ -102,6 +103,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/registry/ha_identity_history.go:Registry.migrateHAIdentityHistory`: reads +file:QueryRow, +file:QueryRowContext, +registry:sql; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_identity_history.go:Registry.saveHAIdentity`: reads +file:QueryRowContext ×2, +registry:Account ×4, +registry:Digest ×6, +registry:IID ×4, +registry:Observation, +registry:Raw ×5, +registry:Ref ×8, +registry:Region ×4, +whole:HABoxIdentity ×2; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:Registry.ClaimHAConfirmation`: reads +registry:Found; written legacy, accepted-legacy, frozen
+- new `internal/registry/ha_journal.go:Registry.ClaimHAIdentityPage`: reads +registry:Found; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:Registry.EnrollDeparture`: reads +whole:HADeparture ×2; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:Registry.HAIdentity`: reads +registry:Found, +registry:Identity, +whole:HABoxIdentity; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:Registry.LoadHAIdentityWalk`: reads +file:Walk, +registry:Walk, +whole:HAIdentityWalk; written legacy, accepted-legacy, frozen
@@ -115,7 +117,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/registry/ha_journal.go:Registry.SaveHAIdentity`: reads +whole:HABoxIdentity ×2; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:Registry.SaveHAIdentityWalk`: reads +file:Walk, +whole:HAIdentityWalk ×2; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:Registry.TerminationInbox`: reads +registry:Inbox, +whole:HATerminationInbox; written legacy, accepted-legacy, frozen
-- new `internal/registry/ha_journal.go:Registry.haJournal`: reads +file:QueryContext ×3, +file:QueryRowContext ×7, +file:Walk ×6, +registry:Account ×6, +registry:At ×19, +registry:Body ×4, +registry:Code ×6, +registry:Count, +registry:Departure, +registry:Departures ×2, +registry:Found ×5, +registry:HAJournal, +registry:Hint ×3, +registry:Hints ×2, +registry:ID ×13, +registry:IID ×7, +registry:Identity ×2, +registry:Inbox ×2, +registry:InventoryGeneration, +registry:Key ×8, +registry:Keys ×2, +registry:LastError ×4, +registry:LastPage ×3, +registry:Limit ×9, +registry:MessageID, +registry:Next ×4, +registry:NextAttempt ×5, +registry:Offset ×2, +registry:Op, +registry:Page, +registry:Phase ×3, +registry:ProofDigest, +registry:ProofKey, +registry:ReceivedAt ×6, +registry:Region ×7, +registry:RetryCount ×4, +registry:Walk ×6, +registry:remote ×2, +registry:sql ×9, +whole:HABoxIdentity ×2, +whole:HADeparture ×10, +whole:HAIdentityWalk ×6, +whole:HAPendingTermination ×6, +whole:HATerminationInbox ×3, +whole:haJournalRequest ×3, +whole:haJournalResponse ×57, +whole:remoteClient ×2; written legacy, accepted-legacy, frozen
+- new `internal/registry/ha_journal.go:Registry.haJournal`: reads +file:QueryContext ×3, +file:QueryRowContext ×7, +file:Walk ×6, +registry:Account ×6, +registry:At ×22, +registry:Body ×4, +registry:Code ×7, +registry:Count, +registry:Departure, +registry:Departures ×2, +registry:Found ×6, +registry:HAJournal, +registry:Hint ×3, +registry:Hints ×2, +registry:ID ×13, +registry:IID ×7, +registry:Identity ×2, +registry:Inbox ×2, +registry:InventoryGeneration, +registry:Key ×8, +registry:Keys ×2, +registry:LastError ×4, +registry:LastPage ×3, +registry:Limit ×9, +registry:MessageID, +registry:Next ×4, +registry:NextAttempt ×5, +registry:Offset ×2, +registry:Op, +registry:Page, +registry:Phase ×3, +registry:ProofDigest, +registry:ProofKey, +registry:ReceivedAt ×6, +registry:Region ×7, +registry:RetryCount ×4, +registry:Walk ×6, +registry:remote ×2, +registry:sql ×10, +whole:HABoxIdentity ×2, +whole:HADeparture ×10, +whole:HAIdentityWalk ×6, +whole:HAPendingTermination ×6, +whole:HATerminationInbox ×3, +whole:haJournalRequest ×3, +whole:haJournalResponse ×60, +whole:remoteClient ×2; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:Registry.migrateHAJournal`: reads +file:Exec, +registry:sql; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:type haJournalRequest`: reads +file:Walk; written legacy, accepted-legacy, frozen
- new `internal/registry/ha_journal.go:type haJournalResponse`: reads +file:Walk; written legacy, accepted-legacy, frozen
@@ -132,6 +134,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/hostfiles/wake.go:ImportWake`: +whole:HAWakeImport, -whole:Route, -whole:Timer ×3; keeps legacy, task accepted-legacy
- reads `internal/registry/remote_dispatch.go:Registry.dispatchRemote`: +registry:Adoption ×2, +registry:Changed ×5, +registry:Duty ×3, +registry:Expected, +registry:HAJournal ×2, +registry:Host ×9, +registry:Import, +registry:Lifetime ×5, +registry:Pair ×3, +registry:Receipt, +registry:Revision ×3, +registry:Wake ×2, +whole:DutyState ×3, +whole:HAAdoption ×2, +whole:HAWakeImport ×2, +whole:Pair ×3, +whole:haJournalRequest, +whole:haJournalResponse; keeps hint, task E2
-Seal: `7e30dee4fb52370555ad173512d7f03782f0fbed725a8a6bf4f7e31f52c23668` → `1f831656aac113ef4935e596fb0c1c89c6aea258e5f437b71d6e92fcad5589df`.
+Seal: `7e30dee4fb52370555ad173512d7f03782f0fbed725a8a6bf4f7e31f52c23668` → `35d8eca02cb401a78f3449dab8fb7675a591a22d9c84c4ea97a961f866030a2b`.
Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md b/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
index c4465f761..5abb9a350 100644
--- a/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
+++ b/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
@@ -59,13 +59,13 @@ internal/registry/ha_duties.go:Registry.AdvanceHADuty B2 fix r1: existing regist
internal/termfence/termination_proof.go:readTerminationProof Read at most 2049 bytes from the existing regional data-bucket S3 client at a key derived solely from independently bound, signature-verified immutable box identity. Reject bodies over 2048 bytes, duplicate/missing/unknown fields, invalid provenance and identity mismatch. Only acquire consumes validated proof as authority after expiry and current owner/lifetime checks. No filesystem path or tenant prefix is read.
internal/provision/reconcile.go:Reconcile B3b: collect validated instance records from the existing scan before pool filtering; report source completeness separately. Record reads, writes, scope and removal authority unchanged.
internal/provision/sidecar_reconcile.go:ReconcileSidecars B3b: retain validated sidecar records before scope/manifest filtering for coverage, including hidden/out-of-pool records. No new object reads or sidecar HA authority.
-internal/host/hadeparture_identity.go:departureIdentities.Observe B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads.
+internal/host/hadeparture_identity.go:departureIdentities.Observe B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads. B4 fix r3: A failed configured replacement retains and refreshes only the current verified incarnation observation. Share exact-key reload refusals with the event walk; cached bindings still pass signature/digest checks and the new configured iid gains nothing until verification succeeds.
internal/host/hadeparture_identity.go:departureIdentities.Proof B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence.
internal/host/hadeparture_identity.go:departureIdentities.Resolve B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence.
-internal/host/hadeparture_identity.go:departureIdentities.Walk B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Read and persist per-ref/iid refusal candidates rather than a global record-validation failure. Unsigned fields only restrict unrelated classification; they never bind identity. Incomplete listing and unidentifiable fixed records keep affected unknown iids pending; known identities continue. Existing page and GET bounds remain. B4 fix r2: A known ref with a changed independent configured iid joins the bounded verification GET page; cache hits remain read-free. Retain the 32-record GET bound and blocked-candidate refusal behavior.
+internal/host/hadeparture_identity.go:departureIdentities.Walk B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Read and persist per-ref/iid refusal candidates rather than a global record-validation failure. Unsigned fields only restrict unrelated classification; they never bind identity. Incomplete listing and unidentifiable fixed records keep affected unknown iids pending; known identities continue. Existing page and GET bounds remain. B4 fix r2: A known ref with a changed independent configured iid joins the bounded verification GET page; cache hits remain read-free. Retain the 32-record GET bound and blocked-candidate refusal behavior. B4 fix r3: Share the per-ref/configured-iid/record-revision refusal cache with Observe. Cached failures still block the configured replacement iid and any bounded parsed candidate; no extra GET while the retry deadline is pending.
internal/host/hadeparture_identity.go:departureIdentities.verify B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B4 fix r2: A different iid and digest may append an incarnation only after AWS signature, expected deployment account/region and independent fixed or deterministic group binding checks. Read current and historical iid bindings from the same registry; refuse duplicate iid, same-iid digest rotation and historical replay. No root path or execution authority is introduced.
internal/host/hadepartures.go:Controller.enqueue B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle.
-internal/host/hadepartures.go:Controller.step B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. B3 fix r1: Describe before proof access on suspicion paths. Normalize validated legacy inbox entries in atomic transactions, process bounded per-iid pending pages, and persist hourly escalation. Delete unrelated rows only after complete applicable walks and guarded received timestamps. Acquire/completion authority unchanged. B4: Count unresolved durable hints for the globally throttled summary and call the bounded scanner outside the fold. Acknowledge unrelated hints only after complete applicable discovery; complete departure acknowledgment reads durable state.
+internal/host/hadepartures.go:Controller.step B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. B3 fix r1: Describe before proof access on suspicion paths. Normalize validated legacy inbox entries in atomic transactions, process bounded per-iid pending pages, and persist hourly escalation. Delete unrelated rows only after complete applicable walks and guarded received timestamps. Acquire/completion authority unchanged. B4: Count unresolved durable hints for the globally throttled summary and call the bounded scanner outside the fold. Acknowledge unrelated hints only after complete applicable discovery; complete departure acknowledgment reads durable state. B4 fix r3: Include refused fixed-box replacements in the existing structured receiver summary, sharing its persisted hourly page claim with pending hints. Read only local refusal state and registry page state; no additional cloud request or completion authority.
internal/registry/ha_journal.go:Registry.ClaimHAConfirmation B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay.
internal/registry/ha_journal.go:Registry.EnrollDeparture B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay.
internal/registry/ha_journal.go:Registry.HAIdentity B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay.
@@ -75,7 +75,7 @@ internal/registry/ha_journal.go:Registry.RetryDeparture B3b: read/write bounded
internal/registry/ha_journal.go:Registry.SaveHAIdentity B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay.
internal/registry/ha_journal.go:Registry.SaveHAIdentityWalk B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay.
internal/registry/ha_journal.go:Registry.TerminationInbox B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay.
-internal/registry/ha_journal.go:Registry.haJournal B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add atomic compact hint enrollment, bounded due reads, received-time guarded removal and hourly page claims. Retain old inbox APIs for migration, no queue receipt or authority bit. All reads/writes stay in the existing SQLite registry with remote parity. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Delegate existing identity RPC operations to historical storage helpers. Remote interface unchanged; historical ref/iid lookups retain the old binding and ref-only lookups return the latest incarnation.
+internal/registry/ha_journal.go:Registry.haJournal B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add atomic compact hint enrollment, bounded due reads, received-time guarded removal and hourly page claims. Retain old inbox APIs for migration, no queue receipt or authority bit. All reads/writes stay in the existing SQLite registry with remote parity. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Delegate existing identity RPC operations to historical storage helpers. Remote interface unchanged; historical ref/iid lookups retain the old binding and ref-only lookups return the latest incarnation. B4 fix r3: Inventory-only waiting resets RetryCount like scan/pending and retains the caller 30-second schedule. Add an atomic claim against the existing singleton identity-page row, shared with retry_hint. Existing database and HAJournal RPC only; no filesystem path or identity authority added.
internal/registry/ha_journal.go:Registry.migrateHAJournal B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add compact per-account/region/iid pending rows to the existing registry, with durable retry and hourly page times. No new database path or receipt storage. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Run the atomic identity-history migration in the same registry; preserve all old binding bytes and observations.
internal/registry/ha_journal.go:type haJournalRequest B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Carry compact pending hints through the existing registry RPC, with no new authority. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry.
internal/registry/ha_journal.go:type haJournalResponse B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Return compact pending-hint pages from the existing registry RPC. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry.
@@ -98,3 +98,5 @@ internal/registry/ha_scan.go:Registry.departureScanJournal B4: Read/write versio
internal/registry/ha_identity_history.go:Registry.migrateHAIdentityHistory B4 fix r2: Inspect the existing SQLite schema and migrate ref-keyed identity rows atomically to (ref,digest), preserving exact binding bodies and observations. iid remains globally unique. Uses only the existing registry database; no filesystem path or executable input.
internal/registry/ha_identity_history.go:Registry.saveHAIdentity B4 fix r2: Read and append identity history in the existing registry. Exact binding bytes/account/region/iid/digest cannot mutate, and duplicate iid across incarnations or refs refuses. Only the latest incarnation observation may update. Host verification remains the caller prerequisite; this trusted registry primitive grants no takeover or completion authority.
internal/registry/ha_identity_history.go:Registry.loadHAIdentity B4 fix r2: Read immutable identity bodies and separately stored observations from the existing registry, matching both supplied ref and iid. Ref-only lookup selects newest insertion; iid lookup retains historical evidence. No new database path or remote method.
+internal/host/hadeparture_identity.go:departureIdentities.loadReplacement B4 fix r3: Read the current verified binding and only its validated control/boxes ref key, with a five-second request context. Serialize replacement requests and cache refusals by ref, configured iid and ETag (digest fallback), retrying at 30/60/120/300 seconds. A changed observed revision resets the delay. Successful verification uses the unchanged account/region/independent-iid/history guards; failures cannot bind a replacement. No tenant-named path or new root input.
+internal/registry/ha_journal.go:Registry.ClaimHAIdentityPage B4 fix r3: Invoke the existing registry journal protocol to claim the existing receiver-wide hourly identity page. Only local alert scheduling changes; no root path, completion or start authority.
diff --git a/internal/host/hadeparture_identity.go b/internal/host/hadeparture_identity.go
index 99c8c3daf..064152fa0 100644
--- a/internal/host/hadeparture_identity.go
+++ b/internal/host/hadeparture_identity.go
@@ -2,9 +2,12 @@ package host
import (
"context"
+ "crypto/sha256"
"encoding/base64"
"encoding/json"
"errors"
+ "fmt"
+ "slices"
"strings"
"sync"
"time"
@@ -18,16 +21,26 @@ import (
var errDepartureIdentity = errors.New("ha_departure_identity_unbound")
+type departureIdentityRefusal struct {
+ Expected, Revision string
+ Raw []byte
+ Err error
+ Next time.Time
+ Attempts int
+}
+
type departureIdentities struct {
- Registry *registry.Registry
- Store release.Store
- OpenStore func(context.Context) (release.Store, error)
- storeMu sync.Mutex
- opening chan struct{}
- Verifier boxid.Verifier
- Fixed map[string]string
- Region string
- Now func() time.Time
+ replacementMu sync.Mutex
+ refusals map[string]departureIdentityRefusal
+ Registry *registry.Registry
+ Store release.Store
+ OpenStore func(context.Context) (release.Store, error)
+ storeMu sync.Mutex
+ opening chan struct{}
+ Verifier boxid.Verifier
+ Fixed map[string]string
+ Region string
+ Now func() time.Time
}
func (r *departureIdentities) store(ctx context.Context) (release.Store, error) {
@@ -144,7 +157,11 @@ func (r *departureIdentities) Observe(ctx context.Context, o hadeparture.BoxObse
if err != nil {
return o, err
}
- if !ok || r.Fixed[o.Box.Ref] != "" && r.Fixed[o.Box.Ref] != b.IID {
+ if ok && r.Fixed[o.Box.Ref] != "" && r.Fixed[o.Box.Ref] != b.IID {
+ if replacement, _, e := r.loadReplacement(ctx, o.Box.Ref); e == nil {
+ b = replacement
+ }
+ } else if !ok {
store, e := r.store(ctx)
if e != nil {
return o, e
@@ -157,6 +174,10 @@ func (r *departureIdentities) Observe(ctx context.Context, o hadeparture.BoxObse
if err != nil {
return o, err
}
+ } else {
+ r.replacementMu.Lock()
+ delete(r.refusals, o.Box.Ref)
+ r.replacementMu.Unlock()
}
ev, err := r.Verifier.Enroll(b.Raw, boxid.Expect{Box: b.Ref, AWSRegion: o.Box.Scope.CloudRegion, TofuInstanceID: b.IID})
if err != nil || ev.RecordSHA256 != b.Digest {
@@ -228,9 +249,14 @@ func (r *departureIdentities) Walk(ctx context.Context) (bool, time.Time, error)
continue
}
gets++
- raw, e := boxid.Load(ctx, store, ref)
- if e == nil {
- _, e = r.verify(ctx, ref, raw)
+ var raw []byte
+ if known {
+ _, raw, e = r.loadReplacement(ctx, ref)
+ } else {
+ raw, e = boxid.Load(ctx, store, ref)
+ if e == nil {
+ _, e = r.verify(ctx, ref, raw)
+ }
}
if e != nil {
w.Blocked = append(w.Blocked, "ref:"+ref)
@@ -282,3 +308,71 @@ func (r *departureIdentities) walkBlocks(blocked []string, iid string) bool {
}
return false
}
+
+func (r *departureIdentities) loadReplacement(ctx context.Context, ref string) (registry.HABoxIdentity, []byte, error) {
+ r.replacementMu.Lock()
+ defer r.replacementMu.Unlock()
+ b, known, err := r.Registry.HAIdentity(ctx, ref, "")
+ if err != nil || !known {
+ return b, nil, errors.Join(err, errDepartureIdentity)
+ }
+ expected := r.Fixed[ref]
+ if expected == "" || expected == b.IID {
+ delete(r.refusals, ref)
+ return b, b.Raw, nil
+ }
+ previous := r.refusals[ref]
+ if previous.Expected == expected && r.now().Before(previous.Next) {
+ return b, previous.Raw, previous.Err
+ }
+ ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
+ defer cancel()
+ store, err := r.store(ctx)
+ var raw []byte
+ revision := previous.Revision
+ if err == nil {
+ raw, revision, err = store.Get(ctx, boxid.Key(ref))
+ if err == nil {
+ if revision == "" {
+ revision = fmt.Sprintf("%x", sha256.Sum256(raw))
+ }
+ var replacement registry.HABoxIdentity
+ replacement, err = r.verify(ctx, ref, raw)
+ if err == nil {
+ delete(r.refusals, ref)
+ return replacement, raw, nil
+ }
+ } else {
+ revision = previous.Revision
+ }
+ }
+ if previous.Expected != expected || previous.Revision != revision {
+ previous.Attempts = 0
+ }
+ waits := [...]time.Duration{30 * time.Second, 60 * time.Second, 120 * time.Second, 300 * time.Second}
+ if len(raw) > 64*1024 {
+ raw = nil
+ }
+ if r.refusals == nil {
+ r.refusals = map[string]departureIdentityRefusal{}
+ }
+ r.refusals[ref] = departureIdentityRefusal{Expected: expected, Revision: revision, Raw: raw, Err: err, Next: r.now().Add(waits[previous.Attempts]), Attempts: min(previous.Attempts+1, len(waits)-1)}
+ return b, raw, err
+}
+
+func (r *departureIdentities) pendingReplacement() (ref, iid string, count int) {
+ r.replacementMu.Lock()
+ defer r.replacementMu.Unlock()
+ refs := make([]string, 0, len(r.refusals))
+ for key, refusal := range r.refusals {
+ if r.Fixed[key] == refusal.Expected {
+ refs = append(refs, key)
+ }
+ }
+ if len(refs) == 0 {
+ return "", "", 0
+ }
+ slices.Sort(refs)
+ ref = refs[0]
+ return ref, r.refusals[ref].Expected, len(refs)
+}
diff --git a/internal/host/hadepartures.go b/internal/host/hadepartures.go
index d3473d7e0..4281bf937 100644
--- a/internal/host/hadepartures.go
+++ b/internal/host/hadepartures.go
@@ -405,6 +405,9 @@ func (c *Controller) step(ctx context.Context) error {
return e
}
code = fmt.Sprintf("%s count=%d", code, count)
+ if ref, iid, replacements := c.cfg.Identities.pendingReplacement(); replacements > 0 {
+ code += fmt.Sprintf(" identity_replacement_ref=%s replacement_iid=%s replacement_count=%d", ref, iid, replacements)
+ }
c.logf("ha_departure_pending code=%s sample_iid=%s", code, h.IID)
if c.cfg.PageIdentity != nil {
if e = c.cfg.PageIdentity(ctx, h, code); e != nil {
@@ -413,6 +416,22 @@ func (c *Controller) step(ctx context.Context) error {
}
}
}
+ if ref, iid, count := c.cfg.Identities.pendingReplacement(); count > 0 {
+ page, e := c.cfg.Registry.ClaimHAIdentityPage(ctx, c.now())
+ if e != nil {
+ return e
+ }
+ if page {
+ code := fmt.Sprintf("identity_replacement ref=%s count=%d", ref, count)
+ h := registry.HAPendingTermination{Account: c.cfg.Self.Account, Region: c.cfg.Self.Scope.CloudRegion, IID: iid}
+ c.logf("ha_departure_pending code=%s sample_iid=%s", code, iid)
+ if c.cfg.PageIdentity != nil {
+ if e = c.cfg.PageIdentity(ctx, h, code); e != nil {
+ c.logf("ha_departure_page code=failed")
+ }
+ }
+ }
+ }
if c.cfg.NewReader != nil {
_, err := c.ScanPass(ctx)
return err
diff --git a/internal/host/hadepartures_rebind_test.go b/internal/host/hadepartures_rebind_test.go
index 9ab304b45..1d82eea4c 100644
--- a/internal/host/hadepartures_rebind_test.go
+++ b/internal/host/hadepartures_rebind_test.go
@@ -4,7 +4,9 @@ import (
"context"
"database/sql"
"encoding/json"
+ "fmt"
"strings"
+ "sync"
"testing"
"time"
@@ -92,7 +94,7 @@ func TestDepartureSameRefRecreation(t *testing.T) {
if err != nil || proof.Evidence().RecordSHA256 != old.Box.RecordSHA256 {
t.Fatalf("old proof lost: %+v %v", proof, err)
}
- } else if mode != "unconfigured" && observeErr == nil {
+ } else if observeErr != nil || got.Box.InstanceID != old.Box.InstanceID {
t.Fatalf("%s replacement accepted: %+v", mode, got)
}
retained, ok, err := repo.Resolve(t.Context(), old.Box.Ref, old.Box.InstanceID)
@@ -173,12 +175,17 @@ func TestDepartureInventoryWaitPageBound(t *testing.T) {
type departureIdentityReads struct {
release.Store
- gets int
+ gets int
+ omitETag bool
}
func (s *departureIdentityReads) Get(ctx context.Context, key string) ([]byte, string, error) {
s.gets++
- return s.Store.Get(ctx, key)
+ raw, tag, err := s.Store.Get(ctx, key)
+ if s.omitETag {
+ tag = ""
+ }
+ return raw, tag, err
}
func (s *departureIdentityReads) ListPage(ctx context.Context, prefix, after string, limit int) ([]string, error) {
@@ -267,3 +274,217 @@ func TestDepartureIdentityRebindingGuards(t *testing.T) {
t.Fatal("group binding overridden by fixed map")
}
}
+
+func TestDepartureReplacementRefusalBackoff(t *testing.T) {
+ x := newScanRig(t, 0)
+ signer := boxidtest.NewSigner(t)
+ store := &departureIdentityReads{Store: x.store}
+ repo := &departureIdentities{Registry: x.r, Store: store, Verifier: boxid.Verifier{Account: x.d.Box.Account, Certs: signer.Certs()}, Fixed: map[string]string{"fixed": x.d.Box.InstanceID}, Region: x.d.Box.Scope.CloudRegion, Now: func() time.Time { return x.now }}
+ _, raw := signer.Record(t, "fixed", x.d.Box.Account, repo.Region, x.d.Box.InstanceID)
+ tag, err := x.store.Put(t.Context(), boxid.Key("fixed"), raw, "")
+ if err != nil {
+ t.Fatal(err)
+ }
+ obs := hadeparture.BoxObservation{Known: true, Box: hadeparture.Box{Ref: "fixed", Scope: x.d.Box.Scope}, EdgesKey: "control/edges/fixed.json", EdgesETag: "first"}
+ old, err := repo.Observe(t.Context(), obs)
+ if err != nil {
+ t.Fatal(err)
+ }
+ repo.Fixed["fixed"] = "i-2123456789abcdef0"
+ start := x.now
+ base := store.gets
+ check := func(age time.Duration, want int) {
+ t.Helper()
+ x.now = start.Add(age)
+ got, e := repo.Observe(t.Context(), obs)
+ if e != nil || got.Box != old.Box {
+ t.Errorf("age=%s lost verified observation: %+v err=%v", age, got, e)
+ }
+ // The event walk shares the refusal cache with edge observations.
+ if done, _, e := repo.Walk(t.Context()); e != nil || !done {
+ t.Fatalf("walk: done=%v err=%v", done, e)
+ }
+ w, e := x.r.LoadHAIdentityWalk(t.Context())
+ if e != nil || !repo.walkBlocks(w.LastBlocked, repo.Fixed["fixed"]) {
+ t.Fatalf("missing replacement considered unrelated: %+v %v", w, e)
+ }
+ if store.gets-base != want {
+ t.Fatalf("age=%s GETs=%d want=%d", age, store.gets-base, want)
+ }
+ }
+ for _, step := range []struct{ seconds, gets int }{{0, 1}, {29, 1}, {30, 2}, {89, 2}, {90, 3}, {209, 3}, {210, 4}, {509, 4}, {510, 5}} {
+ check(time.Duration(step.seconds)*time.Second, step.gets)
+ }
+ base = store.gets
+ for sec := 540; sec <= 4110; sec += 30 {
+ // Simulate ordinary callbacks for a full hour at the saturated delay.
+ x.now = start.Add(time.Duration(sec) * time.Second)
+ if _, err = repo.Observe(t.Context(), obs); err != nil {
+ t.Fatal(err)
+ }
+ want := (sec - 510) / 300
+ if store.gets-base != want {
+ t.Fatalf("saturated second=%d GETs=%d want=%d", sec, store.gets-base, want)
+ }
+ }
+ if store.gets-base != 12 {
+ t.Fatalf("saturated hour GETs=%d", store.gets-base)
+ }
+ _, replacement := signer.Record(t, "fixed", x.d.Box.Account, repo.Region, repo.Fixed["fixed"])
+ if _, err = x.store.Put(t.Context(), boxid.Key("fixed"), replacement, tag); err != nil {
+ t.Fatal(err)
+ }
+ x.now = x.now.Add(300 * time.Second)
+ got, err := repo.Observe(t.Context(), obs)
+ if err != nil || got.Box.InstanceID != repo.Fixed["fixed"] {
+ t.Fatalf("replacement not recovered: %+v %v", got, err)
+ }
+ if _, _, count := repo.pendingReplacement(); count != 0 {
+ t.Fatal("successful replacement retained a refusal")
+ }
+ retained, ok, err := repo.Resolve(t.Context(), old.Box.Ref, old.Box.InstanceID)
+ if err != nil || !ok || retained.Box != old.Box {
+ t.Fatalf("old binding lost: %+v %v", retained, err)
+ }
+}
+
+func TestDepartureReplacementSummaryPage(t *testing.T) {
+ for _, withHint := range []bool{false, true} {
+ t.Run(fmt.Sprint(withHint), func(t *testing.T) {
+ testDepartureReplacementSummaryPage(t, withHint)
+ })
+ }
+}
+
+func testDepartureReplacementSummaryPage(t *testing.T, withHint bool) {
+ x := newScanRig(t, 0)
+ repo := bindScanIdentity(t, x, "fixed", x.d.Box.InstanceID)
+ repo.Now = func() time.Time { return x.now }
+ repo.Fixed["fixed"] = "i-2123456789abcdef0"
+ x.c.cfg.Identities = repo
+ x.c.cfg.NewReader = nil
+ obs, ok, err := repo.Resolve(t.Context(), "fixed", "")
+ if err != nil || !ok {
+ t.Fatal(err)
+ }
+ obs.PublishedAt = time.Time{}
+ x.c.view.Peers = []hadeparture.BoxObservation{obs}
+ pages := 0
+ x.c.cfg.PageIdentity = func(_ context.Context, h registry.HAPendingTermination, code string) error {
+ pages++
+ if h.IID != repo.Fixed["fixed"] || !strings.Contains(code, "identity_replacement") {
+ t.Errorf("page=%+v code=%s", h, code)
+ }
+ return nil
+ }
+ if withHint {
+ h := registry.HAPendingTermination{Account: x.d.Box.Account, Region: repo.Region, IID: repo.Fixed["fixed"], ReceivedAt: x.now}
+ if err = x.r.ParkTermination(t.Context(), h, ""); err != nil {
+ t.Fatal(err)
+ }
+ }
+ start := x.now
+ for tick := 0; tick <= 240; tick++ {
+ x.now = start.Add(time.Duration(tick) * 30 * time.Second)
+ if err = x.c.step(t.Context()); err != nil {
+ t.Fatal(err)
+ }
+ if want := tick/120 + 1; pages != want {
+ t.Fatalf("tick=%d pages=%d want=%d", tick, pages, want)
+ }
+ }
+ hint := registry.HAPendingTermination{Account: x.d.Box.Account, Region: repo.Region, IID: repo.Fixed["fixed"], ReceivedAt: x.now}
+ if err = x.r.ParkTermination(t.Context(), hint, ""); err != nil {
+ t.Fatal(err)
+ }
+ if page, e := x.r.RetryPendingTermination(t.Context(), hint, x.now, "identity_unbound"); e != nil || page {
+ t.Fatalf("replacement page bypassed receiver summary cap: page=%v err=%v", page, e)
+ }
+}
+
+func TestDepartureInventoryWaitCadence(t *testing.T) {
+ x := newScanRig(t, 1)
+ x.inv.Complete = false
+ for range 8 {
+ if _, err := x.c.ScanPass(t.Context()); err != nil {
+ t.Fatal(err)
+ }
+ d, err := x.r.Departure(t.Context(), x.d.ID)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if d.RetryCount != 0 || d.NextAttempt.Sub(x.now) != 30*time.Second {
+ t.Fatalf("inventory escalated retry: count=%d wait=%s", d.RetryCount, d.NextAttempt.Sub(x.now))
+ }
+ x.now = x.now.Add(30 * time.Second)
+ }
+ x.inv.Complete = true
+ x.inv.SourceReadStartedAt, x.inv.WalkStartedAt = x.now, x.now
+ if progress, err := x.c.ScanPass(t.Context()); err != nil || !progress || x.imports != 1 {
+ t.Fatalf("fresh walk missed next tick: progress=%v imports=%d err=%v", progress, x.imports, err)
+ }
+}
+
+func TestDepartureReplacementRevisionBackoff(t *testing.T) {
+ for _, omitETag := range []bool{false, true} {
+ t.Run(fmt.Sprint(omitETag), func(t *testing.T) {
+ x := newScanRig(t, 0)
+ repo := bindScanIdentity(t, x, "fixed", x.d.Box.InstanceID)
+ repo.Now = func() time.Time { return x.now }
+ store := &departureIdentityReads{Store: x.store, omitETag: omitETag}
+ repo.Store = store
+ obs, _, err := repo.Resolve(t.Context(), "fixed", "")
+ if err != nil {
+ t.Fatal(err)
+ }
+ repo.Fixed["fixed"] = "i-2123456789abcdef0"
+ start := x.now
+ for _, seconds := range []int{0, 30, 90, 210} {
+ x.now = start.Add(time.Duration(seconds) * time.Second)
+ if _, err = repo.Observe(t.Context(), obs); err != nil {
+ t.Fatal(err)
+ }
+ }
+ _, tag, err := x.store.Get(t.Context(), boxid.Key("fixed"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err = x.store.Put(t.Context(), boxid.Key("fixed"), []byte(`{"v":1}`), tag); err != nil {
+ t.Fatal(err)
+ }
+ for _, step := range []struct{ seconds, gets int }{{510, 5}, {539, 5}, {540, 6}, {599, 6}, {600, 7}} {
+ x.now = start.Add(time.Duration(step.seconds) * time.Second)
+ got, err := repo.Observe(t.Context(), obs)
+ if err != nil || got.Box != obs.Box || store.gets != step.gets {
+ t.Fatalf("changed revision: second=%d GETs=%d want=%d observation=%+v err=%v", step.seconds, store.gets, step.gets, got, err)
+ }
+ }
+ })
+ }
+}
+
+func TestDepartureReplacementConcurrentCallbacks(t *testing.T) {
+ x := newScanRig(t, 0)
+ repo := bindScanIdentity(t, x, "fixed", x.d.Box.InstanceID)
+ repo.Now = func() time.Time { return x.now }
+ store := &departureIdentityReads{Store: x.store}
+ repo.Store = store
+ obs, _, err := repo.Resolve(t.Context(), "fixed", "")
+ if err != nil {
+ t.Fatal(err)
+ }
+ repo.Fixed["fixed"] = "i-2123456789abcdef0"
+ var wg sync.WaitGroup
+ for range 20 {
+ wg.Go(func() {
+ got, err := repo.Observe(t.Context(), obs)
+ if err != nil || got.Box != obs.Box {
+ t.Errorf("observation lost: %+v %v", got, err)
+ }
+ })
+ }
+ wg.Wait()
+ if store.gets != 1 {
+ t.Fatalf("concurrent replacement GETs=%d want=1", store.gets)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 3ddebdfba..3f76603f3 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -67,4 +67,4 @@ plan14-root-reads-domains-zone-credentials.tsv 3b6cd29b87d2728254936722ab45fdadc
plan14-root-reads-devbox-identity.tsv 66a5df05f18f70c3162ad05aa316c1e69c0f053d54f8b682262c266d6aa50772
plan14-root-reads-region-ha-home-placement.tsv b0304f75d2c5f1b9818d0f282b89c00c00b33e3f9bf974031687527c191fb161
plan14-root-reads-storedoor-stream-get.tsv 7e30dee4fb52370555ad173512d7f03782f0fbed725a8a6bf4f7e31f52c23668
-plan14-root-reads-region-ha-p1b3b-t.tsv 1f831656aac113ef4935e596fb0c1c89c6aea258e5f437b71d6e92fcad5589df
+plan14-root-reads-region-ha-p1b3b-t.tsv 35d8eca02cb401a78f3449dab8fb7675a591a22d9c84c4ea97a961f866030a2b
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv
index d9bf6f254..e67e82d46 100644
--- a/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv
+++ b/internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv
@@ -1,6 +1,6 @@
# Census overlay region-ha-p1b3b-t, written by census-propose (#369). census-ruling-region-ha-p1b3b-t, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md.
# 9 body, 7 sites, 16 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 85 new dispositions: 3 reads re-frozen at their disposition with the claim, 81 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other.
+# 87 new dispositions: 3 reads re-frozen at their disposition with the claim, 83 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other.
@legacy 76aeefcc3063f48d5e854bd81482a114455b6182ba9544399042a8cb07dbb79a internal/activator/activator.go Service.begin legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-edge-request-records;basis=gains a req *http.Request parameter and one edge.MarkWoke(req) call on the path that starts a wake, so the edge's request record can say which request woke the app; no read added;rev3=census-ruling-remote-instance-metrics;basis=the entries-map insertion goes through putEntryLocked (which also notes the route's tenant in memory for the metrics sampler); no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: before an entry is made, a resident inside its backoff answers errResidentBackoff, and a rootfs row must pass the locked admission (rootfsRefusalLocked) and then the backend's rootfs gates off a.mu (rootfsStartRefusal, within the request's wait bound) before Acquire, Restore or the live link; the gate key is recorded on the entry; adds refusals before the lease only;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Read serving lease health through servingError: stateless generations use local lifecycle/process supervision, while stateful generations keep the existing lease checks. No new I/O.;rev3=census-ruling-region-ha-p1b3b-t;basis=Carry background-duty provenance into a new singleflight entry; a visitor waiting on its deferred refusal retries with ordinary visitor authority. No read added. registry:Host@1146,registry:Host@1457,registry:Host@3513,registry:Host@3670,registry:Host@562,whole:Route@2011,whole:Route@2098,whole:Route@2179,whole:Route@2440,whole:Route@2550,whole:Route@2724,whole:Route@3522,whole:Route@3529 6dfb9ff708ed5fc62b5184ff03fb2df8e1e9fe5d84244b4c9979f3c27f3d7168
@legacy ee74269fe59778aca77cdc1c5ccca3fb0cb3322a7e8de49686c4966a86388d6c internal/activator/activator.go Service.sweepOnce legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; registry remains legacy; PROPOSED-plans-2-box-limits: the sweep also narrows an entry's idle window to its account's plan idle through the SetIdleFor hook (never lengthens it; always-on workers and held probe entries are untouched; the hibernate, inflight and held-for-tick guards are unchanged).;rev3=census-ruling-plans-4c-box-throttle;basis=after the worker max_run branch, stops a non-worker entry past the plans continuous-awake ceiling (maxRunFor, passed the row), busy or not, never mid-command (plans 4c). One more whole-row read: the row handed to the hook, as idleFor already is. This bypasses the inflight and held-for-tick protections the idle stop keeps, on purpose: escalated by Astra and ACCEPTED by Paul (census owner), 2026-10-25.;rev3=census-ruling-plans-4d-lapse;basis=stops a live entry the turned-off hook names (never mid-command, never a move's active probe), stands down an exited worker it names instead of restarting it (Astra finding 4), and skips such rows in the due loop and the always-on arm so they are not woken (plans 4d). Four more whole-row reads: the row handed to the hook (a.disabled), as idleFor and maxRunFor already are. Only stops or skips.;rev3=census-ruling-remote-instance-metrics;basis=its two entries-map insertions go through putEntryLocked (which also notes the route's tenant in memory for the metrics sampler); no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more call at the top, a.retryOwedMarkers() (harelease.go), which starts at most one background lease.RetryPending pass over owed region HA release markers, off a.mu; the due query, idle, max-run and lapse logic are unchanged; the same 38 sites, no read added; merge of origin/main d7ae1d76: main's change is kept as main has it (census-ruling-remote-instance-metrics: its two entries-map insertions go through putEntryLocked); this branch's change is the same as above; read sites the same 38, offsets moved;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: a resident (Route.Resident) is never stopped for idleness or by the continuous-awake ceiling; the due-wake check is left on Hibernate (comment); stops less, not more;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: an entry whose host has a release record open (the in-memory a.releaseOps[e.host]) is not stopped by its plan's turn-off, by idleness or by the continuous-awake ceiling until the record goes; one more sweep pass, reapReleaseOpsLocked, retries an unproven release's stop (through finishPendingStops); the same 39 read sites, no read added; stops less, not more;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (PF-18): the four checks that left an entry with a run attached alone (e.cmd == nil) now read holdsAttachedLocked(e), a run or a session attached, so a session holds the idle sleep, the plans awake ceiling, the plans turned-off stop and the turned-off worker's stand-down as a run does; in-memory under a.mu; only keeps an entry awake longer; no read added, read sites unchanged;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Read serving lease health through servingError: stateless generations use local lifecycle/process supervision, while stateful generations keep the existing lease checks. No new I/O.;rev3=census-ruling-region-ha-p1b3b-t;basis=Tag due entries as background duties; the wake evaluates the gate off a.mu before acquire or token preparation. No read added. registry:Hibernate@10805,registry:Hibernate@14563,registry:Hibernate@23821,registry:Hibernate@5680,registry:Hibernate@7879,registry:Host@23890,registry:Host@23948,registry:Host@24415,registry:Host@24508,registry:Host@25260,registry:Host@25361,registry:Host@26425,registry:Host@26712,registry:Host@26768,registry:NextDue@25198,registry:Status@23837,whole:Route@10807,whole:Route@11666,whole:Route@14565,whole:Route@16498,whole:Route@18208,whole:Route@18398,whole:Route@18691,whole:Route@18863,whole:Route@19010,whole:Route@23221,whole:Route@23997,whole:Route@24912,whole:Route@25269,whole:Route@25276,whole:Route@26240,whole:Route@26541,whole:Route@26745,whole:Route@5491,whole:Route@5682,whole:Route@7712,whole:Route@7881,whole:Route@8074,whole:Route@8537 bb62b361b6dff7e47fa68665994a5b73860a499107a67c32af002c608bc936fd
@legacy ebed63ce52f359e7554f0fa5c285656548b89ff2aa30032636c28ec98d37fe65 internal/edge/wakeplacement.go homeMap.wakeSnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Project cold-wake candidates from one immutable cached edges fold using the local route's canonical host, release.RouteAccount and app. Reads only in-memory route fields, cached publication additions and mirrored signing keys; no filesystem, registry, store or root authority added. Reject malformed placement evidence independently of the unchanged holder decoder; preserve explicit local safety denials even when stale.;rev3=census-ruling-region-ha-home-placement;basis=none: accepts the omitted/empty home placement, refuses explicit null; same in-memory fold reads, no new read;rev3=census-ruling-region-ha-p1b3b-t;basis=Expose fresh compatible peer membership separately from per-host eligible serving entries for suppression invalidation. Existing home/pool/scope filtering remains; no new reads. registry:App@2370,registry:Host@1412,whole:Route@1443 35b52d47574c903f65776ba3c476ab38457c93caf027279263774e084023c03d
@@ -30,15 +30,16 @@
@legacy 4598c4202fca743b3c7e08038176ebef0aed7794a56574ae0978094952752e14 internal/activator/haduties.go dutyRefusal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=DutyState alias makes the existing holder and deadline reads visible to the registry census; refusal behavior unchanged. registry:HolderIID@306,registry:HolderRef@223,registry:HolderRef@245,registry:HolderRef@276,registry:NotBefore@167 7d8646a06d8d37ce9e8c736b1fb1e59b8046ba245e1957e0301791fd9032910d
@legacy 9d74212f181039ff692d2e83653397bb7951d9c75b330b3d10e7df9f50fb2e67 internal/activator/hawake.go ExecBackend.TerminationLifetime legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3 fix r1: Read the host route from the existing registry and reuse isHA record/lifetime-index classification. Missing, legacy or lifetime-free hosts refuse. Inventory completeness is not takeover authority. whole:Route@242,whole:Route@329 4f9acf54553193732df400d99d23291f3be27cd09007ca3980075d3da05535b4
@legacy 780da2b6b37d2fc6e2baa16c11257cb492226e4e553679ecc244186fb90d70d4 internal/edge/wakeplacement.go Edge.DutySnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the route to the existing cached home projection; no store reads, network reads or new publication. whole:Route@108 fa66b0bb586cb9a3214d818fbe40181f3ca7d5655f5af4ac259377cf4d5c133d
-@legacy ae385c470aa0266923dabb2163f1c94ef3fcb505573b387fb92a359a83e0d38c internal/host/hadeparture_identity.go departureIdentities.Observe legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads. registry:Account@1042,registry:Digest@1074,registry:Digest@952,registry:IID@1019,registry:IID@559,registry:IID@907,registry:Observation@1084,registry:Raw@823,registry:Ref@848,whole:HABoxIdentity@1144,whole:HABoxIdentity@712 5e4ba3e5a6a5c1119616eebf001ad4554d5024bb6c0d9e9495e67ea5fc372331
+@legacy 20d6032d6c12556542d7e81a4f2a1a789cc6dd568cc56e871da67175bd8fdc11 internal/host/hadeparture_identity.go departureIdentities.Observe legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads. B4 fix r3: A failed configured replacement retains and refreshes only the current verified incarnation observation. Share exact-key reload refusals with the event walk; cached bindings still pass signature/digest checks and the new configured iid gains nothing until verification succeeds. registry:Account@1247,registry:Digest@1157,registry:Digest@1279,registry:IID@1112,registry:IID@1224,registry:IID@558,registry:Observation@1289,registry:Raw@1028,registry:Ref@1053,whole:HABoxIdentity@1349,whole:HABoxIdentity@641,whole:HABoxIdentity@645,whole:HABoxIdentity@823 be36a7b26c6d365eb254c6c0739079ab85304fff848a5463c15ab90427c24a85
@legacy bc853eb0849bd63e09b7e0045561e7b227696504367a5cd139b855facfe1850f internal/host/hadeparture_identity.go departureIdentities.Proof legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. registry:Raw@489 b7b9c4ea43369ac83c0aefd9ed415f556b98a9bcc3e08f15eaf179cd0f9235f2
@legacy 80cc150e254adf415691fabd092007d8c00d6b7d800e7ad310bd552d62c3ba3a internal/host/hadeparture_identity.go departureIdentities.Resolve legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. registry:Account@556,registry:Digest@393,registry:Digest@588,registry:IID@348,registry:IID@533,registry:Observation@480,registry:Raw@279,registry:Ref@304,registry:Ref@507,registry:Region@322,registry:Region@661 96fd0a43aa8f8b142b57e16e8383321b5d0dc42291c296228b57542cc67da194
-@legacy 89645e77f80ae2fe0e3214c1bb2beb82789d8b2945c3d4b5e538f6664974a2a9 internal/host/hadeparture_identity.go departureIdentities.Walk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Read and persist per-ref/iid refusal candidates rather than a global record-validation failure. Unsigned fields only restrict unrelated classification; they never bind identity. Incomplete listing and unidentifiable fixed records keep affected unknown iids pending; known identities continue. Existing page and GET bounds remain. B4 fix r2: A known ref with a changed independent configured iid joins the bounded verification GET page; cache hits remain read-free. Retain the 32-record GET bound and blocked-candidate refusal behavior. file:Walk@30,registry:Blocked@1088,registry:Blocked@1107,registry:Blocked@1275,registry:Blocked@1294,registry:Blocked@1613,registry:Blocked@1632,registry:Blocked@1986,registry:Blocked@2005,registry:Blocked@2163,registry:Blocked@2182,registry:Blocked@2414,registry:Blocked@860,registry:Blocked@879,registry:Cursor@2449,registry:Cursor@483,registry:Cursor@769,registry:Failed@2328,registry:Keys@2250,registry:Keys@2287,registry:Keys@2460,registry:Keys@2471,registry:Keys@2484,registry:Keys@425,registry:Keys@632,registry:Keys@695,registry:Keys@727,registry:Offset@2234,registry:Offset@2499,registry:Offset@648,registry:Offset@680,registry:Offset@734,registry:Offset@746,registry:StartedAt@186,registry:StartedAt@211,registry:StartedAt@2344,registry:StartedAt@297,registry:StartedAt@380,registry:StartedAt@532,registry:StartedAt@592,whole:HAIdentityWalk@2373,whole:HAIdentityWalk@2560 77d155d4ff35378398d88467cda57c65a73387f1f3ded49a40df566f363d5625
+@legacy 19b206f93031b78e918986057c53c2980542cc5ca4aa385cef67f00589ce0c8b internal/host/hadeparture_identity.go departureIdentities.Walk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Read and persist per-ref/iid refusal candidates rather than a global record-validation failure. Unsigned fields only restrict unrelated classification; they never bind identity. Incomplete listing and unidentifiable fixed records keep affected unknown iids pending; known identities continue. Existing page and GET bounds remain. B4 fix r2: A known ref with a changed independent configured iid joins the bounded verification GET page; cache hits remain read-free. Retain the 32-record GET bound and blocked-candidate refusal behavior. B4 fix r3: Share the per-ref/configured-iid/record-revision refusal cache with Observe. Cached failures still block the configured replacement iid and any bounded parsed candidate; no extra GET while the retry deadline is pending. file:Walk@30,registry:Blocked@1088,registry:Blocked@1107,registry:Blocked@1275,registry:Blocked@1294,registry:Blocked@1704,registry:Blocked@1723,registry:Blocked@2077,registry:Blocked@2096,registry:Blocked@2254,registry:Blocked@2273,registry:Blocked@2505,registry:Blocked@860,registry:Blocked@879,registry:Cursor@2540,registry:Cursor@483,registry:Cursor@769,registry:Failed@2419,registry:Keys@2341,registry:Keys@2378,registry:Keys@2551,registry:Keys@2562,registry:Keys@2575,registry:Keys@425,registry:Keys@632,registry:Keys@695,registry:Keys@727,registry:Offset@2325,registry:Offset@2590,registry:Offset@648,registry:Offset@680,registry:Offset@734,registry:Offset@746,registry:StartedAt@186,registry:StartedAt@211,registry:StartedAt@2435,registry:StartedAt@297,registry:StartedAt@380,registry:StartedAt@532,registry:StartedAt@592,whole:HAIdentityWalk@2464,whole:HAIdentityWalk@2651 6a71317efe383c76ea6fe5f61186eb458098a90b0e32ed3f8ff64da0f8c4c87b
+@legacy 614953e83484bb6d969f1092c096b4848bf0f565c0cc28d4d302c8488c4e463d internal/host/hadeparture_identity.go departureIdentities.loadReplacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r3: Read the current verified binding and only its validated control/boxes ref key, with a five-second request context. Serialize replacement requests and cache refusals by ref, configured iid and ETag (digest fallback), retrying at 30/60/120/300 seconds. A changed observed revision resets the delay. Successful verification uses the unchanged account/region/independent-iid/history guards; failures cannot bind a replacement. No tenant-named path or new root input. registry:IID@377,registry:Raw@423,whole:HABoxIdentity@1040,whole:HABoxIdentity@1643,whole:HABoxIdentity@267,whole:HABoxIdentity@420,whole:HABoxIdentity@544,whole:HABoxIdentity@939 f22a00143aa12bf5595149a6b502d469244fba1ca852d36b9e7c670494b44e28
@legacy 48bddea185973477aa34117c816aa06af47cd5b0e763efd0ba96e1d13e3621e1 internal/host/hadeparture_identity.go departureIdentities.verify legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B4 fix r2: A different iid and digest may append an incarnation only after AWS signature, expected deployment account/region and independent fixed or deterministic group binding checks. Read current and historical iid bindings from the same registry; refuse duplicate iid, same-iid digest rotation and historical replay. No root path or execution authority is introduced. registry:Digest@1248,registry:Digest@1262,registry:Digest@819,registry:IID@502,registry:IID@856,registry:Observation@1275,registry:Observation@1291,whole:HABoxIdentity@1034,whole:HABoxIdentity@1351,whole:HABoxIdentity@1377,whole:HABoxIdentity@1395,whole:HABoxIdentity@421,whole:HABoxIdentity@646,whole:HABoxIdentity@777,whole:HABoxIdentity@899 19b608c0c2ce5ff8f74c0d79887ed1f8abc616044d34759f10773a0b0bbd1a61
@legacy 12f0f89af546263dd78f7ce60118308fd43ef103dfbbd9d1e255837d33f7b2da internal/host/hadepartures.go Controller.ackDeparture legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Inspect only local durable completion before acknowledging the current in-memory queue receipt. Never serialize a reusable receipt or use an incomplete journal row as completion. registry:Phase@177 4f864b0711b24676b5c078fb1f16835809b56b7c372b84ce8328a10fc63936ed
@legacy 42dd5737593c53a854792b143e78799af4bb4e475ef7458cc151190f5305a9e8 internal/host/hadepartures.go Controller.enqueue legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. whole:HADeparture@1398 2abe74f070cc47e528a56696aaa3fa5a85a80b6f4bbb4cf564b4d23d7d0a578d
@legacy 146ab004d276b0cbeec8418587670cb84b2d0bb406d207ec1512151ea6a70ba1 internal/host/hadepartures.go Controller.record legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Inspect only local durable completion before acknowledging the current in-memory queue receipt. Never serialize a reusable receipt or use an incomplete journal row as completion. registry:Phase@726,whole:HADeparture@781 dacb56df365647ec11f3fcbf00d13e8b8d94f9c8eb70ff6092a32c31ffb5d63d
-@legacy b3afe0608be140b6f94a03f45d86eb4d0ea34a2b1888109283223feba99c4e18 internal/host/hadepartures.go Controller.step legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. B3 fix r1: Describe before proof access on suspicion paths. Normalize validated legacy inbox entries in atomic transactions, process bounded per-iid pending pages, and persist hourly escalation. Delete unrelated rows only after complete applicable walks and guarded received timestamps. Acquire/completion authority unchanged. B4: Count unresolved durable hints for the globally throttled summary and call the bounded scanner outside the fold. Acknowledge unrelated hints only after complete applicable discovery; complete departure acknowledgment reads durable state. file:Walk@2642,registry:Body@1904,registry:IID@2479,registry:IID@2896,registry:IID@3249,registry:IID@3282,registry:IID@3748,registry:Key@2006,registry:Key@2242,registry:LastBlocked@2797,registry:ReceivedAt@2225,registry:ReceivedAt@3180,whole:HADeparture@4100,whole:HADeparture@5068,whole:HADeparture@5391,whole:HAPendingTermination@2420,whole:HAPendingTermination@2837,whole:HAPendingTermination@3091,whole:HAPendingTermination@3374,whole:HAPendingTermination@3480,whole:HAPendingTermination@3824,whole:HATerminationInbox@1864 4491ef42cf9ea18b01d9ee07502611ccc02e1caacfeb4f01e29b9820aa14a467
+@legacy 7df673ca499e9f18e23e632db033bbf4ff1f86b8f06865826e4fe25372b6d56b internal/host/hadepartures.go Controller.step legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. B3 fix r1: Describe before proof access on suspicion paths. Normalize validated legacy inbox entries in atomic transactions, process bounded per-iid pending pages, and persist hourly escalation. Delete unrelated rows only after complete applicable walks and guarded received timestamps. Acquire/completion authority unchanged. B4: Count unresolved durable hints for the globally throttled summary and call the bounded scanner outside the fold. Acknowledge unrelated hints only after complete applicable discovery; complete departure acknowledgment reads durable state. B4 fix r3: Include refused fixed-box replacements in the existing structured receiver summary, sharing its persisted hourly page claim with pending hints. Read only local refusal state and registry page state; no additional cloud request or completion authority. file:Walk@2642,registry:Body@1904,registry:IID@2479,registry:IID@2896,registry:IID@3249,registry:IID@3282,registry:IID@3963,registry:Key@2006,registry:Key@2242,registry:LastBlocked@2797,registry:ReceivedAt@2225,registry:ReceivedAt@3180,whole:HADeparture@4905,whole:HADeparture@5873,whole:HADeparture@6196,whole:HAPendingTermination@2420,whole:HAPendingTermination@2837,whole:HAPendingTermination@3091,whole:HAPendingTermination@3374,whole:HAPendingTermination@3480,whole:HAPendingTermination@4039,whole:HAPendingTermination@4629,whole:HATerminationInbox@1864 44e727ba7a5f28238e16f971f4cd6440294889159ee0ff80358d4d7099c62f8c
@legacy 3521cfbe30493cf4e633e5a040d624b4b448368312d1e9cefe9ac87f6f57aab5 internal/host/hadepartures_scan.go Controller.ScanPass legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read authoritative pre-filter inventory, exact canonical lock revisions through one page reader, local scan checkpoints and adoption receipts. Persist source identity before the sole AdoptHost importer; validate later successor identity/lifetime/generation and require a fresh full zero-match rescan. Unknown state, unsupported hosts and missing previously matched locks refuse completion. No process launch or tenancy expansion. Preserve checkpoints across walks of identical record bytes; persist the current inventory generation separately and recheck source freshness/completeness before every page and deletion. Placement changes cannot filter the lock census. Fix r1/P15: classify legacy and unrelated locks as zero only before any D match; keep strict successor checks for previously matched hosts and hold malformed HA identities. Compare read start to expiry. Resume authority-complete deletion without rescanning unchanged inventory; persist evidence and scan errors with bounded retry. B4 fix r2: Inventory-only waits request the existing hourly page only after observed evidence is older than ChangeIndexBackstop plus 10 percent. Freshness and completion gates are unchanged; no new read. registry:Cursor@1902,registry:Cursor@2568,registry:Cursor@2651,registry:Cursor@2663,registry:Cursor@6382,registry:Cursor@6488,registry:Cursor@6839,registry:Generation@1843,registry:Generation@1874,registry:Generation@6362,registry:Generation@6520,registry:Hosts@1958,registry:Hosts@1978,registry:Hosts@2699,registry:Hosts@2767,registry:Hosts@4806,registry:Hosts@5193,registry:Hosts@5486,registry:Hosts@6082,registry:InventoryGeneration@1776,registry:Lifetime@2728,registry:NotBefore@3077,registry:NotBefore@3118,registry:NotBefore@4774,registry:NotBefore@5163,registry:NotBefore@5450,registry:Observed@4317,registry:Observed@4471,registry:Observed@5046,registry:Observed@5080,registry:Phase@1366,registry:Phase@1819,registry:Phase@2036,registry:Phase@4031,registry:Phase@552,registry:Phase@607,registry:Phase@647,registry:RecordDigest@3039,registry:RecordDigest@5103,registry:Rescan@1917,registry:Rescan@3019,registry:Rescan@4200,registry:Rescan@5220,registry:Rescan@6397,registry:Rescan@6554,registry:Rescan@6807,registry:Result@4744,registry:Result@5138,registry:Result@6048,registry:Unresolved@1936,registry:Unresolved@2948,registry:Unresolved@3138,registry:Unresolved@3356,registry:Unresolved@3420,registry:Unresolved@3618,registry:Unresolved@3978,registry:Unresolved@4239,registry:Unresolved@4388,registry:Unresolved@4506,registry:Unresolved@4582,registry:Unresolved@4694,registry:Unresolved@5234,registry:Unresolved@5313,registry:Unresolved@5511,registry:Unresolved@5811,registry:Unresolved@5934,registry:Unresolved@6416,registry:Unresolved@6446,registry:Unresolved@6670,registry:Unresolved@6818,registry:Unresolved@6855,registry:Version@5770,whole:HADeparture@1029,whole:HADeparture@1148,whole:HADeparture@1333,whole:HADeparture@1622,whole:HADeparture@2129,whole:HADeparture@2326,whole:HADeparture@2482,whole:HADeparture@268,whole:HADeparture@310,whole:HADeparture@4314,whole:HADeparture@5738,whole:HADeparture@5877,whole:HADeparture@6185,whole:HADeparture@7006,whole:HADeparture@7142,whole:HADeparture@832,whole:HADepartureHostScan@1960,whole:HADepartureHostScan@1980,whole:HADepartureHostScan@2701,whole:HADepartureHostScan@2769,whole:HADepartureHostScan@2803,whole:HADepartureHostScan@4808,whole:HADepartureHostScan@4824,whole:HADepartureHostScan@4865,whole:HADepartureHostScan@5195,whole:HADepartureHostScan@5211,whole:HADepartureHostScan@5488,whole:HADepartureHostScan@5504,whole:HADepartureHostScan@6084,whole:HADepartureHostScan@6100,whole:HADepartureScan@5675,whole:HADepartureScan@6940 3f002a1bc4fe6ca3b820034a40bae05e912aa993cf740101fcf3afbd7b7dd97d
@legacy 9a5b913a4744b9e661e553cbc3c485fd7ab60d6a9d4c7d1ddac34912a69b530f internal/host/hadepartures_scan.go Controller.complete legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read the durable departure/scan and current inventory, then conditionally delete only the retained exact edges key/revision. Reread uncertain results and refuse replacement identities. Persist deletion and acknowledged index phases before complete; queue receipts stay in memory and only complete rows acknowledge. Fresh process evidence is required before authority checkpoint reuse. Fix r1/P15: ignore the old scan-level ETag override and delete only the original departure ETag. Exact-key readback retries the same tag; a changed tag is never deleted and advances only with a different verified iid under the same ref/account/scope, otherwise holds and pages. Persist permission fault episodes; route completion faults through bounded retry. No new filesystem or executable input. registry:Cursor@1644,registry:DeleteUncertain@1796,registry:DeleteUncertain@3108,registry:DeleteUncertain@3493,registry:Generation@1626,registry:Generation@1680,registry:Hosts@4250,registry:InventoryGeneration@1731,registry:PermissionAlerted@2085,registry:PermissionAlerted@2863,registry:PermissionAlerted@3637,registry:PermissionAlerted@4041,registry:PermissionAlerted@740,registry:PermissionAlerted@782,registry:Phase@1437,registry:Phase@161,registry:Phase@2987,registry:Phase@3755,registry:Phase@579,registry:Phase@849,registry:Phase@866,registry:Phase@901,registry:Phase@941,registry:Rescan@1660,registry:Version@564,whole:HADeparture@214,whole:HADeparture@341,whole:HADeparture@4299,whole:HADepartureHostScan@4252,whole:HADepartureScan@542 f0735c15b9423b47776df328fec397ea56fb508af76d1acf7cb7535780ac03fc
@legacy 58dd9fcbd63293ff8212de74247fb4b74a6fb63e5a30c8da804b5ba50f0c4acc internal/host/hadepartures_scan.go Controller.retryScan legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read only the bound departure to persist bounded retry timing and the existing hourly per-departure page claim. No completion authority. Fix r1/P15: bound detached retry bookkeeping to five seconds so cancellation still records backoff/page. Permission episodes use only the structured ha_departure_permission_fault code and key, never wake-state prose. whole:HADeparture@794 34a55a0cdebf92cd064addb96a78638abd0c709a73270f6840cac56384b70df7
@@ -64,6 +65,7 @@
@legacy 3dbb660cdf622bd3e77fd575d72f86dd62efe2482df859fbdffddf2c87e5e838 internal/registry/ha_identity_history.go Registry.migrateHAIdentityHistory legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r2: Inspect the existing SQLite schema and migrate ref-keyed identity rows atomically to (ref,digest), preserving exact binding bodies and observations. iid remains globally unique. Uses only the existing registry database; no filesystem path or executable input. file:QueryRow@80,file:QueryRowContext@382,registry:sql@80 f0fa9410de61dd34fe1dee251eb19b328ea8854933b0ad63113a419ba564f762
@legacy e53cdd7851442838ca42b08d3103f30aa48b8b2705310703a93bb60f2dfaabe6 internal/registry/ha_identity_history.go Registry.saveHAIdentity legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r2: Read and append identity history in the existing registry. Exact binding bytes/account/region/iid/digest cannot mutate, and duplicate iid across incarnations or refs refuses. Only the latest incarnation observation may update. Host verification remains the caller prerequisite; this trusted registry primitive grants no takeover or completion authority. file:QueryRowContext@1335,file:QueryRowContext@546,registry:Account@114,registry:Account@1625,registry:Account@824,registry:Account@839,registry:Digest@1238,registry:Digest@1809,registry:Digest@194,registry:Digest@640,registry:Digest@878,registry:Digest@892,registry:IID@1819,registry:IID@804,registry:IID@815,registry:IID@99,registry:Observation@370,registry:Raw@155,registry:Raw@179,registry:Raw@238,registry:Raw@917,registry:Raw@926,registry:Ref@1231,registry:Ref@1248,registry:Ref@1493,registry:Ref@1802,registry:Ref@633,registry:Ref@784,registry:Ref@795,registry:Ref@84,registry:Region@133,registry:Region@1648,registry:Region@852,registry:Region@866,whole:HABoxIdentity@300,whole:HABoxIdentity@742 68c85cb6bb6644baca7e6dc2ada706a2cf7ce7b475f67822a5a1211377e793ce
@legacy 53941fe404776b4e1b73a0bdedcbffdba6de5b832ec8a311faf19f85337abc46 internal/registry/ha_journal.go Registry.ClaimHAConfirmation legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. registry:Found@195 8fbb36f6bf58466f02bd8e27a144325bbe594129c6cdb8861881e44275ea1288
+@legacy 994198bc4b1ecb829ca097253db968cb04d69d4907363b5c7440b1ca36871f6c internal/registry/ha_journal.go Registry.ClaimHAIdentityPage legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r3: Invoke the existing registry journal protocol to claim the existing receiver-wide hourly identity page. Only local alert scheduling changes; no root path, completion or start authority. registry:Found@175 9b8132cd02a152f558be95b11d15762a2cc7332074e798c01a1ac4c47d6a78aa
@legacy 5ed422a7402dc91644baf4666747cb3fb0bca209fcaa4c98af84620e7d566dd1 internal/registry/ha_journal.go Registry.EnrollDeparture legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. whole:HADeparture@152,whole:HADeparture@163 4869e4e5098ed3545f629e4b1da9f7a17dd375cf49f02c6c5c772318525fb7db
@legacy deb1c2a534ed26751f8a54fcb8fc5f2b10cf0dfe3fbf270b6cb1f19f22350185 internal/registry/ha_journal.go Registry.HAIdentity legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. registry:Found@204,registry:Identity@190,whole:HABoxIdentity@194 5528b0c1503b15069b41afe300402c56268a4f0ef33cc893e5d3826c1c4108a0
@legacy f16823860a6ccd4a035ef80f424b7f817b62d7eb169627d94ee02c5d3eb24aea internal/registry/ha_journal.go Registry.LoadHAIdentityWalk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. file:Walk@153,registry:Walk@153,whole:HAIdentityWalk@157 d69d9bc8c006eeee4405cae920cad99ae801784edcdc7a0a39cab63323dc9ea2
@@ -77,7 +79,7 @@
@legacy 5f4efd3eadaa2db04fae73a550cf053d62841d01540e4c2e903950017a28e90e internal/registry/ha_journal.go Registry.SaveHAIdentity legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. whole:HABoxIdentity@146,whole:HABoxIdentity@156 0830d1f3450aa0bcb0f68ba3f9ced1c37312505564e4b06069bf9484770992cf
@legacy bbeb1a01bd37abc79e377553e01a274362a922ea6d6c8d3150685e8440d34d12 internal/registry/ha_journal.go Registry.SaveHAIdentityWalk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. file:Walk@147,whole:HAIdentityWalk@147,whole:HAIdentityWalk@153 3964525d39325734e0eefd6130022314f8260316ceacbf2b3282b39fb1565e41
@legacy 16b76c533e43012710a953e182c13bd363eafad69830325c719e0c719e8b1b98 internal/registry/ha_journal.go Registry.TerminationInbox legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. registry:Inbox@205,whole:HATerminationInbox@209 5a2aca28aae1664ef5ff06613df4b22f87bb4272358e89a29df5f41e26688802
-@legacy df82d578badffe3e898470e9c60e8026b426a1429bafc05f672972422afc266d internal/registry/ha_journal.go Registry.haJournal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add atomic compact hint enrollment, bounded due reads, received-time guarded removal and hourly page claims. Retain old inbox APIs for migration, no queue receipt or authority bit. All reads/writes stay in the existing SQLite registry with remote parity. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Delegate existing identity RPC operations to historical storage helpers. Remote interface unchanged; historical ref/iid lookups retain the old binding and ref-only lookups return the latest incarnation. file:QueryContext@1372,file:QueryContext@6108,file:QueryContext@7942,file:QueryRowContext@10672,file:QueryRowContext@289,file:QueryRowContext@3529,file:QueryRowContext@4307,file:QueryRowContext@5385,file:QueryRowContext@5585,file:QueryRowContext@8812,file:Walk@10308,file:Walk@10331,file:Walk@10352,file:Walk@10372,file:Walk@10445,file:Walk@10868,registry:Account@1762,registry:Account@2187,registry:Account@2555,registry:Account@3297,registry:Account@516,registry:Account@996,registry:At@1589,registry:At@2548,registry:At@2595,registry:At@2936,registry:At@2955,registry:At@3262,registry:At@3763,registry:At@3780,registry:At@3857,registry:At@4519,registry:At@4903,registry:At@5120,registry:At@5930,registry:At@5949,registry:At@6298,registry:At@8129,registry:At@9233,registry:At@9736,registry:At@9761,registry:Body@5082,registry:Body@5241,registry:Body@5910,registry:Body@6491,registry:Code@10062,registry:Code@3289,registry:Code@6956,registry:Code@9024,registry:Code@9052,registry:Code@9072,registry:Count@370,registry:Departure@6994,registry:Departures@8589,registry:Departures@8613,registry:Found@10228,registry:Found@2723,registry:Found@3090,registry:Found@4999,registry:Found@9897,registry:HAJournal@225,registry:Hint@2052,registry:Hint@2269,registry:Hint@500,registry:Hints@1968,registry:Hints@1987,registry:ID@10070,registry:ID@10267,registry:ID@3620,registry:ID@4078,registry:ID@4404,registry:ID@4885,registry:ID@5044,registry:ID@5062,registry:ID@5230,registry:ID@5904,registry:ID@8881,registry:ID@9525,registry:ID@9743,registry:IID@1017,registry:IID@1785,registry:IID@2208,registry:IID@2576,registry:IID@3318,registry:IID@584,registry:IID@603,registry:Identity@10182,registry:Identity@10214,registry:Inbox@6642,registry:Inbox@6661,registry:InventoryGeneration@3864,registry:Key@10273,registry:Key@1116,registry:Key@1211,registry:Key@6465,registry:Key@6798,registry:Key@6964,registry:Key@7684,registry:Key@7779,registry:Keys@10308,registry:Keys@10372,registry:LastError@1812,registry:LastError@6514,registry:LastError@7220,registry:LastError@8496,registry:LastPage@1934,registry:LastPage@7193,registry:LastPage@8555,registry:Limit@1297,registry:Limit@1312,registry:Limit@1596,registry:Limit@6033,registry:Limit@6048,registry:Limit@6305,registry:Limit@7867,registry:Limit@7882,registry:Limit@8136,registry:MessageID@6475,registry:Next@10053,registry:Next@6947,registry:Next@9289,registry:Next@9304,registry:NextAttempt@1897,registry:NextAttempt@6603,registry:NextAttempt@7239,registry:NextAttempt@7630,registry:NextAttempt@8518,registry:Offset@10331,registry:Offset@10352,registry:Op@254,registry:Page@9575,registry:Phase@3893,registry:Phase@7171,registry:Phase@8477,registry:ProofDigest@7070,registry:ProofKey@7050,registry:ReceivedAt@1036,registry:ReceivedAt@1063,registry:ReceivedAt@1863,registry:ReceivedAt@2227,registry:ReceivedAt@617,registry:ReceivedAt@6567,registry:Region@1007,registry:Region@1774,registry:Region@2198,registry:Region@2566,registry:Region@3308,registry:Region@540,registry:Region@562,registry:RetryCount@9098,registry:RetryCount@9252,registry:RetryCount@9328,registry:RetryCount@9347,registry:Walk@10308,registry:Walk@10331,registry:Walk@10352,registry:Walk@10372,registry:Walk@10445,registry:Walk@10868,registry:remote@111,registry:remote@142,registry:sql@10501,registry:sql@10672,registry:sql@1372,registry:sql@2070,registry:sql@289,registry:sql@6108,registry:sql@6727,registry:sql@6837,registry:sql@7942,whole:HABoxIdentity@10184,whole:HABoxIdentity@10218,whole:HADeparture@3722,whole:HADeparture@3938,whole:HADeparture@6996,whole:HADeparture@7294,whole:HADeparture@8436,whole:HADeparture@8593,whole:HADeparture@8617,whole:HADeparture@8629,whole:HADeparture@8983,whole:HADeparture@9397,whole:HAIdentityWalk@10310,whole:HAIdentityWalk@10333,whole:HAIdentityWalk@10354,whole:HAIdentityWalk@10374,whole:HAIdentityWalk@10447,whole:HAIdentityWalk@10872,whole:HAPendingTermination@1972,whole:HAPendingTermination@1991,whole:HAPendingTermination@1998,whole:HAPendingTermination@2054,whole:HAPendingTermination@2271,whole:HAPendingTermination@502,whole:HATerminationInbox@6646,whole:HATerminationInbox@6665,whole:HATerminationInbox@6672,whole:haJournalRequest@196,whole:haJournalRequest@207,whole:haJournalRequest@476,whole:haJournalResponse@10098,whole:haJournalResponse@10397,whole:haJournalResponse@10479,whole:haJournalResponse@10806,whole:haJournalResponse@10901,whole:haJournalResponse@10930,whole:haJournalResponse@1100,whole:haJournalResponse@1241,whole:haJournalResponse@1337,whole:haJournalResponse@1631,whole:haJournalResponse@1848,whole:haJournalResponse@230,whole:haJournalResponse@2348,whole:haJournalResponse@2644,whole:haJournalResponse@2710,whole:haJournalResponse@3006,whole:haJournalResponse@3075,whole:haJournalResponse@3347,whole:haJournalResponse@3469,whole:haJournalResponse@3660,whole:haJournalResponse@3747,whole:haJournalResponse@3818,whole:haJournalResponse@390,whole:haJournalResponse@3967,whole:haJournalResponse@4106,whole:haJournalResponse@4232,whole:haJournalResponse@4491,whole:haJournalResponse@4544,whole:haJournalResponse@4966,whole:haJournalResponse@5146,whole:haJournalResponse@5326,whole:haJournalResponse@5507,whole:haJournalResponse@5547,whole:haJournalResponse@5689,whole:haJournalResponse@5751,whole:haJournalResponse@5982,whole:haJournalResponse@6073,whole:haJournalResponse@6340,whole:haJournalResponse@651,whole:haJournalResponse@6552,whole:haJournalResponse@7147,whole:haJournalResponse@7323,whole:haJournalResponse@7406,whole:haJournalResponse@745,whole:haJournalResponse@7668,whole:haJournalResponse@7809,whole:haJournalResponse@7907,whole:haJournalResponse@8171,whole:haJournalResponse@8392,whole:haJournalResponse@8462,whole:haJournalResponse@8752,whole:haJournalResponse@8921,whole:haJournalResponse@9008,whole:haJournalResponse@9428,whole:haJournalResponse@9554,whole:haJournalResponse@9812,whole:haJournalResponse@9882,whole:remoteClient@113,whole:remoteClient@144 a0246d2808d3642bd63822c6cb8f4574ecb65307e792ee4eea497b9917e4aa2a
+@legacy b7d510a5b4d5b7e9fe9e380bc789fca8bec32c684e7ec83c76b94f82f29082f1 internal/registry/ha_journal.go Registry.haJournal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add atomic compact hint enrollment, bounded due reads, received-time guarded removal and hourly page claims. Retain old inbox APIs for migration, no queue receipt or authority bit. All reads/writes stay in the existing SQLite registry with remote parity. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Delegate existing identity RPC operations to historical storage helpers. Remote interface unchanged; historical ref/iid lookups retain the old binding and ref-only lookups return the latest incarnation. B4 fix r3: Inventory-only waiting resets RetryCount like scan/pending and retains the caller 30-second schedule. Add an atomic claim against the existing singleton identity-page row, shared with retry_hint. Existing database and HAJournal RPC only; no filesystem path or identity authority added. file:QueryContext@1777,file:QueryContext@6513,file:QueryContext@8347,file:QueryRowContext@11102,file:QueryRowContext@3934,file:QueryRowContext@4712,file:QueryRowContext@5790,file:QueryRowContext@5990,file:QueryRowContext@694,file:QueryRowContext@9217,file:Walk@10738,file:Walk@10761,file:Walk@10782,file:Walk@10802,file:Walk@10875,file:Walk@11298,registry:Account@1401,registry:Account@2167,registry:Account@2592,registry:Account@2960,registry:Account@3702,registry:Account@921,registry:At@10166,registry:At@10191,registry:At@1994,registry:At@289,registry:At@2953,registry:At@3000,registry:At@3341,registry:At@3360,registry:At@3667,registry:At@4168,registry:At@4185,registry:At@4262,registry:At@4924,registry:At@521,registry:At@5308,registry:At@540,registry:At@5525,registry:At@6335,registry:At@6354,registry:At@6703,registry:At@8534,registry:At@9663,registry:Body@5487,registry:Body@5646,registry:Body@6315,registry:Body@6896,registry:Code@10492,registry:Code@3694,registry:Code@7361,registry:Code@9429,registry:Code@9457,registry:Code@9477,registry:Code@9500,registry:Count@775,registry:Departure@7399,registry:Departures@8994,registry:Departures@9018,registry:Found@10327,registry:Found@10658,registry:Found@3128,registry:Found@3495,registry:Found@5404,registry:Found@631,registry:HAJournal@225,registry:Hint@2457,registry:Hint@2674,registry:Hint@905,registry:Hints@2373,registry:Hints@2392,registry:ID@10173,registry:ID@10500,registry:ID@10697,registry:ID@4025,registry:ID@4483,registry:ID@4809,registry:ID@5290,registry:ID@5449,registry:ID@5467,registry:ID@5635,registry:ID@6309,registry:ID@9286,registry:ID@9955,registry:IID@1008,registry:IID@1422,registry:IID@2190,registry:IID@2613,registry:IID@2981,registry:IID@3723,registry:IID@989,registry:Identity@10612,registry:Identity@10644,registry:Inbox@7047,registry:Inbox@7066,registry:InventoryGeneration@4269,registry:Key@10703,registry:Key@1521,registry:Key@1616,registry:Key@6870,registry:Key@7203,registry:Key@7369,registry:Key@8089,registry:Key@8184,registry:Keys@10738,registry:Keys@10802,registry:LastError@2217,registry:LastError@6919,registry:LastError@7625,registry:LastError@8901,registry:LastPage@2339,registry:LastPage@7598,registry:LastPage@8960,registry:Limit@1702,registry:Limit@1717,registry:Limit@2001,registry:Limit@6438,registry:Limit@6453,registry:Limit@6710,registry:Limit@8272,registry:Limit@8287,registry:Limit@8541,registry:MessageID@6880,registry:Next@10483,registry:Next@7352,registry:Next@9719,registry:Next@9734,registry:NextAttempt@2302,registry:NextAttempt@7008,registry:NextAttempt@7644,registry:NextAttempt@8035,registry:NextAttempt@8923,registry:Offset@10761,registry:Offset@10782,registry:Op@254,registry:Page@10005,registry:Phase@4298,registry:Phase@7576,registry:Phase@8882,registry:ProofDigest@7475,registry:ProofKey@7455,registry:ReceivedAt@1022,registry:ReceivedAt@1441,registry:ReceivedAt@1468,registry:ReceivedAt@2268,registry:ReceivedAt@2632,registry:ReceivedAt@6972,registry:Region@1412,registry:Region@2179,registry:Region@2603,registry:Region@2971,registry:Region@3713,registry:Region@945,registry:Region@967,registry:RetryCount@9528,registry:RetryCount@9682,registry:RetryCount@9758,registry:RetryCount@9777,registry:Walk@10738,registry:Walk@10761,registry:Walk@10782,registry:Walk@10802,registry:Walk@10875,registry:Walk@11298,registry:remote@111,registry:remote@142,registry:sql@10931,registry:sql@11102,registry:sql@1777,registry:sql@2475,registry:sql@349,registry:sql@6513,registry:sql@694,registry:sql@7132,registry:sql@7242,registry:sql@8347,whole:HABoxIdentity@10614,whole:HABoxIdentity@10648,whole:HADeparture@4127,whole:HADeparture@4343,whole:HADeparture@7401,whole:HADeparture@7699,whole:HADeparture@8841,whole:HADeparture@8998,whole:HADeparture@9022,whole:HADeparture@9034,whole:HADeparture@9388,whole:HADeparture@9827,whole:HAIdentityWalk@10740,whole:HAIdentityWalk@10763,whole:HAIdentityWalk@10784,whole:HAIdentityWalk@10804,whole:HAIdentityWalk@10877,whole:HAIdentityWalk@11302,whole:HAPendingTermination@2377,whole:HAPendingTermination@2396,whole:HAPendingTermination@2403,whole:HAPendingTermination@2459,whole:HAPendingTermination@2676,whole:HAPendingTermination@907,whole:HATerminationInbox@7051,whole:HATerminationInbox@7070,whole:HATerminationInbox@7077,whole:haJournalRequest@196,whole:haJournalRequest@207,whole:haJournalRequest@881,whole:haJournalResponse@10242,whole:haJournalResponse@10312,whole:haJournalResponse@10528,whole:haJournalResponse@1056,whole:haJournalResponse@10827,whole:haJournalResponse@10909,whole:haJournalResponse@11236,whole:haJournalResponse@11331,whole:haJournalResponse@11360,whole:haJournalResponse@1150,whole:haJournalResponse@1505,whole:haJournalResponse@1646,whole:haJournalResponse@1742,whole:haJournalResponse@2036,whole:haJournalResponse@2253,whole:haJournalResponse@230,whole:haJournalResponse@2753,whole:haJournalResponse@3049,whole:haJournalResponse@3115,whole:haJournalResponse@315,whole:haJournalResponse@3411,whole:haJournalResponse@3480,whole:haJournalResponse@3752,whole:haJournalResponse@3874,whole:haJournalResponse@4065,whole:haJournalResponse@4152,whole:haJournalResponse@4223,whole:haJournalResponse@4372,whole:haJournalResponse@4511,whole:haJournalResponse@4637,whole:haJournalResponse@4896,whole:haJournalResponse@4949,whole:haJournalResponse@5371,whole:haJournalResponse@5551,whole:haJournalResponse@5731,whole:haJournalResponse@589,whole:haJournalResponse@5912,whole:haJournalResponse@5952,whole:haJournalResponse@6094,whole:haJournalResponse@6156,whole:haJournalResponse@6387,whole:haJournalResponse@6478,whole:haJournalResponse@659,whole:haJournalResponse@6745,whole:haJournalResponse@6957,whole:haJournalResponse@7552,whole:haJournalResponse@7728,whole:haJournalResponse@7811,whole:haJournalResponse@795,whole:haJournalResponse@8073,whole:haJournalResponse@8214,whole:haJournalResponse@8312,whole:haJournalResponse@8576,whole:haJournalResponse@8797,whole:haJournalResponse@8867,whole:haJournalResponse@9157,whole:haJournalResponse@9326,whole:haJournalResponse@9413,whole:haJournalResponse@9858,whole:haJournalResponse@9984,whole:remoteClient@113,whole:remoteClient@144 49e1df04452dadc8f27011d9dfa162a231684c6f0354b26a71e43837bdb4f0a9
@legacy 479f59e09805b8bc06e35ed5c38c478d9a76e5bec01be44d205952586dffef49 internal/registry/ha_journal.go Registry.migrateHAJournal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add compact per-account/region/iid pending rows to the existing registry, with durable retry and hourly page times. No new database path or receipt storage. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Run the atomic identity-history migration in the same registry; preserve all old binding bytes and observations. file:Exec@57,registry:sql@57 300874039b3d2abbfa815d56926222caa6881bd47d827ec6c6608dc69a88d8ff
@legacy 0846757b3b6d55ae3840c0d2f7bc7f0bd2d65d18f7d5eeb12bd4cbcb85747989 internal/registry/ha_journal.go type haJournalRequest legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Carry compact pending hints through the existing registry RPC, with no new authority. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. file:Walk@224 90f9a7d36396dbab45329af08fa6cf62fa9b57e280854ffcfff86f62dab35bb5
@legacy 3583838d09725a53dc1286eefdf8f58625dd56de81df29b9788c5e124c613e32 internal/registry/ha_journal.go type haJournalResponse legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Return compact pending-hint pages from the existing registry RPC. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. file:Walk@197 b940765a049b21fa944ea9c2a98150001bfe1284c110bb057715a4e113704e7d
@@ -128,15 +130,16 @@ internal/activator/haduties.go dutyBackend legacy accepted-legacy accepted-legac
internal/activator/haduties.go dutyRefusal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=DutyState alias makes the existing holder and deadline reads visible to the registry census; refusal behavior unchanged. registry:HolderIID@306,registry:HolderRef@223,registry:HolderRef@245,registry:HolderRef@276,registry:NotBefore@167 7d8646a06d8d37ce9e8c736b1fb1e59b8046ba245e1957e0301791fd9032910d
internal/activator/hawake.go ExecBackend.TerminationLifetime legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3 fix r1: Read the host route from the existing registry and reuse isHA record/lifetime-index classification. Missing, legacy or lifetime-free hosts refuse. Inventory completeness is not takeover authority. whole:Route@242,whole:Route@329 4f9acf54553193732df400d99d23291f3be27cd09007ca3980075d3da05535b4
internal/edge/wakeplacement.go Edge.DutySnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Pass the route to the existing cached home projection; no store reads, network reads or new publication. whole:Route@108 fa66b0bb586cb9a3214d818fbe40181f3ca7d5655f5af4ac259377cf4d5c133d
-internal/host/hadeparture_identity.go departureIdentities.Observe legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads. registry:Account@1042,registry:Digest@1074,registry:Digest@952,registry:IID@1019,registry:IID@559,registry:IID@907,registry:Observation@1084,registry:Raw@823,registry:Ref@848,whole:HABoxIdentity@1144,whole:HABoxIdentity@712 5e4ba3e5a6a5c1119616eebf001ad4554d5024bb6c0d9e9495e67ea5fc372331
+internal/host/hadeparture_identity.go departureIdentities.Observe legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Open the existing deployment store lazily; same immutable record verification and independently bound iid. No new record path. B4 fix r2: Reload the exact signed box record when independent fixed configuration changes the expected iid. Verify configured account/region and persist the new incarnation without changing historical observations. Warm unchanged identities add no S3 reads. B4 fix r3: A failed configured replacement retains and refreshes only the current verified incarnation observation. Share exact-key reload refusals with the event walk; cached bindings still pass signature/digest checks and the new configured iid gains nothing until verification succeeds. registry:Account@1247,registry:Digest@1157,registry:Digest@1279,registry:IID@1112,registry:IID@1224,registry:IID@558,registry:Observation@1289,registry:Raw@1028,registry:Ref@1053,whole:HABoxIdentity@1349,whole:HABoxIdentity@641,whole:HABoxIdentity@645,whole:HABoxIdentity@823 be36a7b26c6d365eb254c6c0739079ab85304fff848a5463c15ab90427c24a85
internal/host/hadeparture_identity.go departureIdentities.Proof legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. registry:Raw@489 b7b9c4ea43369ac83c0aefd9ed415f556b98a9bcc3e08f15eaf179cd0f9235f2
internal/host/hadeparture_identity.go departureIdentities.Resolve legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. registry:Account@556,registry:Digest@393,registry:Digest@588,registry:IID@348,registry:IID@533,registry:Observation@480,registry:Raw@279,registry:Ref@304,registry:Ref@507,registry:Region@322,registry:Region@661 96fd0a43aa8f8b142b57e16e8383321b5d0dc42291c296228b57542cc67da194
-internal/host/hadeparture_identity.go departureIdentities.Walk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Read and persist per-ref/iid refusal candidates rather than a global record-validation failure. Unsigned fields only restrict unrelated classification; they never bind identity. Incomplete listing and unidentifiable fixed records keep affected unknown iids pending; known identities continue. Existing page and GET bounds remain. B4 fix r2: A known ref with a changed independent configured iid joins the bounded verification GET page; cache hits remain read-free. Retain the 32-record GET bound and blocked-candidate refusal behavior. file:Walk@30,registry:Blocked@1088,registry:Blocked@1107,registry:Blocked@1275,registry:Blocked@1294,registry:Blocked@1613,registry:Blocked@1632,registry:Blocked@1986,registry:Blocked@2005,registry:Blocked@2163,registry:Blocked@2182,registry:Blocked@2414,registry:Blocked@860,registry:Blocked@879,registry:Cursor@2449,registry:Cursor@483,registry:Cursor@769,registry:Failed@2328,registry:Keys@2250,registry:Keys@2287,registry:Keys@2460,registry:Keys@2471,registry:Keys@2484,registry:Keys@425,registry:Keys@632,registry:Keys@695,registry:Keys@727,registry:Offset@2234,registry:Offset@2499,registry:Offset@648,registry:Offset@680,registry:Offset@734,registry:Offset@746,registry:StartedAt@186,registry:StartedAt@211,registry:StartedAt@2344,registry:StartedAt@297,registry:StartedAt@380,registry:StartedAt@532,registry:StartedAt@592,whole:HAIdentityWalk@2373,whole:HAIdentityWalk@2560 77d155d4ff35378398d88467cda57c65a73387f1f3ded49a40df566f363d5625
+internal/host/hadeparture_identity.go departureIdentities.Walk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B3 fix r1: Read and persist per-ref/iid refusal candidates rather than a global record-validation failure. Unsigned fields only restrict unrelated classification; they never bind identity. Incomplete listing and unidentifiable fixed records keep affected unknown iids pending; known identities continue. Existing page and GET bounds remain. B4 fix r2: A known ref with a changed independent configured iid joins the bounded verification GET page; cache hits remain read-free. Retain the 32-record GET bound and blocked-candidate refusal behavior. B4 fix r3: Share the per-ref/configured-iid/record-revision refusal cache with Observe. Cached failures still block the configured replacement iid and any bounded parsed candidate; no extra GET while the retry deadline is pending. file:Walk@30,registry:Blocked@1088,registry:Blocked@1107,registry:Blocked@1275,registry:Blocked@1294,registry:Blocked@1704,registry:Blocked@1723,registry:Blocked@2077,registry:Blocked@2096,registry:Blocked@2254,registry:Blocked@2273,registry:Blocked@2505,registry:Blocked@860,registry:Blocked@879,registry:Cursor@2540,registry:Cursor@483,registry:Cursor@769,registry:Failed@2419,registry:Keys@2341,registry:Keys@2378,registry:Keys@2551,registry:Keys@2562,registry:Keys@2575,registry:Keys@425,registry:Keys@632,registry:Keys@695,registry:Keys@727,registry:Offset@2325,registry:Offset@2590,registry:Offset@648,registry:Offset@680,registry:Offset@734,registry:Offset@746,registry:StartedAt@186,registry:StartedAt@211,registry:StartedAt@2435,registry:StartedAt@297,registry:StartedAt@380,registry:StartedAt@532,registry:StartedAt@592,whole:HAIdentityWalk@2464,whole:HAIdentityWalk@2651 6a71317efe383c76ea6fe5f61186eb458098a90b0e32ed3f8ff64da0f8c4c87b
+internal/host/hadeparture_identity.go departureIdentities.loadReplacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r3: Read the current verified binding and only its validated control/boxes ref key, with a five-second request context. Serialize replacement requests and cache refusals by ref, configured iid and ETag (digest fallback), retrying at 30/60/120/300 seconds. A changed observed revision resets the delay. Successful verification uses the unchanged account/region/independent-iid/history guards; failures cannot bind a replacement. No tenant-named path or new root input. registry:IID@377,registry:Raw@423,whole:HABoxIdentity@1040,whole:HABoxIdentity@1643,whole:HABoxIdentity@267,whole:HABoxIdentity@420,whole:HABoxIdentity@544,whole:HABoxIdentity@939 f22a00143aa12bf5595149a6b502d469244fba1ca852d36b9e7c670494b44e28
internal/host/hadeparture_identity.go departureIdentities.verify legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read immutable box bytes and local verified bindings; require AWS signature plus independent fixed/group binding, unique ref/iid, exact digest and known scope. Unknown walks persist one 1000-key page and at most 32 new GETs per turn; errors never prove absence. B4 fix r2: A different iid and digest may append an incarnation only after AWS signature, expected deployment account/region and independent fixed or deterministic group binding checks. Read current and historical iid bindings from the same registry; refuse duplicate iid, same-iid digest rotation and historical replay. No root path or execution authority is introduced. registry:Digest@1248,registry:Digest@1262,registry:Digest@819,registry:IID@502,registry:IID@856,registry:Observation@1275,registry:Observation@1291,whole:HABoxIdentity@1034,whole:HABoxIdentity@1351,whole:HABoxIdentity@1377,whole:HABoxIdentity@1395,whole:HABoxIdentity@421,whole:HABoxIdentity@646,whole:HABoxIdentity@777,whole:HABoxIdentity@899 19b608c0c2ce5ff8f74c0d79887ed1f8abc616044d34759f10773a0b0bbd1a61
internal/host/hadepartures.go Controller.ackDeparture legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Inspect only local durable completion before acknowledging the current in-memory queue receipt. Never serialize a reusable receipt or use an incomplete journal row as completion. registry:Phase@177 4f864b0711b24676b5c078fb1f16835809b56b7c372b84ce8328a10fc63936ed
internal/host/hadepartures.go Controller.enqueue legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. whole:HADeparture@1398 2abe74f070cc47e528a56696aaa3fa5a85a80b6f4bbb4cf564b4d23d7d0a578d
internal/host/hadepartures.go Controller.record legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Inspect only local durable completion before acknowledging the current in-memory queue receipt. Never serialize a reusable receipt or use an incomplete journal row as completion. registry:Phase@726,whole:HADeparture@781 dacb56df365647ec11f3fcbf00d13e8b8d94f9c8eb70ff6092a32c31ffb5d63d
-internal/host/hadepartures.go Controller.step legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. B3 fix r1: Describe before proof access on suspicion paths. Normalize validated legacy inbox entries in atomic transactions, process bounded per-iid pending pages, and persist hourly escalation. Delete unrelated rows only after complete applicable walks and guarded received timestamps. Acquire/completion authority unchanged. B4: Count unresolved durable hints for the globally throttled summary and call the bounded scanner outside the fold. Acknowledge unrelated hints only after complete applicable discovery; complete departure acknowledgment reads durable state. file:Walk@2642,registry:Body@1904,registry:IID@2479,registry:IID@2896,registry:IID@3249,registry:IID@3282,registry:IID@3748,registry:Key@2006,registry:Key@2242,registry:LastBlocked@2797,registry:ReceivedAt@2225,registry:ReceivedAt@3180,whole:HADeparture@4100,whole:HADeparture@5068,whole:HADeparture@5391,whole:HAPendingTermination@2420,whole:HAPendingTermination@2837,whole:HAPendingTermination@3091,whole:HAPendingTermination@3374,whole:HAPendingTermination@3480,whole:HAPendingTermination@3824,whole:HATerminationInbox@1864 4491ef42cf9ea18b01d9ee07502611ccc02e1caacfeb4f01e29b9820aa14a467
+internal/host/hadepartures.go Controller.step legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: resolve bound same-scope identities, persist validated termination proof before enrollment, and replay bounded pending work outside consumer/fold locks. Existing regional data client and shared cache; inventory only restricts completion, never lifecycle. B3 fix r1: Describe before proof access on suspicion paths. Normalize validated legacy inbox entries in atomic transactions, process bounded per-iid pending pages, and persist hourly escalation. Delete unrelated rows only after complete applicable walks and guarded received timestamps. Acquire/completion authority unchanged. B4: Count unresolved durable hints for the globally throttled summary and call the bounded scanner outside the fold. Acknowledge unrelated hints only after complete applicable discovery; complete departure acknowledgment reads durable state. B4 fix r3: Include refused fixed-box replacements in the existing structured receiver summary, sharing its persisted hourly page claim with pending hints. Read only local refusal state and registry page state; no additional cloud request or completion authority. file:Walk@2642,registry:Body@1904,registry:IID@2479,registry:IID@2896,registry:IID@3249,registry:IID@3282,registry:IID@3963,registry:Key@2006,registry:Key@2242,registry:LastBlocked@2797,registry:ReceivedAt@2225,registry:ReceivedAt@3180,whole:HADeparture@4905,whole:HADeparture@5873,whole:HADeparture@6196,whole:HAPendingTermination@2420,whole:HAPendingTermination@2837,whole:HAPendingTermination@3091,whole:HAPendingTermination@3374,whole:HAPendingTermination@3480,whole:HAPendingTermination@4039,whole:HAPendingTermination@4629,whole:HATerminationInbox@1864 44e727ba7a5f28238e16f971f4cd6440294889159ee0ff80358d4d7099c62f8c
internal/host/hadepartures_scan.go Controller.ScanPass legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read authoritative pre-filter inventory, exact canonical lock revisions through one page reader, local scan checkpoints and adoption receipts. Persist source identity before the sole AdoptHost importer; validate later successor identity/lifetime/generation and require a fresh full zero-match rescan. Unknown state, unsupported hosts and missing previously matched locks refuse completion. No process launch or tenancy expansion. Preserve checkpoints across walks of identical record bytes; persist the current inventory generation separately and recheck source freshness/completeness before every page and deletion. Placement changes cannot filter the lock census. Fix r1/P15: classify legacy and unrelated locks as zero only before any D match; keep strict successor checks for previously matched hosts and hold malformed HA identities. Compare read start to expiry. Resume authority-complete deletion without rescanning unchanged inventory; persist evidence and scan errors with bounded retry. B4 fix r2: Inventory-only waits request the existing hourly page only after observed evidence is older than ChangeIndexBackstop plus 10 percent. Freshness and completion gates are unchanged; no new read. registry:Cursor@1902,registry:Cursor@2568,registry:Cursor@2651,registry:Cursor@2663,registry:Cursor@6382,registry:Cursor@6488,registry:Cursor@6839,registry:Generation@1843,registry:Generation@1874,registry:Generation@6362,registry:Generation@6520,registry:Hosts@1958,registry:Hosts@1978,registry:Hosts@2699,registry:Hosts@2767,registry:Hosts@4806,registry:Hosts@5193,registry:Hosts@5486,registry:Hosts@6082,registry:InventoryGeneration@1776,registry:Lifetime@2728,registry:NotBefore@3077,registry:NotBefore@3118,registry:NotBefore@4774,registry:NotBefore@5163,registry:NotBefore@5450,registry:Observed@4317,registry:Observed@4471,registry:Observed@5046,registry:Observed@5080,registry:Phase@1366,registry:Phase@1819,registry:Phase@2036,registry:Phase@4031,registry:Phase@552,registry:Phase@607,registry:Phase@647,registry:RecordDigest@3039,registry:RecordDigest@5103,registry:Rescan@1917,registry:Rescan@3019,registry:Rescan@4200,registry:Rescan@5220,registry:Rescan@6397,registry:Rescan@6554,registry:Rescan@6807,registry:Result@4744,registry:Result@5138,registry:Result@6048,registry:Unresolved@1936,registry:Unresolved@2948,registry:Unresolved@3138,registry:Unresolved@3356,registry:Unresolved@3420,registry:Unresolved@3618,registry:Unresolved@3978,registry:Unresolved@4239,registry:Unresolved@4388,registry:Unresolved@4506,registry:Unresolved@4582,registry:Unresolved@4694,registry:Unresolved@5234,registry:Unresolved@5313,registry:Unresolved@5511,registry:Unresolved@5811,registry:Unresolved@5934,registry:Unresolved@6416,registry:Unresolved@6446,registry:Unresolved@6670,registry:Unresolved@6818,registry:Unresolved@6855,registry:Version@5770,whole:HADeparture@1029,whole:HADeparture@1148,whole:HADeparture@1333,whole:HADeparture@1622,whole:HADeparture@2129,whole:HADeparture@2326,whole:HADeparture@2482,whole:HADeparture@268,whole:HADeparture@310,whole:HADeparture@4314,whole:HADeparture@5738,whole:HADeparture@5877,whole:HADeparture@6185,whole:HADeparture@7006,whole:HADeparture@7142,whole:HADeparture@832,whole:HADepartureHostScan@1960,whole:HADepartureHostScan@1980,whole:HADepartureHostScan@2701,whole:HADepartureHostScan@2769,whole:HADepartureHostScan@2803,whole:HADepartureHostScan@4808,whole:HADepartureHostScan@4824,whole:HADepartureHostScan@4865,whole:HADepartureHostScan@5195,whole:HADepartureHostScan@5211,whole:HADepartureHostScan@5488,whole:HADepartureHostScan@5504,whole:HADepartureHostScan@6084,whole:HADepartureHostScan@6100,whole:HADepartureScan@5675,whole:HADepartureScan@6940 3f002a1bc4fe6ca3b820034a40bae05e912aa993cf740101fcf3afbd7b7dd97d
internal/host/hadepartures_scan.go Controller.complete legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read the durable departure/scan and current inventory, then conditionally delete only the retained exact edges key/revision. Reread uncertain results and refuse replacement identities. Persist deletion and acknowledged index phases before complete; queue receipts stay in memory and only complete rows acknowledge. Fresh process evidence is required before authority checkpoint reuse. Fix r1/P15: ignore the old scan-level ETag override and delete only the original departure ETag. Exact-key readback retries the same tag; a changed tag is never deleted and advances only with a different verified iid under the same ref/account/scope, otherwise holds and pages. Persist permission fault episodes; route completion faults through bounded retry. No new filesystem or executable input. registry:Cursor@1644,registry:DeleteUncertain@1796,registry:DeleteUncertain@3108,registry:DeleteUncertain@3493,registry:Generation@1626,registry:Generation@1680,registry:Hosts@4250,registry:InventoryGeneration@1731,registry:PermissionAlerted@2085,registry:PermissionAlerted@2863,registry:PermissionAlerted@3637,registry:PermissionAlerted@4041,registry:PermissionAlerted@740,registry:PermissionAlerted@782,registry:Phase@1437,registry:Phase@161,registry:Phase@2987,registry:Phase@3755,registry:Phase@579,registry:Phase@849,registry:Phase@866,registry:Phase@901,registry:Phase@941,registry:Rescan@1660,registry:Version@564,whole:HADeparture@214,whole:HADeparture@341,whole:HADeparture@4299,whole:HADepartureHostScan@4252,whole:HADepartureScan@542 f0735c15b9423b47776df328fec397ea56fb508af76d1acf7cb7535780ac03fc
internal/host/hadepartures_scan.go Controller.retryScan legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read only the bound departure to persist bounded retry timing and the existing hourly per-departure page claim. No completion authority. Fix r1/P15: bound detached retry bookkeeping to five seconds so cancellation still records backoff/page. Permission episodes use only the structured ha_departure_permission_fault code and key, never wake-state prose. whole:HADeparture@794 34a55a0cdebf92cd064addb96a78638abd0c709a73270f6840cac56384b70df7
@@ -162,6 +165,7 @@ internal/registry/ha_identity_history.go Registry.loadHAIdentity legacy accepted
internal/registry/ha_identity_history.go Registry.migrateHAIdentityHistory legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r2: Inspect the existing SQLite schema and migrate ref-keyed identity rows atomically to (ref,digest), preserving exact binding bodies and observations. iid remains globally unique. Uses only the existing registry database; no filesystem path or executable input. file:QueryRow@80,file:QueryRowContext@382,registry:sql@80 f0fa9410de61dd34fe1dee251eb19b328ea8854933b0ad63113a419ba564f762
internal/registry/ha_identity_history.go Registry.saveHAIdentity legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r2: Read and append identity history in the existing registry. Exact binding bytes/account/region/iid/digest cannot mutate, and duplicate iid across incarnations or refs refuses. Only the latest incarnation observation may update. Host verification remains the caller prerequisite; this trusted registry primitive grants no takeover or completion authority. file:QueryRowContext@1335,file:QueryRowContext@546,registry:Account@114,registry:Account@1625,registry:Account@824,registry:Account@839,registry:Digest@1238,registry:Digest@1809,registry:Digest@194,registry:Digest@640,registry:Digest@878,registry:Digest@892,registry:IID@1819,registry:IID@804,registry:IID@815,registry:IID@99,registry:Observation@370,registry:Raw@155,registry:Raw@179,registry:Raw@238,registry:Raw@917,registry:Raw@926,registry:Ref@1231,registry:Ref@1248,registry:Ref@1493,registry:Ref@1802,registry:Ref@633,registry:Ref@784,registry:Ref@795,registry:Ref@84,registry:Region@133,registry:Region@1648,registry:Region@852,registry:Region@866,whole:HABoxIdentity@300,whole:HABoxIdentity@742 68c85cb6bb6644baca7e6dc2ada706a2cf7ce7b475f67822a5a1211377e793ce
internal/registry/ha_journal.go Registry.ClaimHAConfirmation legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. registry:Found@195 8fbb36f6bf58466f02bd8e27a144325bbe594129c6cdb8861881e44275ea1288
+internal/registry/ha_journal.go Registry.ClaimHAIdentityPage legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4 fix r3: Invoke the existing registry journal protocol to claim the existing receiver-wide hourly identity page. Only local alert scheduling changes; no root path, completion or start authority. registry:Found@175 9b8132cd02a152f558be95b11d15762a2cc7332074e798c01a1ac4c47d6a78aa
internal/registry/ha_journal.go Registry.EnrollDeparture legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. whole:HADeparture@152,whole:HADeparture@163 4869e4e5098ed3545f629e4b1da9f7a17dd375cf49f02c6c5c772318525fb7db
internal/registry/ha_journal.go Registry.HAIdentity legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. registry:Found@204,registry:Identity@190,whole:HABoxIdentity@194 5528b0c1503b15069b41afe300402c56268a4f0ef33cc893e5d3826c1c4108a0
internal/registry/ha_journal.go Registry.LoadHAIdentityWalk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. file:Walk@153,registry:Walk@153,whole:HAIdentityWalk@157 d69d9bc8c006eeee4405cae920cad99ae801784edcdc7a0a39cab63323dc9ea2
@@ -175,7 +179,7 @@ internal/registry/ha_journal.go Registry.RetryPendingTermination legacy accepted
internal/registry/ha_journal.go Registry.SaveHAIdentity legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. whole:HABoxIdentity@146,whole:HABoxIdentity@156 0830d1f3450aa0bcb0f68ba3f9ced1c37312505564e4b06069bf9484770992cf
internal/registry/ha_journal.go Registry.SaveHAIdentityWalk legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. file:Walk@147,whole:HAIdentityWalk@147,whole:HAIdentityWalk@153 3964525d39325734e0eefd6130022314f8260316ceacbf2b3282b39fb1565e41
internal/registry/ha_journal.go Registry.TerminationInbox legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. registry:Inbox@205,whole:HATerminationInbox@209 5a2aca28aae1664ef5ff06613df4b22f87bb4272358e89a29df5f41e26688802
-internal/registry/ha_journal.go Registry.haJournal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add atomic compact hint enrollment, bounded due reads, received-time guarded removal and hourly page claims. Retain old inbox APIs for migration, no queue receipt or authority bit. All reads/writes stay in the existing SQLite registry with remote parity. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Delegate existing identity RPC operations to historical storage helpers. Remote interface unchanged; historical ref/iid lookups retain the old binding and ref-only lookups return the latest incarnation. file:QueryContext@1372,file:QueryContext@6108,file:QueryContext@7942,file:QueryRowContext@10672,file:QueryRowContext@289,file:QueryRowContext@3529,file:QueryRowContext@4307,file:QueryRowContext@5385,file:QueryRowContext@5585,file:QueryRowContext@8812,file:Walk@10308,file:Walk@10331,file:Walk@10352,file:Walk@10372,file:Walk@10445,file:Walk@10868,registry:Account@1762,registry:Account@2187,registry:Account@2555,registry:Account@3297,registry:Account@516,registry:Account@996,registry:At@1589,registry:At@2548,registry:At@2595,registry:At@2936,registry:At@2955,registry:At@3262,registry:At@3763,registry:At@3780,registry:At@3857,registry:At@4519,registry:At@4903,registry:At@5120,registry:At@5930,registry:At@5949,registry:At@6298,registry:At@8129,registry:At@9233,registry:At@9736,registry:At@9761,registry:Body@5082,registry:Body@5241,registry:Body@5910,registry:Body@6491,registry:Code@10062,registry:Code@3289,registry:Code@6956,registry:Code@9024,registry:Code@9052,registry:Code@9072,registry:Count@370,registry:Departure@6994,registry:Departures@8589,registry:Departures@8613,registry:Found@10228,registry:Found@2723,registry:Found@3090,registry:Found@4999,registry:Found@9897,registry:HAJournal@225,registry:Hint@2052,registry:Hint@2269,registry:Hint@500,registry:Hints@1968,registry:Hints@1987,registry:ID@10070,registry:ID@10267,registry:ID@3620,registry:ID@4078,registry:ID@4404,registry:ID@4885,registry:ID@5044,registry:ID@5062,registry:ID@5230,registry:ID@5904,registry:ID@8881,registry:ID@9525,registry:ID@9743,registry:IID@1017,registry:IID@1785,registry:IID@2208,registry:IID@2576,registry:IID@3318,registry:IID@584,registry:IID@603,registry:Identity@10182,registry:Identity@10214,registry:Inbox@6642,registry:Inbox@6661,registry:InventoryGeneration@3864,registry:Key@10273,registry:Key@1116,registry:Key@1211,registry:Key@6465,registry:Key@6798,registry:Key@6964,registry:Key@7684,registry:Key@7779,registry:Keys@10308,registry:Keys@10372,registry:LastError@1812,registry:LastError@6514,registry:LastError@7220,registry:LastError@8496,registry:LastPage@1934,registry:LastPage@7193,registry:LastPage@8555,registry:Limit@1297,registry:Limit@1312,registry:Limit@1596,registry:Limit@6033,registry:Limit@6048,registry:Limit@6305,registry:Limit@7867,registry:Limit@7882,registry:Limit@8136,registry:MessageID@6475,registry:Next@10053,registry:Next@6947,registry:Next@9289,registry:Next@9304,registry:NextAttempt@1897,registry:NextAttempt@6603,registry:NextAttempt@7239,registry:NextAttempt@7630,registry:NextAttempt@8518,registry:Offset@10331,registry:Offset@10352,registry:Op@254,registry:Page@9575,registry:Phase@3893,registry:Phase@7171,registry:Phase@8477,registry:ProofDigest@7070,registry:ProofKey@7050,registry:ReceivedAt@1036,registry:ReceivedAt@1063,registry:ReceivedAt@1863,registry:ReceivedAt@2227,registry:ReceivedAt@617,registry:ReceivedAt@6567,registry:Region@1007,registry:Region@1774,registry:Region@2198,registry:Region@2566,registry:Region@3308,registry:Region@540,registry:Region@562,registry:RetryCount@9098,registry:RetryCount@9252,registry:RetryCount@9328,registry:RetryCount@9347,registry:Walk@10308,registry:Walk@10331,registry:Walk@10352,registry:Walk@10372,registry:Walk@10445,registry:Walk@10868,registry:remote@111,registry:remote@142,registry:sql@10501,registry:sql@10672,registry:sql@1372,registry:sql@2070,registry:sql@289,registry:sql@6108,registry:sql@6727,registry:sql@6837,registry:sql@7942,whole:HABoxIdentity@10184,whole:HABoxIdentity@10218,whole:HADeparture@3722,whole:HADeparture@3938,whole:HADeparture@6996,whole:HADeparture@7294,whole:HADeparture@8436,whole:HADeparture@8593,whole:HADeparture@8617,whole:HADeparture@8629,whole:HADeparture@8983,whole:HADeparture@9397,whole:HAIdentityWalk@10310,whole:HAIdentityWalk@10333,whole:HAIdentityWalk@10354,whole:HAIdentityWalk@10374,whole:HAIdentityWalk@10447,whole:HAIdentityWalk@10872,whole:HAPendingTermination@1972,whole:HAPendingTermination@1991,whole:HAPendingTermination@1998,whole:HAPendingTermination@2054,whole:HAPendingTermination@2271,whole:HAPendingTermination@502,whole:HATerminationInbox@6646,whole:HATerminationInbox@6665,whole:HATerminationInbox@6672,whole:haJournalRequest@196,whole:haJournalRequest@207,whole:haJournalRequest@476,whole:haJournalResponse@10098,whole:haJournalResponse@10397,whole:haJournalResponse@10479,whole:haJournalResponse@10806,whole:haJournalResponse@10901,whole:haJournalResponse@10930,whole:haJournalResponse@1100,whole:haJournalResponse@1241,whole:haJournalResponse@1337,whole:haJournalResponse@1631,whole:haJournalResponse@1848,whole:haJournalResponse@230,whole:haJournalResponse@2348,whole:haJournalResponse@2644,whole:haJournalResponse@2710,whole:haJournalResponse@3006,whole:haJournalResponse@3075,whole:haJournalResponse@3347,whole:haJournalResponse@3469,whole:haJournalResponse@3660,whole:haJournalResponse@3747,whole:haJournalResponse@3818,whole:haJournalResponse@390,whole:haJournalResponse@3967,whole:haJournalResponse@4106,whole:haJournalResponse@4232,whole:haJournalResponse@4491,whole:haJournalResponse@4544,whole:haJournalResponse@4966,whole:haJournalResponse@5146,whole:haJournalResponse@5326,whole:haJournalResponse@5507,whole:haJournalResponse@5547,whole:haJournalResponse@5689,whole:haJournalResponse@5751,whole:haJournalResponse@5982,whole:haJournalResponse@6073,whole:haJournalResponse@6340,whole:haJournalResponse@651,whole:haJournalResponse@6552,whole:haJournalResponse@7147,whole:haJournalResponse@7323,whole:haJournalResponse@7406,whole:haJournalResponse@745,whole:haJournalResponse@7668,whole:haJournalResponse@7809,whole:haJournalResponse@7907,whole:haJournalResponse@8171,whole:haJournalResponse@8392,whole:haJournalResponse@8462,whole:haJournalResponse@8752,whole:haJournalResponse@8921,whole:haJournalResponse@9008,whole:haJournalResponse@9428,whole:haJournalResponse@9554,whole:haJournalResponse@9812,whole:haJournalResponse@9882,whole:remoteClient@113,whole:remoteClient@144 a0246d2808d3642bd63822c6cb8f4574ecb65307e792ee4eea497b9917e4aa2a
+internal/registry/ha_journal.go Registry.haJournal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add atomic compact hint enrollment, bounded due reads, received-time guarded removal and hourly page claims. Retain old inbox APIs for migration, no queue receipt or authority bit. All reads/writes stay in the existing SQLite registry with remote parity. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Delegate existing identity RPC operations to historical storage helpers. Remote interface unchanged; historical ref/iid lookups retain the old binding and ref-only lookups return the latest incarnation. B4 fix r3: Inventory-only waiting resets RetryCount like scan/pending and retains the caller 30-second schedule. Add an atomic claim against the existing singleton identity-page row, shared with retry_hint. Existing database and HAJournal RPC only; no filesystem path or identity authority added. file:QueryContext@1777,file:QueryContext@6513,file:QueryContext@8347,file:QueryRowContext@11102,file:QueryRowContext@3934,file:QueryRowContext@4712,file:QueryRowContext@5790,file:QueryRowContext@5990,file:QueryRowContext@694,file:QueryRowContext@9217,file:Walk@10738,file:Walk@10761,file:Walk@10782,file:Walk@10802,file:Walk@10875,file:Walk@11298,registry:Account@1401,registry:Account@2167,registry:Account@2592,registry:Account@2960,registry:Account@3702,registry:Account@921,registry:At@10166,registry:At@10191,registry:At@1994,registry:At@289,registry:At@2953,registry:At@3000,registry:At@3341,registry:At@3360,registry:At@3667,registry:At@4168,registry:At@4185,registry:At@4262,registry:At@4924,registry:At@521,registry:At@5308,registry:At@540,registry:At@5525,registry:At@6335,registry:At@6354,registry:At@6703,registry:At@8534,registry:At@9663,registry:Body@5487,registry:Body@5646,registry:Body@6315,registry:Body@6896,registry:Code@10492,registry:Code@3694,registry:Code@7361,registry:Code@9429,registry:Code@9457,registry:Code@9477,registry:Code@9500,registry:Count@775,registry:Departure@7399,registry:Departures@8994,registry:Departures@9018,registry:Found@10327,registry:Found@10658,registry:Found@3128,registry:Found@3495,registry:Found@5404,registry:Found@631,registry:HAJournal@225,registry:Hint@2457,registry:Hint@2674,registry:Hint@905,registry:Hints@2373,registry:Hints@2392,registry:ID@10173,registry:ID@10500,registry:ID@10697,registry:ID@4025,registry:ID@4483,registry:ID@4809,registry:ID@5290,registry:ID@5449,registry:ID@5467,registry:ID@5635,registry:ID@6309,registry:ID@9286,registry:ID@9955,registry:IID@1008,registry:IID@1422,registry:IID@2190,registry:IID@2613,registry:IID@2981,registry:IID@3723,registry:IID@989,registry:Identity@10612,registry:Identity@10644,registry:Inbox@7047,registry:Inbox@7066,registry:InventoryGeneration@4269,registry:Key@10703,registry:Key@1521,registry:Key@1616,registry:Key@6870,registry:Key@7203,registry:Key@7369,registry:Key@8089,registry:Key@8184,registry:Keys@10738,registry:Keys@10802,registry:LastError@2217,registry:LastError@6919,registry:LastError@7625,registry:LastError@8901,registry:LastPage@2339,registry:LastPage@7598,registry:LastPage@8960,registry:Limit@1702,registry:Limit@1717,registry:Limit@2001,registry:Limit@6438,registry:Limit@6453,registry:Limit@6710,registry:Limit@8272,registry:Limit@8287,registry:Limit@8541,registry:MessageID@6880,registry:Next@10483,registry:Next@7352,registry:Next@9719,registry:Next@9734,registry:NextAttempt@2302,registry:NextAttempt@7008,registry:NextAttempt@7644,registry:NextAttempt@8035,registry:NextAttempt@8923,registry:Offset@10761,registry:Offset@10782,registry:Op@254,registry:Page@10005,registry:Phase@4298,registry:Phase@7576,registry:Phase@8882,registry:ProofDigest@7475,registry:ProofKey@7455,registry:ReceivedAt@1022,registry:ReceivedAt@1441,registry:ReceivedAt@1468,registry:ReceivedAt@2268,registry:ReceivedAt@2632,registry:ReceivedAt@6972,registry:Region@1412,registry:Region@2179,registry:Region@2603,registry:Region@2971,registry:Region@3713,registry:Region@945,registry:Region@967,registry:RetryCount@9528,registry:RetryCount@9682,registry:RetryCount@9758,registry:RetryCount@9777,registry:Walk@10738,registry:Walk@10761,registry:Walk@10782,registry:Walk@10802,registry:Walk@10875,registry:Walk@11298,registry:remote@111,registry:remote@142,registry:sql@10931,registry:sql@11102,registry:sql@1777,registry:sql@2475,registry:sql@349,registry:sql@6513,registry:sql@694,registry:sql@7132,registry:sql@7242,registry:sql@8347,whole:HABoxIdentity@10614,whole:HABoxIdentity@10648,whole:HADeparture@4127,whole:HADeparture@4343,whole:HADeparture@7401,whole:HADeparture@7699,whole:HADeparture@8841,whole:HADeparture@8998,whole:HADeparture@9022,whole:HADeparture@9034,whole:HADeparture@9388,whole:HADeparture@9827,whole:HAIdentityWalk@10740,whole:HAIdentityWalk@10763,whole:HAIdentityWalk@10784,whole:HAIdentityWalk@10804,whole:HAIdentityWalk@10877,whole:HAIdentityWalk@11302,whole:HAPendingTermination@2377,whole:HAPendingTermination@2396,whole:HAPendingTermination@2403,whole:HAPendingTermination@2459,whole:HAPendingTermination@2676,whole:HAPendingTermination@907,whole:HATerminationInbox@7051,whole:HATerminationInbox@7070,whole:HATerminationInbox@7077,whole:haJournalRequest@196,whole:haJournalRequest@207,whole:haJournalRequest@881,whole:haJournalResponse@10242,whole:haJournalResponse@10312,whole:haJournalResponse@10528,whole:haJournalResponse@1056,whole:haJournalResponse@10827,whole:haJournalResponse@10909,whole:haJournalResponse@11236,whole:haJournalResponse@11331,whole:haJournalResponse@11360,whole:haJournalResponse@1150,whole:haJournalResponse@1505,whole:haJournalResponse@1646,whole:haJournalResponse@1742,whole:haJournalResponse@2036,whole:haJournalResponse@2253,whole:haJournalResponse@230,whole:haJournalResponse@2753,whole:haJournalResponse@3049,whole:haJournalResponse@3115,whole:haJournalResponse@315,whole:haJournalResponse@3411,whole:haJournalResponse@3480,whole:haJournalResponse@3752,whole:haJournalResponse@3874,whole:haJournalResponse@4065,whole:haJournalResponse@4152,whole:haJournalResponse@4223,whole:haJournalResponse@4372,whole:haJournalResponse@4511,whole:haJournalResponse@4637,whole:haJournalResponse@4896,whole:haJournalResponse@4949,whole:haJournalResponse@5371,whole:haJournalResponse@5551,whole:haJournalResponse@5731,whole:haJournalResponse@589,whole:haJournalResponse@5912,whole:haJournalResponse@5952,whole:haJournalResponse@6094,whole:haJournalResponse@6156,whole:haJournalResponse@6387,whole:haJournalResponse@6478,whole:haJournalResponse@659,whole:haJournalResponse@6745,whole:haJournalResponse@6957,whole:haJournalResponse@7552,whole:haJournalResponse@7728,whole:haJournalResponse@7811,whole:haJournalResponse@795,whole:haJournalResponse@8073,whole:haJournalResponse@8214,whole:haJournalResponse@8312,whole:haJournalResponse@8576,whole:haJournalResponse@8797,whole:haJournalResponse@8867,whole:haJournalResponse@9157,whole:haJournalResponse@9326,whole:haJournalResponse@9413,whole:haJournalResponse@9858,whole:haJournalResponse@9984,whole:remoteClient@113,whole:remoteClient@144 49e1df04452dadc8f27011d9dfa162a231684c6f0354b26a71e43837bdb4f0a9
internal/registry/ha_journal.go Registry.migrateHAJournal legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Add compact per-account/region/iid pending rows to the existing registry, with durable retry and hourly page times. No new database path or receipt storage. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. B4 fix r2: Run the atomic identity-history migration in the same registry; preserve all old binding bytes and observations. file:Exec@57,registry:sql@57 300874039b3d2abbfa815d56926222caa6881bd47d827ec6c6608dc69a88d8ff
internal/registry/ha_journal.go type haJournalRequest legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Carry compact pending hints through the existing registry RPC, with no new authority. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. file:Walk@224 90f9a7d36396dbab45329af08fa6cf62fa9b57e280854ffcfff86f62dab35bb5
internal/registry/ha_journal.go type haJournalResponse legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3b: read/write bounded termination inbox, pending departures, verified identity cache and retry/cursor state in the existing SQLite registry with remote parity. No reusable receipt, arbitrary path, import/completion/start authority; retries and page times survive replay. B3 fix r1: Return compact pending-hint pages from the existing registry RPC. B4: Extend the existing registry journal/schema/RPC with scan state, guarded completion phases, durable bounded retry count and one receiver-wide identity summary claim/count. All state stays in the existing database; no queue receipt is persisted and no import/start authority is granted by an inbox entry. file:Walk@197 b940765a049b21fa944ea9c2a98150001bfe1284c110bb057715a4e113704e7d
@@ -203,12 +207,12 @@ internal/schedule/runner.go Runner.fire hint E2 accepted-legacy;rev3=census-ruli
@coverage internal/boxchoice 6b3d6aaacf54a2c2705f5c93d7799e0d9790712e165c90ead6de91e845ae8b09
@coverage internal/edge 6c07ae94aeedd5a5fed9cab1c2cc8c2997fd0f49ae280f94da01ce6bc84f28f3
@coverage internal/hadeparture 96414c792279b1616004f4d5a3ec00b5eb9f7da3a71888c5a70f85f6649ab0e4
-@coverage internal/host 149f5102f60de2dbd280c0a3f263a98f88a75ab062f18dc7a5bd64e825bc09ad
+@coverage internal/host 3fc594f5edd181c1b6a98d0291218cff215400cb59504b82cdf111deedee410d
@coverage internal/hostenv 73e273b78febb9102acb9baf06b441e5001b70f5c96b38fefc64bb50c6e726a7
@coverage internal/hostfiles 21a32d89c6143031af13cb18bc1a2227353ed8595ab23bde7abd1e9d2df92eaf
@coverage internal/lease acbfc3f1b82807209a60fb03ebf3fbacae40ddca6eba808e36750f1f5e0a412c
@coverage internal/provision ff304ed0b6c9445a18262ace1880fcbb2d536b49131a600a06257947bc2062ca
-@coverage internal/registry 73d02429f3650c58fcbbc558d87e7e9d39cdc8ba545cf152a7080c1a2c779f3e
+@coverage internal/registry d48208f3e44196997d2b8b0abe5d36f92889dcf80c6d7771791e84d528644698
@coverage internal/release d2764eeff642215672aa658ec9c10abb4d0f361bcaf2fa33238326869a3a0256
@coverage internal/schedule 45287d297f4431ec8eaa3f515ce684d5e447f99845cfa1207e4386d4897b7f3d
@coverage internal/termfence 7c996207d2d79356e5278d5bb38b636242428abd5db91a15394699546da39645
diff --git a/internal/registry/ha_journal.go b/internal/registry/ha_journal.go
index 1629c600a..9ba52c310 100644
--- a/internal/registry/ha_journal.go
+++ b/internal/registry/ha_journal.go
@@ -113,6 +113,11 @@ func (r *Registry) RetryPendingTermination(ctx context.Context, h HAPendingTermi
return out.Found, err
}
+func (r *Registry) ClaimHAIdentityPage(ctx context.Context, at time.Time) (bool, error) {
+ out, err := r.haJournal(ctx, haJournalRequest{Op: "identity_page", At: at})
+ return out.Found, err
+}
+
func (r *Registry) RecordTermination(ctx context.Context, id string, body []byte, at time.Time) error {
_, err := r.haJournal(ctx, haJournalRequest{Op: "record", ID: id, Body: body, At: at})
return err
@@ -172,6 +177,17 @@ func (r *Registry) haJournal(ctx context.Context, q haJournalRequest) (out haJou
return resp.HAJournal, e
}
switch q.Op {
+ case "identity_page":
+ if q.At.IsZero() {
+ return out, ErrHAJournal
+ }
+ res, e := r.sql.ExecContext(ctx, `INSERT INTO ha_identity_pages(id,last_page) VALUES(1,?) ON CONFLICT(id) DO UPDATE SET last_page=excluded.last_page WHERE last_page<=?`, journalTime(q.At), journalTime(q.At.Add(-time.Hour)))
+ if e != nil {
+ return out, e
+ }
+ n, e := res.RowsAffected()
+ out.Found = n == 1
+ return out, e
case "hint_count":
err = r.sql.QueryRowContext(ctx, `SELECT count(*) FROM ha_pending_terminations`).Scan(&out.Count)
return out, err
@@ -427,7 +443,7 @@ func (r *Registry) haJournal(ctx context.Context, q haJournalRequest) (out haJou
return out, e
}
if q.Code != "reserve" {
- if q.Code == "scan" || q.Code == "pending" {
+ if q.Code == "scan" || q.Code == "pending" || q.Code == "inventory" {
d.RetryCount = 0
} else {
waits := []time.Duration{30 * time.Second, time.Minute, 2 * time.Minute, 5 * time.Minute}
diff --git a/internal/registry/ha_journal_test.go b/internal/registry/ha_journal_test.go
index ab1999222..f0b146713 100644
--- a/internal/registry/ha_journal_test.go
+++ b/internal/registry/ha_journal_test.go
@@ -309,3 +309,44 @@ func TestDepartureScanPhasesAndReplay(t *testing.T) {
})
}
}
+
+func TestDepartureIdentitySummaryClaim(t *testing.T) {
+ for _, remote := range []bool{false, true} {
+ t.Run(fmt.Sprint(remote), func(t *testing.T) {
+ var r *Registry
+ var path string
+ if remote {
+ r, path = remoteTestRegistry(t)
+ } else {
+ r, path = adoptRegistry(t)
+ }
+ now := time.Now().UTC()
+ h := HAPendingTermination{Account: "111122223333", Region: "eu-west-1", IID: "i-12345678", ReceivedAt: now}
+ if err := r.ParkTermination(t.Context(), h, ""); err != nil {
+ t.Fatal(err)
+ }
+ if page, err := r.ClaimHAIdentityPage(t.Context(), now); err != nil || !page {
+ t.Fatalf("replacement page: %v %v", page, err)
+ }
+ if page, err := r.RetryPendingTermination(t.Context(), h, now, "identity_unbound"); err != nil || page {
+ t.Fatalf("hint exceeded receiver limit: %v %v", page, err)
+ }
+ r.Close()
+ var err error
+ r, err = Open(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer r.Close()
+ if page, err := r.ClaimHAIdentityPage(t.Context(), now.Add(time.Hour-time.Nanosecond)); err != nil || page {
+ t.Fatalf("restart forgot page: %v %v", page, err)
+ }
+ if page, err := r.RetryPendingTermination(t.Context(), h, now.Add(time.Hour), "identity_unbound"); err != nil || !page {
+ t.Fatalf("hourly hint page: %v %v", page, err)
+ }
+ if page, err := r.ClaimHAIdentityPage(t.Context(), now.Add(time.Hour)); err != nil || page {
+ t.Fatalf("replacement exceeded receiver limit: %v %v", page, err)
+ }
+ })
+ }
+}