兰亭 (Lanting) — there is no original, only the truest copy.
After the Lantingji Xu, Wang Xizhi's 353 CE preface to a gathering of scholars composing poetry by a winding stream. The original no longer exists; every version we know is a copy. This project is built on the same premise: there is no ground truth manuscript, only the most faithful version we can produce together.
An agentic manuscript-writing graph for drafting, critique, collation, and revision.
The graph routes one section through four judges — scientific integrity, article-type fit, adversarial review, and rhetorical hierarchy — then routes their objections back into revision. Each pass around this loop feeds the next; it stops when scores stabilize or a hard trigger fires for human review.
Phase 1 target: software application note (e.g. Briefings in Bioinformatics Application Note).
- Fill in
paper/project_config.jsonwith your software name, protected claim, forbidden phrases, and sections. Seepaper/profiles/software_application_note/required_fields.jsonfor what is required. - Fill in
Claude/spec.mdwith the paper spec, novelty threats, and figure plan. - Add 3+ target-paper PDFs to
paper/style_ref/. (Style corpus extraction is a Phase 2 addition — in Phase 1, populatepaper/rubrics/style_metrics.jsonmanually from the target journal guidelines.) - Fill in
paper/groundtruth/ground_truth_examples.mdwith annotated good/bad examples as the paper develops.
# Three draft/evaluation passes over one section
python -m lanting run benchmarks/whorlmap --section design_principles --loops 3
# Single-shot baseline: one pass, no revision
python -m lanting run benchmarks/whorlmap --section design_principles --max-loops 0
# Against the live API (mock is the default)
python -m lanting run benchmarks/whorlmap --section design_principles --loops 3 --run-mode live
# Keep iterating past a blocking objection instead of pausing (experiments only)
python -m lanting run benchmarks/whorlmap --section design_principles --loops 3 --on-block continue
# Compare finished runs
python -m lanting compare runs/<arm-a-run-id> runs/<arm-b-run-id>
# Emit the compiled graph topology
python -m lanting graph --format mermaid
python -m lanting graph --format ascii # needs the `viz` extra
python -m lanting graph --format png --output g.png
# Overnight run over all sections
bash run_overnight.shEach run writes runs/<run_id>/ containing every draft, judge output, deterministic
report, metric vector, the route log, run_manifest.json, and checkpoints.sqlite.
The loop is a compiled LangGraph StateGraph (lanting/langgraph_app.py) with a
SQLite checkpointer. State carries references and compact measurements only —
draft text, rubrics, and judge prose live in the run directory and are addressed by
path, so checkpoints stay small and JSON-native.
--engine imperative runs the equivalent plain-Python loop in lanting/graph.py.
It is the fallback when LangGraph is absent and the differential oracle for the
graph: tests/test_langgraph_engine.py asserts both engines produce identical
drafts, objections, metric vectors, and route logs.
- Phase 1 (current): Software application note profile. JSON state, direct API calls, four judges, human-review triggers.
- Phase 2 (partial): LangGraph checkpointing ✅. Style corpus extraction and metrics database still open.
methods_paperprofile. - Phase 3: Scheduled overnight runs, morning brief. Additional profiles.
pip install -r requirements-paper.txtRequires ANTHROPIC_API_KEY in .env.