project_prune
Delete hive projects safely: sweep empty projects with no rows anywhere, or remove one named project with confirmation, snapshotting first and refusing if live panes own rows.
Instructions
Delete every registered project that owns no rows anywhere in the store (pads, todos, kv, leases, agents, wakes, command_trust, questions), verified individually before each delete. Never prunes the caller's own project. With project_id, removes exactly that one project instead of sweeping, and only if it owns no rows; otherwise refuses and names what it owns. With project_id AND confirm_name (the project's exact name), removes that one project even when it owns rows: it takes a snapshot first, refuses while a running row owns a live pane or its pane ownership cannot be verified (agent_close row_only retires the latter), then deletes the project with everything it owns (todos, comments, pads, kv, leases, agents, wakes, trust, questions, agent messages) in one transaction and reports per-table counts and the snapshot path. queen_audit rows naming it are kept, and so are other projects' lead-idle subscriptions that target it, so a watch on its lead ends with a named reason. confirm_name without project_id is refused, and there is no forced sweep. Refuses under HIVE_PROJECT_LOCK=1: this is a whole-store sweep, and a project-locked session may only touch its own project. Immediate, permanent: no dry-run mode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | ||
| confirm_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| counts | No | ||
| errors | No | ||
| deleted | Yes | ||
| snapshot | No | ||
| held_back | Yes | ||
| hive_notice | No |