Orchestrata Ultimate › Plans › briefs › adr-0112-tools-seams
ADR-0112 tools seams — brief for one deepseek-pro run
Source: plans/briefs/adr-0112-tools-seams.md at 8a2cb42ad · last changed 2026-10-19 · first committed 2026-10-19 · 59 lines.
Prose pending.
Plan text
ADR-0112 tools seams — brief for one deepseek-pro run
DESIGN_WAIVER: ADR-0112. Execute that Accepted decision. Do not invent a tools→kernel edge.
Goal
packages/tools no longer imports orchestrata_kernel. Redis and embeddings are reached through contracts protocols. The tools parity allow-list rejects a kernel import.
Ruling / context
Read docs/adr/0112-tools-reaches-redis-and-embeddings-through-contracts-protocols-not-kernel-imports.md and implement it. Closed routes: do not amend boundaries.json to allow tools→kernel. Do not lazy-import kernel. Do not edit integration. Do not commit.
Measured call sites (line numbers may have drifted; find the names, do not trust a stale line if the name moved):
packages/tools/src/orchestrata_tools/schedule_cron_tool.pyimportscreate_async_redisfromorchestrata_kernel.core.redis_factory. The factory already accepts an injected client. Addredis_factory: RedisFactory | None. When it is None, constructredis.asyncio.Redis(host=..., port=..., db=...)from the host, port, and db the function already requires.redisis already a tools dependency. Preserve the existing raise-when-missing checks on those parameters.packages/tools/src/orchestrata_tools/search.pyimportsEmbeddingServicefromorchestrata_kernel.memory.embedding_serviceand constructs it with no arguments. Addembedding: EmbeddingPort | None. When it is None, use a real deterministic hash-projection implementation in the tools package (not a fake class, not a kernel import). It must implementcompute_embedding(text) -> list[float],cosine_similarity(a, b) -> float, andsearch(query, candidates, limit, min_similarity) -> list[tuple[str, float]].
New modules, contracts only:
packages/contracts/src/orchestrata_contracts/protocols/redis_factory.py—RedisFactoryProtocol. Redis types areTYPE_CHECKINGonly, withfrom __future__ import annotations. Contracts gains no runtime third-party dependency.packages/contracts/src/orchestrata_contracts/protocols/embedding_port.py—EmbeddingPortProtocol with the three methods above. Pure-Python types.
Then drop orchestrata-kernel from packages/tools/pyproject.toml and from the tools parity _ALLOWED_ROOTS lists that currently name orchestrata_kernel. A reintroduced kernel import must fail that allow-list.
If a protocol package __init__ re-exports protocols, add the two names there only if that file already re-exports sibling protocols. Do not create a new export style.
Rules
- Edit only the files in the fence. Create only the two protocol modules and, if required, one tools-local embedding default module under
packages/tools/src/orchestrata_tools/. - No commit, no
git add, no graph sync, no full test suite. - Write Python with the editor tools. No inline
python -cprograms.
Files
packages/contracts/src/orchestrata_contracts/protocols/redis_factory.py
packages/contracts/src/orchestrata_contracts/protocols/embedding_port.py
packages/contracts/src/orchestrata_contracts/protocols/__init__.py
packages/tools/src/orchestrata_tools/schedule_cron_tool.py
packages/tools/src/orchestrata_tools/search.py
packages/tools/src/orchestrata_tools/embedding_default.py
packages/tools/pyproject.toml
packages/tools/tests/parity/test_frozen_parity_t01.py
packages/tools/tests/parity/test_frozen_parity_t02.py
Checks
rc=1 :: grep -R -n orchestrata_kernel packages/tools/src
rc=0 :: grep -q orchestrata-contracts packages/tools/pyproject.toml
rc=1 :: grep -q orchestrata-kernel packages/tools/pyproject.toml
rc=0 :: test -f packages/contracts/src/orchestrata_contracts/protocols/redis_factory.py
rc=0 :: test -f packages/contracts/src/orchestrata_contracts/protocols/embedding_port.py
Done
Reply with the two protocol paths, the tools default embedding path if you created one, and confirmation that grep -R orchestrata_kernel packages/tools/src exits 1.