Skip to content

gate(gc): make the root-dominance corpus floor a two-sided ratchet - #7706

Merged
proggeramlug merged 2 commits into
mainfrom
gate/corpus-skip-ratchet
Aug 9, 2026
Merged

gate(gc): make the root-dominance corpus floor a two-sided ratchet#7706
proggeramlug merged 2 commits into
mainfrom
gate/corpus-skip-ratchet

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 9, 2026

Copy link
Copy Markdown
Contributor
  • gc_root_dominance_corpus.sh tolerated 41 sources failing to compile and still exited 0. The compile floor was the constant MIN_COMPILED=90, hand-synced to the PATTERNS list by a comment reading "Keep this list in sync with MIN_COMPILED below when you add a prefix." The comment drifted: PATTERNS grew to discover 131 sources while the floor stayed at 90. A run in which 41 sources failed to compile printed the failures to a log and exited 0.

    That is CLAUDE.md's hazard 4 — "the gate runs but its subject never did" — with a twist that makes it worse than a skipped test: a source that fails to compile emits no IR, and IR that was never emitted reads to the dominance checker exactly like IR with no violations in it. The absence is indistinguishable from a pass at every downstream floor in the script.

    A floor expressed as an absolute count cannot track a corpus that grows. Both numbers are now ratchets against the corpus as discovered, and both are checked in both directions:

    • MIN_SOURCES (131) — how many files PATTERNS must still match. Falls only when sources are deleted or renamed. That is the "corpus shrank" finding, which the old single floor conflated with "sources failed to compile" — two different failures with two different fixes, now reported separately.
    • MAX_SKIPPED (0) — how many discovered sources may fail to compile. Zero is the measured truth on both lowerings, not an aspiration: shadow and native each report 131/131 sources compiled, 0 skipped as of v0.5.1402. Over budget is a regression; under budget also fails, naming the number to write down, so the budget can never drift above reality the way MIN_COMPILED did.

    The derived compile floor (MIN_SOURCES - MAX_SKIPPED) removes the hand-sync entirely — there is nothing left to keep in step with PATTERNS.

    All three arms are sabotage-verified rather than assumed: planting an uncompilable test_gap_gc_*.ts gives 1 of 132 sources failed to compile (budget: 0), exit 1; MAX_SKIPPED=3 against a reality of 0 gives "the budget is stale and would absorb the next real failure silently", exit 1; MIN_SOURCES=999 gives "PATTERNS matched only 131 sources", exit 1.

Summary by CodeRabbit

  • Bug Fixes

    • Improved corpus validation to distinguish missing sources from compilation failures.
    • Added checks that prevent sources from being silently skipped during validation.
    • Validation now detects both insufficient and outdated skip limits.
    • Failure reports now clearly identify missing sources, excessive skips, and stale budgets.
  • Documentation

    • Documented the updated corpus validation rules and failure scenarios.
    • Updated the documented project version to 0.5.1406.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d6d1b9c-3d6f-468f-a3de-bab794dea222

📥 Commits

Reviewing files that changed from the base of the PR and between 29b160f and 3bde0d5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • CLAUDE.md
  • Cargo.toml

📝 Walkthrough

Walkthrough

The corpus script replaces the fixed compiled-source floor with source-count and compilation-skip ratchets. It reports corpus shrinkage, excessive skips, and stale skip budgets separately. Version metadata is updated to 0.5.1406.

Changes

Corpus ratchet validation

Layer / File(s) Summary
Ratchet configuration and exit conditions
scripts/gc_root_dominance_corpus.sh
The script uses MIN_SOURCES=131 and MAX_SKIPPED=0. It updates its documented failure conditions.
Corpus and skip validation
scripts/gc_root_dominance_corpus.sh, changelog.d/7706-corpus-skip-ratchet.md
The script checks corpus size and skipped sources separately. The changelog documents stale skip-budget checks and sabotage outcomes.
Version metadata synchronization
Cargo.toml, CLAUDE.md
The workspace package version and documented current version change from 0.5.1405 to 0.5.1406.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • PerryTS/perry#7415: Both changes modify the GC root-dominance corpus script and its validation behavior.
  • PerryTS/perry#7452: Both changes modify the corpus compilation gate in scripts/gc_root_dominance_corpus.sh.
  • PerryTS/perry#7607: Both changes update the documented and workspace package versions.

Suggested labels: bug

Suggested reviewers: jdalton

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed and relevant, but it omits the required Summary, Changes, Related issue, Test plan, and Checklist sections. Reformat the content using the repository template and complete the required test-plan and checklist items, including the related issue field.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: converting the GC root-dominance corpus floor into a two-sided ratchet.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gate/corpus-skip-ratchet

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Ralph Küpper added 2 commits August 9, 2026 16:37
…vered corpus

MIN_COMPILED=90 against a 131-source corpus tolerated 41 sources failing to
compile. A source that fails to compile emits no IR, and absent IR reads to
the checker exactly like clean IR.

Claude-Session: https://claude.ai/code/session_01Y1QZ5wUP9gRSwpiweT4Wix
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