superlab 0.1.32 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/i18n.cjs CHANGED
@@ -387,10 +387,13 @@ const ZH_SKILL_FILES = {
387
387
  - 为什么我们的想法优于现有方法
388
388
  - 用白话解释我们准备怎么做
389
389
  - 三个一眼就有意义的点
390
- - 第一轮脑暴:先列 2-4 个候选方向
390
+ - 第一轮脑暴:先列 3-4 个候选方向
391
+ - 每个候选方向都要讲清:它是什么、为什么值得研究、大致怎么做、解决了什么问题、主要风险是什么
391
392
  - 第一轮文献检索:每个方向补 3-5 篇最接近前作
392
393
  - 第二轮脑暴:收敛到 1-2 个幸存方向
394
+ - 第二轮脑暴还要讲清:为什么保留这些方向、为什么淘汰其他方向、为什么当前推荐项更强
393
395
  - 第二轮文献检索:把幸存方向扩展成完整文献范围包
396
+ - 用于最终推荐的文献摘要:明确写出最接近前作、近期强相关论文,以及现有工作仍未解决什么
394
397
  - 文献范围包,默认目标约 20 篇来源;如果领域太窄不足 20 篇,必须明确解释
395
398
  - idea 来源清单:记录两轮检索实际用到的查询、来源分桶和最终来源数
396
399
  - 进入 \`/lab:spec\` 前的 approval gate
@@ -400,11 +403,16 @@ const ZH_SKILL_FILES = {
400
403
  ## Evidence Discipline
401
404
 
402
405
  - 明确区分来源事实与生成假设。
406
+ - 显式调用 \`/lab:idea\` 时,默认就是一次完整重跑;即使用户说“根据现有 idea 重组一下”,也不能自动跳过两轮文献检索。
407
+ - 只有当用户明确要求“只重写或重组现有 idea 文档,不重新检索”时,才允许进入 rewrite-only 模式。
408
+ - rewrite-only 模式只能改善结构和可读性,不能改变推荐结论、paper fit 判断、收敛状态或 canonical context;并且必须明确说明这一轮仍未收敛,因为两轮文献检索没有重跑。
403
409
  - 在谈 novelty 前先做文献范围梳理。默认目标是约 20 篇来源,覆盖最接近前作、近期强相关论文、benchmark 或评测论文、survey 或 taxonomy,以及必要的相邻领域工作。
404
410
  - 必须维护单独的 idea 来源清单,把两轮检索真正使用过的查询、来源分桶和最终来源数记下来。
405
411
  - 第一轮脑暴只负责打开空间,不负责直接下 novelty 结论。
412
+ - 第一轮脑暴至少覆盖三个候选方向,并为每个方向写清楚核心理由。
406
413
  - 第一轮文献检索负责快速淘汰撞题或没有缺口的方向。
407
414
  - 第二轮脑暴必须明确哪些方向被保留、哪些被否掉、为什么。
415
+ - 最终推荐前要有一个用户可见的文献摘要,而不是只把来源藏在 source log 里。
408
416
  - 第二轮文献检索完成前,不要把方向写成最终 paper fit 或 final recommendation。
409
417
  - 如果真实领域过窄,达不到默认数量,也必须把原因写清楚,而不是静默跳过。
410
418
  - \`idea\` 工件必须跟随仓库的 \`workflow_language\`,不能自己换成别的语言。
@@ -456,6 +464,7 @@ const ZH_SKILL_FILES = {
456
464
  - 第一轮脑暴先开方向,不要急着写成最终答案。
457
465
  - 第一轮文献检索后再收敛方向,不要跳过中间筛选。
458
466
  - 第二轮文献检索前,不要把方向说成已经有 paper fit。
467
+ - 只有用户明确要求 rewrite-only 时,才允许只改已有 idea 文档的结构;否则显式 \`/lab:idea\` 请求一律按完整 stage 重跑。
459
468
  - 现有方法对照必须显式写出,不能只说“更创新”。
460
469
  - 不要只说“比现有方法更好”;要说清楚现有方法在做什么、为什么不够、我们的方向大致怎么做。
461
470
  - 不要在没有文献范围包和最接近前作对照的情况下直接下 novelty 判断。
@@ -463,6 +472,7 @@ const ZH_SKILL_FILES = {
463
472
  - 不要把 idea 工件本身当成唯一证据记录;两轮文献检索的查询、来源分桶和最终来源数必须同步记到 \`.lab/writing/idea-source-log.md\`。
464
473
  - 三个 meaningful points 每个都控制在一句直接的话里。
465
474
  - 在批准前,必须运行 \`.lab/.managed/scripts/validate_idea_artifact.py --idea <idea-artifact> --source-log .lab/writing/idea-source-log.md --workflow-config .lab/config/workflow.json\`。
475
+ - rewrite-only 模式下不能更新 \`.lab/context/mission.md\`、\`.lab/context/decisions.md\` 或 \`.lab/context/open-questions.md\`。
466
476
  `,
467
477
  [path.join(".codex", "skills", "lab", "references", "workflow.md")]:
468
478
  `# /lab 工作流参考
@@ -1881,6 +1891,8 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "write.md")] = `# \`/l
1881
1891
  - 如果当前是最终导出或最终定稿轮次,且 \`workflow_language\` 与 \`paper_language\` 不一致、\`paper_language_finalization_decision\` 还是 \`unconfirmed\`,就必须追问一次:保持当前 workflow language,还是把最终稿转换成 \`paper_language\`。
1882
1892
  - 如果用户选择保持当前 workflow language,就把 \`paper_language_finalization_decision\` 持久化成 \`keep-workflow-language\`。
1883
1893
  - 如果用户选择转换成最终论文语言,就把 \`paper_language_finalization_decision\` 持久化成 \`convert-to-paper-language\`。
1894
+ - 如果 \`workflow_language\` 与 \`paper_language\` 不一致,就不要在确认前先把最终论文正文改写成 \`paper_language\`;必须先追问、再持久化、再改稿。
1895
+ - 如果 \`workflow_language\` 与 \`paper_language\` 不一致,就要在最新 write iteration artifact 里记录工作流语言、论文语言、最终语言决定,以及为什么这样决定。
1884
1896
  - 如果 \`paper_language_finalization_decision\` 是 \`convert-to-paper-language\`,在接受最终定稿前必须把最终稿转换到 \`paper_language\`。
1885
1897
  - 只加载当前 section guide,不要一次加载全部章节参考。
1886
1898
  - 如果当前 section 是 \`abstract\`、\`introduction\` 或 \`method\`,还必须继续读取本地 example bank:\`references/paper-writing/examples/index.md\`、对应的 examples index,以及 1-2 个具体 example 文件。
@@ -1909,6 +1921,7 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "write.md")] = `# \`/l
1909
1921
  - 最终定稿或导出轮次结束前,必须先通过 \`.lab/.managed/scripts/validate_section_draft.py --section <section> --section-file <section-file> --mode final\` 和 \`.lab/.managed/scripts/validate_paper_claims.py --section-file <section-file> --mode final\`。
1910
1922
  - 如果最终轮次的 section 或 claim 校验失败,就继续改正文;不能因为资产齐全就停下。
1911
1923
  - 在最终定稿或导出轮次结束前,必须运行 \`.lab/.managed/scripts/validate_manuscript_delivery.py --paper-dir <deliverables_root>/paper\`;如果失败,就继续补表、图、引用和正文。
1924
+ - 如果 \`workflow_language\` 与 \`paper_language\` 不一致,\`validate_manuscript_delivery.py\` 还会检查最新 write iteration 里是否存在语言决策审计;缺这块就不能算最终稿合格。
1912
1925
  - 如果本地有 LaTeX 工具链,就再跑一次 compile smoke test;如果没有,也要在 write iteration artifact 里记录该限制。
1913
1926
  - 如果缺少 framing artifact,不要继续写作,直接回到 \`/lab:framing\`。
1914
1927
  - 如果某个 claim 没有证据支撑,就削弱或删除。
@@ -2617,6 +2630,8 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "auto.md")] = `# \`/la
2617
2630
  - 如果当前写作目标是最终导出、\`workflow_language\` 与 \`paper_language\` 不一致,且 \`paper_language_finalization_decision\` 还是 \`unconfirmed\`,就在最终定稿前追问一次:保持当前 workflow language,还是转换成 \`paper_language\`
2618
2631
  - 如果用户选择保持当前语言,就持久化 \`paper_language_finalization_decision: keep-workflow-language\`
2619
2632
  - 如果用户选择转换,就持久化 \`paper_language_finalization_decision: convert-to-paper-language\`
2633
+ - 如果当前写作目标是最终导出,且语言不一致,就不要在追问前先把最终论文正文改成 \`paper_language\`;先问、先持久化,再改稿
2634
+ - 如果当前写作目标是最终导出,且语言不一致,就在最新 write iteration 里记录语言决策审计:工作流语言、论文语言、最终语言决定,以及为什么这样决定
2620
2635
  - 不要把 \`sleep 30\`、单次 \`pgrep\` 或一次性的 \`metrics.json\` 探针当成 rung 主命令;这些只能算进度检查。
2621
2636
  - 当真实实验进程还活着时,只允许发进度更新并继续等待,不能把这一 rung 当作已经完成。
2622
2637
  `;
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "stage_prompt": {
3
- "codex_en": "This command runs the `/lab:idea` stage. Use `.codex/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. Start with brainstorm pass 1 over 2-4 candidate directions, run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.",
4
- "claude_en": "This command runs the `idea` stage of the lab workflow. Use `.claude/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. Start with brainstorm pass 1 over 2-4 candidate directions, run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.",
5
- "codex_zh": "本命令运行 `/lab:idea` 阶段。把 `.codex/skills/lab/stages/idea.md` 当成两轮脑暴、两轮文献检索、最接近前作对照、source-backed proposal memo、评测草图、暂定贡献、用户引导、最小可行实验、收敛状态和 approval gate 的单一来源。先做第一轮脑暴,产出 2-4 个候选方向;再做第一轮文献检索,为每个方向补最接近前作;然后用第二轮脑暴淘汰或收敛方向;最后做第二轮文献检索,补齐最终来源包,再输出协作者可读的推荐结论。任何 final recommendation、paper fit 判断或 mission 写回之前,都必须先 materialize or update `.lab/writing/idea.md` 和 `.lab/writing/idea-source-log.md`。不要以纯聊天脑暴收尾;如果当前还没收敛,就明确写出还缺什么,并停在未收敛状态。最终 idea memo 必须讲清真实场景、解决了什么问题、现有方法为什么不够、准备怎么做、大致怎么评、暂定贡献是什么、哪些部分已经 source-backed、哪些还只是 hypothesis,以及用户下一步该决定什么。`.lab/writing/idea-source-log.md` 必须和两轮检索实际用到的查询、来源分桶和最终来源数保持一致。文献来源包默认目标约 20 篇;如果领域确实很窄,必须显式解释为什么合理地低于这个目标。只有在 `.lab/.managed/scripts/validate_idea_artifact.py` 通过之后,才可以把最终推荐当成已收敛结论输出。",
6
- "claude_zh": "本命令运行 lab workflow 的 `idea` 阶段。把 `.claude/skills/lab/stages/idea.md` 当成两轮脑暴、两轮文献检索、最接近前作对照、source-backed proposal memo、评测草图、暂定贡献、用户引导、最小可行实验、收敛状态和 approval gate 的单一来源。先做第一轮脑暴,产出 2-4 个候选方向;再做第一轮文献检索,为每个方向补最接近前作;然后用第二轮脑暴淘汰或收敛方向;最后做第二轮文献检索,补齐最终来源包,再输出协作者可读的推荐结论。任何 final recommendation、paper fit 判断或 mission 写回之前,都必须先 materialize or update `.lab/writing/idea.md` 和 `.lab/writing/idea-source-log.md`。不要以纯聊天脑暴收尾;如果当前还没收敛,就明确写出还缺什么,并停在未收敛状态。最终 idea memo 必须讲清真实场景、解决了什么问题、现有方法为什么不够、准备怎么做、大致怎么评、暂定贡献是什么、哪些部分已经 source-backed、哪些还只是 hypothesis,以及用户下一步该决定什么。`.lab/writing/idea-source-log.md` 必须和两轮检索实际用到的查询、来源分桶和最终来源数保持一致。文献来源包默认目标约 20 篇;如果领域确实很窄,必须显式解释为什么合理地低于这个目标。只有在 `.lab/.managed/scripts/validate_idea_artifact.py` 通过之后,才可以把最终推荐当成已收敛结论输出。"
3
+ "codex_en": "This command runs the `/lab:idea` stage. Use `.codex/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. An explicit `/lab:idea` request defaults to a full-stage rerun, even if the user asks to reorganize or rewrite an existing idea memo. Only switch to rewrite-only mode when the user explicitly asks to only reorganize or rewrite the existing idea artifact without new searching. Rewrite-only mode may improve structure or readability, but it must not change the recommendation, paper-fit judgment, convergence status, or canonical context; it must say that the stage remains unconverged because the literature sweeps were not rerun. Start with brainstorm pass 1 over 3-4 candidate directions. For each candidate direction, explain what it is, why it matters, roughly how it would work, what problem it solves, and its main risk. Run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2 to 1-2 surviving directions, explain why each survivor remains, why each rejected direction was dropped, and why the narrowed recommendation is stronger now, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. It must also include a user-visible literature summary naming the closest prior found, the recent strong papers found, and what existing work still does not solve. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.",
4
+ "claude_en": "This command runs the `idea` stage of the lab workflow. Use `.claude/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. An explicit `/lab:idea` request defaults to a full-stage rerun, even if the user asks to reorganize or rewrite an existing idea memo. Only switch to rewrite-only mode when the user explicitly asks to only reorganize or rewrite the existing idea artifact without new searching. Rewrite-only mode may improve structure or readability, but it must not change the recommendation, paper-fit judgment, convergence status, or canonical context; it must say that the stage remains unconverged because the literature sweeps were not rerun. Start with brainstorm pass 1 over 3-4 candidate directions. For each candidate direction, explain what it is, why it matters, roughly how it would work, what problem it solves, and its main risk. Run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2 to 1-2 surviving directions, explain why each survivor remains, why each rejected direction was dropped, and why the narrowed recommendation is stronger now, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. It must also include a user-visible literature summary naming the closest prior found, the recent strong papers found, and what existing work still does not solve. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.",
5
+ "codex_zh": "本命令运行 `/lab:idea` 阶段。把 `.codex/skills/lab/stages/idea.md` 当成两轮脑暴、两轮文献检索、最接近前作对照、source-backed proposal memo、评测草图、暂定贡献、用户引导、最小可行实验、收敛状态和 approval gate 的单一来源。显式调用 `/lab:idea` 时,默认就是一次完整重跑,即使用户说的是“根据现有 idea 重组一下”也一样。只有当用户明确要求“只重写或重组现有 idea 文档,不重新检索”时,才允许进入 rewrite-only 模式。rewrite-only 模式只能改结构和可读性,不能改变推荐结论、paper fit 判断、收敛状态或 canonical context,并且必须明确说明:由于没有重跑文献检索,这一轮仍然处于未收敛状态。先做第一轮脑暴,产出 3-4 个候选方向。每个候选方向都要说明:它是什么、为什么值得研究、大致怎么做、解决了什么问题、主要风险是什么。再做第一轮文献检索,为每个方向补最接近前作;然后用第二轮脑暴把范围收敛到 1-2 个幸存方向,并写清每个幸存方向为什么保留、每个被淘汰方向为什么淘汰、为什么当前 narrowed recommendation 更强;最后做第二轮文献检索,补齐最终来源包,再输出协作者可读的推荐结论。任何 final recommendation、paper fit 判断或 mission 写回之前,都必须先 materialize or update `.lab/writing/idea.md` 和 `.lab/writing/idea-source-log.md`。不要以纯聊天脑暴收尾;如果当前还没收敛,就明确写出还缺什么,并停在未收敛状态。最终 idea memo 必须讲清真实场景、解决了什么问题、现有方法为什么不够、准备怎么做、大致怎么评、暂定贡献是什么、哪些部分已经 source-backed、哪些还只是 hypothesis,以及用户下一步该决定什么。它还必须包含一个用户可见的文献摘要,明确写出:找到的最接近前作、找到的近期强相关论文、以及现有工作仍未解决什么。`.lab/writing/idea-source-log.md` 必须和两轮检索实际用到的查询、来源分桶和最终来源数保持一致。文献来源包默认目标约 20 篇;如果领域确实很窄,必须显式解释为什么合理地低于这个目标。只有在 `.lab/.managed/scripts/validate_idea_artifact.py` 通过之后,才可以把最终推荐当成已收敛结论输出。",
6
+ "claude_zh": "本命令运行 lab workflow 的 `idea` 阶段。把 `.claude/skills/lab/stages/idea.md` 当成两轮脑暴、两轮文献检索、最接近前作对照、source-backed proposal memo、评测草图、暂定贡献、用户引导、最小可行实验、收敛状态和 approval gate 的单一来源。显式调用 `/lab:idea` 时,默认就是一次完整重跑,即使用户说的是“根据现有 idea 重组一下”也一样。只有当用户明确要求“只重写或重组现有 idea 文档,不重新检索”时,才允许进入 rewrite-only 模式。rewrite-only 模式只能改结构和可读性,不能改变推荐结论、paper fit 判断、收敛状态或 canonical context,并且必须明确说明:由于没有重跑文献检索,这一轮仍然处于未收敛状态。先做第一轮脑暴,产出 3-4 个候选方向。每个候选方向都要说明:它是什么、为什么值得研究、大致怎么做、解决了什么问题、主要风险是什么。再做第一轮文献检索,为每个方向补最接近前作;然后用第二轮脑暴把范围收敛到 1-2 个幸存方向,并写清每个幸存方向为什么保留、每个被淘汰方向为什么淘汰、为什么当前 narrowed recommendation 更强;最后做第二轮文献检索,补齐最终来源包,再输出协作者可读的推荐结论。任何 final recommendation、paper fit 判断或 mission 写回之前,都必须先 materialize or update `.lab/writing/idea.md` 和 `.lab/writing/idea-source-log.md`。不要以纯聊天脑暴收尾;如果当前还没收敛,就明确写出还缺什么,并停在未收敛状态。最终 idea memo 必须讲清真实场景、解决了什么问题、现有方法为什么不够、准备怎么做、大致怎么评、暂定贡献是什么、哪些部分已经 source-backed、哪些还只是 hypothesis,以及用户下一步该决定什么。它还必须包含一个用户可见的文献摘要,明确写出:找到的最接近前作、找到的近期强相关论文、以及现有工作仍未解决什么。`.lab/writing/idea-source-log.md` 必须和两轮检索实际用到的查询、来源分桶和最终来源数保持一致。文献来源包默认目标约 20 篇;如果领域确实很窄,必须显式解释为什么合理地低于这个目标。只有在 `.lab/.managed/scripts/validate_idea_artifact.py` 通过之后,才可以把最终推荐当成已收敛结论输出。"
7
7
  }
8
8
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "stage_prompt": {
3
- "codex_en": "This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`.",
4
- "claude_en": "This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`.",
5
- "codex_zh": "本命令运行 `/lab:write` 阶段。把 `.codex/skills/lab/stages/write.md` 当成模板选择、paper-plan、section 参考、校验 gate、资产覆盖和最终 manuscript 规则的单一来源。读取与当前 section 对应的 paper-writing reference 和 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`。如果当前稿件将从托管默认 scaffold 开始,且还没有模板决定,就先追问一次:继续使用默认 scaffold,还是先接入模板目录。如果进入最终定稿时 `workflow_language` 与 `paper_language` 不一致,就再追问一次:保持当前语言,还是把最终稿转换成 `paper_language`。",
6
- "claude_zh": "本命令运行 lab workflow 的 `write` 阶段。把 `.claude/skills/lab/stages/write.md` 当成模板选择、paper-plan、section 参考、校验 gate、资产覆盖和最终 manuscript 规则的单一来源。读取与当前 section 对应的 paper-writing reference 和 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`。如果当前稿件将从托管默认 scaffold 开始,且还没有模板决定,就先追问一次:继续使用默认 scaffold,还是先接入模板目录。如果进入最终定稿时 `workflow_language` 与 `paper_language` 不一致,就再追问一次:保持当前语言,还是把最终稿转换成 `paper_language`。"
3
+ "codex_en": "This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`, persist that answer, record the language decision in the latest write iteration, and only then edit the final manuscript in the chosen language.",
4
+ "claude_en": "This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`, persist that answer, record the language decision in the latest write iteration, and only then edit the final manuscript in the chosen language.",
5
+ "codex_zh": "本命令运行 `/lab:write` 阶段。把 `.codex/skills/lab/stages/write.md` 当成模板选择、paper-plan、section 参考、校验 gate、资产覆盖和最终 manuscript 规则的单一来源。读取与当前 section 对应的 paper-writing reference 和 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`。如果当前稿件将从托管默认 scaffold 开始,且还没有模板决定,就先追问一次:继续使用默认 scaffold,还是先接入模板目录。如果进入最终定稿时 `workflow_language` 与 `paper_language` 不一致,就再追问一次:保持当前语言,还是把最终稿转换成 `paper_language`;先持久化这个决定,再在最新 write iteration 里记录语言决策,最后才允许按该语言修改最终稿。",
6
+ "claude_zh": "本命令运行 lab workflow 的 `write` 阶段。把 `.claude/skills/lab/stages/write.md` 当成模板选择、paper-plan、section 参考、校验 gate、资产覆盖和最终 manuscript 规则的单一来源。读取与当前 section 对应的 paper-writing reference 和 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`。如果当前稿件将从托管默认 scaffold 开始,且还没有模板决定,就先追问一次:继续使用默认 scaffold,还是先接入模板目录。如果进入最终定稿时 `workflow_language` 与 `paper_language` 不一致,就再追问一次:保持当前语言,还是把最终稿转换成 `paper_language`;先持久化这个决定,再在最新 write iteration 里记录语言决策,最后才允许按该语言修改最终稿。"
7
7
  }
8
8
  }
@@ -7,4 +7,4 @@ argument-hint: idea or research problem
7
7
  Use the installed `lab` skill at `.claude/skills/lab/SKILL.md`.
8
8
 
9
9
  Execute the requested `/lab-idea` command against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
10
- This command runs the `idea` stage of the lab workflow. Use `.claude/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. Start with brainstorm pass 1 over 2-4 candidate directions, run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.
10
+ This command runs the `idea` stage of the lab workflow. Use `.claude/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. An explicit `/lab:idea` request defaults to a full-stage rerun, even if the user asks to reorganize or rewrite an existing idea memo. Only switch to rewrite-only mode when the user explicitly asks to only reorganize or rewrite the existing idea artifact without new searching. Rewrite-only mode may improve structure or readability, but it must not change the recommendation, paper-fit judgment, convergence status, or canonical context; it must say that the stage remains unconverged because the literature sweeps were not rerun. Start with brainstorm pass 1 over 3-4 candidate directions. For each candidate direction, explain what it is, why it matters, roughly how it would work, what problem it solves, and its main risk. Run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2 to 1-2 surviving directions, explain why each survivor remains, why each rejected direction was dropped, and why the narrowed recommendation is stronger now, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. It must also include a user-visible literature summary naming the closest prior found, the recent strong papers found, and what existing work still does not solve. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.
@@ -7,4 +7,4 @@ argument-hint: section or writing target
7
7
  Use the installed `lab` skill at `.claude/skills/lab/SKILL.md`.
8
8
 
9
9
  Execute the requested `/lab-write` command against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
10
- This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`.
10
+ This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`, persist that answer, record the language decision in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -6,4 +6,4 @@ argument-hint: idea or research problem
6
6
  Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
7
7
 
8
8
  Execute the requested `/lab:idea` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
9
- This command runs the `/lab:idea` stage. Use `.codex/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. Start with brainstorm pass 1 over 2-4 candidate directions, run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.
9
+ This command runs the `/lab:idea` stage. Use `.codex/skills/lab/stages/idea.md` as the single source of truth for the two brainstorm passes, two literature sweeps, closest-prior comparison, source-backed proposal memo, evaluation sketch, tentative contributions, user guidance, minimum viable experiment, convergence status, and approval gate. An explicit `/lab:idea` request defaults to a full-stage rerun, even if the user asks to reorganize or rewrite an existing idea memo. Only switch to rewrite-only mode when the user explicitly asks to only reorganize or rewrite the existing idea artifact without new searching. Rewrite-only mode may improve structure or readability, but it must not change the recommendation, paper-fit judgment, convergence status, or canonical context; it must say that the stage remains unconverged because the literature sweeps were not rerun. Start with brainstorm pass 1 over 3-4 candidate directions. For each candidate direction, explain what it is, why it matters, roughly how it would work, what problem it solves, and its main risk. Run literature sweep 1 with real closest-prior references for each direction, narrow the field with brainstorm pass 2 to 1-2 surviving directions, explain why each survivor remains, why each rejected direction was dropped, and why the narrowed recommendation is stronger now, then run literature sweep 2 to build the final source bundle before producing a collaborator-readable recommendation. Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before any final recommendation, paper-fit judgment, or mission writeback. Do not end the stage with a chat-only brainstorm; if the work is still unconverged, say so explicitly, list what is still missing, and stop there. The final idea memo must explain the real-world scenario, the problem solved, why current methods fall short, roughly how the idea would work, how it would be evaluated, what the tentative contributions are, what is already source-backed, what is still hypothesis-only, and what the user should decide next. It must also include a user-visible literature summary naming the closest prior found, the recent strong papers found, and what existing work still does not solve. Keep `.lab/writing/idea-source-log.md` synchronized with the actual search queries, bucketed sources, and final source count used in both sweeps. The literature bundle should default to about 20 sources unless the field is genuinely narrow and that smaller bundle is explicitly justified. Only after `.lab/.managed/scripts/validate_idea_artifact.py` passes may the stage present a final recommendation as converged.
@@ -6,4 +6,4 @@ argument-hint: section or writing target
6
6
  Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
7
7
 
8
8
  Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
9
- This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`.
9
+ This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, ask once whether to keep the draft language or convert the final manuscript to `paper_language`, persist that answer, record the language decision in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -17,6 +17,10 @@ REQUIRED_SECTIONS = {
17
17
  "Closest Prior Work Comparison": [r"^##\s+Closest Prior Work Comparison\s*$", r"^##\s+最接近前作对照\s*$"],
18
18
  "Brainstorm Pass 2": [r"^##\s+Brainstorm Pass 2\s*$", r"^##\s+第二轮脑暴\s*$"],
19
19
  "Literature Sweep 2": [r"^##\s+Literature Sweep 2\s*$", r"^##\s+第二轮文献(?:检索|收敛)?\s*$"],
20
+ "Literature Summary for Recommendation": [
21
+ r"^##\s+Literature Summary for Recommendation\s*$",
22
+ r"^##\s+用于最终推荐的文献摘要\s*$",
23
+ ],
20
24
  "Rough Approach": [r"^##\s+Rough Approach\s*$", r"^##\s+我们准备怎么做\s*$"],
21
25
  "Problem Solved": [r"^##\s+Problem Solved\s*$", r"^##\s+解决了什么问题\s*$"],
22
26
  "Evaluation Sketch": [r"^##\s+Evaluation Sketch\s*$", r"^##\s+评测草图\s*$"],
@@ -28,6 +32,37 @@ REQUIRED_SECTIONS = {
28
32
  "User Guidance": [r"^##\s+User Guidance\s*$", r"^##\s+用户引导\s*$"],
29
33
  }
30
34
 
35
+ CANDIDATE_DIRECTION_STARTS = (
36
+ r"^-\s*Candidate direction \d+\s*[::]",
37
+ r"^-\s*候选方向 \d+\s*[::]",
38
+ )
39
+
40
+ SURVIVING_DIRECTION_STARTS = (
41
+ r"^-\s*Surviving direction \d+\s*[::]",
42
+ r"^-\s*幸存方向 \d+\s*[::]",
43
+ )
44
+
45
+ CANDIDATE_DIRECTION_FIELDS = {
46
+ "what it is": ("What it is", "是什么"),
47
+ "why it matters": ("Why it matters", "为什么重要", "为什么值得研究"),
48
+ "rough how": ("Rough how", "大致怎么做", "粗略做法"),
49
+ "problem solved": ("Problem solved", "解决了什么问题"),
50
+ "main risk": ("Main risk", "主要风险"),
51
+ }
52
+
53
+ SURVIVING_DIRECTION_FIELDS = {
54
+ "why it survived": ("Why it survived", "为什么保留", "为什么留下"),
55
+ }
56
+
57
+ LITERATURE_SUMMARY_FIELDS = {
58
+ "closest prior found": ("Closest prior found", "最接近前作"),
59
+ "recent strong papers found": ("Recent strong papers found", "近期强相关论文", "近期强论文"),
60
+ "what existing work still does not solve": (
61
+ "What existing work still does not solve",
62
+ "现有工作仍未解决什么",
63
+ ),
64
+ }
65
+
31
66
  SOURCE_LOG_SECTIONS = {
32
67
  "Search Intent": [r"^##\s+Search Intent\s*$", r"^##\s+检索意图\s*$"],
33
68
  "Sweep 1 Log": [r"^##\s+Sweep 1 Log\s*$", r"^##\s+第一轮检索记录\s*$"],
@@ -171,6 +206,34 @@ def extract_bucket_body(body: str, labels: tuple[str, ...]) -> str:
171
206
  return "\n".join(captured).strip()
172
207
 
173
208
 
209
+ def extract_labeled_blocks(body: str, start_patterns: tuple[str, ...]) -> list[str]:
210
+ lines = body.splitlines()
211
+ blocks: list[str] = []
212
+ current: list[str] = []
213
+ current_indent: int | None = None
214
+
215
+ for line in lines:
216
+ stripped = line.lstrip()
217
+ indent = len(line) - len(stripped)
218
+ is_start = any(re.match(pattern, stripped, flags=re.IGNORECASE) for pattern in start_patterns)
219
+ if is_start:
220
+ if current:
221
+ blocks.append("\n".join(current).strip())
222
+ current = [line]
223
+ current_indent = indent
224
+ continue
225
+ if current and stripped.startswith("- ") and current_indent is not None and indent <= current_indent:
226
+ blocks.append("\n".join(current).strip())
227
+ current = []
228
+ current_indent = None
229
+ if current:
230
+ current.append(line)
231
+
232
+ if current:
233
+ blocks.append("\n".join(current).strip())
234
+ return blocks
235
+
236
+
174
237
  def validate_content(text: str) -> list[str]:
175
238
  issues: list[str] = []
176
239
  scenario = extract_section_body(text, REQUIRED_SECTIONS["Scenario"])
@@ -188,6 +251,13 @@ def validate_content(text: str) -> list[str]:
188
251
  brainstorm_1 = extract_section_body(text, REQUIRED_SECTIONS["Brainstorm Pass 1"])
189
252
  if not contains_any(brainstorm_1, ("candidate direction", "候选方向", "worth checking", "值得检查")):
190
253
  issues.append("idea artifact is missing a real brainstorm pass 1 shortlist")
254
+ candidate_blocks = extract_labeled_blocks(brainstorm_1, CANDIDATE_DIRECTION_STARTS)
255
+ if len(candidate_blocks) < 3:
256
+ issues.append("idea artifact brainstorm pass 1 must include at least three candidate directions")
257
+ for index, block in enumerate(candidate_blocks[:3], start=1):
258
+ for field_name, labels in CANDIDATE_DIRECTION_FIELDS.items():
259
+ if not has_field_value(block, labels):
260
+ issues.append(f"idea artifact candidate direction {index} is missing {field_name}")
191
261
 
192
262
  sweep_1 = extract_section_body(text, REQUIRED_SECTIONS["Literature Sweep 1"])
193
263
  if count_references(sweep_1) < 3:
@@ -222,11 +292,36 @@ def validate_content(text: str) -> list[str]:
222
292
  brainstorm_2 = extract_section_body(text, REQUIRED_SECTIONS["Brainstorm Pass 2"])
223
293
  if not contains_any(brainstorm_2, ("surviving direction", "recommended narrowed direction", "surviving", "幸存方向", "推荐收敛方向", "淘汰")):
224
294
  issues.append("idea artifact is missing a real brainstorm pass 2 narrowing step")
295
+ surviving_blocks = extract_labeled_blocks(brainstorm_2, SURVIVING_DIRECTION_STARTS)
296
+ if not surviving_blocks:
297
+ issues.append("idea artifact brainstorm pass 2 must include at least one surviving direction")
298
+ if len(surviving_blocks) > 2:
299
+ issues.append("idea artifact brainstorm pass 2 must narrow to at most two surviving directions")
300
+ for index, block in enumerate(surviving_blocks, start=1):
301
+ for field_name, labels in SURVIVING_DIRECTION_FIELDS.items():
302
+ if not has_field_value(block, labels):
303
+ issues.append(f"idea artifact surviving direction {index} is missing {field_name}")
304
+ if not has_field_value(brainstorm_2, ("Rejected directions and why", "被淘汰的方向和原因")):
305
+ issues.append("idea artifact brainstorm pass 2 is missing rejected directions and why")
306
+ if not has_field_value(brainstorm_2, ("Recommended narrowed direction", "推荐收敛方向")):
307
+ issues.append("idea artifact brainstorm pass 2 is missing the recommended narrowed direction")
308
+ if not has_field_value(brainstorm_2, ("Why this is stronger now", "为什么它现在更强")):
309
+ issues.append("idea artifact brainstorm pass 2 is missing why the surviving recommendation is stronger now")
225
310
 
226
311
  sweep_2 = extract_section_body(text, REQUIRED_SECTIONS["Literature Sweep 2"])
227
312
  if count_references(sweep_2) < 5:
228
313
  issues.append("idea artifact is missing literature sweep 2 with real references")
229
314
 
315
+ literature_summary = extract_section_body(text, REQUIRED_SECTIONS["Literature Summary for Recommendation"])
316
+ if not literature_summary:
317
+ issues.append("idea artifact is missing a literature summary for recommendation")
318
+ else:
319
+ for field_name, labels in LITERATURE_SUMMARY_FIELDS.items():
320
+ if not has_field_value(literature_summary, labels):
321
+ issues.append(f"idea artifact literature summary for recommendation is missing {field_name}")
322
+ if count_references(literature_summary) < 2:
323
+ issues.append("idea artifact literature summary for recommendation is missing real references")
324
+
230
325
  rough_approach = extract_section_body(text, REQUIRED_SECTIONS["Rough Approach"])
231
326
  if not contains_any(rough_approach, ("plain-language", "how this would work", "粗略做法", "怎么做", "why this design", "为什么")):
232
327
  issues.append("idea artifact is missing a rough plain-language approach")
@@ -10,6 +10,9 @@ ABSOLUTE_PATH_MARKERS = ("/Users/", "/home/", "/tmp/", "/private/tmp/")
10
10
  REQUIRED_TABLE_FILES = ("main-results.tex", "ablations.tex")
11
11
  REQUIRED_FIGURE_FILES = ("problem-setting.tex", "method-overview.tex", "results-overview.tex")
12
12
  REF_PATTERN_TEMPLATE = r"\\(?:auto|c|C)?ref\{%s\}"
13
+ WRITE_ITERATION_LANGUAGE_SECTION = {
14
+ "Language Decision": (r"^##\s+Language Decision\s*$", r"^##\s+语言决策\s*$"),
15
+ }
13
16
 
14
17
 
15
18
  def parse_args():
@@ -38,6 +41,40 @@ def load_workflow_config(path: Path) -> dict:
38
41
  return json.loads(path.read_text(encoding="utf-8"))
39
42
 
40
43
 
44
+ def extract_section_body(text: str, patterns: tuple[str, ...]) -> str:
45
+ for pattern in patterns:
46
+ match = re.search(pattern, text, flags=re.MULTILINE)
47
+ if not match:
48
+ continue
49
+ start = match.end()
50
+ next_heading = re.search(r"^##\s+", text[start:], flags=re.MULTILINE)
51
+ end = start + next_heading.start() if next_heading else len(text)
52
+ return text[start:end].strip()
53
+ return ""
54
+
55
+
56
+ def has_field_value(body: str, labels: tuple[str, ...]) -> bool:
57
+ for label in labels:
58
+ pattern = re.compile(rf"^\s*(?:-|\d+\.)\s*{re.escape(label)}[::][ \t]*([^\n]+?)\s*$", flags=re.MULTILINE)
59
+ for match in pattern.finditer(body):
60
+ value = match.group(1).strip()
61
+ if value and value not in {"TBD", "TODO", "待补", "待定", "unclear"}:
62
+ return True
63
+ return False
64
+
65
+
66
+ def find_latest_write_iteration(paper_dir: Path) -> Path | None:
67
+ search_roots = [paper_dir, *paper_dir.parents]
68
+ for root in search_roots:
69
+ iterations_dir = root / ".lab" / "writing" / "iterations"
70
+ if not iterations_dir.exists():
71
+ continue
72
+ candidates = sorted(path for path in iterations_dir.glob("*.md") if path.is_file())
73
+ if candidates:
74
+ return candidates[-1]
75
+ return None
76
+
77
+
41
78
  def text_looks_like_language(text: str, language: str) -> bool:
42
79
  cjk_chars = len(re.findall(r"[\u4e00-\u9fff]", text))
43
80
  latin_chars = len(re.findall(r"[A-Za-z]", text))
@@ -276,6 +313,37 @@ def check_language_layers(paper_dir: Path, issues: list[str]):
276
313
  )
277
314
  return
278
315
 
316
+ latest_iteration = find_latest_write_iteration(paper_dir)
317
+ if latest_iteration is None:
318
+ issues.append(
319
+ "workflow_language and paper_language differ; record the language decision in the latest write iteration before finalizing the manuscript"
320
+ )
321
+ return
322
+
323
+ iteration_text = read_text(latest_iteration)
324
+ language_section = extract_section_body(iteration_text, WRITE_ITERATION_LANGUAGE_SECTION["Language Decision"])
325
+ if not language_section:
326
+ issues.append(
327
+ "latest write iteration is missing a language decision section for the final manuscript language choice"
328
+ )
329
+ else:
330
+ if not has_field_value(language_section, ("Workflow language", "workflow_language", "工作流语言")):
331
+ issues.append("latest write iteration is missing the workflow language in its language decision audit")
332
+ if not has_field_value(language_section, ("Paper language", "paper_language", "论文语言")):
333
+ issues.append("latest write iteration is missing the paper language in its language decision audit")
334
+ if not has_field_value(
335
+ language_section,
336
+ ("Finalization decision", "paper_language_finalization_decision", "最终语言决定"),
337
+ ):
338
+ issues.append("latest write iteration is missing the finalization decision in its language decision audit")
339
+ if not has_field_value(
340
+ language_section,
341
+ ("Why this decision was chosen", "Why this language was chosen", "为什么这样决定"),
342
+ ):
343
+ issues.append("latest write iteration is missing why the language decision was chosen")
344
+ if workflow_language == "zh" and not text_looks_like_language(iteration_text, workflow_language):
345
+ issues.append("latest write iteration should follow workflow_language=zh instead of drifting into another language")
346
+
279
347
  sections_dir = paper_dir / "sections"
280
348
  section_text = "\n".join(
281
349
  read_text(path) for path in sorted(sections_dir.glob("*.tex")) if path.is_file()
@@ -67,9 +67,29 @@ Suggested levels:
67
67
  ## Brainstorm Pass 1
68
68
 
69
69
  - Candidate direction 1:
70
+ - What it is:
71
+ - Why it matters:
72
+ - Rough how:
73
+ - Problem solved:
74
+ - Main risk:
70
75
  - Candidate direction 2:
76
+ - What it is:
77
+ - Why it matters:
78
+ - Rough how:
79
+ - Problem solved:
80
+ - Main risk:
71
81
  - Candidate direction 3:
82
+ - What it is:
83
+ - Why it matters:
84
+ - Rough how:
85
+ - Problem solved:
86
+ - Main risk:
72
87
  - Candidate direction 4:
88
+ - What it is:
89
+ - Why it matters:
90
+ - Rough how:
91
+ - Problem solved:
92
+ - Main risk:
73
93
  - Why these directions are worth checking:
74
94
 
75
95
  ## Literature Sweep 1
@@ -109,9 +129,12 @@ Suggested levels:
109
129
  ## Brainstorm Pass 2
110
130
 
111
131
  - Surviving direction 1:
132
+ - Why it survived:
112
133
  - Surviving direction 2:
134
+ - Why it survived:
113
135
  - Rejected directions and why:
114
136
  - Recommended narrowed direction:
137
+ - Why this is stronger now:
115
138
 
116
139
  ## Literature Sweep 2
117
140
 
@@ -121,6 +144,12 @@ Suggested levels:
121
144
  - Adjacent-field papers:
122
145
  - Final literature takeaway:
123
146
 
147
+ ## Literature Summary for Recommendation
148
+
149
+ - Closest prior found:
150
+ - Recent strong papers found:
151
+ - What existing work still does not solve:
152
+
124
153
  ## Why Ours Is Different
125
154
 
126
155
  - Existing methods rely on:
@@ -27,6 +27,13 @@
27
27
  - Terminology consistency:
28
28
  - Five-dimension self-review outcome:
29
29
 
30
+ ## Language Decision
31
+
32
+ - Workflow language:
33
+ - Paper language:
34
+ - Finalization decision:
35
+ - Why this decision was chosen:
36
+
30
37
  ## Decision
31
38
 
32
39
  - Continue or stop:
@@ -37,12 +37,17 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
37
37
  ### `/lab:idea`
38
38
 
39
39
  - Search relevant literature, baselines, datasets, and evaluation metrics before proposing a plan.
40
- - Start with brainstorm pass 1 over 2-4 candidate directions instead of locking the first idea immediately.
40
+ - Start with brainstorm pass 1 over 3-4 candidate directions instead of locking the first idea immediately.
41
+ - For each brainstorm pass 1 candidate direction, explain what it is, why it matters, roughly how it would work, what problem it solves, and its main risk.
41
42
  - Run literature sweep 1 with closest-prior references for each candidate direction before narrowing.
42
- - Use brainstorm pass 2 to keep only the strongest 1-2 directions and explain what was rejected.
43
+ - Use brainstorm pass 2 to keep only the strongest 1-2 directions, explain why each surviving direction remains, explain what was rejected, and say why the narrowed recommendation is stronger now.
43
44
  - Run literature sweep 2 before making a final recommendation or novelty claim.
45
+ - Include a user-visible literature summary that names the closest prior found, the recent strong papers found, and what existing work still does not solve before giving the final recommendation.
44
46
  - Build a literature-scoping bundle before claiming novelty. The default target is 20 relevant sources unless the field is genuinely too narrow and that exception is written down.
45
47
  - Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before giving any final recommendation, paper-fit judgment, or mission writeback.
48
+ - An explicit `/lab:idea` request defaults to a full-stage rerun, even if the user asks to reorganize or rewrite an existing idea memo.
49
+ - Only switch to rewrite-only mode when the user explicitly asks to only reorganize or rewrite the existing idea artifact without new searching.
50
+ - Rewrite-only mode may improve structure or readability, but it must not change the recommendation, paper-fit judgment, convergence status, or canonical context.
46
51
  - Read `.lab/context/mission.md` and `.lab/context/open-questions.md` before drafting.
47
52
  - Read `.lab/config/workflow.json` before drafting and follow its `workflow_language` for idea artifacts.
48
53
  - Ask one clarifying question at a time when critical ambiguity remains.
@@ -185,7 +190,9 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
185
190
  - Read `.lab/context/mission.md`, `.lab/context/decisions.md`, `.lab/context/evidence-index.md`, and `.lab/context/data-decisions.md` before drafting.
186
191
  - Write one paper section or one explicit subproblem per round.
187
192
  - Ordinary manuscript drafting rounds should follow `workflow_language`.
188
- - If `workflow_language` and `paper_language` differ, the first final-draft or export round must ask once whether to keep the draft language or convert the final manuscript to `paper_language`, then persist that choice.
193
+ - If `workflow_language` and `paper_language` differ, the first final-draft or export round must ask once whether to keep the draft language or convert the final manuscript to `paper_language`.
194
+ - When the languages differ, do not rewrite final manuscript sections in `paper_language` before that question has been answered; ask first, persist the choice, then edit the final manuscript in the chosen language.
195
+ - When the languages differ, record the workflow language, paper language, finalization decision, and why the decision was chosen in the latest write iteration artifact.
189
196
  - Bind each claim to evidence from `report`, iteration reports, or normalized summaries.
190
197
  - Use the write-stage contract in `.codex/skills/lab/stages/write.md` or `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section-specific references, validator calls, asset coverage, and final manuscript gates.
191
198
  - Use the vendored paper-writing references under `skills/lab/references/paper-writing/` and the matching example-bank files under `skills/lab/references/paper-writing/examples/`.
@@ -212,6 +219,7 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
212
219
  - No final report without validated normalized results.
213
220
  - No paper-writing round without stable report artifacts, an approved framing artifact, evidence links, and LaTeX manuscript output.
214
221
  - No final-draft or export round without passing section-quality, claim-safety, and manuscript-delivery validation.
222
+ - No final-draft or export round with mismatched `workflow_language` and `paper_language` unless the latest write iteration records the language decision audit that justified the final manuscript language.
215
223
 
216
224
  ## References
217
225
 
@@ -18,10 +18,13 @@
18
18
  - tentative contributions stated at idea level, not final paper-facing wording
19
19
  - convergence status that says what is already source-backed, what is still hypothesis-only, and whether the stage may end with a final recommendation
20
20
  - three meaningful points
21
- - brainstorm pass 1 with 2-4 candidate directions
21
+ - brainstorm pass 1 with 3-4 candidate directions
22
+ - each brainstorm pass 1 candidate direction explained with what it is, why it matters, rough how it would work, what problem it solves, and its main risk
22
23
  - literature sweep 1 with 3-5 closest-prior references per direction
23
24
  - brainstorm pass 2 that narrows to 1-2 surviving directions
25
+ - each brainstorm pass 2 surviving direction explained with why it survived, plus rejected directions and why, and why the narrowed recommendation is stronger now
24
26
  - literature sweep 2 that expands the surviving directions into the full source bundle
27
+ - literature summary for recommendation with closest prior found, recent strong papers found, and what existing work still does not solve
25
28
  - literature scoping bundle with a default target of 20 sources, or an explicit explanation for a smaller scoped field
26
29
  - literature-backed framing
27
30
  - sourced datasets and metrics
@@ -39,15 +42,22 @@
39
42
  - Mark sourced facts clearly.
40
43
  - Mark generated hypotheses clearly.
41
44
  - Do not merge them into one undifferentiated summary.
45
+ - An explicit `/lab:idea` request defaults to a full-stage rerun, even if the user asks to reorganize or rewrite an existing idea memo.
46
+ - Only switch to rewrite-only mode when the user explicitly asks to only reorganize or rewrite the existing idea artifact without new searching.
47
+ - Rewrite-only mode may improve structure or readability, but it must not change the recommendation, paper-fit judgment, convergence status, or canonical context. It must also say that the stage remains unconverged and that the literature sweeps were not rerun.
42
48
  - Ask one clarifying question at a time when a missing assumption would materially change the proposal.
43
49
  - Build a source bundle before claiming novelty. The default target is 20 relevant sources split across closest prior work, recent strong papers, benchmark or evaluation papers, surveys or taxonomies, and adjacent-field work when useful.
44
50
  - Treat closest prior work, recent strong papers, benchmark or evaluation papers, and survey or taxonomy papers as mandatory coverage buckets. Do not leave those buckets empty in the final source bundle.
45
51
  - Keep a separate idea source log that records the actual search queries, bucketed sources, and final source count for both literature sweeps.
46
52
  - Materialize or update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before giving any final recommendation, paper-fit judgment, or mission writeback.
47
53
  - Use the first brainstorm pass only to generate candidate directions. Treat it as hypothesis generation, not as a novelty judgment.
54
+ - Brainstorm pass 1 should cover at least three candidate directions before narrowing.
55
+ - For each brainstorm pass 1 candidate, explain what it is, why it matters, rough how it would work, what problem it solves, and its main risk.
48
56
  - After brainstorm pass 1, run a first literature sweep that gathers 3-5 closest-prior references per direction before narrowing the idea.
49
57
  - After literature sweep 1, run a second brainstorm pass that explicitly kills, merges, or narrows directions.
58
+ - Brainstorm pass 2 must narrow the field to one or two surviving directions, explain why each survived, explain why the others were rejected, and say why the narrowed recommendation is stronger now.
50
59
  - Only after literature sweep 2 may the artifact give a final recommendation, paper fit, or novelty claim.
60
+ - Before the final recommendation, add a user-visible literature summary that names the closest prior found, the recent strong papers found, and what existing work still does not solve.
51
61
  - Do not end the stage with a chat-only brainstorm. If only a brainstorm pass or literature sweep is complete, mark the stage as unconverged, list what is still missing, and stop without pretending that the idea has converged.
52
62
  - If the field is genuinely too narrow to support that target, say so explicitly in both the idea artifact and the idea source log, and justify the smaller literature bundle instead of silently skipping the search.
53
63
  - The idea artifact must follow the repository `workflow_language`, not whichever language is easiest locally.
@@ -88,22 +98,23 @@
88
98
  10. Closest-prior-work comparison
89
99
  11. Brainstorm pass 2
90
100
  12. Literature sweep 2
91
- 13. Rough approach in plain language
92
- 14. Problem solved in plain language
93
- 15. Why the proposed idea is better
94
- 16. Evaluation sketch
95
- 17. Tentative contributions
96
- 18. Three meaningful points
97
- 19. Candidate approaches and recommendation
98
- 20. Dataset, baseline, and metric candidates
99
- 21. Falsifiable hypothesis
100
- 22. Convergence status
101
- 23. Expert critique
102
- 24. Revised proposal or final recommendation
103
- 25. User guidance
104
- 26. Approval gate
105
- 27. Minimum viable experiment
106
- 28. Idea source log aligned with the two literature sweeps
101
+ 13. Literature summary for recommendation
102
+ 14. Rough approach in plain language
103
+ 15. Problem solved in plain language
104
+ 16. Why the proposed idea is better
105
+ 17. Evaluation sketch
106
+ 18. Tentative contributions
107
+ 19. Three meaningful points
108
+ 20. Candidate approaches and recommendation
109
+ 21. Dataset, baseline, and metric candidates
110
+ 22. Falsifiable hypothesis
111
+ 23. Convergence status
112
+ 24. Expert critique
113
+ 25. Revised proposal or final recommendation
114
+ 26. User guidance
115
+ 27. Approval gate
116
+ 28. Minimum viable experiment
117
+ 29. Idea source log aligned with the two literature sweeps
107
118
 
108
119
  ## Writing Standard
109
120
 
@@ -111,15 +122,18 @@
111
122
  - Explain the scenario, target user or beneficiary, and why the problem matters before talking about novelty.
112
123
  - State why the target problem matters before talking about the method.
113
124
  - Use brainstorm pass 1 to open the space, not to declare a winner.
125
+ - Give brainstorm pass 1 at least three candidate directions, and explain each one with what it is, why it matters, rough how it would work, what problem it solves, and its main risk.
114
126
  - Use literature sweep 1 to test candidate directions against real papers before narrowing them.
115
- - Use brainstorm pass 2 to explain what survived, what was rejected, and why.
127
+ - Use brainstorm pass 2 to explain what survived, why it survived, what was rejected, why it was rejected, and why the narrowed recommendation is stronger now.
116
128
  - Use literature sweep 2 to support the final recommendation with real references across the required buckets.
129
+ - Add a short literature summary for recommendation so the final output shows the closest prior found, the recent strong papers found, and what existing work still does not solve.
117
130
  - Compare against existing methods explicitly, not by vague novelty language.
118
131
  - Do not call something new without a literature-scoping bundle and a closest-prior comparison.
119
132
  - Do not call something paper-worthy or novel after only one brainstorm pass or one literature sweep.
120
133
  - Do not treat the idea artifact itself as the only evidence record; keep `.lab/writing/idea-source-log.md` synchronized with the actual searches and source buckets used in both literature sweeps.
121
134
  - Do not leave the working result only in chat. Update `.lab/writing/idea.md` and `.lab/writing/idea-source-log.md` before returning a stage conclusion.
122
135
  - Do not present a final recommendation, paper fit, or next-stage approval unless the working idea artifact is validator-clean and its convergence status says the stage is ready for that recommendation.
136
+ - Do not update `.lab/context/mission.md`, `.lab/context/decisions.md`, or `.lab/context/open-questions.md` from rewrite-only mode.
123
137
  - Explain what current methods do, why they fall short, and roughly how the proposed idea would work in plain language.
124
138
  - Explain what problem the idea actually solves before describing tentative contributions.
125
139
  - Keep the evaluation sketch high-level: who or what is evaluated, what proxy or simulator is used if any, what outcome matters, and what the main validity risk is. Leave full protocol design to later stages.
@@ -77,6 +77,7 @@ Run these on every round:
77
77
  - If the current round is a final manuscript export or final-draft pass, `paper_template_root` is still empty, `paper_template_decision` is `default-scaffold`, and `paper_template_final_reminder_acknowledged` is `false`, ask one final reminder question about switching to a template before finalizing.
78
78
  - If the user confirms staying on the default scaffold at that final reminder, persist `paper_template_final_reminder_acknowledged: true`.
79
79
  - If the current round is a final manuscript export or final-draft pass, `workflow_language` and `paper_language` differ, and `paper_language_finalization_decision` is `unconfirmed`, ask one explicit question before finalizing: keep the manuscript in `workflow_language`, or convert the final manuscript to `paper_language`.
80
+ - Do not rewrite final manuscript sections in `paper_language` before that question has been answered. Ask first, persist the answer, then edit the final manuscript.
80
81
  - If the user chooses to keep the draft language, persist `paper_language_finalization_decision: keep-workflow-language`.
81
82
  - If the user chooses to convert, persist `paper_language_finalization_decision: convert-to-paper-language`.
82
83
  - If `paper_language_finalization_decision` is `convert-to-paper-language`, the final manuscript output should be converted to `paper_language` before accepting the final round.
@@ -121,10 +122,11 @@ Run these on every round:
121
122
  - For final-draft or export rounds, run `.lab/.managed/scripts/validate_section_draft.py --section <section> --section-file <section-file> --mode final` and `.lab/.managed/scripts/validate_paper_claims.py --section-file <section-file> --mode final` before accepting the round.
122
123
  - If the final-round section or claim validators fail, keep editing the affected section until it passes; do not stop at asset-complete but rhetorically weak or unsafe prose.
123
124
  - Run `.lab/.managed/scripts/validate_manuscript_delivery.py --paper-dir <deliverables_root>/paper` before accepting a final-draft or export round.
124
- - The manuscript-delivery validator should fail if the core figures and tables are only inserted but never cited from section prose, or if final manuscript acceptance tries to bypass the one-time `paper_language_finalization_decision` gate when `workflow_language` and `paper_language` differ.
125
+ - The manuscript-delivery validator should fail if the core figures and tables are only inserted but never cited from section prose, if final manuscript acceptance tries to bypass the one-time `paper_language_finalization_decision` gate when `workflow_language` and `paper_language` differ, or if the latest write iteration does not audit that language decision.
125
126
  - If the manuscript validator fails, keep editing and asset generation until it passes; do not stop at prose-only completion.
126
127
  - Run a LaTeX compile smoke test when a local LaTeX toolchain is available; if not available, record the missing verification in the write iteration artifact.
127
128
  - Record what changed and why in a write-iteration artifact.
129
+ - When `workflow_language` and `paper_language` differ, record the final manuscript language choice in the write-iteration artifact with the workflow language, paper language, finalization decision, and why that decision was chosen.
128
130
  - Return paragraph-level roles for the revised prose when drafting.
129
131
  - Run the five-dimension self-review checklist before accepting a round.
130
132
  - Run reviewer-style checks after every round.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlab",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "Strict /lab research workflow installer for Codex and Claude",
5
5
  "keywords": [
6
6
  "codex",