feat(tact): Support explicit workspace relocation for persisted sessions
Problem
Tact checkpoints bind sessions to the workspace’s absolute canonical path. If the directory is renamed or moved, resuming fails before the TUI opens: 'failed to resolve task workspace /old/path: No such file or directory'
Passing the new path through --workspace does not help because Nanocodex requires the checkpoint workspace to exactly match the configured workspace. A symlink also cannot satisfy the canonical-path check.
The checkpoint and transcript remain intact, but recovery currently requires manually decompressing and editing Tact’s private checkpoint format.
Proposed solution
Preserve the existing safety rule, but add an explicit relocation operation:
tact session relocate SESSION_ID NEW_WORKSPACE
Also, when direct resume finds that the stored workspace is missing, offer an interactive recovery prompt:
The original workspace no longer exists:
/old/path
Relocate this session to the current workspace?
/new/path
Relocation should:
• Canonicalize and validate the new directory. • Require explicit confirmation; never silently resume in an unrelated directory. • Update the snapshot through a typed Nanocodex API rather than rewriting private JSON. • Write the checkpoint atomically while retaining a backup. • Update session-discovery metadata so the session appears under the new workspace. • Preserve historical tool calls and transcript paths unchanged. • Record the relocation so the model receives current workspace context on its next turn.
Acceptance criteria
• Renaming a workspace no longer makes its session inaccessible. • Unrelated workspaces are never accepted silently. • Older checkpoints can be relocated. • Failed relocation leaves the original checkpoint usable. • The relocated session appears in the new workspace’s session picker.
Recommendation: Explicit confirmed relocation is simpler and safer than automatically treating the current directory as equivalent. Filesystem identity tracking could later make same-filesystem renames automatically recognizable.
Not going to add this for now. Workspace pinning was intentional, and workspace dirs shouldn't move often.