Skip to content

test(autonomy): tie escalation event classes to the guardrails stop rule - #13153

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-11024-41791245097-1
Nov 4, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-11024-41791245097-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #11024

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Adds a node:test suite that checks the guardrails Escalation table against the stop rule, and probes check-security-binding.mjs on edited copies of valid.json. The suite checks that gate-failure, verification-divergence, admission-rejection and demotion stop for a person only under the stop rule, and that the stop rule sends each to its owning lane (or keeps an audited rejection final). It checks that structural-plan-approval stops only on an intent or primary-design change, that untrusted-provenance always stops, that the binding must carry a route for each of the six classes, that a bare needs-human route key is rejected, and that merge_policy.C5 cannot be set to auto. Design choice: #13021 says no script routes on these class names, so I built a contract-consistency check (the option the recorded decision offers) rather than a new router. The basis: the classes' only machine surface today is the security binding's escalation_routes, which the checker validates. The untrusted-provenance kept control already has stops-for-a-person tests that I read and confirmed: .github/scripts/intake-triage/admit.test.mjs ('untrusted-provenance work needs a person'), apply-verdict.test.mjs:629-660, work-resolve-issue/check-blockers.test.mjs:181, report-outcome.test.mjs:267, and pr-merge/enable-auto-merge.test.mjs:2677-2704 (the issue gets needs-human). The new suite adds the binding-side C5 merge probe.

Not verified

  • The new node suite was not executed: this lane's Bash runs only the named wrappers, so node --test could not run. Left to the PR's CI (run-plugin-tests.sh picks up the .test.sh).
  • A security-review pass at the head of every PR that touches a person_reasons or hold path: this PR touches neither (test and changelog only). The repository's claude-security-review lane runs on the PR's head.
  • The new .test.sh was written without the executable bit (the lane cannot chmod). run-plugin-tests.sh invokes suites with 'bash "$suite"', so it runs anyway. Left to CI if a mode check exists.
  • Tidy pass 5 (ai-slop fix) got a manual rubric read only. The detector, digest guard and semantic-diff verifier are scripts this lane may not run. Passes 1-4 ran; pass 4 reworded the changelog fragment.
  • No review-venue.txt in the scratchpad, so the review ran locally in one fresh-context subagent.

Fix

  • plugins/autonomy/skills/setup/scripts/check-security-binding.escalation-stop.test.mjs: new suite. It reads guardrails.md '## Escalation' (the table and the stop rule) and asserts each class's 'Stops for a person' cell, the stop rule's three reasons, the kept-control clause and each routed class's…
  • plugins/autonomy/skills/setup/scripts/check-security-binding.escalation-stop.test.sh: discovery wrapper for run-plugin-tests.sh, with a test-scope on plugins/autonomy/reference/guardrails.md so a guardrails edit selects the suite.
  • .changes/autonomy/work-resolve-issue-issue-11024-41791245097-1-ad999d40.md: patch changelog fragment describing the new test.

Verification

The runner ran each check from the base copy against f8b3800:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 25 fragments valid (run before and after tidy)
  • check-changed-skills: plugins/autonomy/skills/setup PASS, 0 errors, 4 warnings that predate this change (description length, body size)
  • check-affected: 13 passed, 6 skipped over 3 changed files (run after tidy and after the review fix)
  • fresh-context review subagent: traced every assertion by hand against guardrails.md:105-127 and check-security-binding.mjs (findings go to stderr with exit 1 at :2682-2685, missing route :758-760, unknown key :518-521, C5 cap :1900-1902) and found no correctness bug. Its one minor finding, a test…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41791245097

Left out: the items under Not verified.

Related

#11024

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #13153, head f8b3800

I found no security issues in this change.

I read all hunks of all 3 changed files in .claude-lane/pr.diff.

  • .changes/autonomy/…-ad999d40.md: a changelog fragment (bump: patch). It only describes the new test.
  • check-security-binding.escalation-stop.test.mjs: a new node:test suite. Here is what it does:
    • It reads plugins/autonomy/reference/guardrails.md.
    • It edits a parsed copy of the existing valid.json fixture and writes it to a mkdtemp directory, which it removes in finally.
    • It runs the in-repo check-security-binding.mjs through spawnSync(process.execPath, [...]) with an argument array, so no shell is involved and none of the input comes from outside.
    • It does not change the checker, the guardrails text, the binding schema or any fixture. It only asserts the current behavior: every escalation class needs a route, a bare needs-human route key is rejected, and merge_policy.C5 can't be set to auto. That adds coverage for a kept control (untrusted-provenance stays human at merge) and loosens nothing.
  • check-security-binding.escalation-stop.test.sh: a discovery wrapper. It execs node --test on its sibling file through a quoted $SCRIPT_DIR path, and exits 0 with a SKIP message when Node is missing.

Other checks:

  • Trusted paths: no changed file matches a TRUSTED PATHS glob.
  • Trust controls and merge holds: nothing that decides who or what is trusted, token scope, the kill switch, the broker, or a merge hold is changed.
  • Standing instructions and plugin manifests: none are deleted or changed (no CLAUDE.md, skill body, hook list or plugin.json/marketplace.json in the diff).
  • PR context: I found no embedded directives aimed at this lane.
  • Prior findings: none (0 rounds, not past the cap).

Spend: one more small Node test suite in the plugin-test CI run (prepaid Actions minutes). Not a hold.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #13153 (no findings)

I read all three changed files in full: the new node:test suite, its .test.sh discovery wrapper, and the changelog fragment.

Checks against the head source. I did not run the suite. I compared each of its assertions with the files it reads:

  • Escalation table and stop rule (plugins/autonomy/reference/guardrails.md:105-126):
    • The table rows starting with | ` cover exactly the six classes in EXPECTED_STOPS, and each class's third cell matches its expected text.
    • The test pulls out the stop rule by splitting on **Stop rule.** and \n\n, then collapsing whitespace. That paragraph runs through line 126.
    • Every reason substring and OWNING_ROUTES substring, including those that cross a line break, matches the paragraph once whitespace is collapsed.
  • Required routes (check-security-binding.mjs:93-100, :757-760): EVENT_CLASSES is the same six classes, and a missing route gives escalation_routes.<class>: missing or empty.
  • Unknown route key: a bare needs-human key fails checkAllowedKeys with escalation_routes: unknown key "needs-human" (:521).
  • C5 merge cap (:1901): merge_policy.C5 = "auto" gives exceeds the matrix cap — C5 merge is human always.
  • Fixture arguments: the fixture manifest gives valid.json a credential_roots of "/home/runner", passed the same way check-security-binding.fixtures.test.mjs:83 passes it. valid.json has both merge_policy.C5 and escalation_routes.

Wrapper file mode. The PR body says the wrapper went in without the executable bit, but the diff adds it as mode 100755.

Closing issue #11024. The remaining done-when items, as the issue's decision comment narrows them:

  • A test or check per changed path: met. The suite ties each class's contract route to the stop rule and checks that the binding must route each class. The decision comment allows a check of this kind in place of a router.
  • The kept control still stops for a person: met. The untrusted-provenance cell and the C5 merge-cap probe are covered and asserted.
  • A security-review pass at the head of a PR that touches a person_reasons or hold path: not applicable. This PR changes only a test and a changelog fragment.

Not verified by this lane: that the suite passes in CI. The author also says they did not run it, so that is left to the PR's CI.

No plugin.json or marketplace.json changes, so no manifest checks apply. The changelog fragment's bump: patch fits a change that only adds a test.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 4, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head f8b380000fa96721e1165912d8f1ed7b6a8a8dd5.

Merged via the queue into main with commit edacf64 Nov 4, 2026
44 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-11024-41791245097-1 branch November 4, 2026 08:12
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.

fix\(pr-pipeline\): align every needs-human path with the owner stop rule - part 6 of 6

1 participant