Repository navigation
F11: Reactivate flock — undo deplete/archive (#57) - #62
Merged
Merged
Conversation
added 2 commits
July 16, 2026 17:11
Deplete/archive were one-way; a mis-click was unrecoverable from the
UI (the incident that motivated this: a DB wipe as the only undo).
- Flock.Reactivate(): Depleted/Archived -> Active, clears the
DepletedOn/ArchivedOn stamps (so the CanRecordProductionOn backfill
window disappears and full capture is restored), bumps Version.
Reactivating an Active flock -> 409.
- POST /flocks/{id}/reactivate.
- Flocks screen: "reactivate" action on any non-Active row, including
archived rows behind the toggle. No confirm — it IS the undo.
Tests (+3 -> 123): domain transition/stamp/Version assertions;
integration deplete->reactivate->record-today (full capture restored),
archive->reactivate, 409 on active; parallel-reactivate race pinning
Version to successful mutations.
Verified in chromium: Depleted flock reactivated to Active and back in
the daily-entry picker; archived flock reactivated from behind the
"show archived" toggle.
Closes #57
- Race test asserts the Version DELTA around the parallel reactivates instead of an absolute value, so future fixture mutations can't make it silently mis-assert. (pi Low) - Glossary documents Reactivate and the dual-stamp state (deplete then archive), which the transition leans on. (pi Info) Deferred with reasons on the PR: lifecycle-transition audit trail (belongs to the Phase 1.1 audit-log slice — retrofit deplete/archive/ reactivate together), no confirm on reactivate (it IS the undo; a mistaken one is re-depletable, losing only stamp dates — covered by the audit decision).
Owner
Author
Review round: codex + picodex: clean pass — "consistently implemented across domain, application, API, and UI layers; preserves optimistic concurrency, tenant filtering, idempotency."
123 tests green. |
90 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #57. The undo for the mis-deplete incident: Depleted/Archived flocks return to Active.
What
Flock.Reactivate()— clearsDepletedOn/ArchivedOn(the backfill window disappears with them; full capture restored), bumps Version, 409 when already Active.POST /flocks/{id}/reactivate.Tests (+3 → 123)
Domain transitions/stamps/Version; integration: deplete → reactivate → entry recordable for today again, archive → reactivate, 409 on Active, parallel-reactivate race (Version == successes).
Verification (chromium, real stack)
Depleted flock → reactivate → Active and back in the daily-entry flock picker (prefill banner even confirmed its submitted entry still resolves). Archived flock → revealed via toggle → reactivate → Active. One false alarm during the drive was a script nav-race, confirmed against a fresh page load.