5.1 KiB
DRP2 Fixture Runner Contract
This document defines the minimal runner behavior for the first DRP2 2.0 fixture corpus.
It is a contract for validation and replay harnesses, not an implementation guide for any specific language or backend.
Goals
- discover the same fixture set deterministically,
- classify outcomes consistently across runtimes,
- make first-failure reporting uniform,
- keep schema negatives, semantic negatives, and positive fixtures in one reusable corpus.
Fixture Discovery
The runner should discover fixtures under:
fixtures/positive/fixtures/negative/fixtures/negative_schema/
Rules:
- only
.jsonfiles are fixtures, - discovery order should be lexical by relative path,
- a runner may filter by path, directory, fixture
name, ortags, - filtering must not change the meaning of an individual fixture.
Fixture Classes
The runner must classify fixtures by expected.outcome and expected.phase.
Positive Fixtures
Definition:
expected.outcome = "success"
Required runner behavior:
- validate the fixture envelope,
- validate every command object against the active DRP command schema,
- run semantic validation and capability checks only as far as the active fixture contract currently requires,
- report success only if no earlier phase fails.
Semantic Negative Fixtures
Definition:
expected.outcome = "error"expected.phase != "schema_validation"
Required runner behavior:
- validate the fixture envelope,
- validate every command object against the active DRP command schema,
- continue into the expected active validation phase,
- report success only if the actual primary failure matches the fixture expectation.
Schema-Negative Fixtures
Definition:
expected.outcome = "error"expected.phase = "schema_validation"
Required runner behavior:
- validate the fixture envelope,
- allow the embedded
commandspayload to be invalid against the active DRP command schema, - stop once schema validation of the command payload fails,
- do not continue to semantic validation or capability validation.
Required Execution Pipeline
For each fixture, the runner should model these phases in order:
- fixture envelope validation,
- command schema validation,
- semantic validation,
- capability validation
Rules:
- the earliest deterministic failure wins,
- once a fixture has failed in one phase, later phases must not replace that result,
- decode and execution remain future extension points rather than active conformance phases for the current runner contract,
- fixture-envelope failure is a runner or corpus-authoring problem, not a DRP command-stream result and should not be reported as a DRP command phase result.
First-Failure Semantics
The runner must report one primary result per fixture.
Rules:
- the primary result is the earliest deterministic failing phase,
- if a failing command can be identified, report its zero-based
command_index, - if the failure is attributable to multiple later commands, only the first failing command counts,
- backend-native secondary diagnostics may be recorded, but they must not replace the contract-level primary result,
- a fixture passes only if the primary result exactly matches the expected outcome.
Result Matching
Positive Fixture Match
A positive fixture matches only if:
- no failure occurs in any earlier phase,
- any declared deterministic success outputs also match.
Negative Fixture Match
A negative fixture matches only if:
actual.outcome = "error",actual.phase = expected.phase,actual.code = expected.code,- if
expected.command_indexis present,actual.command_indexmatches it exactly.
Required Result Shape
Every runner should be able to emit a structured result record with at least:
- fixture path
- fixture name
- actual outcome
- actual phase
- actual code, if any
- actual command index, if known
- pass/fail boolean
- optional short message
For failed expectation matches, runners should also emit:
- expected outcome
- expected phase
- expected code
- expected command index, if present
Reporting Conventions
command_indexis zero-based everywhere,- omitted
command_indexmeans the failure is not attributable to a single command or the fixture intentionally does not require it, - runners should display both the fixture path and
namebecause names are stable but paths help debugging, - schema-negative fixtures should be reported distinctly enough that they are not confused with semantic negatives.
Minimal Runner Summary
At minimum, a batch runner should report:
- total fixtures discovered,
- fixtures run,
- fixtures passed,
- fixtures failed,
- failing fixture paths with mismatch details.
Non-Goals For The First Runner Contract
This document does not yet define:
- snapshot image formats,
- readback hashing algorithms,
- capability negotiation file formats,
- parallel execution rules,
- sharding or caching behavior.
Those can be added later without changing the basic pass/fail contract for the first corpus.