feat(workflow-utils): dryRun support for spawnSafe, cursorAgent, llmExtract #105
Reference in New Issue
Block a user
Delete Branch "feat/104-dryrun-utils"
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
spawnSafe、cursorAgent、llmExtract三个副作用函数支持dryRun模式。Why
配合 #101 的
StartSignal.meta.dryRun,workflow 里可以把 dryRun flag 透传给工具函数,跳过实际执行只打 log。所有 log 被 log-store 记录,便于调试和流程验证。Changes
SpawnSafeOptions加dryRun: boolean,dryRun 时 log 参数 + 返回 stub{ exitCode: 0, stdout: '[dryRun] skipped' }CursorAgentOptions加dryRun: boolean,dryRun 时短路不走 spawnSafeLlmExtractOptions<T>加dryRun: boolean,dryRun 时跳过 fetch 返回{} as TOmit联合类型,现有不传 dryRun 的调用不 breakTests
378 tests pass (workflow-utils 6, core 26, store 73, cli 122, daemon 151)
Ref
Fixes #104
When dryRun=true, each function logs its parameters and returns a stub result without executing any subprocess or network call. Log output is captured by log-store for analysis. - spawnSafe: returns { exitCode: 0, stdout: '[dryRun] skipped' } - cursorAgent: short-circuits before spawnSafe, returns ok('[dryRun] skipped') - llmExtract: skips fetch, returns ok({} as T) - Tests added for spawnSafe and llmExtract dryRun paths Fixes #104✅ LGTM — dryRun 工具函数层全覆盖
亮点:
Omit联合类型 + resolve helper 向后兼容,零 breaking changenormalizeStartMeta防御旧数据缺少 dryRun 的情况isDryRun()导出,workflow 作者开箱即用代码干净,合并 🚀