Repository navigation
fix(review): prevent test-merge ancestry from being attributed to original commits - #1409
Conversation
Record original pinned-head and actual checkout raw parents separately from the GitHub test merge. Keep failed exact-object inspection unknown and teach the reviewer to preserve those identities in public provenance claims.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 3:01 AM ET / 07:01 UTC. ClawSweeper reviewWhat this changesThe PR separates original PR commit ancestry from checkout and test-merge ancestry in reviewer input, with matching guidance and Git regression coverage. Merge readiness✅ Ready for maintainer review The PR remains necessary because current main still omits original-head parent evidence. This re-review found no actionable defects, and the supplied production proof is sufficient. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper assembles local Git evidence and GitHub PR metadata into the model's review prompt. This change gives reviewers distinct commit identities and parent records before they assess ownership and provenance. flowchart TD
A[Pinned PR metadata] --> C[Bounded Git inspection]
B[Local Git objects and checkout] --> C
C --> D{Exact commit inspectable?}
D -->|Yes| E[Role-labeled raw parents]
D -->|No| F[Explicit unknown evidence]
E --> G[Review prompt]
F --> G
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Preserve distinct original-head, checkout, and test-merge records throughout reviewer input, with explicit unknown states when inspection fails. Do we have a high-confidence way to reproduce the issue? Yes for the evidence gap: current main omits original-head parents, and the supplied production probe exercises that boundary. The historical model misattribution itself was not replayed. Is this the best way to solve the issue? Yes. Reusing the existing isolated Git reader and parent parser provides the missing facts without adding a competing provenance implementation or changing publication authority. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c673b36cf19f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review Head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.
What Problem This Solves
Resolves a problem where a ClawSweeper review could attribute a GitHub test merge's main parent to the original PR commit. The historical review of the Gateway PR, reviewed at
2026-09-04T01:20:32.984Z, claimed that original head15ca0925f5d164df5283783aea5f4a01ffe3924ehad current main as its recorded parent. The original raw commit proves otherwise.The producer run ran code
8440386ebd92f39c5d6812d74cda3793a67530a3. Its archived report (exact-review-33825006229-1, artifact ID9919776836, report SHA-2563db6dce3fe4050873ad4131159604ecd62b11432eed98a73fd962cba873772bb) preserves the incorrect claim; the linked durable comment is mutable and now contains later reviews. The raw report is deliberately not reproduced here.15ca0925f5d164df5283783aea5f4a01ffe3924ecd8c74889d21ddcc9f3a2d47fe868224a0e44acb782c712e2dad405a2e9010354b5291fb94d42fe63c0eb9fd822f8101dc3117ce40dbd2b0f5e01930,15ca0925f5d164df5283783aea5f4a01ffe3924eWhy This Change Was Made
The evidence generator supplied identities and test-merge parents but omitted the original head's raw parents, and the model's prose conflated those distinct identities. Reuse the hardened Git reader and canonical parent parser to provide typed, role-labeled
originalHeadandcheckoutrecords, and explicitly labeltestMerge. The prompt requires public ancestry claims to keep these roles separate.Exact object-type checks prevent tag peeling. Reads retain the existing five-second/1 MiB bounds and cap parent lists at eight; unavailable, malformed, or oversized reads return
parents: null, while only an inspected root returns[]. The old scalar head/checkout aliases are removed. This is reviewer input, with no decision schema, dependency, configuration, routing, persistent-data, or publication-authority change and no prose scrubber.Source preparation materializes the pinned original head. There is no evidence that a historical rebase caused the bad claim, and an integration checkout cannot rewrite an existing original SHA's parent.
User Impact
Maintainers and contributors receive explicit original-commit ancestry in review evidence, reducing false provenance and ownership claims when the actual checkout, fetched main, merge base, or test merge differs. Unknown inspection remains visibly unknown. Raw parent records alone do not establish causal introduction, authorship, or parent-object availability.
OpenClaw Bay Impact
Bay is unaffected: the change only adds reviewer-input provenance. No observer data contract, lifecycle/publication authority, queue state, telemetry, routes, or controls change.
Documentation Impact
Updated the active implementation documentation in
docs/pr-review-comments.md, section “PR Introduction Evidence,” and the owning reviewer prompt inprompts/review-item.md. ClawSweeper review maintainers own this contract;src/pr-review-evidence.tsis the source of truth. Verified against this PR's four-file patch; changes to record roles, raw-object bounds, unknown/root semantics, or source acquisition trigger a documentation update. ReviewedCONTRIBUTING.md,docs/README.md,README.md, andVISION.md; no other documentation changes are needed. Release-note context is preserved here without editing the changelog.Evidence
pnpm run checkwas interrupted under severe host load and did not pass. A representative agent-runner failure was reproduced: that command setTMPDIRinside the checkout, which the scanner correctly rejects asunsafe_path. The unchanged test passes with the default external temp directory. This diagnoses that local failure only. The full gate subsequently passed in exact-head Linux CI onf1a20200c0b22ccd309d38939879b8ec66fb7a85; the same run also passed Windows launcher and sparse repair build checks, with no retry. CodeQL passed at the same head. The hosted scan smoke is dispatch-only and was correctly skipped.f1a20200c0b22ccd309d38939879b8ec66fb7a85against baseb4f7d36406ed1e375dc8eac17abc00ff63a93f02, the production build, exact historical-object probe, and selected rebase/unknown/type/size regression cases passed (3/3). The rebased four-file patch is byte-identical to the original 98/98-tested patch (SHA-256e0c149f62c70876b121df9dfb497ec23a6e72fb5cdaf9c8b8cbbfb7387188128); upstream did not change its evidence or prompt-serialization owners.Real Behavior Proof
Claim: compiled production evidence generation preserves the exact original PR head's raw parents independently of the actual integration/rebased checkout and GitHub test merge, and production prompt assembly carries those roles to the reviewer.
Surface and scenarios:
buildPullRequestReviewEvidenceand productionbuildReviewPromptagainst real disposable Git histories; additionally, compiled evidence generation against the exact historical original and test-merge objects in a task-owned bare object store. Historical source objects and active PR checkouts were not modified.Commands/environment: local macOS, Node 24.20.0, pinned pnpm 11.10.0, standard Git configuration. Build and focused proof:
The post-rebase boundary rerun used the default external temp directory and passed all three selected cases:
node --test --test-name-pattern='original head parents survive synthetic|unavailable raw commits|invalid or oversized raw parent' test/review-provenance.test.tsThe historical probe calls the compiled
buildPullRequestReviewEvidencewithhead.sha=15ca0925f5d164df5283783aea5f4a01ffe3924e,base.sha=3c0eb9fd822f8101dc3117ce40dbd2b0f5e01930,mergeCommitSha=782c712e2dad405a2e9010354b5291fb94d42fe6,mainShaequal to that base, and the bare fixture'sHEADat the test merge. It first verifies both objects withgit --no-replace-objects cat-file -p <exact-sha>and asserts the following production output:Artifact/trace: bounded historical output above, the original producer/artifact identities above, and reproducible real-Git regression assertions in
test/review-provenance.test.ts. Red/green logs, fixture JSON, and historical production JSON are retained locally; raw reports and agent transcripts are not published on this branch.Limits: this proves evidence generation and prompt assembly, not model compliance, a replay of the historical model session, or GitHub review publication. It does not guarantee that model prose never makes another provenance mistake. No Gateway PR or lifecycle session was changed.