REQ-LOOP-003: Fixed per-iteration pipeline with pre-generate cancellation

← Requirements

What it requires

  1. Given a PRE_GENERATE hook returning non-zero, When the iteration runs, Then generation is skipped and state becomes COMPLETE.
  2. Given entropic.complete and entropic.pipeline in the same batch, When tool results are processed, Then the pipeline is dropped and the turn ends COMPLETE.
  3. Given interrupt() raised while tools execute, When dispatch is reached, Then state is INTERRUPTED and no delegation starts.
tier
NOT_RUN

Where it lives

  • src/core10

See it on the map

How it is met

implemented byresults (92 tests)dispatch_pending_or_haltdispatch_post_generateexecute_iterationexecute_pending_delegationfire_pre_hookgenerate_batchgenerate_responseparse_tool_callsprocess_generation_resultprocess_tool_results92 absent92 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (92)

Reached through calls

92 tests: 92 absent

testresultlinked byimplementers exercisedcalls away
Basic response contains no special tokensabsentinferred8 of 103
Batch generation worksabsentinferred8 of 103
Budget-exhausted forced complete sets terminal_reason metadataabsentinferred8 of 103
Circuit breaker limits tool calls per turnabsentinferred8 of 103
Compaction fires when context exceeds thresholdabsentinferred8 of 103
Compaction triggers at thresholdabsentinferred8 of 103
Context accumulates across turnsabsentinferred8 of 103
Context anchors persist across runsabsentinferred8 of 103
Delegation directive triggers child loopabsentinferred8 of 103
Delegation wiring fires on_delegation_start callbackabsentinferred8 of 103
Dynamic identity creation and generation through engine loopabsentinferred8 of 103
Empty response handled gracefullyabsentinferred8 of 103
Engine state transitions include PLANNING and EXECUTINGabsentinferred8 of 103
Finish reason length continues loopabsentinferred8 of 103
Generate is called exactly once per iterationabsentinferred8 of 103
Hooks fire in correct order during a generation cycleabsentinferred8 of 103
Interrupt stops loopabsentinferred8 of 103
MCP authorization denial propagates through engineabsentinferred8 of 103
Max iterations stops loopabsentinferred8 of 103
Metrics accurate after runabsentinferred8 of 103
Multi-turn engine calls retain contextabsentinferred8 of 103
Root conversation created at run() init when storage wired (gh#48)absentinferred8 of 103
Route callback is invoked for tier selectionabsentinferred8 of 103
Routing fires on_tier_selected callbackabsentinferred8 of 103
Single iteration completesabsentinferred8 of 103
Single-turn engine loop produces coherent responseabsentinferred8 of 103
State transitions IDLE->PLANNING->EXECUTING->COMPLETEabsentinferred8 of 103
Streaming generation worksabsentinferred8 of 103
Streaming interrupt propagates to backend cancel chain absentinferred8 of 103
Tier routing fires callbackabsentinferred8 of 103
Tool call cycle: generate, parse, execute, generateabsentinferred8 of 103
Tool call cycle: generate, parse, execute, regenerateabsentinferred8 of 103
True end-to-end: real prompts, real engine, real modelabsentinferred8 of 103
a context-overflow refusal fails the turn instead of retrying itabsentinferred8 of 103
auto_chain child sets COMPLETE at depth > 0absentinferred8 of 103
auto_chain does not fire without configabsentinferred8 of 103
auto_chain root fires tier change at depth 0absentinferred8 of 103
budget_exhausted child is relayed partial to lead (E2)absentinferred8 of 103
delegation guards reject depth/cycle/repeat/pipeline-depthabsentinferred8 of 103
delegation snapshot + per-tier metrics accumulationabsentinferred8 of 103
gh#105: constitutional validator's toolless render must NOT clobber absentinferred8 of 103
gh#111: a delegation whose child produces raw UTF-8 content does not absentinferred8 of 103
gh#111: a tool call whose arg carries raw UTF-8 is preserved, not absentinferred8 of 103
gh#111: raw UTF-8 in backend-cleaned content is sanitized before it absentinferred8 of 103
gh#119: delegation auto-complete folds child summary into lead's absentinferred8 of 103
gh#121: zero-tool-call correction names tier's actual toolsabsentinferred8 of 103
gh#123 part 1: zero-tool-call counter resets after genuine tool call progressabsentinferred8 of 103
gh#123 part 2: zero-tool-call ceiling is per-tier configurableabsentinferred8 of 103
gh#123 part 3: prose-only nudge turn does NOT set failure_reason in metadataabsentinferred8 of 103
gh#123 part 4: ChildContextInfo.max_consecutive_empty_turns_override wired through engineabsentinferred8 of 103
gh#158: two concurrent runs accumulate metrics safelyabsentinferred8 of 103
gh#160: an isolated delegation never writes the project, and absentinferred8 of 103
gh#162: a delegate seeded with context answers from the named absentinferred8 of 103
gh#162: resume by target picks that tier's latest delegationabsentinferred8 of 103
gh#169: a capped loop carries its last real content, annotatedabsentinferred8 of 103
gh#169: a capped loop that produced nothing stays distinguishableabsentinferred8 of 103
gh#169: the parent relay receives the capped child's real workabsentinferred8 of 103
gh#181: a hard cut with nothing substantive stays distinguishableabsentinferred8 of 103
gh#181: a thinking-budget hard cut carries the run's real contentabsentinferred8 of 103
gh#181: the parent relay receives the hard-cut child's real workabsentinferred8 of 103
gh#183: a fresh top-level run still clears a stale interruptabsentinferred8 of 103
gh#183: a tier's identity overrides reach a top-level runabsentinferred8 of 103
gh#209/#212: a turn that ends in ERROR records why, for the callerabsentinferred8 of 103
gh#77: entropic.complete is terminal when emitted with sibling pipelineabsentinferred8 of 103
gh#80: a tool call resets the budget windowabsentinferred8 of 103
gh#80: budget off (default) does not gate a tool-call-free spiralabsentinferred8 of 103
gh#80: tokens budget nudges then hard-cuts a tool-call-free spiralabsentinferred8 of 103
gh#81: interrupt during tool processing halts before pending dispatchabsentinferred8 of 103
gh#81: run_loop(inherit_interrupt=false) clears a stale interruptabsentinferred8 of 103
gh#81: run_loop(inherit_interrupt=true) preserves a pre-set interruptabsentinferred8 of 103
gh#84 combined: should_stop halts the loop when the duplicate absentinferred8 of 103
gh#84: a successful tool call DOES reset the budgetabsentinferred8 of 103
gh#84: rejected-duplicate tool calls do NOT reset the budgetabsentinferred8 of 103
gh#88 combined: process_tool_results defangs a meta {action} absentinferred8 of 103
gh#88: a gemma multi-turn session never accumulates a parrotable absentinferred8 of 103
hook dispatch: info / PRE_GENERATE cancel / POST_GENERATE rewrite / ON_ERRORabsentinferred8 of 103
last_loop_metrics populated after runabsentinferred8 of 103
max_iterations override caps loop before global limitabsentinferred8 of 103
misc accessors: pause / context_usage / idle / project_dirabsentinferred8 of 103
queue capacity / cap mutation / clear / observer / state slotabsentinferred8 of 103
resume_delegation failure paths surface typed errorsabsentinferred8 of 103
set_storage wiring covers init_session_conversation pathsabsentinferred8 of 103
should_auto_chain false when no locked tierabsentinferred8 of 103
v2.14.6: a lead that answers in prose is nudged, and its forced absentinferred8 of 103
v2.14.6: after a nudge, a tier that owes a tool call is forced to make oneabsentinferred8 of 103
v2.14.6: an empty turn is retried, never accepted as completeabsentinferred8 of 103
v2.14.6: the model's own tool call stays in the history it is shownabsentinferred8 of 103
v2.14.6: with thinking on, each loop turn ends in a real tool callabsentinferred8 of 103
validation_provider variants are all non-fatalabsentinferred8 of 103
zero-tool-call with explicit_completion halts within retry capabsentinferred8 of 103
gh#182: a model-supplied max_turns bounds the delegated childabsentinferred8 of 104
v2.14.6: after a prose answer is nudged, the forced retry may only absentinferred8 of 104