carlos / platform Public

ha: page operators for retained departure edges

Send the structured retained-edges warning through PageOperator after the persisted hourly claim, preserving the log and excluding the generic C3 page. Verify exact delivery counts across registry/controller restarts and refresh the census.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 63c203ef3cdcc0215401001613bd36eae9655ea2 parent 5b4c3ed
6 files changed, +42 −8
  • docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md +1 −1
  • docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md +1 −1
  • internal/host/hadepartures_retained_test.go +34 −2
  • internal/host/hadepartures_scan.go +2 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-region-ha-p1b3b-t.tsv +3 −3

CI passed — run details

Intent

Human

<task-notification> <task-id>ac232706c4174e2eb</task-id> <tool-use-id>toolu_01KnyABBP31EWnx3YRy2FMAG</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, one small one.** All three items are addressed, and no path in the branch can delete a fixed ref's edges object. The gap is that the retained-edges state is logged but never paged. Line numbers refer to 5b4c3edb. I ran no suites. **Verdicts:** - **P18 (fixed refs never delete edges; group refs keep exact-ETag deletion): ADDRESSED** (`hadepartures_scan.go:417-452`, `:462`). - A departure counts as a group ref only when its ref equals the one derived from its own account and iid. The spelling of the ref doesn't matter. - A fixed ref always gets an exact-key read. It advances only if the object is absent, or if a newer verified incarnation exists (the file is left in place). Otherwise it stays pending with the 30/60/120/300 s backoff. - A group ref deletes only its exact retained ETag. A changed object is never deleted. - **r4 Important 1 (live replacement's edges saved onto the old incarnation): ADDRESSED** (`hadeparture_identity.go:163-166`). When a replacement is refused, Observe returns the stored observation and saves nothing. - **r4 Minor 1 (mutex held across the GET): ADDRESSED** (`hadeparture_identity.go:316-341`, GET at `:363`). Each ref now has its own in-flight channel. The registry read, store open, GET and verification all run outside the mutex, and waiters can cancel. **Can a fixed ref's edges be deleted?** No. - `DeleteRevision` at `hadepartures_scan.go:462` is the only edges-deleting call in the branch's departure code. A fixed ref can never reach it in the phase where it runs. - **Late enrolment:** whatever ETag the departure captures is never used to delete a fixed ref. - **Pre-config window:** observations may still be credited to the old iid, but that can no longer authorise a deletion. - **Replay or restart:** they go back through reobservation and a full rescan. A journal from an earlier build that marked a fixed ref's delete as uncertain takes the forced-read branch and cannot delete. - **Not reviewed:** the operator and console edges-removal flows that already existed outside the departure scanner. **New Critical: 0. New Important: 1.** **Important: the retained-edges state is only logged, never paged** (`hadepartures_scan.go:321-326`). - When the hourly claim succeeds, `retryScan` writes `ha_departure_edges_retained key=…` to the log and returns before any operator page is sent. - P18 asks for a page once per departure per hour. - Under P18 this is the normal end state for every fixed-ref departure on the dev pair. It clears only when an operator removes the retired edges or does the P17 record replacement. Without a page, the departure stays open silently and its queue message keeps redelivering until retention runs out. - Fix: send a prose-free page through the existing identity page path when the claim succeeds. Then make the backoff witness require that page; today it only forbids the generic one. There are also 3 Minors: - A retained departure re-runs a full lock rescan on every record change. - The steady 120 s queue redelivery for retained departures should be noted in the activation card. - Two items deferred from earlier rounds are still open: the Walk counting cache hits against its GET budget, and the P17/P18 step ordering in the activation card. The full write-up is in `.superpowers/sdd/2026-11-03-region-ha-p1b3b-duties/task-B4-review-r5.md`.</result> <usage><subagent_tokens>314489</subagent_tokens><tool_uses>6</tool_uses><duration_ms>83465</duration_ms></usage> </task-notification>

Human

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

Attributed to this commit: 16.9 g CO₂e (2,109,981 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 5d7c98075..d1304a093 100644
--- a/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
+++ b/docs/superpowers/notes/census-proposal-region-ha-p1b3b-t.md
@@ -134,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` → `1c02499b0afb71966d1253d3c5ccc22c7cb848edfb7b81c97f140c79516b3479`.
+Seal: `7e30dee4fb52370555ad173512d7f03782f0fbed725a8a6bf4f7e31f52c23668` → `f188e49198ae3f39bba3dac06c56a99c9463a2c72c128d27a92c0f77848bbb1e`.
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 c393bac36..9d66c5d01 100644
--- a/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
+++ b/docs/superpowers/notes/census-region-ha-p1b3b-t-claims.md
@@ -89,7 +89,7 @@ internal/host/hadepartures.go:Controller.ackDeparture B4: Inspect only local dur
internal/host/hadepartures.go:Controller.record 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.
internal/host/hadepartures_scan.go:Controller.ScanPass 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.
internal/host/hadepartures_scan.go:Controller.complete 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. B4 fix r4/P18 supersedes fixed-ref deletion: only the deterministic account/iid group reference may delete its retained exact ETag. Every other ref performs an exact-key GET and stays pending unless absent or the existing verified newer-incarnation check succeeds; the live replacement file is left intact. Group revision changes stay pending. No new key or authority read.
-internal/host/hadepartures_scan.go:Controller.retryScan 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. B4 fix r4/P18: Retained fixed edges use the existing persisted 30/60/120/300-second retry and hourly departure claim, emitting only ha_departure_edges_retained plus the key. Skip generic prose paging for that code.
+internal/host/hadepartures_scan.go:Controller.retryScan 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. B4 fix r4/P18: Retained fixed edges use the existing persisted 30/60/120/300-second retry and hourly departure claim, emitting only ha_departure_edges_retained plus the key. Skip generic prose paging for that code. B4 fix r5: After the existing durable hourly claim succeeds for retained fixed edges, keep the structured log and send PageOperator a warning with subject ha_departure_edges_retained and body code/key/box fields through the existing bounded alert sinks. Return delivery errors; never call the generic C3 page for this state. No new read site or completion authority.
internal/registry/ha_journal.go:Registry.PendingTerminationCount 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_scan.go:Registry.Departure B4: Read/write versioned scan checkpoints in the existing SQLite registry and existing remote protocol. Atomically compare checkpoint version and phase ordering; retain original authority observations, host outcomes and deletion/index recovery state. No new filesystem path or executable input.
internal/registry/ha_scan.go:Registry.DepartureScan B4: Read/write versioned scan checkpoints in the existing SQLite registry and existing remote protocol. Atomically compare checkpoint version and phase ordering; retain original authority observations, host outcomes and deletion/index recovery state. No new filesystem path or executable input.
diff --git a/internal/host/hadepartures_retained_test.go b/internal/host/hadepartures_retained_test.go
index c6c39d0ac..ae57431d5 100644
--- a/internal/host/hadepartures_retained_test.go
+++ b/internal/host/hadepartures_retained_test.go
@@ -3,6 +3,7 @@ package host
import (
"context"
"database/sql"
+ "encoding/json"
"errors"
"fmt"
"os"
@@ -165,6 +166,21 @@ func TestDepartureFixedRetainedBackoff(t *testing.T) {
bindScanIdentity(t, x, x.d.Box.Ref, x.d.Box.InstanceID)
store := &retainedEdgesStore{completionStore: &completionStore{Store: x.store, raw: x.store}, key: x.d.EdgesKey}
x.c.cfg.OpenStore = func(context.Context) (release.Store, error) { return store, nil }
+ type page struct{ Kind, Level, Subject, Body string }
+ var delivered []page
+ armPaging(newAlertSinks("http://example.test/hook", func(_ string, raw []byte) error {
+ var p page
+ if err := json.Unmarshal(raw, &p); err != nil {
+ t.Fatal(err)
+ }
+ want := page{"page", "warning", "ha_departure_edges_retained", "code=ha_departure_edges_retained key=" + x.d.EdgesKey + " box=" + x.d.Box.Ref}
+ if p != want {
+ t.Errorf("retained page=%+v want=%+v", p, want)
+ }
+ delivered = append(delivered, p)
+ return nil
+ }, "", nil, &alertCounters{}))
+ t.Cleanup(func() { armPaging(nil) })
notices := 0
x.c.cfg.Logf = func(f string, args ...any) {
if strings.HasPrefix(f, "ha_departure_edges_retained") {
@@ -187,6 +203,22 @@ func TestDepartureFixedRetainedBackoff(t *testing.T) {
waits := []time.Duration{30 * time.Second, 60 * time.Second, 120 * time.Second, 300 * time.Second}
for second := 0; second <= 7710; second++ {
x.now = start.Add(time.Duration(second) * time.Second)
+ if second == 1 || second == 4000 {
+ path := x.r.Path()
+ if err := x.r.Close(); err != nil {
+ t.Fatal(err)
+ }
+ r, err := registry.Open(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { r.Close() })
+ x.r = r
+ cfg := x.c.cfg
+ cfg.Registry = r
+ cfg.Identities.Registry = r
+ x.c = &Controller{cfg: cfg, evidence: map[string]bool{x.d.ID: true}}
+ }
due := !x.now.Before(next)
progress, err := x.c.ScanPass(t.Context())
if due {
@@ -203,8 +235,8 @@ func TestDepartureFixedRetainedBackoff(t *testing.T) {
t.Fatalf("early work at %ds: %v %v", second, progress, err)
}
d, e := x.r.Departure(t.Context(), x.d.ID)
- if e != nil || d.Phase != "authority_complete" || store.gets != attempts || store.deletes != 0 || store.indexes != 0 || notices != pages || !d.NextAttempt.Equal(next) {
- t.Fatalf("second=%d phase=%s GET=%d want=%d D=%d I=%d pages=%d want=%d next=%s want=%s err=%v", second, d.Phase, store.gets, attempts, store.deletes, store.indexes, notices, pages, d.NextAttempt, next, e)
+ if e != nil || d.Phase != "authority_complete" || store.gets != attempts || store.deletes != 0 || store.indexes != 0 || notices != pages || len(delivered) != pages || !d.NextAttempt.Equal(next) {
+ t.Fatalf("second=%d phase=%s GET=%d want=%d D=%d I=%d notices=%d delivered=%d want=%d next=%s want=%s err=%v", second, d.Phase, store.gets, attempts, store.deletes, store.indexes, notices, len(delivered), pages, d.NextAttempt, next, e)
}
}
if pages != 3 {
diff --git a/internal/host/hadepartures_scan.go b/internal/host/hadepartures_scan.go
index b58e13ccb..9cf3c0fdc 100644
--- a/internal/host/hadepartures_scan.go
+++ b/internal/host/hadepartures_scan.go
@@ -13,6 +13,7 @@ import (
"github.com/aws/smithy-go"
"github.com/carlosframework/platform/internal/activator"
+ "github.com/carlosframework/platform/internal/alerting"
"github.com/carlosframework/platform/internal/hafresh"
"github.com/carlosframework/platform/internal/lease"
"github.com/carlosframework/platform/internal/provision"
@@ -321,6 +322,7 @@ func (c *Controller) retryScan(ctx context.Context, d registry.HADeparture, host
if code == "ha_departure_edges_retained" {
if claimed {
c.logf("ha_departure_edges_retained key=%s", d.EdgesKey)
+ return PageOperator(ctx, alerting.LevelWarning, code, fmt.Sprintf("code=%s key=%s box=%s", code, d.EdgesKey, d.Box.Ref))
}
return nil
}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index d1948d69a..0c7ef29f8 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 1c02499b0afb71966d1253d3c5ccc22c7cb848edfb7b81c97f140c79516b3479
+plan14-root-reads-region-ha-p1b3b-t.tsv f188e49198ae3f39bba3dac06c56a99c9463a2c72c128d27a92c0f77848bbb1e
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 f3434ddcc..cfbe5c956 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
@@ -42,7 +42,7 @@
@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 1376049514359e774450e82ef76956e1db249cd74642de54bb7b91e0f60d7259 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. B4 fix r4/P18 supersedes fixed-ref deletion: only the deterministic account/iid group reference may delete its retained exact ETag. Every other ref performs an exact-key GET and stays pending unless absent or the existing verified newer-incarnation check succeeds; the live replacement file is left intact. Group revision changes stay pending. No new key or authority read. registry:Cursor@1644,registry:DeleteUncertain@1879,registry:DeleteUncertain@3298,registry:DeleteUncertain@3683,registry:Generation@1626,registry:Generation@1680,registry:Hosts@4440,registry:InventoryGeneration@1731,registry:PermissionAlerted@2168,registry:PermissionAlerted@3053,registry:PermissionAlerted@3827,registry:PermissionAlerted@4231,registry:PermissionAlerted@740,registry:PermissionAlerted@782,registry:Phase@1437,registry:Phase@161,registry:Phase@3177,registry:Phase@3945,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@4489,whole:HADepartureHostScan@4442,whole:HADepartureScan@542 b81686fb4af2257f43e90f85ff13e4f8bf307c6ca71a2fa84e81248d240bad32
-@legacy 7b117e4ef171d5aa0c22c1abb3f4fbda9f608cb433d29c78e4778d4ccfa7e1c0 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. B4 fix r4/P18: Retained fixed edges use the existing persisted 30/60/120/300-second retry and hourly departure claim, emitting only ha_departure_edges_retained plus the key. Skip generic prose paging for that code. whole:HADeparture@933 f74af8684251ae25b69966124853d43b12338d95d88fbd176859377c967de5da
+@legacy c05ce76eda173b29e804bfe065489769305d5056673b29850235ae177f6f4f34 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. B4 fix r4/P18: Retained fixed edges use the existing persisted 30/60/120/300-second retry and hourly departure claim, emitting only ha_departure_edges_retained plus the key. Skip generic prose paging for that code. B4 fix r5: After the existing durable hourly claim succeeds for retained fixed edges, keep the structured log and send PageOperator a warning with subject ha_departure_edges_retained and body code/key/box fields through the existing bounded alert sinks. Return delivery errors; never call the generic C3 page for this state. No new read site or completion authority. whole:HADeparture@1057 b1b08218a18a5346d11679233d32462d7db1986bfcdabf4f045d03f40e3094bc
@legacy 23bdb8d806b4ed6ffd8733c5fd60aec78871cdb23515eb1c0bbc9da6f2a2e271 internal/host/hadepartures_wiring.go armHADepartures legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3 fix r1: Install proof adapter, adoption identity and suspicion callbacks before asynchronous startup. Lazily retry the same deployment/data clients; lifetime callback reads only the current host through ExecBackend.TerminationLifetime. Add bounded structured paging for unresolved per-iid records. No new bucket, tenant input path or acquire bypass. B4: Wire the shared lock reader and existing AdoptHost entry. Read local route, Pair and duty revision only after authoritative inventory eligibility; bind its record lifetime and refuse missing/mismatched local routes. No route synthesis or pool widening. registry:Account@3494,registry:Account@7029,registry:App@7056,registry:IID@3515,registry:Incarnation@7216,registry:Pool@7075,registry:Region@3505,registry:Region@7096,registry:Revision@7451,registry:Revision@7848,registry:ServingSeq@7244,whole:DutyState@7570,whole:Pair@7433,whole:Pair@7826,whole:Pair@7832,whole:Route@7016,whole:Route@7725 cdfee30d90a7080e23a03638b0770886fcdf76998d08fd4345233350bd28059f
@legacy e154d74a30627fba72d2c1f0dd79786d939df5bb9d54a7866d799ec855d90465 internal/host/runs.go runsWorker.dutyStillOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route HA/host and existing service classification; after sink construction require an HA route still held awake locally before RunPick. Refusal only. registry:HA@309,registry:Host@287,whole:Route@237 d7b9c563b32e042e798ffbd98633be9a8eb13eaa68b574693be5937b1cd95ded
@legacy 32bf4eac2498036ddb8b662a319b1ea1af72c75509b3c62ae283614b635abdc4 internal/host/runs.go runsWorker.pickupOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Gate pickup and detached exec. When the detached gate refuses before exec, finish with the existing RefusedIncarnation result, close the picked sink and forget the active handle. Existing guarded sink Finish and cleanup paths are reused; no new input or path read. whole:Route@1180,whole:Route@1946,whole:Route@2020,whole:Route@2288,whole:Route@956 8e426a60b8e738d2dec98df9788d37bcaecbc9726c745e22a39e17ddd9abfdee
@@ -142,7 +142,7 @@ internal/host/hadepartures.go Controller.record legacy accepted-legacy accepted-
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. B4 fix r4/P18 supersedes fixed-ref deletion: only the deterministic account/iid group reference may delete its retained exact ETag. Every other ref performs an exact-key GET and stays pending unless absent or the existing verified newer-incarnation check succeeds; the live replacement file is left intact. Group revision changes stay pending. No new key or authority read. registry:Cursor@1644,registry:DeleteUncertain@1879,registry:DeleteUncertain@3298,registry:DeleteUncertain@3683,registry:Generation@1626,registry:Generation@1680,registry:Hosts@4440,registry:InventoryGeneration@1731,registry:PermissionAlerted@2168,registry:PermissionAlerted@3053,registry:PermissionAlerted@3827,registry:PermissionAlerted@4231,registry:PermissionAlerted@740,registry:PermissionAlerted@782,registry:Phase@1437,registry:Phase@161,registry:Phase@3177,registry:Phase@3945,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@4489,whole:HADepartureHostScan@4442,whole:HADepartureScan@542 b81686fb4af2257f43e90f85ff13e4f8bf307c6ca71a2fa84e81248d240bad32
-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. B4 fix r4/P18: Retained fixed edges use the existing persisted 30/60/120/300-second retry and hourly departure claim, emitting only ha_departure_edges_retained plus the key. Skip generic prose paging for that code. whole:HADeparture@933 f74af8684251ae25b69966124853d43b12338d95d88fbd176859377c967de5da
+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. B4 fix r4/P18: Retained fixed edges use the existing persisted 30/60/120/300-second retry and hourly departure claim, emitting only ha_departure_edges_retained plus the key. Skip generic prose paging for that code. B4 fix r5: After the existing durable hourly claim succeeds for retained fixed edges, keep the structured log and send PageOperator a warning with subject ha_departure_edges_retained and body code/key/box fields through the existing bounded alert sinks. Return delivery errors; never call the generic C3 page for this state. No new read site or completion authority. whole:HADeparture@1057 b1b08218a18a5346d11679233d32462d7db1986bfcdabf4f045d03f40e3094bc
internal/host/hadepartures_wiring.go armHADepartures legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B3 fix r1: Install proof adapter, adoption identity and suspicion callbacks before asynchronous startup. Lazily retry the same deployment/data clients; lifetime callback reads only the current host through ExecBackend.TerminationLifetime. Add bounded structured paging for unresolved per-iid records. No new bucket, tenant input path or acquire bypass. B4: Wire the shared lock reader and existing AdoptHost entry. Read local route, Pair and duty revision only after authoritative inventory eligibility; bind its record lifetime and refuse missing/mismatched local routes. No route synthesis or pool widening. registry:Account@3494,registry:Account@7029,registry:App@7056,registry:IID@3515,registry:Incarnation@7216,registry:Pool@7075,registry:Region@3505,registry:Region@7096,registry:Revision@7451,registry:Revision@7848,registry:ServingSeq@7244,whole:DutyState@7570,whole:Pair@7433,whole:Pair@7826,whole:Pair@7832,whole:Route@7016,whole:Route@7725 cdfee30d90a7080e23a03638b0770886fcdf76998d08fd4345233350bd28059f
internal/host/runs.go runsWorker.dutyStillOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Read route HA/host and existing service classification; after sink construction require an HA route still held awake locally before RunPick. Refusal only. registry:HA@309,registry:Host@287,whole:Route@237 d7b9c563b32e042e798ffbd98633be9a8eb13eaa68b574693be5937b1cd95ded
internal/host/runs.go runsWorker.pickupOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=Gate pickup and detached exec. When the detached gate refuses before exec, finish with the existing RefusedIncarnation result, close the picked sink and forget the active handle. Existing guarded sink Finish and cleanup paths are reused; no new input or path read. whole:Route@1180,whole:Route@1946,whole:Route@2020,whole:Route@2288,whole:Route@956 8e426a60b8e738d2dec98df9788d37bcaecbc9726c745e22a39e17ddd9abfdee
@@ -207,7 +207,7 @@ 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 189876a87b50fabd811abfc30375c19d47b264a0991878c3d58e5f73c7b18883
+@coverage internal/host 171eea341abc65d64b62b664cd112fa445b86f3856622770e22453993b2909e6
@coverage internal/hostenv 73e273b78febb9102acb9baf06b441e5001b70f5c96b38fefc64bb50c6e726a7
@coverage internal/hostfiles 21a32d89c6143031af13cb18bc1a2227353ed8595ab23bde7abd1e9d2df92eaf
@coverage internal/lease acbfc3f1b82807209a60fb03ebf3fbacae40ddca6eba808e36750f1f5e0a412c