You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(worker): withhold stale PR review output when the head moves mid-session (#8) (#42)
Re-fetch the PR refs after the session and before publication. If the head
advanced while the review ran, complete the Check Run as neutral/Stale,
surface 'Status: superseded' on the marker-backed status comment, and mark
the task superseded in the Cave task list — the findings are never presented
as if they covered the current head. The newer push's own event (or a
maintainer retry) reviews the fresh head.
This closes the last gap in issue #8: check runs already attach to resolved
immutable SHAs (no 'HEAD' placeholders since the #10 target-resolution work),
and queued reviews are already superseded at dequeue; this adds the
mid-session window.
Signed-off-by: Val Alexander <bunsthedev@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,7 @@ duplicate comments.
156
156
| PR lifecycle review trigger | Implemented | Policy-gated auto-review on opened/synchronize/reopened/ready_for_review plus label opt-in; familiar-authored PRs are never auto-reviewed. |
157
157
| Push / commit review trigger | Partial | Events parsed and typed with fixtures; execution lane needs headless contract v3. |
158
158
| GitHub App installation tokens | Implemented | Mints installation access tokens from the App private key. |
159
-
| Check Run creation and completion |Partial|Creates and updates Check Runs against the resolved target head SHA; stale-ref revalidation before publish is still planned. |
159
+
| Check Run creation and completion |Implemented| Check Runs attach to the resolved target head SHA; PR reviews re-fetch the head pre-publish and complete as neutral/Stale instead of publishing findings against a moved ref. |
160
160
| Headless execution contract | Locked (v1) | Brief, result envelope, exit codes, and git-auth channel are pinned in [`docs/headless-contract.md`](docs/headless-contract.md) with JSON Schemas, golden fixtures, and a conformance test. |
161
161
|`coven-code --headless` execution | Partial | Worker spawns headless sessions with a tokenless session brief and enforces task timeouts; result quality depends on the runtime. |
162
162
| Pull request creation | Partial | Opens draft PRs from session results against the repository's resolved default/base branch. |
// Contract-conformant review result with a finding that must NOT be
2147
+
// presented as current once the head has moved.
2148
+
let script = r#"#!/usr/bin/env bash
2149
+
cat > "$5" <<EOF
2150
+
{"contract_version":"2","status":"success","branch":null,"commits":[],"files_changed":[],"summary":"Found one issue in src/lib.rs.","pr_body":"","review":{"mode":"pull_request","evidence_status":"complete","reviewed_files":["src/lib.rs"],"supporting_files":[],"findings":[{"severity":"medium","file":"src/lib.rs","line":10,"title":"Off-by-one","body":"Loop bound skips the last element.","recommendation":null}],"tests_run":[],"no_findings_reason":null,"limitations":[]},"exit_reason":null}
0 commit comments