Skip to content

Commit 92cf443

Browse files
JihaoXinclaude
andcommitted
Clean page count: writer prompt constraint + single pre-delivery enforcement
Writer prompt (soft constraint): - Added 90% fill rule: last page must be ≥90% filled - Single-column: 10% whitespace at bottom of last page max - Double-column: right column on last body page ≥90% filled - Added expansion strategies (deepen analysis, more related work, etc.) Hard enforcement (single checkpoint): - Only at pre-delivery (before sending PDF to Telegram) - Removed dev-phase and post-validate enforce calls - _enforce_page_count now detects column layout from venue geometry: double-column → min = N - 0.05, single-column → min = N - 0.1 - Programmatic \clearpage injection before \bibliography Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fbed590 commit 92cf443

File tree

3 files changed

+37
-13
lines changed

3 files changed

+37
-13
lines changed

ark/execution.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,24 @@ def _enforce_page_count(self, context: str = "post-writing") -> bool:
628628
# First: ensure \clearpage before \bibliography (programmatic, no agent needed)
629629
self._ensure_clearpage_before_bibliography()
630630

631-
min_pages = venue_pages - 1 + 0.9 # e.g., 6 pages → 5.9 minimum
632-
max_pages = venue_pages + 0.1 # e.g., 6 pages → 6.1 maximum
631+
# 90% fill rule:
632+
# Single-column: last page 90% filled → min = N - 0.1 (e.g., 6 → 5.9)
633+
# Double-column: right column on last page 90% filled → min = N - 0.05 (stricter,
634+
# because half a page = one column, so 10% of a column ≈ 5% of a page)
635+
from ark.latex_geometry import get_geometry
636+
venue_format = self.config.get("venue_format", "")
637+
geo = get_geometry(venue_format) if venue_format else {}
638+
columns = geo.get("columns", 1)
639+
640+
if columns >= 2:
641+
min_pages = venue_pages - 0.05 # double-column: right column 90% filled
642+
else:
643+
min_pages = venue_pages - 0.1 # single-column: last page 90% filled
644+
max_pages = venue_pages + 0.1
633645
latex_dir = self.config.get("latex_dir", "paper")
634646

635-
self.log(f"[{context}] Page check: {page_count:.1f} body pages (target: {min_pages:.1f}{max_pages:.1f})", "INFO")
647+
self.log(f"[{context}] Page check: {page_count:.1f} body pages "
648+
f"(target: {min_pages:.2f}{max_pages:.1f}, {columns}-col)", "INFO")
636649

637650
# Case 1: Over limit → compress
638651
if page_count > max_pages:

ark/pipeline.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,6 @@ def run_paper_iteration(self) -> bool:
406406
self.log_step_header(step_num, total_steps, "Validate", "end")
407407
self.save_step_checkpoint(step_num, "Validate")
408408

409-
# Final page count check after figure phase (figures may change layout)
410-
self._enforce_page_count(context="post-validate-final")
411-
412409
self.save_paper_state(paper_state)
413410
self._last_score = score
414411

@@ -432,6 +429,9 @@ def run_paper_iteration(self) -> bool:
432429
self.log_step("Recompiling after improvements...", "progress")
433430
self.compile_latex()
434431

432+
# Hard page count enforcement — the ONLY place we enforce before delivery
433+
self._enforce_page_count(context="pre-delivery")
434+
435435
# Send iteration summary + PDF to Telegram
436436
self.send_iteration_summary(score, current_score, review_output)
437437

@@ -1186,8 +1186,6 @@ def _run_dev_phase(self):
11861186
self.log_step("Compiling initial draft...", "progress")
11871187
if self.compile_latex():
11881188
self.log_step("Initial draft compiled successfully", "success")
1189-
# Page count check after initial writing
1190-
self._enforce_page_count(context="dev-phase-initial-draft")
11911189
# Send initial draft PDF via Telegram
11921190
if self.telegram.is_configured:
11931191
pdf_path = self.latex_dir / "main.pdf"

ark/templates/agents/writer.prompt

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,30 @@ When handling figure-related tasks, **you must first read** `{FIGURES_DIR}/figur
4848

4949
## Hard Page Limit — {VENUE_PAGES} pages (MANDATORY)
5050

51-
The paper body (excluding references and appendix) **must not exceed {VENUE_PAGES} pages**. Exceeding this limit means automatic desk rejection.
51+
The paper body (excluding references and appendix) has a strict page target:
52+
- **Maximum**: {VENUE_PAGES} pages. Exceeding this means automatic desk rejection.
53+
- **Minimum**: The last page of body text must be at least 90% filled. A paper that is too short looks incomplete and will be scored lower by reviewers.
54+
- For single-column templates: the last page should have no more than 10% whitespace at the bottom.
55+
- For double-column templates: the right column on the last body page should be at least 90% filled.
5256

53-
**Before making ANY change**, count the current page usage. Then follow these rules strictly:
57+
**Before making ANY change**, check current page count. Then:
5458

55-
- **If already over {VENUE_PAGES} pages**: Your primary job is COMPRESSION. Do NOT add any new content until the paper is under the limit. Move non-essential sections to `\appendix`. Merge overlapping sections. Cut redundant prose.
56-
- **If at or near the limit**: For every paragraph you add, you MUST remove an equal or larger amount of text. Net content must NOT increase.
57-
- **If well under the limit**: You may add content, but always check page count after changes.
59+
- **Over {VENUE_PAGES} pages**: COMPRESS first. Do NOT add content until under the limit.
60+
- **At or near the limit**: For every paragraph added, remove equal or more text.
61+
- **Well under the limit (last page < 90% filled)**: ADD substantive content — deeper analysis, more related work comparisons, expanded methodology details. Do NOT pad with filler.
62+
63+
**Always ensure `\clearpage` appears before `\bibliography`** so references start on a new page.
5864

5965
**Compression strategies** (in order of priority):
6066
1. Move detailed ablations, sensitivity analyses, and per-category breakdowns to `\appendix`
6167
2. Merge Discussion and Conclusion into one section
6268
3. Replace verbose multi-paragraph explanations with concise text
6369
4. Compress tables — remove redundant rows/columns, use `\small` or `\footnotesize`
6470
5. Remove any content that repeats information from another section
71+
72+
**Expansion strategies** (when too short):
73+
1. Deepen analysis/discussion — explain WHY, not just WHAT
74+
2. Add more related work with specific comparisons to your approach
75+
3. Expand experimental setup (hyperparameters, hardware, dataset splits)
76+
4. Add a Limitations paragraph
77+
5. Expand figure captions with interpretive context

0 commit comments

Comments
 (0)