Paper ingest
When a PDF exists under sources/<source-id>/original/, run the full set below.
Extraction details: read /paper-extract when math or algorithms are broken, _raw/ is missing or the main task, or Marker / OCR / arXiv math is in play.
Templates: _templates/source-index.md, _templates/summary.md. Also _templates/study-note.md, _templates/question-bank.md, _templates/algorithm.md, _templates/repro-readme.md as mode requires.
Replace every {{...}} in copied templates (source-id, title, mode, date). Do not copy unused placeholder text into real notes.
Steps
- Confirm
source-idandmode(study/survey/both). Ask if unspecified - Confirm extraction inputs (
/paper-extract)- If
_raw/exists, use it as the primary input - If missing, ask the user to run Marker (full text); for math, use the reference priority (arXiv source first). Continue only after inputs are ready
- Do not full-read the PDF to fill
extracted/(short checks and missing-page fills only)
- If
- Normalize
_raw/into section chunksextracted/NN-<section-slug>.md- About 300–500 lines per file
- Add block IDs per
/paper-extract(one ID = one block; unique in the file) - Figures/tables: captions only; note "See original for figure"
- Do not change meaning. Mark doubtful extractions with
[extraction uncertain] - For survey/both, if math or algorithms are broken, follow
/paper-extract(arXiv source → Mathpix → page image + vision); on failure, follow that fallback and mark[extraction uncertain](never an arbitrary source)
- Generate
index.mdfrom_templates/source-index.md. Setmodefrom step 1. Keep only Artifact links that matchmode - Generate
summary.mdfrom_templates/summary.md(every claim must be cited perCLAUDE.md). Set the samemode - Register the paper in
_index/MOC.mdand_index/keywords.md. MOCstatusmust matchindex.mdfrontmatter. On first paper, delete the(none yet)row - If mode is study/both, prepare
study/stubs from_templates/study-note.mdand_templates/question-bank.md. If survey/both, preparesurvey/algorithm.mdfrom_templates/algorithm.mdandsurvey/repro/README.mdfrom_templates/repro-readme.md - Set
statustoreadyonindex.md,summary.md, and any stubs created in step 7 (unless extraction is still incomplete: thenextracting)
Done when
extracted/chunks exist via_raw/or an explicit exception path- Block IDs in each
extracted/file are unique index.md/summary.mdexist; every#^citation resolves to a block ID that exists in the target file- No
{{...}},…, or other template wording remains in generated files - Unused study/survey Artifact links were removed
- Frontmatter
modematches the confirmed mode;statusisready(orextractingif still incomplete);authors/year/venueare filled only from the paper - The paper is listed in
_index/with the samemodeandstatus - Citations point only to
extracted/(never_raw/)