| index 5797027a1..d98b6292b 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. |
| # 11 body, 12 sites, 5 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 4 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. |
| -# 45 new dispositions: 1 reads re-frozen at their disposition with the claim, 43 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other. |
| +# 46 new dispositions: 1 reads re-frozen at their disposition with the claim, 44 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 |
| @@ -32,8 +32,9 @@ |
| @legacy ea89afa7fe34b39ecf49c55c51f3fea23ba6fd785e1c71880d8d072237ee777e 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 Fix round 1: marks the host checked when it reads the bucket; the same reads. Fix round 2: the ledger is read through ledgerFor (none while this process marks it untrusted); the same reads. Fix round 3: a bucket read is kept as what this process knows the bucket holds (noteKnown), replacing the checked flag; the same reads. Fix round 4: only an open from the bucket feeds what this process knows (learnBucket); an open from the ledger feeds nothing; a failed open or an unparseable manifest wraps errEscrowUnreadable; the same reads. Durability 3a Task 5: after an open from the bucket and learnBucket, noteRawSecrets(rt.Host, m). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. file:Open@737,registry:Host@1040,registry:Host@528,registry:Host@584,whole:Route@415 a1e68a862a55c28dc76702f4558b480c1c5cb3c598f535470fde1f92c90be179 |
| @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 f6e622ed3b9e219a616ce6bf2f951b3e50c7897bd6e8a7f59ddb335fcbf8e3db 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 Fix round 1: refuses while the conflict marker exists or while this box does not hold the host's lease (P1-2), before anything is read. registry:Host@223,registry:Host@269,registry:Host@340,registry:Host@376,registry:Host@435,registry:Host@556,registry:Host@653,whole:Route@157,whole:Route@733 5e2b655605216fcaa50ddfd0511ca4ce913a8716582932a13debf22c4876f117 |
| -@legacy c254e592f86122d29fa7b9947b3f4f4dfca757971bb6fd443215354101e30e72 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 Fix round 1: before staging, mintedConflict on the baseline it would replace, so a secret this box minted is never published over another escrowed value (P1-1). Fix round 2 (P1-1, P1-2, stale ledger): before staging, the write-once check (escrowDivergence, keyed digests only, no request): a staged instance.key or report.token whose escrowed item has another digest refuses the publish (escrowConflictFound); then, under the operation lock just before the commit, the lease again (holdsLease): lost, nothing is committed and the staged state is dropped; after a commit the ledger through keepLedger (written, else the stale one removed with RemoveBeneath under <data>/.escrow, else marked untrusted in memory). Fix round 3: escrowDivergence also holds the env's minted variables write-once (one GET of the sealed env, only when the env changed); the committed manifest is kept as what this process knows (noteKnown). Fix round 4: only a commit that wrote (the baseline's ETag moved) feeds what this process knows (learnBucket) and writes the ledger; a no-op commit on a ledger-opened publisher feeds nothing; the same reads and writes. Durability 3a Task 5: on the held baseline before staging and DropRawSecrets, noteRawSecrets(rt.Host, m). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. Branch fix R1 P1-1: every failed manifest commit drops the publisher, stamps, preparation read and bucket knowledge; the next operation opens the bucket and repeats divergence checks before staging. No new root input or read site. Branch fix R1 P1-4: a CommitRecoveryReadError from the existing CAS-recovery GET wraps errEscrowUnreadable, so the launch refuses rather than using the later-launch write-failure fallback. No new read. Branch fix R1 P1-3: select sealed escrow against Route.Incarnation before decrypting, restoring, minting or checking divergence: lower non-zero escrow is retired in the selected view, higher refuses, equal and zero-stamped retain behavior. Publication stamps the current lifetime atomically, drops prior-lifetime cached stamps, and never treats retired escrow as a committed successor. Same storage paths; historical objects retained. Branch fix R2: remove incarnation selection and stamping per Paul's ruling; restore pre-030ce7f9 hostname-scoped escrow behavior. No read added. Same-key hostname reuse can inherit predecessor secrets; a changed key refuses. Keep the uncertain-commit and CAS-recovery read-failure refusals. registry:Host@2078,registry:Host@2342,registry:Host@2979,registry:Host@4079,registry:Host@4109,registry:Host@5266,registry:Host@574,whole:Route@2269,whole:Route@3036,whole:Route@3155 b83bbe65c4cbbb9f92ec6a2928fe1b6fb16f9f54606717677466f1b1a6a59d67 |
| +@legacy 24182e210cb1e45dc6e61f1c8bce9329a7a9f5d523098987c3cd09b1e47ac3c6 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 Fix round 1: before staging, mintedConflict on the baseline it would replace, so a secret this box minted is never published over another escrowed value (P1-1). Fix round 2 (P1-1, P1-2, stale ledger): before staging, the write-once check (escrowDivergence, keyed digests only, no request): a staged instance.key or report.token whose escrowed item has another digest refuses the publish (escrowConflictFound); then, under the operation lock just before the commit, the lease again (holdsLease): lost, nothing is committed and the staged state is dropped; after a commit the ledger through keepLedger (written, else the stale one removed with RemoveBeneath under <data>/.escrow, else marked untrusted in memory). Fix round 3: escrowDivergence also holds the env's minted variables write-once (one GET of the sealed env, only when the env changed); the committed manifest is kept as what this process knows (noteKnown). Fix round 4: only a commit that wrote (the baseline's ETag moved) feeds what this process knows (learnBucket) and writes the ledger; a no-op commit on a ledger-opened publisher feeds nothing; the same reads and writes. Durability 3a Task 5: on the held baseline before staging and DropRawSecrets, noteRawSecrets(rt.Host, m). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. Branch fix R1 P1-1: every failed manifest commit drops the publisher, stamps, preparation read and bucket knowledge; the next operation opens the bucket and repeats divergence checks before staging. No new root input or read site. Branch fix R1 P1-4: a CommitRecoveryReadError from the existing CAS-recovery GET wraps errEscrowUnreadable, so the launch refuses rather than using the later-launch write-failure fallback. No new read. Branch fix R1 P1-3: select sealed escrow against Route.Incarnation before decrypting, restoring, minting or checking divergence: lower non-zero escrow is retired in the selected view, higher refuses, equal and zero-stamped retain behavior. Publication stamps the current lifetime atomically, drops prior-lifetime cached stamps, and never treats retired escrow as a committed successor. Same storage paths; historical objects retained. Branch fix R2: remove incarnation selection and stamping per Paul's ruling; restore pre-030ce7f9 hostname-scoped escrow behavior. No read added. Same-key hostname reuse can inherit predecessor secrets; a changed key refuses. Keep the uncertain-commit and CAS-recovery read-failure refusals. Branch fix R2 P1-3: delegate the existing baseline, divergence and StageSealed operations to stageEscrowReads, shared with HA. Same bucket objects and reads; lease gating, uncertain-commit state drop, and typed CAS-recovery refusal retained. registry:Host@2078,registry:Host@2342,registry:Host@3307,registry:Host@3337,registry:Host@4494,registry:Host@574,whole:Route@2269,whole:Route@2497 01b4a5ff2f2dccc3f28d998a5e478e309e3eb9762f007a0fbee34501f2743d89 |
| @legacy 74bd4eb3be0768428751ab09e7fdcbcd46d84aa16e619a9f591d35dc57e4a824 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. Fix round 1: the conflict marker first, then the mode (P2-5): no files store, nothing; no key, the preparation's keyless read before any file check. With a key, each trio file is checked with OpenBeneathOrAbsent (a link or FIFO is not missing); the bucket is read (bucketManifest, the preparation's one GET) only for a missing env file, or a missing trio file the ledger says was escrowed, or with no ledger once per agent start (P2-6); the same writes. Fix round 2: the ledger is read through ledgerFor, and while it is untrusted (its write and the stale ledger's removal both failed) a missing trio file always reads the bucket; the same reads and writes. Fix round 3: the ledger no longer decides a restore: a missing trio file reads the bucket unless this process itself saw the bucket's manifest for the host (its read or its commit, escrowState.known) without the item; the same reads and writes otherwise. Branch fix R1 P1-3: select sealed escrow against Route.Incarnation before decrypting, restoring, minting or checking divergence: lower non-zero escrow is retired in the selected view, higher refuses, equal and zero-stamped retain behavior. Publication stamps the current lifetime atomically, drops prior-lifetime cached stamps, and never treats retired escrow as a committed successor. Same storage paths; historical objects retained. Branch fix R2: remove incarnation selection and stamping per Paul's ruling; restore pre-030ce7f9 hostname-scoped escrow behavior. No read added. Same-key hostname reuse can inherit predecessor secrets; a changed key refuses. Keep the uncertain-commit and CAS-recovery read-failure refusals. registry:Host@1027,registry:Host@1145,registry:Host@138,registry:Host@1853,registry:Host@2721,registry:Host@571,registry:Host@652,registry:Host@698,registry:Host@801,whole:Route@1654,whole:Route@1750,whole:Route@200,whole:Route@241,whole:Route@314,whole:Route@360,whole:Route@477 335cb066c95f026fba5e99df8f86252ee6a50b48f799d7b1042460c2ec188642 |
| +@legacy b7f721d0925fe5332a1809aa3e44df9e52c90e5eaccf83193acb1c14ec09b99c internal/activator/escrow.go ExecBackend.stageEscrowReads legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=Branch fix R2 P1-3: shared HA and non-HA write-once funnel. Checks the existing conflict marker, decodes the committed baseline, reports raw secrets, calls escrowDivergence on all candidates before any StageSealed. Trio changes refuse before any env GET. Changed platform-minted env variables refuse; an envelope that cannot open under the key/binding refuses with the existing alert and best-effort durable marker; transient GET errors refuse without a marker. Same host manifest prefix, sealed env object and local conflict path. No new authority or root read target. registry:Host@206,registry:Host@383,whole:Route@437,whole:Route@598,whole:Route@716 f00a182229cbe7f895f91822d1a3b637589a0764d55b5c498feeec9e488a4018 |
| @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 |
| @@ -51,18 +52,18 @@ |
| @legacy 957ad5d3377cd8a74a394858b4836b46d318fbaa7b3a3ac2c102c9b010f75ac4 internal/host/escrow_loop.go escrowLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: every activator.EscrowEvery (30 s) lists the registry and runs svc.EscrowSweep over the rows; logs failures and deferrals; returns with no registry or no Service; the agent as carlos (carlos-edge.service), no root caller whole:Route@426 498f5efdf374f9c35ca954f845507ce3c8db25e9b766f873c3acf23ec2f7cb05 |
| @legacy 29ed64c9e5683c30cebe4a93f46e8c9617e31875b17e64be9ef8fb95db497e06 internal/host/movesfiles.go claimEnvPresent legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5: new: whether the claim env file exists, without reading it: nested, instancefs.OpenBeneathOrAbsent beneath the instance directory (no link at any component; the descriptor closed at once); flat, os.Lstat of <data>/<host>.env (a link there counts as present, so it refuses). An undecidable answer is an error. Only feeds a refusal. file:Lstat@81 99e674efa8d1bf26a59304024912fcd5b5caf2e5d80274e8def7dbb75d9362b5 |
| @legacy 57d643b797aeddcfb4e30175e92072cd6d1cad46c442bf44ecb0f821d74ecafd internal/host/schedule_wiring.go scheduleHostEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: scheduleHostHA renamed: reads the host's row (reg.Get) and asks svc.SecretsEscrowed (HA, or eligible for escrow) with a 10 s timeout; false with no registry or no row; for such a host scheduleToken only reads the existing env token ("" when none) and never mints (EnsureAdminToken skipped); the agent as carlos (carlos-edge.service), no root caller whole:Route@254,whole:Route@413 1a608f98d348d9183088ff4f04742c30467a116f0071358ce479e1dff5e20eeb |
| -@legacy 51297417f7d25f895c3793014740994855e599bf8731cf3295ea836820ae4f13 internal/hostfiles/sealed.go ReadSealed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=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. file:Open@898 7c2b887b6e0b45472fd8d1a63a2b78eb565c4e93c89cb329eeeaef429ab0b010 |
| +@legacy 3fe9f2fb4317a769c1064de405465cd5ad07f19a94d44dbd835b5e2b3bff164b internal/hostfiles/sealed.go ReadSealed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=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. Branch fix R2 P1-3: wrap the existing appconfig.Open error as SealedOpenError, preserving error text and cause, so a decryption refusal leaves a conflict marker while a transient storage GET failure does not. Same fetch and envelope verification; no new read. file:Open@898 14437206baa72c952a8be716aa035b723f408384eaf6db56af16b554587e6a6d |
| @legacy 7520abf7fe01442d3fcca5cc9c46cd22346ae2ad193162ed8df7ba9371914028 internal/layout/inventory.go Inventory legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=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. file:ReadDir@449 9662e465abb7f9c60e908952740384479009c9987c8a6ae65d98fb19cb3d4d7e |
| @legacy 8ccceaa7c2efcec2085fe2f577bdf1d39c723af9d5fca9abf79425fec256740a internal/host/movesfiles.go buildPrepared legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;census-ruling-moves-overcap-cut-236;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, CARLOS_MOVES_PHASE1 only): wantEnv refuses with pubclass.ErrSecretPath before anything is read or written; the env presence check for !wantEnv is os.Stat instead of os.ReadFile (the secret is no longer read into memory); hostfiles.RefuseSecretsAt over root.Open(".") (+file:Open, a descriptor of the os.Root it already opened, never a pathname) before NewPrepared; the walk checks pubclass.Of(...) == App before each Stage; the env file is never staged. Only refuses more, and reads less. file:Lstat@1275,file:Open@2772,file:OpenRoot@2377,file:Stat@1468,file:WalkDir@3263 75cf376b93c2f69f4c8d1997a0158795c7bcd6967a7742a18ca79822b8e27a2a |
| @legacy 3548edf2cc46b90278c03f0a5dedc4ed353279e08b2e5ef1a81cca61a94b3639 internal/activator/backend_exec.go ExecBackend.Acquire legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: after the unchanged AdmitConfig gate, the lease acquire moves into acquireClassified (hawake.go, a new unit): a legacy route or a non-HA host takes the same lease.Acquire as before and maps a held lease to errLeaseHeld as before (leaseError); an HA host goes through the containment admission and lease.AcquireHA. A successful acquire marks the host acquiredHere for the process (same-box recovery). The config gate is not weakened; the same three sites, no read added;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 1: after a successful acquire, records the instance lease it hands out (escrow.noteLease, memory only), so the escrow can ask whether this box holds the host's lease; the same acquire, no read added; the agent as carlos (carlos-edge.service), no root caller registry:Host@1001,registry:Host@807,whole:Route@382,whole:Route@764 ff41146bbb0f1c3fac6a0f34f41540d7dbb036234f490841dca0e23d23b1c99c |
| -@legacy fa23b1e76a6eac98914d65da29e02ca30265027943d4ad08658745393511c800 internal/activator/hafiles.go ExecBackend.newHostFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: builds a hostFiles publisher for rt (its instance paths from pathsFor(rt), rt.Host, the backend's registry, the 1 s platform and 15 min snapshot cadences); +registry:Host, +whole:Route; no I/O;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: now also sets the publisher's sealer (sealerFor(rt); its error is returned and nothing is built) and its skip, pubclass.FilesDirSkip(Nested, rt.Host), a pure function of the name, so every tree pass publishes only App paths and never the trio raw. Still no I/O; the new +registry:Host and +whole:Route sites are the sealer's and the classifier's arguments. Durability 3a Task 5: also sets the publisher's noteHeld, a closure calling noteRawBaseline(host, pub) (the detector over the manifest the publisher holds, decoded from its own committed bytes); no I/O; the -registry:Host site is rt.Host read once into a local. registry:Host@179,whole:Route@128,whole:Route@234 66557a3afeb86cc98763321b922bc589e1a49f8cf6e940c81144c1a1c7852dc5 |
| +@legacy 3b54fecb51d60e732cf8139dbe747b61fbc0b03ab05f65dca7b4b3530c3baf9c internal/activator/hafiles.go ExecBackend.newHostFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: builds a hostFiles publisher for rt (its instance paths from pathsFor(rt), rt.Host, the backend's registry, the 1 s platform and 15 min snapshot cadences); +registry:Host, +whole:Route; no I/O;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: now also sets the publisher's sealer (sealerFor(rt); its error is returned and nothing is built) and its skip, pubclass.FilesDirSkip(Nested, rt.Host), a pure function of the name, so every tree pass publishes only App paths and never the trio raw. Still no I/O; the new +registry:Host and +whole:Route sites are the sealer's and the classifier's arguments. Durability 3a Task 5: also sets the publisher's noteHeld, a closure calling noteRawBaseline(host, pub) (the detector over the manifest the publisher holds, decoded from its own committed bytes); no I/O; the -registry:Host site is rt.Host read once into a local. Branch fix R2 P1-3: capture the route, paths and sealer in the HA publisher callback to the shared stageEscrowReads gate. No I/O added here. All HA passes read the same three bounded no-link local paths before invoking the callback; it refuses divergence or unreadable-key replacement before any StageSealed. registry:Host@179,whole:Route@128,whole:Route@234,whole:Route@463,whole:Route@478 32e71752391c434c6126276d9368be7d7eb87caa471ea23540c11e567954a6d2 |
| @legacy e2036c8cf0cd989e03b82e70861b06539e0af17589a17c81b550efcd36e139e2 internal/activator/hafiles.go ExecBackend.openHostFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: the entry's files publisher: refuses without a FilesStore or outside the nested layout, takes the one this wake's restore staged, else hostfiles.Open on <hibernate prefix>/files/0/ (one GET of the manifest from the hibernate bucket, the scanner's +file:Open); +registry:Host x2, +whole:Route x2; the manifest is written by the agents of the boxes that hold the host, through the same files store;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: asks sealerFor before hostfiles.Open, so a box without an escrow key refuses before it reads the manifest; newHostFiles's error is returned. The same manifest GET otherwise; the new +whole:Route site is sealerFor's argument. Opens nothing new. Durability 3a Task 5: after hostfiles.Open, noteRawBaseline(rt.Host, pub), the detector over the manifest just read (hostfiles.RawAfterSealed on the decoded baseline). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. file:Open@521,registry:Host@342,registry:Host@569,registry:Host@636,whole:Route@198,whole:Route@469,whole:Route@673 34091031ddf1a2b90edfd3453ec197fa3ca6a5290b6b7d15d5a44b1028fc8c7a |
| @legacy 70433b4bfbbaecf83245275d6fda33b6fd5f379e250823dc0e1bae6645fffc17 internal/activator/hafiles.go ExecBackend.stageKeptFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: on a kept wake, reads the manifest baseline the release kept beside its local record (<db>.release.files.json via readFilesBaseline, capped at 32 MiB, O_NOFOLLOW, regular files only) and stages a publisher on it only when its revision (Gen, which carries the body's SHA-256) equals the files_gen in the lock's release marker; the file is on ground the tenant can write, and anything that does not match stages nothing, so the entry re-reads the manifest from the store; it never decides the keep; +registry:Host x4, +whole:Route x2;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: newHostFiles now answers an error (no escrow key), which is logged and stages nothing, as an OpenBaseline failure already did. The same baseline read; nothing new opened or read. Durability 3a Task 5: after the marker's gen matched, noteRawBaseline(rt.Host, pub) on the kept baseline. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. registry:Host@254,registry:Host@344,registry:Host@508,registry:Host@553,registry:Host@660,registry:Host@706,whole:Route@151,whole:Route@593 72b7b10bea4dc499e251ae498dd1ad56a4b966bed80f24106c86d6aab75ad3ec |
| @legacy 23afec3ab558a47f83f80edd7007d473e10940e1a3ac81b045500c03cb315ffd internal/activator/hafiles.go ExecBackend.stageWakeFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: opens a publisher on a manifest baseline the HA restore already holds (hostfiles.OpenBaseline, no read) and keeps it for the wake's entry; without a FilesStore it stages nothing; +registry:Host x3, +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: newHostFiles now answers an error (no escrow key), which is logged and stages nothing, as an OpenBaseline failure already did. No read, as before. Durability 3a Task 5: after OpenBaseline, noteRawBaseline(rt.Host, pub) on the baseline the restore holds. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. registry:Host@185,registry:Host@300,registry:Host@345,registry:Host@452,registry:Host@498,whole:Route@385 688df7afd563bc0828cec0cb5c2cd57405c4ce0e3a017c23df16af901cf54913 |
| @legacy a6b323044a9dccb625ae9031b92980454070a102ef5ebd4ac2efc953dec64ea6 internal/activator/hasecrets.go ExecBackend.captureLaunchEnv legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos: reads an HA launch's own env file and its rendered config env once, the way instanceEnvParts does: on the nested layout through instancefs.ReadBeneathLimit (1 MiB, no link followed), otherwise os.ReadFile (the +file:ReadFile site; an HA host is nested by its acquire's containment admission, so this arm is the flat layout's, where the files are in the agent's own data directory); an absent own file is an error, an absent config is not; parses env and key layer from those bytes; +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: the flat arm's os.ReadFile (-file:ReadFile) is gone: both layouts read the own env file and the rendered config env with instancefs.ReadBeneathLimit beneath the row's data directory (openat2, no symlink, regular files only, 1 MiB), so an escrowed flat row's capture never follows a link at <host>.env; an absent own file is an error, an absent config is not; the agent as carlos (carlos-edge.service), no root caller; only narrows a read whole:Route@98 223e1b2f98aea8bb39f65573bcff0e6d05bb8cd2f55cd43670ca8ba6f1d33299 |
| @legacy 5ca337f30874aae92def93eca1e09c58a4dbc8a85e671df0b4e08fdd14dafd43 internal/activator/hasecrets.go ExecBackend.ensureAdminTokenFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos: the launch paths' admin-token producer: haMintGuard(ctx, rt), then ensureAdminToken on <dataDir>/<host>.env, beneath on the nested layout and by path otherwise, with that guard; +registry:Host, +whole:Route; a non-HA host's guard is nil and the producer is the one it used before;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: classifies the host once (haHostNow), and for a host that is not HA and is eligible for escrow first calls restoreEscrowIfMissing (a new unit on this card), then ensureAdminToken with mintGuardAs's guard; an HA host's path is as before; any other host's guard is nil as before; +whole:Route x3 (the row handed on); the agent as carlos (carlos-edge.service), no root caller Fix round 1: begins the launch's preparation (beginPrep) before the restore, and passes fresh false to the guard. registry:Host@257,registry:Host@386,whole:Route@136,whole:Route@237,whole:Route@308,whole:Route@447 581b4132ee9f3bbb900b5c467c02596502b0232575a8beacd198419469eb4e3c |
| @legacy c39b6a8c39e51f6c93ab4c36c0b3c33765a0f41cd9770e03217c0c3d3b019c63 internal/activator/hasecrets.go ExecBackend.haMintGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos, replacing haMintGate: nil for a host that is not HA; for an HA host a guard that, asked only from a producer's missing-secret branch, reads once whether the host's files manifest exists (haManifestFound) and refuses with ErrInstanceKeyDeferred while it does (or on a read error); it never reads the env; +whole:Route x2; only refuses;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: now only the HA arm of mintGuardFor: the same once-per-guard haManifestFound read and the same ErrInstanceKeyDeferred refusal, the name ignored; the HA classification moved to mintGuardFor (-whole:Route); only refuses whole:Route@220 7218a4d3a064c04bca0bdccec25c2934974b926a5af657a156cd0ca8498b586d |
| -@legacy 192df384d784a7d1ac579802fd8ad96206ff78ee8164d09ab6e8093b968602ba internal/activator/hasecrets.go ExecBackend.haSecretsReady legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: before an HA host's launch, checks that env, the bytes the launch captured (captureLaunchEnv; a new parameter, final fix F2), has the SHA-256 of the committed manifest's env item (envAcknowledged, which now reads no file); else publishes the platform items (env, trio, wake state) through the wake's, the entry's or its own publisher (hostfiles.Open, the +file:Open site: one manifest GET) and checks again, so an env replaced after the capture is committed as other bytes and fails the launch; it no longer classifies the host itself (launchEnvLayer has); every error fails the launch; +file:Open, +registry:Host x3, +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: asks sealerFor before its own hostfiles.Open (a box without an escrow key fails the launch before any read), and newHostFiles's error fails the launch. envAcknowledged now compares the sealed env item's keyed digest (hostfiles.SealedAcknowledged, no read) instead of the raw env item's SHA-256. The publish it triggers stages the trio sealed: <host>.env, <host>/instance.key and <host>/report.token are each read with instancefs.ReadBeneathLimitOrAbsent beneath the instance directory (openat2, no symlink, regular files only, 1 MiB cap), the same reader the env already used, then sealed in memory; nothing else is opened. file:Open@390,registry:Host@1187,registry:Host@120,registry:Host@438,whole:Route@294,whole:Route@559 4f4584786d3f90a54aa3ddc1c39ffed8a62fcfd593127f534bea787c3d9b7829 |
| +@legacy e70505295cbdfc289022949d329711e9aabe7f7c76bb789dc116d85903140334 internal/activator/hasecrets.go ExecBackend.haSecretsReady legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: before an HA host's launch, checks that env, the bytes the launch captured (captureLaunchEnv; a new parameter, final fix F2), has the SHA-256 of the committed manifest's env item (envAcknowledged, which now reads no file); else publishes the platform items (env, trio, wake state) through the wake's, the entry's or its own publisher (hostfiles.Open, the +file:Open site: one manifest GET) and checks again, so an env replaced after the capture is committed as other bytes and fails the launch; it no longer classifies the host itself (launchEnvLayer has); every error fails the launch; +file:Open, +registry:Host x3, +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: asks sealerFor before its own hostfiles.Open (a box without an escrow key fails the launch before any read), and newHostFiles's error fails the launch. envAcknowledged now compares the sealed env item's keyed digest (hostfiles.SealedAcknowledged, no read) instead of the raw env item's SHA-256. The publish it triggers stages the trio sealed: <host>.env, <host>/instance.key and <host>/report.token are each read with instancefs.ReadBeneathLimitOrAbsent beneath the instance directory (openat2, no symlink, regular files only, 1 MiB cap), the same reader the env already used, then sealed in memory; nothing else is opened. Branch fix R2 P1-3: every launch invokes PublishPlatformNow and the shared escrow gate even when the captured env is already acknowledged. A divergent trio or persisted conflict marker cannot bypass the gate. Unchanged publication remains request-free. Same local paths and manifest prefix; no new authority. file:Open@390,registry:Host@120,registry:Host@1236,registry:Host@438,whole:Route@294,whole:Route@559 af5c028a288dd480380c4cf658098373f938337517d7db33aeb8b2d08e489487 |
| @legacy 82fe6cb6c8b941f11795972ab352bc2c63c42602f18f73b275869339964498a1 internal/activator/hasecrets.go ExecBackend.launchEnvLayer legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos: a launch's env and key layer: classifies the host (haHostNow; an error fails the launch), instanceEnvLayer unchanged for a non-HA host; for an HA host captureLaunchEnv once, haSecretsReady over those bytes, a test seam (haLaunchHooks.afterPublish, nil in production), and returns the env parsed from the captured bytes, never a later read; +registry:Host x3 (the error messages), +whole:Route x4;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: for a host that is not HA and is eligible for escrow, escrowedLaunchEnv (a new unit on this card) instead of instanceEnvLayer; the HA and other paths unchanged; +whole:Route x2; the agent as carlos (carlos-edge.service), no root caller registry:Host@245,registry:Host@499,registry:Host@644,whole:Route@154,whole:Route@294,whole:Route@335,whole:Route@371,whole:Route@408,whole:Route@549 35a5150b24c33e81e5d536bb072c62ab55fd583187d83293e644d3599496a99a |
| @legacy 9cc3221e205a34573a2e5737aeae9d6b5cde5f9f240eb165e905827716d2835f internal/activator/hawake.go ExecBackend.restoreFilesClean legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: restores the HA host's published files into a fresh <host>.restore directory beneath the instance data dir (instancefs, no link followed), renames it into place without replacing anything, writes the manifest's env item as <host>.env (instancefs.WriteAtomic, 0600) and imports the manifest's wake state into the registry (hostfiles.ImportWake, then the class for restoredReplication); the source is the host's files manifest in the hibernate bucket, written by the agents of the boxes that held the host; every failure fails the wake; +registry:Host, +whole:Route x2;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3 (fix round 1: sealed precedence before any fetch): the restore into <host>.restore is now RestoreRootBaselineShadowed with sealedShadow(host), a pure function of the manifest already read and validated: a live raw instance.key or report.token entry whose sealed item the manifest holds is neither fetched nor written (so a missing or corrupt raw object cannot fail the wake, and a sealed item that does not open fails it with no raw fallback); every other entry is restored as before, and the baseline the wake's publisher continues from is the manifest as read. Then each sealed trio item the manifest holds (instance.key.sealed, report.token.sealed) is fetched and opened with hostfiles.ReadSealed (key, sha256, v2 envelope, binding and MAC checked) and written with instancefs.WriteAtomic (openat2 directory, no symlink, O_EXCL temp, rename, 0600) into the restore directory this function created, then that directory is synced; then the same no-replace rename. The env file comes from the sealed env item through ReadSealed when present, else from the raw env item as before, written as before. The source is still the host's files manifest in the hibernate bucket; the destinations are the same restore directory and env file; no new path is opened, followed or named from input; the sealer (sealerFor) is built only when a sealed item is present. Durability 3a Task 5: after RestoreRootBaselineShadowed, noteRawSecrets(host, rm) on the manifest just restored from. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. Read sites unchanged. Durability 3a Task 5 fix round 1: the restore is RestoreRootBaselineObserved (the same read and restore as RestoreRootBaselineShadowed) with a checked callback, noteRawSecrets(host, m), run once the manifest is read and validated and before any entry is removed, fetched or written, so a restore that then fails still shows the detector the manifest; the later noteRawSecrets call is gone. No request, open or write added; read sites unchanged. registry:Host@97,whole:Route@1086,whole:Route@1586,whole:Route@200 ca4b8c70486f72a3bd7ede5d16c8f9fd22eee13f11d005597223a4f5ab20b405 |
| @legacy 4e3b06c62e684994c4777083689b9313642be6bc47c477151e37d93198dbc3f6 internal/activator/paths.go ExecBackend.pathsFor legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: split in two: pathsFor classifies (Classify, unchanged) and hands the answer to pathsAt (new on this card), which holds the same body; the same paths for every row; the reads moved to pathsAt whole whole:Route@129,whole:Route@89 5801150c35fef058ce1f8e7c9f334a7a89e3441fe0f63fb451f4804282e90535 |
| @@ -99,8 +100,9 @@ internal/activator/escrow.go ExecBackend.keylessEscrowed legacy accepted-legacy |
| 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 Fix round 1: marks the host checked when it reads the bucket; the same reads. Fix round 2: the ledger is read through ledgerFor (none while this process marks it untrusted); the same reads. Fix round 3: a bucket read is kept as what this process knows the bucket holds (noteKnown), replacing the checked flag; the same reads. Fix round 4: only an open from the bucket feeds what this process knows (learnBucket); an open from the ledger feeds nothing; a failed open or an unparseable manifest wraps errEscrowUnreadable; the same reads. Durability 3a Task 5: after an open from the bucket and learnBucket, noteRawSecrets(rt.Host, m). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. file:Open@737,registry:Host@1040,registry:Host@528,registry:Host@584,whole:Route@415 a1e68a862a55c28dc76702f4558b480c1c5cb3c598f535470fde1f92c90be179 |
| 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 Fix round 1: refuses while the conflict marker exists or while this box does not hold the host's lease (P1-2), before anything is read. registry:Host@223,registry:Host@269,registry:Host@340,registry:Host@376,registry:Host@435,registry:Host@556,registry:Host@653,whole:Route@157,whole:Route@733 5e2b655605216fcaa50ddfd0511ca4ce913a8716582932a13debf22c4876f117 |
| -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 Fix round 1: before staging, mintedConflict on the baseline it would replace, so a secret this box minted is never published over another escrowed value (P1-1). Fix round 2 (P1-1, P1-2, stale ledger): before staging, the write-once check (escrowDivergence, keyed digests only, no request): a staged instance.key or report.token whose escrowed item has another digest refuses the publish (escrowConflictFound); then, under the operation lock just before the commit, the lease again (holdsLease): lost, nothing is committed and the staged state is dropped; after a commit the ledger through keepLedger (written, else the stale one removed with RemoveBeneath under <data>/.escrow, else marked untrusted in memory). Fix round 3: escrowDivergence also holds the env's minted variables write-once (one GET of the sealed env, only when the env changed); the committed manifest is kept as what this process knows (noteKnown). Fix round 4: only a commit that wrote (the baseline's ETag moved) feeds what this process knows (learnBucket) and writes the ledger; a no-op commit on a ledger-opened publisher feeds nothing; the same reads and writes. Durability 3a Task 5: on the held baseline before staging and DropRawSecrets, noteRawSecrets(rt.Host, m). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. Branch fix R1 P1-1: every failed manifest commit drops the publisher, stamps, preparation read and bucket knowledge; the next operation opens the bucket and repeats divergence checks before staging. No new root input or read site. Branch fix R1 P1-4: a CommitRecoveryReadError from the existing CAS-recovery GET wraps errEscrowUnreadable, so the launch refuses rather than using the later-launch write-failure fallback. No new read. Branch fix R1 P1-3: select sealed escrow against Route.Incarnation before decrypting, restoring, minting or checking divergence: lower non-zero escrow is retired in the selected view, higher refuses, equal and zero-stamped retain behavior. Publication stamps the current lifetime atomically, drops prior-lifetime cached stamps, and never treats retired escrow as a committed successor. Same storage paths; historical objects retained. Branch fix R2: remove incarnation selection and stamping per Paul's ruling; restore pre-030ce7f9 hostname-scoped escrow behavior. No read added. Same-key hostname reuse can inherit predecessor secrets; a changed key refuses. Keep the uncertain-commit and CAS-recovery read-failure refusals. registry:Host@2078,registry:Host@2342,registry:Host@2979,registry:Host@4079,registry:Host@4109,registry:Host@5266,registry:Host@574,whole:Route@2269,whole:Route@3036,whole:Route@3155 b83bbe65c4cbbb9f92ec6a2928fe1b6fb16f9f54606717677466f1b1a6a59d67 |
| +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 Fix round 1: before staging, mintedConflict on the baseline it would replace, so a secret this box minted is never published over another escrowed value (P1-1). Fix round 2 (P1-1, P1-2, stale ledger): before staging, the write-once check (escrowDivergence, keyed digests only, no request): a staged instance.key or report.token whose escrowed item has another digest refuses the publish (escrowConflictFound); then, under the operation lock just before the commit, the lease again (holdsLease): lost, nothing is committed and the staged state is dropped; after a commit the ledger through keepLedger (written, else the stale one removed with RemoveBeneath under <data>/.escrow, else marked untrusted in memory). Fix round 3: escrowDivergence also holds the env's minted variables write-once (one GET of the sealed env, only when the env changed); the committed manifest is kept as what this process knows (noteKnown). Fix round 4: only a commit that wrote (the baseline's ETag moved) feeds what this process knows (learnBucket) and writes the ledger; a no-op commit on a ledger-opened publisher feeds nothing; the same reads and writes. Durability 3a Task 5: on the held baseline before staging and DropRawSecrets, noteRawSecrets(rt.Host, m). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. Branch fix R1 P1-1: every failed manifest commit drops the publisher, stamps, preparation read and bucket knowledge; the next operation opens the bucket and repeats divergence checks before staging. No new root input or read site. Branch fix R1 P1-4: a CommitRecoveryReadError from the existing CAS-recovery GET wraps errEscrowUnreadable, so the launch refuses rather than using the later-launch write-failure fallback. No new read. Branch fix R1 P1-3: select sealed escrow against Route.Incarnation before decrypting, restoring, minting or checking divergence: lower non-zero escrow is retired in the selected view, higher refuses, equal and zero-stamped retain behavior. Publication stamps the current lifetime atomically, drops prior-lifetime cached stamps, and never treats retired escrow as a committed successor. Same storage paths; historical objects retained. Branch fix R2: remove incarnation selection and stamping per Paul's ruling; restore pre-030ce7f9 hostname-scoped escrow behavior. No read added. Same-key hostname reuse can inherit predecessor secrets; a changed key refuses. Keep the uncertain-commit and CAS-recovery read-failure refusals. Branch fix R2 P1-3: delegate the existing baseline, divergence and StageSealed operations to stageEscrowReads, shared with HA. Same bucket objects and reads; lease gating, uncertain-commit state drop, and typed CAS-recovery refusal retained. registry:Host@2078,registry:Host@2342,registry:Host@3307,registry:Host@3337,registry:Host@4494,registry:Host@574,whole:Route@2269,whole:Route@2497 01b4a5ff2f2dccc3f28d998a5e478e309e3eb9762f007a0fbee34501f2743d89 |
| 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. Fix round 1: the conflict marker first, then the mode (P2-5): no files store, nothing; no key, the preparation's keyless read before any file check. With a key, each trio file is checked with OpenBeneathOrAbsent (a link or FIFO is not missing); the bucket is read (bucketManifest, the preparation's one GET) only for a missing env file, or a missing trio file the ledger says was escrowed, or with no ledger once per agent start (P2-6); the same writes. Fix round 2: the ledger is read through ledgerFor, and while it is untrusted (its write and the stale ledger's removal both failed) a missing trio file always reads the bucket; the same reads and writes. Fix round 3: the ledger no longer decides a restore: a missing trio file reads the bucket unless this process itself saw the bucket's manifest for the host (its read or its commit, escrowState.known) without the item; the same reads and writes otherwise. Branch fix R1 P1-3: select sealed escrow against Route.Incarnation before decrypting, restoring, minting or checking divergence: lower non-zero escrow is retired in the selected view, higher refuses, equal and zero-stamped retain behavior. Publication stamps the current lifetime atomically, drops prior-lifetime cached stamps, and never treats retired escrow as a committed successor. Same storage paths; historical objects retained. Branch fix R2: remove incarnation selection and stamping per Paul's ruling; restore pre-030ce7f9 hostname-scoped escrow behavior. No read added. Same-key hostname reuse can inherit predecessor secrets; a changed key refuses. Keep the uncertain-commit and CAS-recovery read-failure refusals. registry:Host@1027,registry:Host@1145,registry:Host@138,registry:Host@1853,registry:Host@2721,registry:Host@571,registry:Host@652,registry:Host@698,registry:Host@801,whole:Route@1654,whole:Route@1750,whole:Route@200,whole:Route@241,whole:Route@314,whole:Route@360,whole:Route@477 335cb066c95f026fba5e99df8f86252ee6a50b48f799d7b1042460c2ec188642 |
| +internal/activator/escrow.go ExecBackend.stageEscrowReads legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=Branch fix R2 P1-3: shared HA and non-HA write-once funnel. Checks the existing conflict marker, decodes the committed baseline, reports raw secrets, calls escrowDivergence on all candidates before any StageSealed. Trio changes refuse before any env GET. Changed platform-minted env variables refuse; an envelope that cannot open under the key/binding refuses with the existing alert and best-effort durable marker; transient GET errors refuse without a marker. Same host manifest prefix, sealed env object and local conflict path. No new authority or root read target. registry:Host@206,registry:Host@383,whole:Route@437,whole:Route@598,whole:Route@716 f00a182229cbe7f895f91822d1a3b637589a0764d55b5c498feeec9e488a4018 |
| 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 |
| @@ -118,18 +120,18 @@ internal/activator/paths.go ExecBackend.pathsAt legacy accepted-legacy accepted- |
| internal/host/escrow_loop.go escrowLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: every activator.EscrowEvery (30 s) lists the registry and runs svc.EscrowSweep over the rows; logs failures and deferrals; returns with no registry or no Service; the agent as carlos (carlos-edge.service), no root caller whole:Route@426 498f5efdf374f9c35ca954f845507ce3c8db25e9b766f873c3acf23ec2f7cb05 |
| internal/host/movesfiles.go claimEnvPresent legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5: new: whether the claim env file exists, without reading it: nested, instancefs.OpenBeneathOrAbsent beneath the instance directory (no link at any component; the descriptor closed at once); flat, os.Lstat of <data>/<host>.env (a link there counts as present, so it refuses). An undecidable answer is an error. Only feeds a refusal. file:Lstat@81 99e674efa8d1bf26a59304024912fcd5b5caf2e5d80274e8def7dbb75d9362b5 |
| internal/host/schedule_wiring.go scheduleHostEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: scheduleHostHA renamed: reads the host's row (reg.Get) and asks svc.SecretsEscrowed (HA, or eligible for escrow) with a 10 s timeout; false with no registry or no row; for such a host scheduleToken only reads the existing env token ("" when none) and never mints (EnsureAdminToken skipped); the agent as carlos (carlos-edge.service), no root caller whole:Route@254,whole:Route@413 1a608f98d348d9183088ff4f04742c30467a116f0071358ce479e1dff5e20eeb |
| -internal/hostfiles/sealed.go ReadSealed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=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. file:Open@898 7c2b887b6e0b45472fd8d1a63a2b78eb565c4e93c89cb329eeeaef429ab0b010 |
| +internal/hostfiles/sealed.go ReadSealed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=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. Branch fix R2 P1-3: wrap the existing appconfig.Open error as SealedOpenError, preserving error text and cause, so a decryption refusal leaves a conflict marker while a transient storage GET failure does not. Same fetch and envelope verification; no new read. file:Open@898 14437206baa72c952a8be716aa035b723f408384eaf6db56af16b554587e6a6d |
| internal/layout/inventory.go Inventory legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=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. file:ReadDir@449 9662e465abb7f9c60e908952740384479009c9987c8a6ae65d98fb19cb3d4d7e |
| internal/host/movesfiles.go buildPrepared legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;census-ruling-moves-overcap-cut-236;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, CARLOS_MOVES_PHASE1 only): wantEnv refuses with pubclass.ErrSecretPath before anything is read or written; the env presence check for !wantEnv is os.Stat instead of os.ReadFile (the secret is no longer read into memory); hostfiles.RefuseSecretsAt over root.Open(".") (+file:Open, a descriptor of the os.Root it already opened, never a pathname) before NewPrepared; the walk checks pubclass.Of(...) == App before each Stage; the env file is never staged. Only refuses more, and reads less. file:Lstat@1275,file:Open@2772,file:OpenRoot@2377,file:Stat@1468,file:WalkDir@3263 75cf376b93c2f69f4c8d1997a0158795c7bcd6967a7742a18ca79822b8e27a2a |
| internal/activator/backend_exec.go ExecBackend.Acquire legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: after the unchanged AdmitConfig gate, the lease acquire moves into acquireClassified (hawake.go, a new unit): a legacy route or a non-HA host takes the same lease.Acquire as before and maps a held lease to errLeaseHeld as before (leaseError); an HA host goes through the containment admission and lease.AcquireHA. A successful acquire marks the host acquiredHere for the process (same-box recovery). The config gate is not weakened; the same three sites, no read added;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4 fix round 1: after a successful acquire, records the instance lease it hands out (escrow.noteLease, memory only), so the escrow can ask whether this box holds the host's lease; the same acquire, no read added; the agent as carlos (carlos-edge.service), no root caller registry:Host@1001,registry:Host@807,whole:Route@382,whole:Route@764 ff41146bbb0f1c3fac6a0f34f41540d7dbb036234f490841dca0e23d23b1c99c |
| -internal/activator/hafiles.go ExecBackend.newHostFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: builds a hostFiles publisher for rt (its instance paths from pathsFor(rt), rt.Host, the backend's registry, the 1 s platform and 15 min snapshot cadences); +registry:Host, +whole:Route; no I/O;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: now also sets the publisher's sealer (sealerFor(rt); its error is returned and nothing is built) and its skip, pubclass.FilesDirSkip(Nested, rt.Host), a pure function of the name, so every tree pass publishes only App paths and never the trio raw. Still no I/O; the new +registry:Host and +whole:Route sites are the sealer's and the classifier's arguments. Durability 3a Task 5: also sets the publisher's noteHeld, a closure calling noteRawBaseline(host, pub) (the detector over the manifest the publisher holds, decoded from its own committed bytes); no I/O; the -registry:Host site is rt.Host read once into a local. registry:Host@179,whole:Route@128,whole:Route@234 66557a3afeb86cc98763321b922bc589e1a49f8cf6e940c81144c1a1c7852dc5 |
| +internal/activator/hafiles.go ExecBackend.newHostFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: builds a hostFiles publisher for rt (its instance paths from pathsFor(rt), rt.Host, the backend's registry, the 1 s platform and 15 min snapshot cadences); +registry:Host, +whole:Route; no I/O;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: now also sets the publisher's sealer (sealerFor(rt); its error is returned and nothing is built) and its skip, pubclass.FilesDirSkip(Nested, rt.Host), a pure function of the name, so every tree pass publishes only App paths and never the trio raw. Still no I/O; the new +registry:Host and +whole:Route sites are the sealer's and the classifier's arguments. Durability 3a Task 5: also sets the publisher's noteHeld, a closure calling noteRawBaseline(host, pub) (the detector over the manifest the publisher holds, decoded from its own committed bytes); no I/O; the -registry:Host site is rt.Host read once into a local. Branch fix R2 P1-3: capture the route, paths and sealer in the HA publisher callback to the shared stageEscrowReads gate. No I/O added here. All HA passes read the same three bounded no-link local paths before invoking the callback; it refuses divergence or unreadable-key replacement before any StageSealed. registry:Host@179,whole:Route@128,whole:Route@234,whole:Route@463,whole:Route@478 32e71752391c434c6126276d9368be7d7eb87caa471ea23540c11e567954a6d2 |
| internal/activator/hafiles.go ExecBackend.openHostFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: the entry's files publisher: refuses without a FilesStore or outside the nested layout, takes the one this wake's restore staged, else hostfiles.Open on <hibernate prefix>/files/0/ (one GET of the manifest from the hibernate bucket, the scanner's +file:Open); +registry:Host x2, +whole:Route x2; the manifest is written by the agents of the boxes that hold the host, through the same files store;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: asks sealerFor before hostfiles.Open, so a box without an escrow key refuses before it reads the manifest; newHostFiles's error is returned. The same manifest GET otherwise; the new +whole:Route site is sealerFor's argument. Opens nothing new. Durability 3a Task 5: after hostfiles.Open, noteRawBaseline(rt.Host, pub), the detector over the manifest just read (hostfiles.RawAfterSealed on the decoded baseline). Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. file:Open@521,registry:Host@342,registry:Host@569,registry:Host@636,whole:Route@198,whole:Route@469,whole:Route@673 34091031ddf1a2b90edfd3453ec197fa3ca6a5290b6b7d15d5a44b1028fc8c7a |
| internal/activator/hafiles.go ExecBackend.stageKeptFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: on a kept wake, reads the manifest baseline the release kept beside its local record (<db>.release.files.json via readFilesBaseline, capped at 32 MiB, O_NOFOLLOW, regular files only) and stages a publisher on it only when its revision (Gen, which carries the body's SHA-256) equals the files_gen in the lock's release marker; the file is on ground the tenant can write, and anything that does not match stages nothing, so the entry re-reads the manifest from the store; it never decides the keep; +registry:Host x4, +whole:Route x2;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: newHostFiles now answers an error (no escrow key), which is logged and stages nothing, as an OpenBaseline failure already did. The same baseline read; nothing new opened or read. Durability 3a Task 5: after the marker's gen matched, noteRawBaseline(rt.Host, pub) on the kept baseline. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. registry:Host@254,registry:Host@344,registry:Host@508,registry:Host@553,registry:Host@660,registry:Host@706,whole:Route@151,whole:Route@593 72b7b10bea4dc499e251ae498dd1ad56a4b966bed80f24106c86d6aab75ad3ec |
| internal/activator/hafiles.go ExecBackend.stageWakeFiles legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: opens a publisher on a manifest baseline the HA restore already holds (hostfiles.OpenBaseline, no read) and keeps it for the wake's entry; without a FilesStore it stages nothing; +registry:Host x3, +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: newHostFiles now answers an error (no escrow key), which is logged and stages nothing, as an OpenBaseline failure already did. No read, as before. Durability 3a Task 5: after OpenBaseline, noteRawBaseline(rt.Host, pub) on the baseline the restore holds. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host site is that call's argument. registry:Host@185,registry:Host@300,registry:Host@345,registry:Host@452,registry:Host@498,whole:Route@385 688df7afd563bc0828cec0cb5c2cd57405c4ce0e3a017c23df16af901cf54913 |
| internal/activator/hasecrets.go ExecBackend.captureLaunchEnv legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos: reads an HA launch's own env file and its rendered config env once, the way instanceEnvParts does: on the nested layout through instancefs.ReadBeneathLimit (1 MiB, no link followed), otherwise os.ReadFile (the +file:ReadFile site; an HA host is nested by its acquire's containment admission, so this arm is the flat layout's, where the files are in the agent's own data directory); an absent own file is an error, an absent config is not; parses env and key layer from those bytes; +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: the flat arm's os.ReadFile (-file:ReadFile) is gone: both layouts read the own env file and the rendered config env with instancefs.ReadBeneathLimit beneath the row's data directory (openat2, no symlink, regular files only, 1 MiB), so an escrowed flat row's capture never follows a link at <host>.env; an absent own file is an error, an absent config is not; the agent as carlos (carlos-edge.service), no root caller; only narrows a read whole:Route@98 223e1b2f98aea8bb39f65573bcff0e6d05bb8cd2f55cd43670ca8ba6f1d33299 |
| internal/activator/hasecrets.go ExecBackend.ensureAdminTokenFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos: the launch paths' admin-token producer: haMintGuard(ctx, rt), then ensureAdminToken on <dataDir>/<host>.env, beneath on the nested layout and by path otherwise, with that guard; +registry:Host, +whole:Route; a non-HA host's guard is nil and the producer is the one it used before;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: classifies the host once (haHostNow), and for a host that is not HA and is eligible for escrow first calls restoreEscrowIfMissing (a new unit on this card), then ensureAdminToken with mintGuardAs's guard; an HA host's path is as before; any other host's guard is nil as before; +whole:Route x3 (the row handed on); the agent as carlos (carlos-edge.service), no root caller Fix round 1: begins the launch's preparation (beginPrep) before the restore, and passes fresh false to the guard. registry:Host@257,registry:Host@386,whole:Route@136,whole:Route@237,whole:Route@308,whole:Route@447 581b4132ee9f3bbb900b5c467c02596502b0232575a8beacd198419469eb4e3c |
| internal/activator/hasecrets.go ExecBackend.haMintGuard legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos, replacing haMintGate: nil for a host that is not HA; for an HA host a guard that, asked only from a producer's missing-secret branch, reads once whether the host's files manifest exists (haManifestFound) and refuses with ErrInstanceKeyDeferred while it does (or on a read error); it never reads the env; +whole:Route x2; only refuses;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: now only the HA arm of mintGuardFor: the same once-per-guard haManifestFound read and the same ErrInstanceKeyDeferred refusal, the name ignored; the HA classification moved to mintGuardFor (-whole:Route); only refuses whole:Route@220 7218a4d3a064c04bca0bdccec25c2934974b926a5af657a156cd0ca8498b586d |
| -internal/activator/hasecrets.go ExecBackend.haSecretsReady legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: before an HA host's launch, checks that env, the bytes the launch captured (captureLaunchEnv; a new parameter, final fix F2), has the SHA-256 of the committed manifest's env item (envAcknowledged, which now reads no file); else publishes the platform items (env, trio, wake state) through the wake's, the entry's or its own publisher (hostfiles.Open, the +file:Open site: one manifest GET) and checks again, so an env replaced after the capture is committed as other bytes and fails the launch; it no longer classifies the host itself (launchEnvLayer has); every error fails the launch; +file:Open, +registry:Host x3, +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: asks sealerFor before its own hostfiles.Open (a box without an escrow key fails the launch before any read), and newHostFiles's error fails the launch. envAcknowledged now compares the sealed env item's keyed digest (hostfiles.SealedAcknowledged, no read) instead of the raw env item's SHA-256. The publish it triggers stages the trio sealed: <host>.env, <host>/instance.key and <host>/report.token are each read with instancefs.ReadBeneathLimitOrAbsent beneath the instance directory (openat2, no symlink, regular files only, 1 MiB cap), the same reader the env already used, then sealed in memory; nothing else is opened. file:Open@390,registry:Host@1187,registry:Host@120,registry:Host@438,whole:Route@294,whole:Route@559 4f4584786d3f90a54aa3ddc1c39ffed8a62fcfd593127f534bea787c3d9b7829 |
| +internal/activator/hasecrets.go ExecBackend.haSecretsReady legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: before an HA host's launch, checks that env, the bytes the launch captured (captureLaunchEnv; a new parameter, final fix F2), has the SHA-256 of the committed manifest's env item (envAcknowledged, which now reads no file); else publishes the platform items (env, trio, wake state) through the wake's, the entry's or its own publisher (hostfiles.Open, the +file:Open site: one manifest GET) and checks again, so an env replaced after the capture is committed as other bytes and fails the launch; it no longer classifies the host itself (launchEnvLayer has); every error fails the launch; +file:Open, +registry:Host x3, +whole:Route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: asks sealerFor before its own hostfiles.Open (a box without an escrow key fails the launch before any read), and newHostFiles's error fails the launch. envAcknowledged now compares the sealed env item's keyed digest (hostfiles.SealedAcknowledged, no read) instead of the raw env item's SHA-256. The publish it triggers stages the trio sealed: <host>.env, <host>/instance.key and <host>/report.token are each read with instancefs.ReadBeneathLimitOrAbsent beneath the instance directory (openat2, no symlink, regular files only, 1 MiB cap), the same reader the env already used, then sealed in memory; nothing else is opened. Branch fix R2 P1-3: every launch invokes PublishPlatformNow and the shared escrow gate even when the captured env is already acknowledged. A divergent trio or persisted conflict marker cannot bypass the gate. Unchanged publication remains request-free. Same local paths and manifest prefix; no new authority. file:Open@390,registry:Host@120,registry:Host@1236,registry:Host@438,whole:Route@294,whole:Route@559 af5c028a288dd480380c4cf658098373f938337517d7db33aeb8b2d08e489487 |
| internal/activator/hasecrets.go ExecBackend.launchEnvLayer legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (final fix F2), the agent as carlos: a launch's env and key layer: classifies the host (haHostNow; an error fails the launch), instanceEnvLayer unchanged for a non-HA host; for an HA host captureLaunchEnv once, haSecretsReady over those bytes, a test seam (haLaunchHooks.afterPublish, nil in production), and returns the env parsed from the captured bytes, never a later read; +registry:Host x3 (the error messages), +whole:Route x4;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: for a host that is not HA and is eligible for escrow, escrowedLaunchEnv (a new unit on this card) instead of instanceEnvLayer; the HA and other paths unchanged; +whole:Route x2; the agent as carlos (carlos-edge.service), no root caller registry:Host@245,registry:Host@499,registry:Host@644,whole:Route@154,whole:Route@294,whole:Route@335,whole:Route@371,whole:Route@408,whole:Route@549 35a5150b24c33e81e5d536bb072c62ab55fd583187d83293e644d3599496a99a |
| internal/activator/hawake.go ExecBackend.restoreFilesClean legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: restores the HA host's published files into a fresh <host>.restore directory beneath the instance data dir (instancefs, no link followed), renames it into place without replacing anything, writes the manifest's env item as <host>.env (instancefs.WriteAtomic, 0600) and imports the manifest's wake state into the registry (hostfiles.ImportWake, then the class for restoredReplication); the source is the host's files manifest in the hibernate bucket, written by the agents of the boxes that held the host; every failure fails the wake; +registry:Host, +whole:Route x2;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3 (fix round 1: sealed precedence before any fetch): the restore into <host>.restore is now RestoreRootBaselineShadowed with sealedShadow(host), a pure function of the manifest already read and validated: a live raw instance.key or report.token entry whose sealed item the manifest holds is neither fetched nor written (so a missing or corrupt raw object cannot fail the wake, and a sealed item that does not open fails it with no raw fallback); every other entry is restored as before, and the baseline the wake's publisher continues from is the manifest as read. Then each sealed trio item the manifest holds (instance.key.sealed, report.token.sealed) is fetched and opened with hostfiles.ReadSealed (key, sha256, v2 envelope, binding and MAC checked) and written with instancefs.WriteAtomic (openat2 directory, no symlink, O_EXCL temp, rename, 0600) into the restore directory this function created, then that directory is synced; then the same no-replace rename. The env file comes from the sealed env item through ReadSealed when present, else from the raw env item as before, written as before. The source is still the host's files manifest in the hibernate bucket; the destinations are the same restore directory and env file; no new path is opened, followed or named from input; the sealer (sealerFor) is built only when a sealed item is present. Durability 3a Task 5: after RestoreRootBaselineShadowed, noteRawSecrets(host, rm) on the manifest just restored from. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. Read sites unchanged. Durability 3a Task 5 fix round 1: the restore is RestoreRootBaselineObserved (the same read and restore as RestoreRootBaselineShadowed) with a checked callback, noteRawSecrets(host, m), run once the manifest is read and validated and before any entry is removed, fetched or written, so a restore that then fails still shows the detector the manifest; the later noteRawSecrets call is gone. No request, open or write added; read sites unchanged. registry:Host@97,whole:Route@1086,whole:Route@1586,whole:Route@200 ca4b8c70486f72a3bd7ede5d16c8f9fd22eee13f11d005597223a4f5ab20b405 |
| internal/activator/paths.go ExecBackend.pathsFor legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: split in two: pathsFor classifies (Classify, unchanged) and hands the answer to pathsAt (new on this card), which holds the same body; the same paths for every row; the reads moved to pathsAt whole whole:Route@129,whole:Route@89 5801150c35fef058ce1f8e7c9f334a7a89e3441fe0f63fb451f4804282e90535 |
| @@ -143,8 +145,8 @@ internal/activator/paths.go ExecBackend.pathsFor legacy accepted-legacy accepted |
| @removed internal/host/movesfiles.go readClaimEnvFile H3 census-ruling-durability-3a-escrow;absent;basis=deleted: declaration and sites absent from the tree |
| @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 ee7151ccf105be64f7865bb723d20a1a60b454d6275a81f70c95cb3b86d9c8ff |
| +@coverage internal/activator 7a939c42f169fff3fdb3b3d98665d3d20d8ed935f5d19bc203e59c39a20c2e8a |
| @coverage internal/host 941b090a234199926a9f64c927657034c3b5fb17dea1f5a18716cfe2294f55b1 |
| -@coverage internal/hostfiles 166a3267759ae3d1e417aa90d50f64b73c79dca0f37cb55e069bfd54282a782f |
| +@coverage internal/hostfiles cbcc79ea1d27809889e4f6676b0b154ac61f842b9bb6d2ecfa6aeaf975f05b5f |
| @coverage internal/layout f845fa728b0935279454d8b01023c5d6dae1c985061a41229cf0686e829f5c12 |
| @coverage internal/layout/pubclass 6515ba31b1848139c9da066a6c65b5583c39a92cb77621773d0d11d9cde24e24 |