dsh-mnemon-source-documents 0.5.13 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,16 @@ Choose an existing data authority deliberately. Without `dataDir`, each stable S
19
19
 
20
20
  Manual management can create a document without a model, but it still needs a workspace in the request scope. Standalone archiving retains content locally; cross-Source LLM distillation is an optional Host workflow.
21
21
 
22
+ ## Permanent deletion / 永久删除
23
+
24
+ The detail page offers confirmed deletion for active and archived managed copies. Management uses `delete` with `{ id, fileRevision }`, `confirmed: true`, and the displayed index `expectedRevision`. It removes the managed Markdown file and index entry under the existing queue and store lock, releases active capacity, and restores the exact file bytes if committing the index fails. The file digest comes from the detail read, so edits made directly to the Markdown also reject stale confirmation. Unsafe paths, shared index paths and symlinks are rejected. This is not an archive: it runs without an Agent or a Memory Space write, and leaves project source files and existing Memory Space entries intact. There is no trash or undo; existing backup/sync retention rules are unchanged. The index stays at version 1 and needs no migration. As with existing multi-file mutations, process termination or a second disk failure during rollback is not a crash-atomic transaction.
25
+
26
+ The Source `manage` Action additionally accepts `action: "delete"`, `id`, `confirmed: true`, `expectedRevision`, and the target `fileRevision`. The target must belong to the execution's pinned active or archived ReadGrant. A Documents search returns its post-search index revision as `metadata.indexRevision` and each matched file digest as `items[].provenance.fileRevision`; a changed index or file rejects deletion rather than retrying automatically. Create-only workers cannot delete. The page client's optional `deleteDocument(id, expectedRevision, fileRevision)` callback preserves compatibility with custom pages that only implement create/update/archive.
27
+
28
+ 详情页支持确认后永久删除活跃或归档的托管副本。管理操作为 `delete`,输入 `{ id, fileRevision }`,并提供 `confirmed: true` 与页面所示索引的 `expectedRevision`。操作沿用队列与存储锁,移除托管 Markdown 和索引记录、释放活跃容量;索引提交失败时恢复原文件的完整字节,文件摘要取自详情读取,直接编辑 Markdown 也会使旧确认失效;同时拒绝不安全路径、索引共用路径与符号链接。删除无需 Agent,也不写入记忆空间;项目源文件与已有记忆空间条目保持原样。没有回收站或撤销,已有备份与同步保留规则不变。索引仍为版本 1,无需迁移。与现有多文件修改一样,进程中断或回滚期间再次发生磁盘故障不属于崩溃原子事务保证。
29
+
30
+ Source `manage` Action 新增 `action: "delete"`、`id`、`confirmed: true`、`expectedRevision` 与目标的 `fileRevision`,只允许删除该执行固定 ReadGrant 中的活跃或归档条目。档案检索在 `metadata.indexRevision` 返回检索后的索引修订,并在 `items[].provenance.fileRevision` 返回命中文件的摘要;索引或文件变化时拒绝删除,不自动重试。仅创建档案的工作 Agent 无权删除。页面客户端的 `deleteDocument(id, expectedRevision, fileRevision)` 为可选回调,原有仅支持创建、更新和归档的自定义页面可继续使用。
31
+
22
32
  ## Workspace ownership / 工作区归属
23
33
 
24
34
  Conversation tools use the session workspace (`agent.session.header.cwd`) as the Documents request scope. A shell `cd`, a Source file path, or a delegated task's initial command directory does not rebind that session workspace. Ordinary DSH subagents inherit the parent session's workspace, and delegated memory work retains the parent's pinned workspace authority.