Orchestrata Ultimate › Plans › briefs › kimi-c2-result

Kimi task C2 — twin-bug sweep results

Source: plans/briefs/kimi-c2-result.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-22 · 220 lines.

Prose pending.

Plan text

Kimi task C2 — twin-bug sweep results

Generated from a repo-wide sweep of tests/ + src/orchestrata_ultimate/ for bind/listen/serve sites and a cross-check of every MERGE (:<Label> {…}) against knowledge_graph/canonical_schema.py.


Part 1 — fixed ports bound by tests across parallel batches

Method

Findings

Port-source table (non-dynamic / env-driven sites only)

file:line bind/serve call port source worker-slot-scoped? collision candidate? notes
src/orchestrata_ultimate/cxp/grpc_server.py:436 add_insecure_port CXP_GRPC_PORT env (→ kernel 50053) no no shared infra by design (kernel gRPC)
src/orchestrata_ultimate/cxp/ws_server.py:200 websockets.serve literal default 8765 (WSServerConfig.port) no yes no env var; every default-constructed WSServer() binds the same port
src/orchestrata_ultimate/gateway/server.py:657 websockets.serve GATEWAY_PORT env (→ 8765) no no shared infra by design (gateway WS)
src/orchestrata_ultimate/gateway/http_surface.py:89 uvicorn.Server GATEWAY_HTTP_PORT env (→ 8766) no yes gateway HTTP health/metrics surface; not in the explicit shared-infra list but gateway-owned
src/orchestrata_ultimate/semantic_graph/ha_controller_cli.py:177 uvicorn.Server MEMGRAPH_HA_PORT env (→ 8080) no yes tests currently pass MEMGRAPH_HA_PORT=0, so no live collision today; latent fixed-port risk
tests/knowledge_graph/test_server.py (server bind) CXPServer via server._serve() KG_GRPC_PORT env (→ 50052) yes no known / in-flight (Workstream A); per-slot remap in tests/conftest.py:81-90

Dynamic-port sites (safe — not collision candidates)

The following patterns were found repeatedly and all bind port 0 or a _free_port() / _find_free_port() value:

These are not tabulated individually because every one uses dynamic allocation.

Part 1 summary line

Part 1: 3 candidate ports (3 new).


Part 2 — uniqueness-constraint labels vs MERGE keys

Canonical constraints source

Uniqueness constraints are taken from src/orchestrata_ultimate/knowledge_graph/canonical_schema.py (CANONICAL_MERGE_KEYS), rendered by _constraint_ddl() and exposed through get_all_ddl(). There are 70 canonical (label, key) pairs; the full list is:

label canonical key
Action id
Alert id
ApiContract id
Architecture id
ArchitectureDecision id
Artifact id
AuditEntry entry_id
CapacityModel id
Change id
Class id
CloudService name
Component id
Constraint id
Conversation id
ConversationTurn id
CostLineItem id
CostModel id
DataEntity id
Decision id
Deployment id
DesignClass id
DesignModule id
Directory id
Environment id
Escalation id
Event id
Fact id
FailureMode id
File id
Function id
GatewayEvent entry_id
Intent id
Memory id
Message message_id
Module id
Package id
Parameter id
Pattern name
PipelineRun id
PolicyDecision id
Portfolio name
Predicate id
Project slug
QualityAttribute id
Region code
Requirement id
RequirementItem id
Resolution resolution_id
Risk id
Rule id
Scenario id
SemanticChunk id
ServiceLevelObjective id
Session session_id
SessionEnd id
SessionStart id
Spec id
Task id
TechnologyChoice id
Test id
TestResult id
TestRun id
Timeout id
Tool name
ToolCall id
TradeOff id
UserStory id
Violation id
Volk alias
WAFPillar name

(Constraints are also applied by scripts/migrate_neo4j_canonical.py and the kg_schema.py apply step invoked from scripts/bootstrap_graphs.py.)

MERGE / constraint mismatches found

Swept src/orchestrata_ultimate/ and scripts/ for MERGE (:<Label> {<key>: …}) on canonical labels and compared the MERGE key to the canonical constraint key.

constraint (label.key) MERGE site file:line MERGE key notes
Volk.alias src/orchestrata_ultimate/kernel/audit/writers.py:288 volk_id audit writer creates (v:Volk {volk_id: …})
Class.id src/orchestrata_ultimate/knowledge_graph/kg_context.py:779 name regex-driven class sync MERGEs on name + file_path
Function.id src/orchestrata_ultimate/knowledge_graph/kg_context.py:803 name regex-driven function sync MERGEs on name + file_path
Message.message_id src/orchestrata_ultimate/knowledge_graph/runtime_writer.py:91 id runtime signal writer MERGEs (m:Message {id: …})
GatewayEvent.entry_id src/orchestrata_ultimate/knowledge_graph/runtime_writer.py:135 id runtime signal writer MERGEs (e:GatewayEvent {id: …})
Project.slug src/orchestrata_ultimate/knowledge_graph/sync.py:205 id AST sync MERGEs (p:Project {id: …})
TestRun.id src/orchestrata_ultimate/knowledge_graph/test_results_store.py:130 run_id test-results store MERGEs (r:TestRun {run_id: …})
Function.id src/orchestrata_ultimate/knowledge_graph/test_results_store.py:200 name COVERS relationship writer MERGEs (f:Function {name: …})
Memory.id src/orchestrata_ultimate/memory/cold_store.py:132 key cold store MERGEs (m:Memory {key: …})
Module.id src/orchestrata_ultimate/semantic_graph/adapters/memgraph.py:576 name Memgraph chunk linker MERGEs (m:Module {name: c.module})

Known File/Directory self-check

The brief's known instances are the historical File/Directory mismatch (File/Directory MERGEd on id while the constraint was on path). The canonical_schema.py ruling has since been updated: File and Directory now have canonical keys id (file_id / directory_id constraints), and the old file_path / directory_path constraints were removed from knowledge_graph/schema.py.

historical site MERGE key current canonical constraint status
src/orchestrata_ultimate/session/kg_sync/_stage_folders.py:112 id Directory.id known — now aligned
src/orchestrata_ultimate/session/kg_sync/_stage_folders.py:125 id File.id known — now aligned
src/orchestrata_ultimate/knowledge_graph/synchronizer.py:321 id File.id known — now aligned
src/orchestrata_ultimate/knowledge_graph/kg_context.py:718 id File.id known — now aligned

Part 2 summary line

Part 2: 10 mismatches (10 new).

The 3 known File/Directory sites are included as a self-check; they are now aligned with the canonical id constraint and no longer constitute mismatches.