Repository navigation
fix(publish): stale exact-review artifacts complete terminally instead of requeueing forever - #634
Conversation
…d of requeueing forever
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f364f3eff
ℹ️ 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".
| return { | ||
| detail: "current state is already closed", | ||
| requeueLatest: false, | ||
| terminalClosed: true, |
There was a problem hiding this comment.
Avoid emitting terminal_closed for stale closed-state preflight
When the publisher reaches this branch, the workflow has already queried GitHub and skipped the script entirely if the live item was closed (.github/workflows/sweep.yml:1600-1634). For a remote-closed preflight with a still-open live item (for example a reopened issue whose state record is still under closed/), this now writes terminal_closed=true, which triggers Release terminal review leases; that step asserts the live item is closed before deleting leases (.github/workflows/sweep.yml:1710-1718), so the job fails and the exact-review queue can still requeue the stale artifact instead of completing terminally.
Useful? React with 👍 / 👎.
…d of requeueing forever (openclaw#634)
Why
Monitoring found a poison cohort:
openclaw/agent-skills#100@publish:29455236464:1retried publication for 21+ hours. Root cause: when the publisher's preflight detects a stale artifact ("current state has a newer tuple" / "already closed" / "no record tuple"), it throws — the workflow fails, the queue requeues the SAME artifact, and the failure is deterministic, so it loops until the 80-day artifact ceiling. The oldest-pending publication cohort (~20h) is this bug.What
The preflight-stale branch now writes the workflow's existing disposition outputs and exits successfully instead of throwing:
remote-newer->requeue_latest=true: the existing "Queue fresh review after source drift" step enqueues a review of the LATEST revision (superseding), classifier reports success, queue completes this item.remote-closed->terminal_closed=true,missing->terminal_missing=true: terminal completions the classifier already accepts.The outcome vocabulary and all consuming steps already existed — the preflight path just never emitted it. Disposition mapping lives in a new pure module (
src/repair/stale-event-disposition.ts) so it is unit-testable (the publisher script executes at module load).Proof
pnpm run build:all,format:check,lintgreen; autoreview (Codex Sol, xhigh) clean on first pass.