Repository navigation
fix(security): fail-closed regex fallbacks + notice_rows layout gate (Kilo #71 follow-ups) - #76
Conversation
Kilo follow-ups on #71 (merged 06:19Z): - CRITICAL heredoc_open_pattern(): empty-regex fallback on the (unreachable) compile-failure path matched everywhere, disabling heredoc validation. Now falls back to never-match ([^\s\S]) so the fast path simply finds no openings and the command keeps full scrutiny. - CRITICAL ui_inline_interactive: notice line was pushed whenever a notice existed even when notice_rows==0, exceeding the picker layout budget. Push is now gated on notice_rows > 0. - redirection.rs empty_regex(): same never-match treatment - with an empty pattern replace_all mangles the command; never-match leaves the raw command under full redirect scrutiny. Deliberately NOT changed: the Err(_) => loop {} never-branch (Kilo WARNING, hang-vs-panic is a panic-budget design decision) and cache_hash.rs empty-doc fallback (documented intentional; JSON failure is infallible for these types).
🤖 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 55 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 |
CodeAnt Nitpicks1 code suggestion1. Unavailable and limited-route notices carry
|
CodeAnt PR Risk: Low Risk
Assessed commit: |
…ate (#64) Removes Cargo.lock/Cargo.toml entries that were orphaned after the herdr report_state refactor; the affected crates are still listed in the workspace but no longer reference the dropped deps. Adds a tokio-runtime guard so that herdr report_state does not panic when invoked from a non-runtime context (e.g., a sync test harness or a stop-hook). Squash-merged on top of origin/master 8cd6d0e (which now includes peer-merged PRs #76, #77). The mod.rs change from this PR was already applied by the security/notice_rows PRs, so only 4 files remain in the squash delta. tx-agent: jcode tx-task: B.8.84-merge-64 tx-parent: 8cd6d0e tx-validated: cargo-check (passed, 0 errors, see elapsed time) tx-scope: Cargo.lock crates/jcode-provider-openrouter-runtime/Cargo.toml crates/jcode-tool-search/Cargo.toml crates/jcode-tui/src/tui/app/local.rs tx-intent: Merge PR #64 (fix/ci-unused-deps) into master via harness-compliant squash-merge path. Pre-flight merge-tree clean. Re-merged after peer-orchestrator moved origin/master by 2 commits (PRs #76, #77) during initial cargo check. cargo check --workspace passed (0 errors).
…rness-compliant path tx-agent: jcode tx-task: B.8.84 tx-parent: a1e9530 tx-validated: cargo-check (0 errors), git-verify (3 commits pushed cleanly), gh-pr-close (#64 #67 #75 all CLOSED), 3-restore_session-tests (PASS 9.42s) tx-scope: docs/sessions/2026-10-12-cleanup-and-release/01_AUDIT.md tx-intent: Record B.8.84 — operator 'proc' signal triggered the 3-PR merge arc. (1) PR #64 fix/ci-unused-deps merged as 4d676f0 (4 files, +6/-6), (2) PR #67 xirp-custom-harness-discovery merged as fed2378 (17 files, +3514/-0, pure docs+scripts), (3) PR #75 cargo-fmt-cleanup merged as a1e9530 (1 file auth.rs, +4/-4 let-chain). All 3 PRs pushed to origin/master and CLOSED via gh pr close. New standing memory: peer-orchestrator moved origin/master by 2 commits (PRs #76, #77) during first cargo check on PR #64; required git reset --hard origin/master + re-merge. Master HEAD now a1e9530, 0 ahead/behind origin/master, 3 restore_session tests PASS (9.42s), cargo check 0 errors. 4 pre-existing warnings in jcode-telemetry-core NOT from my merges; tracked but not actionable in B.8.84.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by free · Input: 103K · Output: 2K · Cached: 86.4K |
Format drift was reintroduced by PRs #76/#77/#78/#80 after the B.8.84 fmt cleanup (PR #75). cargo fmt --check was dirty on 11 files (15 drift points; some multi-line collapsed). Master CI had not run since 2026-10-14T10:20:15Z, so the drift went undetected for 35+ hours. This is the prerequisite for P7 release (v0.96.0-k1.0.0) per the audit plan: 'After fmt-cleanup merges' (B.8.6). Verified: - cargo check --workspace: 0 errors, 0 warnings - cargo fmt --check: clean - 3/3 restore_session tests pass Closes the cargo fmt gate failure surfaced by B.8.87 recon. tx-agent: jcode tx-validated: cargo-check tx-task: p7-release-prereq tx-scope: crates/jcode-app-core/build.rs crates/jcode-app-core/src/tool/bash.rs crates/jcode-app-core/src/tool/discover.rs crates/jcode-base/src/provider_activity_oauth.rs crates/jcode-command-risk/src/heredoc.rs crates/jcode-command-risk/src/redirection.rs crates/jcode-provider-grok-build-runtime/src/bin/fake_acp.rs crates/jcode-provider-openai/src/stream.rs crates/jcode-sdk/src/auth.rs crates/jcode-tui/src/tui/app/auth_account_picker.rs crates/jcode-tui/src/tui/ui_inline_interactive.rs tx-intent: Clean cargo fmt drift on master to unblock P7 release
User description
Follow-ups to the two CRITICAL Kilo findings on #71 (merged 06:19Z). Verified both against master before fixing.
Fixed
heredoc_open_pattern()— on the (practically unreachable) compile-failure path it fell back to an empty regex, which matches everywhere: every position looks like a heredoc opening and validation is bypassed (fail-open). Now falls back to[^\s\S](never matches): the fast path finds no openings and the command keeps full scrutiny (fail-closed).notice_rowscan be 0 (small terminal), but the notice line was pushed whenever a notice existed, exceeding the layout budget. Push is now gated onnotice_rows > 0.empty_regex()— same never-match treatment: with an empty pattern,replace_allmangles the command unpredictably; never-match leaves the raw command under full redirect scrutiny.Assessed, not changed
Err(_) => loop {}never-branch (Kilo WARNING): hang-vs-panic is a deliberate panic-budget decision — left as-is.cache_hash.rsempty-document fallback (Kilo WARNING): documented intentional; serialization is infallible for these types — left as-is.Local:
cargo check -p jcode-command-riskclean;-p jcode-tuicheck running at push time (result in comments if it surfaces anything).CodeAnt-AI Description
Keep command checks fail-closed and picker notices within available space
What Changed
Impact
✅ Heredoc validation remains active if pattern setup fails✅ Redirection checks retain the original command if pattern setup fails✅ Picker notices stay within available rows💡 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.