Home / Projects / Orchestrata Ultimate / Decisions / ADR index / ADR-0117

ADR-0117: SPEC-109 rename engine moves to codetools, and orchestrata consumes the deployed CLI

field value
Status Accepted — Accepted (ruling, Mohamed, 2026-10-20, verbatim: "A" — ratifying option A of the coordinator's location prompt over plans/refactor-convergence-design.md)
Date 2026-10-20
Register factory (docs/adr, 4-digit ids)
Source docs/adr/0117-spec-109-rename-engine-moves-to-codetools-and-orchestrata-consumes-the-deployed-cli.md — permalink at 6030e848a (unchanged on master since that commit)
Wiki register entry ADR-0117 (wiki status: Accepted)

← ADR-0116 · ADR-0118 →

The record

Status: Accepted (ruling, Mohamed, 2026-10-20, verbatim: "A" — ratifying option A of the coordinator's location prompt over plans/refactor-convergence-design.md) · Date: 2026-10-20

Context

The refactor-convergence design (2026-10-20, measured) inventoried five refactoring surfaces. SPEC-109's engine — a real stdio JSON-RPC client for basedpyright-langserver with the ratified spike findings (prepareRename/rename/definition, didOpen-before-prepareRename, wait_until_settled, the hard no-name-matching timeout policy REQ-109-103) — is built and 13-module-tested but stranded: the CLI seam shipped (scripts/rename_engine.py), the volk-tool registration was declared-deferred by its own design §5, and refactor.rename.tool has 0 production importers.

Four measurements decide the location question:

  1. codetools already hosts the lane: ~/workspace/orchestrata.codetools/src/codetools/ carries 24 cross-project code-intelligence packages (ast, design — code2diagram/diagram2code, gate, graph, realize, refactor, review, rtm, spec, testing, trace, …), deployed at /opt/codetools/bin — and codetools.refactor holds import-level primitives (module_move, import_rewrite, Prolog-driven refactor results) with no pyright/LSP presence anywhere in codetools. SPEC-109 fills the lane; it does not duplicate it.
  2. The engine is nearly coupling-free: across its 29 modules, exactly 5 external orchestrata imports — core.base.traces, core.tracing.tracer, tools.base, tools.lsp_tool (URI helpers), tools.registry. The LSP machinery itself is project-independent by construction.
  3. The components refactor has no home for it: refactor/ has ZERO mentions in packages/integration/design/clean-target.md and boundary-census.md — unassigned dev tooling in the product tree that cut-over must evict anyway.
  4. ADR-0108 is the precedent at the correct scope: the AST toolkit stayed host-side because it is THIS repo's KB engine; the rename engine is not repo-specific, so its host-side home is codetools. ADR-0108's seam shape (contracts-protocol injection) applies on concrete consumption — codedirector had two real function calls; rename has zero concrete volk consumers today, which is exactly why SPEC-109's own §5 deferred the registration.

Decision (Mohamed, verbatim: "A")

  1. The SPEC-109 engine moves to codetools — refactor/rename/ (engine), scripts/rename_engine.py (CLI), the 13 test modules, and the SPEC-109 bookkeeping: the spec travels with the code into codetools' own spec/rtm machinery. Orchestrata's side RECORDS the move (RTM/spec disposition so REQ-109 ids do not dangle) — a move is recorded, never silently deleted.
  2. Orchestrata consumes the deployed CLI (/opt/codetools/bin lane). A contracts-protocol injection seam is added ONLY when a concrete volk consumer exists — named trigger, no speculative seam (the ADR-0108 consumption precedent).
  3. Two-copy parity discipline for the move: the owed orchestrata-side sanctioned green proof (M5: run_tests.py tests/refactor/rename/*.py --skip-gates — the RUL-038 guard named this exact invocation) runs BEFORE the move; the move is byte-faithful; codetools' runner proves green AFTER. The "before" leg is the move's oracle.
  4. The toolkit's KB-native rename stays (repo-local snapshot + Prolog KB + symtable — it cannot move). The convergence design's lane split stands with the INFERENCE/type-resolved EXECUTION planner living in codetools: name/func/class/module kinds → toolkit fast path; method/type-scoped renames → the codetools engine.
  5. In-packet adjudication: codetools.refactor.module_move vs SPEC-109's module_move (overlap measured — one wins or they compose; the packet's design note rules it, not the builder).
  6. NOT in this ruling: refactor/codemod/ and refactor/ctok/ are the same unassigned- dev-tooling class but stay pending their own location ruling (asked alongside; deliberately not assumed from the "A").

Alternatives rejected

Consequences

Provenance

Mohamed's in-session ruling, 2026-10-20, verbatim "A" on the coordinator's three-option location prompt (options A/B/C as recorded in §Alternatives). Evidence of record: plans/refactor-convergence-design.md §2 inventory + §3 M1-M6 and the location-prompt measurements (codetools package listing; the 29-module/5-import coupling scan over plans/ast-ultimate.json; the zero-mention grep of clean-target.md + boundary-census.md; scripts/rename_engine.py present at 10.3KB; cst-lsp measured third-party — Roy Williams, MIT — and therefore NOT a codetools precedent). Precedents: ADR-0108 (host-side engine + seam-on- consumption), ADR-0107/0112 (component-package boundary rulings), SPEC-109 design §5 (the deferred-wiring declaration this ruling supersedes).

Rulings cited

Specs cited