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

Function is_approved

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

True iff a `status: approved` line exists in the YAML frontmatter. If frontmatter is missing or unparseable, fall back to anchoring against the whole file — still safer than a substring match because the regex requires the directive to be a line on its own.

(text: str)

Source from the content-addressed store, hash-verified

117
118
119def is_approved(text: str) -> bool:
120 """True iff a `status: approved` line exists in the YAML frontmatter.
121
122 If frontmatter is missing or unparseable, fall back to anchoring against
123 the whole file — still safer than a substring match because the regex
124 requires the directive to be a line on its own.
125 """
126 match = FRONTMATTER_RE.match(text)
127 haystack = match.group(1) if match else text
128 return bool(APPROVAL_RE.search(haystack))
129
130
131def block(reason: str) -> None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected