Expand description
Root resolution logic for determining Project boundaries
Implements the root resolution algorithms from PROJECT_ROOT_SPEC.md and 02_DESIGN.md [H2]:
GitRootmode: Each git repository gets its own ProjectWorkspaceFoldermode: Each workspace folder is a ProjectWorkspaceRootmode: Single Project covering all folders
§Fallback Chain (gitRoot mode, per C1)
1. Walk ancestors of file looking for .git
2. IF .git found → use git root
3. ELSE IF workspace folders exist → use containing folder or first folder
4. ELSE (single-file mode) → use parent directoryFunctions§
- canonicalize_
and_ resolve - Canonicalize a path and resolve its index root.
- find_
git_ root - Find the git root for a file path by walking ancestors.
- resolve_
index_ root - Resolve the index root for a file path based on mode and workspace context.