- Status: proposed
- Date: 2026-02-16
Recurgent's current strengths are:
- durable Tool identity and artifact evolution,
- validation-first lifecycle and repair loops,
- contract-governed delegation boundaries.
A remaining gap is long-context exploration inside a single capability shape.
Today, when a task requires inspecting large context, decomposition is possible but ergonomically blunt:
delegate(...)creates/uses another Tool boundary,Agent.for(...)creates an explicit new role instance,- neither provides a first-class way to recurse over context slices while preserving one cognitive identity.
Recursive Language Models (RLMs) show value in recursive decomposition over context. Recurgent should borrow the mechanism while preserving its own differentiator: contracted Tool evolution with typed outcomes.
Introduce a V1 recursive context exploration surface with two primitives:
ContextViewrecurse(...)
Add a runtime-managed ContextView abstraction for bounded context access.
ContextView supports deterministic, composable operations such as:
peekslicegreppartitionsummarize
ContextView is a read-focused exploration surface. Parent context mutation remains explicit at normal runtime boundaries.
Add a runtime primitive conceptually shaped as:
recurse(query:, context_ref:, depth: nil, metadata: {})Semantics:
recurse(...)spawns a depth+1 subcall under the same role/capability intent.- The subcall receives a bounded context reference (
context_ref) fromContextView. - The subcall returns typed
Outcome; parent decides how to merge/use result. - Subcall state is isolated by existing attempt isolation semantics.
recurse(...) is intentionally different from delegate(...) and Agent.for(...).
delegate(...)- purpose: cross-tool composition with explicit contract boundary,
- outcome: Tool creation/reuse and potential persistence evolution.
Agent.for(...)- purpose: explicit root/independent role instantiation.
recurse(...)- purpose: same-role recursive exploration of context,
- not a Tool creation primitive,
- not a separate role bootstrap primitive.
Recursive subcalls must preserve Recurgent invariants.
- No capability escalation through recursion.
- Recursion does not bypass delegated outcome validation.
- Recursion does not bypass guardrail policy.
- Recursion outputs remain typed outcomes and observable.
Recursive execution must be trajectory-native in logs.
Each recursive event captures at least:
recursion_idparent_call_iddepthcontext_refqueryoutcome_typeduration_ms
This makes recursive reasoning auditable and diagnosable.
In scope for this ADR:
ContextViewsurface,recurse(...)primitive,- runtime invariants and observability.
Explicitly out of scope for V1:
- model tiering by depth,
- Recursim integration and replay policy,
- automatic recursion budget tuning.
This ADR governs runtime API and lifecycle behavior for recursive context exploration.
It does not change:
- artifact selection policy from ADR 0012,
- validation-first guardrail recovery from ADR 0016,
- contract-driven utility semantics from ADR 0017.
- Improves long-context decomposition ergonomics without forcing new Tool boundaries.
- Enables recursive exploration while preserving Tool Builder/Tool/Worker language.
- Maintains contract and guardrail discipline under recursion.
- Produces better trajectory data for later optimization.
- Adds another coordination primitive that must be taught in prompt policy.
- Requires clear guidance to avoid overusing recursion where direct execution is sufficient.
- Increases observability payload volume.
- Use only
delegate(...)for recursion- rejected: conflates same-capability decomposition with cross-tool composition.
- Use only
Agent.for(...)for recursion- rejected: role bootstrap is too heavy for intra-capability recursive exploration.
- Delay recursion until model tiering is designed
- rejected: context exploration value is independent of tiering and can progress now.
- Introduce internal
ContextViewobject and context-ref representation. - Add
recurse(...)execution path with depth propagation. - Ensure typed outcome passthrough and isolation semantics.
- Add prompt policy describing when to recurse vs do/delegate.
- Add guardrails for malformed context refs and recursive misuse.
- Keep depth/cost tuning minimal and defer model tiering.
- Emit recursion trajectory fields in logs.
- Add diagnostics for recursion path quality.
- Recursion must not bypass outcome contract validation.
- Recursion must not bypass lifecycle guardrails.
- Recursion is bounded by existing runtime safety mechanisms; no unbounded loops.
- Parent call remains owner of final side-effect claims and result assembly.
- Should
ContextViewexpose only read operations in v1, or allow explicit staged writes? - What is the minimal canonical
context_refschema for stable replay/debuggability? - Which recursion misuse signals should be classified as recoverable vs terminal guardrails?