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)
| 51 | # --------------------------------------------------------------------------- |
| 52 | |
| 53 | def _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 | |
| 72 | def _resolve_dir(project_dir: Path, dirname: str) -> Path: |
no outgoing calls
no test coverage detected