dsh-continual-evolve 0.13.0 → 0.14.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
@@ -7,9 +7,9 @@ English | [中文](README.zh.md)
7
7
  [![CI](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml/badge.svg)](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933)](package.json)
10
- [![Tests](https://img.shields.io/badge/tests-62%20passing-brightgreen)]()
11
- [![Coverage · statements](https://img.shields.io/badge/coverage_statements-98%25-brightgreen)]()
12
- [![Coverage · branches](https://img.shields.io/badge/coverage_branches-95%25-green)]()
10
+ [![Tests](https://img.shields.io/badge/tests-91%20passing-brightgreen)]()
11
+ [![Coverage · statements](https://img.shields.io/badge/coverage_statements-96%25-brightgreen)]()
12
+ [![Coverage · branches](https://img.shields.io/badge/coverage_branches-93%25-green)]()
13
13
  [![Coverage · functions](https://img.shields.io/badge/coverage_functions-100%25-brightgreen)]()
14
14
 
15
15
  A workspace-memory plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`): one plain-markdown memory store per workspace (`<workspace>/.evolve/memory/`), the index injected at session start, used by the model with its **native file tools** — and nothing else.
@@ -23,7 +23,7 @@ Reusable experience gathered in one session (user preferences, pitfalls, project
23
23
  1. **Session-start injection** — the plugin registers a single system-prompt section: the `MEMORY.md` index content (whole-line truncated over budget, with a read-the-directory hint), the absolute store path, and the when_to_save guide. The section is computed once per session and reused byte-for-byte, keeping the system prompt stable and the prompt cache warm; an empty store costs zero tokens.
24
24
  2. **Native read/write** — DSH fully permits file access inside the workspace (reads are never fenced; the write fence only covers paths outside the workspace, see [`docs/FAQ.md`](docs/FAQ.md) #6). The model reads, writes, and edits memory files and maintains the index directly; the store is bootstrapped on first use.
25
25
  3. **Governance is the file** — no versions, no snapshots, no approvals, no background extraction: a bad memory is a visible file in the workspace, and deleting it is the retirement path. Memories are personal context — on bootstrap in a git workspace the store appends `.evolve/` to the workspace `.gitignore` (non-git workspaces are left untouched).
26
- 4. **Read-only card** — the plugin mounts a read-only memory card on its own page in the official plugin manager (the `plugins.bundle.config` slot; hosts without it silently degrade to no card): recently served workspaces, per-workspace entry and index counts, and index-drift warnings (unindexed files, index rows whose file is gone). The card follows the market's look — host theme tokens, the `Button` primitive for refresh, and zh/en copy that tracks the DSH language (plain themed elements on old hosts). The card is a request-time projection of the files on disk — the single source of truth remains `.evolve/memory/`; the card has no edit path, edit the files directly.
26
+ 4. **Read-only card** — the plugin mounts a read-only memory card on its own page in the official plugin manager (the `plugins.bundle.config` slot; hosts without it silently degrade to no card), shaped like the market's own settings card (collapsed by default, header toggle with a rotating chevron, hover/open frame states) and aligned with ZCode's Settings → Memory viewer: one workspace at a time behind a dropdown scope selector fed by the host workspace registry, a file search box, per-file relative updated times, click-to-preview file bodies (5 MiB cap), plus index-drift warnings (unindexed files, index rows whose file is gone). The plugin's display name and description localize through the host's package `locale/*.json` metadata channel. The card follows the market's look — host theme tokens, the `Button` primitive for refresh, and zh/en copy that tracks the DSH language (plain themed elements on old hosts). The card is a request-time projection of the files on disk — the single source of truth remains `.evolve/memory/`; the card has no edit path, edit the files directly.
27
27
 
28
28
  Memory file format (same as ZCode): frontmatter with `name` / `description` (the hook that decides whether a future session recalls it) / `metadata.type` (`user | feedback | project | reference`); `feedback` bodies must carry **Why:** and **How to apply:** lines.
29
29
 
@@ -66,9 +66,9 @@ Profile patch example:
66
66
 
67
67
  ```bash
68
68
  pnpm install && pnpm build # deps + tsc -> lib/
69
- pnpm test # vitest (66 tests)
69
+ pnpm test # vitest (91 tests)
70
70
  pnpm test:coverage # v8 coverage, CI-enforced thresholds
71
- pnpm lint # oxlint src test
71
+ pnpm lint # oxlint src test client
72
72
  ```
73
73
 
74
74
  Layout:
@@ -79,11 +79,13 @@ Layout:
79
79
  │ ├── memory-section.ts # injection: read index / bootstrap / truncate / session freeze
80
80
  │ ├── memory-guide.ts # guide: when_to_save and upkeep (adapted from ZCode)
81
81
  │ ├── memory-snapshot.ts # card: read-only store projection (entries / drift / error degrade)
82
- │ ├── known-workspaces.ts# card: in-process LRU workspace allowlist (the API read fence)
82
+ │ ├── workspace-catalog.ts# card: workspace list from the host registry (the API read fence)
83
+ │ ├── known-workspaces.ts# card: in-process LRU fallback source for the catalogue
83
84
  │ └── card-routes.ts # card: GET-only read API on the host webServer
84
85
  ├── client/
85
86
  │ └── client.js # hand-written client bundle: read-only card in the plugin manager
86
- ├── test/ # vitest suite (7 files)
87
+ ├── locale/ # host package metadata: localized display name + description (zh/en)
88
+ ├── test/ # vitest suite (8 files)
87
89
  ├── lib/ # build output (tsc)
88
90
  ├── docs/ # design.md (design) · FAQ.md (real-world pitfalls)
89
91
  └── .agents/ # AI collaboration layer (AGENTS.md, skills, ADR notes)
package/README.zh.md CHANGED
@@ -7,9 +7,9 @@
7
7
  [![CI](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml/badge.svg)](https://github.com/ZK-Andy/dsh-continual-evolve/actions/workflows/ci.yml)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933)](package.json)
10
- [![Tests](https://img.shields.io/badge/tests-62%20passing-brightgreen)]()
11
- [![Coverage · statements](https://img.shields.io/badge/coverage_statements-98%25-brightgreen)]()
12
- [![Coverage · branches](https://img.shields.io/badge/coverage_branches-95%25-green)]()
10
+ [![Tests](https://img.shields.io/badge/tests-91%20passing-brightgreen)]()
11
+ [![Coverage · statements](https://img.shields.io/badge/coverage_statements-96%25-brightgreen)]()
12
+ [![Coverage · branches](https://img.shields.io/badge/coverage_branches-93%25-green)]()
13
13
  [![Coverage · functions](https://img.shields.io/badge/coverage_functions-100%25-brightgreen)]()
14
14
 
15
15
  [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的工作区记忆插件:每个工作区一个纯 markdown 记忆库(`<workspace>/.evolve/memory/`),会话开局注入索引,模型用**原生文件读写工具**直接使用——仅此而已。
@@ -23,7 +23,7 @@ Agent 每个会话积累的可复用经验(用户偏好、踩坑教训、项
23
23
  1. **开局注入** —— 插件只注册一个 system-prompt section:注入 `MEMORY.md` 索引正文(超预算按整行截断并提示读目录)、记忆目录绝对路径、when_to_save 指南。该 section 每会话只算一次并逐字节复用,system prompt 稳定、prompt cache 持续命中;空 store 零 token。
24
24
  2. **原生读写** —— DSH 对工作区内文件读写全放行(读路径从不设防,写围栏只围工作区外,见 [`docs/FAQ.md`](docs/FAQ.md) #6)。模型直接 Read/Write/Edit 记忆文件并维护索引;store 不存在时自动 bootstrap。
25
25
  3. **治理即文件** —— 无版本、无快照、无审批、无后台提取:一条坏记忆就是工作区里一个可见的文件,删掉它就是退役。记忆是个人上下文——bootstrap 时若工作区是 git 仓库会自动把 `.evolve/` 追加进 `.gitignore`(非 git 工作区不碰任何文件)。
26
- 4. **只读卡片** —— 插件在官方插件管理的本 bundle 页面挂一张只读记忆卡片(`plugins.bundle.config` slot,老宿主自动降级为无卡片):最近服务过的工作区、各自记忆库的条目数/索引行数、索引漂移警告(未索引文件与索引失联文件)。卡片与市场同款——宿主主题 token、`Button` 原语刷新按钮、中英文案跟随 DSH 语言(老宿主降级为同主题裸元素)。卡片是磁盘文件的请求时投影——单一事实源永远是 `.evolve/memory/` 里的文件,卡片没有编辑路径,编辑请直接改文件。
26
+ 4. **只读卡片** —— 插件在官方插件管理的本 bundle 页面挂一张只读记忆卡片(`plugins.bundle.config` slot,老宿主自动降级为无卡片):形态对齐市场自家设置卡(默认收起、头部整行可点 + 旋转 chevron、hover/展开框态),内容对齐 ZCode 设置的记忆选项卡——工作区一次选一个(下拉作用域选择器,目录取宿主工作区注册表)、文件搜索框、每个文件的相对更新时间、点击行内展开文件内容预览(5 MiB 上限),外加索引漂移警告(未索引文件与索引失联文件)。插件的显示名与描述走宿主包元数据 `locale/*.json` 通道双语切换。卡片与市场同款——宿主主题 token、`Button` 原语刷新按钮、中英文案跟随 DSH 语言(老宿主降级为同主题裸元素)。卡片是磁盘文件的请求时投影——单一事实源永远是 `.evolve/memory/` 里的文件,卡片没有编辑路径,编辑请直接改文件。
27
27
 
28
28
  记忆文件格式(与 ZCode 一致):frontmatter 带 `name` / `description`(决定未来会话会不会想起它)/ `metadata.type`(`user | feedback | project | reference`);`feedback` 正文必带 **Why:** 与 **How to apply:**。
29
29
 
@@ -66,9 +66,9 @@ profile patch 示例:
66
66
 
67
67
  ```bash
68
68
  pnpm install && pnpm build # 依赖 + tsc -> lib/
69
- pnpm test # vitest(66 例)
69
+ pnpm test # vitest(91 例)
70
70
  pnpm test:coverage # v8 覆盖率,CI 强制阈值
71
- pnpm lint # oxlint src test
71
+ pnpm lint # oxlint src test client
72
72
  ```
73
73
 
74
74
  目录结构:
@@ -79,11 +79,13 @@ pnpm lint # oxlint src test
79
79
  │ ├── memory-section.ts # 注入:读索引 / bootstrap / 截断 / 会话冻结
80
80
  │ ├── memory-guide.ts # 指南:when_to_save 与维护纪律(改编自 ZCode)
81
81
  │ ├── memory-snapshot.ts # 卡片:记忆库只读投影(条目 / 漂移 / 错误降级)
82
- │ ├── known-workspaces.ts# 卡片:进程内 LRU 工作区白名单(API 读围栏)
82
+ │ ├── workspace-catalog.ts# 卡片:工作区目录(宿主注册表;API 读围栏)
83
+ │ ├── known-workspaces.ts# 卡片:目录的进程内 LRU 回退源
83
84
  │ └── card-routes.ts # 卡片:webServer 上的 GET-only 只读 API
84
85
  ├── client/
85
86
  │ └── client.js # 手写 client bundle:官方插件管理内只读卡片
86
- ├── test/ # vitest 测试(7 个文件)
87
+ ├── locale/ # 宿主包元数据:显示名 + 描述双语(zh/en)
88
+ ├── test/ # vitest 测试(8 个文件)
87
89
  ├── lib/ # 构建产物(tsc)
88
90
  ├── docs/ # design.md(设计)· FAQ.md(踩坑)
89
91
  └── .agents/ # AI 协作层(AGENTS.md、技能、ADR 笔记)