fix: exact re-reviews leave stale status labels - #1236
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 31, 2026, 7:06 AM ET / 11:06 UTC. ClawSweeper reviewWhat this changesThe PR lets exact review publication replace stale managed pull-request labels only when the completed review’s source, timeline, head, and activity receipts still match and no same-second-or-later human activity exists. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain Keep open: the receipt-gated freshness change is a focused fix for the linked stale-label bug, but the supplied validation remains a local mocked GitHub CLI scenario and does not meet the required real-behavior proof gate. Priority: P1 Review scores
Verification
How this fits togetherClawSweeper’s apply lane reads a completed review report and current pull-request activity before synchronizing the durable review comment and managed GitHub labels. This freshness gate determines whether automated label reconciliation may reach the GitHub mutation step. flowchart LR
A[Completed review report] --> C[Freshness gate]
B[Current pull request activity] --> C
C --> D{Receipts and activity valid?}
D -->|yes| E[Managed label reconciliation]
D -->|no| F[Leave labels unchanged]
E --> G[Durable review comment]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the receipt-first reconciliation design and add redacted, current-head Crabbox local-container evidence from an authorized real GitHub transport path showing both the successful stale-label transition and the human-activity no-op. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main uses the generic freshness path, while the introduced branch adds the completed-review receipt and activity boundary needed for the linked exact-publication scenario. A live reproduction was not run in this read-only review. Is this the best way to solve the issue? Yes, conditionally: the receipt-first gate is the narrowest maintainable way to distinguish a reviewed re-review command from later human activity, provided real-transport proof confirms the actual apply boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 206fe726bbad. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Added the requested real-transport trace. It shows label reconciliation through the GitHub API and verifies that both same-second and later human activity prevent the automated action. The trace was captured against the current head without changing the implementation. |
a5d575f to
cff385b
Compare
Closes #1226
What Problem This Solves
Fixes exact pull request re-reviews publishing a current maintainer-ready verdict while stale managed status and rating labels remain because the re-review command advanced activity after the stored snapshot.
Why This Change Was Made
Completed current-head reviews may reconcile labels only when the source, timeline, head, and review-activity receipts still match. The apply path also requires a complete activity read with no human activity in or after the review-completion second, preserving maintainer label changes that are intentionally excluded from receipt hashes. Legacy reports remain fail closed for human comments.
User Impact
Exact re-reviews reconcile stale proof, rating, status, and merge-risk labels when the requesting command is covered by the completed review. Newer or same-second human activity blocks label mutation until another review completes.
OpenClaw Bay Impact
OpenClaw Bay is unaffected. This changes GitHub managed-label reconciliation only and does not change Bay data, routes, observer contracts, or controls.
Documentation Impact
Adds a focused proof package under
docs/proof/exact-review-label-reconciliation/documenting the exercised runtime path, expected mutation, and limits.Finding Disposition
reviewed_atsecond as ambiguous and blocks reconciliation.Validation
pnpm run build:allnode --test --test-name-pattern='human comment activity|exact publication syncs fresh-head PR labels|skips fresh-head PR label sync when humans act|exact publication withholds fresh-head PR label sync from close proposals' test/apply-label-sync.test.ts(4 passed)pnpm run check:staticpnpm run lintbash docs/proof/exact-review-label-reconciliation/run-proof.sh(3 passed)git diff --checkReal Behavior Proof
Claim: Exact publication of a completed, current-head pull request review reconciles stale managed labels when the requesting command is covered by the completed review, while later or same-second human activity still blocks reconciliation.
Exercised surface: The built
dist/clawsweeper.js apply-decisionscommand, exact-event publication, report-owned review lease handling, full pull request context hydration through a local GitHub CLI transport, batched label mutation, durable review comment publication, and lease cleanup.Scenario: The controlled pull request begins with
status: needs proofandrating: silver shellfish. A command requests re-review. Matching complete-review receipts for the unchanged 40-character head select sufficient proof, the current rating, maintainer-ready status, and a merge-risk label. The adjacent negative scenario applies a maintainer-managed label in the same timestamp second asreviewed_atwhile receipt hashes remain equal.Observed result: The positive scenario emitted one atomic
issue editmutation adding the current proof, rating, status, and merge-risk labels, removing both stale labels, and patching the durable review comment. The receipt-matched same-second maintainer activity scenario emitted no label mutation. The exact close-proposal regression also emitted no label mutation.Artifact or trace:
docs/proof/exact-review-label-reconciliation/README.mdanddocs/proof/exact-review-label-reconciliation/run-proof.sh.Limits: The transport is local and deterministic. It exercises the shipped command and mutation boundary without contacting or mutating GitHub's hosted API.
Disclosure: AI was used to understand the codebase and review the fix.