@a9i5k4/dsh-auto-memory 3.0.0 → 3.0.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.
Files changed (90) hide show
  1. package/README.md +19 -7
  2. package/README.zh-CN.md +19 -7
  3. package/docs/FRONTEND-CO-CREATION.md +191 -0
  4. package/docs/GM53-HOMEPAGE-PROMPT.md +323 -0
  5. package/docs/HOMEPAGE-CONTENT-FOR-GM53.md +299 -0
  6. package/docs/PROMO-PROMPT-3.0.md +100 -0
  7. package/docs/USER-GUIDE.en.md +2 -2
  8. package/docs/USER-GUIDE.zh-CN.md +2 -2
  9. package/docs/WHITEPAPER.md +207 -0
  10. package/docs/internal/ARCHITECTURE-FOR-ZCODE-20260920.md +397 -0
  11. package/docs/internal/ART-DIRECTION-DEEPSEEK-20260920.md +351 -0
  12. package/docs/internal/ART-DIRECTION-WIREFRAME.md +191 -181
  13. package/docs/internal/ART-DIRECTION-WIREFRAME.md.bak-superseded +181 -0
  14. package/docs/internal/BATTLE-PLAN-20260917.md +871 -0
  15. package/docs/internal/FEATURE-INVENTORY.md +531 -0
  16. package/docs/internal/G-SERIES-EXECUTION-20260917.md +248 -0
  17. package/docs/internal/G3-DESIGN-20260918.md +82 -0
  18. package/docs/internal/G3-DISK-FORMAT-GAP-20260919.md +92 -0
  19. package/docs/internal/HANDOFF-TO-ZCODE-20260920.md +309 -0
  20. package/docs/internal/HERMES-DATA-VERIFICATION-20260919.md +120 -0
  21. package/docs/internal/HERMES-LEGACY-STATUS-20260919.md +74 -0
  22. package/docs/internal/ISSUE-55-58-VERIFICATION-20260918.md +175 -0
  23. package/docs/internal/ISSUE10-FIX-EXECUTION-20260919.md +389 -0
  24. package/docs/internal/ISSUE10-PLAN-20260919.md +254 -0
  25. package/docs/internal/ISSUE10B-FORENSICS-20260919.md +468 -0
  26. package/docs/internal/ISSUE9-PURGE-AND-R1-PLAIN-20260919.md +150 -0
  27. package/docs/internal/ISSUE9-RESIDUAL-FORENSICS-20260919.md +114 -0
  28. package/docs/internal/LESSON-TO-CANDIDATE-STATUS-20260919.md +79 -0
  29. package/docs/internal/MEMORY-GOVERNANCE-20260917.md +309 -0
  30. package/docs/internal/PRE-FRONTEND-CHECKLIST-20260919.md +705 -0
  31. package/docs/internal/PRE-FRONTEND-CHECKLIST-20260919.md.bak-s10 +649 -0
  32. package/docs/internal/PROCEDURAL-MEMORY-AND-APPROVAL-DESIGN-20260918.md +225 -0
  33. package/docs/internal/PROGRESS-20260917.md +93 -0
  34. package/docs/internal/PROMPT-GAP-AUDIT-20260920.md +128 -0
  35. package/docs/internal/R1-DEGRADE-AUDIT-20260918.md +163 -0
  36. package/docs/internal/R1-READABILITY-FORENSICS-20260919.md +127 -0
  37. package/docs/internal/R2-EVIDENCE-DEEP-AUDIT-20260918.md +140 -0
  38. package/docs/internal/R3-DEGRADE-LEDGER-DESIGN-20260918.md +138 -0
  39. package/docs/internal/R4-RECALL-QUOTA-PLAN-20260918.md +218 -0
  40. package/docs/internal/RESUME-20260918.md +171 -0
  41. package/docs/internal/RESUME-20260919.md +104 -0
  42. package/docs/internal/RHINELAB-TO-DEEPSEEK-FEASIBILITY.md +198 -0
  43. package/docs/internal/ROADMAP-20260917-WEEK.md +134 -0
  44. package/docs/internal/S10-CONSTRUCTION-HANDOFF-20260917.md +13 -3
  45. package/docs/internal/S10-GAP-INVENTORY-20260917.md +239 -0
  46. package/docs/internal/T6-EXECUTION-20260920.md +130 -0
  47. package/docs/internal/TELEMETRY-EFFECT-REPORT-DESIGN-20260918.md +146 -0
  48. package/docs/internal/THESIS-GAP-ANALYSIS-20260918.md +89 -0
  49. package/docs/internal/THESIS-OUTLINE-20260918.md +147 -0
  50. package/docs/internal/THREE-LAYER-CONTRACT.md +10 -1
  51. package/docs/internal/UPSTREAM-ISSUE-PR-TRIAGE-20260919.md +297 -0
  52. package/docs/internal/UPSTREAM-ISSUES-3RD-AUDIT-20260920.md +104 -0
  53. package/docs/screenshots/promo/promo-0-banner-v3.png +0 -0
  54. package/lib/activation-host.js +63 -9
  55. package/lib/board-mode.js +1 -1
  56. package/lib/client.js +892 -27
  57. package/lib/config-io.js +156 -0
  58. package/lib/context-bridge.js +3 -0
  59. package/lib/context-host.js +16 -9
  60. package/lib/degrade.js +385 -0
  61. package/lib/dsh-home.js +143 -0
  62. package/lib/episodic-store.js +52 -2
  63. package/lib/evidence-store.js +8 -1
  64. package/lib/fact-store.js +21 -2
  65. package/lib/index-sync.js +13 -1
  66. package/lib/index.js +1507 -158
  67. package/lib/intent-clean-safe.js +258 -40
  68. package/lib/l0-extract.js +231 -16
  69. package/lib/m4-corpus.js +8 -2
  70. package/lib/m7-index-sync-host.js +8 -1
  71. package/lib/memory-envelope.js +6 -1
  72. package/lib/memory-hub.js +127 -12
  73. package/lib/memory-index.js +4 -2
  74. package/lib/note-status-apply.js +118 -0
  75. package/lib/note-status.js +196 -0
  76. package/lib/procedure-store.js +84 -3
  77. package/lib/python-sidecar-client.js +29 -3
  78. package/lib/recall-fusion.js +83 -12
  79. package/lib/rules-edit.js +159 -0
  80. package/lib/semantic-decide.js +41 -8
  81. package/lib/semantic-js.js +51 -6
  82. package/lib/shadow-host.js +3 -5
  83. package/lib/skill-export-host.js +153 -0
  84. package/lib/skill-export.js +239 -0
  85. package/lib/storage-manage.js +6 -0
  86. package/lib/temporal-parse.js +191 -159
  87. package/lib/tier0-catalog.js +45 -3
  88. package/lib/wb-contract.js +198 -2
  89. package/lib/wb-sidecar.js +54 -3
  90. package/package.json +1 -1
@@ -0,0 +1,100 @@
1
+ # dsh-auto-memory 3.0 宣传图 · 单发完整 Prompt
2
+
3
+ > **用法**:整段粘进生图工具,一次出图。
4
+ > **推荐参数**:`gpt-image-2.5` / quality `high` / size `1536x1024`(16:9 横版)
5
+ > 若要竖版封面用 `1024x1536`,把构图描述里的「left / right」换成「top / bottom」。
6
+
7
+ ---
8
+
9
+ ## Prompt(直接复制)
10
+
11
+ ```
12
+ A polished product banner illustration for a developer tool, 16:9 widescreen, dark cinematic anime aesthetic.
13
+
14
+ LAYOUT: Split composition. Left 55% is a clean information panel with crisp typography. Right 45% is a full-body anime character with floating holographic elements. A soft vertical light seam separates the two halves.
15
+
16
+ BACKGROUND: Deep navy-to-near-black gradient, from #12203f at the upper left to #050810 at the lower right. Subtle floating grid of thin cyan lines, faint bokeh particles, and a soft cyan glow behind the character. A few translucent glass panels drift in the background with very low opacity. Clean, premium, technical — not cluttered.
17
+
18
+ CHARACTER (right side, occupying right 45%, full body from head to knees): A gentle anime girl with long flowing light-blue hair and a small gold star hair clip. Large expressive blue eyes with soft highlights, warm closed-mouth smile, looking slightly toward the viewer. She wears a white blouse with puffy sleeves, a dark navy vest with gold trim and small gold buttons, a large navy bow at the collar with a round blue gemstone brooch, and a navy pleated skirt with a gold chain and gem pendant at the waist. She holds a large open dark-navy hardcover book in both hands; the book's cover is embossed with gold filigree and displays the English text "MEMORY LOG" in clean gold serif capitals. In her raised right hand she holds a dark fountain pen with a gold nib. Around her float 6 to 8 glowing translucent blue glass memory cards, each with a delicate gold corner frame and a small sparkle icon. Soft rim light from the left catches her hair and shoulders; cool cyan bounce light from the cards. Clean crisp line art, cel shading, soft painterly highlights, high detail on hair strands and fabric folds.
19
+
20
+ LEFT PANEL TOP — main title block:
21
+ Large bold Chinese title text, two lines, white with a subtle cyan glow:
22
+ "无问自忆"
23
+ "记忆不断线"
24
+ Below it, smaller light-blue English subtitle in a clean sans-serif:
25
+ "She remembers, unbidden."
26
+ Below that, one line of small gray-blue Chinese text:
27
+ "跨窗口 · 跨会话 · 跨工具"
28
+
29
+ LEFT PANEL MIDDLE — a 2x2 grid of four rounded glass capability cards, each with a thin cyan border, a small line-art icon in the upper left, and Chinese text:
30
+ Card 1 icon: a small closed book. Title "自动记忆" in white bold, body text "每轮自动沉淀,寒暄轮跳过" in small gray-blue.
31
+ Card 2 icon: a shield with a checkmark. Title "写入闸门" in white bold, body text "乱码与凭据进不了提示词" in small gray-blue.
32
+ Card 3 icon: a clipboard with a pen. Title "交接账本" in white bold, body text "换窗口不丢上下文" in small gray-blue.
33
+ Card 4 icon: three stacked horizontal layers. Title "三层记忆" in white bold, body text "硬规矩 / 笔记 / 日志" in small gray-blue.
34
+
35
+ LEFT PANEL LOWER — a dark rounded terminal bar with a thin cyan border, containing monospace text in cyan-green:
36
+ "pnpm add @a9i5k4/dsh-auto-memory@latest"
37
+ To its right, a small rounded pill button with the Chinese text "复制".
38
+
39
+ LEFT PANEL BOTTOM — a horizontal row of small rounded info chips with thin borders, each containing short Chinese text:
40
+ "17 模型工具" "49 路由" "98 配置键" "12 面板页签" "零运行时依赖"
41
+
42
+ TOP RIGHT CORNER — a small glowing version badge, rounded pill shape with a cyan border and cyan text: "v3.0.0"
43
+
44
+ BOTTOM LEFT CORNER — small gray text: "BSD-3-Clause · Windows / macOS / Linux"
45
+
46
+ STYLE: Premium dark UI illustration, deep blue and cyan palette with small warm gold accents, glassmorphism, soft glow, high contrast between text and background. Typography must be sharp, correctly spelled, well-kerned, and perfectly legible. All Chinese characters must be accurate and correct. Cinematic lighting, clean composition, professional key visual quality, no watermark, no signature, no border frame.
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 出图后必做:文字准确性自检
52
+
53
+ AI 生图的**中文长文本**仍可能出错(缺笔画、错字、糊字)。逐项核对:
54
+
55
+ - [ ] 主标题「无问自忆」「记忆不断线」——**这两行最重要**,错一个字就重出
56
+ - [ ] 英文副标题 `She remembers, unbidden.`
57
+ - [ ] 四张卡片标题:自动记忆 / 写入闸门 / 交接账本 / 三层记忆
58
+ - [ ] 卡片小字(错字可接受,糊字不行 —— 小字允许后期覆盖)
59
+ - [ ] 命令 `pnpm add @a9i5k4/dsh-auto-memory@latest`(**必须逐字符对**)
60
+ - [ ] 五个 chip:17 模型工具 / 49 路由 / 98 配置键 / 12 面板页签 / 零运行时依赖
61
+ - [ ] 版本号 `v3.0.0`(不是 0.1.35、不是 3.0.1)
62
+ - [ ] 书封 `MEMORY LOG`
63
+ - [ ] 左下 `BSD-3-Clause`
64
+
65
+ **修图策略**(按性价比排序):
66
+ 1. **重出**:主标题或命令出错 → 直接重跑,改 prompt 里对应那行
67
+ 2. **局部重绘(inpainting)**:只有某一小块错 → 用图生图 + 蒙版只遮那一块
68
+ 3. **HTML 后期覆盖**:只有卡片小字或 chip 糊 → 用 HTML 渲染同位置的文字层叠上去(此时 AI 已经画好了光影氛围,只为修字)
69
+
70
+ ---
71
+
72
+ ## 内容依据(写 prompt 时的事实来源)
73
+
74
+ 全部经代码自核,**不要改动这些数字**:
75
+
76
+ | 项 | 值 |
77
+ |---|---|
78
+ | 版本 | **3.0.0**(2026-09-17 发布) |
79
+ | 模型工具 | **17** |
80
+ | HTTP 路由 | **49** |
81
+ | 配置键 | **98**(60 可写) |
82
+ | 面板页签 | **12** |
83
+ | 运行时依赖 | **0** |
84
+ | 许可 | BSD-3-Clause |
85
+
86
+ **3.0.0 真正的新东西**(宣传图该讲的):
87
+ 1. **底层重建收官** —— 检索、注入、容量、并发四条底层全部重建
88
+ 2. **白板/看板从实验升为出厂形态**(`handoffEnabled` 默认 `true`、`boardMode` 默认 `graph`)
89
+ 3. **语义索引永久不就绪的真因修复** —— 累计 22,945 行 `index-not-ready` 降级日志;根因是 Python worker 的同步槽被一次未完成的同步永久占住;修复给出两条「可证已死」接管出口
90
+ 4. **多工作区/多会话适配** —— 修掉引擎里 4 处「单槽」变量,同时跑两个会话时不再互相覆盖
91
+
92
+ ---
93
+
94
+ ## 负面提示(若工具支持 negative prompt)
95
+
96
+ ```
97
+ low quality, blurry, blurry text, garbled characters, wrong Chinese characters, misspelled text,
98
+ extra fingers, deformed hands, watermark, signature, logo, border frame, cluttered background,
99
+ neon overload, oversaturated, flat lighting, 3d render, photorealism, western cartoon style
100
+ ```
@@ -41,7 +41,7 @@
41
41
 
42
42
  ## 1. Install & entry points
43
43
 
44
- - Install into the DSH web profile directory (`~/.dsh/profiles/web`): `pnpm add @a9i5k4/dsh-auto-memory`, then append `"@a9i5k4/dsh-auto-memory"` to the `dsh.profile.bundles` array in that directory's `package.json` (or one-click from the DSH plugin marketplace).
44
+ - Install into the DSH web profile directory (`~/.dsh/profiles/web`): `pnpm add @a9i5k4/dsh-auto-memory@latest`, then append `"@a9i5k4/dsh-auto-memory"` to the `dsh.profile.bundles` array in that directory's `package.json` (or one-click from the DSH plugin marketplace).
45
45
  - **You must restart dsh web after installing**: the injection surface (manifest) loads at startup. Same after changing host code.
46
46
  - After a browser-side update, **hard-refresh** (Ctrl+Shift+R) to load the new client.js.
47
47
  - pnpm v11 blocks packages published <24h ago (`minimumReleaseAge`): set `minimumReleaseAge: 0` in `pnpm-workspace.yaml` or pin an explicit version for same-day updates.
@@ -193,7 +193,7 @@ The static injection face: the `<memory_system>` block composed into every turn.
193
193
 
194
194
  | Item | Notes |
195
195
  |---|---|
196
- | Version / check for updates | Compares with the npm registry; registry installs get one-click updates. Local dev links show the update command `cd ~/.dsh/profiles/web && pnpm up @a9i5k4/dsh-auto-memory` |
196
+ | Version / check for updates | Compares with the npm registry; registry installs get one-click updates. Local dev links show the update command `cd ~/.dsh/profiles/web && pnpm up @a9i5k4/dsh-auto-memory@latest` |
197
197
  | Diagnostics log | `~/.dsh/dsh-auto-memory-pre-diagnose.log` (subagent circuit-breaking, consolidation skips, GC, recall degradation — all in here) |
198
198
  | Community | QQ group feedback — faster than GitHub issues (link in README) |
199
199
 
@@ -41,7 +41,7 @@
41
41
 
42
42
  ## 1. 安装与入口
43
43
 
44
- - 安装:在 DSH 的 web profile 目录(`~/.dsh/profiles/web`)执行 `pnpm add @a9i5k4/dsh-auto-memory`,并在同目录 `package.json` 的 `dsh.profile.bundles` 数组里追加 `"@a9i5k4/dsh-auto-memory"`(或在 DSH 插件市场一键安装)。
44
+ - 安装:在 DSH 的 web profile 目录(`~/.dsh/profiles/web`)执行 `pnpm add @a9i5k4/dsh-auto-memory@latest`,并在同目录 `package.json` 的 `dsh.profile.bundles` 数组里追加 `"@a9i5k4/dsh-auto-memory"`(或在 DSH 插件市场一键安装)。
45
45
  - **装完必须重启 dsh web**:插件的注入面(manifest)在启动时加载;改完 host 代码同理。
46
46
  - 浏览器端更新后需**硬刷新**(Ctrl+Shift+R)才会加载新 client.js。
47
47
  - pnpm v11 会拦截发布不足 24 小时的新版本(`minimumReleaseAge`):当天更新请在 `pnpm-workspace.yaml` 设 `minimumReleaseAge: 0`,或直接 pin 版本号。
@@ -193,7 +193,7 @@
193
193
 
194
194
  | 项 | 说明 |
195
195
  |---|---|
196
- | 插件版本 / 检查更新 | 与 npm registry 比对;registry 安装可一键更新。本地开发链接会显示更新命令 `cd ~/.dsh/profiles/web && pnpm up @a9i5k4/dsh-auto-memory` |
196
+ | 插件版本 / 检查更新 | 与 npm registry 比对;registry 安装可一键更新。本地开发链接会显示更新命令 `cd ~/.dsh/profiles/web && pnpm up @a9i5k4/dsh-auto-memory@latest` |
197
197
  | 诊断日志 | `~/.dsh/dsh-auto-memory-pre-diagnose.log`(子代理熔断、巩固跳过、回收、唤起降级等事件全在内) |
198
198
  | 交流群 | QQ 群反馈,响应比 issue 快(链接见 README) |
199
199
 
@@ -0,0 +1,207 @@
1
+ # dsh-auto-memory 白皮书
2
+
3
+ > **版本**:3.0.0 · **日期**:2026-09-20 · **许可**:BSD-3-Clause
4
+ >
5
+ > **本文是什么**:一份**约束性文档**。它把「这个插件到底建了什么、它有哪些已知边界」
6
+ > 讲清楚,并把一条**核心不变量**显式成文——因为**约束不落纸,就一定会再被违反一次**。
7
+ >
8
+ > **本文不是什么**:不是宣传材料(宣传看 README),不是 API 文档(看 `FEATURE-INVENTORY.md`),
9
+ > 不是论文(看 `M7-RESEARCH-PAPER.md`)。
10
+
11
+ ---
12
+
13
+ ## 0. 一句话
14
+
15
+ > **同一份记忆字节,同时喂给三个消费者。任何一处写入,都要同时满足三套约束。**
16
+
17
+ 这是本插件全部工程复杂度的来源,也是历史上绝大多数 bug 的来源。
18
+
19
+ ---
20
+
21
+ ## 1. 核心不变量
22
+
23
+ ### 1.1 三个消费者
24
+
25
+ 记忆在磁盘上是纯 Markdown 明文。但同一份字节被三个**语义不同**的消费方读取:
26
+
27
+ | # | 消费者 | 怎么读 | 对字节的要求 |
28
+ |---|---|---|---|
29
+ | ① | **注入面** | 每轮自动注入进上下文 | 必须**干净、短、有结构**;乱码与超长行会污染上下文 |
30
+ | ② | **检索面** | 词法 + 语义双路召回 | 必须有**可切分的锚点结构**;锚点被破坏则召回精度下降 |
31
+ | ③ | **语义面** | digest 供语义模型编码 | 必须**可重复生成**;同一输入必须产出同一 digest |
32
+
33
+ ### 1.2 约束
34
+
35
+ > **一处写入,三处生效。** 写入方必须同时保证:
36
+ > 1. 注入面拿到的字节在**预算内且无污染**;
37
+ > 2. 检索面能按锚点**正确切条**;
38
+ > 3. 语义面的 digest 能**正确失效并重建**。
39
+
40
+ ### 1.3 为什么这条不变量危险
41
+
42
+ 因为它**大多是静默降级**:
43
+
44
+ - 注入进了一段乱码 → 模型读到噪音,**不报错**;
45
+ - 锚点被写坏 → 召回少了几条,**不报错**;
46
+ - digest 没失效 → 语义召回用了旧向量,**不报错**。
47
+
48
+ **不爆的时候,完全看不出来。** 这就是为什么必须有一条显式约束 + 一批针对性断言。
49
+
50
+ ---
51
+
52
+ ## 2. 一次真实事故(本不变量的代价)
53
+
54
+ 这是本项目最典型的一类 bug,值得完整记录。
55
+
56
+ ### 2.1 现象
57
+
58
+ 用户在面板「日志」页签看到**乱码**;同时记忆文件侧也出现异常内容。
59
+
60
+ ### 2.2 根因
61
+
62
+ **两条写入通路,只修了一条。**
63
+
64
+ - 该插件有**两条互不相干**的写入通路:`procedure`(技能)线与 `fact`(事实)线;
65
+ - 早先的清洗器只接进了 `procedure` 线;
66
+ - `fact` 线的三个入口(`crossFeed` 的 fact 分支 / `factCandidateFromRow` / `hubFlushTick` 的回写)**从来没有过清洗器**;
67
+ - 于是脏数据既进了 `facts.json`,又经回写污染了 `MEMORY.md`。
68
+
69
+ > **教训**:「修了一条通路」不等于「另一条受保护」。
70
+ > 只修**具名入口**是治标;把清洗**下沉到写原语**才是治本。
71
+
72
+ ### 2.3 处置
73
+
74
+ - **当时**:在三个已知入口设防,补清洗器 + 新增判据族;
75
+ - **根治(在途)**:把 `sanitizeForWrite` 下沉到写原语(`appendText` / `writeFull`),
76
+ 使**全部写入路径自动受保护**——不再依赖「记得给新通路接上清洗器」;
77
+ - 存量脏数据按**用户拍板**采用 `skip` 并留痕,**不做「清洗后照写」**。
78
+
79
+ > **为什么不做清洗后照写**:那等于悄悄改数据,并丢失「曾出现脏 fact」这一诊断事实。
80
+ > 本项目纪律是 **fail-soft 必须留痕、不得静默改写**。
81
+
82
+ ---
83
+
84
+ ## 3. 系统的实际形态(截至 3.0.0)
85
+
86
+ ### 3.1 规模(全部经代码自核)
87
+
88
+ | 项 | 数量 | 说明 |
89
+ |---|---|---|
90
+ | 模型工具 | **17** | 15 个基础 + 2 个条件注册(`memory_expand_pre` / `memory_trace_pre` 仅在 `boardMode=graph` 时注册) |
91
+ | HTTP 路由 | **49** | 全部 loopback-only;插件层外部访问返回 403,宿主层为 401——**两者都是预期行为** |
92
+ | 设置键 | **98** | 其中 **60** 个可在设置页写入 |
93
+ | 面板页签 | **12** | 概览 / 日志 / 唤起回顾 / 记忆中枢 / 存储管理 / 笔记 / 白板 / 反思 / 接续 / 日历 / 检索 / 工作区 |
94
+ | 插槽注册 | **6** | 侧栏入口 / 浮层面板 / 弹窗 / 接续卡 / 设置分区 / 会话页看板 |
95
+ | 运行时依赖 | **0** | 本插件自身不引入任何 npm 运行时依赖 |
96
+ | 浏览器侧 | 单文件 | `lib/client.js`,纯 ESM,**无构建步骤** |
97
+
98
+ ### 3.2 两条线
99
+
100
+ - **pre 开发线**(本仓):profile 以 `link:` 挂载 ⇒ **开发树就是活的宿主代码**
101
+ - **REL 发布线**(`_publish_dsh-auto-memory`):发布时做 `_pre` 后缀擦除与残留闸门
102
+
103
+ > ⚠️ **「PR merge ≠ 修复落地」的结构性根源**:仓内裸名 `lib/*.js` 是历史遗留的**互引孤岛**
104
+ > (零活引用,唯一例外 `ws-overview-rank.js`),宿主只 import `-pre.js` 版本。
105
+ > **改错副本 = 改了不生效。** 这是本仓最易踩的坑,已写入约束清单。
106
+
107
+ ---
108
+
109
+ ## 4. 已知边界(诚实清单)
110
+
111
+ ### 4.1 特性默认值(★ 3.0.0 起有翻转,旧文档口径已失效)
112
+
113
+ > **警告**:本表在 3.0.0 有过一次**批量默认值翻转**。任何沿用 3.0 之前口径的文档
114
+ > (包括早期 README 与第三方说明)都会写错。以下数值**经代码自核**
115
+ > (`tools/verify-defaults.mjs` / `tools/verify-experimental.mjs`)。
116
+
117
+ | 特性 | 键 | **当前默认** | 备注 |
118
+ |---|---|---|---|
119
+ | 交接白板 + 账本 | `handoffEnabled` | **`true`(开)** | ★ 3.0.0 由 `false` **翻转为 `true`** |
120
+ | 白板看板(5 泳道) | `boardMode` | `'graph'` | 默认新版看板 |
121
+ | 水位测量窗口 | `waterLevelWindowTokens` | `0` | `0` = 自动沿用官方窗口容量 |
122
+ | 水位阈值 | `waterLevelThreshold` | `0.75` | — |
123
+ | 水位提示 | `waterLevelAdvisory` | `true` | — |
124
+ | 水位自动写账本 | `waterLevelAutoHandoff` | `true` | — |
125
+ | **自动接续** | `autoContinueEnabled` | **`false`(关)** | 与白板**已解耦**,各自独立 |
126
+ | 自动固化 | `autoConsolidate` | `true` | — |
127
+ | Tier-0 常驻目录 | `tier0CatalogEnabled` | `true` | 预算 400 tok / 占比 25% |
128
+ | 注入总开关 | `injectEnabled` | `true` | 预算 8000 字符 |
129
+ | 记忆中枢 | `memoryHubEnabled` | `true` | — |
130
+ | **机械流程切片** | `hubMechanicalProcedureFeedEnabled` | **`false`(关)** | T10 关停;向导内有标「不推荐」的回退开关 |
131
+ | 主动联想 | `associativeMemoryEnabled` | `false`(关) | 需显式开启 |
132
+ | 无人值守 | `unattendedMode` | `false`(关) | — |
133
+ | 容量上限 | `noteCapacityChars` / `userCapacityChars` | 各 **24000** | 2026-09-18 由 12000 上调 |
134
+
135
+ **白板默认翻转的理由**(代码注释原文):README 与用户手册早已对外声称「交接默认开启」,
136
+ 而代码默认是关——**文档与实现长期不一致**;且白板/账本是 3.0 的招牌能力,
137
+ 出厂关着等于新用户看不到它。
138
+
139
+ > **这条本身就是「约束不落纸」的又一个样本**:文档写「默认开」、代码写「默认关」,
140
+ > 双方各自都以为自己是权威,一直没人发现。
141
+
142
+ ### 4.2 有测试、无接线
143
+
144
+ 项目内发现**一套协议库三件套**(acceptance / ledger-criteria / state-commit)
145
+ 被 smoke 测试养着,但 `index.js` **未引用**。属「有测试、无接线」——
146
+ 留作后续整合,当前不影响功能。
147
+
148
+ ### 4.3 两条路由无 UI 消费者
149
+
150
+ `/subagent-gc` 与 `/activation-inbox-pre`:**能力在、UI 未接**。
151
+
152
+ ### 4.4 前端回归网极薄
153
+
154
+ 146 个测试套件里,**仅 3 个**断言 React 组件行为。
155
+ 这意味着**前端改动几乎不受回归保护**——重构前需先补特征化测试。
156
+ (这也是「前端交给社区共创」的前提条件之一,见 `FRONTEND-CO-CREATION.md`。)
157
+
158
+ ### 4.5 授权边界
159
+
160
+ | 资产 | 许可 | 说明 |
161
+ |---|---|---|
162
+ | 本项目代码 | BSD-3-Clause | — |
163
+ | 角色设定「溟月」 | **CC BY-NC-SA 4.0** | 原作者 **上善无形**;**非商业 + 相同方式共享**,比代码许可更严格 |
164
+ | 参考项目(RhineLabUI 等) | MIT | **仅覆盖其程序代码**,不覆盖 3D 模型 / Blender 工程 / 原片素材 / 游戏品牌 |
165
+
166
+ > **角色许可与代码许可是两件独立的事,不可合并成一句「本项目采用 XX 许可」。**
167
+
168
+ ---
169
+
170
+ ## 5. 写给后续写入者(约束清单)
171
+
172
+ 任何新增**写入路径**的人(包括 AI 自己)请逐条自查:
173
+
174
+ - [ ] **三面同时满足**:注入面干净、检索面锚点完好、语义面 digest 正确失效
175
+ - [ ] **走写原语**:不绕过 `appendText` / `writeFull` 的校验与事务
176
+ - [ ] **fail-soft 必须留痕**:禁止静默吞异常(本项目有 `DEGRADE_RING` 降级台账)
177
+ - [ ] **不得静默改写**:脏数据 `skip` 并留痕,不要「清洗后照写」
178
+ - [ ] **改对副本**:`-pre.js` 才是活代码,裸名文件是孤岛
179
+ - [ ] **配置写入唯一出口**:`saveConfigPatch` → `POST /config`
180
+ - [ ] **开关解耦**:单开关不得顺带改变其它功能行为
181
+ - [ ] **新旧并存**:已发布的 3.0.0 有真实用户 ⇒ 必须保留开关回退路径
182
+
183
+ ---
184
+
185
+ ## 6. 本白皮书与其它文档的分工
186
+
187
+ | 文档 | 回答什么 |
188
+ |---|---|
189
+ | **本文** | 「有哪些**不能违反**的约束、哪些**已知边界**」 |
190
+ | `FEATURE-INVENTORY.md` | 「有哪些功能、住在哪一行」 |
191
+ | `ARCHITECTURE-FOR-ZCODE-20260920.md` | 「代码结构是怎样的」 |
192
+ | `M7-RESEARCH-PAPER.md` | 「为什么这样设计、实验数据如何」 |
193
+ | `FRONTEND-CO-CREATION.md` | 「外部贡献者能改什么、怎么改」 |
194
+
195
+ ---
196
+
197
+ ## 7. 结论
198
+
199
+ 本项目的「完工」有两层含义:
200
+
201
+ - **功能层面的完工**:功能已稳定,3.0.0 已发布,全量回归 PASS。
202
+ - **认知层面的完工**:**本文** —— 把约束与边界写下来,让后续任何人(含 AI)
203
+ 不必靠口口相传就能避开已知的雷。
204
+
205
+ > **约束不落纸,就一定会再被违反一次。**
206
+
207
+ 这句话是本文存在的全部理由。