You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 28aea2a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(doctor): a project without git is not a failed inspection (#602)
_worktree_locations() treated every failure mode of `git worktree list`
(no repository, git missing, timeout) as the same "inspection unavailable"
WARN. Cortex is an MCP server whose cwd is whatever project the host
opened; a project with no Git repository is ordinary, not a failure to
inspect, so every such session's preflight showed a WARN whose fix
command (`git worktree list --porcelain -z`) can never succeed there.
`run_with_hard_timeout` collapses every subprocess failure mode to
`None`, so the two cases can't be told apart after the call. A new
`_is_git_checkout()` stdlib probe runs first instead — the same upward
walk for a `.git` entry that Git itself performs to discover a
repository, no subprocess involved. No `.git` anywhere up the tree now
reports `ok True, detail "not a git checkout"`; a `.git` present but Git
missing from PATH or the listing timing out keeps the optional WARN.
Renamed test_not_a_git_checkout_warns to test_not_a_git_checkout_passes
(now asserts the ok True case) and added
test_git_unavailable_in_a_checkout_warns for the WARN case with a real
.git present. Updated the parametrised None case in
test_unavailable_or_empty_listing_contract, whose message no longer
claims "not a Git checkout" as a possible cause since that case now
short-circuits before the subprocess call. ADR-1079's Consequences
section records the distinction.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH
Copy file name to clipboardExpand all lines: docs/adr/ADR-1079-report-out-of-convention-git-worktrees-as-an-optional-doctor-warn.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,3 +31,5 @@ Positive: the owner sees worktrees outside both host directories via 'python -m
31
31
Git porcelain uses NUL record delimiters with `-z`; parsing those delimiters preserves literal newlines and trailing spaces in paths (git-worktree(1), Porcelain Format). A real-Git regression verifies that an outside worktree with both characters is reported by its exact path.
32
32
33
33
A failed Git invocation produces an optional WARN that lists the possible causes and provides the Git command to retry. The existing subprocess helper returns no failure category, so the diagnostic does not claim a specific cause. Successful empty output is reported as no registered worktrees.
34
+
35
+
Cortex is an MCP server whose working directory is whatever project the host opened, so a project with no Git repository is an ordinary condition, not a failure to inspect. The check tells the two cases apart with a stdlib walk from the cwd for a `.git` entry — the same discovery Git itself performs — before ever invoking `git worktree list`: no `.git` anywhere up the tree reports `ok True, detail "not a git checkout"`; a `.git` present but Git missing from PATH or the listing timing out keeps the optional WARN.
Copy file name to clipboardExpand all lines: wiki/adr/cortex/1079-report-out-of-convention-git-worktrees-as-an-optional-doctor-warn.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,3 +29,5 @@ Positive: the owner sees worktrees outside both host directories via 'python -m
29
29
Git porcelain uses NUL record delimiters with `-z`; parsing those delimiters preserves literal newlines and trailing spaces in paths (git-worktree(1), Porcelain Format). A real-Git regression verifies that an outside worktree with both characters is reported by its exact path.
30
30
31
31
A failed Git invocation produces an optional WARN that lists the possible causes and provides the Git command to retry. The existing subprocess helper returns no failure category, so the diagnostic does not claim a specific cause. Successful empty output is reported as no registered worktrees.
32
+
33
+
Cortex is an MCP server whose working directory is whatever project the host opened, so a project with no Git repository is an ordinary condition, not a failure to inspect. The check tells the two cases apart with a stdlib walk from the cwd for a `.git` entry — the same discovery Git itself performs — before ever invoking `git worktree list`: no `.git` anywhere up the tree reports `ok True, detail "not a git checkout"`; a `.git` present but Git missing from PATH or the listing timing out keeps the optional WARN.
0 commit comments