refresh-context
Refresh or reuse per-paper research context.
Invocation#
lem-cli refresh-context [--force] [--limit <n>]Inputs and options#
- --force rescrapes full-text context instead of using cached-or-local context.
- --limit <n> processes only the first n registry papers. The parser accepts any integer; zero or a negative value therefore selects no papers.
Output and state#
Without --force, loads cached-or-local context and persists any newly built context. With --force, performs a full-text scrape. The JSON summary reports each paper, paper_count, refreshed_or_created, reused_existing, and failed.
How many papers a context carries is the operator's to declare: LEM_CONTEXT_VENUE_PAPERS for the target-venue bucket and LEM_CONTEXT_SIMILAR_PAPERS for the similar highly cited bucket. Unset (or not a positive whole number), the bucket takes every paper of its ranked pool that has full text, and Lem writes “lem: <NAME> is not set; the paper context takes the whole ranked pool” to stderr. Each forced row reports venue_target and similar_target as the declared count, or null when the whole pool was wanted.
A forced scrape is incomplete when a declared bucket kept fewer papers than declared, or when a bucket with no declared count met a paper whose source did not answer. The process exits nonzero after printing the summary when one or more forced scrapes are incomplete.
A paper's full text is the ar5iv page of the arXiv id its metrics provenance, DOI or URL names, else of the id Semantic Scholar records for the same title. Its sections are the page's h2 sections, and its figure and table counts are the figure elements LaTeXML marks ltx_figure and ltx_table, per thousand measured words as well; nothing is counted from words that merely mention a figure or table. ar5iv answering Not Found drops the paper as having no full text; any other failure, and a local full text named in metrics provenance that cannot be read, lists the paper as unavailable with the cause (`<title>: <cause>`). The manuscript's bibliography is the one it declares with \addbibresource or \bibliography; Lem guesses no file name.
Refusals#
- --limit without an integer refuses with “--limit needs a number”.
- Any other argument refuses with “refresh-context: unknown option <argument>”.
- A registry that is not there yet refuses with “refresh-context: no registry at <path> yet; import a paper first”; one that holds no papers with “refresh-context: registry at <path> contains no papers”; one that is there but cannot be read with “registry at <path> cannot be read: <cause>”.