Repository navigation
fix(ci): keep the code-size ratchet honest after the workspace clippy gate - #210
Conversation
… gate The workspace clippy gate (PR #190) added narrow `#[cfg(...)]` gates to jcode-setup-hints and jcode-telemetry-core so the `--all-targets` test build no longer sees unused imports and dead code. Splitting one import into two, and documenting why, grew both files past their code-size baseline, so the "Enforce oversized-file ratchet" gate failed on master: Code-size budget exceeded. Existing oversized Rust files must shrink or stay flat, and new oversized production files are not allowed: - oversized file grew: crates/jcode-setup-hints/src/lib.rs (2654 -> 2660 LOC) - oversized file grew: crates/jcode-telemetry-core/src/lib.rs (2610 -> 2629 LOC) Both files are over the 1200 LOC threshold, so the ratchet requires them to stay flat or shrink. The growth was almost entirely explanatory comment, so this compresses those comments instead of moving the baseline: crates/jcode-setup-hints/src/lib.rs 2660 -> 2650 LOC (baseline 2654) crates/jcode-telemetry-core/src/lib.rs 2629 -> 2609 LOC (baseline 2610) The diff is comment-only: no code, no `#[cfg(...)]` gate and no test assertion was added, removed or altered. `scripts/code_size_budget.json` is deliberately NOT updated -- the ratchet is the contract, and the fix is to make the code smaller rather than to move the goalposts. `python3 scripts/check_code_size_budget.py` now exits 0 and reports the files as shrunk. tx-agent: jcode tx-validated: manual tx-scope: jcode-setup-hints, jcode-telemetry-core tx-intent: Restore the code-size ratchet without moving its baseline
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 13 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 |
|
| // Keeping them in a separate lock-free atomic domain previously let trailing | ||
| // `record_*` calls drift across session boundaries (see issue #394). | ||
| // Error/switch counters live in `SessionTelemetry` under `SESSION_STATE`, so | ||
| // a separate lock-free domain cannot let trailing `record_*` calls drift |
There was a problem hiding this comment.
SUGGESTION: Comment may overstate cross-session drift protection
The comment claims "a separate lock-free domain cannot let trailing record_* calls drift across session boundaries" (issue #394). However, late record_error or switch calls after a new begin_session may update the new slot under the same SESSION_STATE mutex, potentially undermining the claimed protection. Verify this claim or soften the wording.
| // worker starts. Bound the first prompt's delivery so every active | ||
| // installation has an immediate durable activity anchor. | ||
| // Short `jcode run` invocations can exit before the background worker | ||
| // has flushed, so the shutdown path drains it explicitly. |
There was a problem hiding this comment.
SUGGESTION: Comment may overstate shutdown drain behavior
The comment claims "the shutdown path drains it explicitly" to justify DeliveryMode::Blocking for the first prompt. However, the shutdown path may not actually drain a queued background worker copy. Verify this claim or adjust the wording to match actual behavior.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Merge with notes Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 43.8K · Output: 12.5K · Cached: 199.5K |
User description
Closes #209
Summary
The workspace clippy gate (PR #190) added narrow
#[cfg(...)]gates tojcode-setup-hintsandjcode-telemetry-coreso the--all-targetstest build no longer sees unused imports and dead code. Splitting one import into two, and documenting why, grew both files past their code-size baseline, so the "Enforce oversized-file ratchet" gate failed on master:Both files are over the ratchet's 1200 LOC threshold, so it requires them to stay flat or shrink. The growth was almost entirely explanatory comment, so this compresses those comments rather than moving the baseline.
crates/jcode-setup-hints/src/lib.rscrates/jcode-telemetry-core/src/lib.rspython3 scripts/check_code_size_budget.pynow exits 0 and reports both files as shrank.What was NOT changed
git diff | grep -E "^[+-]" | grep -vE "^(\+\+\+|---)" | grep -vE "^[+-]\s*(//|$)"returns zero lines. No code line was added, removed or altered.#[cfg(...)]gate was removed, added or weakened.scripts/code_size_budget.jsonis deliberately NOT updated. The ratchet is the contract; the fix is to make the code smaller, not to move the goalposts.Why comment-compression and not
--updatescripts/check_code_size_budget.py --updatewould have made the gate pass in one command, but it would also silently re-baseline every oversized file in the repo — destroying the ratchet's ability to catch future growth. The gate's own message says to run--update"only after intentional cleanup"; this PR is that cleanup, performed on the two files that actually grew.Evidence
122656506857(master run40640134851, head9d0996695), step "Enforce oversized-file ratchet".2523c5aab):git diff 2523c5aab~1 origin/master -- crates/jcode-setup-hints/src/lib.rsshows 8 added / 2 removed lines, of which 4 are the new comment block.CodeAnt-AI Description
Keep the code-size check passing without changing app behavior
What Changed
Impact
✅ Existing code-size limits pass💡 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.