Skip to content

feat(status): expose the scheduled review budget and shed reasons publicly - #1737

Merged
steipete merged 4 commits into
mainfrom
feat/scheduled-feed-observability
Oct 1, 2026
Merged

steipete merged 4 commits into
mainfrom
feat/scheduled-feed-observability

Conversation

@steipete

@steipete steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Since #1710 and #1736 deployed, production has dispatched no scheduled backfill reviews. scheduled_feed.active stays at 0, and review sheds run at about 72/hour. The public status cannot say why: the scheduled token balance, the lane balances, a GitHub-throttle pause and the shed reasons are all computed by the queue but stripped from /api/exact-review-queue. Tuning without them is guesswork.

This exposes those aggregates publicly, so the cause of the starvation can be read from production:

  • scheduled_feed.burst and scheduled_feed.token_balance. The balance is signed and goes negative while organic debt is outstanding.
  • scheduled_feed.lanes.{hot_intake,normal_backfill}, each with target_rate_per_hour, burst and token_balance. Both lanes are required, or the block is omitted.
  • scheduled_feed.throttle_observed_at and throttle_recovery_at, which always appear together. The throttle source label stays omitted.
  • lanes.review.shed_reasons_since_reset with backpressure, scheduled_rate and unattributed.

Change

  • dashboard/worker.ts: the public projection passes the values above through explicit allowlists, with bounded integer validation; the signed balance is bounded by ±2,000. Unknown keys and the internal throttle source are dropped, and malformed values are omitted. The projection stays idempotent through strictPublicStatusProjection.
  • test/dashboard-worker-status-privacy.test.ts: updated expectations, plus new cases covering negative balances, both-lane completeness, paired throttle timestamps, shed attribution on the review lane only, sentinel stripping, malformed values and idempotence.
  • docs/limits.md and docs/public-api.md document the fields. A changelog fragment is included.

Behavior proof

Committed in docs/proof/scheduled-feed-observability/ (README, run-proof.mjs, result.json). It runs the real dashboard Worker and ExactReviewQueue SQLite Durable Object in workerd with a fake clock and a loopback GitHub fixture. Base is 7f87179433 (origin/main); head is 3601dbdd3d, clean. Receipt SHA-256 is 35ce0ff12c0a23a3f8ca3ba6ce04ee5f02aa9ee23c77f76238159f1b8be1a826.

node docs/proof/scheduled-feed-observability/run-proof.mjs <base-ref> <tools-dir> <fresh-output-dir>

The scenario admits and claims 40 organic reviews, which charges the budget at claim. It then offers one scheduled normal-backfill item and reads the public route.

Base Head
Organic dispatched / claimed 40 / 40 40 / 40
Scheduled offer shed, scheduled_rate shed, scheduled_rate
Public scheduled_feed after the claims rate, replay, max concurrent, active plus burst: 24, token_balance: -8, lanes hot 8 / normal 16
Public lanes.review.shed_reasons_since_reset absent scheduled_rate: 1

All seven receipt assertions hold, including identical accounting on both builds. Limits: synthetic fixture and credential; reviews are modeled as claims; throttle timestamps are covered by unit tests rather than this run; no production state or GitHub writes.

Validation

  • pnpm run build:all and pnpm run check:static pass.
  • node --test test/dashboard-*.test.ts test/exact-review-*.test.ts: 1,169 pass, 0 fail.
  • The full pnpm run check runs in CI.

OpenClaw Bay

Not affected. Bay reads neither scheduled_feed nor the shed reasons and adds no control. The dashboard's client sanitizer drops negative numbers and unknown fields, so the HTML dashboard is unchanged. The values are available on the JSON route for operators.

Risks / rollback

This is a deliberate public-contract expansion: the queue previously exposed only max_concurrent and active under scheduled_feed. The new values are aggregate budget numbers with no item, repository, actor or credential detail. Rollback is a revert.

Review

Codex /review (autoreview, branch mode against origin/main, P0–P1 threshold): clean on head cd337cdb4d, "patch is correct" (0.93).

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 9:20 AM ET / 13:20 UTC.

ClawSweeper review

What this changes

Expose scheduled review token balances, lane budgets, throttle pause timestamps, and shed-reason counts through ClawSweeper’s public queue status API.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main computes these diagnostics but omits them from the public response. The additive projection is bounded, preserves privacy filtering, and has matching real-runtime evidence; no actionable defect was found.

Priority: P2
Reviewed head: cd337cdb4d1a8a71909a1940445aa309618823c9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused additive projection with matching production-path evidence and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The inspected workerd receipt exercises the real Worker public route after real queue claims and a scheduled shed, showing negative budget and shed attribution with unchanged accounting. Runtime hashes match current head; synthetic GitHub and clock limits are explicit. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The inspected workerd receipt exercises the real Worker public route after real queue claims and a scheduled shed, showing negative budget and shed attribution with unchanged accounting. Runtime hashes match current head; synthetic GitHub and clock limits are explicit. No stored-data contract changes.
Evidence reviewed 8 items Verified introduced scope: The pinned main-to-head diff adds 49 production lines in the Worker, focused privacy coverage, documentation, a changelog fragment, and a standalone proof harness. Queue accounting, permissions, dependencies, and workflows are unchanged.
Current main does not expose the requested diagnostics: Main's projection reads the scheduled target rate, replay capability, concurrency limit, and active count, but lacks the introduced budget, lane, throttle, and shed-reason fields. The queue already produces those values internally.
Privacy and compatibility boundary: The projection constructs closed field sets, bounds signed balances to ±2,000, requires both complete lane records, and publishes throttle timestamps only as a validated pair. It does not retain the internal throttle source or arbitrary keys. Existing strict status projection preserves the dedicated queue projection, including signed values. No persisted schema or existing setting changes.
Findings None None.
Security None None.

How this fits together

ClawSweeper’s review queue tracks review capacity and scheduled admission budgets. The dashboard Worker filters those internal statistics into public diagnostics that operators use to understand delayed backfill.

flowchart TD
  A[Organic review claims] --> C[Review queue accounting]
  B[Scheduled review offers] --> C
  C --> D[Internal queue statistics]
  D --> E[Bounded public projection]
  E --> F[Public queue status API]
  F --> G[Operator diagnostics]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and validation growth production +49, tests +74, proof harness +331 Production growth is justified by the explicit public-field validation; most executable additions provide focused coverage and runtime proof.

Technical review

Best possible solution:

Keep the existing queue accounting and expose its bounded aggregate diagnostics through the documented observer API.

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

Not applicable to a feature request; the recorded before/after runtime scenario directly demonstrates the missing diagnostics and their candidate output.

Is this the best way to solve the issue?

Yes. Extending the existing closed projection is a narrow solution that avoids changing queue accounting, stored state, or dashboard controls.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7f87179433d0.

Labels

Label changes:

  • add P2: This is a bounded operator-observability improvement for diagnosing scheduled review starvation.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The inspected workerd receipt exercises the real Worker public route after real queue claims and a scheduled shed, showing negative budget and shed attribution with unchanged accounting. Runtime hashes match current head; synthetic GitHub and clock limits are explicit. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The inspected workerd receipt exercises the real Worker public route after real queue claims and a scheduled shed, showing negative budget and shed attribution with unchanged accounting. Runtime hashes match current head; synthetic GitHub and clock limits are explicit. No stored-data contract changes.

Label justifications:

  • P2: This is a bounded operator-observability improvement for diagnosing scheduled review starvation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The inspected workerd receipt exercises the real Worker public route after real queue claims and a scheduled shed, showing negative budget and shed attribution with unchanged accounting. Runtime hashes match current head; synthetic GitHub and clock limits are explicit. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The inspected workerd receipt exercises the real Worker public route after real queue claims and a scheduled shed, showing negative budget and shed attribution with unchanged accounting. Runtime hashes match current head; synthetic GitHub and clock limits are explicit. No stored-data contract changes.

Evidence

What I checked:

  • Verified introduced scope: The pinned main-to-head diff adds 49 production lines in the Worker, focused privacy coverage, documentation, a changelog fragment, and a standalone proof harness. Queue accounting, permissions, dependencies, and workflows are unchanged. (dashboard/worker.ts:5556, cd337cdb4d1a)
  • Current main does not expose the requested diagnostics: Main's projection reads the scheduled target rate, replay capability, concurrency limit, and active count, but lacks the introduced budget, lane, throttle, and shed-reason fields. The queue already produces those values internally. (dashboard/worker.ts:5885, 7f87179433d0)
  • Privacy and compatibility boundary: The projection constructs closed field sets, bounds signed balances to ±2,000, requires both complete lane records, and publishes throttle timestamps only as a validated pair. It does not retain the internal throttle source or arbitrary keys. Existing strict status projection preserves the dedicated queue projection, including signed values. No persisted schema or existing setting changes. (dashboard/worker.ts:6045, cd337cdb4d1a)
  • Real production-path proof: The fully inspected harness and receipt run the real Worker and SQLite Durable Object in workerd 1.20260701.1 with Node 24.21.0, a synthetic GitHub fixture, and a controlled clock. Both variants dispatch and claim 40 organic reviews and shed the scheduled offer identically. The candidate public route reports token_balance -8, both lane budgets, and scheduled_rate shed count 1; baseline omits them. Throttle timestamp coverage is supplemental unit coverage, explicitly outside this runtime scenario. (docs/proof/scheduled-feed-observability/result.json:1, cd337cdb4d1a)
  • Proof remains applicable to current head: All four runtime source hashes match the candidate receipt. Receipt SHA-256 is 35ce0ff12c0a23a3f8ca3ba6ce04ee5f02aa9ee23c77f76238159f1b8be1a826. The change after tested head 3601dbd adds only the proof README and receipt. (docs/proof/scheduled-feed-observability/result.json:62, cd337cdb4d1a)
  • Related merged work supplies accounting, not this projection: perf(queue): charge organic executions and let scheduled backfill use its review budget #1710 and fix(queue): charge the review budget when a review lease is claimed #1736 are merged accounting changes. Their supplied discussion explains the debt and claim-charging model that this PR makes observable; neither supersedes the missing public projection. (dashboard/exact-review-queue.ts:12333, 7849c6a87034)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 6566c69 into main Oct 1, 2026
22 checks passed
@steipete
steipete deleted the feat/scheduled-feed-observability branch October 1, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant