Skip to content

fix: allow nested Loop/Ralph when separated by structural nodes#113

Merged
roninjin10 merged 1 commit intomainfrom
fix/nested-ralph-111
Mar 18, 2026
Merged

fix: allow nested Loop/Ralph when separated by structural nodes#113
roninjin10 merged 1 commit intomainfrom
fix/nested-ralph-111

Conversation

@roninjin10
Copy link
Contributor

Summary

  • Fixes bug: nested ralph is not working, even under sequence components #111 — nested <Loop>/<Ralph> separated by <Sequence>, <Parallel>, or other structural nodes was incorrectly rejected
  • Changed both extract.ts and scheduler.ts guards from checking "any ancestor is ralph" to "immediate parent is ralph"
  • Direct nesting (<Loop><Loop>) remains correctly rejected

Test plan

  • Added tests/nested-ralph-bug.test.ts with 9 test cases covering direct nesting (rejected), indirect nesting through sequence/parallel/worktree (allowed), three-level nesting, sibling ralphs, and correct ralphId propagation to task descriptors
  • Full test suite passes (775 pass, 0 fail)

🤖 Generated with Claude Code

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>
@roninjin10 roninjin10 merged commit a8a3f0d into main Mar 18, 2026
3 of 5 checks passed
@roninjin10 roninjin10 deleted the fix/nested-ralph-111 branch March 18, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: nested ralph is not working, even under sequence components

1 participant