REQ-DELEG-001: Delegation admission guards reject before a child loop runs

← Requirements

What it requires

  1. Given delegation_depth at MAX_DELEGATION_DEPTH, When a delegation is dispatched, Then it is rejected and no child runs.
  2. Given a target present in delegation_ancestor_tiers, When is_delegation_cycle is evaluated, Then it returns true.
  3. Given N consecutive failures against the same target with max_consecutive_failed_delegations = N, When the lead re-delegates, Then it is blocked with a "[DELEGATION REJECTED] ... stop retrying" message; and a different target or a success resets the counter.
tier
NOT_RUN

Where it lives

  • src/core9

See it on the map

How it is met

implemented byresults (95 tests)execute_pending_pipelineis_delegation_cycleis_delegation_repeat_blockedpush_delegation_cycle_rejectedpush_delegation_isolation_unsafepush_delegation_rejectedpush_delegation_repeat_blockedreject_delegation_if_guardedreject_pipeline_if_guarded95 absent95 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (95)

Reached through calls

95 tests: 95 absent

testresultlinked byimplementers exercisedcalls away
is_delegation_cycle flags ancestor reuseabsentinferred1 of 9: is_delegation_cycle1
is_delegation_repeat_blocked enforces consecutive capabsentinferred1 of 9: is_delegation_repeat_blocked1
max_consecutive_failed_delegations is configurableabsentinferred1 of 9: is_delegation_repeat_blocked1
Basic response contains no special tokensabsentinferred9 of 96
Batch generation worksabsentinferred9 of 96
Budget-exhausted forced complete sets terminal_reason metadataabsentinferred9 of 96
Circuit breaker limits tool calls per turnabsentinferred9 of 96
Compaction fires when context exceeds thresholdabsentinferred9 of 96
Compaction triggers at thresholdabsentinferred9 of 96
Context accumulates across turnsabsentinferred9 of 96
Context anchors persist across runsabsentinferred9 of 96
Delegation directive triggers child loopabsentinferred9 of 96
Delegation wiring fires on_delegation_start callbackabsentinferred9 of 96
Dynamic identity creation and generation through engine loopabsentinferred9 of 96
Empty response handled gracefullyabsentinferred9 of 96
Engine state transitions include PLANNING and EXECUTINGabsentinferred9 of 96
Finish reason length continues loopabsentinferred9 of 96
Generate is called exactly once per iterationabsentinferred9 of 96
Hooks fire in correct order during a generation cycleabsentinferred9 of 96
Interrupt stops loopabsentinferred9 of 96
MCP authorization denial propagates through engineabsentinferred9 of 96
Max iterations stops loopabsentinferred9 of 96
Metrics accurate after runabsentinferred9 of 96
Multi-turn engine calls retain contextabsentinferred9 of 96
Root conversation created at run() init when storage wired (gh#48)absentinferred9 of 96
Route callback is invoked for tier selectionabsentinferred9 of 96
Routing fires on_tier_selected callbackabsentinferred9 of 96
Single iteration completesabsentinferred9 of 96
Single-turn engine loop produces coherent responseabsentinferred9 of 96
State transitions IDLE->PLANNING->EXECUTING->COMPLETEabsentinferred9 of 96
Streaming generation worksabsentinferred9 of 96
Streaming interrupt propagates to backend cancel chain absentinferred9 of 96
Tier routing fires callbackabsentinferred9 of 96
Tool call cycle: generate, parse, execute, generateabsentinferred9 of 96
Tool call cycle: generate, parse, execute, regenerateabsentinferred9 of 96
True end-to-end: real prompts, real engine, real modelabsentinferred9 of 96
a context-overflow refusal fails the turn instead of retrying itabsentinferred9 of 96
auto_chain child sets COMPLETE at depth > 0absentinferred9 of 96
auto_chain does not fire without configabsentinferred9 of 96
auto_chain root fires tier change at depth 0absentinferred9 of 96
budget_exhausted child is relayed partial to lead (E2)absentinferred9 of 96
delegation guards reject depth/cycle/repeat/pipeline-depthabsentinferred9 of 96
delegation snapshot + per-tier metrics accumulationabsentinferred9 of 96
gh#105: constitutional validator's toolless render must NOT clobber absentinferred9 of 96
gh#111: a delegation whose child produces raw UTF-8 content does not absentinferred9 of 96
gh#111: a tool call whose arg carries raw UTF-8 is preserved, not absentinferred9 of 96
gh#111: raw UTF-8 in backend-cleaned content is sanitized before it absentinferred9 of 96
gh#119: delegation auto-complete folds child summary into lead's absentinferred9 of 96
gh#121: zero-tool-call correction names tier's actual toolsabsentinferred9 of 96
gh#123 part 1: zero-tool-call counter resets after genuine tool call progressabsentinferred9 of 96
gh#123 part 2: zero-tool-call ceiling is per-tier configurableabsentinferred9 of 96
gh#123 part 3: prose-only nudge turn does NOT set failure_reason in metadataabsentinferred9 of 96
gh#123 part 4: ChildContextInfo.max_consecutive_empty_turns_override wired through engineabsentinferred9 of 96
gh#158: two concurrent runs accumulate metrics safelyabsentinferred9 of 96
gh#160: an isolated delegation never writes the project, and absentinferred9 of 96
gh#162: a delegate seeded with context answers from the named absentinferred9 of 96
gh#162: resume by target picks that tier's latest delegationabsentinferred9 of 96
gh#169: a capped loop carries its last real content, annotatedabsentinferred9 of 96
gh#169: a capped loop that produced nothing stays distinguishableabsentinferred9 of 96
gh#169: the parent relay receives the capped child's real workabsentinferred9 of 96
gh#181: a hard cut with nothing substantive stays distinguishableabsentinferred9 of 96
gh#181: a thinking-budget hard cut carries the run's real contentabsentinferred9 of 96
gh#181: the parent relay receives the hard-cut child's real workabsentinferred9 of 96
gh#183: a fresh top-level run still clears a stale interruptabsentinferred9 of 96
gh#183: a tier's identity overrides reach a top-level runabsentinferred9 of 96
gh#209/#212: a turn that ends in ERROR records why, for the callerabsentinferred9 of 96
gh#77: entropic.complete is terminal when emitted with sibling pipelineabsentinferred9 of 96
gh#80: a tool call resets the budget windowabsentinferred9 of 96
gh#80: budget off (default) does not gate a tool-call-free spiralabsentinferred9 of 96
gh#80: tokens budget nudges then hard-cuts a tool-call-free spiralabsentinferred9 of 96
gh#81: interrupt during tool processing halts before pending dispatchabsentinferred9 of 96
gh#81: run_loop(inherit_interrupt=false) clears a stale interruptabsentinferred9 of 96
gh#81: run_loop(inherit_interrupt=true) preserves a pre-set interruptabsentinferred9 of 96
gh#84 combined: should_stop halts the loop when the duplicate absentinferred9 of 96
gh#84: a successful tool call DOES reset the budgetabsentinferred9 of 96
gh#84: rejected-duplicate tool calls do NOT reset the budgetabsentinferred9 of 96
gh#88 combined: process_tool_results defangs a meta {action} absentinferred9 of 96
gh#88: a gemma multi-turn session never accumulates a parrotable absentinferred9 of 96
hook dispatch: info / PRE_GENERATE cancel / POST_GENERATE rewrite / ON_ERRORabsentinferred9 of 96
last_loop_metrics populated after runabsentinferred9 of 96
max_iterations override caps loop before global limitabsentinferred9 of 96
misc accessors: pause / context_usage / idle / project_dirabsentinferred9 of 96
queue capacity / cap mutation / clear / observer / state slotabsentinferred9 of 96
resume_delegation failure paths surface typed errorsabsentinferred9 of 96
set_storage wiring covers init_session_conversation pathsabsentinferred9 of 96
should_auto_chain false when no locked tierabsentinferred9 of 96
v2.14.6: a lead that answers in prose is nudged, and its forced absentinferred9 of 96
v2.14.6: after a nudge, a tier that owes a tool call is forced to make oneabsentinferred9 of 96
v2.14.6: an empty turn is retried, never accepted as completeabsentinferred9 of 96
v2.14.6: the model's own tool call stays in the history it is shownabsentinferred9 of 96
v2.14.6: with thinking on, each loop turn ends in a real tool callabsentinferred9 of 96
validation_provider variants are all non-fatalabsentinferred9 of 96
zero-tool-call with explicit_completion halts within retry capabsentinferred9 of 96
gh#182: a model-supplied max_turns bounds the delegated childabsentinferred9 of 97
v2.14.6: after a prose answer is nudged, the forced retry may only absentinferred9 of 97