Skip to content

docs + fixture suite + grammar reference (Phase 9)#9

Merged
zrosenbauer merged 1 commit into
mainfrom
phase-9-docs-fixtures
May 15, 2026
Merged

docs + fixture suite + grammar reference (Phase 9)#9
zrosenbauer merged 1 commit into
mainfrom
phase-9-docs-fixtures

Conversation

@zrosenbauer
Copy link
Copy Markdown
Member

Summary

Closes out the work plan. Version stays at 0.0.0 — final review + tag are yours.

What's in this PR

Documentation

  • README rewritten around the locked 0.1.0 API. Rust + TS quickstart, install instructions, selector cheat sheet, use cases.
  • docs/ARCHITECTURE.md — tokenizer state machine, parser stack, mutation strategy (string-splicing rather than AST rewrite), two-track API split between Rust and Node, test layering.
  • docs/SELECTOR-GRAMMAR.md — formal grammar (BNF), examples for every form including tag-less attribute selectors, list of what's deliberately not supported in 0.1.0 (sibling combinators, :has(), case-insensitive flags).

Fixture-based integration suite (you explicitly asked for this)

  • 38 fixture files under crates/marxml/tests/fixtures/, across six categories:
    • parse/ (20 files) — clean inputs covering every parse path
    • parse_fail/ (9 files) — inputs that must return Err, snapshotted error messages
    • select/ (5 files) — each runs through a 9-selector probe set
    • mutate/ (4 files) — each exercises update / replaceContent / replaceIn
    • serialize/ (4 files) — each emits to_xml (default + pretty) and to_json
    • validate/ (4 files) — each runs against a hard-coded gg-style schema
  • tests/fixture_suite.rs walks each dir with insta::glob! and produces 46 reviewable .snap files, all checked in.

Tests at the end of Phase 9

Layer Count
Rust unit + integration + rstest 132
Rust property 3
Rust fixture-suite wrappers 6 (driving 46 snapshots)
Rust doc-tests 3
Node binding (vitest against built .node) 23
Total assertions ~210

Coverage held at 100% (source-line level) across the workspace.

What still happens before publishing 0.1.0 — for your final review

  1. Bump Cargo.toml workspace version + bindings/node/package.json version from 0.0.00.1.0.
  2. Add a ## [0.1.0] — 2026-MM-DD heading to CHANGELOG.md over the [Unreleased] block.
  3. Add the required CI secrets in repo settings:
    • NPM_TOKEN (npm publish)
    • CARGO_REGISTRY_TOKEN (crates.io publish)
    • CODSPEED_TOKEN + CODSPEED_ENABLED=true variable (optional, for bench tracking)
    • CODECOV_TOKEN (already wired, optional)
  4. git tag v0.1.0 && git push --tags. That fires .github/workflows/release.yml:
    • version-sync gate
    • cross-compile matrix (6 targets)
    • publish to npm (per-platform + main, with provenance) and crates.io

Anything off here, push back before merging.

Closes out the 0.1.0 work plan. Version stays at 0.0.0 — the user does
final review and tags.

Docs:
- README rewritten around the locked 0.1.0 surface. Rust + TS
  quickstart, selector cheat sheet, install/use-cases/layout sections.
- docs/ARCHITECTURE.md — tokenizer state machine, parser stack,
  mutation strategy (string-splicing not AST rewrite), two-track API.
- docs/SELECTOR-GRAMMAR.md — formal grammar, examples for every form,
  unsupported list (sibling combinators, :has, etc).

Fixture suite (the user explicitly asked for this):
- 38 fixture files across six dirs under tests/fixtures/:
  parse, parse_fail, select, mutate, serialize, validate.
- tests/fixture_suite.rs walks each dir with insta::glob! and produces
  46 reviewable .snap files. Adds 6 wrapper test functions to the
  cargo test report.
- Snapshots checked in. Regenerate via `INSTA_UPDATE=always cargo test`.

Tests at this point:
- 166 Rust tests (unit + integration + proptest + 6 fixture-suite
  wrappers backed by 46 globbed snapshots)
- 23 vitest tests against the built binding
- 0 line uncovered on the workspace (modulo regions in selector parser
  that are sub-line region accounting, not actual uncovered source)
@zrosenbauer zrosenbauer merged commit a672c7c into main May 15, 2026
9 checks passed
@zrosenbauer zrosenbauer deleted the phase-9-docs-fixtures branch May 15, 2026 01:50
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.

1 participant