Skip to content

fix(review): keep explicit maintainer re-reviews through source-drift requeues - #1981

Merged
steipete merged 6 commits into
mainfrom
fix/maintainer-re-review-source-drift
Oct 14, 2026
Merged

steipete merged 6 commits into
mainfrom
fix/maintainer-re-review-source-drift

Conversation

@steipete

@steipete steipete commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1969

What Problem This Solves

Fixes: an explicit @clawsweeper re-review on a maintainer-authored PR is silently lost when the PR changes while that review runs. No review is published, and the command status stays at "Review in progress".

Observed on #1969 (2026-10-13):

Reproduced live on this PR (2026-10-14), against main's code:

For comparison, #1955 had no drift. Its explicit re-review published directly (https://github.com/openclaw/clawsweeper/actions/runs/38366796630), and terminal finalization followed (https://github.com/openclaw/clawsweeper/actions/runs/38367190329).

What caused the drift on #1969: chatgpt-codex-connector[bot] posted a PR review at 16:34:51, inside rev 2's review window. That added review 5506843863, inline comment 4261341013, and their thread, which are exactly the three entries in the v2:3 cursor.

The review-activity cursor counts only PR reviews, inline review comments, and review threads. ClawSweeper writes none of those: its ack, command status, and review are issue comments. So the requeue was correct, and there is no second bug from ClawSweeper's own ack, status, or label writes. The bug is that the requeue lost the request's authority.

User Impact

Maintainers who ask for a review get one even when someone or something changes the PR while ClawSweeper is still reviewing it. The command status then resolves through normal terminal finalization instead of staying "Review in progress".

The opt-in boundary otherwise stays as it was. Automatic events and scheduled passes still need a new request. So do pushes after the request is answered, and any request that already finished or was replaced by a newer one.

Why This Change Was Made

The queue's direct-lifecycle requeue (requeueDirectLifecyclePublicationSync) copies the claimed decision into an in-place source_drift_requeue successor. It is fenced:

  • by the exact lease tuple;
  • by a saved requeue receipt;
  • by item.revision <= leaseRevision, so a newer command on the key wins.

The queue already treats a successor with command context as continuing the command's lifecycle, and exactReviewSourceDriftLoopCounted exempts it from the loop breaker for that reason. isExplicitReviewRequest disagreed: it accepted only re_review, so maintainer items fell into the gap.

There are two parts to the change:

  1. Policy. isExplicitReviewRequest also accepts source_drift_requeue when it still carries the command status (commandStatusMarker or statusCommentId) and the same verified command fields. Claim admission and the hosted apply publication gate both inherit this.
  2. Lifetime boundary in the queue. A source_drift_requeue keeps sourceCommentVerified only when the queue requeued it in place. The in-place requeue's admissionDeliveryId carries the direct-lifecycle-requeue: prefix. Any other copy, for example a publisher re-enqueue that found no queued item for the key, loses verification.
    • The rule runs in the queue's load-time normalizer (normalizeExactReviewQueueItem, used by every state and item read) and when /enqueue creates an item. It therefore also covers rows persisted by the previous release.
    • The command status stays, so status handling is unchanged.
    • The prefix is queue-owned: /enqueue rejects any caller delivery id that uses it (reserved_delivery_id, alongside the existing legacy-generation prefix). An authenticated producer therefore cannot claim in-place provenance.
    • When an item is queued, the low-priority requeue already never replaces it, so a newer request is untouched.

Documentation Impact

Canonical docs reviewed and updated:

  • AGENTS.md (canonical policy) now states the contract explicitly. A request stays open while the queue requeues its own review in place after source drift. A finished or replaced request, changes after the answer, and scheduled passes need a new request. This resolves the Codex connector P1 linked below.
  • docs/scheduler.md (active; owns the maintainer opt-in paragraph) describes the in-place continuation and the queue's verification drop. It also names the current limitation for deferred publications.
  • README.md: the maintainer opt-in paragraph says that a request stays open until it is answered.

Changelog fragment: changelog.d/maintainer-re-review-source-drift.md.

Evidence

  • Policy unit test (test/maintainer-review-policy.test.ts, uses fix(review): retry Codex model-capacity failures as provider throttling #1969's real verified fields): a continuation with a status marker or status comment id is explicit. Without the status, with failed verification, a non-command origin, a bad digest, or for organic or scheduled actions, it is not.
  • Admission e2e (scripts/e2e/exact-review-noop-read-scope.mjs, maintainer-request-continuation, for issues and PRs): runs the real live-item workflow shell against the compiled build. Both cases fail on main (proceed) and pass here. The existing maintainer-stale-request boundary still skips.
  • Queue lifetime (test/exact-review-source-drift-loop.test.ts, real queue Durable Object through /enqueue, alarm, /claim, /complete):
    • A finished request's later source_drift_requeue keeps its status marker but loses verification, and the decision handed out at claim is not explicit. With the queue change removed, this test fails (actual: true).
    • A replaced request's requeue leaves the newer re_review command untouched.
  • Forged provenance (same file): a finished request's verified requeue replayed under direct-lifecycle-requeue:… is rejected with 400 reserved_delivery_id, and no item is created. Without the guard, this test fails.
  • Upgrade (same file): a stored row restored to the previous release's shape, with verification intact, claims as explicit only when its admissionDeliveryId is the in-place requeue's. Without the load-time rule, the orphaned row claims as explicit (actual: true).
  • In-place requeue (test/dashboard-worker-publication-lifecycle.test.ts): a re_review producer completed with a saved requeue receipt becomes a source_drift_requeue successor that is still explicit.
  • Final effects (test/oversized-pr-close.test.ts, real built review report plus the real apply owner with --exact-event-publication, on an OWNER-authored oversized PR):
    • The in-place continuation produces the durable comment write and the close. On main this scenario fails.
    • The finished-request requeue stops at skipped_maintainer_authored with zero writes.
  • Apply gate (test/apply-live-state.test.ts, table-driven): the automatic event and the requeue without status are dropped with zero writes. The continuation passes the gate.
  • Full runs: pnpm run check:fast passes (static, docs, changelog, format, three builds, lint). The 22 affected test files, including the full queue runtime, policy, and storage suites, pass 732/732.
  • Codex review (P2 threshold): scoped-clean on the final committed branch against merge base 850b3d4157.

Real Behavior Proof

  • Claim:
    • The real rev 3 decision from fix(review): retry Codex model-capacity failures as provider throttling #1969 is admitted like the rev 2 explicit request.
    • A continuation the queue requeued in place publishes through the real apply owner.
    • A request that finished or was replaced cannot authorize another review: the queue drops its verification, and both admission and apply then refuse it with zero writes.
  • Exercised surfaces:
    1. the exact Check live target item state step command, pnpm run --silent workflow -- exact-review-admission, from the compiled dist/;
    2. the real queue Durable Object routes /enqueue, /claim, /complete, and the direct-lifecycle complete requeue;
    3. dist/clawsweeper.js review and apply-decisions --exact-event-publication --event-apply-proof, with a recording gh.
  • Fixtures:
    • The rev 2 and rev 3 CLAIM_DECISION values are taken verbatim from runs 38431373647 and 38431867802.
    • fix(review): retry Codex model-capacity failures as provider throttling #1969's issue and pull JSON come from the live API, rewound to the rev 3 moment (open, head 14c8cd4800355331850766af3726eb7f9662b1e4).
    • The real collaborator permission (admin) is used, because the issues API reports CONTRIBUTOR.
    • The final-effect run uses the synthetic OWNER-authored oversized PR fixture.
  • Environment: macOS, Node 24.21.0, pnpm 12.4.1. Before: clean origin/main 850b3d4157.

Admission replay of #1969:

Decision Before (main) After
rev 2 re_review proceed=true, live_head_sha=14c8cd48… proceed=true, live_head_sha=14c8cd48…
rev 3 source_drift_requeue with command status proceed=false, scheduled_semantic_noop=true; notice identical to production proceed=true, live_head_sha=14c8cd48…
rev 3 without command status skipped (same notice) skipped (same notice)

Final effects on the real apply owner (recorded gh writes):

Decision Apply actions Writes
In-place continuation (source_drift_requeue, verified, status marker) review_comment_synced, then closed POST issues/141913/comments (durable review), pr close 141913, PATCH issues/comments/150913 (close notice)
Finished or replaced request (source_drift_requeue, status marker, verification dropped by the queue) skipped_maintainer_authored none

Limits:

  • This is controlled proof, not a live GitHub run. The fix(review): retry Codex model-capacity failures as provider throttling #1969 item state was rewound, and the final-effect fixture is synthetic.
  • Deferred publications. The batch publisher's requeue of a deferred publication (repo#N@publish:… key) arrives at /enqueue with no queued review item, so it now loses verification. A maintainer request on that rarer path still needs a new request, the same as on main today. Restoring it safely needs a command-currency check in the queue, which is a follow-up.
  • No loop limit for command continuations. In-place continuations remain exempt from the source-drift loop breaker, as for non-maintainer items today. The runaway-review health alert still applies.
  • The review workflow runs from main, so this PR's own re-review does not exercise the fix.

Review Findings

  • Codex connector P1 on c4e6ceb8 (fix(review): keep explicit maintainer re-reviews through source-drift requeues #1981 (comment)), "Keep source-drift retries behind a fresh opt-in": resolved by stating the owner-requested policy in AGENTS.md (commit f534cc05).

  • ClawSweeper [medium] on f534cc05, "Establish the lifetime of inherited request authority": fixed.

    • The concern was real. The publisher producers can re-enqueue a finished or replaced request's decision, and with only the policy change that requeue would have been explicit; the new queue test fails with actual: true without the queue change.
    • The queue now drops verification on any source_drift_requeue that finds no queued item. Only the fenced in-place requeue keeps the request's authority.
    • Final-effect proof for the allowed and the forbidden continuation is above.
  • ClawSweeper [P2] on a92b6dcb, "Invalidate persisted orphan authority before accepting continuations", and [medium] "Upgrade reinterprets stale verification as current authority": fixed.

    • The rule moved into the queue's load-time normalizer, so a verified orphan persisted by main before the deploy loses verification before claim and publication.
    • The upgrade test covers both the orphaned row and the in-place row persisted by the previous release.
    • The cross-version data-model proof is above.
  • Codex connector P1 (fix(review): keep explicit maintainer re-reviews through source-drift requeues #1981 (comment)), "Recognize command-preserving source supersessions": declined, with evidence.

    • For a maintainer-gated item, a push never produces a synchronize successor carrying the command. Its organic webhook events are dropped at ingress (dashboard/worker.ts, requiresMaintainerReviewRequest returns accepted: false). The comment webhook and target dispatcher gate the same way, and scheduled planning skips these items.
    • A push during the explicit review therefore shows up as head drift in apply, which requeues in place as source_drift_requeue, the path this PR fixes.
  • Codex connector P1 (fix(review): keep explicit maintainer re-reviews through source-drift requeues #1981 (comment)), "Stop continuation after publishing the requested review": declined; the docs now state the case explicitly.

    • When a close check drifts after the durable review comment synced, the queue records the generation's terminal disposition as requeue. That cancels the command's finalization drivers, and the status still reads "Review in progress".
    • The queue therefore treats the request as unanswered. The in-place continuation refreshes the same durable comment and lets terminal finalization close the status; stopping it would leave the request stuck again.
    • For maintainer items this only arises on the oversized-PR close path. docs/scheduler.md now names this case.
  • ClawSweeper [P2] on 6af7d5ce, "Reject caller delivery IDs using the queue-owned requeue prefix", and [medium] "Authenticated ingestion can impersonate queue-owned continuation provenance": fixed.

    • /enqueue now returns 400 reserved_delivery_id for a direct-lifecycle-requeue: delivery id. Every admission path goes through this ingress check, including command intake and source-authority forwards, and it is the only caller-controlled writer of admissionDeliveryId.
    • It is covered by the forged-provenance test.
    • The stacked fix(queue): keep explicit requests answerable across deferred publication #1984 generalizes the same guard to its additional prefix and will rebase onto this.

Data-Model Compatibility

There is no schema change: the item table, decision fields, and admissionDeliveryId format are unchanged. A throwaway cross-version run used one file-backed SQLite store:

  1. main (850b3d4157) persists the orphan. Its real ExactReviewQueue admitted a late publisher requeue of a finished request (delivery_id: publisher-source-drift:38508988476:1) with 202 queued. It persisted sourceAction: source_drift_requeue, sourceCommentVerified: true, a status marker, and admissionDeliveryId: publisher-source-drift:38508988476:1.
  2. This branch loads the store. Its ExactReviewQueue opened the same file, and /stats reports 1 pending, so the existing data loads.
  3. This branch claims main's bytes. It claimed main's exact persisted row through the real alarm dispatch and /claim. The result is 200, sourceAction: source_drift_requeue with the status marker kept, sourceCommentVerified absent, and isExplicitReviewRequest: false.

In-place successors persisted by main keep their direct-lifecycle-requeue: prefix and therefore their authority (covered by the upgrade test above). Rollback is safe: older code ignores the missing optional field, and its policy rejects every source_drift_requeue anyway.

OpenClaw Bay

Not affected. There are no queue, lifecycle, telemetry, status, or projection schema changes. The queue only stops copying one existing decision field (sourceCommentVerified) onto an orphaned source_drift_requeue, and Bay stays observer-only.

… requeues

An explicit `@clawsweeper re-review` on a maintainer-authored PR could be
lost: when the item changed while the review ran (on #1969 another bot
posted a PR review), apply skipped publication for source drift and the
queue requeued the generation as `source_drift_requeue`. The requeue keeps
the verified command fields and command status, but isExplicitReviewRequest
accepted only `re_review`, so claim admission skipped the continuation as an
automatic maintainer review. No review published and the command status
stayed "Review in progress".

A source-drift requeue only happens for an unpublished review, and the
queue's loop breaker already treats one that carries command status as the
command's lifecycle. Accept that continuation as the same explicit request
when it still carries the status obligation and the verified command fields.
A requeue without that status, organic events, pushes after the review
publishes, and scheduled passes still need a new request.
@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-14T06:07:14.874816Z 131383c New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4e6ceb8e1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +54 to +56
const continuesRequest =
decision.sourceAction === "source_drift_requeue" &&
Boolean(decision.commandStatusMarker || decision.statusCommentId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep source-drift retries behind a fresh opt-in

When a maintainer-authored item changes before publication, this treats the inherited command-status address as authorization for a new source_drift_requeue, allowing admission and apply to review the changed revision without another explicit request. That conflicts with the canonical policy that a one-off request must not enable automatic reviews of later changes; retain the maintainer gate for drifted revisions unless the canonical policy is explicitly changed.

AGENTS.md reference: AGENTS.md:L38-L42

Useful? React with 👍 / 👎.

The canonical policy said an explicit review request never enables review of later changes. A request now stays open until its review publishes, so a source-drift retry that still carries the request's command status continues it; changes after publication still need a new request.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current proof, review-finding disposition (the Codex connector P1 is resolved by stating the changed policy in AGENTS.md), and validation for head f534cc0 are in the PR body. Requested once for landing.

@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: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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

Preserve explicit review authorization through queue-owned source-drift retries while removing it from orphaned retries.

Example: Another bot posts review activity while an explicit maintainer review is running.

  • Before: The source_drift_requeue successor is skipped as automatic, leaving the request at Review in progress.
  • After: The fenced in-place successor continues the request and can publish its review.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful repair with controlled production-entry-point evidence, explicit upgrade coverage, and no remaining actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The complete body records the compiled admission entry point and real apply owner accepting the in-place continuation, refusing a finished request with zero writes, and queue rejection of forged provenance; controlled queue scenarios cover replacement and persisted orphan authority.
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 requests a review but receives no answer when review activity changes during execution.
Reason: The maintainer-authored change repairs the observed in-place retry failure and explicitly preserves the existing deferred-publication limitation.

Merge readiness

✅ Ready for maintainer review

This PR fixes an observed failure in requested maintainer reviews. The previous reserved-prefix finding is resolved, and no new actionable defects were found.

Priority: P2
Reviewed head: 131383c7d2ae01c1aa0c844bf710dbcaf0875cb2

Before merge

None.

Findings

None.

Agent review details

How this fits together

The exact-review queue receives verified commands and publication outcomes, persists review generations, and supplies decisions to admission and GitHub publication gates.

flowchart TD
  A[Verified review command] --> B[Exact review queue]
  B --> C[Review admission]
  C --> D[Review and apply]
  D --> E[Source drift]
  E --> B
  D --> F[Durable review and command completion]
Loading

Technical review

Best possible solution:

Land the scoped in-place continuation fix and handle deferred publication in its existing follow-up.

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

Current main's predicate rejects the verified source-drift successor described in the linked production runs; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The shared policy change and queue-owned provenance check address the admission/publication disagreement without allowing orphaned retries to inherit authorization.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Maintainer review authorization changes intended behavior with a stated reason (f8e303f: Require explicit opt-in for maintainer work and prevent automatic retries from bypassing that policy.)
  • Direct lifecycle requeue ownership keeps the original intent (746186d: Create a fresh fenced source-drift generation while retaining durable lifecycle ownership.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit f8e303f adds src/maintainer-review-policy.ts:52 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)
  • Ayaan Zaidi: Raw commit 7cff2ef adds dashboard/exact-review-queue.ts:11185 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7cff2ef07007; files: dashboard/exact-review-queue.ts)
  • Peter Steinberger: Raw commit 90b8d34 adds test/exact-review-source-drift-loop.test.ts:11 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 90b8d34923f5; files: test/exact-review-source-drift-loop.test.ts)
  • Martin Cleary: Raw commit 746186d adds dashboard/exact-review-queue.ts:6752 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 746186da68f0; files: dashboard/exact-review-queue.ts)

Labels

Label changes:

No label changes.

Label justifications:

  • P2: An explicit maintainer review can be silently skipped after source drift, leaving its command status and coordination unresolved.
  • 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 (3 earlier review cycles)
  • reviewed 2026-10-14T03:16:42.495Z sha f534cc0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-14T05:06:55.164Z sha a92b6dc :: needs real behavior proof before merge. :: [P2] Invalidate persisted orphan authority before accepting continuations
  • reviewed 2026-10-14T05:55:07.445Z sha 6af7d5c :: blocked before merge. :: [P2] Reject caller delivery IDs using the queue-owned requeue prefix

Reviewed October 14, 2026, 2:23 AM ET / 06:23 UTC (Revision 4).

…requeue

ClawSweeper's review asked to establish that a finished or replaced request
cannot authorize another review. It can: the publisher producers re-enqueue a
copy of the claimed decision as source_drift_requeue, and when no item is
queued for the key that copy may belong to a request that already finished or
was replaced, yet it still carried the verified command fields.

/enqueue now drops sourceCommentVerified from a source_drift_requeue that
finds no queued item. The command status stays, so status handling is
unchanged. When an item is queued, the low-priority requeue already never
replaces it. Only the queue's fenced in-place lifecycle requeue keeps the
request's authority.

Tests drive the real queue (finished request loses verification; replaced
request leaves the newer command; in-place requeue stays explicit) and the
real apply owner on an owner-authored oversized PR (continuation closes with
its writes; finished-request requeue is skipped with zero writes). AGENTS.md,
the scheduler docs, README, and the changelog fragment state the contract and
the remaining deferred-publication limitation.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the [medium] authority-lifetime finding on head a92b6dc: the queue now drops request verification from any source-drift requeue that finds no queued item, so only the fenced in-place requeue continues a request. The PR body carries the final-effect proof on the real apply owner (allowed continuation writes; finished-request requeue skipped with zero writes), the queue lifetime tests, and the remaining deferred-publication limitation.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a92b6dcbf0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Boolean(decision.commandStatusMarker || decision.statusCommentId);
return (
decision.sourceAction === "re_review" &&
(decision.sourceAction === "re_review" || continuesRequest) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Recognize command-preserving source supersessions

When a maintainer pushes while the requested review is leased, dashboard/exact-review-queue.ts deliberately merges the active command into the authoritative successor, but the incoming event overwrites sourceAction with synchronize while the verified command fields and status marker remain intact. This condition rejects that successor because it recognizes only re_review and source_drift_requeue, so admission skips it as an automatic maintainer review and the still-unanswered request can remain stuck; treat these command-preserving in-place successors as continuations too, or normalize their action when merging.

AGENTS.md reference: AGENTS.md:L42-L45

Useful? React with 👍 / 👎.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The previous request (head a92b6dc) was lost to the bug this PR fixes: rev 7 drifted when another bot reviewed the head mid-run, and rev 8's source-drift requeue was skipped as automatic (both runs linked in the PR body). Requesting once more for the same unchanged head; proof and finding dispositions are current in the PR body.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The previous request was interrupted because the lost earlier request's status comment still held review coordination until 04:59:21Z (details in the PR body). That lease has expired; head a92b6dc is unchanged and the PR body is current.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Oct 14, 2026
…ds an item

ClawSweeper flagged that the /enqueue strip only covered new enqueues: a
verified source_drift_requeue that the previous release already persisted
for a finished or replaced request would survive the deploy and be claimed
as explicit.

The rule now lives in normalizeExactReviewQueueItem, which every queue read
uses, and /enqueue applies the same helper to new items. A source-drift
requeue keeps sourceCommentVerified only when its admissionDeliveryId carries
the in-place lifecycle requeue's prefix; the command status always stays.

The upgrade test restores a stored row to the previous release's shape and
claims it: an orphaned row is no longer explicit, an in-place row still is.
A cross-version run had main persist such an orphan in a file-backed store
and this branch load and claim those exact bytes as non-explicit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ce7e49d09

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +56 to +57
decision.sourceAction === "source_drift_requeue" &&
Boolean(decision.commandStatusMarker || decision.statusCommentId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop continuation after publishing the requested review

When a close proposal first syncs its durable review comment and then detects source drift in a later close guard, exactEventApplyProof accepts the combined durableReviewSynced plus skipped_changed_since_review actions as source_drift, so the direct lifecycle still creates this verified requeue. The maintainer has already received the requested review, but this predicate treats the still-addressable status comment as sufficient authority and automatically reviews the later revision; require evidence that no durable review was synced before preserving verification. This matters specifically for changes landing between comment publication and the final close checks.

AGENTS.md reference: AGENTS.md:L42-L45

Useful? React with 👍 / 👎.

A close check that drifts after the durable review comment synced also requeues the generation in place instead of finalizing the command, so the retry continues the same explicit request.
steipete added a commit that referenced this pull request Oct 14, 2026
…tion

Follow-ups to #1981, each of which left a command request unanswered:

- A deferred publisher's source-drift requeue keeps the request's
  verification while the publisher still holds the request's newest
  publication and no other command reached the item since. The admitted
  item carries a queue-owned `held-publication-requeue:` delivery prefix
  that the load-time verification rule honors; `/enqueue` rejects caller
  delivery ids with either continuation prefix. Any other orphan requeue
  still drops it.
- The batch publisher builds its requeue with the shared
  `enqueue source-drift` CLI, so both publishers send one delivery id per
  review generation (`publisher-source-drift:<producer run>:<attempt>`).
- Command-bearing recovery is no longer shed by backpressure or a GitHub
  throttle window.
- An artifact refresh leaves a queued command intact. A different, older
  producer command is answered as superseded instead of overwriting it.
- An organic successor of a pending terminal finalizer no longer inherits
  the finalized command.

The `--refuse-terminal-state` report is intended behavior (#1675) and is
unchanged.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the P2 and [medium] persisted-authority findings on head 6af7d5c: the orphan rule now runs in the queue's load-time normalizer, so rows persisted by the previous release lose request verification unless the queue requeued them in place. The PR body adds the upgrade test, a cross-version data-model proof (main persists the orphan, this branch claims main's exact bytes as non-explicit), and dispositions for the two new Codex connector comments.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot 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. labels Oct 14, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 14, 2026
…ovenance

ClawSweeper noted that /enqueue stored any caller delivery id as the item's
admissionDeliveryId, so an authenticated producer could replay a finished
request's verified source_drift_requeue under the direct-lifecycle-requeue
prefix and keep its verification.

The prefix is queue-owned: /enqueue now rejects it as reserved_delivery_id,
next to the existing legacy-generation prefix. Every admission path that
writes a caller id into admissionDeliveryId runs through this check.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the P2 and [medium] reserved-prefix findings on head 131383c: /enqueue now rejects caller delivery ids that use the queue-owned direct-lifecycle-requeue: prefix as reserved_delivery_id, with a forged-replay test. Proof, finding dispositions, and validation (check:fast; 732/732 across the affected files; Codex review scoped-clean on the committed branch) are current in the PR body.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

steipete added a commit that referenced this pull request Oct 14, 2026
…tion

Follow-ups to #1981, each of which left a command request unanswered:

- A deferred publisher's source-drift requeue keeps the request's
  verification while the publisher still holds the request's newest
  publication and no other command reached the item since. The admitted
  item carries a queue-owned `held-publication-requeue:` delivery prefix
  that the load-time verification rule honors; `/enqueue` rejects caller
  delivery ids with either continuation prefix. Any other orphan requeue
  still drops it.
- The batch publisher builds its requeue with the shared
  `enqueue source-drift` CLI, so both publishers send one delivery id per
  review generation (`publisher-source-drift:<producer run>:<attempt>`).
- Command-bearing recovery is no longer shed by backpressure or a GitHub
  throttle window.
- An artifact refresh leaves a queued command intact. A different, older
  producer command is answered as superseded instead of overwriting it.
- An organic successor of a pending terminal finalizer no longer inherits
  the finalized command.

The `--refuse-terminal-state` report is intended behavior (#1675) and is
unchanged.
@clawsweeper clawsweeper Bot added 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 14, 2026
@steipete
steipete merged commit 9ac67f9 into main Oct 14, 2026
31 of 33 checks passed
@steipete
steipete deleted the fix/maintainer-re-review-source-drift branch October 14, 2026 06:27
steipete added a commit that referenced this pull request Oct 14, 2026
…tion

Follow-ups to #1981, each of which left a command request unanswered:

- A deferred publisher's source-drift requeue keeps the request's
  verification while the publisher still holds the request's newest
  publication and no other command reached the item since. The admitted
  item carries a queue-owned `held-publication-requeue:` delivery prefix
  that the load-time verification rule honors; `/enqueue` rejects caller
  delivery ids with either continuation prefix. Any other orphan requeue
  still drops it.
- The batch publisher builds its requeue with the shared
  `enqueue source-drift` CLI, so both publishers send one delivery id per
  review generation (`publisher-source-drift:<producer run>:<attempt>`).
- Command-bearing recovery is no longer shed by backpressure or a GitHub
  throttle window.
- An artifact refresh leaves a queued command intact. A different, older
  producer command is answered as superseded instead of overwriting it.
- An organic successor of a pending terminal finalizer no longer inherits
  the finalized command.

The `--refuse-terminal-state` report is intended behavior (#1675) and is
unchanged.
steipete added a commit that referenced this pull request Oct 14, 2026
…tion (#1984)

Follow-ups to #1981 that each left an explicit command request without an answer.

- Deferred publication: a deferred publisher's source-drift requeue keeps the request's verification only while that publisher still holds its own publication (bound by the requeue's publisher-source-drift:<producer run>:<attempt> delivery id and matched by producer metadata), that publication is the item's newest, and no other command reached the item since, under any repository casing. Admitted items carry a queue-owned held-publication-requeue: prefix that the load-time rule honors; /enqueue rejects caller delivery ids with either continuation prefix.
- Both publishers build the requeue with the shared `enqueue source-drift` CLI, so one review generation is requeued under one delivery id.
- Command-bearing recovery is no longer shed by backpressure or a GitHub throttle window.
- An artifact refresh leaves a queued command intact; a different, older producer command is answered as superseded instead of overwriting it.
- An organic successor of a pending terminal finalizer no longer inherits the finalized command.

Proof: real queue Durable Object and real apply owner (docs/proof/deferred-request-continuation): the held continuation publishes and closes; finished, lease-lost, replaced, casing-alias, newer-publication, and borrowed-producer controls make zero writes; rows persisted by origin/main load and take the new paths. ClawSweeper review on 635a9df: ready, proof sufficient, no findings.
steipete added a commit that referenced this pull request Oct 14, 2026
…iew (#1989)

An explicit @clawsweeper re-review could still stay at "Review in progress" when its review's publication was deferred and an ordinary review was already queued for the item: the publisher's source-drift requeue was ignored as low-priority recovery, nothing carried the request, and the publication still recorded lifecycle requeue.

- A verified source_drift_requeue that meets a pending, request-less, non-publication review hands the still-current request to that review (new command revision, admission held-publication-requeue:<delivery id>), keeping the review's newer source. Currency comes from #1984's producer-bound continuesHeldCommandPublicationSync (the requeue's delivery id must name the producer that still holds its own newest publication, and no other command reached the item).
- A deferred publication's lifecycle requeue stands only if a review at the item admitted the same request after the producer revision (sameCommandAdmittedAfter, sharing #1984's casing-aware scan); otherwise the queue records superseded so the request gets a terminal answer, in /complete and idempotently in the batch post-effect. Direct-lifecycle receipts are excluded.
- Rebased onto main after #1981/#1984: the handoff passes the requeue's delivery id (producer binding), with a test that a requeue naming another producer leaves the pending review untouched.

Proof: real queue Durable Object scenarios; the transferred decision through the real apply owner on an owner-authored oversized PR (a current request publishes and closes; finished, lease-lost, replaced under either casing, older-producer, and wrong-producer requeues make zero writes); the real finalizer status CLI leaves a status comment reused by a newer request untouched. Live: #1981's in-place continuation was exercised in production on this PR (drift injected mid-review; the requeued revision was admitted, published, and the command status reached Complete).
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