mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 07:05:57 +03:00
[GH-ISSUE #86] Hat system event routing bugs cause stalled loops and incorrect behavior #31
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @memyselfandm on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/86
Summary
The multi-hat event routing system has three related bugs that cause loops to stall, terminate prematurely, or exhibit incorrect behavior. These issues were discovered while using the
spec-drivenpreset.Bugs
Bug 1:
starting_eventinstruction shown in all iterationsLocation:
crates/ralph-core/src/hatless_ralph.rs:239-244The
starting_eventinstruction (e.g., "After coordination, publishspec.startto start the workflow") is unconditionally included in every prompt when configured, even when a different hat should be active.This causes Claude to sometimes publish
spec.startinstead of the correct event for the active hat (e.g.,spec.approvedfor Spec Critic), creating self-triggering loops.Evidence from captured prompt:
Bug 2: Orphan events are dropped, not routed to Ralph
Location:
crates/ralph-core/src/event_loop.rs:845-862When Claude publishes an event that no custom hat subscribes to, the code logs it as an orphan but does NOT publish it to the EventBus:
The comment says "Ralph will handle it" but the event is silently dropped.
Bug 3: No validation of published event topics
Location: No validation exists
Hats define a
publisheslist in their config, but there's no validation that Claude only publishes allowed topics. Claude can emit any event topic, causing:Event Log Evidence
The Implementer should trigger on
spec.approvedand publishimplementation.done, but instead:implementation.start,implementation.trigger)Proposed Fixes
Bug 1
Only include
starting_eventinstruction whenis_fresh_start()or pending event istask.start.Bug 2
Route orphan events to Ralph's queue instead of dropping them.
Bug 3
Validate that published events match the active hat's
publisheslist; reject invalid events with feedback.Environment
spec-drivenmain(verified bugs present as of 2026-01-20)@mikeyobrien commented on GitHub (Jan 25, 2026):
Pushed updated presets