feat(review): P3b+P4 论文重排版支持编译 PDF(含 zip 项目) #4

Merged
admin merged 6 commits from wjq/PlantAI-rag-new:feature/p3b-compile-ui into main 2026-10-15 18:30:14 +08:00
Contributor

概要

论文重排版面板启用"编译 PDF"Tab,支持:

  1. 单 .tex 文件编译
  2. 项目 zip 编译(含 .cls / 图片 / .bib)
  3. EPS 图片自动转换(gs -dSAFER)
  4. 换期刊不再需重传文件
  5. 目标期刊规则摘要

详细报告

docs/pr-reports/2026-10-13-p3b-compile-ui.md

测试

  • 后端 pytest:175 passed
  • 前端 vitest:410 passed / 5 failed(5F = 既有 labels.js 基线)
  • npm run build:✓

手工冒烟

  • 真实 MDPI 官方 zip → 7 页 PDF(70688 bytes)
  • EPS 转换:2 个成功(0.27s × 2)
  • 编译总耗时:2.99s(HTTP 链路)

部署验证

bash review_service/restart.sh
# 浏览器 → 教育科研 → 论文自动重排版 → 项目 zip 模式
# 上传 MDPI 官方 zip → 编译 → 期望 7 页 PDF
## 概要 论文重排版面板启用"编译 PDF"Tab,支持: 1. 单 .tex 文件编译 2. 项目 zip 编译(含 .cls / 图片 / .bib) 3. EPS 图片自动转换(gs -dSAFER) 4. 换期刊不再需重传文件 5. 目标期刊规则摘要 ## 详细报告 docs/pr-reports/2026-10-13-p3b-compile-ui.md ## 测试 - 后端 pytest:175 passed - 前端 vitest:410 passed / 5 failed(5F = 既有 labels.js 基线) - npm run build:✓ ## 手工冒烟 - 真实 MDPI 官方 zip → 7 页 PDF(70688 bytes) - EPS 转换:2 个成功(0.27s × 2) - 编译总耗时:2.99s(HTTP 链路) ## 部署验证 ```bash bash review_service/restart.sh # 浏览器 → 教育科研 → 论文自动重排版 → 项目 zip 模式 # 上传 MDPI 官方 zip → 编译 → 期望 7 页 PDF
wjq added 6 commits 2026-10-14 09:54:32 +08:00
- ReformatPanel: compile tab state machine (idle/loading/success/error)
- Blob URL for PDF preview; backend path hidden
- First-compile 1-3min hint banner (dismissible)
- QUEUE_FULL 429 with fixed message
- Store: compileStatus/compileResult/compileError + actions
- prewarm_tectonic.sh: minimal .tex compilation to pre-cache TeX bundles
- Vitest: 6 new cases (guide / button / loading / success / error / queue-full)
- File now stored in edu.js store (reformatFile)
- Switching target journal no longer requires re-upload
- Explicit reset button clears file
- Vitest: 4 cases
- New summary row: shows the journal's rules (even if no diff applies)
- Fixes user confusion when switching journals yields same diff
- When all rules are null: 'no explicit format requirements'
- Vitest: add case for summary rendering
- inspect/upload zip then compile project (main-file detection, zip safety,
  single-slot queue, failed-envelope carries compile_id + log_url)
- keep failed project/ scene 24h (failed_project_ttl_s; KEEP_FAILED_PROJECTS=1
  forever), success deletes immediately; two-tier compile_jobs sweep
- add tectonic --print and persist full engine chatter to output.log so
  XDV→PDF (xdvipdfmx) errors are visible (MDPI: logo EPS inclusion failure)
- EPS fallback: swap X.eps refs for *-eps-converted-to.pdf when present and
  materialize X.pdf for extension-less graphicx lookup; friendly error when
  no converted PDF exists
- frontend: ReformatPanel zip upload/inspect/run flow; one-off
  scripts/debug_compile.py (gitignored)
- tests: backend 169 passed (22 zip_safety + 34 compile_zip + P3a regression),
  frontend edu vitest 43 passed
- v1 fell through because it required pre-converted PDF in zip
- v2: convert all .eps files post-extract via gs -dSAFER
- 15s timeout per file; fail per-file, not blocking
- Size guards: 20MB per file warning, 100MB total abort
- Conversion log written to output.log
- Verified on real MDPI official zip → 7-page PDF

v1 lesson: test sample had pre-converted PDF but real zip does not
admin merged commit 69e3f35a43 into main 2026-10-15 18:30:14 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/PlantAI-rag-new#4