Code shared across tools in this repository that belongs to no single top-level configuration directory.
Python modules loaded by resolved file path from more than one consumer.
bib_entry_check.py— read-only structural checks behindbin/bib-entry-check. Reads the single rules block inagents/bibliography-policy.md; checks explicit parent inheritance, metadata syntax and optional file presence without claiming semantic acceptance. Tested through the command and library bytests/test_bib_entry_check.py.paper_fetch.py— paper acquisition core behindbin/paper-fetch: Anna’s Archive domain resolution and member fast-download API, LibGen DOI/ISBN lookup and full-text search, SciDB parsing, bot-challenge detection, open-access resolution (Crossref, OpenAlex, Unpaywall, arXiv), PDF identity verification and browser-job generation for challenged hosts. Anna’s Archive has no search API, so its book search takes a page a browser saved (--annas-search-html). Its book interfaces inventory, register, stage and inspect candidates, then compare measured bytes only after explicit reviews. The website’s nightlydownload-missing-pdfs-batch.pyloads this module to revalidate retained book reviews; tested bytests/test_paper_fetch.py. Reads the Anna’s Archive key in-process and never prints it.paper_fetch_cli.py— command entry point forbin/paper-fetch, using the dedicated outside-Drive runtime pinned bypaper-fetch-requirements.txt. The acquisition contract documents book commands, manifests and statuses.agent_session_lib.py— loader for the single-actor Emacsagent.elsession primitives (guarded prompt delivery, marker-in-transcript delivery acknowledgment, marker-gated transcript reads, buffer lifecycle inspection). The library itself ships with theagentpackage, inlib/python/of its checkout, and is tested there; this file runs that copy in its own namespace. Consumed by the pairedorchestrate-reviewandrequest-reviewskill helpers on both the Claude and Codex sides. Emacs IPC has a 15-second client timeout. A timeout leaves delivery ambiguous, not failed; pending submissions remain available for receipt reconciliation. Manual delivered reconciliation requires the marker-bearing user message, just like ordinary delivery and retry checks. Consumers call every primitive through the loaded module object (session.<name>) so tests have exactly one patch point per primitive.