Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

Development strategy: schema identity, spec versioning, conformance suite, and communication #1

Open

Description

@kinlane

This is a proposal, not a decision. Nothing here is implemented. I am posting it before doing any of it, because a specification whose process happens in private is just documentation with extra steps.

The CLI side of this has a companion issue: api-commons/spotlight-tools#1. That one is about how you switch tools. This one is about the thing that is supposed to outlive tools.

A specification has a different adoption problem than a CLI. Nobody "installs" a spec. What they do is point at it — a $ref in CI, a URL in a procurement document, a citation in a national standard. Which means the promises that matter here are about stability of identity and never breaking a document that used to validate. Everything below follows from that.


0. The urgent one: the $id is wrong

The schema currently declares:

"$id": "https://raw.githubusercontent.com/api-commons/spotlight-spec/main/schema/v1/spectral-ruleset.schema.json"

That is a source-control URL wearing a specification's identity, and it has three problems:

  1. It points at main. The identity of v1 is mutable by definition — anyone who $refs it gets whatever landed most recently. A schema identity that changes when a branch moves is not an identity.
  2. It is a hosting accident. raw.githubusercontent.com is not a namespace this project controls, is not content-negotiable, has its own rate limits, and could change its URL shape without asking anyone.
  3. It is not the identity anyone should cite. The Dutch government's design rules cite Spectral in normative text. If this format ends up cited that way, the citation must not contain someone else's CDN hostname.

And $id changes are breaking for every downstream $ref. This has to be settled before adoption, not after. It is the single most time-sensitive item in this issue.

Proposal: a stable, versioned, project-controlled URI, served over HTTPS with a permanent redirect from the old one:

https://spotlight-rules.com/schema/v1/spectral-ruleset.schema.json
  • Decide the canonical hostname and commit to it. If the project is renamed later, that URI keeps resolving forever — a spec URI is a promise, and a 404 on a cited schema identity is unrecoverable.
  • The $id points at an immutable, published version — never at a branch.
  • Serve with correct Content-Type: application/schema+json, CORS enabled (browser tooling needs it), and long cache headers.

I have used spotlight-rules.com above because it exists and I control it. It is also the working codename, which makes it a slightly uncomfortable choice for a permanent identity. This is a genuine open question and I would rather be argued out of it now than after people are citing it.


1. Versioning the specification

The README says v1 is additive-only, and that anything which would reject a previously-valid ruleset gets a new directory and a new $id. That is the right rule. What is missing is the vocabulary and the relationship to the tool.

Two version lines that must not be conflated:

  • The specification version (v1) — what a valid ruleset is.
  • The CLI version (6.17.0, per the companion issue) — what one implementation does.

These deliberately do not track each other, and every previous attempt to describe this format has failed exactly here, by letting the tool's version stand in for the format's. A ruleset author cares about the first. A pipeline maintainer cares about both.

  • Publish a compatibility matrix — spec version × implementation × version — as a maintained page, not a paragraph. This is also where vacuum and any other engine appear, which is the point.

Proposal for what the version numbers mean:

Change Result
New optional property, new registered format identifier, clarified prose Additive within v1. New dated revision, same $id line, changelog entry
Anything that would reject a previously valid ruleset New major (v2), new directory, new $id. v1 keeps resolving forever
Fixing a place where the schema was wrong about what the reference implementation accepts Treated as additive if it widens, breaking if it narrows — and narrowing needs an explicit deprecation period

That last row will come up more than anyone expects. This schema was reverse-engineered from a reference implementation's internal meta-schemas; where the spec and the implementation disagree, the implementation is currently right by definition, and the spec has to be corrected. Each of those is worth documenting publicly as a finding, because it is exactly the undocumented behavior that makes multi-engine compatibility unadjudicable today.

  • Dated revisions within v1 (v1/2026-07-30/) alongside the stable v1/ alias, so people can pin if they want to and most people never think about it.
  • A CHANGELOG.md for the specification, in prose, written for ruleset authors rather than committers.

2. The conformance suite

The plan page already calls this a first-class deliverable. It is the highest-leverage thing in this repository, and it belongs here rather than in the CLI — because the moment it lives in the CLI, it measures the CLI instead of defining the format.

Every party who has attempted Spectral compatibility reports the same thing: happy paths pass everywhere, and production rulesets are where implementations diverge. Right now no compatibility claim between any two engines can be adjudicated, because there is nothing to adjudicate against. That is not a gap in one tool, it is a gap in the ecosystem.

Proposal:

  • A machine-readable suite in this repository: input document + ruleset + expected diagnostics, as data rather than as JavaScript tests, so a Go or Rust or Python implementation can consume it without reimplementing a test harness.
  • Split into MUST (a conforming implementation passes all of it) and SHOULD (documented divergence is acceptable if declared).
  • Cases are contributed by users from real rulesets, not written by me from the spec. A suite written by the spec author tests the spec author's assumptions.
  • A published results table — every implementation, every version, pass rate, and which cases fail. Including this project's own CLI, especially when it fails.
  • The suite gates releases in spotlight-tools as a required check.

This is explicitly a gift to other implementations, not a weapon. vacuum is a supported and valued implementation; when Dave rewrote the engine in Go he deliberately refused to fork the format, and he was right. A conformance suite is what lets several engines coexist honestly instead of drifting apart quietly and arguing about it in three years. If it makes this project's own CLI look bad in public, it is working.

  • Invite every known implementer to contribute cases before publishing any results table. Nobody should first encounter their own failing scores in a blog post.

3. How people consume the schema

Pointing at a URL is one mode. There are three others that matter, and none of them exist yet.

  • npm: @apicommons/spectral-ruleset-schema — a tiny package containing just the schema, no dependencies. This is how CI pipelines pin it, and how the CLI can depend on the spec rather than embedding its own copy.
  • SchemaStore: register .spectral.yaml / .spectral.json / .spectral.yml so that every VS Code and JetBrains user gets ruleset validation and autocomplete without installing anything. This is the single largest developer-experience win available in this repository, it costs one upstream pull request, and it also quietly makes this schema the de-facto definition of the format.
  • Documented CI recipe — the README already shows ajv-cli --spec=draft2020, which is right. It should also cover a pinned-version invocation and a pre-commit hook.

A note on why the schema is worth consuming at all, which should be in the README more plainly than it is: it is one self-contained JSON Schema 2020-12 document, replacing five internal draft-07 meta-schemas that were coupled to a linter's runtime. It validates in any conforming 2020-12 validator with no bespoke tooling. That is the whole difference between a format you can describe and one you have to reverse-engineer from someone's node_modules.


4. Branching and releases

A spec repository should be boring. Proposal:

  • main only. Protected, no develop, every change a reviewed PR. There is no reason a specification needs an integration branch.

  • Releases are git tags plus a published directory, not npm-driven. spec/v1-2026-07-30.

  • schema/v1/ is never edited in place after a revision is published. New revision directory, alias updated, old one immutable forever.

  • Every schema change ships with: conformance cases proving it, a changelog entry in prose, and a note on which implementations already behave that way.

  • A CI check that fails if schema/v1/ changes without a corresponding conformance case and changelog entry. Process enforced by machine beats process enforced by discipline.

  • A CI check validating the schema against the 2020-12 metaschema and against the corpus of real-world published rulesets it claims to accept, on every PR.


5. README and documents

The README is currently strong on argument and thin on process. What it needs:

  • The stable $id, prominently, with copy-pasteable $ref and CI snippets — the first thing a visitor needs
  • The versioning policy from §1, in the README rather than only in a provenance note
  • IMPLEMENTATIONS.md — every known implementation, its conformance results, and how to get listed. Being generous here is the whole strategy: a spec with one implementation is a config format
  • IMPLEMENTING.md — how to build an engine for this format, written for somebody who is not going to read the reference implementation's source
  • CONTRIBUTING.md — how to propose a format change, and the standard of evidence for one (real rulesets, not hypotheticals)
  • GOVERNANCE.md — honest interim version: one maintainer, here is the escalation path, here is what would change it
  • SECURITY.md — a schema can carry vulnerabilities too, mostly ReDoS in pattern constraints
  • A stability disclaimer that is accurate. The README says "Status: draft." If the $id is going to be stable and citable, "draft" is doing two contradictory jobs and needs splitting: the document is a draft, the v1 schema identity is not going to move

6. Communication

The specification has a different audience than the CLI, and I have been under-serving it. A CLI has users. A specification has implementers, citers, and authors, and each needs something different:

Audience What they need
Ruleset authors The schema URL, editor validation, a changelog in prose
Implementers (vacuum, and whoever is next) The conformance suite, IMPLEMENTING.md, advance notice of every change
Citers (governments, standards bodies, procurement) A stable URI, a real versioning policy, a governance answer, and a stability commitment they can put in a document

That third row is the one that is easiest to forget and hardest to recover. If a national standard cites this format, the maintainer has taken on an obligation that outlasts their interest in the project — and the honest way to carry that is a published stability policy and a written escalation path, not good intentions.

  • Every proposed format change gets a public comment window before it lands, with implementers notified directly. No format change ever surprises an implementer — that is the single rule that separates a specification from a config file.
  • Spec changes announced in the discussion, on the spotlight-rules.com blog with RSS, and in the changelog.
  • A short document stating what the spec will never do: never invalidate a previously valid ruleset within a major line, never move a published $id, never unpublish a version, never add a dependency on any single implementation.

What I want from you

  1. The $id hostname. Most urgent, most breaking, and I am least confident about it. spotlight-rules.com is a working codename — is that acceptable as a permanent identity, or does this need a neutral home first?
  2. Do you $ref this schema anywhere already? If so I need to know before changing the $id, and you should be in IMPLEMENTATIONS.md.
  3. Conformance cases. If you have a ruleset that broke a tool, that is the most valuable contribution available to this repository. Gnarly and production-real beats minimal and clean.
  4. Where the schema is wrong. It was derived from a reference implementation's internals. If it rejects a ruleset that actually works, that is a bug here and I want the file.
  5. Implementers: what would you need in order to run against a conformance suite and have the results published?

If you depend on this format, say so in the discussion. A visible list of dependents is what turns a fork into a standard.

Activity

  1. pinned this issue on Jul 30, 2026
  2. kinlane commented on Jul 30, 2026

    @kinlane
    ContributorAuthor

    Rename, for anyone who read this before now. The repositories have been renamed:

    Was Is
    api-commons/spectral-rules api-commons/spotlight-spec
    api-commons/spectral-cli api-commons/spotlight-tools

    GitHub redirects the old URLs, including raw.githubusercontent.com paths, so nothing you have already bookmarked or $ref'd is broken. The issue body above has been updated in place.

    This was originally listed as an open community question, on the reasoning that keeping the upstream name would make the lineage obvious. I changed my mind within a day. Asking people to adopt a new package scope, a new issue tracker, and a new schema identity under somebody else's name builds a mess into the foundation, and trademark made a rename inevitable regardless. Doing it now costs a few links. Doing it after adoption costs everybody's CI.

    Two things this does not change, both deliberate:

    • The spectral binary name stays. Thousands of CI files contain spectral lint. That is the single most disruptive thing this project could rename for the least benefit.
    • The ruleset format is still the Spectral ruleset format. Spotlight is the name of this effort and its repositories, not a new format. Your rulesets are Spectral rulesets and the spec describes them that way throughout.

    What is genuinely still open is whether the npm packages should be @apicommons/spectral-* (drop-in legibility) or @apicommons/spotlight-* (honest about what you installed). That is question 1 in the body, and it is the naming decision that is actually expensive to reverse — the repositories were cheap.

  3. kinlane commented on Jul 30, 2026

    @kinlane
    ContributorAuthor

    Done. The schema's $id is now the canonical, project-controlled URI:

    https://spec.spotlight-rules.com/schema/v1/spectral-ruleset.schema.json
    

    It previously declared a raw.githubusercontent.com URL pointing at main — mutable by definition, on a hostname this project does not control, and not something anyone should cite in a national standard.

    Nothing is broken by this. The old GitHub URL still serves identical bytes, so anything that already referenced it keeps resolving. It is simply no longer the identity.

    Doing it now was the whole point. Changing an $id is breaking for every downstream $ref; on day three that costs a few links, and after adoption it costs everyone's pipeline. This is the cheap moment, and it will not come again.

    Verification: the schema still validates against the 2020-12 metaschema, every $ref in it is local (#/$defs/...) so none were affected by the identity change, and the file served at the canonical URI is byte-identical to the one in the repository.

    Remaining, and deliberately not done: the schema is served over Cloudflare rather than directly from GitHub Pages, so Content-Type and cache headers come from that layer. Worth a look when someone is doing the hosting properly — the correct type for a schema document is application/schema+json, and it is currently application/json.

  4. added
    roadmap
    maturity:discussing
    on Jul 31, 2026
  5. unpinned this issue on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maturity:discussingroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions