superlab 0.1.77 → 0.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lab_write_contract.json +1 -1
- package/package-assets/claude/commands/lab/write.md +2 -2
- package/package-assets/claude/commands/lab-write.md +2 -2
- package/package-assets/claude/commands/lab:write.md +2 -2
- package/package-assets/claude/commands/lab/357/274/232write.md +2 -2
- package/package-assets/codex/prompts/lab/write.md +2 -2
- package/package-assets/codex/prompts/lab-write.md +2 -2
- package/package-assets/codex/prompts/lab:write.md +2 -2
- package/package-assets/codex/prompts/lab/357/274/232write.md +2 -2
- package/package-assets/shared/lab/.managed/scripts/validate_paper_layer.py +237 -0
- package/package-assets/shared/lab/.managed/scripts/validate_workflow_language_text.py +47 -0
- package/package-assets/shared/skills/lab/SKILL.md +1 -1
- package/package-assets/shared/skills/lab/stages/write.md +5 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"chinese_terminology_rule": "Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
2
|
+
"chinese_terminology_rule": "Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.",
|
|
3
3
|
"stage_prompt": {
|
|
4
4
|
"codex_en": "This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\\resizebox{\\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\\tabcolsep` conservatively; only use `\\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\\scriptsize` or `\\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.",
|
|
5
5
|
"claude_en": "This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\\resizebox{\\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\\tabcolsep` conservatively; only use `\\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\\scriptsize` or `\\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.",
|
|
@@ -10,6 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
14
|
-
For Chinese workflow-language output, run `
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
14
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
15
15
|
This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -10,6 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
14
|
-
For Chinese workflow-language output, run `
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
14
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
15
15
|
This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -10,6 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
14
|
-
For Chinese workflow-language output, run `
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
14
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
15
15
|
This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -10,6 +10,6 @@ Execute the requested `/lab-write` command against the user's argument now. Do n
|
|
|
10
10
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
11
11
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
12
12
|
Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations.
|
|
13
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
14
|
-
For Chinese workflow-language output, run `
|
|
13
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
14
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
15
15
|
This command runs the `write` stage of the lab workflow. Use `.claude/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -8,6 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
8
8
|
Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
|
|
9
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
12
|
-
For Chinese workflow-language output, run `
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
12
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
13
13
|
This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -8,6 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
8
8
|
Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
|
|
9
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
12
|
-
For Chinese workflow-language output, run `
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
12
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
13
13
|
This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -8,6 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
8
8
|
Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
|
|
9
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
12
|
-
For Chinese workflow-language output, run `
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
12
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
13
13
|
This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -8,6 +8,6 @@ Use the installed `lab` skill at `.codex/skills/lab/SKILL.md`.
|
|
|
8
8
|
Execute the requested `/lab:write` stage against the user's argument now. Do not only recommend another lab stage. If a blocking prerequisite is missing, say exactly what is missing and ask at most one clarifying question.
|
|
9
9
|
When the user provides reference PDFs, paper URLs, local reference-paper paths, or asks to write by reference, stay within the write stage and switch to reference-guided deep-write. Extract structure, map section/subsection slots, paragraph roles, table/figure roles, and bridge logic to the current paper, record the consumption plan, and only then draft prose. The current section must visibly realize the mapped slots; do not treat a consumption plan as enough. Reuse structure only; do not copy wording, claims, metrics, captions, or conclusions. Keep service-style or AI-assistant meta language and workflow-only placeholder language out of paper-facing prose.
|
|
10
10
|
When Method, Experiments, captions, tables, or analysis assets introduce or revise reported metrics, create or update `.lab/writing/metric-glossary.md` before prose polish. Each metric must define its paper-facing name, approved short name, table/header label, plain-language definition, calculation, unit or denominator, direction, scope or conditions, allowed aliases, forbidden aliases, and first-use location. Use the same metric names across prose, captions, table notes, table headers, and result summaries. Run `validate_metric_glossary.py` and remove forbidden aliases from reader-facing LaTeX before finalizing the round.
|
|
11
|
-
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose.
|
|
12
|
-
For Chinese workflow-language output, run `
|
|
11
|
+
Chinese workflow-language terminology: when `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments throughout Chinese prose. Before completing the write round, run `validate_paper_layer.py` on the resolved active Chinese paper layer so the whole layer is checked rather than only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files.
|
|
12
|
+
For Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before completing the write round so the whole layer is checked instead of only the touched file. Use `validate_workflow_language_text.py` as a local repair helper when narrowing down specific offending files. If the layer validator reports English concept fragments or English paper-facing headings/captions, translate them or define a justified glossary exception before prose polish.
|
|
13
13
|
This command runs the `/lab:write` stage. Use `.codex/skills/lab/stages/write.md` as the single source of truth for template choice, paper-plan requirements, section references, validator gates, asset coverage, and final manuscript rules. Carry the same core insight anchor through the paper: Introduction creates the cognitive contrast, Method turns the insight into design motivation, Experiments diagnose it with evidence, and Conclusion states the broader principle and boundary. Do not create a standalone `Our Insights` section just to satisfy this; weave the insight into motivation, mechanism, evidence, and limitations. Read the matching paper-writing reference, the current section block in `section-style-policies.md`, and any bundled example-bank files for the requested section, revise only one section, and keep draft rounds warning-only while final-draft or export rounds must satisfy the write-stage acceptance gates. Draft ordinary manuscript rounds in `workflow_language`, and ordinary `.tex` section drafts must stay in `workflow_language` instead of treating `paper_language` as the default draft language. When `workflow_language` and `paper_language` differ, treat the workflow-language paper layer as the default ordinary working layer. Resolve the active paper topology from `.lab/config/workflow.json` before drafting: the active canonical root is `<deliverables_root>/paper/`, and when workflow-language is active its root is `<deliverables_root>/paper/workflow-language/`. Ordinary write rounds should still edit one target paper layer at a time rather than silently refreshing both language layers. If the user names a concrete file or layer, treat that as the only target for the round unless they also explicitly request synchronization. Classify the named target path before editing it. Only active-layer targets count as managed manuscript rounds; legacy side layers such as `review_zh`, `translation_zh`, `sections_zh`, or stale `deliverables/.../workflow-language/*.md` paths are out-of-band/legacy edits and must not silently replace the active paper topology. If a workflow-language paper layer is active and the round still targets the canonical manuscript, record why canonical-only writing was acceptable in the write iteration artifact. If `paper_language_finalization_decision=convert-to-paper-language`, explicit canonical-manuscript work may target the canonical `paper_language` manuscript, but that does not make canonical the default ordinary working layer while workflow-language remains active. Treat the workflow-language paper layer as a real persisted artifact rather than a review layer, and preserve it as a full LaTeX mirror with `workflow-language/main.tex`, `workflow-language/references.bib`, `workflow-language/sections/*.tex`, `workflow-language/tables/*.tex`, `workflow-language/figures/*.tex`, and `workflow-language/analysis/analysis-asset.tex`. Do not write new workflow-language output to deprecated review-layer paths such as `docs/lab/paper/review_zh/`. Maintain `.lab/writing/terminology-glossary.md` as the write-stage glossary for full forms, approved short forms, reader-facing explanations, and aliases. Apply the same academic readability standard in every language: when the round introduces or revises key terms, abbreviations, metrics, mechanism names, or system labels, use the full form first, define any short form at first mention, explain what the term is and why it matters here, keep one natural-language paper-facing name per concept, use natural-language full names in prose, do not use labels containing `_` or `-` in reader-facing prose, apply the same first-mention rule to table headers, table captions, table notes, and figure captions or labels, do not assume a fixed drafting order such as Method before Experiments, add a local naming bridge when a section uses canonical short names before their defining section has been drafted, and reuse the canonical label instead of replacing it with a narrative alias. Follow the current section's encouraged, discouraged, and banned expression lists from `section-style-policies.md`; section-specific banned expressions take priority over prose-polish goals. Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first. That gate must explicitly confirm naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance. If the round changes the paper's canonical experiment or evaluation protocol, treat that change as a canonical replacement unless the user explicitly scoped it as supplementary or appendix-only, run a paper-wide impact audit before more polishing, update the highest-impact stale sections and assets first, and do not default to translation/workflow-layer sync work unless the user explicitly asked for it or the language-finalization workflow requires it. Only edit both the canonical manuscript and the workflow-language paper layer in the same round when the user explicitly asks for cross-language synchronization or when a final-draft/export language-finalization step requires both layers to be refreshed together. Do not treat a routine tighten/compress/polish request as an instruction to sync the workflow-language companion. For export or remote-publication rounds, if `paper_language_finalization_decision=convert-to-paper-language`, include the workflow-language paper layer in the exported or pushed bundle by default. Allow canonical-only export or remote publication only when the user explicitly asked for it or when the remote target forbids extra files. If any gate item is unresolved, or if a banned expression or move from the current section policy remains, spend the round fixing that blocker instead of polishing sentences further, and do not default the next-step recommendation to another polish pass. Main tables must be locally self-contained: the title, header, note, and adjacent prose should tell the reader what each row and column means, the metric direction, and any relevant unit, denominator, or event condition. Short headers remain allowed, but abbreviations in paper-facing tables must be expanded locally in the same table. If Method or Experiments prose promises a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why. If a metric is measured but omitted because it is zero everywhere, redundant, or appendix-only, state that disposition explicitly in the table note instead of silently dropping it. Do not treat `\resizebox{\linewidth}{!}{...}` as the default way to fit a main table. Fit main tables by redesign first: shorten headers, move secondary metrics out of the main table, reduce or split columns, then adjust `\tabcolsep` conservatively; only use `\resizebox` as a last resort, keep width changes readable, and explain the width-control rationale locally in the same table note. Do not use `\scriptsize` or `\tiny` as the default main-table fit strategy. Keep internal identifiers out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose, and record the terminology-clarity self-check, the section-level acceptance gate, section-style policy compliance, the protocol/scope impact audit, the export or remote bundle audit, the round target layer, any canonical-only justification while workflow-language was active, any cross-language sync justification, the active canonical/workflow-language roots, the resolved target path role, any out-of-band justification, the insight integration audit, and the table-semantics audit in the write iteration artifact. If the manuscript would start from the managed scaffold and no template decision is recorded yet, ask once whether to keep the default scaffold or attach a template directory first. If finalization reaches a round where `workflow_language` and `paper_language` differ, finish and preserve the workflow-language paper layer first, then ask once whether to keep the draft language or convert the canonical manuscript to `paper_language`, persist that answer, record both the language decision and the workflow-language paper-layer path in the latest write iteration, and only then edit the final manuscript in the chosen language.
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
from paper_topology import find_project_root, resolve_paper_topology
|
|
10
|
+
from validate_manuscript_delivery import (
|
|
11
|
+
REQUIRED_FIGURE_FILES,
|
|
12
|
+
REQUIRED_TABLE_FILES,
|
|
13
|
+
check_analysis_asset,
|
|
14
|
+
check_asset_consumption,
|
|
15
|
+
check_bibliography,
|
|
16
|
+
check_experiments_section,
|
|
17
|
+
check_figure_file,
|
|
18
|
+
check_global_tex,
|
|
19
|
+
check_introduction_section,
|
|
20
|
+
check_language_layers,
|
|
21
|
+
check_latest_write_iteration_preflight,
|
|
22
|
+
check_main_tex,
|
|
23
|
+
check_method_section,
|
|
24
|
+
check_table_file,
|
|
25
|
+
)
|
|
26
|
+
from validate_paper_topology import validate_topology_artifacts
|
|
27
|
+
from validate_workflow_language_text import load_allowed_fragments, validate_files
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
INPUT_RE = re.compile(r"\\(?:input|include|wlpath)\{([^}]+)\}")
|
|
31
|
+
REF_RE = re.compile(r"\\(?:auto|c|C)?ref\{([^}]+)\}|\\(?:eqref|pageref)\{([^}]+)\}")
|
|
32
|
+
CITE_RE = re.compile(r"\\(?:cite|citep|citet)\*?(?:\[[^\]]*\])?\{([^}]+)\}")
|
|
33
|
+
LABEL_RE = re.compile(r"\\label\{([^}]+)\}")
|
|
34
|
+
BIB_KEY_RE = re.compile(r"@\w+\{([^,\s]+),")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def parse_args() -> argparse.Namespace:
|
|
38
|
+
parser = argparse.ArgumentParser(
|
|
39
|
+
description="Validate the active paper layer as a whole instead of checking only one section file."
|
|
40
|
+
)
|
|
41
|
+
parser.add_argument("--project-root", required=True, help="Project root containing .lab/config/workflow.json")
|
|
42
|
+
parser.add_argument(
|
|
43
|
+
"--layer",
|
|
44
|
+
default="active",
|
|
45
|
+
choices=("active", "canonical", "workflow-language"),
|
|
46
|
+
help="Which paper layer to validate",
|
|
47
|
+
)
|
|
48
|
+
parser.add_argument("--mode", required=True, choices=("draft", "final", "export"))
|
|
49
|
+
return parser.parse_args()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def read_text(path: Path) -> str:
|
|
53
|
+
return path.read_text(encoding="utf-8")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def strip_comments(text: str) -> str:
|
|
57
|
+
return re.sub(r"(?<!\\)%.*", "", text)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def resolve_target_layer(project_root: Path, layer: str) -> tuple[str, Path | None, str | None]:
|
|
61
|
+
topology = resolve_paper_topology(project_root)
|
|
62
|
+
workflow_config_path = project_root / ".lab" / "config" / "workflow.json"
|
|
63
|
+
workflow_config = {}
|
|
64
|
+
if workflow_config_path.exists():
|
|
65
|
+
import json
|
|
66
|
+
|
|
67
|
+
workflow_config = json.loads(workflow_config_path.read_text(encoding="utf-8"))
|
|
68
|
+
|
|
69
|
+
if layer == "workflow-language":
|
|
70
|
+
return "workflow-language", topology["workflow_root"], workflow_config.get("workflow_language")
|
|
71
|
+
if layer == "canonical":
|
|
72
|
+
return "canonical", topology["canonical_root"], workflow_config.get("paper_language") or workflow_config.get("workflow_language")
|
|
73
|
+
if topology["workflow_language_active"] and topology["workflow_root"] is not None:
|
|
74
|
+
return "workflow-language", topology["workflow_root"], workflow_config.get("workflow_language")
|
|
75
|
+
return "canonical", topology["canonical_root"], workflow_config.get("paper_language") or workflow_config.get("workflow_language")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def collect_tex_files(layer_root: Path) -> list[Path]:
|
|
79
|
+
return sorted(path for path in layer_root.rglob("*.tex") if path.is_file())
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def resolve_input_target(source_file: Path, layer_root: Path, raw_target: str) -> Path | None:
|
|
83
|
+
target = raw_target.strip()
|
|
84
|
+
if not target:
|
|
85
|
+
return None
|
|
86
|
+
candidates: list[Path] = []
|
|
87
|
+
target_path = Path(target)
|
|
88
|
+
if target_path.is_absolute():
|
|
89
|
+
candidates.append(target_path)
|
|
90
|
+
else:
|
|
91
|
+
paths_to_try = [target_path]
|
|
92
|
+
if target_path.suffix == "":
|
|
93
|
+
paths_to_try.append(target_path.with_suffix(".tex"))
|
|
94
|
+
for candidate in paths_to_try:
|
|
95
|
+
candidates.append((source_file.parent / candidate).resolve())
|
|
96
|
+
candidates.append((layer_root / candidate).resolve())
|
|
97
|
+
for candidate in candidates:
|
|
98
|
+
if candidate.exists():
|
|
99
|
+
return candidate
|
|
100
|
+
return candidates[0] if candidates else None
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def parse_bibliography_keys(layer_root: Path) -> set[str]:
|
|
104
|
+
keys: set[str] = set()
|
|
105
|
+
for bib_path in sorted(layer_root.glob("*.bib")):
|
|
106
|
+
text = read_text(bib_path)
|
|
107
|
+
for match in BIB_KEY_RE.finditer(text):
|
|
108
|
+
keys.add(match.group(1).strip())
|
|
109
|
+
return keys
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def validate_latex_graph(layer_root: Path, tex_files: list[Path]) -> list[str]:
|
|
113
|
+
issues: list[str] = []
|
|
114
|
+
main_tex = layer_root / "main.tex"
|
|
115
|
+
if not main_tex.exists():
|
|
116
|
+
issues.append(f"{layer_root}: missing main.tex for paper-layer validation")
|
|
117
|
+
if not tex_files:
|
|
118
|
+
issues.append(f"{layer_root}: no .tex files found in the target paper layer")
|
|
119
|
+
return issues
|
|
120
|
+
|
|
121
|
+
labels: dict[str, Path] = {}
|
|
122
|
+
refs: list[tuple[Path, str]] = []
|
|
123
|
+
cites: list[tuple[Path, str]] = []
|
|
124
|
+
|
|
125
|
+
for tex_path in tex_files:
|
|
126
|
+
text = strip_comments(read_text(tex_path))
|
|
127
|
+
for match in INPUT_RE.finditer(text):
|
|
128
|
+
target = resolve_input_target(tex_path, layer_root, match.group(1))
|
|
129
|
+
if target is None or not target.exists():
|
|
130
|
+
issues.append(
|
|
131
|
+
f"{tex_path}: missing LaTeX include target `{match.group(1)}` inside the active paper layer"
|
|
132
|
+
)
|
|
133
|
+
for match in LABEL_RE.finditer(text):
|
|
134
|
+
label = match.group(1).strip()
|
|
135
|
+
if not label:
|
|
136
|
+
continue
|
|
137
|
+
if label in labels and labels[label] != tex_path:
|
|
138
|
+
issues.append(
|
|
139
|
+
f"duplicate LaTeX label `{label}` appears in both {labels[label]} and {tex_path}"
|
|
140
|
+
)
|
|
141
|
+
labels[label] = tex_path
|
|
142
|
+
for match in REF_RE.finditer(text):
|
|
143
|
+
label = next(group for group in match.groups() if group)
|
|
144
|
+
refs.append((tex_path, label.strip()))
|
|
145
|
+
for match in CITE_RE.finditer(text):
|
|
146
|
+
for key in match.group(1).split(","):
|
|
147
|
+
normalized = key.strip()
|
|
148
|
+
if normalized:
|
|
149
|
+
cites.append((tex_path, normalized))
|
|
150
|
+
|
|
151
|
+
for tex_path, label in refs:
|
|
152
|
+
if label not in labels:
|
|
153
|
+
issues.append(f"{tex_path}: unresolved LaTeX reference `{label}` in the active paper layer")
|
|
154
|
+
|
|
155
|
+
bibliography_keys = parse_bibliography_keys(layer_root)
|
|
156
|
+
if cites and not bibliography_keys:
|
|
157
|
+
issues.append(f"{layer_root}: citations are present but no bibliography keys were found in the paper layer")
|
|
158
|
+
for tex_path, key in cites:
|
|
159
|
+
if bibliography_keys and key not in bibliography_keys:
|
|
160
|
+
issues.append(f"{tex_path}: unresolved bibliography key `{key}` in the active paper layer")
|
|
161
|
+
|
|
162
|
+
return issues
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def validate_manuscript_delivery_layer(layer_root: Path) -> list[str]:
|
|
166
|
+
issues: list[str] = []
|
|
167
|
+
check_main_tex(layer_root, issues)
|
|
168
|
+
check_bibliography(layer_root, issues)
|
|
169
|
+
check_global_tex(layer_root, issues)
|
|
170
|
+
check_introduction_section(layer_root, issues)
|
|
171
|
+
check_method_section(layer_root, issues)
|
|
172
|
+
check_experiments_section(layer_root, issues)
|
|
173
|
+
check_asset_consumption(layer_root, issues)
|
|
174
|
+
check_language_layers(layer_root, issues)
|
|
175
|
+
check_latest_write_iteration_preflight(layer_root, issues)
|
|
176
|
+
|
|
177
|
+
tables_dir = layer_root / "tables"
|
|
178
|
+
check_table_file(tables_dir / REQUIRED_TABLE_FILES[0], issues, "tables/main-results.tex")
|
|
179
|
+
check_table_file(tables_dir / REQUIRED_TABLE_FILES[1], issues, "tables/ablations.tex")
|
|
180
|
+
|
|
181
|
+
figures_dir = layer_root / "figures"
|
|
182
|
+
check_figure_file(figures_dir / REQUIRED_FIGURE_FILES[0], issues, "figures/problem-setting.tex")
|
|
183
|
+
check_figure_file(figures_dir / REQUIRED_FIGURE_FILES[1], issues, "figures/method-overview.tex")
|
|
184
|
+
check_figure_file(figures_dir / REQUIRED_FIGURE_FILES[2], issues, "figures/results-overview.tex")
|
|
185
|
+
|
|
186
|
+
analysis_dir = layer_root / "analysis"
|
|
187
|
+
check_analysis_asset(analysis_dir / "analysis-asset.tex", issues)
|
|
188
|
+
return issues
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def validate_layer(project_root: Path, layer: str, mode: str) -> tuple[list[str], str, Path | None]:
|
|
192
|
+
issues: list[str] = []
|
|
193
|
+
resolved_layer, layer_root, layer_language = resolve_target_layer(project_root, layer)
|
|
194
|
+
if layer_root is None:
|
|
195
|
+
issues.append("workflow-language paper layer is not active for this project")
|
|
196
|
+
return issues, resolved_layer, layer_root
|
|
197
|
+
if not layer_root.exists():
|
|
198
|
+
issues.append(f"paper layer does not exist: {layer_root}")
|
|
199
|
+
return issues, resolved_layer, layer_root
|
|
200
|
+
|
|
201
|
+
issues.extend(validate_topology_artifacts(project_root))
|
|
202
|
+
|
|
203
|
+
tex_files = collect_tex_files(layer_root)
|
|
204
|
+
issues.extend(validate_latex_graph(layer_root, tex_files))
|
|
205
|
+
|
|
206
|
+
if layer_language == "zh":
|
|
207
|
+
glossary_path = project_root / ".lab" / "writing" / "terminology-glossary.md"
|
|
208
|
+
allowed = load_allowed_fragments(str(glossary_path) if glossary_path.exists() else None, [])
|
|
209
|
+
issues.extend(validate_files([str(path) for path in tex_files], allowed))
|
|
210
|
+
|
|
211
|
+
if mode in {"final", "export"}:
|
|
212
|
+
issues.extend(validate_manuscript_delivery_layer(layer_root))
|
|
213
|
+
|
|
214
|
+
return issues, resolved_layer, layer_root
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def main() -> int:
|
|
218
|
+
args = parse_args()
|
|
219
|
+
project_root = find_project_root(Path(args.project_root).resolve())
|
|
220
|
+
if project_root is None:
|
|
221
|
+
print("could not find .lab/config/workflow.json for project root", file=sys.stderr)
|
|
222
|
+
return 1
|
|
223
|
+
|
|
224
|
+
issues, resolved_layer, layer_root = validate_layer(project_root, args.layer, args.mode)
|
|
225
|
+
if issues:
|
|
226
|
+
for issue in issues:
|
|
227
|
+
print(issue, file=sys.stderr)
|
|
228
|
+
return 1
|
|
229
|
+
|
|
230
|
+
print(
|
|
231
|
+
f"paper layer is valid: {resolved_layer} -> {layer_root}"
|
|
232
|
+
)
|
|
233
|
+
return 0
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
if __name__ == "__main__":
|
|
237
|
+
raise SystemExit(main())
|
|
@@ -17,6 +17,9 @@ ENGLISH_FRAGMENT_RE = re.compile(
|
|
|
17
17
|
r"(?:[ \t]+[A-Za-z][A-Za-z0-9+]*(?:-[A-Za-z][A-Za-z0-9+]*)*)*)(?![A-Za-z0-9_])"
|
|
18
18
|
)
|
|
19
19
|
FIELD_RE = re.compile(r"^[ \t]*-[ \t]*([^::]+)[::][ \t]*([^\n]*)[ \t]*$", flags=re.MULTILINE)
|
|
20
|
+
PAPER_FACING_COMMAND_RE = re.compile(
|
|
21
|
+
r"\\(?:section|subsection|subsubsection|paragraph|subparagraph|caption)\*?\{([^}]*)\}"
|
|
22
|
+
)
|
|
20
23
|
|
|
21
24
|
|
|
22
25
|
DEFAULT_ALLOWED_FRAGMENTS = {
|
|
@@ -146,6 +149,22 @@ def should_ignore_candidate(candidate: str, allowed: set[str]) -> bool:
|
|
|
146
149
|
return False
|
|
147
150
|
|
|
148
151
|
|
|
152
|
+
def should_ignore_heading_candidate(candidate: str, allowed: set[str]) -> bool:
|
|
153
|
+
normalized = normalize_fragment(candidate)
|
|
154
|
+
if not normalized:
|
|
155
|
+
return True
|
|
156
|
+
if normalized in allowed or normalized.replace(" ", "") in allowed:
|
|
157
|
+
return True
|
|
158
|
+
tokens = re.findall(r"[A-Za-z][A-Za-z0-9+]*", candidate)
|
|
159
|
+
if not tokens:
|
|
160
|
+
return True
|
|
161
|
+
if all(token.lower() in allowed for token in tokens):
|
|
162
|
+
return True
|
|
163
|
+
if len(tokens) == 1 and re.fullmatch(r"[A-Z0-9+\-]{2,}", tokens[0]):
|
|
164
|
+
return True
|
|
165
|
+
return False
|
|
166
|
+
|
|
167
|
+
|
|
149
168
|
def find_mixed_fragments(text: str, allowed: set[str]) -> list[tuple[int, str]]:
|
|
150
169
|
issues: list[tuple[int, str]] = []
|
|
151
170
|
stripped = strip_latex_noise(remove_first_mention_parentheticals(text))
|
|
@@ -167,6 +186,30 @@ def find_mixed_fragments(text: str, allowed: set[str]) -> list[tuple[int, str]]:
|
|
|
167
186
|
return issues
|
|
168
187
|
|
|
169
188
|
|
|
189
|
+
def strip_inline_latex_markup(text: str) -> str:
|
|
190
|
+
text = re.sub(r"\\[A-Za-z@*]+(?:\[[^\]]*\])?", " ", text)
|
|
191
|
+
text = text.replace("{", " ").replace("}", " ")
|
|
192
|
+
return re.sub(r"\s+", " ", text).strip()
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def find_heading_english_fragments(text: str, allowed: set[str]) -> list[tuple[int, str]]:
|
|
196
|
+
issues: list[tuple[int, str]] = []
|
|
197
|
+
for line_no, line in enumerate(text.splitlines(), start=1):
|
|
198
|
+
seen_on_line: set[str] = set()
|
|
199
|
+
for match in PAPER_FACING_COMMAND_RE.finditer(line):
|
|
200
|
+
candidate = strip_inline_latex_markup(match.group(1))
|
|
201
|
+
if not candidate or CJK_RE.search(candidate) or not re.search(r"[A-Za-z]", candidate):
|
|
202
|
+
continue
|
|
203
|
+
normalized = normalize_fragment(candidate)
|
|
204
|
+
if normalized in seen_on_line:
|
|
205
|
+
continue
|
|
206
|
+
seen_on_line.add(normalized)
|
|
207
|
+
if should_ignore_heading_candidate(candidate, allowed):
|
|
208
|
+
continue
|
|
209
|
+
issues.append((line_no, candidate))
|
|
210
|
+
return issues
|
|
211
|
+
|
|
212
|
+
|
|
170
213
|
def validate_files(files: list[str], allowed: set[str]) -> list[str]:
|
|
171
214
|
issues: list[str] = []
|
|
172
215
|
for file_name in files:
|
|
@@ -185,6 +228,10 @@ def validate_files(files: list[str], allowed: set[str]) -> list[str]:
|
|
|
185
228
|
issues.append(
|
|
186
229
|
f"{path}:{line_no}: English concept fragment '{fragment}' appears in Chinese workflow-language prose; translate it, define it once as a first mention, or add a justified glossary exception"
|
|
187
230
|
)
|
|
231
|
+
for line_no, fragment in find_heading_english_fragments(text, allowed):
|
|
232
|
+
issues.append(
|
|
233
|
+
f"{path}:{line_no}: English paper-facing heading or caption '{fragment}' appears in Chinese workflow-language LaTeX; translate it, define it once locally, or add a justified glossary exception"
|
|
234
|
+
)
|
|
188
235
|
return issues
|
|
189
236
|
|
|
190
237
|
|
|
@@ -314,7 +314,7 @@ Use this skill when the user invokes `/lab:*` or asks for the structured researc
|
|
|
314
314
|
- Keep terminology stable across rounds and sections.
|
|
315
315
|
- Maintain `.lab/writing/terminology-glossary.md` as the write-stage source for full forms, approved short forms, reader-facing explanations, allowed aliases, and terms that should stay out of prose.
|
|
316
316
|
- When `workflow_language=zh`, use Chinese workflow-language terminology: concept terms need a Chinese paper-facing name and Chinese short form by default; English full form plus acronym may appear only at first mention, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally.
|
|
317
|
-
- When completing Chinese workflow-language output, run `
|
|
317
|
+
- When completing Chinese workflow-language output, run `validate_paper_layer.py` on the resolved active paper layer before claiming the round is accepted; use `validate_workflow_language_text.py` only as a local repair helper when the layer validator identifies specific offending files.
|
|
318
318
|
- Maintain `.lab/writing/metric-glossary.md` as the write-stage source for reported metric names, definitions, calculations, denominators, directions, scopes, and aliases.
|
|
319
319
|
- When a round introduces or revises key terms, include a compact terminology note in the user-facing write summary and record the terminology-clarity self-check in the latest write iteration artifact.
|
|
320
320
|
- When a round introduces or revises metrics, include a compact metric-glossary note in the user-facing write summary and record the metric-glossary validation in the latest write iteration artifact.
|
|
@@ -188,7 +188,8 @@ Do not enter prose polish until the current section has passed the reference-con
|
|
|
188
188
|
- Do not default the next-step recommendation to another polish pass. Recommend the first unresolved section-level blocker, or stop if the section is already accepted for the round.
|
|
189
189
|
- Use natural-language full names in prose. If an approved short form is needed later, define it once and reuse it consistently.
|
|
190
190
|
- Chinese workflow-language terminology must be stricter than generic first-mention rules. When `workflow_language=zh`, concept terms should use a Chinese paper-facing name and a Chinese short form by default. English full form plus acronym may appear at first mention only as `中文全称(English full form, ACRONYM)`, then prose should reuse the Chinese short form. Prefer natural compact Chinese short forms; two-character, three-character, four-character, or longer short phrases are all acceptable when they read naturally. Do not force a fixed-length abbreviation. Avoid repeating English concept fragments such as `residual-fitting pathology`, `treated-group noise`, `gain-head function class`, `input-matched`, or `refinement` throughout Chinese prose.
|
|
191
|
-
- For `workflow_language=zh`, run `
|
|
191
|
+
- For `workflow_language=zh`, run `validate_paper_layer.py` on the resolved active paper layer before completing the round. This is a whole-layer gate, not a touched-file spot check. If it reports English concept fragments or English paper-facing headings/captions, translate them, define them once as `中文全称(English full form, ACRONYM)`, or add a justified glossary exception before prose polish.
|
|
192
|
+
- Use `validate_workflow_language_text.py` as a local repair helper when you need to narrow the issue to one specific workflow-language file after the whole-layer validator fails.
|
|
192
193
|
- Do not use labels containing `_` or `-` in reader-facing prose.
|
|
193
194
|
- Keep internal identifiers, config keys, and experiment package labels out of reader-facing prose unless they are mapped once for the reader and then moved back out of prose.
|
|
194
195
|
- Keep run provenance such as tuning-run labels, probe names, internal config strings, rerun ids, and package labels out of reader-facing prose. If the evidence is useful, rewrite it as a bounded paper-facing diagnostic or move the raw provenance to workflow notes or appendix metadata.
|
|
@@ -225,10 +226,12 @@ Do not enter prose polish until the current section has passed the reference-con
|
|
|
225
226
|
- Before drafting `introduction`, `method`, `experiments`, `related work`, or `conclusion`, also run `.lab/.managed/scripts/validate_paper_topology.py --project-root .` so plan/context files cannot keep presenting legacy layers as the active paper topology. If that validator fails, do not mark the topology as repaired and do not continue section polish.
|
|
226
227
|
- When the repository workflow config is available, the paper-plan validator also checks that `.lab/writing/plan.md` stays in `workflow_language` instead of silently drifting into another language.
|
|
227
228
|
- If the paper-plan validator fails, stop and fill `.lab/writing/plan.md` first instead of drafting prose.
|
|
229
|
+
- After revising the active section, run `.lab/.managed/scripts/validate_paper_layer.py --project-root . --layer <resolved-layer> --mode draft` so layer-wide language drift and LaTeX graph breakage are caught even when the current section itself looks clean.
|
|
228
230
|
- During ordinary draft rounds, run `.lab/.managed/scripts/validate_section_draft.py --section <section> --section-file <section-file> --mode draft` and `.lab/.managed/scripts/validate_paper_claims.py --section-file <section-file> --mode draft` after revising the active section.
|
|
229
231
|
- During ordinary draft rounds that introduce or revise metrics, also run `.lab/.managed/scripts/validate_metric_glossary.py --metric-glossary .lab/writing/metric-glossary.md --tex-file <section-or-table-file> --mode draft`.
|
|
230
232
|
- If reference-guided deep-write was triggered, also run `.lab/.managed/scripts/validate_reference_consumption.py --section <section> --section-file <section-file> --mode draft` after revising the active section.
|
|
231
233
|
- 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.
|
|
234
|
+
- Treat paper-layer validator failures as blockers. They indicate active-layer breakage that section-local validators cannot safely waive.
|
|
232
235
|
- If the active section already lives under a paper-layer `sections/` directory, the draft section validator should also warn when the neighboring required figure or analysis placeholder files are still missing from that same paper layer.
|
|
233
236
|
- For each subsection, explicitly include motivation, design, and technical advantage when applicable.
|
|
234
237
|
- Avoid a writing style that reads like incremental patching of a naive baseline.
|
|
@@ -257,6 +260,7 @@ Do not enter prose polish until the current section has passed the reference-con
|
|
|
257
260
|
- Core asset coverage for a paper-facing final draft should include a problem-setting or teaser figure, a method overview figure, a results overview figure, a main-results table, an ablation table, and one additional analysis asset.
|
|
258
261
|
- Keep `.lab/writing/plan.md` synchronized with the current table plan, figure plan, citation plan, and section-to-asset map whenever manuscript assets change.
|
|
259
262
|
- 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.
|
|
263
|
+
- For final-draft or export rounds, run `.lab/.managed/scripts/validate_paper_layer.py --project-root . --layer <resolved-layer> --mode final` before accepting the round; use `--mode export` for export/publish rounds.
|
|
260
264
|
- For final-draft or export rounds with reported metrics, run `.lab/.managed/scripts/validate_metric_glossary.py --metric-glossary .lab/writing/metric-glossary.md --tex-file <section-file> --mode final` before accepting the round. Add relevant table, figure, or analysis `.tex` files with repeated `--tex-file` when they contain metric names.
|
|
261
265
|
- If reference-guided deep-write was triggered, run `.lab/.managed/scripts/validate_reference_consumption.py --section <section> --section-file <section-file> --mode final` before accepting the final-draft or export round.
|
|
262
266
|
- 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.
|