carlos / platform Public

release: unstamped planned rows take the full install (Astra R1)

Astra R1 (NOT READY): a left link is no evidence its build was admitted,
the stamp was not bound to its checks, and the age guard was brittle.
stampLeftLink is gone. An exec-backed, activator-owned row with no
Version whose link names the target now skips the up-to-date return and
takes the existing install path, every gate included, as a first install
does. Its stamp keeps the row's PrevVersion, and its refusal clear keeps
the up-to-date rule (a record that still blocks the selected build or
the head stays). Named units and residents are left as they were.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 736d51a9f6fb3c6a10a8b373748cffef474e8a67 parent 3f8c8fc
6 files changed, +65 −144
  • docs/superpowers/notes/census-proposal-dr1-left-link.md +4 −11
  • internal/host/coldwake_leftlink_test.go +1 −2
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv +6 −6
  • internal/release/adopt.go +27 −52
  • internal/release/unstamped_live_test.go +26 −72

CI failed — run details

diff --git a/docs/superpowers/notes/census-proposal-dr1-left-link.md b/docs/superpowers/notes/census-proposal-dr1-left-link.md
index 68158b28d..eda933959 100644
--- a/docs/superpowers/notes/census-proposal-dr1-left-link.md
+++ b/docs/superpowers/notes/census-proposal-dr1-left-link.md
@@ -1,23 +1,16 @@
# Census approval: dr1-left-link
-Ruling `census-ruling-dr1-left-link`. The independent reviewer approves or rejects every change below, 1 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
-
-| unit | change | read sites | what changed |
-|---|---|---|---|
-| `internal/release/adopt.go` `adoptHost` | sites | +whole:Route | the up-to-date return calls stampLeftLink; no new read of its own (the Route passed whole) |
+Ruling `census-ruling-dr1-left-link`. The independent reviewer approves or rejects every change below, 2 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
Envelopes re-pinned: `internal/host`, `internal/release`.
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
-Recorded dispositions, which each change must still satisfy:
-
-- `internal/release/adopt.go` `adoptHost`: authority, task B3,E1,E2,E3,E4,J1. Basis: E16: root first-registration creation evidence under release exclusion; exact installation identity is required for first-program adoption and is consumed before an attempt. Installed-program history comes from the verified claim launch. Fixtures: TestPlan14FreshInstallRegistration, TestPlan14FreshInstallProgramGate, TestPlan14FreshInstallCanonicalIdentity, TestPlan14FreshInstallLaunchObservation, TestPlan14InstalledLaunchProgramEvidence, TestPlan14FreshInstallProcessCrash, TestPlan14FreshInstallVisibleSync, TestClaimControlUnitInstallers. E22: root generation pins guard existing-tree artifact and manifest writes in adoption and moves-held staging/publication. Held snapshot is read under release exclusion before the leaf held-stage lock; failures remain restrictive for writes. Claims-off source returns no root pins. Fresh wholly absent version trees retain signed staging. Fixtures: TestPlan14GenerationSiblingWrites, TestPlan14GenerationVerifiedSiblingWrites, TestPlan14GenerationHeldStage (production source assembly, both flag values without census, lock order, pin/error/fresh cases). Production completeness remains unavailable; no new completeness grant.;rev3=PROPOSED-p3;run=8;identity=carlos adopt uid 0; legacy agent pass uid carlos;basis=applies root settings to canonically resolved routes including named units while legacy settings eligibility remains unchanged;rev3=PROPOSED-p3;run=16;basis=P3-R11 approved punctuation edit only; authority and reads unchanged;rev3=census-ruling-315;identity=legacy agent pass uid carlos (RootRestartsUnits; never set on carlos adopt);basis=a non-root agent pass hands a route its named unit serves (unitServed) to root through the stage relay before staging or repointing; root adopt reads unchanged;rev3=census-ruling-rootfs-apps-2;identity=the root adopt pass (carlos adopt, carlos-adopt.service, root);basis=the row's runtime (Runtime) rides on a copy of the stage check, so stageFrom stages only the kind the row runs (runtimeMatches) before any download, and the manifest the pass ends up holding is checked again; the artifact sha comes from Manifest.BoxArtifact (the rootfs key for an image); the new kind is registry:Runtime, two sites, and one more Host site in the refusal's line. A runtime the agent forges can make the pass refuse a release, and can also admit a rootfs release to staging for a row it marks rootfs. The evidence paths that can then hand back a staged identity, exhaustively: (1) the signed channel pointer with a manifest digest (ensureStagedDigest, then stageFrom: a fresh download or the staged copy reused); (2) a signed pointer with no digest (the digest marker off), through ensureStagedChecked: with the manifest fetched, stageFrom as in (1); with the fetch failing, a binary's sibling on disk is handed back as before, and a rootfs sibling is refused (controller ruling R-a, task 11 fix E5); (3) a signed promotion record's manifest digest (stageAuthorized, then ensureStagedDigest and stageFrom); (4) retained-copy recovery when (3) fails (stageAuthorized, RetainedStaged: the copy's bytes must hash to its sibling's digest). For a rootfs version every path that hands back an identity yields a sibling byte-equal to the manifest just authorised: stageFrom reads the sibling back after a fresh stage or a reuse and refuses otherwise; (2)'s fallback never yields one; recovery refuses a sibling whose bytes do not hash to the digest a readable record names (retainedRootfsAuthorised, task 11 fix E1), and with no record readable takes the copy root itself verified, as for a binary. Every path is for the row's own account and app. The held stage (materializeheld.go) and signedhead.go stage through ensureStagedDigest with a zero stage check (a binary row's), so they never stage a rootfs release, and their no-digest fallback refuses a rootfs sibling too;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate check is left as is for a resident;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: reuse the manifest verified by existing staging and signed selection; within withReleaseWork after history, proof and staging gates, seed or unseed the exec mode before PointLive (R24), under the same full-row compare and no ServingVersion/GoodVersion/running build guard. Version stamps staging and is not serving evidence. All existing root admission, credentials, quotas, proof, restart and rollback checks retained; no additional manifest or bucket read.
-
New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
-- new `internal/release/adopt.go:stampLeftLink`: reads +file:Lstat, +file:Readlink, +file:Stat, +registry:App ×2, +registry:CreatedAt ×2, +registry:Host ×6, +registry:PrevVersion, +registry:Version, +whole:Route ×2; written legacy, accepted-legacy, frozen
+- new `internal/release/adopt.go:unstampedPlannedRow`: reads +registry:Backing, +registry:Unit, +registry:Version; written legacy, accepted-legacy, frozen
+- reads `internal/release/adopt.go:adoptHost`: +registry:Host ×2, +registry:PrevVersion, +whole:Route; keeps authority, task B3,E1,E2,E3,E4,J1
-Seal: `5b31785441c6a48ddae93e9f3c0f8962f7983b55d89b3acb90d9a6b505647b36` → `d08b065c2984bb40528a2b1e0956907a715b260f2b03dc8f6ee79b286da138ef`.
+Seal: `5b31785441c6a48ddae93e9f3c0f8962f7983b55d89b3acb90d9a6b505647b36` → `c733cf0182c7985b75875a16aaacadd6d9da15ba5a635120e6da8bd0093f6155`.
Overlay: `internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/coldwake_leftlink_test.go b/internal/host/coldwake_leftlink_test.go
index 2334469f5..fd1503778 100644
--- a/internal/host/coldwake_leftlink_test.go
+++ b/internal/host/coldwake_leftlink_test.go
@@ -4,7 +4,6 @@ import (
"context"
"runtime"
"testing"
- "time"
"github.com/carlosframework/platform/internal/registry"
"github.com/carlosframework/platform/internal/release"
@@ -44,7 +43,7 @@ func TestColdWakeInstallStampsAReturningHostFromItsLeftLink(t *testing.T) {
if err := env.reg.Delete(host); err != nil {
t.Fatalf("Delete: %v", err)
}
- row.CreatedAt = time.Now().Add(time.Minute).Unix() // minted after the link was written
+ // minted again, its link left in place
if err := env.reg.Upsert(row); err != nil {
t.Fatalf("Upsert again: %v", err)
}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 33a9050bd..e28d8bf0d 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -117,4 +117,4 @@ plan14-root-reads-signin-first-run-mobile.tsv 61027a32e31cb7ce017304f526f668c269
plan14-root-reads-claim-ux-edge.tsv 889ce9f72f93b581b29527e5c5d4410b47732424ce8ce45c080904ebb6c52195
plan14-root-reads-region-ha-g3-fixes.tsv cd001bf3a9a8871f12d1ca9cfa0a925760c1fc345dc911246ffaabc235dfabf6
plan14-root-reads-claim-countdown.tsv 5b31785441c6a48ddae93e9f3c0f8962f7983b55d89b3acb90d9a6b505647b36
-plan14-root-reads-dr1-left-link.tsv d08b065c2984bb40528a2b1e0956907a715b260f2b03dc8f6ee79b286da138ef
+plan14-root-reads-dr1-left-link.tsv c733cf0182c7985b75875a16aaacadd6d9da15ba5a635120e6da8bd0093f6155
diff --git a/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv b/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv
index f7084fd5e..e10d6a81b 100644
--- a/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv
+++ b/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv
@@ -1,8 +1,8 @@
# Census overlay dr1-left-link, written by census-propose (#369). census-ruling-dr1-left-link, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-dr1-left-link.md.
-# 0 body, 1 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
-@legacy 8d363679e5f5c70635e1c096a8039d39be00a7bdf1360fe8ec4823e154107c7d internal/release/adopt.go stampLeftLink legacy accepted-legacy accepted-legacy;rev3=census-ruling-dr1-left-link;basis=new: on an unstamped row, Lstat/Readlink/Stat of the root-owned live link, the root-owned staged manifest sibling for the link's version, then SetVersions under the release work; the link must predate the row and name the row's own acct/app build file:Lstat@249,file:Readlink@506,file:Stat@628,registry:App@592,registry:App@729,registry:CreatedAt@170,registry:CreatedAt@313,registry:Host@1025,registry:Host@1131,registry:Host@1258,registry:Host@1382,registry:Host@228,registry:Host@901,registry:PrevVersion@1145,registry:Version@137,whole:Route@582,whole:Route@719 c3f01391a826e5b030a007891533ae564e8ac11c3eba0375dafd89f16ad5e861
-internal/release/adopt.go stampLeftLink legacy accepted-legacy accepted-legacy;rev3=census-ruling-dr1-left-link;basis=new: on an unstamped row, Lstat/Readlink/Stat of the root-owned live link, the root-owned staged manifest sibling for the link's version, then SetVersions under the release work; the link must predate the row and name the row's own acct/app build file:Lstat@249,file:Readlink@506,file:Stat@628,registry:App@592,registry:App@729,registry:CreatedAt@170,registry:CreatedAt@313,registry:Host@1025,registry:Host@1131,registry:Host@1258,registry:Host@1382,registry:Host@228,registry:Host@901,registry:PrevVersion@1145,registry:Version@137,whole:Route@582,whole:Route@719 c3f01391a826e5b030a007891533ae564e8ac11c3eba0375dafd89f16ad5e861
-internal/release/adopt.go adoptHost authority B3,E1,E2,E3,E4,J1 E16: root first-registration creation evidence under release exclusion; exact installation identity is required for first-program adoption and is consumed before an attempt. Installed-program history comes from the verified claim launch. Fixtures: TestPlan14FreshInstallRegistration, TestPlan14FreshInstallProgramGate, TestPlan14FreshInstallCanonicalIdentity, TestPlan14FreshInstallLaunchObservation, TestPlan14InstalledLaunchProgramEvidence, TestPlan14FreshInstallProcessCrash, TestPlan14FreshInstallVisibleSync, TestClaimControlUnitInstallers. E22: root generation pins guard existing-tree artifact and manifest writes in adoption and moves-held staging/publication. Held snapshot is read under release exclusion before the leaf held-stage lock; failures remain restrictive for writes. Claims-off source returns no root pins. Fresh wholly absent version trees retain signed staging. Fixtures: TestPlan14GenerationSiblingWrites, TestPlan14GenerationVerifiedSiblingWrites, TestPlan14GenerationHeldStage (production source assembly, both flag values without census, lock order, pin/error/fresh cases). Production completeness remains unavailable; no new completeness grant.;rev3=PROPOSED-p3;run=8;identity=carlos adopt uid 0; legacy agent pass uid carlos;basis=applies root settings to canonically resolved routes including named units while legacy settings eligibility remains unchanged;rev3=PROPOSED-p3;run=16;basis=P3-R11 approved punctuation edit only; authority and reads unchanged;rev3=census-ruling-315;identity=legacy agent pass uid carlos (RootRestartsUnits; never set on carlos adopt);basis=a non-root agent pass hands a route its named unit serves (unitServed) to root through the stage relay before staging or repointing; root adopt reads unchanged;rev3=census-ruling-rootfs-apps-2;identity=the root adopt pass (carlos adopt, carlos-adopt.service, root);basis=the row's runtime (Runtime) rides on a copy of the stage check, so stageFrom stages only the kind the row runs (runtimeMatches) before any download, and the manifest the pass ends up holding is checked again; the artifact sha comes from Manifest.BoxArtifact (the rootfs key for an image); the new kind is registry:Runtime, two sites, and one more Host site in the refusal's line. A runtime the agent forges can make the pass refuse a release, and can also admit a rootfs release to staging for a row it marks rootfs. The evidence paths that can then hand back a staged identity, exhaustively: (1) the signed channel pointer with a manifest digest (ensureStagedDigest, then stageFrom: a fresh download or the staged copy reused); (2) a signed pointer with no digest (the digest marker off), through ensureStagedChecked: with the manifest fetched, stageFrom as in (1); with the fetch failing, a binary's sibling on disk is handed back as before, and a rootfs sibling is refused (controller ruling R-a, task 11 fix E5); (3) a signed promotion record's manifest digest (stageAuthorized, then ensureStagedDigest and stageFrom); (4) retained-copy recovery when (3) fails (stageAuthorized, RetainedStaged: the copy's bytes must hash to its sibling's digest). For a rootfs version every path that hands back an identity yields a sibling byte-equal to the manifest just authorised: stageFrom reads the sibling back after a fresh stage or a reuse and refuses otherwise; (2)'s fallback never yields one; recovery refuses a sibling whose bytes do not hash to the digest a readable record names (retainedRootfsAuthorised, task 11 fix E1), and with no record readable takes the copy root itself verified, as for a binary. Every path is for the row's own account and app. The held stage (materializeheld.go) and signedhead.go stage through ensureStagedDigest with a zero stage check (a binary row's), so they never stage a rootfs release, and their no-digest fallback refuses a rootfs sibling too;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate check is left as is for a resident;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: reuse the manifest verified by existing staging and signed selection; within withReleaseWork after history, proof and staging gates, seed or unseed the exec mode before PointLive (R24), under the same full-row compare and no ServingVersion/GoodVersion/running build guard. Version stamps staging and is not serving evidence. All existing root admission, credentials, quotas, proof, restart and rollback checks retained; no additional manifest or bucket read.;rev3=census-ruling-dr1-left-link;basis=the up-to-date return calls stampLeftLink; no new read of its own (the Route passed whole) registry:App@11596,registry:App@11750,registry:App@13104,registry:App@14030,registry:App@15628,registry:App@21123,registry:App@26599,registry:App@3144,registry:App@34379,registry:App@6807,registry:App@8108,registry:App@8302,registry:Backing@20839,registry:GoodVersion@20878,registry:Hibernate@35354,registry:Host@10533,registry:Host@11476,registry:Host@11509,registry:Host@11609,registry:Host@11763,registry:Host@11859,registry:Host@11891,registry:Host@11956,registry:Host@12406,registry:Host@12746,registry:Host@12870,registry:Host@13317,registry:Host@13426,registry:Host@13628,registry:Host@14120,registry:Host@14906,registry:Host@15381,registry:Host@15614,registry:Host@15956,registry:Host@16591,registry:Host@20299,registry:Host@20407,registry:Host@2105,registry:Host@21091,registry:Host@21911,registry:Host@22069,registry:Host@22531,registry:Host@22583,registry:Host@22730,registry:Host@22817,registry:Host@2294,registry:Host@2375,registry:Host@23923,registry:Host@24167,registry:Host@24827,registry:Host@25212,registry:Host@25353,registry:Host@26567,registry:Host@26694,registry:Host@28036,registry:Host@28686,registry:Host@3157,registry:Host@31919,registry:Host@32537,registry:Host@32862,registry:Host@32936,registry:Host@33183,registry:Host@33334,registry:Host@34551,registry:Host@34718,registry:Host@34825,registry:Host@35053,registry:Host@35196,registry:Host@36055,registry:Host@36181,registry:Host@36269,registry:Host@4469,registry:Host@4583,registry:Host@5546,registry:Host@5651,registry:Host@6919,registry:Host@6967,registry:Host@7084,registry:Host@7116,registry:Host@7994,registry:Host@8162,registry:Host@8288,registry:Host@8407,registry:Host@8885,registry:Host@9272,registry:Host@9498,registry:Host@9594,registry:Host@9685,registry:Kind@20795,registry:Kind@554,registry:Runtime@11260,registry:Runtime@12664,registry:ServingVersion@20902,registry:Socket@20820,registry:Stateless@20779,registry:Stateless@21030,registry:Tunnel@20859,registry:Unit@33082,registry:Unit@579,whole:Route@10122,whole:Route@10476,whole:Route@11591,whole:Route@11745,whole:Route@13094,whole:Route@14020,whole:Route@15596,whole:Route@16161,whole:Route@16567,whole:Route@17767,whole:Route@18070,whole:Route@18226,whole:Route@20556,whole:Route@20700,whole:Route@20976,whole:Route@21113,whole:Route@2206,whole:Route@23652,whole:Route@24051,whole:Route@26589,whole:Route@3139,whole:Route@31490,whole:Route@34527,whole:Route@3595,whole:Route@4347,whole:Route@5709,whole:Route@6802 4d672c83b47567282e0f70eb9ef32341002130fed6837e3e9b41a0b59a1967bd
+# 0 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 2 new dispositions: 1 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy 5b6bf96a9b163865e5e064f584de49f3c5c28a115d32a2ae0b9669babb6cd859 internal/release/adopt.go unstampedPlannedRow legacy accepted-legacy accepted-legacy;rev3=census-ruling-dr1-left-link;basis=new pure predicate over the route row (Version, Unit, Backing, sidecar, ActivatorOwned) and the live version already read; no file, store or process access registry:Backing@121,registry:Unit@104,registry:Version@71 e8eecc0ea0215995b49a66f3a9eb833d95d9364f152ee491ea085d03ff55eee9
+internal/release/adopt.go unstampedPlannedRow legacy accepted-legacy accepted-legacy;rev3=census-ruling-dr1-left-link;basis=new pure predicate over the route row (Version, Unit, Backing, sidecar, ActivatorOwned) and the live version already read; no file, store or process access registry:Backing@121,registry:Unit@104,registry:Version@71 e8eecc0ea0215995b49a66f3a9eb833d95d9364f152ee491ea085d03ff55eee9
+internal/release/adopt.go adoptHost authority B3,E1,E2,E3,E4,J1 E16: root first-registration creation evidence under release exclusion; exact installation identity is required for first-program adoption and is consumed before an attempt. Installed-program history comes from the verified claim launch. Fixtures: TestPlan14FreshInstallRegistration, TestPlan14FreshInstallProgramGate, TestPlan14FreshInstallCanonicalIdentity, TestPlan14FreshInstallLaunchObservation, TestPlan14InstalledLaunchProgramEvidence, TestPlan14FreshInstallProcessCrash, TestPlan14FreshInstallVisibleSync, TestClaimControlUnitInstallers. E22: root generation pins guard existing-tree artifact and manifest writes in adoption and moves-held staging/publication. Held snapshot is read under release exclusion before the leaf held-stage lock; failures remain restrictive for writes. Claims-off source returns no root pins. Fresh wholly absent version trees retain signed staging. Fixtures: TestPlan14GenerationSiblingWrites, TestPlan14GenerationVerifiedSiblingWrites, TestPlan14GenerationHeldStage (production source assembly, both flag values without census, lock order, pin/error/fresh cases). Production completeness remains unavailable; no new completeness grant.;rev3=PROPOSED-p3;run=8;identity=carlos adopt uid 0; legacy agent pass uid carlos;basis=applies root settings to canonically resolved routes including named units while legacy settings eligibility remains unchanged;rev3=PROPOSED-p3;run=16;basis=P3-R11 approved punctuation edit only; authority and reads unchanged;rev3=census-ruling-315;identity=legacy agent pass uid carlos (RootRestartsUnits; never set on carlos adopt);basis=a non-root agent pass hands a route its named unit serves (unitServed) to root through the stage relay before staging or repointing; root adopt reads unchanged;rev3=census-ruling-rootfs-apps-2;identity=the root adopt pass (carlos adopt, carlos-adopt.service, root);basis=the row's runtime (Runtime) rides on a copy of the stage check, so stageFrom stages only the kind the row runs (runtimeMatches) before any download, and the manifest the pass ends up holding is checked again; the artifact sha comes from Manifest.BoxArtifact (the rootfs key for an image); the new kind is registry:Runtime, two sites, and one more Host site in the refusal's line. A runtime the agent forges can make the pass refuse a release, and can also admit a rootfs release to staging for a row it marks rootfs. The evidence paths that can then hand back a staged identity, exhaustively: (1) the signed channel pointer with a manifest digest (ensureStagedDigest, then stageFrom: a fresh download or the staged copy reused); (2) a signed pointer with no digest (the digest marker off), through ensureStagedChecked: with the manifest fetched, stageFrom as in (1); with the fetch failing, a binary's sibling on disk is handed back as before, and a rootfs sibling is refused (controller ruling R-a, task 11 fix E5); (3) a signed promotion record's manifest digest (stageAuthorized, then ensureStagedDigest and stageFrom); (4) retained-copy recovery when (3) fails (stageAuthorized, RetainedStaged: the copy's bytes must hash to its sibling's digest). For a rootfs version every path that hands back an identity yields a sibling byte-equal to the manifest just authorised: stageFrom reads the sibling back after a fresh stage or a reuse and refuses otherwise; (2)'s fallback never yields one; recovery refuses a sibling whose bytes do not hash to the digest a readable record names (retainedRootfsAuthorised, task 11 fix E1), and with no record readable takes the copy root itself verified, as for a binary. Every path is for the row's own account and app. The held stage (materializeheld.go) and signedhead.go stage through ensureStagedDigest with a zero stage check (a binary row's), so they never stage a rootfs release, and their no-digest fallback refuses a rootfs sibling too;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate check is left as is for a resident;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: reuse the manifest verified by existing staging and signed selection; within withReleaseWork after history, proof and staging gates, seed or unseed the exec mode before PointLive (R24), under the same full-row compare and no ServingVersion/GoodVersion/running build guard. Version stamps staging and is not serving evidence. All existing root admission, credentials, quotas, proof, restart and rollback checks retained; no additional manifest or bucket read.;rev3=census-ruling-dr1-left-link;basis=the up-to-date return is skipped for an unstamped planned row (unstampedPlannedRow), which takes the existing install path with all its gates; its stamp keeps PrevVersion and its refusal clear keeps the up-to-date rule. No new read kind registry:App@11580,registry:App@11734,registry:App@13088,registry:App@14014,registry:App@15612,registry:App@21107,registry:App@26583,registry:App@3144,registry:App@34363,registry:App@6791,registry:App@8092,registry:App@8286,registry:Backing@20823,registry:GoodVersion@20862,registry:Hibernate@35836,registry:Host@10517,registry:Host@11460,registry:Host@11493,registry:Host@11593,registry:Host@11747,registry:Host@11843,registry:Host@11875,registry:Host@11940,registry:Host@12390,registry:Host@12730,registry:Host@12854,registry:Host@13301,registry:Host@13410,registry:Host@13612,registry:Host@14104,registry:Host@14890,registry:Host@15365,registry:Host@15598,registry:Host@15940,registry:Host@16575,registry:Host@20283,registry:Host@20391,registry:Host@2105,registry:Host@21075,registry:Host@21895,registry:Host@22053,registry:Host@22515,registry:Host@22567,registry:Host@22714,registry:Host@22801,registry:Host@2294,registry:Host@2375,registry:Host@23907,registry:Host@24151,registry:Host@24811,registry:Host@25196,registry:Host@25337,registry:Host@26551,registry:Host@26678,registry:Host@28020,registry:Host@28670,registry:Host@3157,registry:Host@31903,registry:Host@32521,registry:Host@32846,registry:Host@32920,registry:Host@33167,registry:Host@33318,registry:Host@34535,registry:Host@34820,registry:Host@34933,registry:Host@35371,registry:Host@35427,registry:Host@35531,registry:Host@35678,registry:Host@36537,registry:Host@36663,registry:Host@36751,registry:Host@4469,registry:Host@4616,registry:Host@5579,registry:Host@5684,registry:Host@6903,registry:Host@6951,registry:Host@7068,registry:Host@7100,registry:Host@7978,registry:Host@8146,registry:Host@8272,registry:Host@8391,registry:Host@8869,registry:Host@9256,registry:Host@9482,registry:Host@9578,registry:Host@9669,registry:Kind@20779,registry:Kind@554,registry:PrevVersion@34722,registry:Runtime@11244,registry:Runtime@12648,registry:ServingVersion@20886,registry:Socket@20804,registry:Stateless@20763,registry:Stateless@21014,registry:Tunnel@20843,registry:Unit@33066,registry:Unit@579,whole:Route@10106,whole:Route@10460,whole:Route@11575,whole:Route@11729,whole:Route@13078,whole:Route@14004,whole:Route@15580,whole:Route@16145,whole:Route@16551,whole:Route@17751,whole:Route@18054,whole:Route@18210,whole:Route@20540,whole:Route@20684,whole:Route@20960,whole:Route@21097,whole:Route@2206,whole:Route@23636,whole:Route@24035,whole:Route@26573,whole:Route@3139,whole:Route@31474,whole:Route@34511,whole:Route@3595,whole:Route@4347,whole:Route@4587,whole:Route@6786 616941c4a66df12330c768682235f14d84b854f0b4a05bedb10d7e782d627aff
@coverage internal/host d1354d1a98de9d4b9018e6df0b65ac1f4e6c5a1d2dd922100fe316d592c7be22
-@coverage internal/release 76d886d16558ab5e116e17e01e5579ad5f3383f00cfe8b72b1501758846200b9
+@coverage internal/release 1b89f7d27b8547a80de782facb25f48ff9a36d17ae5cf1346ac580e347b439f9
diff --git a/internal/release/adopt.go b/internal/release/adopt.go
index aed6fd066..8834c409f 100644
--- a/internal/release/adopt.go
+++ b/internal/release/adopt.go
@@ -1485,7 +1485,7 @@ func adoptHost(ctx context.Context, work hostwrite.Work, reg *registry.Registry,
return
}
}
- if cur == ver {
+ if cur == ver && !unstampedPlannedRow(rt, cur) {
cfg.proof.clear(rt.Host) // live on its target: nothing left to wait for
// A refusal that no longer blocks the pointer is stale even though
// nothing moves: v2 was refused and rolled back to v1, then the
@@ -1504,7 +1504,6 @@ func adoptHost(ctx context.Context, work hostwrite.Work, reg *registry.Registry,
_ = ClearRefusal(cfg.bakeDir, rt.Host)
}
}
- stampLeftLink(ctx, work, reg, optDir, rt, cur)
return // up to date — stay quiet on the periodic tick
}
// Two independent waivers, both root-signed in origin: ignore is the
@@ -2149,14 +2148,25 @@ func adoptHost(ctx context.Context, work hostwrite.Work, reg *registry.Registry,
return
}
}
- if err := withReleaseWork(ctx, work, id, func() error { return reg.SetVersions(rt.Host, ver, cur) }); err != nil {
+ stampPrev := cur
+ if cur == ver { // an unstamped row's repair (unstampedPlannedRow)
+ stampPrev = rt.PrevVersion
+ }
+ if err := withReleaseWork(ctx, work, id, func() error { return reg.SetVersions(rt.Host, ver, stampPrev) }); err != nil {
fmt.Printf(" %s: repointed but recording the version failed: %v\n", rt.Host, err)
return
}
// A record left from an older promotion is stale once a build is live.
// Best-effort: the agent cannot remove root's file, the root pass can.
+ // An unstamped row's repair installed what was already live, so it
+ // clears only what the up-to-date return above would: a record that
+ // blocks neither the selected build nor the head.
if cfg.bakeDir != "" {
- _ = ClearRefusal(cfg.bakeDir, rt.Host)
+ if cur != ver {
+ _ = ClearRefusal(cfg.bakeDir, rt.Host)
+ } else if r, err := ReadRefusal(cfg.bakeDir, rt.Host); err == nil && r != nil && !r.Blocks(sel) && !r.Blocks(ptr) {
+ _ = ClearRefusal(cfg.bakeDir, rt.Host)
+ }
}
if rt.IsSidecar() {
fmt.Printf(" %s: repointed %s -> %s (%s; sidecar, its worker moves onto it on the agent's drift check)\n", rt.Host, cur, ver, channel)
@@ -2846,52 +2856,17 @@ func retainedRootfsAuthorised(optDir, acct, app, ver string, m *Manifest, author
return nil
}
-// stampLeftLink records cur as rt's installed build when the row records
-// none and the link is one an earlier row left behind (DR-1, 2026-11-07).
-//
-// A box keeps a host's live link after the host's row goes (an HA host
-// moving to another box removes the row, never the link). When the host
-// comes back its row is minted again with no Version, the link already
-// names the selected build, and the up-to-date return above would leave
-// the row unstamped for good: no pass ever moves the link again, and the
-// rollout planner refuses every wake of a row with no installed build.
-//
-// Only a link older than the row is stamped. A link written after the row
-// was minted is an install in progress (PointLive, then the restart, then
-// SetVersions), and that install stamps its own row or rolls the link back;
-// stamping it here could record a build whose restart is about to fail.
-// A link that does not resolve, or a staged manifest that does not read,
-// is left alone: the wake reports it, as before.
-func stampLeftLink(ctx context.Context, work hostwrite.Work, reg *registry.Registry, optDir string, rt registry.Route, cur string) {
- if rt.Version != "" || cur == "" || rt.CreatedAt == 0 {
- return
- }
- link := LiveLink(optDir, rt.Host)
- li, err := os.Lstat(link)
- if err != nil || !li.ModTime().Before(time.Unix(rt.CreatedAt, 0)) {
- return
- }
- // The link must name this row's own build (a host minted again for
- // another app or account keeps nothing of the old one's), and resolve.
- if target, err := os.Readlink(link); err != nil || target != VersionPath(optDir, RouteAccount(rt), cur, rt.App) {
- return
- }
- if _, err := os.Stat(link); err != nil {
- return
- }
- m, err := ReadStagedManifest(optDir, RouteAccount(rt), cur, rt.App)
- if err != nil || m == nil {
- fmt.Printf(" %s: its live link names %s, but the staged manifest does not read (%v); the row is left without an installed build\n", rt.Host, cur, err)
- return
- }
- id, err := releaseIdentity(m)
- if err != nil {
- fmt.Printf(" %s: release identity: %v\n", rt.Host, err)
- return
- }
- if err := withReleaseWork(ctx, work, id, func() error { return reg.SetVersions(rt.Host, cur, rt.PrevVersion) }); err != nil {
- fmt.Printf(" %s: recording %s, the build its live link already names: %v\n", rt.Host, cur, err)
- return
- }
- fmt.Printf(" %s: recorded %s as installed (its live link was left by an earlier route)\n", rt.Host, cur)
+// unstampedPlannedRow reports whether rt is a row the rollout planner wakes
+// (exec-backed, the activator's) that records no installed build while its
+// live link names cur (DR-1, 2026-11-07). A box keeps a host's link after
+// the host's row goes, and the row minted when the host comes back has no
+// Version; the up-to-date return left it unstamped for good, and the
+// planner refuses every wake of such a row. It takes the whole install
+// instead, every gate included, as a first install does: a link alone is
+// no evidence that its build was admitted (Astra R1). A named unit, or an
+// always-awake instance, execs its link without the planner, so its row is
+// left as it was and nothing restarts it.
+func unstampedPlannedRow(rt registry.Route, cur string) bool {
+ return rt.Version == "" && cur != "" && rt.Unit == "" && rt.Backing != registry.BackingUnit &&
+ !rt.IsSidecar() && rt.ActivatorOwned()
}
diff --git a/internal/release/unstamped_live_test.go b/internal/release/unstamped_live_test.go
index 66c5fba08..f5b9a0f4f 100644
--- a/internal/release/unstamped_live_test.go
+++ b/internal/release/unstamped_live_test.go
@@ -11,11 +11,10 @@ import (
// DR-1 (2026-11-07 dev rehearsal): a box that served a host once keeps the
// host's live link after the row goes (an HA host moving to another box).
// When the host comes back the row is minted again with no Version, the
-// link already names the channel head, and the pass's up-to-date
-// short-circuit returned before stamping the row. The rollout planner
-// refuses a wake for a row with no installed build, so the host could
-// never wake on that box again. Both the cold wake's install
-// (MaterializeHost) and the hourly pass must stamp the row from the link.
+// link already names the channel head, and the pass's up-to-date return
+// left the row unstamped for good. The rollout planner refuses a wake for a
+// row with no installed build, so the host could never wake on that box
+// again. Such a row takes the whole install, gates included, and is stamped.
func remintedRow(t *testing.T) *matFixture {
t.Helper()
env := newMatFixture(t)
@@ -28,104 +27,59 @@ func remintedRow(t *testing.T) *matFixture {
if err := MaterializeHost(ctx, env.reg, env.store, env.pub, env.optDir, env.dataDir, "mat.test"); err != nil {
t.Fatalf("first MaterializeHost: %v", err)
}
- if rt, err := env.reg.Get("mat.test"); err != nil || rt == nil || rt.Version != "abc1234" {
- t.Fatalf("first install: row = %+v, %v; want Version abc1234", rt, err)
+ if rt := mustRow(t, env, "mat.test"); rt.Version != "abc1234" {
+ t.Fatalf("first install: row = %+v; want Version abc1234", rt)
}
// The host leaves this box (its row goes, its link stays) and comes back.
if err := env.reg.Delete("mat.test"); err != nil {
t.Fatalf("Delete: %v", err)
}
- // Minted again later than the link was written (CreatedAt has second
- // resolution, so the test dates the row rather than sleeping).
- if err := env.reg.Upsert(registry.Route{Host: "mat.test", Kind: "instance", App: "matapp",
- Channel: "canary/dev", Hibernate: true, CreatedAt: time.Now().Add(time.Minute).Unix()}); err != nil {
- t.Fatalf("Upsert: %v", err)
- }
+ addRoute(t, env.reg, "mat.test", "matapp", "canary/dev", true)
if v, _ := LiveVersion(env.optDir, "mat.test"); v != "abc1234" {
t.Fatalf("live = %q, want the link left at abc1234", v)
}
return env
}
-func TestMaterializeHostStampsARemintedRowFromItsLiveLink(t *testing.T) {
+func TestMaterializeHostStampsARemintedRowWhoseLinkWasLeft(t *testing.T) {
env := remintedRow(t)
if err := MaterializeHost(context.Background(), env.reg, env.store, env.pub, env.optDir, env.dataDir, "mat.test"); err != nil {
t.Fatalf("MaterializeHost: %v", err)
}
- rt, err := env.reg.Get("mat.test")
- if err != nil || rt == nil || rt.Version != "abc1234" {
- t.Fatalf("row = %+v, %v; want Version abc1234 (the build its link names)", rt, err)
+ if rt := mustRow(t, env, "mat.test"); rt.Version != "abc1234" {
+ t.Fatalf("row = %+v; want Version abc1234", rt)
}
}
-func TestPassStampsARemintedRowFromItsLiveLink(t *testing.T) {
+func TestPassStampsARemintedRowWhoseLinkWasLeft(t *testing.T) {
env := remintedRow(t)
if err := Pass(context.Background(), env.reg, env.store, env.pub, env.optDir, nil, BakeDir(env.dataDir)); err != nil {
t.Fatalf("Pass: %v", err)
}
- rt, err := env.reg.Get("mat.test")
- if err != nil || rt == nil || rt.Version != "abc1234" {
- t.Fatalf("row = %+v, %v; want Version abc1234 (the build its link names)", rt, err)
+ if rt := mustRow(t, env, "mat.test"); rt.Version != "abc1234" {
+ t.Fatalf("row = %+v; want Version abc1234", rt)
}
}
-// An install in progress has written the link after the row was minted and
-// stamps its own row once its restart succeeds (or rolls the link back):
-// the pass must not stamp it first.
-func TestPassLeavesALinkNewerThanItsRowToItsInstall(t *testing.T) {
- env := newMatFixture(t)
- ctx := context.Background()
- shipRelease(t, env.store, "bab", "matapp", "abc1234", adoptPlatform, []byte("ha build"))
- if err := Promote(ctx, env.store, env.priv, "bab", "matapp", "canary/dev", "abc1234"); err != nil {
- t.Fatalf("Promote: %v", err)
- }
- if err := env.reg.Upsert(registry.Route{Host: "mat.test", Kind: "instance", App: "matapp",
- Channel: "canary/dev", Hibernate: true, CreatedAt: time.Now().Add(-time.Minute).Unix()}); err != nil {
- t.Fatalf("Upsert: %v", err)
- }
- if _, err := ensureStagedDigest(ctx, env.store, env.optDir, "bab", "matapp", "abc1234", "mat.test", "", stageCheck{}); err != nil {
- t.Fatalf("stage: %v", err)
- }
- if err := PointLive(env.optDir, "mat.test", "bab", "abc1234", "matapp"); err != nil {
- t.Fatalf("PointLive: %v", err)
- }
- if err := Pass(ctx, env.reg, env.store, env.pub, env.optDir, nil, BakeDir(env.dataDir)); err != nil {
- t.Fatalf("Pass: %v", err)
- }
- if rt, _ := env.reg.Get("mat.test"); rt == nil || rt.Version != "" {
- t.Fatalf("row = %+v; want no Version (the link is an install in progress)", rt)
- }
-}
-
-// A host minted again for another app keeps nothing of the old one's: a left
-// link that names another app's build, even under the same version name,
-// is not this row's install.
-func TestPassLeavesALeftLinkOfAnotherApp(t *testing.T) {
+// Astra R1 #1: a left link is no evidence its build was admitted. A build
+// this box refused (its rollback could not move the link off it) stays
+// refused when the row comes back: the install's gates still run.
+func TestARemintedRowOnARefusedLeftLinkStaysUnstamped(t *testing.T) {
env := remintedRow(t)
- ctx := context.Background()
- shipRelease(t, env.store, "bab", "otherapp", "abc1234", adoptPlatform, []byte("other build"))
- if err := Promote(ctx, env.store, env.priv, "bab", "otherapp", "canary/dev", "abc1234"); err != nil {
- t.Fatalf("Promote: %v", err)
- }
- // Staged here too, so only the link's target tells the two apart.
- if _, err := ensureStagedDigest(ctx, env.store, env.optDir, "bab", "otherapp", "abc1234", "mat.test", "", stageCheck{}); err != nil {
- t.Fatalf("stage: %v", err)
+ ptr, err := Channel(context.Background(), env.store, env.pub, "bab", "matapp", "canary/dev")
+ if err != nil {
+ t.Fatal(err)
}
- if err := env.reg.Delete("mat.test"); err != nil {
- t.Fatalf("Delete: %v", err)
- }
- if err := env.reg.Upsert(registry.Route{Host: "mat.test", Kind: "instance", App: "otherapp",
- Channel: "canary/dev", Hibernate: true, CreatedAt: time.Now().Add(time.Minute).Unix()}); err != nil {
- t.Fatalf("Upsert: %v", err)
+ if err := WriteRefusal(env.dataDir, Refusal{Host: "mat.test", App: "matapp", Version: ptr.Version,
+ PointerPromotedAt: ptr.PromotedAt, RefusedAt: time.Now().UTC(), Reason: "exited: status=2",
+ RecoveryError: "could not roll the symlink back"}); err != nil {
+ t.Fatal(err)
}
- if v, _ := LiveVersion(env.optDir, "mat.test"); v != "abc1234" {
- t.Fatalf("live = %q, want abc1234", v)
- }
- if err := Pass(ctx, env.reg, env.store, env.pub, env.optDir, nil, BakeDir(env.dataDir)); err != nil {
+ if err := Pass(context.Background(), env.reg, env.store, env.pub, env.optDir, nil, BakeDir(env.dataDir)); err != nil {
t.Fatalf("Pass: %v", err)
}
if rt := mustRow(t, env, "mat.test"); rt.Version != "" {
- t.Fatalf("row = %+v; want no Version (the link names matapp's build)", rt)
+ t.Fatalf("row = %+v; a refused build was stamped from its left link", rt)
}
}