Repository navigation
Conversation
Add recoverable Wiki file commits, ingest and review pipelines, scoped references, directory selection and management UI. Include regressions for stale manifests, finalize reentry, same-turn receipts and editor/library state. Built against upstream 2.22.7; focused suite 43/43. Full Windows upstream run retains failures/timeouts documented in PR.
Clusm
marked this pull request as ready for review
November 20, 2026 12:11
Use only the in-console browser, renamed 选择目录; native picker entry stays hidden in this UI. Collapse raw artifacts behind a details element, load on demand, and filter with a 100-row cap so large raw trees no longer flood the page.
Persist found/duplicate counts on start so the scan result explains what was skipped; render per-stage progress with the current file and stage, and poll running jobs so progress updates without manual refresh. Stop polling when nothing runs; refresh the page list once on completion.
…d fold The everyday flow is AI-driven: scan, ingest, review. Page editing, schema editing and raw inspection stay available but load lazily only when the advanced section is expanded.
Catalog and index files are no longer discovered as source material. Scanning now reports candidates without moving files or calling a model; processing requires explicit confirmation and a separate action. A sticky bar shows the running job with a stop button that cancels it.
…h for source changes Root-level folders are deliveries with preserved relative paths; catalog files are never source. Strict YAML failures retry once with restricted scalar quoting, marking pages for metadata repair without rewriting bytes. Register-only media is recorded in place, never copied. Daily updates report discovered/skipped counts, two-step confirmation, a sticky stop bar, and a read-only change watcher (new/changed/missing, 15 min, skippable, skipped explained). Connection report explains rejected pages by code with examples.
Owner
|
谢谢整理这个 PR。我按当前提交 这版已经做出了「从原件到 Wiki 页」的基本流程。可以接入已有 Markdown,也可以扫描投递的资料,确认后分类、抽取正文并生成带来源的 Wiki 页。成文页可用普通编辑器打开,挂载后的会话可以检索和引用。AI 建议更新已有页时,会生成候选等待人工审核。这个流程对集中整理一批说明书或项目资料有价值。 要作为日常维护的 Wiki,还有几个问题:
我本地构建通过,Wiki 专项测试 108 项通过、1 项失败、1 项因平台跳过。失败项发生在空入库任务还没结束时,变更检查跳过了该轮。等任务结束再次检查,可以报告已改名文件的旧路径缺失。 Wiki 目前还没有排进短期计划,这个 PR 先保留讨论。 如果后续决定做,我们更倾向先验证「选择一批资料 → 生成带来源的 Markdown 草稿 → 审核后入库」这条最小流程,原件默认留在原位。自动归档、定时扫描和已有 Wiki 接管,再按实际使用需求评估。也先不用为这次合并把整套功能补齐。 |
… registration and change watch - scan: root folders are deliveries with preserved relative paths; catalog files never ingested; extractable types above 256 MB are reported as skipped instead of vanishing - legacy pages: strict YAML failures retry once with restricted scalar quoting, marking metadataRepair without rewriting bytes; connection report explains rejects by code - register-only media is recorded in place (hash, size, original path) with no copy, move, raw file or page - two-step scan (preview then explicit process) with a persistent stop bar - change watch: new/changed/missing over receipts and ledgers, read-only, 15 min, skip on busy - conversation: session-level single-library selector; conversation_save writes new pages only - jobs: cancelled jobs are hidden and cannot resume, single-library serial across libraries, id lookup independent of the list window, audit listing unlimited - updates: distill updates write directly with hash-conflict protection and log audit line - refactor: split wiki/ingest and notes/store by sub-domain, split the wiki workspace UI, remove dead constants module, add citation request timeout - tests: 146 wiki cases, 46 UI cases, mount selection, conversation save, job dismiss
Conflicts resolved: - src/client.css: kept the composer library selector and added the calendar reminder styles - src/tool-entry.ts: upstream guide text plus the conversation_save sentence - src/notes/store.ts: kept the delegating skeleton; the new manifest cache lives in the host interface and note-store-sync.ts, including the transaction guard from upstream Notes: upstream calendar/worklog, idle-sync performance, packaging and launcher changes are taken as-is. Local wiki work, the session library selector and conversation_save are preserved.
…ndomUUID The acknowledge lock was set before the try block while the request id was minted outside it, so a throwing crypto.randomUUID() (non-secure context, older browser) skipped finally and left every "知道了" button disabled for good. Mint the id through a small helper that falls back to timestamp+counter+entropy, and move the call inside the try so finally always releases the lock. Adds a DOM-free regression test for the fallback path.
Carries the uncommitted wiki work: delivery folders are scanned as candidates, register-only types are recorded in place without moving the original, the scan stays a read-only preview until processing is confirmed, and the change watcher reports new/changed/missing/skipped without rewriting archives. UI side covers the two-phase scan, the stop/continue controls and per-item stage reporting.
Built with scripts/build-client.mjs; the committed bundles no longer matched src/, which made test/client-bundle.test.mjs fail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
文件夹投递、旧页恢复与变化监测(团队修复)
分类/投递夹名/相对路径,basename 不变;已归档分类目录按回执/归档清单证据识别后不重复处理;清单与索引类文件永不当作资料。:的未加引号纯标量”做一次受限加引号重试;成功则登记并在清单标记metadataRepair,页面字节与 mtime 不变;仍失败才判 invalid,并给出错误码与中文原因、按原因分组、示例清单。POST scan只读预览(根层文件 / 文件夹投递 / 因过大未处理),POST process才在确认后归档与调用模型;运行中顶部常驻“停止”。GET/POST /changes返回 new/changed/missing/skipped;15 分钟可配置(0 关闭)、有任务时跳过、只读、失败只记日志;界面显示徽章、上次检查时间、三类计数与示例。>8MiB已归档文件仅按大小校验,同尺寸内容改动不会报 changed(已写入验收文档)。验证:
tsc/build 通过;test/wiki-*.test.mjs110/110、UI 31/31;复核 verdict=pass。生产只读核对:87 篇全部可解析、38 篇标记需修复、页面 mtime 仍为 2026-11-10、仅写 manifest;扫描返回 13 个候选(全部在投递夹外部汇图ai),changes 显示 new=13。未自动删除或移动任何资料。扫描不再直接动文件(追加修复)
用户实测发现点击扫描后目录文件被蒸馏。复现证据:任务仅发现根层
归档目录树.md、资料索引.md;前者被移入07_其他文档并生成 raw,未生成知识页。已取消任务、把文件恢复根层、删除误生成 raw 与对应 CSV 回执;未删除原有文件。修复:
discover统一用isInventory排除 README/index/log/schema/归档清单/归档目录树/资料索引/资料目录/目录树/索引/清单 等目录产物。POST scan只读预览并登记页面文件,返回候选清单与重复数;POST process才启动归档/抽取/蒸馏。旧update接口保留兼容,界面不再使用。开始处理需勾选同意且二次确认。验证:针对性 69/69 通过;实测
POST scan对该库返回files: [],安装后资源包含 scan/process/runbar。完整 94 文件回归未在本提交后重跑,仍保留上一轮 76 通过/12 失败/6 超时及未消除的 retrieval-index 失败,不能称全套通过。三目录与扫描链路修复(追加)
这个 PR 做什么
把本地 Knowledge 从“只存数据库知识库”扩展为可以直接接管已有 Markdown Wiki 文件:文件是成文权威,SQLite 只做可重建索引;新资料一次点击完成分类、原名归档、抽取和受限蒸馏;会话候选、人工编辑与模型候选都走同一个可恢复提交器。普通数据库知识库的既有行为不变。
lemoncat7/dsh-knowledge@7c9efe3(2.22.7),保留其日报目标与 iCloud 日历功能Clusm:feat/local-wiki-workflow→lemoncat7:main新增功能
_meta/knowledge/manifest.json记录pageId、路径、范围、来源、版本与上次接纳哈希;同标题同正文的不同路径不会因核心内容唯一约束被合并。@引用(签发与读取都复核挂载/项目范围)、会话回写候选、模型候选,全部经提交器落到同一批 Markdown。本次修复的缺陷(均为先复现、后修复、再回归)
WIKI_FILE_CONFLICT拒绝上述修复新增 9 条回归,全部通过。
逐文件改动点
一、新增功能
以
docs/、scripts/、src/wiki/、web/wiki-*及对应测试为主docs/wiki-acceptance.mddocs/wiki-handover.mdscripts/extract-one.pyscripts/wiki-build.mjsscripts/wiki-export.mjssrc/wiki/api.tssrc/wiki/browse.tssrc/wiki/commit.tssrc/wiki/distill.tssrc/wiki/extract.tssrc/wiki/identity.ts_meta/knowledge清单校验:范围、来源、版本与归档标记。src/wiki/ingest.tssrc/wiki/markdown.tssrc/wiki/mention-source.ts@的 Wiki 来源:签发前核对会话与挂载,分页读取。src/wiki/model.tssrc/wiki/native-picker.tssrc/wiki/paths.tssrc/wiki/proposals.tssrc/wiki/provider-bridge.tssrc/wiki/python.tssrc/wiki/raw.tssrc/wiki/store.tstest/wiki-commit-recovery.test.mjstest/wiki-distill.test.mjstest/wiki-gate-a.test.mjstest/wiki-identity.test.mjstest/wiki-ingest.test.mjstest/wiki-markdown.test.mjstest/wiki-native-picker.test.mjstest/wiki-paths.test.mjstest/wiki-review-regressions.test.mjstest/wiki-workspace-ui.test.mjsweb/wiki-directory-browser.jsweb/wiki-workspace.js二、对既有文件的接入改动
Provider 分派、管理 API、客户端引用与静态资源
package-lock.jsonpackage.json@tiptap/pm。src/activity-control.ts@的 Wiki 页面。src/api.tssrc/client.tsx@引用源。src/index.tssrc/local-provider.tssrc/web.tsweb/app.jsweb/styles.css验证证据
tsc、scripts/build-client.mjs、JS 语法检查均通过;已在实际 Git 分支上重跑。逐文件对照仅一处差异:
cordis-integration.test.mjs在对照中退出超时、本 PR 通过;11 个失败文件与 6 个超时在两版中一致。这不等于证明无回归,也不能称全套通过。首次接入+日常更新(追加改版)
已知限制(需要维护者判断是否阻塞)
wiki,只扫描原件根目录;没有目录监视、可靠外部重命名绑定、跨进程写锁。建议审阅顺序
src/wiki/{identity,paths,markdown,store,commit}.ts:身份、路径安全、无损解析、快照 CAS 与恢复。src/local-provider.ts与src/wiki/provider-bridge.ts:写入口分派、普通库隔离、索引重建。src/wiki/{ingest,extract,distill,model,proposals}.ts:任务流水线、进程调用、模型输出校验。src/wiki/api.ts、src/api.ts、src/index.ts、src/client.tsx、src/activity-control.ts:权限、路由与@引用。web/:工作台、目录弹窗与编辑器生命周期。test/wiki-*.test.mjs与docs/:证据与回退口径。