| 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. B5: Route the unchanged AdoptHost callback through measured telemetry; no new authority or lock read.;rev3=census-ruling-region-ha-p3b;basis=Gate and register the existing departure scan with admission before any work. Existing registry/object reads remain, closed members do not import, and shutdown cancels/joins registered work; no new root input.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: when a departure is blocked only on inventory freshness, signals the bounded early backstop round (global 60 s spacing, three per evidence) instead of waiting for the 30 min backstop. FreshAfter/I3 gates unchanged; no walk inside the step; no new read.;rev3=census-ruling-region-ha-g3-fixes;basis=Track current record revisions across inventory publications; separate lease waits from blockers and persist Cursor as zero for rollback. Drop removed records from coverage while retaining adoption or validated-successor gates for current hosts. Use the bounded lock-prefix listing only after validating every current host prefix; preserve per-host reads for known duties and fall back to the existing 32-host scan when listing evidence is unavailable. Cache listing evidence only in this process under scanMu, invalidate it on blocked work or inventory changes, and permit 128 reads with proven listing coverage. Added reads include departure LastError, host scan state and registry Hosts; the new remote read is a bounded LIST of the configured lock prefix in the existing data bucket.;rev3=census-ruling-region-ha-dr5;basis=BASIS AMENDED by spec 7.5 (DR-5, approved by agent manager 8a3d302 for the region HA standing approval): the B4 completion gate "adoption or validated successor" becomes "adoption, validated successor, or unserved discharge". A host may be discharged unserved only when (1) its lock is a valid release marker naming the departed box or a held lock whose expiry this box read as passed, (2) this box would adopt it but for the pool (placement, HA, lifetime, kind and sidecar rules, not denied), and (3) the complete in-memory departure view shows no in-scope box that serves or may serve the pool, other than group members with a departure enrolled in this box journal (fixed refs never count as gone; unknown served_pools blocks). Every unserved discharge is rechecked at one finalization gate immediately before the conditional edges delete. An unserved host is never imported and its lock is never written, so no lease authority moves; the full zero-match rescan still runs, with unserved hosts the only allowed matches. Inputs: served_pools comes from edges files that only box roles write (already trusted by this scan for identity and by placement); a box agent that lies can at most let a departure finish without import, which it can already cause by deleting edges files with its own role. No new remote read; reads Hosts/Rescan/Result from the local journal. The rescan is due at once.;rev3=census-ruling-ha-1192;basis=records a matched host whose app is TrashRetired, with a released or expired lock, as result "trashed" (no import, lock untouched) instead of adopting it; only reads added are the trash marker and production flag, and only when the local registry has no route for the host registry:Cursor@2032,registry:Cursor@2122,registry:Cursor@9546,registry:Generation@2094,registry:Generation@8811,registry:Hosts@2306,registry:Hosts@2326,registry:Hosts@3357,registry:Hosts@3977,registry:Hosts@4045,registry:Hosts@6053,registry:Hosts@6440,registry:Hosts@7147,registry:Hosts@7259,registry:Hosts@7498,registry:Hosts@8256,registry:InventoryGeneration@1913,registry:LastError@2902,registry:Lifetime@4006,registry:NotBefore@2191,registry:NotBefore@3905,registry:NotBefore@4378,registry:NotBefore@4419,registry:NotBefore@4444,registry:NotBefore@6021,registry:NotBefore@6410,registry:NotBefore@7111,registry:NotBefore@7177,registry:NotBefore@9220,registry:NotBefore@9274,registry:NotBefore@9599,registry:Observed@5592,registry:Observed@5739,registry:Observed@6293,registry:Observed@6327,registry:Phase@1448,registry:Phase@2049,registry:Phase@2384,registry:Phase@5309,registry:Phase@634,registry:Phase@689,registry:Phase@729,registry:RecordDigest@3287,registry:RecordDigest@4340,registry:RecordDigest@6350,registry:Rescan@2137,registry:Rescan@4320,registry:Rescan@5478,registry:Rescan@7678,registry:Rescan@8997,registry:Rescan@9385,registry:Rescan@9438,registry:Result@5991,registry:Result@6385,registry:Result@7226,registry:Result@7464,registry:Result@8222,registry:Unresolved@2156,registry:Unresolved@3811,registry:Unresolved@8280,registry:Unresolved@8868,registry:Unresolved@9113,registry:Unresolved@9396,registry:Unresolved@9562,registry:Version@7954,registry:Visited@2073,registry:Visited@2219,registry:Visited@3262,registry:Visited@3762,registry:Visited@3838,registry:Visited@3932,registry:Visited@8307,registry:Visited@9628,registry:Waiting@2175,registry:Waiting@9128,registry:Waiting@9203,registry:Waiting@9417,registry:Waiting@9582,whole:HADeparture@10014,whole:HADeparture@1111,whole:HADeparture@1230,whole:HADeparture@1415,whole:HADeparture@1704,whole:HADeparture@2517,whole:HADeparture@2714,whole:HADeparture@2870,whole:HADeparture@3005,whole:HADeparture@350,whole:HADeparture@392,whole:HADeparture@5589,whole:HADeparture@6941,whole:HADeparture@7922,whole:HADeparture@8058,whole:HADeparture@8414,whole:HADeparture@914,whole:HADeparture@9845,whole:HADepartureHostScan@2308,whole:HADepartureHostScan@2328,whole:HADepartureHostScan@3359,whole:HADepartureHostScan@3979,whole:HADepartureHostScan@4047,whole:HADepartureHostScan@4081,whole:HADepartureHostScan@6055,whole:HADepartureHostScan@6071,whole:HADepartureHostScan@6112,whole:HADepartureHostScan@6442,whole:HADepartureHostScan@6458,whole:HADepartureHostScan@7149,whole:HADepartureHostScan@7165,whole:HADepartureHostScan@7261,whole:HADepartureHostScan@7277,whole:HADepartureHostScan@7500,whole:HADepartureHostScan@7516,whole:HADepartureHostScan@8258,whole:HADepartureHostScan@8274,whole:HADepartureScan@7859,whole:HADepartureScan@8802,whole:HADepartureScan@9779,whole:HADepartureVisit@2075,whole:HADepartureVisit@2221,whole:HADepartureVisit@3264,whole:HADepartureVisit@3764,whole:HADepartureVisit@3782,whole:HADepartureVisit@3840,whole:HADepartureVisit@3858,whole:HADepartureVisit@3934,whole:HADepartureVisit@3952,whole:HADepartureVisit@8309,whole:HADepartureVisit@8327,whole:HADepartureVisit@9630 d11e9de047f7f5dde6a4dbab412fea5c061b0d8c4fbb018685f1705ab5859693 |
| 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. B5: Increment completion counter only after the durable complete phase; C4 ordering stays after that commit.;rev3=census-ruling-region-ha-p3b;basis=Require registered admitted work before completing a departure or acknowledging it. Existing coverage, inventory, lease and successor reads remain; closed members defer rather than clear obligations.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: drops the per-departure nudge bookkeeping (moved to a fixed-size global limiter). Completion gates, exact-ETag deletion and reads unchanged.;rev3=census-ruling-region-ha-g3-fixes;basis=Require current inventory visit coverage and re-read group edges before conditional deletion. Verify identity and scope before rebinding a changed ETag; preserve fixed-ref retention and exact-ETag deletion. Reads scan EdgesETag and coverage state; no new object key or read source.;rev3=census-ruling-region-ha-dr2;basis=DR-2: after the edges phases, calls retireStatusSnapshot, which for a deterministic account/iid group reference only does one GET of status/boxes/<ref>.json in the deployment store and a conditional delete of that exact revision (ETag). Best-effort and time-bounded (at most 5 s, always leaving 2 s of the step for the completion save; Astra R1 P2): any failure or timeout is logged and never holds completion, paging or acknowledgement. Fixed refs untouched. No filesystem, executable or new authority read; no change to the edges deletion, completion gates or ordering.;rev3=census-ruling-region-ha-dr5;basis=DR-5: one finalization gate immediately before the conditional edges delete revalidates unserved discharges (unservedRevoked: local view, policy, journal only); on failure clears DeleteUncertain and resets to a fresh walk before any delete. The completion log counts imported hosts only. No new remote read.;rev3=census-ruling-ha-1192;basis=excludes "trashed" hosts from the recovered count, as it does "unserved" registry:DeleteUncertain@3813,registry:DeleteUncertain@4544,registry:DeleteUncertain@4997,registry:EdgesETag@1894,registry:EdgesETag@2906,registry:Hosts@5848,registry:InventoryGeneration@1846,registry:PermissionAlerted@2426,registry:PermissionAlerted@3559,registry:PermissionAlerted@5141,registry:PermissionAlerted@5545,registry:PermissionAlerted@841,registry:PermissionAlerted@883,registry:Phase@1002,registry:Phase@1042,registry:Phase@1538,registry:Phase@262,registry:Phase@3692,registry:Phase@5259,registry:Phase@680,registry:Phase@950,registry:Phase@967,registry:Rescan@4574,registry:Result@5863,registry:Result@5896,registry:Version@665,registry:Visited@4595,whole:HADeparture@2846,whole:HADeparture@315,whole:HADeparture@442,whole:HADeparture@4423,whole:HADeparture@5671,whole:HADeparture@6057,whole:HADepartureHostScan@5850,whole:HADepartureScan@1718,whole:HADepartureScan@4426,whole:HADepartureScan@643,whole:HADepartureVisit@4597 f33013ac30442297b3e54f41180c4216262080cbeb373f9d1617ab7c47b64a2a |