From 2c2a8a7545518a1cdacc93476de4effdfe2c208e Mon Sep 17 00:00:00 2001 From: VDT-91 Date: Fri, 6 Feb 2026 10:14:18 +0100 Subject: [PATCH] fix: correct .auto-claude path mismatch causing discovery phase timeout (#1748) * fix: correct .auto-claude path mismatch causing discovery phase timeout The spec pipeline reads project_index.json from `auto-claude/` (no dot) but the orchestrator saves it to `.auto-claude/` (with dot). This mismatch means the cached index is never found, forcing discovery to re-run analyzer.py as a subprocess every time. On larger projects this subprocess hits the 300-second timeout, making spec creation fail at Phase 1. The mismatch was introduced in 757e5e04 (Dec 20 2025) when _ensure_fresh_project_index() was added with the correct `.auto-claude/` save path, but the existing read paths were never updated to match. Files fixed: - spec/discovery.py (primary fix - unblocks discovery phase) - spec/complexity.py (heuristic assessment fallback) - spec/pipeline/orchestrator.py (heuristic assessment in orchestrator) - spec/phases/utils.py (generic script runner) - spec/context.py (context discovery script path) Co-Authored-By: Claude Opus 4.6 * fix: remove duplicate .auto-claude segment in complexity.py path spec_dir.parent.parent already resolves to the .auto-claude directory, so adding another .auto-claude segment created a non-existent path: .auto-claude/.auto-claude/project_index.json Now correctly resolves to: .auto-claude/project_index.json Co-Authored-By: Claude Opus 4.5 --------- Co-authored-by: Claude Opus 4.6 Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com> --- apps/backend/spec/complexity.py | 2 +- apps/backend/spec/context.py | 2 +- apps/backend/spec/discovery.py | 2 +- apps/backend/spec/phases/utils.py | 2 +- apps/backend/spec/pipeline/orchestrator.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/backend/spec/complexity.py b/apps/backend/spec/complexity.py index 9a1770a0..6d4e8282 100644 --- a/apps/backend/spec/complexity.py +++ b/apps/backend/spec/complexity.py @@ -382,7 +382,7 @@ async def run_ai_complexity_assessment( context += f"\n**Task Description**: {task_description or 'Not provided'}\n" # Add project index if available - auto_build_index = spec_dir.parent.parent / "auto-claude" / "project_index.json" + auto_build_index = spec_dir.parent.parent / "project_index.json" if auto_build_index.exists(): context += f"\n**Project Index**: Available at {auto_build_index}\n" diff --git a/apps/backend/spec/context.py b/apps/backend/spec/context.py index 61771999..4d06d0a4 100644 --- a/apps/backend/spec/context.py +++ b/apps/backend/spec/context.py @@ -34,7 +34,7 @@ def run_context_discovery( if context_file.exists(): return True, "context.json already exists" - script_path = project_dir / "auto-claude" / "context.py" + script_path = project_dir / ".auto-claude" / "context.py" if not script_path.exists(): return False, f"Script not found: {script_path}" diff --git a/apps/backend/spec/discovery.py b/apps/backend/spec/discovery.py index e2254eb0..159ac477 100644 --- a/apps/backend/spec/discovery.py +++ b/apps/backend/spec/discovery.py @@ -24,7 +24,7 @@ def run_discovery_script( (success, output_message) """ spec_index = spec_dir / "project_index.json" - auto_build_index = project_dir / "auto-claude" / "project_index.json" + auto_build_index = project_dir / ".auto-claude" / "project_index.json" # Check if project_index already exists if auto_build_index.exists() and not spec_index.exists(): diff --git a/apps/backend/spec/phases/utils.py b/apps/backend/spec/phases/utils.py index 704b6bee..b9306fcf 100644 --- a/apps/backend/spec/phases/utils.py +++ b/apps/backend/spec/phases/utils.py @@ -22,7 +22,7 @@ def run_script(project_dir: Path, script: str, args: list[str]) -> tuple[bool, s Returns: Tuple of (success: bool, output: str) """ - script_path = project_dir / "auto-claude" / script + script_path = project_dir / ".auto-claude" / script if not script_path.exists(): return False, f"Script not found: {script_path}" diff --git a/apps/backend/spec/pipeline/orchestrator.py b/apps/backend/spec/pipeline/orchestrator.py index 0654a7fd..5f3ba923 100644 --- a/apps/backend/spec/pipeline/orchestrator.py +++ b/apps/backend/spec/pipeline/orchestrator.py @@ -603,7 +603,7 @@ class SpecOrchestrator: The complexity assessment """ project_index = {} - auto_build_index = self.project_dir / "auto-claude" / "project_index.json" + auto_build_index = self.project_dir / ".auto-claude" / "project_index.json" if auto_build_index.exists(): with open(auto_build_index, encoding="utf-8") as f: project_index = json.load(f)