Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Add an entry here when the project meaningfully changes for users, for example:

## Unreleased

### Added

- Added end-to-end English output through `DEEPPAPERNOTE_OUTPUT_LANGUAGE=en` or `--language en`, including localized note schemas, paper-type planning contracts, figure callouts, grounding, final-note linting, and Formal Save validation.
- Kept Simplified Chinese as the backward-compatible default while making the selected language explicit in synthesis, lint, and save artifacts.

## v2.2.0

### Improved
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ Generate a deep-reading note for this paper: <title, DOI, URL, arXiv ID, or loca
Turn this paper into an Obsidian note: <paper>
```

DeepPaperNote currently generates Chinese notes by default, and its writing and validation rules are optimized for Chinese output.
DeepPaperNote supports complete English and Simplified Chinese note schemas. Chinese remains the default for backward compatibility; set English persistently with:

```bash
export DEEPPAPERNOTE_OUTPUT_LANGUAGE=en
```

The core pipeline commands also accept `--language en` for a single run. Section names, metadata fields, figure callouts, planning guidance, linting, and Formal Save all follow the selected language.

## 🎯 Why DeepPaperNote?

Expand Down
8 changes: 7 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ DeepPaperNote 需要 Python 3.10 或更高版本。核心 PDF 抽取路径依赖
把这篇论文整理成 Obsidian 笔记:<论文>
```

DeepPaperNote 默认生成中文笔记,当前写作与校验规则也主要针对中文输出优化。
DeepPaperNote 完整支持英文和简体中文笔记结构。为了向后兼容,默认仍为中文;可用以下设置长期启用英文:

```bash
export DEEPPAPERNOTE_OUTPUT_LANGUAGE=en
```

核心流程命令也支持使用 `--language en` 进行单次英文运行。章节名称、元数据字段、图表占位、规划规则、校验与正式保存都会遵循所选语言。

## 🎯 为什么选择 DeepPaperNote?

Expand Down
39 changes: 26 additions & 13 deletions skills/deeppapernote/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ Chinese trigger examples:
- `把这篇文章整理成 obsidian 笔记`
- `读这篇论文并生成 md 笔记`

English trigger examples:
- `Generate a deep-reading note for this paper`
- `Turn this paper into an Obsidian research note`

## Output Language

DeepPaperNote supports `zh-CN` and `en`. Resolve the language in this order:
1. the user's explicit language request
2. `--language` when a supporting script exposes it
3. `DEEPPAPERNOTE_OUTPUT_LANGUAGE`
4. `zh-CN` for backward compatibility

The synthesis bundle's `writing_contract.language`, localized sections, metadata fields, figure labels, and mechanism-flow heading are authoritative for drafting and linting. Never draft in one language and validate it under another. Read `references/output-language.md` when configuring, drafting, or debugging a non-default language.

This skill is intentionally narrow:
- it handles one paper at a time
- it does not update daily reading lists
Expand Down Expand Up @@ -92,10 +106,10 @@ Non-negotiable rules:
- evidence-first: draft from the synthesis bundle, `source_manifest`, raw sections, coverage metadata, explicit `note_plan`, and inspected paper evidence; never finish from title/abstract/headings alone
- raw-source authority: for ordinary PDFs, `*_raw_sections.jsonl` and `*_source_manifest.json` are the canonical reading material; old top-N evidence buckets, truncated `section_texts`, and `candidate_chunks` are not model-facing writing inputs
- fail-closed: if a usable PDF or sufficient evidence cannot be obtained after supported acquisition paths, stop and ask for better source material rather than producing a finished degraded note
- model-first: scripts structure evidence, but the model must decide emphasis, contribution, mechanism, limitations, and final Chinese prose
- required structure: include the canonical required sections, with `原文摘要翻译` before `一句话总结` and a dedicated `创新点` section immediately after `原文摘要翻译`
- abstract translation: when abstract metadata exists, `原文摘要翻译` is a faithful Chinese translation of the original abstract, not a bilingual block and not the model's own summary
- mechanism depth: method, framework, and system papers should include `### 机制流程` under `方法主线`, normally as a 3 to 4 step numbered flow with input, operation, and output destination
- model-first: scripts structure evidence, but the model must decide emphasis, contribution, mechanism, limitations, and final prose in the configured language
- required structure: include the localized canonical sections in the order declared by `writing_contract.must_include_sections`
- abstract fidelity: preserve the original abstract's meaning without adding later evidence or model judgments; translate it in `zh-CN` mode and render it faithfully in English in `en` mode
- mechanism depth: method, framework, and system papers should include the localized mechanism-flow subsection under the localized method section, normally as a 3 to 4 step numbered flow with input, operation, and output destination
- placeholder-first figures: plan major figure/table placeholders first; replace one only when identity match and visual usability are both strong; otherwise keep the placeholder
- final quality gates: lint is a floor; after lint passes, first run `final_quality_review` for analytical depth, then run `final_readability_review` for language polish, and rerun lint if either review edits the note

Expand Down Expand Up @@ -141,19 +155,18 @@ Formal Save states:
- Do not stop after a text-only draft just to ask whether the user wants figures inserted. Finish the figure replacement decision inside the same task unless the user explicitly asked for text only.
- The note must use real heading levels: `#`, `##`, and `###`.
- Every final note must start with an Obsidian YAML properties block above the `#` title heading. Include at least a `tags` field with a `papers/<domain>` value and useful `aliases`; include `date`, `doi`, or `arxiv_id` when known, and omit unavailable fields rather than inventing placeholders.
- `## 核心信息` must be a fixed metadata block only. Use only these fields, in this order, as `- 字段名: 值` bullets: `标题`, `标题翻译`, `作者`, `机构`, `发表时间`, `发表渠道`, `DOI`, `arXiv`, `论文链接`, `代码 / 项目`, `数据 / 资源`, `论文类型`. Omit unavailable fields; put any guide sentence, takeaway, or analysis in `一句话总结` or a later section instead.
- The note should include `原文摘要翻译` near the beginning when abstract metadata is available, before `一句话总结`.
- When abstract metadata is available, `原文摘要翻译` should directly translate the original paper abstract into Chinese rather than restating it as your own summary.
- The `原文摘要翻译` section itself should be Chinese-only; do not place English abstract sentences or English paragraph excerpts in that section.
- Do not mix later judgments, innovation summaries, or hindsight explanations into `原文摘要翻译`; keep it as the original abstract translated into Chinese.
- The note should include a dedicated `创新点` section immediately after `原文摘要翻译` and before `一句话总结`.
- The `创新点` section should not be empty praise. It should enumerate the paper's actual innovations and briefly explain why each one matters.
- The localized Core Information section must be a fixed metadata block only. Use only the fields and order declared by `writing_contract.core_info_fields`; omit unavailable fields and move commentary to a later analysis section.
- Include the localized Abstract section near the beginning when abstract metadata is available, before the one-sentence summary.
- The Abstract section should faithfully render the paper's original abstract in the configured language rather than replacing it with a model-written summary.
- Do not mix later judgments, contribution summaries, or hindsight explanations into the Abstract section.
- Include a dedicated localized Contributions section immediately after Abstract and before the one-sentence summary.
- Contributions should enumerate the paper's actual innovations and explain why each matters rather than offering empty praise.
- High-quality notes should usually contain multiple meaningful `###` subheadings in the technical sections when the paper is non-trivial.
- Generate the complete figure/table decision table and satisfy the generated `writing_contract.figure_table_contract` before drafting or saving.
- After the synthesis bundle is built, complete the model-led Visual Review Gate and Figure/Table Decision Freeze before creating `note_plan`; no `review_pending` item may cross that boundary.
- Pass the grounding and final-note figure gates before advancing; revise any failed decision coverage, insertion, structure, or status check.
- An `insert` decision is complete only after Formal Save materializes the selected image into the paper-local `images/` directory and the write succeeds.
- The note must pass a style gate: no mixed Chinese-English prose lines except stable proper nouns or citation metadata.
- The note must pass the style gate for its configured language: `zh-CN` rejects mixed Chinese-English prose artifacts, while `en` rejects Chinese prose outside citation metadata.
- The style gate also rejects mechanical term-replacement artifacts such as `KV缓存 of`, `批量ing`, `In相关 Researcher`, or `Single 序列 generation`; rewrite the sentence naturally instead of preserving a partially translated phrase.
- Style gate enforcement: when `lint_note.py` output contains `passes_style_gate: false`, fix the reported issues and re-run lint. Keep fixing and re-running until lint passes — multiple rounds are normal and expected. Do not decide that any failure is an acceptable exception — proper nouns, math formulas, and citation metadata are not automatic exemptions. Only escalate to the user if the same failures appear unchanged across multiple rounds with no reduction, indicating the model is unable to make further progress independently.
- If PDF or evidence quality is insufficient for a real deep note, fail closed: stop, report the blocked stage, and ask for the better PDF, OCR/source material, or other input needed to continue.
Expand All @@ -172,7 +185,7 @@ Model-first rule:
- central quantitative comparisons with three or more systems, settings, tasks, datasets, metrics, or ablation rows should normally be written as compact Markdown tables, followed by interpretation; do not leave the main result table as a loose bullet list when a table would be clearer
- short papers still need a complete deep note: use the saved space to explain protocol details, ablations, limitations, and deployment or replication implications rather than compressing the note into a terse summary
- after `final_quality_review` passes, reread the full note once more for readability; do not stop at formal compliance only
- in `final_readability_review`, ordinary English phrase leftovers should usually be rewritten into natural Chinese, while stable proper nouns may remain in English
- in `final_readability_review`, rewrite language leftovers into natural prose in the configured language while preserving stable proper nouns
- do not use `final_readability_review` to invent new facts, empty filler text, or shallower but safer wording just to satisfy lint

The topic references above can improve difficult runs, but the normal execution path should not depend on reading all of them.
Expand Down
4 changes: 3 additions & 1 deletion skills/deeppapernote/references/deep-analysis.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Deep Analysis

Language note: the analytical standard is language-independent. Draft in the configured output language; for `en`, use the exact headings and labels in `output-language.md`. Chinese-specific examples below apply only to `zh-CN`.

Use this guide when the user wants a note that feels like a real research note rather than a cleaned-up summary.

## Goal

Produce a Chinese paper note that helps future rereading answer:
Produce a paper note in the configured language that helps future rereading answer:
- this paper is really solving what problem
- the core route or method chain is what
- which evidence actually supports the claim
Expand Down
2 changes: 2 additions & 0 deletions skills/deeppapernote/references/figure-placement.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Figure Placement

Language note: target sections and figure-callout labels must follow the generated writing contract. For English output, use the labels in `output-language.md`.

In MVP, the skill must plan figure placement even when it cannot extract image files.

## Goal
Expand Down
2 changes: 2 additions & 0 deletions skills/deeppapernote/references/final-writing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Final Writing

Language note: draft in `synthesis_bundle.writing_contract.language`. For `en`, use the exact schema in `output-language.md`; Chinese-only wording and typography rules below apply only to `zh-CN`.

The final note should not read like raw extracted evidence.

Use the structured artifacts as inputs:
Expand Down
2 changes: 2 additions & 0 deletions skills/deeppapernote/references/note-quality.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Note Quality

Language note: evaluate headings and language cleanliness against `synthesis_bundle.writing_contract`. For `en`, use `output-language.md`; Chinese-specific examples below apply only to `zh-CN`.

The note is high quality only if it satisfies most of the checks below.

## Minimum Bar
Expand Down
2 changes: 2 additions & 0 deletions skills/deeppapernote/references/obsidian-format.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Obsidian Format

Language note: section names, metadata labels, figure callouts, and the mechanism-flow heading must follow `synthesis_bundle.writing_contract`. For `en`, use the exact schema in `output-language.md`; Chinese-specific examples below apply only to `zh-CN`.

## Heading Rules

- Use `#` for the note title only.
Expand Down
52 changes: 52 additions & 0 deletions skills/deeppapernote/references/output-language.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Output Language

DeepPaperNote supports two output schemas:

| Setting | Language | Default |
|---|---|---|
| `zh-CN` | Simplified Chinese | Yes, for backward compatibility |
| `en` | English | No |

Set a persistent preference with:

```bash
export DEEPPAPERNOTE_OUTPUT_LANGUAGE=en
```

For a single command, use `--language en` with `run_pipeline.py`, `build_synthesis_bundle.py`, `lint_note.py`, or `write_obsidian_note.py` where applicable. An explicit user request overrides the persistent preference.

## English note schema

Use these top-level sections in this order:

1. `Core Information`
2. `Abstract`
3. `Contributions`
4. `One-Sentence Summary`
5. `Research Questions`
6. `Data and Task Definition`
7. `Method`
8. `Key Results`
9. `Deep Analysis`
10. `Limitations`
11. `My Notes`
12. `References`

The allowed Core Information fields, in order, are:

`Title`, `Translated title`, `Authors`, `Institutions`, `Publication date`, `Venue`, `DOI`, `arXiv`, `Paper link`, `Code / Project`, `Data / Resources`, `Paper type`.

Use `### Analytical Flow` for the mechanism-flow subsection. Each figure placeholder uses:

```md
> [!figure] Figure 2 Human-readable label
> Suggested location: Method
> Why it matters: This figure clarifies the execution path.
> Current status: Placeholder retained; the recovered crop is incomplete.
```

For a materialized image, use the normal image embed followed immediately by one italic caption beginning with `Original paper item:`.

## Validation invariant

The bundle language, drafted note language, lint language, and save language must match. Do not reuse a passing lint artifact from another language.
2 changes: 2 additions & 0 deletions skills/deeppapernote/references/paper-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Paper Types

Language note: use the localized `contracts_by_paper_type` and section names from the generated synthesis bundle. The examples below use the backward-compatible Chinese schema; `output-language.md` defines the English schema.

Every note keeps the same 12 top-level sections from `NOTE_REQUIRED_SECTIONS`.
Paper type only changes the typed semantics of shared sections and the recommended `###` subsections used in `note_plan.section_plan`.

Expand Down
Loading