Skip to content

feat(toolchain): add per-file ceilings, the lint rollout rule and break glass to toolchain:ratchet - #12160

Closed
melodic-automation-lanes[bot] wants to merge 3 commits into
mainfrom
work-resolve-issue/issue-12140-41358589368-1
Closed

melodic-automation-lanes[bot] wants to merge 3 commits into
mainfrom
work-resolve-issue/issue-12140-41358589368-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #12140

Summary

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

ratchet.py (canonical in plugins/performance, regenerated into toolchain) gains per-file counters: an entry with a ceilings object of path to ceiling, a command printing <path> <field>=<n> lines, check failing any file above its ceiling even when the total fell, propose-tighten lowering each file's ceiling and dropping files at 0, and add --per-file. Break glass is an inline ratchet-break-glass(<counter>): reason=..; expires=YYYY-MM-DD; approved-by=.. comment that holds one violation above a file's ceiling. One missing a field or past its expiry fails check (exit 1). The repository key is the ceilings file's top-level break_glass, which CI's vendored script reads directly, and the new ratchet_break_glass userConfig option (default on, following ADR 0080's 'break glass stays available') fills it via add --break-glass when the file has none. I put the setting in the ceilings file, not a YAML convention file, because CI runs the vendored script with no plugin or YAML parser. The skill now states the rollout rule: zero lands the rule, a mechanical fix gets a codemod and then error, otherwise a per-file baseline at error severity (the linter's native baseline where one exists, with ESLint and PHPStan pointers, as-of date and recheck trigger, else the ratchet's per-file mode). Warn severity is allowed only as a dated step with its end date in the ceilings entry's goal.

Not verified

  • plugins/performance/scripts/ratchet.test.sh was not executed: this lane has no wrapper to run a bash test suite. Each new assertion was traced by hand and by the review subagent. Running it, and checking that the per-file test fails against main's ratchet.py (main exits 2 on a ceilings key), is le
  • The ratchet-lint-count eval and the evals.json changes were not run against a model, only quality-checked; the eval-schema check is CI-only
  • Tidy skipped: the change is over the cutoffs (12 files, roughly 800 changed lines, 2 areas: performance and toolchain)
  • review-venue.txt was absent, so review ran locally in one fresh-context subagent instead of the CI code-review lane
  • Build/lint of the touched files beyond check-affected (markdownlint, typos, ruff/shellcheck) did not run here: check-affected skipped typos and markdownlint is CI-only
  • The issue's 'PR's CI is green' item is left to the PR's CI
  • Break glass reads exceptions only in files the counter's command prints or has a ceiling for, so a malformed marker in a file with no violations and no ceiling is not reported. The skill and docstring state this scope. ADR 0080's 90-day maximum exception age (exceptions.max_days) is not enforced
  • Untracked files at the checkout root that this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) belong to the runner environment and must not go into the patch
  • Changes are left uncommitted in the working tree as the lane's runner instructions require; the runner commits them

Fix

  • plugins/performance/scripts/ratchet.py: per-file counters (ceilings), optional top-level break_glass key, inline break-glass exception parsing and validation, per-file check/propose-tighten/add (--per-file, --break-glass on|off); single-count counters unchanged
  • plugins/toolchain/skills/ratchet/scripts/ratchet.py: regenerated copy via sync-shared-copies
  • plugins/performance/scripts/ratchet.test.sh: sections 6 and 7 test per-file ceilings (a fix in file A does not pay for a new violation in file B: check exits 1 naming B though the total fell), malformed per-file output, tightening, add --per-file, and break glass (valid, off, absent, each missing fi
  • plugins/toolchain/skills/ratchet/SKILL.md: section 2 is now the lint rollout rule with native-baseline pointers (ESLint, PHPStan), the dated warn step, a Per-file counters subsection, a Break glass subsection naming the break_glass key and the ratchet_break_glass option, and updated CI-step, tig
  • plugins/toolchain/skills/ratchet/reference/zero-entries.md: fixed the anchor to the renamed section 2 and noted that a per-file counter is a list of offenders
  • plugins/toolchain/skills/ratchet/evals/evals.json: eval 1 now tests per-file ceilings on a linter with no native baseline; new eval 8 tests that an ESLint rule uses ESLint's native suppressions
  • plugins/toolchain/evals/ratchet-lint-count/scaffold.sh: the repository's lint check is an in-house script with no baseline that prints per-file counts (ESLint would now route to its native baseline)
  • plugins/toolchain/evals/ratchet-lint-count/case.yaml: description, expected outcome and the ceiling grader moved to per-file ceilings
  • plugins/toolchain/.claude-plugin/plugin.json: new ratchet_break_glass boolean userConfig option, default true
  • plugins/toolchain/README.md: options-reference row for ratchet_break_glass
  • .changes/toolchain/work-resolve-issue-issue-12140-41358589368-1-f43debe8.md: bump minor
  • .changes/performance/work-resolve-issue-issue-12140-41358589368-1-73f8e81a.md: bump patch

Verification

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

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

The run reports:

  • read https: //eslint.org/docs/latest/use/suppressions: ESLint bulk suppressions record existing violations of error-severity rules in a checked-in eslint-suppressions.json, matched by file path, and new violations are still reported
  • read https: //phpstan.org/user-guide/baseline: PHPStan --generate-baseline writes phpstan-baseline.neon listing errors with a count per file path
  • sync-shared-copies: regenerated plugins/toolchain/skills/ratchet/scripts/ratchet.py, exit 0
  • check-changelog-fragments: all 4 fragments valid
  • check-changed-skills: ratchet PASS, 0 errors, 2 size warnings (body 304 lines, grew from 231)
  • check-affected: 13 passed, 5 skipped, 0 failed over 12 changed files
  • check-evals-quality plugins/toolchain/skills/ratchet/evals/evals.json: PASS, 0 warnings
  • cant-fail-scan --file plugins/performance/scripts/ratchet.test.sh --check: PASS, no gating findings
  • fresh-context review subagent: 5 findings, all fixed (exception scope narrowed in docs to the files the counter names, a vacuous break_glass test made non-empty with a message assertion, eval 1 and the ratchet-lint-count eval moved off the old single-ceiling ESLint behaviour, the broken zero-entries
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41358589368

Left out: the items under Not verified.

Related

#12140

Lane-Activity: work-resolve-issue/resolve-issue

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 1 inline finding(s) on ead19232a8668c6d7b1377f812081b18bee834c6; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review of PR #12160, incremental (c7fa225 → c3c4ecb)

I read every hunk of all four in-scope files in .claude-lane/incremental.diff. None of them matches a TRUSTED PATHS: glob. This change adds no security issues. It changes the default of the ratchet_break_glass option from on to off.

plugins/toolchain/.claude-plugin/plugin.json

  • manifest userConfig.ratchet_break_glass: pass. This key is a guard: it decides whether /toolchain:ratchet writes "break_glass": true into a new ceilings file, and that setting lets inline ratchet-break-glass(...) markers hold violations above a file's ceiling. Its default changed from true to false, and its description changed (an inert field). The default now moves toward the restrictive setting, so users who never set the option no longer get self-attested exceptions turned on. The vendored script agrees with this: ratchet.py reads data.get("break_glass", False) (
    break_glass = data.get("break_glass", False)
    and #L370), and it writes the key only when --break-glass is passed (
    if args.break_glass is not None:
    data["break_glass"] = args.break_glass == "on"
    ).

plugins/toolchain/skills/ratchet/SKILL.md

  • When the option is unset or unrendered (${user_config.…} or empty), the skill now passes --break-glass off instead of on. Under the instruction-surface lens, this tightens the default and removes no guardrail.

plugins/toolchain/README.md and .changes/toolchain/…-f43debe8.md

  • Documentation and changelog text, updated to match the new default. They have no security surface.

Carried finding from earlier rounds

  • My earlier IMPORTANT finding on ratchet_break_glass (feat(toolchain): add per-file ceilings, the lint rollout rule and break glass to toolchain:ratchet #12160 (comment)) said the guard key defaulted to its permissive value. This change fixes it: plugin.json now has "default": false, and the skill falls back to off. I am not posting or counting it again.
  • A separate part of that finding is still open: expires has no upper bound and approved-by is free text nothing verifies. This only matters in a repository that turns break glass on, and the earlier comment offered it as a suggestion ("Separately, consider capping expires"). This change does not touch that code, so I am not raising it as a new finding.

PR context and settled threads

  • No embedded instructions aimed at this lane in either file.

Round cap

  • Not reached (2 rounds with findings, cap 3).

Spend

  • None.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 2 inline finding(s) on ead19232a8668c6d7b1377f812081b18bee834c6; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review, incremental: PR #12160 (c7fa225d → c3c4ecb9)

I read every hunk of the incremental diff in all four files in scope:

  • the toolchain changelog fragment
  • plugins/toolchain/.claude-plugin/plugin.json
  • plugins/toolchain/README.md
  • plugins/toolchain/skills/ratchet/SKILL.md

Security is left to the separate security lane.

No new findings. This round changes the ratchet_break_glass default from on to off, which is the fix the owner asked for on the earlier manifest thread ("pr-fix lane: please fix this finding"). The change is the same in every place:

  • plugin.json: "default": false, and the description now says "Off (default) writes false, so a repository opts in".
  • README: the options row shows the default as false, with the same description.
  • SKILL.md:171-172: an unrendered or empty ${user_config.…} now passes off, matching the option's default (SKILL.md#L169-L173).
  • Fragment: now says "default off, so a repository opts in".
  • Script: this matches what ratchet.py does when the key is missing (data.get("break_glass", False), ratchet.py#L293).

I searched the toolchain plugin's skill, evals and README for other text that still says the default is on and found none. Eval 1 expects only that --break-glass is passed, not which value.

Manifest

  • manifest userConfig.ratchet_break_glass default: pass. The field is new in this PR. It now defaults to the restrictive value, and the fragment gives the reason (a repository opts in), following the owner's decision on the earlier thread.
  • manifest userConfig.ratchet_break_glass read: pass. SKILL.md:170-172 reads ${user_config.ratchet_break_glass}.
  • manifest version (fragment bump:): pass. minor is still right for an added capability.

Note (not a finding)

The PR description still says the option is "default on, following ADR 0080's 'break glass stays available'", and its Fix list says "default true". Both are now out of date. Updating the body would stop a later reader from taking it as the shipped behaviour.

Closing issue #12140

  • The break-glass criterion still holds: the change keeps the inline exception, the userConfig setting and the repository key break_glass. The issue does not say what the default should be.
  • I did not re-review the other criteria, because the files behind them are unchanged since c7fa225d. The earlier verdicts still apply.
  • Not verified: I have no shell, so I ran no tests, evals or checks.

No embedded instructions in the PR context, settled-threads or prior-findings files. Round count: 1 round with findings before this one, cap 3, not past the cap.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yfYDh
Lane-Thread: PRRT_kwDOTCGFQM6yfYDm
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on c7fa225.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 1, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the lane left a review finding open and no adjudicator verdict settled it: none was recorded, it found the finding does not hold where the lane had not disputed it (an UNCERTAIN or VALID-defer reply), which only an INCORRECT reply lets a verdict resolve, it found the finding asks only for tests whose covering check runs had not all passed when the round began, or it raised a security question on a finding the security-review lane rated below CRITICAL; so a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=12160 -f activity=address-feedback

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yfXp7
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 2 of max 4 on c3c4ecb.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head c3c4ecb90ae81583e00ff8b53ccec7779ce385e3. The lanes clear this reason on their own; the next scheduled run judges it again.

a pr-unblock lane stopped its head (pr-unblock/fix-ci is failure), which ci-status fails in the
  merge queue

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped fix-ci on this pull request: the lane could fix a failing check only by weakening a test, which is refused, so it runs one fresh fixer round on this head that must keep the test's assertions. The lane sets no label: the run ends in a failing pr-unblock/fix-ci status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=12160 -f activity=fix-ci

@kyle-sexton

Copy link
Copy Markdown
Member

Hold: superseded by #12223. Releases when: never; closed once #12223 merges.

@kyle-sexton

Copy link
Copy Markdown
Member

Superseded by #12223, merged 2026-11-02T03:57:16Z.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Hard merge gate: do not merge while applied. needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(toolchain): add a per-file baseline mode, the lint rollout rule and a break-glass setting to /toolchain:ratchet

1 participant