daemon: GET /api/worktrees plus a reclaim endpoint #80

Closed
opened 2026-08-24 09:38:40 +01:00 by naps62-yolo · 0 comments
Collaborator

Retained worktrees need somewhere to be seen and something to do about them. Without this the store from #E2 is a log nobody reads.

GET /api/worktrees lists what the store holds: path, base repository, branch, why it was retained, when, and what is currently in the way — the same breakdown the kill refusal reports, recomputed on read so it reflects the tree now rather than when it was retained. A tree whose work has since been pushed or committed should say so.

DELETE /api/worktrees/<id> reclaims one: removes the directory and drops the store entry. Reclaim is the deliberate destructive act, so it does not consult the guard — the operator is looking at what is in the way when they choose it. It never deletes the branch; git worktree remove keeps the ref, and reclaiming a tree must not throw away the commits on it.

Route constants go in maestro_protocol::routes beside the existing ones, and the payload type beside SessionWorktree.

Non-goals: no bulk reclaim, no age-based expiry, no automatic cleanup of retained trees. Everything here is operator-initiated.

Depends on: #E2

Retained worktrees need somewhere to be seen and something to do about them. Without this the store from #E2 is a log nobody reads. `GET /api/worktrees` lists what the store holds: path, base repository, branch, why it was retained, when, and what is currently in the way — the same breakdown the kill refusal reports, recomputed on read so it reflects the tree now rather than when it was retained. A tree whose work has since been pushed or committed should say so. `DELETE /api/worktrees/<id>` reclaims one: removes the directory and drops the store entry. Reclaim is the deliberate destructive act, so it does not consult the guard — the operator is looking at what is in the way when they choose it. It never deletes the branch; `git worktree remove` keeps the ref, and reclaiming a tree must not throw away the commits on it. Route constants go in `maestro_protocol::routes` beside the existing ones, and the payload type beside `SessionWorktree`. Non-goals: no bulk reclaim, no age-based expiry, no automatic cleanup of retained trees. Everything here is operator-initiated. Depends on: #E2
naps62-yolo added this to the Worktree lifecycle milestone 2026-08-24 09:38:40 +01:00
naps62-yolo added the area/daemonarea/protocoldifficulty/mediumtype/feat labels 2026-08-24 09:38:40 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:00 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Reference: naps62/maestro#80