Skip to content

conformance: the runner as a library, and the corpus as a versioned spec - #69

Merged
Kinflou merged 1 commit into
mainfrom
conformance/runner-library
Oct 31, 2026
Merged

Kinflou merged 1 commit into
mainfrom
conformance/runner-library

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 31, 2026

Copy link
Copy Markdown
Member

Refs ComlineProject/cli#106 (step B5): comline conformance --impl <cmd> depends on this crate by git rev.

The library (comline_runtime_conformance::runner):

  • load_corpus(dir) (vectors/*.json, profiles/*.json), load_vectors(path), load_profile(path);
  • Corpus::cases_for(profile) (every case of the features its facts are proven from) and Corpus::prove(profile, outcomes) / prove(...): each fact, proven or why not;
  • questions(case) and judge(case, answers): a case's questions depend on the case alone, so a caller can send them all at once to an untrusted process and judge afterwards; failures carry a byte_diff (first differing byte marked);
  • parse_reply, Question::request;
  • the Implementation trait, with InProcess (comline-runtime) and Lines (any writer/reader speaking the ops protocol, e.g. a child's stdin/stdout); run_all.

The spec: the case format and the ops protocol are documented as spec 0.1 (runner::SPEC_VERSION, README "The spec, version 0.1"), early-days 0.x rules.

Ops protocol: unchanged. version already says what an implementation ships (formats, framings); the spec now says a third party lists its namespaced names there.

Profiles: ProfileKind::Handshake (no facts), as core already declares it, so a package's handshake profile loads.

Tests: the_runner_passes_the_reference (in process, every case, every official profile proven); reference/tests/runner.rs (the built comline-reference through Lines: every case passes, every profile proven, a flipped byte fails with a diff); unit tests for the diff, judging and reply parsing. cargo test (workspace) passes locally.

A `runner` module other crates (the CLI's `comline conformance`) depend on
by git rev: load a corpus, pose each case's questions to any
implementation, judge the answers with byte diffs, and prove a profile's
facts. `Lines` drives a process over comline-reference's ops protocol;
`InProcess` is comline-runtime. The case format and the ops protocol are
documented as spec 0.1. A handshake profile kind, with no facts, as core
declares it.

Refs ComlineProject/cli#106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant