Skip to content

Commit f5a6395

Browse files
JihaoXinclaude
andcommitted
Re-enforce page count after citation verification
[NEEDS-CHECK] markers added during citation verification can push the paper over the venue page limit. Previously the page enforcement ran before citation verification, so the final PDF could exceed the limit (e.g., 8.9 → 9.13 pages). Now we re-run _enforce_page_count after _run_citation_verification in both review-phase delivery and dev-phase delivery paths. Also adds aiofiles, json_repair, huggingface_hub to environment.yml so PaperBanana (advanced figure generation pipeline) works without falling back to Nano Banana. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 061afc7 commit f5a6395

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

ark/pipeline.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,13 @@ def run_paper_iteration(self) -> bool:
572572
return True # continue to retry
573573
self._run_citation_verification()
574574

575+
# Re-enforce page count after citation verification:
576+
# [NEEDS-CHECK] markers can push the paper over the limit.
577+
try:
578+
self._enforce_page_count(context="post-citation")
579+
except QuotaExhaustedError:
580+
self.log("Post-citation page enforcement hit quota; delivering as-is", "WARN")
581+
575582
# Send iteration summary + PDF to Telegram
576583
self.send_iteration_summary(score, current_score, review_output)
577584

@@ -2023,6 +2030,11 @@ def _deliver_dev_phase(self, dev_state: dict, max_dev_iters: int):
20232030
self._quota_exhausted = False # Reset for retry
20242031
self._enforce_page_count(context="dev-phase-delivery-retry")
20252032
self._run_citation_verification()
2033+
# Re-enforce page count: citation [NEEDS-CHECK] markers can push over limit
2034+
try:
2035+
self._enforce_page_count(context="dev-phase-post-citation")
2036+
except QuotaExhaustedError:
2037+
self.log("Dev-phase post-citation page enforcement hit quota; delivering as-is", "WARN")
20262038

20272039
if draft_compiled and self.telegram.is_configured:
20282040
pdf_path = self.latex_dir / "main.pdf"

environment.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dependencies:
3131
- wheel=0.46.3=pyhd8ed1ab_0
3232
- zstd=1.5.7=hb78ec9c_6
3333
- pip:
34+
- aiofiles==25.1.0
3435
- annotated-doc==0.0.4
3536
- annotated-types==0.7.0
3637
- anthropic==0.94.1
@@ -49,22 +50,29 @@ dependencies:
4950
- distro==1.9.0
5051
- docstring-parser==0.17.0
5152
- fastapi==0.135.3
53+
- filelock==3.28.0
5254
- fonttools==4.62.1
55+
- fsspec==2026.3.0
5356
- google-auth==2.49.2
5457
- google-genai==1.72.0
5558
- greenlet==3.4.0
5659
- h11==0.16.0
60+
- hf-xet==1.4.3
5761
- httpcore==1.0.9
5862
- httptools==0.7.1
5963
- httpx==0.28.1
64+
- huggingface-hub==1.10.2
6065
- idna==3.11
6166
- itsdangerous==2.2.0
6267
- jinja2==3.1.6
6368
- jiter==0.14.0
69+
- json-repair==0.59.4
6470
- kiwisolver==1.5.0
6571
- markdown==3.10.2
72+
- markdown-it-py==4.0.0
6673
- markupsafe==3.0.3
6774
- matplotlib==3.10.8
75+
- mdurl==0.1.2
6876
- numpy==2.4.4
6977
- openai==2.31.0
7078
- pandas==3.0.2
@@ -75,6 +83,7 @@ dependencies:
7583
- pydantic==2.13.0
7684
- pydantic-core==2.46.0
7785
- pydyf==0.12.1
86+
- pygments==2.20.0
7887
- pymupdf==1.27.2.2
7988
- pyparsing==3.3.2
8089
- pypdf==6.10.0
@@ -84,7 +93,9 @@ dependencies:
8493
- python-multipart==0.0.26
8594
- pyyaml==6.0.3
8695
- requests==2.33.1
96+
- rich==15.0.0
8797
- seaborn==0.13.2
98+
- shellingham==1.5.4
8899
- six==1.17.0
89100
- sniffio==1.3.1
90101
- sqlalchemy==2.0.49
@@ -94,6 +105,7 @@ dependencies:
94105
- tinycss2==1.5.1
95106
- tinyhtml5==2.1.0
96107
- tqdm==4.67.3
108+
- typer==0.24.1
97109
- typing-extensions==4.15.0
98110
- typing-inspection==0.4.2
99111
- urllib3==2.6.3

0 commit comments

Comments
 (0)