Commit 97cd75045794b76cf2c5a993f9a752df7d51e46a

Authored by zichun
1 parent 2ee4c7fd

fix(coding.mjs): restore top-level `return { results }` as the Workflow result

The autonomous build changed it to `export default` to satisfy `node --check`,
but Workflow scripts run in an async wrapper where top-level `return` is the
result contract (alongside `export const meta`). `export default` would be a
dead module export and the per-module result summary would be lost.
Showing 1 changed file with 4 additions and 4 deletions
workflows/coding.mjs
@@ -470,7 +470,7 @@ for (const module of todo) { @@ -470,7 +470,7 @@ for (const module of todo) {
470 } 470 }
471 471
472 // Workflow 结果:跑完 / halt 的逐模块摘要。 472 // Workflow 结果:跑完 / halt 的逐模块摘要。
473 -// 注:plan 骨架原文是顶层 `return { results }`;裸 top-level return 在独立 ESM 模块下  
474 -// 无法通过 `node --check`(Illegal return statement),故改为 `export default`——  
475 -// Workflow 运行时读取模块的默认导出作为结果,语义等价、结构其余部分与骨架逐行一致。  
476 -export default { results } 473 +// 注:Workflow 运行时在异步包装上下文中执行脚本体,顶层 `return` 即为结果(与 `export const meta`
  474 +// 并存)。这是 Workflow 脚本的契约,**不是**独立 ESM 模块——因此 `node --check` 会报 Illegal
  475 +// return statement,但运行时正确(不要据 node --check 改成 export default,那会让结果丢失)。
  476 +return { results }