Schemas and compatibility¶
Every file format Modeldiffr writes, which parts are stable, and the promise that applies from 1.0.
Formats¶
| File | Schema id | JSON Schema in the package | Id prefix |
|---|---|---|---|
report.json |
schema_version 0.3 |
modeldiffr/schema/report.schema.json |
mdr1: |
report.json from 0.2 |
schema_version 0.2 |
modeldiffr/schema/report-0.2.schema.json |
mdr1: |
| Attestation predicate | https://modeldiffr.dev/attestation/audit/v1 |
modeldiffr/schema/audit-predicate-v1.schema.json |
none |
features.json |
modeldiffr.features/1 |
modeldiffr/schema/features.schema.json |
mdrf1: |
causal.json |
modeldiffr.causal/1 |
modeldiffr/schema/causal.schema.json |
mdrc1: |
scan.json |
modeldiffr.scan/1 |
modeldiffr/schema/scan.schema.json |
mdrs1: |
*.commitment.json |
modeldiffr.commitment/1 |
none | none |
index.json from batch |
modeldiffr.batch/1 |
none | none |
registry.json |
modeldiffr.registry/1 |
none | none |
study.json |
modeldiffr.study/1 |
none | none |
modeldiffr verify validates reports, features, causal and scan files against their schema whenever jsonschema is installed (pip install "modeldiffr[proof]").
Report schema 1.0 candidate¶
Report schema 0.3 is the candidate for 1.0. It will become 1.0 unchanged unless the published audits of Phase 8 show a field that cannot be kept. These parts are frozen now:
- The manifest:
schema,base,derivative,suite,settings,code, and the model entry fieldsmodel_id,revision,commit,weights_root,weights_algorithm,tokenizer_vocab,tokenizer_json,chat_template. - The audit id:
mdr1:plus SHA 256 of the RFC 8785 canonical JSON of the manifest. itemsand the results root: RFC 6962 Merkle tree with leaves{"task", "side", "index", "row"}over tasks in sorted order and sidesbase,derivative,pair.- The statement hash: SHA 256 of the canonical JSON of
audit_id,results_root,metrics,verdict,comparabilityandweights_diff. - Every metric's
name,n,base_mean,derivative_mean,delta,ci_low,ci_high,p_value,significant,significant_raw,negligibleandspec. verdictwithchanged,negligibleandany_change.- The weight fingerprint algorithm
modeldiffr.weights/1.
The promise from 1.0¶
- Reports keep verifying. Every report written by any 1.x version verifies with every later 1.x version, offline, with the same result. Reports from 0.2 and 0.3 keep verifying too.
- Ids never change meaning. An audit id, features id, causal id or scan id computed by one version is computed identically by every later version for the same inputs.
- Additive changes only within 1.x. New optional fields may appear. Existing fields are not removed, renamed or given a new meaning.
- Breaking changes need a new major schema with a new id prefix (
mdr2:), and the old schema stays verifiable for at least two years. - Deprecations are announced in the changelog at least one minor release before anything optional stops being written.
- The attestation predicate
audit/v1follows the same rules. A breaking change getsaudit/v2.
Version numbers¶
The package follows Semantic Versioning. Until 1.0, minor releases may change formats, and the changelog says how. Every format change so far has kept older reports verifiable.