Repository navigation
Closed
Labels
ready-for-agentFully specified, ready for an AFK agent
Description
Part of #247. Implements spec §10; decision Admin authority, drawn on the page mocks.
What to build
- The pick page
GET /company/users/:id/deactivateinpackages/portal(admins; the last-active-admin rule refuses at the top as today): the user's live patches, each with a checkbox and a static badge listing its live dependants (patch and owner; the user's own marked "theirs"); retired and deleted patches shown, not selectable; three submits: Keep their patches live (the leave-them-all choice: deactivates at once), Retire selected, Retire all; Retire selected with nothing checked stays on the page with "Select at least one, or keep their patches live." (422). A user with no live patches goes straight to the confirmation. - The confirmation (
POSTwith the selection, re-rendered): recomputed for the exact selection; every live dependant not itself in the selection, whichever owner it has, or "Nothing breaks"; the acknowledgement when anything breaks; confirm commits the deactivation and every selected retire (ordinary retires, actor the admin) in one transaction, or nothing:Users.deactivateandUsers.reactivatetake an optional outer transaction and open their own only when none is given (the portal always passes one), and the last-active-admin rule runs on GET and POST. - Reactivation mirrors it:
GET/POST /company/users/:id/reactivatewith the user's retired patches, however retired; Keep them retired, Restore selected, Restore all; the comes-back-broken warning per patch whose current version's sources are off, where a source that is live or in the same selection counts as intact; one transaction withUsers.reactivate. /company's Deactivate and Reactivate buttons become links to these pages; Companies' one-clickPOST /company/users/:id/deactivateand/reactivateroutes move to the portal. Bulk retire and restore exist only here.
Admitted at merge
The whole admin governance of §4 and §10 is in the portal.
Done when
- Tested: the badges; the confirmation recomputed for three selections (nothing selected, a chain inside the selection showing no breakage, a dependant outside it showing breakage); the transaction committing deactivation and retires together, and rolling both back when one retire fails (alternate layer); the no-live-patches shortcut; reactivation's warning; the last-active-admin refusal;
/company's links.
Surfaces
Served pages (ui-consistency), reverse states (reactivation mirrors deactivation; a retired patch is restorable from its card too), the Companies glossary (Deactivation, Reactivation gain the pick), the Portal glossary (Pick page from decided to built), docs/product.md § Ownership and deactivation from decided to built, CONTEXT-MAP.md's Companies line.
Metadata
Metadata
Assignees
Labels
ready-for-agentFully specified, ready for an AFK agent
Activity
allisonmahmood commentedon Sep 15, 2026
§10's "optional outer transaction" is satisfied by Effect's ambient
sql.withTransactionnesting: Users and Patches join the portal's transaction through savepoints, commit or roll back together, and Users opens its own transaction when called outside one.feat(portal): deactivate and reactivate users with their patches
feat(portal): deactivate and reactivate users with their patches