Skip to content

test(cotal): pin resume role refusal for spawn grant bound (RIG-11871) - #246

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
cotal-auth/rig-11871-pin-resume-role-refusal-for-spawn-grant
Open

rigel-mintaka wants to merge 2 commits into
mainfrom
cotal-auth/rig-11871-pin-resume-role-refusal-for-spawn-grant

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What does this do

Adds two cases to the Cotal manager's spawn-grant-bound smoke:

  • A spawner without role:worker that --resumes a worker seat gets the same SPEC 13.15 grant refusal as a new spawn.
  • A spawner holding role:worker passes the grant bound with a resume. The fake connector does not fork a real session, so this is not proof of a full relaunch.

The smoke's fake connector now declares supportsResume. No production code changes.

Why do we need it

RIG-11871: foreman cannot relaunch a despawned seat, because its credential lacks worker. How to fix that is open in RIG-12345 (A: resume-only grant, B: route via the supervisor holder, C: the seat's systemd unit). This test pins today's behavior, which all three options start from. If option A lands, it flips the first case.

Summary

  • Finding: Manager.spawnBoundRefusal receives the grant but not the resume option. It cannot tell a resume from a new spawn today, so option A needs that plumbing.
  • Step-up: the first implement-ts run took 10 minutes and added no test (provider stream errors). The slice moved to implement-hard-ts.

Verification

Run on macpro2013 from an archive of the cotal rigel-release commit with this change. The file is byte-identical in nebula forks/cotal.

nix shell nixpkgs#nats-server -c nix develop -c pnpm smoke:spawn-grant-bound
  ✓ resuming a worker without its role is refused with the same grant error
  ✓ a spawner holding role:worker passes the grant bound with a resume
SPAWN-GRANT-BOUND SMOKE 41 passed, 0 failed

Risks

Test-only. The resume case compares its error to the new-spawn refusal instead of pinning the message text.

Spec-impact: none

Checks skipped: nebula has no pre-push hook config; GitHub Actions ci.yaml runs its checks

Refs RIG-11871

Co-authored-by: Matt Wilkinson matt@rigel.build

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

RIG-11871

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review round 1 (head a661f17)

0 high, 0 medium, 2 low. Both fixed in 3128ad0.

  • L1 (low): the resume control's label claimed a real resume, but the fake connector forks no session. Relabeled to "passes the grant bound with a resume"; the PR body says so.
  • L2 (low): the resume case pinned the full refusal text. It now compares to the new-spawn refusal error (r.error).

Smoke at 3128ad0 on macpro2013: SPAWN-GRANT-BOUND SMOKE 41 passed, 0 failed, including both resume cases.

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

All-clear at 3128ad0
Base: main

This branch had an error being deployed

1 failed deployment
ci — 3128ad02 Deployed Nov 23, 2026 by rigel-mintaka via CI (aarch64-darwin) #1173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant