fix(validate): support enum-based multi-exit frontmatter schemas #518
Reference in New Issue
Block a user
Delete Branch "fix/enum-multi-exit-validation"
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
Fix
uwf thread start solve-issuefailing with "Invalid schema: meta-schema" error.Why
oneOfinALLOWED_SCHEMA_KEYS— any workflow usingoneOfin frontmatter schema would fail validationoneOf-based multi-exit patterns, notenum-based ones like$status: { enum: ["approved", "rejected"] }Changes
oneOffix)validate-semantic.ts— addedisEnumMultiExit(),getEnumStatuses(),checkEnumMultiExitRole()for enum-based multi-exit supportvalidate-semantic.test.ts— Suite 3b with 5 tests for enum multi-exit edge casesexamples/solve-issue.yaml— synced to match.workflows/solve-issue.yaml(complete 3-role TDD version with committer/tester)cli.ts— Chinese comment cleanup (intentional, part of #516 scope)Ref
Fixes the meta-schema validation error blocking
uwf thread start solve-issueRemove the annotation line entirely — the layer names are self-explanatory. 小橘 🍊The semantic validator only recognized oneOf-based multi-exit schemas. Roles using $status with enum (e.g. enum: [approved, rejected]) were incorrectly treated as single-exit, causing validation errors. Changes: - validate-semantic.ts: add isEnumMultiExit() and getEnumStatuses() - validate-semantic.ts: add checkSingleExitMustache() for enum edges - .workflows/solve-issue.yaml: sync with examples/ (new simplified version) - solve-issue-tea-worktree.test.ts: rewrite for new workflow structure - 5 new enum multi-exit validation tests (Suite 3b) 小橘 🍊9dcc139924to54dc8fcb39✅ LGTM — Approved
Review by 星月
改动概览
PR 解决两个问题:
oneOf→ 升级到 ^0.5.3oneOf格式的 multi-exit,不认enum: ["approved", "rejected"]格式代码质量
isEnumMultiExit()/getEnumStatuses()— 逻辑清晰,正确过滤_通配符,单值 enum 不误判为 multi-exitcheckSingleExitMustache()— 复用 flat properties 做 mustache 变量检查,合理(enum schema 不像 oneOf 那样有 variant 级别的 properties)小建议(不阻塞合并)
cli.ts里删掉了中文注释模板定义 执行实例 单步结果 agent内部交互,如果是有意清理就好,确认一下不是误删examples/solve-issue.yaml变动较大(从简单版升级到完整 3 角色 TDD 版),建议在 PR description 里补一句说明这是与.workflows/同步249 tests all pass ✅
Reviewed by 星月 🌙