feat(pdf): report the page count from size #9

Merged
gravityfargo merged 8 commits from pdf-size-page-count into main 2026-08-14 01:37:09 +00:00
Owner

pdf size now opens the file with the shared open_reader guard and reports the page count alongside the size verdict, e.g. sample.pdf is 545.0kB, 12 pages, under the 5.0MB limit. A file that does not parse as a PDF now exits 1 like the other verbs.

Tests move the size cases onto a new sized_pdf fixture (a real one-page PDF padded to an exact byte size), keeping the blob-based pdf_file fixture for the not-a-PDF cases, and add page-count, singular, and corrupt-file cases.

Resolves the tool half of gravityfargo/claude-sync#53 — the vault CLAUDE.md advice to get the page count from pdf size before Read now works as written.

`pdf size` now opens the file with the shared `open_reader` guard and reports the page count alongside the size verdict, e.g. `sample.pdf is 545.0kB, 12 pages, under the 5.0MB limit`. A file that does not parse as a PDF now exits 1 like the other verbs. Tests move the size cases onto a new `sized_pdf` fixture (a real one-page PDF padded to an exact byte size), keeping the blob-based `pdf_file` fixture for the not-a-PDF cases, and add page-count, singular, and corrupt-file cases. Resolves the tool half of gravityfargo/claude-sync#53 — the vault CLAUDE.md advice to get the page count from `pdf size` before `Read` now works as written.
test(reference-cache): pin the bare upstream's initial branch to main
All checks were successful
Test / checks (pull_request) Successful in 20s
Test / code-quality (pull_request) Successful in 0s
Test / test (pull_request) Successful in 24s
ecba4c7efe
gravityfargo deleted branch pdf-size-page-count 2026-08-14 01:37:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gravityfargo/local-tools!9
No description provided.