Description
Some ledger periods are under legal hold and must not be purged even after retention. Add retention labels per period with legal-hold override and a purge worker that respects labels.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/services/auditPurgeService.ts
- Legal-hold add/remove dual-controlled
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/ledger-legal-hold-labels
- Implement changes
- Add
retention_labels table
- Extend purge to skip held periods
- Emit
purge.skipped_hold counter
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Hold removed re-enters purge on next cycle only
- Include test output and notes
Example commit message
feat: retention labels with legal-hold override
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Some ledger periods are under legal hold and must not be purged even after retention. Add retention labels per period with legal-hold override and a purge worker that respects labels.
Requirements and context
src/services/auditPurgeService.tsSuggested execution
git checkout -b feat/ledger-legal-hold-labelsretention_labelstablepurge.skipped_holdcounterTest and commit
npm testExample commit message
feat: retention labels with legal-hold overrideGuidelines