superlab 0.1.66 → 0.1.68

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.
Files changed (26) hide show
  1. package/lib/i18n.cjs +0 -6
  2. package/lib/lab_write_contract.json +4 -4
  3. package/package-assets/claude/commands/lab/write.md +2 -1
  4. package/package-assets/claude/commands/lab-write.md +2 -1
  5. package/package-assets/claude/commands/lab:write.md +2 -1
  6. package/package-assets/claude/commands/lab/357/274/232write.md +2 -1
  7. package/package-assets/codex/prompts/lab/write.md +2 -1
  8. package/package-assets/codex/prompts/lab-write.md +2 -1
  9. package/package-assets/codex/prompts/lab:write.md +2 -1
  10. package/package-assets/codex/prompts/lab/357/274/232write.md +2 -1
  11. package/package-assets/shared/lab/.managed/scripts/validate_manuscript_delivery.py +119 -83
  12. package/package-assets/shared/lab/.managed/scripts/validate_paper_plan.py +2 -0
  13. package/package-assets/shared/lab/.managed/scripts/validate_reference_consumption.py +348 -0
  14. package/package-assets/shared/lab/.managed/scripts/validate_section_draft.py +70 -141
  15. package/package-assets/shared/lab/.managed/templates/paper-figure.tex +2 -1
  16. package/package-assets/shared/lab/.managed/templates/paper-plan.md +4 -4
  17. package/package-assets/shared/lab/.managed/templates/reference-consumption-plan.md +41 -0
  18. package/package-assets/shared/lab/.managed/templates/write-iteration.md +17 -27
  19. package/package-assets/shared/skills/lab/SKILL.md +6 -1
  20. package/package-assets/shared/skills/lab/references/paper-writing/examples/experiments/figure-placeholder-and-discussion.md +10 -6
  21. package/package-assets/shared/skills/lab/references/paper-writing/examples/experiments-examples.md +1 -1
  22. package/package-assets/shared/skills/lab/references/paper-writing/section-style-policies.md +12 -0
  23. package/package-assets/shared/skills/lab/stages/write.md +32 -20
  24. package/package.json +1 -1
  25. package/package-assets/shared/lab/.managed/scripts/extract_reference_paper_structure.py +0 -1200
  26. package/package-assets/shared/lab/.managed/templates/reference-template-intake.md +0 -50
@@ -69,6 +69,29 @@ Run these on every round:
69
69
  - reviewer pass -> `skills/lab/references/paper-writing/paper-review.md`
70
70
  - section-specific style policy -> `skills/lab/references/paper-writing/section-style-policies.md` (load the block matching the current section)
71
71
 
72
+ ## Reference-Guided Deep Write
73
+
74
+ Trigger this mode automatically when the user provides reference PDFs, paper URLs, local reference-paper paths, a template paper, or asks to "参考" papers while continuing `/lab:write`.
75
+
76
+ This mode is still `/lab:write`; do not introduce a separate user command. It increases the depth of the write round instead of asking the user to remember another stage.
77
+
78
+ Required sequence:
79
+
80
+ 1. Extract or refresh reference-paper structure with `.lab/.managed/scripts/extract_reference_paper_structure.py` when new reference PDFs or URLs are provided.
81
+ 2. Read the generated `section-map.json`, `section-logic.md`, `paragraph-roles.json`, `visual-assets.json`, and aggregate `section-templates/<section>.json` for the current section.
82
+ 3. Write `.lab/writing/reference-patterns/consumption-plan/<section>.md` from `.lab/.managed/templates/reference-consumption-plan.md` before drafting prose.
83
+ 4. Map reference section/subsection slots, paragraph roles, table roles, figure roles, and bridge logic to the current paper's evidence and active paper layer.
84
+ 5. Explicitly waive any reference slot that is not used, with a reason tied to current evidence or scope.
85
+ 6. Reuse structure only. Do not copy wording, claims, metrics, captions, or conclusions from the reference papers.
86
+ 7. Realize the mapped structure in the section itself. Do not stop at a consumption-plan artifact; the current section must visibly expose the adopted dataset, protocol, comparator, metric, result, ablation, robustness, paragraph-role, and asset-role slots where applicable.
87
+ 8. Run `.lab/.managed/scripts/validate_reference_consumption.py --section <section> --section-file <section-file> --mode draft` after drafting; final-draft or export rounds must use `--mode final`.
88
+
89
+ For experiments, the consumption plan must cover or explicitly waive dataset description/statistics, split protocol, baseline setup, metric definition, implementation details, main results, ablation, and sensitivity/robustness. Dataset description, split protocol, baseline setup, metric definition, and main results are core slots and should be mapped rather than waived in normal empirical papers.
90
+
91
+ For experiments, do not collapse all adopted reference slots into one dense setup paragraph. Dataset/task scope, split protocol, comparator setup, metric definitions, main results, ablation, and robustness/diagnostic analysis should be separated by subsection, paragraph anchor, table/figure placement, or an explicit local bridge when the paper is short.
92
+
93
+ Do not enter prose polish until the current section has passed the reference-consumption check or has a recorded reason why reference-guided writing was not triggered.
94
+
72
95
  ## Small-Step Writing Rules
73
96
 
74
97
  - Change one section or one clearly bounded subsection per round.
@@ -113,16 +136,8 @@ Run these on every round:
113
136
  - Load only the current section guide. Do not load every section guide at once.
114
137
  - Reuse example-bank structure, paragraph roles, sentence logic, and paper-facing LaTeX asset patterns when examples are bundled, but never copy wording verbatim.
115
138
  - Treat example cites and example file names as writing references, not as evidence for the current paper.
116
- - When the user provides local PDFs, PDF URLs, HTML pages, or reference papers while invoking `/lab:write`, run `.lab/.managed/scripts/extract_reference_paper_structure.py --output-dir .lab/writing/reference-patterns <sources...>` before drafting unless an up-to-date `.lab/writing/reference-patterns/aggregate-template-playbook.md` already covers those exact sources.
117
- - Treat reference-paper intake as an internal write capability, not a separate user command. The user should still only need `/lab:write`; do not ask them to learn another workflow.
118
- - The purpose of reference-paper intake is to help `/lab:write` reproduce mature multi-template writing structure: section slots, paragraph roles, argument sequence, table and figure functions, placement logic, and bridge sentences.
119
- - Use at least two compatible reference templates when available. If only one reference is available, mark it as a single-template pattern and avoid treating it as a universal standard.
120
- - For every reference table or figure, extract what reader question it answers, which section/subsection it supports, why it is placed there, what the prose before it should do, and what the prose after it should explain.
121
- - When drafting from reference templates, reproduce structure and logic only. Do not copy wording, claims, metrics, baselines, data, captions, or conclusions from reference papers.
122
- - Before drafting a section from reference templates, read `.lab/writing/reference-patterns/aggregate-template-playbook.md`, the matching file under `.lab/writing/reference-patterns/section-templates/`, and the matching visual/table template under `.lab/writing/reference-patterns/visual-templates/` when the section uses tables or figures.
123
- - For experiment sections, also read `.lab/writing/reference-patterns/section-templates/experiments-protocol.json` when it exists and preserve its protocol slot logic: dataset descriptions, dataset statistics, split/sampling protocol, baseline setup, metric definitions, implementation or tuning details, main results, ablations, sensitivity analysis, and appendix-to-main links.
124
- - Do not accept coarse labels such as “setup” or “overall performance” as a complete experiment-template extraction when the source papers contain explicit dataset, baseline, metric, implementation, or appendix-detail paragraphs.
125
139
  - Build a compact mini-outline before prose.
140
+ - When reference-guided deep-write is triggered, build the reference consumption plan before the mini-outline so the outline is based on mapped section slots rather than generic prose flow.
126
141
  - Academic readability standards are the same in `workflow_language` and `paper_language`; changing languages must not lower external-reader clarity.
127
142
  - If the current round introduces or revises key terms, abbreviations, metric names, mechanism names, or system labels, explain them at first mention by briefly stating what they are and why they matter here.
128
143
  - First mention should use the full form. If a short form or acronym will be reused later, define it at first mention as `Full Form (Short Form)` before switching to the short form.
@@ -135,10 +150,6 @@ Run these on every round:
135
150
  - Before any additional tighten, compress, or polish pass on the same section, run a section-level acceptance gate first.
136
151
  - The section-level acceptance gate is passed only when canonical naming consistency, adjacent-section consistency, claim, metric, and ranking consistency with the current evidence, local clarity, local concision, and section-style compliance are all explicitly checked and no unresolved blocker remains.
137
152
  - If the current section still contains a banned expression or banned rhetorical move from `section-style-policies.md`, the round has not passed the section-level acceptance gate.
138
- - If reviewer notes, validator warnings, or prior write rounds produced issues, record them as a review issue bundle in the write-iteration artifact before further polishing.
139
- - Review issue bundles should separate script-backed findings from judgment-backed findings, preserve the source quote or local pointer when available, and track whether each issue is new, resolved, open, or superseded.
140
- - Before continuing prose polish after a review issue bundle exists, run a re-audit pass that compares the current draft against previous root causes and records fully addressed, partially addressed, not addressed, and newly introduced root causes.
141
- - Do not answer a review issue by merely changing wording around it. Fix the underlying section structure, evidence support, terminology definition, or asset/table linkage that caused the issue.
142
153
  - If the current round changes the paper's canonical experiment or evaluation protocol (for example split ratio, train/test size, seed or split count, benchmark set, or main-table evaluation contract), treat it as a canonical protocol replacement unless the user explicitly scopes it as supplementary or appendix-only.
143
154
  - A canonical protocol replacement requires a paper-wide impact audit before more polishing: identify stale sections and assets across Abstract, Introduction, Method, Experiments, Conclusion, tables, figures, analysis assets, and `.lab/writing/plan.md`, then update the plan and highest-impact stale targets first.
144
155
  - When a paper-wide impact audit is still open, default the next write action to the highest-impact canonical stale section or asset instead of polishing the same section again.
@@ -151,7 +162,10 @@ Run these on every round:
151
162
  - Use natural-language full names in prose. If an approved short form is needed later, define it once and reuse it consistently.
152
163
  - Do not use labels containing `_` or `-` in reader-facing prose.
153
164
  - 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.
165
+ - 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.
154
166
  - Do not use unexplained terminology density as a substitute for academic tone.
167
+ - Keep service-style or AI-assistant meta language out of manuscript prose. Phrases such as "用户说", "按你的要求", "我来解释", "下面我", "this version", or "as requested by the user" belong in workflow notes, not in paper-facing sections, captions, table notes, or analysis assets.
168
+ - Keep workflow-only placeholder language out of manuscript prose. Phrases such as "图的意图", "资产意图", "占位符", "workflow-language", "translation layer", or "sync this wording" belong in authoring artifacts, not in reader-facing LaTeX.
155
169
  - Main tables must be locally self-contained: a reader looking at the table title, header, note, and adjacent introduction or interpretation should be able to determine what each row represents, what each column measures, the metric direction, and any relevant unit, denominator, or event condition.
156
170
  - Short headers remain allowed, but they must be resolved locally through the same table's caption or table note instead of forcing the reader to chase the Method section.
157
171
  - If the Method or Experiments prose says the paper reports a metric family, the main table set must either expose those metrics directly or explicitly mark the missing ones as appendix-only and explain why.
@@ -174,9 +188,9 @@ Run these on every round:
174
188
  - 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.
175
189
  - If the paper-plan validator fails, stop and fill `.lab/writing/plan.md` first instead of drafting prose.
176
190
  - 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.
191
+ - 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.
177
192
  - 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.
178
193
  - 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.
179
- - For experiment sections, treat prose-only performance claims, unnamed generic comparator phrases, repeated split/seed protocols without variance disposition, and result paragraphs without concrete metric/table anchors as section warnings that must be fixed before more prose-only polishing.
180
194
  - For each subsection, explicitly include motivation, design, and technical advantage when applicable.
181
195
  - Avoid a writing style that reads like incremental patching of a naive baseline.
182
196
  - Keep terminology stable across the full paper.
@@ -197,14 +211,13 @@ Run these on every round:
197
211
  - `<deliverables_root>/paper/analysis/analysis-asset.tex`
198
212
  - Table assets must use paper-facing LaTeX structure with `booktabs`, caption, label, and consistent precision.
199
213
  - Table assets must also include a local table note that explains row meaning, column meaning, metric definitions, comparison scope, and any important caveat.
200
- - Table assets must avoid vertical rules, `\hline`, and `\cline`; use `booktabs` rules and whitespace instead.
201
- - Table captions should appear before the tabular body so the table can be read top-down in manuscript order.
202
- - Numeric precision should be consistent within each metric column unless the table note explains a deliberate exception.
214
+ - The local table note must contain real reader-facing explanations, not the default template phrases such as "explain what each row represents" or "expand local abbreviations".
203
215
  - Table assets must not rely on aggressive width hacks by default; if width control is still needed after table redesign, document it locally and keep it readable.
204
- - Figure placeholders must explain what the final figure should show and why the reader needs it.
216
+ - Figure placeholders may record what the final figure should show and why the reader needs it in authoring comments, the paper plan, or the write-iteration artifact, but the caption itself must remain paper-facing and must not contain "Figure intent", "图的意图", "asset intent", "占位符", or similar workflow language.
205
217
  - 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.
206
218
  - Keep `.lab/writing/plan.md` synchronized with the current table plan, figure plan, citation plan, and section-to-asset map whenever manuscript assets change.
207
219
  - 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.
220
+ - 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.
208
221
  - 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.
209
222
  - Final-round section validation should fail when a section in the paper layer references required figure or analysis placeholders but the neighboring asset files are still missing from that layer.
210
223
  - Run `.lab/.managed/scripts/validate_manuscript_delivery.py --paper-dir <deliverables_root>/paper` before accepting a final-draft or export round.
@@ -217,8 +230,6 @@ Run these on every round:
217
230
  - When a round introduces or revises key terms, include a compact terminology note in the user-facing round summary and record the terminology-clarity self-check in the write-iteration artifact.
218
231
  - Record the section-level acceptance gate in the write-iteration artifact before recommending further tightening on the same section.
219
232
  - Record section-style policy compliance, any retained discouraged move, and any banned move found in the write-iteration artifact.
220
- - Record the review issue bundle and re-audit status in the write-iteration artifact whenever the round follows reviewer notes, validator warnings, or prior failed writing rounds.
221
- - Record the reference template intake in the write-iteration artifact whenever the round uses PDFs, URLs, or `.lab/writing/reference-patterns/` artifacts: sources used, aggregate playbook path, section templates consulted, visual/table templates consulted, multi-template reproduction plan, and structure-only reuse boundary.
222
233
  - Record the round target layer in the write-iteration artifact as `canonical manuscript`, `workflow-language paper layer`, or `both`.
223
234
  - If workflow-language was active and the round still targeted the canonical manuscript, record why canonical-only writing was acceptable in the write-iteration artifact.
224
235
  - If both layers were edited, record why the cross-language sync was required and whether it was explicitly requested by the user or required by final-draft/export finalization.
@@ -239,6 +250,7 @@ Run these on every round:
239
250
  - `.lab/writing/framing.md`
240
251
  - `.lab/writing/plan.md`
241
252
  - `.lab/writing/terminology-glossary.md`
253
+ - `.lab/writing/reference-patterns/consumption-plan/<section>.md` when reference-guided deep-write is triggered
242
254
  - `.lab/writing/iterations/<n>.md`
243
255
  - `<deliverables_root>/paper/main.tex`
244
256
  - `<deliverables_root>/paper/references.bib`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlab",
3
- "version": "0.1.66",
3
+ "version": "0.1.68",
4
4
  "description": "Strict /lab research workflow installer for Codex and Claude",
5
5
  "keywords": [
6
6
  "codex",