feat(cli): workflow semantic validation before execution #507
Reference in New Issue
Block a user
Delete Branch "fix/506-semantic-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
Add validateWorkflow() function for deep semantic checks on parsed workflows.
Why
parseWorkflowPayload only validates structural shape — semantic errors blow up at runtime.
Changes
Ref
Fixes #506
Code Review — 小墨 🖊️
APPROVED ✅
非常扎实的语义验证层,6 个维度的检查:
_出口)、$END 无出边、BFS 可达性分析_、多出口 role 的 status 集合与 oneOf variants 精确匹配$status必须是 const代码组织也很好,每个检查维度独立函数,
validateWorkflow作为门面串联。集成点选在materializeLocalWorkflow和cmdWorkflowAdd,workflow put 和 thread start 都会过验证。isRoleDefinition的 oneOf 兼容修复也到位 —frontmatter.type或frontmatter.oneOf都合法。366 行测试,覆盖全面 👏