Skip to content

feat(toolchain): add the lane record writer that refuses any command the run did not log - #19046

Merged
melodic-automation-lanes[bot] merged 8 commits into
mainfrom
work-resolve-issue/issue-15734-45615963224-1
Nov 25, 2026
Merged

melodic-automation-lanes[bot] merged 8 commits into
mainfrom
work-resolve-issue/issue-15734-45615963224-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Refs: #15734

Summary

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

Adds plugins/toolchain/skills/check/scripts/lane-record.mjs, one script with two modes. Write mode builds a proposed ecosystem record only from a run's assumed: &lt;ecosystem&gt;.&lt;key&gt;=&lt;value&gt; (&lt;file:line&gt;) lines and re-reads each cited line. It accepts a record line, an instructions-file line stating the command as a whole code span, a root package.json script run through the package manager its tracked lockfile names, a Makefile target or justfile recipe, or a build tool's verb on its entry point. It refuses install verbs, package runners, shell -c strings, command substitution, CI workflow files, untracked or modified cited files and malformed lines. On any refusal it writes nothing, and it never writes inside an ecosystem records folder or over an existing file. Verify mode exits non-zero on any key other than globs and the command keys, and on any command the lines do not support. With --base <ref> it reads cited lines at the pull request's base commit, so a pull request cannot cite lines it adds itself; without --base, a record line never supports the record. /toolchain:check runs write mode only under the new --propose-records &lt;dir&gt; flag in an unattended run. Its new section 5 names the assumed: input, tells the session to put the draft in the report and open a separate pull request from the default branch through /source-control:pull-request create, and quotes the acceptance sentence. Design choices made from the code: the record is written in a restricted YAML subset (double-quoted JSON-compatible strings) that verify parses strictly, failing closed on anything else; globs come from --glob because assumed: lines carry none; gate lines are left out with a note. A fresh-context review found that a record could cite itself, that stated commands matched as substrings, install-verb bypasses, unquoted names, an output-path bypass and a regex holding a literal U+2028 that would not parse. All were fixed before this outcome.

Remaining work

  • Write the two new toolchain check eval cases for --propose-records and run the two-version compare (120-run budget, --case, --runs 3, a --max-cost-usd ceiling) in the local eval-runner session, then put the compare record in the pull request body
  • Run the security review gate at the frontier tier and this repository's dogfooding step, and record both in the pull request body

Not verified

  • The node:test suite lane-record.test.mjs was not executed: this lane's shell runs only the named wrappers, so no node process could run. Left to the pull request's CI. Its correctness rests on two hand traces only.
  • Tidy did not run: the change is over the tidy cutoffs (more than 300 changed lines, and two areas: plugins/toolchain and docs).
  • The two-version eval compare (8 toolchain check cases plus 2 new ones, opus and sonnet, three runs a side, 120 runs) was not run and the two new cases were not written: eval batches run in the one local eval-runner session in the main checkout, which this lane cannot reach.
  • The issue asks for the pull request to open with the do-not-merge label until the compare record releases it; this lane cannot add labels, so a person or the runner must add it.
  • The security review gate at the frontier tier and this repository's dogfooding step are not in the pull request body: the local review subagent ran at this session's model, and dogfooding needs a real unattended /toolchain:check --propose-records run.
  • Hand-trace residuals the scripts accept by design or leave open: write mode's unchanged-file check runs only when --repo is the git top level (outside git it relies on the files as they are); --base trusts the caller to pass the true base commit; record lines are read one physical line at a time,…
  • Untracked /dev/null character devices at the checkout root (.bashrc, .gitconfig, .mcp.json, .idea and others) are sandbox mounts, not part of this change.

Fix

  • plugins/toolchain/skills/check/scripts/lane-record.mjs: new writer and verify script (write and verify modes, --base, --lines, --out guard)
  • plugins/toolchain/skills/check/scripts/lane-record.test.mjs: new node:test suite: three lines give exactly three values; a fourth unsupported command exits non-zero and writes nothing (write and verify); malformed line refused and named; cited line not holding the manifest script, target or entry…
  • plugins/toolchain/skills/check/SKILL.md: --propose-records &lt;dir&gt; argument (argument-hint and Arguments line) and section 5, Propose records
  • plugins/toolchain/reference/resolution-ladder.md: Unattended runs names /toolchain:check --propose-records as the drafter of a lane's record pull request
  • docs/skill-cheat-sheet.md: regenerated row for the new argument-hint (validate-plugins cheat-sheet drift check)
  • .changes/toolchain/work-resolve-issue-issue-15734-45615963224-1-36f7418b.md: minor changelog fragment

Verification

The runner ran each check from the base copy against 16ac39a:

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

The run reports:

  • check-changelog-fragments: all 31 fragments valid
  • check-changed-skills: plugins/toolchain/skills/check PASS, 0 errors, 4 advisory warnings (body size and a pre-existing numbered-procedure warning)
  • check-affected: 16 passed, 11 skipped, 0 failed after fixing two failures it reported (the Arguments. line did not lead with the new argument-hint; docs/skill-cheat-sheet.md drift)
  • fresh-context review subagent over the whole diff: two HIGH and several MEDIUM findings, all fixed
  • second fresh-context subagent hand-traced every test against the rewritten script: found a literal U+2028 in a regex that would stop the module parsing, fixed by moving to a pure-ASCII code-point check; with that fixed it traced all 37 cases as passing
  • Grep for non-ASCII bytes in the scripts directory: none
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/45615963224

Review follow-up: two write-mode cases on a committed git fixture cover the rule that a cited file must be tracked and unchanged from the merge-base with the default branch. One cites an untracked AGENTS.md line, and the other cites a Makefile line edited after the commit. The git setup is shared with the --base verify case.

Second review follow-up: write mode now finds the default branch in an actions/checkout workspace, which sets no refs/remotes/origin/HEAD. When that ref is missing, the script asks the remote with git ls-remote --symref, the same detection the skill's branch diff uses, and accepts the named branch only when a local tracking ref exists. It still exits 2 when the remote names no such branch. A new case fetches from a local bare remote with no remote HEAD ref and shows a draft is written and a file changed after the merge-base is refused. The address-feedback lane did not run the suite. check-affected passed over the change (16 passed, 11 skipped), and CI runs the tests on the pushed head.

Left out: the items under Not verified.

Related

#15734

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-review: 1 inline finding(s) on 16ac39a22ab0b10251fa344b11ca192b2652b2ec; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

claude-review: incremental re-review of head b1715634 against 2af7a4ce. I read the whole change in both files in scope (2 of 2). This lane has reviewed earlier heads, so this review is blocking only. I found no blocking issues.

The blocking finding from the last review is fixed. That finding was about lane-record.test.mjs: the "no remote HEAD ref" regression test committed a change to CLAUDE.md before it drafted THREE. The draft cites CLAUDE.md:3, so unchanged() refused it and drafted.status was 1, not 0.

  • This push makes the commit before the draft an unrelated README.md change (lane-record.test.mjs:382-383). That is the same setup the passing default-branch test uses at L342-L343.
  • The draft now goes through the ls-remote fallback with every cited file unchanged from the merge-base.
  • The CLAUDE.md edit and commit now come after the draft (L388-L389), so the CLAUDE.md:4 case still checks the refusal against origin/<branch>.

SKILL.md: one wording change. "an actions/checkout workspace" now reads "a GitHub Actions checkout". It means the same thing and changes no behavior.

Scope notes

  • Closing issue: none. The PR only references Add the lane record writer that refuses any command the run did not log #15734, so I checked no acceptance criteria.
  • Manifests: this push changes no plugin.json or marketplace.json.
  • Loosened checks would be marked: fail, with 0 patterns. That is the default, because the prompt had no loosened_check_verdict: or loosened_check_patterns: line. This push loosens nothing. The prompt had no decision-record line, so I did not check the citation requirement.
  • Security: left to the separate security lane.
  • Verification: I did not run the test suite, because this lane has no shell. Both conclusions come from reading the test and the code it exercises. Any verification the PR body describes is the author's claim and I have not checked it.

Verifier dropped 0 of 0 candidates.

@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 16ac39a22ab0b10251fa344b11ca192b2652b2ec; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #19046, incremental (2af7a4c → b171563)

I found no security issues in this change.

This lane already reviewed an earlier head of this pull request, so this pass reports only CRITICAL and IMPORTANT findings. In .claude-lane/incremental.diff I read the whole change to both files in scope: plugins/toolchain/skills/check/SKILL.md and plugins/toolchain/skills/check/scripts/lane-record.test.mjs.

What changed:

  • SKILL.md: in section 5, the phrase "the only source in an actions/checkout workspace" now reads "the only source in a GitHub Actions checkout". The wording changed, but the rule did not: the same sources, refusals and exit codes are described. No guardrail was removed, narrowed or softened, so the instruction-surface lens has no finding.
  • lane-record.test.mjs: the no-remote-HEAD test now writes the draft after an unrelated README.md commit, and only then commits the CLAUDE.md edit and checks that citing the edited line is refused. This is test ordering only. It does not touch lane-record.mjs, and the refusal check stays the same.

Security relevance: none. Neither change touches a workflow, action, token request, kill switch, merge hold, trusted-actor list, plugin manifest or hook.

Prior findings: the earlier inline SUGGESTION on lane-record.mjs L529-531 is marked as changed since it was posted. This push does not touch that file, and a SUGGESTION is out of scope in a blocking-only pass, so I did not repeat it.

PR context: the description contains no instructions to this lane.

critical-findings: 0

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

Unattended merge: superseded. The pr-merge lane armed native auto-merge at head b1715634e92bb6e3e9bf2ff6beefe301d9b2b8b3, so the unarmed note this comment held no longer stands; its edit history keeps the reasons.

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

Copy link
Copy Markdown
Contributor Author

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

@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 25, 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=19046 -f activity=address-feedback

…er HEAD

verify now refuses to run without --base (usage error, exit 2) and reads
every cited source at that commit, whatever its kind. Before, verify
without --base read CLAUDE.md, AGENTS.md, rules, package.json, Makefile,
justfile and build entry points from the working tree and compared them
only with HEAD, which in a consumer's PR CI is the PR head, so a line the
PR adds could back the record it proposes. Requiring --base removes that
path, and the special case refusing only record lines without --base is
no longer needed.

write now refuses a cited file that differs from --base, or by default
from the merge-base with the default branch, found by the same remote
order the check skill's branch-diff script uses (tracked remote, origin,
the rest, each by its refs/remotes/<remote>/HEAD). The draft's PR is
opened from the default branch, so a line the lane branch committed must
not support it. In a git repository with no detectable default branch,
write exits 2 naming --base rather than guess. Outside a git repository
there is no base to compare with, as before.

Tests: verify without --base exits 2; a PR-added CLAUDE.md line plus
record is refused with --base and no longer passes without it; write
refuses a CLAUDE.md line committed on the branch, against the default
branch and against an explicit --base; write and verify still pass
sources the branch left unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 25, 2026

@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: 1 inline finding(s) on d345c4ab185bab69e1b490849deb037c6fe05ad0; the summary is in this lane's pull request comment.

claude-lane: claude-review

kyle-sexton and others added 2 commits November 25, 2026 09:13
plan-test-lanes.sh refused the new Node suite because no lane runs it:
it had no sibling .test.sh and no test-node package holds it. The
wrapper follows fingerprint.test.sh, so the bash lane runs it. No test
count change: the same 43 tests now run in CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM67718j
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

kyle-sexton and others added 3 commits November 25, 2026 09:29
lane-record.mjs lists npm's real misspelled command aliases (isntall,
instal, udpate) and a shell-name regex fragment (ba), which failed the
Lint Repo spell check. _typos.toml allows those four words in that file
only; the same words in any other file still fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d.mjs

The extend-words entry allowed isntall, instal, udpate and ba anywhere in
lane-record.mjs, so a real misspelling of those words in that file
would pass. extend-ignore-re now skips only the quoted alias strings and
the (?:ba| regex fragment; the same words elsewhere in the file still
fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…DE.md edit

The test edited CLAUDE.md, then expected the three lines citing it to
draft. write compares the whole cited file with the merge-base, so all
three were refused and Test Bash failed. The draft now runs after an
unrelated README change; the CLAUDE.md edit and its refusal follow.

SKILL.md cited actions/checkout in a code span, which check-skill reads
as a skill-internal path; it now names a GitHub Actions checkout in
plain text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head b1715634e92bb6e3e9bf2ff6beefe301d9b2b8b3, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: unrated reason=pending

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 0e60cfd Nov 25, 2026
50 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15734-45615963224-1 branch November 25, 2026 15:16
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 4, survived 3, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 57%; mutation score 57%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/toolchain/skills/check/scripts/lane-record.mjs 4 3 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/toolchain/skills/check/scripts/lane-record.mjs:39 ROR unclassified none
plugins/toolchain/skills/check/scripts/lane-record.mjs:246 ROR unclassified none
plugins/toolchain/skills/check/scripts/lane-record.mjs:393 SBR unclassified none

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 0e60cfd01cddbf2880a8c1cbe8e897182393ef13; later checks count it verified from this comment.

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