Require proof before superseded PR closeout#196
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 25, 2026, 2:14 AM ET / 06:14 UTC. Summary Reproducibility: yes. by source inspection. Current main can promote linked supersession closeout from durable report links without hydrating and comparing PR A and PR B; I did not run a live apply repro. Review metrics: 2 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 dirty merge state, rerun the declared Node 24 checks, and land the proof-gated closeout path if maintainers accept the added model proof step. Do we have a high-confidence way to reproduce the issue? Yes by source inspection. Current main can promote linked supersession closeout from durable report links without hydrating and comparing PR A and PR B; I did not run a live apply repro. Is this the best way to solve the issue? Yes, the proposed fail-closed proof gate is a conservative way to solve the closeout safety issue, but the dirty merge state must be resolved before the final implementation can be trusted. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 77e35f078a76. 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 strengthens the “superseded PR” auto-close flow by requiring explicit, schema-validated “supersession proof” (plus security/context gating) before ClawSweeper can close a source PR as superseded by a linked replacement PR.
Changes:
- Adds shared supersession proof utilities + schema parsing/normalization to ensure “superseded” decisions have concrete coverage evidence.
- Updates apply/repair flows to hydrate PR context (labels/comments/files/body) and gate closeout on security signals and model proof; falls back to link-only when blocked or incomplete.
- Expands tests and mocks to cover proof-required behavior, security gating, and prompt/content constraints.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/supersession-proof.ts |
New shared helpers for compact PR views + schema-backed parsing/normalization of supersession proof output. |
src/clawsweeper.ts |
Adds supersession-proof runtime/prompt/model execution and blocks “superseded close” promotions unless proof allows it. |
src/repair/execute-fix-github.ts |
Hydrates PR view with labels/comments/files/body and introduces a security gate helper for source PRs. |
src/repair/execute-fix-artifact.ts |
Adds replacement closeout proof runner and enforces security + proof checks before gh pr close; otherwise link-only. |
schema/clawsweeper-supersession-proof.schema.json |
New JSON schema for model output validation. |
prompts/supersession-proof.md |
New prompt template for general supersession proof in apply flow. |
prompts/repair/replacement-closeout-proof.md |
New prompt template for repair replacement closeout proof. |
test/clawsweeper.test.ts |
Adds mocks + tests covering proof-required close behavior and security/incomplete-proof keep-open behavior. |
test/repair/execute-fix-github.test.ts |
Adds unit tests for the source PR security gating helper. |
test/repair/execute-fix-artifact-source.test.ts |
Adds source-level regression tests ensuring security/proof checks precede closeout calls and prompt changes are in place. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export function fetchSourcePullRequestView({ | ||
| repo, | ||
| number, | ||
| targetDir, | ||
| }: { | ||
| repo: string; | ||
| number: JsonValue; | ||
| targetDir: string; | ||
| }): LooseRecord { | ||
| return JSON.parse( | ||
| run( | ||
| "gh", | ||
| ["pr", "view", String(number), "--repo", repo, "--json", "author,state,mergedAt,title,url"], | ||
| [ | ||
| "pr", | ||
| "view", | ||
| String(number), | ||
| "--repo", | ||
| repo, | ||
| "--json", | ||
| "author,state,mergedAt,title,url,body,labels,comments,files,headRefOid,updatedAt", | ||
| ], |
| } catch { | ||
| return { close: false, reason: "replacement closeout proof output was invalid JSON" }; |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Tiny Diff Drake Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
Adding evidence that the supersession-proof gate in this PR would catch a real openclaw/openclaw#86590 was auto-closed on 2026-05-25 as
The ClawSweeper review body on #86590 explicitly said "Keep open for maintainer If the supersession-proof gate in this PR is fed PR A's file paths and PR B's One question: is the marker-contract layer (apply lane gated independently on |
Summary
Validation
fnm exec --using v24.14.1 pnpm run formatfnm exec --using v24.14.1 pnpm run build:allfnm exec --using v24.14.1 node --test --test-name-pattern 'PRs superseded by linked pull requests|linked supersession proof is incomplete|same-file supersession is incomplete|security-labeled PRs open|comments contain security markers|supersession proof prompt' test/clawsweeper.test.tsfnm exec --using v24.14.1 node --test test/repair/execute-fix-artifact-source.test.ts test/repair/execute-fix-github.test.tsfnm exec --using v24.14.1 pnpm run checkgit diff --check --cached