R3 → R19: Subagents → Task Swarm
Tier 1 Supersession Background task pool (R3) evolving into 100-parallel isolated agents with git worktree backends (R19).
Discriminated Input
TypedAgentInput vs ForkAgentInput — no impossible states. TypeBox stays flat for LLMs.
Discriminated Result
{ status: "completed" | "failed" | "running" } — each variant carries exactly the fields it needs.
Shared BackgroundRunner
R3 pool, R6 auto-trigger, R14 pipeline all share one abstraction: run/error/lifecycle/notify.
Tool Restriction
Read-only subagents (R6 verification) spawn without bash, edit, or write. Only read, grep, find, ls.
Cache Sharing
Fork mode shares parent’s cache prefix. Different model_role values share family cache line.
R16: Model Roles
Tier 4 Novel Configure default/smol/slow/plan/commit models. Auto-discovery from provider. ≥30% cost reduction on exploration sessions.
default
Primary Agent
Main model for implementation, editing, and conversation. Full capability baseline.
smol
Cheap Exploration
Read-only operations: grep, find, read, ls, context_pack. Auto-suggest when next action is read-only.
slow
Deep Reasoning
Architecture decisions, complex debugging. Higher cost justified by accuracy on hard problems.
plan
Planning
Structured plan generation. Optimized for multi-step reasoning and dependency analysis.
commit
Commit Messages
Conventional commit generation. Small model, fast turnaround, low cost per commit.
smol instead of default, cost reduction is 0.6 × (1 − smol_cost/default_cost) ≈ 30%. Achievable with good routing logic that auto-suggests smol for read-only operations.
R7: Model-Specific Variants
Tier 2 Planned Per-model-family prompt patches targeting actual failure modes. Variants in dynamic suffix to preserve single cache entry.
Discriminated Unions
5 of 8 proposed types replaced with discriminated unions: AgentToolInput, HookResponse, MemoryEntry, AgentToolResult, TtsrMatchResult.
TypeBox + Narrow
TypeBox schema stays flat (LLMs can’t reason about unions). Internal TS type narrows via resolver functions.
SubqConfig Split
Flat config bag split into namespaced sub-interfaces: hooks, modelRoles, memory, session, autonomous.
Event Name Mapping
PreToolUse→tool_call via satisfies Record for exhaustive compile-time checks.
A/B Testing
20 benchmark tasks per failure mode. Measure: comment density, claim accuracy, response length, verification rate.