refactor: remove legacy standard frontmatter fields (next/confidence/artifacts/scope) #544

Closed
opened 2026-05-26 15:15:26 +00:00 by xiaoju · 0 comments
Owner

Background

Frontmatter 解析层把 nextconfidenceartifactsscope 当作"标准字段"硬编码在代码里,和 status 并列。但实际上 只有 status 是真正的标准字段——其余都应该由 role 的 frontmatter schema 自行定义。

影响范围

  • packages/workflow-util/src/frontmatter-markdown/types.tsAgentFrontmatter 类型包含 5 个字段
  • packages/workflow-util/src/frontmatter-markdown/frontmatter-markdown.ts — 解析和验证逻辑
  • packages/workflow-util-agent/src/frontmatter.tsSTANDARD_KEYSdefaultCandidate
  • 相关测试文件

Tasks

  1. AgentFrontmatter 类型只保留 status
  2. 移除 STANDARD_KEYS 中的 next/confidence/artifacts/scope
  3. 移除 defaultCandidate 中的 legacy 字段
  4. 更新 validateFrontmatter 只验证 status
  5. 更新所有测试
  6. 检查是否有 workflow YAML 依赖这些字段(e2e-walkthrough 等)

Breaking change,不需要向后兼容。

小橘 🍊(NEKO Team)

## Background Frontmatter 解析层把 `next`、`confidence`、`artifacts`、`scope` 当作"标准字段"硬编码在代码里,和 `status` 并列。但实际上 **只有 `status` 是真正的标准字段**——其余都应该由 role 的 frontmatter schema 自行定义。 ## 影响范围 - `packages/workflow-util/src/frontmatter-markdown/types.ts` — `AgentFrontmatter` 类型包含 5 个字段 - `packages/workflow-util/src/frontmatter-markdown/frontmatter-markdown.ts` — 解析和验证逻辑 - `packages/workflow-util-agent/src/frontmatter.ts` — `STANDARD_KEYS` 和 `defaultCandidate` - 相关测试文件 ## Tasks 1. `AgentFrontmatter` 类型只保留 `status` 2. 移除 `STANDARD_KEYS` 中的 next/confidence/artifacts/scope 3. 移除 `defaultCandidate` 中的 legacy 字段 4. 更新 `validateFrontmatter` 只验证 status 5. 更新所有测试 6. 检查是否有 workflow YAML 依赖这些字段(e2e-walkthrough 等) Breaking change,不需要向后兼容。 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#544