Repository navigation
refactor(scripts): unify shrink-ratchet mechanics under one owner - #125301
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 7:43 PM ET / 23:43 UTC. ClawSweeper reviewWhat this changesThe PR moves shared baseline loading, comparison, ordering, and reporting for three shrink-only repository checks into Merge readinessNo blocking correctness finding found. This maintainer-owned, protected PR remains open for the explicit landing decision after its exact-head CI completes. Priority: P3 Review scores
Verification
How this fits togetherThree CI ratchets inspect source and baseline files, compare them with a Git reference, and report debt growth or required cleanup. The changed-check planner invokes those ratchets when related source, baseline, or shared-helper files change. flowchart LR
A[Source and baseline files] --> B[Domain-specific ratchet checks]
B --> C[Shared shrink-ratchet helper]
C --> D[Git reference comparison]
D --> E[Pass or failure guidance]
F[Changed-file planner] --> B
Decision needed
Why: The PR is maintainer-authored and carries the protected Before merge
Agent review detailsSecurityNone. PR surfaceTests +135, Other -2. Total +133 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one generic file-backed ratchet owner and merge after exact-head CI confirms the preserved checker behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors deterministic repository checks rather than reporting a user-facing defect. Is this the best way to solve the issue? Yes: centralizing only shared file-backed ratchet mechanics preserves one canonical policy owner while leaving checker-specific counting and policy local. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 741250f5bb5d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
6908564 to
0a2329f
Compare
|
Landing proof for exact head
This satisfies ClawSweeper’s remaining current-green-merge-result move. No proof gaps remain. |
|
Merged via squash.
|
…enclaw#125301) * refactor(scripts): unify shrink-ratchet mechanics under one owner * refactor(scripts): tighten shrink-ratchet owner * fix(scripts): widen ratchet comparator type * test(scripts): type heterogeneous ratchet fixtures
What Problem This Solves
Three shrink-only repository checks independently implemented baseline loading, comparison, deterministic ordering, and pass/failure guidance. That duplication made policy changes easy to apply inconsistently and left the shared concept without a canonical owner.
Why This Change Was Made
This maintainer-requested refactor moves the shared mechanics into the concept-named
scripts/lib/shrink-ratchet.mtsowner while leaving each checker responsible for its domain counting. Existing baseline formats and all pass/failure text are preserved verbatim.The chained-assertion exclusion ledger remains in
type-assertion-guard-scope.mjs. It is live scope policy synchronously loaded by the plain-JS oxlint plugin, not a file-backed baseline; folding it into the owner would couple that runtime to git/fs machinery without reusing ratchet behavior.User Impact
No user-visible behavior changes. Operators and CI receive the same checker results and byte-identical output, while future shrink-ratchet changes have one policy owner.
AI-assisted: yes. The final implementation was reviewed with the repository autoreview workflow.
Evidence
origin/main, per checker:0/0, stdout diff empty, stderr diff empty0/0, stdout diff empty, stderr diff empty0/0, stdout diff empty, stderr diff empty1/1, stdout diff empty, stderr diff empty1/1, stdout diff empty, stderr diff empty1/1, stdout diff empty, stderr diff emptypnpm lint: passed, including core, extensions, and scripts.pnpm tsgo:scripts: passed.pnpm tsgo:test:root: passed.node scripts/check-changed.mjs: passed, including all three ratchets, formatting, script/test typechecks, erasability, andlint:scripts.origin/main: clean; no accepted/actionable findings.[check:changed] FAILED (exit 1).+396/-398(net-2); tests+163/-28(net+135).