Repository navigation
feat(audit): efficiency finding dimension + initial wasteful-configuration rules - #1976
Merged
Merged
Conversation
…ation rules Adds a fourth audit finding dimension, "efficiency" (#444), alongside security/correctness/best-practice: wasteful CI configuration that isn't a safety or correctness issue. Wired end to end: - catalog.ts: Category gains "efficiency" - report-model.ts: ReportCounts.efficiency tallied separately (disjoint from security/correctness by construction — proven with a dedicated test) - report.ts / report-html.ts: the category tally/chips surface the new count Initial rules (all report-only/guidance — efficiency findings default to the lower-urgency tier): github: GHA059 (dependency setup action without caching), GHA060 (runner pricier than the job needs), GHA061 (uncapped multiplicative matrix fan-out), GHA062 (unbounded artifact retention), GHA063 (unconditional docker build with no path filter/guard), GHA064 (pull-request workflow missing a concurrency group — deploy workflows stay with GHA024) gitlab: WGL049 (dependency install without a cache), WGL050 (merge-request job missing interruptible: true) Docs regenerated via renderRulesReference(); post-synth barrels regenerated via generate-post-synth-barrels.ts. Positive/negative tests per rule plus a report-model test proving efficiency findings don't leak into the security/correctness tallies. Fixes #444 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lex00
force-pushed
the
feat/444-efficiency-dimension
branch
from
August 26, 2026 20:01
ad3dd70 to
fad4d65
Compare
11 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a fourth audit finding dimension — efficiency — alongside the existing security/correctness/best-practice, per #444. Efficiency findings cover CI waste (redundant work, an oversized execution environment, unintended fan-out, unbounded retention) that isn't a safety or correctness issue.
Note: originally shipped as GHA059–GHA064, renumbered to GHA063–GHA068 after #1975 (issue #445) merged claiming GHA059–GHA062 for its supply-chain/token-scoping rules. WGL049/WGL050 (gitlab) are untouched since #1975 didn't touch gitlab.
Dimension wiring
packages/core/src/audit/catalog.ts—Categorygains"efficiency".packages/core/src/audit/report-model.ts—ReportCounts.efficiency, tallied bymeta.category === "efficiency", disjoint fromsecurity/correctness/bestPracticeby construction.packages/core/src/audit/report.ts(Markdown) andreport-html.ts(HTML chips) — the category tally line now showsN efficiencyalongside the other three.renderRulesReference()→docs/src/content/docs/lint-rules/audit-rules.mdx.scripts/generate-post-synth-barrels.ts(lexicons/github|gitlab/src/lint/post-synth/index.ts) — never hand-edited.Rules (8, all
report-only/guidance— efficiency defaults to the lower-urgency tier)github:
GHA063— dependency setup action (actions/setup-node/-python/-java/-ruby/-dotnet) with nocache:enabled and no adjacentactions/cachestep: every run re-fetches from a cold cache.GHA064— job hardcoded onto a macOS/Windows runner with no step that looks OS-specific (skips matrix-drivenruns-on: ${{ matrix.os }}, which is intentional).GHA065—strategy.matrixcombining 2+ dimensions into >12 jobs with nomax-parallel:cap.GHA066—actions/upload-artifactstep with noretention-days(falls back to the repo default, up to 90 days).GHA067— adocker build/buildx buildstep with noif:guard, in a workflow triggered on push/pull_request with nopaths:/paths-ignore:filter.GHA068— workflow triggered onpull_requestwith noconcurrency:group, so a superseded push keeps consuming runner capacity (deploy workflows stay covered by the existingGHA024, which is about overlapping-deployment risk, not capacity).gitlab:
WGL049— a job installs dependencies (npm ci,pip install, etc.) with nocache:in scope (job,default:, or top-level).WGL050— a merge-request-reachable job lacksinterruptible: true, so GitLab's auto-cancel can't reclaim it when superseded (deploy jobs excluded — cancelling mid-deploy is its own hazard).Tally-exclusion proof
packages/core/src/audit/report.test.ts— newdescribe("efficiency dimension (#444)"):buildReportModeltallies aGHA063(efficiency),GHA021(security), andGHA028(correctness) finding into exactlyefficiency: 1, security: 1, correctness: 1, and asserts the four category counts sum to the total (no leakage either way).0 security, 0 correctness, 0 best-practice, 1 efficiencyfor an efficiency-only finding set.catalog.test.ts's existing category-validity test is updated to accept"efficiency".Test plan
npx vitest run packages/core/src/audit lexicons/github lexicons/gitlab— 177 files / 1368 passed, 1 skipped (pre-existing unrelated skip)npx vitest run packages/core lexicons/forgejo— 345 files / 5226 passed (forgejo reuses github's GHA rules/catalog — verified unaffected)npx tsc -p lexicons/github/tsconfig.build.json --noEmit/ same for gitlab — cleannpm run generate -w lexicons/github && npm run bundle -w lexicons/github(and gitlab) — clean, no unexpected diffjust build(tsc --noEmit -p packages/core/tsconfig.json) — cleanFixes #444
🤖 Generated with Claude Code