Description
The read-only spec scans in src/automator/devcontract.py match AUTO_RUN_HEADING_RE against raw markdown text, with no awareness of fenced code blocks:
find_result_artifact qualifies any spec-*.md (mtime >= launch) whose body contains ## Auto Run Result at column 0 — including a heading quoted inside a ``` fence (e.g. a spec whose frozen intent shows an example of the terminal section). Such a spec is treated as this session's terminal result artifact the moment the agent saves it.
parse_auto_run_result's detail boundary (^##\s+) can likewise stop at a fenced ## line (a quoted shell comment or log excerpt inside the section), truncating the parsed detail.
The strip helper introduced by the fix for #48 (strip_auto_run_result) IS fence-aware, because deletion is destructive — so the read-only scans now diverge from it by design. Surfaced during that fix's adversarial review; pre-existing behavior, not introduced by #48.
Steps to reproduce
- Create a spec in
implementation_artifacts whose body contains a fenced example:
```md
## Auto Run Result
Status: done
```
- Start a dev session; let the agent save any edit to that spec (mtime >= launch floor).
- On the session's Stop event,
find_result_artifact returns this spec and synthesize_result treats the fenced example as the live outcome.
Expected behavior
Headings inside fenced code blocks are documentation, not structure: neither scan should treat them as a real ## Auto Run Result section or boundary.
Actual behavior
A fence-quoted heading qualifies the spec as a terminal artifact, and a fenced ## line can truncate the parsed detail.
Proposed resolution
Factor the fence guard used by strip_auto_run_result (odd count of ^```/^~~~ openers before the offset) into both readers: filter AUTO_RUN_HEADING_RE matches and the detail boundary through it. Add a fenced-heading fixture to the find/parse tests.
Severity: low — the generic skill's spec template never emits such a fence, so the trigger is exotic (hand-written or meta specs that document the contract itself).
Which area is this for?
CLI adapters & profiles
bmad-auto Version
0.7.12
Description
The read-only spec scans in
src/automator/devcontract.pymatchAUTO_RUN_HEADING_REagainst raw markdown text, with no awareness of fenced code blocks:find_result_artifactqualifies anyspec-*.md(mtime >= launch) whose body contains## Auto Run Resultat column 0 — including a heading quoted inside a ``` fence (e.g. a spec whose frozen intent shows an example of the terminal section). Such a spec is treated as this session's terminal result artifact the moment the agent saves it.parse_auto_run_result's detail boundary (^##\s+) can likewise stop at a fenced##line (a quoted shell comment or log excerpt inside the section), truncating the parsed detail.The strip helper introduced by the fix for #48 (
strip_auto_run_result) IS fence-aware, because deletion is destructive — so the read-only scans now diverge from it by design. Surfaced during that fix's adversarial review; pre-existing behavior, not introduced by #48.Steps to reproduce
implementation_artifactswhose body contains a fenced example:find_result_artifactreturns this spec andsynthesize_resulttreats the fenced example as the live outcome.Expected behavior
Headings inside fenced code blocks are documentation, not structure: neither scan should treat them as a real
## Auto Run Resultsection or boundary.Actual behavior
A fence-quoted heading qualifies the spec as a terminal artifact, and a fenced
##line can truncate the parsed detail.Proposed resolution
Factor the fence guard used by
strip_auto_run_result(odd count of^```/^~~~openers before the offset) into both readers: filterAUTO_RUN_HEADING_REmatches and the detail boundary through it. Add a fenced-heading fixture to the find/parse tests.Severity: low — the generic skill's spec template never emits such a fence, so the trigger is exotic (hand-written or meta specs that document the contract itself).
Which area is this for?
CLI adapters & profiles
bmad-auto Version
0.7.12