Skip to content

feat(scc): the honest banner — coverage-by-category + foreign-language concentration caveat (#117) - #118

Merged
maudlin merged 2 commits into
mainfrom
117-honest-banner
Jun 24, 2026
Merged

maudlin merged 2 commits into
mainfrom
117-honest-banner

Conversation

@maudlin

@maudlin maudlin commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Plan 0002 Phase 3 — "the honest banner". Phases 1 (#110) and 2 (#115) routed the scc engines through the first-party inventory and added a banner-shaped generated-marker exclusion (opt-in). Phase 3 makes the exclusions visible and actionable and catches the markerless flat-vendored case the auto-exclude deliberately can't (plan §6.5, the dotCMS class).

What changed

  • Coverage-by-category (detection.json schema → 1.5): coverage.tracked / firstParty / pctExcluded, plus excluded.{generated,authorDeclared,convention} over the all-extension keep-set the scc engines use. Surfaced on the console and the report headline, so a shrunk scan can never read as "nothing here" — % excluded is itself a signal. Computed via staged count-deltas in build_scc_keepset (wires in the previously-unsurfaced GENERATED_EXCLUDED_COUNT).
  • Single-directory concentration caveat (lib/scc-concentration.jq, plan §6.5): a directory dominated by a language foreign to the repo's primary is flagged as vendored-looking, with the exact one-line fix (CHECKUP_EXCLUDE='<dir>/*'). Language-aware on purpose — end-to-end testing showed pure share flags the primary source dir on every normal repo (a real false positive); the foreign-language rule matches the spike evidence (dotCMS webapp/html/js is JS while the codebase is Java) and stays silent on monolithic-source repos. Threshold CHECKUP_CONCENTRATION_PCT (default 25). Advisory only, never auto-excluded.
  • Generated markers flipped default-on with a loud banner (count + enumerated raw/…generated list) and kill-switch CHECKUP_EXCLUDE_GENERATED=0. The shrink is announced, never silent.

Verification

  • All 12 test suites green; scc-inventory (+ concentration: foreign-tree detection, primary-dir-not-flagged guard, thresholds, determinism) and source-inventory (+ coverage-by-category partition, flipped Phase 2 default, kill-switch).
  • End-to-end runs (real scc): correctly flags a foreign JS tree at 48% while a Go codebase, ignores the Go source dir, and stays silent on a pure-Go repo.
  • shellcheck --severity=error clean (CI's gate); bash -n clean.
  • Docs updated: README env vars, docs/architecture.md (schema 1.5 + example), CHANGELOG.

Refs #107. Closes #117.

🤖 Generated with Claude Code

maudlin and others added 2 commits June 24, 2026 00:40
…e concentration caveat (#117)

Plan 0002 Phase 3. Makes first-party exclusions visible and actionable, and
catches the markerless flat-vendored case the auto-exclude deliberately can't.

- detection.json coverage-by-category (schema 1.5): tracked / firstParty /
  pctExcluded, and excluded.{generated,authorDeclared,convention} over the
  all-extension keep-set the scc engines use — surfaced on the console and the
  report headline so a shrunk scan never reads as "nothing here". Wires in the
  previously-unsurfaced exclusion counts via staged deltas in build_scc_keepset.
- single-directory concentration caveat (plan §6.5): a dir dominated by a
  language FOREIGN to the repo's primary is flagged as vendored-looking, with the
  exact one-line fix. Language-aware on purpose — pure share flags the primary
  source dir on every normal repo (a false positive found in end-to-end testing);
  the foreign-language test matches the spike evidence (dotCMS webapp/html/js is
  JS while the codebase is Java) and stays silent on monolithic-source repos.
  Pure transform in lib/scc-concentration.jq; threshold CHECKUP_CONCENTRATION_PCT
  (default 25); advisory only, never auto-excluded.
- generated-marker exclusion flipped DEFAULT-ON with a loud banner + the
  enumerated raw/…generated list; kill-switch CHECKUP_EXCLUDE_GENERATED=0. The
  shrink is announced, never silent.

Tests: language-aware concentration (incl. the primary-dir-not-flagged guard) and
the coverage-by-category count partition, both env-independent / determinism-safe
(#96); flipped the Phase 2 default expectations. Docs: README env vars,
architecture.md schema 1.5, CHANGELOG.

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.

Phase 3 — the honest banner: coverage-by-category + single-dir concentration caveat (+ flip generated markers default-on)

1 participant