open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

Emit a complete immutable review manifest and partial-coverage contract

Open acoliver opened this issue 4 months ago • 4 comments

Problem

OpenCodeReview can produce useful findings while some selected files or subtasks fail. Consumers currently receive aggregate status and warnings, but not a complete machine-readable record of which files were selected, completed, reused, failed, or waived. This allows a partial review to look complete.

A retained cross-repository study observed 117 fully successful runs out of 145 attempts (80.7%), while 142 runs produced some usable output (97.9%). In a matched same-commit comparison, one run reviewed 90 files but reported 16 provider-concurrency subtask failures. Useful output and complete coverage are materially different states.

PR 306 added resumable sessions and file checkpoints, which appears to be the right substrate. This request is a narrow output-contract follow-up, not a parallel persistence system.

Desired behavior

Expose a versioned immutable run manifest through JSON output and persisted sessions containing:

  • canonical run/session ID and parent/resume ID;
  • repository identity, requested head, resolved base, and exact range;
  • OCR version, provider/model identifier, configured concurrency, and non-secret rule/config hashes;
  • selected, completed, reused, failed, and explicitly waived file sets;
  • typed failure classification per failed item;
  • terminal state: complete, partial, failed, or skipped;
  • redacted source artifact checksum and elapsed execution metadata.

A partial result may still publish useful findings, but it must not be represented as ordinary success or as a complete no-findings result.

Acceptance criteria

  • JSON output and the persisted session expose the same coverage values.
  • Selected/completed/reused/failed arrays are machine-readable and stable under a versioned schema.
  • Mixed-success runs terminate as partial until failed items are resumed successfully or explicitly waived.
  • Resume retains the original input identity and links to its parent session.
  • Tests cover full success, zero findings, mixed failures, resume, cancellation, and provider transition.
  • No credentials, raw secrets, or provider tokens are emitted.

Related work

  • PR 306: resumable sessions and file checkpoints
  • PR 179: persisted review results/viewer

Neither currently provides the complete selected-versus-completed coverage contract requested here.

acoliver avatar Jul 14 '26 22:07 acoliver

Thank you for this thorough research and well-structured proposal. The cross-repository study data (80.7% fully successful vs 97.9% producing usable output) makes a compelling case for distinguishing between "has useful findings" and "complete coverage."

We agree this is an important capability and plan to support it. The direction of exposing a machine-readable coverage contract (selected/completed/reused/failed/waived) on top of the existing session infrastructure from PR #306 aligns well with where we want to take the project.

We'd also welcome community contributions here — if any developer is interested in picking this up, it would be a high-value PR. Happy to discuss implementation details and provide guidance.

lizhengfeng101 avatar Jul 15 '26 06:07 lizhengfeng101

I'd like to work on this. Could you please assign it to me?

hanhaiqingchuan avatar Jul 15 '26 07:07 hanhaiqingchuan

Hi @hanhaiqingchuan — apologies for the bad timing: I'd already done about half of this earlier this morning before I saw your comment now, and I've just opened #379 with the implementation (manifest record, terminal-state contract, typed failure classes, --waive, redacted run metadata).

I'd genuinely be happy to collaborate on this though. Two options can be:

  • a review pass on #379 from you would be very welcome — on the schema/contract before it lands would make it stronger;
  • the follow-up #368 (provider-aware retry with preserved lineage) builds directly on this substrate and is still fully open — happy to team up on it or split the pieces (failure taxonomy, backoff, per-provider budgets) however you'd like.

Sorry again for the overlap!

chethanuk avatar Jul 15 '26 09:07 chethanuk

Hi @chethanuk — thanks for the heads-up. I've read through #379 and it looks good. I'm also working on #367 and plan to open a PR shortly. I'll incorporate some of the good patterns from your implementation. You're welcome to join as a co-author once it's up.

As for #368 and #369, they're already in our pipeline. If you're interested in contributing further, there are plenty of other open issues to pick up — happy to have you involved!

hanhaiqingchuan avatar Jul 15 '26 11:07 hanhaiqingchuan