Orchestrata Ultimate › Plans › graph-usage-defects-plan

Graph-usage defects — remediation plan (2026-10-09)

Source: plans/graph-usage-defects-plan.md at 8a2cb42ad · last changed 2026-10-09 · first committed 2026-10-09 · 46 lines.

Prose pending.

Plan text

Graph-usage defects — remediation plan (2026-10-09)

Source: the "how is the graph used now?" investigation of 2026-10-09 against prod (/opt/orchestrata @ 1c0beae6a, both graphs on the prod cluster, split by database).

Findings being fixed

# Defect Evidence
D1 Gateway never reaches the kernel: _init_kernel probes grpc_connect_attempts times in ~1 s, then falls back to the in-process pipeline for the process lifetime (_probe_kernel_live has one caller). 44/44 gateway starts in 7 days logged "falling back to in-process pipeline"; the kernel binds its port ~6 s after systemd reports it started; 0 kernel dispatches in 7 days.
D2 Claude conversation capture is dead: the producer takes REDIS_HOST/PORT/DB from the ambient env; ~/.env has none, dev checkouts' .env name a retired subnet; the hook exits 0 silently. prod orchkg has 0 Conversation nodes; the only producer cursors in prod Redis are kimi's; test Redis holds 38 suite-fixture messages.
D3 Session-start recall cannot reach the conversation graph because ~/.env lacks CONVERSATION_KG_URI/DATABASE. SessionStart hook: "[conversation-recall] FAILED … rc=1".
D4 Kimi turns do not land: producer cursors advance in prod Redis, the consumer logs nothing on success, the graph holds no Project {slug:'orchestrata'} and no turns. consumer journal: only errors are logged, none in 7 days.
D5 ADRs never enter the operational graph: architecture_writer / adr_parser have zero non-test importers. prod ArchitectureDecision=0; test fleet 105 (from the suite).
D6 Kernel skips session facts: ORCHESTRATA_KERNEL_SESSION_ROOT unset in every profile. "[Session] No ORCHESTRATA_KERNEL_SESSION_ROOT configured — skipping" on every boot.
D7 claude/hooks/context_graph (Ctx* labels) is dead code: zero importers, no Ctx node in any fleet. toolkit who-imports; label census of both fleets.
D8 No seam can read the semantic database: graph_query.py has no --database. investigation had to stop at semantic_search.py.

Packets (one worktree each, all off origin/master)

Packet Worktree / branch Agent Defects Files it owns
P1 wt-GD-GATEWAY / feat/gd-gateway builder D1 gateway/server.py, gateway/config.py, deploy/systemd/orchestrata-gateway.service, tests/gateway/
P2 wt-GD-CONVERSATION / feat/gd-conversation builder D2, D4 (code half of D3) scripts/claude_turn_capture.py, claude/tools/claude_turn_capture.py, scripts/_irc_*.py, scripts/run_conversation_consumer.py, knowledge_graph/conversation_consumer.py, kernel/cli_main.py (consumer boot only), their tests
P3 wt-GD-ADR / feat/gd-adr builder D5 scripts/sync_architecture_to_graph.py, knowledge_graph/architecture_writer.py, adr_parser.py, scripts/check_adr_graph_sync.py, their tests
P4 wt-GD-SESSION-SEAM / feat/gd-session-seam wirer D6, D8 env/*.env, deploy state dir, kernel/pipeline_session.py, scripts/graph_query.py, their tests
P5 wt-GD-CTX-REMOVAL / feat/gd-ctx-removal refactorer D7 claude/hooks/context_graph/, claude/hooks/session_context_hook.py, tests/claude/test_context_graph_*, plugin manifests
— orchestrator (this session) — D3 (config half), D2 config ~/.env conversation keys, copied from /opt/orchestrata/.env; not committed

Packets own disjoint files, so they merge without conflict into feat/graph-defects (wt-GRAPH-DEFECTS), which is what ship takes to master and prod.

Rules every packet runs under

Verify → promote → deploy

  1. Each packet reports: branch, commits, test command and counts.
  2. Orchestrator reviews every diff, merges the five branches into feat/graph-defects, runs the affected-test gate (scripts/affected_tests.py) live, then ruff + black + scripts/gate.py run.
  3. ship from wt-GRAPH-DEFECTS: merge to master, promote to prod (promote_env.py promote --to prod), verify stage, graphs stage.
  4. Post-deploy proof on prod: gateway journal shows "kernel" mode (not fallback); orchkg gains ArchitectureDecision nodes equal to docs/adr/*.md; conversation_recall.py recent works from a workspace shell; a Claude turn from this session appears in the graph; graph_query.py --database memgraph returns the semantic label census; no "[Session] … skipping" line on kernel boot.