Skip to content

Reports and formats ​

Every command that evaluates something produces a versioned JSON document. The terminal output is a summary of the same data: --format json prints the full document to stdout, and --output FILE writes it.

DocumentWritten byVersion field
Reporttest, fuzz, test --all, reportreport_version: "0.1"
Diff reportdiffdiff_version: "0.1"
Replay reportreplay --format jsonreplay_version: "0.1"
Production reportcheckcheck_version: "0.1"

All of them carry decguard_version, created_at, status (pass, warn or fail) and exit_code. Their formats are versioned independently of the package: a change in meaning comes with a version bump and a changelog entry.

Report ​

The report of decguard test and decguard fuzz.

FieldContent
report_version, decguard_version, created_atformat and tool provenance
modetest (golden gates), fuzz (properties) or all (both)
status, exit_codepass / warn / fail, and 0 / 0 / 1
contractname, type, labels, schema_version, hash (sha256:), path
datasetpath, hash (sha256: of the file bytes), n_cases, n_labeled
backendname, provider, model, model_version, details (redacted provider details)
healthhealthcheck status (ok / unhealthy / unknown) and detail
evaluation, requirements, warningsthe settings and gates used
metricscounts, classification, calibration (with reliability bins), selective, latency
checksone entry per gate: gate, level, metric, comparison, threshold, value, status, message
failuresfailing examples (errors and wrong answers) with their inputs
resultsevery case: case_id, input, expected, metadata, and either a result or an error
propertiesfuzz/all only: see below

A check entry:

json
{
  "gate": "min_accuracy",
  "level": "requirement",
  "metric": "accuracy",
  "comparison": ">=",
  "threshold": 0.9,
  "value": 1.0,
  "status": "pass",
  "message": "accuracy 1 >= 0.9"
}

A result entry holds the normalized DecisionResult; an error entry holds its kind and message.

properties ​

Present in fuzz and all reports:

FieldContent
seedthe transformation seed used
fuzz, configthe fuzz settings and every property's settings
summariesper property: counts of transformed, skipped, errored and evaluated cases; violations and flips with their rates; max TV, JS and deltas
pairsevery transformed case: id (<property>/<case id>/<sample>), steps, input, presentation (option shown → contract label), result or error, comparison, violations, and a reduced minimal example when minimized
skippedcases a property could not transform, with the reason

Integrity on load ​

Loading a report — with report, diff or replay — re-verifies it completely:

  • every stored result has probabilities over exactly the contract labels, in canonical order, summing to 1 within the recorded probability_tolerance; selected is the argmax (ties to the first label) and confidence its probability;
  • each case has exactly one of result or error;
  • transformed cases are checked the same way, and their comparisons and violations must match what their results and the recorded property settings imply;
  • dataset counts, aggregate metrics, failure examples, property summaries, checks, status and exit code are recomputed and must agree with the stored values.

A tampered or corrupted report is rejected with exit code 2.

Re-evaluation ​

Because results holds every normalized decision, decguard report report.json --contract edited.yaml recomputes metrics and re-applies the edited gates offline. Recomputation from the same results is bit-identical. For fuzz and all reports it also re-applies edited property limits and levels to the stored transformed cases; transformations are not regenerated.

Diff report ​

Written by decguard diff.

FieldContent
contractthe decision compared
baseline, candidateprovenance of each run: path, created_at, mode, contract_hash, dataset, backend
same_datasetwhether both runs used the same dataset file (by hash)
evaluationsettings used to recompute metrics on matched cases
countscases per run, matched, only in one run, compared; answer flips, newly wrong/correct; newly errored, recovered, still errored
shiftanswer flip rate; mean and max TV distance; mean JS divergence; mean, mean absolute and max absolute confidence delta
metricsper metric: baseline, candidate, delta
segmentsper segment: key, value, size, accuracy before and after, flip rate
checksregression gates, same shape as report checks
changeseach flipped, newly errored or recovered case with its input, answers and confidences

Replay report ​

Printed by decguard replay --format json.

FieldContent
sourcethe report replayed
contract_path, contract_hash, contract_changedthe contract used, and whether it differs from the one recorded
backendthe backend replayed against
outcomesper replayed failure: id, property, case_id; regenerated (the seed regenerates the stored transformation; null for non-deterministic paraphrase providers); the new original result or original_error; the re-judged examples (transformed and reduced); and reproduced

Production report ​

Written by decguard check.

FieldContent
contract, evaluationthe decision and settings used
configthe production section: segments and gates
datasetpath, hash, n_records, n_outcomes, n_correctness
baselinesource (dataset or report), path, hash, n_records and metrics, or null
metricscounts, outcomes, calibration, confidence (with histogram), threshold, routing, latency_ms, cost
driftconfidence_tv_distance, confidence_mean_delta, accuracy_drop, ece_increase (null without a baseline)
segmentsper metadata group: key, value, metrics, checks
checksaggregate and segment checks
recordsevery normalized record

A production report can be passed back as --baseline to the next decguard check; its records are validated again against the contract when it is loaded.

Input formats ​

FormatUsed byReference
Decision Contract (YAML/JSON)every commandDecision Contract
Golden dataset (JSONL/JSON)validate, test, fuzzGolden datasets
Production records (JSONL/JSON)checkRecord schema
Paraphrase file (JSONL)paraphrase with provider: fileParaphrase providers
decguard.http/0.1 request/responsehttp backendHTTP protocol
System One request/answersystemone backendWire format

Status semantics and exit codes are described in Requirements and warnings and the CLI reference.

Released under the Apache-2.0 License.