Skip to content

feat(review): add non-blaming regression provenance - #1023

Merged
brokemac79 merged 1 commit into
mainfrom
codex/csw-085-regression-provenance-v2
Aug 3, 2026
Merged

brokemac79 merged 1 commit into
mainfrom
codex/csw-085-regression-provenance-v2

Conversation

@brokemac79

@brokemac79 brokemac79 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a non-blaming regression-assessment signal to ClawSweeper review decisions and durable review comments.
  • Render suspected and probable assessments with normalized supporting evidence, without naming a predecessor PR.
  • Render a predecessor PR only as confirmed provenance after exact PR metadata and local blame agree that its merge commit introduced the reviewed source line.

Problem

Reviewers need to record useful regression context without treating temporal proximity or an adjacent change as causation. The former output had no structured, confidence-aware way to distinguish a possible regression from independently verified provenance.

Implementation

  • Add regressionAssessment with closed evidence kinds: reproduction, reviewed_change, failure_trace, and known_regression_link.
  • Permit model-authored suspected or probable only; probable requires two evidence kinds and confirmed is runtime-only.
  • Keep the existing candidate PR data untrusted. The fixed verifier accepts only the report-recorded main or PR-head revision, canonical merged-PR metadata, a tracked safe path, and a single-line porcelain blame result matching the merge SHA.
  • Reject malformed candidates, checkout/revision mismatch, missing history, shallow-history boundary output, and stale/incorrect hypotheses. These cases retain only a generic assessment, if present; they never name a predecessor.
  • Persist the assessment/provenance in the durable report and re-render it in public review comments without exposing source paths, full SHAs, local paths, free-form proof, or contributor ratings.

Real Behavior Proof

  • Claim: review output distinguishes possible regression signals from confirmed provenance, and never names a PR without exact evidence.

  • Surface: the exact built 2667a5e50acbf9d928cc04d4616d018a76e1247f verifier and its durable-report comment renderer, in Linux.

  • Scenario / fixture: canonical read-only GitHub metadata for merged #1007, plus a disposable full public Git clone of this exact PR branch. The candidate source line blamed exactly to fix(review): suppress owned activity churn #1007's merge commit; an adjacent line blamed elsewhere. The renderer was then given each outcome.

  • Command / environment:

    • Read only the six verifier fields from gh api repos/openclaw/clawsweeper/pulls/1007 and pass that canonical response to the production fetchPull dependency.
    • Run a fixed proof harness through crabbox run --provider local-container --local-container-image mcr.microsoft.com/playwright:v1.60.0-noble --no-hydrate --timing-json on this Windows host. It mounts the exact built head read-only, clones only this published branch with complete blobs for the disposable proof fixture, then invokes the verifier's fixed rev-parse, ls-files, and blame allowlist.
  • Observed result: provider local-container; image mcr.microsoft.com/playwright:v1.60.0-noble; lease cbx_02228fa2746a (stopped); exit 0; head 2667a5e50acbf9d928cc04d4616d018a76e1247f; GitHub metadata says fix(review): suppress owned activity churn #1007 is merged to main. The exact verifier emitted a fix(review): suppress owned activity churn #1007 link only for the blame-to-merge match. It suppressed the adjacent incorrect candidate and the actual renderer emitted the generic possible-regression fallback without a predecessor.

  • Artifact / trace: the durable fixtures are test/regression-provenance.test.ts and test/review-comment-rendering.test.ts. Redacted current-head Crabbox trace:

    CRABBOX_PHASE:git-fixture
    CRABBOX_PHASE:prove
    CSW085_PROOF github_source=authenticated_gh_api predecessor_pr=1007 merged=true base=main
    CSW085_PROOF head=2667a5e50acbf9d928cc04d4616d018a76e1247f verified_link=true public_source_details=false evidence=blame_to_merge_commit
    CSW085_PROOF incorrect_candidate_suppressed=true possible_regression_fallback=true predecessor_attributed=false
    
  • Limits: this is a controlled read-only proof, not a live review/comment mutation and not evidence that a model will elect to propose a candidate. The verifier never hydrates history: on incomplete or shallow history it remains unknown and emits no predecessor. The separate full clone is only fixture setup to provide immutable complete history for the positive case.

Validation

  • pnpm run build
  • Exact-head controlled Linux proof: Crabbox local-container lease cbx_02228fa2746a — passed (exit 0)
  • node --test --test-concurrency=1 test/regression-provenance.test.ts test/decision-parser.test.ts test/review-comment-rendering.test.ts — 49/49 passed
  • pnpm exec oxfmt --check over all 21 changed files
  • pnpm exec oxlint over the changed TypeScript sources and tests
  • git diff --check origin/main...HEAD

Codex review closeout

  • Current exact-head loop: focused build/tests/format/lint/diff checks passed; codex review --uncommitted found no local diff (the proof added no product-code change or commit).
  • Current codex review --base origin/main final retry reported: “No actionable correctness issues were found in the diff” against 326104b08f93941c21ab7afd2cd57a60b51ff583.
  • codex review --uncommitted — final pass reported no actionable correctness issues.
  • codex review --base origin/main — no actionable defects against 326104b08f93941c21ab7afd2cd57a60b51ff583.
  • Accepted review fixes: use the exact report-recorded checkout revision (including managed PR head) and reject shallow Git blame boundary results.
  • Deliberate safety boundary: do not hydrate/fetch missing historical blobs. That would broaden the authorized local verifier; incomplete history is treated as unknown.

Risks and rollout

  • Confidence labels are informational, not blame or contributor scoring.
  • The system may omit a confirmed predecessor when local history is incomplete; this is intentional fail-closed behavior.
  • No queue, state, Cloudflare, Bay, reviewer gate, or merge behavior changes.

Current-main collision check

Review state

Draft PR. No @clawsweeper review command has been posted; no existing PR or active command route existed before creation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 5:05 PM ET / 21:05 UTC.

ClawSweeper review

What this changes

The branch adds structured non-blaming regression assessments and a runtime verifier that publishes an earlier merged PR only when exact GitHub metadata and Git blame prove it introduced the reviewed source line.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR remains necessary: it adds a bounded, fail-closed way to distinguish a generic regression signal from verified predecessor provenance. The verifier validates canonical merged-PR metadata, the exact reviewed checkout revision, a tracked path, and a one-line blame match before any predecessor link is rendered; the current-head controlled runtime proof is sufficient. Because this introduces a new public review-comment policy, it should stay open for a maintainer product-direction decision rather than close or auto-repair.

Priority: P2
Reviewed head: 2667a5e50acbf9d928cc04d4616d018a76e1247f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, fail-closed, and well covered, with current-head controlled runtime proof; only the public attribution policy requires maintainer confirmation.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The updated PR body provides current-head terminal proof of the built verifier and renderer using canonical read-only GitHub metadata plus a disposable full-history Git fixture; it shows both the positive attribution and incorrect-candidate suppression paths. Redacted terminal output is appropriate for this internal automation change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The updated PR body provides current-head terminal proof of the built verifier and renderer using canonical read-only GitHub metadata plus a disposable full-history Git fixture; it shows both the positive attribution and incorrect-candidate suppression paths. Redacted terminal output is appropriate for this internal automation change.
Evidence reviewed 6 items Fail-closed verifier: The new verifier rejects malformed candidates, requires the candidate repository to match the reviewed item, checks canonical merged-PR metadata against the target branch, confirms the checkout is one of the recorded review revisions, and only accepts a tracked source line blamed exactly to the merge commit.
Runtime integration: The review workflow runs the verifier after parsing the decision and before rendering the report; the runtime replaces unverified candidate provenance with null while preserving any generic assessment.
Focused regression coverage: The added verifier tests cover malformed and self candidates, metadata mismatches, shallow-history boundaries, unavailable history, checkout revision mismatch, and the permitted exact PR-head case.
Findings None None.
Security None None.

How this fits together

ClawSweeper parses model-produced review decisions, enriches them with independently checked runtime facts, then persists and renders durable GitHub review reports. This change adds a narrow provenance-validation stage between decision parsing and report/comment presentation so unverified model hints cannot become public attribution.

flowchart LR
  A[Model review decision] --> B[Decision parser]
  B --> C[Regression assessment or candidate]
  C --> D[GitHub metadata and Git verifier]
  D --> E{Exact merge and blame match?}
  E -->|Yes| F[Verified predecessor provenance]
  E -->|No| G[Generic non-blaming assessment]
  F --> H[Durable report and public comment]
  G --> H
Loading

Decision needed

Question Recommendation
Should ClawSweeper publicly render a predecessor PR when canonical metadata and an exact reviewed-line blame match verify that the PR merge introduced that line? Adopt verified provenance: Keep the PR's strict blame-to-merge-commit threshold and publish a predecessor link only after the runtime verifier succeeds.

Why: The implementation is mechanically bounded, but whether confirmed source-line provenance belongs in a public automated review comment is a maintainer communication-policy choice rather than a correctness fact.

Before merge

  • Resolve merge risk (P1) - Merging changes public review-comment semantics: a verified predecessor link can influence how contributors interpret responsibility, so maintainers should explicitly confirm that this narrowly defined blame-to-merge-commit threshold is the intended permanent communication policy.
  • Resolve merge risk (P1) - The verifier deliberately fails closed when checkout history is incomplete; that avoids unsupported attribution but can omit provenance in shallow or partial-clone environments.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch surface 21 files, +1067/-2 The feature spans model schema, decision parsing, runtime verification, durable reports, and public presentation.
Production versus tests production +668, tests +399 Most production growth implements the verifier and cross-layer wiring, with substantial focused coverage for rejection and rendering paths.

Merge-risk options

Maintainer options:

  1. Confirm the public attribution policy (recommended)
    Before merge, confirm that the strict verified-provenance threshold is acceptable for public automated comments; the implementation already fails closed when it cannot prove the relationship.
  2. Keep only generic assessments
    Accept the structured assessment data but remove public predecessor links if maintainers want to avoid automated attribution entirely.
  3. Defer the surface
    Pause this feature if maintainers do not yet want regression provenance to become part of ClawSweeper's public review contract.

Technical review

Best possible solution:

Adopt the fail-closed verifier only after confirming that public comments should show a predecessor PR at this exact evidence threshold; retain generic assessments whenever that proof is incomplete.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds a new provenance capability rather than repairing a reported current-main defect. Its stated exact-head controlled runtime proof exercises the verifier and renderer with canonical PR metadata and a disposable full-history fixture.

Is this the best way to solve the issue?

Yes for the technical boundary: fixed commands, canonical metadata, recorded-revision checks, tracked-path checks, and exact blame matching are a narrow maintainable way to prevent unsupported attribution. Whether the public predecessor link should exist remains a maintainer policy decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 326104b08f93.

Labels

Label justifications:

  • P2: This is a bounded internal review-automation feature with no demonstrated active user-facing outage.
  • merge-risk: 🚨 automation: The PR changes review-time GitHub/Git verification and the durable public-comment rendering path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The updated PR body provides current-head terminal proof of the built verifier and renderer using canonical read-only GitHub metadata plus a disposable full-history Git fixture; it shows both the positive attribution and incorrect-candidate suppression paths. Redacted terminal output is appropriate for this internal automation change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body provides current-head terminal proof of the built verifier and renderer using canonical read-only GitHub metadata plus a disposable full-history Git fixture; it shows both the positive attribution and incorrect-candidate suppression paths. Redacted terminal output is appropriate for this internal automation change.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Authored the recent decomposition that established the current review rendering and automation boundaries this PR extends. (role: review-system refactor author; confidence: high; commits: 2d1a40bfa643, dccfa528f038; files: src/clawsweeper-review-command-workflow.ts, src/clawsweeper-review-runtime.ts, src/clawsweeper-report-comment-presentation.ts)
  • PollyBot13: Authored the current-main review-freshness and structural-receipt change that overlaps the runtime review path and supplied the merged PR used by this branch's provenance proof fixture. (role: recent adjacent workflow contributor; confidence: medium; commits: 326104b08f93; files: src/clawsweeper-review-command-workflow.ts, src/clawsweeper-runtime.ts, src/clawsweeper-status-context.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain a maintainer decision on the public verified-provenance policy before marking the draft ready.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-03T20:01:08.823Z sha 2667a5e :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 3, 2026
@brokemac79
brokemac79 marked this pull request as ready for review August 3, 2026 23:21
@brokemac79
brokemac79 merged commit 37283cc into main Aug 3, 2026
31 checks passed
@brokemac79
brokemac79 deleted the codex/csw-085-regression-provenance-v2 branch August 3, 2026 23:21
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant