superlab 0.1.76 → 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/i18n.cjs +10 -1
- package/lib/lab_write_contract.json +1 -0
- package/package-assets/claude/commands/lab/write.md +2 -0
- package/package-assets/claude/commands/lab-write.md +2 -0
- package/package-assets/claude/commands/lab.md +1 -1
- package/package-assets/claude/commands/lab:write.md +2 -0
- package/package-assets/claude/commands/lab/357/274/232write.md +2 -0
- package/package-assets/codex/prompts/lab/auto.md +1 -1
- package/package-assets/codex/prompts/lab/write.md +2 -0
- package/package-assets/codex/prompts/lab-auto.md +1 -1
- package/package-assets/codex/prompts/lab-write.md +2 -0
- package/package-assets/codex/prompts/lab.md +1 -1
- package/package-assets/codex/prompts/lab:auto.md +1 -1
- package/package-assets/codex/prompts/lab:write.md +2 -0
- package/package-assets/codex/prompts/lab/357/274/232auto.md +1 -1
- package/package-assets/codex/prompts/lab/357/274/232write.md +2 -0
- package/package-assets/shared/lab/.managed/scripts/validate_workflow_language_text.py +221 -0
- package/package-assets/shared/lab/.managed/templates/terminology-glossary.md +5 -0
- package/package-assets/shared/skills/lab/SKILL.md +3 -1
- package/package-assets/shared/skills/lab/stages/auto.md +7 -0
- package/package-assets/shared/skills/lab/stages/write.md +2 -0
- package/package.json +1 -1
package/lib/i18n.cjs
CHANGED
|
@@ -1602,6 +1602,7 @@ const ZH_SKILL_FILES = {
|
|
|
1602
1602
|
- 正文里只用自然语言全称。
|
|
1603
1603
|
- 正文里不要使用包含 \`_\` 或 \`-\` 的标签名。
|
|
1604
1604
|
- 内部标识符、配置键和实验包标签默认不要进正文;若必须出现,也只能先给读者做一次映射,然后移回正文之外。
|
|
1605
|
+
- Chinese workflow-language terminology / 中文工作流层术语:当 \`workflow_language=zh\` 时,概念术语默认使用中文 paper-facing 名称和中文简称。英文最多在首次出现时以 \`中文全称(English full form, ACRONYM)\` 形式括注一次,后文复用中文简称。优先使用自然紧凑的中文简称;二字、三字、四字或更长短语都可以,只要读起来自然。不要强制固定字数。避免在中文正文里反复夹入 \`residual-fitting pathology\`、\`treated-group noise\` 或 \`gain-head function class\` 这类英文概念碎片。中文工作语言层完成前要运行 \`validate_workflow_language_text.py\` 扫描 touched sections、tables、figures 和 analysis assets。
|
|
1605
1606
|
|
|
1606
1607
|
## Entries
|
|
1607
1608
|
|
|
@@ -1610,6 +1611,10 @@ const ZH_SKILL_FILES = {
|
|
|
1610
1611
|
- Canonical paper-facing term:
|
|
1611
1612
|
- Full form at first mention:
|
|
1612
1613
|
- Approved short form or acronym:
|
|
1614
|
+
- Chinese short form, if workflow_language is zh:
|
|
1615
|
+
- English full form plus acronym allowed at first mention:
|
|
1616
|
+
- Allowed English fragments that may remain in Chinese prose:
|
|
1617
|
+
- Subsequent-language rule:
|
|
1613
1618
|
- Reader-facing explanation:
|
|
1614
1619
|
- Why this term matters here:
|
|
1615
1620
|
- First-use section:
|
|
@@ -2547,6 +2552,7 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "write.md")] = `# \`/l
|
|
|
2547
2552
|
- 把 \`.lab/writing/terminology-glossary.md\` 当成写作期 glossary,用来沉淀全称、批准缩写、对外解释和可接受别名;它和 \`.lab/context/terminology-lock.md\` 的职责不同,不能混用。
|
|
2548
2553
|
- 无论当前语言是什么,都要满足同一套学术可读性标准;如果本轮引入或改写了关键术语、缩写、指标名、机制名或系统标签,就在首次出现时顺手说明它是什么、为什么在这里重要。
|
|
2549
2554
|
- 第一次出现先写全称;如果后面要复用简称或缩写,就在首次出现时定义。
|
|
2555
|
+
- 中文工作流层术语必须更严格:当 \`workflow_language=zh\` 时,概念术语默认使用中文 paper-facing 名称和中文简称;英文最多在首次出现时以 \`中文全称(English full form, ACRONYM)\` 形式括注一次,后文复用中文简称。优先使用自然紧凑的中文简称;二字、三字、四字或更长短语都可以,只要读起来自然。不要强制固定字数;不要在中文正文里反复夹入英文概念碎片。中文工作语言层完成前要运行 \`validate_workflow_language_text.py\`。
|
|
2550
2556
|
- 同一个概念只保留一个自然语言 paper-facing 名称。
|
|
2551
2557
|
- 正文里使用自然语言全称;如果后面要复用简称,就先在第一次出现时定义。
|
|
2552
2558
|
- 不要假定固定的写作顺序,例如 Method 一定先于 Experiments;formal naming 可以先在 Method、Experiments 或其他 section 里出现。
|
|
@@ -2744,7 +2750,7 @@ const zhAutoPriorityCodexLine =
|
|
|
2744
2750
|
const zhAutoPriorityClaudeLine =
|
|
2745
2751
|
"显式的 `/lab auto` 或 `/lab-auto` 请求,其优先级高于 brainstorming、spec review 这类更宽的创作或审阅技能路径。";
|
|
2746
2752
|
const zhAutoVisibleCloseoutLine =
|
|
2747
|
-
"最终可见收尾必须直接消费已通过校验的 stage report
|
|
2753
|
+
"最终可见收尾必须直接消费已通过校验的 stage report,并严格使用结果收尾格式作为顶层结构:`Requested outcome status` / `请求结果状态`、`Plain-language result table` / `白话结果表`、`Evidence and validation` / `证据与验证`、`Gaps and next action` / `缺口与下一步`。白话结果表必须回答用户要什么、改了什么、什么有效、什么无效、验证了什么、还没验证什么、是否还需要改进及原因。不要使用 `核心修复`、`主要修改文件`、`已完成`、`已推送` 这类顶层收尾标题;文件、commit 或修改细节只能放在四个必需标题下面。不能只用“已完成”“已推送”或流水账命令日志结束。";
|
|
2748
2754
|
|
|
2749
2755
|
ZH_CONTENT[path.join(".codex", "prompts", "lab.md")] = ZH_CONTENT[
|
|
2750
2756
|
path.join(".codex", "prompts", "lab.md")
|
|
@@ -3443,6 +3449,7 @@ ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "auto.md")] = `# \`/la
|
|
|
3443
3449
|
- 把 \`.lab/writing/terminology-glossary.md\` 当成写作期 glossary,用来沉淀全称、批准缩写、对外解释和可接受别名
|
|
3444
3450
|
- 当循环推进 \`write\` 时,无论 workflow language 还是 paper language,都要满足同一套学术可读性标准;如果本轮引入或改写了关键术语、缩写、指标名、机制名或系统标签,就在首次出现时说明它是什么、为什么在这里重要
|
|
3445
3451
|
- 当循环推进 \`write\` 时,第一次出现先写全称;如果后面要复用简称或缩写,就在首次出现时定义;一个概念只保留一个 paper-facing 名称,并尽量避免新造的连字符拼接标签
|
|
3452
|
+
- 当循环推进中文 \`write\` 时,使用 Chinese workflow-language terminology:概念术语默认中文名和 Chinese short form / 中文简称;English full form plus acronym / 英文全称和缩写最多首次括注一次;后文复用自然中文简称,不限制二字、三字、四字或更长短语;用 \`validate_workflow_language_text.py\` 拦截不必要的中英混杂
|
|
3446
3453
|
- 不要靠术语堆积来制造学术感;如果本轮引入或改写了关键术语,就在用户可见的总结里补一段简短术语说明,并把 terminology-clarity 自检写进最新 write iteration
|
|
3447
3454
|
- 不要把 \`sleep 30\`、单次 \`pgrep\` 或一次性的 \`metrics.json\` 探针当成 rung 主命令;这些只能算进度检查。
|
|
3448
3455
|
- 当真实实验进程还活着时,只允许发进度更新并继续等待,不能把这一 rung 当作已经完成。
|
|
@@ -3465,7 +3472,9 @@ const zhAutoStageVisibleCloseout = `
|
|
|
3465
3472
|
|
|
3466
3473
|
- 最终可见收尾必须在 stage report 校验通过后给出,不能只写“已完成”“已推送”或命令流水账。
|
|
3467
3474
|
- 最终可见收尾必须直接来自已校验的阶段报告,而不是另起一套临场叙述。
|
|
3475
|
+
- 最终可见收尾必须严格使用 Result Closeout Shape / 结果收尾格式作为顶层结构:\`Requested outcome status\` / 请求结果状态、\`Plain-language result table\` / 白话结果表、\`Evidence and validation\` / 证据与验证、\`Gaps and next action\` / 缺口与下一步。
|
|
3468
3476
|
- 最终可见收尾至少包含:请求交付物或目标及状态、核心说明表关键行、证据路径、验证命令和验证结果、已知缺口、下一步动作和为什么这样做。
|
|
3477
|
+
- 不要使用 \`核心修复\`、\`主要修改文件\`、\`已完成\`、\`已推送\` 这类顶层收尾标题;文件、commit 或修改细节只能放在四个必需标题下面。
|
|
3469
3478
|
- 如果说“已完成”,也必须同时写明仍然存在的 handoff 边界,例如 PDF 编译、版面检查、外部审批、预算耗尽、冻结核心风险或环境缺失。
|
|
3470
3479
|
`;
|
|
3471
3480
|
if (!ZH_CONTENT[path.join(".codex", "skills", "lab", "stages", "auto.md")].includes("最终可见收尾")) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"chinese_terminology_rule": "Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.",
|
|
2
3
|
"stage_prompt": {
|
|
3
4
|
"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. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. 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. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. 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. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. 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, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, 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
5
|
"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.",
|
|
@@ -10,4 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
14
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
13
15
|
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.
|
|
@@ -10,4 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
14
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
13
15
|
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.
|
|
@@ -100,7 +100,7 @@ Treat all of these as equivalent stage requests:
|
|
|
100
100
|
- While the loop is alive, `/lab auto` should keep `.lab/context/auto-ledger.md` updated with the active owner, observed state, and resume boundary.
|
|
101
101
|
- Separate internal polling from user-facing progress reports.
|
|
102
102
|
- While the loop is healthy, `/lab auto` should report to the user only on a meaningful change or at the keepalive cadence recorded in the current contract or runtime state, and it should not ask the user to trigger the next poll.
|
|
103
|
-
- Final visible closeout must consume the validated stage report:
|
|
103
|
+
- Final visible closeout must consume the validated stage report and use this Result Closeout Shape as top-level headings: `Requested outcome status`, `Plain-language result table`, `Evidence and validation`, and `Gaps and next action`. Show requested deliverable statuses, Core Explanation Table rows, evidence paths, validation/verification commands and results, known gaps, and the next action. Do not use top-level closeout headings such as `核心修复` or `主要修改文件`, and do not end with only "done", "pushed", or a chronological command log.
|
|
104
104
|
|
|
105
105
|
- Treat `Autonomy level L1/L2/L3` as the execution privilege level, not as a paper layer, phase, or table number.
|
|
106
106
|
- Treat `paper layer`, `phase`, and `table` as experiment targets. For example, `paper layer 3` or `Phase 1` should not be interpreted as `Autonomy level L3`.
|
|
@@ -10,4 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
14
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
13
15
|
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.
|
|
@@ -10,4 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
14
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
13
15
|
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.
|
|
@@ -27,4 +27,4 @@ If the preflight block cannot be completed because any required field is missing
|
|
|
27
27
|
When the repository workflow language is Chinese, summaries, checklist items, task labels, and progress updates should be written in Chinese unless a literal identifier must stay unchanged.
|
|
28
28
|
Treat `Layer 3`, `Phase 1`, or `Table 2` as paper-scope targets. Treat `Autonomy level L3` as the execution permission level.
|
|
29
29
|
Do not replace the real long-running experiment command with a short watcher such as `sleep 30`, `pgrep`, or a one-shot `metrics.json` probe. While the real experiment process is still alive, emit only a progress update and keep waiting.
|
|
30
|
-
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
30
|
+
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Use this Result Closeout Shape exactly as the top-level structure: `Requested outcome status`, `Plain-language result table`, `Evidence and validation`, and `Gaps and next action`. The plain-language result table must answer what was requested, what changed, what worked, what did not work, what was verified, what remains unverified, and whether improvement is still needed. Do not use top-level closeout headings such as `Core fixes`, `核心修复`, `Main modified files`, `主要修改文件`, `Done`, or `已推送`; those details may appear only under the required four headings. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
@@ -8,4 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
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
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
12
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
11
13
|
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. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. 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. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. 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. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. 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, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, 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.
|
|
@@ -27,4 +27,4 @@ If the preflight block cannot be completed because any required field is missing
|
|
|
27
27
|
When the repository workflow language is Chinese, summaries, checklist items, task labels, and progress updates should be written in Chinese unless a literal identifier must stay unchanged.
|
|
28
28
|
Treat `Layer 3`, `Phase 1`, or `Table 2` as paper-scope targets. Treat `Autonomy level L3` as the execution permission level.
|
|
29
29
|
Do not replace the real long-running experiment command with a short watcher such as `sleep 30`, `pgrep`, or a one-shot `metrics.json` probe. While the real experiment process is still alive, emit only a progress update and keep waiting.
|
|
30
|
-
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
30
|
+
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Use this Result Closeout Shape exactly as the top-level structure: `Requested outcome status`, `Plain-language result table`, `Evidence and validation`, and `Gaps and next action`. The plain-language result table must answer what was requested, what changed, what worked, what did not work, what was verified, what remains unverified, and whether improvement is still needed. Do not use top-level closeout headings such as `Core fixes`, `核心修复`, `Main modified files`, `主要修改文件`, `Done`, or `已推送`; those details may appear only under the required four headings. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
@@ -8,4 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
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
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
12
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
11
13
|
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. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. 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. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. 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. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. 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, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, 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.
|
|
@@ -94,7 +94,7 @@ Treat all of these as equivalent stage requests:
|
|
|
94
94
|
- While the loop is alive, `/lab:auto` should keep `.lab/context/auto-ledger.md` updated with the active owner, observed state, and resume boundary.
|
|
95
95
|
- Separate internal polling from user-facing progress reports.
|
|
96
96
|
- While the loop is healthy, `/lab:auto` should report to the user only on a meaningful change or at the keepalive cadence recorded in the current contract or runtime state, and it should not ask the user to trigger the next poll.
|
|
97
|
-
- Final visible closeout must consume the validated stage report:
|
|
97
|
+
- Final visible closeout must consume the validated stage report and use this Result Closeout Shape as top-level headings: `Requested outcome status`, `Plain-language result table`, `Evidence and validation`, and `Gaps and next action`. Show requested deliverable statuses, Core Explanation Table rows, evidence paths, validation/verification commands and results, known gaps, and the next action. Do not use top-level closeout headings such as `核心修复` or `主要修改文件`, and do not end with only "done", "pushed", or a chronological command log.
|
|
98
98
|
|
|
99
99
|
- Treat `Autonomy level L1/L2/L3` as the execution privilege level, not as a paper layer, phase, or table number.
|
|
100
100
|
- Treat `paper layer`, `phase`, and `table` as experiment targets. For example, `paper layer 3` or `Phase 1` should not be interpreted as `Autonomy level L3`.
|
|
@@ -27,4 +27,4 @@ If the preflight block cannot be completed because any required field is missing
|
|
|
27
27
|
When the repository workflow language is Chinese, summaries, checklist items, task labels, and progress updates should be written in Chinese unless a literal identifier must stay unchanged.
|
|
28
28
|
Treat `Layer 3`, `Phase 1`, or `Table 2` as paper-scope targets. Treat `Autonomy level L3` as the execution permission level.
|
|
29
29
|
Do not replace the real long-running experiment command with a short watcher such as `sleep 30`, `pgrep`, or a one-shot `metrics.json` probe. While the real experiment process is still alive, emit only a progress update and keep waiting.
|
|
30
|
-
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
30
|
+
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Use this Result Closeout Shape exactly as the top-level structure: `Requested outcome status`, `Plain-language result table`, `Evidence and validation`, and `Gaps and next action`. The plain-language result table must answer what was requested, what changed, what worked, what did not work, what was verified, what remains unverified, and whether improvement is still needed. Do not use top-level closeout headings such as `Core fixes`, `核心修复`, `Main modified files`, `主要修改文件`, `Done`, or `已推送`; those details may appear only under the required four headings. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
@@ -8,4 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
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
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
12
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
11
13
|
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. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. 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. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. 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. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. 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, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, 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.
|
|
@@ -27,4 +27,4 @@ If the preflight block cannot be completed because any required field is missing
|
|
|
27
27
|
When the repository workflow language is Chinese, summaries, checklist items, task labels, and progress updates should be written in Chinese unless a literal identifier must stay unchanged.
|
|
28
28
|
Treat `Layer 3`, `Phase 1`, or `Table 2` as paper-scope targets. Treat `Autonomy level L3` as the execution permission level.
|
|
29
29
|
Do not replace the real long-running experiment command with a short watcher such as `sleep 30`, `pgrep`, or a one-shot `metrics.json` probe. While the real experiment process is still alive, emit only a progress update and keep waiting.
|
|
30
|
-
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
30
|
+
Final visible closeout is mandatory when `/lab:auto` reaches stop, failure, escalation, or handoff. After validating the stage report, the final answer must consume that report directly: list the requested deliverables or objectives with status, summarize the Core Explanation Table rows, provide evidence paths, show validation/verification commands and validation results, name known gaps or commands that could not run, and state the next action plus why it is appropriate. Use this Result Closeout Shape exactly as the top-level structure: `Requested outcome status`, `Plain-language result table`, `Evidence and validation`, and `Gaps and next action`. The plain-language result table must answer what was requested, what changed, what worked, what did not work, what was verified, what remains unverified, and whether improvement is still needed. Do not use top-level closeout headings such as `Core fixes`, `核心修复`, `Main modified files`, `主要修改文件`, `Done`, or `已推送`; those details may appear only under the required four headings. Do not end with only `done`, `pushed`, `completed`, or a chronological command log.
|
|
@@ -8,4 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
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
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Run `validate_workflow_language_text.py` on touched Chinese workflow-language sections, tables, figures, and analysis assets before completing the write round.
|
|
12
|
+
For Chinese workflow-language output, run `validate_workflow_language_text.py` over the touched workflow-language sections, tables, figures, and analysis assets before completing the write round. If it reports English concept fragments, translate them or define a justified glossary exception before prose polish.
|
|
11
13
|
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. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. 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. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. 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. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. 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, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, 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.
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
from collections import Counter
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
CJK_RE = re.compile(r"[\u3400-\u4dbf\u4e00-\u9fff]")
|
|
12
|
+
FIRST_MENTION_RE = re.compile(
|
|
13
|
+
r"[\u3400-\u4dbf\u4e00-\u9fff][^()()\n]{0,48}(([A-Za-z][A-Za-z0-9 .,'/&+\-]*?(?:,\s*[A-Z][A-Z0-9+\-]{1,})?))"
|
|
14
|
+
)
|
|
15
|
+
ENGLISH_FRAGMENT_RE = re.compile(
|
|
16
|
+
r"(?<![A-Za-z0-9_])([A-Za-z][A-Za-z0-9+]*(?:-[A-Za-z][A-Za-z0-9+]*)*"
|
|
17
|
+
r"(?:[ \t]+[A-Za-z][A-Za-z0-9+]*(?:-[A-Za-z][A-Za-z0-9+]*)*)*)(?![A-Za-z0-9_])"
|
|
18
|
+
)
|
|
19
|
+
FIELD_RE = re.compile(r"^[ \t]*-[ \t]*([^::]+)[::][ \t]*([^\n]*)[ \t]*$", flags=re.MULTILINE)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
DEFAULT_ALLOWED_FRAGMENTS = {
|
|
23
|
+
"api",
|
|
24
|
+
"arxiv",
|
|
25
|
+
"auuc",
|
|
26
|
+
"bert",
|
|
27
|
+
"csv",
|
|
28
|
+
"doi",
|
|
29
|
+
"gpt",
|
|
30
|
+
"html",
|
|
31
|
+
"iclr",
|
|
32
|
+
"icml",
|
|
33
|
+
"json",
|
|
34
|
+
"latex",
|
|
35
|
+
"llm",
|
|
36
|
+
"mlp",
|
|
37
|
+
"neurips",
|
|
38
|
+
"pdf",
|
|
39
|
+
"qini",
|
|
40
|
+
"rag",
|
|
41
|
+
"relu",
|
|
42
|
+
"sota",
|
|
43
|
+
"svm",
|
|
44
|
+
"tex",
|
|
45
|
+
"url",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def parse_args() -> argparse.Namespace:
|
|
50
|
+
parser = argparse.ArgumentParser(
|
|
51
|
+
description="Validate that Chinese workflow-language files avoid unnecessary English concept fragments."
|
|
52
|
+
)
|
|
53
|
+
parser.add_argument("--workflow-language", required=True, help="Workflow language, for example zh or en")
|
|
54
|
+
parser.add_argument("--file", action="append", default=[], help="Workflow-language .tex/.md file to scan")
|
|
55
|
+
parser.add_argument(
|
|
56
|
+
"--terminology-glossary",
|
|
57
|
+
help="Optional .lab/writing/terminology-glossary.md used for allowed English exceptions",
|
|
58
|
+
)
|
|
59
|
+
parser.add_argument(
|
|
60
|
+
"--allowed-fragment",
|
|
61
|
+
action="append",
|
|
62
|
+
default=[],
|
|
63
|
+
help="Explicit English fragment allowed to remain in Chinese workflow-language prose",
|
|
64
|
+
)
|
|
65
|
+
parser.add_argument("--mode", required=True, choices=("draft", "final"))
|
|
66
|
+
return parser.parse_args()
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def read_text(path: Path) -> str:
|
|
70
|
+
return path.read_text(encoding="utf-8")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def normalize_fragment(value: str) -> str:
|
|
74
|
+
value = re.sub(r"\s+", " ", value.strip().strip("`").strip())
|
|
75
|
+
return value.lower()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def split_fragments(value: str) -> list[str]:
|
|
79
|
+
fragments: list[str] = []
|
|
80
|
+
for fragment in re.split(r"[,;,;、\n]+", value):
|
|
81
|
+
cleaned = fragment.strip().strip("`").strip()
|
|
82
|
+
if cleaned and cleaned.lower() not in {"none", "n/a", "na", "无", "不适用", "todo", "tbd"}:
|
|
83
|
+
fragments.append(cleaned)
|
|
84
|
+
return fragments
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def load_allowed_fragments(glossary_path: str | None, explicit: list[str]) -> set[str]:
|
|
88
|
+
allowed = {normalize_fragment(fragment) for fragment in DEFAULT_ALLOWED_FRAGMENTS}
|
|
89
|
+
allowed.update(normalize_fragment(fragment) for fragment in explicit if fragment.strip())
|
|
90
|
+
if not glossary_path:
|
|
91
|
+
return allowed
|
|
92
|
+
path = Path(glossary_path)
|
|
93
|
+
if not path.exists():
|
|
94
|
+
return allowed
|
|
95
|
+
text = read_text(path)
|
|
96
|
+
for field, value in FIELD_RE.findall(text):
|
|
97
|
+
normalized_field = field.strip().lower()
|
|
98
|
+
if normalized_field in {
|
|
99
|
+
"allowed english fragments",
|
|
100
|
+
"allowed english fragments that may remain in chinese prose",
|
|
101
|
+
"allowed english fragments that may remain in zh prose",
|
|
102
|
+
"允许保留的英文片段",
|
|
103
|
+
}:
|
|
104
|
+
allowed.update(normalize_fragment(fragment) for fragment in split_fragments(value))
|
|
105
|
+
return allowed
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def strip_latex_noise(text: str) -> str:
|
|
109
|
+
text = re.sub(r"%.*", " ", text)
|
|
110
|
+
text = re.sub(r"\\begin\{[^}]+\}", " ", text)
|
|
111
|
+
text = re.sub(r"\\end\{[^}]+\}", " ", text)
|
|
112
|
+
text = re.sub(r"\\(?:cite|citep|citet|ref|eqref|label|url|href|path|input|includegraphics)\*?(?:\[[^\]]*\])?\{[^}]*\}", " ", text)
|
|
113
|
+
text = re.sub(r"\$\$[\s\S]*?\$\$", " ", text)
|
|
114
|
+
text = re.sub(r"\$[^$]*\$", " ", text)
|
|
115
|
+
text = re.sub(r"\\\[[\s\S]*?\\\]", " ", text)
|
|
116
|
+
text = re.sub(r"\\\([\s\S]*?\\\)", " ", text)
|
|
117
|
+
text = re.sub(r"\\[A-Za-z@*]+(?:\[[^\]]*\])?", " ", text)
|
|
118
|
+
text = text.replace("{", " ").replace("}", " ")
|
|
119
|
+
text = text.replace("~", " ")
|
|
120
|
+
return text
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def first_mention_fragments(text: str) -> list[str]:
|
|
124
|
+
return [normalize_fragment(match.group(1)) for match in FIRST_MENTION_RE.finditer(text)]
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def remove_first_mention_parentheticals(text: str) -> str:
|
|
128
|
+
return FIRST_MENTION_RE.sub(" ", text)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def should_ignore_candidate(candidate: str, allowed: set[str]) -> bool:
|
|
132
|
+
normalized = normalize_fragment(candidate)
|
|
133
|
+
if not normalized:
|
|
134
|
+
return True
|
|
135
|
+
if normalized in allowed:
|
|
136
|
+
return True
|
|
137
|
+
if normalized.replace(" ", "") in allowed:
|
|
138
|
+
return True
|
|
139
|
+
tokens = re.findall(r"[A-Za-z][A-Za-z0-9+]*", candidate)
|
|
140
|
+
if not tokens:
|
|
141
|
+
return True
|
|
142
|
+
if all(token.lower() in allowed for token in tokens):
|
|
143
|
+
return True
|
|
144
|
+
if all(token.isupper() or re.fullmatch(r"[A-Z][A-Za-z]*\d*", token) for token in tokens) and len(tokens) == 1:
|
|
145
|
+
return True
|
|
146
|
+
return False
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def find_mixed_fragments(text: str, allowed: set[str]) -> list[tuple[int, str]]:
|
|
150
|
+
issues: list[tuple[int, str]] = []
|
|
151
|
+
stripped = strip_latex_noise(remove_first_mention_parentheticals(text))
|
|
152
|
+
for line_no, line in enumerate(stripped.splitlines(), start=1):
|
|
153
|
+
if not CJK_RE.search(line):
|
|
154
|
+
continue
|
|
155
|
+
seen_on_line: set[str] = set()
|
|
156
|
+
for match in ENGLISH_FRAGMENT_RE.finditer(line):
|
|
157
|
+
candidate = match.group(1).strip()
|
|
158
|
+
if " " not in candidate and "-" not in candidate:
|
|
159
|
+
continue
|
|
160
|
+
normalized = normalize_fragment(candidate)
|
|
161
|
+
if normalized in seen_on_line:
|
|
162
|
+
continue
|
|
163
|
+
seen_on_line.add(normalized)
|
|
164
|
+
if should_ignore_candidate(candidate, allowed):
|
|
165
|
+
continue
|
|
166
|
+
issues.append((line_no, candidate))
|
|
167
|
+
return issues
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def validate_files(files: list[str], allowed: set[str]) -> list[str]:
|
|
171
|
+
issues: list[str] = []
|
|
172
|
+
for file_name in files:
|
|
173
|
+
path = Path(file_name)
|
|
174
|
+
if not path.exists():
|
|
175
|
+
issues.append(f"workflow-language file does not exist: {path}")
|
|
176
|
+
continue
|
|
177
|
+
text = read_text(path)
|
|
178
|
+
mentions = Counter(first_mention_fragments(text))
|
|
179
|
+
for fragment, count in mentions.items():
|
|
180
|
+
if count > 1:
|
|
181
|
+
issues.append(
|
|
182
|
+
f"{path}: English first-mention parenthetical '{fragment}' appears {count} times; define it once, then use the Chinese short form"
|
|
183
|
+
)
|
|
184
|
+
for line_no, fragment in find_mixed_fragments(text, allowed):
|
|
185
|
+
issues.append(
|
|
186
|
+
f"{path}:{line_no}: English concept fragment '{fragment}' appears in Chinese workflow-language prose; translate it, define it once as a first mention, or add a justified glossary exception"
|
|
187
|
+
)
|
|
188
|
+
return issues
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def main() -> int:
|
|
192
|
+
args = parse_args()
|
|
193
|
+
if args.workflow_language.lower() != "zh":
|
|
194
|
+
print(f"workflow-language text validation skipped for workflow_language={args.workflow_language}")
|
|
195
|
+
return 0
|
|
196
|
+
if not args.file:
|
|
197
|
+
message = "at least one --file is required for zh workflow-language validation"
|
|
198
|
+
if args.mode == "draft":
|
|
199
|
+
print(f"WARNING: {message}")
|
|
200
|
+
return 0
|
|
201
|
+
print(message, file=sys.stderr)
|
|
202
|
+
return 1
|
|
203
|
+
|
|
204
|
+
allowed = load_allowed_fragments(args.terminology_glossary, args.allowed_fragment)
|
|
205
|
+
issues = validate_files(args.file, allowed)
|
|
206
|
+
if not issues:
|
|
207
|
+
print("workflow-language text is valid")
|
|
208
|
+
return 0
|
|
209
|
+
|
|
210
|
+
if args.mode == "draft":
|
|
211
|
+
for issue in issues:
|
|
212
|
+
print(f"WARNING: {issue}")
|
|
213
|
+
return 0
|
|
214
|
+
|
|
215
|
+
for issue in issues:
|
|
216
|
+
print(issue, file=sys.stderr)
|
|
217
|
+
return 1
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
if __name__ == "__main__":
|
|
221
|
+
raise SystemExit(main())
|
|
@@ -9,6 +9,7 @@ Use this glossary during `/lab:write` to keep reader-facing naming stable.
|
|
|
9
9
|
- Use natural-language full names in prose.
|
|
10
10
|
- Do not use labels containing `_` or `-` in reader-facing prose.
|
|
11
11
|
- Keep internal identifiers, config keys, and experiment package labels out of prose unless they are mapped once for the reader and then moved back out of prose.
|
|
12
|
+
- Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments such as `residual-fitting pathology`, `treated-group noise`, or `gain-head function class` throughout Chinese prose.
|
|
12
13
|
|
|
13
14
|
## Entries
|
|
14
15
|
|
|
@@ -17,6 +18,10 @@ Use this glossary during `/lab:write` to keep reader-facing naming stable.
|
|
|
17
18
|
- Canonical paper-facing term:
|
|
18
19
|
- Full form at first mention:
|
|
19
20
|
- Approved short form or acronym:
|
|
21
|
+
- Chinese short form, if workflow_language is zh:
|
|
22
|
+
- English full form plus acronym allowed at first mention:
|
|
23
|
+
- Allowed English fragments that may remain in Chinese prose:
|
|
24
|
+
- Subsequent-language rule:
|
|
20
25
|
- Reader-facing explanation:
|
|
21
26
|
- Why this term matters here:
|
|
22
27
|
- First-use section:
|
|
@@ -49,7 +49,7 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
|
|
|
49
49
|
- If the stage says improvement is needed, do not choose `stop` unless the next action states a concrete terminal boundary such as budget exhaustion, frozen-core risk, safety or integrity failure, impossible target, or a required approval boundary. Otherwise choose `continue`, `revise`, `rerun`, or `escalate`.
|
|
50
50
|
- Stage reports are closeout and handoff artifacts, not a new user command and not a replacement for stage-specific artifacts such as idea memos, iteration reports, final reports, or write-iteration records.
|
|
51
51
|
- Run `.lab/.managed/scripts/validate_stage_report.py --stage-report <stage-report> --stage <stage>` before claiming the stage is complete, and include the stage-report path plus validation result in the final user-facing summary.
|
|
52
|
-
- For `/lab:auto`, the final user-facing answer must visibly consume the validated stage report: summarize requested deliverable statuses, Core Explanation Table rows, evidence paths, validation/verification commands and results, known gaps, and the next action. A chat-only chronological result list is not
|
|
52
|
+
- For `/lab:auto`, the final user-facing answer must visibly consume the validated stage report and use the Result Closeout Shape as top-level headings: `Requested outcome status`, `Plain-language result table`, `Evidence and validation`, and `Gaps and next action`. It must summarize requested deliverable statuses, Core Explanation Table rows, evidence paths, validation/verification commands and results, known gaps, and the next action. A chat-only chronological result list or top-level `核心修复` / `主要修改文件` closeout is not valid.
|
|
53
53
|
- Final paper output should default to LaTeX, and its manuscript language should be decided separately from the workflow language.
|
|
54
54
|
- Separate sourced facts from model-generated hypotheses.
|
|
55
55
|
- Preserve failed runs, failed ideas, and limitations.
|
|
@@ -313,6 +313,8 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
|
|
|
313
313
|
- For each subsection, explicitly cover motivation, design, and technical advantage when applicable.
|
|
314
314
|
- Keep terminology stable across rounds and sections.
|
|
315
315
|
- Maintain `.lab/writing/terminology-glossary.md` as the write-stage source for full forms, approved short forms, reader-facing explanations, allowed aliases, and terms that should stay out of prose.
|
|
316
|
+
- When `workflow_language=zh`, use Chinese workflow-language terminology: concept terms need a Chinese paper-facing name and Chinese short form by default; English full form plus acronym may appear only at first mention, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally.
|
|
317
|
+
- When completing Chinese workflow-language output, run `validate_workflow_language_text.py` on touched sections, tables, figures, and analysis assets before claiming the round is accepted; unresolved English concept fragments are blockers for final/export write rounds.
|
|
316
318
|
- Maintain `.lab/writing/metric-glossary.md` as the write-stage source for reported metric names, definitions, calculations, denominators, directions, scopes, and aliases.
|
|
317
319
|
- When a round introduces or revises key terms, include a compact terminology note in the user-facing write summary and record the terminology-clarity self-check in the latest write iteration artifact.
|
|
318
320
|
- When a round introduces or revises metrics, include a compact metric-glossary note in the user-facing write summary and record the metric-glossary validation in the latest write iteration artifact.
|
|
@@ -233,6 +233,11 @@
|
|
|
233
233
|
- Run `.lab/.managed/scripts/validate_stage_report.py --stage-report <stage-report> --stage auto` and include the report path plus validation result in the final user-facing summary.
|
|
234
234
|
- Final visible closeout is mandatory after validation. Do not end `/lab:auto` with only "done", "pushed", "completed", or a chronological command log.
|
|
235
235
|
- The final visible closeout must be derived from the validated stage report, not from a separate improvised narrative.
|
|
236
|
+
- Use this Result Closeout Shape exactly as the top-level structure:
|
|
237
|
+
- `Requested outcome status`
|
|
238
|
+
- `Plain-language result table`
|
|
239
|
+
- `Evidence and validation`
|
|
240
|
+
- `Gaps and next action`
|
|
236
241
|
- The final visible closeout must include:
|
|
237
242
|
- the user's requested deliverables or objectives and their status: completed, repaired, failed-gate, not promoted, blocked, or handoff
|
|
238
243
|
- the key Core Explanation Table rows: what was done, how it was done, what worked, what did not work, what was verified, what remains unverified, whether improvement is needed and why, how to improve and why
|
|
@@ -240,4 +245,6 @@
|
|
|
240
245
|
- validation/verification commands and validation result, including commands that could not run
|
|
241
246
|
- known gaps or compile/runtime limitations
|
|
242
247
|
- next action and why that action is appropriate
|
|
248
|
+
- The `Plain-language result table` must answer, in user-facing language, what was requested, what changed, what worked, what did not work, what was verified, what remains unverified, and whether improvement is still needed.
|
|
249
|
+
- Do not use top-level closeout headings such as `Core fixes`, `核心修复`, `Main modified files`, `主要修改文件`, `Done`, or `已推送`. If useful, put file lists, commits, or modification details under the required four headings.
|
|
243
250
|
- If the final answer says the work is "completed", it must still name any remaining handoff boundary such as PDF compile, layout check, external approval, budget exhaustion, frozen-core risk, or missing environment.
|
|
@@ -187,6 +187,8 @@ Do not enter prose polish until the current section has passed the reference-con
|
|
|
187
187
|
- If any section-level acceptance item is still unresolved, spend the round fixing that blocker instead of doing more prose polish.
|
|
188
188
|
- 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.
|
|
189
189
|
- Use natural-language full names in prose. If an approved short form is needed later, define it once and reuse it consistently.
|
|
190
|
+
- Chinese workflow-language terminology must be stricter than generic first-mention rules. When `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments such as `residual-fitting pathology`, `treated-group noise`, `gain-head function class`, `input-matched`, or `refinement` throughout Chinese prose.
|
|
191
|
+
- For `workflow_language=zh`, run `validate_workflow_language_text.py` over touched workflow-language sections, tables, figures, and analysis assets before completing the round. If it reports English concept fragments, translate them, define them once as `中文全称(English full form, ACRONYM)`, or add a justified glossary exception before prose polish.
|
|
190
192
|
- Do not use labels containing `_` or `-` in reader-facing prose.
|
|
191
193
|
- Keep internal identifiers, config keys, and experiment package labels out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose.
|
|
192
194
|
- Keep run provenance such as tuning-run labels, probe names, internal config strings, rerun ids, and package labels out of reader-facing prose. If the evidence is useful, rewrite it as a bounded paper-facing diagnostic or move the raw provenance to workflow notes or appendix metadata.
|