FN-7154: prevent duplicate automation schedule runs
Add an atomic schedule claim so concurrent automation pollers execute each due window only once.
- Add AutomationStore.claimDueSchedule to CAS-advance nextRunAt before execution.
- Gate CronRunner execution on the claim across project, global, and all-scope pollers.
- Cover single-store, shared SQLite, legacy command, step, and in-process intercept deduplication paths.
- Document the claim-then-run automation invariant.
Files changed:
docs/architecture.md | 1 +
.../core/src/__tests__/automation-store.test.ts | 77 +++++++++++++++
packages/core/src/automation-store.ts | 33 +++++++
packages/engine/src/__tests__/cron-runner.test.ts | 110 +++++++++++++++++++++
packages/engine/src/cron-runner.ts | 18 +++-
5 files changed, 237 insertions(+), 2 deletions(-)
Fusion-Task-Id: FN-7154
Fusion-Task-Lineage: 490ba154-9dd8-4e92-bacb-24b7184cb6f8
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>