Skip to content

fix(review): review PRs once after a quiet window - #1997

Merged
vincentkoc merged 6 commits into
mainfrom
fix/pr-review-once-after-quiet
Oct 14, 2026
Merged

vincentkoc merged 6 commits into
mainfrom
fix/pr-review-once-after-quiet

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Wait ten quiet minutes before the first automatic PR review, then require an explicit @clawsweeper review or @clawsweeper re-review after a completed answer. This prevents premature reviews during author/cleanup-bot edits and repeated automatic reviews after an answer.

  • Restart the initial window for head, title, body, and draft changes, including changes whose webhook was missed. Comment/label-only activity does not extend it.
  • Store the lifetime completed-answer fact at canonical publication. It survives queue cleanup, restart, failed replacement, and archive/deletion. Failed, unverified, and stale-source attempts do not consume the first answer.
  • Keep scheduler nominations for recovery; enforce the lifetime rule at queue admission, dispatch, and claim before any review workflow starts. Preserve unfinished explicit requests and existing autofix/automerge opt-ins; recheck live opt-in labels at claim.
  • Update contributor guidance to request re-review after finishing changes.

Real Behavior Proof

Candidate: 314d612bf8c633f5414293c9e1bb5fd747c768f0.

Executed node scripts/proof-pr-review-policy.mjs "$TOOL_PREFIX" "$FRESH_OUTPUT_DIR" "$LEGACY_PUBLICATION_SOURCE" against the production queue and persisted SQLite in workerd. The source-bound proof and result include nine current production-source hashes and the previous implementation's hash.

Observed: initial ten-minute hold, body-change extension, one dispatch, stale automatic claim rejection after completion, suppression across a fresh Worker instance, explicit/opt-in dispatch, and rejection after opt-in removal before claim.

For upgrade proof, the actual publication store from base adf080a6318b96e9665cc46de87f97641f3cfa23 writes and prunes a database. A fresh candidate Worker opens it: unverified and pruned/unknown-provenance records remain eligible; verified completion with a retained valid receipt stays answered. Old records whose provenance was already discarded may receive one fresh review rather than permanently suppressing an unproven answer.

Environment: macOS arm64, Node 26.7.0, frozen pnpm 12.4.1 dependencies in an isolated temporary source copy, Miniflare/workerd versions recorded in the proof. AWS Crabbox source transfer and the local container service were unavailable, so trusted-source local fallback was used. GitHub HTTP responses and time are controlled fixtures. This proof calls no model, mutates no live PR, and does not claim production deployment.

Review finding disposition

The first ClawSweeper review identified three accepted P2 issues, all addressed:

  1. Verified completion: moved the existing effectiveReviewStatus and runner-owned checkout verification into a shared dependency-light module; metadata and the new lifetime gate use the same contract. This preserves the intent of #1170.
  2. Receipts pruned before upgrade: missing or unknown lifecycle provenance no longer becomes a permanent positive latch. The upgrade proof runs the old writer/pruner, rather than relying on the new preserving prune hook.
  3. Opt-out after dispatch: claim reads current labels and revalidates the lease and claimant after awaiting GitHub. Failed reads retry without consuming the lease; rejecting the old lease preserves a newer explicit request. Tests include an in-flight explicit request and lease expiry.

The same audit found a duplicate planner-only inference: complete-looking unpublished reports could suppress the scheduled offer needed to release a source-drift park after a missed webhook. That filter and helper are removed. The existing durable queue remains the sole completion authority and rejects answered offers before dispatch.

The earlier branch review also caught first-post-upgrade pruning deleting valid legacy receipts before lazy seeding. Pruning now seeds every selected published receipt, including valid completions, before deletion. The old-store runtime proof explicitly runs candidate pruning before the first eligibility check and preserves the completed answer.

The second ClawSweeper review identified archive/reopen reconciliation incorrectly promoting stale-source reports to completed answers. Positive completion now lives only in actual review publication. Generic tuple mutations preserve the existing fact and seed proven legacy completion before overwriting records. A regression test reproduces the previous failure, and the refreshed workerd proof covers both stale-source and valid answers through archive/reopen.

CI also caught an early draft discard, which was removed so existing draft/oversized-PR worker gates remain authoritative. The local review's earlier legacy-seeding finding was corrected and covered before and after receipt pruning.

Validation

  • 310 focused queue/hold/source regressions passed.
  • 33 completion, upgrade, claim, verified-checkout, and source-drift tests passed; the CSW-088 planning regression and earlier public-comment/proof coverage also passed.
  • Build, strict types, lint, formatting, docs, and limits checks passed.
  • Real workerd + SQLite proof passed; all nine source hashes match.
  • Exact-head CI run passed all four test shards, coverage, aggregate pnpm check, fast gates, Windows launcher, and sparse build smoke. Fresh local delta and final committed-branch reviews found no actionable P0/P1/P2 findings.

The publication store owns lifetime completion; the existing queue owns quiet time and admission. This adds one additive SQLite table without a schema bump, no new executor or scheduling service. Production TypeScript: +375 / -31 lines (net +344). Tests and the runtime-proof harness: +952 / -87 (net +865). Production growth implements durable completion, the quiet interval, and live claim authorization; duplicate planner policy was removed.

@vincentkoc
vincentkoc marked this pull request as ready for review October 14, 2026 14:05
@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

Please review the final candidate 4330586d295c7e488f193d7264ad02af68d43079. Current real-runtime proof and exact-head CI evidence are in the PR body.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 14, 2026
@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR delays the first automatic PR review until ten quiet minutes pass and requires an explicit request after a completed answer.

Example: An ordinary PR changes its body nine minutes after initial observation.

  • Before: Automatic reviews could start during editing and recur after later changes.
  • After: The body change restarts the ten-minute window; after a completed answer, further reviews require an explicit request.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and the earlier findings are resolved; production-runtime and upgrade traces provide useful proof within a controlled harness.
Proof confidence 🦐 gold shrimp (3/6) ✨ media proof bonus Sufficient (linked_artifact): The source-matched workerd/SQLite proof exercises production admission, alarms, HTTP dispatch, delayed claim rejection, restart, archive/reopen, and old-store upgrade behavior; allowed explicit/opt-in dispatch and revoked opt-in rejection are recorded with controlled transport and time.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Contributors receive reviews during ongoing edits and repeated automatic answers after completing an initial review.
Reason: The maintainer-authored direction explicitly approves the cadence change, and the implementation preserves unfinished requests and opted-in automation.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for landing consideration: the prior findings are resolved, and no new actionable defect was found in the pinned diff.

Priority: P2
Reviewed head: 314d612bf8c633f5414293c9e1bb5fd747c768f0

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied proof exercises production queue and storage owners with controlled GitHub HTTP responses rather than a live hosted review workflow.
Agent review details

How this fits together

GitHub events and scheduled nominations enter the durable review queue, which checks live PR state and stored completion before dispatching or granting review work.

flowchart LR
Events[GitHub events and scheduled nominations] --> Queue[Durable review queue]
Live[Live PR state] --> Queue
Store[Canonical publication and completion store] --> Queue
Queue --> Dispatch[Review workflow dispatch]
Dispatch --> Claim[Live claim eligibility]
Claim --> Review[Review and canonical publication]
Review --> Store
Loading

Technical review

Best possible solution:

Keep completion ownership in canonical publication and quiet-window enforcement in the existing queue, preserving explicit requests and live automation opt-ins.

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

Current main retains recurring automatic review behavior and lacks the lifetime completion gate; source inspection establishes the path without running target code.

Is this the best way to solve the issue?

The existing publication store and queue are appropriate owners, and the final change resolves the earlier provenance and delayed-claim defects without adding a competing scheduler.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c0f27ee282e1.

Provenance checked

  • Automatic review timing changes intended behavior with a stated reason (dd58d9e: perf(queue): hold organic churn longer on actively re-reviewed items #1708 reduced churn through longer debounce while preserving immediate first reviews.)
  • Maintainer review opt-in keeps the original intent (f8e303f: fix(review): make maintainer reviews opt-in #1948 prevents unsolicited maintainer reviews while retaining explicit requests and automation opt-ins.)
  • Verified checkout completion keeps the original intent (fix(review): verify checkout access before publication #1170: Complete reports must carry runner-owned verified checkout evidence; the extracted completion helper preserves that existing contract.)
  • Canonical publication and receipt pruning keeps the original intent (70fcb48: Canonical publication owns records while terminal receipts have bounded retention; the additive lifetime fact preserves completion before receipts disappear.)
  • Public proof guidance changes intended behavior with a stated reason (b3820a1: The presentation refactor preserved guidance promising automatic re-review; this PR replaces that promise to match its approved explicit-request policy.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit f8e303f adds src/maintainer-review-policy.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f8e303f63a04; files: src/maintainer-review-policy.ts)
  • Peter Steinberger: Raw commit 70fcb48 adds dashboard/exact-review-direct-publication.ts:390 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 70fcb48c8397; files: dashboard/exact-review-direct-publication.ts)
  • Ayaan Zaidi: Raw commit e4d9b1a adds src/clawsweeper-record-metadata.ts:407 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e4d9b1abc054; files: src/clawsweeper-record-metadata.ts)

Review metrics

Metric Value Why it matters
Production versus validation growth Production TypeScript +375/-31; tests and runtime-proof harness +952/-87 Growth implements durable completion, quiet-window admission, and live claim checks, with focused persistence and concurrency coverage.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority review-cadence improvement that reduces premature and repeated automation.
  • merge-risk: 🚨 automation: The PR changes durable review admission and dispatch eligibility; its longer initial wait and explicit-request requirement are accepted policy changes documented by the maintainer author.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-14T14:14:34.147Z sha 4330586 :: blocked before merge. :: [P2] Preserve verified-checkout semantics when recording completion | [P2] Handle stale receipts pruned before the upgrade | [P2] Refresh automation opt-in before accepting an answered PR claim
  • reviewed 2026-10-14T14:41:52.290Z sha c0cc6da :: needs changes before merge. :: [P2] Preserve unanswered provenance during canonical tuple mutations

Reviewed October 14, 2026, 10:57 AM ET / 14:57 UTC (Revision 3).

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head c0cc6daef58c9f480ebfcfcc307b741659ae97d3. All three earlier findings and the additional branch-review prune-order issue are addressed; the PR body includes their dispositions, current source-bound workerd/SQLite upgrade proof, and passing exact-head CI.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient Contributor real behavior proof is sufficient. label Oct 14, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Current head 314d612bf8c633f5414293c9e1bb5fd747c768f0 fixes the archive/reopen finding: only review publication advances completion; canonical tuple mutations preserve existing provenance. The regression fails on the previous code and passes here. The refreshed source-bound workerd/SQLite proof covers stale and valid answers through archive/reopen; the PR body records all dispositions and passing exact-head validation.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 14, 2026
@vincentkoc
vincentkoc merged commit 8cf2991 into main Oct 14, 2026
34 of 36 checks passed
@vincentkoc
vincentkoc deleted the fix/pr-review-once-after-quiet branch October 14, 2026 15:44
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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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