refactor: compact provider-PDF bridge plumbing

↗ view on GitHub · Eli Ziff · 2026-07-27 · eb793a16

prune() replaces ten conditional-spread pyramids with identical
persisted-JSON key order, attachmentFromStored() unifies the duplicate
stored-record validators, parsedState()/cachedPdf() dedupe the
resume-vs-read and downloaded-branch copies, and the lease layer
collapses SELECT+INSERT/CAS into one upsert whose semantics match the
original exactly (live lease refuses even the same owner; expired
lease taken over atomically under BEGIN IMMEDIATE). -301 lines.
mike-provider-pdf:v1 / v2 pointer / binding byte-shapes unchanged.

Verified: tsc clean; bridge suite 34/34 incl. lease-takeover and
cold-failure backoff, plus consumer suites green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUsMXzBsEJ27DjJVPSfW5o
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents dc1c3f46
Stats 1 file changed , +374 , -675
Part of PDF pinpoint evidence and parse-lifecycle hardening

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-eb793a16.md from inside the repo you want the change in.

⬇ Download capture-commit-eb793a16.md