Commit Graph

1 Commits

Author SHA1 Message Date
Angelo B. J. Luidens
a4e4306fb1 Stage 4 partial: cadence optimizer + publish-loop state machine
Pure-function pieces that need no Redis/DB to verify (11 new tests):
- apps/scheduler/src/cadence.ts: Beta posterior model, propose(history, config)→[Proposal]; threshold gates (≥8 samples, ≥4 weeks, ≥20% ratio, disjoint 95% CIs); never auto-applied (RBR)
- apps/scheduler/src/publish-loop.ts: state-machine transition function for pending→queued→dispatching→published with retry-vs-DLQ branch on failure and cancellation path

What defers to live Redis + Postgres + LinkedIn:
- 4.1 BullMQ queue + Redis enqueue→consume integration test
- 4.2 End-to-end publish loop trace (POST /api/content → DB → BullMQ → LinkedIn fake → publication row)
- 4.3 Chaos test for idempotency on retry

117/117 tests pass cumulative across all packages and apps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-26 12:59:46 -04:00