Skip to content

feat(code-metrics): run the metric audits across several repositories via the target-scope contract - #17295

Merged
melodic-automation-lanes[bot] merged 6 commits into
mainfrom
work-resolve-issue/issue-17231-44405815518-1
Nov 19, 2026
Merged

melodic-automation-lanes[bot] merged 6 commits into
mainfrom
work-resolve-issue/issue-17231-44405815518-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #17231

Summary

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

The four code-metrics audits (audit, audit-coverage, audit-duplication, audit-suppressions) now take the target-scope forms by citing the shipped contract copy. The plugin-specific differences are written once in a new reference/several-repositories.md instead of four times. In a multi-repository run, each repository's script runs from its own root, because root, config and state key all come from the working directory (entry-common.sh, persist-report.sh, lib/state-key.sh). So kept trend baselines and --findings files stay with their repository. A repository other than the session's own is measured only when its checkout is clean at the remote default branch, and over its whole tree unless --all, paths or --base are given. With no target form, every skill runs as before. JSON decision: one document per repository, not a new repository field. Basis: every code-metrics/v2 path is relative to its document's root.path (report-schema.md "Path relativity"), the clone trend compares documents of one project, and /verification:measure metrics compares two documents. A merged document would break all three, and the schema stays unchanged. Eval case: the existing evals for these skills (for example audit-suppressions-count-quoted and audit-size-reports-the-change-with-provenance-and-no-verdict) load the changed SKILL.md text when run, but none exercises a target form.

Not verified

  • docs/skill-cheat-sheet.md was edited by hand, not regenerated with node scripts/generate-cheatsheet.mjs: this lane cannot run node. Only the argument-hint cells changed. CI's cheat-sheet drift check confirms it.
  • /code-metrics:audit's argument-hint reads [--repo <repo>...] (no space before the ellipsis), not the issue's [--repo <repo> ...]. The spaced form puts the hint at 101 characters, over the 100-character budget the plugin validator enforces. The three sibling skills use the spaced…
  • allowed-tools was not widened for the git fetch, status and cd calls a multi-repository run needs. several-repositories.md says these calls may prompt for permission.
  • Tidy skipped: the change touches 14 files, over the 10-file cutoff, and includes scripts/shared-copies.txt under the shared scripts/ path.
  • Several checks only run in the PR's CI (code-metrics-skill-prose, code-metrics-config-reference, lychee, eval-cases, comment-lint and the other CI-only checks check-affected listed), and so did comment-hygiene, whose fetch was blocked here.
  • No eval case exercises a target form. The existing audit evals read the changed SKILL.md text but run single-repository.

Fix

  • plugins/code-metrics/reference/several-repositories.md: new. Covers where each repository's script runs, which tree it reads, the scope default, the relative-path rule, one document per repository with its basis, the merged markdown order, per-repository state, the --findings write, and the pointer…
  • plugins/code-metrics/reference/target-scope.md: new generated copy of docs/contracts/target-scope/README.md.
  • plugins/code-metrics/skills/audit/SKILL.md: argument-hint gains [--repo <repo>...]; standing rule pointing at several-repositories.md; target forms are never passed to a script; size --check takes no target form.
  • plugins/code-metrics/skills/audit-coverage/SKILL.md: argument-hint gains [--repo <repo> ...]; paragraph on the target forms and per-root --artifacts.
  • plugins/code-metrics/skills/audit-duplication/SKILL.md: argument-hint gains [--repo <repo> ...]; paragraph on per-repository clones, trend and registries, and /coupling:reduce for copies between repositories.
  • plugins/code-metrics/skills/audit-suppressions/SKILL.md: argument-hint gains [--repo <repo> ...]; paragraph on per-repository correctness rules and findings files.
  • docs/contracts/target-scope/README.md: Adopters table lists the four code-metrics audits.
  • plugins/architecture/reference/target-scope.md, plugins/coupling/reference/target-scope.md: regenerated from the edited contract.
  • scripts/shared-copies.txt: registers plugins/code-metrics/reference/target-scope.md. scripts/cross-plugin-source-registry.txt already covers it through its plugins/*/reference/target-scope.md glob, so it is unchanged.
  • docs/skill-cheat-sheet.md: argument-hint column updated for the four rows, edited by hand to match the frontmatter.
  • .changes/code-metrics/work-resolve-issue-issue-17231-44405815518-1-49c6f57b.md: minor fragment.
  • .changes/architecture/work-resolve-issue-issue-17231-44405815518-1-5c8608f9.md, .changes/coupling/work-resolve-issue-issue-17231-44405815518-1-b1099b89.md: patch fragments for the regenerated contract copies.
  • plugins/improvement/reference/target-scope.md, plugins/docs-naming/reference/target-scope.md: regenerated copies (Adopters table keeps main's docs-naming rows beside the code-metrics row after the merge of main); .changes/improvement/work-resolve-issue-issue-17231-44405815518-1-3b9c4e61.md and .changes/docs-naming/work-resolve-issue-issue-17231-44405815518-1-2204665e.md: patch fragments for them

Verification

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

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

The run reports:

  • sync-shared-copies --check: all 963 registered copies match their canonical sources
  • check-changelog-fragments: all 9 fragments valid
  • check-changed-skills: 4 skills checked, 0 failed. The warnings are pre-existing description and body-length advisories, plus body growth of 5 to 6 lines per skill.
  • check-affected: first run failed validate-plugins because the audit argument-hint was 101 characters, over the 100-character budget. Shortened to [--repo <repo>...]; the rerun passed (14 passed, 8 skipped).
  • fresh-context review subagent over the diff: 8 findings. Fixed 1-7: suppressions/v1 has no root.path, --findings is a write, absolute paths, --base keeps change mode, fallback when origin/HEAD is missing, type-debt ordering, user-global registries. Finding 8 (multi-repository git calls are not in…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44405815518

Left out: the items under Not verified.

Related

#17231

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

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44408827836

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

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

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #17295, code-metrics audits across several repositories

Blocking only. This lane already reviewed two earlier heads of this PR, so this pass reports only blocking findings.

I read every hunk of all 10 changed files in .claude-lane/pr.diff. This head merges main, which moved the contract's Adopters table into docs/contracts/target-scope/adopters.md. The code-metrics row now goes in that file, so the canonical README.md and the other plugins' copies of it are no longer part of this diff.

Blocking findings

None. The change is prose and registration only; no script changed. Checked against the "Done when" list in #17231:

  • Target forms: met. Each of the four skills cites ${CLAUDE_PLUGIN_ROOT}/reference/several-repositories.md, which cites the shipped contract copy. Each argument-hint gains --repo. /code-metrics:audit shows [--repo <repo>...] with no space before the ellipsis. The PR says this keeps the hint within the validator's 100-character limit; that is the author's claim, and I did not check it.
  • No target form: met. The new reference says nothing in it applies without a target form, and each skill's added text covers only target forms.
  • State per repository: met. The duplication trend baseline and the --findings files stay in each repository.
  • Generated copy: met. I compared plugins/code-metrics/reference/target-scope.md with docs/contracts/target-scope/README.md at head: they match apart from the generated header. The copy is registered in scripts/shared-copies.txt. scripts/cross-plugin-source-registry.txt:62 covers it through the existing glob plugins/*/reference/target-scope.md.
  • Adopters table: met. docs/contracts/target-scope/adopters.md:11 lists all four audits.
  • Cheat sheet: the four hint cells match each skill's frontmatter. They were edited by hand, not regenerated with node scripts/generate-cheatsheet.mjs. The PR says CI's drift check confirms them; I did not verify that.
  • Changelog: met. The .changes/code-metrics/ fragment is minor.
  • Eval case: met. The PR body says no eval case exercises a target form, which this criterion accepts.

Earlier finding

The inline thread on plugins/code-metrics/skills/audit/SKILL.md:21-22 is settled. It was fixed with the suggested wording, and those lines haven't changed since it was resolved.

No plugin manifest changed, so there are no manifest lines.

Loosened-check verdict: fail (default, because the prompt gave no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. No changed file loosens a check. The prompt also gave no loosened_check_decision_record: line, so I did not check the citation requirement.

Verifier dropped 0 of 0 candidates.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: no issues found (blocking only)

This lane already reviewed an earlier head, so this review reports only CRITICAL and IMPORTANT findings. There are none.

The change is still documentation and skill text only. The four code-metrics audits can now run over several repositories using the target-scope contract. The new head merges main and moves the code-metrics Adopters row into docs/contracts/target-scope/adopters.md. The shipped contract copy (plugins/code-metrics/reference/target-scope.md) now points to that file instead of carrying the table. The regenerated architecture, coupling, docs-naming and improvement copies and their changelog fragments are gone from this diff.

What changed:

  • the new plugins/code-metrics/reference/several-repositories.md;
  • the new generated contract copy plugins/code-metrics/reference/target-scope.md;
  • a --repo argument hint and one paragraph or rule in each of the four SKILL.md files;
  • one Adopters row in docs/contracts/target-scope/adopters.md;
  • the scripts/shared-copies.txt registration, the cheat-sheet rows and one changelog fragment.

No changed file matches a trusted path. The diff touches no plugin manifest, workflow, action, hook, allowlist, trust control or merge hold.

What I checked:

  • Tool permissions are unchanged. Each skill keeps the allowed-tools line it had before, for example audit/SKILL.md#L6. The new cd <root>, git -C <root> fetch and git -C <root> status calls are not pre-approved, so they still ask for permission, as several-repositories.md#L17-L18 says.
  • Untrusted input does not choose what is read or run. The user names the repositories, and each must already be cloned locally; the contract forbids cloning during a run. A repository other than the session's own is measured only when its checkout is clean and at the remote default branch.
  • Writes stay inside each repository. The only write is --findings, into each repository's own memory root. Absolute paths are refused before the run fans out (several-repositories.md#L29-L34).
  • No guardrail is removed. The only standing rule edited is the audit skill's Variables line. It now keeps the target forms out of what reaches the scripts, which narrows their input.
  • The settled thread stays settled. The thread on audit/SKILL.md lines 21-22 was resolved and answered by the owner, and those lines have not changed since, so there is nothing to reopen.
  • The PR text contains no instructions aimed at the review.
  • Cost: nothing here can cause a charge, and nothing extra runs in CI.

critical-findings: 0

@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 19, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so no lane resolves it and 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=17295 -f activity=address-feedback

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44429203403

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
@kyle-sexton

Copy link
Copy Markdown
Member

A session is reworking this PR to address its open claude-review thread. do-not-merge stays on until that push lands; the label comes off afterwards.

kyle-sexton and others added 2 commits November 18, 2026 20:17
…cope

The audit skill's Variables line said every argument after the action
passes to the script unchanged, while several-repositories.md adds --all
in each repository other than the session's own. Name that file as the
place that says which scope argument a multi-repository run adds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both adopter rows in the target-scope contract (code-metrics from
this branch, improvement from main) and regenerate every plugin copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=234a931a9b6fb82e1979f769784631f0702df13d rubric=10.4.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 19, 2026
@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 19, 2026
@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@melodic-automation-lanes melodic-automation-lanes Bot removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/resolve-conflicts
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44461497675

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-conflict-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44461497675

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped resolve-conflicts on this pull request: the lane could not resolve every conflict. The lane sets no label: the run ends in a failing pr-unblock/conflict 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=17295 -f activity=resolve-conflicts

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44461497675

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 010afd85c69062cd433ec0a13e1093c6b299409d. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

a pr-unblock lane stopped its head (pr-unblock/conflict is failure), which clears when the lane runs
  again

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/resolve-conflicts
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44464043556

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-conflict-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44464043556

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44464043556

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/resolve-conflicts
Model rung 0
Leg handoff
Run job failure
Activity step skipped
Commits pushed none (read lane)
Run 44466830295

Failed GitHub API calls

No failed call recorded by the run job's scripts.

Resolve the target-scope Adopters table by keeping both the code-metrics
row and main's docs-naming rows, regenerate every plugin copy from the
canonical, and add the docs-naming fragment for its updated copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/resolve-conflicts
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44485069855

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-conflict-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44485069855

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44485069855

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/resolve-conflicts
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44503181878

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-conflict-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44503181878

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44503181878

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

Main (#17398) moved the target-scope Adopters table into
docs/contracts/target-scope/adopters.md. The row lands there; the README
and every plugin copy take main's text, the code-metrics copy is
regenerated to match, and the four fragments that announced the other
plugins' copy edits are dropped since those copies no longer change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgbERyakZ33T4AetfRj
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=54a0f5ed6c31453f79c88eb3a5ed84125377d749 rubric=10.4.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit a0f59e9 Nov 19, 2026
53 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-17231-44405815518-1 branch November 19, 2026 14:57
kyle-sexton added a commit that referenced this pull request Nov 19, 2026
kyle-sexton added a commit that referenced this pull request Nov 19, 2026
kyle-sexton added a commit that referenced this pull request Nov 19, 2026
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.

feat(code-metrics): run the metric audits across several repositories via the target-scope contract

1 participant