.cursorrules ยท diff
git:20260915.1667a72 to git:20261023.053c18a
8 added, 7 removed. Audit A to A.
# Cursor Rules for PDF-Translate Skill
# High-fidelity vector PDF translation, layout preservation, and automated audit.
- # Rule 1: Layout & Height Preservation
- - Always enforce CSS @page size (e.g. A4 portrait, margin 12mm 15mm).
- - Always wrap each page in a container with class `.page` and strict `max-height: 270mm` with `overflow: hidden`.
- - Never allow unconstrained flex or table heights that expand across pages.
+ # Rule 1: Layout & Height Preservation (unified convention, same as SKILL.md)
+ - Probe the source first (PyMuPDF `page.rect`, `get_image_rects`, `get_drawings`); never guess sizes.
+ - Use `@page { size: <source width> <source height>; margin: 0; }`.
+ - Wrap each page in a `.page` container with exactly the source width/height, page margins in `padding`, and `overflow: hidden`.
+ - Never combine `@page` margins with a fixed `.page` height; never let flex/table heights expand across pages.
# Rule 2: Zero Hallucination Pipeline
- Always extract clause hierarchy trees and numerical metrics into a structured schema before filling templates.
- Never summarize, merge, or omit statutory sub-clauses (e.g. 2.1.1~2.1.8).
- Never fabricate non-existent numbers, dates, or workflow steps.
# Rule 3: Automated Verification
- - After generating HTML, run `python scripts/render_pdf.py input.html output.pdf --strict-overflow`.
- - Always audit using `python scripts/audit_pdf.py --src original.pdf --tgt output.pdf`.
- - Any Critical Error from `audit_pdf.py` must trigger self-repair before user delivery.
+ - After generating HTML, run `python scripts/render_pdf.py input.html output.pdf --strict-overflow` (exit 2 = overflow).
+ - Always audit using `python scripts/audit_pdf.py --src original.pdf --tgt output.pdf --compare-png compare_png/`.
+ - Any Critical Error from `audit_pdf.py` must trigger self-repair before user delivery; review warnings (missing clauses / numbers / refs).