Skip to content

fix(schedules): persist pending occurrences across retries - #489

Closed
andrei-hasna wants to merge 20 commits into
mainfrom
fix/2fe0ce99-loop-deferral
Closed

fix(schedules): persist pending occurrences across retries#489
andrei-hasna wants to merge 20 commits into
mainfrom
fix/2fe0ce99-loop-deferral

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Persist one durable pending occurrence and stable run/turn identity per thread schedule.
  • Recover waiting, enqueued, started, and terminal occurrences across retries and restarts.
  • Finalize interval, cron, and once cadence plus failure counters exactly once.
  • Prevent a reserved scheduled start from overwriting a replacement active turn.

Regression coverage:

  • due while busy reuses one occurrence without counting a run or emitting duplicate run state
  • duplicate claim and lease fencing
  • restart recovery for waiting, enqueued, started, and terminal states
  • interval, cron, and once finalization
  • cadence and failure counters
  • visible scheduled assistant result and persisted turn history

Validation:

  • staged diff and credential scans: clean
  • Rust formatting check: exit 0
  • Blacksmith Testbox package gates: pending
  • independent SOL/xhigh adversarial review: pending

Todos plan: 522f0953-22b4-46f6-bca0-50f1bdc2d4eb
Implementation task: 2fe0ce99-23f7-40c4-8769-fc64dfe2ef0b


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@andrei-hasna
andrei-hasna force-pushed the fix/2fe0ce99-loop-deferral branch 9 times, most recently from 18a4061 to d9e1e11 Compare August 9, 2026 14:26
Move the occurrence migration after the live schema sequence and repair the three compiler blockers so the focused regression can execute remotely.

Agent: cossus
Import the repository-standard pretty assertion macro explicitly in the nested occurrence regression module.

Agent: cossus
Restrict the legacy pause/expiry compatibility trigger to non-terminal occurrences so the current runtime remains responsible for its fenced terminal delete.

Agent: cossus
Keep the split terminal implementation private to the schedule runtime while making its re-exports visible across the nested occurrence module boundary.

Agent: cossus
Expose only the five terminal helpers consumed by sibling request processors through the intermediate occurrence module.

Agent: cossus
Place split occurrence tests on conventional nested module paths so both rustc and cargo-shear follow the same linkage.

Agent: cossus
Disambiguate assertions, retain the expected schedule for later lookup, import the Tokio test channel, and gate test-only re-exports.

Agent: cossus
Complete the installed turn start snapshot before releasing its worker so trigger mail queued after spawn_task belongs to the next turn.

Agent: cossus
@andrei-hasna
andrei-hasna force-pushed the fix/2fe0ce99-loop-deferral branch from d9e1e11 to 6fa9939 Compare August 9, 2026 15:26
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