Skip to content

feat: yield background review under exact pressure#559

Merged
brokemac79 merged 7 commits into
mainfrom
feat/exact-review-admission-policy
Jul 14, 2026
Merged

feat: yield background review under exact pressure#559
brokemac79 merged 7 commits into
mainfrom
feat/exact-review-admission-policy

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 14, 2026

Copy link
Copy Markdown
Member

Related: #542 (closed; superseded)

Depends on: #555 (merged as 41ea43b)

What Problem This Solves

Periodic and commit-review background work can consume the worker budget needed to drain an exact-review backlog. Operators had no opt-in admission policy that causes lower-priority broad-review lanes to yield when exact review is congested or saturated.

Why This Change Was Made

This is the scheduler/admission-policy portion of closed contributor PR #542. It deliberately consumes the durable exact_review_queue.generated_at and exact_review_queue.pressure.status contract published by #555 instead of duplicating pressure classification.

When explicitly enabled, the policy:

  • caps shared background review at 16 workers when exact review is congested and 4 when it is saturated;
  • subtracts already-active background workers before admitting another broad planner;
  • serializes background admission through one shared workflow lock;
  • re-evaluates caps on continuation and defers zero-cap commit work by requeueing the same range;
  • fails open to normal capacity when telemetry is missing, malformed, stale, or unknown.

Exact-review, repair, apply, and other priority lanes remain outside this background cap. The default behavior remains unchanged until CLAWSWEEPER_ENABLE_EXACT_REVIEW_BACKGROUND_YIELD=1 is explicitly set.

User Impact

With the opt-in variable enabled, broad work yields capacity when the exact-review lane is under pressure. This is a safe guardrail, not a replacement for #545's recovery work and not a fix for post-review state-ledger/lease-completion contention.

Evidence

  • The original exact-head GitHub CI passed 7/7, including pnpm check.
  • After integrating merged feat(dashboard): expose exact-review pressure telemetry #555, disposable Linux-container proof passed: pnpm run build:all and node --test test/sweep-workflow.test.ts test/repair/workflow-utils.test.ts dist/repair/workflow-utils.test.js115/115 passing. The container copy normalized Windows checkout CRLF only; no tracked file was changed.
  • pnpm run check:limits passed in the same Linux container.
  • git diff --check origin/main...HEAD passed.
  • Codex cleanup review: codex review --uncommitted clean for the release-owned changelog removal.
  • Codex final review: codex review --base origin/main clean with no actionable findings after feat(dashboard): expose exact-review pressure telemetry #555 integration.
  • The local actionlint image reports the repository's pre-existing queue: max concurrency extension, including occurrences already on main; GitHub Actions' own Analyze (actions) check is the authoritative validation for this workflow syntax.

Maintainer follow-up — 2026-07-14

vincentkoc and others added 5 commits July 14, 2026 13:29
Co-authored-by: brokemac79 <255583030+brokemac79@users.noreply.github.com>
Co-authored-by: brokemac79 <255583030+brokemac79@users.noreply.github.com>
Co-authored-by: brokemac79 <255583030+brokemac79@users.noreply.github.com>
Co-authored-by: brokemac79 <255583030+brokemac79@users.noreply.github.com>
Co-authored-by: brokemac79 <255583030+brokemac79@users.noreply.github.com>
@brokemac79

Copy link
Copy Markdown
Contributor

Confirmed against #542: this is the opt-in background-yield scheduler slice. #542 is being closed as superseded.

Please land #555 first: this PR consumes its durable exact_review_queue.generated_at and exact_review_queue.pressure.status contract. It is a contention guardrail, not a replacement for #545's completion-burst recovery, and remains disabled until CLAWSWEEPER_ENABLE_EXACT_REVIEW_BACKGROUND_YIELD=1 is explicitly set.

I am removing the release-owned CHANGELOG.md entry before merge; it is not part of this normal feature PR.

@brokemac79 brokemac79 marked this pull request as ready for review July 14, 2026 14:57
@brokemac79 brokemac79 requested a review from a team as a code owner July 14, 2026 14:57
@brokemac79 brokemac79 merged commit 7f18537 into main Jul 14, 2026
8 checks passed
@brokemac79 brokemac79 deleted the feat/exact-review-admission-policy branch July 14, 2026 14:57
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.

2 participants