Skip to content

fix(queue): govern publication backlog - #641

Merged
hxy91819 merged 1 commit into
mainfrom
feature/publication-backlog-governance
Jul 17, 2026
Merged

hxy91819 merged 1 commit into
mainfrom
feature/publication-backlog-governance

Conversation

@hxy91819

Copy link
Copy Markdown
Member

Summary

  • add a backward-compatible structured publication completion protocol so published, superseded, retryable, refresh-required, and permanent outcomes have distinct queue semantics
  • terminate remote-newer and remote-closed artifacts without retry amplification, refresh unavailable artifacts after bounded confirmation, and park permanent poison items in an operator-visible SQLite dead-letter queue
  • replace ready-only publication scaling with hysteresis driven by ready + backoff depth, oldest age, 15/60-minute net drain, GitHub pressure feedback, and the shared Actions worker budget
  • expose separate publish/supersede/retry/dead-letter flow metrics, oldest ready/backoff/DLQ ages, capacity control state, and approximate per-item queue position

Root cause

Publication work was treated as one success/failure stream. Stale artifacts could repeatedly consume workers, dispatch attempts could exhaust publication-specific retry budgets, and completed_total obscured whether work was truly published or merely terminal. Capacity also reacted mostly to ready depth, so the lane could remain at 24 while an old queue was still falling behind.

Current main includes two useful partial fixes that this branch preserves:

The live dashboard still showed 226 pending, 213 ready, a 23-hour oldest item, and a -7/hour net publication rate while 23 of 24 slots were active. This change addresses the remaining control-loop and poison-item gaps without adding GitHub polling.

Safety and operations

  • review and apply ownership boundaries are unchanged
  • stale/superseded results never count as real publish successes
  • GitHub 429 and transient feedback immediately reduce the pressure ceiling and recover gradually
  • publication admission preserves 16 Actions slots and honors WORKER_BUDGET - active_reviews - 16
  • DLQ and stock-classification operations use the existing internal HMAC, exact item revision tuples, bounded pages/batches, and idempotent replay keys
  • no live queue cleanup, apply/close, workflow pause, or deployment was performed while preparing this PR

Validation

  • pnpm run check
  • node --test test/dashboard-worker.test.ts test/sweep-workflow.test.ts test/repair/stale-event-disposition.test.ts (203 passed)
  • global autoreview: clean, no accepted/actionable findings (patch is correct, confidence 0.74)
  • git diff --cached --check
  • staged-diff sensitive-pattern scan: no findings; full-repository gitleaks findings are pre-existing public App client IDs and synthetic test fixtures

@hxy91819
hxy91819 marked this pull request as ready for review July 17, 2026 03:03
@hxy91819
hxy91819 requested a review from a team as a code owner July 17, 2026 03:03
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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