Goal
Add a DMC-owned database table/repository for known workspace worktrees so DMC does not have to rediscover everything from filesystem scans on every operator command.
Scope
- Add activation/schema management for
datamachine_code_worktrees.
- Add repository/service for upsert/list/get/delete by handle.
- Write rows from
worktree add, finalize, mark-cleanup-eligible, remove, prune, and metadata refresh paths.
- Add
workspace inventory refresh or equivalent to reconcile DB from current filesystem inventory.
workspace hygiene should report DB inventory freshness and optionally refresh.
Required behavior
- Handle remains the stable key.
- Filesystem metadata can be imported, but DB becomes the queryable source.
- Missing path / stale row state is recorded instead of silently disappearing.
- No long-term compatibility shim. Unknown unmanaged paths require explicit adoption/refresh.
Tests
- Schema install smoke.
- Worktree add writes DB row.
- Finalize updates lifecycle/pr fields.
- Remove/prune marks/removes row.
- Inventory refresh reconciles missing/new rows deterministically.
Goal
Add a DMC-owned database table/repository for known workspace worktrees so DMC does not have to rediscover everything from filesystem scans on every operator command.
Scope
datamachine_code_worktrees.worktree add,finalize,mark-cleanup-eligible,remove,prune, and metadata refresh paths.workspace inventory refreshor equivalent to reconcile DB from current filesystem inventory.workspace hygieneshould report DB inventory freshness and optionally refresh.Required behavior
Tests