Skip to content

feat: Add spm validate command for manifest-against-HTML validation #2

Description

@watashi-00

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

  • spm validate runs without a browser
  • Reports selector match/miss for all reconstructs and components
  • Reports bind extraction results with values
  • Reports preserve slot resolution
  • --json flag for structured output
  • Exit code reflects pass/fail status

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestqa-toolingQA testing infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions