[PR #192] [CLOSED] test: add cascade reproduction test and code task for #187 #189

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

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/192
Author: @mikeyobrien
Created: 2/25/2026
Status: Closed

Base: mainHead: fix/default-publishes-cascade-187


📝 Commits (1)

  • ffaaf1e test: add cascade reproduction test and code task for #187

📊 Changes

2 files changed (+253 additions, -0 deletions)

View changed files

.ralph/tasks/fix-default-publishes-cascade.code-task.md (+117 -0)
📝 crates/ralph-core/src/event_loop/tests.rs (+136 -0)

📄 Description

Summary

Adds a reproduction test and structured code-task for issue #187: default_publishes cascades to LOOP_COMPLETE when agent writes no events in worktree loops, completing the loop with zero work done.

What's included

Integration test: test_default_publishes_cascade_on_silent_agent

Drives the EventLoop through a 3-hat chain (track_buildersecurity_reviewertrack_reviewer) where:

  • All hats have default_publishes configured
  • Agent writes zero events every iteration (silent backend)
  • Verifies all 3 defaults fire, cascading through to LOOP_COMPLETE

The test documents the bug — assertions will be flipped when the fix lands.

Code task: fix-default-publishes-cascade.code-task.md

Fix design synthesized from 3 independent model analyses (o3, Sonnet 4, Gemini 3.1):

Layer 1 — Runtime cascade guard:

  • consecutive_default_publishes: u32 counter in LoopState
  • Resets on real agent output, increments on default injection
  • CascadingDefaults termination when threshold (1) exceeded

Layer 2 — Config validation:

  • Reject default_publishes == completion_promise at config load time
  • Warn when default_publishes is set to LOOP_COMPLETE (almost always a mistake)

Acceptance criteria (9 items)

See the code-task file for the full checklist.

Testing

  • All 719 tests pass (688 unit + 31 integration/doc), excluding the pre-existing check_node_rejects_old_version web.rs flake
  • The new test (test_default_publishes_cascade_on_silent_agent) exercises the exact bug path

Refs: #187


🔄 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/192 **Author:** [@mikeyobrien](https://github.com/mikeyobrien) **Created:** 2/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/default-publishes-cascade-187` --- ### 📝 Commits (1) - [`ffaaf1e`](https://github.com/mikeyobrien/ralph-orchestrator/commit/ffaaf1e323200da5cadab925c29c646766cf6bd3) test: add cascade reproduction test and code task for #187 ### 📊 Changes **2 files changed** (+253 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.ralph/tasks/fix-default-publishes-cascade.code-task.md` (+117 -0) 📝 `crates/ralph-core/src/event_loop/tests.rs` (+136 -0) </details> ### 📄 Description ## Summary Adds a reproduction test and structured code-task for **issue #187**: `default_publishes` cascades to `LOOP_COMPLETE` when agent writes no events in worktree loops, completing the loop with zero work done. ## What's included ### Integration test: `test_default_publishes_cascade_on_silent_agent` Drives the `EventLoop` through a 3-hat chain (`track_builder` → `security_reviewer` → `track_reviewer`) where: - All hats have `default_publishes` configured - Agent writes zero events every iteration (silent backend) - Verifies all 3 defaults fire, cascading through to `LOOP_COMPLETE` The test **documents the bug** — assertions will be flipped when the fix lands. ### Code task: `fix-default-publishes-cascade.code-task.md` Fix design synthesized from 3 independent model analyses (o3, Sonnet 4, Gemini 3.1): **Layer 1 — Runtime cascade guard:** - `consecutive_default_publishes: u32` counter in `LoopState` - Resets on real agent output, increments on default injection - `CascadingDefaults` termination when threshold (1) exceeded **Layer 2 — Config validation:** - Reject `default_publishes == completion_promise` at config load time - Warn when `default_publishes` is set to `LOOP_COMPLETE` (almost always a mistake) ### Acceptance criteria (9 items) See the code-task file for the full checklist. ## Testing - ✅ All 719 tests pass (688 unit + 31 integration/doc), excluding the pre-existing `check_node_rejects_old_version` web.rs flake - The new test (`test_default_publishes_cascade_on_silent_agent`) exercises the exact bug path Refs: #187 --- <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:39 +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#189
No description provided.