Task · TSO-0160

Sharded CodeRabbit runner: a shard is clean only when counted findings match the complete event's total

Description

TSO-0157 made scripts/shard_coderabbit_review.py report per-shard finding counts from ‘finding’ events, but it never reads the ‘findings’ field on the shard’s ‘complete’ event. If the CLI drops or truncates finding events, the shard still reports clean. Loop19’s TSO-0157 review left this as an advisory; loop20 preparation (2026-10-09) adopted it. Decided: a complete event with no findings field, or a non-integer one, is not-clean (fail closed); a mismatch is a failure with its own reason string and a non-zero exit.

Acceptance Criteria

Definition of Done

Implementation Plan

Implement frozen scope; regression red then green; exact candidate gate and independent review before landing.

Implementation Notes

loop20: 1 implementation attempts; Done after acceptance, landed code and green composed gate. Earlier superseded/cancelled CI runs are not passes.

Final Summary

loop20 landed evidence 50cb41a27f72e973b362dfee460b00514bf91bba. Counted findings must match every integer completion total; missing/noninteger totals fail closed. CLI subprocess tests observed red then green; independent review PASS; completed CodeRabbit reviewed both scripts with zero findings. Final composed just check on actual shipped SHA129945fb3230f1c5d8a1127ad3e3c7faa2c514f4 passed, unchanged tree. Exact CI e96e74e31e2df4c697435dd4b7a32315e0e02f41 run38003933710 ci-success succeeded; no production diff outside backlog from that tested code. Helm absent-not-required (no landed chart change). Just formatting passed. Generated-input DoD is not applicable or covered by gate; no generator drift or weakened test claimed.

References

View the source file on GitHub