group verb: ask a cut post-revoke status read once more (#1255)
On the v0.39.0 flagship window (US move 2) the status session that proves a revoke timed out at its 15 s bound. The 74 other post-revoke reads in the journals took 0.6 to 2.6 s. The verb refused with the transaction open; one resume closed it. The SSM record shows the session alive until our TerminateSession and no output logged, so the cause, a slow box or a stalled stream, cannot be split from here. The box side is bounded at about 8 s (agent status 5 s, two 1 s systemctl reads, 1 s health). revokeReadBack asks that read once more when it is Uncertain, in finish_return and in rollback's revoke of a remaining apply permit. Status writes nothing on the box; the first session's error and its terminate stay journaled. A Refusal or a second Uncertain stops as before. Other box sessions stay single-attempt. Spec V21. Tests: one cut read finishes the roll; two stop it with the transaction open and a resume closes it without a second revoke; the rollback path's read is retried. Census: internal/grouproll envelope re-pinned (census-proposal-group-revoke-readback-1255).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 files changed,
+160
−2
docs/superpowers/notes/census-proposal-group-revoke-readback-1255.md+11 −0docs/superpowers/specs/2026-11-09-group-roll-verb-design.md+1 −0internal/grouproll/roll.go+17 −2internal/grouproll/roll_test.go+127 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-group-revoke-readback-1255.tsv+3 −0
diff --git a/docs/superpowers/notes/census-proposal-group-revoke-readback-1255.md b/docs/superpowers/notes/census-proposal-group-revoke-readback-1255.md| new file mode 100644 |
| index 000000000..2569fc6d8 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-group-revoke-readback-1255.md |
| @@ -0,0 +1,11 @@ |
| +# Census approval: group-revoke-readback-1255 |
| + |
| +Ruling `census-ruling-group-revoke-readback-1255`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +Envelopes re-pinned: `internal/grouproll`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Seal: `f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6` → `f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-group-revoke-readback-1255.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md b/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md| index 649057ab9..8038ac9ac 100644 |
| --- a/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md |
| +++ b/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md |
| @@ -381,6 +381,7 @@ build to it. |
| | V18 | A request that gets no response is one failed call | A read whose request got no response at all (the SDK's RequestSendError: a reset or EOF on a reused connection, no call in CloudTrail) is retried as a throttle is (V17's budget); a timeout is not, and stays one bound. A failure to get credentials (AssumeRole, SSO), throttled or unanswered, is never retried, so no credential call repeats. Writes and sessions are never retried | G5 release 1, dev, 2026-11-11: the post-prepare group describe failed in 14 ms with no CloudTrail call; resume closed it (8a3d302) | |
| | V19 | The provider observation names one launch template version; any other pinned version refuses `observation` | The observation carries across a re-pin that changes only user data (§7.1). A launch template version other than the observation's, with the same template id and name, is accepted when the two versions' launch template data are identical once UserData is removed; anything else refuses `observation` as before | G5 release 1, 2026-11-11: every release's re-pin left the next roll needing a pin-back (Paul approved option b, 11-11) | |
| | V20 | close-lost reads the group and EC2 only | After the group and EC2 checks, close-lost lists `control/edges/` once (journaled, like the floor's listing; a failure refuses and leaves the transaction open). If the member's edges record is still listed it records `edges_published: true` and says so, naming the record. It never deletes it: the boxes' termination recovery retires it once every host naming the member is settled, and a drain does not wait for a member whose departure the box has enrolled | #1192, dev IE 2026-11-17: a member closed with close-lost kept its edges record (its departure was held by a trashed app's host) and the next drain failed waiting on it (8a3d302: report, never delete) | |
| +| V21 | The status read after a revoke (finish_return, and rollback's revoke of a remaining apply permit) is one session; an Uncertain read stops the verb with the transaction open | That read alone is asked once more when it is Uncertain (a session cut at its 15 s bound, a plugin that did not run): status writes nothing on the box, the first session's error and its terminate are journaled, and the revoke already answered. A Refusal, or a second Uncertain, stops the verb as before; resume reads it again. Other box sessions stay single-attempt (V17) | Flagship v0.39.0 window 2026-11-19, US move 2 (#1255): one post-revoke status session timed out at 15 s, where 74 others took 0.6 to 2.6 s; the verb refused and one resume closed the move | |
| Not deviations, recorded so nobody "fixes" them in the port: the drain-rerun |
| backoff and the TakeHost `wake_timeout` follow-ups from the held build stay |
diff --git a/internal/grouproll/roll.go b/internal/grouproll/roll.go| index 919476501..1fa66c746 100644 |
| --- a/internal/grouproll/roll.go |
| +++ b/internal/grouproll/roll.go |
| @@ -1019,7 +1019,7 @@ func (e *Engine) mutation(ctx context.Context) error { |
| if _, err := e.box(ctx, iid, "revoke", BoxArgs{}); err != nil { |
| return err |
| } |
| - if s, err = e.status(ctx, iid); err != nil { |
| + if s, err = e.revokeReadBack(ctx, iid); err != nil { |
| return err |
| } |
| p, _ = s["permit"].(map[string]any) |
| @@ -1475,7 +1475,7 @@ func (e *Engine) finishReturn(ctx context.Context, ready *readiness) error { |
| if _, err := e.box(ctx, iid, "revoke", BoxArgs{}); err != nil { |
| return err |
| } |
| - s, err := e.status(ctx, iid) |
| + s, err := e.revokeReadBack(ctx, iid) |
| if err != nil { |
| return err |
| } |
| @@ -1521,6 +1521,21 @@ func (e *Engine) finishReturn(ctx context.Context, ready *readiness) error { |
| return nil |
| } |
| +// revokeReadBack is the status read that proves a revoke (V21, #1255). A |
| +// read that is Uncertain (a session cut at its bound, a plugin that did |
| +// not run) is asked once more: status writes nothing on the box, the |
| +// first session's error and its terminate are journaled, and the revoke |
| +// already answered. Any other failure, and a second Uncertain, stops the |
| +// verb with the transaction open, as before; resume reads it again. |
| +func (e *Engine) revokeReadBack(ctx context.Context, iid string) (map[string]any, error) { |
| + s, err := e.status(ctx, iid) |
| + var u Uncertain |
| + if err == nil || !errors.As(err, &u) || ctx.Err() != nil { |
| + return s, err |
| + } |
| + return e.status(ctx, iid) |
| +} |
| + |
| // abandon is the script's Operator.abandon. Prepare sessions may stage an |
| // artifact but change neither the group nor a running binary; any other |
| // write intent, even an unsent one, blocks closure. |
diff --git a/internal/grouproll/roll_test.go b/internal/grouproll/roll_test.go| index 1b2c05814..a214eec7a 100644 |
| --- a/internal/grouproll/roll_test.go |
| +++ b/internal/grouproll/roll_test.go |
| @@ -2311,3 +2311,130 @@ func TestRollMutationVerifiesConsumedAction(t *testing.T) { |
| t.Fatal("consumed action not verified") |
| } |
| } |
| + |
| +// #1255 (V21): the status read that proves a revoke is asked once more |
| +// when it is Uncertain. One cut read: the roll finishes. Two: the verb |
| +// stops with the transaction open, as before, and a resume closes it. |
| +func TestRollRevokeReadBackIsAskedOnceMore(t *testing.T) { |
| + for _, c := range []struct { |
| + name string |
| + cuts int |
| + }{{"one cut read finishes", 1}, {"two cut reads stop", 2}} { |
| + t.Run(c.name, func(t *testing.T) { |
| + h := newHarness(t, 2) |
| + h.f.sessions = func(iid, verb string) []string { |
| + if verb == "status" { |
| + return []string{"status-session"} |
| + } |
| + return nil |
| + } |
| + revoked, cut, afterRevoke := false, 0, 0 |
| + h.f.wrap = func(op string, args map[string]any, r any, err error) (any, error) { |
| + if op != "session" || err != nil { |
| + return r, err |
| + } |
| + switch args["verb"] { |
| + case "revoke": |
| + revoked = true |
| + case "status": |
| + if revoked { |
| + afterRevoke++ |
| + if cut < c.cuts { |
| + cut++ |
| + return nil, Uncertain{Key: "remote", Timeout: true} |
| + } |
| + } |
| + } |
| + return r, err |
| + } |
| + err := h.runRoll() |
| + tx := h.onlyTx() |
| + j := h.txJournal(tx) |
| + errs := 0 |
| + for _, row := range j.Rows() { |
| + if row["kind"] == "error" && row["op"] == "session" { |
| + errs++ |
| + } |
| + } |
| + if errs != c.cuts { |
| + t.Fatalf("%d session error rows, want %d", errs, c.cuts) |
| + } |
| + if n := countOf(h.f.ops(), "terminate_session"); n != c.cuts { |
| + t.Fatalf("%d terminate_session calls, want %d: %v", n, c.cuts, h.f.ops()) |
| + } |
| + if c.cuts == 1 { |
| + if err != nil { |
| + t.Fatalf("roll = %v", err) |
| + } |
| + if afterRevoke != 2 { |
| + t.Fatalf("%d status reads after the revoke, want 2", afterRevoke) |
| + } |
| + if done, ok := j.Last("done", nil); !ok || done["outcome"] != "returned" { |
| + t.Fatalf("done row %v", done) |
| + } |
| + if h.activeTx() != "" { |
| + t.Fatal("the transaction is still open") |
| + } |
| + mustRetain(t, h) |
| + return |
| + } |
| + if !isUncertain(err) { |
| + t.Fatalf("roll = %v, want Uncertain", err) |
| + } |
| + if afterRevoke != 2 { |
| + t.Fatalf("%d status reads after the revoke, want 2 (no third)", afterRevoke) |
| + } |
| + if _, ok := j.Last("done", nil); ok { |
| + t.Fatal("the transaction closed on two cut reads") |
| + } |
| + if h.activeTx() != tx { |
| + t.Fatal("the transaction is not left open") |
| + } |
| + revokes := countOf(h.f.writes, "revoke") |
| + if err := h.resume(); err != nil { |
| + t.Fatalf("resume = %v", err) |
| + } |
| + if countOf(h.f.writes, "revoke") != revokes { |
| + t.Fatal("the resume revoked again") |
| + } |
| + if h.activeTx() != "" { |
| + t.Fatal("the resume left the transaction open") |
| + } |
| + mustRetain(t, h) |
| + }) |
| + } |
| +} |
| + |
| +// #1255 (V21): rollback's revoke of a remaining apply permit is proven by |
| +// the same read, asked once more when it is cut. |
| +func TestRollRollbackRevokeReadBackIsAskedOnceMore(t *testing.T) { |
| + h := newHarness(t, 2) |
| + h.pauseAfterApply() |
| + h.f.fault = "" |
| + revoked, cut := false, false |
| + h.f.wrap = func(op string, args map[string]any, r any, err error) (any, error) { |
| + if op != "session" || err != nil { |
| + return r, err |
| + } |
| + switch args["verb"] { |
| + case "revoke": |
| + revoked = true |
| + case "status": |
| + if revoked && !cut { |
| + cut = true |
| + return nil, Uncertain{Key: "remote", Timeout: true} |
| + } |
| + } |
| + return r, err |
| + } |
| + if err := h.rollbackMember(); err != nil { |
| + t.Fatalf("rollback: %v\n%s", err, h.out.String()) |
| + } |
| + if !cut { |
| + t.Fatal("no read after the revoke was cut") |
| + } |
| + if got := h.f.writes[5:9]; !reflect.DeepEqual(got, []string{"revoke", "permit", "rollback", "exit"}) { |
| + t.Fatalf("writes %v", h.f.writes) |
| + } |
| + mustRetain(t, h) |
| +} |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index d6b71e9a3..cdfaef7aa 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -274,3 +274,4 @@ plan14-root-reads-media-spike-fixes.tsv 194e88ad9cd7413c93b1181c0ac1e962107039ad |
| plan14-root-reads-media-spike-values.tsv 194e88ad9cd7413c93b1181c0ac1e962107039ad84525e065893a8c14cdb3138 |
| plan14-root-reads-path-routes-across-boxes.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6 |
| plan14-root-reads-headers-security-allowlist.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6 |
| +plan14-root-reads-group-revoke-readback-1255.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6 |
diff --git a/internal/provision/testdata/plan14-root-reads-group-revoke-readback-1255.tsv b/internal/provision/testdata/plan14-root-reads-group-revoke-readback-1255.tsv| new file mode 100644 |
| index 000000000..d13b87279 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-group-revoke-readback-1255.tsv |
| @@ -0,0 +1,3 @@ |
| +# Census overlay group-revoke-readback-1255, written by census-propose (#369). census-ruling-group-revoke-readback-1255, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-group-revoke-readback-1255.md. |
| +# 0 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@coverage internal/grouproll 5320f12228e6c716b3b79c6c34c33966288e4982beb05ce78d8d7841ead3b5b0 |