Skip to content

Conformance

The spec ships with a language-agnostic conformance suite under conformance/. Every Sightmap SDK port is expected to pass it. The fixtures are the executable definition of “conforming” — when prose and the suite disagree, the suite wins until prose is updated.

Each fixture is a numbered directory with a simulated .sightmap/ and an expected.json of test cases. The current set covers the load-bearing behavior of stream 1:

#FixtureExercises
001minimalSmallest valid sightmap; basic match
002multi-file-mergeSame view name across two files emits a merge-collision-view warning
003route-precedenceFirst-match-wins on * vs ** vs literal
004param-normalizationExpress-style :param normalizes to *
005selector-arrayArray selectors try alternates in order
006view-scoped-vs-globalGlobals match everywhere; scoped only on their view
007request-method-filtermatch filters requests by HTTP method

Fixtures numbered 100+ exercise the formatter (fmt) — quoting, key order, list sorting, comment and header preservation, idempotence. Those are SDK-tooling concerns, not stream-1 semantics.

The runner asserts that every key in expected is present in the actual output and matches deeply. Extra keys are allowed, so the suite is forward-compatible with new optional output.

The reference runner ships in @sightmap/sightmap:

Terminal window
pnpm add -D @sightmap/sightmap
pnpm sightmap conformance ./path/to/spec/conformance

For a port in another language, implement a runner that loads each fixture’s sightmap/ directory, executes the listed command with args, and asserts the result matches expected. The shape of expected.json is documented in conformance/README.md.

  1. Create the next-numbered directory under conformance/.
  2. Author sightmap/*.yaml and expected.json.
  3. Run the conformance runner from any SDK to verify it passes.
  4. Open a PR against sightmap/spec.

Good fixture candidates: a behavior the spec mandates that no current fixture exercises, an edge case you hit while implementing an SDK, or a regression you want pinned.

The full field-by-field contract is in the Schema reference. The machine-readable version is sightmap.schema.json.