Skip to content

compiler: conformance cases for given-up guarantees (core#224) - #5

Merged
Kinflou merged 2 commits into
mainfrom
compiler-cases
Nov 11, 2026
Merged

Kinflou merged 2 commits into
mainfrom
compiler-cases

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 11, 2026

Copy link
Copy Markdown
Member

Starts the compiler conformance cases of ComlineProject/core#224: schema graphs as data, with the outcome any compiler must reproduce. This is the specification side; core's runner follows in a later PR, and its first run is the real check of the expectations here (outcomes are those of core at d1b678a).

Layout

  • compiler/cases/<group>.json: the cases, six groups, 42 cases. What a runner reads and a consumer vendors.
  • compiler/src/*.cue: where they are written. A package's files are multi-line strings, an expected outcome a struct; specs/check.sh generates the JSON, and CI fails when it is stale. (The vectors are JSON because a generator writes them; these are written by hand, and multi-line schema text in JSON is unreadable.)
  • specs/compiler.cue: #CompilerCases, closed: guarantee ids and acknowledgement scopes come from the catalog, diagnostic codes are a closed list with their severities, so a typo can't pass. specs/gen/compiler.schema.json is generated from it.
  • specs/compiler.jq: what the schema can't say: each protocol of the built package listed once, acknowledged guarantees are given up, reasons are written in the package, dependencies exist and have no cycle and are declared in config, a failing build says why.
  • compiler/readme.md: the format, how a compiler runs a case, the corpus, what is to come (inner scopes, strict, pinning to chains, fail closed), and how core vendors it (compiler/cases/*.json at a pinned rev, as for the size vectors).

Format notes

  • A case: id, description, packages (name, whole config.idp, schema files {path, text}, path dependencies), build, expect.
  • A passing build lists every protocol of the package built with its given_up set, optionally acknowledged (scope protocol or package, and the reason shown), and the warnings as {code, severity}.
  • A failing build lists the coded errors, and error_contains for a dependency that isn't accepted, which core reports without a code: provisional until those errors get codes.
  • Diagnostics are those of the built package's own schemas and config, matched as sets on code and severity.

No VERSION bump.

Schema graphs as data with the outcome a compiler must reproduce: the
guarantees each protocol gives up and who acknowledged them, and the
diagnostics a build reports. Written compactly in compiler/src, generated
into compiler/cases/*.json, held to specs/compiler.cue and specs/compiler.jq
by specs/check.sh.
@Kinflou
Kinflou marked this pull request as ready for review November 11, 2026 11:58
@Kinflou
Kinflou merged commit 0685006 into main Nov 11, 2026
2 checks passed
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