carlos / platform Public

Durability 3a: sealed escrow for instance secrets, no raw writes (#477)

No release from 3a on writes <host>.env, instance.key or report.token to
the bucket unsealed, born-HA hosts included. One classifier
(internal/layout/pubclass) decides what a publication may carry and hands
out the only value that can stage a sealed item; a go/ast guard holds every
staging call and every files-manifest write to it. Sealed items are
appconfig v2 envelopes bound to account and app, sealed to the box's own
CARLOS_SECRETS_KEY, with a keyed digest. Every activator host gets an
escrow at <hibernate prefix>/files/0/, published from the launch's one
capture of the env and by a 30 s sweep; a box that lost an env restores
the sealed copy instead of minting. Minted values and the trio are
write-once against the escrow through one gate for HA and non-HA (a
divergence refuses, alerts and leaves <data>/.escrow/<host>.conflict); a
box key changed outside the console fails closed. After an uncertain
commit the publisher must re-read the manifest. Parked claim, moves and
relocation publishers refuse raw-secret baselines and pins. Instance
create, lifetime recovery and fleet key replacement share one account
lock; replacement is refused while the fleet has instances, trashed apps
included.

Rulings: Paul 2026-10-31 (rollback as today, the step 7 copier refuses
raw items; one fleet-key lock), Paul 2026-11-01 (hostname reuse left to
#199, binding cut; refuse raw baselines, no 4th round), controller
2026-11-01 (key change fails closed). Spec rev 4.3; copy DUR3A-C01..C02
approved by delegation (Luna). Reviews: plan Astra R1-R3; per-task Astra
(3-5) and Opus (6-7); whole-branch Astra R1-R3, R3's one P1 fixed and
checked by Opus (closed). Census census-ruling-durability-3a-escrow
approved by Astra on #280. Follow-ups in discussion 499. Historical raw
objects stay until 3b's migration, so #477 stays open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from durability-3a-escrow into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 44d810d0222ddd26a90e39ad309b2d4e3966fd40 parent 00bf5b8
170 files changed, +13,540 −966
  • docs/site/cli.md +2 −0
  • docs/superpowers/notes/census-durability-3a-escrow-claims.md +97 −0
  • docs/superpowers/notes/census-proposal-durability-3a-escrow.md +127 −0
  • docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md +1 −1
  • docs/superpowers/plans/LUNA-COPY-BRIEF-DURABILITY-3A.md +75 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-durability-3a-branch-R2.md +119 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-durability-3a-branch-R3.md +133 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-durability-3a-branch.md +100 −0
  • docs/superpowers/specs/2026-10-23-durability-design.md +23 −2
  • internal/activator/admintoken.go +5 −4
  • internal/activator/backend_exec.go +51 −0
  • internal/activator/claim_snapshot.go +1 −1
  • internal/activator/escrow.go +1,634 −0
  • internal/activator/escrow_branchfix_test.go +110 −0
  • internal/activator/escrow_hostname_reuse_test.go +58 −0
  • internal/activator/escrow_known_guard_test.go +263 −0
  • internal/activator/escrow_linux_test.go +138 −0
  • internal/activator/escrow_stamp_linux.go +18 −0
  • internal/activator/escrow_stamp_other.go +12 −0
  • internal/activator/escrow_test.go +1,642 −0
  • internal/activator/haescrow_branchfix_test.go +339 −0
  • internal/activator/hafiles.go +257 −66
  • internal/activator/hafiles_test.go +177 −22
  • internal/activator/harelease_test.go +14 −6
  • internal/activator/hasecrets.go +126 −80
  • internal/activator/hasecrets_test.go +66 −12
  • internal/activator/hawake.go +85 −7
  • internal/activator/hawake_test.go +285 −3
  • internal/activator/instancekey.go +13 −9
  • internal/activator/paths.go +6 −0
  • internal/activator/rawsecret_test.go +295 −0
  • internal/activator/rootfs_deploy_test.go +8 −1
  • internal/activator/rootfs_test.go +4 −1
  • internal/activator/seedplace.go +3 −1
  • internal/console/apiinstances.go +4 −3
  • internal/console/fleetsecrets_race_test.go +207 −0
  • internal/console/fleetsecretskey.go +65 −3
  • internal/console/fleetsecretskey_test.go +356 −0
  • internal/console/lifetimes_create_test.go +14 −21
  • internal/console/lifetimes_recovery.go +4 −0
  • internal/console/recordcreators_guard_test.go +157 −0
  • internal/console/sealkey_guard_test.go +4 −0
  • internal/console/store.go +19 −0
  • internal/host/agent.go +48 −0
  • internal/host/buildstate_carry_test.go +1 −0
  • internal/host/buildstate_moves_test.go +7 −1
  • internal/host/claimfiles_test.go +0 −1
  • internal/host/claimfilesseed_assembly_linux_test.go +0 −3
  • internal/host/claimfilesseed_integration_linux_test.go +0 −3
  • internal/host/claimfilesseed_select_linux_test.go +0 −3
  • internal/host/claimfilesseed_stage.go +13 −2
  • internal/host/claimfilesseed_stage_linux_test.go +3 −3
  • internal/host/escrow_loop.go +52 −0
  • internal/host/escrow_publication_race_linux_test.go +100 −0
  • internal/host/hawake_wiring_test.go +26 −2
  • internal/host/movesbuildstatepark_test.go +3 −1
  • internal/host/movescarries_test.go +8 −6
  • internal/host/movesclose_order_test.go +4 −0
  • internal/host/movesenvpin_lifetime_test.go +4 −0
  • internal/host/movesenvpin_test.go +7 −0
  • internal/host/movesenvskew_test.go +2 −0
  • internal/host/movesevents_test.go +2 −0
  • internal/host/movesfiles.go +108 −74
  • internal/host/movesfiles_test.go +102 −162
  • internal/host/movesfilescap_test.go +0 −2
  • internal/host/movesfileslive_test.go +7 −4
  • internal/host/movesfinal_test.go +20 −1
  • internal/host/movesheldclaim_test.go +12 −1
  • internal/host/moveshome_fixture_test.go +12 −0
  • internal/host/moveshome_target_test.go +8 −0
  • internal/host/moveshome_test.go +1 −0
  • internal/host/movesinstall_test.go +12 −11
  • internal/host/movesland_commit_test.go +9 −0
  • internal/host/movesland_finalfix_test.go +15 −9
  • internal/host/movesland_probe_test.go +11 −0
  • internal/host/movesland_test.go +32 −3
  • internal/host/movesloss_test.go +23 −0
  • internal/host/movespaging_test.go +27 −0
  • internal/host/movesparks_test.go +6 −0
  • internal/host/movespass_lost_test.go +3 −0
  • internal/host/movesphase1_harness_test.go +13 −2
  • internal/host/movesprobeowners_committed_test.go +11 −0
  • internal/host/movesprobeowners_fix1_test.go +9 −0
  • internal/host/movesprobeowners_test.go +8 −0
  • internal/host/movesrecover_test.go +15 −0
  • internal/host/movesrecoveryowners_test.go +11 −0
  • internal/host/movesretire_byop_test.go +1 −0
  • internal/host/movesretry_test.go +7 −0
  • internal/host/movesrevert_test.go +6 −0
  • internal/host/movesrollback_finalfix_test.go +9 −2
  • internal/host/movesrollback_test.go +20 −0
  • internal/host/movesrollback_witness_test.go +2 −0
  • internal/host/movessources_test.go +6 −0
  • internal/host/movesstuckpage_test.go +4 −0
  • internal/host/moveswakesource_linux_test.go +6 −0
  • internal/host/parkedrefusals_linux_test.go +245 −0
  • internal/host/parkedsecretflow_test.go +33 −0
  • internal/host/plan10_j2_adapter_test.go +2 −0
  • internal/host/plan13_amendments_test.go +1 −0
  • internal/host/plan13_fix1_test.go +1 −0
  • internal/host/rawbaseline_linux_test.go +176 −0
  • internal/host/rawsecretpage_test.go +59 −0
  • internal/host/relocationbuild_test.go +7 −1
  • internal/host/relocationflush.go +47 −32
  • internal/host/relocationflush_adoption_test.go +2 −3
  • internal/host/relocationflush_saferead_linux_test.go +38 −12
  • internal/host/relocationflush_wake_linux_test.go +9 −29
  • internal/host/relocationprobefiles_linux_test.go +44 −96
  • internal/host/schedule_wiring.go +13 −11
  • internal/host/schedule_wiring_test.go +103 −0
  • internal/hostfiles/contract.go +8 −3
  • internal/hostfiles/hostfiles_test.go +84 −7
  • internal/hostfiles/manifest.go +7 −0
  • internal/hostfiles/origins_test.go +10 −10
  • internal/hostfiles/platform.go +3 −0
  • internal/hostfiles/prepared.go +5 −2
  • internal/hostfiles/prepared_test.go +5 −5
  • internal/hostfiles/publisher.go +72 −35
  • internal/hostfiles/publisher_refresh_test.go +99 −0
  • internal/hostfiles/rawbaseline.go +65 −0
  • internal/hostfiles/rawbaseline_test.go +100 −0
  • internal/hostfiles/rawsecrets.go +35 −0
  • internal/hostfiles/rawsecrets_test.go +104 −0
  • internal/hostfiles/refuse.go +95 −0
  • internal/hostfiles/refuse_other.go +16 −0
  • internal/hostfiles/refuse_test.go +206 −0
  • internal/hostfiles/restore.go +41 −5
  • internal/hostfiles/sealed.go +263 −0
  • internal/hostfiles/sealed_test.go +474 −0
  • internal/hostfiles/seed.go +6 −0
  • internal/hostrelocate/pin.go +6 −0
  • internal/hostrelocate/pin_envkey_test.go +2 −0
  • internal/hostrelocate/pin_test.go +8 −0
  • internal/hostrelocate/pin_versioned_test.go +1 −0
  • internal/hostrelocate/rawbaseline_test.go +132 −0
  • internal/layout/extras.go +5 −36
  • internal/layout/extras_test.go +3 −25
  • internal/layout/hostsused.go +2 −1
  • internal/layout/inventory.go +62 −0
  • internal/layout/inventory_test.go +90 −0
  • internal/layout/pass_linux_test.go +5 −4
  • internal/layout/plan.go +27 −109
  • internal/layout/pubclass/names.go +140 −0
  • internal/layout/pubclass/pubclass.go +290 −0
  • internal/layout/pubclass/pubclass_test.go +246 −0
  • internal/layout/pubclass/publication_guard_test.go +1,132 −0
  • internal/layout/pubclass/testdata/publication_guard/baseline.go +21 −0
  • internal/layout/pubclass/testdata/publication_guard/clean.go +145 −0
  • internal/layout/pubclass/testdata/publication_guard/embedding.go +18 −0
  • internal/layout/pubclass/testdata/publication_guard/iface.go +21 −0
  • internal/layout/pubclass/testdata/publication_guard/ignored.go +20 −0
  • internal/layout/pubclass/testdata/publication_guard/manifestwrite.go +89 −0
  • internal/layout/pubclass/testdata/publication_guard/mixedalias.go +40 −0
  • internal/layout/pubclass/testdata/publication_guard/nilvar.go +34 −0
  • internal/layout/pubclass/testdata/publication_guard/preflight.go +19 −0
  • internal/layout/pubclass/testdata/publication_guard/prepared.go +17 −0
  • internal/layout/pubclass/testdata/publication_guard/reassign.go +48 −0
  • internal/layout/pubclass/testdata/publication_guard/refusalwrites.go +41 −0
  • internal/layout/pubclass/testdata/publication_guard/unclassified.go +57 −0
  • internal/layout/pubclass/testdata/publication_guard/unmapped.go +18 −0
  • internal/layout/pubclass/testdata/publication_guard/wrapper.go +11 −0
  • internal/layout/pubclass_guard_test.go +47 −0
  • internal/provision/durability_3a_branchfix2b_census_test.go +19 −0
  • internal/provision/durability_3a_branchfix3_census_test.go +25 −0
  • internal/provision/durability_3a_branchfix3b_census_test.go +25 −0
  • internal/provision/durability_3a_branchfix_census_test.go +27 −0
  • internal/provision/durability_3a_escrow_census_test.go +74 −0
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv +160 −0

CI passed — run details

docs/site/cli.md

Loading diff…

docs/superpowers/notes/census-durability-3a-escrow-claims.md

Loading diff…

docs/superpowers/notes/census-proposal-durability-3a-escrow.md

Loading diff…

docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md

Loading diff…

docs/superpowers/plans/LUNA-COPY-BRIEF-DURABILITY-3A.md

Loading diff…

docs/superpowers/reviews/CODEX-REVIEW-BRIEF-durability-3a-branch-R2.md

Loading diff…

docs/superpowers/reviews/CODEX-REVIEW-BRIEF-durability-3a-branch-R3.md

Loading diff…

docs/superpowers/reviews/CODEX-REVIEW-BRIEF-durability-3a-branch.md

Loading diff…

docs/superpowers/specs/2026-10-23-durability-design.md

Loading diff…

internal/activator/admintoken.go

Loading diff…

internal/activator/backend_exec.go

Loading diff…

internal/activator/claim_snapshot.go

Loading diff…

internal/activator/escrow.go

Loading diff…

internal/activator/escrow_branchfix_test.go

Loading diff…

internal/activator/escrow_hostname_reuse_test.go

Loading diff…

internal/activator/escrow_known_guard_test.go

Loading diff…

internal/activator/escrow_linux_test.go

Loading diff…

internal/activator/escrow_stamp_linux.go

Loading diff…

internal/activator/escrow_stamp_other.go

Loading diff…

internal/activator/escrow_test.go

Loading diff…

internal/activator/haescrow_branchfix_test.go

Loading diff…

internal/activator/hafiles.go

Loading diff…

internal/activator/hafiles_test.go

Loading diff…

internal/activator/harelease_test.go

Loading diff…

internal/activator/hasecrets.go

Loading diff…

internal/activator/hasecrets_test.go

Loading diff…

internal/activator/hawake.go

Loading diff…

internal/activator/hawake_test.go

Loading diff…

internal/activator/instancekey.go

Loading diff…

internal/activator/paths.go

Loading diff…

internal/activator/rawsecret_test.go

Loading diff…

internal/activator/rootfs_deploy_test.go

Loading diff…

internal/activator/rootfs_test.go

Loading diff…

internal/activator/seedplace.go

Loading diff…

internal/console/apiinstances.go

Loading diff…

internal/console/fleetsecrets_race_test.go

Loading diff…

internal/console/fleetsecretskey.go

Loading diff…

internal/console/fleetsecretskey_test.go

Loading diff…

internal/console/lifetimes_create_test.go

Loading diff…

internal/console/lifetimes_recovery.go

Loading diff…

internal/console/recordcreators_guard_test.go

Loading diff…

internal/console/sealkey_guard_test.go

Loading diff…

internal/console/store.go

Loading diff…

internal/host/agent.go

Loading diff…

internal/host/buildstate_carry_test.go

Loading diff…

internal/host/buildstate_moves_test.go

Loading diff…

internal/host/claimfiles_test.go

Loading diff…

internal/host/claimfilesseed_assembly_linux_test.go

Loading diff…

internal/host/claimfilesseed_integration_linux_test.go

Loading diff…

internal/host/claimfilesseed_select_linux_test.go

Loading diff…

internal/host/claimfilesseed_stage.go

Loading diff…

internal/host/claimfilesseed_stage_linux_test.go

Loading diff…

internal/host/escrow_loop.go

Loading diff…

internal/host/escrow_publication_race_linux_test.go

Loading diff…

internal/host/hawake_wiring_test.go

Loading diff…

internal/host/movesbuildstatepark_test.go

Loading diff…

internal/host/movescarries_test.go

Loading diff…

internal/host/movesclose_order_test.go

Loading diff…

internal/host/movesenvpin_lifetime_test.go

Loading diff…

internal/host/movesenvpin_test.go

Loading diff…

internal/host/movesenvskew_test.go

Loading diff…

internal/host/movesevents_test.go

Loading diff…

internal/host/movesfiles.go

Loading diff…

internal/host/movesfiles_test.go

Loading diff…

internal/host/movesfilescap_test.go

Loading diff…

internal/host/movesfileslive_test.go

Loading diff…

internal/host/movesfinal_test.go

Loading diff…

internal/host/movesheldclaim_test.go

Loading diff…

internal/host/moveshome_fixture_test.go

Loading diff…

internal/host/moveshome_target_test.go

Loading diff…

internal/host/moveshome_test.go

Loading diff…

internal/host/movesinstall_test.go

Loading diff…

internal/host/movesland_commit_test.go

Loading diff…

internal/host/movesland_finalfix_test.go

Loading diff…

internal/host/movesland_probe_test.go

Loading diff…

internal/host/movesland_test.go

Loading diff…

internal/host/movesloss_test.go

Loading diff…

internal/host/movespaging_test.go

Loading diff…

internal/host/movesparks_test.go

Loading diff…

internal/host/movespass_lost_test.go

Loading diff…

internal/host/movesphase1_harness_test.go

Loading diff…

internal/host/movesprobeowners_committed_test.go

Loading diff…

internal/host/movesprobeowners_fix1_test.go

Loading diff…

internal/host/movesprobeowners_test.go

Loading diff…

internal/host/movesrecover_test.go

Loading diff…

internal/host/movesrecoveryowners_test.go

Loading diff…

internal/host/movesretire_byop_test.go

Loading diff…

internal/host/movesretry_test.go

Loading diff…

internal/host/movesrevert_test.go

Loading diff…

internal/host/movesrollback_finalfix_test.go

Loading diff…

internal/host/movesrollback_test.go

Loading diff…

internal/host/movesrollback_witness_test.go

Loading diff…

internal/host/movessources_test.go

Loading diff…

internal/host/movesstuckpage_test.go

Loading diff…

internal/host/moveswakesource_linux_test.go

Loading diff…

internal/host/parkedrefusals_linux_test.go

Loading diff…

internal/host/parkedsecretflow_test.go

Loading diff…

internal/host/plan10_j2_adapter_test.go

Loading diff…

internal/host/plan13_amendments_test.go

Loading diff…

internal/host/plan13_fix1_test.go

Loading diff…

internal/host/rawbaseline_linux_test.go

Loading diff…

internal/host/rawsecretpage_test.go

Loading diff…

internal/host/relocationbuild_test.go

Loading diff…

internal/host/relocationflush.go

Loading diff…

internal/host/relocationflush_adoption_test.go

Loading diff…

internal/host/relocationflush_saferead_linux_test.go

Loading diff…

internal/host/relocationflush_wake_linux_test.go

Loading diff…

internal/host/relocationprobefiles_linux_test.go

Loading diff…

internal/host/schedule_wiring.go

Loading diff…

internal/host/schedule_wiring_test.go

Loading diff…

internal/hostfiles/contract.go

Loading diff…

internal/hostfiles/hostfiles_test.go

Loading diff…

internal/hostfiles/manifest.go

Loading diff…

internal/hostfiles/origins_test.go

Loading diff…

internal/hostfiles/platform.go

Loading diff…

internal/hostfiles/prepared.go

Loading diff…

internal/hostfiles/prepared_test.go

Loading diff…

internal/hostfiles/publisher.go

Loading diff…

internal/hostfiles/publisher_refresh_test.go

Loading diff…

internal/hostfiles/rawbaseline.go

Loading diff…

internal/hostfiles/rawbaseline_test.go

Loading diff…

internal/hostfiles/rawsecrets.go

Loading diff…

internal/hostfiles/rawsecrets_test.go

Loading diff…

internal/hostfiles/refuse.go

Loading diff…

internal/hostfiles/refuse_other.go

Loading diff…

internal/hostfiles/refuse_test.go

Loading diff…

internal/hostfiles/restore.go

Loading diff…

internal/hostfiles/sealed.go

Loading diff…

internal/hostfiles/sealed_test.go

Loading diff…

internal/hostfiles/seed.go

Loading diff…

internal/hostrelocate/pin.go

Loading diff…

internal/hostrelocate/pin_envkey_test.go

Loading diff…

internal/hostrelocate/pin_test.go

Loading diff…

internal/hostrelocate/pin_versioned_test.go

Loading diff…

internal/hostrelocate/rawbaseline_test.go

Loading diff…

internal/layout/extras.go

Loading diff…

internal/layout/extras_test.go

Loading diff…

internal/layout/hostsused.go

Loading diff…

internal/layout/inventory.go

Loading diff…

internal/layout/inventory_test.go

Loading diff…

internal/layout/pass_linux_test.go

Loading diff…

internal/layout/plan.go

Loading diff…

internal/layout/pubclass/names.go

Loading diff…

internal/layout/pubclass/pubclass.go

Loading diff…

internal/layout/pubclass/pubclass_test.go

Loading diff…

internal/layout/pubclass/publication_guard_test.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/baseline.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/clean.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/embedding.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/iface.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/ignored.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/manifestwrite.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/mixedalias.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/nilvar.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/preflight.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/prepared.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/reassign.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/refusalwrites.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/unclassified.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/unmapped.go

Loading diff…

internal/layout/pubclass/testdata/publication_guard/wrapper.go

Loading diff…

internal/layout/pubclass_guard_test.go

Loading diff…

internal/provision/durability_3a_branchfix2b_census_test.go

Loading diff…

internal/provision/durability_3a_branchfix3_census_test.go

Loading diff…

internal/provision/durability_3a_branchfix3b_census_test.go

Loading diff…

internal/provision/durability_3a_branchfix_census_test.go

Loading diff…

internal/provision/durability_3a_escrow_census_test.go

Loading diff…

internal/provision/plan9_b8_census_test.go

Loading diff…

internal/provision/testdata/plan14-root-reads-chain.tsv

Loading diff…

internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv

Loading diff…