MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / find_spec

Function find_spec

tools/spec-loop/hooks/solo_spec_gate.py:64–80  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

62
63
64def 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
83def project_root_for(spec: Path) -> Path:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected