- Status: accepted
- Date: 2026-02-14
The dependency environment contract from ADR 0010 requires deterministic and policy-safe environment reuse. Two implementation gaps emerged:
- Environment identity and cache-hit checks did not include source policy (
source_mode,gem_sources), allowing cache reuse across different policy configurations. - Execution routing used per-call dependency declarations instead of the tool's resolved effective manifest, so a call could run inline even after the tool had already adopted a non-empty environment manifest.
In addition, the dynamic-call orchestration path in lib/recurgent.rb had grown large enough to reduce clarity for future maintenance.
EnvironmentManager#env_id_forincludes normalized source policy:source_mode- normalized/sorted
gem_sources
- Environment cache-hit validation requires policy metadata match in
.ready.json:source_mode- normalized/sorted
gem_sources - existing manifest + lock checksum checks remain required.
- Dynamic execution routing follows the effective manifest after monotonic manifest resolution:
- if effective manifest is non-empty, execution remains worker-backed even when current call omits dependencies.
- Dynamic-call orchestration is extracted into
Agent::CallExecutionto keep the coreAgentfile focused on public surface and shared internals.
- Source-policy changes now force a distinct environment identity and prevent accidental cross-policy cache reuse.
- Tool execution behavior is deterministic across calls and aligned with the persisted manifest contract.
- Core runtime code is easier to reason about and maintain without changing public API behavior.