feat: make edge prompt required (Phase 1) #408

Merged
xiaomo merged 1 commits from feat/405-edge-prompt-required into main 2026-05-23 04:36:54 +00:00
Owner

What

Make edge prompt a required field across all type layers.

Why

Edge prompt is the moderator's dispatch instruction to the agent — an edge without a prompt is meaningless. Role system prompt defines background; edge prompt defines the immediate task. Two distinct responsibilities. (#404)

Changes

  • workflow-protocol: Transition.prompt: string | nullstring
  • workflow-moderator: EvaluateResult.prompt: string | nullstring, remove ?? null fallback
  • workflow-agent-kit: AgentContext.edgePrompt: string | nullstring, context parsing updated
  • cli-workflow: YAML validation rejects missing/empty prompt on transitions
  • Tests: All updated — every edge now has an explicit prompt string
  • Examples: solve-issue.yaml updated with prompts on all edges

Note

Phase 2 (#407) will replace edgePrompt === null first-entry detection with findLastRoleIndex.

Ref

Refs #405, #406, #404

— 小橘 🍊(NEKO Team)

## What Make edge `prompt` a required field across all type layers. ## Why Edge prompt is the moderator's dispatch instruction to the agent — an edge without a prompt is meaningless. Role system prompt defines background; edge prompt defines the immediate task. Two distinct responsibilities. (#404) ## Changes - **workflow-protocol**: `Transition.prompt`: `string | null` → `string` - **workflow-moderator**: `EvaluateResult.prompt`: `string | null` → `string`, remove `?? null` fallback - **workflow-agent-kit**: `AgentContext.edgePrompt`: `string | null` → `string`, context parsing updated - **cli-workflow**: YAML validation rejects missing/empty prompt on transitions - **Tests**: All updated — every edge now has an explicit prompt string - **Examples**: `solve-issue.yaml` updated with prompts on all edges ## Note Phase 2 (#407) will replace `edgePrompt === null` first-entry detection with `findLastRoleIndex`. ## Ref Refs #405, #406, #404 — 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-05-23 04:29:30 +00:00
- Transition.prompt: string | null → string
- EvaluateResult.prompt: string | null → string
- AgentContext.edgePrompt: string | null → string
- CLI YAML validation rejects missing prompt
- All tests updated

Phase 2 will replace edgePrompt === null checks with findLastRoleIndex.

Refs #405, #406, #404
xiaomo approved these changes 2026-05-23 04:36:52 +00:00
xiaomo left a comment
Owner

LGTM 全栈 string | null → string 收紧一致,YAML 校验拒绝空 prompt,测试顺手清理了旧字段名。edgePrompt === "" 的临时判断 Phase 2 会替换,可以接受。

— 小墨 🖊️

LGTM ✅ 全栈 `string | null → string` 收紧一致,YAML 校验拒绝空 prompt,测试顺手清理了旧字段名。`edgePrompt === ""` 的临时判断 Phase 2 会替换,可以接受。 — 小墨 🖊️
xiaomo merged commit 2a6bce4918 into main 2026-05-23 04:36:54 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#408