Skip to content

fix(nara): --objects downloads /medialz/ records; atomic downloads; honest sizes and help - #113

Merged
JordanCoin merged 1 commit into
mainfrom
fix/nara-medialz
Oct 20, 2026
Merged

JordanCoin merged 1 commit into
mainfrom
fix/nara-medialz

Conversation

@JordanCoin

Copy link
Copy Markdown
Owner

Found while using openfoia itself to gather NARA PDFs for the PDF-engine test corpus.

  • /medialz/ refused. NARA serves objects under both /medialive/ and /medialz/ (19 of 27 records sampled use /medialz/, e.g. NAID 122681436). The allowlist from fix(nara): --objects downloads scans served from catalog.archives.gov/medialive #110 only had /medialive/, so --objects still skipped most records. Both are allowed (https only, no ..).
  • Placeholder sizes broke resume. NARA reports objectFileSize: 1234 on many objects (live: listed 1,234, real 1,573,115). Resume compared the file to that number and re-downloaded. download_to_file now streams to <dest>.part and renames when complete (all adapters), so an existing file is whole and resume trusts it. --list-objects prints "size unknown" for the placeholder.
  • Help text. records search --help listed 2 of 11 sources and said no keys are needed; it now lists all 11 and the key each reads.

Tests first (all failed before): medialz allowlist, placeholder-size resume, no partial file at dest mid-stream, size display, help lists every registered source. Full suite: 530 passed.

Live: NAID 122681436 --objects: 4 ingested; rerun: 4 already present; no .part left.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wdqj51cPquyTRKmoJLQV6y

…d help

Found by an agent gathering test PDFs with the openfoia CLI: 19 of 27 NARA
records serve objects under /medialz/, which --objects refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wdqj51cPquyTRKmoJLQV6y
@JordanCoin
JordanCoin merged commit c59557d into main Oct 20, 2026
7 checks passed
@JordanCoin
JordanCoin deleted the fix/nara-medialz branch October 20, 2026 10:09
@JordanCoin JordanCoin mentioned this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant