carlos / platform Public

offline move #339: Luna copy for MV-O200..O204; Astra fixes check

Astra fixes check READY AFTER FIXES, census APPROVED; its one open
item (MV-O203 overstated the failure) is Luna's rewrite, applied here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4fbe930cfeae61c7688ad5faeb7f07c5d7f1f7fa parent 4769472
7 files changed, +49 −12
  • docs/site/cli.md +1 −1
  • docs/superpowers/plans/2026-10-06-moves-phase1-copy.md +7 −5
  • docs/superpowers/plans/2026-10-21-offline-move-runbook.md +1 −1
  • docs/superpowers/reviews/CODEX-FINDINGS-OFFLINE-MOVE-REFUSALS-339-FIXES.md +35 −0
  • internal/console/apiinstancemove_offline_facts.go +2 −2
  • internal/console/apiinstancemove_offline_stage_test.go +2 −2
  • internal/host/movesoffline_e2e_test.go +1 −1

CI passed — run details

Intent

Human

<task-notification> <task-id>a5ef49b8d47227ee5</task-id> <tool-use-id>toolu_01PvKLWxo3Bpq4QxCuK698Qu</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/96a09f74-e398-48ed-a97f-140bd1f7e255/tasks/a5ef49b8d47227ee5.output</output-file> <status>completed</status> <summary>Agent "Implement #413 offline move pool target" 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>I made the round-1 changes and pushed them as `79afb1d9` on top of the review commits, with no history rewritten. **What changed:** - **Pin removed:** `MoveState.TargetBox` and `OfflineTargeted` are gone. The provision Go code is back to main. - **One filter in the console:** a single helper, `offlineMoveEvidence`, decides which target reports count. It keeps a report only if the box that wrote it hibernates and serves the shared pool in the target region, using the same edges-file check as the start door. Every door and the status view read through it, so open, finish, the items, the failed flag and the reports sent to any CLI all see the same targets. - **Record's pool:** the move gate already refuses pool records, so offline moves only ever carry the shared pool and that check is complete. - **Unreadable edges files:** no target report counts, and open answers "the fleet's edges files could not all be read. try again". - **Kept as before:** the box-side pool check, MV-O194 and the empty-region refusal. **Tests added:** - **Older writer:** a record rewritten the way an older sealer or target rewrites it still opens. - **CLI through the real console:** with a failed pool-box report present, `flip` follows the move to "next is open" and exits 0, and `status` agrees. - **Unreadable edges files:** open is refused with that message. **Mutation checks:** I broke the helper five ways (keep every target report, skip the shared-pool check, bypass the helper in the view, bypass it in the doors, drop the unreadable-files refusal); each made a test fail. With the view unfiltered, the CLI test exits 4, which is the review's P2 failure. Breaking the box-side pool check also fails its tests. **Checks:** census re-proposed under the same NAME; it now re-pins only `internal/host`, and the census tests pass. Targeted tests pass for console, host, provision, moves and the root package. gofmt, vet, `go build ./...` and the darwin and windows builds are clean. **Follow-up (P3, not fixed):** start still accepts a target region whose only box has `CARLOS_INBOUND=none`. Reconcile never gives that box the row, so landing waits forever.</result> <usage><subagent_tokens>376595</subagent_tokens><tool_uses>29</tool_uses><duration_ms>1301830</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bj9j5zuuc</task-id> <tool-use-id>toolu_01729oMrVjSJNiPe5QZpVn9d</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/96a09f74-e398-48ed-a97f-140bd1f7e255/tasks/bj9j5zuuc.output</output-file> <status>completed</status> <summary>Background command "Run Astra fixes check and Luna copy pass" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bxbq7u00y</task-id> <tool-use-id>toolu_01Dx47fNgYuTU3p7wjMAojPE</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/96a09f74-e398-48ed-a97f-140bd1f7e255/tasks/bxbq7u00y.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 2 on #413" completed (exit code 0)</summary> </task-notification>

diff --git a/docs/site/cli.md b/docs/site/cli.md
index df99e0ed4..c2042885f 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -3385,7 +3385,7 @@ The instance is offline from `start` until `open`. Until `open`, `abort` puts it
`stage` is optional and comes before `start`. It copies the instance's data to the region it moves to while the instance keeps serving, and each time it runs it copies only what is new. The more it has copied, the less is left to copy while the instance is offline. Until `start`, `abort` removes the staged copy and the instance is never offline.
-`stage` and `start` refuse a move that would fail after the instance goes offline: when a box in the target region still holds a live link for the instance from an earlier time it ran there. Each refusal names the box and what it found.
+`stage` and `start` refuse an offline move when a box in the target region still holds a live link for the instance from an earlier time it ran there, or has more live links than its report can carry. The refusal names the box and says what it found.
## On the host
diff --git a/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md b/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
index d636bd2db..cc00bfbd7 100644
--- a/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
+++ b/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
@@ -721,11 +721,13 @@ Three more console door refusals for a staged move (`internal/console/apiinstanc
## Offline move: refused while the instance still serves (#339)
-A live link the target box still kept for the host from an earlier time it ran there failed an offline move only after `start` had taken the instance offline: the landing's `release` item fails at `flip` (MV-O177) over any link that does not name the sealed build (amadan #339, item 1). Each box now reports the hosts it keeps such a link for in its status report while the instance serves, and the `stage` and `start` doors refuse first (branch `offline-move-stage-refusals-339`). The report names the link and not its build, so the doors refuse any such link: MV-O200 states the fact and that policy, not a predicted failure (Astra round 1, P2-6). MV-O204 is the refusal when the box holds more links than its bounded report can carry (Astra round 1, P1-3), so it cannot say whether one is for the host. Both are console door refusals (`internal/console/apiinstancemove_offline_facts.go`), lower case like the other door sentences; `<box>` is the target box. Item 4 (app directories beside the files directory) was cut from this branch after round 1 and is a follow-up, so its row is gone. MV-O202 is what `carlos move offline status` says for a move aborted from staging (item 2), in place of MV-O8 and the manifest's items, until `finish` ends the move: nothing moved. It is followed by MV-O187 or MV-O188. MV-O203 is the CLI page's paragraph for the refusal, in Luna's wording with its directories clause dropped. The ids start at 200 so that another branch's rows from 194 do not collide. Luna approved MV-O200 and MV-O202 in their first wording; MV-O200 is reworded, so MV-O200, MV-O203 and MV-O204 are pending a copy review.
+MV-O200, MV-O203 and MV-O204 approved by Luna on 2026-11-13 (Paul's 2026-10-25 delegation), as Luna rewrote them; MV-O202 approved by Luna unchanged.
+
+A live link the target box still kept for the host from an earlier time it ran there failed an offline move only after `start` had taken the instance offline: the landing's `release` item fails at `flip` (MV-O177) over any link that does not name the sealed build (amadan #339, item 1). Each box now reports the hosts it keeps such a link for in its status report while the instance serves, and the `stage` and `start` doors refuse first (branch `offline-move-stage-refusals-339`). The report names the link and not its build, so the doors refuse any such link: MV-O200 states the fact and that policy, not a predicted failure (Astra round 1, P2-6). MV-O204 is the refusal when the box holds more links than its bounded report can carry (Astra round 1, P1-3), so it cannot say whether one is for the host. Both are console door refusals (`internal/console/apiinstancemove_offline_facts.go`), lower case like the other door sentences; `<box>` is the target box. Item 4 (app directories beside the files directory) was cut from this branch after round 1 and is a follow-up, so its row is gone. MV-O202 is what `carlos move offline status` says for a move aborted from staging (item 2), in place of MV-O8 and the manifest's items, until `finish` ends the move: nothing moved. It is followed by MV-O187 or MV-O188. MV-O203 is the CLI page's paragraph for the refusal, in Luna's wording with its directories clause dropped. The ids start at 200 so that another branch's rows from 194 do not collide.
| id | file | text | status |
|---|---|---|---|
-| MV-O200 | internal/console/apiinstancemove_offline_facts.go | <box> still holds a live link for <host> from when it last ran there. stage refuses until it is cleared, since a mismatched link fails the move only after <host> is offline. see the offline move runbook | pending |
-| MV-O202 | move.go | Nothing moved. The stage of <host> was abandoned, and <host> kept serving in <from>. | pending |
-| MV-O203 | docs/site/cli.md | `stage` and `start` refuse a move that would fail after the instance goes offline: when a box in the target region still holds a live link for the instance from an earlier time it ran there. Each refusal names the box and what it found. | pending |
-| MV-O204 | internal/console/apiinstancemove_offline_facts.go | <box> holds more live links than it can report, so stage cannot tell whether one is for <host>. see the offline move runbook | pending |
+| MV-O200 | internal/console/apiinstancemove_offline_facts.go | <box> still holds a live link for <host> from when it last ran there. stage and start refuse until it is cleared, since a mismatched link fails the move only after <host> is offline. see the offline move runbook | approved |
+| MV-O202 | move.go | Nothing moved. The stage of <host> was abandoned, and <host> kept serving in <from>. | approved |
+| MV-O203 | docs/site/cli.md | `stage` and `start` refuse an offline move when a box in the target region still holds a live link for the instance from an earlier time it ran there, or has more live links than its report can carry. The refusal names the box and says what it found. | approved |
+| MV-O204 | internal/console/apiinstancemove_offline_facts.go | <box> holds more live links than it can report, so stage and start cannot tell whether one is for <host>. see the offline move runbook | approved |
diff --git a/docs/superpowers/plans/2026-10-21-offline-move-runbook.md b/docs/superpowers/plans/2026-10-21-offline-move-runbook.md
index a8027c3f7..7a1dbc704 100644
--- a/docs/superpowers/plans/2026-10-21-offline-move-runbook.md
+++ b/docs/superpowers/plans/2026-10-21-offline-move-runbook.md
@@ -172,7 +172,7 @@ Pass: the files tree is under 268435456 bytes (256 MiB; over that the seal refus
This check exists because of the first staged move on the flagship. An earlier attempt had left a root-owned link `/opt/carlos/live/<host>` on the UK box, naming a build from weeks before. Nothing reports it before `flip`, and `flip` fails the landing's `release` item only after `start` has taken the instance offline: `flip` exited 4 with "uk could not take shop.example.com: the target box still holds an older build of this instance", the move was aborted, and the instance was offline for about two minutes for nothing (amadan #339).
-From the release carrying the #339 fix, the target box reports every live link it keeps for a host it has no row for, and `stage` and `start` refuse such a host with "<box> still holds a live link for <host> from when it last ran there. stage refuses until it is cleared, since a mismatched link fails the move only after <host> is offline. see the offline move runbook" (exit 5), before anything goes offline. The report names the link and not its build, so the doors refuse any such link, even one that names the build the instance runs. A box that holds more live links than its report can carry (more than 128) makes them refuse every host with "<box> holds more live links than it can report, so stage cannot tell whether one is for <host>. see the offline move runbook". A box whose agent runs as root reports no links, and the doors then refuse nothing over it. A box reports again within about six minutes, so after clearing a link wait for its next report before staging. The landing's own check stays behind the doors. Run the checks below anyway: they also cover older releases.
+From the release carrying the #339 fix, the target box reports every live link it keeps for a host it has no row for, and `stage` and `start` refuse such a host with "<box> still holds a live link for <host> from when it last ran there. stage and start refuse until it is cleared, since a mismatched link fails the move only after <host> is offline. see the offline move runbook" (exit 5), before anything goes offline. The report names the link and not its build, so the doors refuse any such link, even one that names the build the instance runs. A box that holds more live links than its report can carry (more than 128) makes them refuse every host with "<box> holds more live links than it can report, so stage and start cannot tell whether one is for <host>. see the offline move runbook". A box whose agent runs as root reports no links, and the doors then refuse nothing over it. A box reports again within about six minutes, so after clearing a link wait for its next report before staging. The landing's own check stays behind the doors. Run the checks below anyway: they also cover older releases.
```bash
tgt "set -- $H; $(cat "$W/target.box.sh")"
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-OFFLINE-MOVE-REFUSALS-339-FIXES.md b/docs/superpowers/reviews/CODEX-FINDINGS-OFFLINE-MOVE-REFUSALS-339-FIXES.md
new file mode 100644
index 000000000..7fe740df6
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-OFFLINE-MOVE-REFUSALS-339-FIXES.md
@@ -0,0 +1,35 @@
+Reviewed `ccd35818..6b580cd6db9e7d4c2bc59e02a306d58332fee3fb`, within round 1’s fix-check budget. HEAD adds only the brief.
+
+**P2-6 remains partly unresolved.** [docs/site/cli.md:3388](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/offline-move-stage-refusals-339/docs/site/cli.md:3388) still says the refused move “would fail.” A leftover link naming the sealed build passes [liveNotSealed:1250](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/offline-move-stage-refusals-339/internal/host/movesoffline_land.go:1250), but the name-only probe cannot distinguish it. MV-O200 now explains the conservative policy correctly; MV-O203 still predicts an unestablished failure. Update the CLI paragraph and its copy-table row to describe that policy. **Invariant:** refusal copy distinguishes observed facts from predicted failures. Fix without reopening review.
+
+Round 1 dispositions:
+
+- **P1-1 — resolved:** effective UID 0 returns before filesystem access.
+- **P1-3, remaining half — resolved:** enumeration and reported names/bytes are bounded; overflow is explicit.
+- **P2-4 — resolved:** staging status checks the same facts before offering start.
+- **P2-5 — resolved by removal:** app-directory paths no longer reach refusal output; reported link names are compared, not printed.
+- **P2-6 — partly resolved:** MV-O200 corrected; MV-O203 remains inaccurate.
+- **P2-7 — resolved:** the runbook now limits the headline to status before finish.
+
+The app-directory implementation is removed. `movesoffline_seal.go` has the identical Git blob on the reviewed commit and `origin/main`: `f98559c24d3d6e0231790e339fe798b1ceef0853`. P1-2 and the directory half of P1-3 are therefore removed, not fixed.
+
+The probe opens only the live directory and enumerates names; it never stats, opens or follows an entry. Its precise bound is **4,096 retained names plus one overflow lookahead**, rather than literally 4,096 names read. It reports at most 128 names and 8 KiB of hostname bytes, plus JSON overhead. The added round-trip test covers `WriteBox` and `LoadBoxesComplete`.
+
+Bootstrap creates the host live directory with mode 0755; root’s release paths create links through `PointLive`. Tenant units receive read-only executable mounts. I found no tenant filesystem path that can create entries there. Legitimate deployments can cause root to create hostname entries; the bounds cover their accumulation.
+
+MV-O204 does not strand a move: it gates stage/start and staging status. [Abort:1241](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/offline-move-stage-refusals-339/internal/console/apiinstancemove_offline.go:1241) and reverting-to-finish checks do not consult these facts.
+
+| Census unit or envelope | Verdict | Evidence |
+|---|---|---|
+| `CollectBox` | APPROVED | `snapshot.go:1251–1258,1315–1316`: supplied metrics only; no new external read. |
+| `statusLoop` | APPROVED | `agent.go:5086`: calls the identity-gated probe. |
+| `offlineMoveFactsProbe` | APPROVED | `movesoffline_facts.go:38–39`: passes actual effective UID. |
+| `movesWorker.offlineMoveFacts` | APPROVED | `movesoffline_facts.go:56–91`: UID refusal first; bounded name-only collection. |
+| `readNamesBounded` | APPROVED | `movesoffline_facts.go:97–120`: directory open and bounded enumeration, including one lookahead; no entry access. |
+| Envelope `.` | APPROVED | `move.go:1501–1511,1614–1619`: display changes add no root authority. |
+| Envelope `internal/host` | APPROVED | Gated probe above; seal restored byte-for-byte. |
+| Envelope `internal/status` | APPROVED | `snapshot.go:243–263,814,1258,1316`: private schema and supplied-value projection. |
+
+Targeted tests, including census checks, could not start: with `GOCACHE` unset, Go failed creating its work directory in the read-only sandbox. These are source-review approvals, not a claim that the tests passed. No files were edited; no subagents were used.
+
+**READY AFTER FIXES**
\ No newline at end of file
diff --git a/internal/console/apiinstancemove_offline_facts.go b/internal/console/apiinstancemove_offline_facts.go
index d40f716b6..d4e2d908b 100644
--- a/internal/console/apiinstancemove_offline_facts.go
+++ b/internal/console/apiinstancemove_offline_facts.go
@@ -26,10 +26,10 @@ func offlineBoxFacts(f offlineFleet, host, to string) *offlineRefusal {
continue
}
if slices.Contains(m.OfflineMove.StaleLiveLinks, host) {
- return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s still holds a live link for %s from when it last ran there. stage refuses until it is cleared, since a mismatched link fails the move only after %s is offline. see the offline move runbook", b.Box, host, host)}
+ return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s still holds a live link for %s from when it last ran there. stage and start refuse until it is cleared, since a mismatched link fails the move only after %s is offline. see the offline move runbook", b.Box, host, host)}
}
if m.OfflineMove.StaleLiveLinksOverflow {
- return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s holds more live links than it can report, so stage cannot tell whether one is for %s. see the offline move runbook", b.Box, host)}
+ return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s holds more live links than it can report, so stage and start cannot tell whether one is for %s. see the offline move runbook", b.Box, host)}
}
}
return nil
diff --git a/internal/console/apiinstancemove_offline_stage_test.go b/internal/console/apiinstancemove_offline_stage_test.go
index 9a1ccb947..9f1445389 100644
--- a/internal/console/apiinstancemove_offline_stage_test.go
+++ b/internal/console/apiinstancemove_offline_stage_test.go
@@ -332,11 +332,11 @@ func TestOfflineStagedMoveRefusesChangedCoordinates(t *testing.T) {
// ---- #339: refused while the instance still serves ----
func msgO200(box string) string {
- return box + " still holds a live link for " + offlineHost + " from when it last ran there. stage refuses until it is cleared, since a mismatched link fails the move only after " + offlineHost + " is offline. see the offline move runbook"
+ return box + " still holds a live link for " + offlineHost + " from when it last ran there. stage and start refuse until it is cleared, since a mismatched link fails the move only after " + offlineHost + " is offline. see the offline move runbook"
}
func msgO204(box string) string {
- return box + " holds more live links than it can report, so stage cannot tell whether one is for " + offlineHost + ". see the offline move runbook"
+ return box + " holds more live links than it can report, so stage and start cannot tell whether one is for " + offlineHost + ". see the offline move runbook"
}
// A target box that reports a live link for the host, left from an earlier
diff --git a/internal/host/movesoffline_e2e_test.go b/internal/host/movesoffline_e2e_test.go
index 671349fea..9c9a1a831 100644
--- a/internal/host/movesoffline_e2e_test.go
+++ b/internal/host/movesoffline_e2e_test.go
@@ -1208,7 +1208,7 @@ func offlineRefusesAStaleLiveLink(t *testing.T) {
w := newE2EWorld(t, landOpts{})
old := w.stageLive("v0")
w.reportStatus()
- msg := "uk-box still holds a live link for " + offHost + " from when it last ran there. stage refuses until it is cleared, since a mismatched link fails the move only after " + offHost + " is offline. see the offline move runbook"
+ msg := "uk-box still holds a live link for " + offHost + " from when it last ran there. stage and start refuse until it is cleared, since a mismatched link fails the move only after " + offHost + " is offline. see the offline move runbook"
w.requireRefused("stage", msg)
w.requireRefused("", msg)
if got, err := os.Readlink(release.LiveLink(w.uk.opt, offHost)); err != nil || got != old {