carlos / platform Public

durability-3a-escrow

No handoff yet. An agent working here writes one with amadan branch handoff, so that whoever picks the branch up next — a person, or another agent on another machine — can start without reading the whole history.

Recently

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/866679.sock" from-name="platform-cf" from-mode="bypass"> platform-cf: go ahead and cut v0.33.3. No one else is cutting it. - **Flagship:** my v0.33.2 flagship roll is still running. I'll message you the moment it's done. Don't touch flagship, and don't start your dev roll until then. - **Dev:** don't roll dennis (carlos-dev-uk) before about 13:50Z. platform-86's disk-forecast witness runs there; message platform-86 before and after you roll it. - **My fix:** I have a small rootfs fix in flight, branch rootfs-default-home: rootfs processes get HOME=/tmp when nothing sets one. It's waiting on Paul's copy review of one docs line, then census and CI. It won't be on main in time, so don't wait for it. It'll ride the release after yours (I'll cut v0.33.4 to dev, or hand it to whoever cuts next). - **Merge timing:** if it does land before you tag, take it only if main CI is green with it in. Tell me which MERGE you cut from. </cross-session-message>

Human

<task-notification> <task-id>b0cxe6tn7</task-id> <tool-use-id>toolu_01LLeVUMUcBzowaZVTB4AU1g</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/b0cxe6tn7.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on the branch tip to finish" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>ad78661b885d70d84</task-id> <tool-use-id>toolu_011QTigSCuMFVZUBbxKtKdau</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/ad78661b885d70d84.output</output-file> <status>completed</status> <summary>Agent "Opus re-check of 3a fix 3b" 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># Branch fix 3b check (Opus), ca56d939 over e6cb5af8 The gap is closed. A raw-bearing pin now refuses before any write. The only files-manifest write outside hostfiles goes through the one exported check. The guard's new rule has fixtures that fail, and nothing live breaks. I read the diff once, plus the touched code in the worktree. I grepped non-test `internal/` and `cmd/` for every `ManifestKey` reference and every literal `manifest.json` key. I ran one test, `TestEveryStagingOperationIsClassified`, with the default GOCACHE. The sandbox makes `~/.cache/go-build` read-only, so the first attempt failed while loading packages. I re-ran the same command once outside the sandbox and it passed. No production code was reported, and every `manifestwrite.go` and `clean.go` expectation matched. ## 1. Is the CopyPinnedManifest gap closed? Yes. **Fresh pins.** `StorePinner.filesPin` (pin.go:275) refuses right after it decodes the source manifest. `Pin` only reads before that point. The retained copy (pin.go:181) and the pin object (:189) are written after the check. With no pin there is no build, so no P manifest, no database build, no install manifest and no env restore. **Old or reused pins.** These skip the pin check, so `CopyPinnedManifest` (pin.go:451) runs the same check before it marshals and writes. In the build it comes before `BuildGeneration` (relocationbuild.go:106). The install manifest and the env restore come later still, so the refusal stops all of them. Before the copy, the build still runs `activate`, the authority check and the replica lease. None of these writes a files manifest or a secret. **Witnesses.** - **Pin:** three cases (`instance.key`, `host.env`, and `instance.key` with the legacy platform items). Each checks: - the typed error names the exact item - zero PUTs on both stores - nothing in the claims bucket - no P manifest - the source manifest is unchanged byte for byte - the operator log names the item - **Copy:** `instance.key` and `host.env`, each with zero PUTs and no P manifest. A clean `tenant.txt` control makes exactly one PUT, which proves the counter sees `CreateExact`. - **Build:** three production-build cases (raw env with a database, raw env with an empty database, raw `instance.key`). Each asserts zero PUTs and no P manifest, without the skip helper. - The old B3 assertions that P held the raw env are gone. ## 2. Write sites outside hostfiles | Site | Verdict | |---|---| | hostrelocate/pin.go:458 `CreateExact(…, hostfiles.ManifestKey(toPrefix), body)` | The only write. The check at :451 comes first, with no change to the manifest in between. OK | | pin.go:265, :212 | A read, and a binding that is only validated. OK | | host/movesfiles.go:346, :349, :506, :708 | Error text, a binding that is only compared or logged, and reads. The two key-holding stores (`versionStore`, `exactBytesStore`) error on Put. OK | | claimfilesseed_select.go:213, claimfilesseed_guard.go:45, claimempty_recovery.go:100, relocationinstall.go:268, movessources.go:302, relocationwake.go:423, relocationbuild.go:240, movesinstall.go:913 | All reads or comparisons. OK | No other package builds a files-manifest key by hand. The other `manifest.json` literals belong to the park archive, the local moves archive and release manifests. The activator writes only through Publisher. ## 3. Guard fixture and false negatives `manifestwrite.go` has nine fixtures that must be reported: - a direct write - an aliased key - an ignored check - a check on the wrong manifest - a change after the check - a check inside one branch only - a function alias - a change through a map alias - a key passed through `Sprintf` The comparison is exact both ways: each expected item must appear and nothing extra may. `clean.go` covers three clean writes and reads. The rule refuses any use of the key it doesn't recognise. Three theoretical holes remain, but no production code uses them: - a key stored in one of the allowed struct fields is not followed afterwards - the key returned by `movesFilesSelect` is not followed at its callers - a key built from a literal (`prefix + "manifest.json"`) skips `ManifestKey` altogether ## 4. Live paths Nothing breaks. - **Operator offline move:** no touched file is on it. - **HA publication and escrow:** the activator is unchanged, and the hostfiles change is a rename with the same behaviour. - **Relocation:** production never starts one (`relocationStartRefused`, relocatepass.go:218). One side effect: the pin still requires a raw `host.env` as evidence (pin.go:289), and that item is now refused. So every relocation of a host with files will be refused until that rule changes. That is fine while relocation is parked. ## Follow-ups - Before relocation is unparked, change the pin's env-evidence rule (pin.go:289) and `relocationPlatformItem` to require the sealed item. Otherwise no host with files can ever pin. - Guard: follow keys stored in the allowed binding fields and the `movesFilesSelect` return, or limit those allowances to today's sites. Optionally flag `manifest.json` literals outside hostfiles. - Still deferred from my earlier check: raw-name tombstones refuse; the activator sealing allowlist uses bare function names; `Publisher.Refresh` is not covered by the guard. - The guard test can't load packages in this sandbox because the default GOCACHE is read-only. Run it outside the sandbox or rely on CI. The full check is saved at /home/paulca/amadan.net/carlos/platform/.claude/worktrees/durability-3a/.superpowers/sdd/2026-10-30-durability-step3-escrow-fence-restore/branch-fix3b-check-opus.md Verdict: CLOSED</result> <usage><subagent_tokens>126234</subagent_tokens><tool_uses>29</tool_uses><duration_ms>263734</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bf8h4iwwa</task-id> <tool-use-id>toolu_014eZuFKzv2vAAQMN1rFJ7rY</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/bf8h4iwwa.output</output-file> <status>completed</status> <summary>Background command "Run Astra census re-check at the 3b tip" completed (exit code 1: No matches found)</summary> </task-notification>

Human

<task-notification> <task-id>bwoal3klv</task-id> <tool-use-id>toolu_01G1hp4RKvZ9TYMoca6nyhwT</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/bwoal3klv.output</output-file> <status>completed</status> <summary>Background command "Record Opus finding and run fix 3b on Astra" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>b4xqcaod3</task-id> <tool-use-id>toolu_01PUV8EJjVzramYKbDqv7YS5</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/b4xqcaod3.output</output-file> <status>completed</status> <summary>Background command "Run the Astra census re-check at the new tip" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a5050d706a566669a</task-id> <tool-use-id>toolu_01FqPxYjoPjrSkHnN8674JYp</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/a5050d706a566669a.output</output-file> <status>completed</status> <summary>Agent "Opus check of 3a fix round 3" 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>The fix is not closed. It works for the two publishers Astra named (the claim Establish and the relocation release flush), but one other parked path still copies a raw-secret baseline into a new manifest without the refusal. The full write-up is in `.../2026-10-30-durability-step3-escrow-fence-restore/branch-fix3-check-opus.md`. I ran one focused test, `TestRelocationFirstProbeRefusesRawBaselineThroughTheC8Provider`. It passed, and its log shows the refusal naming `files/g-p1/ ... host.env`. I used the sandbox TMPDIR because `/tmp/g` is read-only in this sandbox. ## 1. Paths outside hostfiles that start from an existing manifest - **`movesfiles.go:1153`** (Establish copying the newest manifest): refused. A witness covers it. - **`movesfiles.go:754`** (prepared replay, `OpenAtForSeed`): refused. A witness covers it. - **`movesfiles.go:1109`** (empty bootstrap) and **`:295`** (`NewPrepared` from the local tree): no inherited baseline. OK. - **`claimfilesseed_stage.go:152`** (`Seed`): its publisher is already checked, and `Seed` checks again under the lock. OK. - **`relocationflush.go:82` and `:101`** (release flush via `OpenForSeed`, then `Seed`): refused. A witness covers it. - **Activator** (`Open` and `OpenBaseline` at hasecrets.go:269, hafiles.go:216/294/335, escrow.go:335/646/652/1227, plus two `Refresh` calls): these are the live sealing publishers. They are allowlisted on purpose and drop raw items in the same sealed commit. Within the ruling. - **`hostfiles.Publish`, `CopyManifest`, `Run`**: no production callers. - **Not closed: `internal/hostrelocate/pin.go:417-452` `CopyPinnedManifest`**, called from `internal/host/relocationbuild.go:106`. - The relocation build writes the new generation's prepared manifest (generation P, sequence 0) using its own JSON encode and `release.CreateExact`. That copies every pinned entry and platform item, including raw `instance.key`, `report.token` and `host.env`. - It only runs `ValidateManifest`. The guard doesn't see it because it never calls a hostfiles publisher function. - B3's own test edits (`relocationprobefiles_linux_test.go:257`, `:277-279`, `:288`, `:308`) now assert that P still holds the raw env, and call it "historical". It isn't historical: this relocation's build wrote it, before the probe refused. The focused test run confirms this. ## 2. Refusal before any PUT - **Establish (copy and prepared) and the release flush:** yes. Everything before the refusing call is a read. The witnesses count PUTs on the only store written, check the old manifest is unchanged byte for byte, check that nothing new was committed, check the operator log line, and include a clean control. - **Relocation:** no. The pin's retained copy, P's manifest, the database build, the install manifest and the restore of the env file to the target's disk all happen before the probe refuses. ## 3. Live paths Nothing live breaks. - **Operator offline move:** makes no hostfiles calls at all. - **HA publication:** only uses `Open`, `OpenBaseline`, `Refresh` and `SyncDirAt`, none of which B3 changed. - **Pre-3a HA manifests with a raw `host.env`:** unchanged on the live path. The escrow gate seals the trio. In the same commit, `DropRawSecrets` removes the `host.env` platform key and tombstones `instance.key` and `report.token`. Historical objects stay where they are, and no page fires unless the cutover marker is present. - **The same manifests on the parked paths** now refuse with `ErrRawSecretBaseline`. Before, Establish dropped the env and committed. ## 4. New problems - **Important:** the `CopyPinnedManifest` gap above. - The fix should refuse at pin time (pin.go:265-275), before the retained copy at :181. The check should be one exported function in hostfiles. - `CopyPinnedManifest` should also run that check before it writes. - The relocation tests should assert that no P manifest is written for a raw pin. - **Important:** the publication guard recognises hostfiles functions by name only. A manifest written by hand outside hostfiles with `CreateExact` or `Put` on `hostfiles.ManifestKey(...)` is never inventoried. - **Minor:** - **Tombstones are refused** (rawbaseline.go:22-37). Tombstones name no object, but `DropRawSecrets` leaves them permanently. Any lineage that went through the HA migration therefore stays blocked for parked publishers. This matches the brief ("any raw item"), but should be noted before host claims are unparked. - **Guard allowlist:** it is keyed by bare function name inside the activator, so a new free function with an allowlisted name would pass. - **`Publisher.Refresh` bypass:** it re-opens with the unchecked `Open`, and the guard doesn't inventory it. No parked path calls it today. - **Stale doc comment** at `movesfiles.go:1048-1050`: it still says the raw env is dropped. Verdict: NOT CLOSED: hostrelocate.CopyPinnedManifest (relocation build, relocationbuild.go:106) still commits P's new seq-0 manifest carrying the pinned baseline's raw instance.key/report.token/host.env items without the hostfiles refusal, and the publication guard does not inventory that manifest copy.</result> <usage><subagent_tokens>170073</subagent_tokens><tool_uses>39</tool_uses><duration_ms>360694</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>b02ptovhn</task-id> <tool-use-id>toolu_01NmgsnXT1Cdye4CqfkM4Z6h</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/b02ptovhn.output</output-file> <status>completed</status> <summary>Background command "Run whole-branch Astra review round 3" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>b0kgzkp3b</task-id> <tool-use-id>toolu_01NVeoZNZu1b4oThYnfDsu3R</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/b0kgzkp3b.output</output-file> <status>completed</status> <summary>Background command "Run the Astra census re-review for R3" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bux42cn6l</task-id> <tool-use-id>toolu_01Qqb37VdZehi4Etd6VufBso</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/bux42cn6l.output</output-file> <status>completed</status> <summary>Background command "Run fix round 2b on Astra" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bf9buno4z</task-id> <tool-use-id>toolu_01BkjGCfWaQA2jKe1DX3eNGL</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/bf9buno4z.output</output-file> <status>completed</status> <summary>Background command "Run branch fix round 2 on Astra" completed (exit code 0)</summary> </task-notification>