Skip to content

fix(review): answer a maintainer request whose retry is skipped at admission - #2001

Merged
steipete merged 1 commit into
mainfrom
fix/answer-skipped-maintainer-request
Oct 14, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/answer-skipped-maintainer-request

Conversation

@steipete

@steipete steipete commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #1981, #1984, and #1989.

What Problem This Solves

Fixes: a maintainer's explicit @clawsweeper re-review status stays at "Review in progress" forever when a retry of that request is skipped at claim admission.

On a maintainer-authored item, a review generation that still carries the command's status but no longer carries request authority is skipped by the maintainer opt-in gate. For example, #1981/#1984's fail-closed source_drift_requeue has its verification stripped, because it could not prove it continues the request. This is the same failure seen on #1969 (rev 3, https://github.com/openclaw/clawsweeper/actions/runs/38431867802).

The skip path never creates the review job's target write token. "Mark unsuccessful re-review", the step that answers a command whose review did not complete, therefore never runs.

Nothing else answers the status either. A probe on the real queue shows that a review generation completed with lifecycle_terminal_disposition: policy_noop records acknowledgement: pending and creates no terminal-finalization driver; those drivers exist only for publication completions. It also came up on #1989 (Codex connector P2, #1989 (comment)).

User Impact

When ClawSweeper skips such a retry, the maintainer's status comment now says Waiting, with the reason and a prompt to request a fresh review, instead of claiming forever that a review is running.

Nothing changes for automatic items, non-maintainer items, or reviews that run.

Why This Change Was Made

  • "Create target write token" also runs for exactly this case: scheduled_semantic_noop == 'true', review_hold == 'maintainer_request_required', and has_command_context == 'true'. I audited every step that consumes the token. Each is gated on the review proceeding (live-item.outputs.proceed), on the review having run, or on items without command context (has_command_context != 'true'). So the only newly enabled step is "Mark unsuccessful re-review".
  • "Mark unsuccessful re-review" reads the admission's hold (ADMISSION_REVIEW_HOLD; the completion step's REVIEW_HOLD stays the only one) and, for this hold, answers Waiting. Waiting is deliberately non-terminal. --refuse-terminal-state would otherwise make a later legitimate continuation of the same request, such as fix(queue): answer requests whose deferred requeue meets a queued review #1989's handoff, refuse to review. Other answers are unchanged.
  • The update keeps both existing fences: the lease heartbeat and --require-queue-authority-fence.

ClawSweeper's own review comments already contain "comment @clawsweeper re-review" without triggering commands, so the hint in the status text is inert.

Documentation Impact

  • docs/scheduler.md (active; owns the maintainer request contract): a skipped request-carrying retry answers "Waiting" with a re-review request.
  • Changelog fragment: changelog.d/answer-skipped-maintainer-request.md.

Evidence

  • test/sweep-workflow.test.ts "a maintainer admission skip that carries a command answers its status":
    • It evaluates the real token-gate expression over six cases: proceeding review, skipped request, no command, other no-op, other hold, admission retry.
    • It executes the real step shell with stubs: maintainer hold gives --state Waiting with both fences; no hold still gives Failed.
  • The existing pin "exactly one completion step forwards REVIEW_HOLD" still holds.
  • pnpm run check:fast passes, and the 8 affected test files (sweep workflow, structural invariants, terminal-finalization cancellation, review recovery/placeholder, command ledger, admission e2e, review hold) pass 174/174.
  • Codex review (P2 threshold) is scoped-clean on the uncommitted change and on the committed branch.

Real Behavior Proof

  • Claim: on a maintainer admission skip that carries a command, the review job rewrites that command's stuck "Review in progress" status comment to "Waiting" with a re-review request, behind the queue's lease and authority fences. Other failures keep their answer.
  • Exercised surface:
    • the real Mark unsuccessful re-review step script from sweep.yml, executed by bash from the repository root;
    • the real scripts/control-plane-curl.sh and dist/repair/exact-review-queue-request.js heartbeat;
    • the real pnpm run repair:update-command-status CLI (dist/repair/update-command-status.js).
  • Fixture:
  • Environment: macOS, Node 24.21.0, pnpm 12.4.1, no network.
ADMISSION_REVIEW_HOLD Exit Status comment after the step
maintainer_request_required 0 State: Waiting, "ClawSweeper did not review this retry: maintainer reviews need an explicit request, and this retry could not show that it continues one. Comment @clawsweeper re-review to request a fresh review."
(none) 0 State: Failed, unchanged text
  • Trace: 6 queue requests, all /internal/exact-review/heartbeat: the step's lease fence and the CLI's authority fence, for both cases. Exactly one status PATCH per case.

Allowed and nearest-forbidden owners on the newly enabled path. This run is on the current head 5eb24930 with ADMISSION_REVIEW_HOLD=maintainer_request_required. The local queue answers each heartbeat in sequence from a per-scenario plan, and the recording gh counts comment reads and writes. In the allowed case three heartbeats fire: the step's lease fence, then the status CLI's authority fence before it looks up the comment, then again before it writes.

Scenario Queue heartbeat answers Exit gh GET / PATCH Status comment
allowed: queue owner current 200, 200, 200 0 2 / 1 Waiting
step lease fence superseded 409 lease_superseded 0 0 / 0 unchanged ("Skipping unsuccessful command status because the exact-review queue claim was superseded.")
owner lost before comment lookup 200, 409 0 0 / 0 unchanged
owner lost during comment lookup 200, 200, 409 0 2 / 0 unchanged: the comment was read, the write refused
queue error 500 ×6 (control-plane retries) 1 0 / 0 unchanged ("Unable to fence unsuccessful command status…")

So the newly enabled path writes only while the queue confirms the claim at every fence, and an expired or reassigned owner causes zero comment writes.

  • Before: on main the token gate is false for this case, so the step never runs and the status stays "Review in progress". The test evaluates the gate for that case.
  • Limits:
    • This is controlled proof, not a live GitHub run. Producing a fail-closed maintainer retry live requires a deferred publication that loses its lease mid-flight.
    • The queue's lifecycle acknowledgement for that generation stays pending, because the workflow answers the status, not a finalization driver. That matches how the review job already answers its own failures.

Review Findings

  • ClawSweeper [medium] on 5eb24930, "Verify the newly enabled write path rejects stale ownership": addressed with proof, no code change. The allowed and nearest-forbidden table above covers a superseded step fence, an owner lost before and during comment lookup, and a queue error. Each forbidden case makes zero PATCHes, and the during-lookup case reads the comment but does not write it.

OpenClaw Bay

Not affected. There is no queue, lifecycle, telemetry, status, or projection schema change: a workflow step gate and one status text. Bay stays observer-only.

…mission

On a maintainer-authored item, a review generation that still carries an
explicit command but lacks request authority (for example a fail-closed
source-drift requeue whose verification the queue stripped) is skipped at
claim admission. The skip path never created the job's write token, so
"Mark unsuccessful re-review" never ran and the command status stayed
"Review in progress" forever, as on #1969.

Create the write token for exactly that case (semantic no-op, maintainer
hold, command context); every other token consumer is gated on the review
proceeding or on non-command items. "Mark unsuccessful re-review" then
answers "Waiting" with a request to re-review. Waiting is deliberately not
terminal, so a later continuation of the same request still runs.
@steipete
steipete requested a review from a team as a code owner October 14, 2026 17:13
@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T17:15:14.970192Z 5eb2493 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Follow-up to #1981/#1984/#1989 for head 5eb2493: answers a maintainer request's status when its retry is skipped at admission. The PR body carries the token-consumer audit, the end-to-end proof (real step script and status CLI behind the queue fences), and validation.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR changes a skipped maintainer-request retry from a stuck review status to Waiting with instructions to request a fresh review.

Example: A request on item 1969 retains command context but loses explicit-request verification before retry admission.

  • Before: Admission skips the retry without creating a write token, leaving Review in progress indefinitely.
  • After: The existing fenced status writer changes the comment to Waiting and offers @clawsweeper re-review.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful fix with meaningful workflow coverage and sufficient controlled final-effect evidence; no actionable defect remains.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): At head 5eb2493, the supplied macOS Node 24 trace runs the real workflow shell, heartbeat client, and status CLI against a controlled HTTP queue and recording GitHub boundary: the allowed owner writes Waiting, while supersession before or during lookup and queue failure produce zero PATCHes. The prior review's requested final-effect controls are addressed; this remains controlled evidence rather than a live GitHub canary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A maintainer's requested review can display Review in progress forever after its retry is declined.
Reason: The maintainer-authored direction repairs the documented request-answer contract with a focused change and no new option or review permission.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a concrete unanswered-request path still present on main. The added ownership-loss traces resolve the prior review concern, and no introduced defect was found.

Priority: P2
Reviewed head: 5eb2493007d2865ac3a420abd3a0912172e88ced

Before merge

None.

Findings

None.

Agent review details

How this fits together

The exact-review workflow consumes claimed queue decisions, checks live admission policy, and updates command status through the existing queue-fenced GitHub writer.

flowchart TD
A[Claimed review decision] --> B[Live admission]
B --> C[Maintainer request hold]
C --> D[Scoped token exception]
D --> E[Queue ownership fences]
E --> F[Existing status CLI]
F --> G[Waiting command status]
Loading

Technical review

Best possible solution:

Retain the narrow admission exception and reuse the existing fenced writer to answer skipped requests without granting review authority.

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

Main's admission and token gates establish the skipped-command path directly; the supplied controlled trace demonstrates the corrected status, and no target code was executed during this review.

Is this the best way to solve the issue?

The workflow owns the missing token admission, and reusing its existing unsuccessful-command writer fixes that boundary without weakening maintainer review authorization or adding another status owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Semantic no-op token suppression changes intended behavior with a stated reason (2cc2c0d: Avoid unnecessary target access and timestamp-only writes for proven scheduled self-feedback no-ops.)
  • Unsuccessful command status and ownership fences keeps the original intent (f06c3bf: Use one command status comment with queue fencing before lookup and immediately before mutation; Waiting remains retryable.)
  • Existing failure-specific answers keeps the original intent (99fa190: Distinguish non-retryable incomplete-source failures while retaining ordinary retry handling.)
  • Fail-closed request continuation keeps the original intent (bb328b0: Retain command addressing without lending finished or replaced requests authority to review again.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f06c3bf adds .github/workflows/sweep.yml:2104 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f06c3bf687a4; files: .github/workflows/sweep.yml)
  • Vincent Koc: Raw commit 453d571 adds test/sweep-workflow.test.ts:40 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 453d57128f47; files: test/sweep-workflow.test.ts)

Review metrics

Metric Value Why it matters
Change distribution Workflow +10/-2 lines; tests +81 lines; documentation and changelog +5/-1 lines The small production change is supported by executable gate and shell-branch coverage.

Labels

Label changes:

  • add P2: A bounded retry-admission failure leaves an explicit maintainer request displaying an indefinitely running review.
  • 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 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A bounded retry-admission failure leaves an explicit maintainer request displaying an indefinitely running review.
  • 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.
  • 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 (1 earlier review cycle)
  • reviewed 2026-10-14T17:21:21.690Z sha 5eb2493 :: needs real behavior proof before merge. :: none

Reviewed October 14, 2026, 1:31 PM ET / 17:31 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added the requested allowed and nearest-forbidden final-effect traces for head 5eb2493 in the PR body: superseded step fence, owner lost before and during comment lookup, and queue error all make zero status PATCHes; only a current owner writes Waiting.

@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. 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. labels Oct 14, 2026
@steipete
steipete merged commit cc0bc82 into main Oct 14, 2026
32 checks passed
@steipete
steipete deleted the fix/answer-skipped-maintainer-request branch October 14, 2026 17:35
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