{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://docforge.local/schema/projection-package-v1.json", "title": "DocForge immutable renderer projection package", "$comment": "package_id and embedded plan identity equality are verified by the runtime contract validator.", "$defs": { "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "manual_plan": { "type": "object", "required": [ "schema_version", "contract", "plan_id", "project", "view", "changeset_hash", "pages", "navigation", "search_documents", "diagnostics" ], "properties": { "schema_version": { "const": 1 }, "contract": { "const": "docforge.manual-render-plan" }, "plan_id": { "$ref": "#/$defs/sha256" }, "project": { "type": "object" }, "view": { "type": "object" }, "changeset_hash": { "oneOf": [ { "$ref": "#/$defs/sha256" }, { "type": "null" } ] }, "pages": { "type": "array", "maxItems": 10000 }, "navigation": { "type": "array", "maxItems": 10000 }, "search_documents": { "type": "array", "maxItems": 10000 }, "diagnostics": { "type": "object" } }, "additionalProperties": false }, "graph_plan": { "type": "object", "required": [ "schema_version", "contract", "plan_id", "project", "view", "bounds", "policy", "graph", "omissions", "diagnostics" ], "properties": { "schema_version": { "const": 1 }, "contract": { "const": "docforge.graph-view-plan" }, "plan_id": { "$ref": "#/$defs/sha256" }, "project": { "type": "object" }, "view": { "type": "object" }, "bounds": { "type": "object" }, "policy": { "type": "object" }, "graph": { "type": "object" }, "omissions": { "type": "array", "maxItems": 10000 }, "diagnostics": { "type": "object" } }, "additionalProperties": false }, "renderer": { "type": "object", "required": ["renderer_id", "renderer_version"], "properties": { "renderer_id": { "type": "string", "minLength": 1 }, "renderer_version": { "type": "string", "minLength": 1 } }, "additionalProperties": false }, "component": { "type": "object", "required": ["component_id"], "properties": { "component_id": { "type": "string", "minLength": 1 } }, "additionalProperties": false }, "asset": { "type": "object", "required": ["asset_id", "media_type", "sha256", "text"], "properties": { "asset_id": { "type": "string", "minLength": 1, "pattern": "^[^/]+$" }, "media_type": { "type": "string", "minLength": 1 }, "sha256": { "$ref": "#/$defs/sha256" }, "text": { "type": "string" } }, "additionalProperties": false } }, "type": "object", "required": [ "schema_version", "contract", "package_id", "kind", "plan_id", "plan", "renderer", "components", "assets", "output_policy" ], "properties": { "schema_version": { "const": 1 }, "contract": { "const": "docforge.projection-package" }, "package_id": { "$ref": "#/$defs/sha256" }, "kind": { "enum": ["manual", "graph"] }, "plan_id": { "$ref": "#/$defs/sha256" }, "plan": { "oneOf": [ { "$ref": "#/$defs/manual_plan" }, { "$ref": "#/$defs/graph_plan" } ] }, "renderer": { "$ref": "#/$defs/renderer" }, "components": { "type": "array", "maxItems": 32, "items": { "$ref": "#/$defs/component" }, "uniqueItems": true }, "assets": { "type": "array", "maxItems": 32, "items": { "$ref": "#/$defs/asset" } }, "output_policy": { "type": "object", "required": ["artifact_ids", "max_total_bytes"], "properties": { "artifact_ids": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "type": "string", "minLength": 1, "pattern": "^[^/]+$" }, "uniqueItems": true }, "max_total_bytes": { "type": "integer", "minimum": 1 } }, "additionalProperties": false } }, "allOf": [ { "if": { "properties": { "kind": { "const": "manual" } }, "required": ["kind"] }, "then": { "properties": { "plan": { "$ref": "#/$defs/manual_plan" } } } }, { "if": { "properties": { "kind": { "const": "graph" } }, "required": ["kind"] }, "then": { "properties": { "plan": { "$ref": "#/$defs/graph_plan" } } } } ], "additionalProperties": false }