-
Notifications
You must be signed in to change notification settings - Fork 0
实现 Wiki 批量导出 API 与 pages[] 请求格式 #49
Copy link
Copy link
Open
Labels
area: demoCreated by issue publisherCreated by issue publisherarea: wikiCreated by issue publisherCreated by issue publisherlane: backendCreated by issue publisherCreated by issue publisherphase: 3-wiki-demoCreated by issue publisherCreated by issue publisherpriority: p1Created by issue publisherCreated by issue publishertype: backendCreated by issue publisherCreated by issue publisher
Description
Metadata
Metadata
Assignees
Labels
area: demoCreated by issue publisherCreated by issue publisherarea: wikiCreated by issue publisherCreated by issue publisherlane: backendCreated by issue publisherCreated by issue publisherphase: 3-wiki-demoCreated by issue publisherCreated by issue publisherpriority: p1Created by issue publisherCreated by issue publishertype: backendCreated by issue publisherCreated by issue publisher
背景
#48 负责修复 P0 后端 API 契约与演示闭环偏差。当前修复分支已经让
POST /api/wiki/export支持单页导出、memory_ids筛选、write_files、workspace 子目录和 frontmatter provenance。但
docs/15-api-contract-plan.md中还描述了更完整的 batch 形状:{ "workspace_id": "uuid", "pages": [ { "page_slug": "why-memorybase", "page_type": "synthesis", "title": "Why MemoryBase", "memory_ids": ["uuid"] } ], "write_files": true }这不是 P0 演示闭环的阻塞项,但需要单独记录,避免后续遗忘。
Related: #30 #48
目标
为 Wiki export 增加批量导出能力,使一个请求可以导出多个 Wiki page,并返回统一的 pages 结果列表。
任务清单
POST /api/wiki/export的 batch request schema:workspace_id、pages[]、write_files。pages[]item 支持page_slug、title、page_type、memory_ids、可选max_memories。{ workspace_id, pages: [...] },每个 page 包含page_id、page_slug、revision_no、file_path、memory_count、source_count。wiki_page并新增wiki_page_revision。data/markdown_wiki/{workspace_id}/{page_slug}.md。workspace_id、page_slug、page_type、title、generated_at、memory_ids、source_doc_ids。docs/15-api-contract-plan.md和docs/08-api-design.md。验收标准
wiki_page_revision,revision number 正确递增。write_files=false时只写数据库,不落盘 Markdown 文件。write_files=true时写入 workspace 子目录。memory_ids与默认按重要性选择 memory 两种路径。ruff check scripts backend通过。.venv/bin/python -m pytest backend/tests -q通过。备注
优先级建议:P1。
这个 issue 不阻塞 #48,也不阻塞 P0 演示。#48 保持聚焦:修复当前后端 API 契约偏差和 demo 闭环失败点。