Skip to content

Latest commit

 

History

History

lib

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.org

Shared library code

Code shared across tools in this repository that belongs to no single top-level configuration directory.

python/

Python modules loaded by resolved file path from more than one consumer.

  • bib_entry_check.py — read-only structural checks behind bin/bib-entry-check. Reads the single rules block in agents/bibliography-policy.md; checks explicit parent inheritance, metadata syntax and optional file presence without claiming semantic acceptance. Tested through the command and library by tests/test_bib_entry_check.py.
  • paper_fetch.py — paper acquisition core behind bin/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 nightly download-missing-pdfs-batch.py loads this module to revalidate retained book reviews; tested by tests/test_paper_fetch.py. Reads the Anna’s Archive key in-process and never prints it.
  • paper_fetch_cli.py — command entry point for bin/paper-fetch, using the dedicated outside-Drive runtime pinned by paper-fetch-requirements.txt. The acquisition contract documents book commands, manifests and statuses.
  • agent_session_lib.py — loader for the single-actor Emacs agent.el session primitives (guarded prompt delivery, marker-in-transcript delivery acknowledgment, marker-gated transcript reads, buffer lifecycle inspection). The library itself ships with the agent package, in lib/python/ of its checkout, and is tested there; this file runs that copy in its own namespace. Consumed by the paired orchestrate-review and request-review skill 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.