Skip to content

Releases: thematteroftime/lazy-paper

lazy-paper 2.0.0 — the knowledge-base loop

Choose a tag to compare

@thematteroftime thematteroftime released this 12 Jun 14:16
7bc2abb

lazy-paper grows from a single-paper deep-read pipeline into a personal research knowledge base with an AI-scientist loop.

READ → ASK → GROW → CROSS-ANALYZE → EXPERIMENT + ITERATE — see the README for the image-annotated walkthrough.

Highlights

  • ingest / query / papers — persistent cross-paper library (LanceDB + BM25 hybrid retrieval, merged knowledge graphs); zero extra LLM calls on ingest
  • template --idea "..." — your idea becomes a question template; every section ends with a mandatory divergent [发散] question anchored in evidence but reaching past the paper
  • synthesize --topic "..." — grounded five-section cross-paper report; bidirectional cross-analysis; ends with ≥3 new anchored questions
  • exp-ingest / advise — your experiments (curves, metrics, notes) become library citizens; grounded next-iteration plans with round memory (--outcome makes advice hit-rate auditable)
  • garden — the whole library as a star map (papers and experiments are stars), static single page, double-click to open
  • Grounding everywhere — span-anchored verification in deep reads, [src: id] markers + deterministic citation checks, (推测) labels, audit sidecars for every LLM call
  • 406 tests, bilingual docs, five live-verified real-data acceptance rounds (including two fresh arXiv ingests through the full loop)

Full step-by-step arc in CHANGELOG.md.

v1.11.5 — --ocr-lang flag + bilingual doc mirror restored + 656-line slimdown

Choose a tag to compare

@thematteroftime thematteroftime released this 24 May 15:03

Two threads landed this cycle: a tiny CLI plumbing addition for CJK-OCR (--ocr-lang) and a 6-subagent + 1-scrub-subagent doc reorg that restores the bilingual mirror cycle 13 had folded for size, deletes redundant zh duplicates of dev/test docs, and embeds three real-data images in the pipeline walkthrough.

Added — --ocr-lang CLI flag

Independent of --lang (cli.py:215 is Output language for LLM stages + render). --ocr-lang controls the language field MinerU sees at s01 OCR. Default en preserves pre-v1.11.5 behaviour byte-for-byte for English papers; --ocr-lang zh is for CJK-heavy manuscripts where the English OCR drops characters. The two flags don't couple — you can ask for --ocr-lang zh --lang en (Chinese source, English output) or the reverse.

Doc reorg — bilingual mirror + slimdown

Cycle 15 + cycle 16: 6 parallel subagents (1 wide + 5 narrow + 1 OCR audit) + 1 final scrub. Net +224 / -879 across 40 files.

  • docs/ARCHITECTURE.md rewritten in native English (940 lines, not literal translation); docs_zh/ARCHITECTURE.md restored as the simplified-Chinese mirror (939 lines). The cycle-13 single-source policy is rescinded: README.mddocs/ only, README.zh.mddocs_zh/ only, no cross-language pointers in either index.
  • docs_zh/CONTRIBUTING.md + docs_zh/TEST_FRAMEWORK.md + the stale docs_zh/README.md index deleted. User-facing rule: bilingual mirrors are for technical explanation docs (USER_GUIDE / AGENT_GUIDE / ARCHITECTURE / HANDOFF); dev/test/contributor docs ship English-only. Root CONTRIBUTING.md and docs/TEST_FRAMEWORK.md are the canonical sources.
  • Real-data pipeline walkthrough in both READMEs now embeds three pipeline images extracted from runs/meng2024_v111_demo/ (docs/assets/pipeline-{fig-extracted.jpg, preview-pdf-p01.png, preview-pdf-p03.png}). Narrative path references unified to v1.11.1 demos (was a mix of v110 + v111).
  • docs/v1_10_external_reference.md + docs/v1_10_variant_comparison.md promoted into docs/archive/; 9 live references updated.
  • tests/fixtures/hu2025/ (1.2 MB dead v1.4-era fixture) deleted.
  • B1/B2 用词 audit: 52 surgical edits across 11 docs — long-sentence splits, semicolon→period, utilizeuse, 斥责拒绝, removed marketing filler. No structural rewrites.
  • docs/INTERNAL/audit_subagent_template.md (added in v1.11.4) is now the opening template for every audit-subagent prompt. Codifies the seven rules drawn from the v1.10 → v1.11.4 session's five audit-methodology reversals.

Off-tree cleanup (gitignored)

runs/ baselines (_v190 / _v190b / _v191 / bare; 47 dirs) cleaned, freeing ~200 MB. Documented in project memory: /tmp/run_demo.sh skips-and-exits since its v190 cache is gone; future demo reruns should source s01–s07 from runs/<paper>_v111_demo/ instead.

Tests

301 collected (+1 vs v1.11.4: test_dispatch_ocr_lang_zh_threads_through). No pipeline behaviour change beyond the new optional flag.

v1.11.4 — 2 drive-by literal fixes + audit_subagent_template.md

Choose a tag to compare

@thematteroftime thematteroftime released this 24 May 11:29

Tiny patch release. 2 LOC of literal-alignment fixes + a new audit-process discipline document. Cycle 15 = 3 specialist + 2 independent meta auditors; Meta #2 caught a latent scope bug in the proposed v1.12.0 ch06 same-chunk-pairing rule (the rule relied on the LLM knowing \n\n---\n\n is a chunk separator, which the prompt never states), so that fix was queued for v1.12.1 and v1.11.4 shipped only the two zero-risk drive-bys.

Fixed

  • README.zh.md:408 — broken link to deleted docs_zh/ARCHITECTURE.md. Redirected to canonical docs/ARCHITECTURE.md with explicit "单一来源" wording, matching the policy at docs_zh/README.md:19.
  • stages/s09_render/renderers/pptx.py:571"Key Insights" literal was a drift outlier (convention is _S.COMBINED_KW = ("要点", "Key Points") at line 72). Replaced with _S.pick(_S.COMBINED_KW, doc.lang).

Added

  • docs/INTERNAL/audit_subagent_template.md — hard-won discipline from the v1.10 → v1.11.4 session's five audit-methodology reversals. Lists seven mandatory rules for an audit subagent (don't cite the spec, use audit_grep.py not plain grep, test the design empirically, worktree-gate prompt or verifier changes, two independent meta auditors when stakes are high, don't synthesise away dissent, state confidence and what would flip it) plus a recommended prompt skeleton.

Deferred queue (NOT in this release)

  • v1.12.1: ch06 same-chunk-pairing rule (with Meta #2's corrective preamble); s01/mineru.py:38 language=en decoupling via new --ocr-lang flag.
  • v1.13: domain-agnostic prompts (4 llm/prompts/*.md files declare "materials-science journal"); reasoning_content persistence.

Tests

300/300 pass.

v1.11.3 — F2 abstention + F4 swap-guard relax (meng ch06/ch07 hotfix)

Choose a tag to compare

@thematteroftime thematteroftime released this 24 May 10:12

Targeted pipeline hotfix. ~15 LOC across llm/prompts/section_compose.md + stages/s08_section_compose/structured.py. Cycle 14 = 4 specialist subagents (database / prompt / LLM / doc) + 2 independent meta auditors; methodology hardened after cycle 12's three reversals.

Fixes

  • F2 — section_compose.md NO MAKING UP NUMBERS rule. If the cited chunks do not contain the specific value/condition/field/formula a claim would need, the composer MUST either describe the trend qualitatively or explicitly note "未在源中找到该数值". May NOT invent a plausible-looking number to fill a syntactic slot. (+5 LOC prompt.)
  • F4 — structured.py numeric-anchor-aware swap guard. Retry-when-short now accepts retries that have strictly more _ANCHOR_VALUE_RE hits than the prior draft, not only those with at-least-as-many verified claims. β#3 ≥1-accepted-claim safety guard retained so a silent 0→0 swap still can't happen. (~15 LOC.)

Root cause (4-spec convergence)

meng2024 ch06's "5.00 J/cm³ @ 180 kV/cm" + "E_b=214 kV/cm" is L3 (composition layer) hallucination, NOT retrieval miss: chunk 1 + c0023 both contain the correct co-occurrence 5.00 + 90.09% + **340 kV/cm** and both were cited by ch06. The LLM cross-stitched chunk 1's value with chunk 5's 180 kV/cm condition and fabricated 214 (the unique grep hit for "214" in meng2024 is a substring of grant number 52302147).

meng2024 ch07 lost its 5.00 J/cm³ reference (v1.10 had it, v1.11+ did not) because the retry-when-short swap guard required ≥ current accepted-claim count — the better retry had fewer total claims but more numeric anchors, so it was rejected.

Sanity results (meng2024 + ali2025_flash, fresh s08+s09)

  • ch06: 180 kV/cm / 214 kV/cm / 340 kV/cm mention counts ALL → 0. Fabricated 214 / mis-bound 180 GONE.
  • ch07: 5.00 J/cm³ reference recovered (1 hit, matching v1.10).
  • ali2025_flash ch13/14/15: 3021 / 1671 / 3023 chars ≈ v1.11.1 baseline (= 0 regression).

Known issue (deferred to v1.12)

F2 abstention rule is too defensive on meng2024 ch06: LLM drops the flagship 5.00 J/cm³ entirely rather than risk wrong-field binding, even though the correct 5.00 @ 340 kV/cm co-occurrence IS in cited chunks. ch06 chars 4261 → 1234 (−71 %). Net trade vs v1.11.1 on this one chapter: no fabrication, but missing the flagship metric. Per project principle "don't invent > do invent", trade is acceptable for hotfix. v1.12 will add a same-chunk-pairing rule so the composer emits the correct binding instead of abstaining.

v1.12 candidates surfaced (NOT in v1.11.3)

  • Domain-agnostic prompts — all 8 llm/prompts/*.md declare themselves "materials-science journal".
  • s01/mineru.py:38 hardcoded language=en ignores --lang zh at OCR stage.
  • docs_zh/ARCHITECTURE.md broken link from README.zh.md:408.
  • pptx.py:571 "Key Insights" vs _S.COMBINED_KW[1] "Key Points" centralisation drift.
  • llm/client.py does not persist DeepSeek reasoning_content — blocks retro-audit of CoT.

Tests

300/300 pass. No unit-test behaviour changed.

v1.11.2 — erratum: audit_grep.py + 'Audit pitfall' note

Choose a tag to compare

@thematteroftime thematteroftime released this 24 May 05:10

Tooling/erratum release. Zero pipeline behaviour changed vs v1.11.1.

What happened

Cycle 12 audit #1 on v1.11.1 flagged ali2025_flash ch13 as fabricating three baseline values (17.3 / 20.1 / 27.9 J/cm³). A hotfix candidate added a prompt rule + numeric-in-chunk verifier advisory. Two specialist + two meta audits then independently falsified the bug report: all three values exist verbatim in runs/ali2025_flash/s02_clean/doc_6.md as OCR-tokenised LaTeX char streams ($\sim 1 7 . 3 ~ \mathrm{J/cm}^3$); a plain grep silently misses them. The hotfix candidate had additionally caused real regressions on real chapters and was reverted before commit.

What v1.11.2 ships

  • scripts/audit_grep.py — OCR-tolerant grep that runs both the pattern and every source line through normalize_ocr_latex (the same normaliser the s08 verifier uses), so LaTeX char-spacing and unit-superscript variants collapse.
  • docs/TEST_FRAMEWORK.md + docs_zh/TEST_FRAMEWORK.md — new "Audit pitfall: OCR-spaced numerics + LaTeX wrappers" section. Audit subagent prompts MUST require audit_grep.py, never plain grep, for any numeric verification against OCR source.

Known issue (deferred)

Two-meta cross-check surfaced a real v1.11.1 regression that all four cycle-12 audits missed: meng2024 ch06 binds W_rec=5.00 J/cm³ / η=90.09% to "180 kV/cm" (source: 340 kV/cm) and emits E_b=214 kV/cm (not in source); meng2024 ch07 dropped its 5.00 J/cm³ reference entirely between v1.10 and v1.11.1. A v1.11.3 single-line cap fix was tried and reverted (no fix on ch06, -60% chapter collapse). Deferred to a dedicated v1.11.3 diagnostic cycle.

Tests

300/300 pass. No pipeline code changes.

v1.11.1 — 4 HIGH bug fixes from cycle 11 sentence-level audit

Choose a tag to compare

@thematteroftime thematteroftime released this 24 May 05:10

v1.11.0 passed the architecture-review ship gate but a follow-up
precision audit (3 subagents cross-checking output vs source paper)
caught 4 HIGH issues that surface-level checks missed. v1.11.0 was
not pushed; v1.11.1 is the first stable of the v1.11 line.

Fixes

  • Bug #1+#2: meng2024 flagship W_rec inconsistent across chapters (5.00 / 4.50 / 2.94) because s08 scavenged comparator values. Fix: extract headline_metrics from the KG and pipe into context.yaml as ground truth; prompt forbids substituting comparator numbers.
  • Bug #3: meng2024 ch13 attributed La(Mg)-doped-NBT result to Cao et al. when source said Ma et al. Fix: post-verify advisory in verify_section_draft flags author surnames not in cited chunks. LAZY_PAPER_AUTHOR_HARDREJECT=1 promotes advisory → hard reject.
  • Bug #4: hif_2 ch15 emitted a fabricated physics critique of "图 43" — actually an unCLIP appendix figure whose OCR'd caption was the literal generation prompt (a) A high quality photo of a dog…. Fix: two-layer caption-stub filter at s04 + s07.

Bilingual regression prevention

  • cli.py writes lang to meta.yaml.
  • s07 emits a CJK-ratio guard warning when lang=zh but the LLM returned <30% CJK chars.
  • s09 builder localises the "Untitled" fallback to "未命名章节" for lang=zh.

Note

v1.11.2 ships an erratum + tooling fix on top of this release; prefer v1.11.2 unless cherry-picking commits.

v1.10.0 — Variant C figure_ids hard constraint + normalize BS3+BS4

Choose a tag to compare

@thematteroftime thematteroftime released this 23 May 04:38

Highlights since v1.9.2

  • Variant C — figure_ids hard constraint ships as v1.10's headline change. Picks the winner of a 3-variant × 9-paper × 3-audit-cycle test (33 LLM runs across 3 git worktrees).
  • normalize_ocr_latex BS3+BS4 lifts verifier accuracy across all variants by collapsing LaTeX escape sequences (\%%) and Unicode super/subscripts (³3).
  • 3-cycle audit committee (each cycle = 3 specialist auditors in parallel) caught 5 bugs in variant C, all fixed before ship.
  • 280/280 tests pass (+25 from v1.9.2's 255).

Full report: docs/v1_10_variant_comparison.md · External reference survey: docs/v1_10_external_reference.md

Variant C — figure_ids hard constraint

Before v1.10, figure embedding in the rendered output depended on the LLM voluntarily writing Fig. N literally in the prose. On figure-rich papers (ML papers with ≥10 figs, materials reviews with ≥20 figs), the LLM cited <30% of available figures, and the s09 binding silently dropped the rest.

Variant C makes figure citation a schema-level + verifier-level constraint:

  • GroundedClaim.figure_ids: list[str] — schema field tells the binding which figures the claim cites.
  • Prompt rule — for each figure listed in section_figures, the LLM must emit a claim with figure_ids=["Fig. N"] AND include the literal Fig. N / 图N in text.
  • Verify advisory — accepted claims whose figure_ids don't appear literally in text get recorded as figure_hint_unmet for audit visibility (claim still kept).
  • Figure-retry pass — when ≥50% of available figures aren't mentioned post-verify, one strengthened LLM call adds them. Three swap guards (parity with retry-when-short β#3): more figures AND ≥1 verifier-accepted claim AND required-mention coverage not regressed.
  • Env-gated whitelistLAZY_PAPER_FIGURE_ID_WHITELIST=1 strips unknown fig_ids; default OFF because cycle 1+2 evidence (reading original PDFs) shows "unknown" fig_ids are usually s04_figures OCR-vs-paper-actual numbering misalignment, NOT LLM hallucination.

Validation — 33 LLM runs across 3 variants

M2 figure embed ratio (true distinct-figure count, not panels)

Paper available A (env tuning) B (cap tiering) C (figure_ids)
ali2025_flash 26 5 (19%) 4 (15%) 26 (100%)
he2023 8 4 (50%) 7 (88%) 8 (100%)
meng2024 7 4 (57%) 5 (71%) 7 (100%)
hif_1 (Adv Mat 62p) 20 2 (10%) 4 (20%) 20 (100%)
hif_2 (DALL-E 2) 17 3 (18%) 5 (29%) 17 (100%)

M1 zero-variance probe (meng2024 × 3 runs)

Variant per run mean stdev
baseline (v1.9.2) 10117 / 12742 / 13666 12175 1503
A 12819 / 12065 / 12521 12468 310
B 13740 / 13012 / 12002 12918 713
C 12703 / 13525 / 12849 13026 358

All 3 variants stay well below the spec §7 floor (baseline stdev = 1503).

M4 TestCase scores

TestCase (max) baseline A B C
meng2024 T1 ch01 benchmark recovery (17) 9 / 9 / 9 (stdev 0) 5 / 9 / 9 (stdev 1.88) 5 / 17 / 15 (stdev 5.25) 9 / 9 / 9 (stdev 0)
ali2025_flash T4 ch14 comparison depth (5) 4 / 3 4 3 5
chai2026 T6 ch01 (4) 4 / 4 3 3 4
yang2025 T2 ch01 (3) 3 / 3 3 3 3
meng2024 T3 ch10 (5) 3 / 3 / 5 4 / 5 / 4 5 / 4 / 4 4 / 4 / 4

Variant C is the only variant that preserves the meng2024 T1 = 9/9/9 zero-variance achievement of v1.9.x AND breaks baseline on ali2025_flash T4 (4 → 5).

Why not Variant A or B

  • A (env tuning) introduces M4 variance (stdev 1.88 on T1) and Auditor 1 caught a content-quality error in cycle 2 (called PbZrO₃ "lead-free" — chemical-naming mistake). The env tuning is real lift; it'll be recommended in .env.example as a LAZY_PAPER_MIN_SECTION_CHARS=1200 LAZY_PAPER_BEST_OF_N=3 combo, not as a separate variant flag.
  • B (cap tiering) had the worst M4 variance (stdev 5.25 — can reach 17/17 peak but unstable) AND lowered M3 coverage rate (meng2024: A 71% vs B 64%; gaur2022: A 53% vs B 34%). cap=12 spreads LLM attention too thin. Deferred to v1.11 for redesign as dynamic cap = min(comparator_count, 10).

normalize_ocr_latex BS3+BS4

Auditor 2 (cycle 1) inventoried 4 normalize blindspots causing 41-74 verifier false-rejects per s08 run. Cycle 2 broke them into BS1-4 with asymmetric fix difficulty:

  • BS3 — LaTeX escape sequences: \%, \&, \_, \^, \$ lose their leading backslash so they match the LLM's unescaped quote.
  • BS4 — Unicode super/subscript folding: NFKD decomposes ³3, 2. Greek letters (α/β/π) NOT decomposed. NFKD doesn't fold U+2212 / U+2013 / U+2014 to ASCII -, so an explicit _UNICODE_DASH substitution follows.
  • BS1+BS2 (letter-spaced subscript) deferred to v1.11 due to inherent OCR↔LLM asymmetry.

11 unit tests in stages/_common/tests/test_normalize.py lock in the new behavior.

3 audit cycles — caught & fixed bugs in variant C

Cycle Auditor Bug Fix commit
1 Auditor 3 figure_ids advisory ran on rejected claims (double-report) 2e30e1c
1.5 Auditor 3.2 figure-retry missing C-1 coverage guard 0cc056d
1.5 Auditor 3.2 figure-retry missing C-2 min-accepted guard 0cc056d (same)
2 Auditor 2 advisory entries inflated audit log's "verifier_rejects" count 535d035
3 Final ship gate env-gated whitelist needed for cycle 3 visibility e3cb9e1

3 cycles ran the audit committee in parallel (each cycle = 3 specialist auditors with non-overlapping scopes, reading original PDFs + code + reference docs).

Side effects

  • M2_figures_embedded metric (scripts/collect_variant_metrics.py) was inflating values by counting <img> tags (which includes every panel of a multi-panel figure). Fixed to count <figure> blocks (one per distinct figure). Cycle 1 caught this — earlier "17/17 = 100%" readings on multi-panel-heavy papers were panel-count artifacts.
  • New M2_figures_hallucinated_count field surfaces s04_figures ↔ LLM numbering misalignment (v1.11 #2 candidate fix).
  • M4 TestCase scores are deterministic (regex + size + fuzzy substring — no LLM judge), so baseline recheck took 0 LLM cost and confirmed zero drift from v1.9.x scores.

Deferred to v1.11 (ranked by ROI)

# Item Complexity
1 normalize_ocr_latex BS1+BS2 (letter-spaced subscript) M
2 s04_figures caption-aware numbering (fix OCR vs paper number misalign) M
3 prompt comparator gap — Jiang/Ma et al. systematically missed M
4 template-vs-paper subject-mismatch graceful degrade L
5 Variant B redesign: dynamic cap = min(comparator_count, 10) S
6 real-time LLM cost meter into metrics.yaml (M6) S
7 DOCX HYPERLINK dead-code fix (thread sources into renderers) M
8 _merge_drafts 60-char prefix + (author, value) dedup S
9 6 hardcodes → env vars S

Release trail (since v1.9.2)

  • v1.9.2 — 8-bug fix + 18-paper validation
  • v1.10.0 — Variant C ship + normalize BS3+BS4 + 3-cycle audit

Full details: CHANGELOG.md

v1.9.2 — informed-retry + 18-paper validation + post-audit fixes

Choose a tag to compare

@thematteroftime thematteroftime released this 22 May 07:13

Highlights since v1.8.2

  • v1.9.0 ships informed-retry — meng2024 T1 benchmark recovery
    variance drops to stdev 0 (was stdev 2.6 in v1.8.1). Three
    independent runs all score 9/9.
  • v1.9.2 lands 8 high-impact bug fixes from a 2-auditor + 3-reviewer
    • 2-confirmation cycle (see fix list below).
  • 18-paper validation (13 corpus + 5 newly OCR'd from PDFs) —
    every paper completes end-to-end; retry-when-empty is load-bearing
    (2–13 fires per paper).
  • HTML clickable citations are now the default for end users.
  • 255/255 tests pass.

Full report: docs/v1_9_2_20_paper_validation.md

v1.9.2 fixes (post-audit cycle)

  • C1 retry-when-short was comparing against a stale accepted from
    before retry-when-empty rebound verified/rejected. Wrong-output
    potential. Now rebinds after the empty-retry swap.
  • C2 retry-when-short could swap one fully-ungrounded draft for
    another when both had 0 verifier-accepted claims (0 >= 0 passed).
    Now requires len(retry_accepted) >= 1.
  • H1 _find_chunk_for_entity_span fallback-2 print crashed on
    None entity.text.
  • H2 _evidence_quote pad_right formula could go negative for
    spans longer than max_chars - 30, silently producing empty/garbage
    snippets via negative-index slicing.
  • M1 + CLI fix s09_render/runner.py now defaults to HYPERLINK
    for HTML format. cli.py passes None when --debug-citations is
    absent, so the per-format default actually reaches CLI users.
  • M2 HtmlRenderer env_mode now .strip() before .lower().
  • M3 best-of-N exception-swallow logs the failed sample.
  • pyproject.toml version bumped from stale 1.4.0 to current 1.9.2.

Release trail (since v1.8.2)

  • v1.8.3 — HTML clickable citations + chunk-find fallback + length retry
  • v1.9.0 — informed-retry (zero variance on meng2024 T1)
  • v1.9.1 — 3-review + 2-audit findings
  • v1.9.2 — 8 bug fixes from 2-auditor cycle + 18-paper validation

Full details: CHANGELOG.md

v1.8.2 — security/flow hardening + 10-paper corpus validation

Choose a tag to compare

@thematteroftime thematteroftime released this 21 May 04:12

Highlights

v1.8.x is a stability + safety hardening of the Strategy KL section composer. v1.7 KL had wide variance (floor 1/17 on the meng2024 benchmark-recovery test). v1.8.x lifts the floor to 12/17 and gets a perfect 17/17 in one of three runs.

v1.8.2 layers on top of v1.8.1 with three security findings (one HIGH), one infinite-poll flow bug, two silent exception swallows removed, normalizer consolidation, and the full 10-paper corpus validation that proves KL is now production-ready as the default.

What changed in v1.8.2

Security (audit-driven)

  • HIGH--paper-id always slugified, defeating ../../etc/x path traversal into your filesystem.
  • MEDIUM — MinerU OCR zip extraction now validates every entry against the destination root, preventing zip-slip from a malicious or MITM'd vendor response.
  • LOW — error messages no longer echo raw HTTP bodies (potential upstream-gateway leak); render-failure done.yaml entries are truncated to type(exc).__name__ + str(exc)[:200].

Flow correctness

  • PaddleOCR poll loop now has a hard deadline (PADDLEOCR_TIMEOUT_S, default 30 min) — previously could hang forever on a stuck job.
  • Two except Exception: pass swallows removed; they now log + fall back.

Maintainability

  • New stages/_common/normalize.py consolidates the v1.8.1 OCR/LaTeX normalizer. One source of truth.
  • coverage_summary() removed (zero callers).
  • kg_extract.py docstring updated to point at the live paper_kg_v3.md prompt.

New env-overridable knobs

MINERU_BASE_URL, MINERU_TIMEOUT_S, MINERU_POLL_S, PADDLEOCR_BASE_URL, PADDLEOCR_MODEL, PADDLEOCR_TIMEOUT_S, PADDLEOCR_POLL_S.

10-paper corpus validation

Paper Test v1.8.x KL
meng2024 ch01 (3 runs) competitor benchmark recovery (max 17) 12 / 17 / 16 — mean 15, floor 12 (v1.7 KL floor was 1)
yang2025 ch01 fabrication resistance 3/3 ✓
fu2020 ch01 basic 3/4 ✓
chai2026 ch01 basic 4/4 ✓
ali2025_flash ch14 comparison depth 0/5 ⚠ (LLM sampling variance — analyzed in docs/v1_8_2_corpus_validation.md)

Eight additional papers (gaur2022, ge2025, he2023, liu2022, pamula2025, pan2025, randall2021, yao2022) — all 15/15 chapters with substantive output. Retry-when-empty mechanism fires on 4 of the 9 newly-validated runs, confirming it's load-bearing.

Architecture diagrams

docs/ARCHITECTURE.md now includes Mermaid flowcharts for:

  • the 9-stage pipeline (color-coded by deterministic / LLM / renderer)
  • the Strategy KL compose flow (verifier + retry-when-empty)

Upgrade

git pull
uv pip install -e ".[dev]"

# Recommended Strategy KL invocation (unchanged from v1.8.1)
LAZY_PAPER_STRUCTURED=1 \
LAZY_PAPER_KG_PROMPT=paper_kg_v3.md \
LAZY_PAPER_BEST_OF_N=2 \
uv run python -m cli run --pdf <pdf> --template <docx> --paper-id <id> --lang zh

Tests

250/250 pass · 2 deselected (live-LLM tests gated by pytest -m live).

v1.1.0 — quality, density, hand-off

Choose a tag to compare

@thematteroftime thematteroftime released this 19 May 06:50

Second public release. Focus: output quality, LLM cost-control knob, code/docs polish, agent-friendly hand-off.

Highlights

  • LLM_MAX_TOKENS_CEILING env var caps every LLM call site through a shared llm.client.max_tokens() helper (default 40000). Per-stage defaults raised: s06 1500→4000, s07 2000→4000, s08 3000→12000, s09 outline 8000→16000, s09 summary/paper 2000→8000. DeepSeek-Reasoner's chain-of-thought tokens no longer starve the final JSON content.
  • CLI --only accepts comma-separated stage lists (s08_section_compose,s09_render) and rejects unknown stage names.
  • s08 chapter heading consistency: template's number field no longer leaks into displayed headings; PPT outline renderer adds its own positional 01–N prefix.
  • PPT deep-observation typography: 11pt → 13pt, eyebrow bold, row height 0.52" → 0.70".
  • Image-data-url helper consolidated to stages/_common/images.py (HTML renderer + LLM client share it).

Docs

  • New docs/AGENT_GUIDE.md: workflow patterns, cache gotchas, anti-patterns for AI agents maintaining the repo.
  • Rewritten docs/INTERNAL/HANDOFF.md: verified state, 5-paper test corpus, env-var table, safe-to-delete list.
  • docs/PPT_KNOWN_ISSUES.md: triaged math-subscript font fallback + KEY POINTS card overlap for v1.2.
  • New README.zh.md (Chinese mirror); README badges + tech stack table; citation block.

Verified

5 end-to-end papers (he2023, ali2025_flash, yang2025, liu2022, pan2025) — all produce DOCX/PDF/HTML/PPTX with LLM-grouped 4–5 section outline. 158/158 unit tests pass.

See CHANGELOG.md for the full diff.