{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://ccc.local/schemas/delegation.schema.json",
"type": "object",
"additionalProperties": false,
"required": [
"delegation_id",
"run_id",
"task_card_id",
"delegated_by_role",
"review_round",
"summary",
"child_agent",
"executor",
"worker_request",
"worker_lifecycle",
"worker_result",
"result_summary",
"reviewer_outcome",
"latest_failure",
"created_at",
"updated_at",
"completed_at"
],
"properties": {
"delegation_id": {
"type": "string",
"pattern": "^delegation-[0-9]{4,}$"
},
"run_id": {
"type": "string",
"minLength": 1
},
"task_card_id": {
"type": "string",
"minLength": 1
},
"source_task_card_id": {
"type": ["string", "null"],
"minLength": 1
},
"delegated_by_role": {
"type": "string",
"enum": ["orchestrator", "way", "explorer", "code specialist", "documenter", "verifier"]
},
"review_round": {
"type": ["integer", "null"],
"minimum": 0
},
"summary": {
"type": "string",
"minLength": 1
},
"child_agent": {
"$ref": "#/$defs/childAgent"
},
"executor": {
"$ref": "#/$defs/specialistExecutor"
},
"worker_request": {
"anyOf": [
{
"$ref": "#/$defs/workerRequest"
},
{
"type": "null"
}
]
},
"worker_role_config_snapshot": {
"anyOf": [
{
"$ref": "#/$defs/taskRoleConfigSnapshot"
},
{
"type": "null"
}
]
},
"worker_launch_evidence": {
"anyOf": [
{
"$ref": "#/$defs/roleModelLaunchEvidence"
},
{
"type": "null"
}
]
},
"worker_policy_decision": {
"anyOf": [
{
"$ref": "#/$defs/workerPolicyDecision"
},
{
"type": "null"
}
]
},
"worker_lifecycle": {
"anyOf": [
{
"$ref": "#/$defs/workerLifecycle"
},
{
"type": "null"
}
]
},
"worker_result": {
"anyOf": [
{
"$ref": "#/$defs/workerResult"
},
{
"type": "null"
}
]
},
"result_summary": {
"type": ["string", "null"],
"minLength": 1
},
"reviewer_outcome": {
"anyOf": [
{
"$ref": "#/$defs/reviewerOutcome"
},
{
"type": "null"
}
]
},
"latest_failure": {
"anyOf": [
{
"$ref": "#/$defs/failureRecord"
},
{
"type": "null"
}
]
},
"fan_in_collapsed_at": {
"type": ["string", "null"],
"minLength": 1
},
"created_at": {
"type": "string",
"minLength": 1
},
"updated_at": {
"type": "string",
"minLength": 1
},
"completed_at": {
"type": ["string", "null"],
"minLength": 1
}
},
"$defs": {
"childAgent": {
"type": "object",
"additionalProperties": false,
"required": ["agent_id", "parent_agent_id", "role", "status", "task_card_id"],
"properties": {
"agent_id": {
"type": "string",
"minLength": 1
},
"parent_agent_id": {
"type": ["string", "null"],
"minLength": 1
},
"role": {
"type": "string",
"enum": ["orchestrator", "way", "explorer", "code specialist", "documenter", "verifier"]
},
"status": {
"type": "string",
"enum": ["queued", "running", "completed", "failed", "cancelled"]
},
"task_card_id": {
"type": ["string", "null"],
"minLength": 1
},
"lane_id": {
"type": ["string", "null"],
"enum": ["raider-a", "raider-b", "raider-c", "raider-d", null]
}
}
},
"specialistExecutor": {
"type": "object",
"additionalProperties": false,
"required": ["executor_id", "status", "task_card_id", "delegation_id", "child_agent_id"],
"properties": {
"executor_id": {
"type": "string",
"minLength": 1
},
"status": {
"type": "string",
"enum": ["queued", "running", "completed", "failed", "cancelled"]
},
"task_card_id": {
"type": "string",
"minLength": 1
},
"lane_id": {
"type": ["string", "null"],
"enum": ["raider-a", "raider-b", "raider-c", "raider-d", null]
},
"delegation_id": {
"type": "string",
"pattern": "^delegation-[0-9]{4,}$"
},
"child_agent_id": {
"type": "string",
"minLength": 1
}
}
},
"reviewerOutcome": {
"type": "object",
"additionalProperties": false,
"required": ["outcome", "summary", "recorded_at"],
"properties": {
"outcome": {
"type": "string",
"enum": ["passed", "needs_work", "blocked"]
},
"summary": {
"type": "string",
"minLength": 1
},
"recorded_at": {
"type": "string",
"minLength": 1
}
}
},
"workerRequest": {
"type": "object",
"additionalProperties": false,
"required": ["prompt", "acceptance"],
"properties": {
"prompt": {
"type": "string",
"minLength": 1
},
"acceptance": {
"type": "string",
"minLength": 1
},
"workflow_skill_id": {
"type": ["string", "null"],
"minLength": 1
},
"workflow_step_index": {
"type": ["integer", "null"],
"minimum": 1
},
"workflow_step_skill_id": {
"type": ["string", "null"],
"minLength": 1
},
"workflow_next_step_skill_id": {
"type": ["string", "null"],
"minLength": 1
},
"scope": {
"type": ["string", "null"],
"minLength": 1
},
"slice_label": {
"type": ["string", "null"],
"minLength": 1
},
"partition_strategy": {
"type": ["string", "null"],
"enum": ["directory", "role_surface", "artifact_type", "code_doc_test_split", null]
},
"coverage_focus": {
"type": "array",
"items": {
"type": "string",
"enum": ["file_candidates", "code_structure", "recent_changes", "tests", "schema", "docs"]
}
},
"coverage_rules": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
}
},
"workerLifecycle": {
"type": "object",
"additionalProperties": false,
"required": [
"state",
"reclaim_state",
"queued_at",
"launch_requested_at",
"started_at",
"last_progress_at",
"returned_at",
"stale_at",
"timed_out_at",
"stale_after_ms",
"timeout_after_ms",
"summary"
],
"properties": {
"state": {
"type": "string",
"enum": ["queued", "launching", "running", "returned", "failed", "cancelled", "stale", "timed_out"]
},
"reclaim_state": {
"type": "string",
"enum": ["not_needed", "reclaim_needed", "resumable", "reclaimed"]
},
"queued_at": {
"type": "string",
"minLength": 1
},
"launch_requested_at": {
"type": ["string", "null"],
"minLength": 1
},
"started_at": {
"type": ["string", "null"],
"minLength": 1
},
"process_id": {
"type": ["integer", "null"],
"minimum": 1
},
"process_started_at": {
"type": ["string", "null"],
"minLength": 1
},
"process_last_seen_at": {
"type": ["string", "null"],
"minLength": 1
},
"last_progress_at": {
"type": "string",
"minLength": 1
},
"returned_at": {
"type": ["string", "null"],
"minLength": 1
},
"stale_at": {
"type": ["string", "null"],
"minLength": 1
},
"timed_out_at": {
"type": ["string", "null"],
"minLength": 1
},
"stale_after_ms": {
"type": "integer",
"minimum": 1
},
"timeout_after_ms": {
"type": "integer",
"minimum": 1
},
"summary": {
"type": "string",
"minLength": 1
}
}
},
"workerPolicyDecision": {
"type": "object",
"additionalProperties": false,
"required": [
"outcome",
"configured_role",
"selected_agent_id",
"allowed_agent_ids",
"configured_model_tier",
"requested_model_tier",
"allowed_model_tiers",
"configured_variant",
"requested_variant",
"rejection_reason",
"read_only_fallback_allowed",
"summary",
"recorded_at"
],
"properties": {
"outcome": {
"type": "string",
"enum": ["allowed", "policy_blocked", "policy_retryable", "policy_override_required"]
},
"configured_role": {
"type": "string",
"enum": ["orchestrator", "way", "explorer", "code specialist", "documenter", "verifier"]
},
"selected_agent_id": {
"type": ["string", "null"],
"minLength": 1
},
"allowed_agent_ids": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"configured_model_tier": {
"type": "string",
"enum": ["low_cost", "standard", "high_tier"]
},
"requested_model_tier": {
"type": ["string", "null"],
"enum": ["low_cost", "standard", "high_tier", null]
},
"allowed_model_tiers": {
"type": "array",
"items": {
"type": "string",
"enum": ["low_cost", "standard", "high_tier"]
}
},
"configured_variant": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", "xhigh", null]
},
"requested_variant": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", "xhigh", null]
},
"rejection_reason": {
"type": ["string", "null"],
"enum": ["role_mismatch", "agent_mismatch", "model_tier_mismatch", "reasoning_tier_mismatch", "write_scope_requires_worker", "unknown", null]
},
"read_only_fallback_allowed": {
"type": "boolean"
},
"summary": {
"type": "string",
"minLength": 1
},
"recorded_at": {
"type": "string",
"minLength": 1
}
}
},
"taskRoleConfigSnapshot": {
"type": "object",
"additionalProperties": false,
"required": ["source", "role", "profile", "model", "variant", "fast_mode", "config_entries"],
"properties": {
"source": {
"const": "shared_role_config"
},
"role": {
"type": "string",
"enum": ["orchestrator", "way", "explorer", "code specialist", "documenter", "verifier"]
},
"profile": {
"type": ["string", "null"],
"minLength": 1
},
"model": {
"type": ["string", "null"],
"minLength": 1
},
"variant": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", "xhigh", null]
},
"fast_mode": {
"type": "boolean"
},
"config_entries": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
}
},
"roleModelLaunchEvidence": {
"type": "object",
"additionalProperties": false,
"required": [
"role",
"request_kind",
"launch_source",
"codex_path",
"configured_profile",
"configured_model",
"configured_variant",
"configured_fast_mode",
"dispatched_profile",
"dispatched_model",
"dispatched_variant",
"dispatched_fast_mode",
"dispatched_config_entries",
"actual_profile",
"actual_model",
"actual_variant",
"actual_fast_mode",
"actual_config_entries",
"observed_profile",
"observed_model",
"observed_variant",
"observed_source",
"observed_confidence",
"observed_capability",
"observation_status",
"observation_match_state",
"observation_unavailable_reason",
"observation_mismatch_summary",
"match_state",
"mismatch_summary",
"recorded_at"
],
"properties": {
"role": {
"type": "string",
"enum": ["orchestrator", "way", "explorer", "code specialist", "documenter", "verifier"]
},
"request_kind": {
"type": "string",
"enum": ["execution", "verification", "way", "advisory"]
},
"launch_source": {
"const": "ccc_spawn"
},
"codex_path": {
"type": "string",
"minLength": 1
},
"configured_profile": {
"type": ["string", "null"],
"minLength": 1
},
"configured_model": {
"type": ["string", "null"],
"minLength": 1
},
"configured_variant": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", "xhigh", null]
},
"configured_fast_mode": {
"type": "boolean"
},
"dispatched_profile": {
"type": ["string", "null"],
"minLength": 1
},
"dispatched_model": {
"type": ["string", "null"],
"minLength": 1
},
"dispatched_variant": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", "xhigh", null]
},
"dispatched_fast_mode": {
"type": "boolean"
},
"dispatched_config_entries": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"actual_profile": {
"type": ["string", "null"],
"minLength": 1
},
"actual_model": {
"type": ["string", "null"],
"minLength": 1
},
"actual_variant": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", "xhigh", null]
},
"actual_fast_mode": {
"type": "boolean"
},
"actual_config_entries": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"observed_profile": {
"type": ["string", "null"],
"minLength": 1
},
"observed_model": {
"type": ["string", "null"],
"minLength": 1
},
"observed_variant": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", "xhigh", null]
},
"observed_source": {
"type": ["string", "null"],
"enum": ["codex_state_db", "provider_surface", null]
},
"observed_confidence": {
"type": ["string", "null"],
"enum": ["best_effort_local", "provider_confirmed", null]
},
"observed_capability": {
"type": "string",
"enum": ["thread_observable", "launch_request_only", "unsupported"]
},
"observation_status": {
"type": "string",
"enum": ["not_started", "observed", "unavailable"]
},
"observation_match_state": {
"type": "string",
"enum": ["not_started", "matched", "mismatch", "unavailable"]
},
"observation_unavailable_reason": {
"type": ["string", "null"],
"enum": ["unsupported", "no_thread_id", "temporary_probe_failure", "environment_limited", "surface_mismatch", null]
},
"observation_mismatch_summary": {
"type": ["string", "null"],
"minLength": 1
},
"match_state": {
"type": "string",
"enum": ["verified_match", "mismatch"]
},
"mismatch_summary": {
"type": ["string", "null"],
"minLength": 1
},
"recorded_at": {
"type": "string",
"minLength": 1
}
}
},
"workerResult": {
"type": "object",
"additionalProperties": false,
"required": [
"thread_id",
"raw_events_file",
"scope",
"evidence_paths",
"confidence",
"uncertainty_summary",
"summary",
"recorded_at"
],
"properties": {
"thread_id": {
"type": ["string", "null"],
"minLength": 1
},
"raw_events_file": {
"type": ["string", "null"],
"minLength": 1
},
"scope": {
"type": ["string", "null"],
"minLength": 1
},
"slice_label": {
"type": ["string", "null"],
"minLength": 1
},
"partition_strategy": {
"type": ["string", "null"],
"enum": ["directory", "role_surface", "artifact_type", "code_doc_test_split", null]
},
"coverage_focus": {
"type": "array",
"items": {
"type": "string",
"enum": ["file_candidates", "code_structure", "recent_changes", "tests", "schema", "docs"]
}
},
"key_findings": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"evidence_paths": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"confidence": {
"type": ["string", "null"],
"enum": ["low", "medium", "high", null]
},
"uncertainty_summary": {
"type": ["string", "null"],
"minLength": 1
},
"summary": {
"type": "string",
"minLength": 1
},
"recorded_at": {
"type": "string",
"minLength": 1
}
}
},
"failureRecord": {
"type": "object",
"additionalProperties": false,
"required": ["stage", "reason", "summary", "recorded_at"],
"properties": {
"stage": {
"type": "string",
"enum": ["way", "handoff", "execution", "verification", "compatibility"]
},
"reason": {
"type": "string",
"enum": [
"surface_mismatch",
"invalid_output",
"timeout",
"verification_failed",
"blocked_dependency",
"cancelled",
"unknown"
]
},
"summary": {
"type": "string",
"minLength": 1
},
"recorded_at": {
"type": "string",
"minLength": 1
}
}
}
}
}