Subsection Writer (compatibility router)
Purpose: write or refine per-section survey prose under sections/ while keeping the current pipeline contract unchanged.
Compatibility mode:
- output paths stay the same
scripts/run.pystill handles approval checks, missing-file bootstrap, andsections/sections_manifest.jsonl- writing guidance now lives in
references/instead of being encoded primarily in the script
Load Order
Always read:
references/overview.mdreferences/paragraph_jobs.mdreferences/paragraph_job_archetypes.mdwhen adjusting paragraph-role behavior or refactoring writer policy out of Pythonreferences/bootstrap_assembly.mdwhen reasoning about compatibility-mode bootstrap behavior
Read as needed:
references/opener_catalog.mdwhen paragraph 1 sounds generic or narratedreferences/contrast_moves.mdwhen building A-vs-B comparison paragraphsreferences/eval_anchor_patterns.mdwhen making performance / robustness / benchmark claimsreferences/limitation_moves.mdwhen adding caveats or local conclusionsreferences/examples_good.mdandreferences/examples_bad.mdfor calibration only
Machine-readable contract:
assets/subsection_writer_context.schema.jsonassets/bootstrap_paragraph_templates.jsonassets/paragraph_job_templates.json
Inputs
Required:
DECISIONS.md(must includeApprove C2)outline/outline.ymloutline/writer_context_packs.jsonl(preferred)citations/ref.bib
Optional but useful:
outline/subsection_briefs.jsonloutline/evidence_drafts.jsonloutline/evidence_bindings.jsonloutline/anchor_sheet.jsonloutline/chapter_briefs.jsonl
Outputs
Keep the current contract:
sections/abstract.mdsections/discussion.mdsections/conclusion.mdsections/S<sec_id>.mdfor H2-without-H3 bodiessections/S<sec_id>_lead.mdfor H2 lead blockssections/S<sub_id>.mdfor H3 bodiessections/sections_manifest.jsonl
Writer policy
The active rule is move coverage, not paragraph quota. A subsection should cover the necessary argument moves the pack supports; do not pad to a fixed count when the evidence does not justify it.
Opener / ending policy:
- generate 2-4 opener candidates from the pack's actual tension, contrast, protocol, or limitation signals; keep the most content-bearing option instead of reusing one stock stem everywhere
- let subsection endings emerge from evidence-bearing comparison / limitation material; do not append a fixed “safest synthesis / decision rule” closer just to make the paragraph feel finished
- normalize internal axis labels into natural reader prose; slash-style brief handles should remain planning metadata, not leak unchanged into the paper
Script boundary
Use scripts/run.py as a helper only:
- it may bootstrap missing H3 files and refresh the manifest
- it must not be treated as the canonical source of prose shape or voice policy
Quick Start
python .codex/skills/subsection-writer/scripts/run.py --workspace workspaces/<ws>
Troubleshooting
- If the pack is thin, stop and route upstream instead of padding prose.
- If the subsection sounds narrated, reload
references/opener_catalog.mdandreferences/examples_bad.md. - If a claim lacks protocol context, reload
references/eval_anchor_patterns.mdbefore rewriting.
Execution notes
When running in compatibility mode, scripts/run.py currently consumes:
DECISIONS.mdforApprove C2outline/outline.ymlto enumerate chapter / subsection filesoutline/writer_context_packs.jsonlas the primary drafting inputcitations/ref.bibfor in-scope citationsoutline/subsection_briefs.jsonl,outline/evidence_drafts.jsonl,outline/evidence_bindings.jsonl,outline/anchor_sheet.jsonl, andoutline/chapter_briefs.jsonlas optional enrichment sources
Script
Quick Start
python .codex/skills/subsection-writer/scripts/run.py --workspace <workspace_dir>
All Options
--workspace <dir>--unit-id <id>--inputs <a;b;...>--outputs <a;b;...>--checkpoint <C*>
Examples
python .codex/skills/subsection-writer/scripts/run.py --workspace workspaces/<ws>
Troubleshooting
- If
DECISIONS.mdlacksApprove C2, stop and fix approval first. - If
outline/writer_context_packs.jsonlis thin, reroute upstream instead of padding prose. - If citation scope looks wrong, re-check
citations/ref.biband the writer packs before editing output text.