feat(zot): stack zot fetch — Zotero full-text connector, slice Z1 #826

Open
kert wants to merge 9 commits from feat/zot-fetch-z1 into main

9 Commits

Author SHA1 Message Date
kert
d821ccc964 fix(zot): fetch review pass — quota 403 degrades instead of aborting, per-item isolation with rollback and scratch cleanup, ledger notes with an 'error' outcome that retries next run (refs Z1)
Some checks failed
CI / lint (pull_request) Successful in 45s
CI / notebooks-smoke (pull_request) Successful in 1m58s
CI / test (pull_request) Successful in 2m55s
CI / lint (push) Successful in 45s
CI / notebooks-smoke (push) Successful in 1m43s
CI / test (push) Successful in 2m38s
Infra CI / zotero (pull_request) Successful in 15s
Infra CI / notebooks (pull_request) Successful in 1m5s
Infra CI / api (pull_request) Successful in 1m12s
Infra CI / docs (pull_request) Successful in 2m1s
Infra CI / mc (pull_request) Failing after 44s
Infra CI / llm (pull_request) Successful in 1m5s
Infra CI / zotero (push) Successful in 22s
Infra CI / notebooks (push) Successful in 1m14s
Infra CI / llm (push) Successful in 19s
Infra CI / docs (push) Successful in 15s
Infra CI / api (push) Successful in 24s
Infra CI / mc (push) Failing after 55s
- Anna's 403 whose body is not a key/membership error disables Anna's for
  the run (annas_left=0) instead of raising AnnasAuthError.
- run() isolates each item: any exception rolls the transaction back,
  unlinks scratch files, ledgers outcome=error with the exception text,
  and continues; AnnasAuthError still aborts.
- attach_file writes rows before copying so a failed copy rolls back
  cleanly instead of orphaning a storage dir.
- Notes (miss vs error) from resolve/deliver land in every ledger line;
  an item whose lookups/deliveries errored (transport, 5xx, throttle
  page) is 'error' and retried next run rather than a 30-day miss.
- resolve tolerates non-dict file entries and non-numeric filesize.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:27:19 -04:00
kert
0b29cd7acc feat(zot): stack zot fetch — full-text connector CLI under the --hold guard, with docs (refs Z1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:11:53 -04:00
kert
773bbc5d18 feat(zot): fetch.run — the per-item loop with dry-run, limit, retry and quota outcomes (refs Z1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:10:07 -04:00
kert
f69a3c3430 feat(zot): fetch.deliver — libgen ads→get with throttle retry, Anna's fast download under a daily reserve (refs Z1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:07:59 -04:00
kert
8ca3af3a8a feat(zot): fetch.resolve — Unpaywall + libgen JSON (DOI/ISBN/title) → ordered candidates (refs Z1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:06:13 -04:00
kert
68c9531d98 feat(zot): fetch.select — item population by collection/tag/type/item/all with the standing exclusions (refs Z1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:04:27 -04:00
kert
6846554c97 feat(zot): fetch.attach — storage copy, attachment row, source tag and md5 provenance (refs Z1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:02:44 -04:00
kert
f149c6e984 feat(zot): fetch ledger — JSONL attempts with the 30-day retry rule (refs spec 2026-09-09 Z1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 21:00:36 -04:00
kert
3615f6e781 docs(plan): Z1 of the Zotero full-text connector — stack zot fetch (spec 2026-09-09)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 20:58:52 -04:00