-
id: writing_plan
label: "写作计划"
label_en: "Writing plan"
kind: llm_chat
depends_on: [paper_preferences, outline, citation_plan, experiment_design, figure_placeholders, table_placeholders, analysis_outline, refbib]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
system: "You build a writing blueprint for a long-form academic manuscript. The blueprint is consumed verbatim by per-section authors; precision matters more than prose."
task: |
Synthesize the upstream planning outputs into a single
authoritative WRITING_PLAN that every section author must
obey. Lock terminology, notation, claim mapping, and
per-section length budget BEFORE any prose is written.
Paper facts:
TOPIC: {{ outputs.paper_contract | truncate(1200) }}
MODE: {{ outputs.paper_contract | truncate(400) }}
LANGUAGE: {{ outputs.paper_contract | truncate(400) }}
TARGET_PAGES: {{ outputs.paper_contract | truncate(400) }}
AUDIENCE: {{ outputs.paper_contract | truncate(400) }}
Preferences:
{{ outputs.paper_preferences | truncate(2000) }}
Outline:
{{ outputs.outline | truncate(6000) }}
Experiment design:
{{ outputs.experiment_design | truncate(6000) }}
Citation plan:
{{ outputs.citation_plan | truncate(6000) }}
Bibliography (cite keys MUST come from here):
{{ outputs.refbib | truncate(4000) }}
Figure placeholders (IDs only):
{{ outputs.figure_placeholders | truncate(1500) }}
Table placeholders (IDs only):
{{ outputs.table_placeholders | truncate(1500) }}
Length/citation budget rules:
- Treat paper_preferences.LENGTH_STRATEGY and TARGET_LENGTH as
authoritative; do not use a fixed default page or word budget when
the user requested a different length.
- This writing plan is the length-control point. Solve length by
allocating enough section scope, subclaims, evidence, analysis,
and limitations now; do not assume a downstream checker will fix
an undersized manuscript later.
- Convert the requested compiled-page target into an approximate
total word budget using the paper language, figure/table count,
and venue style. For normal academic article formatting, set the
minimum total target_words to at least TARGET_PAGES × 820 English
words (or the equivalent dense prose units for non-English text).
Do not reduce below TARGET_PAGES × 760 for figures/tables; instead
add analysis, limitations, related-work synthesis, and method detail.
- Allocate words across sections according to the requested paper
type and contribution shape. A method-heavy paper should give
more budget to Method; an empirical paper should give more to
Experiments/Results; a survey should give more to Related Work.
- The sum of PER_SECTION_BLUEPRINT.*.target_words must meet or
exceed the minimum total target_words implied by TARGET_PAGES. If
the target is 12 pages, the blueprint should normally allocate at
least 9,840 total words across abstract/introduction/related_work/
method/experiments/discussion/conclusion.
- In every PER_SECTION_BLUEPRINT entry, target_words is a
lower-bound writing budget. It is not a ceiling. Give each
section enough planned subclaims, paragraphs, evidence, analysis,
and transitions that a section author can satisfy at least 90% of
target_words without padding.
- Do not return an undersized section from any non-abstract section author.
- Treat paper_preferences.CITATION_TARGET and CITATION_STRATEGY as
authoritative. If they are AUTO, derive a citation budget
proportional to target length and available verified references;
never invent citations to hit a count.
- Return explicit per-section target_words and cite_keys budgets
that downstream section authors must obey.
Return EXACTLY this structure (no preamble, no markdown headings):
TITLE:
<final paper title, ≤16 words>
EVIDENCE_STATUS:
<copy EVIDENCE_STATUS from paper_preferences verbatim>
ABSTRACT_DRAFT:
<120-220 word draft abstract — section authors may polish but
may not change the thesis, scope, terminology, or
PLACEHOLDER_RESULT_TOKEN. Do not invent empirical numbers.>
NARRATIVE_ARC:
- thesis: <one sentence>
- story_beats:
1. <intro beat>
2. <related-work positioning>
3. <method core idea>
4. <experimental verification>
5. <discussion+conclusion takeaway>
KEY_CLAIMS:
- C1: <one sentence, must be defensible by an experiment>
- C2: ...
- ...
- Cn: ... (5-8 total)
NOTATION_LOCK:
- symbol: $\theta$ meaning: model parameters
- symbol: $\mathcal{D}$ meaning: dataset
- (list every symbol that will appear in math)
TERMINOLOGY_LOCK:
- "ours" (proposed method) forbidden_aliases: ["our method", "the proposed", "本文方法", "the method"]
- "DPR" (baseline) forbidden_aliases: ["dpr", "Dpr"]
- ... (every named entity that appears more than once)
PER_SECTION_BLUEPRINT:
abstract:
target_words: <int>
key_claims: [C1, C2, ...]
cite_keys: [] # abstract never cites
figures: []
must_mention: [TITLE, PLACEHOLDER_RESULT_TOKEN, EVIDENCE_STATUS]
introduction:
target_words: <int>
key_claims: [C1, C2]
cite_keys: [ref_x, ref_y, ...] # from citation_plan
figures: []
structure: [motivation, problem, contributions]
contributions_count: <int>
related_work:
target_words: <int>
key_claims: []
cite_keys: [ref_x, ...]
figures: []
structure: [survey by axis]
method:
target_words: <int>
key_claims: [C3, C4]
cite_keys: [...]
figures: [fig1, ...]
tables: []
structure: [overview → component A → component B → algorithm box]
notation_introduced: [θ, f_φ, ...]
experiments:
target_words: <int>
key_claims: [C5, C6]
cite_keys: [...]
figures: [fig2, ...]
tables: [tab1, ...]
structure: [setup → main results → ablations]
must_include_baselines: [...]
discussion:
target_words: <int>
key_claims: [C7]
cite_keys: [...]
figures: []
structure: [insights → limitations → threats_to_validity]
conclusion:
target_words: <int>
key_claims: [C1-Cn 重申]
cite_keys: []
figures: []
must_call_back_to_abstract: yes
CROSS_SECTION_DEPENDENCIES:
- method.NOTATION_LOCK symbols MUST be reused verbatim in experiments + discussion
- intro.contributions_count MUST equal method.structure step count
- abstract.PLACEHOLDER_RESULT_TOKEN == experiments.PLACEHOLDER_RESULT_TOKEN
- experiments, discussion, and conclusion MUST use the same
qualitative result placeholder until real experiment outputs
are supplied; do not state exact numeric improvements.
- when EVIDENCE_STATUS is not_supplied, every results-facing section
MUST explicitly say that no empirical results were supplied and
describe evaluation in planned/future tense only.
- In that mode, every unknown outcome value must be written as TBD
or 待实验确定. Never replace it with a guessed percentage, score,
latency, effect size, or other concrete forecast.
- In that mode, every figure/table caption must be explicitly
labeled as a planned evaluation placeholder or hypothesis. A
caption may name concrete setup values or a predefined metric
threshold, but must not state a categorical observed finding.
- All section authors must avoid Unicode U+2011, U+2013, and U+2014
punctuation. Use an ASCII hyphen, LaTeX ``--`` / ``---``, or
native full-width sentence punctuation instead.
WRITING_VOICE:
- tense: <e.g. "we present / we observe", active>
- perspective: <e.g. third-person except contributions list>
- formality: academic; no contractions, no marketing language
- language: {{ outputs.paper_contract | truncate(400) }}
PLACEHOLDER_RESULT_TOKEN:
<one stable phrase such as "the planned evaluation will test
the thesis across performance, robustness, and efficiency axes";
use this same phrase in abstract, experiments, discussion, and
conclusion. Do not invent empirical numbers.>
-
id: section_abstract
label: "摘要段"
label_en: "Abstract section"
kind: agent
skill: paper-section-author
depends_on: [writing_plan]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
task: |
You are writing the ABSTRACT section. Follow the writing plan
and produce a single dense paragraph 4-6 sentences covering
problem → approach → key result → significance.
section: abstract
writing_plan:
{{ outputs.writing_plan | truncate(8000) }}
evidence_contract (authoritative even if writing_plan is truncated):
{{ outputs.paper_contract | truncate(1200) }}
outline:
{{ outputs.outline | truncate(3000) }}
citation_plan:
{{ outputs.citation_plan | truncate(3000) }}
cite_keys_hint:
{{ outputs.refbib | truncate(2000) }}
Output rules:
- Use \begin{abstract} ... \end{abstract}.
- Do not include \cite{...}.
- Match TERMINOLOGY_LOCK and NOTATION_LOCK exactly.
- target_words from writing_plan.PER_SECTION_BLUEPRINT.abstract.target_words
- For the abstract, follow the 4-6 sentence contract first; do not
expand it just to satisfy the long-form page target.
- If EVIDENCE_STATUS is not_supplied, state explicitly that empirical
results are not yet available; describe only the planned evaluation
and never claim observed findings.
- Only output the LaTeX fragment. No commentary, no fences.
-
id: section_introduction
label: "引言段"
label_en: "Introduction section"
kind: agent
skill: paper-section-author
depends_on: [writing_plan, section_abstract]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
task: |
You are writing the INTRODUCTION section.
section: introduction
writing_plan:
{{ outputs.writing_plan | truncate(8000) }}
evidence_contract (authoritative even if writing_plan is truncated):
{{ outputs.paper_contract | truncate(1200) }}
previous_section_tail (last paragraphs of the abstract):
{{ outputs.section_abstract | truncate(2000) }}
outline:
{{ outputs.outline | truncate(3000) }}
citation_plan (your assigned cite keys are listed under introduction:):
{{ outputs.citation_plan | truncate(3000) }}
cite_keys_hint (only these keys exist in the bibliography):
{{ outputs.refbib | truncate(2000) }}
Output rules:
- Start with \section{Introduction}.
- Structure: motivation → problem → prior-work clusters → gap →
our contributions (numbered \begin{enumerate}) → paper roadmap.
- Use only cite keys assigned to introduction in citation_plan,
and only keys present in cite_keys_hint.
- Match TERMINOLOGY_LOCK and NOTATION_LOCK exactly.
- target_words from writing_plan.PER_SECTION_BLUEPRINT.introduction.target_words.
- Length floor: target_words is a lower-bound writing budget. Do
not return until the section reaches at least 90% of target_words;
expand with plan-aligned motivation, prior-work contrast,
contribution detail, and roadmap prose if short. Do not return an
undersized section.
- Output ONLY the LaTeX fragment for this section. No fences.
-
id: section_related_work
label: "相关工作"
label_en: "Related work"
kind: agent
skill: paper-section-author
depends_on: [writing_plan, section_introduction]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
task: |
You are writing the RELATED WORK section.
section: related_work
writing_plan:
{{ outputs.writing_plan | truncate(8000) }}
evidence_contract (authoritative even if writing_plan is truncated):
{{ outputs.paper_contract | truncate(1200) }}
previous_section_tail (last paragraphs of the introduction):
{{ outputs.section_introduction | truncate(2000) }}
outline:
{{ outputs.outline | truncate(3000) }}
citation_plan (your assigned cite keys are listed under related_work:):
{{ outputs.citation_plan | truncate(3000) }}
cite_keys_hint (only these keys exist in the bibliography):
{{ outputs.refbib | truncate(2500) }}
Output rules:
- Start with \section{Related Work}.
- Survey by 2-4 thematic axes (e.g. efficiency / fidelity /
agentic / dataset construction). Use \subsection for each.
- Cite from your assigned keys; do not introduce new claims.
- Do NOT include figures/tables here.
- Match TERMINOLOGY_LOCK exactly.
- target_words from writing_plan.PER_SECTION_BLUEPRINT.related_work.target_words.
- Length floor: target_words is a lower-bound writing budget. Do
not return until the section reaches at least 90% of target_words;
expand with plan-aligned thematic comparisons, citation synthesis,
and explicit gap analysis if short. Do not return an undersized
section.
- Output ONLY the LaTeX fragment. No fences, no preamble.
-
id: section_method
label: "方法段"
label_en: "Methods section"
kind: agent
skill: paper-section-author
depends_on: [writing_plan, section_related_work, figure_placeholders]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
task: |
You are writing the METHOD section.
section: method
writing_plan:
{{ outputs.writing_plan | truncate(8000) }}
evidence_contract (authoritative even if writing_plan is truncated):
{{ outputs.paper_contract | truncate(1200) }}
previous_section_tail (last paragraphs of related work):
{{ outputs.section_related_work | truncate(2000) }}
outline:
{{ outputs.outline | truncate(3000) }}
citation_plan:
{{ outputs.citation_plan | truncate(3000) }}
cite_keys_hint:
{{ outputs.refbib | truncate(2500) }}
figure_placeholders (you may reference these via \ref{fig:<id>} when relevant):
{{ outputs.figure_placeholders | truncate(2000) }}
Output rules:
- Start with \section{Method}.
- Use \subsection{Setup}, \subsection{Algorithm} (or {Approach}),
\subsection{Instrumentation}, and \subsection{Baselines}.
- Introduce notation per writing_plan.NOTATION_LOCK
(every symbol used later in experiments/discussion MUST
be defined here).
- You may inline ONE figure environment from figure_placeholders
that supports method exposition; reference it via \ref{fig:<id>}.
- If pseudocode is useful, use only the `algorithm` float with the
`algorithmic` environment and uppercase commands such as
`\STATE`, `\FOR`, `\ENDFOR`, `\IF`, and `\ENDIF`. The manuscript
template loads `algorithm` + `algorithmic`. Do not use
`algorithm2e`, `algpseudocode`, or commands from another dialect.
- Match TERMINOLOGY_LOCK / NOTATION_LOCK exactly.
- target_words from writing_plan.PER_SECTION_BLUEPRINT.method.target_words.
- Length floor: target_words is a lower-bound writing budget. Do
not return until the section reaches at least 90% of target_words;
expand with plan-aligned assumptions, definitions, algorithmic
detail, instrumentation, and reproducibility notes if short. Do
not return an undersized section.
- Output ONLY the LaTeX fragment. No fences.
-
id: section_experiments
label: "实验段"
label_en: "Experiments section"
kind: agent
skill: paper-section-author
depends_on: [writing_plan, section_method, figure_placeholders, table_placeholders]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
task: |
You are writing the EXPERIMENTS / RESULTS section. Use the
paper-section-author "results" contract.
section: results
writing_plan:
{{ outputs.writing_plan | truncate(8000) }}
evidence_contract (authoritative even if writing_plan is truncated):
{{ outputs.paper_contract | truncate(1200) }}
previous_section_tail (last paragraphs of method):
{{ outputs.section_method | truncate(2500) }}
outline:
{{ outputs.outline | truncate(3000) }}
citation_plan:
{{ outputs.citation_plan | truncate(3000) }}
cite_keys_hint:
{{ outputs.refbib | truncate(2500) }}
figure_placeholders (inline ALL remaining figures here):
{{ outputs.figure_placeholders | truncate(4000) }}
table_placeholders (inline ALL tables here):
{{ outputs.table_placeholders | truncate(4000) }}
Output rules:
- Start with \section{Experiments}.
- Inline EVERY figure and table from figure_placeholders /
table_placeholders that has not already been inlined in method.
- Reference via \ref{fig:<id>} and \ref{tab:<id>}.
- Structure: \subsection{Setup} → \subsection{Main Results} →
\subsection{Ablations} → \subsection{Sensitivity}.
- Use writing_plan.PLACEHOLDER_RESULT_TOKEN for the headline
evidence claim. Do not state exact numeric improvements,
percentages, scores, latency reductions, or win rates unless
they are explicitly present in user-provided experiment data.
- If EVIDENCE_STATUS is not_supplied, include the literal sentence
"No empirical results were supplied; this section specifies the
planned evaluation." and keep ALL setup, results, ablation, and
sensitivity prose in proposed/planned/future tense. Do not claim
that a dataset was collected, participants were recruited, or a
hypothesis was confirmed.
- Use ONLY notation/terminology locked in writing_plan.
- target_words from writing_plan.PER_SECTION_BLUEPRINT.experiments.target_words.
- Length floor: target_words is a lower-bound writing budget. Do
not return until the section reaches at least 90% of target_words;
expand with plan-aligned setup, metric rationale, baseline
comparison, ablation interpretation, sensitivity analysis, and
failure-case discussion if short. Do not return an undersized
section.
- Output ONLY the LaTeX fragment. No fences.
-
id: section_discussion
label: "讨论段"
label_en: "Discussion section"
kind: agent
skill: paper-section-author
depends_on: [writing_plan, section_experiments, analysis_outline]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
task: |
You are writing the DISCUSSION section.
section: discussion
writing_plan:
{{ outputs.writing_plan | truncate(8000) }}
evidence_contract (authoritative even if writing_plan is truncated):
{{ outputs.paper_contract | truncate(1200) }}
previous_section_tail (last paragraphs of experiments):
{{ outputs.section_experiments | truncate(2500) }}
outline:
{{ outputs.outline | truncate(3000) }}
citation_plan:
{{ outputs.citation_plan | truncate(3000) }}
cite_keys_hint:
{{ outputs.refbib | truncate(2500) }}
analysis_outline (use this as the structural blueprint):
{{ outputs.analysis_outline | truncate(4000) }}
Output rules:
- Start with \section{Discussion}.
- Inline the analysis_outline subsections verbatim where they fit,
but expand each with 1-2 paragraphs of substantive commentary.
Reference concrete experiment results only when EVIDENCE_STATUS is
supplied; otherwise discuss planned interpretation criteria and
explicitly say that empirical results are not yet available.
Unknown outcomes must remain TBD / 待实验确定; do not predict exact
percentages, scores, latency reductions, or ablation effects.
- End the section with explicit \subsection{Limitations} and
\subsection{Threats to Validity}.
- Match TERMINOLOGY_LOCK / NOTATION_LOCK exactly.
- target_words from writing_plan.PER_SECTION_BLUEPRINT.discussion.target_words.
- Length floor: target_words is a lower-bound writing budget. Do
not return until the section reaches at least 90% of target_words;
expand with plan-aligned interpretation, boundary conditions,
limitations, threats to validity, and implications if short. Do
not return an undersized section.
- Output ONLY the LaTeX fragment.
-
id: section_conclusion
label: "结论段"
label_en: "Conclusion section"
kind: agent
skill: paper-section-author
depends_on: [writing_plan, section_discussion, section_abstract]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
task: |
You are writing the CONCLUSION section. Must close the loop on the abstract.
section: conclusion
writing_plan:
{{ outputs.writing_plan | truncate(8000) }}
evidence_contract (authoritative even if writing_plan is truncated):
{{ outputs.paper_contract | truncate(1200) }}
abstract (the conclusion must echo its claims):
{{ outputs.section_abstract | truncate(1500) }}
previous_section_tail (discussion ending):
{{ outputs.section_discussion | truncate(2000) }}
Output rules:
- Start with \section{Conclusion}.
- Cover: 1) restated thesis + headline result status, 2) key contributions
reiterated, 3) scope and limitations, 4) future-work pointer. Use
as many concise paragraphs as the writing_plan target_words
requires; do not cap the conclusion at 2-3 paragraphs when the
requested page target is long.
- No new claims, no new figures, no \cite{}.
- If EVIDENCE_STATUS is not_supplied, do not state that the method
worked, improved, outperformed, or was statistically significant.
Restate that evaluation is planned and results remain unavailable.
- Match TERMINOLOGY_LOCK exactly.
- target_words from writing_plan.PER_SECTION_BLUEPRINT.conclusion.target_words.
- Length floor: target_words is a lower-bound writing budget. Do
not return until the section reaches at least 90% of target_words;
expand with plan-aligned synthesis and implications if short. Do
not return an undersized section.
- Output ONLY the LaTeX fragment.
-
id: persist_sections
label: "保存章节"
label_en: "Save sections"
kind: skill_exec
skill: paper-artifact-runtime
depends_on: [section_abstract, section_introduction, section_related_work, section_method, section_experiments, section_discussion, section_conclusion]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
Persist large section bodies to disk and return only a compact
manifest. This keeps later LLM steps from repeatedly ingesting the
full manuscript and reduces repeated context-compaction pressure.
payload: |
{
"operation": "persist_sections",
"meta_run_id": {{ inputs.meta_run_id | tojson }},
"sections": {
"abstract": {{ outputs.section_abstract | tojson }},
"introduction": {{ outputs.section_introduction | tojson }},
"related_work": {{ outputs.section_related_work | tojson }},
"method": {{ outputs.section_method | tojson }},
"experiments": {{ outputs.section_experiments | tojson }},
"discussion": {{ outputs.section_discussion | tojson }},
"conclusion": {{ outputs.section_conclusion | tojson }}
}
}
-
id: assemble_manuscript_tex
label: "组装 TEX"
label_en: "Assemble TEX"
kind: skill_exec
skill: paper-artifact-runtime
depends_on: [writing_plan, persist_sections, refbib]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
Concatenate section artifact files into a full LaTeX document and
write it to paper/<meta_run_id>/paper.tex. Return a compact manifest instead of
echoing the full manuscript back into the meta context.
payload: |
{
"operation": "assemble_manuscript_tex",
"meta_run_id": {{ inputs.meta_run_id | tojson }},
"bib_text": {{ outputs.refbib | tojson }},
"writing_plan": {{ outputs.writing_plan | tojson }},
"topic": {{ (outputs.paper_contract | truncate(400)) | tojson }}
}
-
id: consistency_pass
label: "一致性检查"
label_en: "Consistency check"
kind: llm_chat
depends_on: [writing_plan, assemble_manuscript_tex]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract"
with:
system: "You are the consistency auditor for an academic manuscript. You inspect compact manifests and return actionable checks without rewriting the full manuscript."
task: |
Review the assembled manuscript manifest against the writing plan.
Do NOT request or reproduce the full manuscript text in this step.
The full manuscript is persisted on disk; keep this output compact
so long paper runs do not trigger repeated context compaction.
Drift to check:
1. Terminology: any synonym variant of a TERMINOLOGY_LOCK term
should be flagged for later repair.
2. Notation: any math symbol that disagrees with NOTATION_LOCK
should be flagged.
3. Numbers: if abstract / experiments / discussion mention the
same headline metric with different values, flag the drift.
4. Cite keys: ensure every \cite{...} key exists in the
REFERENCES_BIB block; citation_map performs the exact parse.
5. Section ordering: keep abstract → intro → related → method →
experiments → discussion → conclusion.
Writing plan (authoritative):
{{ outputs.writing_plan | truncate(8000) }}
Assembled manuscript manifest:
{{ outputs.assemble_manuscript_tex | truncate(2000) }}
Output EXACTLY:
MANUSCRIPT_PATH: <copy MANUSCRIPT_PATH from assembled manifest>
REFERENCES_PATH: <copy REFERENCES_PATH from assembled manifest>
COMPILE_NOTES:
- consistency_findings: <one line per possible drift, OR "none">
CONTEXT_POLICY: artifact-only; full manuscript omitted from prompt/output
-
id: final_manuscript_package
label: "终稿打包"
label_en: "Final package"
kind: llm_chat
depends_on: [paper_contract, outline, citation_plan, refbib, figure_placeholders, table_placeholders, analysis_outline]
when: "'PAPER_MODE: COMPACT_SKELETON' in outputs.paper_contract"
with:
system: "You write clean LaTeX manuscripts. Output only the requested manuscript package. NEVER invent cite keys — every \cite{...} you emit MUST exist verbatim in REFERENCES_BIB below."
task: |
Draft a compact manuscript package. The output must be clean
LaTeX-ready paper text, not planning notes. Do not include markdown
fences, chat commentary, progress notes, or tool logs.
Paper mode:
TOPIC: {{ outputs.paper_contract | truncate(1200) }}, MODE: {{ outputs.paper_contract | truncate(400) }}, PAGES: {{ outputs.paper_contract | truncate(400) }}
Mode behavior:
- COMPACT_SKELETON is the lower-latency authoring path, but its
compiled artifact MUST still meet TARGET_PAGES. Produce a coherent
compact manuscript, not a one-page outline followed by a promise
to expand later. Size substantive MANUSCRIPT_TEX prose to at least
TARGET_PAGES x 550 English words, or TARGET_PAGES x 950 CJK
characters, before returning. For the default four-page contract,
this normally means at least 2,200 English words (or about 3,800
CJK characters), distributed across every required section.
The final package MUST also include a concise manuscript plan,
target-length expansion plan, limitations/threats-to-validity,
and reference placeholders sized to the requested/derived citation
strategy when verified BibTeX entries are unavailable. Put the
complete MANUSCRIPT_TEX first so all required sections survive any
downstream truncation. Do not use blank pages, repeated paragraphs,
oversized headings, spacing tricks, or filler to reach the target.
CITATION CONTRACT (load-bearing):
- DO NOT invent cite keys. Use ONLY keys that appear verbatim in
REFERENCES_BIB below.
- DO NOT cite a key that REFERENCES_BIB does not contain.
- Every claim that needs evidence MUST cite at least one key from
REFERENCES_BIB.
- Distribute citations according to paper_preferences.CITATION_STRATEGY;
avoid repeatedly citing one key when enough verified sources exist.
- If REFERENCES_BIB is empty or lacks enough verified entries, do
not emit \cite{...}. Use visible placeholders such as
[REF-01 needed: agent benchmark survey] in the LaTeX text and
list them under REFERENCE_PLACEHOLDERS instead. Placeholder
references are safer than fabricated BibTeX.
EMPIRICAL EVIDENCE CONTRACT (load-bearing):
- Read EVIDENCE_STATUS from paper_contract; never upgrade it.
- When EVIDENCE_STATUS is not_supplied, include the exact disclosure
"No empirical results were supplied; the evaluation described here
is planned." in MANUSCRIPT_TEX.
- In that case, describe datasets, participants, experiments,
ablations, sensitivity analyses, results, discussion, abstract,
and conclusion in proposed/planned/future tense only.
- Do not invent completed sample counts, measurements, p-values,
effect sizes, confidence intervals, numeric improvements, observed
findings, or novelty claims such as "first experimental evidence".
- Keep every result table cell as <TBD> or --- and every finding as a
falsifiable hypothesis or planned analysis criterion.
- Every figure/table caption must explicitly identify itself as a
planned evaluation placeholder or hypothesis. It may state setup
values or a predefined target threshold, but may not present a
categorical observed result.
LATEX GLYPH CONTRACT (load-bearing):
- Never emit literal Unicode Greek letters in prose, captions, or
tables. Use named macros in math mode, e.g. ``\(\alpha\)``,
``\(\delta\)``, and ``\(\varepsilon\)``.
- Do not emit Unicode U+2011, U+2013, or U+2014 punctuation. Use an
ASCII hyphen, LaTeX ``--`` / ``---``, or native full-width
sentence punctuation instead.
- Wrap every ``tabular`` in ``\resizebox{\linewidth}{!}{...}``.
FIGURE/TABLE CONTRACT:
- Inline the figure_placeholders block verbatim into Results.
- Inline the table_placeholders block verbatim into Method or
Results (split by purpose).
- Inline the analysis_outline block verbatim into Discussion.
- Reference figures/tables via \\ref{fig:<id>} and \\ref{tab:<id>}
where they appear in the body; never reference an id not present
in the placeholders.
Paper preferences:
{{ outputs.paper_preferences | truncate(2000) }}
Outline:
{{ outputs.outline | truncate(8000) }}
Citation plan:
{{ outputs.citation_plan | truncate(8000) }}
Figure placeholders (inline this verbatim somewhere in Results):
{{ outputs.figure_placeholders | truncate(4000) }}
Table placeholders (inline this verbatim in Method/Results):
{{ outputs.table_placeholders | truncate(4000) }}
Analysis outline (inline this verbatim in Discussion):
{{ outputs.analysis_outline | truncate(4000) }}
Bibliography (cite keys MUST come from here):
{{ outputs.refbib | truncate(8000) }}
CRITICAL OUTPUT CONTRACT (load-bearing — the downstream
compile_pdf step parses these markers literally):
- The MANUSCRIPT_TEX section is MANDATORY and MUST come first.
It MUST start with the literal token `MANUSCRIPT_TEX:` on its
own line, immediately followed by `\documentclass{article}`
and end with `\end{document}`. Do NOT wrap in ```latex
fences. Do NOT prefix with markdown headings.
- If you find yourself running out of tokens, shorten section
bodies — DO NOT omit MANUSCRIPT_TEX. A short complete
\documentclass…\end{document} block is FAR more useful than
a long MANUSCRIPT_PLAN with no LaTeX.
- REFERENCES_BIB is the second mandatory section. Use
`REFERENCES_BIB:` on its own line followed by BibTeX entries.
If the bibliography is empty, output `REFERENCES_BIB:`
followed by a single line `% no verified references` (the
\cite{} keys in MANUSCRIPT_TEX should then be visible
placeholders, not BibTeX-keyed cites).
Return EXACTLY in this order (no preamble, no markdown headings):
MANUSCRIPT_TEX:
\documentclass{article}
\usepackage{fontspec}
\setmainfont[FontIndex=2]{NotoSansCJK-Regular.ttc}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage[hidelinks]{hyperref}
\title{...}
\author{...}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}...\end{abstract}
\section{Introduction}...
\section{Related Work}...
\section{Method}...
\section{Experiments}...
(inline the figure_placeholders, table_placeholders, and
analysis_outline blocks verbatim where appropriate)
\section{Discussion}...
\section{Limitations}...
\section{Threats to Validity}...
\section{Conclusion}...
\bibliographystyle{plain}
\bibliography{references}
\end{document}
REFERENCES_BIB:
<BibTeX entries copied verbatim from the provided bibliography —
only the entries actually cited in MANUSCRIPT_TEX. If empty,
output a single `% no verified references` line.>
MANUSCRIPT_PLAN:
- (optional) section-by-section plan with target pages and
contribution. Skip this section if MANUSCRIPT_TEX is already
tight on tokens.
TARGET_LENGTH_EXPANSION_PLAN:
- For COMPACT_SKELETON, list the concrete section expansions,
extra experiments, figures, tables, and citation work needed
to grow this package into the user-requested target length.
REFERENCE_PLACEHOLDERS:
- (optional) placeholder reference notes if REFERENCES_BIB is
empty or sparse.
COMPILE_NOTES:
- <short note about figure/reference assumptions>
-
id: latex_sanitizer
label: "LaTeX 清理"
label_en: "LaTeX cleanup"
kind: skill_exec
skill: paper-latex-sanitizer
depends_on: [paper_contract, final_manuscript_package, consistency_pass, assemble_manuscript_tex]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract or 'PAPER_MODE: COMPACT_SKELETON' in outputs.paper_contract"
with:
payload: |
{
"paper_contract": {{ outputs.paper_contract | tojson }},
"meta_run_id": {{ inputs.meta_run_id | tojson }},
"user_request": {{ (inputs.user_message | truncate(4000)) | tojson }},
"manuscript_package": {{ (outputs.get('consistency_pass') or outputs.get('assemble_manuscript_tex') or outputs.get('final_manuscript_package', '')) | tojson }}
}
-
id: materialize_manuscript
label: "固化稿件"
label_en: "Materialize manuscript"
kind: skill_exec
skill: paper-artifact-runtime
depends_on: [paper_contract, latex_sanitizer]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract or 'PAPER_MODE: COMPACT_SKELETON' in outputs.paper_contract"
with:
payload: |
{
"operation": "materialize_manuscript",
"meta_run_id": {{ inputs.meta_run_id | tojson }},
"paper_contract": {{ outputs.paper_contract | tojson }},
"manuscript_package": {{ outputs.latex_sanitizer | tojson }}
}
-
id: paper_length_preflight
label: "篇幅预检"
label_en: "Length preflight"
kind: skill_exec
skill: paper-length-gate
depends_on: [paper_contract, materialize_manuscript]
when: "'PAPER_MODE: FULL_MANUSCRIPT' in outputs.paper_contract or 'PAPER_MODE: COMPACT_SKELETON' in outputs.paper_contract"
with:
Report-only makes the target-correlated deficit available to the
bounded authoring repair below. The later paper_length_gate remains
fail-closed and must pass before any compiler is invoked.
payload: |
{
"paper_contract": {{ outputs.paper_contract | tojson }},
"manuscript_package": {{ outputs.materialize_manuscript | tojson }},
"report_only": true
}
-
id: precompile_length_expansion
label: "篇幅扩写"
label_en: "Pre-compile expansion"
kind: llm_chat
depends_on: [paper_contract, paper_preferences, outline, materialize_manuscript, paper_length_preflight]
when: "'below target-correlated readiness floor' in outputs.paper_length_preflight"
with:
system: "You author one substantive, evidence-safe LaTeX expansion fragment for an undersized academic manuscript."
task: |
The deterministic preflight found that this manuscript is too small
for its requested compiled-page contract. Produce one body-only
expansion that closes the reported content-unit deficit with a 15%
safety margin. This is the first of at most two bounded repair
attempts; make it substantive enough to pass now.
Paper contract:
{{ outputs.paper_contract | truncate(1200) }}
Preferences:
{{ outputs.paper_preferences | truncate(2000) }}
Outline:
{{ outputs.outline | truncate(3500) }}
Deterministic deficit report (authoritative):
{{ outputs.paper_length_preflight | truncate(2000) }}
Existing sanitized source excerpt (compact packages are inline;
full manuscripts may provide only an artifact manifest):
{{ outputs.latex_sanitizer | truncate(12000) }}
Run-owned artifact manifest:
{{ outputs.materialize_manuscript | truncate(2000) }}
Rules:
- Write only new subsection-level prose that deepens method
rationale, evaluation design, limitations, boundary conditions,
and reproducibility. Do not repeat paragraphs or pad formatting.
- Do not emit \documentclass, \begin{document}, \end{document},
\section, \bibliography, \input, \include, \includegraphics,
\usepackage, or any \cite command. Existing citations and document
boundaries are locked.
- Preserve EVIDENCE_STATUS. If evidence is not_supplied, use
planned/future tense, keep outcomes TBD, and invent no results,
measurements, sources, or citations.
- Match the manuscript language. Use ASCII/LaTeX-safe punctuation
and named math macros rather than literal Unicode Greek.