Repository navigation
feat(code-metrics): count size against the repository's own limit and rank long files by commits - #16444
Conversation
… rank long files by commits The size action gains two run options: --file-lines <n> replaces the reference for one run, and --commits-since <date> adds the commits that touched each file at or above the reference. The action text says which reference to use (a code-metrics layer, else a limit the repository's own linter configuration sets, else the bundled default) and when to act on a long file: only when it also changes often, by filing an issue. The scc collector row is verified against scc 4.1.0 as well as 3.7.0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The two new options belong to the size action alone and are documented in its action file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8231e45d2a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A file renamed inside the window lost the commits under its earlier name, so an often-changed file could rank as stable. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Lane run report
Failed GitHub API calls
|
Lane run report
Failed GitHub API calls
|
|
claude-security-review reviewed Security review: PR #16444, incremental (2b5ac25..82bc415)No security issues found. I read every hunk of the 3 files in scope in What changed:
Settled threads: the threads on Prior findings: this lane's only earlier post is the summary for 2b5ac25, which reported 0 findings. This review was blocking only ( Embedded text: the PR context contains no instructions aimed at the review lane. critical-findings: 0 |
|
claude-review reviewed Code review, incremental: PR #16444 (
|
…option form the script takes Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
No related issue: an owner decision from a design interview (2026-11-15), recorded outside this repository.
Summary
/code-metrics:audit sizereported lines per file against one reference and said nothing aboutwhich reference a repository should use or what to do with a long file. The owner's decision: one
configurable reference (default 1000), the repository's own linter limit preferred when one is
set, no second "must refactor" stage, and a long file acted on only when it also changes often, by
filing an issue, never by a refactor inside an unrelated change.
Fix
audit-size.sh --file-lines <n>: replaces the reference for one run and writes no layer. Thereport names the option as the layer that supplied the number.
audit-size.sh --commits-since <date>: for each file at or above the reference, the commitssince that date that touched it, authors containing
[bot]left out, most-changed first. Atable in the markdown report, a
file_commitsobject in the JSON. It ranks and sets no cutoff:the research behind the decision found no published one.
actions/size.md: "Which reference" (a code-metrics layer, else a limit the repository's ownlinter or analyzer configuration sets, else the bundled default) and "Acting on a long file"
(commit count, a tracker item,
/toolchain:ratchetto stop growth).repository has.
scc4.1.0 prints the same per-file fields as 3.7.0 and still omits a file of an unknownlanguage; the collector row and the install hint say so.
Design choices, with what was weighed:
linter would put language-specific logic in the plugin.
size.file_lineswins over a linter limit: it is the repository's statementabout this measure.
git log, so thenumber is the same on every run.
Verification
plugins/code-metrics/skills/audit/scripts/audit-size.test.sh: 34 cases, 0 failed (13 new).scripts/check-affected.sh --testsat this head: 18 passed, 13 skipped.claude plugin evalon the new caseaudit-size-uses-the-repo-limit-and-files-an-issue, 3 runsper arm: 3 of 3 with the plugin, 0 of 3 without it. Against the plugin as it is on
main, withthe first shape of the case (before the commit-count grader): 0 of 3, so the case can fail.
scc3.7.0 and 4.1.0 both run over two fixture files and one file of an unknown extension.Related
change (
plugins/review/agents/code-reviewer.md).🤖 Generated with Claude Code