carlos / platform Public

durability 3a: escrow readiness splits three ways; no outage on a keyless box

The controller's ruling on Task 4's concern 3. As first built, a box with
no CARLOS_SECRETS_KEY or no files store refused the launch of every
eligible host after the upgrade, since none had been escrowed yet: an
outage for every deployment without a secrets key.

- Key and store: everything as built.
- Store, no usable key: the bucket manifest is read (one GET per launch;
  a mint reads it again at that moment). An escrow there (any sealed item
  or the cutover marker) refuses restore, mint and a first launch, P1-1's
  rebuilt box. None there: the host launches and mints exactly as before
  3a, nothing is published, and one line per host per process says escrow
  is off.
- No files store: exactly as before 3a, logged once.
- Scheduled ticks stay read-only for every eligible host.

TestNotReadyRefusesRestoreMintAndFirstLaunch is now the keyless box with
an escrow; TestNoKeyAndNoEscrowLaunchesAsBefore and
TestNoFilesStoreLaunchesAsBefore are new, through the real Service wake.
Census claims updated and the proposal re-run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 5060147885e2f05dd1d51ae91565bc4d19fcc4fd parent 4a89740
6 files changed, +335 −115
  • docs/superpowers/notes/census-durability-3a-escrow-claims.md +6 −4
  • docs/superpowers/notes/census-proposal-durability-3a-escrow.md +8 −5
  • internal/activator/escrow.go +165 −25
  • internal/activator/escrow_test.go +141 −72
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv +14 −8

Intent

Human

<task-notification> <task-id>a3ce1b31a8618f132</task-id> <tool-use-id>toolu_014RbJgty1egmsiQTKaa8yVj</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/953e7524-2e06-4308-b9ce-fd1b38579971/tasks/a3ce1b31a8618f132.output</output-file> <status>completed</status> <summary>Agent "Implement Task 4: escrow for activator hosts" 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>Status: DONE_WITH_CONCERNS Commit: 4a897404 on durability-3a-escrow (one commit, not pushed). Tests: the full activator (187 s), host (147 s) and layout packages pass, as do the census tests and the brief's Step 4 runs. gofmt and vet are clean, and the linux, darwin/arm64 and windows/amd64 builds pass. Every brief test was RED, then GREEN. The 252-host burst test finished in about 7 s of scaled store time against the 30 s period. Concerns (details in the report): 1. **Stale copies after the roll.** On group boxes, the first sweep after the roll lets every box holding an old local env publish it; the last one wins until that host's next launch. I propose a mitigation but did not build it. 2. **Wake cost.** A host with no instance.key or report.token reads the bucket (1 GET) on every launch. A first launch reads it up to 3 times, against §9's "1 GET before a first mint". 3. **Rollout.** Once this rolls, a box without CARLOS_SECRETS_KEY or a files store refuses to launch every eligible host. The Task 8 dev check should confirm the key on every box first. 4. **Additions beyond the brief.** - A fix for missed same-size rewrites: a stat stamp under 2 s old is not trusted. - Stricter eligibility: a valid app is required, so a row that can never be sealed doesn't become unlaunchable. - The flat env read no longer follows a link. - New files escrow_stamp_linux.go and escrow_stamp_other.go, for the cross-compile gate. - A census move layer for pathsFor's body, now in pathsAt. - Four existing tests/fixtures changed: the rootfs fixtures now have a files store and key, and three tests were updated for the new escrow behaviour. Report: /home/paulca/amadan.net/carlos/platform/.claude/worktrees/durability-3a/.superpowers/sdd/2026-10-30-durability-step3-escrow-fence-restore/task-4-report.md</result> <usage><subagent_tokens>490928</subagent_tokens><tool_uses>136</tool_uses><duration_ms>2808076</duration_ms></usage> </task-notification>

Attributed to this commit: 22.9 g CO₂e (2,880,232 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on durability-3a-escrow, 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-durability-3a-escrow-claims.md b/docs/superpowers/notes/census-durability-3a-escrow-claims.md
index 1d7fe23f8..e9410ef1f 100644
--- a/docs/superpowers/notes/census-durability-3a-escrow-claims.md
+++ b/docs/superpowers/notes/census-durability-3a-escrow-claims.md
@@ -1,7 +1,6 @@
# CLAIMS for the root-read census, branch durability-3a-escrow (durability plan 3a: escrow, fence, restore).
# Format (AGENTS.md "The census"): <file>:<unit><TAB><what changed>. Lines starting with # are ignored.
# Appended task by task; census-propose is re-run with the whole file.
-
internal/layout/inventory.go:Inventory durability 3a Task 1: new. One os.ReadDir of the host's inventory root, provision.InstanceDir(dataDir, host) nested or dataDir flat, after refusing a host that fails controlname.ValidHostShape and a layout that is neither flat nor nested; reads only the listing's names and types (DirEntry.IsDir), opens and follows nothing; flat ownership is the extras scan's own (hostEntries over knownHosts); each top-level name is classified by pubclass.Of, a pure function of the name. A missing directory is an empty inventory. No caller in this task; later tasks call it from the publisher.
internal/layout/plan.go:NestedPlatformNames durability 3a Task 1: now a one-line wrapper for pubclass.NestedPlatformNames, which builds the same set (byte-identical, checked before and after) from pubclass.FileBases and the same instancectl/instancekey names, without nestedFiles or rawInstanceDir; it never read anything, and reads nothing now
internal/hostfiles/sealed.go:ReadSealed durability 3a Task 2: new. Reads one sealed platform item of a files manifest the caller already loaded: the object at exactly the key the entry names, through the existing fetch (checkEntry: origin admitted, key shape, sha256 and size verified), only for an entry marked sealed "v2". The "Open" the scanner sees is appconfig.Open, an in-memory AES-GCM decryption of the fetched bytes, not a file open: no filesystem path is opened, read or followed. It refuses a v1 envelope (appconfig.EnvelopeBound), and after opening under the caller-supplied key and (account, app) binding it checks the HMAC digest over account, app, host and item against the entry. Writes nothing. No production caller in this task; Tasks 3 and 4 call it from the activator.
@@ -42,16 +41,16 @@ internal/activator/escrow.go:ExecBackend.escrowEnvOf durability 3a Task 4: new:
internal/activator/escrow.go:ExecBackend.escrowChanged durability 3a Task 4: new: compares each escrowed file's stamp (stampAt, beneath the row's data directory) with the last kept one; reads no bytes
internal/activator/escrow.go:ExecBackend.escrowEligible durability 3a Task 4: new: escrowEligibleAt on pathsFor's classification
internal/activator/escrow.go:ExecBackend.escrowEligibleAt durability 3a Task 4: new: a pure predicate over the row and a classification: ActivatorManaged, not unit, sidecar, HA, replica, held, a valid host shape and app, flat or nested, on a box with a hibernate bucket; reads only row fields
-internal/activator/escrow.go:ExecBackend.escrowMintGuard durability 3a Task 4: new: on a box that is not ready refuses every mint (ErrEscrowNotReady); otherwise, once and only when a producer would mint, bucketEscrowEnv, and refuses (ErrInstanceKeyDeferred) when the escrowed env holds the variable; a mint it allows is noted in memory; only refuses
+internal/activator/escrow.go:ExecBackend.escrowMintGuard durability 3a Task 4: new: on a box that is not ready refuses every mint (ErrEscrowNotReady); otherwise, once and only when a producer would mint, bucketEscrowEnv, and refuses (ErrInstanceKeyDeferred) when the escrowed env holds the variable; a mint it allows is noted in memory; only refuses Fix round 0 (controller readiness ruling): with no files store it is nil, and the producer mints as before 3a; with a files store and no sealing key it reads the bucket manifest at the mint (keylessEscrowed, fresh) and refuses (ErrEscrowNotReady) when the bucket holds any sealed item or the cutover marker for the host, and otherwise lets the mint go ahead (logged once); only refuses.
internal/activator/escrow.go:ExecBackend.escrowReady durability 3a Task 4: new: FilesStore and EscrowKey set and sealerFor succeeds; reads nothing
internal/activator/escrow.go:ExecBackend.escrowReread durability 3a Task 4: new, after a superseded publish: hostfiles.Open of the host's files manifest, and, when this box noted a mint, the sealed env (escrowEnvOf) and the local env file with instancefs.ReadBeneathLimitOrAbsent (1 MiB, no link followed) beneath the row's data directory, to refuse publishing over an escrowed secret of another value; the agent as carlos (carlos-edge.service), no root caller; only refuses
-internal/activator/escrow.go:ExecBackend.escrowedLaunchEnv durability 3a Task 4: new, the launch path for an eligible host: captureLaunchEnv once, publishEscrowAt over those bytes, SealedAcknowledged on the commit, and the env parsed from the captured bytes; on a supersession escrowReread and the launch preparation again (ensureAdminTokenFor, ensureInstanceKeyFor) once; a not-ready box launches only a host its ledger shows escrowed; the agent as carlos (carlos-edge.service), no root caller
+internal/activator/escrow.go:ExecBackend.escrowedLaunchEnv durability 3a Task 4: new, the launch path for an eligible host: captureLaunchEnv once, publishEscrowAt over those bytes, SealedAcknowledged on the commit, and the env parsed from the captured bytes; on a supersession escrowReread and the launch preparation again (ensureAdminTokenFor, ensureInstanceKeyFor) once; a not-ready box launches only a host its ledger shows escrowed; the agent as carlos (carlos-edge.service), no root caller Fix round 0 (controller readiness ruling): before the capture, the box's mode: no files store, instanceEnvLayer exactly as before 3a (logged once); no sealing key, a host whose ledger shows it escrowed launches on instanceEnvLayer (logged), otherwise keylessEscrowed (the answer this launch's restore read, within haSecretsBudget, else one GET) refuses when the bucket holds an escrow and launches on instanceEnvLayer when it holds none; nothing is published in either.
internal/activator/escrow.go:ExecBackend.haKnown durability 3a Task 4: new: the HA classification from memory only (haWakes, haLegacyRoute, the row's mark, the lifetime index); reads nothing
internal/activator/escrow.go:ExecBackend.openEscrowLocked durability 3a Task 4: new: the host's publisher, from its ledger (readEscrowLedger: readCappedFile, O_NOFOLLOW, 32 MiB, under <data>/.escrow, the agent's own directory) with no request, else hostfiles.Open (one GET); the agent as carlos (carlos-edge.service), no root caller
internal/activator/escrow.go:ExecBackend.publishEscrow durability 3a Task 4: new: publishEscrowAt on pathsFor
internal/activator/escrow.go:ExecBackend.publishEscrowAt durability 3a Task 4: new: escrowReady and the layout checked, then publishEscrowLocked under the host's lock
internal/activator/escrow.go:ExecBackend.publishEscrowLocked durability 3a Task 4: new: reads <host>.env (unless the launch's capture is handed in), <host>/instance.key and <host>/report.token with readStamped beneath the row's data directory, seals what changed (StageSealed), DropRawSecrets of the constant raw names, commits, and writes the ledger (writeEscrowLedger: EnsureDirBeneath .escrow 0700, a 0600 temp, rename, fsync); an absent file stages nothing; a refused file publishes nothing for it; the agent as carlos (carlos-edge.service), no root caller
-internal/activator/escrow.go:ExecBackend.restoreEscrowIfMissing durability 3a Task 4: new: checks each escrowed file with instancefs.OpenBeneathOrAbsent beneath the row's data directory; when one is absent, hostfiles.Open of the host's manifest, ReadSealed of each missing item, and writeIfAbsent (instancefs.WriteAtomic of a temp, then RenameBetweenNoReplace, so a present file is never replaced; EnsureDirBeneath for the files directory, 0700); on a box that is not ready it refuses unless the ledger shows the host escrowed and the env file is here; the agent as carlos (carlos-edge.service), no root caller
+internal/activator/escrow.go:ExecBackend.restoreEscrowIfMissing durability 3a Task 4: new: checks each escrowed file with instancefs.OpenBeneathOrAbsent beneath the row's data directory; when one is absent, hostfiles.Open of the host's manifest, ReadSealed of each missing item, and writeIfAbsent (instancefs.WriteAtomic of a temp, then RenameBetweenNoReplace, so a present file is never replaced; EnsureDirBeneath for the files directory, 0700); on a box that is not ready it refuses unless the ledger shows the host escrowed and the env file is here; the agent as carlos (carlos-edge.service), no root caller Fix round 0 (controller readiness ruling): with no files store it does nothing (logged once); with no sealing key it restores nothing: a ledger here and an env file here go on, otherwise keylessEscrowed refuses when the bucket holds an escrow and goes on as before 3a when it holds none.
internal/activator/escrow.go:ExecBackend.sweepPublish durability 3a Task 4: new: publishEscrowAt, and on a supersession escrowReread and one more publish; a second one is the alert
internal/activator/escrow.go:Service.EscrowSweep durability 3a Task 4: new: the backend's EscrowSweep, nothing for a backend without one
internal/activator/escrow.go:Service.SecretsEscrowed durability 3a Task 4: new: the backend's SecretsEscrowed, else IsHA
@@ -59,3 +58,6 @@ internal/activator/escrow.go:SplitBackend.EscrowSweep durability 3a Task 4: new:
internal/activator/escrow.go:SplitBackend.SecretsEscrowed durability 3a Task 4: new: forwards to the exec half, else IsHA
internal/activator/escrow.go:readStamped durability 3a Task 4: new: instancefs.OpenBeneathOrAbsent (openat2 beneath the row's data directory, no symlink, O_NONBLOCK, regular files only), fstat for the stamp, and at most 1 MiB read from that descriptor when the stamp moved
internal/activator/escrow.go:stampAt durability 3a Task 4: new: the same open as readStamped and its fstat; reads no bytes
+internal/activator/escrow.go:ExecBackend.escrowModeOf durability 3a Task 4 fix round 0 (controller readiness ruling): new: escrowNoStore when FilesStore is nil, escrowNoKey when escrowReady fails, else escrowOn; reads nothing
+internal/activator/escrow.go:ExecBackend.escrowOff durability 3a Task 4 fix round 0: new: one log line per host per process saying escrow is off and why; reads nothing
+internal/activator/escrow.go:ExecBackend.keylessEscrowed durability 3a Task 4 fix round 0: new, on a box with a files store and no sealing key: hostfiles.Load of the host's files manifest in the hibernate bucket (one GET), true when it holds any sealed item or the cutover marker (manifestEscrowed); the answer is kept in memory and reused within haSecretsBudget only for refusals and launches, a mint reads again; a failed read is an error and the caller refuses; the agent as carlos (carlos-edge.service), no root caller
diff --git a/docs/superpowers/notes/census-proposal-durability-3a-escrow.md b/docs/superpowers/notes/census-proposal-durability-3a-escrow.md
index 38da16364..ff26ba38e 100644
--- a/docs/superpowers/notes/census-proposal-durability-3a-escrow.md
+++ b/docs/superpowers/notes/census-proposal-durability-3a-escrow.md
@@ -1,6 +1,6 @@
# Census approval: durability-3a-escrow
-Ruling `census-ruling-durability-3a-escrow`. The independent reviewer approves or rejects every change below, 35 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-durability-3a-escrow`. The independent reviewer approves or rejects every change below, 38 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
@@ -69,16 +69,19 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/activator/escrow.go:ExecBackend.escrowEligible`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.escrowEligibleAt`: reads +registry:App, +registry:HA, +registry:HoldOp, +registry:Host, +registry:Replica, +registry:Status, +registry:Unit, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.escrowEnvOf`: reads +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
-- new `internal/activator/escrow.go:ExecBackend.escrowMintGuard`: reads +registry:Host, +whole:Route ×2; written legacy, accepted-legacy, frozen
+- new `internal/activator/escrow.go:ExecBackend.escrowMintGuard`: reads +registry:Host, +whole:Route ×5; written legacy, accepted-legacy, frozen
+- new `internal/activator/escrow.go:ExecBackend.escrowModeOf`: reads +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/activator/escrow.go:ExecBackend.escrowOff`: reads +registry:Host ×2; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.escrowReady`: reads +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.escrowReread`: reads +file:Open, +registry:Host ×5, +whole:Route ×2; written legacy, accepted-legacy, frozen
-- new `internal/activator/escrow.go:ExecBackend.escrowedLaunchEnv`: reads +registry:Host ×14, +whole:Route ×7; written legacy, accepted-legacy, frozen
+- new `internal/activator/escrow.go:ExecBackend.escrowedLaunchEnv`: reads +registry:Host ×15, +whole:Route ×14; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.haKnown`: reads +registry:HA, +registry:Host ×2, +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/activator/escrow.go:ExecBackend.keylessEscrowed`: reads +registry:Host ×2; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.openEscrowLocked`: reads +file:Open, +registry:Host ×2, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.publishEscrow`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.publishEscrowAt`: reads +registry:Host ×3, +whole:Route ×2; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.publishEscrowLocked`: reads +registry:Host ×5, +whole:Route; written legacy, accepted-legacy, frozen
-- new `internal/activator/escrow.go:ExecBackend.restoreEscrowIfMissing`: reads +file:Open, +registry:Host ×7, +whole:Route ×2; written legacy, accepted-legacy, frozen
+- new `internal/activator/escrow.go:ExecBackend.restoreEscrowIfMissing`: reads +file:Open, +registry:Host ×7, +whole:Route ×6; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:ExecBackend.sweepPublish`: reads +registry:Host, +whole:Route ×3; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:Service.EscrowSweep`: reads +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/activator/escrow.go:Service.SecretsEscrowed`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
@@ -98,6 +101,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/layout/inventory.go:Inventory`: reads +file:ReadDir; written legacy, accepted-legacy, frozen
- quiet `internal/layout/plan.go:NestedPlatformNames`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
-Seal: `eaeb153ab7a7a849edc9c6e92f2ac5c709c6e39044a647971cf1fa5ebcb660c8` → `ff7de0ee0c3c4d467e9517b579b300d3284ff900e96de78a2f3f27bed25180a0`.
+Seal: `eaeb153ab7a7a849edc9c6e92f2ac5c709c6e39044a647971cf1fa5ebcb660c8` → `c82fb613f735563c494d3ceb11cf6fc377f1a4b28562d71ebb0b7b128d53b422`.
Overlay: `internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/activator/escrow.go b/internal/activator/escrow.go
index 0edf85795..dfe058949 100644
--- a/internal/activator/escrow.go
+++ b/internal/activator/escrow.go
@@ -32,9 +32,13 @@ import (
//
// - Eligible is not ready. A host is eligible from its row and the box's
// layout facts alone (escrowEligible). The box is ready when it has a
-// files store and a sealing key (escrowReady). An eligible host on a
-// box that is not ready never restores, never mints and never makes
-// its first launch, and its scheduled ticks only read.
+// files store and a sealing key (escrowReady); readiness splits three
+// ways (escrowModeOf, the controller's ruling of 2026-10-31). With
+// both, everything below. With a files store and no key, the bucket is
+// read: an escrow there (any sealed item) means no restore, no mint
+// and no first launch; none there, and the host launches and mints as
+// before 3a, with nothing published. With no files store, as before
+// 3a. An eligible host's scheduled ticks only read, in every case.
// - The ledger (<data>/.escrow/<host>.json, the last committed manifest)
// is a publication baseline only: it keeps an unchanged sweep at zero
// requests across restarts. Before a missing file is restored, and
@@ -110,6 +114,14 @@ type escrowState struct {
// fromBucket: the next open reads the bucket, never the ledger (the
// ledger could not be written after a commit).
fromBucket bool
+ // keyless is the last answer, on a box with a files store and no
+ // sealing key, to "does the bucket hold an escrow for the host"
+ // (keylessEscrowed), and when it was read.
+ keyless bool
+ keylessAt time.Time
+ // offLogged: this process has said once that escrow is off for the
+ // host (escrowOff).
+ offLogged bool
}
// escrowBook is the backend's escrow state: one escrowState per host and
@@ -193,6 +205,92 @@ func (b *ExecBackend) escrowEligibleAt(rt registry.Route, l Layout) bool {
return ok
}
+// escrowMode is how far this box can take an eligible host's escrow
+// (the controller's readiness ruling, 2026-10-31).
+type escrowMode uint8
+
+const (
+ // escrowOn: a files store and a usable sealing key. Everything as the
+ // escrow is built.
+ escrowOn escrowMode = iota
+ // escrowNoKey: a files store and no usable sealing key. The bucket is
+ // read: an escrow there refuses restore, mint and a first launch (a
+ // rebuilt box with an escrow and no key, P1-1); none there, and the host
+ // launches and mints as before 3a, with nothing published.
+ escrowNoKey
+ // escrowNoStore: no files store, so no bucket to ask: the host
+ // launches and mints as before 3a.
+ escrowNoStore
+)
+
+// escrowModeOf is this box's escrow mode for rt.
+func (b *ExecBackend) escrowModeOf(rt registry.Route) escrowMode {
+ switch {
+ case b.FilesStore == nil:
+ return escrowNoStore
+ case b.escrowReady(rt) != nil:
+ return escrowNoKey
+ }
+ return escrowOn
+}
+
+// escrowOff says once per host per process that escrow is off for it, and
+// why.
+func (b *ExecBackend) escrowOff(rt registry.Route, why string) {
+ st := b.escrow.state(rt.Host)
+ said := true
+ b.escrow.with(func() { said, st.offLogged = st.offLogged, true })
+ if !said {
+ log.Printf("activator: %s: escrow is off: %s; the host launches and mints as before, and nothing of it is published", rt.Host, why)
+ }
+}
+
+// manifestEscrowed reports whether m holds an escrow: any sealed item, or
+// the cutover marker the first sealed commit leaves.
+func manifestEscrowed(m hostfiles.Manifest) bool {
+ for _, e := range m.Platform {
+ if e.Sealed != "" {
+ return true
+ }
+ }
+ _, ok := m.Platform[hostfiles.CutoverItem]
+ return ok
+}
+
+// keylessEscrowed answers, on a box with a files store and no sealing key,
+// whether the bucket holds an escrow for rt (one GET of the manifest). A
+// decision that only refuses, or only launches what is already on disk,
+// may reuse an answer read within haSecretsBudget (one launch's
+// preparation, so a launch costs one GET); a mint passes fresh and reads
+// the bucket at that moment. A read that fails is an error: the caller
+// refuses.
+func (b *ExecBackend) keylessEscrowed(ctx context.Context, rt registry.Route, fresh bool) (bool, error) {
+ st := b.escrow.state(rt.Host)
+ if !fresh {
+ var (
+ v bool
+ at time.Time
+ )
+ b.escrow.with(func() { v, at = st.keyless, st.keylessAt })
+ if !at.IsZero() && time.Since(at) < haSecretsBudget {
+ return v, nil
+ }
+ }
+ m, found, err := hostfiles.Load(ctx, b.FilesStore, b.filesPrefix(rt.Host))
+ if err != nil {
+ return false, fmt.Errorf("read the bucket for the host's escrow: %w", err)
+ }
+ v := found && manifestEscrowed(m)
+ b.escrow.with(func() { st.keyless, st.keylessAt = v, time.Now() })
+ return v, nil
+}
+
+// escrowKeylessRefusal is the refusal on a box with no sealing key whose
+// bucket holds an escrow for the host.
+func escrowKeylessRefusal(err error) error {
+ return fmt.Errorf("%w: the bucket holds an escrow for the host and this box has no key to open it", err)
+}
+
// escrowReady is nil when this box can read and write rt's sealed copy: a
// files store, a key, and a sealer for the row. Anything else wraps
// ErrEscrowNotReady.
@@ -520,9 +618,11 @@ func (b *ExecBackend) publishEscrowLocked(ctx context.Context, rt registry.Route
// restoreEscrowIfMissing reads the bucket manifest (one GET), then writes
// each sealed item whose local file is absent. A present file is never
-// touched. Nothing is read when no file is missing. On a box that is not
-// ready it restores nothing and refuses, unless the host has a ledger and
-// its env file is here.
+// touched. Nothing is read when no file is missing. With no files store it
+// does nothing (escrowNoStore). With no sealing key (escrowNoKey) it
+// restores nothing: it refuses when the bucket holds an escrow for the
+// host, unless the host has a ledger here and its env file is here, and
+// otherwise lets the launch go on as before 3a.
func (b *ExecBackend) restoreEscrowIfMissing(ctx context.Context, rt registry.Route, p instancePaths) error {
lay, ok := pubLayout(p.layout)
if !ok {
@@ -541,14 +641,24 @@ func (b *ExecBackend) restoreEscrowIfMissing(ctx context.Context, rt registry.Ro
f.Close()
}
}
- if err := b.escrowReady(rt); err != nil {
+ switch b.escrowModeOf(rt) {
+ case escrowNoStore:
+ b.escrowOff(rt, "this box has no files store")
+ return nil
+ case escrowNoKey:
+ err := b.escrowReady(rt)
+ if !missing[hostfiles.SealedEnvItem] && b.ledgerEscrowed(rt.Host) {
+ logPerFile("escrow-not-ready", rt.Host, fmt.Sprintf("activator: %s: escrow: %v; launching on the local env this box escrowed before", rt.Host, err))
+ return nil
+ }
+ escrowed, rerr := b.keylessEscrowed(ctx, rt, false)
switch {
- case missing[hostfiles.SealedEnvItem]:
- return fmt.Errorf("%w: the env file is missing and its escrow cannot be read here", err)
- case !b.ledgerEscrowed(rt.Host):
- return fmt.Errorf("%w: the host was never escrowed from this box, and its escrow cannot be read here", err)
+ case rerr != nil:
+ return fmt.Errorf("%w: %v", err, rerr)
+ case escrowed:
+ return escrowKeylessRefusal(err)
}
- logPerFile("escrow-not-ready", rt.Host, fmt.Sprintf("activator: %s: escrow: %v; launching on the local env this box escrowed before", rt.Host, err))
+ b.escrowOff(rt, "this box has no CARLOS_SECRETS_KEY to seal with, and the bucket holds no escrow for the host")
return nil
}
if len(missing) == 0 {
@@ -624,17 +734,32 @@ func writeIfAbsent(dir, name string, data []byte) (bool, error) {
return true, syncDirIfThere(dir)
}
-// escrowMintGuard is an eligible host's mint decision. On a box that is
-// not ready it refuses every mint (ErrEscrowNotReady). Otherwise it reads
+// escrowMintGuard is an eligible host's mint decision. With no files store
+// it is nil, and the producer mints as before 3a. With no sealing key it
+// reads the bucket at the mint and refuses (ErrEscrowNotReady) when the
+// bucket holds an escrow for the host, and lets the mint go ahead when it
+// holds none. Otherwise it reads
// the bucket's manifest when a producer would mint (never the ledger), at
// most once, and refuses, wrapping ErrInstanceKeyDeferred, when the
// escrowed env holds the variable; an escrow that does not open with this
// box's key refuses as not ready does. A mint it lets go ahead is noted, so
// a re-read after a supersession can tell a secret this box minted.
func (b *ExecBackend) escrowMintGuard(ctx context.Context, rt registry.Route) mintGuard {
- if err := b.escrowReady(rt); err != nil {
+ switch b.escrowModeOf(rt) {
+ case escrowNoStore:
+ return nil
+ case escrowNoKey:
+ ready := b.escrowReady(rt)
return func(name string) error {
- return fmt.Errorf("refusing to mint %s: %w", name, err)
+ escrowed, err := b.keylessEscrowed(ctx, rt, true)
+ switch {
+ case err != nil:
+ return fmt.Errorf("refusing to mint %s: %w: %v", name, ready, err)
+ case escrowed:
+ return fmt.Errorf("refusing to mint %s: %w", name, escrowKeylessRefusal(ready))
+ }
+ b.escrowOff(rt, "this box has no CARLOS_SECRETS_KEY to seal with, and the bucket holds no escrow for the host")
+ return nil
}
}
var (
@@ -765,11 +890,33 @@ func (b *ExecBackend) escrowReread(ctx context.Context, rt registry.Route, p ins
// them handed back. A publish that meets another writer reads the bucket
// again and starts the preparation over from the restore, once; a second
// one fails the launch with an alert. A failed write holds only a first
-// launch (a host never escrowed). On a box that is not ready, a host this
-// box escrowed before launches on its local env, logged.
+// launch (a host never escrowed). With no files store the launch is as
+// before 3a (instanceEnvLayer). With no sealing key, a host this box
+// escrowed before launches on its local env, logged; any other launches
+// as before 3a only while the bucket holds no escrow for it.
func (b *ExecBackend) escrowedLaunchEnv(ctx context.Context, rt registry.Route) (map[string]string, instancekey.Layer, error) {
for attempt := 0; ; attempt++ {
p := b.pathsFor(rt)
+ switch b.escrowModeOf(rt) {
+ case escrowNoStore:
+ b.escrowOff(rt, "this box has no files store")
+ return b.instanceEnvLayer(rt)
+ case escrowNoKey:
+ ready := b.escrowReady(rt)
+ if b.ledgerEscrowed(rt.Host) {
+ logPerFile("escrow-not-ready", rt.Host, fmt.Sprintf("activator: %s: escrow: %v; launching on the local env this box escrowed before", rt.Host, ready))
+ return b.instanceEnvLayer(rt)
+ }
+ escrowed, err := b.keylessEscrowed(ctx, rt, false)
+ switch {
+ case err != nil:
+ return nil, instancekey.LayerNone, fmt.Errorf("secrets for %s: %w: %v", rt.Host, ready, err)
+ case escrowed:
+ return nil, instancekey.LayerNone, fmt.Errorf("secrets for %s: %w", rt.Host, escrowKeylessRefusal(ready))
+ }
+ b.escrowOff(rt, "this box has no CARLOS_SECRETS_KEY to seal with, and the bucket holds no escrow for the host")
+ return b.instanceEnvLayer(rt)
+ }
c, err := b.captureLaunchEnv(rt)
if err != nil {
return nil, instancekey.LayerNone, fmt.Errorf("secrets for %s: %w", rt.Host, err)
@@ -777,13 +924,6 @@ func (b *ExecBackend) escrowedLaunchEnv(ctx context.Context, rt registry.Route)
if escrowHooks.afterCapture != nil {
escrowHooks.afterCapture(rt.Host)
}
- if err := b.escrowReady(rt); err != nil {
- if !b.ledgerEscrowed(rt.Host) {
- return nil, instancekey.LayerNone, fmt.Errorf("secrets for %s: %w", rt.Host, err)
- }
- logPerFile("escrow-not-ready", rt.Host, fmt.Sprintf("activator: %s: escrow: %v; launching on the local env this box escrowed before", rt.Host, err))
- return c.env, c.layer, nil
- }
r, err := b.publishEscrowAt(ctx, rt, p, c.own)
switch {
case errors.Is(err, hostfiles.ErrSuperseded):
diff --git a/internal/activator/escrow_test.go b/internal/activator/escrow_test.go
index c5c3d71be..306aa5f9d 100644
--- a/internal/activator/escrow_test.go
+++ b/internal/activator/escrow_test.go
@@ -301,83 +301,152 @@ func TestEscrowEligibilitySkipsWhatItMustNot(t *testing.T) {
}
}
-// An eligible host on a box that is not ready (no key, or no files store)
-// never restores, never mints and never makes its first launch, through
-// the real wake and the backfill. With a ledger and a complete local env it
-// launches.
+// A box with a files store and no sealing key, whose bucket holds an
+// escrow for the host (P1-1's rebuilt box): it never restores, never mints
+// and never makes the host's first launch, through the real wake and the
+// backfill. With a ledger and a complete local env it launches.
func TestNotReadyRefusesRestoreMintAndFirstLaunch(t *testing.T) {
- for _, gap := range []string{"no key", "no files store"} {
- t.Run(gap, func(t *testing.T) {
- ctx := context.Background()
- s := escrowService(t, escrowHost)
- writeEnv(t, s.b, s.rt, envA)
- mustPublish(t, s.b, s.rt)
- ledger := escrowLedgerPath(s.b.DataDir, s.rt.Host)
- kept, err := os.ReadFile(ledger)
- if err != nil {
- t.Fatal(err)
- }
- nb := restartEscrow(t, s.b)
- s.b = nb
- s.wire(nb)
- s.a = New(Config{Bucket: nb.Cfg.Bucket, Idle: time.Hour}, nb, nb.Registry)
- t.Cleanup(s.abandon)
- if gap == "no key" {
- nb.EscrowKey = nil
- } else {
- nb.FilesStore = nil
- }
- if err := nb.escrowReady(s.rt); !errors.Is(err, ErrEscrowNotReady) {
- t.Fatalf("ready: %v", err)
- }
- if ok, err := s.a.SecretsEscrowed(ctx, s.rt); !ok || err != nil {
- t.Fatalf("SecretsEscrowed %v, %v", ok, err)
- }
+ ctx := context.Background()
+ s := escrowService(t, escrowHost)
+ writeEnv(t, s.b, s.rt, envA)
+ mustPublish(t, s.b, s.rt)
+ ledger := escrowLedgerPath(s.b.DataDir, s.rt.Host)
+ kept, err := os.ReadFile(ledger)
+ if err != nil {
+ t.Fatal(err)
+ }
+ nb := restartEscrow(t, s.b)
+ s.b = nb
+ s.wire(nb)
+ s.a = New(Config{Bucket: nb.Cfg.Bucket, Idle: time.Hour}, nb, nb.Registry)
+ t.Cleanup(s.abandon)
+ nb.EscrowKey = nil
+ if nb.escrowModeOf(s.rt) != escrowNoKey {
+ t.Fatalf("mode %v", nb.escrowModeOf(s.rt))
+ }
+ if ok, err := s.a.SecretsEscrowed(ctx, s.rt); !ok || err != nil {
+ t.Fatalf("SecretsEscrowed %v, %v", ok, err)
+ }
- // The env is gone and the escrow is in the bucket: no restore, no
- // mint, no launch.
- if err := os.Remove(nb.pathsFor(s.rt).envFile); err != nil {
- t.Fatal(err)
- }
- if _, err := s.wakeForTest(ctx); !errors.Is(err, ErrEscrowNotReady) {
- t.Fatalf("wake with the env gone: %v", err)
- }
- if exists(nb.pathsFor(s.rt).envFile) || spawns(nb) != 0 {
- t.Fatalf("env written %v, spawns %d", exists(nb.pathsFor(s.rt).envFile), spawns(nb))
- }
+ // The env is gone and the escrow is in the bucket: no restore, no
+ // mint, no launch.
+ if err := os.Remove(nb.pathsFor(s.rt).envFile); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := s.wakeForTest(ctx); !errors.Is(err, ErrEscrowNotReady) {
+ t.Fatalf("wake with the env gone: %v", err)
+ }
+ if exists(nb.pathsFor(s.rt).envFile) || spawns(nb) != 0 {
+ t.Fatalf("env written %v, spawns %d", exists(nb.pathsFor(s.rt).envFile), spawns(nb))
+ }
- // No ledger: the host may have an escrow this box cannot see, so
- // its launch is refused even with a complete env.
- if err := os.Remove(ledger); err != nil {
- t.Fatal(err)
- }
- writeEnv(t, nb, s.rt, envA)
- if _, err := s.wakeForTest(ctx); !errors.Is(err, ErrEscrowNotReady) {
- t.Fatalf("wake with no ledger: %v", err)
- }
+ // No ledger: a complete env is not enough for the host's first launch
+ // from this box while the bucket holds an escrow.
+ if err := os.Remove(ledger); err != nil {
+ t.Fatal(err)
+ }
+ writeEnv(t, nb, s.rt, envA)
+ if _, err := s.wakeForTest(ctx); !errors.Is(err, ErrEscrowNotReady) {
+ t.Fatalf("wake with no ledger: %v", err)
+ }
- // A mint is refused: the backfill writes nothing.
- writeEnv(t, nb, s.rt, "CARLOS_ADMIN_TOKEN=tok-a\n")
- if _, err := nb.BackfillInstanceKey(ctx, s.rt); !errors.Is(err, ErrEscrowNotReady) {
- t.Fatalf("backfill: %v", err)
- }
- if got := envFileBytes(t, nb, s.rt); got != "CARLOS_ADMIN_TOKEN=tok-a\n" {
- t.Fatalf("the backfill changed the env: %q", got)
- }
+ // A mint is refused: the backfill writes nothing.
+ writeEnv(t, nb, s.rt, "CARLOS_ADMIN_TOKEN=tok-a\n")
+ if _, err := nb.BackfillInstanceKey(ctx, s.rt); !errors.Is(err, ErrEscrowNotReady) {
+ t.Fatalf("backfill: %v", err)
+ }
+ if got := envFileBytes(t, nb, s.rt); got != "CARLOS_ADMIN_TOKEN=tok-a\n" {
+ t.Fatalf("the backfill changed the env: %q", got)
+ }
- // A ledger and a complete env: the launch goes ahead.
- if err := os.WriteFile(ledger, kept, 0o600); err != nil {
- t.Fatal(err)
- }
- writeEnv(t, nb, s.rt, envA)
- e, err := s.wakeForTest(ctx)
- if err != nil || e == nil {
- t.Fatalf("wake with a ledger and a complete env: %v", err)
- }
- if got := envFileBytes(t, nb, s.rt); got != envA {
- t.Fatalf("env %q", got)
- }
- })
+ // A ledger and a complete env: the launch goes ahead.
+ if err := os.WriteFile(ledger, kept, 0o600); err != nil {
+ t.Fatal(err)
+ }
+ writeEnv(t, nb, s.rt, envA)
+ if e, err := s.wakeForTest(ctx); err != nil || e == nil {
+ t.Fatalf("wake with a ledger and a complete env: %v", err)
+ }
+ if got := envFileBytes(t, nb, s.rt); got != envA {
+ t.Fatalf("env %q", got)
+ }
+}
+
+// A box with a files store and no sealing key, whose bucket holds no
+// escrow for the host: the host launches and mints exactly as before 3a,
+// nothing is published, and a launch of a host already minted costs one
+// manifest GET.
+func TestNoKeyAndNoEscrowLaunchesAsBefore(t *testing.T) {
+ ctx := context.Background()
+ s := escrowService(t, escrowHost)
+ store := s.b.FilesStore
+ cs := &countingStore{Store: store}
+ s.b.FilesStore, s.b.EscrowKey = cs, nil
+ e, err := s.wakeForTest(ctx)
+ if err != nil {
+ t.Fatalf("wake: %v\n%s", err, s.ctl.joined())
+ }
+ if v := envValues(t, s.b, s.rt, "CARLOS_ADMIN_TOKEN", InstanceKeyVar); v[0] == "" || v[1] == "" || launchToken(t, s.b, s.rt) != v[0] {
+ t.Fatalf("the launch did not mint as before: %v, launch token %q", v, launchToken(t, s.b, s.rt))
+ }
+ if cs.puts.Load() != 0 || len(prefixObjects(t, s.b, s.rt)) != 0 {
+ t.Fatalf("published: %d PUTs, objects %v", cs.puts.Load(), prefixObjects(t, s.b, s.rt))
+ }
+ if _, err := os.Stat(escrowLedgerPath(s.b.DataDir, s.rt.Host)); !errors.Is(err, os.ErrNotExist) {
+ t.Fatalf("a ledger was written: %v", err)
+ }
+ if rep := s.b.EscrowSweep(ctx, []registry.Route{s.rt}); rep.Published+rep.Unchanged+rep.Deferred != 0 || len(rep.Failing) != 0 {
+ t.Fatalf("the sweep ran: %+v", rep)
+ }
+ s.stopForTest(e)
+ // The next launch, with both secrets on disk: one GET, and the token
+ // is the first launch's.
+ tok := launchToken(t, s.b, s.rt)
+ // A new launch's preparation: the first launch's answer has aged out.
+ st := s.b.escrow.state(s.rt.Host)
+ s.b.escrow.with(func() { st.keylessAt = time.Time{} })
+ before := cs.gets.Load()
+ if _, err := s.wakeForTest(ctx); err != nil {
+ t.Fatalf("the second wake: %v", err)
+ }
+ if got := cs.gets.Load() - before; got != 1 {
+ t.Fatalf("the second launch read the bucket %d times, want 1", got)
+ }
+ if launchToken(t, s.b, s.rt) != tok || cs.puts.Load() != 0 {
+ t.Fatalf("token %q, want %q; %d PUTs", launchToken(t, s.b, s.rt), tok, cs.puts.Load())
+ }
+ // The backfill mints as before.
+ writeEnv(t, s.b, s.rt, "CARLOS_ADMIN_TOKEN="+tok+"\n")
+ if got, err := s.b.BackfillInstanceKey(ctx, s.rt); err != nil || got != InstanceKeyMinted {
+ t.Fatalf("backfill: %v, %v", got, err)
+ }
+ if ok, err := s.a.SecretsEscrowed(ctx, s.rt); !ok || err != nil {
+ t.Fatalf("SecretsEscrowed %v, %v: scheduled ticks must stay read-only", ok, err)
+ }
+}
+
+// A box with no files store has no bucket to ask: the host launches and
+// mints exactly as before 3a.
+func TestNoFilesStoreLaunchesAsBefore(t *testing.T) {
+ ctx := context.Background()
+ s := escrowService(t, escrowHost)
+ store := s.b.FilesStore
+ s.b.FilesStore = nil
+ if s.b.escrowModeOf(s.rt) != escrowNoStore {
+ t.Fatalf("mode %v", s.b.escrowModeOf(s.rt))
+ }
+ if _, err := s.wakeForTest(ctx); err != nil {
+ t.Fatalf("wake: %v\n%s", err, s.ctl.joined())
+ }
+ if v := envValues(t, s.b, s.rt, "CARLOS_ADMIN_TOKEN", InstanceKeyVar); v[0] == "" || v[1] == "" {
+ t.Fatalf("the launch did not mint as before: %v", v)
+ }
+ s.b.FilesStore = store
+ if objs := prefixObjects(t, s.b, s.rt); len(objs) != 0 {
+ t.Fatalf("published %d objects", len(objs))
+ }
+ if ok, err := s.a.SecretsEscrowed(ctx, s.rt); !ok || err != nil {
+ t.Fatalf("SecretsEscrowed %v, %v: scheduled ticks must stay read-only", ok, err)
}
}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 8688cb8a8..78d2ed417 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -45,4 +45,4 @@ plan14-root-reads-fleet-public-routes.tsv bca6ef741a96b72767b1747789cd01b3111d61
plan14-root-reads-fleet-routes-followups.tsv 1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7
plan14-root-reads-tunnel-websockets.tsv 949bc734a293366e6b2700244af5110dd6e84b5432023e991c09e806afd62483
plan14-root-reads-console-protection-tab.tsv eaeb153ab7a7a849edc9c6e92f2ac5c709c6e39044a647971cf1fa5ebcb660c8
-plan14-root-reads-durability-3a-escrow.tsv ff7de0ee0c3c4d467e9517b579b300d3284ff900e96de78a2f3f27bed25180a0
+plan14-root-reads-durability-3a-escrow.tsv c82fb613f735563c494d3ceb11cf6fc377f1a4b28562d71ebb0b7b128d53b422
diff --git a/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv b/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv
index 135e6f0b4..167ca71f2 100644
--- a/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv
+++ b/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv
@@ -1,7 +1,7 @@
# Census overlay durability-3a-escrow, written by census-propose (#369). census-ruling-durability-3a-escrow, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-durability-3a-escrow.md.
# 8 body, 11 sites, 5 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 3 removed: each unit's declaration, or each envelope's directory, is absent from the scanned tree, so its row goes, a frozen declaration is retired as absent, and an envelope is retired.
-# 35 new dispositions: 0 reads re-frozen at their disposition with the claim, 34 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other.
+# 38 new dispositions: 0 reads re-frozen at their disposition with the claim, 37 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other.
@legacy 88938980d11f4be9932058259d7d471b340ac51300691427ac51de62999b0f83 internal/activator/admintoken.go ensureAdminToken legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos (EnsureAdminToken, EnsureAdminTokenBeneath and ensureAdminTokenFor; the agent's scheduler token through EnsureAdminToken; no root caller found): one more parameter, guard (a mintGuard, nil for every caller but an HA host's ensureAdminTokenFor), asked once this locked read has found no token and before anything is minted; its refusal is returned with nothing written. The read, mode check, shape check and mint are unchanged; the same four sites, no read added; only adds a refusal;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: the guard is now asked with the variable it would mint, guard("CARLOS_ADMIN_TOKEN"), still only once this locked read found no token and before anything is minted; its refusal is returned with nothing written. The read, mode check, shape check and mint are unchanged; the same four sites; only adds a refusal file:Lstat@1864,file:OpenFile@4464,file:Read@4101,file:ReadFile@433 cf06e83cc0e322792272d3a10b6b2478cac66973acfd2ac3faf8497a2b6eb61b
@legacy 3b34d3f4313e6a6e9b96b37e3eee744d3574f6d523bd329f750f1cd245a0e22b internal/activator/claim_snapshot.go ExecBackend.EnsureClaimAdminToken legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, inside the claim's authorize callback: the missing-token mint is now ensureAdminTokenFor(ctx, rt, paths) instead of ensureAdminTokenAt(paths, rt.Host+".env") (deleted); both pick the beneath (instancefs) producer on the nested layout and the path one otherwise, on the same file; the new one also asks an HA host's mint decision (haMintGuard) at the moment it would mint. The separate haMintGate call of the first proposal is gone (final fix F2). Sites: -registry:Host (the rt.Host+".env" argument) and +whole:Route (rt to ensureAdminTokenFor); only adds a refusal for an HA host;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: a comment names mintGuardFor instead of haMintGuard; the body is unchanged registry:Host@2644,registry:Replica@1285,whole:Route@1363,whole:Route@2016,whole:Route@212,whole:Route@2307,whole:Route@2571,whole:Route@285,whole:Route@347 4a5935d18fe04a5f73170a32bdcb46f9996eacca5602ba108b408e2f4254fa79
@legacy 27c808de21de2d81ab651428b0e177ba93a21a86a5d5d47f7901fbd768e773a6 internal/activator/hasecrets.go Service.fillScheduledToken legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: sets the tick's Authorization header from haScheduledToken for an HA host; any other host's request is untouched; +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: asks escrowedScheduledToken (was haScheduledToken), so an escrowed host (HA, or eligible for escrow) gets its tick's Authorization header from the env file its wake restored or minted; any other host's request is untouched; the same one site whole:Route@215 8d7bdf5e155a74ca9f667c4ebc21a4a7df571740d0f81ef5e77bc86bffd9cbe0
@@ -16,16 +16,19 @@
@legacy 254a354a40269aaae37fee1c09f3fa5a46763943c83ba128748dc51e3f1a46fe internal/activator/escrow.go ExecBackend.escrowEligible legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: escrowEligibleAt on pathsFor's classification whole:Route@105,whole:Route@90 038966cd4221f6cbafe0eb80bdbf7ec69b54d36a34c0ea22a53746d2acac63fe
@legacy ea8e33b8cda7a3bf9671cfec5fbb8f90ad01be56378d7558af9520f6c25519c8 internal/activator/escrow.go ExecBackend.escrowEligibleAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: a pure predicate over the row and a classification: ActivatorManaged, not unit, sidecar, HA, replica, held, a valid host shape and app, flat or nested, on a box with a hibernate bucket; reads only row fields registry:App@295,registry:HA@163,registry:HoldOp@186,registry:Host@265,registry:Replica@172,registry:Status@221,registry:Unit@126,whole:Route@119 5df0c11ddde0ec351b062b87863396108d2fe48b7b4e390ca69daf377e0cac58
@legacy a7d3afeb8f7275c5636a65cace92ecf2e4a2d4f2fa5f3fa2278494f27ec2d2bb internal/activator/escrow.go ExecBackend.escrowEnvOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the sealed env item opened with hostfiles.ReadSealed under this box's key and the row's binding (sha256, v2 envelope, binding and MAC checked); found false when the manifest holds none; a failure wraps ErrEscrowNotReady registry:Host@389,whole:Route@230 dd6e1f3a3e8299303a3f9c2f89d2ec2f952dbdcb45264ac39484abc925b2e415
-@legacy 3a99a89a020dcd2d9515c44d50142d60462b47aa8f5c88899d7678fd82cbca46 internal/activator/escrow.go ExecBackend.escrowMintGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: on a box that is not ready refuses every mint (ErrEscrowNotReady); otherwise, once and only when a producer would mint, bucketEscrowEnv, and refuses (ErrInstanceKeyDeferred) when the escrowed env holds the variable; a mint it allows is noted in memory; only refuses registry:Host@823,whole:Route@115,whole:Route@375 dc67b3eb05e7fb7d907c2d1028fb8792cd2e3f416d29610601fc3b90e6534735
+@legacy 4d61ab07852c1855e1d763b3a93f42a1f6f1a796df2f3dd3d0ba725873bbff29 internal/activator/escrow.go ExecBackend.escrowMintGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: on a box that is not ready refuses every mint (ErrEscrowNotReady); otherwise, once and only when a producer would mint, bucketEscrowEnv, and refuses (ErrInstanceKeyDeferred) when the escrowed env holds the variable; a mint it allows is noted in memory; only refuses Fix round 0 (controller readiness ruling): with no files store it is nil, and the producer mints as before 3a; with a files store and no sealing key it reads the bucket manifest at the mint (keylessEscrowed, fresh) and refuses (ErrEscrowNotReady) when the bucket holds any sealed item or the cutover marker for the host, and otherwise lets the mint go ahead (logged once); only refuses. registry:Host@1224,whole:Route@113,whole:Route@197,whole:Route@279,whole:Route@514,whole:Route@776 3e914cc96c915529e0c322572e62a5a67fc0528a06ee6514541aa492ce50be1f
+@legacy 4936d243b2f0dfe0070b2ed97ea46ff79d868bedc54deefec132baadba1410ee internal/activator/escrow.go ExecBackend.escrowModeOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 0 (controller readiness ruling): new: escrowNoStore when FilesStore is nil, escrowNoKey when escrowReady fails, else escrowOn; reads nothing whole:Route@147 6bfaddec7936f24f6756c8c68547d6a7fa54dd0523db9024e2f71924a2e7ecee
+@legacy 2483746d1c63202a3c641199ea442261483853bea1b112ec3f2afc4772011d26 internal/activator/escrow.go ExecBackend.escrowOff legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 0: new: one log line per host per process saying escrow is off and why; reads nothing registry:Host@309,registry:Host@87 6f3a552d5af240733241ea7befefa194706a70770e8bdc4f3c444ac48cf8f8c3
@legacy 73fa77e711e182b4777ae6346795af7d5a36c4f1c231714ff2415806bffeafff internal/activator/escrow.go ExecBackend.escrowReady legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: FilesStore and EscrowKey set and sealerFor succeeds; reads nothing whole:Route@165 fb7390d8f2ce1653619c3b365a3f804e5e1a0bb6f77210972a83453ebda42316
@legacy 3ff2ef7cd3271d7327d344768855f6f806dc4b09cad4c5ef9250b14d0ddc0770 internal/activator/escrow.go ExecBackend.escrowReread legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, after a superseded publish: hostfiles.Open of the host's files manifest, and, when this box noted a mint, the sealed env (escrowEnvOf) and the local env file with instancefs.ReadBeneathLimitOrAbsent (1 MiB, no link followed) beneath the row's data directory, to refuse publishing over an escrowed secret of another value; the agent as carlos (carlos-edge.service), no root caller; only refuses file:Open@284,registry:Host@122,registry:Host@1394,registry:Host@332,registry:Host@520,registry:Host@925,whole:Route@193,whole:Route@810 81436a987e2a08d1290ebb30cfb0c63e7b42466ab2dd2a9f318697b18937b8fe
-@legacy 6978a370aacf57a603e45fe277e027bde6ff8947714eac9b08754053e305223b internal/activator/escrow.go ExecBackend.escrowedLaunchEnv legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, the launch path for an eligible host: captureLaunchEnv once, publishEscrowAt over those bytes, SealedAcknowledged on the commit, and the env parsed from the captured bytes; on a supersession escrowReread and the launch preparation again (ensureAdminTokenFor, ensureInstanceKeyFor) once; a not-ready box launches only a host its ledger shows escrowed; the agent as carlos (carlos-edge.service), no root caller registry:Host@1118,registry:Host@1380,registry:Host@1541,registry:Host@1726,registry:Host@1847,registry:Host@2021,registry:Host@2237,registry:Host@307,registry:Host@392,registry:Host@473,registry:Host@556,registry:Host@609,registry:Host@712,registry:Host@916,whole:Route@1025,whole:Route@1283,whole:Route@1443,whole:Route@179,whole:Route@214,whole:Route@431,whole:Route@796 2d7bcc0404536ce0ff4420c91f7ec8456e05f15f7ef320ba16d95b833eb518aa
+@legacy b62bbc256140c64ab4f837b8ab1b5a7b39da7ca33b8c17c0a4f209c319621a4b internal/activator/escrow.go ExecBackend.escrowedLaunchEnv legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, the launch path for an eligible host: captureLaunchEnv once, publishEscrowAt over those bytes, SealedAcknowledged on the commit, and the env parsed from the captured bytes; on a supersession escrowReread and the launch preparation again (ensureAdminTokenFor, ensureInstanceKeyFor) once; a not-ready box launches only a host its ledger shows escrowed; the agent as carlos (carlos-edge.service), no root caller Fix round 0 (controller readiness ruling): before the capture, the box's mode: no files store, instanceEnvLayer exactly as before 3a (logged once); no sealing key, a host whose ledger shows it escrowed launches on instanceEnvLayer (logged), otherwise keylessEscrowed (the answer this launch's restore read, within haSecretsBudget, else one GET) refuses when the bucket holds an escrow and launches on instanceEnvLayer when it holds none; nothing is published in either. registry:Host@1188,registry:Host@1273,registry:Host@1441,registry:Host@1643,registry:Host@1905,registry:Host@2066,registry:Host@2251,registry:Host@2372,registry:Host@2546,registry:Host@2762,registry:Host@391,registry:Host@437,registry:Host@540,registry:Host@758,registry:Host@869,whole:Route@1056,whole:Route@1095,whole:Route@1321,whole:Route@1550,whole:Route@179,whole:Route@1808,whole:Route@1968,whole:Route@207,whole:Route@250,whole:Route@314,whole:Route@364,whole:Route@587,whole:Route@639,whole:Route@927 dd7eed18e97f32155348bacb8a49cf44b77963756f75254788c0a520f6f1145d
@legacy aa6c1694a6bfba03769ad089b3715610848596875e636952cf981c59a1761de3 internal/activator/escrow.go ExecBackend.haKnown legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the HA classification from memory only (haWakes, haLegacyRoute, the row's mark, the lifetime index); reads nothing registry:HA@185,registry:Host@274,registry:Host@95,whole:Route@151 4ecae90469fb6eda421464ca4509db7ddf4e5180180377867d3804b95bfd0c23
+@legacy 2587e3150f1a9419ddd6dec519ae86f3ea25d3af12c14f2f8cb261a0a2eac3bf internal/activator/escrow.go ExecBackend.keylessEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 0: new, on a box with a files store and no sealing key: hostfiles.Load of the host's files manifest in the hibernate bucket (one GET), true when it holds any sealed item or the cutover marker (manifestEscrowed); the answer is kept in memory and reused within haSecretsBudget only for refusals and launches, a mint reads again; a failed read is an error and the caller refuses; the agent as carlos (carlos-edge.service), no root caller registry:Host@128,registry:Host@396 9c404de03d0b6d4a6f8945919190309f303da2f09b87e6a77899c63300f471ea
@legacy 5f8d31b1db375a8c123a14e6bba1f641e7691aaae538be3c2616707eca4b3211 internal/activator/escrow.go ExecBackend.openEscrowLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the host's publisher, from its ledger (readEscrowLedger: readCappedFile, O_NOFOLLOW, 32 MiB, under <data>/.escrow, the agent's own directory) with no request, else hostfiles.Open (one GET); the agent as carlos (carlos-edge.service), no root caller file:Open@753,registry:Host@528,registry:Host@600,whole:Route@415 8e3c6c1f3e88b7d6681df4b8be74508386172b1a7b88c308d18511509a3af991
@legacy c7f95f454a974537377434c9993beebc3b0761e814ae369a8e1e29a5c3fc5474 internal/activator/escrow.go ExecBackend.publishEscrow legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: publishEscrowAt on pathsFor whole:Route@149,whole:Route@164 e61757f12a116ef8bf819dcad7136f810c51dfa9f7104ceb7f810efece48cc29
@legacy 05a44197ac3ebe3fb4402d2153442bf4f578be3cfbae0bbea4ea7a7aff67a4f8 internal/activator/escrow.go ExecBackend.publishEscrowAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: escrowReady and the layout checked, then publishEscrowLocked under the host's lock registry:Host@223,registry:Host@331,registry:Host@428,whole:Route@157,whole:Route@508 726dfaf89eaf2a1a13a1b0492ffe4582dbc43ca816821d488d5dcca53bda6f33
@legacy 5308584fd1521a1ede129be626cb25ecebdf2cf2c3a02c0036d09e6a159ac7c8 internal/activator/escrow.go ExecBackend.publishEscrowLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: reads <host>.env (unless the launch's capture is handed in), <host>/instance.key and <host>/report.token with readStamped beneath the row's data directory, seals what changed (StageSealed), DropRawSecrets of the constant raw names, commits, and writes the ledger (writeEscrowLedger: EnsureDirBeneath .escrow 0700, a 0600 temp, rename, fsync); an absent file stages nothing; a refused file publishes nothing for it; the agent as carlos (carlos-edge.service), no root caller registry:Host@2175,registry:Host@2439,registry:Host@3454,registry:Host@3602,registry:Host@589,whole:Route@2366 18edc91e27cadfdb73cd23e3c45b71350239c1d3f0a109a87b49e6fa2b7f8f35
-@legacy 46e7ba0e76be7212ff3492fc03c77b4a37a024df4971462c1084cca653290a2e internal/activator/escrow.go ExecBackend.restoreEscrowIfMissing legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: checks each escrowed file with instancefs.OpenBeneathOrAbsent beneath the row's data directory; when one is absent, hostfiles.Open of the host's manifest, ReadSealed of each missing item, and writeIfAbsent (instancefs.WriteAtomic of a temp, then RenameBetweenNoReplace, so a present file is never replaced; EnsureDirBeneath for the files directory, 0700); on a box that is not ready it refuses unless the ledger shows the host escrowed and the env file is here; the agent as carlos (carlos-edge.service), no root caller file:Open@1454,registry:Host@1044,registry:Host@1137,registry:Host@1311,registry:Host@2541,registry:Host@267,registry:Host@783,registry:Host@941,whole:Route@1208,whole:Route@596 963e02ab77afb2b8f9c86f8022b5200134345a25d750bfd2da54f9cacd627953
+@legacy a909f0d37bf1b4f77c9d218c79b454ecbbe98bcdfccc7511bebc0a8f250d03a7 internal/activator/escrow.go ExecBackend.restoreEscrowIfMissing legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: checks each escrowed file with instancefs.OpenBeneathOrAbsent beneath the row's data directory; when one is absent, hostfiles.Open of the host's manifest, ReadSealed of each missing item, and writeIfAbsent (instancefs.WriteAtomic of a temp, then RenameBetweenNoReplace, so a present file is never replaced; EnsureDirBeneath for the files directory, 0700); on a box that is not ready it refuses unless the ledger shows the host escrowed and the env file is here; the agent as carlos (carlos-edge.service), no root caller Fix round 0 (controller readiness ruling): with no files store it does nothing (logged once); with no sealing key it restores nothing: a ledger here and an env file here go on, otherwise keylessEscrowed refuses when the bucket holds an escrow and goes on as before 3a when it holds none. file:Open@1662,registry:Host@1345,registry:Host@1519,registry:Host@267,registry:Host@2749,registry:Host@788,registry:Host@833,registry:Host@936,whole:Route@1012,whole:Route@1167,whole:Route@1416,whole:Route@594,whole:Route@635,whole:Route@725 e24cb07f81da9026c269ab9de76cb0d64761ba5e2a2fc5fbe1c1d73cdc600b8b
@legacy 7d7ae676fe3d33d027489b397a804eaa184295667ad039688aed3757f662ab9d internal/activator/escrow.go ExecBackend.sweepPublish legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: publishEscrowAt, and on a supersession escrowReread and one more publish; a second one is the alert registry:Host@404,whole:Route@142,whole:Route@232,whole:Route@312 71bfee868a2ca8e3371cfc3c628b6ab5d8730ca48fcd099e7932049fe1e12a69
@legacy c89cfff20022faa5af3e07251a620b1b63e0b42f350483a6efec4162efdd1cca internal/activator/escrow.go Service.EscrowSweep legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the backend's EscrowSweep, nothing for a backend without one whole:Route@184 8ed0ea62a9807b7c43b3576d01f096bfe366c21bcc3be040831a3f1b80d1b123
@legacy 5e6fbfb1fc889f9d7742e9275cfaac39888a93c8d33ed329ee92088fcc52167f internal/activator/escrow.go Service.SecretsEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the backend's SecretsEscrowed, else IsHA whole:Route@184,whole:Route@215 87261115297104155806136d4d0001c4cd3e150e5ffe91612bb5014fb7780881
@@ -69,16 +72,19 @@ internal/activator/escrow.go ExecBackend.escrowChanged legacy accepted-legacy ac
internal/activator/escrow.go ExecBackend.escrowEligible legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: escrowEligibleAt on pathsFor's classification whole:Route@105,whole:Route@90 038966cd4221f6cbafe0eb80bdbf7ec69b54d36a34c0ea22a53746d2acac63fe
internal/activator/escrow.go ExecBackend.escrowEligibleAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: a pure predicate over the row and a classification: ActivatorManaged, not unit, sidecar, HA, replica, held, a valid host shape and app, flat or nested, on a box with a hibernate bucket; reads only row fields registry:App@295,registry:HA@163,registry:HoldOp@186,registry:Host@265,registry:Replica@172,registry:Status@221,registry:Unit@126,whole:Route@119 5df0c11ddde0ec351b062b87863396108d2fe48b7b4e390ca69daf377e0cac58
internal/activator/escrow.go ExecBackend.escrowEnvOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the sealed env item opened with hostfiles.ReadSealed under this box's key and the row's binding (sha256, v2 envelope, binding and MAC checked); found false when the manifest holds none; a failure wraps ErrEscrowNotReady registry:Host@389,whole:Route@230 dd6e1f3a3e8299303a3f9c2f89d2ec2f952dbdcb45264ac39484abc925b2e415
-internal/activator/escrow.go ExecBackend.escrowMintGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: on a box that is not ready refuses every mint (ErrEscrowNotReady); otherwise, once and only when a producer would mint, bucketEscrowEnv, and refuses (ErrInstanceKeyDeferred) when the escrowed env holds the variable; a mint it allows is noted in memory; only refuses registry:Host@823,whole:Route@115,whole:Route@375 dc67b3eb05e7fb7d907c2d1028fb8792cd2e3f416d29610601fc3b90e6534735
+internal/activator/escrow.go ExecBackend.escrowMintGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: on a box that is not ready refuses every mint (ErrEscrowNotReady); otherwise, once and only when a producer would mint, bucketEscrowEnv, and refuses (ErrInstanceKeyDeferred) when the escrowed env holds the variable; a mint it allows is noted in memory; only refuses Fix round 0 (controller readiness ruling): with no files store it is nil, and the producer mints as before 3a; with a files store and no sealing key it reads the bucket manifest at the mint (keylessEscrowed, fresh) and refuses (ErrEscrowNotReady) when the bucket holds any sealed item or the cutover marker for the host, and otherwise lets the mint go ahead (logged once); only refuses. registry:Host@1224,whole:Route@113,whole:Route@197,whole:Route@279,whole:Route@514,whole:Route@776 3e914cc96c915529e0c322572e62a5a67fc0528a06ee6514541aa492ce50be1f
+internal/activator/escrow.go ExecBackend.escrowModeOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 0 (controller readiness ruling): new: escrowNoStore when FilesStore is nil, escrowNoKey when escrowReady fails, else escrowOn; reads nothing whole:Route@147 6bfaddec7936f24f6756c8c68547d6a7fa54dd0523db9024e2f71924a2e7ecee
+internal/activator/escrow.go ExecBackend.escrowOff legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 0: new: one log line per host per process saying escrow is off and why; reads nothing registry:Host@309,registry:Host@87 6f3a552d5af240733241ea7befefa194706a70770e8bdc4f3c444ac48cf8f8c3
internal/activator/escrow.go ExecBackend.escrowReady legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: FilesStore and EscrowKey set and sealerFor succeeds; reads nothing whole:Route@165 fb7390d8f2ce1653619c3b365a3f804e5e1a0bb6f77210972a83453ebda42316
internal/activator/escrow.go ExecBackend.escrowReread legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, after a superseded publish: hostfiles.Open of the host's files manifest, and, when this box noted a mint, the sealed env (escrowEnvOf) and the local env file with instancefs.ReadBeneathLimitOrAbsent (1 MiB, no link followed) beneath the row's data directory, to refuse publishing over an escrowed secret of another value; the agent as carlos (carlos-edge.service), no root caller; only refuses file:Open@284,registry:Host@122,registry:Host@1394,registry:Host@332,registry:Host@520,registry:Host@925,whole:Route@193,whole:Route@810 81436a987e2a08d1290ebb30cfb0c63e7b42466ab2dd2a9f318697b18937b8fe
-internal/activator/escrow.go ExecBackend.escrowedLaunchEnv legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, the launch path for an eligible host: captureLaunchEnv once, publishEscrowAt over those bytes, SealedAcknowledged on the commit, and the env parsed from the captured bytes; on a supersession escrowReread and the launch preparation again (ensureAdminTokenFor, ensureInstanceKeyFor) once; a not-ready box launches only a host its ledger shows escrowed; the agent as carlos (carlos-edge.service), no root caller registry:Host@1118,registry:Host@1380,registry:Host@1541,registry:Host@1726,registry:Host@1847,registry:Host@2021,registry:Host@2237,registry:Host@307,registry:Host@392,registry:Host@473,registry:Host@556,registry:Host@609,registry:Host@712,registry:Host@916,whole:Route@1025,whole:Route@1283,whole:Route@1443,whole:Route@179,whole:Route@214,whole:Route@431,whole:Route@796 2d7bcc0404536ce0ff4420c91f7ec8456e05f15f7ef320ba16d95b833eb518aa
+internal/activator/escrow.go ExecBackend.escrowedLaunchEnv legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, the launch path for an eligible host: captureLaunchEnv once, publishEscrowAt over those bytes, SealedAcknowledged on the commit, and the env parsed from the captured bytes; on a supersession escrowReread and the launch preparation again (ensureAdminTokenFor, ensureInstanceKeyFor) once; a not-ready box launches only a host its ledger shows escrowed; the agent as carlos (carlos-edge.service), no root caller Fix round 0 (controller readiness ruling): before the capture, the box's mode: no files store, instanceEnvLayer exactly as before 3a (logged once); no sealing key, a host whose ledger shows it escrowed launches on instanceEnvLayer (logged), otherwise keylessEscrowed (the answer this launch's restore read, within haSecretsBudget, else one GET) refuses when the bucket holds an escrow and launches on instanceEnvLayer when it holds none; nothing is published in either. registry:Host@1188,registry:Host@1273,registry:Host@1441,registry:Host@1643,registry:Host@1905,registry:Host@2066,registry:Host@2251,registry:Host@2372,registry:Host@2546,registry:Host@2762,registry:Host@391,registry:Host@437,registry:Host@540,registry:Host@758,registry:Host@869,whole:Route@1056,whole:Route@1095,whole:Route@1321,whole:Route@1550,whole:Route@179,whole:Route@1808,whole:Route@1968,whole:Route@207,whole:Route@250,whole:Route@314,whole:Route@364,whole:Route@587,whole:Route@639,whole:Route@927 dd7eed18e97f32155348bacb8a49cf44b77963756f75254788c0a520f6f1145d
internal/activator/escrow.go ExecBackend.haKnown legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the HA classification from memory only (haWakes, haLegacyRoute, the row's mark, the lifetime index); reads nothing registry:HA@185,registry:Host@274,registry:Host@95,whole:Route@151 4ecae90469fb6eda421464ca4509db7ddf4e5180180377867d3804b95bfd0c23
+internal/activator/escrow.go ExecBackend.keylessEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 0: new, on a box with a files store and no sealing key: hostfiles.Load of the host's files manifest in the hibernate bucket (one GET), true when it holds any sealed item or the cutover marker (manifestEscrowed); the answer is kept in memory and reused within haSecretsBudget only for refusals and launches, a mint reads again; a failed read is an error and the caller refuses; the agent as carlos (carlos-edge.service), no root caller registry:Host@128,registry:Host@396 9c404de03d0b6d4a6f8945919190309f303da2f09b87e6a77899c63300f471ea
internal/activator/escrow.go ExecBackend.openEscrowLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the host's publisher, from its ledger (readEscrowLedger: readCappedFile, O_NOFOLLOW, 32 MiB, under <data>/.escrow, the agent's own directory) with no request, else hostfiles.Open (one GET); the agent as carlos (carlos-edge.service), no root caller file:Open@753,registry:Host@528,registry:Host@600,whole:Route@415 8e3c6c1f3e88b7d6681df4b8be74508386172b1a7b88c308d18511509a3af991
internal/activator/escrow.go ExecBackend.publishEscrow legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: publishEscrowAt on pathsFor whole:Route@149,whole:Route@164 e61757f12a116ef8bf819dcad7136f810c51dfa9f7104ceb7f810efece48cc29
internal/activator/escrow.go ExecBackend.publishEscrowAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: escrowReady and the layout checked, then publishEscrowLocked under the host's lock registry:Host@223,registry:Host@331,registry:Host@428,whole:Route@157,whole:Route@508 726dfaf89eaf2a1a13a1b0492ffe4582dbc43ca816821d488d5dcca53bda6f33
internal/activator/escrow.go ExecBackend.publishEscrowLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: reads <host>.env (unless the launch's capture is handed in), <host>/instance.key and <host>/report.token with readStamped beneath the row's data directory, seals what changed (StageSealed), DropRawSecrets of the constant raw names, commits, and writes the ledger (writeEscrowLedger: EnsureDirBeneath .escrow 0700, a 0600 temp, rename, fsync); an absent file stages nothing; a refused file publishes nothing for it; the agent as carlos (carlos-edge.service), no root caller registry:Host@2175,registry:Host@2439,registry:Host@3454,registry:Host@3602,registry:Host@589,whole:Route@2366 18edc91e27cadfdb73cd23e3c45b71350239c1d3f0a109a87b49e6fa2b7f8f35
-internal/activator/escrow.go ExecBackend.restoreEscrowIfMissing legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: checks each escrowed file with instancefs.OpenBeneathOrAbsent beneath the row's data directory; when one is absent, hostfiles.Open of the host's manifest, ReadSealed of each missing item, and writeIfAbsent (instancefs.WriteAtomic of a temp, then RenameBetweenNoReplace, so a present file is never replaced; EnsureDirBeneath for the files directory, 0700); on a box that is not ready it refuses unless the ledger shows the host escrowed and the env file is here; the agent as carlos (carlos-edge.service), no root caller file:Open@1454,registry:Host@1044,registry:Host@1137,registry:Host@1311,registry:Host@2541,registry:Host@267,registry:Host@783,registry:Host@941,whole:Route@1208,whole:Route@596 963e02ab77afb2b8f9c86f8022b5200134345a25d750bfd2da54f9cacd627953
+internal/activator/escrow.go ExecBackend.restoreEscrowIfMissing legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: checks each escrowed file with instancefs.OpenBeneathOrAbsent beneath the row's data directory; when one is absent, hostfiles.Open of the host's manifest, ReadSealed of each missing item, and writeIfAbsent (instancefs.WriteAtomic of a temp, then RenameBetweenNoReplace, so a present file is never replaced; EnsureDirBeneath for the files directory, 0700); on a box that is not ready it refuses unless the ledger shows the host escrowed and the env file is here; the agent as carlos (carlos-edge.service), no root caller Fix round 0 (controller readiness ruling): with no files store it does nothing (logged once); with no sealing key it restores nothing: a ledger here and an env file here go on, otherwise keylessEscrowed refuses when the bucket holds an escrow and goes on as before 3a when it holds none. file:Open@1662,registry:Host@1345,registry:Host@1519,registry:Host@267,registry:Host@2749,registry:Host@788,registry:Host@833,registry:Host@936,whole:Route@1012,whole:Route@1167,whole:Route@1416,whole:Route@594,whole:Route@635,whole:Route@725 e24cb07f81da9026c269ab9de76cb0d64761ba5e2a2fc5fbe1c1d73cdc600b8b
internal/activator/escrow.go ExecBackend.sweepPublish legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: publishEscrowAt, and on a supersession escrowReread and one more publish; a second one is the alert registry:Host@404,whole:Route@142,whole:Route@232,whole:Route@312 71bfee868a2ca8e3371cfc3c628b6ab5d8730ca48fcd099e7932049fe1e12a69
internal/activator/escrow.go Service.EscrowSweep legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the backend's EscrowSweep, nothing for a backend without one whole:Route@184 8ed0ea62a9807b7c43b3576d01f096bfe366c21bcc3be040831a3f1b80d1b123
internal/activator/escrow.go Service.SecretsEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: the backend's SecretsEscrowed, else IsHA whole:Route@184,whole:Route@215 87261115297104155806136d4d0001c4cd3e150e5ffe91612bb5014fb7780881
@@ -115,7 +121,7 @@ internal/activator/paths.go ExecBackend.pathsFor legacy accepted-legacy accepted
@removed internal/activator/hasecrets.go SplitBackend.haScheduledToken H3 census-ruling-durability-3a-escrow;absent;basis=durability 3a Task 4: renamed to SplitBackend.escrowedScheduledToken (on this card)
@remove internal/host/schedule_wiring.go scheduleHostHA
@removed internal/host/schedule_wiring.go scheduleHostHA H3 census-ruling-durability-3a-escrow;absent;basis=durability 3a Task 4: renamed to scheduleHostEscrowed (on this card), asking SecretsEscrowed instead of IsHA
-@coverage internal/activator 780c32b2769a7316dcc663f694b6385f753f01a64ca63357ef50c36f54967a4a
+@coverage internal/activator 1ace39f15f5a7ed962b84164ab97c63c5fa7657ee2910392febcce0253670024
@coverage internal/host c12e11dd2fbfb5936e5256007db85a88f96cb12f3d1c74c551ff7ec5f52f9355
@coverage internal/hostfiles a0b0deb2779b183ee3f3578d1112ac5f723d930e40690a55eaaaa2644a24a9ad
@coverage internal/layout f845fa728b0935279454d8b01023c5d6dae1c985061a41229cf0686e829f5c12