fix: allow nested Loop/Ralph when separated by structural nodes#113
Merged
roninjin10 merged 1 commit intomainfrom Mar 18, 2026
Merged
fix: allow nested Loop/Ralph when separated by structural nodes#113roninjin10 merged 1 commit intomainfrom
roninjin10 merged 1 commit intomainfrom
Conversation
Fixes #111. The nesting guard in both extract.ts and scheduler.ts used a monotonic flag (ralphId / inRalph) that propagated through the entire subtree. This rejected <Loop><Sequence><Loop> even though only direct nesting (<Loop><Loop>) should be disallowed. Changed both guards to check parentIsRalph (immediate parent) instead of any-ancestor. Co-Authored-By: Claude Opus 4.6 (1M context) <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
<Loop>/<Ralph>separated by<Sequence>,<Parallel>, or other structural nodes was incorrectly rejectedextract.tsandscheduler.tsguards from checking "any ancestor is ralph" to "immediate parent is ralph"<Loop><Loop>) remains correctly rejectedTest plan
tests/nested-ralph-bug.test.tswith 9 test cases covering direct nesting (rejected), indirect nesting through sequence/parallel/worktree (allowed), three-level nesting, sibling ralphs, and correctralphIdpropagation to task descriptors🤖 Generated with Claude Code