Skip to content

(MOT-4229) feat(harness): max_fires fire budget + unbounded-cron advisory - #593

Open
andersonleal wants to merge 1 commit into
mainfrom
feat/harness-cron-fire-budget
Open

(MOT-4229) feat(harness): max_fires fire budget + unbounded-cron advisory#593
andersonleal wants to merge 1 commit into
mainfrom
feat/harness-cron-fire-budget

Conversation

@andersonleal

Copy link
Copy Markdown
Collaborator

Why

rctest7 postmortem: an orchestrator registered a 10-second gate-check cron with no termination path. Its gate condition became unreachable (the reactor aggregated into mistyped tables — companion PR #592 guards that side), so the cron polled forever: 69 fires in 10 minutes until manually stopped. At 6 fires/min the fire-rate breaker (loop breaker #3) correctly never engages — this loop shape is slow, "legitimate" trigger traffic, and nothing in the platform bounded it.

What

1. metadata.max_fires: N on react bindings — a caller-declared lifetime budget of delivered fires:

  • every budgeted fire is stamped __fire_seq / __fire_budget; the Nth also gets __final_fire: true + a note explaining the binding is now retired
  • the final fire is delivered normally, then the binding retires through the exact once teardown path (fired records carry retired: true)
  • fires past the budget (teardown raced the source / a prior unregister failed) are blocked and re-attempt teardown
  • counted after gate admission, so coalesced parks don't burn budget their trailing fire will spend
  • rejected on join predecessors (the join owns their lifecycle) and on once bindings with budget > 1
  • counters live in the subscription registry, die with their entry, bounded for spec-hash fallback keys

2. Unbounded-cron advisory — registering a standing cron binding without a termination path appends a registration note: fires FOREVER until unregistered; set max_fires (react) and/or give the task a deadline escape (both paths: react + notify).

Tests

  • unit: validate_spec budget rules, advisory variants, registry counter lifecycle (278 lib tests green)
  • E2E-010 fire-budget-retires-binding: standing budgeted call-mode reaction; each fire gated on the previous call's evidence; turn 2 proves retirement via removed: false on the captured sub id before a third write is attempted; whole-run call count pins exactly 2 fires
  • full integration suite: 10/10 direct scenarios pass

Fixes MOT-4229

rctest7 postmortem: an orchestrator's 10-second gate-check cron had no
termination path. When its gate condition became unreachable it polled
forever — 69 fires in 10 minutes until manually stopped. At 6 fires/min
the fire-rate breaker (loop breaker #3) correctly never engages; nothing
in the platform bounded the loop.

- metadata.max_fires: N on react bindings — a lifetime budget of
  delivered fires. Every budgeted fire is stamped __fire_seq/__fire_budget;
  the Nth is stamped __final_fire + an explanatory note and retires the
  binding through the once teardown path. Fires past the budget are
  blocked and re-attempt teardown. Rejected on join predecessors and on
  once bindings with budget > 1.
- Registering a standing cron binding (react or notify) without a
  termination path appends an advisory: fires FOREVER until unregistered;
  set max_fires and/or give the task a deadline escape.
- E2E-010 fire-budget-retires-binding: standing budgeted call reaction,
  per-fire probe gating, removed:false retirement proof before a third
  fire is attempted.
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 24, 2026 3:11pm
workers-tech-spec Ready Ready Preview, Comment Jul 24, 2026 3:11pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 48 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@andersonleal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e891a7d-c662-4217-8cad-88b70cbcb533

📥 Commits

Reviewing files that changed from the base of the PR and between 6452708 and c15898a.

📒 Files selected for processing (7)
  • harness/src/functions/react.rs
  • harness/src/functions/subscribe.rs
  • harness/src/subscriptions/registry.rs
  • harness/tests/e2e/README.md
  • harness/tests/e2e/src/fixtures/tests.rs
  • harness/tests/e2e/src/scenarios/fire_budget.rs
  • harness/tests/e2e/src/scenarios/mod.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/harness-cron-fire-budget

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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