Skip to content

fix(review): make maintainer reviews opt-in - #1948

Merged
vincentkoc merged 1 commit into
mainfrom
fix/maintainer-review-opt-in
Oct 13, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/maintainer-review-opt-in

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

ClawSweeper automatically reviews maintainer issues and PRs while work is still in progress. Automatic retries and old queue reservations can continue that work even when the entry-point dispatcher skips it.

User Impact

Reviews of maintainer-authored or maintainer-labelled items are opt-in. Maintainers can request @clawsweeper review once the work and validation are complete, only if a review is needed. Existing autofix/automerge labels remain explicit opt-ins.

New issues and ready, non-draft PRs receive at most one friendly reminder: finish the work first, avoid repeated requests while a review is queued or running, and do not let agents request reviews automatically. Edits and pushes do not repeat the reminder. A verified review request authorizes one review; later source changes require a new request.

Why This Change Was Made

One shared maintainer policy now governs planning, webhooks, claim admission, reservation recovery, and hosted-result publication. This prevents bypassing the dispatcher through scheduled work, stale jobs, or publication of an old automatic review. Maintainers are identified by OWNER/MEMBER/COLLABORATOR association or a normalized maintainer label.

The reminder reuses the existing acknowledgement dedupe and settlement owner. Trusted-bot receipts prevent duplicate comments and the marker is excluded from command routing. Comment-history reads retain their ten-page limit; if absence cannot be established, the reminder is skipped. Generic GitHub activity ingestion stays enabled.

The target-repository rollout is openclaw/openclaw#170587.

OpenClaw Bay Impact

Bay queue and review projections retain their existing schemas, statuses, and activity ingestion contract. The affected admission and recovery paths are exercised through the Worker and queue entry points; no Bay code or data migration is needed.

Documentation Impact

Updated active guidance in README, AGENTS, scheduler documentation, and the canonical target-dispatcher example. The existing runtime/dispatcher owners and sources of truth remain in place; maintainer classification, explicit opt-in, one-shot authority, and reminder delivery are the update triggers. Added the required changelog fragment.

Evidence

  • Linux Crabbox, Node 24.19.0 and pnpm 12.4.1: all three builds passed; static checks, documentation checks, formatting, types, lint, and coverage thresholds passed.
  • Full pnpm run check: 5,822 tests, 5,791 passed, 23 skipped, 8 initial failures; 225.9 seconds total (212.8 seconds in the test runner). Coverage: 91.30% lines, 81.42% branches, 93.82% functions.
  • All eight failures were diagnosed and cleared by a 26-test targeted run in 50.9 seconds. Four needed the isolated checkout's missing Git metadata, restored from the exact frozen base. The others covered changed maintainer audit/read-order expectations and a command fixture that could accidentally land exactly on a whole-second concurrent-activity boundary. The fixture now explicitly uses subsecond precision. The final targeted run passed; this is not a claim that the entire suite was rerun afterward.
  • Official GitHub Actions expression evaluator: 120 author/label/event combinations passed across both dispatchers, including GitHub's truthy empty-array behavior.
  • Fresh pre-commit and committed-branch P0-P2 reviews found no actionable defects; final changed-test lint/format and git diff --check passed.

Real Behavior Proof

Claim: automatic maintainer work is skipped at every admission/publication boundary, explicit requests remain available once, and the reminder does not create duplicate reviews or comments.

Surface and scenarios: signed Worker webhook requests, compiled claim/apply workflow entry points, the actual queue recovery alarm, and the extracted dispatcher shell step. Controlled GitHub adapters cover maintainer issues and PRs, draft/ready transitions, contributor-authored work with a maintainer sender, duplicate/concurrent delivery, pushes/edits, explicit commands and labels, stale source requeues, private-member permission fallback, old reservations/results, trusted/spoofed receipts, and exhausted pagination.

Commands/environment: pnpm run build:all, pnpm run check, and focused node --test runs of the affected admission, webhook, queue, apply, planning, and dispatcher suites on the pinned Linux environment above. Both workflow eligibility expressions were also executed with @actions/expressions 0.3.61.

Observed trace: automatic maintainer claims stop before review; old reservations are removed before acknowledgement lookup/enqueue; old automatic results produce no comment/label/close mutation; verified commands and explicit automation labels remain eligible; duplicate reminders collapse to one trusted receipt; activity ingestion continues. The final dispatcher suite passed 11/11 in 2.93 seconds; the final targeted regression run passed 26/26.

Cost and limits: the added shell reminder case took 0.51 seconds and the recovery case 0.042 seconds; the expanded admission file took 26.8 seconds. The targeted run's 50.9 seconds is mostly an existing reservation case. GitHub CI timings will be recorded when available. These are controlled API boundary proofs, not live GitHub comment mutations or a live Actions dispatch. No rendered UI changed.

Final publication authority proof

Addressed the hosted review's missing proof and associated merge-risk item on the unchanged head cacf8aee298eba26ff634504ad9b53d6a35e9e15. A fresh isolated AWS Crabbox run used Node 24.19.0, pnpm 12.4.1, the frozen dependency lock, and source-hash checks for the policy and apply owner. Its command completed successfully in 9.48 seconds. No production code changed.

The probe executes the real node dist/clawsweeper.js apply-decisions entry point with --exact-event-publication --event-apply-proof --sync-comments-only --item-numbers 321. It reads a persisted MEMBER-authored PR report and its production-rendered review lease, then uses controlled GitHub responses at the transport boundary. The explicit-request case supplies the same verified re_review receipt fields exercised by the earlier admission proof. The production apply owner makes every eligibility, freshness, lease, and publication decision. There is no dry-run flag.

Input at delayed publication Observed result Comment API writes Item label writes Close writes
Verified maintainer request; reviewed head still current review_comment_synced, durableReviewSynced: true 2 1 0
Automatic event with live clawsweeper:autofix opt-in review_comment_synced, durableReviewSynced: true 2 1 0
Verified request, but live PR head changed after review skipped_changed_since_review, sourceDriftVerified: true 0 0 0
Report captured the automation opt-in, but the live label was removed skipped_maintainer_authored 0 0 0
Verified request fields retained on source_drift_requeue skipped_maintainer_authored 0 0 0

The successful cases assert both the public result and a written payload containing the durable clawsweeper-review item=321 marker. Comment API counts include lease/status handling; they do not mean two durable reviews. The rejected cases assert zero comment, item-label, and close writes, with source change rejected after ten read commands and the two maintainer-policy refusals after one read command. The candidate handles the final effects; the adapter supplies only external state and records requests.

The first probe stopped because its adapter lacked commit-check and label-catalog responses. Those fixture responses were completed before the passing run; no product failure was hidden or retried unchanged. This closes the review's requested allowed/forbidden/revoked publication matrix. It remains controlled transport proof, not a live GitHub mutation or a claim to execute the model-review service end to end.

GitHub CI also passed on this exact head: https://github.com/openclaw/clawsweeper/actions/runs/38342195653. Whole-job times were 344/222/125/137 seconds for test shards 1–4, 15 seconds for static gates, and 23 seconds for coverage. These are whole-job costs; the focused case costs above describe the added coverage.

Skip automatic maintainer-authored and maintainer-labeled item reviews at intake, planning, claim, recovery, and publication. Keep verified explicit requests one-shot and preserve existing automation opt-in labels. Post one bounded, deduplicated reminder asking for review only when needed after work and validation are complete.

Validation: builds, lint, docs, formatting, and coverage gates passed on Node 24 in Crabbox. Full check ran 5,822 tests; eight initial failures were diagnosed as stale policy/read-count expectations, absent fixture Git metadata, and a whole-second timestamp flake. All affected checks passed in a 26-test targeted rerun (50.9s). The complete command test file also passed in original order (8.7s). Canonical dispatcher shell tests and 120 author/label/event cases using the GitHub expression evaluator passed. Fresh P0-P2 review is clean.

Proof uses the actual signed webhook handler, compiled admission workflow, apply publication entry point, queue alarm recovery, and dispatcher shell with controlled GitHub adapters; no live GitHub writes or model reviews. New reminder shell case: 0.51s; recovery case: 0.042s; expanded admission file: 26.8s. OpenClaw Bay is unaffected: activity ingestion and observer schemas remain unchanged.
@vincentkoc vincentkoc self-assigned this Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review October 13, 2026 03:32
@vincentkoc
vincentkoc requested a review from a team as a code owner October 13, 2026 03:32
@vincentkoc

Copy link
Copy Markdown
Member Author

CI passed on cacf8aee298eba26ff634504ad9b53d6a35e9e15: run and job evidence.

Measured GitHub job wall times: test shards 1–4 took 344, 222, 125, and 137 seconds; static gates 15 seconds; coverage 23 seconds; sparse-build smoke 13 seconds; Windows launcher 79 seconds. These are whole-job timings, not the incremental cost of the new cases. The main PR body records the focused local case timings and behavior-proof limits.

@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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes maintainer reviews opt-in across intake, planning, recovery, and publication, with a deduplicated reminder.

Example: A MEMBER opens PR 321 without an automation opt-in label.

  • Before: Automatic intake can review the PR while work is still in progress.
  • After: Automatic review is skipped, and a reminder explains how to request one after validation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful maintainer-approved policy change with no actionable findings and sufficient controlled production-entry-point proof.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): On the reviewed head, the recorded AWS Crabbox probe executes the production apply-decisions CLI with persisted reports and controlled GitHub transport responses: valid requests and live opt-ins publish durable reviews, while changed source, removed opt-ins, and stale request reuse produce zero writes; this resolves the earlier publication-authority concern without claiming live GitHub mutations.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Maintainers receive automatic reviews while their work and validation are still in progress.
Reason: The maintainer author supplies the direction decision, and the patch consistently covers automatic admission, delayed recovery, and publication.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: current main lacks the policy, the updated publication proof resolves the earlier concern, and no actionable defect was found.

Priority: P2
Reviewed head: cacf8aee298eba26ff634504ad9b53d6a35e9e15

Before merge

None.

Findings

None.

Agent review details

How this fits together

GitHub events and explicit commands enter the dispatcher and Worker, pass through queue admission and recovery, and produce review comments and labels through the apply workflow.

flowchart TD
  A[GitHub events and commands] --> B[Dispatcher and Worker]
  B --> C[Maintainer opt-in policy]
  C --> D[Queue admission and recovery]
  D --> E[Review execution]
  E --> F[Publication freshness checks]
  F --> G[GitHub comments and labels]
Loading

Technical review

Best possible solution:

Use the shared opt-in policy while preserving verified one-shot requests, existing automation opt-ins, and publication freshness checks.

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

Current-main planning permits maintainer items, and its intake and publication owners lack the new opt-in checks, establishing the reported behavior from source.

Is this the best way to solve the issue?

Applying the shared policy through the existing owners closes stale-work paths that dispatcher-only filtering would leave while retaining contributor reviews and explicit requests.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced policy and current-main behavior: The pinned diff adds opt-in checks to existing owners; base shouldPlanItem permits maintainer-authored and maintainer-only items, and base admission and publication lack these checks. (src/clawsweeper-item-policy.ts:145, cacf8aee298e)
  • One-shot request authority: Explicit review eligibility requires a verified re_review receipt or restricted manual request; source_drift_requeue does not inherit an earlier request's authorization. (src/maintainer-review-policy.ts:36, cacf8aee298e)
  • Final publication proof: The current PR body records the real apply-decisions CLI publishing durable reviews for a verified request and live automation opt-in, while changed source, removed opt-in, and stale request reuse produce zero comment, label, or close writes. (src/clawsweeper-apply-decision-workflow.ts:1033, cacf8aee298e)
  • Existing reservation compatibility: No persisted schema or serialization format changes; the recovery regression supplies an existing reservation and verifies its removal before acknowledgement lookup or enqueue when live maintainer eligibility fails. (test/dashboard-worker-queue-runtime.test.ts:1089, cacf8aee298e)
  • Current-head validation: The referenced CI run succeeded on the reviewed head. The separate cancelled dispatcher job reports successful dispatch and cleanup steps, with no failing step attributable to this diff. (cacf8aee298e)
  • Repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory was present. The fragment records the user-visible change, and the PR explains why unchanged Bay schemas and activity ingestion need no Bay update. (AGENTS.md:35, cacf8aee298e)

Likely related people:

  • Peter Steinberger: Raw commit c0680bf adds src/clawsweeper-item-policy.ts:66 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c0680bf79ab7; files: src/clawsweeper-item-policy.ts)
  • Ayaan Zaidi: Raw commit 9df9545 adds src/clawsweeper-item-policy.ts:17 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9df9545acd12; files: src/clawsweeper-item-policy.ts)

Review metrics

Metric Value Why it matters
Change distribution Production/workflow +245/-31; tests and proof scripts +430/-40 The larger validation share covers the policy across existing intake, admission, recovery, and publication boundaries.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This bounded automation-policy improvement reduces unsolicited maintainer reviews without evidence of an urgent outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • 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-13T03:37:51.235Z sha cacf8ae :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T03:49:50.556Z sha cacf8ae :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 11:54 PM ET / October 13, 2026, 03:54 UTC (Revision 3).

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

The requested final publication authority proof is complete in the main PR body on the unchanged head. Valid requests and live automation opt-ins publish a durable review; changed source, removed opt-in, and source-drift reuse of an old request produce zero comment, label, or close writes. All CI checks passed. Please review the current body and its proof disposition.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 13, 2026
@vincentkoc
vincentkoc merged commit f8e303f into main Oct 13, 2026
47 of 48 checks passed
@vincentkoc
vincentkoc deleted the fix/maintainer-review-opt-in branch October 13, 2026 03:56
obviyus added a commit that referenced this pull request Oct 29, 2026
)

## Problem

When a PR is pushed after its first review, ClawSweeper replaces the verdict with a stale notice whose next step reads "Run or wait for a fresh ClawSweeper review on the current PR head." Since #1948, pushes after the first review are not reviewed automatically, so waiting never produces a review. On 2026-10-29, 94 of 341 open non-draft `openclaw/openclaw` PRs showed this notice, and some looked stalled to their authors.

## Fix

The stale notice now says: "Comment `@clawsweeper re-review` when the current head is ready; pushes after the first review are not reviewed automatically." Contributors may request reviews of their own items, so the command is available to the readers of this notice.

## User impact

Authors of stale PRs know what to do to get a fresh review. Review admission does not change.

## Proof

- `node --test test/review-history.test.ts test/apply-label-sync.test.ts`
- `pnpm run check:changelog`

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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