Skip to content

feat(audit): efficiency finding dimension + initial wasteful-configuration rules - #1976

Merged
lex00 merged 1 commit into
mainfrom
feat/444-efficiency-dimension
Aug 26, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/444-efficiency-dimension

Conversation

@lex00

@lex00 lex00 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

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 — Category gains "efficiency".
  • packages/core/src/audit/report-model.ts — ReportCounts.efficiency, tallied by meta.category === "efficiency", disjoint from security/correctness/bestPractice by construction.
  • packages/core/src/audit/report.ts (Markdown) and report-html.ts (HTML chips) — the category tally line now shows N efficiency alongside the other three.
  • Docs regenerated via renderRulesReference() → docs/src/content/docs/lint-rules/audit-rules.mdx.
  • Post-synth barrels regenerated via 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 no cache: enabled and no adjacent actions/cache step: 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-driven runs-on: ${{ matrix.os }}, which is intentional).
  • GHA065 — strategy.matrix combining 2+ dimensions into >12 jobs with no max-parallel: cap.
  • GHA066 — actions/upload-artifact step with no retention-days (falls back to the repo default, up to 90 days).
  • GHA067 — a docker build/buildx build step with no if: guard, in a workflow triggered on push/pull_request with no paths:/paths-ignore: filter.
  • GHA068 — workflow triggered on pull_request with no concurrency: group, so a superseded push keeps consuming runner capacity (deploy workflows stay covered by the existing GHA024, which is about overlapping-deployment risk, not capacity).

gitlab:

  • WGL049 — a job installs dependencies (npm ci, pip install, etc.) with no cache: in scope (job, default:, or top-level).
  • WGL050 — a merge-request-reachable job lacks interruptible: 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 — new describe("efficiency dimension (#444)"):

  • buildReportModel tallies a GHA063 (efficiency), GHA021 (security), and GHA028 (correctness) finding into exactly efficiency: 1, security: 1, correctness: 1, and asserts the four category counts sum to the total (no leakage either way).
  • The Markdown "By category" line renders 0 security, 0 correctness, 0 best-practice, 1 efficiency for an efficiency-only finding set.

catalog.test.ts's existing category-validity test is updated to accept "efficiency".

Test plan

Fixes #444

🤖 Generated with Claude Code

…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
lex00 force-pushed the feat/444-efficiency-dimension branch from ad3dd70 to fad4d65 Compare August 26, 2026 20:01
@lex00
lex00 merged commit 284c6a8 into main Aug 26, 2026
6 checks passed
@lex00
lex00 deleted the feat/444-efficiency-dimension branch August 26, 2026 20:15
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.

Add an efficiency finding dimension for wasteful configuration

1 participant