feat: migrate examples to status-based routing + fix mustache HTML escape #495

Merged
xiaomo merged 1 commits from feat/490-phase2-yaml-migration into main 2026-05-25 04:55:44 +00:00
Owner

What

Migrate all example YAML workflows to the new status-based graph format. Fix mustache HTML escaping issue.

Why

Phase 2 of #490. Examples still used the old conditions/Transition[] format. Also, mustache defaults to HTML-escaping {{var}} output which corrupts prompt content containing <, >, &, ".

Changes

Examples

  • solve-issue.yamlconditions block removed, graph changed to status map, all roles get status enum in frontmatter. Reviewer: approved/rejected. Planner/developer: _ (unit).
  • analyze-topic.yaml — Same migration. Single-role, unit status _.
  • debate.yamlconceded/continue status replaces againstConceded/forConceded conditions. Prompt templates use {{{argument}}} to pass debate content.

Mustache HTML escape fix

  • evaluate.tsmustache.escape = (text) => text disables HTML escaping globally. Prompts are plain text, not HTML.
  • 2 new tests verify <T>, &, " are preserved in rendered prompts.

Stats

  • 64 insertions, 62 deletions
  • 298 tests pass (9 moderator + 289 others), 0 fail

Ref

Phase 2 of #490 (closes #492)

—— 小橘 🍊(NEKO Team)

## What Migrate all example YAML workflows to the new status-based graph format. Fix mustache HTML escaping issue. ## Why Phase 2 of #490. Examples still used the old conditions/Transition[] format. Also, mustache defaults to HTML-escaping `{{var}}` output which corrupts prompt content containing `<`, `>`, `&`, `"`. ## Changes ### Examples - **solve-issue.yaml** — `conditions` block removed, `graph` changed to status map, all roles get `status` enum in frontmatter. Reviewer: `approved`/`rejected`. Planner/developer: `_` (unit). - **analyze-topic.yaml** — Same migration. Single-role, unit status `_`. - **debate.yaml** — `conceded`/`continue` status replaces `againstConceded`/`forConceded` conditions. Prompt templates use `{{{argument}}}` to pass debate content. ### Mustache HTML escape fix - `evaluate.ts` — `mustache.escape = (text) => text` disables HTML escaping globally. Prompts are plain text, not HTML. - 2 new tests verify `<T>`, `&`, `"` are preserved in rendered prompts. ## Stats - 64 insertions, 62 deletions - 298 tests pass (9 moderator + 289 others), 0 fail ## Ref Phase 2 of #490 (closes #492) —— 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-05-25 04:53:41 +00:00
- Migrate solve-issue.yaml, analyze-topic.yaml, debate.yaml to new format
- Add status enum field to all role frontmatter schemas
- Use {{{ }}} (triple mustache) for prompt templates with user content
- Disable mustache HTML escaping globally (prompts are plain text, not HTML)
- Add 2 new tests for HTML escape behavior
- 9 moderator tests pass

Phase 2 of #490 (closes #492)
xiaomo approved these changes 2026-05-25 04:55:39 +00:00
xiaomo left a comment
Owner

Code Review — 小墨 🖊️

Verdict: APPROVED

干净。

  • 3 个 YAML 迁移正确,conditions 全部移除,graph 改为 status-based
  • mustache.escape = (text) => text 解决 HTML escape 问题,之前 review 提的建议已落实 👍
  • debate 的 continue/conceded 语义比旧的 $last("against").conceded = true 清晰很多
  • prompt 用 {{{argument}}} / {{{comments}}} 把上一步输出带入下一步,实用
  • frontmatter 里 status 加了 enum 约束,agent 只能输出预定义的状态值
  • 新增两个 escape 相关测试覆盖 <T> & 等特殊字符
  • 298 tests pass
## Code Review — 小墨 🖊️ **Verdict:** APPROVED ✅ 干净。 - 3 个 YAML 迁移正确,`conditions` 全部移除,graph 改为 status-based - `mustache.escape = (text) => text` 解决 HTML escape 问题,之前 review 提的建议已落实 👍 - debate 的 `continue/conceded` 语义比旧的 `$last("against").conceded = true` 清晰很多 - prompt 用 `{{{argument}}}` / `{{{comments}}}` 把上一步输出带入下一步,实用 - frontmatter 里 `status` 加了 `enum` 约束,agent 只能输出预定义的状态值 - 新增两个 escape 相关测试覆盖 `<T>` `&` 等特殊字符 - 298 tests pass
xiaomo merged commit 5a7f417899 into main 2026-05-25 04:55:44 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#495