Skip to content

fix(ci): end a check-mode kill-switch refusal as a stop, not a failure - #12759

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/kill-switch-check-neutral
Nov 3, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/kill-switch-check-neutral

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

No related issue: ledger L94. A check-mode kill-switch refusal ended every lane run red. 28 of 29 failed work-resolve-issue runs around the 2026-11-03 04:34Z trip were this designed stop (e.g. run 41576258964: lane-check-denied: the broker answered 403 with reason kill-switch), which inflated every raw failure view.

Summary

When the broker refuses a check-mode ask with kill-switch, broker-check now ends green as a stop. Every write and model step is still skipped, so the change is to the run's colour and nothing else. Every other denial still fails red, and nothing changes while the switch is off.

Fix

  • .github/actions/request-lane-token/action.yml (+ README):
    • kill-switch-ok is now valid in check mode. A 403 kill-switch exits 0 with ::notice::lane-check-stopped, and skip-reason=kill-switch.
    • A new allowed output is true only on a real allow, so a green stop never reads as an allow.
    • The guard that refused this was [[ $KILL_SWITCH_OK == false || $MODE == token ]] || fail "kill-switch-ok needs token mode".
  • .github/workflows/pr-run-activity-read.yml:
    • broker-check passes kill-switch-ok: true and exposes skip-reason. allowed now also needs the step's allowed == 'true'.
    • The lease step needs an allow. The run job's if: adds skip-reason == '', which skips run, issue-fields, scan, scan-refusal, summary and broker-allowed.
    • A pull_request-run stop posts the check as neutral Skipped: kill-switch, and the lane report comment is not posted.
  • .github/scripts/work-unblock/label-unblocked.mjs still counts the green stop as a check-stage breaker trip (broker step success + lease step skipped + the lane-check-stopped notice in the broker.request log section), so work-unblock re-fires those issues as before.
  • docs/conventions/pr-pipeline/pr-run-activity.md: the contract text is updated to match. A changelog fragment is added.

Verification

  • request-lane-token.test.mjs:
    • check + kill-switch + kill-switch-ok exits 0 with the stop output;
    • another reason (403 workflow-modified, 500 kill-switch) still fails;
    • without kill-switch-ok it still fails red with run 41576258964's text;
    • an allow sets allowed=true.
  • callers.test.mjs walks the workflow YAML in needs order, evaluating each if:. On a stop (PR and issue mode), allowed is false, every job and step listed above skips, the head step outputs not-run-reason=kill-switch, and decide() returns neutral. Controls: an allow runs everything. No caller job with a write grant runs on a stop, except the jobs named below. Removing each new guard in turn failed these tests.
  • label-unblocked.test.mjs: a green stop is a trip and is re-fired. A lookalike or missing notice is a failed mint. An allow reads no log.
  • node --test over callers, request-lane-token, label-unblocked and decide: 674/674. scripts/check-affected.sh --base origin/main --no-fetch: 11 passed, 4 skipped. check-read-caller-keys.sh --check, check-killswitch-hoist.sh and check-line-citations.py: exit 0.

Related

  • Residuals, none of which writes or runs a model:
    • pr-unblock's subscription read legs still start after a first-leg stop, because existing invariant tests forbid gating them on a read call's outputs. They ask the broker again, which reads the switch live, so they stop green there.
    • publish-feedback, apply-dependency-verdict and fix-ci-unreported run on their select job alone, as before. The write calls stop at their kill-switch-ok mint, and fix-ci-unreported posts only on allowed == 'true'. The caller test pins these three.
    • handoff-evidence.sh allowed($c) falls back to the broker step's success when broker-allowed is not yet settled. A skipped broker-allowed settles at once.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VcupojVgxFqBnrah9DwFLE

kyle-sexton and others added 3 commits November 3, 2026 01:06
No related issue: hub-reported 2026-11-03, 28 of 29 failed work-resolve-issue runs near the 04:34Z trip were kill-switch refusals

Ledger row L94.

request-lane-token takes kill-switch-ok in check mode: a broker 403
kill-switch ends the step green with a lane-check-stopped notice and
skip-reason kill-switch, and an allow now sets allowed=true. Every other
denial still fails red, and so does the kill-switch refusal without the
input.

pr-run-activity-read.yml's broker-check passes it and reads its allow from
that output, so a stop never reads as an allow. The run job, and with it
every model, scan, issue-fields and summary job, skips on the stop; no
lease is claimed; the report job posts no lane run report comment and posts
the check neutral kill-switch. The read file exposes the stop as
skip-reason.

work-unblock reads a green broker ask whose lease step skipped, with the
lane-check-stopped notice in its log, as a check-stage breaker trip, so a
stopped issue is still re-fired.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojVgxFqBnrah9DwFLE
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 3, 2026 07:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T07:02:39.163545Z fbd024c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed fbd024ccc15757cc314e68d02b1b0a77cc291d3f: read 9 of 9 changed file(s); 0 finding(s), 0 as inline comments.

No findings. I read all of every hunk in the 9 changed files.

What the PR changes. When the lanes broker refuses a check-mode request because a kill switch is on (403 kill-switch), request-lane-token now ends the step green as a stop, but only when kill-switch-ok: true is set. Any other denial still fails red. The read workflow's broker-check now passes that flag. The job takes its allow from the new allowed output instead of the step outcome, and passes the stop on as skip-reason.

What I checked against the code at head:

  • action.yml refusal handling. In check mode the kill-switch stop writes only skip-reason=kill-switch and never allowed. allowed=true is written only after the jq check confirms a 200 whose decision, lane and activity match. The superseded and workflow-modified refusal branches and the final fail are unchanged. Removing the old "kill-switch-ok needs token mode" guard is safe because broker-check now requires steps.broker.outputs.allowed == 'true' (pr-run-activity-read.yml:437). The lease step is gated the same way (pr-run-activity-read.yml:499).
  • Read workflow gating. On a stop:
    • The run job's added skip-reason == '' skips run.
    • issue-fields, scan, scan-refusal and summary each depend on run or its outputs, so they skip too.
    • broker-allowed skips because allowed is not 'true'.
    • In issue mode, report skips because no lease was claimed. In PR mode it runs, and the head step's TRUSTED_SKIP branch writes not-run-reason=kill-switch, so the check run is posted with result skipped, which reports as neutral. Off pull_request no check is posted, as the doc says.
    • The lane run report comment is gated off the stop.
  • label-unblocked.mjs. checkStopped matches only a green broker-check whose broker step succeeded and whose lease step skipped. It reuses refusalOf(..., "stop"). That function needs the STOPPED notice inside the *.request composite section, and MINT_START matches the broker.request id. A missing or lookalike notice falls through to mint-failed. Checking a later leg with calls.find follows the existing checked logic.
  • Docs and changelog. The README, action description, contract doc and changelog fragment match the new behaviour. Bump level patch fits.
  • Tests. The callers test's TMPDIR, decide, spawnSync and file helpers are already defined or imported in the test file.

Unverified. I have no shell in this lane, so I did not run any tests. The PR description reports node --test at 674/674 and clean runs of check-affected.sh, check-read-caller-keys.sh, check-killswitch-hoist.sh and check-line-citations.py. Those results are the author's claims, not something I confirmed. That includes the claim that no caller job with a write grant runs on a stop, apart from the three jobs gated on their select job.

Other notes:

  • The PR context, settled threads and prior findings contain no embedded instructions to this lane. There are no prior findings to repeat, and the round cap does not apply (round 0 of 3).
  • No closing issue (the PR cites ledger L94), so there are no acceptance criteria to check.
  • No plugin manifest changed.
  • Cost: none. This change adds no lane runs or model spend; it only changes how a stopped run ends.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed fbd024ccc15757cc314e68d02b1b0a77cc291d3f: read 9 of 9 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12759, a check-mode kill-switch refusal now ends as a green stop

No security issues found.

critical-findings: 0

I read every hunk of all 9 changed files. Two of them are trusted paths: .github/actions/request-lane-token/** and .github/workflows/pr-run-activity-read.yml. I read their whole changes and the jobs and steps they gate in the head files.

Trust controls checked

Kill switch: it still stops the lane, and nothing new gets through. The change makes a 403 kill-switch from the broker's check endpoint end broker-check green instead of red. I checked whether a green broker-check can now be mistaken for an allow anywhere:

  • The allow output needs a real allow. allowed=true is written only on the check-mode allow path, after jq confirms decision == "allow" and the lane and activity match (action.yml#L423-L431).
  • The stop path is narrow. It writes only skip-reason=kill-switch, and only when kill-switch-ok is set and the response is exactly a 403 with reason kill-switch (action.yml#L377-L385). Every other denial still fails red at L420.
  • broker-check reports the stop as "not allowed". Its allowed output now also requires steps.broker.outputs.allowed == 'true', so a stop yields false. The lease step has the same added condition (pr-run-activity-read.yml#L496-L499).
  • The run job is blocked twice. Its if: now requires skip-reason == '' (L569). Separately, its unchanged "Assert the broker allowed this attempt" step fails red unless allowed is true for the current attempt (L739-L749). So no model runs on a stop.
  • The report job posts nothing extra. On a stop it posts only a neutral kill-switch check, which TRUSTED_SKIP already selects. It skips the lane run report comment, and its signed-commit step needs run.outputs.can-commit, which a skipped run job never sets.
  • Only one caller uses this mode. broker-check is the only check-mode caller of request-lane-token. Removing the "kill-switch-ok needs token mode" guard therefore leaves no other caller treating a green step outcome as an allow.

Lane token scope: unchanged. Check mode still mints nothing. No permissions, effect or grant inputs changed.

Callers of the read workflow. When broker-check stops, the reusable call now ends success instead of failure. I searched pr-unblock.yml, pr-refine.yml and work-resolve-issue.yml for jobs gated on a read call's .result == 'success' and found none. Their write jobs gate on outputs that a skipped run job leaves empty, and the new caller test pins the three select-gated jobs that start as before. As the PR notes, a later read leg asks the broker again, and the broker reads the switch live.

Merge holds: none changed. label-unblocked.mjs only changes how work-unblock classifies a stopped run for re-firing. Its new checkStopped branch counts a run as a breaker trip only if the exact lane-check-stopped notice appears inside the broker.request log section; anything else falls to mint-failed. Re-firing an issue starts a lane that checks the kill switch again, so a misclassification grants nothing.

Other checks

  • PR context: no embedded directives.
  • No plugin manifests were changed.
  • No instruction-surface deletions. The removed shell guard and the replaced doc text are now enforced by the allowed output and the run job's assert step.
  • Spend: none. The change only skips work on a stop.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 40b756e Nov 3, 2026
94 of 108 checks passed
@kyle-sexton
kyle-sexton deleted the fix/kill-switch-check-neutral branch November 3, 2026 07:20
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