carlos / platform Public

Ledger · fix-set-aside-exdev

Human

<task-notification> <task-id>af4316d8578e8cb5c</task-id> <tool-use-id>toolu_01BufUTU9ik6riWdw5xDku9A</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/3bbea1fd-996b-42f3-b651-0add5a8ac1d5/tasks/af4316d8578e8cb5c.output</output-file> <status>completed</status> <summary>Agent "Cut v0.33.1 and roll dev" 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 dev console is on v0.33.1 and every dev check passed, except shop and railsdemo on box-1, which I've marked KNOWN FAILING as you asked. Detail is in /home/paulca/.cache/release-v0.33.1/roll-log.md. **Console roll** - Shipped and promoted to canary/console at 08:50:48–08:51:01Z, using the console build stamped with 11c8c864. - Console restart: stopped at 08:51:05.93Z and serving again at 08:51:08.54Z, about 2.6 s. It hasn't restarted since. - x-carlos-version is v0.33.1 on platform.dev.carlosframework.com from 08:51:10Z. - Over the 5-minute probe of GET /, all 1186 requests got 200. Requests sent during the restart waited at most 2.55 s. - The rollback target was v0.33.0 (c48f29ff); I didn't need it. **Checks** - **Sophie's console drop-ins:** the 9 drop-ins and 4 files have the same sha8, owner and mode before and after. - **Console journal since start:** no ERROR lines, none mentioning interactive, tty, session or relay, and no panics. - **"launch rule not cleared":** absent. - **"Alert checks":** running. The job writes nothing to the journal and its status page needs an operator sign-in, so my evidence is its beat file, alert-engine.beat. It was rewritten at 08:51:08Z and again by 08:56:08Z, with no beat errors. - **alert-connectors.key:** exists. I checked existence only. - **Edge journals on sophie, leo and dennis:** no ERROR, REFUSING or LEASE HELD lines, no proxy errors, no restarts, and no ERROR lines about interactive, tty, session or relay. Their host.env files haven't changed since this morning's pre-check. - **Everything else from v0.33.0's checklist passed:** - all boxes v0.33.1 current except box-2, which is detached and was already unreachable on v0.33.0; - fleets ls, hosts-used (38 recorded, floor v0.33.0), and the static site's headers are unchanged; - the protection logs path works, the ops-account exemption holds, and the billing webhook returns 400 as before; - wakecheck returned 200 (0.51 s), and analytics exited 0 for all four apps. - **Shop and railsdemo on box-1:** both returned 200 before the roll and 503 after. KNOWN FAILING (the v0.33.0 set-aside cross-device bug); I didn't touch box-1. **Anything odd** - At 08:09:11Z, the second sophie's edge restarted, one sample got 502 from both shop and railsdemo. That is the gap before box-1's tunnel reconnected at 08:09:12Z. - The analytics commands needed `--account bab`. Without it the CLI exits 1 saying I belong to several accounts. - Main moved to 90c4d3aa (#488) after I tagged at MERGE, so that commit is not in v0.33.1. Nothing I started is still running. The Plan 6 dev-box checklist is yours.</result> <usage><subagent_tokens>204151</subagent_tokens><tool_uses>18</tool_uses><duration_ms>389860</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>ad0bf2efbc85cb6fc</task-id> <tool-use-id>toolu_01XCXKWsvVSnhU371TchQw3u</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/3bbea1fd-996b-42f3-b651-0add5a8ac1d5/tasks/ad0bf2efbc85cb6fc.output</output-file> <status>completed</status> <summary>Agent "Review set-aside EXDEV fix" 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>**Verdict: READY.** I found no P1 or P2 issues. I checked that the new test fails without the fix: I reverted the one line through a `go test -overlay` copy in `$TMPDIR`, and the worktree was not touched. The reverted run hits the box's error, `renameat2 .../instances/shop.example.com/shop.example.com.db .../.superseded/.../&lt;n&gt;.partial/...: invalid cross-device link`. With the fix, the targeted set-aside, interrupted-move and durability-order tests all pass. The bind test really ran here and was not skipped. No temp dirs or mounts were left behind, after either the passing or the failing run. **1. Correctness on a nested box.** - `carlos-edge.service` has `ReadWritePaths=/data`, so in the agent's namespace `/data/.instances` and `/data/.superseded` sit on one mount and only `/data/instances` is a separate bind. The raw path therefore shares `.superseded`'s mount and the rename succeeds. - No other rename or link in the start-rule flow crosses the bind. Each of these stays inside one directory: - the marker write (`writeDurable` → `WriteAtomic`, in `dir`) - the `.partial` → final rename (inside `hostDir`) - the seed placement (`seedplace.go:433`) - the litestream restore into `dbPath` - the corrupt-restore quarantine (`backend_exec.go:957`) - the HA renames (`hawake.go:559,635`) - `seedplace.go:186` reuses `reconcileAssignment`, so it gets the fix too. **2. Safety.** - A tenant cannot steer which path is used. The `id` comes from the host name, and `/data`, `/data/.instances` and `/data/instances` belong to `carlos` (mode 0700). An isolated unit sees only its own directory (`TemporaryFileSystem=/data:ro`). A flat child already shares the agent's uid and could do anything anyway. - A symlink at the raw path fails `IsDir`, so the code falls back to `dir`. - Moving through the raw path (no nosymfollow) loses no protection: `openDir` refuses symlinks (`RESOLVE_NO_SYMLINKS`), and `renameat2` never follows its last path component. - The time-of-check race fails closed in both directions. If the bind appears after the check, the rename gets EXDEV and the wake is refused, as before. If the bind disappears, the raw path is still on the same mount. - Durability holds: both paths name the same inode, so syncing the directory through the raw path covers it. **3. Flat layout and boxes without `.instances`.** These behave exactly as before. A flat `dir` of `/data` gives `Rel` = `..`. A missing or different raw directory fails the Lstat or `SameFile` check. A relative path makes `Rel` error. All three return `dir`. **4. The test.** It reproduces the box's condition, and it checks that the rename really gets EXDEV first. It is safe to run in CI: - From an unprivileged user namespace, the new mount namespace already turns shared mounts into slaves, and the `MS_PRIVATE` call adds a second guard. - The unmount cleanup runs before `TempDir` removal (cleanups run last-in, first-out). - The namespace dies with the child process. - Blocked user namespaces cause a skip (the start error is not an `ExitError`), and so does an AppArmor mount `EPERM` (via `SKIP-BIND`). **Findings:** - **P3** `internal/activator/startrule_bind_linux_test.go:45,52`: the child gets no `-test.timeout` and runs under plain `CombinedOutput`, with no context and no `Pdeathsig`. If `Restore` ever blocks inside the child, `go test -timeout` panics the parent and leaves the namespaced child orphaned on the CI worker. Fix: pass the parent's deadline through, using `exec.CommandContext` with `t.Deadline()` or `-test.timeout`. - **P3** `internal/host/units/data-instances.mount` (header comment): it still says `/data/.instances` is "opened by the layout pass only". That statement is now false. Someone reasoning about the nosymfollow guarantee from it would miss the set-aside path. **5. Possible follow-ups (same EXDEV risk; not changed here).** - `internal/host/movesoffline_land.go:550-557` → `ensureAbsent` → `parkInto` (`os.Rename` at `:294`). `warmPaths` includes `rt.DBPath`. On a nested row with a warm copy, that renames `/data/instances/&lt;id&gt;/&lt;host&gt;.db` into `&lt;DataDir&gt;/.offline-moves/...`, which would get EXDEV. - `internal/host/claimretire_local.go:91` → `park.Local.RetireSuperseded` (`internal/park/local_linux.go:341`, `Renameat2`). Worth checking whether its database path can be nested. Claims are shelved, so this is low priority. - Already correct, and a precedent for this fix: `movesoffline.go` `retirePaths` moves through `layout.RawInstanceDir`. The layout pass also works on the raw path. `movesinstall`, `movesfinal` and `movesrollback` move only flat paths.</result> <usage><subagent_tokens>101855</subagent_tokens><tool_uses>36</tool_uses><duration_ms>287658</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bu0syxkcp</task-id> <tool-use-id>toolu_015MuGgNqZ1NdkRJe6WCuYRv</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/3bbea1fd-996b-42f3-b651-0add5a8ac1d5/tasks/bu0syxkcp.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on the fix branch tip" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bvadmn9c3</task-id> <tool-use-id>toolu_01AhAjZvazhqg9ArdfjCdS1R</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/3bbea1fd-996b-42f3-b651-0add5a8ac1d5/tasks/bvadmn9c3.output</output-file> <status>completed</status> <summary>Background command "Wait for CI and the Astra census review" completed (exit code 0)</summary> </task-notification>