feat: replace $START _ status with new/resume semantics #102

Merged
xiaomo merged 1 commits from feat/101-start-new-resume into main 2026-06-05 09:35:36 +00:00
Owner

What

Replace the special _ status key on $START graph nodes with two explicit status values:

  • new — first-time thread start
  • resume — resuming a completed thread

Why

$START was the only graph node using magic _ status. This broke consistency — every other node routes by $status. The hardcoded resume prompt in CLI couldn't be customized per workflow.

Changes

  • evaluate.ts — removed START_ROLE/START_STATUS special case; $START now uses $status like all nodes
  • thread.tsresolveEvaluateArgs passes "new" for fresh starts; cmdThreadResume passes "resume" and uses the graph edge prompt instead of hardcoded text
  • validate.ts_ is now rejected everywhere (no longer valid as a status key)
  • validate-semantic.ts$START must have new and resume edges (not just _)
  • util/ references — updated moderator/workflow-authoring/yaml reference docs
  • All workflow YAMLs$START._$START.new + $START.resume (6 workflows + 5 test fixtures)
  • All affected tests — 809/809 passing

BREAKING

All workflow YAML files must update $START._ to $START.new + $START.resume.

Ref

Fixes #101

## What Replace the special `_` status key on `$START` graph nodes with two explicit status values: - `new` — first-time thread start - `resume` — resuming a completed thread ## Why `$START` was the only graph node using magic `_` status. This broke consistency — every other node routes by `$status`. The hardcoded resume prompt in CLI couldn't be customized per workflow. ## Changes - **`evaluate.ts`** — removed `START_ROLE`/`START_STATUS` special case; `$START` now uses `$status` like all nodes - **`thread.ts`** — `resolveEvaluateArgs` passes `"new"` for fresh starts; `cmdThreadResume` passes `"resume"` and uses the graph edge prompt instead of hardcoded text - **`validate.ts`** — `_` is now rejected everywhere (no longer valid as a status key) - **`validate-semantic.ts`** — `$START` must have `new` and `resume` edges (not just `_`) - **`util/` references** — updated moderator/workflow-authoring/yaml reference docs - **All workflow YAMLs** — `$START._` → `$START.new` + `$START.resume` (6 workflows + 5 test fixtures) - **All affected tests** — 809/809 passing ## BREAKING All workflow YAML files must update `$START._` to `$START.new` + `$START.resume`. ## Ref Fixes #101
xiaoju added 1 commit 2026-06-05 09:31:41 +00:00
feat: replace $START _ status with new/resume semantics
CI / check (pull_request) Successful in 2m27s
fbfd31a042
BREAKING: All workflow YAML files must update $START._ to $START.new + $START.resume.
The resume edge prompt replaces the previously hardcoded resume message.

- evaluate.ts: remove START_ROLE/START_STATUS special case, use $status like all nodes
- thread.ts: resolveEvaluateArgs passes 'new', cmdThreadResume passes 'resume'
- validate.ts: reject '_' everywhere (no longer valid)
- validate-semantic.ts: require 'new' and 'resume' edges on $START
- All workflow YAMLs and test fixtures updated

Fixes #101
xiaomo approved these changes 2026-06-05 09:35:34 +00:00
xiaomo left a comment
Owner

LGTM

设计上很干净:把 $START_ 魔法值和硬编码 resume prompt 从代码层移到 workflow YAML 层,让 workflow 作者自己定义 new/resume 语义。

evaluate.ts — 删掉 $START 特判,统一走 $status 路由,逻辑简化。

thread.tsresolveEvaluateArgs"new"cmdThreadResume"resume" 并用 graph edge prompt 替掉硬编码的 "Previous run completed...",biome-ignore 也能顺手摘掉了。

validate.ts_ 全局禁用,断得干脆。

validate-semantic.ts$START 强制要求 new + resume 两条边,编译期保证 workflow 完整性。测试覆盖了缺 new、缺 resume、都有三种情况。

changeset 标 cli minor(BREAKING)+ util patch,合理。

所有 workflow YAML、fixture、reference 文档同步更新,没有遗漏。

LGTM ✅ 设计上很干净:把 `$START` 的 `_` 魔法值和硬编码 resume prompt 从代码层移到 workflow YAML 层,让 workflow 作者自己定义 new/resume 语义。 **evaluate.ts** — 删掉 `$START` 特判,统一走 `$status` 路由,逻辑简化。 **thread.ts** — `resolveEvaluateArgs` 传 `"new"`,`cmdThreadResume` 传 `"resume"` 并用 graph edge prompt 替掉硬编码的 "Previous run completed...",biome-ignore 也能顺手摘掉了。 **validate.ts** — `_` 全局禁用,断得干脆。 **validate-semantic.ts** — `$START` 强制要求 `new` + `resume` 两条边,编译期保证 workflow 完整性。测试覆盖了缺 new、缺 resume、都有三种情况。 changeset 标 cli minor(BREAKING)+ util patch,合理。 所有 workflow YAML、fixture、reference 文档同步更新,没有遗漏。
xiaomo merged commit 61dfb40933 into main 2026-06-05 09:35:36 +00:00
xiaomo deleted branch feat/101-start-new-resume 2026-06-05 09:35:36 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#102