[GH-ISSUE #89] Preset YAML files use deprecated XML event format instead of ralph emit #34

Closed
opened 2026-02-27 10:21:52 +03:00 by kerem · 1 comment
Owner

Originally created by @memyselfandm on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/89

Summary

Several built-in preset YAML files contain instructions showing an XML-style event format (<event topic="...">) in their hat instructions. This is incorrect - the actual event system uses ralph emit CLI command which writes JSONL to .agent/events.jsonl.

The core HatlessRalph prompt correctly documents the format:

ralph emit "build.done" "tests: pass, lint: pass"
ralph emit "review.done" --json '{"status": "approved", "issues": 0}'

But the presets show XML that will not be parsed by the event loop.

Affected Files

1. crates/ralph-cli/presets/refactor.yml

Lines 41-49, 62, 89, 92:

6. **Publish** `<event topic="refactor.done">`

### Event Format
step: [step description] tests: pass clippy: pass ```

Publish <event topic="refactor.blocked"> with failure details
Publish <event topic="verify.passed">
Publish <event topic="verify.failed"> with details


### 2. `crates/ralph-cli/presets/pr-review.yml`

**Lines 52-60, 95-105, 139-147, 181-197:**
```yaml
<event topic="correctness.done">
files_reviewed: [list of files]
...
</event>

<event topic="security.done">
...
</event>

<event topic="architecture.done">
...
</event>

<event topic="review.complete">
verdict: APPROVE | REQUEST_CHANGES | COMMENT
...
</event>

3. crates/ralph-cli/presets/feature.yml

Lines 40-49, 64, 85, 88-96:

5. **Exit.** Publish `<event topic="build.done">` with evidence.

### Event Format
Write events as JSONL:  # <-- Note: says JSONL but shows XML!
tests: pass lint: pass typecheck: pass ```

Publish <event topic="build.blocked"> with what you tried
Publish <event topic="review.approved">
Publish <event topic="review.changes_requested">


### 4. `crates/ralph-cli/presets/docs.yml`

**Lines 40-47, 81, 84:**
```yaml
6. Publish `<event topic="write.done">`

### Event Format
section: [section name] file: [path/to/doc.md] ```

Publish <event topic="review.revision"> with specific feedback.
Publish <event topic="review.done">


### 5. `crates/ralph-cli/presets/minimal/code-assist.yml`

**Lines 44-54:**
```yaml
When task is complete with passing tests:
tests: pass Summary of what was implemented ```

When blocked and unable to proceed:

<event topic="build.blocked">
Explanation of what's blocking progress
</event>

## Correct Format

These should all use `ralph emit`:

```yaml
instructions: |
  When complete, publish the event:
  ```bash
  ralph emit "build.done" "tests: pass, lint: pass"

For structured data:

ralph emit "review.done" --json '{"status": "approved", "files": ["a.rs", "b.rs"]}'

## Impact

- Claude sees XML format in hat instructions
- Claude may output XML events that the event loop cannot parse
- Events are silently dropped or cause malformed event errors
- Loops stall because expected events never arrive

## Presets NOT Affected

The following presets don't include event format examples in their instructions and rely on the core `EVENT WRITING` section from HatlessRalph:

- `spec-driven.yml` - just says "Publish spec.ready when complete"
- `tdd-red-green.yml`
- `debug.yml`
- `research.yml`
- And others

## Proposed Fix

Update all affected preset files to:
1. Remove XML-style event examples
2. Use `ralph emit` CLI syntax
3. Or simply reference the event topic without format details (let HatlessRalph's EVENT WRITING section handle it)
Originally created by @memyselfandm on GitHub (Jan 21, 2026). Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/89 ## Summary Several built-in preset YAML files contain instructions showing an XML-style event format (`<event topic="...">`) in their hat instructions. This is incorrect - the actual event system uses `ralph emit` CLI command which writes JSONL to `.agent/events.jsonl`. The core `HatlessRalph` prompt correctly documents the format: ```bash ralph emit "build.done" "tests: pass, lint: pass" ralph emit "review.done" --json '{"status": "approved", "issues": 0}' ``` But the presets show XML that will not be parsed by the event loop. ## Affected Files ### 1. `crates/ralph-cli/presets/refactor.yml` **Lines 41-49, 62, 89, 92:** ```yaml 6. **Publish** `<event topic="refactor.done">` ### Event Format ``` <event topic="refactor.done"> step: [step description] tests: pass clippy: pass </event> ``` Publish `<event topic="refactor.blocked">` with failure details Publish `<event topic="verify.passed">` Publish `<event topic="verify.failed">` with details ``` ### 2. `crates/ralph-cli/presets/pr-review.yml` **Lines 52-60, 95-105, 139-147, 181-197:** ```yaml <event topic="correctness.done"> files_reviewed: [list of files] ... </event> <event topic="security.done"> ... </event> <event topic="architecture.done"> ... </event> <event topic="review.complete"> verdict: APPROVE | REQUEST_CHANGES | COMMENT ... </event> ``` ### 3. `crates/ralph-cli/presets/feature.yml` **Lines 40-49, 64, 85, 88-96:** ```yaml 5. **Exit.** Publish `<event topic="build.done">` with evidence. ### Event Format Write events as JSONL: # <-- Note: says JSONL but shows XML! ``` <event topic="build.done"> tests: pass lint: pass typecheck: pass </event> ``` Publish `<event topic="build.blocked">` with what you tried Publish `<event topic="review.approved">` Publish `<event topic="review.changes_requested">` ``` ### 4. `crates/ralph-cli/presets/docs.yml` **Lines 40-47, 81, 84:** ```yaml 6. Publish `<event topic="write.done">` ### Event Format ``` <event topic="write.done"> section: [section name] file: [path/to/doc.md] </event> ``` Publish `<event topic="review.revision">` with specific feedback. Publish `<event topic="review.done">` ``` ### 5. `crates/ralph-cli/presets/minimal/code-assist.yml` **Lines 44-54:** ```yaml When task is complete with passing tests: ``` <event topic="build.done"> tests: pass Summary of what was implemented </event> ``` When blocked and unable to proceed: ``` <event topic="build.blocked"> Explanation of what's blocking progress </event> ``` ``` ## Correct Format These should all use `ralph emit`: ```yaml instructions: | When complete, publish the event: ```bash ralph emit "build.done" "tests: pass, lint: pass" ``` For structured data: ```bash ralph emit "review.done" --json '{"status": "approved", "files": ["a.rs", "b.rs"]}' ``` ``` ## Impact - Claude sees XML format in hat instructions - Claude may output XML events that the event loop cannot parse - Events are silently dropped or cause malformed event errors - Loops stall because expected events never arrive ## Presets NOT Affected The following presets don't include event format examples in their instructions and rely on the core `EVENT WRITING` section from HatlessRalph: - `spec-driven.yml` - just says "Publish spec.ready when complete" - `tdd-red-green.yml` - `debug.yml` - `research.yml` - And others ## Proposed Fix Update all affected preset files to: 1. Remove XML-style event examples 2. Use `ralph emit` CLI syntax 3. Or simply reference the event topic without format details (let HatlessRalph's EVENT WRITING section handle it)
kerem closed this issue 2026-02-27 10:21:52 +03:00
Author
Owner

@mikeyobrien commented on GitHub (Jan 22, 2026):

This issue has been resolved. All affected preset files have been updated to use ralph emit CLI syntax instead of the deprecated XML event format:

Fixed files:

  • refactor.yml - Now uses ralph emit "refactor.done" "step: ..."
  • pr-review.yml - Now uses ralph emit "correctness.done" --json '...' for structured data
  • feature.yml - Now uses ralph emit "build.done" "tests: pass, ..."
  • docs.yml - Now uses ralph emit "write.done" "section: ..."
  • minimal/code-assist.yml - Now uses ralph emit "build.done" "..."

All event examples are consistent with the HatlessRalph EVENT WRITING section documented in PROMPT.md.

<!-- gh-comment-id:3784309046 --> @mikeyobrien commented on GitHub (Jan 22, 2026): This issue has been resolved. All affected preset files have been updated to use `ralph emit` CLI syntax instead of the deprecated XML event format: **Fixed files:** - `refactor.yml` - Now uses `ralph emit "refactor.done" "step: ..."` - `pr-review.yml` - Now uses `ralph emit "correctness.done" --json '...'` for structured data - `feature.yml` - Now uses `ralph emit "build.done" "tests: pass, ..."` - `docs.yml` - Now uses `ralph emit "write.done" "section: ..."` - `minimal/code-assist.yml` - Now uses `ralph emit "build.done" "..."` All event examples are consistent with the HatlessRalph EVENT WRITING section documented in PROMPT.md.
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#34
No description provided.