Description
Ops needs to pause a scheduled distribution mid-flight (e.g. on liquidity concern) and resume it later without losing state. Add pause/resume endpoints with reason capture and audit event on each transition.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/services/distributionScheduler.ts, src/routes/distributions.ts
- Pause reason must be non-empty
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/distribution-pause-resume
- Implement changes
- Add state machine transitions with audit
- Add API endpoints with RBAC
- Emit
distribution.paused_seconds histogram
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Resume of an unpause is idempotent
- Include test output and notes
Example commit message
feat: pause/resume for deferred distributions
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Ops needs to pause a scheduled distribution mid-flight (e.g. on liquidity concern) and resume it later without losing state. Add pause/resume endpoints with reason capture and audit event on each transition.
Requirements and context
src/services/distributionScheduler.ts,src/routes/distributions.tsSuggested execution
git checkout -b feat/distribution-pause-resumedistribution.paused_secondshistogramTest and commit
npm testExample commit message
feat: pause/resume for deferred distributionsGuidelines