Problem
idle-compact.ts and todos.ts resolve todo directories differently:
idle-compact.ts derives path from PI_TODO_PATH or join('.pi','todos'), then applies process.cwd().
todos.ts has its own getTodosDir()/label logic and default semantics.
This can cause idle compaction to think there are no active todos when the todo tool is actually using a different directory.
Proposed solution
- Extract shared todo-dir resolution utility used by both extensions.
- Define one canonical resolution order:
PI_TODO_PATH absolute/relative
- default
.pi/todos relative to canonical runtime cwd (or explicit home-based path)
- Add tests proving both extensions see the same effective todo dir under different cwd/env combinations.
Helpful context
pi/extensions/idle-compact.ts: TODO_DIR, hasInProgressTodos() path resolution via process.cwd().
pi/extensions/todos.ts: TODO_PATH_ENV, TODO_DIR_NAME, getTodosDir(process.cwd()).