feat: replace $START _ status with new/resume semantics
#102
Reference in New Issue
Block a user
Delete Branch "feat/101-start-new-resume"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Replace the special
_status key on$STARTgraph nodes with two explicit status values:new— first-time thread startresume— resuming a completed threadWhy
$STARTwas 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— removedSTART_ROLE/START_STATUSspecial case;$STARTnow uses$statuslike all nodesthread.ts—resolveEvaluateArgspasses"new"for fresh starts;cmdThreadResumepasses"resume"and uses the graph edge prompt instead of hardcoded textvalidate.ts—_is now rejected everywhere (no longer valid as a status key)validate-semantic.ts—$STARTmust havenewandresumeedges (not just_)util/references — updated moderator/workflow-authoring/yaml reference docs$START._→$START.new+$START.resume(6 workflows + 5 test fixtures)BREAKING
All workflow YAML files must update
$START._to$START.new+$START.resume.Ref
Fixes #101
_status withnew/resumesemanticsLGTM ✅
设计上很干净:把
$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 文档同步更新,没有遗漏。