Skip to content

refactor(attribution): read audit settings through one YAML-first reader - #10542

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-10538-40593006900-1
Oct 27, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-10538-40593006900-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #10538

Summary

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

The attribution audit's four detectors now read their settings through one reader in lib.sh (cfg_scalar, cfg_list). It resolves each layer's YAML first (<home>/attribution.yaml, <home>/attribution.local.yaml, per ADR 0075) and falls back to the .claude/ JSON per file, and every --show-config value names the layer that supplied it. No YAML is committed, so this repository still reads .claude/attribution.json and behaves as before.

Not verified

  • The issue's test commands (scripts/run-test-file.sh on check-stamps.test.sh, list-corpus.test.sh, sweep-ledger.test.sh) and the new lib.test.sh and changed score-golden.test.sh were not executed: this lane's Bash runs only the named wrappers, and check-affected ran without --tests. Left to the PR's
  • scripts/check-changelog-fragments.sh --check-required origin/main was not run with that argument (the lane wrapper runs it without arguments); check-affected's changelog-fragments step, which runs --check-required against the base, passed
  • check-affected skipped validate-plugins sub-checks, typos (not installed) and changed-skills (runs the checked tree's own code) for the SKILL.md edit; left to the PR's CI
  • lib.test.sh is created 0644; the lane's apply-patch sets the exec bit on new #! files, as check-affected's exec-bit step assumes
  • The shared reader uses local -n, so the audit scripts now need bash 4.3 or newer (they already needed 4.0 for declare -A); the ai-slop reader has the same floor. Not otherwise addressed
  • /attribution:setup still writes only the .claude/ JSON files, and the config-cascade README's adoption table still lists .claude/attribution.json; per the issue, moving the settings and setup belongs to slices 2 and 3 of #9729

Fix

  • plugins/attribution/skills/audit/scripts/lib.sh: cfg_layers_init resolves the convention home via resolve-convention-home.sh and picks each layer's YAML, else its .claude JSON; the new shared readers cfg_scalar (dotted key, optional validation pattern) and cfg_list (presence-keyed list replace) set
  • plugins/attribution/skills/audit/scripts/check-stamps.sh: per-script jq reader replaced by cfg_scalar; --show-config now names the real layer (the old reader ran in a command substitution, so CFG_SOURCE never reached the caller)
  • plugins/attribution/skills/audit/scripts/list-corpus.sh: cfg_array replaced by cfg_list; --show-config names the layer behind excluded_paths
  • plugins/attribution/skills/audit/scripts/score-golden.sh: cfg_num replaced by cfg_scalar with a numeric pattern; --show-config names each gate's layer
  • plugins/attribution/skills/audit/scripts/sweep-ledger.sh: inline jq loop replaced by cfg_scalar; status exit 4 and the jq notice apply only when a JSON layer is present
  • plugins/attribution/skills/audit/scripts/lib.test.sh: new suite for the reader covering the JSON fallback, YAML winning when both exist, overlays, the user-global layer, per-layer value attribution, validation, unparseable YAML, BOM and quoted keys, non-list JSON values, the bound convention home, a
  • plugins/attribution/skills/audit/scripts/check-stamps.test.sh, list-corpus.test.sh, sweep-ledger.test.sh, score-golden.test.sh: YAML-layer cases plus assertions that --show-config attributes each value to its layer
  • plugins/attribution/lib/parse-concern-value.sh, yaml-subset.awk, resolve-convention-home.sh: generated shared copies (sync-shared-copies)
  • scripts/shared-copies.txt: the three attribution copies registered
  • plugins/attribution/skills/audit/SKILL.md: Configuration names the YAML layers and their JSON fallback; step 7 reads .separation from a YAML layer as well as a JSON one
  • plugins/attribution/README.md: Configuration names the YAML layers, the fallback, and quoting a glob that starts with *
  • plugins/attribution/skills/audit/reference/source-fetch.md: points at SKILL.md Configuration instead of naming .claude/attribution.json
  • plugins/attribution/prerequisites.json: the jq degrade note says only JSON layers need jq
  • .changes/attribution/refactor-10538-attribution-yaml-reader-5b7e2c91.md: minor changelog fragment

Verification

The runner ran each check from the base copy against 004abfd:

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

The run reports:

  • .lane/verify/bin/sync-shared-copies: generated the three plugins/attribution/lib copies, exit 0
  • .lane/checks/bin/check-changelog-fragments: all 6 fragments valid
  • .lane/checks/bin/check-affected: first run failed shellcheck (SC2154 on nameref-assigned globals in score-golden.sh, SC2034 on CFG_SOURCE in lib.sh); after fixes, 12 passed, 6 skipped over 19 changed files
  • fresh-context review subagent over the whole diff: no regression for JSON-only configs, and every new test assertion passes when traced by hand. Fixed what it found: SKILL.md step 7 read .separation with jq only, SKILL.md claimed setup manages the YAML, an unparseable YAML layer was dropped silently
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40593006900

Left out: the items under Not verified.

Related

#10538

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

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

No security findings.

Scope: the incremental change since 004abfd, which touches only plugins/attribution/skills/audit/scripts/lib.test.sh.

The change respells "unparseable" as "unparsable" in three assert_eq description strings (lines 132, 135 and 137 of the test). Each run still compares the same values and asserts the same behavior. The change touches no production code, trust control, workflow, manifest or instruction surface. It is not on the trusted-path list and has no security-relevant surface, so the skip gate applies (item 2).

I did not re-review the other 18 files. They are unchanged since the last review.

critical-findings: 0

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 72555b33fc4ace5110e8d90a8ce59691b7d6a4e1: 0 finding(s), 0 as inline comments.

Incremental review of plugins/attribution/skills/audit/scripts/lib.test.sh since 004abfd. The change renames "unparseable" to "unparsable" in three assert_eq description strings (lines 132, 135, 137). It changes no logic, assertion values or expected output. I grepped the attribution plugin: the wording now matches emit-findings.test.sh and emit-findings.sh, and no other file matches on the old spelling. No findings. I ran no tests. The other 18 files are unchanged since the last review.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 72555b33fc4ace5110e8d90a8ce59691b7d6a4e1.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 7862ba0 Oct 27, 2026
45 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-10538-40593006900-1 branch October 27, 2026 23:27
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

  • Range: 1c28066..7862ba0
  • Merged pull request: #10542
  • Outcome: no result. The run's summary says why.

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.

refactor(attribution): read audit settings through one YAML-first reader

0 participants