|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://codaro.dev/contracts/executableUnit.schema.json", |
| 4 | + "title": "Codaro ExecutableUnitSpec", |
| 5 | + "type": "object", |
| 6 | + "additionalProperties": false, |
| 7 | + "required": [ |
| 8 | + "schemaVersion", |
| 9 | + "unitId", |
| 10 | + "entryBlockId", |
| 11 | + "dependencyBlockIds", |
| 12 | + "inputSchema", |
| 13 | + "outputSchema", |
| 14 | + "effects", |
| 15 | + "statePolicy", |
| 16 | + "runtimeTarget", |
| 17 | + "sourceSpan", |
| 18 | + "sourceHash", |
| 19 | + "dependencyHash", |
| 20 | + "assetHashes", |
| 21 | + "checkScenarioIds", |
| 22 | + "evidenceReceiptIds", |
| 23 | + "diagnostics" |
| 24 | + ], |
| 25 | + "properties": { |
| 26 | + "schemaVersion": { "const": 1 }, |
| 27 | + "unitId": { "type": "string", "minLength": 1, "maxLength": 200 }, |
| 28 | + "entryBlockId": { "type": "string", "minLength": 1, "maxLength": 200 }, |
| 29 | + "dependencyBlockIds": { |
| 30 | + "type": "array", |
| 31 | + "uniqueItems": true, |
| 32 | + "items": { "type": "string", "minLength": 1, "maxLength": 200 } |
| 33 | + }, |
| 34 | + "inputSchema": { "type": "object" }, |
| 35 | + "outputSchema": { "type": "object" }, |
| 36 | + "effects": { "$ref": "#/$defs/EffectSpec" }, |
| 37 | + "statePolicy": { "$ref": "#/$defs/StatePolicy" }, |
| 38 | + "runtimeTarget": { "$ref": "#/$defs/RuntimeTarget" }, |
| 39 | + "sourceSpan": { "$ref": "#/$defs/SourceSpan" }, |
| 40 | + "sourceHash": { "$ref": "#/$defs/ContentHash" }, |
| 41 | + "dependencyHash": { "$ref": "#/$defs/ContentHash" }, |
| 42 | + "assetHashes": { |
| 43 | + "type": "object", |
| 44 | + "additionalProperties": { "$ref": "#/$defs/ContentHash" } |
| 45 | + }, |
| 46 | + "checkScenarioIds": { |
| 47 | + "type": "array", |
| 48 | + "uniqueItems": true, |
| 49 | + "items": { "type": "string", "minLength": 1 } |
| 50 | + }, |
| 51 | + "evidenceReceiptIds": { |
| 52 | + "type": "array", |
| 53 | + "uniqueItems": true, |
| 54 | + "items": { "type": "string", "minLength": 1 } |
| 55 | + }, |
| 56 | + "diagnostics": { |
| 57 | + "type": "array", |
| 58 | + "items": { "$ref": "#/$defs/CapabilityDiagnostic" } |
| 59 | + } |
| 60 | + }, |
| 61 | + "$defs": { |
| 62 | + "ContentHash": { |
| 63 | + "type": "string", |
| 64 | + "pattern": "^sha256-[0-9a-f]{64}$" |
| 65 | + }, |
| 66 | + "StatePolicy": { |
| 67 | + "type": "string", |
| 68 | + "enum": ["none", "perSession", "shared"] |
| 69 | + }, |
| 70 | + "RuntimeTarget": { |
| 71 | + "type": "string", |
| 72 | + "enum": ["browser", "server", "local", "blocked"] |
| 73 | + }, |
| 74 | + "SourceSpan": { |
| 75 | + "type": "object", |
| 76 | + "additionalProperties": false, |
| 77 | + "required": ["path", "startLine", "endLine"], |
| 78 | + "properties": { |
| 79 | + "path": { "type": "string", "minLength": 1 }, |
| 80 | + "startLine": { "type": "integer", "minimum": 1 }, |
| 81 | + "endLine": { "type": "integer", "minimum": 1 } |
| 82 | + } |
| 83 | + }, |
| 84 | + "EffectSpec": { |
| 85 | + "type": "object", |
| 86 | + "additionalProperties": false, |
| 87 | + "required": [ |
| 88 | + "filesystemRead", |
| 89 | + "filesystemWrite", |
| 90 | + "networkOrigins", |
| 91 | + "process", |
| 92 | + "gui", |
| 93 | + "secretRefs" |
| 94 | + ], |
| 95 | + "properties": { |
| 96 | + "filesystemRead": { |
| 97 | + "type": "array", |
| 98 | + "uniqueItems": true, |
| 99 | + "items": { "type": "string", "minLength": 1 } |
| 100 | + }, |
| 101 | + "filesystemWrite": { |
| 102 | + "type": "array", |
| 103 | + "uniqueItems": true, |
| 104 | + "items": { "type": "string", "minLength": 1 } |
| 105 | + }, |
| 106 | + "networkOrigins": { |
| 107 | + "type": "array", |
| 108 | + "uniqueItems": true, |
| 109 | + "items": { "type": "string", "minLength": 1 } |
| 110 | + }, |
| 111 | + "process": { "type": "boolean" }, |
| 112 | + "gui": { "type": "boolean" }, |
| 113 | + "secretRefs": { |
| 114 | + "type": "array", |
| 115 | + "uniqueItems": true, |
| 116 | + "items": { "type": "string", "minLength": 1 } |
| 117 | + } |
| 118 | + } |
| 119 | + }, |
| 120 | + "CapabilityDiagnostic": { |
| 121 | + "type": "object", |
| 122 | + "additionalProperties": false, |
| 123 | + "required": ["code", "message", "severity", "sourceSpan"], |
| 124 | + "properties": { |
| 125 | + "code": { "type": "string", "minLength": 1 }, |
| 126 | + "message": { "type": "string", "minLength": 1 }, |
| 127 | + "severity": { "type": "string", "enum": ["info", "warning", "blocked"] }, |
| 128 | + "sourceSpan": { "$ref": "#/$defs/SourceSpan" } |
| 129 | + } |
| 130 | + } |
| 131 | + } |
| 132 | +} |
0 commit comments