Summary
Implement a spm validate subcommand that validates a compiled manifest.json against an HTML page snapshot, reporting which selectors matched, which binds extracted data, and which preserve slots resolved.
Motivation
The QA test suite (spm-qa-test-suite) currently performs only static documentation audits. To enable real runtime QA, the CLI needs a command that validates selector matching and data extraction against real HTML without requiring a running browser.
Proposed Usage
spm validate manifest.json --against page-snapshot.html
Expected Output
- Selector match/miss for all reconstructs and components
- Bind extraction results with extracted values
- Preserve slot resolution status
- Structured JSON with --json flag
- Exit code: 0 if all pass, 1 if failures
Implementation Notes
- Use HTML parser (libxml2, Gumbo, or lexbor) to load HTML snapshot
- Apply CSS selector matching from manifest reconstructs and components
- Execute extractor pipes (text, attr, html, hiddenInputs) against matched elements
- Output structured JSON report alongside human-readable output
Acceptance Criteria
Summary
Implement a
spm validatesubcommand that validates a compiled manifest.json against an HTML page snapshot, reporting which selectors matched, which binds extracted data, and which preserve slots resolved.Motivation
The QA test suite (spm-qa-test-suite) currently performs only static documentation audits. To enable real runtime QA, the CLI needs a command that validates selector matching and data extraction against real HTML without requiring a running browser.
Proposed Usage
Expected Output
Implementation Notes
Acceptance Criteria