superlab 0.1.59 → 0.1.61
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/README.md +5 -2
- package/lib/i18n.cjs +11 -3
- package/lib/lab_write_contract.json +4 -4
- package/package-assets/claude/commands/lab/write.md +1 -1
- package/package-assets/claude/commands/lab-write.md +1 -1
- package/package-assets/claude/commands/lab:write.md +1 -1
- package/package-assets/claude/commands/lab/357/274/232write.md +1 -1
- package/package-assets/codex/prompts/lab/write.md +1 -1
- package/package-assets/codex/prompts/lab-write.md +1 -1
- package/package-assets/codex/prompts/lab:write.md +1 -1
- package/package-assets/codex/prompts/lab/357/274/232write.md +1 -1
- package/package-assets/shared/lab/.managed/scripts/validate_manuscript_delivery.py +89 -0
- package/package-assets/shared/lab/.managed/scripts/validate_section_draft.py +98 -0
- package/package-assets/shared/lab/.managed/templates/write-iteration.md +8 -0
- package/package-assets/shared/skills/lab/SKILL.md +8 -2
- package/package-assets/shared/skills/lab/stages/write.md +17 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -329,8 +329,11 @@ If the user approves the default scaffold, persist that choice in `.lab/config/w
|
|
|
329
329
|
Ordinary manuscript drafting rounds should follow `workflow_language`.
|
|
330
330
|
If `workflow_language` and `paper_language` differ, `/lab:write` should preserve a full workflow-language paper layer first, then the first final-draft or export round should ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, then persist that decision.
|
|
331
331
|
The workflow-language paper layer is a real LaTeX mirror of the paper, not a review layer, and should stay persisted until it is explicitly refreshed.
|
|
332
|
-
|
|
333
|
-
|
|
332
|
+
When `workflow_language` and `paper_language` differ, ordinary `/lab:write` rounds should treat the workflow-language paper layer as the default working layer. Do not silently refresh both the canonical manuscript and the workflow-language paper layer on the same round unless the user explicitly asked for cross-language synchronization or the final-draft/export language-finalization step requires it.
|
|
333
|
+
Canonical-manuscript drafting is still allowed, but if workflow-language is active then canonical-only writing should record why that exception was acceptable in the latest write iteration artifact.
|
|
334
|
+
If `paper_language_finalization_decision=convert-to-paper-language`, canonical manuscript work may proceed in `paper_language` during explicit canonical or finalization rounds, but that does not make canonical the default next step while workflow-language remains active.
|
|
335
|
+
For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, the exported or pushed bundle should include the persisted workflow-language paper layer by default.
|
|
336
|
+
Canonical-only export is acceptable only when the user explicitly asked for it or when the remote target forbids extra files, and that justification should be recorded in the latest write iteration artifact.
|
|
334
337
|
Paper-facing tables must be locally interpretable: readers should be able to recover row meaning, column meaning, metric direction, and any relevant denominator or unit from the table title, note, and adjacent prose without chasing the Method section. Short headers are allowed, but abbreviations must be expanded locally in the same table.
|
|
335
338
|
Do not assume a fixed drafting order such as Method before Experiments. If a section needs to use canonical model, system, or ablation labels before the defining section has been drafted, add a short local naming bridge there and then reuse the canonical label instead of drifting into narrative aliases.
|
|
336
339
|
`/lab:write` now also applies a section-specific style policy for Abstract, Introduction, Related Work, Method, Experiments, and Conclusion. Each active section must follow its encouraged moves, avoid discouraged moves, and remove banned expressions before the round can be accepted.
|
package/lib/i18n.cjs
CHANGED
|
@@ -2026,9 +2026,11 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "write.md")] = `# \`/l
|
|
|
2026
2026
|
- 每轮只改一个 section 或一个明确子问题。
|
|
2027
2027
|
- 最终稿必须是 LaTeX。
|
|
2028
2028
|
- 普通起草轮次先跟随 \`workflow_language\`。
|
|
2029
|
-
-
|
|
2029
|
+
- 当 \`workflow_language\` 与 \`paper_language\` 不一致时,把 workflow-language 论文层当成普通写作轮次的默认工作层。
|
|
2030
|
+
- 普通写作轮次仍然只改一个目标层,不要静默同时刷新两种语言层。
|
|
2030
2031
|
- 如果用户明确点名了某个文件或层级,就把它当成当前轮次唯一目标,除非用户另外明确要求同步。
|
|
2031
|
-
- 如果
|
|
2032
|
+
- 如果 workflow-language 论文层现役而本轮仍然写 canonical manuscript,必须在 write iteration artifact 里说明为什么这次 canonical-only 写作是合理的。
|
|
2033
|
+
- 如果 \`paper_language_finalization_decision=convert-to-paper-language\`,显式的 canonical manuscript 工作可以直接落在 \`paper_language\`,但这并不意味着只要 workflow-language 仍然现役,canonical 就变成普通轮次的默认工作层。
|
|
2032
2034
|
- 把 workflow-language 论文层当成正式持久化产物,而不是 review 层。
|
|
2033
2035
|
- workflow-language 层必须是一套完整的 LaTeX 镜像,至少包含 \`workflow-language/main.tex\`、\`workflow-language/references.bib\`、\`workflow-language/sections/*.tex\`、\`workflow-language/tables/*.tex\`、\`workflow-language/figures/*.tex\` 和 \`workflow-language/analysis/analysis-asset.tex\`。
|
|
2034
2036
|
- 不要再把新的 workflow-language 输出写到已经废弃的 review 层路径,例如 \`docs/lab/paper/review_zh/\`。
|
|
@@ -2048,6 +2050,8 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "write.md")] = `# \`/l
|
|
|
2048
2050
|
- 如果 \`workflow_language\` 与 \`paper_language\` 不一致,就要在最新 write iteration artifact 里记录工作流语言、论文语言、最终语言决定、为什么这样决定,以及 workflow-language 论文层路径。
|
|
2049
2051
|
- 如果 \`paper_language_finalization_decision\` 是 \`convert-to-paper-language\`,在接受最终定稿前必须保留 workflow-language 论文层,并把 canonical manuscript 转换到 \`paper_language\`。
|
|
2050
2052
|
- 只有在用户明确要求跨语言同步,或者 final-draft/export 的语言最终定稿步骤确实要求两层一起刷新时,才允许同一轮同时修改 canonical manuscript 和 workflow-language 论文层。
|
|
2053
|
+
- 如果当前是导出或远程发布轮次,且 \`paper_language_finalization_decision=convert-to-paper-language\`,默认把 workflow-language 论文层一起带进导出的或推送的 bundle。
|
|
2054
|
+
- 只有在用户明确要求只导出 canonical,或者远程目标明确不允许附带额外文件时,才允许 canonical-only export,并且必须把理由写进 write iteration artifact。
|
|
2051
2055
|
- 把 \`.lab/writing/terminology-glossary.md\` 当成写作期 glossary,用来沉淀全称、批准缩写、对外解释和可接受别名;它和 \`.lab/context/terminology-lock.md\` 的职责不同,不能混用。
|
|
2052
2056
|
- 无论当前语言是什么,都要满足同一套学术可读性标准;如果本轮引入或改写了关键术语、缩写、指标名、机制名或系统标签,就在首次出现时顺手说明它是什么、为什么在这里重要。
|
|
2053
2057
|
- 第一次出现先写全称;如果后面要复用简称或缩写,就在首次出现时定义。
|
|
@@ -2897,14 +2901,18 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "auto.md")] = `# \`/la
|
|
|
2897
2901
|
- 如果用户在最终提醒里仍确认继续使用默认 scaffold,就持久化 \`paper_template_final_reminder_acknowledged: true\`
|
|
2898
2902
|
- 普通 \`write\` 起草轮次先跟随 \`workflow_language\`。
|
|
2899
2903
|
- 普通 \`write\` 起草轮次里的 manuscript 仍然是 LaTeX,所以普通 manuscript \`.tex\` sections 也必须先保留在 \`workflow_language\`,还不是 \`paper_language\` 版本。
|
|
2900
|
-
-
|
|
2904
|
+
- 当 \`workflow_language\` 与 \`paper_language\` 不一致时,把 workflow-language 论文层当成普通写作轮次的默认工作层。
|
|
2905
|
+
- 普通写作轮次仍然只改一个目标层,不要在没有明确要求的情况下同时刷新 canonical manuscript 和 workflow-language 论文层。
|
|
2901
2906
|
- 把 workflow-language 论文层当成正式持久化产物,而不是 review 层。
|
|
2907
|
+
- 如果 workflow-language 论文层现役而本轮仍然写 canonical manuscript,必须在最新 write iteration 里说明为什么这次 canonical-only 写作是合理的。
|
|
2902
2908
|
- 如果当前写作目标是最终导出、\`workflow_language\` 与 \`paper_language\` 不一致,且 \`paper_language_finalization_decision\` 还是 \`unconfirmed\`,就在最终定稿前先完成并保留 workflow-language 论文层,再追问一次:保持当前 workflow language,还是转换成 \`paper_language\`
|
|
2903
2909
|
- 如果用户选择保持当前语言,就持久化 \`paper_language_finalization_decision: keep-workflow-language\`
|
|
2904
2910
|
- 如果用户选择转换,就持久化 \`paper_language_finalization_decision: convert-to-paper-language\`
|
|
2905
2911
|
- 如果当前写作目标是最终导出,且语言不一致,就不要在追问前先把最终论文正文改成 \`paper_language\`;先问、先持久化,再改稿
|
|
2906
2912
|
- 如果当前写作目标是最终导出,且语言不一致,就在最新 write iteration 里记录语言决策审计:工作流语言、论文语言、最终语言决定、为什么这样决定,以及 workflow-language 论文层路径
|
|
2907
2913
|
- 只有在用户明确要求跨语言同步,或者 final-draft/export 的语言最终定稿步骤确实要求两层一起刷新时,才允许同一轮同时修改 canonical manuscript 和 workflow-language 论文层
|
|
2914
|
+
- 如果当前是导出或远程发布轮次,且 \`paper_language_finalization_decision=convert-to-paper-language\`,默认把 workflow-language 论文层一起带进导出的或推送的 bundle
|
|
2915
|
+
- 只有在用户明确要求只导出 canonical,或者远程目标明确不允许附带额外文件时,才允许 canonical-only export,并且必须把理由写进最新 write iteration
|
|
2908
2916
|
- 把 \`.lab/writing/terminology-glossary.md\` 当成写作期 glossary,用来沉淀全称、批准缩写、对外解释和可接受别名
|
|
2909
2917
|
- 当循环推进 \`write\` 时,无论 workflow language 还是 paper language,都要满足同一套学术可读性标准;如果本轮引入或改写了关键术语、缩写、指标名、机制名或系统标签,就在首次出现时说明它是什么、为什么在这里重要
|
|
2910
2918
|
- 当循环推进 \`write\` 时,第一次出现先写全称;如果后面要复用简称或缩写,就在首次出现时定义;一个概念只保留一个 paper-facing 名称,并尽量避免新造的连字符拼接标签
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
5
|
-
"codex_zh": "本命令运行 `/lab:write` 阶段。把 `.codex/skills/lab/stages/write.md` 当成模板选择、paper-plan、section 参考、校验 gate、资产覆盖和最终 manuscript 规则的单一来源。读取与当前 section 对应的 paper-writing reference、`section-style-policies.md` 里与当前 section 对应的风格块,以及 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`,普通 `.tex` section 草稿也必须先停留在 `workflow_language`,不能把 `paper_language` 当成默认草稿语言,并把 workflow-language 论文层当成正式持久化产物,而不是 review
|
|
6
|
-
"claude_zh": "本命令运行 lab workflow 的 `write` 阶段。把 `.claude/skills/lab/stages/write.md` 当成模板选择、paper-plan、section 参考、校验 gate、资产覆盖和最终 manuscript 规则的单一来源。读取与当前 section 对应的 paper-writing reference、`section-style-policies.md` 里与当前 section 对应的风格块,以及 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`,普通 `.tex` section 草稿也必须先停留在 `workflow_language`,不能把 `paper_language` 当成默认草稿语言,并把 workflow-language 论文层当成正式持久化产物,而不是 review
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\\resizebox{\\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\\tabcolsep` conservatively; only use `\\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\\scriptsize` or `\\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path 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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\\resizebox{\\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\\tabcolsep` conservatively; only use `\\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\\scriptsize` or `\\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path 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、`section-style-policies.md` 里与当前 section 对应的风格块,以及 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`,普通 `.tex` section 草稿也必须先停留在 `workflow_language`,不能把 `paper_language` 当成默认草稿语言,并把 workflow-language 论文层当成正式持久化产物,而不是 review 层。当 `workflow_language` 与 `paper_language` 不一致时,把 workflow-language 论文层当成普通写作轮次的默认工作层。普通写作轮次仍然只改一个目标层,不要静默同时刷新两种语言层。如果用户明确点名了某个文件或层级,就把它当成当前轮次唯一目标,除非用户另外明确要求同步。如果 workflow-language 论文层现役而本轮仍然写 canonical manuscript,必须在 write iteration artifact 里说明为什么这次 canonical-only 写作是合理的。如果 `paper_language_finalization_decision=convert-to-paper-language`,显式的 canonical manuscript 工作可以直接落在 `paper_language`,但这并不意味着只要 workflow-language 仍然现役,canonical 就变成普通轮次的默认工作层。workflow-language 层必须是一套完整的 LaTeX 镜像,至少包含 `workflow-language/main.tex`、`workflow-language/references.bib`、`workflow-language/sections/*.tex`、`workflow-language/tables/*.tex`、`workflow-language/figures/*.tex` 和 `workflow-language/analysis/analysis-asset.tex`。不要再把新的 workflow-language 输出写到已经废弃的 review 层路径,例如 `docs/lab/paper/review_zh/`。把 `.lab/writing/terminology-glossary.md` 作为写作期 glossary,用来沉淀全称、批准缩写、对外解释和可接受别名。无论当前语言是什么,都要满足同一套学术可读性标准:如果本轮引入或改写了关键术语、缩写、指标名、机制名或系统标签,就先写全称;如果后面要复用短写,就在首次出现时定义;同时说明它是什么、为什么在这里重要,保持一个概念只有一个 paper-facing 名称,并尽量避免新造的连字符拼接标签。相同的首次解释规则也适用于表头、caption、表注和图注;如果术语第一次出现在表里,就必须在同一张表里局部解释。不要假定当前 section 可以无限继续压句子;在同一个 section 上做新的 tighten、compress 或 polish 之前,先过一遍 section-level acceptance gate。这个 gate 至少要显式确认命名一致性、前后文一致性、claim / metric / ranking 与当前证据的一致性、局部清晰度、局部简洁度,以及 section-style compliance。当前 section 的写作表达必须先遵守 `section-style-policies.md` 里的鼓励表达、谨慎表达和禁用表达;只要还有禁用表达或禁用写法残留,本轮就不能算通过 section-level acceptance gate。如果本轮改动的是论文当前的 canonical 实验或评测协议(例如 split 比例、训练/测试规模、seed 或 split 数量、benchmark 集合、主表评测口径),默认把它当成主协议替换,而不是补充实验;除非用户明确说这是 supplementary 或 appendix-only。遇到这种协议替换时,先做全文影响审计(paper-wide impact audit),列出哪些 section 和资产已经过期,优先更新影响最大的 canonical section / asset,再继续润色;不要默认去做 translation/workflow-layer 同步,除非用户明确要求,或者语言最终定稿流程要求这样做。只有在用户明确要求跨语言同步,或者 final-draft/export 的语言最终定稿步骤确实要求两层一起刷新时,才允许同一轮同时修改 canonical manuscript 和 workflow-language 论文层。不要把普通 tighten/compress/polish 请求理解成“顺手同步 companion”。如果当前是导出或远程发布轮次,且 `paper_language_finalization_decision=convert-to-paper-language`,默认把 workflow-language 论文层一起带进导出的或推送的 bundle。只有在用户明确要求只导出 canonical,或者远程目标明确不允许附带额外文件时,才允许 canonical-only export。如果任何一项还没过,就先解决这个 blocker,不要默认继续 prose polish,也不要把下一步建议自动写成“再收紧一轮”。主表必须局部自足:读者只看表题、表头、表注和邻近引入或解读,就应当知道每行是什么、每列是什么、指标方向是什么,以及需要的单位、分母或触发条件。表头可以短,但表里的缩写必须在同表局部展开。如果 Method 或 Experiments 承诺了一组指标,主表就必须直接展示这些指标,或者明确标成 appendix-only 并解释原因;如果某个指标因为恒为零、冗余或只放附录而不单列,也必须在表注里显式说明,不能静默省略。不要把 `\\resizebox{\\linewidth}{!}{...}` 当成主表默认的宽度解决方案。主表如果超宽,先重构表:缩短表头但保留局部解释,把次要指标移到 appendix-only,减少或拆分列,最后才保守调整 `\\tabcolsep`;只有这些都做过仍然超宽时,才允许把 `\\resizebox` 当成最后手段,而且必须在同一张表的表注里解释宽度处理理由。不要把 `\\scriptsize` 或 `\\tiny` 当成主表默认的适配策略。内部标识符默认不要进入 reader-facing prose;若必须出现,只能在完成一次读者映射后使用,并把 terminology-clarity 自检、section-level acceptance gate、section-style policy 合规检查、protocol/scope impact audit、export 或 remote bundle 审计、当前轮次目标层、workflow-language 现役时的 canonical-only 理由、任何跨语言同步理由,以及 table-semantics 审计一起写进 write iteration artifact。如果当前稿件将从托管默认 scaffold 开始,且还没有模板决定,就先追问一次:继续使用默认 scaffold,还是先接入模板目录。如果进入最终定稿时 `workflow_language` 与 `paper_language` 不一致,就先完成并保留 workflow-language 论文层,再追问一次:保持当前语言,还是把 canonical manuscript 转成 `paper_language`;先持久化这个决定,再在最新 write iteration 里记录语言决策和 workflow-language 论文层路径,最后才允许按该语言修改最终稿。",
|
|
6
|
+
"claude_zh": "本命令运行 lab workflow 的 `write` 阶段。把 `.claude/skills/lab/stages/write.md` 当成模板选择、paper-plan、section 参考、校验 gate、资产覆盖和最终 manuscript 规则的单一来源。读取与当前 section 对应的 paper-writing reference、`section-style-policies.md` 里与当前 section 对应的风格块,以及 bundled example-bank 文件,一次只修改一个 section;普通草稿轮次把写作校验当 warning,最终定稿或导出轮次必须满足 write-stage 的接受 gate。普通起草轮次先跟随 `workflow_language`,普通 `.tex` section 草稿也必须先停留在 `workflow_language`,不能把 `paper_language` 当成默认草稿语言,并把 workflow-language 论文层当成正式持久化产物,而不是 review 层。当 `workflow_language` 与 `paper_language` 不一致时,把 workflow-language 论文层当成普通写作轮次的默认工作层。普通写作轮次仍然只改一个目标层,不要静默同时刷新两种语言层。如果用户明确点名了某个文件或层级,就把它当成当前轮次唯一目标,除非用户另外明确要求同步。如果 workflow-language 论文层现役而本轮仍然写 canonical manuscript,必须在 write iteration artifact 里说明为什么这次 canonical-only 写作是合理的。如果 `paper_language_finalization_decision=convert-to-paper-language`,显式的 canonical manuscript 工作可以直接落在 `paper_language`,但这并不意味着只要 workflow-language 仍然现役,canonical 就变成普通轮次的默认工作层。workflow-language 层必须是一套完整的 LaTeX 镜像,至少包含 `workflow-language/main.tex`、`workflow-language/references.bib`、`workflow-language/sections/*.tex`、`workflow-language/tables/*.tex`、`workflow-language/figures/*.tex` 和 `workflow-language/analysis/analysis-asset.tex`。不要再把新的 workflow-language 输出写到已经废弃的 review 层路径,例如 `docs/lab/paper/review_zh/`。把 `.lab/writing/terminology-glossary.md` 作为写作期 glossary,用来沉淀全称、批准缩写、对外解释和可接受别名。无论当前语言是什么,都要满足同一套学术可读性标准:如果本轮引入或改写了关键术语、缩写、指标名、机制名或系统标签,就先写全称;如果后面要复用短写,就在首次出现时定义;同时说明它是什么、为什么在这里重要,保持一个概念只有一个 paper-facing 名称,并尽量避免新造的连字符拼接标签。相同的首次解释规则也适用于表头、caption、表注和图注;如果术语第一次出现在表里,就必须在同一张表里局部解释。不要假定当前 section 可以无限继续压句子;在同一个 section 上做新的 tighten、compress 或 polish 之前,先过一遍 section-level acceptance gate。这个 gate 至少要显式确认命名一致性、前后文一致性、claim / metric / ranking 与当前证据的一致性、局部清晰度、局部简洁度,以及 section-style compliance。当前 section 的写作表达必须先遵守 `section-style-policies.md` 里的鼓励表达、谨慎表达和禁用表达;只要还有禁用表达或禁用写法残留,本轮就不能算通过 section-level acceptance gate。如果本轮改动的是论文当前的 canonical 实验或评测协议(例如 split 比例、训练/测试规模、seed 或 split 数量、benchmark 集合、主表评测口径),默认把它当成主协议替换,而不是补充实验;除非用户明确说这是 supplementary 或 appendix-only。遇到这种协议替换时,先做全文影响审计(paper-wide impact audit),列出哪些 section 和资产已经过期,优先更新影响最大的 canonical section / asset,再继续润色;不要默认去做 translation/workflow-layer 同步,除非用户明确要求,或者语言最终定稿流程要求这样做。只有在用户明确要求跨语言同步,或者 final-draft/export 的语言最终定稿步骤确实要求两层一起刷新时,才允许同一轮同时修改 canonical manuscript 和 workflow-language 论文层。不要把普通 tighten/compress/polish 请求理解成“顺手同步 companion”。如果当前是导出或远程发布轮次,且 `paper_language_finalization_decision=convert-to-paper-language`,默认把 workflow-language 论文层一起带进导出的或推送的 bundle。只有在用户明确要求只导出 canonical,或者远程目标明确不允许附带额外文件时,才允许 canonical-only export。如果任何一项还没过,就先解决这个 blocker,不要默认继续 prose polish,也不要把下一步建议自动写成“再收紧一轮”。主表必须局部自足:读者只看表题、表头、表注和邻近引入或解读,就应当知道每行是什么、每列是什么、指标方向是什么,以及需要的单位、分母或触发条件。表头可以短,但表里的缩写必须在同表局部展开。如果 Method 或 Experiments 承诺了一组指标,主表就必须直接展示这些指标,或者明确标成 appendix-only 并解释原因;如果某个指标因为恒为零、冗余或只放附录而不单列,也必须在表注里显式说明,不能静默省略。不要把 `\\resizebox{\\linewidth}{!}{...}` 当成主表默认的宽度解决方案。主表如果超宽,先重构表:缩短表头但保留局部解释,把次要指标移到 appendix-only,减少或拆分列,最后才保守调整 `\\tabcolsep`;只有这些都做过仍然超宽时,才允许把 `\\resizebox` 当成最后手段,而且必须在同一张表的表注里解释宽度处理理由。不要把 `\\scriptsize` 或 `\\tiny` 当成主表默认的适配策略。内部标识符默认不要进入 reader-facing prose;若必须出现,只能在完成一次读者映射后使用,并把 terminology-clarity 自检、section-level acceptance gate、section-style policy 合规检查、protocol/scope impact audit、export 或 remote bundle 审计、当前轮次目标层、workflow-language 现役时的 canonical-only 理由、任何跨语言同步理由,以及 table-semantics 审计一起写进 write iteration artifact。如果当前稿件将从托管默认 scaffold 开始,且还没有模板决定,就先追问一次:继续使用默认 scaffold,还是先接入模板目录。如果进入最终定稿时 `workflow_language` 与 `paper_language` 不一致,就先完成并保留 workflow-language 论文层,再追问一次:保持当前语言,还是把 canonical manuscript 转成 `paper_language`;先持久化这个决定,再在最新 write iteration 里记录语言决策和 workflow-language 论文层路径,最后才允许按该语言修改最终稿。"
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. Ordinary write rounds should edit one target paper layer
|
|
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, the current section block in `section-style-policies.md`, 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`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. 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, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -11,7 +11,13 @@ 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
13
|
WRITE_ITERATION_LANGUAGE_SECTION = {
|
|
14
|
+
"Round": (r"^##\s+Round\s*$", r"^##\s+轮次\s*$"),
|
|
14
15
|
"Language Decision": (r"^##\s+Language Decision\s*$", r"^##\s+语言决策\s*$"),
|
|
16
|
+
"Export / Remote Bundle": (
|
|
17
|
+
r"^##\s+Export\s*/\s*Remote Bundle\s*$",
|
|
18
|
+
r"^##\s+导出\s*/\s*远程 Bundle\s*$",
|
|
19
|
+
r"^##\s+导出\s*/\s*远程发布 Bundle\s*$",
|
|
20
|
+
),
|
|
15
21
|
}
|
|
16
22
|
WORKFLOW_LANGUAGE_DELIVERABLE_REVIEW_MARKERS = (
|
|
17
23
|
"Paragraph Outline",
|
|
@@ -81,6 +87,30 @@ def has_field_value(body: str, labels: tuple[str, ...]) -> bool:
|
|
|
81
87
|
return False
|
|
82
88
|
|
|
83
89
|
|
|
90
|
+
def extract_field_value(body: str, labels: tuple[str, ...]) -> str | None:
|
|
91
|
+
for label in labels:
|
|
92
|
+
pattern = re.compile(rf"^\s*(?:-|\d+\.)\s*{re.escape(label)}[::][ \t]*([^\n]+?)\s*$", flags=re.MULTILINE)
|
|
93
|
+
for match in pattern.finditer(body):
|
|
94
|
+
value = match.group(1).strip()
|
|
95
|
+
if value and value not in {"TBD", "TODO", "待补", "待定", "unclear"}:
|
|
96
|
+
return value
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def value_means_yes(value: str | None) -> bool:
|
|
101
|
+
if value is None:
|
|
102
|
+
return False
|
|
103
|
+
normalized = value.strip().lower()
|
|
104
|
+
return normalized in {"yes", "y", "true", "1", "是", "需要", "included"}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def value_means_no(value: str | None) -> bool:
|
|
108
|
+
if value is None:
|
|
109
|
+
return False
|
|
110
|
+
normalized = value.strip().lower()
|
|
111
|
+
return normalized in {"no", "n", "false", "0", "否", "不需要", "omitted", "canonical-only"}
|
|
112
|
+
|
|
113
|
+
|
|
84
114
|
def find_latest_write_iteration(paper_dir: Path) -> Path | None:
|
|
85
115
|
search_roots = [paper_dir, *paper_dir.parents]
|
|
86
116
|
for root in search_roots:
|
|
@@ -387,7 +417,12 @@ def check_language_layers(paper_dir: Path, issues: list[str]):
|
|
|
387
417
|
return
|
|
388
418
|
|
|
389
419
|
iteration_text = read_text(latest_iteration)
|
|
420
|
+
round_section = extract_section_body(iteration_text, WRITE_ITERATION_LANGUAGE_SECTION["Round"])
|
|
390
421
|
language_section = extract_section_body(iteration_text, WRITE_ITERATION_LANGUAGE_SECTION["Language Decision"])
|
|
422
|
+
export_bundle_section = extract_section_body(
|
|
423
|
+
iteration_text,
|
|
424
|
+
WRITE_ITERATION_LANGUAGE_SECTION["Export / Remote Bundle"],
|
|
425
|
+
)
|
|
391
426
|
if not language_section:
|
|
392
427
|
issues.append(
|
|
393
428
|
"latest write iteration is missing a language decision section for the final manuscript language choice"
|
|
@@ -421,6 +456,23 @@ def check_language_layers(paper_dir: Path, issues: list[str]):
|
|
|
421
456
|
if workflow_language == "zh" and not text_looks_like_language(iteration_text, workflow_language):
|
|
422
457
|
issues.append("latest write iteration should follow workflow_language=zh instead of drifting into another language")
|
|
423
458
|
|
|
459
|
+
round_target = extract_field_value(
|
|
460
|
+
round_section,
|
|
461
|
+
("Section target", "section_target", "轮次目标", "Section guide target"),
|
|
462
|
+
)
|
|
463
|
+
export_round_flag = extract_field_value(
|
|
464
|
+
export_bundle_section,
|
|
465
|
+
(
|
|
466
|
+
"Was this round an export or remote publication round",
|
|
467
|
+
"export_or_remote_publication_round",
|
|
468
|
+
"本轮是否为导出或远程发布轮次",
|
|
469
|
+
),
|
|
470
|
+
)
|
|
471
|
+
is_export_or_remote_round = (
|
|
472
|
+
(round_target is not None and any(token in round_target.lower() for token in ("export", "remote")))
|
|
473
|
+
or value_means_yes(export_round_flag)
|
|
474
|
+
)
|
|
475
|
+
|
|
424
476
|
sections_dir = paper_dir / "sections"
|
|
425
477
|
section_text = "\n".join(
|
|
426
478
|
read_text(path) for path in sorted(sections_dir.glob("*.tex")) if path.is_file()
|
|
@@ -434,6 +486,43 @@ def check_language_layers(paper_dir: Path, issues: list[str]):
|
|
|
434
486
|
if finalization_decision != "convert-to-paper-language":
|
|
435
487
|
return
|
|
436
488
|
|
|
489
|
+
if is_export_or_remote_round:
|
|
490
|
+
if not export_bundle_section:
|
|
491
|
+
issues.append(
|
|
492
|
+
"latest write iteration is missing an export / remote bundle audit while the workflow-language paper layer should ship with export rounds"
|
|
493
|
+
)
|
|
494
|
+
else:
|
|
495
|
+
if not has_field_value(
|
|
496
|
+
export_bundle_section,
|
|
497
|
+
("Export/publish target", "export_publish_target", "导出/发布目标"),
|
|
498
|
+
):
|
|
499
|
+
issues.append(
|
|
500
|
+
"latest write iteration is missing the export / remote bundle target while the workflow-language paper layer should ship with export rounds"
|
|
501
|
+
)
|
|
502
|
+
bundle_included = extract_field_value(
|
|
503
|
+
export_bundle_section,
|
|
504
|
+
(
|
|
505
|
+
"Was workflow-language paper layer included in the exported/pushed bundle",
|
|
506
|
+
"workflow_language_bundle_included",
|
|
507
|
+
"导出的/推送的 bundle 是否包含 workflow-language 论文层",
|
|
508
|
+
),
|
|
509
|
+
)
|
|
510
|
+
if bundle_included is None:
|
|
511
|
+
issues.append(
|
|
512
|
+
"latest write iteration is missing whether the workflow-language paper layer was included in the export / remote bundle"
|
|
513
|
+
)
|
|
514
|
+
elif value_means_no(bundle_included) and not has_field_value(
|
|
515
|
+
export_bundle_section,
|
|
516
|
+
(
|
|
517
|
+
"If workflow-language was omitted, why was canonical-only export acceptable",
|
|
518
|
+
"canonical_only_export_justification",
|
|
519
|
+
"如果省略 workflow-language,为什么只导出 canonical 仍然可接受",
|
|
520
|
+
),
|
|
521
|
+
):
|
|
522
|
+
issues.append(
|
|
523
|
+
"latest write iteration is missing the canonical-only export justification while the workflow-language paper layer was omitted from the export / remote bundle"
|
|
524
|
+
)
|
|
525
|
+
|
|
437
526
|
workflow_layer_dir = paper_dir / "workflow-language"
|
|
438
527
|
workflow_deliverable_sections = workflow_layer_dir / "sections"
|
|
439
528
|
workflow_tables_dir = workflow_layer_dir / "tables"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
import argparse
|
|
3
|
+
import json
|
|
3
4
|
import re
|
|
4
5
|
import sys
|
|
5
6
|
from pathlib import Path
|
|
@@ -58,6 +59,50 @@ def has_local_naming_bridge(text: str) -> bool:
|
|
|
58
59
|
)
|
|
59
60
|
|
|
60
61
|
|
|
62
|
+
def find_project_root(section_path: Path) -> Path | None:
|
|
63
|
+
for parent in (section_path.parent, *section_path.parents):
|
|
64
|
+
workflow_config = parent / ".lab" / "config" / "workflow.json"
|
|
65
|
+
if workflow_config.exists():
|
|
66
|
+
return parent
|
|
67
|
+
return None
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def load_workflow_config(project_root: Path | None) -> dict:
|
|
71
|
+
if project_root is None:
|
|
72
|
+
return {}
|
|
73
|
+
workflow_config = project_root / ".lab" / "config" / "workflow.json"
|
|
74
|
+
if not workflow_config.exists():
|
|
75
|
+
return {}
|
|
76
|
+
try:
|
|
77
|
+
return json.loads(workflow_config.read_text(encoding="utf-8"))
|
|
78
|
+
except json.JSONDecodeError:
|
|
79
|
+
return {}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def extract_markdown_field(text: str, section_heading: str, field_label: str) -> str:
|
|
83
|
+
section_match = re.search(
|
|
84
|
+
rf"^##\s+{re.escape(section_heading)}\s*$([\s\S]*?)(?=^##\s+|\Z)",
|
|
85
|
+
text,
|
|
86
|
+
flags=re.MULTILINE,
|
|
87
|
+
)
|
|
88
|
+
if not section_match:
|
|
89
|
+
return ""
|
|
90
|
+
section_text = section_match.group(1)
|
|
91
|
+
field_match = re.search(
|
|
92
|
+
rf"^- \s*{re.escape(field_label)}[ \t]*(.*)$",
|
|
93
|
+
section_text,
|
|
94
|
+
flags=re.MULTILINE,
|
|
95
|
+
)
|
|
96
|
+
if not field_match:
|
|
97
|
+
return ""
|
|
98
|
+
return field_match.group(1).strip()
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def has_meaningful_field_value(value: str) -> bool:
|
|
102
|
+
normalized = value.strip().lower()
|
|
103
|
+
return normalized not in {"", "-", "n/a", "na", "none", "no", "not applicable", "null", "false"}
|
|
104
|
+
|
|
105
|
+
|
|
61
106
|
SECTION_STYLE_WARNINGS = {
|
|
62
107
|
"abstract": [
|
|
63
108
|
(
|
|
@@ -271,6 +316,58 @@ def check_neighbor_asset_files(section: str, section_path: Path, issues: list[st
|
|
|
271
316
|
)
|
|
272
317
|
|
|
273
318
|
|
|
319
|
+
def check_workflow_language_targeting(section_path: Path, issues: list[str]):
|
|
320
|
+
project_root = find_project_root(section_path)
|
|
321
|
+
workflow_config = load_workflow_config(project_root)
|
|
322
|
+
workflow_language = workflow_config.get("workflow_language")
|
|
323
|
+
paper_language = workflow_config.get("paper_language")
|
|
324
|
+
if not workflow_language or not paper_language or workflow_language == paper_language:
|
|
325
|
+
return
|
|
326
|
+
|
|
327
|
+
if "workflow-language" in section_path.parts:
|
|
328
|
+
return
|
|
329
|
+
|
|
330
|
+
if project_root is None:
|
|
331
|
+
return
|
|
332
|
+
|
|
333
|
+
iteration_dir = project_root / ".lab" / "writing" / "iterations"
|
|
334
|
+
if not iteration_dir.exists():
|
|
335
|
+
issues.append(
|
|
336
|
+
"workflow-language is active for this project, but no write-iteration audit explains why this round targeted the canonical manuscript"
|
|
337
|
+
)
|
|
338
|
+
return
|
|
339
|
+
|
|
340
|
+
iteration_files = sorted(iteration_dir.glob("*.md"))
|
|
341
|
+
if not iteration_files:
|
|
342
|
+
issues.append(
|
|
343
|
+
"workflow-language is active for this project, but no write-iteration audit explains why this round targeted the canonical manuscript"
|
|
344
|
+
)
|
|
345
|
+
return
|
|
346
|
+
|
|
347
|
+
latest_iteration = iteration_files[-1]
|
|
348
|
+
iteration_text = read_text(latest_iteration)
|
|
349
|
+
round_target = extract_markdown_field(
|
|
350
|
+
iteration_text,
|
|
351
|
+
"Language Layer Target",
|
|
352
|
+
"Round target layer:",
|
|
353
|
+
)
|
|
354
|
+
canonical_reason = extract_markdown_field(
|
|
355
|
+
iteration_text,
|
|
356
|
+
"Language Layer Target",
|
|
357
|
+
"If workflow-language was active and this round still targeted canonical manuscript, why was canonical-only writing acceptable:",
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
if round_target and all(token not in round_target.lower() for token in ("canonical", "both")):
|
|
361
|
+
issues.append(
|
|
362
|
+
"workflow-language is active for this project, but the latest write-iteration target layer does not match this canonical-manuscript draft"
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
if not has_meaningful_field_value(canonical_reason):
|
|
366
|
+
issues.append(
|
|
367
|
+
"workflow-language is active for this project, but the latest write iteration does not explain why canonical-only writing was acceptable for this round"
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
|
|
274
371
|
def check_abstract(text: str, issues: list[str]):
|
|
275
372
|
numbers = re.findall(r"\b\d+(?:\.\d+)?\b", text)
|
|
276
373
|
if len(numbers) > 6:
|
|
@@ -399,6 +496,7 @@ def main():
|
|
|
399
496
|
text = read_text(section_path)
|
|
400
497
|
issues: list[str] = []
|
|
401
498
|
check_common_section_gate_risks(text, issues)
|
|
499
|
+
check_workflow_language_targeting(section_path, issues)
|
|
402
500
|
check_section_style_policy(text, args.section, issues)
|
|
403
501
|
SECTION_CHECKS[args.section](text, issues)
|
|
404
502
|
check_neighbor_asset_files(args.section, section_path, issues)
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
## Language Layer Target
|
|
79
79
|
|
|
80
80
|
- Round target layer:
|
|
81
|
+
- If workflow-language was active and this round still targeted canonical manuscript, why was canonical-only writing acceptable:
|
|
81
82
|
- If both canonical manuscript and workflow-language layer were edited, why:
|
|
82
83
|
- Was cross-language sync explicitly requested or required by final-draft/export:
|
|
83
84
|
|
|
@@ -89,6 +90,13 @@
|
|
|
89
90
|
- Was the change explicitly scoped as supplementary/appendix-only by the user:
|
|
90
91
|
- Did any translation/workflow-layer sync get proposed or executed, and why:
|
|
91
92
|
|
|
93
|
+
## Export / Remote Bundle
|
|
94
|
+
|
|
95
|
+
- Was this round an export or remote publication round:
|
|
96
|
+
- Export/publish target:
|
|
97
|
+
- Was workflow-language paper layer included in the exported/pushed bundle:
|
|
98
|
+
- If workflow-language was omitted, why was canonical-only export acceptable:
|
|
99
|
+
|
|
92
100
|
## Decision
|
|
93
101
|
|
|
94
102
|
- Continue or stop:
|
|
@@ -213,9 +213,11 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
|
|
|
213
213
|
- Write one paper section or one explicit subproblem per round.
|
|
214
214
|
- Ordinary manuscript drafting rounds should follow `workflow_language`.
|
|
215
215
|
- In those ordinary rounds, the manuscript is still LaTeX, so the initial `.tex` section drafts must stay in `workflow_language` rather than jumping straight to `paper_language`.
|
|
216
|
-
-
|
|
216
|
+
- When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as active and use it as the default ordinary working layer.
|
|
217
|
+
- Ordinary write rounds should still edit one target paper layer at a time, not both language layers at once.
|
|
217
218
|
- If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization.
|
|
218
|
-
- If
|
|
219
|
+
- If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the latest write iteration artifact.
|
|
220
|
+
- If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active.
|
|
219
221
|
- Treat the workflow-language paper as a real persisted paper layer, not as a review layer.
|
|
220
222
|
- If `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then the first final-draft or export round must ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`.
|
|
221
223
|
- 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.
|
|
@@ -237,6 +239,8 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
|
|
|
237
239
|
- When a paper-wide impact audit is still open, default the next write action to the highest-impact canonical stale section or asset instead of another polish pass on the current section.
|
|
238
240
|
- Do not propose or execute translation/workflow-layer synchronization unless the user explicitly asked for it or the language-finalization workflow requires it.
|
|
239
241
|
- Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion.
|
|
242
|
+
- For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default.
|
|
243
|
+
- Allow canonical-only export only when the user explicitly asked for it or when the remote target forbids extra files, and record that justification.
|
|
240
244
|
- If any section-level acceptance item is unresolved, spend the round fixing that blocker instead of polishing sentences further.
|
|
241
245
|
- Use natural-language full names in prose, and define any approved short form once before reusing it.
|
|
242
246
|
- Do not use labels containing `_` or `-` in reader-facing prose.
|
|
@@ -262,8 +266,10 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
|
|
|
262
266
|
- Record the section-level acceptance gate in the latest write iteration artifact before recommending another tighten/compress/polish pass on the same section.
|
|
263
267
|
- Record section-style policy compliance, any retained discouraged move, and any banned move found in the latest write iteration artifact.
|
|
264
268
|
- Record the round target layer in the latest write iteration artifact as `canonical manuscript`, `workflow-language paper layer`, or `both`.
|
|
269
|
+
- If workflow-language was active and the round still targeted the canonical manuscript, record why canonical-only writing was acceptable in the latest write iteration artifact.
|
|
265
270
|
- If both layers were edited, record why the cross-language sync was required and whether it was explicitly requested by the user or required by final-draft/export finalization.
|
|
266
271
|
- Record the protocol/scope impact audit in the latest write iteration artifact whenever a round replaces or rewrites a canonical experiment/evaluation protocol.
|
|
272
|
+
- If the round is an export or remote-publication round, record the export target, whether the workflow-language paper layer was included in the exported or pushed bundle, and why any canonical-only export was acceptable.
|
|
267
273
|
- If a claim is not supported by evidence, weaken or remove it.
|
|
268
274
|
- Treat tables, figures, citations, and bibliography as core manuscript content rather than optional polish.
|
|
269
275
|
- Keep paper-facing LaTeX free of absolute local paths, rerun ids, shell transcripts, and internal workflow provenance.
|
|
@@ -66,9 +66,11 @@ Run these on every round:
|
|
|
66
66
|
- LaTeX is the required manuscript output format.
|
|
67
67
|
- Ordinary manuscript drafting rounds should follow `workflow_language`.
|
|
68
68
|
- During ordinary rounds, ordinary `.tex` section drafts must stay in `workflow_language`; do not treat `paper_language` as the default draft language.
|
|
69
|
-
-
|
|
69
|
+
- When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as active and use it as the default ordinary working layer.
|
|
70
|
+
- Ordinary write rounds should still edit one target paper layer at a time, not both language layers at once.
|
|
70
71
|
- If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization.
|
|
71
|
-
- If
|
|
72
|
+
- If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write-iteration artifact instead of silently treating canonical as the default working layer.
|
|
73
|
+
- If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active.
|
|
72
74
|
- Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together.
|
|
73
75
|
- Treat the workflow-language manuscript as a real persisted paper layer, not just an internal review note.
|
|
74
76
|
- If the user asks to read the paper in `workflow_language`, materialize or refresh a full workflow-language paper layer under `<deliverables_root>/paper/workflow-language/` instead of pointing to a review layer.
|
|
@@ -117,6 +119,8 @@ Run these on every round:
|
|
|
117
119
|
- When a paper-wide impact audit is still open, default the next write action to the highest-impact canonical stale section or asset instead of polishing the same section again.
|
|
118
120
|
- Do not propose or execute translation-layer or workflow-layer synchronization steps unless the user explicitly asked for them or the language-finalization workflow requires them.
|
|
119
121
|
- Do not treat a routine prose-tightening request as an instruction to refresh both the canonical manuscript and the workflow-language companion.
|
|
122
|
+
- For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default.
|
|
123
|
+
- Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files, and record that justification in the write-iteration artifact.
|
|
120
124
|
- If any section-level acceptance item is still unresolved, spend the round fixing that blocker instead of doing more prose polish.
|
|
121
125
|
- Do not default the next-step recommendation to another polish pass. Recommend the first unresolved section-level blocker, or stop if the section is already accepted for the round.
|
|
122
126
|
- Use natural-language full names in prose. If an approved short form is needed later, define it once and reuse it consistently.
|
|
@@ -184,8 +188,10 @@ Run these on every round:
|
|
|
184
188
|
- Record the section-level acceptance gate in the write-iteration artifact before recommending further tightening on the same section.
|
|
185
189
|
- Record section-style policy compliance, any retained discouraged move, and any banned move found in the write-iteration artifact.
|
|
186
190
|
- Record the round target layer in the write-iteration artifact as `canonical manuscript`, `workflow-language paper layer`, or `both`.
|
|
191
|
+
- If workflow-language was active and the round still targeted the canonical manuscript, record why canonical-only writing was acceptable in the write-iteration artifact.
|
|
187
192
|
- If both layers were edited, record why the cross-language sync was required and whether it was explicitly requested by the user or required by final-draft/export finalization.
|
|
188
193
|
- Record the protocol/scope impact audit in the write-iteration artifact whenever a round replaces or rewrites a canonical experiment/evaluation protocol.
|
|
194
|
+
- If the round is an export or remote-publication round, record the export target, whether the workflow-language paper layer was included in the exported or pushed bundle, and why any canonical-only export was acceptable.
|
|
189
195
|
- 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.
|
|
190
196
|
- When `workflow_language` and `paper_language` differ, also record the persisted workflow-language paper-layer path in the write-iteration artifact.
|
|
191
197
|
- Keep the handoff wording in the write-iteration artifact explicit and stable: say what is completed, what scope is frozen for the next round, what the next owner is allowed to do, what they must read first, and what counts as accept, revise, or reject.
|
|
@@ -210,15 +216,15 @@ Run these on every round:
|
|
|
210
216
|
- `<deliverables_root>/paper/figures/method-overview.tex`
|
|
211
217
|
- `<deliverables_root>/paper/figures/results-overview.tex`
|
|
212
218
|
- `<deliverables_root>/paper/analysis/analysis-asset.tex`
|
|
213
|
-
- `<deliverables_root>/paper/workflow-language/main.tex` when
|
|
214
|
-
- `<deliverables_root>/paper/workflow-language/references.bib` when
|
|
215
|
-
- `<deliverables_root>/paper/workflow-language/sections/<section>.tex` when
|
|
216
|
-
- `<deliverables_root>/paper/workflow-language/tables/main-results.tex` when the current paper contains experimental claims and `
|
|
217
|
-
- `<deliverables_root>/paper/workflow-language/tables/ablations.tex` when the current paper contains experimental claims and `
|
|
218
|
-
- `<deliverables_root>/paper/workflow-language/figures/problem-setting.tex` when the current paper contains method or experiments claims and `
|
|
219
|
-
- `<deliverables_root>/paper/workflow-language/figures/method-overview.tex` when the current paper contains method or experiments claims and `
|
|
220
|
-
- `<deliverables_root>/paper/workflow-language/figures/results-overview.tex` when the current paper contains experimental claims and `
|
|
221
|
-
- `<deliverables_root>/paper/workflow-language/analysis/analysis-asset.tex` when the current paper contains experimental claims and `
|
|
219
|
+
- `<deliverables_root>/paper/workflow-language/main.tex` when `workflow_language` and `paper_language` differ
|
|
220
|
+
- `<deliverables_root>/paper/workflow-language/references.bib` when `workflow_language` and `paper_language` differ
|
|
221
|
+
- `<deliverables_root>/paper/workflow-language/sections/<section>.tex` when `workflow_language` and `paper_language` differ
|
|
222
|
+
- `<deliverables_root>/paper/workflow-language/tables/main-results.tex` when the current paper contains experimental claims and `workflow_language` and `paper_language` differ
|
|
223
|
+
- `<deliverables_root>/paper/workflow-language/tables/ablations.tex` when the current paper contains experimental claims and `workflow_language` and `paper_language` differ
|
|
224
|
+
- `<deliverables_root>/paper/workflow-language/figures/problem-setting.tex` when the current paper contains method or experiments claims and `workflow_language` and `paper_language` differ
|
|
225
|
+
- `<deliverables_root>/paper/workflow-language/figures/method-overview.tex` when the current paper contains method or experiments claims and `workflow_language` and `paper_language` differ
|
|
226
|
+
- `<deliverables_root>/paper/workflow-language/figures/results-overview.tex` when the current paper contains experimental claims and `workflow_language` and `paper_language` differ
|
|
227
|
+
- `<deliverables_root>/paper/workflow-language/analysis/analysis-asset.tex` when the current paper contains experimental claims and `workflow_language` and `paper_language` differ
|
|
222
228
|
|
|
223
229
|
## Stop Conditions
|
|
224
230
|
|