Orchestrata Ultimate › Plans › wiring-campaign-2026-07-06

Wiring campaign — construct and wire ALL unwired code (user order, 2026-07-06)

Source: plans/wiring-campaign-2026-07-06.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-06 · 124 lines.

Prose pending.

Plan text

Wiring campaign — construct and wire ALL unwired code (user order, 2026-07-06)

Ruling: every implemented, spec-traced module with zero production construction gets WIRED (D14/D15 ruling generalized). Retirement is not an option; the only allowed exception is a proven same-REQ twin, which gets an individual consolidation ruling (absorb the better implementation into the live path — never delete capability).

Source of truth: module-granularity orphan audit (2026-07-06, 128 orphans = 10 entrypoints + 1 dynamic + 9 shims + 4 dead twins + 96 unwired + 8 misc). Entrypoints/shims/dynamic are NOT on this list (they are wired by process boundary or documented design). The 96 + ruled D13 items are the campaign.

Wave A — surgical quick wires (D13 already ruled) — MOSTLY LANDED (b44426a1)

Wave B — verification subsystem (D14) — PLAN LANDED (see D16)

22 modules / 2,975 LOC, SPEC-007b. Stages A–E per D16: A) audit-only QA Gate 4 via VerificationEngine (D3 precedent); B) author prolog/verification.pl + fix ConstraintEvaluator to consult Prolog; C) max_attempts 5 + ESCALATED→EscalationInterruptMixin (G226 reconciled: two counters, two scopes); D) replace 4 model-wrapper stubs with real call_llm + rewrite their stub-asserting tests; E) IntentConstraint adapter.

Wave C — postman engine layer (D15) — ABSORPTION PLAN LANDED

16 modules / 6,172 LOC, SPEC-002. 12 phases; first seam = Postman.route() constructs DeliveryManager (+RoutingEngine+EnvelopeHandler) via a packet↔envelope adapter (to_instance handled pre-engine). BLOCKER to fix first: delivery.py:336-382 _deliver_to_recipient is a stub that lies DELIVERED. True twins to consolidate: Postman's local DeliveryStatus/ QueueEntry/DeliveryResult vs types.py supersets (same REQ ids). Phase 7 (message_store/replay sqlite + self-made redis) violates D12 — needs factory routing + storage decision BEFORE landing. Phase 12 governance.py is an island (never calls real PolicyEngine) — rewrite to delegate before absorbing. postman/queue.py (934 LOC near-twin of queue_manager) + EventEmittingPostman flagged for follow-up audit.

Wave D — knowledge_graph analysis layer (10 modules, 1,698 LOC)

ast_analyzer, dependency_analyzer, history, pam_integration, portfolio, relationships, search, temporal, test_results_store, versioning. Natural consumers: gateway/handlers/knowledge.py RPC surface, the KG gRPC server, session/kg_context. test_results_store additionally converges with gateway/test_runner.py writers (D12 P2 canonical writer).

Wave E — orchestrator managers (9 modules, 3,135 LOC)

ambiguity_resolver, fact_store, impact/cli, intent_broker, intent_dispatcher, intent_template, intent_workflow, nlp, policy_registry. Natural consumers: orchestrator/engine.py intent path (parse → validate → broker → dispatch → workflow), U:Ox governance surface.

Wave F — kernel composition bundle (D17 ruled) + managers

F1 (ruled, D17): compose into OrchestrationKernel.init/start(): AuditLogger (SPEC-001 US-008), PAMEnforcer → dispatcher path (US-003), ResourceMonitor → health loop (US-007), performance package. Fold kernel/pam/escalation.py's unique behavior into the already-wired governance.escalation_handler, then delete the wrapper (true twin). kernel/cli.py: no action (lazy-import coverage artifact).

Wave G — agents old runtime layer (9 modules, 2,196 LOC)

coordinator, cxp_adapter, escalation, intent_adapter, lifecycle, postman_adapter, prompt_builder, spec_writer, uml_generator. TWIN CHECK REQUIRED: these predate the volks/ generation; each module's REQs checked for a live volks/-side implementation before wiring (audit W1.6 flagged AgentPool/AgentRuntime/CXPVolkAdapter unresolved since e3b4317b).

Wave H — session managers (8 modules + 2 examples, 2,113 LOC)

recovery, sync, mcp_tools, prolog_facts, fireflies_tools, hooks/{session_auto_start_hook,session_fact_hook,session_pre_close_hook}. Natural consumers: session/controller lifecycle + CLI; hooks wire into the hook_registry. examples/{basic_usage,portfolio_usage} are doc-smoke targets (already pytest-smoked) — reclassify, not wire.

Wave I — misc singles

core/isolation.py (Isolation), core/patterns/error_handling.py, cxp/{ws_client,ws_server} (parallel WS transport vs gateway/server.py — TWIN CHECK), integrations/fireflies_sync.py (consumer: knowledge_graph/fireflies write path + gateway/handlers/fireflies.py).

Traceability gate (user ruling: "make sure they are traced — the RTM

should display exactly that")

Every wave's definition of done includes:

  1. Every wired module KEEPS/GAINS correct @traces(spec=, story=, reqs=[…]) — and the NEW construction/wiring seam itself carries a @traces for the REQ it satisfies (wiring IS requirement satisfaction).
  2. python scripts/serialize_codebase_ast.py check-traces passes — no orphaned REQs, no reqs claimed by deleted code.
  3. RTM regenerated (scripts/generate_traced_rtm_simple.py → docs/rtm.md + rtm.json) in the same commit; the wave's REQ ids must visibly move to implemented+tested in the RTM diff. The RTM is the campaign's public scoreboard: unwired spec code shows up there, wired code shows exactly where it is constructed and which tests prove it.

Sequencing / load management

One wave of agents at a time alongside the coverage swarm; Wave A now (single wirer), B+C on plan arrival, D–I as slots free. Every wave: worktree isolation, twin-check before construction, no-mocks tests proving the wiring (construction + call path + observable effect), gates green, merge to main serially. Progress tracked by checkboxes here.