Repository navigation
chore(ratchet): tighten panic baseline from 140 to 62 - #74
Merged
Merged
Conversation
The panic-prone refactor removed 78 occurrences, but the baseline stayed at 140, leaving the ratchet toothless: 78 new panics could land before CI complained. This lowers the baseline to the achieved count so the gate regains its regression-prevention value. This is the ratchet-tightening step after real cleanup, matching the existing pattern in 29c85cb and 660d915. It is not the anti-pattern of raising the baseline to absorb new panics. Verified the gate bites: adding a single .unwrap() to crates/jcode-render-core/src/reasoning.rs now fails with "total panic-prone count grew: 62 -> 63" and "new production panic-prone usage: crates/jcode-render-core/src/reasoning.rs (1)". Merged state: total=62, tracked files 46 -> 20. tx-agent: jcode tx-task: panic-budget-ratchet tx-validated: manual tx-scope: scripts/panic_budget.json tx-intent: restore the panic ratchet's regression-prevention value after the cleanup landed
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
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. Comment |
KooshaPari
pushed a commit
that referenced
this pull request
Oct 15, 2026
…arification tx-agent: jcode tx-task: B.8.80 tx-parent: 6bc421d tx-validated: rg-ratchet-rebaseline (corrected 6 ratchets A/B/B'/C/D/E/F), git-verify (stash dropped, scripts/panic_budget.json read post-merge), cargo-test (3 restore_session tests pass on new HEAD) tx-scope: docs/sessions/2026-10-12-cleanup-and-release/01_AUDIT.md tx-intent: Record B.8.80 — Master moved to 6bc421d (PR #74 chore(ratchet): tighten panic baseline 140→62). PR #74 commit message finally explained the ratchet system: scripts/panic_budget.json tracks .expect()+.unwrap() in 20 specific production files (NOT panic! macros despite the filename). B.8.78's 'Ratchet A = 0' was misleading because the peer-agent tracked subset has 0 panic!s but the whole-tree Ratchet A is 492. Corrected 6-ratchet system: A=panic! macros (492, no gate), B=.expect/.unwrap subset (62, CI-gated), B'=.expect/.unwrap whole-tree (7447, no gate), C=swallowed-error (1585, no gate), D=prod files>500 lines (350), E=test files>500 lines (89), F=dependency boundaries (PASS). Stash dropped (now redundant). Net cleanup effect: 78 panic-prone sites removed from 26 fully-cleaned files, Ratchet B CI gate now active at 62.
CodeAnt Nitpicks1 code suggestion1. The checker counts this test-only unwrap; if it is removed while one production panic is added, the file stays at 1 and total at 62, so the regression passes.Logic error · |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by free · Input: 75.9K · Output: 6.3K · Cached: 347.8K |
KooshaPari
added a commit
that referenced
this pull request
Oct 17, 2026
…one) Subagent session_daisy_1792220259698_483f4ca0aa2846ee (Tier 1 M3, read-only) scanned 109 PRs on KooshaPari/Jcode. Result: PRs #64, #67, #75 are the SAME 3 §22-pattern PRs on BOTH the Jcode and KCode forks — identical SHAs (4d676f0, fed2378, a1e9530), identical parents, identical tx-intent trailers. This is because the forks share pre-2026-10-08 history; the squash-merge commits predate the brand split. The §22 finding is therefore NOT fork-specific — it generalizes to any KooshaPari/ fork with shared pre-2026-10-08 history. 16 other CLOSED+mergedAt=null PRs returned 0 commits from 'git log origin/master --grep="(#N)"'. Several are likely superseded by merged siblings: #94→#96, #73→#74, #62→#75. 11 appear genuinely abandoned. 22-NEW-FINDING-gh-pr-view-closed-vs-merged.md extended with a 'Cross-fork audit (2026-10-17T07:00Z)' section containing: - The 3-PR SHA-equivalence table - The 16 superseded/abandoned table - Operator follow-up note (apply same body-scrub to Jcode fork PRs if a consistent record is desired; out of scope for this audit) STATE.md §4 row U updated: IN FLIGHT -> DONE — 3 MATCHES. tx-agent: jcode tx-validated: manual tx-task: jcode-fork-22-audit tx-scope: docs/sessions/2026-10-15-portal-xirp-resume/{22-NEW-FINDING,STATE.md} tx-parent: 92d6609 tx-intent: Land the Jcode-fork §22 audit so PR 103 carries the cross-fork generalization, not just the KCode single-fork evidence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Lowers the panic-prone baseline from 140 to 62 now that the refactor has landed, so the ratchet regains its regression-prevention value.
Why this is a separate PR
The refactor PRs (#69, #70, #71) remove 78 occurrences. That is a genuine improvement, but the ratchet gate treats a decrease as a pass without tightening the baseline — so with the baseline left at 140, 78 new panics could land before CI complains. The code would be cleaner while the gate stayed toothless.
This PR closes that gap. It depends on #69, #70 and #71 and should merge after them.
Not the anti-pattern
Raising a baseline to absorb new panics is the anti-pattern, and this is the opposite: the count only moves down, and only to a number that the merged code actually achieves.
This matches the repo's existing ratchet-tightening commits:
29c85cbdfand660d9152c.Effect
Verification that the gate bites again
Adding a single
.unwrap()tocrates/jcode-render-core/src/reasoning.rs:With that probe reverted, the gate reports
Panic-prone budget OK: total=62 files=20and exits 0.Ledger
Refs #69, #70, #71.
CodeAnt-AI Description
Tighten the panic-prone code limit to 62
What Changed
Impact
✅ CI blocks new panic-prone code regressions✅ Panic budget reflects the cleaned-up codebase💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.