dsh-spirit 0.2.0 → 0.3.0

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 (68) hide show
  1. package/CHANGELOG.en.md +20 -0
  2. package/CHANGELOG.md +176 -0
  3. package/README.en.md +9 -0
  4. package/README.md +5 -0
  5. package/dist/client.js +3329 -109
  6. package/dist/config.d.ts +1 -1
  7. package/dist/config.js +67 -0
  8. package/dist/contract.d.ts +477 -24
  9. package/dist/contract.js +67 -3
  10. package/dist/db/migrate.js +35 -0
  11. package/dist/db/schema.d.ts +10 -3
  12. package/dist/db/schema.js +109 -4
  13. package/dist/distill/llm.d.ts +56 -0
  14. package/dist/distill/llm.js +109 -0
  15. package/dist/distill/prompts.d.ts +60 -0
  16. package/dist/distill/prompts.js +175 -0
  17. package/dist/distill/ruminate.d.ts +82 -0
  18. package/dist/distill/ruminate.js +346 -0
  19. package/dist/dream/dream.d.ts +70 -0
  20. package/dist/dream/dream.js +156 -0
  21. package/dist/drsc/client.d.ts +18 -2
  22. package/dist/drsc/client.js +20 -4
  23. package/dist/drsc/probe.d.ts +7 -0
  24. package/dist/drsc/probe.js +9 -0
  25. package/dist/embed/probe.d.ts +48 -0
  26. package/dist/embed/probe.js +91 -0
  27. package/dist/embed/remote.d.ts +58 -0
  28. package/dist/embed/remote.js +149 -0
  29. package/dist/experience/render.js +9 -1
  30. package/dist/hooks/persona-section.d.ts +6 -0
  31. package/dist/hooks/persona-section.js +11 -8
  32. package/dist/index.js +142 -3
  33. package/dist/persona/markdown.d.ts +27 -0
  34. package/dist/persona/markdown.js +175 -0
  35. package/dist/persona/render.d.ts +12 -0
  36. package/dist/persona/render.js +25 -0
  37. package/dist/persona/store.d.ts +50 -7
  38. package/dist/persona/store.js +206 -7
  39. package/dist/persona/types.d.ts +3 -0
  40. package/dist/persona/types.js +15 -1
  41. package/dist/prime/client.d.ts +75 -0
  42. package/dist/prime/client.js +156 -0
  43. package/dist/prime/sync.d.ts +74 -0
  44. package/dist/prime/sync.js +116 -0
  45. package/dist/rpc.d.ts +31 -1
  46. package/dist/rpc.js +368 -30
  47. package/dist/sea/scene.d.ts +116 -0
  48. package/dist/sea/scene.js +253 -0
  49. package/dist/stats.d.ts +1 -0
  50. package/dist/stats.js +3 -0
  51. package/dist/store/edges.d.ts +63 -0
  52. package/dist/store/edges.js +146 -0
  53. package/dist/store/experience.d.ts +109 -1
  54. package/dist/store/experience.js +423 -19
  55. package/dist/store/insights.d.ts +53 -0
  56. package/dist/store/insights.js +131 -0
  57. package/dist/store/owner.d.ts +67 -0
  58. package/dist/store/owner.js +179 -0
  59. package/dist/store/topics.d.ts +55 -0
  60. package/dist/store/topics.js +133 -0
  61. package/dist/tools/selfname.d.ts +10 -0
  62. package/dist/tools/selfname.js +84 -0
  63. package/dist/types.d.ts +26 -1
  64. package/dist/types.js +13 -1
  65. package/dist/words.d.ts +10 -1
  66. package/dist/words.js +29 -1
  67. package/dsh.plugin.json +2 -2
  68. package/package.json +126 -126
package/CHANGELOG.en.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to this project are documented here. Versioning is semantic.
4
4
 
5
+ ## Unreleased
6
+
7
+ ### Fixed
8
+
9
+ - **History recall gained a scan window (`LOCAL_SCAN_LIMIT` = 5000 rows)**: `LIKE '%…%'` cannot use
10
+ an index and `LIMIT` truncates the output, not the scan — because the store is append-only and
11
+ never deletes rows, the cost of one lookup grew with total row count. Worse, this lookup runs
12
+ **synchronously** on `agent/pre-step`: `recall.timeoutMs` only covers the async DRSC call and does
13
+ **not** protect local SQLite. It now takes the most recent N rows as a candidate pool and filters
14
+ within it — bounded cost, and byte-for-byte equivalent when the table is smaller than the window
15
+ (regression tests pin this). Cross-session tone anchoring uses the same window.
16
+ - **Degraded-mode wording completed**: the in-memory mirror is memory-only (capped at 200 rows, no
17
+ path back into the DB) — entries recorded while degraded are **not recoverable after a restart**.
18
+ Earlier text only said "history and cross-session stop", which reads like "you merely lose history".
19
+ - **Panel now shows the DRSC projected segment count**: `ok` + **0 segments** means "connected, but
20
+ the projection DB has no content yet". Previously the panel said only "available", which made a
21
+ silent-empty state look healthy. It is deliberately not raised to `warn` (that would produce a
22
+ screenful of false alarms); the count is simply shown, and when the probe has no value nothing is
23
+ shown (**unknown is not zero**).
24
+
5
25
  ## 0.1.0
6
26
 
7
27
  First usable release: **a first-person experience entry store plus dual-lane instant recall**.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,182 @@
2
2
 
3
3
  本项目的所有值得记录的变更都写在这里。版本号遵循语义化版本。
4
4
 
5
+ ## Unreleased
6
+
7
+ ### 修正
8
+
9
+ - **检索有扫描窗(`LOCAL_SCAN_LIMIT` = 5000 行)**:`LIKE '%…%'` 用不上索引、`LIMIT` 只截输出
10
+ 不截扫描,而本库 append-only 且只归档不删行 ⇒ 单次检索的成本原本与库总行数成正比。更关键的是
11
+ 这条检索**同步**跑在 `agent/pre-step` 上,`recall.timeoutMs` 只包 DRSC 那次异步检索、**管不到
12
+ 本地 SQLite**。现改为「先取最近 N 条做候选池,再在其上过滤」:代价有界,行数小于窗时与全表
13
+ 逐行等价(有回归用例钉住)。跨会话基调的会话定位同窗。
14
+ - **降级表述补全**:内存镜像只在内存(上限 200 条、无回灌库路径)——降级期间记下的条目在重启后
15
+ **不可恢复**。此前对外只说“停历史与跨会话”,读起来像“只是少了历史”。
16
+ - **面板显示 DRSC 已投影段数**:`ok` + **0 段** = 「连上了但库里还没有内容」,此前只显示“可用”,
17
+ 把静默为空读成了功能正常。不升 `warn`(那会造一屏假故障),只把 0 显示出来;未探到 ⇒ 不显示
18
+ (**未知不当 0**)。
19
+
20
+ ## 0.3.0
21
+
22
+ 记忆星海:把体验库投影成一张能转的三维星图。**只读投影,不是可查询图谱**(不开写图面、
23
+ 不改 DB schema(仍 v2)、不引入任何渲染库),入口挂在顶部两席位(`sidebar.panellist` + `main`)。
24
+
25
+ ### 新增
26
+
27
+ - **`sea-graph`(只读)**:`listRecent(limit, { includeSuperseded })` 取全库最近 ≤3000 条(带 `LIMIT`:
28
+ 本库只归档不删行,无顶就是随使用时长线性变慢),`src/sea/scene.ts` 纯函数算出点/边/统计。
29
+ 边只允许三类且各自分色分线型:共享 cue / 时间邻近 / 取代链;每点 ≤6 边、全图 ≤6000 边。
30
+ - **编码规则(一个量只编码一次)**:颜色 = trigger 族(**不随主题变**),亮度 = 老化权重,
31
+ 半径 = salience,★ = feedback;`tier`(full/gist/held)与注入侧同公式同阈值,它只门控“能不能发光”。
32
+ - **两种组织方式**(面板「组织」切换,存 localStorage):`双极`(高度 = 归属轴,她 +Y / 主人 −Y,
33
+ 两极与主轴真画出来)与 `星盘`(中心 = 她,半径 = 多淡,相位 = 时间次序螺线,差速旋转 + 相位滞后自然成旋臂)。
34
+ - **渲染层双后端可插拔**:Canvas2D 为交付下限(光晕走**预渲染 sprite** + `lighter` 叠加,禁止逐帧
35
+ `createRadialGradient`);WebGL2 为可选加速(≥1500 点自动升,或用户开「高质量辉光」),
36
+ 中文标签固定叠 2D 层,`webglcontextlost` 当场回退 2D(切换必须换新 canvas 元素)。
37
+ - **人设管理接出已有写面**:`persona-preview`(不写盘)/ `persona-set`(`expectedRevision` 乐观并发)/
38
+ `persona-history` / `persona-restore`(回退也是**追加新 revision**,历史一行不改);面板内可改
39
+ 名字/语气/在意度/在意面,保存前能看见将要注入的原文与字节预算。
40
+
41
+ ### 增补(0.3.0-local.2 / local.3,用户实机反馈后追加)
42
+
43
+ - **靠近激活闪烁(proximity 场)**:对照姊妹包 prime-memory 的图交互——鼠标拂过一片星时
44
+ 半径(90px)内的星逐个拿脉冲辉光(相位用每点 `phase`,不同步闪),而不是只有 16px
45
+ 拾取命中的那一颗有反应;纯函数 `proxBoost` 两后端共用,带 4 例单测(含“齐闪像加载
46
+ 动画”的反例门禁)。
47
+ - **手记改名「灵-鱼的手记」并升级为结构卡片**(对照 prime-memory explorer 的字段分层):
48
+ 徽章行(类型/来源路/在意度/★)→ 正文 → gist 斜体行 → **线索 chips** → 元信息行(轮次·
49
+ 时间·在意面)。线索来自 `experience_cues`,`journal-tail` 行与 `sea-graph` 点**同批下发**
50
+ (≤4 条,不给前端二次请求拼证据面);星海详情卡同样挂线索 chips。在意面徽章单源
51
+ `sea-labels.NOTICE_LABEL`(手记与人设面共用,不给主人看 slug)。
52
+
53
+ ### 增补(0.3.0-local.4,人设进库 + markdown 备份可恢复)
54
+
55
+ - **人设从纯文件迁进 SQLite(schema v3,正向迁移)**:`persona_current`(单行表,
56
+ `CHECK(singleton=1)` 形状即约束)为权威当前位,`persona_revision` 为 append-only 全量
57
+ 历史——历史不再受 256KB 尾窗限制,超窗老版也能按 revision 找回。首次打开时若库里空而
58
+ `persona.json` 存在,自动一次性迁入(原文件不动,留作事故现场);DB 不可用时退回现行
59
+ 文件路径,降级纪律与体验库一致。
60
+ - **每次成功保存自动写单层人话备份 `persona.md`**(文件本身就是恢复源,不嵌 JSON 区;
61
+ 内容零 slug,在意度/在意面/语气全用面板同串中文,词表漂移由门禁测试钉住)。
62
+ 备份写失败只告警不回滚已提交的 DB 事务——备份可滞后,权威不能跟丢。
63
+ - **新端点 `persona-export-md` / `persona-import-md`**:人设页新增「markdown 备份」区——
64
+ 查看/复制当前备份,粘贴改过的文本二次确认后恢复。恢复走 `save()` 唯一写路径 ⇒
65
+ **追加新 revision,历史一行不改**;解析失败整体拒绝并点名非法词,绝不部分恢复。
66
+ - 语气下拉与历史行改显中文(平实/简短/温和,`words.ts` 单源),不再给主人看 slug。
67
+
68
+ ### 增补(0.3.0-local.5 / local.6,主人背景档案:prime-memory 定期同步 + 双段编辑)
69
+
70
+ - **主人背景档案进库(schema v4,正向迁移)**:`owner_profile` 单行表,**双段写路径分离**——
71
+ 同步段(机器投影,整段覆盖)与自述段(主人手写,乐观并发 `expectedRevision`)各列各写,
72
+ 互不抹段;每次成功写入原子落 `owner.md`(双节人话备份)。
73
+ - **定期同步 prime-memory 的 person 实体**(只读消费,无编译期依赖):主路径同源 RPC
74
+ `dsh-memory/rpc/graph-preview` 种子榜取 person 清单,再逐 id `graph-node-get` 取全量详情
75
+ (真宿主实测定案:`graph-search` 空 query 永远返空、preview 的 full 块是轻量形状无 facts);
76
+ 渲染成“名称(别名):facts 摘要”清单(top 8、单条 ≤120 字),**不断言谁是主人**(图上无主人标记)。
77
+ 缺席/空图 ⇒ 跳过且**不清旧段**(拿不到源 ≠ 背景消失)。
78
+ - **三个触发入口共用 60s 去重窗**:日级定时器(缺省 24h,首跑 0–10min 抖动)、面板「立即同步」、
79
+ `owner-sync-ping`(事件接收预备:prime 侧后续“情景更新推送”打这里,推送只发信号不带数据)。
80
+ - **新端点四腿**:`owner-get` / `owner-set-self` / `owner-sync-now` / `owner-sync-ping`;
81
+ 人设页新增「主人档案」区(prime 三态状态行 + 同步段只读 + 自述段可编)。
82
+ - **注入稳定区新增主人段**(`[主人] 自述` 优先、`[主人的背景(同步)]` 次行):独立预算键
83
+ `owner.budgetBytes`(缺省 400B,不挤人格区);两段皆空物理离场;缓存键含同步时刻,
84
+ 后台同步的新段不会因 revision 未变而被旧缓存顶掉。
85
+ - **prime 未装完全不影响运行**(真宿主对照组实测):`owner-get` 报 `primeStatus:'absent'`、
86
+ 同步 `{updated:false, reason:'prime-absent'}`,无报错无重试风暴;解耦门禁同步演进:
87
+ 禁包引用/库直读不变,`dsh-memory/` 端点字面量收口到 `src/prime/client.ts` 单文件。
88
+
89
+ ### 增补(0.3.0-local.10,昵称序列 + 自称序列(模型经 spirit_selfname 工具自改))
90
+
91
+ - **人设卡加两条序列**:`aliases`(昵称:主人日常怎么喊这条鱼)与 `selfNames`(自称:鱼说话时用什么指代自己),
92
+ 去重保序、单条 ≤24 字、列表 ≤8;稳定区新增 `[昵称]`/`[自称]` 两行(名字后、语气前;空 ⇒ 整行物理离场,
93
+ 老卡逐字节不变);markdown 备份新增「昵称/自称」节(round-trip 无损,自由词只套上限不拒收);
94
+ 人设页两条输入行(、/逗号/分号/空白宽进)。
95
+ - **`spirit_selfname` 工具(用户点名:自称允许 LLM 自己改)**:模型可增删自称列表(用顺了新自称当场记下);
96
+ 这是人设面**唯一**对模型开放的写字段(名字/语气/在意度/价值/边界不开);护栏:走 save() 唯一写路径(revision 推进/历史留档/md 重生)、
97
+ 累积式无整表覆盖、列表有顶、部署总闸关 ⇒ 不注册。tools 服务缺席的老宿主线自动不挂(作域注入)。
98
+
99
+ ### 增补(0.3.0-local.16,语气扩到七档 + 长文本框自动长高)
100
+
101
+ - **语气档位 3→7**(用户点名:偏少):新增 俏皮/安静/直白/诗意 四档,每档有开口词与收尾词(只表态度不表事实);
102
+ 单源传导链验证:面板下拉/md 备份反查/稳定区 [语气] 行全部自动跟进;键集闸改单源比对(以后再扩列不用改闸)。
103
+ - **主人档案等同源长文本框自动长高**(用户点名:同步段钉死三行读不了):六处 textarea 统一换 AutoArea,
104
+ 随内容撑开封顶 480px 后内滚;只读同步段(拖拽手柄对只读框不可用)受益最明显。
105
+
106
+ ### 增补(0.3.0-local.12..15,长觉阶梯:主题分区 + 因果边 + LLM 蒸馏反刍 + 碰撞裁决 + 向量能力位)
107
+
108
+ - **三层记忆(schema v6,五张派生表 + entry_vector)**:工作记忆(experience,一字不动)→ 主题分区
109
+ (topic/experience_topic:cues×trigger 确定性骨架即时回填 + 长觉归题精修,改判写新行)→ 蒸馏记忆
110
+ (insight/causal_edge/sleep_run)。派生定性 action_bias 同构:可整表重算,**绝不进 recent()/deriveMood/注入**
111
+ (G15 结构闸 + 行为例:蒸完整轮后注入指纹逐字不变)。
112
+ - **长觉(RuminateRunner,缺省关)**:异步 LLM 归纳 pass——攒批(水位防重蒸)→ 调用#1 归题/洞察/因果提案
113
+ → 调用#2 碰撞去重 → 单事务落库;进度 phase/detail、软取消、退避 120s→15min(配置错误豁免)、去重窗 300s、
114
+ 连败 3 park。面板「做梦」tab 长觉块:一键跑 + 进度轮询 + 叫醒 + 上次长觉报告(含实际模型名)。
115
+ - **蒸馏模型可选(fail-closed)**:distill.{provider,model,reasoningEffort} 留空跟宿主默认(agentDefaultModel 宽容读),
116
+ 显式配了解析不到 ⇒ 拒蒸说人话,**绝不隐式改选**(G13 实闸:代码面不存在退默认分支);llm 缺席整条休眠(域注入,顶层 inject 不变)。
117
+ - **碰撞检查三层(用户点名)**:insight 同题矛盾 ⇒ conflict 双留(机器绝不自动删),翻阅 tab「线索头」视图里
118
+ 人工裁决(「信这条」/「都收起来」走 insight-resolve,只改状态位原文永在);证据条目被藏/取代 ⇒ 读侧 stale 传播(回场自愈);
119
+ 幻觉 id 校验丢弃(evidence 必须 ⊆ 本批)。
120
+ - **因果边**:启发式打底(失败→恢复「导致」)+ LLM 投影(四词单源 SPIRIT_CAUSAL_RELATIONS、只钳长度、
121
+ 显式陈述才写);星海 kind 扩 'causal'(橙实线图例在场才显),截断优先级 causal>cue>time(score 1.1 表达,既有边序零回归)。
122
+ - **向量能力位(缺省关)**:调研实锤 prime 无可借 embedding 服务——定案为「借档位(embedding-state-get 对齐
123
+ baseURL/模型/维度,key 自持)+ 缺席自启(纯 fetch OpenAI 兼容)+ BLOB+Float32Array 零新依赖」;
124
+ 两阶段检索只走冷路径;维度首建锁 meta,不一致显式报错不静默重建;G11 出站收口/G20 出境(prompt 不含用户原文)/
125
+ G24 凭据(apiKey 不回显不落日志)三道新闸落地。
126
+ - **新端点六腿**:`sleep-run/status/cancel/report` + `topics-get` + `insight-resolve`;settings 面加 distillEnabled 热更键。
127
+ - 对外语域仍是鱼/睡/梦:小盹=确定性整理,长觉=深睡想明白——没有「反刍/蒸馏管道」类机械词(R5 禁词族扩 sleep/topic/causal)。
128
+ - 桥 round-29 拓出并修复两枚同源 bug(受理路径自拦双变体):`run()` 预置 running / 预占去重窗后
129
+ 任务体再 precheck 会把自家受理拒掉——受理后专用体 `runAccepted()` 不再重检;回归钉进 distill.test。
130
+ 另补报告跨重启可读(status 懒 hydrate 自 meta,宿主重启后面板不致失忆)。
131
+
132
+ ### 增补(0.3.0-local.9,设置面可见性:睡眠开关 + 回响导航)
133
+
134
+ - **做梦开关进 volatile(六写点全套)**:`live.dreamEnabled`(缺省开)——宿主设置页自动表单与设置卡「睡眠(做梦)」块同时可见可热更;
135
+ 双闸取与(部署面总闸 ∧ live 闸),关闸后定时器空转、手动「让鱼睡一觉」拒并指路(reason:'disabled' 说出口)。
136
+ - **设置卡新增睡眠块**:自动做梦开关 + 上次梦境读数(时间/合并对数/在场数)+ 回响导航行(条目管理与手动做梦在「记忆星海」的 翻阅/做梦 tab)。
137
+
138
+ ### 增补(0.3.0-local.7 / local.8,翻阅 tab:prime 级条目管理面 + 做梦 + DRSC 缺席提示 + 设置卡瘦身)
139
+
140
+ - (local.8 重包)round-28 真浏览器拓出★继承假绿:`reviseEntry` 的 INSERT 没带 feedback_score 列,
141
+ ★只在返回对象里、库里新行是 NULL,刷新即蒸发——新增 REVISE_INSERT_SQL(17 列含 feedback_score),
142
+ 单测同步补**读回断言**(断返回对象不算数,断库里的行才算数)。
143
+
144
+ - **星海面板四 tab(星海/人设/翻阅/做梦)**:设置卡的记录检视整体迁到「翻阅」——
145
+ 搜索(扫描窗内 LIKE,截断如实报)/ 筛选(类型·来源·★·含更正史·藏起来的)/ 服务端分页
146
+ (limit=50 加载更多,hasMore 探界不做全表 COUNT)/ 就地详情 / 「这条重要」/ 导出入口。
147
+ - **藏起来 ⇄ 再想起(schema v5,正向迁移)**:`experience.hidden_at` 标记列——行永不物理删
148
+ (红线闸不变),藏后退出星海图/注入/手记缺省视图,「藏起来的」视图里可恢复。
149
+ - **更正式编辑(「理解变了」)**:插新行 + 旧行置 `superseded_by`(与更正同构,不原地改正文);
150
+ ★ 标记复制进新行,cues 拷贝,`source_ref=rev:<旧 id>`;编辑史以取代链形态在星海自然可见。
151
+ UPDATE 列白名单(superseded_by/updated_at/feedback_score/hidden_at)落成实闸,把 schema
152
+ 注释里声称却不存在的那道纸面闸补成了真闸。
153
+ - **让鱼做梦(确定性整理 pass,零模型调用)**:等值查重合并 + 归档淡出(尊重部署面 dryRun)
154
+ + 梦境报告(合并/归档/在场/幽灵/★/档位读数)落 meta;「让鱼睡一觉」手动按钮 + 日级定时器
155
+ (owner 同款骨架),三入口共用 60s 去重窗;报告不进系统提示。
156
+ - **DRSC 缺席提示(照 prime banner 口径,按 spirit 探测能力封顶两档)**:设置卡 verdict 行下
157
+ warn 态出「影响说明 + 可复制指引」(clipboard 失败退全选,绝不自动执行);skipped 中性不渲染;
158
+ 星海顶栏消息带同位短提示(判定单源在 sea-graph 响应的 drscVerdict 字段)。
159
+ - **设置卡瘦身**:只留运行读数 + 淡出表单 + 导出 + 重试,不再逐轮拉条目;UI 可达性实闸
160
+ (settings-set/journal-export/experience-feedback 必须在 client 源码有引用)防「契约在、UI 没了」。
161
+ - **拟人化文案纪律(R5)**:新机制文案统一鱼的第一人称行为语言(「藏起来」「再想起」「理解变了」
162
+ 「让鱼睡一觉」「鱼梦见了…」),新前缀键(rec/dream/drscHint)禁机械词实闸;词表目录首屏下发,
163
+ client 不手抄枚举。
164
+
165
+ ### 修正
166
+
167
+ - **图上亮度与注入侧分两把尺**(新键 `sea.agingHalfLifeMs`,缺省 7 天):拿 1.5h 的注意力窗口算跨月库
168
+ 会得到“全图都是暗星”(真浏览器实测 `fade` = 0/0/3000);`tier` 仍用小时尺度,因为它的语义就是
169
+ “还在不在注意力窗口里”。
170
+ - **亮度带基座、暗星有地板**:指数衰减动态范围极大(跨月 ÷ 7 天 ≈ 15 个半衰期),从 0 起算会让
171
+ 90% 的点在暗背景上隐形。遗忘是“沉下去”,不是“看不见”。
172
+ - **经度不再按类型分扇区**:`axisOf` 已按 trigger 给基值,经度再按 trigger 分角度就是把同一个量画两次
173
+ (同类排成纬线弧带,读图者会把高度误读成类型);改为 id 哈希铺满整圈 + 正弦弱吸引(线性插值会在
174
+ 基准角对面留出一段无点空弧)。
175
+
176
+ ### 性能
177
+
178
+ 真浏览器实测(Canvas2D,单帧 CPU):300 点 1.29ms、1000 点 5.32ms、3000 点 10.7ms(关边)/ 14.7ms(开边);
179
+ WebGL2 3000 点 4.5–5.1ms(与 2D 同视角对拍验证过色带分群/边网密度逐层一致)。产物增量:`dist/client.js` 24.6KB → 114.8KB(无第三方渲染库,react 仍走 external)。
180
+
5
181
  ## 0.2.0
6
182
 
7
183
  主体性流程记录:**遗忘作为设计**——滑窗淡出、未竟账、条件化、反馈重排,四件全部**缺省关**(灰度闸链:
package/README.en.md CHANGED
@@ -87,6 +87,10 @@ only the live recency lane runs — no errors, nothing invented. spirit calls on
87
87
  and the character has no feelings" happens silently.
88
88
  - **A broken store does not mean no feelings**: if `node:sqlite` is unavailable, entries fall back to
89
89
  an in-memory mirror — this turn's state is still injected, history and cross-session tone stop.
90
+ ⚠️ The mirror is memory-only (capped at 200 rows, **no path back into the DB**): entries recorded
91
+ while degraded do not survive a restart. The "storage unavailable" panel line says exactly this.
92
+ The plugin does not retry reopening in a loop (bounded failure beats infinite restart); restart
93
+ the host to recover.
90
94
  - **Off really means zero bytes**: the host was measured on two arms — installed with
91
95
  `enabled: false` versus not installed at all — pairing request bodies by kind. spirit contributes
92
96
  0 bytes (no injected row, no persona section, identical `system`). The only 40 B difference comes
@@ -138,6 +142,11 @@ not render an automatic volatile form, so those keys are not on the settings pag
138
142
 
139
143
  ## Known limits (v0.1)
140
144
 
145
+ - History recall has a **scan window**: the candidate pool is the most recent 5000 rows. `LIKE '%…%'`
146
+ cannot use an index, the store is append-only (rows are never deleted), and this lookup runs
147
+ **synchronously** on pre-step — `recall.timeoutMs` only covers the async DRSC call, not local
148
+ SQLite. Older entries are reachable through journal paging / export, not automatic recall
149
+
141
150
  - No long-range emotion retrieval, knowledge graph, conflict adjudication or persona self-evolution
142
151
  (that is memory-engine and dsh-soul territory)
143
152
  - Neutral turns are not recorded by default (`salience.neutral = 0`), otherwise the store degrades
package/README.md CHANGED
@@ -75,6 +75,8 @@ spirit 只调用它的 `op` 面(`status` / `session` / `search`),**从不
75
75
  - **卡是否还作数,看会话日志而不是猜**:注入行要真进日志才算生效;压缩/清空会把"已发过"的凭据重置,
76
76
  否则就是"压缩一次,角色再也没情绪了"——而且不报错。
77
77
  - **库坏了不等于没情绪**:`node:sqlite` 不可用就退内存镜像,本轮状态照常出卡,只停历史与跨会话。
78
+ ⚠️ 镜像只在内存(上限 200 条,**没有回灌库的路径**):降级期间记下的条目在重启后不会回来。
79
+ 面板「存储不可用」那行就是在说这件事;本仓不自动反复重开库(有界失败优于无限重试),要恢复就重启宿主。
78
80
  - **关掉就是零字节**:真机把“装了但 `enabled:false`”与“根本没装”两臂的请求体逐类配对比过,
79
81
  spirit 自身贡献 0 字节(无注入行、无人格区、`system` 完全相同);唯一的 40B 差异来自宿主
80
82
  自己列出的已安装插件清单(那是宿主行为,与插件启停无关)。
@@ -165,6 +167,9 @@ grep 断言同装跑真回合。但对方证据面**原样收 assistant 发言**
165
167
 
166
168
  - 不做长期情绪检索的**语义层**(矛盾裁决、图谱、人设自动演化仍不在——淡出/gist 是注入侧形态,
167
169
  不是新的事实索引);条目库依旧不建 FTS5
170
+ - 历史检索有**扫描窗**:候选池只取最近 5000 条再过滤。理由是 `LIKE '%…%'` 用不上索引、库
171
+ append-only 且永不删行,而这条检索在 pre-step 上**同步**执行(`recall.timeoutMs` 只包 DRSC
172
+ 那次异步检索,管不到本地 SQLite)。超过这个量的旧条目走「手记」分页与导出,不进自动回忆
168
173
  - 淡出/未竟账/条件化三面**缺省全关**:实机最佳参数集尚未观察出来;开了的单会话数据只进
169
174
  派生表与卡文本,关闸后行为与 v0.1 逐字节一致(有回归用例钉住)
170
175
  - 中性轮默认不记(`salience.neutral = 0`),否则库会退化成逐轮流水账