Update b905 issue: Add delayed archival strategy to Phase 6

Added detailed implementation considerations for delayed archival:
- Activity threshold evaluation (< 5 items OR 1-2 pubkeys = immediate)
- 2-minute grace period to prevent accidental deletions
- Notification issue creation (signed with owner pubkey)
- 10-day community response window before archival
- 4 new configuration options
- 4 new metrics for tracking
- Testing considerations with fast test cycles

Decision: Defer full implementation to Phase 6 as design consideration.
Core deletion flow (Phases 1-5) remains simpler with immediate archival.
This commit is contained in:
DanConwayDev
2026-01-13 11:29:22 +00:00
parent 54ed559d9f
commit aae077ec2b
+56 -2
View File
@@ -305,21 +305,60 @@ Graph-based retention algorithm:
- [ ] Design mechanism: admin CLI command? config flag? database operation?
- [ ] Should manual ejection delete git archive immediately or wait for cleanup?
- [ ] Log manual ejections for audit trail
- [ ] Delayed archival strategy design (defer full implementation):
- [ ] Activity threshold evaluation algorithm
- [ ] Count issues/PRs/patches (< 5 = low activity)
- [ ] Count unique creator pubkeys (1-2 = low activity)
- [ ] Both conditions evaluated (either triggers immediate archival)
- [ ] Grace period implementation (2 minutes default)
- [ ] Prevent accidental deletions
- [ ] Allow user to publish new announcement to cancel
- [ ] Handle cancellation during grace period
- [ ] Notification issue creation
- [ ] Sign issue with repository owner pubkey
- [ ] Content: deletion warning, 14-day timeline, affected content list
- [ ] Store notification issue reference for cleanup
- [ ] Archive delay implementation (10 days default)
- [ ] Community response window
- [ ] Scheduled task system for delayed execution
- [ ] Cancellation check before archival
- [ ] Configuration options:
- [ ] `deletion_notification_delay_secs` (default 120)
- [ ] `deletion_archive_delay_secs` (default 864000)
- [ ] `deletion_activity_threshold` (default 5)
- [ ] `deletion_creator_threshold` (default 3)
- [ ] Add config to all 4 required sources (CRITICAL):
- [ ] `src/config.rs`
- [ ] `docs/reference/configuration.md`
- [ ] `nix/module.nix`
- [ ] `.env.example`
- [ ] Timeline calculation and validation
- [ ] Total for active repos: 2min + 10days + 90days ≈ 100 days
- [ ] Low-activity repos: immediate + 90 days
- [ ] Testing considerations
- [ ] Override delays for test scenarios (5-10 seconds)
- [ ] Test immediate vs delayed paths
- [ ] Test cancellation during both grace and delay periods
- [ ] Metrics implementation:
- [ ] `ngit_deletion_requests_total`
- [ ] `ngit_deletion_requests_processed`
- [ ] `ngit_blacklist_deletions_total` (new)
- [ ] `ngit_deletion_requests_immediate` (new - low activity)
- [ ] `ngit_deletion_requests_delayed` (new - active repos)
- [ ] `ngit_deletion_notifications_created` (new)
- [ ] `ngit_deletion_requests_cancelled` (new)
- [ ] `ngit_blacklist_deletions_total`
- [ ] `ngit_holding_database_events`
- [ ] `ngit_holding_database_size_bytes`
- [ ] `ngit_archive_files_total`
- [ ] `ngit_archive_size_bytes`
- [ ] `ngit_recoveries_total`
- [ ] `ngit_permanent_deletions_total`
- [ ] `ngit_manual_ejections_total` (new)
- [ ] `ngit_manual_ejections_total`
- [ ] Documentation:
- [ ] Update `docs/explanation/deletion-requests.md` with findings
- [ ] Add blacklist deletion behavior documentation
- [ ] Add manual ejection mechanism documentation
- [ ] Add delayed archival strategy documentation
- [ ] Add edge case documentation
- [ ] Performance tuning guide
@@ -454,6 +493,21 @@ Kind 5 Event → Validate → Query Dependents → Archive Git → Move Events
8. ✅ Documentation complete
9. ✅ Production-ready metrics
## Progress
### 2026-01-13 [Session 14:30]
- **Design Update:** Added delayed archival strategy for active repositories
- Immediate archival for repos with < 5 items OR 1-2 pubkeys
- Delayed archival for active repos: 2min grace + 10 day delay + notification issue
- Total timeline: ~100 days for active repos (2min + 10d + 90d retention)
- Added 4 new configuration options: notification delay, archive delay, activity threshold, creator threshold
- **Decision:** Defer full implementation to Phase 6 as design consideration
- Core deletion flow (Phases 1-5) remains simpler with immediate archival
- Delayed strategy adds significant complexity (scheduled tasks, cancellation, notifications)
- Can evaluate necessity after basic deletion working
- **Updated:** Both `docs/explanation/deletion-requests.md` and issue with new strategy
- **Next:** Commit changes and continue with Phase 1 implementation planning
## References
- **Explanation:** `docs/explanation/deletion-requests.md`