- Status: proposed
- Date: 2026-02-16
Recurgent needs better long-context handling, but the project is still in a nascent phase.
A broad recursion surface (ContextView, recurse(...)) was captured in ADR 0018 as a forward-looking direction. However, introducing new coordination primitives now creates risk:
- additional policy surface before we have trace evidence,
- more decision volatility (
dovsdelegatevsrecurse) without empirical grounding, - premature runtime abstraction that may not match how Tool Builders naturally decompose tasks.
The immediate need is simpler: give Tool Builders direct, structured access to prior interaction history and observe what decomposition behaviors emerge.
Adopt a data-first step before new recursion APIs.
Expose context[:conversation_history] as a structured Ruby array of records available directly to generated code.
V1 record shape should be explicit and stable enough for programmatic use:
call_idtimestampspeaker(user|agent|tool)method_nameargskwargsoutcome_summary
The shape remains tolerant to additive fields.
Prompting must explicitly tell Tool Builders:
- conversation history is available at
context[:conversation_history], - it is structured data intended for direct read/query/filter operations,
- direct code access should be preferred over speculative helper abstractions.
Do not introduce ContextView or recurse(...) yet.
delegate(...) and Agent.for(...) semantics remain unchanged.
Add observability signals to evaluate whether recursion primitives are justified later.
At minimum, capture:
- whether generated code accessed
context[:conversation_history], - history query patterns used (filter/map/slice style summaries),
- repeated boilerplate patterns indicating missing runtime affordances,
- repeated same-role decomposition attempts that currently route through delegation.
In scope:
- conversation-history schema and runtime population,
- prompt guidance for direct history access,
- observability fields for evidence gathering.
Out of scope:
ContextViewclass,recurse(...)primitive,- model tiering,
- Recursim integration work.
- Minimal surface-area change with immediate utility.
- Preserves emergence-first philosophy by observing agent behavior before introducing abstractions.
- Reduces premature architectural commitments.
- Some history-processing code may be duplicated in generated programs.
- Deep-context ergonomics may remain rough until evidence-driven abstractions are introduced.
- Implement ADR 0018 immediately.
- rejected for now: broad primitive set before evidence from real traces.
- Keep history unstructured and rely on model memory.
- rejected: weak for deterministic introspection and code-level manipulation.
- define canonical
context[:conversation_history]record shape, - populate records on each call lifecycle.
- add explicit prompt guidance about history access,
- verify generated code can read and use structured history.
- emit observability fields for history-access patterns,
- gather traces to decide if
ContextView/recurse(...)is warranted.
- History exposure must preserve existing capability boundaries.
- History records should avoid storing non-serializable payloads.
- Additive schema changes must remain backward-tolerant.
Relationship to ADR 0018
ADR 0018 remains a forward-looking proposal.
This ADR sequences the work: first observe behavior with structured history access, then decide whether recursive primitives are justified.
- Which history fields are mandatory in v1 versus optional diagnostic enrichments?
- Should history retention be bounded by count, time window, or token-estimated footprint?
- What objective threshold (pattern frequency) should trigger revisiting ADR 0018 for implementation?