Orchestrata Ultimate / Specs / 001-kernel
001-kernel: Orchestration Kernel (U:KR)
The Orchestration Kernel (U:KR) is the central nervous system of Orchestrata. It manages Volk (agent) registration, message routing, governance policy enforcement, session lifecycle, escalation handling, workflow orchestration, resource management, and audit trail logging.
At a glance
| Item | Value |
|---|---|
| Spec directory | specs/001-kernel/ |
| Status line in the spec | Complete |
| Requirement IDs defined | 373 |
With a @traces citation in src/ |
298 (79.9%) |
With a @traces citation in tests/ |
64 (17.2%) |
| Tracked files | 9 |
| RTM page | 001-kernel |
Reading this spec
The Orchestration Kernel (U:KR) is the central nervous system of Orchestrata. It is the single coordination point for a multi-agent system: it registers Volks (agents), routes messages between them, enforces governance policy, manages sessions, handles escalations, runs workflows, manages resources and writes the audit trail.
The scope is ten user stories: Volk registration and discovery, message routing and dispatch, governance policy enforcement, session management, escalation handling, workflow orchestration, resource management, audit trail logging, configuration management, and performance and scalability. Requirement IDs take the form REQ-001-US-nnn for story requirements. Registration, routing and governance are marked critical; the workflow and resource stories are medium priority.
The design constraints stated in the overview are these. State is held in Redis. Governance decisions come from Prolog queries. All inter-agent communication uses the CXP protocol. The architecture is async-first for performance. The stated goals are deterministic message routing, governance enforced at the infrastructure level, scale to more than 1000 concurrent agents and a complete audit trail for compliance.
In the code, the kernel is spread over many modules. The largest tracers are orchestrata_ultimate/kernel/audit/logger for the audit trail, orchestrata_ultimate/kernel/config_manager for configuration, orchestrata_ultimate/core/protocols/decoupling, orchestrata_ultimate/agents/volk_registry for registration, and orchestrata_ultimate/kernel/router for routing. The per-requirement view is on the RTM page.
The spec's status line reads Complete. It tracks 9 files and defines 373 requirement IDs. The full text follows below.
Measured coverage is 298 of 373 requirements cited by at least one @traces in src/ (79.9%), spread over 129 modules; the module citing the most of them is orchestrata_ultimate/kernel/audit/logger (32 requirements). In tests/, 64 requirements are cited by a test-side @traces.
Coverage gaps: 75 requirements have no citing symbol. The largest untraced groups are REQ-001-US-006 (27), REQ-001-US-007 (15), REQ-001-US-005 (12). Untraced means no @traces names the ID; the behaviour may still exist in code that was never annotated. Test-side citations are thinner than code-side ones (64 against 298).
Requirements
Checkbox is the state recorded in the requirements checklist; Traced by is the count of src/ symbols whose @traces names the ID.
| ID | Done | Requirement | Traced by |
|---|---|---|---|
REQ-001-001 |
yes | Volk can register with unique alias (e.g., U:Ox, U:PS) | 9 |
REQ-001-002 |
yes | Registration includes capabilities declaration | 2 |
REQ-001-003 |
yes | Registration includes supported protocols (CXP, gRPC, WS) | 2 |
REQ-001-004 |
yes | Registration includes resource requirements | 2 |
REQ-001-005 |
yes | Registration validates alias uniqueness | 4 |
REQ-001-006 |
yes | Registration validates capability schema | 3 |
REQ-001-007 |
yes | Registration returns registration token | 3 |
REQ-001-008 |
yes | Registration updates Volk registry | 6 |
REQ-001-009 |
yes | Registration notifies other Volks of new agent | 8 |
REQ-001-010 |
yes | Registration persists to Redis state | 2 |
REQ-001-011 |
yes | Volk can query all registered Volks | 6 |
REQ-001-012 |
yes | Volk can query Volks by capability | 3 |
REQ-001-013 |
yes | Volk can query Volks by protocol support | 2 |
REQ-001-014 |
yes | Volk can subscribe to registry updates | 10 |
REQ-001-015 |
yes | Discovery returns Volk metadata (alias, capabilities, protocols) | 9 |
REQ-001-016 |
yes | Discovery uses caching for performance | 2 |
REQ-001-017 |
yes | Discovery handles partial failures gracefully | 5 |
REQ-001-018 |
yes | Discovery provides health status for each Volk | 23 |
REQ-001-019 |
yes | Discovery supports filtering and pagination | 4 |
REQ-001-020 |
yes | Discovery validates query parameters | 2 |
REQ-001-021 |
yes | Volk can deregister cleanly | 5 |
REQ-001-022 |
yes | Deregistration notifies dependent Volks | 8 |
REQ-001-023 |
yes | Deregistration updates registry | 1 |
REQ-001-024 |
yes | Deregistration cleans up resources | 2 |
REQ-001-025 |
yes | Deregistration handles in-flight messages | 5 |
REQ-001-US-002-001 |
yes | Route message based on TO field in CXP packet | 22 |
REQ-001-US-002-002 |
yes | Validate FROM field matches sender identity | 1 |
REQ-001-US-002-003 |
yes | Support unicast (single recipient) routing | 12 |
REQ-001-US-002-004 |
yes | Support multicast (multiple recipients) routing | 5 |
REQ-001-US-002-005 |
yes | Support broadcast (all Volks) routing | 6 |
REQ-001-US-002-006 |
yes | Route to specific Volk instance by alias | 3 |
REQ-001-US-002-007 |
yes | Route to Volk role (e.g., any QA agent) | 2 |
REQ-001-US-002-008 |
yes | Handle routing to offline Volks | 8 |
REQ-001-US-002-009 |
yes | Handle routing to unknown recipients | 8 |
REQ-001-US-002-010 |
yes | Validate message schema before routing | 3 |
REQ-001-US-002-011 |
yes | Dispatch message via Volk-specified protocol | 5 |
REQ-001-US-002-012 |
yes | Support CXP over gRPC dispatch | 9 |
REQ-001-US-002-013 |
yes | Support CXP over WebSocket dispatch | 3 |
REQ-001-US-002-014 |
yes | Support CXP over HTTP dispatch | 3 |
REQ-001-US-002-015 |
yes | Retry failed dispatches with exponential backoff | 4 |
REQ-001-US-002-016 |
yes | Track dispatch attempts and failures | 7 |
REQ-001-US-002-017 |
yes | Timeout stale dispatch attempts | 3 |
REQ-001-US-002-018 |
yes | Queue messages for offline Volks | 1 |
REQ-001-US-002-019 |
yes | Provide delivery acknowledgments | 6 |
REQ-001-US-002-020 |
yes | Handle partial delivery failures (multicast) | none |
REQ-001-US-002-021 |
yes | Queue messages when recipient unavailable | 4 |
REQ-001-US-002-022 |
yes | Persist queue to Redis for durability | 8 |
REQ-001-US-002-023 |
yes | Support priority queuing (urgent messages first) | 3 |
REQ-001-US-002-024 |
yes | Apply backpressure when queue full | 3 |
REQ-001-US-002-025 |
yes | Monitor queue depth and latency | 4 |
REQ-001-US-002-026 |
yes | Expire stale messages from queue | 1 |
REQ-001-US-002-027 |
yes | Support dead-letter queue for failed messages | 4 |
REQ-001-US-002-028 |
yes | Provide queue statistics (depth, rate, latency) | 6 |
REQ-001-US-002-029 |
yes | Support queue inspection for debugging | 1 |
REQ-001-US-002-030 |
yes | Handle queue overflow gracefully | 6 |
REQ-001-US-002-031 |
yes | Track message status: queued | 6 |
REQ-001-US-002-032 |
yes | Track message status: dispatched | 2 |
REQ-001-US-002-033 |
yes | Track message status: delivered | 9 |
REQ-001-US-002-034 |
yes | Track message status: acknowledged | 4 |
REQ-001-US-002-035 |
yes | Track message status: failed | 9 |
REQ-001-US-002-036 |
yes | Provide message status query API | 4 |
REQ-001-US-002-037 |
yes | Store status transitions with timestamps | 6 |
REQ-001-US-002-038 |
yes | Notify sender of status changes | 7 |
REQ-001-US-002-039 |
yes | Support message tracing across hops | 12 |
REQ-001-US-002-040 |
yes | Generate routing metrics (latency, success rate) | 5 |
REQ-001-US-003-001 |
yes | Query Prolog for routing decisions | 14 |
REQ-001-US-003-002 |
yes | Query Prolog for permission checks | 12 |
REQ-001-US-003-003 |
yes | Query Prolog for ownership validation | 6 |
REQ-001-US-003-004 |
yes | Query Prolog for escalation rules | 3 |
REQ-001-US-003-005 |
yes | Cache Prolog query results for performance | 13 |
REQ-001-US-003-006 |
yes | Invalidate cache on policy updates | 4 |
REQ-001-US-003-007 |
yes | Handle Prolog query timeouts | 2 |
REQ-001-US-003-008 |
yes | Handle Prolog query failures | 6 |
REQ-001-US-003-009 |
yes | Log all policy queries for audit | 6 |
REQ-001-US-003-010 |
yes | Support policy dry-run mode (testing) | 3 |
REQ-001-US-003-011 |
yes | Validate message sender has authority | 9 |
REQ-001-US-003-012 |
yes | Validate message recipient is correct owner | 4 |
REQ-001-US-003-013 |
yes | Enforce component ownership boundaries | 8 |
REQ-001-US-003-014 |
yes | Block unauthorized cross-boundary messages | 4 |
REQ-001-US-003-015 |
yes | Allow whitelisted cross-boundary exceptions | 3 |
REQ-001-US-003-016 |
yes | Validate workflow step permissions | 3 |
REQ-001-US-003-017 |
yes | Enforce read/write/execute permissions | 5 |
REQ-001-US-003-018 |
yes | Support ownership delegation | 8 |
REQ-001-US-003-019 |
yes | Support temporary permission grants | 3 |
REQ-001-US-003-020 |
yes | Log all permission violations | 4 |
REQ-001-US-003-021 |
yes | Detect conflicts requiring escalation | 4 |
REQ-001-US-003-022 |
yes | Query Prolog for escalation path | 3 |
REQ-001-US-003-023 |
yes | Route escalation to correct authority (e.g., U:Ox) | 6 |
REQ-001-US-003-024 |
yes | Track escalation history | 9 |
REQ-001-US-003-025 |
yes | Timeout stale escalations | 2 |
REQ-001-US-003-026 |
yes | Notify stakeholders of escalation | 2 |
REQ-001-US-003-027 |
yes | Support escalation priority levels | none |
REQ-001-US-003-028 |
yes | Handle recursive escalations | 2 |
REQ-001-US-003-029 |
yes | Provide escalation resolution feedback | 2 |
REQ-001-US-003-030 |
yes | Log all escalation events | 2 |
REQ-001-US-004-001 |
yes | Create new session with unique session ID | 3 |
REQ-001-US-004-002 |
yes | Initialize session context (facts, portfolio, carryover) | none |
REQ-001-US-004-003 |
yes | Load session-specific Prolog rules | 1 |
REQ-001-US-004-004 |
yes | Notify all Volks of session start | none |
REQ-001-US-004-005 |
yes | Persist session metadata to Redis | 6 |
REQ-001-US-004-006 |
yes | Support session templates (pre-configured sessions) | none |
REQ-001-US-004-007 |
yes | Validate session configuration | none |
REQ-001-US-004-008 |
yes | Handle concurrent session initialization | none |
REQ-001-US-004-009 |
yes | Set session resource limits | 3 |
REQ-001-US-004-010 |
yes | Log session initialization events | 2 |
REQ-001-US-004-011 |
yes | Maintain session-specific facts | 7 |
REQ-001-US-004-012 |
yes | Maintain session portfolio (artifacts) | 2 |
REQ-001-US-004-013 |
yes | Maintain session carryover (todos) | 7 |
REQ-001-US-004-014 |
yes | Isolate session state from other sessions | 4 |
REQ-001-US-004-015 |
yes | Support session context queries | 4 |
REQ-001-US-004-016 |
yes | Support session context updates | 8 |
REQ-001-US-004-017 |
yes | Validate context schema | 6 |
REQ-001-US-004-018 |
yes | Persist context changes to Redis | 7 |
REQ-001-US-004-019 |
yes | Handle context merge conflicts | none |
REQ-001-US-004-020 |
yes | Provide context versioning | none |
REQ-001-US-004-021 |
yes | Gracefully terminate session | 4 |
REQ-001-US-004-022 |
yes | Archive session artifacts | 3 |
REQ-001-US-004-023 |
yes | Clean up session resources | 7 |
REQ-001-US-004-024 |
yes | Notify all Volks of session end | 1 |
REQ-001-US-004-025 |
yes | Generate session summary report | none |
REQ-001-US-004-026 |
yes | Persist final session state | 2 |
REQ-001-US-004-027 |
yes | Handle forced session termination | 1 |
REQ-001-US-004-028 |
yes | Transfer carryover to next session | 4 |
REQ-001-US-004-029 |
yes | Log session teardown events | 2 |
REQ-001-US-004-030 |
yes | Validate session closure conditions | none |
REQ-001-US-005-001 |
yes | Detect ownership conflicts | 4 |
REQ-001-US-005-002 |
yes | Detect permission conflicts | 3 |
REQ-001-US-005-003 |
yes | Detect resource conflicts | 3 |
REQ-001-US-005-004 |
yes | Detect workflow deadlocks | none |
REQ-001-US-005-005 |
yes | Detect policy violations | 1 |
REQ-001-US-005-006 |
yes | Classify conflict severity (low, medium, high, critical) | none |
REQ-001-US-005-007 |
yes | Log conflict detection events | 1 |
REQ-001-US-005-008 |
yes | Notify involved Volks of conflict | none |
REQ-001-US-005-009 |
yes | Track conflict resolution time | none |
REQ-001-US-005-010 |
yes | Generate conflict metrics | none |
REQ-001-US-005-011 |
yes | Query Prolog for escalation authority | 4 |
REQ-001-US-005-012 |
yes | Route escalation to U:Ox (Orchestrator) | 2 |
REQ-001-US-005-013 |
yes | Route escalation to component owner | none |
REQ-001-US-005-014 |
yes | Support multi-level escalation paths | 8 |
REQ-001-US-005-015 |
yes | Handle circular escalation dependencies | 4 |
REQ-001-US-005-016 |
yes | Timeout stale escalations | 7 |
REQ-001-US-005-017 |
yes | Provide escalation context (parties, issue, history) | 4 |
REQ-001-US-005-018 |
yes | Support escalation priority override | 1 |
REQ-001-US-005-019 |
yes | Log escalation routing decisions | 2 |
REQ-001-US-005-020 |
yes | Track escalation routing latency | none |
REQ-001-US-005-021 |
yes | Apply escalation resolution decision | 9 |
REQ-001-US-005-022 |
yes | Notify all parties of resolution | none |
REQ-001-US-005-023 |
yes | Update Prolog rules if needed | none |
REQ-001-US-005-024 |
yes | Log resolution for future reference | 5 |
REQ-001-US-005-025 |
yes | Support resolution appeals | none |
REQ-001-US-005-026 |
yes | Track resolution compliance | 1 |
REQ-001-US-005-027 |
yes | Generate resolution metrics | 2 |
REQ-001-US-005-028 |
yes | Archive escalation history | 2 |
REQ-001-US-005-029 |
yes | Learn from escalation patterns | none |
REQ-001-US-005-030 |
yes | Prevent similar future escalations | none |
REQ-001-US-006-001 |
yes | Parse workflow definitions (YAML or JSON) | none |
REQ-001-US-006-002 |
yes | Validate workflow schema | none |
REQ-001-US-006-003 |
yes | Support sequential workflow steps | none |
REQ-001-US-006-004 |
yes | Support parallel workflow steps | none |
REQ-001-US-006-005 |
yes | Support conditional branching (if/else) | none |
REQ-001-US-006-006 |
yes | Support loops and retries | none |
REQ-001-US-006-007 |
yes | Define step dependencies (DAG) | none |
REQ-001-US-006-008 |
yes | Define step timeouts | none |
REQ-001-US-006-009 |
yes | Define step rollback actions | none |
REQ-001-US-006-010 |
yes | Persist workflow definitions | none |
REQ-001-US-006-011 |
yes | Initialize workflow instance | none |
REQ-001-US-006-012 |
yes | Execute steps in dependency order | none |
REQ-001-US-006-013 |
yes | Track step completion status | none |
REQ-001-US-006-014 |
yes | Handle step failures with retries | none |
REQ-001-US-006-015 |
yes | Apply step timeouts | none |
REQ-001-US-006-016 |
yes | Support workflow pause/resume | 3 |
REQ-001-US-006-017 |
yes | Support workflow cancellation | none |
REQ-001-US-006-018 |
yes | Collect step outputs for next steps | 8 |
REQ-001-US-006-019 |
yes | Pass context between steps | none |
REQ-001-US-006-020 |
yes | Log workflow execution events | 4 |
REQ-001-US-006-021 |
yes | Provide workflow status query API | none |
REQ-001-US-006-022 |
yes | Track workflow progress percentage | none |
REQ-001-US-006-023 |
yes | Track step-level metrics (duration, success rate) | none |
REQ-001-US-006-024 |
yes | Generate workflow execution reports | none |
REQ-001-US-006-025 |
yes | Alert on workflow failures | none |
REQ-001-US-006-026 |
yes | Support workflow debugging | none |
REQ-001-US-006-027 |
yes | Visualize workflow state | none |
REQ-001-US-006-028 |
yes | Archive completed workflows | none |
REQ-001-US-006-029 |
yes | Support workflow replay (for debugging) | none |
REQ-001-US-006-030 |
yes | Generate workflow analytics | none |
REQ-001-US-007-001 |
yes | Track available system resources (CPU, memory, network) | 3 |
REQ-001-US-007-002 |
yes | Allocate resources to Volks on request | none |
REQ-001-US-007-003 |
yes | Enforce resource quotas per Volk | none |
REQ-001-US-007-004 |
yes | Support resource reservation (future allocation) | none |
REQ-001-US-007-005 |
yes | Handle resource contention (prioritization) | 1 |
REQ-001-US-007-006 |
yes | Deallocate resources when Volk completes | none |
REQ-001-US-007-007 |
yes | Reclaim resources from idle Volks | none |
REQ-001-US-007-008 |
yes | Log resource allocation events | 1 |
REQ-001-US-007-009 |
yes | Track resource utilization metrics | 2 |
REQ-001-US-007-010 |
yes | Alert on resource exhaustion | 5 |
REQ-001-US-007-011 |
yes | Enforce per-Volk CPU limits | 2 |
REQ-001-US-007-012 |
yes | Enforce per-Volk memory limits | 2 |
REQ-001-US-007-013 |
yes | Enforce per-Volk network bandwidth limits | none |
REQ-001-US-007-014 |
yes | Enforce per-Volk storage limits | none |
REQ-001-US-007-015 |
yes | Enforce system-wide resource limits | none |
REQ-001-US-007-016 |
yes | Throttle Volks exceeding limits | none |
REQ-001-US-007-017 |
yes | Terminate Volks violating hard limits | none |
REQ-001-US-007-018 |
yes | Log limit violations | none |
REQ-001-US-007-019 |
yes | Notify Volks of approaching limits | 1 |
REQ-001-US-007-020 |
yes | Support dynamic limit adjustments | 1 |
REQ-001-US-007-021 |
yes | Monitor CPU usage per Volk | 1 |
REQ-001-US-007-022 |
yes | Monitor memory usage per Volk | 1 |
REQ-001-US-007-023 |
yes | Monitor network usage per Volk | none |
REQ-001-US-007-024 |
yes | Monitor storage usage per Volk | 1 |
REQ-001-US-007-025 |
yes | Provide resource usage query API | 2 |
REQ-001-US-007-026 |
yes | Generate resource usage reports | 2 |
REQ-001-US-007-027 |
yes | Track resource usage trends | 4 |
REQ-001-US-007-028 |
yes | Alert on anomalous resource usage | none |
REQ-001-US-007-029 |
yes | Support resource profiling | none |
REQ-001-US-007-030 |
yes | Archive resource usage history | none |
REQ-001-US-008-001 |
yes | Log all message routing decisions | 3 |
REQ-001-US-008-002 |
yes | Log all policy queries and results | 3 |
REQ-001-US-008-003 |
yes | Log all escalation events | 4 |
REQ-001-US-008-004 |
yes | Log all session lifecycle events | 2 |
REQ-001-US-008-005 |
yes | Log all resource allocation events | 2 |
REQ-001-US-008-006 |
yes | Log all workflow execution steps | 2 |
REQ-001-US-008-007 |
yes | Log all Volk registration/deregistration | 5 |
REQ-001-US-008-008 |
yes | Include timestamps in all log entries | 4 |
REQ-001-US-008-009 |
yes | Include session context in log entries | 3 |
REQ-001-US-008-010 |
yes | Include correlation IDs for tracing | 3 |
REQ-001-US-008-011 |
yes | Persist logs to Neo4j knowledge graph | 6 |
REQ-001-US-008-012 |
yes | Persist logs to file system | 6 |
REQ-001-US-008-013 |
yes | Support log rotation (size and time-based) | 4 |
REQ-001-US-008-014 |
yes | Compress archived logs | 4 |
REQ-001-US-008-015 |
yes | Support log retention policies | 3 |
REQ-001-US-008-016 |
yes | Encrypt sensitive log data | 3 |
REQ-001-US-008-017 |
yes | Support log export (JSON, CSV) | 1 |
REQ-001-US-008-018 |
yes | Handle log storage failures gracefully | 9 |
REQ-001-US-008-019 |
yes | Provide log backup/restore | 2 |
REQ-001-US-008-020 |
yes | Support multi-destination logging | 11 |
REQ-001-US-008-021 |
yes | Query logs by session ID | 1 |
REQ-001-US-008-022 |
yes | Query logs by Volk alias | 1 |
REQ-001-US-008-023 |
yes | Query logs by event type | 1 |
REQ-001-US-008-024 |
yes | Query logs by time range | 1 |
REQ-001-US-008-025 |
yes | Query logs by correlation ID | 1 |
REQ-001-US-008-026 |
yes | Support full-text log search | 3 |
REQ-001-US-008-027 |
yes | Support log filtering and aggregation | 2 |
REQ-001-US-008-028 |
yes | Provide log visualization | none |
REQ-001-US-008-029 |
yes | Support log export for external analysis | 1 |
REQ-001-US-008-030 |
yes | Generate audit reports from logs | 1 |
REQ-001-US-009-001 |
yes | Load configuration from YAML files | 10 |
REQ-001-US-009-002 |
yes | Load configuration from environment variables | 9 |
REQ-001-US-009-003 |
yes | Load configuration from Redis | 4 |
REQ-001-US-009-004 |
yes | Validate configuration schema | 15 |
REQ-001-US-009-005 |
yes | Support configuration defaults | 1 |
REQ-001-US-009-006 |
yes | Support configuration overrides (env > file > defaults) | 9 |
REQ-001-US-009-007 |
yes | Log configuration loading events | 2 |
REQ-001-US-009-008 |
yes | Handle configuration loading errors | 2 |
REQ-001-US-009-009 |
yes | Support encrypted configuration values | 4 |
REQ-001-US-009-010 |
yes | Persist configuration to Redis | 2 |
REQ-001-US-009-011 |
yes | Reload configuration without restart | 9 |
REQ-001-US-009-012 |
yes | Apply configuration changes incrementally | 4 |
REQ-001-US-009-013 |
yes | Validate configuration before applying | 3 |
REQ-001-US-009-014 |
yes | Rollback invalid configuration changes | 3 |
REQ-001-US-009-015 |
yes | Notify Volks of configuration changes | 4 |
REQ-001-US-009-016 |
yes | Support configuration versioning | 6 |
REQ-001-US-009-017 |
yes | Track configuration change history | 5 |
REQ-001-US-009-018 |
yes | Log all configuration changes | 1 |
REQ-001-US-009-019 |
yes | Support configuration dry-run (test mode) | 1 |
REQ-001-US-009-020 |
yes | Provide configuration diff API | 1 |
REQ-001-US-009-021 |
yes | Query current configuration | 4 |
REQ-001-US-009-022 |
yes | Query configuration history | 1 |
REQ-001-US-009-023 |
yes | Query configuration for specific Volk | 1 |
REQ-001-US-009-024 |
yes | Query configuration by key | 4 |
REQ-001-US-009-025 |
yes | Export configuration as YAML | 1 |
REQ-001-US-009-026 |
yes | Export configuration as JSON | 2 |
REQ-001-US-009-027 |
yes | Support configuration comparison | 1 |
REQ-001-US-009-028 |
yes | Validate configuration compliance | 1 |
REQ-001-US-009-029 |
yes | Generate configuration documentation | 1 |
REQ-001-US-009-030 |
yes | Support configuration templates | 1 |
REQ-001-US-010-001 |
yes | Achieve <50ms p95 routing latency | 5 |
REQ-001-US-010-002 |
yes | Achieve <100ms p99 routing latency | 5 |
REQ-001-US-010-003 |
yes | Achieve <10ms p95 policy query latency | 5 |
REQ-001-US-010-004 |
yes | Achieve <20ms p99 policy query latency | 5 |
REQ-001-US-010-005 |
yes | Support 10,000 messages/sec throughput | 5 |
REQ-001-US-010-006 |
yes | Maintain <5MB memory per session | 6 |
REQ-001-US-010-007 |
yes | Startup in <2 seconds | 2 |
REQ-001-US-010-008 |
yes | Handle 1000+ concurrent Volks | 1 |
REQ-001-US-010-009 |
yes | Maintain 99.9% uptime | 6 |
REQ-001-US-010-010 |
yes | Support graceful degradation under load | 3 |
REQ-001-US-010-011 |
yes | Cache Prolog query results | 6 |
REQ-001-US-010-012 |
yes | Use connection pooling for Redis | 7 |
REQ-001-US-010-013 |
yes | Use connection pooling for Neo4j | 7 |
REQ-001-US-010-014 |
yes | Batch message dispatches where possible | 1 |
REQ-001-US-010-015 |
yes | Use async I/O for all network operations | 15 |
REQ-001-US-010-016 |
yes | Minimize serialization overhead | 4 |
REQ-001-US-010-017 |
yes | Use efficient data structures (ring buffers, etc.) | 3 |
REQ-001-US-010-018 |
yes | Avoid blocking operations in critical paths | 4 |
REQ-001-US-010-019 |
yes | Profile and optimize hot paths | 2 |
REQ-001-US-010-020 |
yes | Implement backpressure mechanisms | 5 |
REQ-001-US-010-021 |
yes | Support horizontal scaling (multiple kernel instances) | 3 |
REQ-001-US-010-022 |
yes | Support sharding by session ID | 3 |
REQ-001-US-010-023 |
yes | Support sharding by Volk alias | 3 |
REQ-001-US-010-024 |
yes | Use consistent hashing for routing | 4 |
REQ-001-US-010-025 |
yes | Support leader election for coordination | 10 |
REQ-001-US-010-026 |
yes | Handle kernel instance failures | 6 |
REQ-001-US-010-027 |
yes | Rebalance load across kernel instances | 3 |
REQ-001-US-010-028 |
yes | Support autoscaling based on load | 6 |
REQ-001-US-010-029 |
yes | Provide metrics for scaling decisions | 8 |
REQ-001-US-010-030 |
yes | Test scaling with chaos engineering | 5 |
REQ-006-031 |
yes | PipelineEvent.event_type values SHALL be defined by a single |
7 |
REQ-006-032 |
yes | The change SHALL be byte-for-byte wire-compatible: serialized | 1 |
REQ-006-033 |
yes | Documented-but-never-emitted types (pipeline.governance, |
7 |
REQ-003-US-004 |
- | 102). The fallback producer's pipeline.stage / pipeline.paused / |
none |
REQ-006-034 |
yes | PipelineEvent SHALL carry a driver: str = "" field recording |
none |
REQ-006-035 |
yes | Attribution SHALL be resolve, never mutate. A wire producer | none |
REQ-006-036 |
yes | There SHALL be exactly two production producers of the canonical | none |
REQ-006-037 |
yes | Human-facing rendering of an event (the orchestrata watch CLI) |
none |
REQ-008-001 |
- | Log all message routing decisions | 2 |
REQ-008-002 |
- | Log all policy queries and results | 6 |
REQ-008-003 |
- | Log all escalation events | 3 |
REQ-008-004 |
- | Log all session lifecycle events | 6 |
REQ-008-005 |
- | Log all resource allocation events | 11 |
REQ-008-006 |
- | Log all workflow execution steps | 19 |
REQ-008-007 |
- | Log all Volk registration/deregistration | 3 |
REQ-008-008 |
- | Include timestamps in all log entries | 1 |
REQ-008-009 |
- | Include session context in log entries | 2 |
REQ-008-010 |
- | Include correlation IDs for tracing | none |
REQ-008-011 |
- | Persist logs to Neo4j knowledge graph | none |
REQ-008-012 |
- | Persist logs to file system | 5 |
REQ-008-013 |
- | Support log rotation (size and time-based) | 19 |
REQ-008-014 |
- | Compress archived logs | 1 |
REQ-008-015 |
- | Support log retention policies | 6 |
REQ-008-016 |
- | Encrypt sensitive log data | 1 |
REQ-008-017 |
- | Support log export (JSON, CSV) | 6 |
REQ-008-018 |
- | Handle log storage failures gracefully | 6 |
REQ-008-019 |
- | Provide log backup/restore | 5 |
REQ-008-020 |
- | Support multi-destination logging | 1 |
REQ-008-021 |
- | Query logs by session ID | 32 |
REQ-008-022 |
- | Query logs by Volk alias | 2 |
REQ-008-023 |
- | Query logs by event type | 17 |
REQ-008-024 |
- | Query logs by time range | 6 |
REQ-008-025 |
- | Query logs by correlation ID | 12 |
REQ-008-026 |
- | Support full-text log search | 14 |
REQ-008-027 |
- | Support log filtering and aggregation | 3 |
REQ-008-028 |
- | Provide log visualization | 3 |
REQ-008-029 |
- | Support log export for external analysis | 7 |
REQ-008-030 |
- | Generate audit reports from logs | 4 |
REQ-010-001 |
- | Achieve <50ms p95 routing latency | 1 |
REQ-010-002 |
- | Achieve <100ms p99 routing latency | 5 |
REQ-010-003 |
- | Achieve <10ms p95 policy query latency | 6 |
REQ-010-004 |
- | Achieve <20ms p99 policy query latency | 2 |
REQ-010-005 |
- | Support 10,000 messages/sec throughput | 1 |
REQ-010-006 |
- | Maintain <5MB memory per session | 3 |
REQ-010-007 |
- | Startup in <2 seconds | 2 |
REQ-010-008 |
- | Handle 1000+ concurrent Volks | 1 |
REQ-010-009 |
- | Maintain 99.9% uptime | 2 |
REQ-010-010 |
- | Support graceful degradation under load | 1 |
REQ-010-011 |
- | Cache Prolog query results | 3 |
REQ-010-012 |
- | Use connection pooling for Redis | 1 |
REQ-010-013 |
- | Use connection pooling for Neo4j | 1 |
REQ-010-014 |
- | Batch message dispatches where possible | 1 |
REQ-010-015 |
- | Use async I/O for all network operations | 4 |
REQ-010-016 |
- | Minimize serialization overhead | none |
REQ-010-017 |
- | Use efficient data structures (ring buffers, etc.) | 3 |
REQ-010-018 |
- | Avoid blocking operations in critical paths | 1 |
REQ-010-019 |
- | Profile and optimize hot paths | 3 |
REQ-010-020 |
- | Implement backpressure mechanisms | 2 |
REQ-010-021 |
- | Support horizontal scaling (multiple kernel instances) | 1 |
REQ-010-022 |
- | Support sharding by session ID | 2 |
REQ-010-023 |
- | Support sharding by Volk alias | 2 |
REQ-010-024 |
- | Use consistent hashing for routing | 2 |
REQ-010-025 |
- | Support leader election for coordination | 1 |
REQ-010-026 |
- | Handle kernel instance failures | none |
REQ-010-027 |
- | Rebalance load across kernel instances | 2 |
REQ-010-028 |
- | Support autoscaling based on load | 2 |
REQ-010-029 |
- | Provide metrics for scaling decisions | 2 |
REQ-010-030 |
- | Test scaling with chaos engineering | 1 |
Code that traces this spec
Checklists
checklists/README.md
Orchestration Kernel (U:KR) Checklists
Project: Orchestrator-AI Orchestration Kernel (Spec 001)
Component: U:KR (Kernel)
Status: Implementation Phase
Owner: Architecture Team
Overview
The Orchestration Kernel (U:KR) is the central coordination component of the Orchestrator-AI system. It serves as the executive brain that:
- Routes messages between Volks (agents) using CXP protocol
- Enforces governance policies via Prolog rules engine
- Manages session lifecycle across multi-session workflows
- Coordinates multi-agent workflows with deterministic execution
- Handles escalation paths when conflicts or failures occur
- Provides resource management for system-wide resources
- Maintains audit trails for all orchestration decisions
Checklist Summary
| Checklist | Total Items | Completed | Progress |
|---|---|---|---|
| Requirements | 150+ | 0 | 0% |
| Constitutional Compliance | 110+ | 0 | 0% |
| Testing Plan | 441+ | 0 | 0% |
| TOTAL | 700+ | 0 | 0% |
Key Responsibilities
1. Message Routing and Dispatch
- Route CXP packets to appropriate Volks based on TO field
- Handle broadcast messages to multiple recipients
- Manage message queues and delivery guarantees
- Track message status (queued, delivered, acknowledged, failed)
2. Governance Policy Enforcement
- Query Prolog rules for routing decisions
- Enforce PAM++ ownership boundaries
- Validate message permissions and authority
- Apply escalation rules when conflicts occur
3. Session Management
- Initialize and teardown sessions
- Maintain session context and state
- Coordinate multi-session workflows
- Handle session isolation and boundaries
4. Workflow Orchestration
- Coordinate multi-step agent workflows
- Manage task dependencies and ordering
- Handle parallel and sequential execution
- Track workflow progress and completion
5. Resource Management
- Allocate system resources to Volks
- Enforce resource quotas and limits
- Handle resource contention
- Monitor resource utilization
6. Audit and Observability
- Log all routing decisions and policy queries
- Track performance metrics (latency, throughput)
- Provide debugging and diagnostic capabilities
- Generate audit trails for governance compliance
Performance Targets
| Metric | Target | Critical Threshold |
|---|---|---|
| Routing Latency | <50ms p95 | <100ms p99 |
| Policy Query Time | <10ms p95 | <20ms p99 |
| Agent Capacity | 1000+ agents | 500 minimum |
| Message Throughput | 10,000 msg/sec | 5,000 msg/sec |
| Session Overhead | <5MB per session | <10MB per session |
| Startup Time | <2 seconds | <5 seconds |
Checklist Files
1. requirements.md
Functional requirements organized by user stories:
- US-001: Volk Registration and Discovery
- US-002: Message Routing and Dispatch
- US-003: Governance Policy Enforcement
- US-004: Session Management
- US-005: Escalation Handling
- US-006: Workflow Orchestration
- US-007: Resource Management
- US-008: Audit Trail Logging
- US-009: Configuration Management
- US-010: Performance and Scalability
2. constitutional.md
Compliance with all 11 constitutional articles:
- Article I: Agent Autonomy
- Article II: Prolog as Single Source of Truth
- Article III: Session Isolation
- Article IV: Hooks for Extensibility
- Article V: Minimal Core, Maximal Extension
- Article VI: Python 3.11+ Implementation
- Article VII: Testing Without Mocks
- Article VIII: Metrics and Observability
- Article IX: Graceful Degradation
- Article X: Version Compatibility
- Article XI: Documentation First
3. testing.md
Comprehensive testing strategy:
- Unit Tests (150+ tests): Core routing, policy, session logic
- Integration Tests (100+ tests): Prolog, Redis, Neo4j integration
- Contract Tests (50 tests): Volk interface contracts
- Performance Tests (80+ tests): Latency, throughput, scalability
- Compliance Tests (11 tests): Constitutional compliance
- Failure Scenario Tests (50+ tests): Error handling, recovery
Usage Guidelines
For Developers
- Review requirements.md for functional specifications
- Check constitutional.md for design constraints
- Follow testing.md for test implementation
- Update checkboxes as work completes
- Track progress in the summary table above
For Reviewers
- Verify all requirements are addressed
- Validate constitutional compliance
- Ensure test coverage meets targets
- Check for completeness of implementation
- Sign off on completed sections
For Project Managers
- Monitor progress via checklist completion
- Identify blockers and dependencies
- Track milestone completion
- Report status to stakeholders
- Coordinate with other component teams
Integration Points
Upstream Dependencies
- Prolog Engine: Policy evaluation and governance
- Redis: State persistence and caching
- Neo4j: Knowledge graph queries
- CXP Protocol: Message format and validation
Downstream Consumers
- All Volks: Receive routed messages
- Postman (U:PS): Message delivery coordination
- Session Manager: Session lifecycle events
- Audit Logger: Logging and observability
Key Metrics
Routing Metrics
- Messages routed per second
- Routing decision latency (p50, p95, p99)
- Queue depth and wait times
- Delivery success rate
Policy Metrics
- Policy queries per second
- Policy evaluation latency
- Cache hit rate
- Policy violations detected
Session Metrics
- Active sessions count
- Session initialization time
- Session memory usage
- Session isolation violations
Resource Metrics
- Resource allocation requests
- Resource contention events
- Resource utilization percentages
- Quota violations
Dependencies
Required Services
- Prolog engine (SWI-Prolog or PySwip)
- Redis server (for state)
- Neo4j server (for knowledge graph)
Required Libraries
-
- Data validation
-
- State persistence
-
- Knowledge graph
-
- Metrics
Optional Services
- OpenTelemetry for tracing
- Grafana for visualization
- Jaeger for distributed tracing
Next Steps
- [ ] Review all checklist files for completeness
- [ ] Assign owners to each user story
- [ ] Create implementation tasks in tracking system
- [ ] Set up development environment
- [ ] Begin implementation of US-001 (Volk Registration)
- [ ] Establish CI/CD pipeline for kernel component
- [ ] Create integration test environment
- [ ] Document API interfaces for Volks
References
- CXP Protocol Specification
- PAM++ Governance Model
- Prolog Rules Engine
- Session Management Spec
- Constitutional Articles
Last Updated: 2026-01-15
Version: 1.0.0
Maintained By: Architecture Team
checklists/constitutional.md
Orchestration Kernel (U:KR) - Constitutional Compliance
Component: U:KR (Kernel)
Spec: 001-kernel
Status: Compliance Review
Total Compliance Items: 110+
Overview
This document tracks compliance of the Orchestration Kernel (U:KR) with all 11 articles of the Orchestrator-AI Constitution. Each article includes specific compliance requirements and verification checkpoints.
Article I: Agent Autonomy
Principle: Volks (agents) retain autonomy; the kernel coordinates but does not control.
Compliance Requirements
Autonomy Preservation
- [ ] CONST-I-001: Kernel routes messages but does not interpret or modify agent decisions
- [ ] CONST-I-002: Agents can refuse work assignments without penalty
- [ ] CONST-I-003: Agents control their own internal state and logic
- [ ] CONST-I-004: Kernel does not inspect agent internal operations
- [ ] CONST-I-005: Agents can deregister at any time
- [ ] CONST-I-006: Kernel does not force agents into specific behaviors
- [ ] CONST-I-007: Agents choose how to respond to routed messages
- [ ] CONST-I-008: Kernel respects agent-defined capabilities
- [ ] CONST-I-009: Agents set their own resource requirements
- [ ] CONST-I-010: Kernel does not override agent protocols
Coordination Without Control
- [ ] CONST-I-011: Kernel provides suggestions, not commands
- [ ] CONST-I-012: Agents opt into workflows voluntarily
- [ ] CONST-I-013: Kernel facilitates communication, agents decide responses
- [ ] CONST-I-014: Escalations are requests, not mandates
- [ ] CONST-I-015: Agents can appeal routing decisions
- [ ] CONST-I-016: Kernel does not inject messages on behalf of agents
- [ ] CONST-I-017: Agents control message acknowledgment timing
- [ ] CONST-I-018: Kernel respects agent availability status
- [ ] CONST-I-019: Agents define their own SLAs
- [ ] CONST-I-020: Kernel honors agent-requested pauses
Priority: Critical
Verification: Manual review + integration tests
Article II: Prolog as Single Source of Truth
Principle: All governance rules are defined in Prolog; the kernel queries Prolog for decisions.
Compliance Requirements
Prolog Integration
- [ ] CONST-II-001: All routing decisions query Prolog first
- [ ] CONST-II-002: All permission checks query Prolog
- [ ] CONST-II-003: All escalation paths are defined in Prolog
- [ ] CONST-II-004: All ownership rules are stored in Prolog
- [ ] CONST-II-005: Kernel does not hardcode policy logic
- [ ] CONST-II-006: Kernel caches Prolog results but invalidates on updates
- [ ] CONST-II-007: Kernel falls back to safe defaults on Prolog failure
- [ ] CONST-II-008: All policy changes update Prolog rules
- [ ] CONST-II-009: Kernel logs all Prolog queries for audit
- [ ] CONST-II-010: Kernel validates Prolog rule consistency
Policy Queries
- [ ] CONST-II-011: Routing decisions use
can_route(From, To, Message)predicate - [ ] CONST-II-012: Permission checks use
has_permission(Agent, Action, Resource)predicate - [ ] CONST-II-013: Escalation paths use
escalate_to(Issue, Authority)predicate - [ ] CONST-II-014: Ownership validation uses
owns_component(Agent, Component)predicate - [ ] CONST-II-015: Workflow permissions use
can_execute_step(Agent, Step)predicate - [ ] CONST-II-016: Resource allocation uses
allocate_resource(Agent, Resource, Amount)predicate - [ ] CONST-II-017: Conflict resolution uses
resolve_conflict(Parties, Issue)predicate - [ ] CONST-II-018: Session policies use
session_policy(SessionID, Policy)predicate - [ ] CONST-II-019: Configuration rules use
config_value(Key, Value)predicate - [ ] CONST-II-020: Prolog errors are logged and escalated
Priority: Critical
Verification: Prolog integration tests + policy compliance tests
Article III: Session Isolation
Principle: Sessions are isolated; state does not leak between sessions.
Compliance Requirements
State Isolation
- [ ] CONST-III-001: Each session has isolated Redis namespace
- [ ] CONST-III-002: Session facts do not leak to other sessions
- [ ] CONST-III-003: Session portfolio is session-specific
- [ ] CONST-III-004: Session carryover is explicitly transferred
- [ ] CONST-III-005: Prolog session predicates are namespaced
- [ ] CONST-III-006: Message queues are session-specific
- [ ] CONST-III-007: Resource allocations are session-scoped
- [ ] CONST-III-008: Workflow state is session-isolated
- [ ] CONST-III-009: Audit logs include session ID for tracing
- [ ] CONST-III-010: Session teardown cleans all session state
Cross-Session Operations
- [ ] CONST-III-011: Cross-session communication is explicit and logged
- [ ] CONST-III-012: Session handover is controlled and audited
- [ ] CONST-III-013: Carryover transfer validates target session
- [ ] CONST-III-014: Global state is minimal and well-documented
- [ ] CONST-III-015: Session IDs are unique and non-reusable
- [ ] CONST-III-016: Session access control is enforced
- [ ] CONST-III-017: Session context cannot be modified from other sessions
- [ ] CONST-III-018: Session termination is irreversible
- [ ] CONST-III-019: Session archives are immutable
- [ ] CONST-III-020: Session replay does not affect other sessions
Priority: Critical
Verification: Session isolation tests + state leak detection
Article IV: Hooks for Extensibility
Principle: The kernel provides extension points for customization without core modification.
Compliance Requirements
Extension Points
- [ ] CONST-IV-001: Pre-routing hook for message inspection
- [ ] CONST-IV-002: Post-routing hook for logging/metrics
- [ ] CONST-IV-003: Pre-dispatch hook for message transformation
- [ ] CONST-IV-004: Post-dispatch hook for delivery tracking
- [ ] CONST-IV-005: Pre-policy-query hook for cache checking
- [ ] CONST-IV-006: Post-policy-query hook for cache updates
- [ ] CONST-IV-007: Pre-session-init hook for setup
- [ ] CONST-IV-008: Post-session-teardown hook for cleanup
- [ ] CONST-IV-009: Escalation handler hook for custom escalation logic
- [ ] CONST-IV-010: Resource allocation hook for custom allocation strategies
Hook Management
- [ ] CONST-IV-011: Hooks are registered dynamically
- [ ] CONST-IV-012: Hooks can be enabled/disabled at runtime
- [ ] CONST-IV-013: Hooks are executed in priority order
- [ ] CONST-IV-014: Hook failures do not crash the kernel
- [ ] CONST-IV-015: Hooks have timeouts to prevent blocking
- [ ] CONST-IV-016: Hook execution is logged for debugging
- [ ] CONST-IV-017: Hooks can access context (session, message, etc.)
- [ ] CONST-IV-018: Hooks can modify behavior via return values
- [ ] CONST-IV-019: Hook API is versioned for compatibility
- [ ] CONST-IV-020: Hook documentation includes examples
Priority: High
Verification: Hook registration tests + extension tests
Article V: Minimal Core, Maximal Extension
Principle: Kernel core is minimal; features are added via extensions.
Compliance Requirements
Minimal Core
- [ ] CONST-V-001: Core handles only routing, policy, session management
- [ ] CONST-V-002: Advanced workflows are implemented as extensions
- [ ] CONST-V-003: Custom protocols are added via extensions
- [ ] CONST-V-004: Monitoring/metrics are extensions
- [ ] CONST-V-005: Custom storage backends are extensions
- [ ] CONST-V-006: Core has zero business logic
- [ ] CONST-V-007: Core dependencies are minimal (<10 libraries)
- [ ] CONST-V-008: Core code is <5000 lines
- [ ] CONST-V-009: Core API is stable and versioned
- [ ] CONST-V-010: Core changes require RFC approval
Extension System
- [ ] CONST-V-011: Extensions are loaded dynamically
- [ ] CONST-V-012: Extensions can be added without kernel restart
- [ ] CONST-V-013: Extensions declare dependencies
- [ ] CONST-V-014: Extensions have isolated namespaces
- [ ] CONST-V-015: Extensions can be versioned independently
- [ ] CONST-V-016: Extension API is well-documented
- [ ] CONST-V-017: Extensions can be tested independently
- [ ] CONST-V-018: Extension failures do not crash kernel
- [ ] CONST-V-019: Extensions can be hot-reloaded
- [ ] CONST-V-020: Extension marketplace/registry exists
Priority: High
Verification: Core size metrics + extension loading tests
Article VI: Python 3.11+ Implementation
Principle: Kernel is implemented in Python 3.11+ with modern async patterns.
Compliance Requirements
Python Version
- [ ] CONST-VI-001: Code requires Python 3.11 or newer
- [ ] CONST-VI-002: Type hints are used throughout
- [ ] CONST-VI-003: Pydantic v2 for data validation
- [ ] CONST-VI-004: Async/await for all I/O operations
- [ ] CONST-VI-005: No blocking calls in async functions
- [ ] CONST-VI-006: Use asyncio.gather for concurrent operations
- [ ] CONST-VI-007: Use asyncio.Queue for message queues
- [ ] CONST-VI-008: Use aioredis for Redis operations
- [ ] CONST-VI-009: Use neo4j async driver for Neo4j
- [ ] CONST-VI-010: Use grpcio for gRPC async operations
Code Quality
- [ ] CONST-VI-011: Black formatting enforced
- [ ] CONST-VI-012: Flake8 linting with max-line-length=120
- [ ] CONST-VI-013: Mypy strict mode enabled
- [ ] CONST-VI-014: Isort for import sorting
- [ ] CONST-VI-015: Docstrings for all public APIs
- [ ] CONST-VI-016: Type stubs for third-party libraries
- [ ] CONST-VI-017: No
# type: ignorecomments without justification - [ ] CONST-VI-018: Test coverage >90%
- [ ] CONST-VI-019: Cyclomatic complexity <10 per function
- [ ] CONST-VI-020: Code reviewed before merge
Priority: High
Verification: CI/CD checks + static analysis
Article VII: Testing Without Mocks
Principle: Tests use real implementations, not mocks.
Compliance Requirements
Real Systems Testing
- [ ] CONST-VII-001: Tests use real Redis (test instance)
- [ ] CONST-VII-002: Tests use real Neo4j (test instance)
- [ ] CONST-VII-003: Tests use real Prolog (SWI-Prolog)
- [ ] CONST-VII-004: Tests use real Volks (test agents)
- [ ] CONST-VII-005: No unittest.mock usage
- [ ] CONST-VII-006: No MagicMock or Mock objects
- [ ] CONST-VII-007: Test fixtures create real resources
- [ ] CONST-VII-008: Tests clean up real resources
- [ ] CONST-VII-009: Integration tests use real network I/O
- [ ] CONST-VII-010: Performance tests use real workloads
Test Authenticity
- [ ] CONST-VII-011: Tests validate real behavior, not mock behavior
- [ ] CONST-VII-012: Tests catch real race conditions
- [ ] CONST-VII-013: Tests catch real resource leaks
- [ ] CONST-VII-014: Tests catch real network failures
- [ ] CONST-VII-015: Tests catch real concurrency issues
- [ ] CONST-VII-016: Tests validate real performance characteristics
- [ ] CONST-VII-017: Tests use real timers (asyncio.sleep)
- [ ] CONST-VII-018: Tests validate real error messages
- [ ] CONST-VII-019: Tests validate real timeouts
- [ ] CONST-VII-020: Tests validate real resource limits
Priority: Critical
Verification: Test code review + mock detector
Article VIII: Metrics and Observability
Principle: All operations are observable and measurable.
Compliance Requirements
Metrics Collection
- [ ] CONST-VIII-001: Routing latency metrics (p50, p95, p99)
- [ ] CONST-VIII-002: Policy query latency metrics
- [ ] CONST-VIII-003: Message throughput metrics
- [ ] CONST-VIII-004: Queue depth metrics
- [ ] CONST-VIII-005: Resource utilization metrics
- [ ] CONST-VIII-006: Session count metrics
- [ ] CONST-VIII-007: Escalation count metrics
- [ ] CONST-VIII-008: Error rate metrics
- [ ] CONST-VIII-009: Volk registration metrics
- [ ] CONST-VIII-010: Workflow execution metrics
Observability
- [ ] CONST-VIII-011: Structured logging (JSON format)
- [ ] CONST-VIII-012: Correlation IDs for request tracing
- [ ] CONST-VIII-013: OpenTelemetry integration
- [ ] CONST-VIII-014: Distributed tracing support
- [ ] CONST-VIII-015: Health check endpoint
- [ ] CONST-VIII-016: Readiness probe endpoint
- [ ] CONST-VIII-017: Debug endpoint (disabled in production)
- [ ] CONST-VIII-018: Prometheus metrics export
- [ ] CONST-VIII-019: Grafana dashboards defined
- [ ] CONST-VIII-020: Alert rules defined
Priority: High
Verification: Metrics tests + observability review
Article IX: Graceful Degradation
Principle: System degrades gracefully under failure, does not crash.
Compliance Requirements
Failure Handling
- [ ] CONST-IX-001: Redis unavailable: use in-memory fallback
- [ ] CONST-IX-002: Neo4j unavailable: disable audit logging
- [ ] CONST-IX-003: Prolog unavailable: use cached policies
- [ ] CONST-IX-004: Volk unreachable: queue messages
- [ ] CONST-IX-005: Queue full: apply backpressure
- [ ] CONST-IX-006: Policy query timeout: use safe default
- [ ] CONST-IX-007: Resource exhaustion: reject new work
- [ ] CONST-IX-008: Network partition: continue local operations
- [ ] CONST-IX-009: Configuration invalid: use last valid config
- [ ] CONST-IX-010: Extension crash: disable extension
Recovery
- [ ] CONST-IX-011: Automatic retry with exponential backoff
- [ ] CONST-IX-012: Circuit breaker for failing dependencies
- [ ] CONST-IX-013: Reconnection to Redis on disconnect
- [ ] CONST-IX-014: Reconnection to Neo4j on disconnect
- [ ] CONST-IX-015: Prolog rule reload on recovery
- [ ] CONST-IX-016: Message replay from queue on recovery
- [ ] CONST-IX-017: Session state recovery from Redis
- [ ] CONST-IX-018: Graceful shutdown on SIGTERM
- [ ] CONST-IX-019: Fast restart with state recovery
- [ ] CONST-IX-020: Chaos engineering tests for resilience
Priority: High
Verification: Failure injection tests + chaos tests
Article X: Version Compatibility
Principle: APIs are versioned; breaking changes are avoided.
Compliance Requirements
API Versioning
- [ ] CONST-X-001: CXP protocol version in all messages
- [ ] CONST-X-002: Kernel API version in endpoints
- [ ] CONST-X-003: Prolog rule schema versioning
- [ ] CONST-X-004: Redis state schema versioning
- [ ] CONST-X-005: Neo4j schema versioning
- [ ] CONST-X-006: Semantic versioning for kernel releases
- [ ] CONST-X-007: Deprecation warnings for old APIs
- [ ] CONST-X-008: Support for N-1 versions
- [ ] CONST-X-009: Migration paths documented
- [ ] CONST-X-010: Breaking changes require major version bump
Backward Compatibility
- [ ] CONST-X-011: Old Volks can communicate with new kernel
- [ ] CONST-X-012: New Volks can communicate with old kernel
- [ ] CONST-X-013: Old sessions can be recovered in new kernel
- [ ] CONST-X-014: Configuration migration automated
- [ ] CONST-X-015: Prolog rule migration automated
- [ ] CONST-X-016: Redis state migration automated
- [ ] CONST-X-017: API changes are additive, not destructive
- [ ] CONST-X-018: Compatibility tests for N-1, N-2 versions
- [ ] CONST-X-019: Changelogs document breaking changes
- [ ] CONST-X-020: Upgrade guides provided
Priority: Medium
Verification: Compatibility tests + version migration tests
Article XI: Documentation First
Principle: Documentation precedes implementation.
Compliance Requirements
Design Documentation
- [ ] CONST-XI-001: Architecture diagrams created before code
- [ ] CONST-XI-002: API specifications written before implementation
- [ ] CONST-XI-003: Data models documented before schemas
- [ ] CONST-XI-004: Workflow diagrams before orchestration code
- [ ] CONST-XI-005: Decision records (ADRs) for major choices
- [ ] CONST-XI-006: User stories define requirements
- [ ] CONST-XI-007: Prolog rules documented with examples
- [ ] CONST-XI-008: Configuration options documented
- [ ] CONST-XI-009: Extension API documented with examples
- [ ] CONST-XI-010: Performance targets documented
Living Documentation
- [ ] CONST-XI-011: Documentation updated with code changes
- [ ] CONST-XI-012: Code examples tested in CI/CD
- [ ] CONST-XI-013: API documentation generated from code
- [ ] CONST-XI-014: Changelog maintained
- [ ] CONST-XI-015: README includes quick start
- [ ] CONST-XI-016: Troubleshooting guide maintained
- [ ] CONST-XI-017: FAQ updated based on questions
- [ ] CONST-XI-018: Runbooks for operations
- [ ] CONST-XI-019: Diagrams versioned with code
- [ ] CONST-XI-020: Documentation reviewed in PRs
Priority: High
Verification: Documentation review + doc tests
Summary Statistics
| Article | Total Items | Completed | Percentage |
|---|---|---|---|
| Article I (Autonomy) | 20 | 0 | 0% |
| Article II (Prolog) | 20 | 0 | 0% |
| Article III (Isolation) | 20 | 0 | 0% |
| Article IV (Hooks) | 20 | 0 | 0% |
| Article V (Minimal Core) | 20 | 0 | 0% |
| Article VI (Python 3.11+) | 20 | 0 | 0% |
| Article VII (No Mocks) | 20 | 0 | 0% |
| Article VIII (Observability) | 20 | 0 | 0% |
| Article IX (Degradation) | 20 | 0 | 0% |
| Article X (Versioning) | 20 | 0 | 0% |
| Article XI (Documentation) | 20 | 0 | 0% |
| TOTAL | 220 | 0 | 0% |
Last Updated: 2026-01-15
Version: 1.0.0
Maintained By: Architecture Team
checklists/requirements.md
The requirement list above comes from this file; 312 of 312 checkbox items are ticked.
checklists/testing.md
Orchestration Kernel (U:KR) - Testing Plan
Component: U:KR (Kernel)
Spec: 001-kernel
Status: Test Planning Phase
Total Test Cases: 441+
Overview
This document defines the comprehensive testing strategy for the Orchestration Kernel (U:KR). All tests follow the strict "no mocking" policy and use real implementations.
Test Categories Summary
| Category | Test Count | Purpose | Priority |
|---|---|---|---|
| Unit Tests | 150+ | Core logic validation | Critical |
| Integration Tests | 100+ | System integration | Critical |
| Contract Tests | 50 | Volk interface contracts | High |
| Performance Tests | 80+ | Latency & throughput | High |
| Compliance Tests | 11 | Constitutional compliance | Critical |
| Failure Scenario Tests | 50+ | Error handling & recovery | High |
| TOTAL | 441+ |
Unit Tests (150+)
Routing Tests (40 tests)
- [ ] TEST-UNIT-R-001: Route unicast message to single Volk
- [ ] TEST-UNIT-R-002: Route multicast message to multiple Volks
- [ ] TEST-UNIT-R-003: Route broadcast message to all Volks
- [ ] TEST-UNIT-R-004: Route message by Volk alias (e.g., U:Ox)
- [ ] TEST-UNIT-R-005: Route message by Volk role (e.g., any QA)
- [ ] TEST-UNIT-R-006: Validate FROM field matches sender
- [ ] TEST-UNIT-R-007: Reject message with invalid TO field
- [ ] TEST-UNIT-R-008: Reject message with invalid FROM field
- [ ] TEST-UNIT-R-009: Route message to offline Volk (queue)
- [ ] TEST-UNIT-R-010: Route message to unknown recipient (error)
- [ ] TEST-UNIT-R-011: Validate message schema before routing
- [ ] TEST-UNIT-R-012: Route high-priority messages first
- [ ] TEST-UNIT-R-013: Route normal-priority messages second
- [ ] TEST-UNIT-R-014: Route low-priority messages last
- [ ] TEST-UNIT-R-015: Track message status: queued
- [ ] TEST-UNIT-R-016: Track message status: dispatched
- [ ] TEST-UNIT-R-017: Track message status: delivered
- [ ] TEST-UNIT-R-018: Track message status: acknowledged
- [ ] TEST-UNIT-R-019: Track message status: failed
- [ ] TEST-UNIT-R-020: Query message status by ID
- [ ] TEST-UNIT-R-021: Timeout stale routing attempts
- [ ] TEST-UNIT-R-022: Retry failed routing with backoff
- [ ] TEST-UNIT-R-023: Route concurrent messages without race
- [ ] TEST-UNIT-R-024: Route messages in FIFO order
- [ ] TEST-UNIT-R-025: Handle routing loop detection
- [ ] TEST-UNIT-R-026: Apply routing policy from Prolog
- [ ] TEST-UNIT-R-027: Cache routing decisions
- [ ] TEST-UNIT-R-028: Invalidate routing cache on registry change
- [ ] TEST-UNIT-R-029: Log all routing decisions
- [ ] TEST-UNIT-R-030: Measure routing latency (p95 <50ms)
- [ ] TEST-UNIT-R-031: Support 10,000 messages/sec throughput
- [ ] TEST-UNIT-R-032: Handle 1000+ concurrent routes
- [ ] TEST-UNIT-R-033: Route message via gRPC protocol
- [ ] TEST-UNIT-R-034: Route message via WebSocket protocol
- [ ] TEST-UNIT-R-035: Route message via HTTP protocol
- [ ] TEST-UNIT-R-036: Handle protocol fallback on failure
- [ ] TEST-UNIT-R-037: Validate correlation IDs in routing
- [ ] TEST-UNIT-R-038: Support tracing across routing hops
- [ ] TEST-UNIT-R-039: Generate routing metrics
- [ ] TEST-UNIT-R-040: Handle routing under backpressure
Policy Tests (30 tests)
- [ ] TEST-UNIT-P-001: Query Prolog for routing decision
- [ ] TEST-UNIT-P-002: Query Prolog for permission check
- [ ] TEST-UNIT-P-003: Query Prolog for ownership validation
- [ ] TEST-UNIT-P-004: Query Prolog for escalation path
- [ ] TEST-UNIT-P-005: Cache Prolog query results
- [ ] TEST-UNIT-P-006: Invalidate cache on policy update
- [ ] TEST-UNIT-P-007: Handle Prolog query timeout (default policy)
- [ ] TEST-UNIT-P-008: Handle Prolog query failure (safe default)
- [ ] TEST-UNIT-P-009: Log all policy queries
- [ ] TEST-UNIT-P-010: Measure policy query latency (p95 <10ms)
- [ ] TEST-UNIT-P-011: Validate PAM++ ownership boundaries
- [ ] TEST-UNIT-P-012: Block unauthorized cross-boundary messages
- [ ] TEST-UNIT-P-013: Allow whitelisted exceptions
- [ ] TEST-UNIT-P-014: Enforce read permissions
- [ ] TEST-UNIT-P-015: Enforce write permissions
- [ ] TEST-UNIT-P-016: Enforce execute permissions
- [ ] TEST-UNIT-P-017: Support ownership delegation
- [ ] TEST-UNIT-P-018: Support temporary permission grants
- [ ] TEST-UNIT-P-019: Log permission violations
- [ ] TEST-UNIT-P-020: Detect conflicts requiring escalation
- [ ] TEST-UNIT-P-021: Query escalation authority from Prolog
- [ ] TEST-UNIT-P-022: Route escalation to U:Ox
- [ ] TEST-UNIT-P-023: Track escalation history
- [ ] TEST-UNIT-P-024: Timeout stale escalations
- [ ] TEST-UNIT-P-025: Apply escalation resolution
- [ ] TEST-UNIT-P-026: Notify parties of resolution
- [ ] TEST-UNIT-P-027: Generate policy metrics
- [ ] TEST-UNIT-P-028: Support policy dry-run mode
- [ ] TEST-UNIT-P-029: Validate policy rule consistency
- [ ] TEST-UNIT-P-030: Handle concurrent policy queries
Session Tests (30 tests)
- [ ] TEST-UNIT-S-001: Create new session with unique ID
- [ ] TEST-UNIT-S-002: Initialize session context (facts, portfolio, carryover)
- [ ] TEST-UNIT-S-003: Load session-specific Prolog rules
- [ ] ] TEST-UNIT-S-004: Persist session metadata to Redis
- [ ] TEST-UNIT-S-005: Notify Volks of session start
- [ ] TEST-UNIT-S-006: Isolate session state from other sessions
- [ ] TEST-UNIT-S-007: Query session facts
- [ ] TEST-UNIT-S-008: Update session facts
- [ ] TEST-UNIT-S-009: Query session portfolio
- [ ] TEST-UNIT-S-010: Add artifact to session portfolio
- [ ] TEST-UNIT-S-011: Query session carryover
- [ ] TEST-UNIT-S-012: Add todo to session carryover
- [ ] TEST-UNIT-S-013: Validate session context schema
- [ ] TEST-UNIT-S-014: Handle context merge conflicts
- [ ] TEST-UNIT-S-015: Provide context versioning
- [ ] TEST-UNIT-S-016: Gracefully terminate session
- [ ] TEST-UNIT-S-017: Archive session artifacts
- [ ] TEST-UNIT-S-018: Clean up session resources
- [ ] TEST-UNIT-S-019: Notify Volks of session end
- [ ] TEST-UNIT-S-020: Generate session summary report
- [ ] TEST-UNIT-S-021: Persist final session state
- [ ] TEST-UNIT-S-022: Handle forced session termination
- [ ] TEST-UNIT-S-023: Transfer carryover to next session
- [ ] TEST-UNIT-S-024: Log session lifecycle events
- [ ] TEST-UNIT-S-025: Measure session memory usage (<5MB)
- [ ] TEST-UNIT-S-026: Support session templates
- [ ] TEST-UNIT-S-027: Support concurrent session initialization
- [ ] TEST-UNIT-S-028: Handle session state recovery
- [ ] TEST-UNIT-S-029: Generate session metrics
- [ ] TEST-UNIT-S-030: Validate session isolation (no leaks)
Volk Registry Tests (25 tests)
- [ ] TEST-UNIT-V-001: Register Volk with unique alias
- [ ] TEST-UNIT-V-002: Register Volk capabilities
- [ ] TEST-UNIT-V-003: Register Volk protocols
- [ ] TEST-UNIT-V-004: Register Volk resource requirements
- [ ] TEST-UNIT-V-005: Validate alias uniqueness
- [ ] TEST-UNIT-V-006: Validate capability schema
- [ ] TEST-UNIT-V-007: Return registration token
- [ ] TEST-UNIT-V-008: Update Volk registry
- [ ] TEST-UNIT-V-009: Notify other Volks of new agent
- [ ] TEST-UNIT-V-010: Persist registration to Redis
- [ ] TEST-UNIT-V-011: Query all registered Volks
- [ ] TEST-UNIT-V-012: Query Volks by capability
- [ ] TEST-UNIT-V-013: Query Volks by protocol
- [ ] TEST-UNIT-V-014: Subscribe to registry updates
- [ ] TEST-UNIT-V-015: Return Volk metadata (alias, capabilities, protocols)
- [ ] TEST-UNIT-V-016: Use caching for performance
- [ ] TEST-UNIT-V-017: Handle partial discovery failures
- [ ] TEST-UNIT-V-018: Provide health status for each Volk
- [ ] TEST-UNIT-V-019: Support discovery filtering
- [ ] TEST-UNIT-V-020: Support discovery pagination
- [ ] TEST-UNIT-V-021: Deregister Volk cleanly
- [ ] TEST-UNIT-V-022: Notify dependent Volks on deregistration
- [ ] TEST-UNIT-V-023: Clean up resources on deregistration
- [ ] TEST-UNIT-V-024: Handle in-flight messages on deregistration
- [ ] TEST-UNIT-V-025: Generate registry metrics
Workflow Tests (25 tests)
- [ ] TEST-UNIT-W-001: Parse workflow definition (YAML)
- [ ] TEST-UNIT-W-002: Validate workflow schema
- [ ] TEST-UNIT-W-003: Support sequential steps
- [ ] TEST-UNIT-W-004: Support parallel steps
- [ ] TEST-UNIT-W-005: Support conditional branching
- [ ] TEST-UNIT-W-006: Support loops
- [ ] TEST-UNIT-W-007: Define step dependencies (DAG)
- [ ] TEST-UNIT-W-008: Define step timeouts
- [ ] TEST-UNIT-W-009: Define step rollback actions
- [ ] TEST-UNIT-W-010: Initialize workflow instance
- [ ] TEST-UNIT-W-011: Execute steps in dependency order
- [ ] TEST-UNIT-W-012: Track step completion status
- [ ] TEST-UNIT-W-013: Handle step failures with retries
- [ ] TEST-UNIT-W-014: Apply step timeouts
- [ ] TEST-UNIT-W-015: Support workflow pause
- [ ] TEST-UNIT-W-016: Support workflow resume
- [ ] TEST-UNIT-W-017: Support workflow cancellation
- [ ] TEST-UNIT-W-018: Collect step outputs
- [ ] TEST-UNIT-W-019: Pass context between steps
- [ ] TEST-UNIT-W-020: Query workflow status
- [ ] TEST-UNIT-W-021: Track workflow progress percentage
- [ ] TEST-UNIT-W-022: Generate workflow reports
- [ ] TEST-UNIT-W-023: Alert on workflow failures
- [ ] TEST-UNIT-W-024: Archive completed workflows
- [ ] TEST-UNIT-W-025: Support workflow replay
Integration Tests (100+)
Prolog Integration Tests (30 tests)
- [ ] TEST-INTEG-PL-001: Connect to SWI-Prolog instance
- [ ] TEST-INTEG-PL-002: Load governance rules from file
- [ ] TEST-INTEG-PL-003: Query routing rules
- [ ] TEST-INTEG-PL-004: Query permission rules
- [ ] TEST-INTEG-PL-005: Query ownership rules
- [ ] TEST-INTEG-PL-006: Query escalation rules
- [ ] TEST-INTEG-PL-007: Assert new facts dynamically
- [ ] TEST-INTEG-PL-008: Retract facts dynamically
- [ ] TEST-INTEG-PL-009: Validate rule consistency
- [ ] TEST-INTEG-PL-010: Handle Prolog syntax errors
- [ ] TEST-INTEG-PL-011: Handle Prolog query timeouts
- [ ] TEST-INTEG-PL-012: Cache query results
- [ ] TEST-INTEG-PL-013: Invalidate cache on rule update
- [ ] TEST-INTEG-PL-014: Support namespaced rules (sessions)
- [ ] TEST-INTEG-PL-015: Query complex predicates (multi-argument)
- [ ] TEST-INTEG-PL-016: Handle Prolog connection failures
- [ ] TEST-INTEG-PL-017: Reconnect to Prolog on disconnect
- [ ] TEST-INTEG-PL-018: Log all Prolog queries
- [ ] TEST-INTEG-PL-019: Measure Prolog query latency
- [ ] TEST-INTEG-PL-020: Support concurrent Prolog queries
- [ ] TEST-INTEG-PL-021: Validate Prolog response schema
- [ ] TEST-INTEG-PL-022: Handle Prolog result sets (multiple answers)
- [ ] TEST-INTEG-PL-023: Support Prolog debugging mode
- [ ] TEST-INTEG-PL-024: Export Prolog rules for audit
- [ ] TEST-INTEG-PL-025: Import Prolog rules from backup
- [ ] TEST-INTEG-PL-026: Support Prolog rule versioning
- [ ] TEST-INTEG-PL-027: Validate Prolog rule migrations
- [ ] TEST-INTEG-PL-028: Handle Prolog memory limits
- [ ] TEST-INTEG-PL-029: Monitor Prolog resource usage
- [ ] TEST-INTEG-PL-030: Graceful degradation on Prolog failure
Redis Integration Tests (35 tests)
- [ ] TEST-INTEG-RD-001: Connect to Redis instance
- [ ] TEST-INTEG-RD-002: Store session state in Redis
- [ ] TEST-INTEG-RD-003: Retrieve session state from Redis
- [ ] TEST-INTEG-RD-004: Update session state in Redis
- [ ] TEST-INTEG-RD-005: Delete session state from Redis
- [ ] TEST-INTEG-RD-006: Use Redis namespaces for isolation
- [ ] TEST-INTEG-RD-007: Store message queue in Redis
- [ ] TEST-INTEG-RD-008: Retrieve messages from queue
- [ ] TEST-INTEG-RD-009: Remove messages from queue
- [ ] TEST-INTEG-RD-010: Store Volk registry in Redis
- [ ] TEST-INTEG-RD-011: Update Volk registry in Redis
- [ ] TEST-INTEG-RD-012: Query Volk registry from Redis
- [ ] TEST-INTEG-RD-013: Store workflow state in Redis
- [ ] TEST-INTEG-RD-014: Update workflow state in Redis
- [ ] TEST-INTEG-RD-015: Query workflow state from Redis
- [ ] TEST-INTEG-RD-016: Store configuration in Redis
- [ ] TEST-INTEG-RD-017: Update configuration in Redis
- [ ] TEST-INTEG-RD-018: Query configuration from Redis
- [ ] TEST-INTEG-RD-019: Use Redis TTL for expiration
- [ ] TEST-INTEG-RD-020: Handle Redis key eviction
- [ ] TEST-INTEG-RD-021: Use Redis transactions for atomicity
- [ ] TEST-INTEG-RD-022: Use Redis pub/sub for notifications
- [ ] TEST-INTEG-RD-023: Handle Redis connection failures
- [ ] TEST-INTEG-RD-024: Reconnect to Redis on disconnect
- [ ] TEST-INTEG-RD-025: Use connection pooling for performance
- [ ] TEST-INTEG-RD-026: Measure Redis operation latency
- [ ] TEST-INTEG-RD-027: Support concurrent Redis operations
- [ ] TEST-INTEG-RD-028: Validate Redis data schema
- [ ] TEST-INTEG-RD-029: Handle Redis memory limits
- [ ] TEST-INTEG-RD-030: Monitor Redis resource usage
- [ ] TEST-INTEG-RD-031: Backup Redis state periodically
- [ ] TEST-INTEG-RD-032: Restore Redis state from backup
- [ ] TEST-INTEG-RD-033: Graceful degradation on Redis failure (in-memory)
- [ ] TEST-INTEG-RD-034: Log all Redis operations
- [ ] TEST-INTEG-RD-035: Generate Redis metrics
Neo4j Integration Tests (35 tests)
- [ ] TEST-INTEG-NJ-001: Connect to Neo4j instance
- [ ] TEST-INTEG-NJ-002: Store audit log in Neo4j
- [ ] TEST-INTEG-NJ-003: Query audit log from Neo4j
- [ ] TEST-INTEG-NJ-004: Store message routing graph in Neo4j
- [ ] TEST-INTEG-NJ-005: Query routing graph from Neo4j
- [ ] TEST-INTEG-NJ-006: Store session graph in Neo4j
- [ ] TEST-INTEG-NJ-007: Query session relationships from Neo4j
- [ ] TEST-INTEG-NJ-008: Store workflow graph in Neo4j
- [ ] TEST-INTEG-NJ-009: Query workflow dependencies from Neo4j
- [ ] TEST-INTEG-NJ-010: Store Volk relationships in Neo4j
- [ ] TEST-INTEG-NJ-011: Query Volk dependencies from Neo4j
- [ ] TEST-INTEG-NJ-012: Use Cypher queries for complex queries
- [ ] TEST-INTEG-NJ-013: Create indexes for performance
- [ ] TEST-INTEG-NJ-014: Use transactions for atomicity
- [ ] TEST-INTEG-NJ-015: Handle Neo4j connection failures
- [ ] TEST-INTEG-NJ-016: Reconnect to Neo4j on disconnect
- [ ] TEST-INTEG-NJ-017: Use connection pooling for performance
- [ ] TEST-INTEG-NJ-018: Measure Neo4j query latency
- [ ] TEST-INTEG-NJ-019: Support concurrent Neo4j operations
- [ ] TEST-INTEG-NJ-020: Validate Neo4j data schema
- [ ] TEST-INTEG-NJ-021: Handle Neo4j memory limits
- [ ] TEST-INTEG-NJ-022: Monitor Neo4j resource usage
- [ ] TEST-INTEG-NJ-023: Backup Neo4j database periodically
- [ ] TEST-INTEG-NJ-024: Restore Neo4j database from backup
- [ ] TEST-INTEG-NJ-025: Graceful degradation on Neo4j failure (disable audit)
- [ ] TEST-INTEG-NJ-026: Log all Neo4j operations
- [ ] TEST-INTEG-NJ-027: Generate Neo4j metrics
- [ ] TEST-INTEG-NJ-028: Support Neo4j schema migrations
- [ ] TEST-INTEG-NJ-029: Validate Neo4j relationships
- [ ] TEST-INTEG-NJ-030: Query audit trail by session
- [ ] TEST-INTEG-NJ-031: Query audit trail by Volk
- [ ] TEST-INTEG-NJ-032: Query audit trail by time range
- [ ] TEST-INTEG-NJ-033: Generate audit reports from Neo4j
- [ ] TEST-INTEG-NJ-034: Support graph visualization
- [ ] TEST-INTEG-NJ-035: Archive old audit data
Contract Tests (50 tests)
Volk Interface Contracts (50 tests)
- [ ] TEST-CONTRACT-001: Volk registration API contract
- [ ] TEST-CONTRACT-002: Volk deregistration API contract
- [ ] TEST-CONTRACT-003: Volk discovery API contract
- [ ] TEST-CONTRACT-004: Message routing API contract
- [ ] TEST-CONTRACT-005: Message acknowledgment API contract
- [ ] TEST-CONTRACT-006: Session initialization API contract
- [ ] TEST-CONTRACT-007: Session teardown API contract
- [ ] TEST-CONTRACT-008: Session context API contract
- [ ] TEST-CONTRACT-009: Policy query API contract
- [ ] TEST-CONTRACT-010: Escalation routing API contract
- [ ] TEST-CONTRACT-011: Workflow definition API contract
- [ ] TEST-CONTRACT-012: Workflow execution API contract
- [ ] TEST-CONTRACT-013: Resource allocation API contract
- [ ] TEST-CONTRACT-014: Configuration API contract
- [ ] TEST-CONTRACT-015: Metrics API contract
- [ ] TEST-CONTRACT-016: Health check API contract
- [ ] TEST-CONTRACT-017: Readiness probe API contract
- [ ] TEST-CONTRACT-018: CXP message schema contract
- [ ] TEST-CONTRACT-019: Volk metadata schema contract
- [ ] TEST-CONTRACT-020: Session state schema contract
- [ ] TEST-CONTRACT-021: Workflow definition schema contract
- [ ] TEST-CONTRACT-022: Audit log schema contract
- [ ] TEST-CONTRACT-023: Configuration schema contract
- [ ] TEST-CONTRACT-024: gRPC service contract
- [ ] TEST-CONTRACT-025: WebSocket protocol contract
- [ ] TEST-CONTRACT-026: HTTP API contract
- [ ] TEST-CONTRACT-027: Prolog predicate contracts
- [ ] TEST-CONTRACT-028: Redis key schema contracts
- [ ] TEST-CONTRACT-029: Neo4j node schema contracts
- [ ] TEST-CONTRACT-030: Neo4j relationship schema contracts
- [ ] TEST-CONTRACT-031: Error response schema contracts
- [ ] TEST-CONTRACT-032: Success response schema contracts
- [ ] TEST-CONTRACT-033: Pagination schema contracts
- [ ] TEST-CONTRACT-034: Filtering schema contracts
- [ ] TEST-CONTRACT-035: Sorting schema contracts
- [ ] TEST-CONTRACT-036: Batch operation contracts
- [ ] TEST-CONTRACT-037: Transaction contracts
- [ ] TEST-CONTRACT-038: Event notification contracts
- [ ] TEST-CONTRACT-039: Subscription contracts
- [ ] TEST-CONTRACT-040: Versioning contracts
- [ ] TEST-CONTRACT-041: Deprecation contracts
- [ ] TEST-CONTRACT-042: Migration contracts
- [ ] TEST-CONTRACT-043: Backward compatibility contracts
- [ ] TEST-CONTRACT-044: Forward compatibility contracts
- [ ] TEST-CONTRACT-045: Security contracts (authentication)
- [ ] TEST-CONTRACT-046: Security contracts (authorization)
- [ ] TEST-CONTRACT-047: Security contracts (encryption)
- [ ] TEST-CONTRACT-048: Observability contracts (logging)
- [ ] TEST-CONTRACT-049: Observability contracts (metrics)
- [ ] TEST-CONTRACT-050: Observability contracts (tracing)
Performance Tests (80+ tests)
Latency Tests (30 tests)
- [ ] TEST-PERF-L-001: Measure routing latency p50 (target: <25ms)
- [ ] TEST-PERF-L-002: Measure routing latency p95 (target: <50ms)
- [ ] TEST-PERF-L-003: Measure routing latency p99 (target: <100ms)
- [ ] TEST-PERF-L-004: Measure policy query latency p50 (target: <5ms)
- [ ] TEST-PERF-L-005: Measure policy query latency p95 (target: <10ms)
- [ ] TEST-PERF-L-006: Measure policy query latency p99 (target: <20ms)
- [ ] TEST-PERF-L-007: Measure session init latency (target: <100ms)
- [ ] TEST-PERF-L-008: Measure session teardown latency (target: <200ms)
- [ ] TEST-PERF-L-009: Measure Volk registration latency (target: <50ms)
- [ ] TEST-PERF-L-010: Measure Volk discovery latency (target: <10ms)
- [ ] TEST-PERF-L-011: Measure workflow start latency (target: <100ms)
- [ ] TEST-PERF-L-012: Measure workflow step latency (target: <50ms)
- [ ] TEST-PERF-L-013: Measure Redis read latency (target: <5ms)
- [ ] TEST-PERF-L-014: Measure Redis write latency (target: <10ms)
- [ ] TEST-PERF-L-015: Measure Neo4j query latency (target: <20ms)
- [ ] TEST-PERF-L-016: Measure Prolog query latency (target: <10ms)
- [ ] TEST-PERF-L-017: Measure escalation routing latency (target: <100ms)
- [ ] TEST-PERF-L-018: Measure message dispatch latency (target: <20ms)
- [ ] TEST-PERF-L-019: Measure queue enqueue latency (target: <5ms)
- [ ] TEST-PERF-L-020: Measure queue dequeue latency (target: <5ms)
- [ ] TEST-PERF-L-021: Measure configuration reload latency (target: <50ms)
- [ ] TEST-PERF-L-022: Measure resource allocation latency (target: <10ms)
- [ ] TEST-PERF-L-023: Measure audit log write latency (target: <10ms)
- [ ] TEST-PERF-L-024: Measure health check latency (target: <5ms)
- [ ] TEST-PERF-L-025: Measure latency under light load (10 msg/sec)
- [ ] TEST-PERF-L-026: Measure latency under medium load (1000 msg/sec)
- [ ] TEST-PERF-L-027: Measure latency under heavy load (10000 msg/sec)
- [ ] TEST-PERF-L-028: Measure latency with 10 concurrent Volks
- [ ] TEST-PERF-L-029: Measure latency with 100 concurrent Volks
- [ ] TEST-PERF-L-030: Measure latency with 1000 concurrent Volks
Throughput Tests (20 tests)
- [ ] TEST-PERF-T-001: Measure message throughput (target: 10,000 msg/sec)
- [ ] TEST-PERF-T-002: Measure routing throughput (target: 10,000 routes/sec)
- [ ] TEST-PERF-T-003: Measure policy query throughput (target: 50,000 queries/sec)
- [ ] TEST-PERF-T-004: Measure session creation throughput (target: 100 sessions/sec)
- [ ] TEST-PERF-T-005: Measure Volk registration throughput (target: 100 reg/sec)
- [ ] TEST-PERF-T-006: Measure workflow execution throughput (target: 1000 workflows/sec)
- [ ] TEST-PERF-T-007: Measure Redis operation throughput (target: 100,000 ops/sec)
- [ ] TEST-PERF-T-008: Measure Neo4j write throughput (target: 10,000 writes/sec)
- [ ] TEST-PERF-T-009: Measure Prolog query throughput (target: 50,000 queries/sec)
- [ ] TEST-PERF-T-010: Measure throughput with 10 concurrent Volks
- [ ] TEST-PERF-T-011: Measure throughput with 100 concurrent Volks
- [ ] TEST-PERF-T-012: Measure throughput with 1000 concurrent Volks
- [ ] TEST-PERF-T-013: Measure throughput under sustained load (1 hour)
- [ ] TEST-PERF-T-014: Measure throughput under burst load
- [ ] TEST-PERF-T-015: Measure throughput with mixed message sizes
- [ ] TEST-PERF-T-016: Measure throughput with mixed priorities
- [ ] TEST-PERF-T-017: Measure throughput with cache hits
- [ ] TEST-PERF-T-018: Measure throughput with cache misses
- [ ] TEST-PERF-T-019: Measure throughput with backpressure
- [ ] TEST-PERF-T-020: Measure throughput degradation under failure
Scalability Tests (30 tests)
- [ ] TEST-PERF-S-001: Test with 10 Volks
- [ ] TEST-PERF-S-002: Test with 50 Volks
- [ ] TEST-PERF-S-003: Test with 100 Volks
- [ ] TEST-PERF-S-004: Test with 500 Volks
- [ ] TEST-PERF-S-005: Test with 1000 Volks
- [ ] TEST-PERF-S-006: Test with 10 concurrent sessions
- [ ] TEST-PERF-S-007: Test with 50 concurrent sessions
- [ ] TEST-PERF-S-008: Test with 100 concurrent sessions
- [ ] TEST-PERF-S-009: Test with 10 concurrent workflows
- [ ] TEST-PERF-S-010: Test with 100 concurrent workflows
- [ ] TEST-PERF-S-011: Test with 1000 concurrent workflows
- [ ] TEST-PERF-S-012: Measure memory usage with 10 Volks (target: <100MB)
- [ ] TEST-PERF-S-013: Measure memory usage with 100 Volks (target: <500MB)
- [ ] TEST-PERF-S-014: Measure memory usage with 1000 Volks (target: <2GB)
- [ ] TEST-PERF-S-015: Measure CPU usage with 10 Volks (target: <10%)
- [ ] TEST-PERF-S-016: Measure CPU usage with 100 Volks (target: <50%)
- [ ] TEST-PERF-S-017: Measure CPU usage with 1000 Volks (target: <80%)
- [ ] TEST-PERF-S-018: Measure network bandwidth with 1000 msg/sec
- [ ] TEST-PERF-S-019: Measure network bandwidth with 10000 msg/sec
- [ ] TEST-PERF-S-020: Test horizontal scaling (2 kernel instances)
- [ ] TEST-PERF-S-021: Test horizontal scaling (5 kernel instances)
- [ ] TEST-PERF-S-022: Test horizontal scaling (10 kernel instances)
- [ ] TEST-PERF-S-023: Test sharding by session ID
- [ ] TEST-PERF-S-024: Test sharding by Volk alias
- [ ] TEST-PERF-S-025: Test consistent hashing for routing
- [ ] TEST-PERF-S-026: Test leader election for coordination
- [ ] TEST-PERF-S-027: Test load rebalancing across instances
- [ ] TEST-PERF-S-028: Test autoscaling based on load
- [ ] TEST-PERF-S-029: Measure startup time (target: <2 seconds)
- [ ] TEST-PERF-S-030: Measure graceful shutdown time (target: <5 seconds)
Compliance Tests (11 tests)
- [ ] TEST-COMPLY-I: Article I - Agent Autonomy compliance
- [ ] TEST-COMPLY-II: Article II - Prolog as Single Source of Truth compliance
- [ ] TEST-COMPLY-III: Article III - Session Isolation compliance
- [ ] TEST-COMPLY-IV: Article IV - Hooks for Extensibility compliance
- [ ] TEST-COMPLY-V: Article V - Minimal Core, Maximal Extension compliance
- [ ] TEST-COMPLY-VI: Article VI - Python 3.11+ Implementation compliance
- [ ] TEST-COMPLY-VII: Article VII - Testing Without Mocks compliance
- [ ] TEST-COMPLY-VIII: Article VIII - Metrics and Observability compliance
- [ ] TEST-COMPLY-IX: Article IX - Graceful Degradation compliance
- [ ] TEST-COMPLY-X: Article X - Version Compatibility compliance
- [ ] TEST-COMPLY-XI: Article XI - Documentation First compliance
Failure Scenario Tests (50+ tests)
Network Failures (15 tests)
- [ ] TEST-FAIL-N-001: Handle Redis connection loss
- [ ] TEST-FAIL-N-002: Handle Neo4j connection loss
- [ ] TEST-FAIL-N-003: Handle Prolog connection loss
- [ ] TEST-FAIL-N-004: Handle Volk connection loss
- [ ] TEST-FAIL-N-005: Handle network partition
- [ ] TEST-FAIL-N-006: Handle DNS failure
- [ ] TEST-FAIL-N-007: Handle slow network (high latency)
- [ ] TEST-FAIL-N-008: Handle packet loss
- [ ] TEST-FAIL-N-009: Handle connection timeout
- [ ] TEST-FAIL-N-010: Handle partial network failure (some Volks unreachable)
- [ ] TEST-FAIL-N-011: Reconnect to Redis after connection recovery
- [ ] TEST-FAIL-N-012: Reconnect to Neo4j after connection recovery
- [ ] TEST-FAIL-N-013: Reconnect to Prolog after connection recovery
- [ ] TEST-FAIL-N-014: Recover message queue after reconnection
- [ ] TEST-FAIL-N-015: Recover session state after reconnection
Resource Exhaustion (10 tests)
- [ ] TEST-FAIL-R-001: Handle Redis memory exhaustion
- [ ] TEST-FAIL-R-002: Handle Neo4j disk exhaustion
- [ ] TEST-FAIL-R-003: Handle kernel memory exhaustion
- [ ] TEST-FAIL-R-004: Handle kernel CPU exhaustion
- [ ] TEST-FAIL-R-005: Handle message queue overflow
- [ ] TEST-FAIL-R-006: Handle file descriptor exhaustion
- [ ] TEST-FAIL-R-007: Handle network bandwidth exhaustion
- [ ] TEST-FAIL-R-008: Apply backpressure on queue full
- [ ] TEST-FAIL-R-009: Reject new work on resource exhaustion
- [ ] TEST-FAIL-R-010: Recover after resource becomes available
Data Corruption (10 tests)
- [ ] TEST-FAIL-D-001: Handle corrupted Redis state
- [ ] TEST-FAIL-D-002: Handle corrupted Neo4j data
- [ ] TEST-FAIL-D-003: Handle corrupted Prolog rules
- [ ] TEST-FAIL-D-004: Handle corrupted configuration
- [ ] TEST-FAIL-D-005: Handle malformed CXP messages
- [ ] TEST-FAIL-D-006: Handle invalid session state
- [ ] TEST-FAIL-D-007: Handle invalid Volk metadata
- [ ] TEST-FAIL-D-008: Handle invalid workflow definition
- [ ] TEST-FAIL-D-009: Validate and reject corrupted data
- [ ] TEST-FAIL-D-010: Restore from backup on data corruption
Concurrency Issues (15 tests)
- [ ] TEST-FAIL-C-001: Handle race condition in routing
- [ ] TEST-FAIL-C-002: Handle race condition in session init
- [ ] TEST-FAIL-C-003: Handle race condition in Volk registration
- [ ] TEST-FAIL-C-004: Handle race condition in policy updates
- [ ] TEST-FAIL-C-005: Handle race condition in workflow execution
- [ ] TEST-FAIL-C-006: Handle deadlock in escalation routing
- [ ] TEST-FAIL-C-007: Handle deadlock in resource allocation
- [ ] TEST-FAIL-C-008: Handle livelock in message routing
- [ ] TEST-FAIL-C-009: Prevent double message delivery
- [ ] TEST-FAIL-C-010: Prevent double session initialization
- [ ] TEST-FAIL-C-011: Prevent double Volk registration
- [ ] TEST-FAIL-C-012: Use atomic operations for state updates
- [ ] TEST-FAIL-C-013: Use transactions for multi-step operations
- [ ] TEST-FAIL-C-014: Detect and break deadlocks
- [ ] TEST-FAIL-C-015: Timeout on livelock detection
Summary Statistics
| Category | Total Tests | Completed | Percentage |
|---|---|---|---|
| Unit Tests | 150 | 0 | 0% |
| Integration Tests | 100 | 0 | 0% |
| Contract Tests | 50 | 0 | 0% |
| Performance Tests | 80 | 0 | 0% |
| Compliance Tests | 11 | 0 | 0% |
| Failure Scenario Tests | 50 | 0 | 0% |
| TOTAL | 441 | 0 | 0% |
Test Execution Strategy
Local Development
# Run unit tests
uv run pytest tests/unit/ -v
# Run integration tests (requires Redis, Neo4j, Prolog)
uv run pytest tests/integration/ -v
# Run contract tests
uv run pytest tests/contracts/ -v
# Run performance tests
uv run pytest tests/performance/ -v --benchmark
# Run compliance tests
uv run pytest tests/compliance/ -v
# Run failure tests
uv run pytest tests/failures/ -v
# Run all tests
uv run pytest tests/ -v --cov=src --cov-report=html
CI/CD Pipeline
- All tests run on every commit
- Integration tests require test infrastructure (Redis, Neo4j, Prolog containers)
- Performance tests run nightly
- Compliance tests run on release branches
- Failure tests run weekly with chaos engineering
Last Updated: 2026-01-15
Version: 1.0.0
Maintained By: Architecture Team
Other tracked files
specs/001-kernel/compliance-audit.mdspecs/001-kernel/eventbus-addendum.mdspecs/001-kernel/pipeline-event-type-addendum.mdspecs/001-kernel/review-2026-03-25.md
Full spec text
Verbatim from specs/001-kernel/spec.md; headings are pushed down two levels.
SPEC-001: Orchestration Kernel (U:KR)
Metadata
- Spec ID: 001-kernel
- Title: Orchestration Kernel
- Alias: U:KR
- Author: Mohamed
- Status: Complete
- Created: 2026-01-15
- Last Updated: 2026-01-15
- Priority: P0
- Components: Kernel module, Volk Registry, Message Router
Overview
What
The Orchestration Kernel (U:KR) is the central nervous system of Orchestrata. It manages Volk (agent) registration, message routing, governance policy enforcement, session lifecycle, escalation handling, workflow orchestration, resource management, and audit trail logging.
Why
- Central coordination point for multi-agent systems
- Deterministic message routing between agents
- Governance enforcement at the infrastructure level
- Scalable to 1000+ concurrent agents
- Complete audit trail for compliance
How
- Redis-backed state management
- Prolog-driven governance queries
- CXP protocol for all inter-agent communication
- Async-first architecture for performance
User Scenarios & Stories
US-001: Volk Registration and Discovery (Critical)
As a Volk (agent) I want to register with the kernel and discover other Volks So that I can participate in the orchestration network
Acceptance Criteria:
- Register with unique alias (e.g., U:Ox, U:PS)
- Declare capabilities and supported protocols (CXP, gRPC, WS)
- Specify resource requirements
- Validate alias uniqueness
- Query registered Volks by capability or protocol
- Subscribe to registry updates
- Deregister cleanly with resource cleanup
US-002: Message Routing and Dispatch (Critical)
As a Kernel I want to route CXP messages to appropriate Volks So that agents can communicate deterministically
Acceptance Criteria:
- Route based on TO field in CXP packet
- Support unicast, multicast, and broadcast routing
- Route to specific Volk instance or role
- Handle offline Volks with queueing
- Retry failed dispatches with exponential backoff
- Track delivery status (queued, dispatched, delivered, acknowledged, failed)
- Apply backpressure when queues are full
- Support priority queuing
US-003: Governance Policy Enforcement (Critical)
As a Kernel I want to enforce governance policies via Prolog So that the system respects PAM++ boundaries and rules
Acceptance Criteria:
- Query Prolog for routing decisions (<10ms cached)
- Validate message sender has authority
- Enforce component ownership boundaries
- Block unauthorized cross-boundary messages
- Support ownership delegation
- Log all policy violations
- Detect conflicts requiring escalation
- Support policy dry-run mode
US-004: Session Management (High)
As a Kernel I want to manage session lifecycle So that multi-session workflows maintain state correctly
Acceptance Criteria:
- Create session with unique ID and context
- Load session-specific Prolog rules
- Maintain session facts, portfolio, carryover tasks
- Isolate session state from other sessions
- Support session context queries and updates
- Gracefully terminate sessions with artifact archival
- Transfer carryover to next session
US-005: Escalation Handling (High)
As a Kernel I want to handle escalations when conflicts occur So that deadlocks and disputes are resolved
Acceptance Criteria:
- Detect ownership, permission, resource conflicts
- Classify conflict severity (low, medium, high, critical)
- Query Prolog for escalation authority
- Route escalation to U:Ox or component owner
- Support multi-level escalation paths
- Handle circular escalation dependencies
- Timeout stale escalations
- Track resolution compliance
US-006: Workflow Orchestration (Medium)
As a Kernel I want to coordinate multi-step workflows across Volks So that complex tasks complete correctly
Acceptance Criteria:
- Parse workflow definitions (YAML/JSON)
- Support sequential, parallel, conditional branching
- Define step dependencies (DAG)
- Track step completion status
- Handle step failures with retries and rollback
- Support workflow pause/resume/cancellation
- Collect step outputs for next steps
- Generate workflow execution reports
US-007: Resource Management (Medium)
As a Kernel I want to manage system resources So that Volks have what they need without overload
Acceptance Criteria:
- Track CPU, memory, network, storage resources
- Allocate and enforce resource quotas per Volk
- Handle resource contention with prioritization
- Deallocate resources when Volk completes
- Enforce per-Volk and system-wide limits
- Throttle or terminate Volks exceeding limits
- Monitor and alert on resource exhaustion
US-008: Audit Trail Logging (High)
As a Kernel I want to log all orchestration decisions So that we have complete audit trails
Acceptance Criteria:
- Log all routing decisions, policy queries, escalation events
- Log session lifecycle, resource allocation, workflow execution
- Persist logs to Neo4j knowledge graph and file system
- Include timestamps, session context, correlation IDs
- Support log rotation, compression, encryption
- Query logs by session, Volk, event type, time range
- Generate audit reports
US-009: Configuration Management (Medium)
As a Kernel I want to manage configuration dynamically So that the system adapts without restarts
Acceptance Criteria:
- Load configuration from YAML, environment variables
- Validate configuration schema
- Support hot-reload without restart
- Apply changes incrementally with rollback
- Notify Volks of configuration changes
- Track configuration change history
US-010: Performance and Scalability (High)
As a Kernel I want to operate efficiently at scale So that the system supports 1000+ agents
Acceptance Criteria:
- <50ms p95 routing latency
- <10ms p95 policy query latency (cached)
- 10,000 messages/sec throughput
- Handle 1000+ concurrent Volks
- 99.9% uptime
- Support horizontal scaling with sharding
- Graceful degradation under load
Functional Requirements
See checklists/requirements.md for 305+ detailed requirements organized by user story.
Core Capabilities
| Capability | Target |
|---|---|
| Volk Registration | <50ms |
| Message Routing | <50ms p95 |
| Policy Query (cached) | <10ms p95 |
| Session Creation | <100ms |
| Escalation Resolution | <200ms |
| Workflow Step Execution | <500ms |
Technical Design
Architecture
┌─────────────────────────────────────────────────────────┐
│ U:KR - Kernel │
├─────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Volk │ │ Message │ │ Policy │ │
│ │ Registry │ │ Router │ │ Engine │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ ┌──────┴──────┐ ┌──────┴──────┐ ┌──────┴──────┐ │
│ │ Session │ │ Workflow │ │ Resource │ │
│ │ Manager │ │ Orchestrator│ │ Manager │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────┤
│ Redis (State) │ Neo4j (Audit) │ Prolog (Governance)│
└─────────────────────────────────────────────────────────┘
Key Interfaces
IVolkRegistry
class IVolkRegistry(Protocol):
async def register(self, volk: VolkRegistration) -> str: ...
async def deregister(self, alias: str) -> None: ...
async def discover(self, capability: Optional[str] = None) -> List[Volk]: ...
async def get_volk(self, alias: str) -> Optional[Volk]: ...
IMessageRouter
class IMessageRouter(Protocol):
async def route(self, packet: CXPPacket) -> RoutingResult: ...
async def dispatch(self, packet: CXPPacket, volk: Volk) -> DispatchResult: ...
async def get_status(self, message_id: str) -> DeliveryStatus: ...
IPolicyEngine
class IPolicyEngine(Protocol):
async def query(self, predicate: str, args: List[Any]) -> PolicyDecision: ...
async def validate_route(self, from_volk: str, to_volk: str) -> bool: ...
Data Models
Volk Registration
class VolkRegistration:
alias: str # U:Ox, U:PS, etc.
role: str # orchestrator, postman, etc.
capabilities: List[str] # What the volk can do
protocols: List[str] # CXP, gRPC, WebSocket
resources: ResourceRequirements
endpoint: str # Connection address
Routing Table Entry
class RoutingEntry:
message_id: str
from_volk: str
to_volk: str
status: DeliveryStatus
timestamp: datetime
attempts: int
error_reason: Optional[str]
Success Criteria
- Performance: <50ms p95 routing, <10ms p95 policy queries
- Scale: Support 1000+ concurrent Volks, 10K msg/sec
- Reliability: 99.9% uptime, zero message loss
- Governance: All routing decisions pass Prolog validation
- Audit: Complete audit trail for all operations
Dependencies
- orchestrata-core (enums, interfaces)
- orchestrata-cxp (packet format)
- orchestrata-governance (Prolog integration)
- orchestrata-session (Redis state)
- orchestrata-knowledge (Neo4j audit)
Integration Points
| Component | Integration |
|---|---|
| orchestrata-postman | Message delivery |
| orchestrata-orchestrator | Escalation handling |
| orchestrata-agents | Volk lifecycle |
| orchestrata-session | Session state |
Revision History
| Date | Version | Author | Changes |
|---|---|---|---|
| 2026-03-07 | 1.0 | Mohamed | Initial specification |