Bound Unbounded Routing Loops in Research-Family Recipes#2209
Merged
Trecek merged 6 commits intoMay 8, 2026
Merged
Conversation
…s with success re-entry When a routing cycle has retries > 0 with on_exhausted outside the cycle, but the success path re-enters the cycle, the retry budget only bounds individual visits — not the outer loop. The outer loop remains unbounded and should block recipe loading. Also update the message to suggest check_loop_iteration guard steps as the fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add guard steps to bound 8 routing loops across research-design.yaml, research.yaml, and research-implement.yaml: - review_design loop: check_design_review_loop (3 iters) in research-design, research - implement_phase loop: check_implement_fix_loop (3 iters) in research, research-implement - run_experiment loop: check_run_fix_loop (3 iters) in research, research-implement Route revise_design → check_design_review_loop (instead of plan_experiment). Route adjust_experiment → check_run_fix_loop (instead of run_experiment). Route route_implement_failure → check_implement_fix_loop (instead of plan_phase). Guard steps use run_python with check_loop_iteration callable and provide on_failure routing to escape steps outside the cycle. Update all misleading "bounded by retries: 2" descriptions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion - Update research-design step count (9→10) and step names to include check_design_review_loop - Update revise_design routing expectation to check_design_review_loop - Update research-implement step count (20→22) for two new guard steps - Update adjust_experiment routing to check_run_fix_loop - Update on_context_limit test to expect ERROR instead of WARNING - Add unbounded-cycle to KNOWN_PART_B_VIOLATIONS for non-research recipes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The note described the cycle as run_experiment → troubleshoot → adjust_experiment but the actual sub-loop enters via troubleshoot_run_failure → route_run_failure → adjust_experiment. Updated both YAML and JSON variants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test asserts severity==ERROR and expects exactly one finding, so the _is_clean suffix was misleading. Renamed to _is_error to match behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rity promotion Renamed cycle_warnings to cycle_findings and updated the assertion message from "Expected a cycle WARNING" to "Expected a cycle ERROR" to match the actual Severity.ERROR expectation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trecek
added a commit
that referenced
this pull request
May 8, 2026
## Summary Research-family recipes had 8 unbounded routing loops across 3 files (`research-design.yaml`, `research.yaml`, `research-implement.yaml`). These loops used `retries: N` + `on_exhausted` as their escape hatch, but `retries` only decrements on infrastructure failures (stale/resume), not on semantic `on_result` routing — making the escape hatch dead code for routing cycles. This fix adds `check_loop_iteration` guard steps to all 8 loops, promotes the `unbounded-cycle` validation rule's WARNING to ERROR for cycles where retries cannot provide termination, and corrects misleading "bounded by retries: 2" descriptions in the recipe headers. ## Requirements *(none — no new functional requirements; this is a corrective change)* ## Architecture Impact *(no validated diagrams — arch lens outputs were context files, not rendered diagrams)* Closes #2205 ## Implementation Plan Plan file: `/home/talon/projects/autoskillit-runs/impl-20260507-170916-720653/.autoskillit/temp/make-plan/unbounded_routing_loops_plan_2026-05-07_171600.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) via AutoSkillit <!-- autoskillit:pipeline-signature steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr --> ## Token Usage Summary | Step | Model | count | uncached | output | cache_read | peak_ctx | turns | cache_write | time | |------|-------|-------|----------|--------|------------|----------|-------|-------------|------| | plan | claude-sonnet-4-6 | 1 | 115 | 17.6k | 424.6k | 50.8k | 58 | 42.5k | 5m 28s | | verify | claude-sonnet-4-6 | 1 | 743 | 14.7k | 788.3k | 53.4k | 69 | 40.6k | 4m 5s | | implement* | MiniMax-M2.7-highspeed | 1 | 5.4M | 26.6k | 4.3M | 91.9k | 321 | 188.3k | 13m 26s | | **Total** | | | 5.4M | 58.9k | 5.5M | 91.9k | | 271.4k | 23m 0s | \* *Step used a non-Anthropic provider; caching behavior may differ.* ## Token Efficiency | Step | LoC Changed | cache_read/LoC | cache_write/LoC | output/LoC | |------|-------------|----------------|-----------------|------------| | plan | 0 | — | — | — | | verify | 0 | — | — | — | | implement | 272 | 15792.7 | 692.3 | 97.8 | | **Total** | **272** | 20251.8 | 997.7 | 216.7 | ## Model Usage Breakdown | Model | steps | uncached | output | cache_read | cache_write | time | |-------|-------|----------|--------|------------|-------------|------| | claude-sonnet-4-6 | 2 | 858 | 32.3k | 1.2M | 83.1k | 9m 33s | | MiniMax-M2.7-highspeed | 1 | 5.4M | 26.6k | 4.3M | 188.3k | 13m 26s | --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Research-family recipes had 8 unbounded routing loops across 3 files (
research-design.yaml,research.yaml,research-implement.yaml). These loops usedretries: N+on_exhaustedas their escape hatch, butretriesonly decrements on infrastructure failures (stale/resume), not on semanticon_resultrouting — making the escape hatch dead code for routing cycles.This fix adds
check_loop_iterationguard steps to all 8 loops, promotes theunbounded-cyclevalidation rule's WARNING to ERROR for cycles where retries cannot provide termination, and corrects misleading "bounded by retries: 2" descriptions in the recipe headers.Requirements
(none — no new functional requirements; this is a corrective change)
Architecture Impact
(no validated diagrams — arch lens outputs were context files, not rendered diagrams)
Closes #2205
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260507-170916-720653/.autoskillit/temp/make-plan/unbounded_routing_loops_plan_2026-05-07_171600.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown