fix(cli): generate a v2 markdown table and honors escaped pipes#100
fix(cli): generate a v2 markdown table and honors escaped pipes#100area73 wants to merge 1 commit into
Conversation
|
@nathanacurtis, I opened this PR to address the V2 markdown-table manifest issue. I used to work with OpenSpec for SDD, so I added the specs to give you more context on the behavior and requirements that were already in place. I can remove them if you feel they’re not needed. If you think the OpenSpec library could be useful, you’ll need to go through the installation steps separately. I didn’t include the commands or skills on .claude in order to keep this PR focused and clean. I hope this PR helps, and that you find it useful. Thanks for your work on this project. It’s really awesome. |
|
Thank you so much for this, @area73 — genuinely. You spotted a real, user-facing break in the We're going to land an intentionally minimal version in #104 (releasing as Closes #100 in favor of #104. Thank you again for taking the time to report and fix this. |
|
I'm glad I could help, thanks for the credits 🙌 |
Summary
specs scanwrites a v2 markdown-table manifest, butspecs generateonly detected the legacy v1 checkbox-list format (- [) and failed the documentedscan && generateround-trip withError: Unrecognized source format. This PR wires the existingManifestParserV2intoGenerateCommandand fixes a parser bug where escaped pipes (\|) emitted byScanCommand'sescapeCellwere not honored on the read side — the backslash was leaking literally into the parsed component name.Changes
GenerateCommand— detect v2 manifests viaManifestParserV2.isV2, v1 viaisV1Manifest, JSON unchanged. Parse dispatch now picks the right parser. Error message and exit code are preserved.ManifestParserV2— replaced the combinedROW_REGEXwith a recognition regex plus an escape-awaresplitRowwalker. PublicManifestResultV2shape is unchanged.Toggle \| On/Offparses toToggle | On/Off.generate-v2-manifest-support(proposal, design, tasks, spec delta) and addsopenspec/config.yaml.Why
The
scan && generateround-trip is part of the documented CLI workflow. Without v2 support ingenerate, any manifest produced by currentscanwas unusable downstream. The escaped-pipe fix ensures component names containing|survive the round-trip intact.Files touched
packages/cli/src/commands/GenerateCommand.tspackages/cli/src/utilities/ManifestParserV2.tspackages/cli/tests/unit/commands/GenerateCommand.test.tspackages/cli/tests/unit/utilities/ManifestParserV2.test.tsopenspec/config.yamlopenspec/changes/generate-v2-manifest-support/(proposal, design, tasks, spec delta)Test plan
npm test --workspace=packages/clipassesnpm run buildpassesspecs scan ...thenspecs generate ...against the produced v2 manifest succeedsToggle \| On/Off) round-trips toToggle | On/Off