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.

Ruleset modularity: one family of rulesets, many environments, standards and versions #41

Open

Description

@kinlane

Three people described the same missing feature on the 28 August office hours (#40), from two different directions, and neither of them was asking for a tool — both were asking for modularity in the ruleset format itself.

What was said

A consultant, from a live customer engagement:

Right now I'm with a customer that has around 160 custom rules, which is already a lot. So it sometimes gets difficult to handle so many rules… They need different rulesets for different environments. They need something different in prod, in staging, in the IDE — and then there's a pipeline that does several things, all the API operations aspects and so on. Right now, usually you have one ruleset. But people need more than one. And that's very difficult right now to really handle: either you duplicate the rules, or you try to import them, but then it gets pretty messy.

A public-sector platform team, immediately after:

We have exactly the same challenge. We have different standards, different versions of standards — and for every version of every standard, we have different rulesets. We have now created an additional layer on top of Spectral to coordinate this all. But it would be even better if the ruleset specification already provides some sort of modularity in rulesets to manage this.

Why this is its own issue

Two things in there are worth separating from #30.

1. It is the specification that is missing something, not the tooling. #30 covers how rulesets are named, found and composed — the referencing mechanics. This is a level above: how a family of related rulesets is expressed as one thing with variants, so that the same rule does not have to exist in four files.

2. Someone has already built the missing layer privately. That is the exact pattern that produced this fork: a capable user hits a hole in the format, builds a private layer over it, and the format never learns. Every organisation running this at scale is currently writing the same coordination layer, and none of those layers interoperate. The private layer is the evidence, not an anecdote.

The two axes people are actually asking for

They are not the same axis, and a design that only handles one will not land.

Axis Example What varies
Environment / stage IDE, pre-commit, CI gate, staging, production Usually the severity and the subset: the same rule is a hint in the editor and an error in the gate. Rules are largely shared; enforcement is not.
Standard and version OAS 3.0 vs 3.1; FHIR R4 vs R5; a house standard v2 vs v3 Usually which rules apply at all, plus per-version given expressions. This is where aliases (#20) do real work, since aliases are already registered per format version.

Questions this needs to answer

  1. Is a variant a first-class construct in the ruleset document (profiles, layers, overlays) or is it composition of separate documents that the format only has to make possible?
  2. Can a variant change severity only, or also add and remove rules and change given? The IDE-vs-gate case is mostly severity; the standard-version case is not.
  3. How does this interact with extends — today the only composition primitive, and the one that already leaks (aliases stop working when you extend, see Elevate aliases out of the core ruleset into their own namespace, and get rules off JSONPath #20).
  4. How does it interact with the industry layer model in Where do industry rulesets sit in the layer model? #21? An organisation extending a FHIR ruleset and then varying it per environment is stacking two different kinds of modularity, and the model has to say how they compose.
  5. Does selecting a variant belong in the document, the invocation, or the environment? A CI gate that has to pass --profile production is a different design from a ruleset that knows what a production run is.
  6. What does a conformance suite (Build the conformance suite — and no blessed implementation #9) assert about variant resolution? Two implementations that resolve profiles differently are worse than no profiles at all.

Prior art worth reading before designing anything

What would settle it

Two ruleset families, written out longhand, from the people who actually have them: the ~160-rule customer set with its IDE/pipeline/staging/prod variants, and the multi-standard multi-version set with its coordination layer. Sanitised is fine. Design against real ones or this gets a mechanism nobody's real case fits.

Related: #30 (referencing and composition) · #21 (industry layers) · #20 (aliases, including per-format-version registration) · #9 (whatever this becomes has to be conformance-testable).

Raised in the office hours of 28 August 2026 — notes in #40.

Activity

  1. added
    enhancement
    roadmap
    maturity:raised
    on Aug 28, 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

    enhancementmaturity:raisedroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions