init
This commit is contained in:
+66
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/capability-catalog.schema.json",
|
||||
"title": "CapabilityCatalog",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "CapabilityCatalog"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain", "capabilities"],
|
||||
"properties": {
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "description", "target_devices", "parameters", "risk_level", "confirmation_policy"],
|
||||
"properties": {
|
||||
"name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"},
|
||||
"description": {"type": "string", "minLength": 1, "maxLength": 1000},
|
||||
"target_devices": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}
|
||||
},
|
||||
"target_scopes": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}
|
||||
},
|
||||
"parameters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "type", "required", "description"],
|
||||
"properties": {
|
||||
"name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"type": {"type": "string", "enum": ["number", "integer", "string", "boolean", "object", "array"]},
|
||||
"unit": {"type": "string", "minLength": 1},
|
||||
"required": {"type": "boolean"},
|
||||
"description": {"type": "string", "minLength": 1, "maxLength": 500},
|
||||
"minimum": {"type": "number"},
|
||||
"maximum": {"type": "number"},
|
||||
"allowed_values": {"type": "array", "minItems": 1}
|
||||
}
|
||||
}
|
||||
},
|
||||
"risk_level": {"type": "string", "enum": ["low", "medium", "high"]},
|
||||
"confirmation_policy": {"type": "string", "enum": ["never", "on_ambiguity", "always"]}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/command-plan.schema.json",
|
||||
"title": "CommandPlan",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "CommandPlan"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain", "platform", "source", "commands"],
|
||||
"properties": {
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"platform": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
|
||||
"source": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["config_id", "config_version", "compiler_version", "mapping_version"],
|
||||
"properties": {
|
||||
"config_id": {"type": "string", "minLength": 3},
|
||||
"config_version": {"type": "string", "minLength": 1},
|
||||
"config_sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
|
||||
"compiler_version": {"type": "string", "minLength": 1},
|
||||
"mapping_version": {"type": "string", "minLength": 1}
|
||||
}
|
||||
},
|
||||
"commands": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 512,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "operation_ref", "bus", "message", "signals"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "pattern": "^[a-z][a-z0-9_-]{1,63}$"},
|
||||
"operation_ref": {"type": "string", "minLength": 2},
|
||||
"bus": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
|
||||
"message": {"type": "string", "minLength": 1},
|
||||
"signals": {
|
||||
"type": "object",
|
||||
"minProperties": 1,
|
||||
"additionalProperties": {"type": ["number", "integer", "boolean", "string"]}
|
||||
},
|
||||
"send_offset_ms": {"type": "integer", "minimum": 0, "maximum": 3600000},
|
||||
"repeat": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["count", "period_ms"],
|
||||
"properties": {
|
||||
"count": {"type": "integer", "minimum": 1, "maximum": 10000},
|
||||
"period_ms": {"type": "integer", "minimum": 1, "maximum": 60000}
|
||||
}
|
||||
},
|
||||
"completion": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["message", "signal", "operator", "value", "timeout_ms"],
|
||||
"properties": {
|
||||
"message": {"type": "string", "minLength": 1},
|
||||
"signal": {"type": "string", "minLength": 1},
|
||||
"operator": {"type": "string", "enum": ["eq", "neq", "gte", "lte", "within"]},
|
||||
"value": {"type": ["number", "integer", "boolean", "string"]},
|
||||
"tolerance": {"type": "number", "minimum": 0},
|
||||
"timeout_ms": {"type": "integer", "minimum": 1, "maximum": 3600000}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/common.schema.json",
|
||||
"$defs": {
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "name", "version"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9][a-z0-9._-]{2,127}$"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 128
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?$"
|
||||
},
|
||||
"request_id": {
|
||||
"type": "string",
|
||||
"minLength": 3,
|
||||
"maxLength": 128
|
||||
},
|
||||
"generated_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
},
|
||||
"labels": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"maxLength": 128
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["device"],
|
||||
"properties": {
|
||||
"device": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9_]*$"
|
||||
},
|
||||
"zone": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9_]*$"
|
||||
},
|
||||
"instance": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9_]*$"
|
||||
}
|
||||
}
|
||||
},
|
||||
"transition": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"duration_ms": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 3600000
|
||||
},
|
||||
"profile": {
|
||||
"type": "string",
|
||||
"enum": ["immediate", "linear", "ease_in", "ease_out", "ease_in_out", "device_default"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"failure_policy": {
|
||||
"type": "string",
|
||||
"enum": ["abort", "skip", "continue", "compensate"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/domain-manifest.schema.json",
|
||||
"title": "DomainManifest",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "DomainManifest"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain", "entrypoint", "function_schema", "capabilities", "signal_mapping", "supported_platforms"],
|
||||
"properties": {
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"entrypoint": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_.]*:[A-Za-z_][A-Za-z0-9_]*$"},
|
||||
"function_schema": {"type": "string", "format": "uri-reference"},
|
||||
"capabilities": {"type": "string", "format": "uri-reference"},
|
||||
"signal_mapping": {"type": "string", "format": "uri-reference"},
|
||||
"supported_platforms": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"}
|
||||
},
|
||||
"telemetry_required": {"type": "boolean", "default": true}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/execution-report.schema.json",
|
||||
"title": "ExecutionReport",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "ExecutionReport"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["mode", "status", "started_at", "finished_at", "results"],
|
||||
"properties": {
|
||||
"mode": {"type": "string", "enum": ["dry_run", "hil", "vehicle"]},
|
||||
"status": {"type": "string", "enum": ["succeeded", "partially_succeeded", "failed", "cancelled"]},
|
||||
"started_at": {"type": "string", "format": "date-time"},
|
||||
"finished_at": {"type": "string", "format": "date-time"},
|
||||
"results": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["ref", "domain", "status"],
|
||||
"properties": {
|
||||
"ref": {"type": "string", "minLength": 1},
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"status": {"type": "string", "enum": ["succeeded", "failed", "skipped", "compensated"]},
|
||||
"message": {"type": "string", "maxLength": 1000},
|
||||
"telemetry": {"type": "object"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/function-config.schema.json",
|
||||
"title": "FunctionConfig",
|
||||
"$defs": {
|
||||
"operation": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "capability", "target", "parameters"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "pattern": "^[a-z][a-z0-9_-]{1,63}$"},
|
||||
"capability": {"type": "string", "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"},
|
||||
"target": {"$ref": "common.schema.json#/$defs/target"},
|
||||
"parameters": {"type": "object"},
|
||||
"motion": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["mode", "direction", "start_position_pct", "delta_position_pct"],
|
||||
"properties": {
|
||||
"mode": {"const": "relative"},
|
||||
"direction": {"type": "string", "enum": ["increase", "decrease"]},
|
||||
"start_position_pct": {"type": "integer", "minimum": 0, "maximum": 100},
|
||||
"delta_position_pct": {"type": "integer", "minimum": 0, "maximum": 100},
|
||||
"start_angle_deg": {"type": "number"},
|
||||
"delta_angle_deg": {"type": "number", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"transition": {"$ref": "common.schema.json#/$defs/transition"},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_-]{1,63}$"},
|
||||
"default": []
|
||||
},
|
||||
"timeout_ms": {"type": "integer", "minimum": 1, "maximum": 3600000},
|
||||
"failure_policy": {"$ref": "common.schema.json#/$defs/failure_policy"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "FunctionConfig"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain", "operations"],
|
||||
"properties": {
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"operations": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 64,
|
||||
"items": {"$ref": "#/$defs/operation"}
|
||||
},
|
||||
"assumptions": {
|
||||
"type": "array",
|
||||
"items": {"type": "string", "maxLength": 500},
|
||||
"default": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/function-preset.schema.json",
|
||||
"title": "FunctionPreset",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "FunctionPreset"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain", "operations"],
|
||||
"properties": {
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"operations": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {"$ref": "function-config.schema.json#/$defs/operation"}
|
||||
},
|
||||
"locked_parameters": {
|
||||
"type": "array",
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "minLength": 1}
|
||||
},
|
||||
"applicability": {
|
||||
"type": "object",
|
||||
"additionalProperties": {"type": ["string", "number", "boolean", "array"]}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+61
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/intent-ir.schema.json",
|
||||
"title": "IntentIR",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "IntentIR"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["utterance", "language", "mode", "detected_domains", "requests", "confidence", "requires_confirmation"],
|
||||
"properties": {
|
||||
"utterance": {"type": "string", "minLength": 1, "maxLength": 4000},
|
||||
"language": {"type": "string", "pattern": "^[a-z]{2}(?:-[A-Z]{2})?$"},
|
||||
"mode": {"type": "string", "enum": ["single_domain", "cross_domain"]},
|
||||
"detected_domains": {
|
||||
"type": "array",
|
||||
"minItems": 0,
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}
|
||||
},
|
||||
"requests": {
|
||||
"type": "array",
|
||||
"minItems": 0,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain", "goal"],
|
||||
"properties": {
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"goal": {"type": "string", "minLength": 1, "maxLength": 500},
|
||||
"target": {"$ref": "common.schema.json#/$defs/target"},
|
||||
"parameters": {"type": "object"},
|
||||
"source_span": {"type": "string", "maxLength": 500}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ambiguities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["field", "question"],
|
||||
"properties": {
|
||||
"field": {"type": "string", "minLength": 1},
|
||||
"question": {"type": "string", "minLength": 1},
|
||||
"options": {"type": "array", "items": {"type": ["string", "number", "boolean"]}}
|
||||
}
|
||||
},
|
||||
"default": []
|
||||
},
|
||||
"confidence": {"type": "number", "minimum": 0, "maximum": 1},
|
||||
"requires_confirmation": {"type": "boolean"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/platform-manifest.schema.json",
|
||||
"title": "PlatformManifest",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "PlatformManifest"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["platform", "execution_enabled", "dbc_files", "buses", "supported_domains", "calibrations"],
|
||||
"properties": {
|
||||
"platform": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
|
||||
"execution_enabled": {"type": "boolean"},
|
||||
"dbc_files": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "format": "uri-reference"}
|
||||
},
|
||||
"buses": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "backend", "channel_env"],
|
||||
"properties": {
|
||||
"name": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
|
||||
"backend": {"type": "string", "enum": ["virtual", "socketcan", "pcan", "vector", "zlgcan"]},
|
||||
"channel_env": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]*$"},
|
||||
"fd": {"type": "boolean", "default": false}
|
||||
}
|
||||
}
|
||||
},
|
||||
"supported_domains": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}
|
||||
},
|
||||
"calibrations": {
|
||||
"type": "object",
|
||||
"minProperties": 1,
|
||||
"additionalProperties": {"type": "string", "format": "uri-reference"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+70
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/scene-config.schema.json",
|
||||
"title": "SceneConfig",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "SceneConfig"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["function_refs", "steps", "execution"],
|
||||
"properties": {
|
||||
"function_refs": {
|
||||
"type": "array",
|
||||
"minItems": 2,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "domain", "config_ref"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "pattern": "^[a-z][a-z0-9_-]{1,63}$"},
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"config_ref": {"type": "string", "minLength": 1, "format": "uri-reference"},
|
||||
"sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"steps": {
|
||||
"type": "array",
|
||||
"minItems": 2,
|
||||
"maxItems": 128,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "function_ref"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "pattern": "^[a-z][a-z0-9_-]{1,63}$"},
|
||||
"function_ref": {"type": "string", "pattern": "^[a-z][a-z0-9_-]{1,63}$"},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_-]{1,63}$"},
|
||||
"default": []
|
||||
},
|
||||
"start_offset_ms": {"type": "integer", "minimum": 0, "maximum": 3600000},
|
||||
"failure_policy": {"$ref": "common.schema.json#/$defs/failure_policy"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"execution": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["mode", "default_failure_policy"],
|
||||
"properties": {
|
||||
"mode": {"type": "string", "enum": ["sequential", "parallel", "dag"]},
|
||||
"default_failure_policy": {"$ref": "common.schema.json#/$defs/failure_policy"},
|
||||
"max_parallelism": {"type": "integer", "minimum": 1, "maximum": 16},
|
||||
"scene_timeout_ms": {"type": "integer", "minimum": 1, "maximum": 3600000}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/signal-mapping.schema.json",
|
||||
"title": "SignalMapping",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "metadata", "spec"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "SignalMapping"},
|
||||
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain", "platform", "dbc_ref", "status", "mappings"],
|
||||
"properties": {
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"platform": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
|
||||
"dbc_ref": {"type": "string", "format": "uri-reference"},
|
||||
"matrix_ref": {"type": "string", "format": "uri-reference"},
|
||||
"status": {"type": "string", "enum": ["draft", "hil_verified", "vehicle_verified"]},
|
||||
"mappings": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["capability", "parameter", "compiler_handler"],
|
||||
"properties": {
|
||||
"capability": {"type": "string", "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"},
|
||||
"parameter": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"target_zone": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"physical_target_alias": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"compiler_handler": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
|
||||
"bus": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
|
||||
"message": {"type": "string", "minLength": 1},
|
||||
"signal": {"type": "string", "minLength": 1},
|
||||
"signals": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": {"type": "string", "minLength": 1}
|
||||
},
|
||||
"value_map": {
|
||||
"type": "object",
|
||||
"minProperties": 1,
|
||||
"additionalProperties": {"type": "integer"}
|
||||
},
|
||||
"feedback_message": {"type": "string", "minLength": 1},
|
||||
"feedback_signal": {"type": "string", "minLength": 1},
|
||||
"feedback_handler": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
|
||||
"feedback_value_map": {
|
||||
"type": "object",
|
||||
"minProperties": 1,
|
||||
"additionalProperties": {"type": "integer"}
|
||||
},
|
||||
"calibration_ref": {"type": "string", "format": "uri-reference"},
|
||||
"unit": {"type": "string", "minLength": 1}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://cognitive-agent.local/schemas/trace-event.schema.json",
|
||||
"title": "TraceEvent",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["apiVersion", "kind", "event_id", "request_id", "timestamp", "stage", "status", "summary"],
|
||||
"properties": {
|
||||
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
||||
"kind": {"const": "TraceEvent"},
|
||||
"event_id": {"type": "string", "minLength": 3},
|
||||
"request_id": {"type": "string", "minLength": 3},
|
||||
"timestamp": {"type": "string", "format": "date-time"},
|
||||
"stage": {
|
||||
"type": "string",
|
||||
"enum": ["intent_parse", "context_resolve", "domain_route", "function_generate", "scene_plan", "schema_validate", "domain_validate", "compile", "safety_check", "schedule", "execute", "state_update", "telemetry"]
|
||||
},
|
||||
"status": {"type": "string", "enum": ["started", "succeeded", "failed", "waiting_confirmation", "skipped"]},
|
||||
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
||||
"summary": {"type": "string", "minLength": 1, "maxLength": 1000},
|
||||
"artifact_refs": {
|
||||
"type": "array",
|
||||
"items": {"type": "string", "format": "uri-reference"}
|
||||
},
|
||||
"details": {
|
||||
"type": "object",
|
||||
"description": "Sanitized structured facts only; never store private chain-of-thought or secrets."
|
||||
},
|
||||
"duration_ms": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user