Orchestrata Ultimate › Plans › analysis-2026-07-06-findings

Deep-Analysis Findings — 2026-07-06 (Session 199)

Source: plans/analysis-2026-07-06-findings.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-05 · 198 lines.

Prose pending.

Plan text

Deep-Analysis Findings — 2026-07-06 (Session 199)

Evidence-based snapshot of code, architecture, structure, features, process, and hygiene, produced by an Opus orchestrator + 5 read-only agents (hygiene, AST metrics, architecture, feature inventory, spec-gap triage) + direct measurement. Companion execution plan: plans/swarm-remediation-plan-2026-07-06.md. Nothing in this doc is a vibe; every claim was measured or cited this session.

1. Headline verdict

The system is substantially real, not vaporware: intent→volk pipeline proven by 344 trace files (114 with live llm_call events, e.g. 34s U:Cp stage latency in pipeline_output/traces/pipeline_3408344e.jsonl); 7 working provider adapters behind configs/spike-profiles.yaml routing; vizint-ui with executed Playwright artifacts; docker(4 services)+incus composition. Architecture is a governed layered monolith with a CXP/Postman message spine — the 6-layer import model in scripts/architecture_checker.py holds at 622 files / 1 live violation (from 91 historical). The debt is duplicated organs, not bad bones (port residue: twin runners/routers/policy stacks), plus broken truth instruments (RTM validation, pyright baseline, projectstatus.md) that misreport project state.

2. Scale & quality metrics (measured 2026-07-05/06)

3. Broken truth instruments (highest leverage)

  1. RTM validation is false-confidence garbage: docs/rtm.json (regenerated 2026-07-06T01:40) reports 1 verified / 35 missing / 4,585 orphan / 2.8% coverage. Cause: spec-000's checklist uses non-canonical format (~112 REQ-000-* invisible) and 5 specs (009, 050, 097, 103, 104) lack checklists/requirements.md, so generate_rtm.py's parser can't see the requirements that 4,600+ @traces decorators point at → nearly everything counts as "orphan". The value-based check-traces gate gives the real picture: 241 genuinely untraced REQs + 265 dangling + 0 malformed (506 findings). Untraced by spec: 102: 96, 105: 40, 007: 23, 003: 22, 005: 18, 022: 13, 028: 13, 017: 10, 009: 5, 004: 1. Dangling clusters exactly in the 5 checklist-less specs (103: 9, 104: 8, 050: 2, 097: 1, 100: 1 by unique REQ) → parser artifacts, not code gaps.
  2. Pyright baseline myth: gates check changed-files only ("no NEW errors"), so whole-tree debt grew unmeasured to 631. Needs a committed pyrightconfig + full-tree ratchet (the untyped --max ratchet pattern demonstrably worked).
  3. projectstatus.md is 2 months stale (2026-04-27: "77% coverage, 16,000 tests, v1.0.0 pending") and contradicts context.json. Two authorities, one wrong.
  4. ast_query_cli snapshot staleness is silent: snapshot said 618 modules / 155,085 LOC vs live 671 / 163,477 — 105 src files newer than the snapshot, no freshness warning.
  5. unused query is structurally blind to the worst orphans: it skips @traces-decorated defs and string-literal-mentioned names — which hid BOTH confirmed orphan classes (below). Nearly every public symbol is decorated, so it can never find a decorated orphan.

4. Architecture findings (ranked)

  1. Two competing PipelineRunners + a third engine — kernel/pipeline.py:83 ("…Sole orchestrator for the pipeline") vs orchestrator/pipeline_runner.py:109 ("executes dynamic agent stages through Postman routing") vs kernel/workflow_engine.py (992-LOC generic DAG engine). Both kernel files open with # mypy: ignore-errors. The kernel-vs-orchestrator ownership question is THE root decision; routers/policy duplication flows from it.
  2. Five traceability implementations under the 444-fan-in symbol: core/base/traces.py, core/traceability/__init__.py, core/traceability_utils.py, core/tracing/traceability.py, verification/traceability.py. Drift silently corrupts the RTM.
  3. Port-residue duplicate pairs: cxp/router.py CXPRouter vs kernel/router.py also named CXPRouter vs postman/router.py RoutingEngine; 3 policy stacks (governance/policy_engine.py, kernel/policy_evaluator.py, orchestrator/engine.py); postman/types.py vs postman/postman_types.py; kernel/error_handler.py vs core/patterns/error_handling.py; LRUCache ×2 (core/lru_cache.py, kernel/performance/resources.py); architect mixin near-twins (architect_context.py≈context_mixin.py, architect_project.py≈ project_mixin.py).
  4. DI container (951 LOC) bypassed at real composition roots — instantiated once outside its package (gateway/server.py:252), resolved via plugin/context.py:136; gateway actually wires by setters (gateway/rpc.py set_processor:124 / set_neo4j_driver:136 / set_memory_engine:150 / set_kernel_client:172 / set_policy_engine:197); kernel/cli_main.py _boot_monolithic:250 hand-constructs a parallel world.
  5. ~60 function-scoped lazy imports in agents/ satisfy the layer checker while preserving runtime L3-peer coupling (e.g. agents/volks/analyst/agent.py:246 lazily imports knowledge_graph.kg_design). Invisible to the gate.
  6. Entry-point sprawl: 12 src entrypoints vs 4 docker services + incus path; kernel/cli.py vs kernel/cli_main.py vs root cli.py overlap; no shared composition root.
  7. agents/volks layout non-uniform: 10 package-volks; senior_dev.py flat; analyst exists TWICE (package analyst/agent.py+parsers.py AND legacy flat mixins analyst_parsing.py/analyst_storage.py at volks/ root).
  8. architecture-standards.md is a 13-line stub; the real layer model lives only in scripts/architecture_checker.py:20-68 (+ KNOWN_VIOLATIONS at :84-89, 1 codified exception: cxp.prolog_bridge→orchestrator.prolog_worker). The checker's header references architecture/layer-dependency-rules.md which does not exist. Per-package interfaces.py files still define ~43 protocols (postman/interfaces.py alone: 19) with no written placement policy.

5. Feature reality

Feature Verdict Evidence
Intent→volk pipeline LIVE 344 traces; trace_llm_call from agents/volks/base.py:199/:236
Provider routing (011/028) LIVE 7 adapters; router/circuit_breaker/rate_limiter/cost_tracker real
Gateway + vizint-ui (014/016) LIVE Playwright run artifacts incl. failure/retry traces in vizint-ui/test-results/
Memory engine (010) WIRED gateway/server.py:241 _register_memory_engine; Redis hot + Neo4j cold
Governance/Prolog (007) WIRED PolicyEngine + prolog bridges ×4 layers; tool-interceptor e2e test
Tool-calling volks PARTIAL Loop live in only base + documentor (2 of ~12); AnthropicAdapter.complete does NOT forward tools/tool_choice (backlog #33) so API-route tool_use can't trigger
Context injection (009) SPLIT Live ContextInjector works; VolkContextInjector (450 LOC, 6 handlers, fully tested) has 0 callers — confirmed via refs
SPEC-103 refactor loop REAL refactor/agent.py + scripts/refactor.py, separate tool loop
Deploy REAL docker-compose + 4 Dockerfiles; incus launch scripts (+gitlab)
AST toolkit + 6 generators LIVE gen-volk/gen-facade argparse-registered (serialize_codebase_ast.py:6926/:6957) + tested

Known orphans (tested-but-never-wired false confidence): AnalystStorageMixin (agents/volks/analyst_storage.py:15) and VolkContextInjector (knowledge_graph/volk_context_injector.py:160) — each 1 def / 0 src imports / 0 uses, each with dedicated passing test files.

6. Process & operational findings

7. Hygiene inventory

8. Conversation-history observations (S195–198 + 341-session archive)