carlos / platform Public

host: revert the revert-anywhere change (#413, Paul's cut)

Reverts e2e54f66. Its fixes check found a P1 (a box that never held
the row could park same-named paths on an old report alone), the second
round in the "who may undo a move" family. Paul chose to refuse the case
up front instead (#1005): the runbook says not to change a target box's
CARLOS_POOLS while an offline move holds it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev e18f4f3cfcc5f89a386123e92eb7e276cf8ae951 parent dad923b
5 files changed, +7 −75
  • docs/superpowers/notes/census-proposal-offline-move-pool-target-413.md +2 −2
  • internal/host/movesoffline.go +1 −10
  • internal/host/movesoffline_e2e_test.go +0 −59
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-offline-move-pool-target-413.tsv +3 −3

Intent

Human

<task-notification> <task-id>b0t0vymbu</task-id> <tool-use-id>toolu_017CjYXtc8w13fyBsY6yuQYS</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/96a09f74-e398-48ed-a97f-140bd1f7e255/tasks/b0t0vymbu.output</output-file> <status>completed</status> <summary>Background command "Wait for #339 CI" completed (exit code 0)</summary> </task-notification>

diff --git a/docs/superpowers/notes/census-proposal-offline-move-pool-target-413.md b/docs/superpowers/notes/census-proposal-offline-move-pool-target-413.md
index e4f74e70e..fc46da2d2 100644
--- a/docs/superpowers/notes/census-proposal-offline-move-pool-target-413.md
+++ b/docs/superpowers/notes/census-proposal-offline-move-pool-target-413.md
@@ -4,7 +4,7 @@ Ruling `census-ruling-offline-move-pool-target-413`. The independent reviewer ap
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/host/movespass.go` `armOffline` | body | unchanged (1) | sets moveCfg.OfflinePools from CARLOS_POOLS through provision.ParseBoxPools (an env string the agent already reads for reconcile; no file read), so offlineTargetHere keeps a box whose pools do not admit the record out of the offline landing and open (amadan #413); no read added |
+| `internal/host/movespass.go` `armOffline` | body | unchanged (1) | sets moveCfg.OfflinePools from CARLOS_POOLS through provision.ParseBoxPools (an env string the agent already reads for reconcile; no file read), so offlineTargetHere keeps a box whose pools do not admit the record out of the offline target role (amadan #413); no read added |
Envelopes re-pinned: `internal/host`.
@@ -14,6 +14,6 @@ Recorded dispositions, which each change must still satisfy:
- `internal/host/movespass.go` `armOffline`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=root-route (J1, as main's moves units); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census-ruling-moves-offline's body, which also arms moveCfg.ReleaseHoldSeq (releaseHeldSeq over the registry, touching the stage-requested marker after a release that landed); closes over the registry and reads nothing itself; self-serve moves 1 Task 7
-Seal: `3f43afa4b0c18ad678a952b48b511e74e849992cd629b9aa1442bbe0055d5631` → `56acafa04ef8540fa9a50c1bed6242fbb5152fc9b45943da6a9b6ac5ccdacb6e`.
+Seal: `3f43afa4b0c18ad678a952b48b511e74e849992cd629b9aa1442bbe0055d5631` → `022a33f457a0684b499f118b8d475bd4aa3c0f04395727c3e8c090863daaff89`.
Overlay: `internal/provision/testdata/plan14-root-reads-offline-move-pool-target-413.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/movesoffline.go b/internal/host/movesoffline.go
index 6a82cb4bc..28e01b56d 100644
--- a/internal/host/movesoffline.go
+++ b/internal/host/movesoffline.go
@@ -421,8 +421,7 @@ func (w *movesWorker) offlineRound(ctx context.Context, s release.Store, rec pro
}
here := cfg.parkRegion()
source := here != "" && regionname.PlacementMatches(cfg.ParkHomeRegion, m.From, here)
- target := here != "" && regionname.PlacementMatches(cfg.ParkHomeRegion, m.To, here) &&
- (m.State == provision.OfflineReverting || cfg.offlineTargetHere(rec))
+ target := here != "" && regionname.PlacementMatches(cfg.ParkHomeRegion, m.To, here) && cfg.offlineTargetHere(rec)
sealer := cfg.Box != "" && cfg.Box == m.Sealer
if !cfg.OfflineCapable {
if source || target || sealer {
@@ -457,14 +456,6 @@ func (w *movesWorker) offlineRound(ctx context.Context, s release.Store, rec pro
// target report and lands nothing. The console counts a target report only
// from a box its edges file says can hold the row, so this is the box's own
// half of the same rule, and it reads nothing from the record but the pool.
-//
-// It gates the landing and the open only, never the revert (Astra round 2):
-// a box that landed this move and then lost the pool (a restart with other
-// CARLOS_POOLS) still holds the row and the files it extracted, and only
-// offlineTargetRevert parks them and deletes the row. The revert's own
-// checks (the row held by this move, or this box's own report for it)
-// decide whether a box has anything to put back; one that never took part
-// does nothing.
func (c moveCfg) offlineTargetHere(rec provision.Record) bool {
return c.OfflinePools.Serves(rec.Pool)
}
diff --git a/internal/host/movesoffline_e2e_test.go b/internal/host/movesoffline_e2e_test.go
index 709336744..edd1f6b9b 100644
--- a/internal/host/movesoffline_e2e_test.go
+++ b/internal/host/movesoffline_e2e_test.go
@@ -1108,9 +1108,6 @@ func TestOfflineMoveE2E(t *testing.T) {
// produced it.
t.Run("done, through a lifetime", func(t *testing.T) { offlineMoveDone(t, landOpts{lifetime: true}) })
t.Run("aborted from landed, through a lifetime", offlineMoveAbortedFromLanded)
- // Astra round 2 on amadan #413: the target landed, then restarted
- // serving only a named pool; the abort still puts back what it landed.
- t.Run("aborted after the target left the shared pool", offlineMoveAbortedAfterThePoolChanged)
t.Run("a release skips a record that moved on", offlineReleaseSkipsAMovedRecord)
// Task 7 fix round 1: a claims-on box (no judge) releases through
// today's ReleaseHold, whatever incarnation its held rows carry.
@@ -1683,62 +1680,6 @@ func offlineMoveAbortedFromLanded(t *testing.T) {
}
}
-// The target lands (files, env, config, a held row with its timers), then
-// restarts with CARLOS_POOLS=cohort1, so its pools no longer admit the
-// record. The abort runs through the production dispatch (the boxes' ticks:
-// reconcile, the edges file, movesPass): the target still parks what it
-// extracted and deletes its held row and timers before the move clears.
-// Pool admission gates a landing, never the revert of one.
-func offlineMoveAbortedAfterThePoolChanged(t *testing.T) {
- w := newE2EWorld(t, landOpts{})
- w.begin()
- w.seal()
- w.flipAndLand()
- uk := w.uk
- if rt := uk.row(offHost); rt == nil || rt.HoldOp != w.id {
- t.Fatalf("fixture: uk-box's row %+v, want held by the move", rt)
- }
- if tm, err := uk.reg.TimersFor(offHost); err != nil || len(tm) == 0 {
- t.Fatalf("fixture: uk-box landed no timers (%v)", err)
- }
- for _, name := range []string{offHost + ".env", offHost + ".config.env"} {
- if !lexists(filepath.Join(uk.dd, name)) {
- t.Fatalf("fixture: uk-box did not land %s", name)
- }
- }
-
- uk.env["CARLOS_POOLS"] = "cohort1"
- w.restart()
- if uk.w.cfg.offlineTargetHere(w.wd.record()) {
- t.Fatal("fixture: uk-box's pools still admit the record after the restart")
- }
-
- w.accept("abort", "", provision.OfflineReverting)
- w.until("the revert", nextIs("finish"))
- if r := w.wd.reportFor(w.id, moves.OfflineRoleTarget, "uk-box"); r.Phase != moves.OfflinePhaseReverted {
- t.Fatalf("uk-box's report is %s before finish, want reverted", r.Phase)
- }
- w.finish("aborted")
- w.tickAll()
- if rt := uk.row(offHost); rt != nil {
- t.Fatalf("uk-box has a row after the abort: %+v", rt)
- }
- if tm, err := uk.reg.TimersFor(offHost); err != nil || len(tm) != 0 {
- t.Fatalf("uk-box keeps timers %v after the abort (%v)", tm, err)
- }
- for _, name := range []string{offHost, offHost + ".env", offHost + ".config.env"} {
- if lexists(filepath.Join(uk.dd, name)) {
- t.Errorf("uk-box keeps %s in place after the abort", name)
- }
- }
- parked := w.parkedTarget()
- for _, name := range []string{offHost + ".env", offHost + ".config.env"} {
- if !parked[name] {
- t.Errorf("uk-box parked %v, want %s among them", parked, name)
- }
- }
-}
-
// The target's open releases from the record it observes under the locks,
// through armOffline's releaser: a record that moved on between the pass's
// listing and the release is not released for, and the row stays held.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 8ca8aed10..1e432b26a 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -208,4 +208,4 @@ plan14-root-reads-instance-gomemlimit-991.tsv 19c9f395547d998f4b5e87e89c0dfa3b5f
plan14-root-reads-ppv2-operator-copy.tsv 19c9f395547d998f4b5e87e89c0dfa3b5f012d177a87eb5010a8c4defac305dc
plan14-root-reads-same-box-edge-fence.tsv 76c986ad534d23071100a9a573ffb38afc60b26c8942baf218436bf6a3ff03b3
plan14-root-reads-g6-fence.tsv 3f43afa4b0c18ad678a952b48b511e74e849992cd629b9aa1442bbe0055d5631
-plan14-root-reads-offline-move-pool-target-413.tsv 56acafa04ef8540fa9a50c1bed6242fbb5152fc9b45943da6a9b6ac5ccdacb6e
+plan14-root-reads-offline-move-pool-target-413.tsv 022a33f457a0684b499f118b8d475bd4aa3c0f04395727c3e8c090863daaff89
diff --git a/internal/provision/testdata/plan14-root-reads-offline-move-pool-target-413.tsv b/internal/provision/testdata/plan14-root-reads-offline-move-pool-target-413.tsv
index 431922add..7d475494f 100644
--- a/internal/provision/testdata/plan14-root-reads-offline-move-pool-target-413.tsv
+++ b/internal/provision/testdata/plan14-root-reads-offline-move-pool-target-413.tsv
@@ -1,5 +1,5 @@
# Census overlay offline-move-pool-target-413, written by census-propose (#369). census-ruling-offline-move-pool-target-413, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-offline-move-pool-target-413.md.
# 1 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-@legacy 93f2459d88690caf745e04221a00d94b6a617bc793de2229f658091adc823ba7 internal/host/movespass.go armOffline legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=root-route (J1, as main's moves units); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census-ruling-moves-offline's body, which also arms moveCfg.ReleaseHoldSeq (releaseHeldSeq over the registry, touching the stage-requested marker after a release that landed); closes over the registry and reads nothing itself; self-serve moves 1 Task 7;rev3=census-ruling-offline-move-pool-target-413;basis=sets moveCfg.OfflinePools from CARLOS_POOLS through provision.ParseBoxPools (an env string the agent already reads for reconcile; no file read), so offlineTargetHere keeps a box whose pools do not admit the record out of the offline landing and open (amadan #413); no read added whole:Route@2258 9a021c1f9794e1e55b785db0117059bb5e1d0775286d914ce155b7eb01b259dd
-internal/host/movespass.go armOffline legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=root-route (J1, as main's moves units); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census-ruling-moves-offline's body, which also arms moveCfg.ReleaseHoldSeq (releaseHeldSeq over the registry, touching the stage-requested marker after a release that landed); closes over the registry and reads nothing itself; self-serve moves 1 Task 7;rev3=census-ruling-offline-move-pool-target-413;basis=sets moveCfg.OfflinePools from CARLOS_POOLS through provision.ParseBoxPools (an env string the agent already reads for reconcile; no file read), so offlineTargetHere keeps a box whose pools do not admit the record out of the offline landing and open (amadan #413); no read added whole:Route@2258 9a021c1f9794e1e55b785db0117059bb5e1d0775286d914ce155b7eb01b259dd
-@coverage internal/host e170581a8a2a548d858fbc33ada4c11aa71456184dae1f3da266714f42c1c439
+@legacy 1c7bd4ba117b1b09a161422e9344a24460fddd7418477fdca993d513254791b3 internal/host/movespass.go armOffline legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=root-route (J1, as main's moves units); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census-ruling-moves-offline's body, which also arms moveCfg.ReleaseHoldSeq (releaseHeldSeq over the registry, touching the stage-requested marker after a release that landed); closes over the registry and reads nothing itself; self-serve moves 1 Task 7;rev3=census-ruling-offline-move-pool-target-413;basis=sets moveCfg.OfflinePools from CARLOS_POOLS through provision.ParseBoxPools (an env string the agent already reads for reconcile; no file read), so offlineTargetHere keeps a box whose pools do not admit the record out of the offline target role (amadan #413); no read added whole:Route@2258 9a021c1f9794e1e55b785db0117059bb5e1d0775286d914ce155b7eb01b259dd
+internal/host/movespass.go armOffline legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=root-route (J1, as main's moves units); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): census-ruling-moves-offline's body, which also arms moveCfg.ReleaseHoldSeq (releaseHeldSeq over the registry, touching the stage-requested marker after a release that landed); closes over the registry and reads nothing itself; self-serve moves 1 Task 7;rev3=census-ruling-offline-move-pool-target-413;basis=sets moveCfg.OfflinePools from CARLOS_POOLS through provision.ParseBoxPools (an env string the agent already reads for reconcile; no file read), so offlineTargetHere keeps a box whose pools do not admit the record out of the offline target role (amadan #413); no read added whole:Route@2258 9a021c1f9794e1e55b785db0117059bb5e1d0775286d914ce155b7eb01b259dd
+@coverage internal/host d61aeb158451d6f59b0f702c4fc36304a79fe83473a2dbced957542ef7deece6