Repository navigation
fix(output): keep the highest-priority findings under the check-JSON byte budget and name what was dropped (#10093) - #10094
Conversation
…byte budget and name what was dropped (#10093) When RIPR_CHECK_FINDINGS_BYTES engages, findings render in a deterministic priority order (candidate-current first, then reachable_unrevealed, weakly_exposed, no_static_path, unknown classes, exposed last, recommended next step, sort order as tiebreak) and the kept set is emitted in the unchanged sort order. The limited_findings_bound message now names dropped counts per class and file. An unengaged budget is byte-identical. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 30 minutes. View limit details
Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors the ripr check --format json findings-array byte budget to prioritize keeping the most actionable findings (such as candidate-current and stronger gap classes) rather than cutting them off in file order. It also enhances the limited_findings_bound message to report the counts of omitted findings by class and file. The review feedback suggests two valuable performance optimizations: implementing a fast path to bypass priority sorting and allocations when no budget is set, and using &Path keys in the omitted summary map to avoid redundant string allocations for every omitted finding.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- The budgeted array calculation includes a separator for the first retained finding and excludes it for the last, so the accounted byte count differs from the documented payloads-plus-separators definition by one byte.
- The unbounded JSON path now sorts findings and allocates every rendered payload before emitting it.
Verification questions
- Confirm the CLI smoke test proves deterministic budgeted output and that the retained finding belongs to the analyzed set, but does not assert the specific retained identity against the priority ordering.
- Confirm the implementation’s budget accounting includes each payload plus a two-byte separator for every finding after the first, while tests exercise exact lead-payload and lead-plus-one boundaries but do not independently assert total emitted array-byte semantics for a multi-finding case.
Refuted
- The byte-budget limitation may omit the names of dropped files or classes.; refuted because: The omitted summary computes counts for every omitted finding and formats class counts plus up to five files, with a remainder count.
- The budget accounting could omit the separator or admit an oversized first payload.; refuted because: Each payload is counted, later payloads add the two-byte separator, and the prior contract intentionally renders at least one finding even when it exceeds the budget.
Evidence gaps
- Cargo-test evidence was still scheduled late while the ripr sensor failed with exit code 2, so the changed Rust behavior lacks a recorded passing automated proof in the packet.
- Model proof intent was rejected by deterministic validation.
- The ripr proof sensor failed without a supplied diagnostic, so its result cannot establish whether the changed Rust behavior passes the repository's own checks.
Test the next-step tiebreak, name it in the limitation message and changelog, stream directly with no priority sort or buffering when the budget is off, key the omitted-file map by path, assert the retained finding's class in the CLI test, and replace stale prefix wording with bounded subset. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC
There was a problem hiding this comment.
Confirmed findings
- The documented budget is defined as emitted array bytes, but the new accounting does not clearly equal emitted bytes for multi-finding retained sets; a boundary regression could allow output over budget.
- The code and comments explicitly allow the first over-budget finding to render, so the effective bound can exceed RIPR_CHECK_FINDINGS_BYTES by one payload plus separator. This is a contract clarification or implementation decision, not a demonstrated regression.
Verification questions
- Confirm the budgeted renderer retains the first finding whose cumulative payload-plus-separator size exceeds the budget, then reports it as rendered.
- Confirm the smoke test proves determinism and class-rank priority, but it does not assert the exact retained identity for every possible tie or currentness case.
- Confirm budget accounting in the bounded route includes a separator before each later finding, while the documented budget is payload bytes plus separators.
- Confirm the CLI smoke test proves determinism, membership, and strongest-class retention, but it does not independently validate exact emitted array-byte accounting for a multi-finding result.
- Confirm the implementation's configured-budget accounting charges each payload plus a two-byte separator before later findings; existing boundary coverage uses the lead payload and lead-plus-one but does not isolate the complete multi-finding separator sum.
- Confirm the CLI smoke test proves repeat-run determinism and retention of an analyzed strongest-class finding, but does not independently prove exact total array-byte semantics for multiple findings.
- Confirm the budget accumulator includes a separator before every retained finding except the first, but the emitted array places separators after findings except the last.
Refuted
- The new helper duplicates finding-ranking behavior across rendering and tests.; refuted because: Priority ordering and omitted-summary construction are centralized in findings_priority.rs; report.rs handles serialization and emits the selected indices in original order.
- The omitted disclosure may omit class or file counts.; refuted because: The new summary builds per-class and per-file maps, and focused tests assert class/file counts plus the bounded-file remainder.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…10093) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Governing issue or accepted claim: #10093
Acceptance delta (one sentence): When the check-JSON findings-array byte budget engages it keeps the highest-priority findings instead of a file-order prefix, and the
limited_findings_boundmessage names what was dropped per class and file.Before
sort_findingsorder, so the last files lost findings first (indexmapddb0316: 61 of 68 rendered; the 7 hidden were all the changedmap.rs:967weakly_exposed finding).rendered R of T findings ....After
reachable_unrevealed,weakly_exposed,no_static_path, unknown classes,exposedlast, then a recommended next step, then sort order as tiebreak. The kept set is emitted in the unchanged sort order.finding_alignmentis computed over exactly the kept findings.omitted N: by class ...; by file ...(5 files named, rest counted, base-side/unresolved count when present), still namingRIPR_CHECK_FINDINGS_BYTESand=0.=0(streamed with no sort or buffering), are byte-identical to before. No schema field added, no default change.How
output/json/findings_priority.rs(priority key, order, omitted summary);report.rsrenders per-finding payloads in priority order until the budget is exceeded, then emits the kept set in index order.weakly_exposedbeats earlierexposed/unknown, base-side demoted, kept set in sort order, roomy budget keeps all, ties keep sort order, next-step tiebreak (with a control), and a CLI smoke check that the retained finding has the strongest class. Existing budget tests that encoded "first in file order is kept" were updated deliberately.Verified
cargo test -p ripr --lib output::json(103 passed), cli_smoke budget tests,cargo xtask goldens check,cargo xtask precommitexit 0.Not verified
RIPR_CHECK_FINDINGS_BYTES=0), so no human change.🤖 Generated with Claude Code
https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC