Repository navigation
fix(xtask): count SARIF folded results in token-cost findings - #13309
Conversation
|
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 12 minutes. View limit details
|
There was a problem hiding this comment.
Code Review
This pull request updates the findings_count calculation for SARIF reports in xtask/src/reports/token_cost.rs to include folded results in the total count, preventing undercounting compared to JSON formats. It also updates the documentation and adds a corresponding unit test. There are no review comments, so I have no feedback to provide.
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
ripr static exposure checkCommit Took 10s. |
Summary
properties.folded_results(ux(sarif): one small PR yields 12 code-scanning alerts (7 findings + 5 seams), generic alert titles, 700-character messages, and seam fingerprints that move with every line shift #11219), so countingresultsalone undercounted findings against the JSON rows. Onweak_error_oraclethe sarif row read 1 finding where json reads 2. The count is now results plus folded entries; the fold itself is intentional, disclosed renderer behavior and is unchanged.Swarm / Source Boundary
This PR targets
EffortlessMetrics/ripr-swarm, the normal development trunk fortrusted same-repo
riprwork. Confirm the change belongs here:dependency, or repo-ops development for
ripr-swarmsurface
Source-of-truth Links
Proposal: none
Spec: none; definition updated in the
token_cost.rsmodule headerADR: none
Plan item: token-efficiency measurement lane (follow-up to #13261)
Governing issue or accepted claim: No single issue; accepted claim is the session goal's token-efficient feedback predicate. The discrepancy was recorded as an observation in #13261 and root-caused here to the disclosed SARIF fold (#11219,
fold_same_line_resultsincrates/ripr/src/output/sarif.rs), verified live: the kept result'sfolded_resultsnamesprobe:src_lib.rs:return_value:e21dccccand run properties carryfolded_same_line_results.Acceptance delta (one sentence): SARIF rows in
cargo xtask token-costcount findings (results + folded), so bytes-per-finding compares across formats.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
fix/token-cost-sarif-folded-countStack parent or prerequisite PR (if any): none (builds on merged #13261)
Proposed replacement of PR (if any; not yet accepted): none. Title search found only #13261.
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): n/a
Scope
xtask/src/reports/token_cost.rsonly:findings_countsarif arm counts folded results; module-header definition updated; one test case added.Scope Classification
This PR is scoped by:
Production delta:
riprproduct binary. xtask-only.Evidence/support delta:
weak_error_oraclesarif row now 2 findings, 6260 bytes/finding (was 1, 12521).Single acceptance criterion:
cargo xtask token-costreports sarif findings including folded results, and the unit tests pass.Non-goals:
Support-tier Impact
docs/status/SUPPORT_TIERS.mdClaim/proof notes:
Policy Impact
Ledger or exception notes:
Proof
Result, failures, or skipped proof:
findings_count_reads_each_machine_formatfailed at the folded case before the fix (exit 101).Claim Boundary
What may be claimed after this PR? What must not be claimed yet?
Rollback
How can this PR be reverted safely?
Spec-Test-Code Traceability
xtask/src/reports/token_cost.rsreports::token_cost::tests::findings_count_reads_each_machine_format(folded case)xtask/src/reports/token_cost.rstarget/ripr/reports/token-cost.{json,md}Static Language Check
killed,survived,untested,proven, andadequate.