Files
paperspec/schemas/common.schema.json
T
alexmandClaude a09d158e16 feat: minted keys, VRF seeds, RFC 9162 proofs, history roots, tag URIs and a transparency log
Keys (spec/02 §2.4), the rule paperstack settled on:
- A work key is a Scholar-style citation key, a hyphen and the first four
  Crockford base32 characters of SHA-256("scienting-key/1:" + identity),
  where the identity is the first of doi, arxiv, isbn, pmid, pmcid and
  openalex in same_as, else the folded title, year and family name. A
  collision lengthens the later key by two characters; a key is minted
  once and never recomputed. A document key adds .si, .v<seq> or .<type>
  for versions other than the version of record.
- Every fixture key is now minted (hale2026harmonic-damb,
  okafor2025solvent-acth, writer2027fixed-ynr7.v3, tiny2026tiny-j4qm), so
  every node and record ID was re-minted and the docs rewritten to match.
  The validator checks the document key against the work key and version
  (doc.key.work) and the hash part against the identifier (doc.key.suffix).
  vectors/keys.jsonl pins the cases paperstack's tests pin.

Review:
- Spot-check seeds are ECVRF-EDWARDS25519-SHA512-TAI proofs (RFC 9381),
  implemented in tools/oracle/vrf.py in plain Python and reproduced
  against the RFC's Example 16; the sample ranks by the VRF output. The
  earlier Ed25519 seed could be ground by a dishonest checker.
- RFC 9162 inclusion and consistency proofs (crypto.inclusion_path,
  verify_inclusion, consistency_proof, verify_consistency) with
  scienting-proof/1, vectors/proofs.jsonl and two fixture records.
- document.json carries `history`, the root over the corrections, with
  the empty-tree hash for none (spec/11 §11.5, rule doc.history).
- A provisional transparency log (spec/23): log entries, signed-note
  checkpoints with key hashes as transparency logs share them, the rule
  that a logged revocation beats a self-asserted time, and vectors.
- Reserved signature schemes cose and ml-dsa-65 (spec/08 §8.4).

Identifiers and text:
- urn:scienting: becomes tag:scient.ing,2026: (RFC 4151), since the URN
  namespace was never registered.
- Unicode 16.0 is pinned for normalization and categories (spec/01 §1.4);
  the checker refuses another version.

Checking:
- check.py: keys, proofs, VRF and checkpoint vectors; the proof and
  checkpoint records; a check that every ID and hash the prose quotes
  exists in the fixtures or vectors; three more broken packages
  (history-wrong, key-suffix, key-work).
- stress.py: key, VRF, proof and checkpoint properties.
- Docs: a keys section in the concepts and FAQ, rationale entries for
  keys, VRF, proofs, tag URIs and the Unicode pin, a "Looking ahead"
  section, media-type registration and OCI distribution notes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 23:21:57 -04:00

570 lines
12 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": {
"type": "string",
"minLength": 1
},
"run": {
"type": "string",
"minLength": 1
}
},
"required": [
"model",
"run"
],
"additionalProperties": false
}
]
},
"hashing": {
"oneOf": [
{
"type": "object",
"properties": {
"scheme": {
"const": "plain"
}
},
"required": [
"scheme"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"scheme": {
"const": "hmac-team"
},
"key_id": {
"type": "string",
"pattern": "^[0-9a-f]{16}$"
}
},
"required": [
"scheme",
"key_id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"scheme": {
"const": "hkdf-pages"
},
"context": {
"type": "string",
"minLength": 1
},
"pages": {
"type": "array",
"items": {
"$ref": "#/$defs/hash"
},
"minItems": 1
}
},
"required": [
"scheme",
"context",
"pages"
],
"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
}
}
}