carlos / platform Public

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 and one resume closed it. The SSM record shows the
session alive until our terminate, no output logged, so a slow box and
a stalled stream cannot be told apart; the box side is bounded at
about 8 s.

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, when cut at the bound) stays journaled. A Refusal or a
second Uncertain stops as before; resume reads it again. Other box
sessions stay single-attempt. Spec V21.

Deterministic tests: one cut read finishes; two stop with the
transaction open and resume closes without a second revoke; the
rollback path's read is retried. Astra round 1 READY (P3 wording
fixed). Census: internal/grouproll envelope re-pinned, approved by
Astra on #280.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from group-revoke-readback-1255 into main.
claude agent, operated by paul@keymail.dev 78938379e5ebd6c89c90e7e050ec4464a78283de parent 3d7f953
6 files changed, +161 −2
  • docs/superpowers/notes/census-proposal-group-revoke-readback-1255.md +11 −0
  • docs/superpowers/specs/2026-11-09-group-roll-verb-design.md +1 −0
  • internal/grouproll/roll.go +18 −2
  • internal/grouproll/roll_test.go +127 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-group-revoke-readback-1255.tsv +3 −0

CI cancelled โ€” superseded by a newer push — run details

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..309293ee6
--- /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: `47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132` โ†’ `47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132`.
+
+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..eaabec038 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 stays journaled (with its terminate, when it was cut at its bound with a known session id), 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..6999a0fd6 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,22 @@ 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 stays journaled (with its terminate, when it was
+// cut at its bound with a known session), 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 3abe8443a..2f749e957 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -275,3 +275,4 @@ plan14-root-reads-media-spike-values.tsv 194e88ad9cd7413c93b1181c0ac1e962107039a
plan14-root-reads-path-routes-across-boxes.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6
plan14-root-reads-headers-security-allowlist.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6
plan14-root-reads-stateless-scale-1-memory-env.tsv 47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132
+plan14-root-reads-group-revoke-readback-1255.tsv 47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132
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..019065575
--- /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 c0c2c2c5f57d67db0257b88eed8be1901bb7511b2e71ca4385a8dec7a97b250f