carlos / platform Public

moves: offline run says a failure in words that fit its own abort

Astra branch review round 1, finding 7 (P2). When run aborts after a
box failure it no longer prints MV-O6, MV-O9 or MV-O185, whose tails
tell the operator to run abort or stage again while run is doing it.
A target's failure is M-C8 (moves.MovingBackLine) on the abort line; a
sealer's is new OR72 (MV-O9's head alone) then OR22; a failed staging
round is new OR73 (MV-O185's head with OR23's ending), since nothing
moves back. OR72 and OR73 are pending in strings-fix.json.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 34a15d49fa027e40c11572aa6c78a8d963ef62c5 parent f95eee7
6 files changed, +79 −14
  • approved_moves_copy_test.go +1 −1
  • docs/drafts/offline-move-run/copy-review/strings-fix.json +16 −0
  • docs/superpowers/plans/2026-10-06-moves-phase1-copy.md +2 −0
  • move_offline_run.go +19 −4
  • move_offline_run_test.go +36 −7
  • offline_move_e2e_test.go +5 −2
diff --git a/approved_moves_copy_test.go b/approved_moves_copy_test.go
index d73aa46ef..98a4efc86 100644
--- a/approved_moves_copy_test.go
+++ b/approved_moves_copy_test.go
@@ -129,7 +129,7 @@ var movesCopyIDs = []string{
"OR60", "OR61", "OR62", "OR63", "OR65", "OR66",
// The fixes for Astra's branch review, round 1 (deck
// strings-fix.json beside strings.json; pending).
- "OR70", "OR71",
+ "OR70", "OR71", "OR72", "OR73",
}
// copyRow is one row of the record. The File cell is the file the sentence is
diff --git a/docs/drafts/offline-move-run/copy-review/strings-fix.json b/docs/drafts/offline-move-run/copy-review/strings-fix.json
index 5aef60c51..e9f27bad3 100644
--- a/docs/drafts/offline-move-run/copy-review/strings-fix.json
+++ b/docs/drafts/offline-move-run/copy-review/strings-fix.json
@@ -14,5 +14,21 @@
"text": "No status from the console for %s. run keeps asking. To see where the move is, run:",
"context": "carlos move offline run, once the move is under way: the status reads have failed in a way that may pass (no answer, a 5xx, the rate limit) for 2 minutes. Said once per outage; the next line is the status command (carlos move offline status --host <host>). %s is '2 min'. run sends nothing while it has no status, and goes on when the console answers. A refusal that will not pass (401, 403, 404) ends run instead, with exit 1: the console's own sentence, then OR29 and the status command. Astra branch review round 1, finding 6.",
"status": "pending"
+ },
+ {
+ "id": "OR72",
+ "section": "run lines",
+ "label": "A step failed (run moves it back)",
+ "text": "The move could not finish a step: %s.",
+ "context": "carlos move offline run, before open, when the sealer (stop or copy) reports a failure. %s is the box's own reason. The next line is '<time> abort Moving it back to <from>.' (OR22), and run aborts by itself. MV-O9's opening words without its tail ('Run carlos move offline status ... for each item'), which read as if the operator had to act. A target's failure says the approved M-C8 instead ('<to> could not start <host>: <reason>. Moving it back to <from>.'). Astra branch review round 1, finding 7.",
+ "status": "pending"
+ },
+ {
+ "id": "OR73",
+ "section": "run lines",
+ "label": "A staging round failed (run abandons the stage)",
+ "text": "The last staging round failed: %s. %s keeps serving and nothing went offline.",
+ "context": "carlos move offline run, on the 'abort' step line, when a staging round reports a failure: run abandons the stage by itself (abort, then finish; exit 3). %s the stager box's own reason, %s the host. MV-O185's opening words without its advice to stage again, with OR23's ending. Replaces OR22 here: the instance never left, so nothing moves back. Astra branch review round 1, finding 7.",
+ "status": "pending"
}
]
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 b2ca9dbf6..b418e5d97 100644
--- a/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
+++ b/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
@@ -820,3 +820,5 @@ Sentences the fixes for Astra's whole-branch review of `offline-move-run` (round
|---|---|---|---|
| OR70 | move_offline_run.go | Stopped. Nothing was sent. | pending |
| OR71 | move_offline_run.go | No status from the console for <duration>. run keeps asking. To see where the move is, run: | pending |
+| OR72 | move_offline_run.go | The move could not finish a step: <reason>. | pending |
+| OR73 | move_offline_run.go | The last staging round failed: <reason>. <host> keeps serving and nothing went offline. | pending |
diff --git a/move_offline_run.go b/move_offline_run.go
index 1ecdb64d9..96c0210a7 100644
--- a/move_offline_run.go
+++ b/move_offline_run.go
@@ -571,11 +571,26 @@ func (rw *runWatcher) sayWhy(reason string) {
case offlinerun.ReasonInterrupted:
// OR28 was said at the Ctrl-C.
case offlinerun.ReasonFailed:
- if !rw.w.sayFailure(v) {
- rw.w.sayStaged(v) // the staging round failed (MV-O185)
+ // What failed, in words that fit what run does next (finding 7 of
+ // the branch review): never MV-O6's, MV-O9's or MV-O185's advice to
+ // run abort or stage, since run is aborting by itself.
+ kind, why, failed := v.failure()
+ c := v.Copying
+ switch {
+ case v.State == provision.OfflineStaging && c != nil && c.Phase == moves.OfflinePhaseFailed:
+ rw.column(offlinerun.VerbAbort)
+ moveSay(rw.out(), fmt.Sprintf("The last staging round failed: %s. %s keeps serving and nothing went offline.", c.Trouble, host))
+ case failed && kind == failTarget:
+ rw.column(offlinerun.VerbAbort)
+ moveSay(rw.out(), moves.MovingBackLine(v.toPlace(), host, why, from))
+ case failed:
+ moveSay(rw.out(), fmt.Sprintf("The move could not finish a step: %s.", why))
+ rw.column(offlinerun.VerbAbort)
+ moveSay(rw.out(), fmt.Sprintf("Moving it back to %s.", from))
+ default:
+ rw.column(offlinerun.VerbAbort)
+ moveSay(rw.out(), fmt.Sprintf("Moving it back to %s.", from))
}
- rw.column(offlinerun.VerbAbort)
- moveSay(rw.out(), fmt.Sprintf("Moving it back to %s.", from))
case offlinerun.ReasonStageRounds:
rw.column("limit")
moveSay(rw.out(), fmt.Sprintf("Stopped staging after %d rounds: each still copied over 1 MB. %s keeps serving and nothing went offline.", p.MaxStageRounds, host))
diff --git a/move_offline_run_test.go b/move_offline_run_test.go
index 34d34c2ea..24daa8b7c 100644
--- a/move_offline_run_test.go
+++ b/move_offline_run_test.go
@@ -30,6 +30,7 @@ type offlineSim struct {
last frame // the outcome once the move ended
failIn string // the state whose box work fails
+ failBy string // the role whose report says it failed: "target" (the default) or "sealer"
stallIn string // a state whose box work waits for a nudge
holdIn string // a state whose box work never ends
drop string // the verb whose reply is lost (once), after it commits
@@ -128,6 +129,10 @@ func (s *offlineSim) view() frame {
extra["failed"] = true
extra["reports"] = []frame{{"box": "uk-box", "role": "target", "phase": "failed", "fresh": true,
"items": frame{"release": frame{"ok": false, "reason": "the release did not unpack"}}}}
+ if s.failBy == "sealer" {
+ extra["reports"] = []frame{{"box": "ie-box", "role": "sealer", "phase": "failed", "fresh": true,
+ "items": frame{"files": frame{"ok": false, "reason": "special file in the archive"}}}}
+ }
delete(extra, "next")
}
if s.never {
@@ -423,21 +428,45 @@ func TestMoveOfflineRunDroppedSealReply(t *testing.T) {
}
}
+// A box that fails before open: run aborts, follows the move back and
+// exits 3. What it says of the failure fits what it does next (finding 7
+// of the branch review): never a sentence that tells the operator to run
+// abort or stage again, since run is doing it. A target's failure is M-C8
+// (it moves back), a sealer's OR72 then OR22, a staging round's OR73.
func TestMoveOfflineRunFailureBeforeOpenAborts(t *testing.T) {
- for _, state := range []string{"offline-staging", "offline-stopping", "offline-sealing", "offline-sealed", "offline-landing", "offline-landed"} {
- t.Run(state, func(t *testing.T) {
- c := &fakeOfflineConsole{sim: &offlineSim{failIn: state}}
- code, out := runOfflineRun(t, c, runSeams{}, "--to", "uk")
+ const landing = " abort uk could not start acme.shop.example.com: the release did not unpack. Moving it back to ie.\n"
+ for _, c := range []struct {
+ state, by string
+ say []string
+ }{
+ {"offline-staging", "", []string{" abort The last staging round failed: the staging bucket refused a write. acme.shop.example.com keeps serving and nothing went offline.\n"}},
+ {"offline-stopping", "", []string{landing}},
+ {"offline-sealing", "", []string{landing}},
+ {"offline-sealed", "", []string{landing}},
+ {"offline-landing", "", []string{landing}},
+ {"offline-landed", "", []string{landing}},
+ {"offline-sealing", "sealer", []string{"\nThe move could not finish a step: special file in the archive.\n", " abort Moving it back to ie.\n"}},
+ } {
+ t.Run(c.state+" "+c.by, func(t *testing.T) {
+ f := &fakeOfflineConsole{sim: &offlineSim{failIn: c.state, failBy: c.by}}
+ code, out := runOfflineRun(t, f, runSeams{}, "--to", "uk")
if code != 3 {
t.Fatalf("exit %d:\n%s", code, out)
}
- got := doorsOf(c.postsSent())
+ got := doorsOf(f.postsSent())
if !strings.HasSuffix(got, ",abort,finish") || strings.Contains(got, "open") {
t.Fatalf("doors %s:\n%s", got, out)
}
wantLines(t, out, orBack)
- if !strings.Contains(out, " abort Moving it back to ie.\n") {
- t.Errorf("no abort reason line:\n%s", out)
+ for _, say := range c.say {
+ if !strings.Contains(out, say) {
+ t.Errorf("no %q:\n%s", say, out)
+ }
+ }
+ for _, advice := range []string{"Run carlos move offline abort", "Run carlos move offline stage", "for each item"} {
+ if strings.Contains(out, advice) {
+ t.Errorf("run said %q while it aborts by itself:\n%s", advice, out)
+ }
}
})
}
diff --git a/offline_move_e2e_test.go b/offline_move_e2e_test.go
index d0a673708..a0bec96e0 100644
--- a/offline_move_e2e_test.go
+++ b/offline_move_e2e_test.go
@@ -740,7 +740,7 @@ func TestMoveOfflineRunAgainstTheRealDoors(t *testing.T) {
}{
{provision.OfflineStaging, "", []string{"stage", "abort", "finish"}},
{provision.OfflineSealing, "", []string{"stage", "start", "seal", "abort", "finish"}},
- {provision.OfflineLanding, "uk could not take " + "acme.shop.example.com" + ": the app settings differ.", []string{"stage", "start", "seal", "flip", "abort", "finish"}},
+ {provision.OfflineLanding, " abort uk could not start " + "acme.shop.example.com" + ": the app settings differ. Moving it back to ie.", []string{"stage", "start", "seal", "flip", "abort", "finish"}},
} {
t.Run("a box fails in "+c.state, func(t *testing.T) {
e := newOfflineE2E(t, []string{"region-ha-1", "offline-move-1", "offline-stage-1"})
@@ -766,9 +766,12 @@ func TestMoveOfflineRunAgainstTheRealDoors(t *testing.T) {
t.Fatalf("POSTs %q, want %q\n%s", *posts, want, out)
}
wantLines(t, out, e.host+" is back in ie and serving. Nothing was lost.")
- if c.state != provision.OfflineStaging {
+ if c.state == provision.OfflineSealing {
wantLines(t, out, " abort Moving it back to ie.")
}
+ if strings.Contains(out, "Run carlos move offline abort") || strings.Contains(out, "Run carlos move offline stage") {
+ t.Fatalf("run told the operator to do what it does itself:\n%s", out)
+ }
if c.said != "" && !strings.Contains(out, c.said) {
t.Fatalf("the box's reason is not said:\n%s", out)
}