Skip to content

fix(exact-review): retain actionable dispatch 422 detail#843

Merged
brokemac79 merged 1 commit into
mainfrom
codex/csw-057-dispatch-422-classification
Jul 25, 2026
Merged

fix(exact-review): retain actionable dispatch 422 detail#843
brokemac79 merged 1 commit into
mainfrom
codex/csw-057-dispatch-422-classification

Conversation

@brokemac79

Copy link
Copy Markdown
Contributor

Summary

Preserve actionable, redacted GitHub validation detail for exact-review dispatch failures, and avoid silently parking a normal pull_request:synchronize update on an opaque HTTP 422.

Problem

On 2026-07-25 at 03:17:12Z, PR #842 received a user-authorized empty synchronize commit (21f465f05a7d382256de1b6c7a16abaf4d042cae -> 81e4abc894e7d3ec1fddbd856378b6aadb4392f3). At 03:17:15.782Z the exact-review queue parked revision 3 with:

state=parked
parked_reason=dispatch_rejected
status=422
class=permanent_rejection
fingerprint=dispatch-72215b4b

No exact-review worker run was created. The contemporaneous GitHub-activity run (30141979462) was intentionally skipped by its synchronize filter; an unrelated exact repository-dispatch review succeeded at 03:21:17Z, so this was not a general Actions outage.

#839 (cf01fe706b) classified every 400/404/422 as an item-scoped permanent rejection and retained only status/class/fingerprint. Its request helper consumed the GitHub response body but did not preserve a safe, actionable diagnosis.

Implementation

  • Move source_head_sha under the existing queue_claim object. This keeps the exact dispatch client payload at 10 top-level keys even when review_options is present, while the workflow continues to read legacy top-level payloads.
  • Parse only allowlisted 422 validation field/code tokens. Persist and expose those tokens, never the raw GitHub message, values, paths, headers, or request body.
  • Park only structured client_payload validation as a genuine item-specific permanent rejection.
  • Treat opaque or differently scoped 422s as validation_unknown: retain the item, block the dispatcher with bounded global backoff, and expose the redacted diagnostic.
  • Preserve secondary-rate-limit 422 handling as global rate-limit backoff. Keep per-target admission 422s item-scoped.

Validation

pnpm run build:all
node --test --test-name-pattern='(bounds item-specific terminal-state check failures|parks an item after repeated item-specific target-state failures|structured client-payload validation|retains a synchronize update|secondary-limit 422|globally backs off GitHub outages)' test/dashboard-worker.test.ts
node --test --test-name-pattern='exact event item' test/sweep-workflow.test.ts
git diff --check

All commands above passed. actionlint is not installed on this Windows host. The focused workflow parser test passed. Broader workflow tests have existing native-Windows Bash availability failures unrelated to this patch.

Regression coverage proves:

  • a fix(exact-review): supersede stale PR heads before dispatch #842-shaped command-plus-synchronize payload has exactly 10 client_payload keys, retains source-head semantics, and exposes an actionable global 422 outcome instead of parking silently;
  • structured malformed client_payload validation parks with redacted field/code detail;
  • secondary-limit 422 remains global rate-limit backoff;
  • non-422 GitHub outage handling remains retryable; and
  • no raw validation message, URL, value, or token-shaped test data reaches durable state.

Codex review closeout

  • Dirty review: codex review --uncommitted initially found one accepted issue: shared 422 classification changed per-target admission failures to global scope. The patch now forces admission 422s back to item scope; focused admission tests were rerun.
  • Final dirty review: codex review --uncommitted reported no actionable defects.
  • Branch review: codex review --base origin/main reported no actionable correctness issues.

Risks and rollout

The change affects exact-review dispatch and sweep.yml payload compatibility. New producers emit queue_claim.source_head_sha; the workflow reads both nested and legacy top-level locations. Opaque 422s deliberately pause the shared dispatcher with capped backoff to prevent a retry storm, leaving the affected update visible for operators rather than discarding it.

The response body from the #842 incident is not recoverable from authorized read-only run logs, artifacts, or the public queue API; this patch records only a bounded allowlist needed for future diagnosis.

Links

@brokemac79
brokemac79 requested a review from a team as a code owner July 25, 2026 03:40
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(exact-review): retain actionable dispatch 422 detail This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@brokemac79
brokemac79 merged commit df5ec54 into main Jul 25, 2026
10 checks passed
@brokemac79
brokemac79 deleted the codex/csw-057-dispatch-422-classification branch July 25, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant