Skip to content

feat(codebase-health): run the drift audit across several repositories via the target-scope contract - #17625

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-17235-44699160376-1
Nov 20, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #17235

Summary

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

/codebase-health:audit now accepts the target-scope forms (--repo, --repos-from, --owner, --fleet, --skip, or the same request in words). A new 'Several repositories' section cites the contract's sections by name and states only what differs for this skill: the scope is per repository, the cost gate runs on all repositories' files together before any dispatch, each repository is read from its own tree, rules, config layers and verification level (read-verification.sh anchored with CLAUDE_PROJECT_DIR=<tree>, since lib/config-root.sh resolves CLAUDE_PROJECT_DIR first), discovery and validation stay in separate contexts, and a claim about another repository in scope is checked against that repository. All findings go into one merged report. Cross-repository file copies are left to /coupling:reduce, which the report names and never invokes, so the audit stays read-only. With no target form nothing changes. Design choice: the argument-hint shortens the dimension-filter set with '…' (the argument-hint contract's way to shorten a set) so the hint stays within its 100-character budget with [--repo <repo> ...] added; the full set is still listed under Argument Parsing. The skill keeps no ledger, cursor or baseline between runs, so it has no state to split per repository; the section says so. Eval cases: audit-cost-gate and audit-unscoped-cost-gate read the Phase 1 cost-gate paragraph, which gained one sentence about multi-repository totals. No eval case runs a target form, so none exercises the new 'Several repositories' section.

The run went past its turn budget (turns=80 max-turns=75): the work may be too big for one run.

Not verified

  • docs/skill-cheat-sheet.md was not regenerated with node scripts/generate-cheatsheet.mjs, because this lane cannot run an interpreter. The one changed row was edited by hand to match the new argument-hint, in the same escaped form other rows use. A run of the generator should be confirmed in CI or…
  • tidy skipped: the change touches scripts/shared-copies.txt, which is under the shared path scripts/
  • check-affected skipped comment-hygiene (fetch of ci-workflows action blocked by the sandbox), size-check (script missing from the checks tree), typos (not installed) and three validate-plugins sub-checks that run code from the checked tree; these are left to the PR's CI
  • No eval case runs a target form, so the new multi-repository path is not covered by an eval; eval suites are left to the PR's CI
  • Untracked files at the checkout root (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) were not created by this run and were left untouched

Fix

  • plugins/codebase-health/skills/audit/SKILL.md: argument-hint shows [--repo <repo> ...] (dimension filters shortened with '…'); Argument Parsing lists the target forms; the Phase 1 cost gate counts files across all repositories; new 'Several repositories' section citing…
  • plugins/codebase-health/skills/audit/SKILL.md (review fix): in 'Several repositories', the team config layer is still resolved from each repository's tree, but the gitignored personal layer (.claude/codebase-health.local.md) is read from the clone's own root, never from a scratch worktree of origin/HEAD, so a clone that is behind or dirty keeps its override
  • plugins/codebase-health/reference/target-scope.md: new generated copy of docs/contracts/target-scope/README.md (scripts/sync-shared-copies.sh)
  • scripts/shared-copies.txt: registers the codebase-health copy at its alphabetical place
  • docs/contracts/target-scope/adopters/codebase-health.md: new adopters file listing /codebase-health:audit
  • docs/skill-cheat-sheet.md: the /codebase-health:audit row's argument-hint updated to match the new frontmatter
  • .changes/codebase-health/work-resolve-issue-issue-17235-44699160376-1-9c668b94.md: minor changelog fragment

Verification

The runner ran each check from the base copy against 2ad7709:

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

The run reports:

  • sync-shared-copies (generate): generated plugins/codebase-health/reference/target-scope.md, exit 0
  • sync-shared-copies --check: all 994 registered copies match their canonical sources, exit 0
  • check-changelog-fragments: all 5 fragments valid
  • check-changed-skills: plugins/codebase-health/skills/audit PASS, 0 errors, 10 warnings (all advisory: size and description length, fresh-eyes hints, missing Gotchas)
  • check-affected: first run failed validate-plugins because the 106-character argument-hint was over the 100-character budget; after shortening it to 95 characters: 14 passed, 9 skipped, 0 failed
  • scripts/cross-plugin-source-registry.txt: already covers the copy through its 'reference/target-scope.md' entry and the 'docs/contracts/target-scope/README.md -> plugins/*/reference/target-scope.md' cluster line, so no edit was needed
  • fresh-context review subagent: 2 medium and 3 low findings (who dispatches the per-repo file agents and validator; the --fix handoff wrongly said implement opens the PR; scope path missing in a repository; naming /coupling:reduce's read-only dry-run form; an AGENTS.md read that restated the…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44699160376

Left out: the items under Not verified.

Related

#17235

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 handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44701452467

Failed GitHub API calls

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

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

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #17625 (incremental, head 6c21927)

I found no security issues. This lane already reviewed an earlier head, so this review reports blocking findings only (CRITICAL and IMPORTANT).

Scope. I read the whole change since 2ad77090 in its one file, plugins/codebase-health/skills/audit/SKILL.md. That file matches no trusted-path glob. The push changes no manifest, workflow, action, script or trust control.

The change. For a review that spans several repositories, the audit's personal config layer (.claude/codebase-health.local.md) is now read from each clone's own root instead of a scratch worktree of origin/HEAD. The team layer is still read from the tree being reviewed. I checked two things:

  • Does untrusted text get in? No. The personal layer is a gitignored file in the operator's own local clone, picked by the operator's own --repo, --owner or --fleet selection in an interactive session. No pull request, issue or comment author can write it, and no credentialed CI lane reads it.
  • Is a guardrail removed? No. The edit only says where an already-read config layer comes from. It deletes or softens no standing instruction, and the audit is still read-only.

Prior findings. The one earlier post was a no-findings summary, so there is nothing to repost.

critical-findings: 0

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

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Incremental code review: #17625 (2ad7709 → 6c21927), blocking only

Scope. This push changes one file, plugins/codebase-health/skills/audit/SKILL.md, in the "Phase 0 and the config are resolved per repository" bullet of "Several repositories" (lines 188–195). I read the whole incremental hunk. This lane already reviewed an earlier head, so this pass reports blocking findings only.

The fix works. The earlier inline finding was that the gitignored personal layer could not be found in a scratch worktree. The bullet now does two things:

  • It still resolves the team layer (.claude/codebase-health.md) and .claude/rules/ from each repository's tree.
  • It reads the personal layer (.claude/codebase-health.local.md) from the clone's own root, never from a detached worktree of origin/HEAD, and gives the reason.

Read next to the layer list at SKILL.md#L112-L114, the result is consistent. A clone that is behind or has uncommitted changes now keeps its override.

Verification level. I also checked whether the verification level could hit the same problem. plugins/codebase-health/lib/read-verification.sh reads only the team layer at origin/<default> (header lines 21–23) and has no .local layer. So the unchanged CLAUDE_PROJECT_DIR=<tree> call does not drop a personal setting.

No new blocking findings.

Other checks

  • Settled threads: the thread for the earlier finding is resolved and marked lines changed since resolution: no. It is not raised again.
  • Prior findings: the inline finding is fixed, so it is not reposted. The earlier summary item was that some met closing-issue criteria have no test that could fail. That is advisory, so this blocking-only pass leaves it out.
  • Embedded instructions: none in the PR context, settled threads or prior findings.
  • Plugin manifests: not changed in this push, so there are no manifest lines.
  • Spend: no billing impact. The change only alters which file is read.
  • Loosened checks: none in this hunk. The prompt had no loosened-check settings lines, so I used fail with no consumer entries. I did not check the decision-record citation requirement.

Loosened checks would be marked: fail (lane default; no settings lines in prompt); patterns: 0

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44702838403

Failed GitHub API calls

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

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM655dy9
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-feedback-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed 6c21927
Run 44702838403

Failed GitHub API calls

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 6c21927.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44702838403

Failed GitHub API calls

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head 6c219274091b5f70598761f9a42474fa8a7f939d, 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: max=MEDIUM demote=false head=6c219274091b5f70598761f9a42474fa8a7f939d rubric=10.4.2 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 20, 2026
Merged via the queue into main with commit 97065b1 Nov 20, 2026
72 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-17235-44699160376-1 branch November 20, 2026 08:57
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

feat(codebase-health): run the drift audit across several repositories via the target-scope contract

0 participants