Repository navigation
conformance: the runner as a library, and the corpus as a versioned spec - #69
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andCorpus::prove(profile, outcomes)/prove(...): each fact, proven or why not;questions(case)andjudge(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 abyte_diff(first differing byte marked);parse_reply,Question::request;Implementationtrait, withInProcess(comline-runtime) andLines(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.
versionalready 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 throughLines: 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.