Repository navigation
fix(review): verify provenance against raw Git history - #1298
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 4:13 PM ET / 20:13 UTC. ClawSweeper reviewWhat this changesThe PR verifies that a blamed source line was actually changed against raw recorded Git parents before publishing attribution or regression provenance in review reports and comments. Merge readiness✅ Ready for maintainer review Keep open: the raw-parent verifier is a distinct repair not present on the fetched current main, and the introduced implementation plus real-Git regression coverage support it without a concrete correctness blocker. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper converts review inputs into durable reports and public comments. This change validates model-supplied history pointers at the Git boundary before report and comment rendering consume them. flowchart LR
A[Review decision] --> B[History pointer]
B --> C[Raw Git history reader]
C --> D{Line changed in parents?}
D -->|Yes| E[Verified attribution]
D -->|No or unknown| F[Conservative routing output]
E --> G[Reports and public comments]
F --> G
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Land the bounded raw-parent verification and retain the conservative unknown/carried-forward output when history cannot prove a source-line change. Do we have a high-confidence way to reproduce the issue? Yes, at high confidence: the supplied proof and focused tests use disposable real Git repositories to exercise the local review and rendering path across positive and negative attribution cases. Is this the best way to solve the issue? Yes. Validating the exact blamed line against raw recorded parents at the shared Git boundary is narrower and more reliable than trusting blame display metadata or free-form reviewer attribution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f8f467433af2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready verification for the reviewed candidate. The missing boundary was between model/blame hints and published historical attribution. One shared host-owned reader now verifies the implicated line against raw recorded parents, and report/comment readers preserve only that verified projection. This replaces the blame-only verification and unrestricted injected Git path; missing or carried-forward evidence stays conservative. The necessary proof/projection boundary accounts for net +232 production TypeScript lines and +33 prompt/schema lines; regression tests are net +316. The final local command was: PATH="/opt/homebrew/opt/git/bin:/opt/homebrew/opt/bash/bin:$PATH" pnpm run checkIt passed all gates with 4,026 passing tests, nine skips, and no failures. The PR body records the separate 124-test focused run and executed native Codex/TruffleHog local-range CLI → persisted report → public-comment rendering proof. Independent precommit and committed-branch reviews both returned scoped-clean with no P0–P2 findings. Exact-head CI run 33272663379 passed Current-main drift was inspected: the overlapping prompt/docs edits are disjoint, attribution owners and their tests are unchanged, and the nearest scanner change is limited to unrelated fixture classification. GitHub reports the candidate mergeable with all relevant checks green; no enforced independent-approval rule applies. The original Browser comment remains untouched. Its actual historical blame invocation is still unproven: the recovered artifacts do not contain that stdout, and private/R2 retention has not been verified. |
Related: Browser SDK import-boundary review with unsupported historical attribution.
Additional instructions
Keep Allow edits from maintainers enabled.
What Problem This Solves
Resolves a problem where readers of ClawSweeper reviews could see confident claims that a person introduced code even though the cited commit did not change that code. In the reported Browser review, the cited commit changed unrelated mobile UI rather than either Browser barrel. The retained report had confident related-people attribution while its structured regression provenance was unknown.
The recovered artifacts and Actions logs do not contain raw blame output; private/R2 retention has not been verified. The exact historical command and checkout/history state are unknown; this repair does not claim that a particular shallow-checkout configuration caused that incident. It repairs the demonstrated missing verification boundary and reproduces concrete ways that boundary could fail.
Why This Change Was Made
ClawSweeper now verifies source-line changes against the actual parents recorded in raw Git commit objects before projecting historical people attribution or structured regression provenance. The model still judges routing and semantic relevance; the host supplies only verified Git facts, keeps author, committer, PR author, and merger separate, and never equates line authorship with feature responsibility.
The canonical reader is shared by both attribution surfaces. It clears blame ignore lists, detects carried-forward renames, rejects incomplete parent evidence, disables replacement refs and legacy grafts, and parses Git records on LF boundaries. Blame is a locator, not introduction proof; graph-truncated parent displays and root-style output cannot substitute for raw-parent patch evidence. Missing objects, ambiguous rename mappings, unavailable paths, oversized reads, and exhausted verification budgets remain unknown without failing the whole review.
Unverified candidates retain only low-confidence routing suggestions. Public report and comment readers require host-owned proof markers, so legacy stored prose cannot regain historical confidence simply by being rendered. The prior merged-history routing policy remains intact: the current PR proposer is not automatically a historical feature owner.
User Impact
Maintainers and contributors receive bounded, factual source-line attribution rather than an unsupported claim about who introduced a feature or regression. Genuine verified author/committer metadata remains available; uncertain history is visibly uncertain and useful nonhistorical routing is preserved. A required maintainer-decision owner stays synchronized with that normalized public result.
This change does not edit Browser code, rewrite stored historical reports, or mutate the old public comment. It adds no operator setting, dependency, database migration, fetch budget, scanner exemption, sandbox bypass, or GitHub mutation route. The existing model-facing decision schema gains the bounded, nullable history pointer.
OpenClaw Bay Impact
No Bay change is needed. This changes report/comment attribution, not observer routes, controls, queue state, or aggregate telemetry. The public API contract and
dashboard/public-observability.tswere inspected: those projections select closed aggregate fields rather than serializing likely-owner or regression-provenance report content. Bay remains observer-only.Documentation Impact
docs/pr-review-comments.mdis the active implementation reference and now documents the history-proof owner, raw-parent and record-boundary rules, unknown/carried-forward behavior, host markers, and legacy downgrade.CONTRIBUTING.mdremains the active contributor guide and now states the existing Bash 4+ prerequisite for workflow-intake validation on macOS; this does not change the default shell. The local-review and public-observer API documentation was also checked; their isolation and observer contracts are unchanged.Evidence
Candidate:
3b2fb44d092a4bd265d72825f66b3d7175c327b9, based one1eefe217304f0f510acb3890db1155cef61682e.The final full gate passed on Node 24.20.0, pnpm 11.10.0, Git 2.55.0, and Bash 5.3.15. From the candidate checkout, with installed Git/Bash selected only for this task:
PATH="/opt/homebrew/opt/git/bin:/opt/homebrew/opt/bash/bin:$PATH" pnpm run checkResult: 4,035 tests; 4,026 passed, 9 skipped, 0 failed. Full coverage was 82.95% lines / 75.51% branches / 88.08% functions. Static guards, formatting, documentation checks, all three builds, lint, and changed-coverage validation passed. The focused attribution/reader/runner proof passed 124/124 tests. An earlier full run exposed one obsolete rendering assertion; its final test-only alignment preserved proposal-only close guards and removed a false-positive owner-commit-link test. The final full gate includes that correction.
A fresh independent pre-commit P0–P2 source review returned
scoped-clean, no findings, and “patch is correct” with confidence 0.90. A separate fresh committed-branch review against the recorded base also returnedscoped-clean, no P0–P2 findings, with confidence 0.87. These reviewers inspected source and did not run tests; the execution evidence above is separate. Both required review stages are complete on the candidate's source.Source and reader coverage
Complete affected owners, callers, readers, and relevant siblings were inspected rather than reviewing the diff alone:
schema/clawsweeper-decision.schema.json,clawsweeper-types,clawsweeper-policy, andclawsweeper-decision-parser; model output cannot mint host verification markers.clawsweeper-review-preparation,clawsweeper-review-command-workflow, andclawsweeper-review-runtime; parsed output passes through history verification before the decision leaves the runtime.pr-review-evidenceandclawsweeper-regression-provenance; bounded callback-free reads, exact recorded parents, actual added-line spans, actor metadata, and conservative predecessor relationships. The PR test-merge reader shares the corrected raw-parent parser.clawsweeper-report-document,clawsweeper-report-parser,clawsweeper-status-context,clawsweeper-review-presentation, report rendering/orchestration/comment helpers, and review blobs; both direct and stored-report paths preserve the public trust boundary.decision-packets, report actions, and close-decision owners; selected-owner consistency and proposal-only mutation gates remain covered.agent-runner,agent-input-scan,codex-env,codex-spawn, andcommit-sweeper; mandatory input scanning, read-only inspection, credential stripping, empty GitHub config, and disabled web search remain in the native path.Dependency contracts were checked directly in Git 2.55.0 raw commit parsing, its graft-environment and identity handling, and Codex CLI schema/output arguments. Codex loads and passes the schema into the user turn; its JSON loader is not proof of Git truth or model-service schema admission.
Scope and production growth
Nineteen existing files changed: production TypeScript +232 net, model-facing prompt/schema +33 net, tests +316 net, and docs +32 net. Combined runtime/model-contract growth is +265. The added production surface establishes the previously missing typed source-line proof and public-projection boundary; a prose-only warning or shallow-fetch change cannot enforce that contract. It reuses the trusted Git reader and existing report representation, replaces unrestricted Git injection and the older blame-only verification path, and avoids a parallel attribution implementation or schema overhaul.
Real Behavior Proof
Claim and exercised surface: unchanged or unverifiable history must not become confident historical people attribution; genuine introducing-line metadata must survive the actual producer, report serialization, and public-comment reader.
Scenario and observed before/after: disposable real Git histories contain an introducing commit, unrelated later work, shallow boundaries with the actual parent available or missing, and genuine introduction positives. The pre-fix verifier attributed an unchanged line to the unrelated commit. After the repair those histories remain carried-forward/unknown, while real introducing author and committer metadata stays distinct from PR author and merger. Further fail-before/pass-after cases cover configured blame exclusions, exact/inexact renames, legacy grafts, replacement refs, malformed parent records, and CR/Unicode record-boundary spoofing. The sibling test-merge reader rejects fake ancestry. Legacy report rendering no longer promotes a historical role, high confidence, or owner commit link without host proof.
Executed production path: the built
review --local-rangeCLI was exercised against real Git repositories, then its actual report was passed through the public-comment renderer. Positive and negative attribution, selected-owner consistency, and clean target checkouts were asserted. The focused run and final full gate include this proof intest/regression-provenance.test.ts, alongside the provenance and comment-reader siblings. A local rendering of the retained incident report likewise produced no attributed predecessor and only unverified routing candidates; the live comment was not touched.Limits: that deterministic producer-to-report-to-comment harness uses existing fixture Codex/scanner executables to control model decisions. It proves the changed Git and projection behavior, not native model-service schema admission, hosted publication, or a reproduction of the unavailable historical blame invocation. No live GitHub write is part of this proof.
Native CLI/schema admission — executed
A separate native run on 2026-08-29, 19:34:46–19:40:13 UTC completed with exit 0 in 326.458 seconds, using real TruffleHog 3.97.1 and Codex CLI 0.150.1 on the candidate/base above. It used the configured built-in OpenAI provider, retained the mandatory scanner and read-only checkout inspection, requested
read-onlysandboxing with approvals disabled, stripped GitHub credentials, isolated GitHub config, and disabled web search. This was GitHub-isolated, not air-gapped: Codex inference used its configured model service.The executed CLI command, from the candidate checkout, was:
The task pinned
CODEX_BINto the verified installed CLI and selected the existing Codex runner; it did not alter persistent configuration or override the configured model. No model-selector flag was passed: configured routing was used, and its private model identifier is intentionally omitted from this proof. The report recordsreview_status: complete,local_checkout_access: verified, and the exact base/head. The model returned two non-null history pointers and no host proof markers. The host verified both pointers and emitted tworaw_parent_line_v1source-line author facts. Passing that native report through the production public-comment renderer retained both facts and removed the model's broader role descriptions.The native source review reported zero findings and zero risks, with “patch is correct” and confidence 0.88. It explicitly did not rerun or reassess the separate test evidence. The recorded 35 shell commands had no Git mutation, GitHub CLI, network-lookup, or test/build/install command matches; the isolated GitHub config remained empty. HEAD and the clean checkout were unchanged after both the CLI run and local comment rendering.
Sanitized trace:
artifacts/provenance-native-3b2fb44d/native-sanitized-proof.json. Raw model output, report, comment rendering, and execution logs remain private; the sanitized trace records their hashes, tool versions, exact candidate/base, outcomes, and limits. Observable result extract:{ "exitCode": 0, "reviewStatus": "complete", "readOnlyCheckoutInspection": "verified", "nonNullHistoryPointers": 2, "modelSuppliedHostProofMarkers": 0, "hostProofMarkersInReport": 2, "publicCommentSourceLineAuthorCount": 2, "rawModelRolesRemovedFromComment": true, "reviewFindingCount": 0, "headUnchanged": true, "checkoutCleanAfterRendering": true }Native limits: one candidate/base and two positive histories, with negative cases established separately by the deterministic real-Git regressions; no hosted publication, live GitHub comment update, or packet-level network audit. The native model's
realBehaviorProof: not_applicabledescribes its source-only review of separately held evidence, not the CLI/report behavior directly observed here. The separate committed-branch review is complete and clean. Exact-head CI and a ClawSweeper review matching the current PR head and body remain required before landing.