parseRequirements: colon-aligned separators and unbounded Traceability section create phantom requirements (false /cad-audit FAIL) #41
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence#41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: medium · Area: audit · surfaced in the post-v1.2.0 cross-model review sweep. Two independent trip-wires in one parser; the colon case was reproduced with a fixture.
parseRequirements(cadence-core/bin/lib/planning-files.mjs:82-95) feeds/cad-audit, the pre-ship traceability gate. Two soft spots each mint a phantom requirement row, which surfaces as a broken/no-phase requirement and flips the audit to a false FAIL on an otherwise clean project.1. Colon-aligned table separators are not skipped
planning-files.mjs:90:if (!id || id === 'Requirement' || /^-+$/.test(id)) continue;The separator-row skip matches only all-dash cells. Markdown alignment separators contain colons (
|:------------|:-----:|-------:|), so the first cell:------------fails/^-+$/and is not skipped — it becomes a requirement literally named:------------with no phase. The shipped template uses plain dashes, but any hand-edit or regeneration of the table can introduce alignment colons, after which the ship gate fails for no real reason.2. The Traceability section is unbounded
planning-files.mjs:83:const section = text.split(/^## Traceability\s*$/m)[1];This captures everything after the
## Traceabilityheading to end-of-file, with no stop at the next##heading. Today Traceability is the last section, so it is latent — but the moment any table-bearing section is added after it, those rows parse as requirements too.Fix direction
-,:, and spaces as a separator).## Traceabilityup to the next^##.One fix pass hardens both; both protect the same gate (
/cad-audit).