MCPcopy Index your code
hub / github.com/AutoForgeAI/autoforge / _resolve_path

Function _resolve_path

autoforge_paths.py:53–69  ·  view source on GitHub ↗

Resolve a file path using tri-path strategy. Checks the new ``.autoforge/`` location first, then the legacy ``.autocoder/`` location, then the root-level location. If none exist, returns the new location so that newly-created files land in ``.autoforge/``.

(project_dir: Path, filename: str)

Source from the content-addressed store, hash-verified

51# ---------------------------------------------------------------------------
52
53def _resolve_path(project_dir: Path, filename: str) -> Path:
54 """Resolve a file path using tri-path strategy.
55
56 Checks the new ``.autoforge/`` location first, then the legacy
57 ``.autocoder/`` location, then the root-level location. If none exist,
58 returns the new location so that newly-created files land in ``.autoforge/``.
59 """
60 new = project_dir / ".autoforge" / filename
61 if new.exists():
62 return new
63 legacy = project_dir / ".autocoder" / filename
64 if legacy.exists():
65 return legacy
66 old = project_dir / filename
67 if old.exists():
68 return old
69 return new # default for new projects
70
71
72def _resolve_dir(project_dir: Path, dirname: str) -> Path:

Callers 7

get_features_db_pathFunction · 0.85
get_assistant_db_pathFunction · 0.85
get_agent_lock_pathFunction · 0.85
get_devserver_lock_pathFunction · 0.85
get_claude_settings_pathFunction · 0.85
get_progress_cache_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected