torchcell.literature.build_manifest

build_manifest(artifact_dir: Path, *, citation_key: str, doi: str | None = None, title: str | None = None, library_id: str | None = None, zotero_item_key: str | None = None, collections: list[str] | None = None, sources: dict[str, str] | None = None, zotero_md5: dict[str, str] | None = None, si_data_sources: list[str] | None = None, si_expected: list[str] | None = None, provenance_complete: bool = True, created_at: str | None = None) → Manifest[source]

Scan an artifact directory and build its manifest.

Walks every file except manifest.json itself, computes sha256 and size, and tags each with a role and (when known) a source URL / Zotero md5. A MinerU markdown whose <stem>_ocr_provenance.json sits beside it (written by ocr.ocr_pdf) carries that ProcessingRecord as processing; markdown OCR’d before the record existed has none.

Parameters:
  • artifact_dir – The <...>/<citation_key>/ directory.

  • citation_key – Zotero/library identity for the paper.

  • doi – DOI join key, when known.

  • title – Paper title, when known.

  • library_id – Zotero library id the item came from.

  • zotero_item_key – Zotero item key for the paper.

  • collections – Zotero collection names the item belongs to.

  • sources – Optional map of relative-path -> source string.

  • zotero_md5 – Optional map of relative-path -> Zotero-reported md5.

  • si_data_sources – External URLs the SI data came from.

  • si_expected – SI items the paper says exist (completeness checklist).

  • provenance_complete – False when retrieval/processing provenance could not be sourced (backfill of a pre-formalization key); files stay hashed.

  • created_at – ISO timestamp; defaults to now (UTC).