Skip to content

Add DB-backed worktree inventory table and repository #243

@chubes4

Description

@chubes4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions