Walk up from `start` looking for `.specs/next.md`. Stops at the first `.git/` directory encountered (project ceiling) or at filesystem root. Returns the spec path or None.
(start: Path)
| 62 | |
| 63 | |
| 64 | def find_spec(start: Path) -> Path | None: |
| 65 | """Walk up from `start` looking for `.specs/next.md`. |
| 66 | |
| 67 | Stops at the first `.git/` directory encountered (project ceiling) or |
| 68 | at filesystem root. Returns the spec path or None. |
| 69 | """ |
| 70 | current = start.resolve() |
| 71 | while True: |
| 72 | spec = current / ".specs" / "next.md" |
| 73 | if spec.is_file(): |
| 74 | return spec |
| 75 | if (current / ".git").exists(): |
| 76 | return None |
| 77 | parent = current.parent |
| 78 | if parent == current: |
| 79 | return None |
| 80 | current = parent |
| 81 | |
| 82 | |
| 83 | def project_root_for(spec: Path) -> Path: |