Skip to content

Commit 135c6ae

Browse files
Alan-JowettAlan JowettCopilot
authored
Fix investigate-security protocol mismatch breaking CI (#246)
* Fix investigate-security protocol mismatch breaking CI Remove inline YAML comment from investigate-security.md frontmatter that the lightweight YAML parsers were not stripping, causing 'exhaustive-path-tracing' to be parsed as 'exhaustive-path-tracing # optional — apply selectively to parser/decoder functions'. Also harden both validate-manifest.py and validate-graph-integrity.py to strip inline YAML comments from list items, preventing similar issues in the future. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use re.split for YAML comment stripping to preserve # in values Address PR review feedback: replace regex that treats any # as a comment delimiter with re.split(r'\s+#', ...) which only strips # when preceded by whitespace, matching YAML comment semantics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Alan Jowett <alan.jowett@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 28a2f97 commit 135c6ae

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

templates/investigate-security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protocols:
1414
- guardrails/operational-constraints
1515
- guardrails/adversarial-falsification
1616
- analysis/security-vulnerability
17-
- reasoning/exhaustive-path-tracing # optional — apply selectively to parser/decoder functions
17+
- reasoning/exhaustive-path-tracing
1818
taxonomies:
1919
- stack-lifetime-hazards
2020
format: investigation-report

tests/validate-graph-integrity.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ def _parse_template_frontmatter(text: str) -> dict[str, object] | None:
7878
if indent > 0:
7979
# Still collect multi-line list items at indent 2
8080
if current_list_field and stripped.startswith("- "):
81-
result[current_list_field].append(
82-
stripped[2:].strip().strip("'\"")
83-
)
81+
val = stripped[2:].strip().strip("'\"")
82+
# Strip inline YAML comments only when `#` follows whitespace
83+
val = re.split(r"\s+#", val, maxsplit=1)[0].strip().strip("'\"")
84+
result[current_list_field].append(val)
8485
elif stripped and current_list_field and not stripped.startswith("#"):
8586
current_list_field = None
8687
continue

tests/validate-manifest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ def parse_yaml_frontmatter(text: str) -> dict[str, object] | None:
4747
continue
4848
if in_protocols:
4949
if stripped.startswith("- "):
50-
protocols.append(stripped[2:].strip().strip("'\""))
50+
val = stripped[2:].strip().strip("'\"")
51+
# Strip inline YAML comments only when '#' is preceded by whitespace.
52+
val = re.split(r"\s+#", val, maxsplit=1)[0].strip().strip("'\"")
53+
protocols.append(val)
5154
else:
5255
in_protocols = False
5356
return {"protocols": protocols}

0 commit comments

Comments
 (0)