1
0
Fork 0
Code Issues Pull requests Projects Releases 2 Packages Wiki Activity Actions Pages
DocForge2/schemas/changeset.schema.json

51 lines
2.3 KiB
JSON
Raw Permalink Normal View History

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docforge.local/schema/changeset-v1.json",
"title": "DocForge isolated changeset",
"type": "object",
"required": ["schema_version", "changeset_id", "project_id", "root_fingerprint", "base_revision", "base_source_hash", "creator", "operations"],
"properties": {
"schema_version": { "const": 1 },
"changeset_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"project_id": { "type": "string" },
2026-07-22 02:58:51 -04:00
"root_fingerprint": { "type": "string", "pattern": "^[0-9a-f]{16}$" },
"base_revision": { "type": "string", "minLength": 1 },
"base_source_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
"creator": { "type": "string", "minLength": 1 },
"operations": {
"type": "array",
2026-07-22 02:58:51 -04:00
"maxItems": 10000,
"items": {
"type": "object",
2026-07-22 02:58:51 -04:00
"required": ["sequence", "operation", "node_id", "expected_content_hash", "target_source", "metadata", "content", "relationship_changes", "rationale"],
"properties": {
2026-07-22 02:58:51 -04:00
"sequence": { "type": "integer", "minimum": 1 },
"operation": { "enum": ["create", "update", "move", "delete"] },
"node_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
2026-07-22 02:58:51 -04:00
"expected_content_hash": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$" },
"target_source": { "type": ["string", "null"] },
"metadata": { "type": ["object", "null"] },
"content": { "type": ["string", "null"] },
2026-07-22 02:58:51 -04:00
"relationship_changes": {
"type": "array",
"items": {
"type": "object",
"required": ["action", "source_id", "relation", "target_id"],
"properties": {
"action": { "enum": ["add", "remove"] },
"source_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"relation": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"target_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" }
},
"additionalProperties": false
}
},
"rationale": { "type": "string", "minLength": 1 }
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}