Skip to content

[MN4][P1] Complete the writeback and re-import workflow #5

Description

@evan188199-tech

Tracked by #10. Local plan: docs/roadmap/marginnote-4.md.

Goal (中文): 把 DeepTutor 的掌握度、错题和摘要写成 MN4 能稳定导入的 Markdown,并支持单笔记/目录 ZIP 下载。marginnote4:// 在真实验证前不启用。

Do you need to file a feature request?

  • I have searched the existing feature requests and this feature request is not already filed.
  • I believe this is a legitimate feature request, not just a question or bug.

Feature Request Description

Close the writeback loop so learning results created in DeepTutor can be imported back into MarginNote 4.

v1 already writes Markdown into deeptutor-notes/ with frontmatter for mastery_path_id, knowledge_point_id, and a reserved source_url. This is not yet a verified MN4 import workflow, and users have no download/export helper.

Scope:

  • Generate Markdown that MN4 can stably import, preserving document, page, mastery, wrong-question analysis, and knowledge-point references
  • Offer single-note download and a ZIP of the writeback directory
  • Show generation results and recoverable errors in the MN4 detail Writeback view
  • Keep marginnote4:// disabled until a real URL scheme is validated against MN4; use ordinary source references until then
  • Default writeback directory remains deeptutor-notes/ under the export root unless the user configured another writable path

Related Module

Knowledge Base Management

Use Case

After a mastery review, DeepTutor writes a summary card. The learner downloads the note or the writeback ZIP, imports it into MN4, and sees mastery/wrong-question context next to the original PDF/EPUB notes.

Additional Context

Priority: P1
Phase: M2
Status: Planned
Depends on: real export-format validation; dedicated notebook detail
Blocked until verified: marginnote4:// deep links

Key files

  • deeptutor/capabilities/marginnote/tools.py
  • deeptutor/capabilities/marginnote/data/export_adapter.py
  • web/components/knowledge/KnowledgeBaseDetail.tsx

Acceptance criteria

  • Writeback Markdown preserves document, page, mastery, wrong-question analysis, and knowledge-point IDs.
  • Users can download one note and a ZIP of the writeback folder.
  • Generation success and recoverable failures are visible in UI.
  • marginnote4:// is not advertised until validated against a real MN4 app; otherwise source_url stays a normal reference.
  • Unwritable writeback path, empty analysis, and missing mastery data have explicit fallbacks.

Success metric
A generated summary can be imported into MN4 without losing mastery or source references.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions