Skip to content

refactor(attribution): simplify audit stamp, breadcrumb and findings scripts - #14837

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14413-42681132742-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14413

Summary

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

Shortened check-stamps.sh, emit-findings.sh and extract-breadcrumbs.sh by 301 deleted against 82 added lines. Most of the cut is history narration and corpus-measurement stories in comments; the rule each comment states is kept. Code changes are small and behavior-equivalent: one TRIGGER_LESS_BOOL replaces two inline true/false substitutions, a require_no_mode() helper replaces two copies of the --dir/--files exclusivity check, a jq key_slot($k) replaces three copies of the case-folded key lookup, and stray_verdict now reuses names_in. I made the edits mostly deletions so the PR stays under the issue's 400-changed-line cap.

Not verified

  • The script test suites (check-stamps.test.sh, emit-findings.test.sh, extract-breadcrumbs.test.sh) could not be run in this lane: Bash runs only the named wrappers. Left to the PR's CI.
  • ci-status green is a PR check, left to the PR's CI.
  • Tidy not run: the change is about 390 changed lines, over the 300-line tidy cutoff.
  • Untracked files in the checkout that this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) were left untouched; they look like runner environment files and do not belong in the patch.

Fix

  • plugins/attribution/skills/audit/scripts/check-stamps.sh: compute TRIGGER_LESS_BOOL once for --show-config and the JSON output; trim the header, may_form, keyword_window and classifier comments
  • plugins/attribution/skills/audit/scripts/emit-findings.sh: add jq key_slot($k) behind tier_slot, verdict_slot and searched_here; rewrite stray_verdict as [ . ] | names_in | any(is_verdict_name); trim the header, tier-reader, gate, record-stream and composition comments
  • plugins/attribution/skills/audit/scripts/extract-breadcrumbs.sh: add require_no_mode() for the --dir/--files exclusivity check; trim the may_form, is_stamp and window comments
  • .changes/attribution/work-resolve-issue-issue-14413-42681132742-1-8605a411.md: patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

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

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

The run reports:

  • check-changelog-fragments: all 12 fragments valid
  • check-changed-skills: plugins/attribution/skills/audit PASS, 0 errors (5 existing warnings about SKILL.md size and rubric.md, none from this diff)
  • check-affected: 13 passed, 6 skipped over 4 changed files
  • git-read diff --numstat HEAD: 82 added and 301 deleted lines in the three scripts, plus a 7-line fragment, 390 in total, under the 400-line cap; only the listed files and one fragment changed
  • Fresh-context review subagent: all four code changes behavior-equivalent and no apostrophe inside the single-quoted awk/jq programs; it flagged three edited comments as inaccurate, and I fixed all three
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42681132742

Left out: the items under Not verified.

Related

#14413

Merge-Risk: max=LOW demote=false head=db51a144c40d8798e95b764c7fe741445c8689ff rubric=8.2.0 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14837 (refactor(attribution): simplify audit stamp, breadcrumb and findings scripts)

I found no security issues. I read every hunk of all 4 changed files. None of them matches a trusted-path glob.

What changed. Most of the diff deletes comments: history and corpus-measurement narration in check-stamps.sh, emit-findings.sh and extract-breadcrumbs.sh. There is also a changelog fragment. I checked the four code changes and none of them changes behavior:

  • check-stamps.sh: TRIGGER_LESS_BOOL is now set once, from the same TRIGGER_LESS_CHECK -eq 1 test. It replaces two inline true/false substitutions that printed the same values, one in --show-config and one in the JSON output.
  • extract-breadcrumbs.sh: require_no_mode() runs in the main shell, not a subshell, so its exit 2 still ends the script. The error message is unchanged.
  • emit-findings.sh, key_slot($k):
    • tier_slot, verdict_slot and searched_here all go through key_slot($k), with the same type == "object" guard and the same ascii_downcase comparison.
    • The relay boundary is the check that keeps judgment verdicts out of the findings file. It reads the same keys as before.
  • emit-findings.sh, stray_verdict:
    • The new form, [ . ] | names_in | any(is_verdict_name), expands to [ . | .. | (strings, (objects | keys[])) | norm ]. That is exactly the old expression.
    • names_in is defined earlier in TIER_DEFS, so the reference resolves.
  • Quoting: none of the new comment lines inside the single-quoted jq and awk programs contains an apostrophe, so the quoting still holds.

Controls touched. None. The change leaves the trusted-trigger check, lane tokens, the kill switch, the token broker, merge holds and the plugin manifests alone. No standing instruction (CLAUDE.md, AGENTS.md, skill or agent body, hook list) changes; the deleted text is only code comments.

Embedded text. The PR context contains no instructions aimed at this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14837 (simplify the attribution audit scripts)

No blocking or advisory findings. I read every hunk of all 4 changed files. None of them matches a trusted-path glob.

Do the code changes behave the same? (checked by reading the code, not by running it)

  • check-stamps.sh, TRIGGER_LESS_BOOL: It is set once, at L166-L167, after the last assignment to TRIGGER_LESS_CHECK. Nothing reassigns TRIGGER_LESS_CHECK before the --show-config echo (L172) or the JSON printf (L485).
    • The script runs set -uo pipefail with no -e and no ERR trap, so the [[ … ]] && … line cannot abort when the test is false.
    • Output is still true or false.
  • extract-breadcrumbs.sh, require_no_mode(): MODE is a global set to "" at L40. The helper prints the same message and exits 2, and the call order relative to require_opt_value is unchanged.
  • emit-findings.sh, key_slot($k): It is the same case-folded to_entries lookup the three copies did. tier_slot, verdict_slot and searched_here produce the same output streams, including inside .. | objects | searched_here.
  • emit-findings.sh, stray_verdict: The new form is [ . ] | names_in. Because names_in is [ .[] | .. | … | norm ], applying it to [ . ] gives exactly the old [ .. | (strings, (objects | keys[])) | norm ]. That includes null and scalar inputs.
  • Comments inside the quoted jq programs: None of the comments added inside the single-quoted TIER_DEFS or record-stream jq programs contains an apostrophe, so neither shell string is cut short.
  • The edited comment at L336, which now says "U" (or "W"), is accurate. L353 sends a non-object record to W when stray_verdict holds.
  • Cross-references in the remaining comments still resolve. In extract-breadcrumbs.sh, "as check-stamps.sh notes at the same rule" and "carries the same body and its known costs" point at text that is still in check-stamps.sh (the may-rule note and the "Known costs" paragraph).

Closing issue #14413 acceptance criteria

  • Behavior unchanged: met, judged by reading the code (above). The existing suites check-stamps.test.sh, emit-findings.test.sh and extract-breadcrumbs.test.sh cover these paths. The author says they did not run them, and I could not run them either.
  • Edits only the listed files plus a fragment: met.
  • Within 400 changed lines: met. The diff is 82 added and 301 deleted in the scripts, plus a 7-line fragment, for 390. I counted this from the diff myself.
  • ci-status green: depends on the PR's CI, so I have not verified it.
  • Fragment: met. bump: patch, a ### Changed heading, and the exact line "Internal simplification, no behavior change."

The author's test results, check runs and fresh-context review claims are their own, and I have not checked them. I found no embedded instructions in the PR context, and no plugin manifest changed.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head db51a144c40d8798e95b764c7fe741445c8689ff, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for db51a14

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14837-db51a144c40d8798e95b764c7fe741445c8689ff, expires on 2026-12-09.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 39955d7 Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14413-42681132742-1 branch November 9, 2026 23:58
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 86%; mutation score 86%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/attribution/skills/audit/scripts/check-stamps.sh 2 0 0 0 0 0
plugins/attribution/skills/audit/scripts/emit-findings.sh 3 0 0 0 0 0
plugins/attribution/skills/audit/scripts/extract-breadcrumbs.sh 1 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/attribution/skills/audit/scripts/extract-breadcrumbs.sh:70 SBR productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 39955d71490929d8c2f03f74a1cea1aab0946320; 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.

Simplify the audit attribution plugin code (1 of 2)

0 participants