Orchestrata Ultimate › Plans › briefs › kimi-c2
Kimi task C2 — twin-bug sweep: shared ports + MERGE-key/constraint-key mismatches
Source: plans/briefs/kimi-c2.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-22 · 29 lines.
Prose pending.
Plan text
Kimi task C2 — twin-bug sweep: shared ports + MERGE-key/constraint-key mismatches
Read plans/parallel-collision-fix-plan.md (Workstream C2) for context. Enumeration only:
no code changes, no fixes, no test runs.
Part 1 — fixed ports bound by tests across parallel batches.
scripts/run_tests.py runs 4 concurrent batch subprocesses sharing one .env. Enumerate every
port a TEST module itself binds (listen/serve), as opposed to shared infra it merely connects to
(Redis 6379, Neo4j 7687, gateway 8765, kernel 50053 are shared BY DESIGN — exclude them unless a
test BINDS one). Method: sweep tests/ + src/ for bind/listen/serve sites (add_insecure_port,
bind, serve(, uvicorn, websockets.serve, socket binds) and trace each port back to its
env var or literal. For each: file:line, port source (env var name or literal), and whether it is
worker-slot-scoped. Flag every non-slot-scoped one as a collision candidate.
NOTE: KG_GRPC_PORT (50052) is already known and being fixed in Workstream A — list it, mark it
known / in-flight.
Part 2 — uniqueness-constraint labels vs MERGE keys.
From src/orchestrata_ultimate/knowledge_graph/canonical_schema.py (and any schema-bootstrap
Cypher creating constraints, e.g. scripts/migrate_neo4j_canonical.py,
scripts/bootstrap_graphs.py), list every label+property uniqueness constraint. Then sweep
src/ and scripts/ for every MERGE (:<Label> {<key>: ...}) on those labels and compare the
MERGE key to the constraint property. Report every mismatch: constraint (label.property) |
MERGE site file:line | MERGE key. The known instances (File/Directory merged on id, constraint
on path — session/kg_sync/_stage_folders.py:112,125, knowledge_graph/synchronizer.py:321,
knowledge_graph/kg_context.py:718) must appear in your output as a self-check; mark them
known. Any NEW mismatch is the payload — Workstream B0 consumes this list.
Deliverable: write plans/briefs/kimi-c2-result.md with both tables and a summary line per
part: Part 1: N candidate ports (M new) / Part 2: N mismatches (M new).