Skip to content

docs(standards): make shallow findings advisory, CC > 15 the stop rule - #69

Merged
kevmoo merged 1 commit into
mainfrom
standards-shallow-advisory
Oct 9, 2026
Merged

kevmoo merged 1 commit into
mainfrom
standards-shallow-advisory

Conversation

@kevmoo

@kevmoo kevmoo commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Problem

The shallow-helper bullet in .agents/CODING_STANDARDS.md told agents to run
shallow and re-inline single-caller SAFE_INLINE helpers, so agents treated
those findings as a gate.

Change

  • Stop rule: only declarations above CC 15 are work items; stop at max <= 15.
  • shallow / file_split findings are advisory review prompts. Never run
    --fail-on-safe-inline as a gate. Re-inline only true pass-throughs with no
    same-shape siblings and no meaningful name or doc comment.
  • Hot per-element loops: benchmark before splitting; prefer a per-declaration
    // cognitive_complexity:ignore with a reason comment.
  • Points to the dart-cognitive-complexity skill.

Evidence

Blind reviews of four dogfood PRs found the CC > 15 fixes were improvements,
while SAFE_INLINE re-inlining was mostly a regression. It deleted well-named
helpers with same-shape siblings and made callers longer.

Splitting a hot loop to meet CC <= 15 cost 39-66% performance; fixed with an
ignore comment in kevmoo/qr.dart#175.

- Only declarations above cognitive_complexity 15 are work items; stop at
  max <= 15.
- shallow / file_split findings are review prompts, not gates; never run
  --fail-on-safe-inline. Re-inline only true pass-throughs with no
  same-shape siblings and no meaningful name or doc comment.
- Benchmark hot per-element loops before splitting; prefer a
  per-declaration `// cognitive_complexity:ignore` with a reason.
- Point to the dart-cognitive-complexity skill for details.
@kevmoo
kevmoo merged commit a0acb6c into main Oct 9, 2026
@kevmoo
kevmoo deleted the standards-shallow-advisory branch October 9, 2026 05:35
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.

1 participant