Skip to content

Push ontology-derived rules into the C++ checker's IScenarioChecker slots #182

Description

@jdsika

Phase 3.4 of docs/openscenario-api-coverage.md, split out of #174 because that issue sequences it last and it needs its own WASM artifact bump (#180 spent one).

Why now

Everything it depends on is in place:

What

IScenarioChecker exposes 295 Add*CheckerRule slots — upstream's documented extension point ("write your own checker rules for your company's authoring guidelines"). Rules derived from the ontology (the SHACL shapes in artifacts/openscenario/) belong there: they would then run inside the same CheckScenarioInFileContext pass as the generated range/union/version rules, on the parsed model, instead of only over the IR before serialization.

Sketch:

  • A small C++ rule class that evaluates a table of constraints handed to it from TypeScript at load time, so adding a rule does not mean rebuilding the WASM artifact. The alternative — one generated C++ class per SHACL constraint — makes every ontology change an artifact bump and is the wrong trade.
  • The constraint table is derived from SHACL at runtime (sh:minInclusive/sh:maxInclusive/sh:in on the derived shapes), not transcribed. This is the budget-sensitive part: it must stay discovery-driven, with no ontology-specific literals in the C++ or in the bridge.
  • Findings come back as diagnostics carrying this repo's own rule UIDs, which the .xqar export already knows how to render.

Tests (criterion #30)

An ontology constraint that the generated range rules do not cover must produce an error from validate() on a document that violates it, and no diagnostic on one that does not — with the constraint added to the SHACL only, never to the C++.

Note

One artifact rebuild, batched with whatever else lands at the same time. packages/authoring-wasm/native/BUILD.md has the recipe; the pinned Emscripten SDK is in versions.json.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions