planning-files parser strictness: multi-line YAML reqs/files lists and name-less phase headings are missed #48

Closed
opened 2026-07-23 14:50:28 +00:00 by crenshawdev · 0 comments
crenshawdev commented 2026-07-23 14:50:28 +00:00 (Migrated from github.com)

Severity: low · Area: planning-seam · surfaced in the post-v1.2.0 cross-model review sweep (bundled: two parser-strictness gaps in planning-files.mjs, both latent — they under-read valid markdown/YAML rather than crash).

1. Multi-line YAML requirements: / files: lists read as empty

cadence-core/bin/lib/planning-files.mjs:326 (parsePlanRequirements) and :345 (parsePlanFiles) match only an inline list: /^requirements:\s*\[(.*)\]/m and /^files:\s*\[(.*)\]/m. A plan written with a block YAML list —

requirements:
  - REQ-1
  - REQ-2

— has no [...] on the heading line, so the parser returns zero. The plan then contributes no requirement coverage (weakening audit) and no declared files (weakening the parallel-safety overlap check), silently.

2. A phase detail heading with no name is not cut

cadence-core/bin/lib/planning-files.mjs:403 (cutPhaseDetail): new RegExp('^### Phase ${n}: .*$', 'm') requires a space after the colon. A heading written exactly ### Phase 2: (colon, no trailing name) does not match, so on a renumber remove the section is left in the document instead of being cut.

Fix direction

Accept a block YAML list form in parsePlanRequirements/parsePlanFiles in addition to the inline [...] form; and relax the cutPhaseDetail heading match so a name-less ### Phase N: heading is still recognized.

**Severity:** low · **Area:** planning-seam · surfaced in the post-v1.2.0 cross-model review sweep (bundled: two parser-strictness gaps in `planning-files.mjs`, both latent — they under-read valid markdown/YAML rather than crash). ## 1. Multi-line YAML `requirements:` / `files:` lists read as empty `cadence-core/bin/lib/planning-files.mjs:326` (`parsePlanRequirements`) and `:345` (`parsePlanFiles`) match only an **inline** list: `/^requirements:\s*\[(.*)\]/m` and `/^files:\s*\[(.*)\]/m`. A plan written with a block YAML list — ```yaml requirements: - REQ-1 - REQ-2 ``` — has no `[...]` on the heading line, so the parser returns zero. The plan then contributes no requirement coverage (weakening `audit`) and no declared files (weakening the parallel-safety overlap check), silently. ## 2. A phase detail heading with no name is not cut `cadence-core/bin/lib/planning-files.mjs:403` (`cutPhaseDetail`): `new RegExp('^### Phase ${n}: .*$', 'm')` requires a space after the colon. A heading written exactly `### Phase 2:` (colon, no trailing name) does not match, so on a `renumber remove` the section is left in the document instead of being cut. ## Fix direction Accept a block YAML list form in `parsePlanRequirements`/`parsePlanFiles` in addition to the inline `[...]` form; and relax the `cutPhaseDetail` heading match so a name-less `### Phase N:` heading is still recognized.
Sign in to join this conversation.
No description provided.