Files
paperspec/schemas/common.schema.json
T
alexmandClaude 3831b52a2b feat: ML-DSA-65, did:key, named hash algorithm, model provenance, log tiles and witnesses
- hashing.algorithm names the hash function in every document; a consumer refuses one it does not implement (doc.hash.algorithm)
- ML-DSA-65 (FIPS 204) is an implemented signature scheme: pure-Python reference in tools/oracle/mldsa.py checked against NIST ACVP vectors, a receipt signed by the new roster key dana, and signature vectors for key generation and a deterministic signature
- roster keys may carry a did:key, which the validator checks against the public key (doc.roster.did), and a witness purpose for parties that cosign log checkpoints
- model provenance: a correction's author and an annotation's generator name the model with provider, version and the hashes of its weights, prompt and parameters, and where it ran
- the transparency log gains the tlog-tiles static layout (fixtures/records/log/), a project settings.log with origin, witnesses and threshold, and an acceptance rule; the fixture checkpoint is cosigned by a witness
- store.sql: roster_keys accepts cose and ml-dsa-65 and gains a did column
- spec chapters 01, 08, 11, 18, 20 and 23, the rationale, glossary, fixture, vector and tool guides updated; stress harness covers ML-DSA

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 04:39:12 -04:00

618 lines
13 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://paperspec.scient.ing/schemas/common.schema.json",
"title": "Shared definitions",
"description": "Definitions every scienting schema shares; spec/01-conventions.md.",
"$defs": {
"hash": {
"type": "string",
"pattern": "^[0-9a-f]{64}$",
"description": "SHA-256 or HMAC-SHA-256, 64 lowercase hex digits."
},
"hash6": {
"type": "string",
"pattern": "^[0-9a-f]{6}$"
},
"nodeId": {
"type": "string",
"pattern": "^[a-hjkmnp-tv-z][0-9a-hjkmnp-tv-z]{6}$",
"description": "Seven lowercase Crockford base32 characters, the first a letter."
},
"recordId": {
"type": "string",
"pattern": "^[a-hjkmnp-tv-z][0-9a-hjkmnp-tv-z]{6,25}$"
},
"key": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9._-]*$",
"maxLength": 128,
"description": "A store, project or source key, or a legacy document key kept as an alias."
},
"workKey": {
"type": "string",
"pattern": "^[a-z][a-z0-9]*-[0-9a-hjkmnp-tv-z]{4,51}$",
"maxLength": 128,
"description": "A Scholar-style part, a hyphen and the hash of the work's identity (spec/02 §2.4)."
},
"documentKey": {
"type": "string",
"pattern": "^[a-z][a-z0-9]*-[0-9a-hjkmnp-tv-z]{4,51}(\\.[a-z0-9][a-z0-9-]*)*$",
"maxLength": 128,
"description": "A work key, with a dotted suffix for anything other than the version of record."
},
"alias": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9._-]*[._-][a-z0-9._-]*$",
"maxLength": 128,
"description": "A legacy ID; it always contains a separator, so it never looks like a node ID."
},
"nodeRef": {
"anyOf": [
{
"$ref": "#/$defs/nodeId"
},
{
"$ref": "#/$defs/alias"
}
]
},
"qualifiedKey": {
"type": "string",
"pattern": "^([a-z0-9][a-z0-9._-]*/)?[a-z][a-z0-9]*-[0-9a-hjkmnp-tv-z]{4,51}(\\.[a-z0-9][a-z0-9-]*)*$",
"maxLength": 257,
"description": "A document key, optionally qualified by its store."
},
"datasetId": {
"type": "string",
"pattern": "^ds-[a-z0-9][a-z0-9._-]*$",
"maxLength": 128
},
"address": {
"type": "string",
"pattern": "^([a-z0-9][a-z0-9._-]*/)?[a-z][a-z0-9]*-[0-9a-hjkmnp-tv-z]{4,51}(\\.[a-z0-9][a-z0-9-]*)*#[a-z0-9][a-z0-9._-]*(@[0-9a-f]{6})?(\\[(0|[1-9][0-9]*):(0|[1-9][0-9]*)\\])?$"
},
"time": {
"type": "string",
"pattern": "^[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]Z$"
},
"date": {
"type": "string",
"pattern": "^[0-9]{4}(-[0-1][0-9](-[0-3][0-9])?)?$"
},
"decimal": {
"type": "string",
"pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
"description": "A decimal that carries meaning, as a string."
},
"level": {
"enum": [
"F0",
"F1",
"F2",
"F3"
]
},
"receiptLevel": {
"enum": [
"F1",
"F2",
"F3"
]
},
"nodeKind": {
"enum": [
"document",
"front",
"title",
"authors",
"abstract",
"keywords",
"notes",
"section",
"heading",
"paragraph",
"sentence",
"equation",
"equation-line",
"figure",
"panel",
"caption",
"figure-note",
"table",
"table-head",
"table-body",
"table-note",
"row",
"cell",
"list",
"item",
"quote",
"code",
"algorithm",
"theorem",
"footnote",
"back",
"acknowledgments",
"references",
"reference",
"appendix"
]
},
"box": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4,
"description": "[x0, y0, x1, y1] in PDF points, origin top left after rotation."
},
"size": {
"type": "array",
"items": {
"type": "number",
"exclusiveMinimum": 0
},
"minItems": 2,
"maxItems": 2
},
"url": {
"type": "string",
"pattern": "^[a-z][a-z0-9+.-]*:[^ ]+$"
},
"language": {
"type": "string",
"pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$"
},
"spdx": {
"type": "string",
"pattern": "^[A-Za-z0-9.+-]+( (AND|OR|WITH) [A-Za-z0-9.+-]+)*$"
},
"license": {
"type": "object",
"properties": {
"spdx": {
"$ref": "#/$defs/spdx"
},
"text": {
"type": "string",
"minLength": 1
},
"url": {
"$ref": "#/$defs/url"
}
},
"additionalProperties": false,
"minProperties": 1
},
"tri": {
"enum": [
true,
false,
"unknown"
]
},
"base64": {
"type": "string",
"pattern": "^[A-Za-z0-9+/]+={0,2}$"
},
"processor": {
"enum": [
"local",
"tenancy",
"outside-no-retention",
"outside"
]
},
"basis": {
"enum": [
"open-license",
"publisher-tdm",
"collective-license",
"subscription",
"own-work",
"permission",
"unknown"
]
},
"signature": {
"type": "object",
"properties": {
"scheme": {
"enum": [
"ed25519",
"ssh",
"gpg",
"sigstore",
"cose",
"ml-dsa-65"
]
},
"key": {
"$ref": "#/$defs/key"
},
"value": {
"type": "string",
"minLength": 1
}
},
"required": [
"scheme",
"key",
"value"
],
"additionalProperties": false
},
"evidence": {
"type": "object",
"properties": {
"kind": {
"enum": [
"crop",
"witness",
"source-file",
"person"
]
},
"sha256": {
"$ref": "#/$defs/hash"
},
"node": {
"$ref": "#/$defs/nodeId"
},
"page_fp": {
"$ref": "#/$defs/hash"
},
"box": {
"$ref": "#/$defs/box"
},
"by": {
"$ref": "#/$defs/key"
},
"note": {
"type": "string",
"minLength": 1
}
},
"required": [
"kind"
],
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"kind": {
"const": "person"
}
}
},
"then": {
"required": [
"by"
]
},
"else": {
"required": [
"sha256"
]
}
}
]
},
"author": {
"oneOf": [
{
"type": "object",
"properties": {
"key": {
"$ref": "#/$defs/key"
}
},
"required": [
"key"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"model": {
"$ref": "#/$defs/model"
},
"run": {
"type": "string",
"minLength": 1
}
},
"required": [
"model",
"run"
],
"additionalProperties": false
}
]
},
"hashAlgorithm": {
"enum": [
"sha-256"
],
"description": "The hash function every value of a package uses; the only value so far (spec/01 §1.3)."
},
"hashing": {
"oneOf": [
{
"type": "object",
"properties": {
"scheme": {
"const": "plain"
},
"algorithm": {
"$ref": "#/$defs/hashAlgorithm"
}
},
"required": [
"scheme"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"scheme": {
"const": "hmac-team"
},
"algorithm": {
"$ref": "#/$defs/hashAlgorithm"
},
"key_id": {
"type": "string",
"pattern": "^[0-9a-f]{16}$"
}
},
"required": [
"scheme",
"key_id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"scheme": {
"const": "hkdf-pages"
},
"algorithm": {
"$ref": "#/$defs/hashAlgorithm"
},
"context": {
"type": "string",
"minLength": 1
},
"pages": {
"type": "array",
"items": {
"$ref": "#/$defs/hash"
},
"minItems": 1
}
},
"required": [
"scheme",
"context",
"pages"
],
"additionalProperties": false
}
]
},
"model": {
"type": "object",
"description": "A model that proposed something: enough to name the weights and the instructions it ran with (spec/11 §11.2).",
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"provider": {
"type": "string",
"minLength": 1
},
"version": {
"type": "string",
"minLength": 1
},
"weights": {
"$ref": "#/$defs/hash"
},
"prompt": {
"$ref": "#/$defs/hash"
},
"parameters": {
"$ref": "#/$defs/hash"
},
"processor": {
"$ref": "#/$defs/processor"
}
},
"required": [
"name"
],
"additionalProperties": false
},
"quote": {
"type": "object",
"properties": {
"exact": {
"type": "string",
"maxLength": 200
},
"exact_hash": {
"$ref": "#/$defs/hash"
},
"length": {
"type": "integer",
"minimum": 201
},
"prefix": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"suffix": {
"type": "string",
"minLength": 1,
"maxLength": 32
}
},
"required": [],
"additionalProperties": false,
"oneOf": [
{
"required": [
"exact"
],
"not": {
"anyOf": [
{
"required": [
"exact_hash"
]
},
{
"required": [
"length"
]
}
]
}
},
{
"required": [
"exact_hash",
"length"
],
"not": {
"required": [
"exact"
]
}
}
]
},
"keyedQuote": {
"type": "object",
"properties": {
"mac": {
"$ref": "#/$defs/hash"
},
"length": {
"type": "integer",
"minimum": 0
},
"prefix_mac": {
"$ref": "#/$defs/hash"
},
"suffix_mac": {
"$ref": "#/$defs/hash"
}
},
"required": [
"mac",
"length"
],
"additionalProperties": false
},
"cellContext": {
"type": "object",
"properties": {
"table_label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"row_path": {
"type": "array",
"items": {
"type": "string"
}
},
"column_path": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"table_label",
"row_path",
"column_path"
],
"additionalProperties": false
},
"keyedContext": {
"type": "object",
"properties": {
"table_label_mac": {
"anyOf": [
{
"$ref": "#/$defs/hash"
},
{
"type": "null"
}
]
},
"row_path_mac": {
"type": "array",
"items": {
"$ref": "#/$defs/hash"
}
},
"column_path_mac": {
"type": "array",
"items": {
"$ref": "#/$defs/hash"
}
}
},
"required": [
"table_label_mac",
"row_path_mac",
"column_path_mac"
],
"additionalProperties": false
},
"agent": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^tag:scient\\.ing,2026:(key|person|software):[^ ]+$"
},
"type": {
"enum": [
"Person",
"Software"
]
},
"name": {
"type": "string",
"minLength": 1
}
},
"required": [
"id",
"type"
],
"additionalProperties": false
}
}
}