superlab 0.1.67 → 0.1.69

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.
@@ -7,5 +7,6 @@ argument-hint: section or writing target
7
7
  Use the installed `lab` skill at `.claude/skills/lab/SKILL.md`.
8
8
 
9
9
  Execute the requested `/lab-write` command against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
10
- 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. 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
+ 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
+ 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
12
  This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -7,5 +7,6 @@ argument-hint: section or writing target
7
7
  Use the installed `lab` skill at `.claude/skills/lab/SKILL.md`.
8
8
 
9
9
  Execute the requested `/lab-write` command against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
10
- 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. 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
+ 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
+ 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
12
  This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -7,5 +7,6 @@ argument-hint: section or writing target
7
7
  Use the installed `lab` skill at `.claude/skills/lab/SKILL.md`.
8
8
 
9
9
  Execute the requested `/lab-write` command against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
10
- 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. 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
+ 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
+ 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
12
  This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -7,5 +7,6 @@ argument-hint: section or writing target
7
7
  Use the installed `lab` skill at `.claude/skills/lab/SKILL.md`.
8
8
 
9
9
  Execute the requested `/lab-write` command against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
10
- 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. 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
+ 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
+ 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
12
  This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -6,5 +6,6 @@ argument-hint: section or writing target
6
6
  Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
7
7
 
8
8
  Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
9
- 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. 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.
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
+ 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.
10
11
  This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. 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, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -6,5 +6,6 @@ argument-hint: section or writing target
6
6
  Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
7
7
 
8
8
  Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
9
- 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. 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.
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
+ 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.
10
11
  This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. 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, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -6,5 +6,6 @@ argument-hint: section or writing target
6
6
  Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
7
7
 
8
8
  Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
9
- 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. 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.
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
+ 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.
10
11
  This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. 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, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
@@ -6,5 +6,6 @@ argument-hint: section or writing target
6
6
  Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
7
7
 
8
8
  Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
9
- 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. 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.
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
+ 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.
10
11
  This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. 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, 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.
@@ -39,6 +39,18 @@ REQUIRED_TABLE_NOTE_MARKERS = (
39
39
  )
40
40
  WIDTH_CONTROL_NOTE_MARKER = "% Width control:"
41
41
  TABLE_ABBREVIATION_EXCEPTIONS = {"TODO", "TBD"}
42
+ PLACEHOLDER_TABLE_NOTE_PREFIXES = (
43
+ "explain ",
44
+ "state ",
45
+ "expand ",
46
+ "describe ",
47
+ "fill ",
48
+ "todo",
49
+ "tbd",
50
+ "待补",
51
+ "待定",
52
+ "说明每",
53
+ )
42
54
  SERVICE_STYLE_PHRASES = (
43
55
  "user asked",
44
56
  "the user asked",
@@ -99,6 +111,23 @@ def load_workflow_config(path: Path) -> dict:
99
111
  return json.loads(path.read_text(encoding="utf-8"))
100
112
 
101
113
 
114
+ def project_root_from_workflow_config(path: Path) -> Path:
115
+ if path.parent.name == "config" and path.parent.parent.name == ".lab":
116
+ return path.parent.parent.parent
117
+ return path.parent.parent
118
+
119
+
120
+ def is_workflow_language_layer_target(paper_dir: Path, workflow_config_path: Path, config: dict) -> bool:
121
+ workflow_language = config.get("workflow_language")
122
+ paper_language = config.get("paper_language", workflow_language)
123
+ if not workflow_language or workflow_language == paper_language:
124
+ return False
125
+ project_root = project_root_from_workflow_config(workflow_config_path)
126
+ deliverables_root = (project_root / config.get("deliverables_root", "docs/research")).resolve()
127
+ workflow_layer_dir = (deliverables_root / "paper" / "workflow-language").resolve()
128
+ return paper_dir.resolve() == workflow_layer_dir
129
+
130
+
102
131
  def extract_section_body(text: str, patterns: tuple[str, ...]) -> str:
103
132
  for pattern in patterns:
104
133
  match = re.search(pattern, text, flags=re.MULTILINE)
@@ -201,6 +230,13 @@ def section_references_label(text: str, label: str) -> bool:
201
230
  return bool(re.search(REF_PATTERN_TEMPLATE % re.escape(label), text))
202
231
 
203
232
 
233
+ def section_includes_asset(text: str, asset_path: str) -> bool:
234
+ escaped = re.escape(asset_path)
235
+ return bool(
236
+ re.search(rf"\\(?:input|include|wlpath)\{{{escaped}(?:\.tex)?\}}", text)
237
+ )
238
+
239
+
204
240
  def check_exists(path: Path, issues: list[str], label: str):
205
241
  if not path.exists():
206
242
  issues.append(f"missing required file: {label} ({path})")
@@ -246,6 +282,19 @@ def check_table_file(path: Path, issues: list[str], label: str):
246
282
  issues.append(f"{label} must use booktabs structure")
247
283
  if not all(marker in text for marker in REQUIRED_TABLE_NOTE_MARKERS):
248
284
  issues.append(f"{label} must include a local table note scaffold")
285
+ for marker in REQUIRED_TABLE_NOTE_MARKERS:
286
+ for line in text.splitlines():
287
+ stripped = line.strip()
288
+ if not stripped.startswith(marker):
289
+ continue
290
+ value = stripped.removeprefix(marker).strip().lower()
291
+ if (
292
+ not value
293
+ or "placeholder" in value
294
+ or "占位" in value
295
+ or any(value.startswith(prefix) for prefix in PLACEHOLDER_TABLE_NOTE_PREFIXES)
296
+ ):
297
+ issues.append(f"{label} contains placeholder table note text for `{marker}`")
249
298
  caption_text = extract_caption(text)
250
299
  note_text = extract_table_note(text)
251
300
  local_context = "\n".join((caption_text, note_text))
@@ -321,10 +370,9 @@ def check_introduction_section(paper_dir: Path, issues: list[str]):
321
370
  return
322
371
  text = read_text(introduction)
323
372
  has_problem_figure = any(
324
- token in text
325
- for token in (
326
- r"\input{figures/problem-setting}",
327
- r"\begin{figure}",
373
+ (
374
+ section_includes_asset(text, "figures/problem-setting"),
375
+ r"\begin{figure}" in text,
328
376
  )
329
377
  )
330
378
  if not has_problem_figure:
@@ -338,25 +386,22 @@ def check_experiments_section(paper_dir: Path, issues: list[str]):
338
386
  return
339
387
  text = read_text(experiments)
340
388
  has_table = any(
341
- token in text
342
- for token in (
343
- r"\input{tables/main-results}",
344
- r"\input{tables/ablations}",
345
- r"\begin{table}",
389
+ (
390
+ section_includes_asset(text, "tables/main-results"),
391
+ section_includes_asset(text, "tables/ablations"),
392
+ r"\begin{table}" in text,
346
393
  )
347
394
  )
348
395
  has_figure = any(
349
- token in text
350
- for token in (
351
- r"\input{figures/results-overview}",
352
- r"\begin{figure}",
396
+ (
397
+ section_includes_asset(text, "figures/results-overview"),
398
+ r"\begin{figure}" in text,
353
399
  )
354
400
  )
355
401
  has_analysis = any(
356
- token in text
357
- for token in (
358
- r"\input{analysis/analysis-asset}",
359
- r"\input{tables/analysis}",
402
+ (
403
+ section_includes_asset(text, "analysis/analysis-asset"),
404
+ section_includes_asset(text, "tables/analysis"),
360
405
  )
361
406
  )
362
407
  if not has_table:
@@ -410,10 +455,9 @@ def check_method_section(paper_dir: Path, issues: list[str]):
410
455
  return
411
456
  text = read_text(method)
412
457
  has_figure = any(
413
- token in text
414
- for token in (
415
- r"\input{figures/method-overview}",
416
- r"\begin{figure}",
458
+ (
459
+ section_includes_asset(text, "figures/method-overview"),
460
+ r"\begin{figure}" in text,
417
461
  )
418
462
  )
419
463
  if not has_figure:
@@ -443,6 +487,17 @@ def check_language_layers(paper_dir: Path, issues: list[str]):
443
487
  if not workflow_language or workflow_language == paper_language:
444
488
  return
445
489
 
490
+ if is_workflow_language_layer_target(paper_dir, workflow_config, config):
491
+ sections_dir = paper_dir / "sections"
492
+ section_text = "\n".join(
493
+ read_text(path) for path in sorted(sections_dir.glob("*.tex")) if path.is_file()
494
+ )
495
+ if section_text and not text_looks_like_language(section_text, workflow_language):
496
+ issues.append(
497
+ f"workflow-language paper-layer sections should follow workflow_language={workflow_language}"
498
+ )
499
+ return
500
+
446
501
  if finalization_decision == "unconfirmed":
447
502
  issues.append(
448
503
  "workflow_language and paper_language differ; confirm paper_language_finalization_decision before finalizing the manuscript"
@@ -638,7 +693,7 @@ def check_latest_write_iteration_preflight(paper_dir: Path, issues: list[str]):
638
693
  if workflow_config is None:
639
694
  return
640
695
 
641
- project_root = workflow_config.parent.parent
696
+ project_root = project_root_from_workflow_config(workflow_config)
642
697
  manifest_path = project_root / ".lab" / ".managed" / "rule-manifest.json"
643
698
  if not manifest_path.exists():
644
699
  return
@@ -0,0 +1,191 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import re
6
+ import sys
7
+ from dataclasses import dataclass
8
+ from pathlib import Path
9
+
10
+
11
+ REQUIRED_HEADINGS = (
12
+ "## Metric Rules",
13
+ "## Metrics",
14
+ "## Audit",
15
+ )
16
+
17
+ REQUIRED_METRIC_FIELDS = (
18
+ "Paper-facing name",
19
+ "Approved short name",
20
+ "Table/header label",
21
+ "Plain-language definition",
22
+ "Calculation",
23
+ "Unit or denominator",
24
+ "Direction",
25
+ "Scope / conditions",
26
+ "First-use location",
27
+ )
28
+
29
+ REQUIRED_ALIAS_FIELDS = (
30
+ "Allowed aliases",
31
+ "Forbidden aliases",
32
+ )
33
+
34
+ EMPTY_VALUES = {
35
+ "",
36
+ "todo",
37
+ "tbd",
38
+ "待补",
39
+ "待定",
40
+ "none",
41
+ "n/a",
42
+ "na",
43
+ "null",
44
+ "unknown",
45
+ "未定",
46
+ }
47
+
48
+
49
+ @dataclass
50
+ class MetricEntry:
51
+ heading: str
52
+ fields: dict[str, str]
53
+
54
+
55
+ def parse_args() -> argparse.Namespace:
56
+ parser = argparse.ArgumentParser(description="Validate reader-facing metric names and definitions.")
57
+ parser.add_argument("--metric-glossary", required=True, help="Path to .lab/writing/metric-glossary.md")
58
+ parser.add_argument("--tex-file", action="append", default=[], help="Paper-facing .tex file to scan for forbidden metric aliases")
59
+ parser.add_argument("--mode", required=True, choices=("draft", "final"))
60
+ return parser.parse_args()
61
+
62
+
63
+ def read_text(path: Path) -> str:
64
+ return path.read_text(encoding="utf-8")
65
+
66
+
67
+ def is_empty_value(value: str) -> bool:
68
+ normalized = value.strip().strip("`").strip().lower()
69
+ return normalized in EMPTY_VALUES
70
+
71
+
72
+ def has_required_heading(text: str, heading: str) -> bool:
73
+ return re.search(rf"^{re.escape(heading)}\s*$", text, flags=re.MULTILINE) is not None
74
+
75
+
76
+ def section_block(text: str, heading: str) -> str:
77
+ heading_name = heading.removeprefix("## ").strip()
78
+ match = re.search(
79
+ rf"^##\s+{re.escape(heading_name)}\s*$([\s\S]*?)(?=^##\s+|\Z)",
80
+ text,
81
+ flags=re.MULTILINE,
82
+ )
83
+ return match.group(1) if match else ""
84
+
85
+
86
+ def parse_metric_entries(text: str) -> list[MetricEntry]:
87
+ metrics = section_block(text, "## Metrics")
88
+ entries: list[MetricEntry] = []
89
+ for match in re.finditer(r"^###\s+(.+?)\s*$([\s\S]*?)(?=^###\s+|\Z)", metrics, flags=re.MULTILINE):
90
+ heading = match.group(1).strip()
91
+ body = match.group(2)
92
+ fields: dict[str, str] = {}
93
+ for line in body.splitlines():
94
+ field_match = re.match(r"^\s*-\s*([^::]+)[::]\s*(.*)\s*$", line)
95
+ if field_match:
96
+ fields[field_match.group(1).strip()] = field_match.group(2).strip()
97
+ entries.append(MetricEntry(heading=heading, fields=fields))
98
+ return entries
99
+
100
+
101
+ def split_aliases(value: str) -> list[str]:
102
+ aliases = []
103
+ for alias in re.split(r"[,;,;、\n]+", value):
104
+ cleaned = alias.strip().strip("`").strip()
105
+ if cleaned and not is_empty_value(cleaned):
106
+ aliases.append(cleaned)
107
+ return aliases
108
+
109
+
110
+ def contains_alias(text: str, alias: str) -> bool:
111
+ if re.search(r"[A-Za-z0-9_]", alias):
112
+ pattern = rf"(?<![A-Za-z0-9_]){re.escape(alias)}(?![A-Za-z0-9_])"
113
+ return re.search(pattern, text, flags=re.IGNORECASE) is not None
114
+ return alias in text
115
+
116
+
117
+ def validate_glossary(text: str) -> tuple[list[MetricEntry], list[str]]:
118
+ issues: list[str] = []
119
+ for heading in REQUIRED_HEADINGS:
120
+ if not has_required_heading(text, heading):
121
+ issues.append(f"metric glossary missing required heading: {heading}")
122
+
123
+ entries = parse_metric_entries(text)
124
+ if not entries:
125
+ issues.append("metric glossary must define at least one metric under ## Metrics")
126
+ return entries, issues
127
+
128
+ for entry in entries:
129
+ for field in REQUIRED_METRIC_FIELDS:
130
+ value = entry.fields.get(field, "")
131
+ if is_empty_value(value):
132
+ issues.append(f"metric '{entry.heading}' missing required field value: {field}")
133
+ for field in REQUIRED_ALIAS_FIELDS:
134
+ if field not in entry.fields:
135
+ issues.append(f"metric '{entry.heading}' missing required field: {field}")
136
+
137
+ return entries, issues
138
+
139
+
140
+ def validate_forbidden_aliases(entries: list[MetricEntry], tex_files: list[str]) -> list[str]:
141
+ issues: list[str] = []
142
+ for tex_file in tex_files:
143
+ tex_path = Path(tex_file)
144
+ if not tex_path.exists():
145
+ issues.append(f"tex file does not exist: {tex_path}")
146
+ continue
147
+ text = read_text(tex_path)
148
+ for entry in entries:
149
+ canonical = entry.fields.get("Paper-facing name") or entry.heading
150
+ table_label = entry.fields.get("Table/header label", "")
151
+ for alias in split_aliases(entry.fields.get("Forbidden aliases", "")):
152
+ if contains_alias(text, alias):
153
+ issues.append(
154
+ "forbidden metric alias "
155
+ f"'{alias}' appears in {tex_path}; use '{canonical}'"
156
+ + (f" or table/header label '{table_label}'" if table_label else "")
157
+ + " instead"
158
+ )
159
+ return issues
160
+
161
+
162
+ def main() -> int:
163
+ args = parse_args()
164
+ glossary_path = Path(args.metric_glossary)
165
+ if not glossary_path.exists():
166
+ message = f"metric glossary does not exist: {glossary_path}"
167
+ if args.mode == "draft":
168
+ print(f"WARNING: {message}")
169
+ return 0
170
+ print(message, file=sys.stderr)
171
+ return 1
172
+
173
+ entries, issues = validate_glossary(read_text(glossary_path))
174
+ issues.extend(validate_forbidden_aliases(entries, args.tex_file))
175
+
176
+ if not issues:
177
+ print("metric glossary is valid")
178
+ return 0
179
+
180
+ if args.mode == "draft":
181
+ for issue in issues:
182
+ print(f"WARNING: {issue}")
183
+ return 0
184
+
185
+ for issue in issues:
186
+ print(issue, file=sys.stderr)
187
+ return 1
188
+
189
+
190
+ if __name__ == "__main__":
191
+ raise SystemExit(main())
@@ -23,6 +23,7 @@ REQUIRED_HEADINGS = (
23
23
  "## Adopted Structure Slots",
24
24
  "## Rejected or Waived Slots",
25
25
  "## Section Mapping",
26
+ "## Paragraph Role Mapping",
26
27
  "## Asset Mapping",
27
28
  "## Reuse Boundary",
28
29
  )
@@ -41,6 +42,99 @@ EXPERIMENT_WAIVABLE_SLOTS = {
41
42
  "implementation_details": ("implementation_details", "implementation", "reproducibility", "实现", "复现"),
42
43
  }
43
44
 
45
+ EXPERIMENT_TEXT_ALIASES = {
46
+ "dataset_description": (
47
+ "dataset",
48
+ "datasets",
49
+ "benchmark",
50
+ "benchmarks",
51
+ "cohort",
52
+ "population",
53
+ "数据集",
54
+ "基准",
55
+ "样本",
56
+ ),
57
+ "split_protocol": (
58
+ "split",
59
+ "splits",
60
+ "train",
61
+ "test",
62
+ "training",
63
+ "testing",
64
+ "random",
65
+ "seed",
66
+ "划分",
67
+ "切分",
68
+ "训练",
69
+ "测试",
70
+ ),
71
+ "baseline_setup": (
72
+ "baseline",
73
+ "baselines",
74
+ "comparator",
75
+ "comparators",
76
+ "prior method",
77
+ "compared",
78
+ "comparison",
79
+ "基线",
80
+ "对比方法",
81
+ "比较",
82
+ ),
83
+ "metric_definition": (
84
+ "metric",
85
+ "metrics",
86
+ "auuc",
87
+ "qini",
88
+ "primary metric",
89
+ "ranking",
90
+ "higher is better",
91
+ "指标",
92
+ "排序",
93
+ "越高越好",
94
+ ),
95
+ "main_results": (
96
+ "main result",
97
+ "main results",
98
+ "primary comparison",
99
+ "table",
100
+ "result",
101
+ "results",
102
+ "主结果",
103
+ "主要结果",
104
+ "结果",
105
+ "表",
106
+ ),
107
+ "ablation": (
108
+ "ablation",
109
+ "ablations",
110
+ "component",
111
+ "variant",
112
+ "消融",
113
+ "组件",
114
+ "变体",
115
+ ),
116
+ "sensitivity": (
117
+ "sensitivity",
118
+ "robustness",
119
+ "stability",
120
+ "diagnostic",
121
+ "trade-off",
122
+ "敏感性",
123
+ "稳健性",
124
+ "稳定性",
125
+ "诊断",
126
+ ),
127
+ "implementation_details": (
128
+ "implementation",
129
+ "training",
130
+ "hyperparameter",
131
+ "reproducibility",
132
+ "实现",
133
+ "训练",
134
+ "复现",
135
+ ),
136
+ }
137
+
44
138
  SERVICE_STYLE_PHRASES = (
45
139
  "user asked",
46
140
  "the user asked",
@@ -177,6 +271,29 @@ def validate_experiment_slots(plan_text: str, issues: list[str]) -> None:
177
271
  issues.append(f"experiments reference consumption must map or explicitly waive slot: {slot}")
178
272
 
179
273
 
274
+ def mapped_experiment_slots(plan_text: str) -> list[str]:
275
+ slots: list[str] = []
276
+ for slot, aliases in {**EXPERIMENT_CORE_SLOTS, **EXPERIMENT_WAIVABLE_SLOTS}.items():
277
+ if slot_is_mapped(plan_text, aliases):
278
+ slots.append(slot)
279
+ return slots
280
+
281
+
282
+ def validate_experiment_section_realizes_slots(plan_text: str, section_text: str, issues: list[str]) -> None:
283
+ paper_text = strip_latex_comments(section_text).lower()
284
+ if not re.search(r"\\subsection\{|\\paragraph\{", section_text):
285
+ issues.append(
286
+ "experiments reference consumption mapped multiple structure slots, but the section has no subsection or paragraph anchors"
287
+ )
288
+
289
+ for slot in mapped_experiment_slots(plan_text):
290
+ aliases = EXPERIMENT_TEXT_ALIASES.get(slot, ())
291
+ if aliases and not contains_any(paper_text, aliases):
292
+ issues.append(
293
+ f"mapped slot `{slot}` is not realized in the section text; expand the current section instead of recording a shallow consumption plan"
294
+ )
295
+
296
+
180
297
  def validate_section_text(section_text: str, issues: list[str]) -> None:
181
298
  prose_text = strip_latex_comments(section_text)
182
299
  if contains_any(prose_text, SERVICE_STYLE_PHRASES):
@@ -210,6 +327,7 @@ def main() -> int:
210
327
  validate_plan_shape(plan_text, issues)
211
328
  if args.section == "experiments":
212
329
  validate_experiment_slots(plan_text, issues)
330
+ validate_experiment_section_realizes_slots(plan_text, section_text, issues)
213
331
  validate_section_text(section_text, issues)
214
332
 
215
333
  if not issues:
@@ -229,6 +229,22 @@ WORKFLOW_ONLY_MANUSCRIPT_PHRASES = (
229
229
  "工作流语言",
230
230
  "同步到",
231
231
  )
232
+ INTERNAL_EXPERIMENT_PROVENANCE_PHRASES = (
233
+ "tuning run",
234
+ "tuning runs",
235
+ "historical probe",
236
+ "rank-margin probe",
237
+ "rerun id",
238
+ "run id",
239
+ "实验包",
240
+ "历史 probe",
241
+ "调参运行",
242
+ "调参轮次",
243
+ )
244
+ INTERNAL_CONFIG_LABEL_PATTERN = re.compile(
245
+ r"\b[a-z]{1,4}\d+(?:[-_][a-z]?\d+(?:\.\d+)?){1,4}\b",
246
+ flags=re.IGNORECASE,
247
+ )
232
248
 
233
249
 
234
250
  def check_common_section_gate_risks(text: str, issues: list[str]):
@@ -245,6 +261,10 @@ def check_common_section_gate_risks(text: str, issues: list[str]):
245
261
  issues.append(
246
262
  "reader-facing prose appears to contain internal identifier-like tokens; map them once for the reader and move them back out of prose before more polishing"
247
263
  )
264
+ if contains_any(prose_text, INTERNAL_EXPERIMENT_PROVENANCE_PHRASES) or INTERNAL_CONFIG_LABEL_PATTERN.search(prose_text):
265
+ issues.append(
266
+ "reader-facing prose appears to contain internal experiment provenance or tuning/config labels; move run provenance to workflow notes or map it to paper-facing diagnostic terminology"
267
+ )
248
268
  if contains_any(
249
269
  prose_text,
250
270
  (
@@ -0,0 +1,35 @@
1
+ # Metric Glossary
2
+
3
+ Use this glossary during `/lab:write` to keep reported metrics understandable and consistent across prose, captions, table headers, and table notes.
4
+
5
+ ## Metric Rules
6
+
7
+ - Define every reported metric before using a short name or table label.
8
+ - Every metric needs a 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.
9
+ - Use the same metric name in Method, Experiments, captions, table notes, and result summaries.
10
+ - If the denominator, event condition, score scale, or comparison scope changes, either define a separate metric entry or make the scope explicit in the metric definition.
11
+ - Short table headers are allowed only when the table note or adjacent prose locally resolves the metric.
12
+ - Forbidden aliases are deprecated reader-facing names. Remove them from prose, captions, tables, and analysis assets.
13
+
14
+ ## Metrics
15
+
16
+ ### Metric
17
+
18
+ - Paper-facing name:
19
+ - Approved short name:
20
+ - Table/header label:
21
+ - Plain-language definition:
22
+ - Calculation:
23
+ - Unit or denominator:
24
+ - Direction:
25
+ - Scope / conditions:
26
+ - Allowed aliases:
27
+ - Forbidden aliases:
28
+ - First-use location:
29
+
30
+ ## Audit
31
+
32
+ - Metric naming drift found this round:
33
+ - Metrics used in prose, captions, tables, or figures but missing from this glossary:
34
+ - Deprecated aliases removed this round:
35
+ - Metrics that still need a clearer calculation or denominator:
@@ -19,11 +19,18 @@
19
19
  ## Paragraph Role Mapping
20
20
 
21
21
  - paragraph_role -> current-paper paragraph
22
+ - paragraph_role -> current-paper local bridge / transition sentence
22
23
 
23
24
  ## Asset Mapping
24
25
 
25
26
  - asset_role -> current-paper figure/table/analysis asset
26
27
 
28
+ ## Section Realization Check
29
+
30
+ - Adopted slots that are visibly realized in the current section:
31
+ - Adopted slots that still need prose, subsection, paragraph, or asset support:
32
+ - Reason any dense paragraph was kept instead of splitting into reader-facing anchors:
33
+
27
34
  ## Reuse Boundary
28
35
 
29
36
  - Reuse structure, section order, paragraph roles, asset function, placement logic, and bridge logic only.
@@ -51,6 +51,17 @@
51
51
  - Did any alias drift remain unresolved:
52
52
  - Remaining reader-facing jargon risk:
53
53
 
54
+ ## Metric Glossary
55
+
56
+ - Was `.lab/writing/metric-glossary.md` required this round:
57
+ - Metric glossary path:
58
+ - Metrics introduced or revised:
59
+ - Did each metric include 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:
60
+ - Did prose, captions, table headers, table notes, and result summaries use the same metric names:
61
+ - Deprecated or forbidden aliases removed:
62
+ - Metrics used in prose or tables but missing from the glossary:
63
+ - Validator command and result:
64
+
54
65
  ## Section Acceptance Gate
55
66
 
56
67
  - Canonical naming consistency passed:
@@ -123,6 +134,8 @@
123
134
  - Were section/subsection slots mapped before prose:
124
135
  - Were paragraph roles mapped before prose:
125
136
  - Were table/figure roles mapped before prose:
137
+ - Were adopted slots visibly realized in the section, not only in the plan:
138
+ - Did any adopted experiment slot remain collapsed into an overly dense paragraph:
126
139
  - Which reference slots were adopted:
127
140
  - Which reference slots were waived and why:
128
141
  - Did the round avoid copying reference wording, claims, metrics, captions, or conclusions:
@@ -247,6 +247,7 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
247
247
  - Once a paper-facing model or ablation label is chosen, reuse the canonical label instead of replacing it with a narrative alias in later prose, tables, or captions.
248
248
  - Before drafting or polishing, check the current section block in `skills/lab/references/paper-writing/section-style-policies.md` and follow its encouraged, discouraged, and banned expression lists.
249
249
  - When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within `/lab:write` but switch to reference-guided deep writing: extract structure, map section/subsection slots, paragraph roles, and table/figure roles to the current paper, record the mapping, and only then draft prose.
250
+ - The reference-consumption plan is not sufficient by itself. The current section must visibly realize the adopted structure slots through subsection or paragraph anchors, table/figure placement, local bridges, and reader-facing prose.
250
251
  - Reference-guided writing may reuse structure, paragraph roles, asset placement, and bridge logic, but must not copy reference wording, claims, metrics, captions, or conclusions.
251
252
  - Keep service-style, AI-assistant meta language, and workflow-only placeholder language out of manuscript prose, captions, table notes, and paper-facing analysis assets.
252
253
  - Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first.
@@ -265,12 +266,16 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
265
266
  - Main tables must be locally self-contained: a reader should be able to understand row meaning, column meaning, metric direction, and any relevant unit or denominator from the table title, table note, and adjacent prose without chasing the Method section.
266
267
  - If Method or Experiments prose promises a metric family, the main table set must either expose that metric family directly or mark the missing items as appendix-only and explain why.
267
268
  - Short table headers are allowed, but any abbreviation in a paper-facing table must be expanded locally in the same table.
269
+ - Local table notes must be filled with real reader-facing explanations; default template text such as "explain what each row represents" or "expand local abbreviations" is still incomplete.
268
270
  - If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that decision explicitly in the table note instead of silently dropping it.
271
+ - Maintain `.lab/writing/metric-glossary.md` whenever the paper reports empirical metrics. Each metric needs a 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.
272
+ - Use the same metric names across Method, Experiments, captions, table headers, table notes, and result summaries; remove forbidden aliases from reader-facing LaTeX instead of letting legacy metric names drift.
273
+ - Run `.lab/.managed/scripts/validate_metric_glossary.py` in metric-bearing draft, final-draft, or export rounds and record the result in the latest write iteration artifact.
269
274
  - Do not treat `\resizebox{\linewidth}{!}{...}` as the default main-table fit strategy.
270
275
  - Fit paper-facing 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 and document why.
271
276
  - Keep `\tabcolsep` adjustments conservative and avoid shrinking below a roughly readable floor for paper-facing main tables.
272
277
  - Do not rely on `\scriptsize` or `\tiny` as the default way to make a main table fit.
273
- - Keep internal identifiers out of prose unless they are mapped once for the reader and then moved back out of prose.
278
+ - Keep internal identifiers, tuning-run labels, probe names, config strings, rerun ids, and package labels out of prose unless they are mapped once for the reader and then moved back out of prose.
274
279
  - Do not rely on unexplained jargon density as a substitute for academic tone.
275
280
  - Bind each claim to evidence from `report`, iteration reports, or normalized summaries.
276
281
  - Use the write-stage contract in `.codex/skills/lab/stages/write.md` or `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section-specific references, validator calls, asset coverage, and final manuscript gates.
@@ -280,7 +285,9 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
280
285
  - For each subsection, explicitly cover motivation, design, and technical advantage when applicable.
281
286
  - Keep terminology stable across rounds and sections.
282
287
  - 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.
288
+ - Maintain `.lab/writing/metric-glossary.md` as the write-stage source for reported metric names, definitions, calculations, denominators, directions, scopes, and aliases.
283
289
  - 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.
290
+ - 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.
284
291
  - Record the section-level acceptance gate in the latest write iteration artifact before recommending another tighten/compress/polish pass on the same section.
285
292
  - Record section-style policy compliance, any retained discouraged move, and any banned move found in the latest write iteration artifact.
286
293
  - Record the round target layer in the latest write iteration artifact as `canonical manuscript`, `workflow-language paper layer`, or `both`.
@@ -5,6 +5,7 @@
5
5
  - stable `report` artifact
6
6
  - approved framing artifact at `.lab/writing/framing.md`
7
7
  - current terminology glossary at `.lab/writing/terminology-glossary.md` when it already exists
8
+ - current metric glossary at `.lab/writing/metric-glossary.md` when the paper reports empirical metrics
8
9
  - iteration reports
9
10
  - normalized summaries
10
11
  - reviewer notes when available
@@ -28,6 +29,7 @@
28
29
  - `.lab/context/data-decisions.md`
29
30
  - `.lab/context/terminology-lock.md`
30
31
  - `.lab/writing/terminology-glossary.md` when it exists
32
+ - `.lab/writing/metric-glossary.md` when it exists or the current section reports metrics
31
33
  - `.lab/.managed/rule-manifest.json`
32
34
 
33
35
  ## Rule Preflight
@@ -83,10 +85,13 @@ Required sequence:
83
85
  4. Map reference section/subsection slots, paragraph roles, table roles, figure roles, and bridge logic to the current paper's evidence and active paper layer.
84
86
  5. Explicitly waive any reference slot that is not used, with a reason tied to current evidence or scope.
85
87
  6. Reuse structure only. Do not copy wording, claims, metrics, captions, or conclusions from the reference papers.
86
- 7. Run `.lab/.managed/scripts/validate_reference_consumption.py --section <section> --section-file <section-file> --mode draft` after drafting; final-draft or export rounds must use `--mode final`.
88
+ 7. Realize the mapped structure in the section itself. Do not stop at a consumption-plan artifact; the current section must visibly expose the adopted dataset, protocol, comparator, metric, result, ablation, robustness, paragraph-role, and asset-role slots where applicable.
89
+ 8. Run `.lab/.managed/scripts/validate_reference_consumption.py --section <section> --section-file <section-file> --mode draft` after drafting; final-draft or export rounds must use `--mode final`.
87
90
 
88
91
  For experiments, the consumption plan must cover or explicitly waive dataset description/statistics, split protocol, baseline setup, metric definition, implementation details, main results, ablation, and sensitivity/robustness. Dataset description, split protocol, baseline setup, metric definition, and main results are core slots and should be mapped rather than waived in normal empirical papers.
89
92
 
93
+ For experiments, do not collapse all adopted reference slots into one dense setup paragraph. Dataset/task scope, split protocol, comparator setup, metric definitions, main results, ablation, and robustness/diagnostic analysis should be separated by subsection, paragraph anchor, table/figure placement, or an explicit local bridge when the paper is short.
94
+
90
95
  Do not enter prose polish until the current section has passed the reference-consumption check or has a recorded reason why reference-guided writing was not triggered.
91
96
 
92
97
  ## Small-Step Writing Rules
@@ -159,6 +164,7 @@ Do not enter prose polish until the current section has passed the reference-con
159
164
  - Use natural-language full names in prose. If an approved short form is needed later, define it once and reuse it consistently.
160
165
  - Do not use labels containing `_` or `-` in reader-facing prose.
161
166
  - 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.
167
+ - 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.
162
168
  - Do not use unexplained terminology density as a substitute for academic tone.
163
169
  - Keep service-style or AI-assistant meta language out of manuscript prose. Phrases such as "用户说", "按你的要求", "我来解释", "下面我", "this version", or "as requested by the user" belong in workflow notes, not in paper-facing sections, captions, table notes, or analysis assets.
164
170
  - Keep workflow-only placeholder language out of manuscript prose. Phrases such as "图的意图", "资产意图", "占位符", "workflow-language", "translation layer", or "sync this wording" belong in authoring artifacts, not in reader-facing LaTeX.
@@ -166,6 +172,11 @@ Do not enter prose polish until the current section has passed the reference-con
166
172
  - Short headers remain allowed, but they must be resolved locally through the same table's caption or table note instead of forcing the reader to chase the Method section.
167
173
  - If the Method or Experiments prose says the paper reports 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.
168
174
  - If a metric is measured but omitted because it is uniformly zero, redundant, or appendix-only, state that disposition explicitly in the caption or table note instead of silently dropping it.
175
+ - Maintain `.lab/writing/metric-glossary.md` whenever the paper reports metrics or the round introduces or revises Method metric descriptions, Experiments metrics, captions, table notes, table headers, or analysis assets.
176
+ - Every metric glossary entry must include 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.
177
+ - Use the same metric names across prose, captions, table notes, table headers, and result summaries. Do not let one metric drift across paper-facing names, shorthand, table headers, and legacy aliases.
178
+ - If a metric's denominator, event condition, score scale, or comparison scope differs by setting, define a separate entry or explicitly scope the metric in `.lab/writing/metric-glossary.md`.
179
+ - Deprecated or forbidden metric aliases must be removed from reader-facing LaTeX instead of explained away locally.
169
180
  - Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table.
170
181
  - Main-table width control should follow this order: shorten headers while preserving local explanations, move secondary metrics to appendix-only, reduce or split columns, adjust `\tabcolsep` conservatively, and only then consider `\resizebox` as a last resort.
171
182
  - When `\tabcolsep` is adjusted for a paper-facing main table, keep it in a safe range and avoid shrinking below roughly `3pt`; prefer `4pt` or `5pt` when a small reduction is enough.
@@ -184,6 +195,7 @@ Do not enter prose polish until the current section has passed the reference-con
184
195
  - 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.
185
196
  - If the paper-plan validator fails, stop and fill `.lab/writing/plan.md` first instead of drafting prose.
186
197
  - 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.
198
+ - 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`.
187
199
  - 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.
188
200
  - 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.
189
201
  - 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.
@@ -207,11 +219,13 @@ Do not enter prose polish until the current section has passed the reference-con
207
219
  - `<deliverables_root>/paper/analysis/analysis-asset.tex`
208
220
  - Table assets must use paper-facing LaTeX structure with `booktabs`, caption, label, and consistent precision.
209
221
  - Table assets must also include a local table note that explains row meaning, column meaning, metric definitions, comparison scope, and any important caveat.
222
+ - The local table note must contain real reader-facing explanations, not the default template phrases such as "explain what each row represents" or "expand local abbreviations".
210
223
  - Table assets must not rely on aggressive width hacks by default; if width control is still needed after table redesign, document it locally and keep it readable.
211
224
  - Figure placeholders may record what the final figure should show and why the reader needs it in authoring comments, the paper plan, or the write-iteration artifact, but the caption itself must remain paper-facing and must not contain "Figure intent", "图的意图", "asset intent", "占位符", or similar workflow language.
212
225
  - 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.
213
226
  - Keep `.lab/writing/plan.md` synchronized with the current table plan, figure plan, citation plan, and section-to-asset map whenever manuscript assets change.
214
227
  - 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.
228
+ - 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.
215
229
  - 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.
216
230
  - 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.
217
231
  - Final-round section validation should fail when a section in the paper layer references required figure or analysis placeholders but the neighboring asset files are still missing from that layer.
@@ -222,7 +236,9 @@ Do not enter prose polish until the current section has passed the reference-con
222
236
  - Run a LaTeX compile smoke test when a local LaTeX toolchain is available; if not available, record the missing verification in the write iteration artifact.
223
237
  - Record what changed and why in a write-iteration artifact.
224
238
  - Maintain `.lab/writing/terminology-glossary.md` as the write-stage source for full forms, approved short forms, reader-facing explanations, and aliases whenever terminology changes.
239
+ - Maintain `.lab/writing/metric-glossary.md` as the write-stage source for metric names, calculations, denominators, directions, scopes, and aliases whenever empirical metrics are reported.
225
240
  - When a round introduces or revises key terms, include a compact terminology note in the user-facing round summary and record the terminology-clarity self-check in the write-iteration artifact.
241
+ - When a round introduces or revises metrics, include a compact metric-glossary note in the user-facing round summary and record the metric-glossary validation in the write-iteration artifact.
226
242
  - Record the section-level acceptance gate in the write-iteration artifact before recommending further tightening on the same section.
227
243
  - Record section-style policy compliance, any retained discouraged move, and any banned move found in the write-iteration artifact.
228
244
  - Record the round target layer in the write-iteration artifact as `canonical manuscript`, `workflow-language paper layer`, or `both`.
@@ -245,6 +261,7 @@ Do not enter prose polish until the current section has passed the reference-con
245
261
  - `.lab/writing/framing.md`
246
262
  - `.lab/writing/plan.md`
247
263
  - `.lab/writing/terminology-glossary.md`
264
+ - `.lab/writing/metric-glossary.md` when the paper reports empirical metrics
248
265
  - `.lab/writing/reference-patterns/consumption-plan/<section>.md` when reference-guided deep-write is triggered
249
266
  - `.lab/writing/iterations/<n>.md`
250
267
  - `<deliverables_root>/paper/main.tex`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlab",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
4
4
  "description": "Strict /lab research workflow installer for Codex and Claude",
5
5
  "keywords": [
6
6
  "codex",