Skip to content

subagent

sherry-wiki edited this page Nov 24, 2026 · 17 revisions

🧩 Subagent Design: Two-Axis Roles, Privilege Guards & Layered Completion Gates

Sherry Wiki · English · 中文 · 日本語 · 한국어

← Back to index

The design-level companion to the Subagent System README. That document is the runtime and API reference — spawn pipeline phases, registry state machines, announce delivery, tool schemas, and the full configuration table. This page states the design invariants behind the role model, the spawn-privilege guards, and the four-layer completion gate stack, and names the failure modes each layer accepts.

Source of truth: agent/tools/subagent/** (types/, capabilities/, roles/, spawn/), agent/tools/taskflow/step_judge.py and agent/tools/taskflow/tools/, agent/middlewares/subagent_completion_drain/, config/features/agent_side/. Every statement below was verified against that code.

Table of Contents

🎯 Overview

A spawned worker is described by two orthogonal answers to two different questions:

  1. Who may spawn, and over what? — the depth role (SubagentSessionRole), derived from nesting depth. It alone decides spawn permission and control scope.
  2. What kind of worker is this? — the functional role (FunctionalRole), an explicit specialization. It alone decides the child LLM tier, the tool allow-list, and role-specific prompt sections.

Completion is then verified by four always-on layers, ordered from the single child run outward to the parent turn: the child-run completion judge and goal loop, the TaskFlow step judge, the taskflow_flow(action="finish") flow gates, and the parent-turn completion-drain programmatic gate. The two axes and the gate stack are the subject of this page; the API surface lives in the module README.

🧱 Invariants

  1. The axes never merge. A functional role cannot grant spawn permission, and the depth role cannot change the tool allow-list or the prompt. Both compose on every spawn.
  2. general is the identity role. With no functional-role hint, spawn behavior is unchanged: no definition is loaded, and the depth role supplies the LLM tier.
  3. Spawn privilege is depth-gated twice — at assembly time (tool-policy intersection) and at call time (a permission check inside the tool itself).
  4. Role spawning is allow-listed per hop, never chain-walked. A specialized parent may spawn its own role plus the read-only extras its SPAWN_ALLOWED_CHILD_ROLES entry lists; the invariant is single-hop (no permitted non-parent child may be write-capable), which is what makes multi-hop safe without ancestor traversal.
  5. Completion gates are on by default. COMPLETION_JUDGE["enabled"] and GOAL_GATE["enabled"] are master switches; when on, only budgets and criteria are inputs.
  6. Fail-open means model error, unparseable output, or an unavailable lookup — never a negative verdict. A parsed RETRY, BLOCK, or failing evidence row still blocks.
  7. Child context is isolated. A child starts from its own empty message list; the parent transcript is never inherited, and there is no mode that changes this.
  8. Completion carriers are claims, not verified results. The parent turn receives the child's report as a claim; when the session has no passing evidence, the drain gate appends a mandatory-verification message.

🧭 Two Role Axes

Axis Resolved from Drives
Depth role (SubagentSessionRole) nesting depth spawn permission, control scope
Functional role (FunctionalRole) explicit hint → agent_id match → configured default child LLM, tool allow-list, prompt sections

Depth role. resolve_subagent_capabilities(depth, max_depth) maps depth 0 to MAIN with ControlScope.CHILDREN, any depth >= max_depth to LEAF with ControlScope.NONE, and everything in between to ORCHESTRATOR with CHILDREN. The single predicate behind permission decisions is can_spawn_children(role), true for MAIN and ORCHESTRATOR only. Depth itself resolves from the run record first, then from the :subagent: count in the session key (get_subagent_depth). max_spawn_depth defaults to 2 and is hard-capped at 2.

Functional role. _resolve_functional_role(hint, agent_id) tries the explicit hint (an unknown hint logs a warning and falls through), then the agent_id name, then the configured default_functional_role, and finally GENERAL. GENERAL short-circuits before any definition is loaded, which is what keeps the depth-based behavior intact for hint-less spawns.

The two axes are orthogonal in both directions: a researcher at depth 1 is still an ORCHESTRATOR that may spawn; a general at the depth limit is still a LEAF that may not.

🧰 Functional Roles: Definition, Loading, Behavior

📄 Definition Files

Built-in definitions ship inside the package, tracked and distributable, at agent/tools/subagent/roles/definitions/<name>/AGENTS.md. An optional per-user override may sit (untracked) at workspace/subagent_roles/<name>/AGENTS.md; resolution order is override → package default → none, and the override directory name is configurable. Each file carries YAML frontmatter (name, description, model_tier, tools) plus a markdown body that is appended to the child prompt. tools: inherit resolves to “all tools”; an unknown model_tier falls back to inherit.

Role Purpose Effective LLM tier Role tool set
general Default worker; identity role (its package definition is never loaded) depth role all tools + ast-grep ast_grep_search, ast_grep_rewrite
researcher Read-only codebase and web research auxiliary read_file, search_files, terminal, web_search, web_fetch, message_search, skill_view, skill_list + code-intel explore, callers, callees, impact, path, semantic_code_search + LSP lsp_goto_definition, lsp_find_references, lsp_workspace_symbol, lsp_call_hierarchy, lsp_rename, lsp_diagnostics, lsp_format, lsp_status + ast-grep ast_grep_search, ast_grep_rewrite + coordination (opt-in) share_finding, peers_findings
executor Write-capable implementation and command execution; the one role that may also spawn read-only researcher / librarian children auxiliary read_file, write_file, patch_file, terminal, python_repl, execute_code + ast-grep ast_grep_search, ast_grep_rewrite + coordination (opt-in) claim_scope, share_finding, peers_findings
reviewer Read-only diff and quality audit auxiliary read_file, terminal + ast-grep ast_grep_search, ast_grep_rewrite + coordination (opt-in) share_finding, peers_findings
librarian Read-only external codebase retrieval: clone, index, and search third-party repos auxiliary read_file, search_files, terminal, web_search, web_fetch, message_search, skill_view, skill_list + code-intel explore, callers, callees, impact, path, semantic_code_search + LSP lsp_goto_definition, lsp_find_references, lsp_workspace_symbol, lsp_call_hierarchy, lsp_rename, lsp_diagnostics, lsp_format, lsp_status + ast-grep ast_grep_search, ast_grep_rewrite + coordination (opt-in) share_finding, peers_findings

ast-grep is universal; code-intel is not. Every functional role (including general) additionally receives the ast-grep structural search/rewrite tools ast_grep_search and ast_grep_rewrite. The tree-sitter code-intel tools explore / callers / callees / impact / semantic_code_search go to the two code-intel roles, researcher and librarian, because they need the symbol index; semantic_code_search is the embedding-backed concept search over that index. The LSP tools lsp_goto_definition / lsp_find_references / lsp_workspace_symbol / lsp_call_hierarchy / lsp_rename / lsp_diagnostics / lsp_format / lsp_status reach the same two roles for the same reason: they need a running language server, which the child starts lazily and stops when idle. lsp_rename and lsp_format preview by default, lsp_diagnostics waits for the asynchronous diagnostics notification, and lsp_status reports availability without starting anything. The execute_code tool (Programmatic Tool Calling) is executor-only: the executor role receives it, and no other functional role does.

🛡️ Fail-Open Loader

load_role_definition(role) walks the candidate paths, parses the first existing file, and returns None on every failure: no file at all, missing or unterminated frontmatter, non-mapping frontmatter, an invalid tools value, or an unreadable file. Each parse failure logs a warning; the caller treats None as general. The loader is fail-open on model, file, and parse problems only — it can never turn a malformed definition into a privileged one. load_all_role_definitions() caches results in-process; call invalidate_role_cache() after editing a workspace override.

⚙️ What a Role Drives

LLM selection. A per-role model profile wins (it also carries the child's own max_output_tokens, default 8192); otherwise an explicit model_override applies; otherwise a non-general role's model_tier applies; otherwise the depth role decides (ORCHESTRATOR → main LLM, LEAF → auxiliary LLM).

per-role model profile (own max_output_tokens, default 8192)
  └─► explicit model_override
        └─► functional-role model_tier ("main" | "auxiliary")
              └─► depth role (ORCHESTRATOR → main LLM, LEAF → auxiliary LLM)

System prompt. A non-general role (or any non-empty role description/body) adds the {ROLE} specialization line to ## Your Role and appends a ## Role Instructions section carrying the definition body.

Tool policy. A role's tools list becomes an allow-list, and the default deny-list is cleared because the allow-list already restricts. Per-spawn extra_tools join that allow-list; both remain subject to the unconditional main_only metadata drop and to any explicit deny-list.

Skill visibility. A specialized role's tools are stamped with metadata["caller_role"] next to caller_scope; the identity GENERAL role stays unstamped, so the default delegation path keeps the pre-role full view. skill_list and skill_view hide a skill whose frontmatter roles: [...] omits the role; a skill without roles is visible to every role, and the main agent skips the check entirely. skill_view reads the target SKILL.md directly, so the same roles gate is applied there; the delegate load_skills validation uses the identical filter. Builtin tags: multimodal_rag / llm_wiki are hidden from the executor (visible to every other role), bugfix-contract is executor + reviewer only, and the multimedia chain + code_wiki stay all-visible.

🔒 Spawn Privilege Guards

Depth-based spawn privilege is enforced at two independent points, so no single leak can escalate it (functional-role containment is a third, orthogonal gate — see the note below):

  • Assembly time (primary gate). After the final allow-list is built from the role whitelist and extra_tools, Phase 8.6 intersects it with can_spawn_children(role): for any role that may not spawn, sessions_spawn and sessions_yield are stripped from the list. In inherit mode the list is empty and the default deny-list already blocks the pair, so the intersection is a no-op there.
  • Call time (defense in depth). check_spawn_permission(session_id) resolves the canonical caller key (child and swarm keys verbatim; any other id gets the agent:main:session: prefix), resolves depth from the run record first and the session-key shape second, then resolves the depth role and refuses non-spawning callers. It returns a (allowed, reason) tuple and never raises; the tool renders the refusal through its existing string contract.
assembly:  final allow-list ∩ can_spawn_children(role)   → sessions_spawn / sessions_yield stripped
call:      check_spawn_permission(session_id)            → "status=forbidden", never raises

The call-time guard backs sessions_spawn (the escalation path) in both the tool and the runtime spawn wrapper. sessions_yield is protected by assembly-time stripping alone.

Functional-role containment (a third, orthogonal gate). Depth decides whether a worker may spawn; containment decides which role it may spawn. _check_role_containment (spawn/core.py) reads the requester's own run record — one hop, never the ancestor chain — and consults SPAWN_ALLOWED_CHILD_ROLES (types/functional_role.py): an absent entry means same-role only, which is what reviewer keeps, and MAIN (no run record) plus general (tools: inherit = every tool) short-circuit as unrestricted because every specialized allow-list is already a subset of theirs. Widened entries: executor may additionally spawn the READ-ONLY researcher / librarian so it can research before it writes, and the two research roles may spawn each other in addition to their own role. Multi-hop safety rests on a single-hop invariant, not on chain traversal: every permitted non-parent child must be read-only, so a write role can only reach write roles and a read-only role only read-only roles — no path returns to a write capability, and a future entry that would form a cycle (say researcher → executor) fails the invariant test instead of opening a hole.

🧩 Strategy Tables & Guarded Transitions

Two stateful decisions are explicit objects (2026-11-09 design audit):

  • Structured-output degradation is a StructuredOutputStrategy in agent/tools/subagent/model_caps.py (level, label, sends_json_mode, thinking_off, local_validation_fatal). The spawn path resolves the persisted integer once with strategy_for() and reads flags; the integer stays the on-disk compatibility format, but no call site compares level >= 1/2. The persisted entry also carries escalated_at and reprobe_count: get_level decays one rung after 24 h → 48 h → 7 d, confirm_level commits the decayed rung once a spawn succeeds at it, and a transient 429 / rate-limit / timeout / connection error never degrades a model. Menu → System Config → Model Config lists and clears the learned labels through GET|DELETE /sherry-config/model-caps.
  • Completion delivery transitions through one table (registry/delivery_state.py::_ALLOWED_TRANSITIONS). Every mark_delivery_* helper calls transition_delivery(), so DELIVERED and DISCARDED are terminal and an illegal edge raises InvalidDeliveryTransitionError; same-state transitions stay idempotent for crash recovery.

🧱 Spawn Request, Modules & Completion Events

The 2026-11-10 design audit reshaped the spawn pipeline without changing its behavior:

  • spawn/request.py::SpawnRequest is the frozen request object the orchestration receives. spawn_subagent_direct(request=None, **legacy) keeps the historical keyword-argument call shape through from_legacy.
  • spawn/core.py is a 732-line facade; the phases live in handoff.py, validation.py, isolation.py, child_agent_factory.py, lifecycle.py and ptc_prefill.py, and the facade re-exports every name older imports use.
  • Child completion is event-driven: terminal transitions publish through registry/completion_events.py (backed by runtime/event_wait.py), and taskflow_wait_all wakes on them. The old poll interval remains the fallback that covers a missed notification.

🧪 Completion Judge & Goal Loop

The completion judge (spawn/completion_judge.py) is the subagent-level gate. An auxiliary LLM at temperature 0 receives the task, the child's latest response (capped at 8000 characters on the legacy baseline; scaled with the serving model's output budget), the child session's verification-evidence summary, and the task's acceptance criteria, and returns DONE, CONTINUE, or DRIFTED with a one-sentence reason. CONTINUE carries a short continuation prompt; DRIFTED carries a drift_correction directive. Parsing degrades safely — JSON repair first, then a regex scan — and any model error or unusable output finalizes as DONE with an explicit fail-open reason.

Task anchoring. The child's system prompt (build_subagent_system_prompt_from_context) carries a ## Your Task section with the original task. Because a SystemMessage lives outside the compressed message list, the task survives compaction by construction — the child summarizer deliberately keeps need_update_system_prompt off (turning it on would rebuild the prompt through the main agent's builder and replace the child prompt). As a fallback, the initial task HumanMessage is tagged metadata.origin="user", so a compaction summary labels it [User] (up to 2000 chars) rather than [System notice] (500 chars). At spawn, normative clauses extracted from the task are dual-written to the child's state register under subagent_task_acceptance and are shown to the judge; the key is deleted when the child's session state is released.

The goal loop runs on every spawn whose budget exceeds one turn, under COMPLETION_JUDGE["goal_max_turns"] (default 5), which counts the first turn. A per-spawn goal_max_turns parameter overrides it. On CONTINUE the judge's prompt is injected as the next HumanMessage on the same checkpoint thread, so the continuation extends the same child conversation instead of starting a new one.

turn 1 ─► judge DONE ─────────────────────────────────────► finalize
      ├─► judge CONTINUE (continuation_prompt) ─► turn 2 ─► judge …
      └─► judge DRIFTED ─► inject drift_correction (task + acceptance) ─► turn 2 ─► judge …
               (repeat until DONE, empty continuation prompt, or turns_used == goal_max_turns)

DRIFTED means the recent work does not serve the original task (preparatory work such as reading files stays CONTINUE/DONE). A drift injects a corrective HumanMessage marked metadata={"internal": true, "provenance": "drift_correction"} that quotes the task and acceptance criteria (or uses the judge's own correction text); the drift counter accumulates across intervening CONTINUE verdicts. Three drifts report the run as BUDGET_EXHAUSTED with error="task_drift_3_times" — checked before the turn-budget guard so a final-turn drift is not mislabeled as plain exhaustion. When the budget is spent the run still finalizes as OK, with error="goal_loop_budget_exhausted" recorded — the loop never converts exhaustion into a failure. An empty continuation prompt also ends the loop. A budget of 1 keeps the child single-turn: the judge is not called at all.

🤝 Child Handoff (Phase 1)

Every child ends its answer with a ```json block carrying five EXPERIENCE fields about ITS OWN layer — task_understanding, `discovered_hard_constraints`, `locked_decisions` ({decision, reason}), `failed_branches` ({branch, failure_reason}) and `success_steps` ({step, tool, params, outcome} — the curated DIRECT path to completion). The block goes FIRST because both the stored-result cap and the delivery cap truncate from the tail. It is a PROMPT contract (no `response_format`), so thinking stays on.

At completion _extract_handoff_json parses the last block (fail-open → None) and stores the five fields on run.completion.handoff; metadata (depth/agent_label/outcome/children) is never accepted from the model — code injects it. The run record also carries the TaskFlow coordinates (step_id/flow_id) captured at spawn.

Skill review then reads the descendant runs' handoffs, filters them against the CURRENT plan snapshot (a cancelled todo or a superseded flow drops its runs; resolved_position re-maps step_id to the todo's CURRENT position, never step_id - 1), assembles the per-layer tree (orphans whose parent was filtered are promoted to roots), and flattens it depth-first into failed_branches / success_steps / hard_constraints / locked_decisions with a source label (depth-1:label > depth-2:label). The raw merged tree is written to handoff-tree.json BEFORE the extraction LLM runs (atomic, idempotent overwrite), so an interrupted synthesis never loses it; the LLM's plan-summary.json is a second, lossy layer on top. the raw tree is available on disk as handoff-tree.json; the model-facing knowledge tool and its system-prompt block are retired.

The child's summarizer carries the handoff through compression: SummaryDoc gained failed_branches (capped by failed_branches_max_items) and success_steps (capped by success_steps_max_items; tentative entries are replaced with the final curated direct path once the approach settles), its constraints rule asks for HARD constraints first, and every subagent summary uses a depth-scaled budget — summary_total_max_tokens_base (5000) plus summary_total_max_tokens_depth_step (1000) per level above the deepest — while the main agent keeps its flat 4000.

🚦 Layered Completion Gates

Four gates stack from the child run outward. All four are on by default; COMPLETION_JUDGE["enabled"] and GOAL_GATE["enabled"] can disable the judge and goal gate respectively, while budgets and criteria remain the normal inputs.

# Layer Gate Input it needs Fail-open behavior
1 Child run completion judge + goal loop (spawn/completion_judge.py) task, latest response, evidence summary; budget goal_max_turns (default 5) model error / unparseable → done
2 Step TaskFlow step judge (agent/tools/taskflow/step_judge.py) the step's judge_criteria (legacy validation_criteria; absent → no judge call) model error / unparseable → pass
3 Flow taskflow_flow(action="finish") gates A–C (agent/tools/taskflow/tools/taskflow_finish.py) DAG state and flow evidence unreadable ledger → pass
4 Parent turn completion-drain programmatic gate (agent/middlewares/subagent_completion_drain/) the session's verification-evidence summary lookup failure → gate skipped

Layer 2 — step judge. After taskflow_step(action="resume") injects a child result, a step that carries judge_criteria (or legacy validation_criteria) is judged PASS / RETRY / BLOCK. A RETRY re-dispatches the step with the judge's feedback while the step's retry count is below STEP_JUDGE["max_retries"] (default 2); exhausting the budget blocks the step. Criteria are the judge's input, not a switch — a step without them is never sent to the judge.

Layer 3 — flow gates. taskflow_flow(action="finish") refuses the DONE transition until Gate A sees every step done or blocked, Gate B sees no blocked steps, and Gate C sees no FAIL or [stale] flow evidence (plus the opt-in Gate E goal judge for a described flow of GOAL_GATE["min_steps"] steps or more).

Layer 4 — parent-turn gate. When the drain injects queued completion carriers, it also checks the parent session's evidence. The carriers are injected verbatim; if the session has no passing evidence, a mandatory-verification message is appended after them. The check is unconditional — no configuration disables it — and it is fail-open only when the evidence lookup itself is unavailable. It reads the same invalidation marks the flow gates do: a [stale] or [broken] row is not a pass, so a child whose work a later write invalidated cannot drain as if it were verified.

Restart semantics. No task survives a restart, so a RUNNING run restored from disk is terminalized as a TIMEOUT with pause_reason=process_restart (leaving it RUNNING made every liveness reader believe the child was alive), and every persisted monotonic timestamp is rebased onto the restore point — a value from the previous process can read as hours old or as a future time, which silently disabled each expiry check. Its delivery stays PENDING and the sweeper's undelivered scan announces it, so the owning step learns instead of staying DISPATCHED. Killing a run that is INTERRUPTED releases its per-session guard state here too: there is no live child agent whose finally would do it.

A parsed negative verdict always blocks: fail-open covers model errors, unparseable output, and unavailable lookups, never a real RETRY, BLOCK, or failing evidence row. The gate-internals (breaker thresholds, announce retries, the evidence ledger) are detailed in the Loop Prevention README and the Long-Running Tasks README.

🔗 Relationships to Other Subsystems

Subsystem What crosses this boundary Details
TaskFlow engine step dispatch, judge_criteria, aggregate_deps, finish gates A–C (+ Gate E) Long-Running Tasks
Loop prevention completion gates, judge budgets, drain and announce retry behavior Loop Prevention
Context engine only the completion carrier is persisted to MesMemory; child transcripts stay checkpoint-only Context Engine README
Runtime lanes the SUBAGENT lane bounds concurrent child runs; over-limit spawns queue as PENDING Loop Prevention
Memory store a non-empty drain reloads the shared SQLite memory store (load_from_store(), fail-open); there is no save-back Subagent System README

🧵 Synthesis Aggregation

taskflow_step(action="run_task", aggregate_deps=True) marks a synthesis step so its dispatched task text carries its dependencies' recorded results. The flag is stored on the step, and build_task_with_dep_results(step, steps, results) appends a ## Upstream Results block with one ### {step_id} section per dependency in depends_on order, matching each dependency's child_session_key against the flow's {child_session_key, result, result_hash} record; a dependency with no recorded result contributes a no result recorded placeholder. Because the aggregation is re-derived on every dispatch or retry from stable records, the stored step task is never rewritten; without the flag the task text is unchanged. The full behavior is documented in the Long-Running Tasks README.

⚙️ Configuration

Knob Location Default Effect
goal_max_turns config/features/agent_side/completion_judge.py 5 goal-loop turn budget, including the first turn
per-spawn goal_max_turns sessions_spawn parameter None → configured value overrides the budget for one spawn
per-spawn run_timeout_seconds sessions_spawn parameter / SubagentConfig.run_timeout_seconds 600 s wall-clock ceiling for the run AND its subtree: frozen on the run, descendants capped by the parent's remaining budget (1 s fail-fast floor); a non-OK parent cascade-kills its live descendants
max_retries config/features/agent_side/step_judge.py 2 RETRY verdicts before the step is blocked
default_functional_role SubagentConfig "general" fallback when neither a hint nor an agent_id match resolves
roles_override_dir_name SubagentConfig "subagent_roles" workspace directory holding optional role overrides
max_spawn_depth SubagentConfig 2 depth at which the role flips to LEAF (hard cap 2)
verify_commands config/features/agent_side/evidence_ledger.py test / lint / build / typecheck / format families commands auto-recorded as verification evidence
result_text_caps agent/tools/subagent/output_caps.py legacy values scales the stored/delivery/summary/judge/transcript caps by W/8000 for a configured serving-model output budget W; unset keeps the legacy values
role_profile_max_output AGENT_CONFIG.subagent_models[role].max_output_tokens 8192 the role profile's own output cap (decimal string, min 8K); drives both the child request and its result-text caps, independent of the MAIN env budget
executor_max_iterations config/features/agent_side/iteration_budget.py 90 per-turn model-call budget for the executor child (tool results are free); other subagent roles keep worker_max_iterations=60

🗺️ Test Map

Area Tests
Role enum and loader tests/agent/tools/subagent/types/test_functional_role.py, tests/agent/tools/subagent/roles/test_loader.py
Role-driven spawn behavior tests/agent/tools/subagent/spawn/test_functional_role_integration.py, tests/agent/tools/subagent/spawn/test_system_prompt_role.py
Spawn privilege guard tests/agent/tools/subagent/test_spawn_privilege_guard.py
Functional-role containment tests/agent/tools/subagent/test_spawn_role_containment.py
Completion judge and drain tests/agent/tools/subagent/test_completion_judge.py, tests/agent/tools/subagent/test_completion_drain.py
Parent-turn gate tests/agent/middlewares/test_completion_drain_gate.py
Step judge tests/agent/tools/taskflow/test_step_judge.py, tests/agent/tools/taskflow/test_resume_with_judge.py
Finish gates tests/agent/tools/taskflow/test_finish_gate.py
Synthesis aggregation tests/agent/tools/taskflow/test_synthesize.py, tests/agent/tools/taskflow/test_synthesize_e2e.py

⚠️ Limitations

  • Every judge is fail-open by design: an unreachable or unparseable judge finalizes done / pass. Availability wins over strictness — a wedged judge must never trap a run.
  • goal_max_turns of 1 makes the child single-turn; the completion judge is not called for that spawn.
  • The call-time privilege guard backs sessions_spawn; sessions_yield relies on assembly-time stripping alone.
  • The old Gate D (SisyphusVerifier via caller-supplied todo + plan_path) was removed by the over-engineering audit: no prompt required the linkage and nothing passed it. The Sisyphus contract lives on as orchestrator doctrine in skills/builtin/core/ulw-execute/SKILL.md.
  • The parent-turn gate reasons over a text evidence summary and its FAIL / [stale] markers, not over a structured ledger.
  • aggregate_deps concatenates raw dependency results — it does not summarize, so very large results grow the dispatched task text.
  • Child context isolation is fixed by design: there is no mode that inherits the parent transcript.
  • Child checkpoints are kept latest-only after a run: the child's own checkpoint thread retains the newest top-level checkpoint and its writes; tools:* / model:* namespaces are pruned. Deleting a main session cascades to every descendant run; the boot sweep deletes orphan subtrees whose root session is gone.

Clone this wiki locally