Skip to content

docs: correct scheduler fallback arithmetic - #1098

Merged
brokemac79 merged 2 commits into
mainfrom
codex/csw-119-scheduler-doc-consistency
Aug 10, 2026
Merged

brokemac79 merged 2 commits into
mainfrom
codex/csw-119-scheduler-doc-consistency

Conversation

@brokemac79

@brokemac79 brokemac79 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • correct the stale quiet-system scheduler example from 20 candidates / 200 reviews per hour to the current bounded fallback of 50 candidates and production admission target of 300 reviews per hour with a 30-item burst
  • distinguish the live shared candidate-capacity budget from the bounded queue-probe fallback
  • correct the fallback cadence arithmetic: 600 offers per 10-minute normal-fanout cycle, 3,600 offers per hour across six fallback cycles, and 600 offers per hour for a five-minute single-target fallback
  • extend the existing documentation-sync manifest so the affected limits example tracks the production admission target and burst

What Problem This Solves

docs/limits.md still described the pre-current fallback and admission values. docs/scheduler.md called 50 × 12 = 600 an hourly normal-fanout value even though normal fanout runs every 10 minutes.

Source inspection also found an important qualification: the 50-per-target multiplication is not the ordinary live-capacity path. Normal fanout ordinarily divides one queue-advertised candidate-capacity budget across selected repositories. 50 × 12 is the bounded fallback only when the queue-capacity probe is unavailable.

Why This Change Was Made

The corrected wording follows current source and workflow behavior:

  • src/repair/target-fanout.ts defines SCHEDULED_REVIEW_PLAN_BATCH_SIZE = 50.
  • Normal fanout uses the live queue's availableCandidateCapacity when present and divides that shared budget across selected repositories.
  • If the capacity probe is unavailable, fallback capacity is 50 × min(12, selected repositories).
  • .github/workflows/sweep.yml runs normal fanout at 41/10 * * * * with a 12-target limit.
  • Direct schedules run every five minutes and default an unavailable queue-capacity probe to 50 candidates for the single target.
  • dashboard/wrangler.toml configures EXACT_REVIEW_TARGET_RATE_PER_HOUR = 300 and EXACT_REVIEW_TARGET_BURST = 30.

The offer ceilings are upstream candidate ceilings, not admitted review throughput. Due filtering, planner capacity clamping, dedupe, queue backpressure, and Worker admission can all reduce them; the Worker admits at most 300 scheduled reviews per hour.

User Impact

Operators and maintainers get source-aligned scheduler capacity examples. Runtime behavior is unchanged.

Validation

  • pnpm run check:docs — passed
  • pnpm run check:limits — passed
  • pnpm run build — passed
  • git diff --check origin/main..HEAD — passed
  • pnpm run codex:local:check — passed

Review Proof

  • Dirty-patch Codex review initially found that the proposed 3,600/hour wording incorrectly described the fallback as ordinary per-target capacity. The finding was accepted, the wording was corrected to distinguish the live shared budget from fallback behavior, validation was rerun, and the repeat dirty review found no actionable defects.
  • Durable ClawSweeper review on the first PR head found that the earlier Current defaults bullet still described 50 items per target without distinguishing live shared capacity from fallback behavior. The finding was accepted. During the required committed-base review, the first wording fix was further corrected to avoid presenting 50 as a per-repository allocation cap: direct single-target fallback is 50 candidates, while normal fanout creates a pooled 50 × selected target count fallback and apportions it by backlog.
  • Final dirty-patch and committed-base Codex reviews: clean, no actionable findings.
  • Exact-head local ClawSweeper committed-range review: pnpm run review -- --local-range --target-repo openclaw/clawsweeper --base origin/main — review_status: complete, high confidence, patch correct, no findings; reviewed main 0559e03857fa9a9a6de28c984ed495287ec3b9cc and head d8a47bc68a380bb5ebf8a3830963b7dda170512a. The local generic classifier marked proof missing because config/documentation-sync.json is outside docs/; repository policy and the live review apply the docs-only proof exception to this documentation-sync manifest change, with the executable checks above as proof.

Real Behavior Proof

Not applicable. Every changed surface is documentation or documentation-sync configuration; no runtime, workflow, queue, API, UI, package, or integration behavior changes. The focused executable proof is pnpm run check:docs, pnpm run check:limits, and the build.

Overlap and Landing Order

Draft PR #1097 also touches docs/limits.md, docs/scheduler.md, and config/documentation-sync.json, but for the separate production publication-capacity rollback (8/32/40 versus 50/50/50). This PR does not change publication policy, Goal B rate limiting, queues, workflows, config values, gates, or production state.

Either PR may land first because their semantic changes are independent. The second PR must rebase onto current main, preserve both sets of documentation changes, rerun the docs/build/diff checks, and repeat the required review gate before its next push. Neither branch should overwrite the other's prose or manifest claims.

Risks and Rollback

Risk is limited to documentation accuracy and a deterministic docs-sync claim. Revert commits d8a47bc68a380bb5ebf8a3830963b7dda170512a and 52f76a07fa55843f7907f2b01775bf601de4d95b to roll back. No production state or configuration rollback is involved.

Non-goals

  • changing production publication capacity (8/32/40 or 50/50/50)
  • changing the 300/hour admission target, burst, Goal B behavior, queues, workflow cadence, scheduler code, gates, or production state
  • broadening the documentation audit beyond these two derived examples

Related: #1097

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 10, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 10, 2026, 10:21 AM ET / 14:21 UTC.

ClawSweeper review

What this changes

Updates scheduler-capacity documentation and its documentation-sync manifest to distinguish live queue capacity from bounded fallback offers and correct the stated admission limits.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: current main still documents the stale 20-candidate/200-review example and incorrect hourly fanout arithmetic, while this PR provides a narrow, source-aligned correction. The only remaining landing concern is coordinating its overlapping documentation edits with #1097.

Priority: P3
Reviewed head: d8a47bc68a380bb5ebf8a3830963b7dda170512a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The documentation correction is narrow and matches the current scheduler, queue-capacity, and production-setting sources.
Proof confidence 🌊 off-meta tidepool Not applicable: The changed JSON supplies documentation-validation claims and the remaining changes are operator documentation; no runtime, workflow, API, or integration behavior changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The changed JSON supplies documentation-validation claims and the remaining changes are operator documentation; no runtime, workflow, API, or integration behavior changes.
Evidence reviewed 7 items Current fallback behavior: Normal fanout uses advertised available candidate capacity when present and otherwise falls back to 50 multiplied by the selected-target count.
Allocation semantics: The selected repositories share one budget through backlog-weighted allocation, so 50 is not an ordinary per-target live allocation.
Cadence and direct fallback: The workflow runs normal fanout every 10 minutes, defaults an unavailable queue probe to 50, and clamps direct scheduled work to the available capacity.
Findings None None.
Security None None.

How this fits together

Scheduled fanout reads available capacity from the exact-review queue, apportions candidate selection across repositories, and sends selected items into durable admission. The edited documentation and sync manifest explain that behavior and keep operator-facing examples tied to production settings.

flowchart LR
A[Queue capacity] --> B[Scheduled fanout]
B --> C[Candidate allocation]
C --> D[Durable review queue]
D --> E[Review admission]
B --> F[Operator documentation]
F --> G[Documentation sync check]
Loading

Before merge

  • Add real behavior proof - Not applicable: The changed JSON supplies documentation-validation claims and the remaining changes are operator documentation; no runtime, workflow, API, or integration behavior changes.
  • Resolve merge risk (P1) - fix(publication): restore production publisher capacity #1097 edits the same two documents and sync manifest; whichever PR lands second must rebase and preserve both independent documentation claims.
  • Complete next step (P2) - No concrete repair is needed; this is a valid contributor documentation PR awaiting normal maintainer landing coordination.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Documentation scope 3 files affected; 26 added, 10 removed The patch is limited to two operator documents and their deterministic synchronization manifest.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the source-aligned documentation correction, rebasing the second of the two overlapping PRs and rerunning the documentation checks after conflict resolution.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the source-aligned documentation correction, rebasing the second of the two overlapping PRs and rerunning the documentation checks after conflict resolution.

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

Not applicable: this PR changes documentation and documentation-validation data, not a runtime behavior requiring reproduction.

Is this the best way to solve the issue?

Yes: it preserves the runtime as the source of truth, corrects the derived examples, and adds a focused check against the production admission values.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0559e03857fa.

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P3: This corrects operator documentation and its drift check without changing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The changed JSON supplies documentation-validation claims and the remaining changes are operator documentation; no runtime, workflow, API, or integration behavior changes.

Evidence

What I checked:

  • Current fallback behavior: Normal fanout uses advertised available candidate capacity when present and otherwise falls back to 50 multiplied by the selected-target count. (src/repair/target-fanout.ts:203, 0559e03857fa)
  • Allocation semantics: The selected repositories share one budget through backlog-weighted allocation, so 50 is not an ordinary per-target live allocation. (src/repair/target-fanout.ts:450, 0559e03857fa)
  • Cadence and direct fallback: The workflow runs normal fanout every 10 minutes, defaults an unavailable queue probe to 50, and clamps direct scheduled work to the available capacity. (.github/workflows/sweep.yml:190, 0559e03857fa)
  • Production admission settings: Production config defines a 300-review/hour target with a 30-item burst, matching the proposed documentation text. (dashboard/wrangler.toml:74, 0559e03857fa)
  • Current documentation remains stale: Current main still says 20 candidates/200 reviews per hour and describes 50 items per target, so the central documentation problem is not already implemented. (docs/limits.md:290, 0559e03857fa)
  • Documentation-sync contract: The documentation checker substitutes configured values into manifest claims and verifies their presence in the referenced document, so the added claim is an appropriate drift guard. (scripts/check-docs.mjs:407, 0559e03857fa)

Likely related people:

  • Peter Steinberger: Recent history on the fallback and fanout implementation includes the target-fanout recovery work. (role: recent target-fanout contributor; confidence: medium; commits: 095f5c5a9492; files: src/repair/target-fanout.ts)
  • Martin Cleary: Current main's documentation-sync contract and related operator documentation were recently updated in commit 0559e03. (role: recent documentation-sync contributor; confidence: high; commits: 0559e03857fa; files: config/documentation-sync.json, docs/limits.md, docs/scheduler.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-10T14:06:45.153Z sha 52f76a0 :: needs real behavior proof before merge. :: [P2] Align the current-defaults capacity statement
  • reviewed 2026-08-10T14:11:04.586Z sha 52f76a0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 10, 2026
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 10, 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.

Re-review progress:

@clawsweeper clawsweeper Bot removed the proof: sufficient Contributor real behavior proof is sufficient. label Aug 10, 2026
@brokemac79
brokemac79 marked this pull request as ready for review August 10, 2026 14:27
@brokemac79
brokemac79 merged commit 75ac66b into main Aug 10, 2026
11 of 12 checks passed
@brokemac79
brokemac79 deleted the codex/csw-119-scheduler-doc-consistency branch August 10, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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