Orchestrata Ultimate › Plans › evidence › d3-duplicate-twins
D3 Evidence Pack — Port-Residue Duplicate Twins (verdict per pair)
Source: plans/evidence/d3-duplicate-twins.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-05 · 70 lines.
Prose pending.
Plan text
D3 Evidence Pack — Port-Residue Duplicate Twins (verdict per pair)
Source: auditor agent W3.E3 (2026-07-06). Decision: plan §D, D3. Blocks W3.3. Agent-declared not-verified: GovernanceEngine test assertions unread; LRUCache TTL/eviction semantics undiffed; dead architect-mixin tests' assertions not diffed against live tests. Chase during execution.
Verdicts
a. THREE routers — NEEDS-DECISION (plan's "rename kernel class" framing was wrong):
- cxp/router.py:53 CXPRouter — LIVE (cxp/init.py:167, dispatcher.py:24/:72); allow/deny route table + prolog governance.
- kernel/router.py:204 CXPRouter — 0 importers; NOT a copy (VolkRegistry-based, routing modes/metrics/trace); 3 dedicated test files = false confidence.
- postman/router.py:71 RoutingEngine — 0 importers; delivery.py:25,105 types the param as IRoutingEngine but nothing constructs THIS class; not exported.
- ASK: delete kernel/router.py or was it meant to replace kernel/dispatcher.py routing? delete postman/router.py or wire into DeliveryManager?
b. postman/types.py vs postman_types.py — MECHANICAL: types.py has 19 importers; postman_types.py 0 importers + a dedicated coverage test on dead code. Recipe: rm postman_types.py + tests/postman/test_postman_types_coverage.py.
c. kernel/error_handler.py vs core/patterns/error_handling.py — MECHANICAL (+trace-merge): byte-identical logic, both 0 importers; only @traces differ (SPEC-001/007 vs SPEC-100). Keep core/patterns; UNION kernel's @traces reqs onto survivor (protect RTM); delete kernel copy + its test; 4-5 test files duplicate- cover this dead code.
d. LRUCache ×2 — NEEDS-DECISION: core/lru_cache.py (1 consumer: governance/cache.py:21) vs kernel/performance/resources.py (package-local, Generic[T], richer). BOTH LIVE. ASK: promote kernel's to core/ + repoint, or accept two subsystem-local caches? Diff TTL/eviction semantics first.
e. Architect mixins — MECHANICAL: live = project_mixin.py + volk_context.py (imported by architect/volk.py:10,13). Dead = architect_context.py, context_mixin.py, architect_project.py (identical method sets, orphaned) + 5 dead test files. Diff assertions into live tests before deleting.
f. Flat analyst mixins — MECHANICAL: analyst_storage.py AnalystStorageMixin dead (backlog #35) AND analyst_parsing.py AnalystParsingMixin ALSO dead (NEW — widens #35). analyst/agent.py is the live path (kernel/pipeline.py:14, :155) and reimplements the logic independently (kg_store vs _kg_store divergence noted).
g. THREE policy stacks — NEEDS-DECISION (highest impact):
- governance/policy_engine.py:107 PolicyEngine — LIVE (gateway/server.py:306, via event_emitting wrapper). Its GovernanceEngine subclass (:423) = 0 callers.
- kernel/policy_evaluator.py:289 PolicyEvaluator — ~1200 LOC fully built (evaluate_routing/check_permission/validate_ownership/dry_run/audit), 2 test files, ZERO callers. postman/router.py:172 docstring admits "to integrate with PolicyEvaluator when available". A fully-built governance layer may be silently unenforced.
- orchestrator/engine.py:171 UOxEngine — LIVE (claude tool_interceptor.py:19,83,101).
- ASK: wire PolicyEvaluator into kernel/dispatcher.py routing, or delete as superseded? GovernanceEngine: delete or documented extension point?
h. senior_dev.py — MECHANICAL (packaging safe): LIVE via importlib dynamic dispatch (harness/executor.py:142 special_cases + import_module + getattr) — invisible to static refs. Recipe: move to agents/volks/senior_dev/agent.py + init re-export (mirror analyst); loader unchanged.
Sequenced W3.3 execution (mechanical, in order; 1 refactorer task each)
- b (postman_types) 2. f (analyst mixins ×2) 3. e (architect mixins ×3 + 5 tests)
- h (package senior_dev) 5. c (ErrorHandler + traces-union). Each with refs->expected + targeted pytest verify.
Decision-gated (Mohamed, priority order)
- g PolicyEvaluator wire-vs-delete + GovernanceEngine keep-vs-delete
- a kernel.router + postman.router wire-vs-delete (2 sub-decisions)
- d LRUCache consolidate-vs-accept (semantics diff first)