Skip to content

fix(guardrails): report reference-verify findings at their line and honor the entry's decline - #10824

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-9843-40797483321-1
Oct 29, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-9843-40797483321-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9843

Summary

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

reference-verify.sh now reports each finding at the first line it judged that holds the flag, cited path or skill reference the finding names, falling back to the file's first added line. Before, every finding in a file carried the first added line, so line 1 for a new file. It also reads checks.guardrails.reference-verify.declined (else checks.git-hooks.declined, the same way install.mjs reads them) and exits 0 without checking when declined, so consumers of the lefthook remote, whose fetched copy no installer removes, can turn it off. Per the recorded decision, defects 1 and 3 were already fixed by #9852, and the time bound moved to #9861 (Refs #9861).

Not verified

  • reference-verify.test.sh and lefthook-remote.test.sh were not executed: this lane runs no test runner or interpreter. Left to the PR's CI.
  • The acceptance criterion 'The issue links #9861 for the time bound' needs a comment on the issue, which this lane cannot post; the PR body carries Refs #9861 through the summary.
  • tidy: ai-slop's detector (detect.sh) is not among the wrappers this lane may run, so pass 4 read the two markdown passages against the catalog by hand and wrote no findings file.
  • The new-changelog-fragment helper refuses a detached HEAD, so the fragment was written by hand in the existing fragments' format; check-changelog-fragments accepts it.
  • git status lists untracked files that are not part of this change (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc); this run did not create them, and they should stay out of the patch.
  • Line mapping matches by substring: a short flag or a common command name can match an earlier added line, and a command split across a line continuation, or a path the verifier normalized, falls back to the first added line. Every such result is still a line the push added.

Fix

  • plugins/guardrails/git-hooks/reference-verify.sh: reads the decline keys before checks_init and exits 0 when declined; new report() maps each verifier detail line (flag with its command, path, skill reference) to the first judged line that holds it, gives each heading its first detail's line, passes
  • plugins/guardrails/git-hooks/reference-verify.test.sh: expected lines for whole-file findings updated to the true line (a"b.sh:3, big.sh:2502, tool.sh:2); new cases: a finding in the second of two added hunks (run.sh:5), a new markdown file's code span at line 5 (heading and detail), and the decline
  • plugins/guardrails/git-hooks/lefthook-remote.test.sh: end-to-end case where the consumer declines the entry and the push that was blocked now passes
  • plugins/guardrails/README.md: the reference-verify row says the entry reads the decline itself (so it stops on the lefthook remote too) and that each finding names the matched line
  • .changes/guardrails/fix-9843-reference-verify-line-and-decline-5d1c2a83.md: new patch fragment under Fixed for both changes

Verification

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

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • check-changelog-fragments: all 7 fragments valid (run before and after tidy and the review fix)
  • check-affected: 12 passed, 6 skipped over 5 changed files (run before and after tidy and the review fix)
  • fresh-context review subagent over the whole diff: one finding (awk -v decoded backslash escapes in the printed path), fixed by passing the path through ENVIRON; it traced each test's expected line number against the range and verifier logic and found them consistent, and confirmed the new tests fai
  • tidy-diff over all 19 changed hunks: one wording edit to the changelog fragment, no code edits
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40797483321

Left out: the items under Not verified.

Related

#9843

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

Copy link
Copy Markdown
Contributor

claude-security-review reviewed d31f41247df9746f34f0513e38b845ae49e364ee: 0 finding(s), 0 as inline comments.

No security findings in PR #10824 at d31f412. I read the full diff and the PR context. None of the five changed files match the trusted-path list, and there is no manifest, trust-control or instruction-surface change.

  • The new decline check in reference-verify.sh (lines 72-78) reads the pusher's local git config. A pull request or a cloned repository can't set that value, so a PR author can't switch the check off for someone else. It is a local pre-push check, not a merge hold, token scope or kill switch, so it widens no trust control. A non-boolean value makes git config --type=bool exit 128, so the check still runs.
  • The new report() awk function treats file content and verifier output as data. It uses index() and a fixed printf "%s:%s: %s\n" and never evaluates that data. The path goes through ENVIRON, and first, ranges and file are a number and temp-file paths.
  • The check_range change writes the tip's text to a temp file and builds the jq payloads with --arg / --rawfile as before. File content is not interpolated into shell.
  • The test, README and changelog changes have no security surface.

critical-findings: 0

No spend beyond the repository's existing CI.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed d31f41247df9746f34f0513e38b845ae49e364ee: 1 finding(s), 0 as inline comments.

Code review: PR #10824 (reference-verify line and decline)

I found no correctness defect in the code or tests. One acceptance criterion from #9843 is still open. I could only read the diff and the repository files. I ran no tests, so nothing below is independently run, and the PR's verification claims are author-claimed and unverified by me.

What I checked

  • Decline read. reference-verify.sh:51-57 matches install.mjs:463-471. The entry key is read with git config --type=bool --get, and only exit status 1 (unset) falls back to checks.git-hooks.declined. A non-boolean value gives status 128, which does not decline, as in configBool. The read runs before checks_init, so a declined entry creates no temp dir and installs no trap. It also covers the lefthook-remote wrapper, since the wrapper execs this script.
  • Line mapping. In report(), each detail line maps to the first line the push judged that holds its flag and command, path or reference. A heading takes its first detail's line. The unindented trailing note that stale-path-verify.sh:902 adds ("A path cited as a deletion record is correct as written.") falls back to the file's first added line. That is cosmetic.
  • Ranges. judged() restricts matches to the added ranges, or to every line when the file is judged whole. The ranges are in tip-file line numbers, the same numbering as $CHECKS_TMP/file. Passing the path through ENVIRON avoids awk's backslash decoding for quoted file names.
  • Tests. The new cases cover the second hunk (run.sh:5), a markdown code span (docs/guide.md:5, heading and detail), the entry key, the master key, the entry's false beating the master's true, and the wrapper path. The lefthook-remote test checks that a push blocked before the decline passes after it. I traced the small fixtures by hand and they are consistent. I did not trace big.sh:2502.
  • Spend. The change adds no billable or prepaid spend.

Finding (advisory): an acceptance criterion in #9843 is not met by the change

The issue's third acceptance criterion reads: "The issue links #9861 for the time bound." The PR body says it carries only Refs #9861, and the lane could not comment on the issue. Nothing in the diff can satisfy this, so a person needs to add the link on #9843. Until then the box stays unchecked.

Manifest items: no plugin.json or marketplace.json changes. The patch fragment's bump: patch fits a bug fix with no new surface.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit d93fb14 Oct 29, 2026
45 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-9843-40797483321-1 branch October 29, 2026 02:33
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 7, survived 0, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 100%; mutation score 100%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/guardrails/git-hooks/reference-verify.sh 4 0 0 0 0 0
plugins/source-control/skills/pull-request/scripts/review-venue.sh 3 0 0 0 0 0

The run's summary has the full report.

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(guardrails): reference-verify flags a quoted claude -p prompt and blocks every push that merges main

0 participants