Skip to content

feat(cli): verfix show --dom — query the saved DOM snapshot - #79

Merged
jyotir-aditya merged 2 commits into
mainfrom
feat/show-dom
Jul 10, 2026
Merged

jyotir-aditya merged 2 commits into
mainfrom
feat/show-dom

Conversation

@jyotir-aditya

Copy link
Copy Markdown
Contributor

Closes #57.

Answers "what was actually in the failure-time DOM?" without grepping raw HTML:

  • verfix show <id> --dom '<css selector>' queries the run's saved snapshot and prints matches (tag, key attributes: id/class/role/data-testid/aria-*, truncated text, match count).
  • --dom with no selector prints a compact outline: landmarks, dialogs, headings.
  • Zero matches ⇒ dom_matches: [] in JSON / clear pretty message; missing snapshot ⇒ same artifact_not_found UX as --console; invalid selector ⇒ invalid_selector, exit 2.
  • Implementation: queryDomSnapshot() in cli/src/local-runner.ts using node-html-parser (new CLI dependency — deliberately small; no headless browser pulled into the CLI). Static-snapshot queries only; visibility/computed-style questions belong to failure-time facts (feat(workers): report cause-agnostic failure-time facts (page state, prior anomalies) in failure JSON #55).
  • Generated agent instructions and getting-started docs updated; run's detail_commands gains an additive dom entry.

Verified: typechecks clean, cli build + full test suite green (incl. local-run e2e), json-purity.sh green, manual e2e against the testbed covering match/outline/zero-match/invalid-selector/missing-snapshot paths.

Lets agents ask structural questions about a run's saved DOM snapshot
(tag, key attributes, truncated text, match count) via a CSS selector
instead of grepping raw HTML; omitting the selector prints a compact
outline of landmarks, dialogs, and headings. Uses node-html-parser
(new CLI dependency) rather than pulling a headless browser into the CLI.
@jyotir-aditya
jyotir-aditya merged commit b20e839 into main Jul 10, 2026
2 checks passed
@jyotir-aditya
jyotir-aditya deleted the feat/show-dom branch July 10, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): verfix show --dom <selector> — query the saved failure-time DOM snapshot

1 participant