Files
paperspec/schemas/correction.schema.json
T
alexmandClaude 8b5ee87275 feat: comment categories; emend, relink and resolve corrections
scienting-layer/1: an optional, fixed category on comment, caveat and
question bodies (comment, context, critique, question, correction,
feedback, resource).

Corrections: emend fixes the authors' own slip and keeps what was printed
(a run's printed), never lowering fidelity or a witness match; relink sets
or removes what a citation names; resolve sets a reference's resolution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017R7sgDNvUGWY2zFPCq2JH6
2026-10-17 06:17:10 -04:00

485 lines
8.3 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://paperspec.scient.ing/schemas/correction.schema.json",
"title": "Correction",
"description": "scienting-correction/1: a line of corrections.jsonl, or a proposal; spec/11-corrections.md.",
"$defs": {
"emendKind": {
"enum": [
"typo",
"spelling",
"grammar",
"punctuation",
"wording",
"other"
]
}
},
"type": "object",
"properties": {
"format": {
"const": "scienting-correction/1"
},
"index": {
"type": "integer",
"minimum": 1
},
"id": {
"$ref": "common.schema.json#/$defs/recordId"
},
"op": {
"enum": [
"replace",
"insert",
"delete",
"split",
"merge",
"move",
"reclassify",
"relabel",
"set",
"emend",
"relink",
"resolve"
]
},
"target": {
"$ref": "common.schema.json#/$defs/nodeId"
},
"find": {
"type": "string",
"minLength": 1
},
"replace": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "runs.schema.json"
}
]
},
"run": {
"type": "integer",
"minimum": 0
},
"offset": {
"type": "integer",
"minimum": 0
},
"text": {
"type": "string",
"minLength": 1
},
"parent": {
"$ref": "common.schema.json#/$defs/nodeId"
},
"node": {
"type": "object",
"description": "A node subtree to insert: kind, label, attrs, content and children; equation runs name a child by position."
},
"with": {
"$ref": "common.schema.json#/$defs/nodeId"
},
"joiner": {
"type": "string"
},
"kind": {
"description": "A reclassify's new node kind, or what an emend corrects.",
"anyOf": [
{
"$ref": "common.schema.json#/$defs/nodeKind"
},
{
"$ref": "#/$defs/emendKind"
}
]
},
"note": {
"type": "string",
"minLength": 1
},
"refs": {
"description": "A relink's references: reference node IDs, or null to unlink.",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "common.schema.json#/$defs/nodeId"
},
"minItems": 1,
"uniqueItems": true
},
{
"type": "null"
}
]
},
"resolution": {
"$ref": "reference.schema.json#/properties/resolution"
},
"label": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"attr": {
"enum": [
"level",
"columns",
"column",
"rowspan",
"colspan",
"role",
"header_path",
"ordered",
"marker",
"variant"
]
},
"value": {},
"evidence": {
"type": "array",
"items": {
"$ref": "common.schema.json#/$defs/evidence"
},
"minItems": 1
},
"author": {
"$ref": "common.schema.json#/$defs/author"
},
"reason": {
"type": "string",
"minLength": 1
},
"at": {
"$ref": "common.schema.json#/$defs/time"
},
"before": {
"anyOf": [
{
"$ref": "common.schema.json#/$defs/hash"
},
{
"type": "null"
}
]
},
"path": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "common.schema.json#/$defs/nodeId"
}
},
{
"type": "null"
}
]
},
"to_path": {
"type": "array",
"items": {
"$ref": "common.schema.json#/$defs/nodeId"
}
},
"touched": {
"type": "array",
"items": {
"$ref": "common.schema.json#/$defs/nodeId"
},
"uniqueItems": true
},
"created": {
"type": "array",
"items": {
"$ref": "common.schema.json#/$defs/nodeId"
},
"minItems": 1
},
"retired": {
"type": "array",
"items": {
"$ref": "common.schema.json#/$defs/nodeId"
},
"minItems": 1
},
"from": {},
"status": {
"enum": [
"proposed"
]
},
"after": {
"anyOf": [
{
"$ref": "common.schema.json#/$defs/hash"
},
{
"type": "null"
}
]
},
"place_after": {
"anyOf": [
{
"$ref": "common.schema.json#/$defs/nodeId"
},
{
"type": "null"
}
]
}
},
"required": [
"format",
"op",
"evidence",
"author",
"reason",
"at"
],
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"op": {
"const": "replace"
}
}
},
"then": {
"required": [
"target",
"find",
"replace"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "delete"
}
}
},
"then": {
"required": [
"target"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "split"
}
}
},
"then": {
"required": [
"target",
"offset"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "merge"
}
}
},
"then": {
"required": [
"target",
"with"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "move"
}
}
},
"then": {
"required": [
"target",
"parent"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "reclassify"
}
}
},
"then": {
"properties": {
"kind": {
"$ref": "common.schema.json#/$defs/nodeKind"
}
},
"required": [
"target",
"kind"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "emend"
}
}
},
"then": {
"properties": {
"replace": {
"type": "string",
"minLength": 1
},
"kind": {
"$ref": "#/$defs/emendKind"
}
},
"required": [
"target",
"find",
"replace",
"kind"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "relink"
}
}
},
"then": {
"required": [
"target",
"run",
"refs"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "resolve"
}
}
},
"then": {
"required": [
"target",
"resolution"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "relabel"
}
}
},
"then": {
"required": [
"target",
"label"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "set"
}
}
},
"then": {
"required": [
"target",
"attr",
"value"
]
}
},
{
"if": {
"properties": {
"op": {
"const": "insert"
}
}
},
"then": {
"oneOf": [
{
"required": [
"parent",
"node"
]
},
{
"required": [
"target",
"run",
"offset",
"text"
]
}
]
}
},
{
"if": {
"required": [
"index"
]
},
"then": {
"required": [
"id",
"before",
"after",
"path",
"touched"
]
},
"else": {
"required": [
"status"
]
}
}
]
}