Skip to content

feat(scc): generated-marker exclusion — banner-shaped, opt-in (#114) - #115

Merged
maudlin merged 2 commits into
mainfrom
114-generated-markers
Jun 23, 2026
Merged

maudlin merged 2 commits into
mainfrom
114-generated-markers

Conversation

@maudlin

@maudlin maudlin commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Phase 2 of #107 (plan 0002), on the merged Phase 1 routing (#110).

With CHECKUP_EXCLUDE_GENERATED=1, files whose head carries a banner-shaped
generated marker are dropped from both the lizard inventory and the scc
keep-set — the corvus lever: it stops a codegen-heavy repo from drowning the
measurement and pre-empts the #105 lizard overflow/OOM by shrinking the set before
the engines run.

Validated on corvus

opt-in off opt-in on
source inventory 39,208 3,569
scc keep-set 41,081 5,442
generated excluded — 35,639

(corvus's generated C# carries // <auto-generated> on line 2 — whole-file
grep -l catches it and short-circuits there, so it's cheap.)

Banner-shaped, not loose substrings (Morlock M1)

Markers are case-sensitive + anchored to a comment leader at line start:

  • Go canonical full line // Code generated … DO NOT EDIT.
  • @generated only inside a comment leader (//, #, *, /*, --, <!--)
  • C# <auto-generated> at line start

So first-party code that merely quotes a marker (prose, a @generated in a
string), or owns a bare DO NOT EDIT (IaC, hand-written migrations), is kept.
Regression-tested both directions.

Honesty

Every drop is enumerated to raw/…​.generated (loud, greppable — not a silent
count), and GENERATED_EXCLUDED_COUNT is set. Surfacing "% generated" as a
headline signal is Phase 3.

Rollout (review decision)

Shipped opt-in, default off so the regex is field-tested with zero
default-behaviour change. Flipping to default-on (with a kill-switch) is a
deliberate follow-up once proven on real repos. Open to default-on-now if preferred.

Full suite green (source-inventory 29), shellcheck clean. Refs #107.

🤖 Generated with Claude Code

maudlin and others added 2 commits June 22, 2026 23:22
…ated (#114)

Phase 2 of plan 0002 (#107), on the merged Phase 1 routing. With
CHECKUP_EXCLUDE_GENERATED=1, drop files whose head carries a banner-shaped
generated marker from BOTH the lizard inventory and the scc keep-set — the
corvus lever (39,208 -> 3,569 source files; 41,081 -> 5,442 keep-set), which
also pre-empts the #105 lizard blow-ups by shrinking the set first.

- lib/source-inventory.sh: INV_GENERATED_RE (Go `Code generated … DO NOT
  EDIT.`, comment-leader `@generated`, C# `<auto-generated>`) +
  _apply_generated_excludes, called from build_source_inventory and
  build_scc_keepset (mirrors _apply_gitattr_excludes). Markers are
  case-sensitive + anchored (NOT the spike's loose substrings) so first-party
  code that quotes a marker, or owns a bare `DO NOT EDIT` (IaC, migrations),
  is kept (Morlock M1). Whole-file `grep -lIZ` short-circuits at the marker
  (cheap even on mostly-generated trees) and catches markers below line 1
  (corvus's sit on line 2). Every drop is ENUMERATED to `<lst>.generated`
  (loud, not a silent count); sets GENERATED_EXCLUDED_COUNT.

- Opt-in (default off) so the regex is field-tested with zero default-
  behaviour change; flip to default-on is a deliberate follow-up. Surfacing
  "% generated" as a headline signal is Phase 3.

- test/source-inventory.test.sh: opt-in off = unchanged; on = drops the three
  banner forms, keeps prose/bare-DO-NOT-EDIT first-party, sets the count, and
  enumerates the drops.

Refs #107.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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