superlab 0.1.77 → 0.1.79

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.
@@ -1,5 +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
+ "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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.",
3
3
  "stage_prompt": {
4
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.",
5
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,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
14
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
15
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,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
14
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
15
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,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
14
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
15
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,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
14
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
15
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.
@@ -8,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
12
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
13
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.
@@ -8,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
12
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
13
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.
@@ -8,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
12
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
13
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.
@@ -8,6 +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
+ 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. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
12
+ For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
13
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,237 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import re
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ from paper_topology import find_project_root, resolve_paper_topology
10
+ from validate_manuscript_delivery import (
11
+ REQUIRED_FIGURE_FILES,
12
+ REQUIRED_TABLE_FILES,
13
+ check_analysis_asset,
14
+ check_asset_consumption,
15
+ check_bibliography,
16
+ check_experiments_section,
17
+ check_figure_file,
18
+ check_global_tex,
19
+ check_introduction_section,
20
+ check_language_layers,
21
+ check_latest_write_iteration_preflight,
22
+ check_main_tex,
23
+ check_method_section,
24
+ check_table_file,
25
+ )
26
+ from validate_paper_topology import validate_topology_artifacts
27
+ from validate_workflow_language_text import load_allowed_fragments, validate_files
28
+
29
+
30
+ INPUT_RE = re.compile(r"\\(?:input|include|wlpath)\{([^}]+)\}")
31
+ REF_RE = re.compile(r"\\(?:auto|c|C)?ref\{([^}]+)\}|\\(?:eqref|pageref)\{([^}]+)\}")
32
+ CITE_RE = re.compile(r"\\(?:cite|citep|citet)\*?(?:\[[^\]]*\])?\{([^}]+)\}")
33
+ LABEL_RE = re.compile(r"\\label\{([^}]+)\}")
34
+ BIB_KEY_RE = re.compile(r"@\w+\{([^,\s]+),")
35
+
36
+
37
+ def parse_args() -> argparse.Namespace:
38
+ parser = argparse.ArgumentParser(
39
+ description="Validate the active paper layer as a whole instead of checking only one section file."
40
+ )
41
+ parser.add_argument("--project-root", required=True, help="Project root containing .lab/config/workflow.json")
42
+ parser.add_argument(
43
+ "--layer",
44
+ default="active",
45
+ choices=("active", "canonical", "workflow-language"),
46
+ help="Which paper layer to validate",
47
+ )
48
+ parser.add_argument("--mode", required=True, choices=("draft", "final", "export"))
49
+ return parser.parse_args()
50
+
51
+
52
+ def read_text(path: Path) -> str:
53
+ return path.read_text(encoding="utf-8")
54
+
55
+
56
+ def strip_comments(text: str) -> str:
57
+ return re.sub(r"(?<!\\)%.*", "", text)
58
+
59
+
60
+ def resolve_target_layer(project_root: Path, layer: str) -> tuple[str, Path | None, str | None]:
61
+ topology = resolve_paper_topology(project_root)
62
+ workflow_config_path = project_root / ".lab" / "config" / "workflow.json"
63
+ workflow_config = {}
64
+ if workflow_config_path.exists():
65
+ import json
66
+
67
+ workflow_config = json.loads(workflow_config_path.read_text(encoding="utf-8"))
68
+
69
+ if layer == "workflow-language":
70
+ return "workflow-language", topology["workflow_root"], workflow_config.get("workflow_language")
71
+ if layer == "canonical":
72
+ return "canonical", topology["canonical_root"], workflow_config.get("paper_language") or workflow_config.get("workflow_language")
73
+ if topology["workflow_language_active"] and topology["workflow_root"] is not None:
74
+ return "workflow-language", topology["workflow_root"], workflow_config.get("workflow_language")
75
+ return "canonical", topology["canonical_root"], workflow_config.get("paper_language") or workflow_config.get("workflow_language")
76
+
77
+
78
+ def collect_tex_files(layer_root: Path) -> list[Path]:
79
+ return sorted(path for path in layer_root.rglob("*.tex") if path.is_file())
80
+
81
+
82
+ def resolve_input_target(source_file: Path, layer_root: Path, raw_target: str) -> Path | None:
83
+ target = raw_target.strip()
84
+ if not target:
85
+ return None
86
+ candidates: list[Path] = []
87
+ target_path = Path(target)
88
+ if target_path.is_absolute():
89
+ candidates.append(target_path)
90
+ else:
91
+ paths_to_try = [target_path]
92
+ if target_path.suffix == "":
93
+ paths_to_try.append(target_path.with_suffix(".tex"))
94
+ for candidate in paths_to_try:
95
+ candidates.append((source_file.parent / candidate).resolve())
96
+ candidates.append((layer_root / candidate).resolve())
97
+ for candidate in candidates:
98
+ if candidate.exists():
99
+ return candidate
100
+ return candidates[0] if candidates else None
101
+
102
+
103
+ def parse_bibliography_keys(layer_root: Path) -> set[str]:
104
+ keys: set[str] = set()
105
+ for bib_path in sorted(layer_root.glob("*.bib")):
106
+ text = read_text(bib_path)
107
+ for match in BIB_KEY_RE.finditer(text):
108
+ keys.add(match.group(1).strip())
109
+ return keys
110
+
111
+
112
+ def validate_latex_graph(layer_root: Path, tex_files: list[Path]) -> list[str]:
113
+ issues: list[str] = []
114
+ main_tex = layer_root / "main.tex"
115
+ if not main_tex.exists():
116
+ issues.append(f"{layer_root}: missing main.tex for paper-layer validation")
117
+ if not tex_files:
118
+ issues.append(f"{layer_root}: no .tex files found in the target paper layer")
119
+ return issues
120
+
121
+ labels: dict[str, Path] = {}
122
+ refs: list[tuple[Path, str]] = []
123
+ cites: list[tuple[Path, str]] = []
124
+
125
+ for tex_path in tex_files:
126
+ text = strip_comments(read_text(tex_path))
127
+ for match in INPUT_RE.finditer(text):
128
+ target = resolve_input_target(tex_path, layer_root, match.group(1))
129
+ if target is None or not target.exists():
130
+ issues.append(
131
+ f"{tex_path}: missing LaTeX include target `{match.group(1)}` inside the active paper layer"
132
+ )
133
+ for match in LABEL_RE.finditer(text):
134
+ label = match.group(1).strip()
135
+ if not label:
136
+ continue
137
+ if label in labels and labels[label] != tex_path:
138
+ issues.append(
139
+ f"duplicate LaTeX label `{label}` appears in both {labels[label]} and {tex_path}"
140
+ )
141
+ labels[label] = tex_path
142
+ for match in REF_RE.finditer(text):
143
+ label = next(group for group in match.groups() if group)
144
+ refs.append((tex_path, label.strip()))
145
+ for match in CITE_RE.finditer(text):
146
+ for key in match.group(1).split(","):
147
+ normalized = key.strip()
148
+ if normalized:
149
+ cites.append((tex_path, normalized))
150
+
151
+ for tex_path, label in refs:
152
+ if label not in labels:
153
+ issues.append(f"{tex_path}: unresolved LaTeX reference `{label}` in the active paper layer")
154
+
155
+ bibliography_keys = parse_bibliography_keys(layer_root)
156
+ if cites and not bibliography_keys:
157
+ issues.append(f"{layer_root}: citations are present but no bibliography keys were found in the paper layer")
158
+ for tex_path, key in cites:
159
+ if bibliography_keys and key not in bibliography_keys:
160
+ issues.append(f"{tex_path}: unresolved bibliography key `{key}` in the active paper layer")
161
+
162
+ return issues
163
+
164
+
165
+ def validate_manuscript_delivery_layer(layer_root: Path) -> list[str]:
166
+ issues: list[str] = []
167
+ check_main_tex(layer_root, issues)
168
+ check_bibliography(layer_root, issues)
169
+ check_global_tex(layer_root, issues)
170
+ check_introduction_section(layer_root, issues)
171
+ check_method_section(layer_root, issues)
172
+ check_experiments_section(layer_root, issues)
173
+ check_asset_consumption(layer_root, issues)
174
+ check_language_layers(layer_root, issues)
175
+ check_latest_write_iteration_preflight(layer_root, issues)
176
+
177
+ tables_dir = layer_root / "tables"
178
+ check_table_file(tables_dir / REQUIRED_TABLE_FILES[0], issues, "tables/main-results.tex")
179
+ check_table_file(tables_dir / REQUIRED_TABLE_FILES[1], issues, "tables/ablations.tex")
180
+
181
+ figures_dir = layer_root / "figures"
182
+ check_figure_file(figures_dir / REQUIRED_FIGURE_FILES[0], issues, "figures/problem-setting.tex")
183
+ check_figure_file(figures_dir / REQUIRED_FIGURE_FILES[1], issues, "figures/method-overview.tex")
184
+ check_figure_file(figures_dir / REQUIRED_FIGURE_FILES[2], issues, "figures/results-overview.tex")
185
+
186
+ analysis_dir = layer_root / "analysis"
187
+ check_analysis_asset(analysis_dir / "analysis-asset.tex", issues)
188
+ return issues
189
+
190
+
191
+ def validate_layer(project_root: Path, layer: str, mode: str) -> tuple[list[str], str, Path | None]:
192
+ issues: list[str] = []
193
+ resolved_layer, layer_root, layer_language = resolve_target_layer(project_root, layer)
194
+ if layer_root is None:
195
+ issues.append("workflow-language paper layer is not active for this project")
196
+ return issues, resolved_layer, layer_root
197
+ if not layer_root.exists():
198
+ issues.append(f"paper layer does not exist: {layer_root}")
199
+ return issues, resolved_layer, layer_root
200
+
201
+ issues.extend(validate_topology_artifacts(project_root))
202
+
203
+ tex_files = collect_tex_files(layer_root)
204
+ issues.extend(validate_latex_graph(layer_root, tex_files))
205
+
206
+ if layer_language == "zh":
207
+ glossary_path = project_root / ".lab" / "writing" / "terminology-glossary.md"
208
+ allowed = load_allowed_fragments(str(glossary_path) if glossary_path.exists() else None, [])
209
+ issues.extend(validate_files([str(path) for path in tex_files], allowed))
210
+
211
+ if mode in {"final", "export"}:
212
+ issues.extend(validate_manuscript_delivery_layer(layer_root))
213
+
214
+ return issues, resolved_layer, layer_root
215
+
216
+
217
+ def main() -> int:
218
+ args = parse_args()
219
+ project_root = find_project_root(Path(args.project_root).resolve())
220
+ if project_root is None:
221
+ print("could not find .lab/config/workflow.json for project root", file=sys.stderr)
222
+ return 1
223
+
224
+ issues, resolved_layer, layer_root = validate_layer(project_root, args.layer, args.mode)
225
+ if issues:
226
+ for issue in issues:
227
+ print(issue, file=sys.stderr)
228
+ return 1
229
+
230
+ print(
231
+ f"paper layer is valid: {resolved_layer} -> {layer_root}"
232
+ )
233
+ return 0
234
+
235
+
236
+ if __name__ == "__main__":
237
+ raise SystemExit(main())
@@ -17,6 +17,9 @@ ENGLISH_FRAGMENT_RE = re.compile(
17
17
  r"(?:[ \t]+[A-Za-z][A-Za-z0-9+]*(?:-[A-Za-z][A-Za-z0-9+]*)*)*)(?![A-Za-z0-9_])"
18
18
  )
19
19
  FIELD_RE = re.compile(r"^[ \t]*-[ \t]*([^::]+)[::][ \t]*([^\n]*)[ \t]*$", flags=re.MULTILINE)
20
+ PAPER_FACING_COMMAND_RE = re.compile(
21
+ r"\\(?:section|subsection|subsubsection|paragraph|subparagraph|caption)\*?\{([^}]*)\}"
22
+ )
20
23
 
21
24
 
22
25
  DEFAULT_ALLOWED_FRAGMENTS = {
@@ -146,6 +149,22 @@ def should_ignore_candidate(candidate: str, allowed: set[str]) -> bool:
146
149
  return False
147
150
 
148
151
 
152
+ def should_ignore_heading_candidate(candidate: str, allowed: set[str]) -> bool:
153
+ normalized = normalize_fragment(candidate)
154
+ if not normalized:
155
+ return True
156
+ if normalized in allowed or normalized.replace(" ", "") in allowed:
157
+ return True
158
+ tokens = re.findall(r"[A-Za-z][A-Za-z0-9+]*", candidate)
159
+ if not tokens:
160
+ return True
161
+ if all(token.lower() in allowed for token in tokens):
162
+ return True
163
+ if len(tokens) == 1 and re.fullmatch(r"[A-Z0-9+\-]{2,}", tokens[0]):
164
+ return True
165
+ return False
166
+
167
+
149
168
  def find_mixed_fragments(text: str, allowed: set[str]) -> list[tuple[int, str]]:
150
169
  issues: list[tuple[int, str]] = []
151
170
  stripped = strip_latex_noise(remove_first_mention_parentheticals(text))
@@ -167,6 +186,30 @@ def find_mixed_fragments(text: str, allowed: set[str]) -> list[tuple[int, str]]:
167
186
  return issues
168
187
 
169
188
 
189
+ def strip_inline_latex_markup(text: str) -> str:
190
+ text = re.sub(r"\\[A-Za-z@*]+(?:\[[^\]]*\])?", " ", text)
191
+ text = text.replace("{", " ").replace("}", " ")
192
+ return re.sub(r"\s+", " ", text).strip()
193
+
194
+
195
+ def find_heading_english_fragments(text: str, allowed: set[str]) -> list[tuple[int, str]]:
196
+ issues: list[tuple[int, str]] = []
197
+ for line_no, line in enumerate(text.splitlines(), start=1):
198
+ seen_on_line: set[str] = set()
199
+ for match in PAPER_FACING_COMMAND_RE.finditer(line):
200
+ candidate = strip_inline_latex_markup(match.group(1))
201
+ if not candidate or CJK_RE.search(candidate) or not re.search(r"[A-Za-z]", candidate):
202
+ continue
203
+ normalized = normalize_fragment(candidate)
204
+ if normalized in seen_on_line:
205
+ continue
206
+ seen_on_line.add(normalized)
207
+ if should_ignore_heading_candidate(candidate, allowed):
208
+ continue
209
+ issues.append((line_no, candidate))
210
+ return issues
211
+
212
+
170
213
  def validate_files(files: list[str], allowed: set[str]) -> list[str]:
171
214
  issues: list[str] = []
172
215
  for file_name in files:
@@ -185,6 +228,10 @@ def validate_files(files: list[str], allowed: set[str]) -> list[str]:
185
228
  issues.append(
186
229
  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
230
  )
231
+ for line_no, fragment in find_heading_english_fragments(text, allowed):
232
+ issues.append(
233
+ f"{path}:{line_no}: English paper-facing heading or caption '{fragment}' appears in Chinese workflow-language LaTeX; translate it, define it once locally, or add a justified glossary exception"
234
+ )
188
235
  return issues
189
236
 
190
237
 
@@ -22,9 +22,15 @@
22
22
 
23
23
  ## External Rebuttal Intake
24
24
 
25
- | Source | Raw criticism summary | Affected unit | Reviewer axis | Severity | Route | Acceptance check |
26
- | --- | --- | --- | --- | --- | --- | --- |
27
- | | | | | | | |
25
+ | Source | Raw criticism summary | Affected unit | Reviewer axis | Severity | Why it matters | Route | Acceptance check |
26
+ | --- | --- | --- | --- | --- | --- | --- | --- |
27
+ | | | | | | | | |
28
+
29
+ ## Revision Traceability
30
+
31
+ | Author claim or revised statement | Claimed artifact location | Independently verified | Remaining gap |
32
+ | --- | --- | --- | --- |
33
+ | | | | |
28
34
 
29
35
  ## Reviewer Panel Findings
30
36
 
@@ -70,9 +76,15 @@
70
76
 
71
77
  ## Actionable Issue Register
72
78
 
73
- | ID | Axis | Severity | Affected artifact | Finding | Required fix | Route | Acceptance check | Core mutation required |
74
- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
75
- | | | | | | | | | |
79
+ | ID | Axis | Severity | Affected artifact | Finding | Why it matters | Required fix | Route | Acceptance check | Core mutation required |
80
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
81
+ | | | | | | | | | | |
82
+
83
+ ## Consensus / Disagreement / Resolution
84
+
85
+ - Consensus:
86
+ - Disagreement:
87
+ - Resolution:
76
88
 
77
89
  ## Core Mutation Check
78
90
 
@@ -314,7 +314,7 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
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
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.
317
+ - When completing Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before claiming the round is accepted; use `validate_workflow_language_text.py` only as a local repair helper when the layer validator identifies specific offending files.
318
318
  - Maintain `.lab/writing/metric-glossary.md` as the write-stage source for reported metric names, definitions, calculations, denominators, directions, scopes, and aliases.
319
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.
320
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.
@@ -0,0 +1,34 @@
1
+ # Argument Stress Test
2
+
3
+ Run this after the logic pass and before language polish. The goal is to break weak argument chains early.
4
+
5
+ ## Required Checks
6
+
7
+ 1. **Weakest-link test**
8
+ Which paragraph carries the most unsupported inference? Rewrite or narrow it first.
9
+
10
+ 2. **Reverse-claim test**
11
+ If the main claim were false, which sentence in this section would fail first? That sentence usually reveals the overclaim.
12
+
13
+ 3. **Alternative-explanation test**
14
+ What simpler explanation could produce the same pattern? State it explicitly and check whether the section already weakens it.
15
+
16
+ 4. **Boundary test**
17
+ What does the current evidence still not justify? Add that limit before polishing.
18
+
19
+ 5. **Evidence-trace test**
20
+ Can every major claim be traced to a figure, table, protocol statement, citation, or definition already present?
21
+
22
+ ## Section-Specific Triggers
23
+
24
+ - **Introduction**: would the paper still look necessary if the claimed challenge were softened?
25
+ - **Method**: could a reviewer say the module is an arbitrary stack choice?
26
+ - **Experiments**: does the prose explain what the result teaches, not only what number is larger?
27
+ - **Conclusion**: does any sentence exceed what the experiments actually support?
28
+
29
+ ## Repair Moves
30
+
31
+ 1. Replace vague claims with a narrower mechanism claim.
32
+ 2. Add one explicit bridge sentence from evidence to interpretation.
33
+ 3. Move unsupported motivation out of results and back into hypothesis language.
34
+ 4. State the remaining alternative explanation if it is not fully ruled out.
@@ -0,0 +1,59 @@
1
+ # Section Question Bank
2
+
3
+ Use this file before drafting or revising a paper section. The goal is to force one pass on section purpose before wording.
4
+
5
+ ## Global Questions
6
+
7
+ 1. What single job must this section do for the paper?
8
+ 2. What must the reader understand after this section that they did not understand before?
9
+ 3. Which claim, protocol, metric, or boundary does this section depend on?
10
+ 4. Which paragraph is most likely to confuse a skeptical reviewer?
11
+ 5. Which sentence would become false if one supporting result disappeared?
12
+
13
+ ## Abstract
14
+
15
+ 1. Is the task clear in one pass?
16
+ 2. Is the gap tied to prior work rather than hype?
17
+ 3. Is the mechanism-level insight visible?
18
+ 4. Is the main result bounded by scope?
19
+ 5. Is the main boundary stated?
20
+
21
+ ## Introduction
22
+
23
+ 1. What common assumption or prior explanation is being challenged?
24
+ 2. What failure, anomaly, or unmet need forces the paper to exist?
25
+ 3. What is the core insight anchor?
26
+ 4. Why does the proposed direction follow from that insight?
27
+ 5. Which contribution is truly central, and which are supporting?
28
+
29
+ ## Related Work
30
+
31
+ 1. What are the 2-4 actual research clusters readers need?
32
+ 2. Which paper is the closest prior work?
33
+ 3. What exact capability remains unresolved in each cluster?
34
+ 4. Does each cluster end with a gap statement?
35
+ 5. Did any paragraph become a citation list instead of a comparison?
36
+
37
+ ## Method
38
+
39
+ 1. Which design choice would a reviewer call arbitrary?
40
+ 2. What problem forces each module, loss, or representation?
41
+ 3. Is the information flow described in executable order?
42
+ 4. What technical effect is expected from each major design?
43
+ 5. Which term or label still lacks a first-mention explanation?
44
+
45
+ ## Experiments
46
+
47
+ 1. Are dataset scope, split protocol, and baseline setup separately visible?
48
+ 2. Is each metric defined once in reader-facing language?
49
+ 3. Which table answers the main effectiveness question?
50
+ 4. Which ablation rules out the strongest simpler explanation?
51
+ 5. What boundary or failure mode remains after the main result?
52
+
53
+ ## Conclusion
54
+
55
+ 1. What is the strongest supported takeaway?
56
+ 2. What broader principle follows from that takeaway?
57
+ 3. What boundary prevents overclaiming?
58
+ 4. What next step follows from the boundary instead of from habit?
59
+ 5. Did the section introduce any new evidence or claim?
@@ -0,0 +1,33 @@
1
+ # Writing Anti-Patterns
2
+
3
+ Run this only after logic and theory blockers are cleared. The goal is to remove common low-quality prose habits without inventing new content.
4
+
5
+ ## Common Anti-Patterns
6
+
7
+ 1. **Throat-clearing openings**
8
+ Paragraphs that spend one or two sentences warming up before making the point. Move the point to the first sentence.
9
+
10
+ 2. **Uniform paragraph length**
11
+ Every paragraph having the same size often signals template writing rather than argument structure. Split or merge by idea, not by rhythm.
12
+
13
+ 3. **Synonym cycling**
14
+ Switching among multiple names for the same concept creates false variety and weakens terminology control. Keep one canonical paper-facing name.
15
+
16
+ 4. **Generic evaluative vocabulary**
17
+ Words such as `important`, `significant`, `effective`, `clear`, or `promising` without concrete content. Replace with the specific consequence, metric, or boundary.
18
+
19
+ 5. **List-shaped filler**
20
+ Sentences that pile up three or more loosely related claims to sound complete. Split them into one claim per sentence when the logic differs.
21
+
22
+ 6. **Overconnected transitions**
23
+ Repeated `therefore`, `moreover`, `furthermore`, or similar connectors can hide weak logic. Keep the connective only when the relation is explicit.
24
+
25
+ 7. **Meta-writer commentary**
26
+ Phrases about what the paper is doing rather than the research itself, unless the sentence is a legitimate roadmap or scope statement.
27
+
28
+ ## Quick Repair Questions
29
+
30
+ 1. Can the first sentence of each paragraph state the paragraph's job directly?
31
+ 2. Did any concept get renamed just to avoid repetition?
32
+ 3. Can a vague adjective be replaced by a metric, mechanism, or constraint?
33
+ 4. Did any sentence become longer because two different ideas were forced together?
@@ -56,11 +56,23 @@ For each external comment, record:
56
56
  - affected paper unit: claim, section, table, figure, protocol, metric, threat model, experiment, or wording
57
57
  - reviewer axis: R1, R2, R3, R4, or R5
58
58
  - severity: fatal, major, minor, or clarification
59
+ - why it matters: what acceptance risk or scientific risk it creates
59
60
  - route: `write`, `iterate`, `report`, `framing`, `data`, `spec`, or `ask-user`
60
61
  - acceptance check: concrete evidence or manuscript condition that resolves the issue
61
62
 
62
63
  Do not answer external criticism with prose-only reassurance. If the issue is valid, it must become a repair task. If it is invalid, state the evidence that rules it out.
63
64
 
65
+ ## Revision Traceability
66
+
67
+ When the paper already contains a claimed repair, rebuttal response, or revised section, record:
68
+
69
+ - author claim: what the current draft or response says was fixed
70
+ - claimed artifact location: where the claimed fix lives
71
+ - independently verified: yes / no / partial
72
+ - remaining gap: what still fails the acceptance check
73
+
74
+ Do not mark an issue resolved only because the manuscript says it was resolved. The pass must independently verify the fix or keep the remaining gap open.
75
+
64
76
  ## Reviewer Panel
65
77
 
66
78
  Run five independent review lenses. Each lens must produce actionable issues, not vague advice.
@@ -112,6 +124,16 @@ Every issue must include:
112
124
 
113
125
  Prioritize fatal and major issues before language polish. Minor presentation fixes may be batched.
114
126
 
127
+ ## Consensus / Disagreement / Resolution
128
+
129
+ At the end of the panel, summarize:
130
+
131
+ - consensus: what multiple review lenses agree is the main blocking problem
132
+ - disagreement: what remains contested across lenses or between criticism and evidence
133
+ - resolution: what concrete route, evidence, or rewrite will settle the disagreement
134
+
135
+ Use this summary to keep rebuttal mode actionable instead of devolving into parallel opinions.
136
+
115
137
  ## Core Mutation Policy
116
138
 
117
139
  Core mutation means changing any of:
@@ -5,9 +5,11 @@
5
5
  1. Give a concise summary of the artifact or result under review.
6
6
  2. State the top review question or risk focus.
7
7
  3. Audit in reviewer mode.
8
- 4. Output fatal flaws first when present.
9
- 5. Rank the fix priority.
10
- 6. End with residual risks and a clear next action.
8
+ 4. Convert findings into structured issues: problem, why it matters, required fix, severity, route, and acceptance check.
9
+ 5. When the target already has claimed fixes or rebuttal responses, add revision traceability: author claim, claimed artifact location, independently verified or not, and remaining gap.
10
+ 6. Output fatal flaws first when present.
11
+ 7. Rank the fix priority.
12
+ 8. End with consensus, disagreement, resolution, residual risks, and a clear next action.
11
13
 
12
14
  ## Context Read Set
13
15
 
@@ -48,7 +50,8 @@
48
50
  - For quick prompts such as "rebuttal一下看有什么缺点", start with the rebuttal Light Read Set only: active LaTeX, result summaries, managed indices, and supplied criticism. Do not run a whole-repository scan unless the panel records a specific escalation reason.
49
51
  - External rebuttal, AC, meta-review, colleague, or user criticism must be converted into internal actionable issues before any rewrite or response draft.
50
52
  - The Reviewer Panel must classify issues across R1 Significance / Originality / Insight, R2 Soundness / Technical Quality, R3 Evaluation / Analysis, R4 Results / Tables / Numeric Evidence, and R5 Presentation / Clarity.
51
- - Each issue must include severity, affected artifact, required fix, route, acceptance check, and whether core mutation is required.
53
+ - Each issue must include problem, why it matters, severity, affected artifact, required fix, route, acceptance check, and whether core mutation is required.
54
+ - For re-review or rebuttal-repair passes, record author claim, claimed location, independently verified status, and remaining gap before marking an issue resolved.
52
55
  - In L1/L2, core mutation remains an approval boundary unless explicitly authorized. In L3, route core mutation through the shared ledger policy instead of treating it as a reviewer-stage blocker.
53
56
 
54
57
  ## Output Style
@@ -57,6 +60,7 @@
57
60
  - findings first
58
61
  - fatal flaws called out explicitly
59
62
  - fix priority stated clearly
63
+ - consensus / disagreement / resolution stated clearly
60
64
  - evidence-linked critique
61
65
  - explicit residual risks
62
66
  - explicit alternative explanations and boundary risks
@@ -70,6 +70,9 @@ Run these on every round:
70
70
  - section flow check -> `skills/lab/references/paper-writing/does-my-writing-flow-source.md`
71
71
  - reviewer pass -> `skills/lab/references/paper-writing/paper-review.md`
72
72
  - section-specific style policy -> `skills/lab/references/paper-writing/section-style-policies.md` (load the block matching the current section)
73
+ - section question bank -> `skills/lab/references/paper-writing/section-question-bank.md`
74
+ - argument stress test -> `skills/lab/references/paper-writing/argument-stress-test.md`
75
+ - language anti-pattern sweep -> `skills/lab/references/paper-writing/writing-anti-patterns.md`
73
76
 
74
77
  ## Rebuttal Mode
75
78
 
@@ -167,9 +170,9 @@ Do not enter prose polish until the current section has passed the reference-con
167
170
  - In Conclusion, state the broader principle or action implication implied by the evidence, then state the boundary. Do not introduce a new insight there.
168
171
  - Avoid paper-facing headings such as `Our Insights` or `核心洞见`; if a heading is needed, use normal section roles such as motivation, analysis, ablation, or discussion and let the insight appear in the prose.
169
172
  - Nontrivial section work must use three separated revision passes instead of one all-purpose rewrite:
170
- - Logic pass: check the paragraph role, claim chain, premise-to-conclusion transition, evidence dependency, and whether the section naturally follows from adjacent sections. Do not polish wording in this pass.
171
- - Theory / field pass: after the logic pass is clean, check concept use, field terminology, metric definitions, citation anchors, and whether the chosen framework actually fits the claim. Do not treat fluent language as proof that the theory is right.
172
- - Language pass: only after logic and theory blockers are resolved, revise academic tone, sentence rhythm, transitions, concision, and local readability.
173
+ - Logic pass: check the paragraph role, claim chain, premise-to-conclusion transition, evidence dependency, and whether the section naturally follows from adjacent sections. Use `section-question-bank.md` to force explicit answers about section purpose. Do not polish wording in this pass.
174
+ - Theory / field pass: after the logic pass is clean, check concept use, field terminology, metric definitions, citation anchors, and whether the chosen framework actually fits the claim. Run `argument-stress-test.md` here, including the weakest-link test, reverse-claim test, and strongest alternative explanation check. Do not treat fluent language as proof that the theory is right.
175
+ - Language pass: only after logic and theory blockers are resolved, revise academic tone, sentence rhythm, transitions, concision, and local readability. Run `writing-anti-patterns.md` here and remove throat-clearing openings, uniform paragraph patterns, synonym cycling, and generic evaluative filler before accepting the pass.
173
176
  - Do not continue into language polish when the logic pass or theory / field pass still has an unresolved blocker; repair the blocker first or route back to `review`, `iterate`, or `report` if the blocker is evidentiary.
174
177
  - Default automation should not require the user to approve every pass. Record the three pass outcomes in the write-iteration artifact and stop for one user question only when a failed pass would change paper-level framing, claims, protocol, or downstream section structure.
175
178
  - If the user explicitly asks for interactive or human-in-the-loop rewriting, show the result of each pass and wait before moving from logic -> theory -> language.
@@ -188,7 +191,8 @@ Do not enter prose polish until the current section has passed the reference-con
188
191
  - 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
192
  - Use natural-language full names in prose. If an approved short form is needed later, define it once and reuse it consistently.
190
193
  - 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.
194
+ - For `workflow_language=zh`, run `validate_paper_layer.py` on the resolved active paper layer before completing the round. This is a whole-layer gate, not a touched-file spot check. If it reports English concept fragments or English paper-facing headings/captions, translate them, define them once as `中文全称(English full form, ACRONYM)`, or add a justified glossary exception before prose polish.
195
+ - Use `validate_workflow_language_text.py` as a local repair helper when you need to narrow the issue to one specific workflow-language file after the whole-layer validator fails.
192
196
  - Do not use labels containing `_` or `-` in reader-facing prose.
193
197
  - 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.
194
198
  - 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.
@@ -225,10 +229,12 @@ Do not enter prose polish until the current section has passed the reference-con
225
229
  - Before drafting `introduction`, `method`, `experiments`, `related work`, or `conclusion`, also run `.lab/.managed/scripts/validate_paper_topology.py --project-root .` so plan/context files cannot keep presenting legacy layers as the active paper topology. If that validator fails, do not mark the topology as repaired and do not continue section polish.
226
230
  - When the repository workflow config is available, the paper-plan validator also checks that `.lab/writing/plan.md` stays in `workflow_language` instead of silently drifting into another language.
227
231
  - If the paper-plan validator fails, stop and fill `.lab/writing/plan.md` first instead of drafting prose.
232
+ - After revising the active section, run `.lab/.managed/scripts/validate_paper_layer.py --project-root . --layer <resolved-layer> --mode draft` so layer-wide language drift and LaTeX graph breakage are caught even when the current section itself looks clean.
228
233
  - During ordinary draft rounds, run `.lab/.managed/scripts/validate_section_draft.py --section <section> --section-file <section-file> --mode draft` and `.lab/.managed/scripts/validate_paper_claims.py --section-file <section-file> --mode draft` after revising the active section.
229
234
  - During ordinary draft rounds that introduce or revise metrics, also run `.lab/.managed/scripts/validate_metric_glossary.py --metric-glossary .lab/writing/metric-glossary.md --tex-file <section-or-table-file> --mode draft`.
230
235
  - If reference-guided deep-write was triggered, also run `.lab/.managed/scripts/validate_reference_consumption.py --section <section> --section-file <section-file> --mode draft` after revising the active section.
231
236
  - Treat draft-round output from the section and claim validators as warnings that must be recorded and addressed in the write-iteration artifact, not as immediate stop conditions.
237
+ - Treat paper-layer validator failures as blockers. They indicate active-layer breakage that section-local validators cannot safely waive.
232
238
  - If the active section already lives under a paper-layer `sections/` directory, the draft section validator should also warn when the neighboring required figure or analysis placeholder files are still missing from that same paper layer.
233
239
  - For each subsection, explicitly include motivation, design, and technical advantage when applicable.
234
240
  - Avoid a writing style that reads like incremental patching of a naive baseline.
@@ -257,6 +263,7 @@ Do not enter prose polish until the current section has passed the reference-con
257
263
  - Core asset coverage for a paper-facing final draft should include a problem-setting or teaser figure, a method overview figure, a results overview figure, a main-results table, an ablation table, and one additional analysis asset.
258
264
  - Keep `.lab/writing/plan.md` synchronized with the current table plan, figure plan, citation plan, and section-to-asset map whenever manuscript assets change.
259
265
  - For final-draft or export rounds, run `.lab/.managed/scripts/validate_section_draft.py --section <section> --section-file <section-file> --mode final` and `.lab/.managed/scripts/validate_paper_claims.py --section-file <section-file> --mode final` before accepting the round.
266
+ - For final-draft or export rounds, run `.lab/.managed/scripts/validate_paper_layer.py --project-root . --layer <resolved-layer> --mode final` before accepting the round; use `--mode export` for export/publish rounds.
260
267
  - For final-draft or export rounds with reported metrics, run `.lab/.managed/scripts/validate_metric_glossary.py --metric-glossary .lab/writing/metric-glossary.md --tex-file <section-file> --mode final` before accepting the round. Add relevant table, figure, or analysis `.tex` files with repeated `--tex-file` when they contain metric names.
261
268
  - If reference-guided deep-write was triggered, run `.lab/.managed/scripts/validate_reference_consumption.py --section <section> --section-file <section-file> --mode final` before accepting the final-draft or export round.
262
269
  - If the final-round section or claim validators fail, keep editing the affected section until it passes; do not stop at asset-complete but rhetorically weak or unsafe prose.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlab",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "description": "Strict /lab research workflow installer for Codex and Claude",
5
5
  "keywords": [
6
6
  "codex",