Skip to content

feat(autonomy): admit C2 issues by owner-written binding rules - #7421

Merged
kyle-sexton merged 6 commits into
mainfrom
feat/autonomy-rule-admission
Oct 14, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
feat/autonomy-rule-admission

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: the owner asked for this directly in session; no tracker item exists for it.

Summary

The work loop can admit a GitHub issue through owner-written rules in the security binding (admission.rule_admission[]), using the intake-triage lane's proposed work class. Nothing writes a label and no model runs. plugins/work-items/scripts/rule-admit.sh evaluates the rules, and the autonomy admission-policy leaf ("Rule admission") defines what they mean.

Fix

These changes apply the owner's disposition of the security review findings:

  • Finding 3 (medium), fixed. rule-admit.sh exits 4 unless dispatch_posture is autonomous-enabled and the decision table resolves each rule's class to autonomous-eligible for tracker-vcs-event under every provenance. Resolution is most-specific-wins, no match means human-gated, and an equal-specificity tie fails closed. check-security-binding.mjs reports the same conflict as a finding.
  • Finding 1 (medium), fixed. Only C2 admits. A C1 rule stays valid in the binding but refuses every issue (C1 rule admission is not enabled), because /work-items:work always pushes and no-push was enforced only in prose. The work-loop SKILL.md and the admission-policy leaf say this and give the reason. The work-class: label gate in babysit is unchanged.
  • Finding 2 (medium), accepted risk. Agents file issues under the operator's token, so an agent-filed issue counts as owner-authored. admission-policy.md records this as an accepted risk. No code changed for it.

Known follow-ups (low findings 4-7, deliberately not fixed here):

  1. The model supplies the --binding path to rule-admit.sh, so a wrong path could be passed. The skill tells the model to resolve the path from /autonomy:setup, but nothing checks it mechanically.
  2. Edits to the lane comment are not detected. The body edit time is compared with the lane comment's updated_at, but nothing checks whether the lane comment itself was edited.
  3. The lane comment is identified as github-actions[bot] plus a marker. Every workflow in the repository shares that identity.
  4. The predicate runs once before dispatch and is not checked again at dispatch or PR time.

Verification

  • bash plugins/work-items/scripts/rule-admit.test.sh: all checks pass. New checks: a C1 rule never admits; human-gated-only posture, missing table rules, an empty table (default human-gated) and a most-specific agent-provenance gate each exit 4. In the control, a gate on another signal class still admits.
  • bash plugins/autonomy/skills/setup/scripts/check-security-binding.fixtures.test.sh: 696 checks pass, including two new fixtures (rule-admission-human-gated-only.json, rule-admission-gated-class.json). In the second fixture, a C1 rule gated only on temporal is not flagged.
  • scripts/affected-tests.sh --run: 11 shell suites pass. The selected suites in other runtimes also pass: promotion-evidence-e2e.test.mjs (33 pass) and test_render_review.py (10 OK).
  • shellcheck and shfmt (per .editorconfig) are clean on the touched scripts, and markdownlint is clean on the touched markdown.

Related

  • Security review of this branch (in session), findings 1-7.

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits October 13, 2026 21:01
Add admission.rule_admission[] to the security binding (schema,
validator, admission-policy leaf), a no-model evaluator
work-items/scripts/rule-admit.sh with fixture tests, and a second
admission path in the work-loop gate that consumes its verdicts without
writing any label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…only

rule-admit.sh exits 4 unless the binding's dispatch_posture is
autonomous-enabled and its decision table makes each rule's class
autonomous-eligible for tracker-vcs-event under every provenance; the
binding validator reports the same conflict as a finding.

C1 rule admission is off until a mechanical no-push exists: the work
skill always pushes, so the no-push constraint rested on prose. A C1
rule stays valid and refuses every issue.

admission-policy.md records agent-filed issues reading as owner-authored
as an accepted risk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-10-14T03:40:39.468155Z a9e2a7d 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.

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 3m 18s —— View job


Code review in progress

  • Gather context (PR diff, CLAUDE.md/AGENTS.md, REVIEW.md, standards index)
  • Review plugins/work-items/scripts/rule-admit.sh and its tests/fixtures
  • Review plugins/autonomy/skills/setup/scripts/check-security-binding.mjs changes and schema/fixtures
  • Review plugins/autonomy/reference/guardrails/admission-policy.md and work-loop/SKILL.md doc changes
  • Adversarially verify candidate findings (two hunter passes running)
  • Post inline comments and summary

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 6m 33s —— View job


Security review in progress

  • Gather context (diff, changed files, instruction-surface check)
  • Review rule-admit.sh (new admission logic)
  • Review check-security-binding.mjs changes
  • Review schema, fixtures, and skill/doc changes
  • Check for instruction-surface deletions/softenings — none found (this PR only adds a new opt-in admission path; nothing is removed or softened)
  • Adversarial validation of candidate findings — verifier agent running
  • Post findings and summary

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9e2a7d85b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

kyle-sexton and others added 2 commits October 14, 2026 00:10
…old text

Move the work-loop rule-admission paragraph into reference/rule-admission.md
so SKILL.md stays under the 500-line cap, correct the human-merge text (a
Hold: line holds the merge only; ready still flips the draft), add outcome
eval cases 31 and 32 for the rule-admission branch, and spell the pin
alternation in rule-admit.sh so typos passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 4m 5s —— View job


Security review — no findings

  • Gather context (diff, changed files, instruction-surface check)
  • Review rule-admit.sh (new admission logic)
  • Review check-security-binding.mjs changes
  • Review schema, fixtures, and skill/doc changes
  • Check for instruction-surface deletions/softenings — none found (this PR only adds a new opt-in admission path; nothing is removed or softened)
  • Adversarial validation of candidate findings
  • Post findings and summary

I reviewed plugins/work-items/scripts/rule-admit.sh, plugins/autonomy/skills/setup/scripts/check-security-binding.mjs, the schema/fixtures, and the admission-policy/work-loop doc changes against origin/main...HEAD (head 9d2a925).

No new security findings. The trust boundary holds up under adversarial reading:

  • Admission requires the issue author to be OWNER/MEMBER (rule-admit.sh#L169-L184), every comment to be from a trusted author or the lane bot, exactly one intake-triage lane comment, no body edit after that comment, and no trust-surface label/keyword hit — before a rule can even be consulted. An untrusted actor filing the issue is refused regardless of lane output, so the "lane output is model text" risk can't be combined with an untrusted-author path.
  • rule-admit.sh's posture/decision-table gate (L139-L156) and check-security-binding.mjs's resolveDisposition/checkRuleAdmissionGate (L2193-L2230) implement the same most-specific-wins/tie-fails-closed resolution independently in bash and JS; I traced both line by line and they agree, including the all-three-provenances requirement (an agent-filed issue can't be trusted as human provenance).
  • The C1 cutoff ($rule.work_class != "C2" refuses) and the human-merge hold-text fix are present and match the new fixtures/evals (rule-admission-gated-class.json, rule-admission-human-gated-only.json, eval 31/32).
  • --repo/--issue inputs are regex-validated before use in gh api calls; no shell-injection or path-traversal surface.
  • dispatch_posture defaulting to autonomous-enabled when absent is pre-existing behavior unchanged by this diff (verified against origin/main), not introduced here.
  • Both Codex findings on this PR (missing work-loop eval; stale ready-flip wording) are already fixed in commit 9d2a925.

The PR body's own "known follow-ups" (1-4: model-supplied --binding path not mechanically checked, lane-comment edits undetected, shared bot identity for the lane marker, one-time predicate check) are accurately described, already disclosed with reasoning, and low severity given the trust gates above — no new angle on them to add.
· branch feat/autonomy-rule-admission

claude-lane-summary: lane=claude-security-review sha=9d2a92572c8c2307832b69f114d5705ac6c858e0 run=38510243750

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 3m 43s —— View job


Code review complete

  • Gather context (PR diff, CLAUDE.md/AGENTS.md, REVIEW.md, standards index)
  • Review plugins/work-items/scripts/rule-admit.sh and tests/fixtures
  • Review plugins/autonomy/skills/setup/scripts/check-security-binding.mjs changes and schema/fixtures
  • Review plugins/work-items/skills/work-loop/SKILL.md and new reference/rule-admission.md
  • Review plugins/autonomy/reference/guardrails/admission-policy.md
  • Adversarially verify candidate findings
  • Post summary

Summary

Reviewed the full diff at head 9d2a9257 (code-review lane scope: correctness, design, tests, docs — security findings are out of scope here since pr-review-security-hosted.yml runs as its own lane).

Both findings from Codex's earlier review (on commit a9e2a7d) are already resolved by this head:

Cross-checked for internal consistency and found none of my own:

  • rule-admit.sh's GATE evaluation (most-specific-wins, no-match → human-gated, tie → fail-closed, checked for every provenance, applied to both C1 and C2 rule_admission entries) and check-security-binding.mjs's checkRuleAdmissionGate/resolveDisposition implement the same semantics independently and agree on every fixture case I traced by hand (rule-admission-gated-class.json, the "most-specific wins"/"control" cases in rule-admit.test.sh).
  • The schema's RuleAdmission def, validateRuleAdmission's findings, and rule-admission-invalid.json's expected findings_substrings all line up field-for-field (duplicate id, bad work_class, duplicate proposed_class, unknown key, bad id/proposed_class shape).
  • The deny-list regex in rule-admit.sh (\b(...)\b word-boundary alternation) behaves as documented against the "terms inside other words do not hit" fixture case (specific/spinner/shape don't false-positive on ci/pin/sha).
  • admission-policy.md is the sole normative home for the precedence/predicate/deny-list; work-loop/reference/rule-admission.md and SKILL.md only cite it and add work-loop-specific dispatch mechanics, so no reference-dont-duplicate concern.
  • No paved-path row exists in docs/standards/README.md, so that check doesn't apply.

No high-signal correctness or maintainability findings to report.

Verification note: I was not able to execute shellcheck/shfmt/jq/bash <script> myself in this sandbox (tool calls for them were denied), so the PR body's shellcheck/shfmt/test-suite results are author-claimed and unverified by me; I relied on static reading of the scripts, jq programs, and fixtures instead.

claude-lane-summary: lane=claude-review sha=9d2a92572c8c2307832b69f114d5705ac6c858e0 run=38510243830

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

claude-review has reviewed this pull request through eecd2f6; a later push is reviewed from there.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review has reviewed this pull request through eecd2f6; a later push is reviewed from there.

A spoke is read, not expanded, so the plugin-root token in
reference/rule-admission.md resolved against nothing. SKILL.md now names
the script path and the spoke points at it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 0s —— View job


Code review complete

  • Gather context (incremental diff since 9d2a925, gh pr diff for broader context)
  • Review plugins/work-items/skills/work-loop/SKILL.md change
  • Review plugins/work-items/skills/work-loop/reference/rule-admission.md change
  • Check for duplication/consistency against docs/standards/reference-dont-duplicate.md
  • Post summary

Summary

Incremental scope only (commit eecd2f6, "name the rule-admit path in SKILL.md, not the spoke"), per this lane's last review at 9d2a925.

The change moves the literal ${CLAUDE_PLUGIN_ROOT}/scripts/rule-admit.sh path so it's stated once, in SKILL.md's pointer sentence, and has reference/rule-admission.md cite that pointer instead of restating the literal path — correctly applying the hub/spoke split in docs/standards/reference-dont-duplicate.md ("Must be cited, never recapped" covers a path literal).

Checked for correctness:

  • SKILL.md has exactly one link to reference/rule-admission.md (line 390), so "the SKILL.md pointer to this file" in the reference doc is unambiguous — there's no second pointer it could be confused with.
  • That one sentence does name the path (`${CLAUDE_PLUGIN_ROOT}/scripts/rule-admit.sh`) immediately before the link, so the cross-reference is accurate, not a dangling claim.
  • Repo-wide grep for rule-admit.sh across *.md confirms the literal path now appears in exactly one markdown file.

No correctness, maintainability, or test-coverage findings on this incremental diff.

claude-lane-summary: lane=claude-review sha=eecd2f605d141038c6fb81e39b9c3fff4f104836 run=38510770572
· branch feat/autonomy-rule-admission

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 49s —— View job


Security review — no findings

  • Gather context (incremental diff scope: .claude-lane/incremental.diff, two files)
  • Review plugins/work-items/skills/work-loop/SKILL.md change
  • Review plugins/work-items/skills/work-loop/reference/rule-admission.md change
  • Check for instruction-surface deletions/softenings — none found
  • Post summary

Scope: incremental review per the lane header — this lane last reviewed 9d2a92572c; everything else in this PR was reviewed then and is unchanged. The only delta to head eecd2f605d is in:

What changed: purely a documentation de-duplication. The literal path to the admission
script (${CLAUDE_PLUGIN_ROOT}/scripts/rule-admit.sh) now lives in exactly one place — the
SKILL.md pointer line — and reference/rule-admission.md was reworded to resolve the path from
that pointer instead of restating the same literal string. No code file changed (rule-admit.sh
itself is untouched since 9d2a925), no argument, flag, or invocation semantics changed, and the
script's trust gates (author/commenter trust checks, posture/decision-table resolution, C2-only
cutoff) are unaffected.

Instruction-surface check: this is a reorg, not a removal — the fully-qualified path is still
stated once (SKILL.md line 390) and the reference doc points at it rather than dropping it, so no
guardrail is deleted, narrowed, or softened. No match against the instruction exception register
is applicable.

No security-relevant surface in this diff. No findings reported.

claude-lane-summary: lane=claude-security-review sha=eecd2f605d141038c6fb81e39b9c3fff4f104836 run=38510770685
· branch feat/autonomy-rule-admission

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit bf1d70b Oct 14, 2026
27 checks passed
@kyle-sexton
kyle-sexton deleted the feat/autonomy-rule-admission branch October 14, 2026 04:46
kyle-sexton added a commit to melodic-software/ci-workflows that referenced this pull request Oct 20, 2026
No related issue: companion to the claude-code-plugins rule-admission
work (melodic-software/claude-code-plugins#7421), which reads the
intake-triage lane comment.

## Summary
Intake triage writes `Proposed work class: <class>` on line 2 of its
lane comment on every run.

## Fix
- `feat(intake-triage)`: record the proposed work class on every run.
- `fix(intake-triage)` (security review findings 1 and 2): an escalated
run writes `Proposed work class: none` and shows a usable class below
the fixed note as `Unconfirmed model suggestion: <class>`; the comment
is rewritten on every run where `ran` is true, so a rerun replaces line
2.

## Verification
- `node --test .github/scripts/*.test.cjs`: 378 pass, 0 fail (reported
by the worker that made the fix).
- New tests: escalated run asserts line 2 is `none` with the suggestion
line; empty comment with no class still writes `none`.

## Related
- Not addressed (evaluator-side, from the same review): finding 3
(proposal not tied to the issue text; rule-admit in #7421 compares the
last body-edit time) and finding 4 (another workflow could spoof the
comment; see #7421's low findings). The optional label-regex tightening
at intake-triage.yml:279 was not applied.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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