Gate PR close proposals with coverage proof#219
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 3:17 AM ET / 07:17 UTC. Summary Reproducibility: not applicable. This PR adds a new automation safety gate rather than reporting a current-main bug. Source inspection confirms current main lacks the new proof runner and retry/skip actions. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Resolve the current merge conflicts, rerun the Node 24 check plus the cited apply/proof smoke cases, and land only after maintainers accept the added model gate for duplicate/superseded PR closes. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR adds a new automation safety gate rather than reporting a current-main bug. Source inspection confirms current main lacks the new proof runner and retry/skip actions. Is this the best way to solve the issue? Mostly yes; a separate prompt/schema/runner integrated at both apply paths is a maintainable shape for this safety check, but the branch needs conflict resolution and final apply-lane validation before merge. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 666e707a8288. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a “PR close coverage proof” mechanism that uses a dedicated prompt+schema+runner to decide whether a duplicate/superseded PR can be safely auto-closed, and wires that gate into both the main apply flow and the repair apply flow.
Changes:
- Add PR close coverage proof prompt + JSON schema, plus a runner/parser + unit tests.
- Gate duplicate/superseded PR close proposals on coverage proof results (retry on transient failures; keep-open decisions become terminal for that apply attempt).
- Update workflows and selection utilities to install/run Codex where needed and to re-select retryable proof-failure records.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/repair/workflow-utils.test.ts | Extends repair workflow selection tests to include retryable proof-failure close proposals. |
| test/repair/apply-result.test.ts | Adds repair apply integration tests covering proof allow/block/retry behavior and prompt hygiene. |
| test/pr-close-coverage-proof.test.ts | Adds unit tests for proof parsing/normalization and prompt content checks. |
| test/clawsweeper.test.ts | Expands apply-decisions tests and mocks to cover proof gating, retries, and workflow ordering. |
| src/repair/workflow-utils.ts | Allows retryable proof-failure close records to be selected for repair apply. |
| src/repair/apply-result.ts | Adds coverage-proof gating for repair PR close actions, including bounded comment hydration. |
| src/pr-close-coverage-proof.ts | New module implementing prompt building, Codex invocation, output parsing, and decision normalization. |
| src/clawsweeper.ts | Adds coverage-proof gating to apply-decisions for duplicate/superseded PR close proposals. |
| schema/clawsweeper-pr-close-coverage-proof.schema.json | Defines the model output contract for coverage proof. |
| prompts/pr-close-coverage-proof.md | Adds the proof-checker system prompt with strict decision rules. |
| .github/workflows/sweep.yml | Ensures Codex is installed before apply paths that may need proof, with a preselect step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const report = JSON.parse(readFileSync(reportPath, "utf8")) as Array<{ | ||
| action: string; | ||
| reason: string; | ||
| }>; |
Summary
Verification
fnm exec --using v24.14.1 pnpm run check85630 -> 71465kept open,85448 -> 80751kept open,85448 -> 85707covered