[PR #170] [MERGED] fix: deterministic hat selection and default_publishes injection #176

Closed
opened 2026-02-27 10:22:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/170
Author: @The-Zona-Zoo
Created: 2/12/2026
Status: Merged
Merged: 2/13/2026
Merged by: @mikeyobrien

Base: mainHead: fix/hat-selection-determinism-and-display


📝 Commits (3)

  • a43a944 fix: deterministic hat selection and default_publishes injection
  • 07248fe chore: sync embedded pdd sop
  • 5431378 Merge remote-tracking branch 'origin/main' into fix/hat-selection-determinism-and-display

📊 Changes

8 files changed (+175 additions, -59 deletions)

View changed files

📝 crates/ralph-cli/src/loop_runner.rs (+16 -2)
📝 crates/ralph-core/src/event_loop/loop_state.rs (+5 -0)
📝 crates/ralph-core/src/event_loop/mod.rs (+7 -25)
📝 crates/ralph-core/src/event_loop/tests.rs (+57 -24)
📝 crates/ralph-core/src/hat_registry.rs (+84 -4)
📝 crates/ralph-core/src/summary_writer.rs (+1 -0)
📝 crates/ralph-proto/src/event_bus.rs (+4 -3)
📝 crates/ralph-proto/src/hat.rs (+1 -1)

📄 Description

  • HashMap → BTreeMap for hat registry and event bus to ensure deterministic hat ordering (alphabetical by hat ID). This should fix the TUI not always displaying the correct hat.
  • Track last_active_hat_ids in LoopState so default_publishes knows which hats ran.
  • Fix check_default_publishes always injecting: it re-read the event file after process_events_from_jsonl had already consumed it, so read_new_events always returned 0. Now the caller uses the return value of process_events_from_jsonl to guard injection.
  • Remove dead record_event_count method and unused _events_before parameter.

Fixes #157


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mikeyobrien/ralph-orchestrator/pull/170 **Author:** [@The-Zona-Zoo](https://github.com/The-Zona-Zoo) **Created:** 2/12/2026 **Status:** ✅ Merged **Merged:** 2/13/2026 **Merged by:** [@mikeyobrien](https://github.com/mikeyobrien) **Base:** `main` ← **Head:** `fix/hat-selection-determinism-and-display` --- ### 📝 Commits (3) - [`a43a944`](https://github.com/mikeyobrien/ralph-orchestrator/commit/a43a944b05b6171f73271ec1fb25c5352926c5ea) fix: deterministic hat selection and default_publishes injection - [`07248fe`](https://github.com/mikeyobrien/ralph-orchestrator/commit/07248feb97e7d0e5d54b2c921ccb5e302a169215) chore: sync embedded pdd sop - [`5431378`](https://github.com/mikeyobrien/ralph-orchestrator/commit/543137841e4079f7aeae0c1c9dcfc6282b87a01d) Merge remote-tracking branch 'origin/main' into fix/hat-selection-determinism-and-display ### 📊 Changes **8 files changed** (+175 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `crates/ralph-cli/src/loop_runner.rs` (+16 -2) 📝 `crates/ralph-core/src/event_loop/loop_state.rs` (+5 -0) 📝 `crates/ralph-core/src/event_loop/mod.rs` (+7 -25) 📝 `crates/ralph-core/src/event_loop/tests.rs` (+57 -24) 📝 `crates/ralph-core/src/hat_registry.rs` (+84 -4) 📝 `crates/ralph-core/src/summary_writer.rs` (+1 -0) 📝 `crates/ralph-proto/src/event_bus.rs` (+4 -3) 📝 `crates/ralph-proto/src/hat.rs` (+1 -1) </details> ### 📄 Description - HashMap → BTreeMap for hat registry and event bus to ensure deterministic hat ordering (alphabetical by hat ID). This should fix the TUI not always displaying the correct hat. - Track last_active_hat_ids in LoopState so default_publishes knows which hats ran. - Fix check_default_publishes always injecting: it re-read the event file after process_events_from_jsonl had already consumed it, so read_new_events always returned 0. Now the caller uses the return value of process_events_from_jsonl to guard injection. - Remove dead record_event_count method and unused _events_before parameter. Fixes #157 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:22:32 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#176
No description provided.