@jjh32456/dsh-longlive 1.6.7 → 1.8.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 (289) hide show
  1. package/CHANGELOG.md +70 -1508
  2. package/LICENSE +1 -1
  3. package/QUICKSTART.md +34 -13
  4. package/README.en.md +18 -7
  5. package/README.md +34 -9
  6. package/SPEC.md +5 -5
  7. package/cordis.patch.yml +23 -9
  8. package/docs/ANSWER-GUARD.md +92 -0
  9. package/docs/ARCHITECTURE.md +4 -3
  10. package/docs/AUTO-RECALL-WIRING.md +1 -1
  11. package/docs/AUTO-RECALL.md +15 -9
  12. package/docs/CONFIG.md +168 -35
  13. package/docs/ERRORS.md +17 -5
  14. package/docs/FAQ.md +7 -7
  15. package/docs/FEATURES.md +96 -28
  16. package/docs/MIGRATION-1.6.0.md +2 -2
  17. package/docs/OPERATIONS.md +6 -6
  18. package/docs/PANEL-INTEGRATION.md +6 -0
  19. package/docs/PRIVACY.md +88 -0
  20. package/docs/QUICKSTART.md +5 -5
  21. package/docs/README.en.md +4 -2
  22. package/docs/RESIDENT-WATCHER.md +1 -1
  23. package/docs/SESSION-WATCH.md +6 -6
  24. package/docs/TROUBLESHOOTING.md +4 -4
  25. package/package.json +47 -117
  26. package/runbook.md +2 -2
  27. package/scripts/backfill-auto-cards.mjs +98 -0
  28. package/scripts/install-surgery-task.ps1 +5 -2
  29. package/scripts/lib/session-watch-fixture.mjs +1 -1
  30. package/scripts/longlive-doctor.mjs +6 -0
  31. package/scripts/migrate-180.mjs +163 -0
  32. package/scripts/recall-index-build.mjs +128 -0
  33. package/scripts/session-watch-drill.mjs +1 -1
  34. package/scripts/surgery-run.cmd +1 -1
  35. package/scripts/unattended-surgery.ps1 +5 -2
  36. package/scripts/verify-card-anchors.mjs +138 -0
  37. package/src/actions/audit.js +125 -0
  38. package/src/actions/evidence.js +122 -0
  39. package/src/actions/fs.js +162 -0
  40. package/src/activity/index.js +760 -0
  41. package/src/activity/model.js +351 -0
  42. package/src/activity/store.js +644 -0
  43. package/src/activity/thinking.js +176 -0
  44. package/src/adapters/constants.js +11 -0
  45. package/src/adapters/engram/data/aliases.json +51 -0
  46. package/src/adapters/engram/data/policy.json +8 -0
  47. package/src/adapters/engram/data/routing-rules.json +546 -0
  48. package/src/adapters/engram/index.js +235 -0
  49. package/src/adapters/registry.js +315 -0
  50. package/src/answer/audit.js +193 -0
  51. package/src/answer/evidence.js +30 -0
  52. package/src/answer/guard.js +1370 -0
  53. package/src/answer/index.js +1067 -0
  54. package/src/answer/query.js +111 -0
  55. package/src/answer/second-hop.mjs +101 -0
  56. package/src/auto-truncate.js +1 -1
  57. package/src/config.js +171 -47
  58. package/src/deps.js +6 -4
  59. package/src/features.js +182 -6
  60. package/src/heartbeat.js +156 -23
  61. package/src/identity/handover.js +52 -1
  62. package/src/identity/index.js +13 -5
  63. package/src/identity/inject-position.js +2 -2
  64. package/src/index.js +97 -7
  65. package/src/lifecycle/gap-clocks.js +328 -0
  66. package/src/lifecycle/index.js +269 -0
  67. package/src/live.js +22 -2
  68. package/src/memory/activity-capture.js +229 -0
  69. package/src/memory/anchors.js +194 -0
  70. package/src/memory/audit-records.js +222 -0
  71. package/src/memory/auto-cards.js +401 -0
  72. package/src/memory/capture.js +442 -0
  73. package/src/memory/card-anchors.js +203 -0
  74. package/src/memory/conflicts.js +106 -0
  75. package/src/memory/decay.js +311 -0
  76. package/src/memory/distill.js +471 -0
  77. package/src/memory/event-index.js +917 -0
  78. package/src/memory/evidence-chain.js +295 -0
  79. package/src/memory/evidence.js +145 -0
  80. package/src/memory/filter-runner.js +1 -1
  81. package/src/memory/filter.js +5 -1
  82. package/src/memory/forget-v2.js +410 -0
  83. package/src/memory/forget.js +71 -0
  84. package/src/memory/frames-activation.js +247 -0
  85. package/src/memory/fts-query.js +174 -0
  86. package/src/memory/governance.js +604 -0
  87. package/src/memory/index.js +1 -0
  88. package/src/memory/l2-gate.js +169 -0
  89. package/src/memory/lock.js +121 -0
  90. package/src/memory/migrate.js +139 -0
  91. package/src/memory/recall-v2.js +223 -0
  92. package/src/memory/recall.js +65 -2
  93. package/src/memory/records.js +425 -0
  94. package/src/memory/retention.js +128 -0
  95. package/src/memory/review.js +124 -0
  96. package/src/memory/trust.js +88 -0
  97. package/src/memory/version-chain.js +264 -0
  98. package/src/memory/wal.js +137 -0
  99. package/src/memory/working-frame.js +516 -0
  100. package/src/metrics/classify.mjs +5 -3
  101. package/src/metrics/index.mjs +21 -1
  102. package/src/metrics/prestep-latency.mjs +300 -0
  103. package/src/metrics/store.mjs +25 -0
  104. package/src/policy-profile.js +18 -3
  105. package/src/recall/anaphora.mjs +87 -0
  106. package/src/recall/cards.mjs +7 -0
  107. package/src/recall/embedding.mjs +8 -8
  108. package/src/recall/entities.mjs +112 -0
  109. package/src/recall/index.js +235 -19
  110. package/src/recall/inject-order.mjs +10 -8
  111. package/src/recall/privacy.mjs +105 -16
  112. package/src/recall/recall-core.mjs +116 -10
  113. package/src/recall/shared-visibility.js +302 -0
  114. package/src/recall/time-normalizer.mjs +196 -0
  115. package/src/role/activation.js +191 -0
  116. package/src/role/attention.js +318 -0
  117. package/src/role/base.js +36 -0
  118. package/src/role/channels.js +423 -0
  119. package/src/role/index.js +425 -0
  120. package/src/role/interfaces.js +115 -0
  121. package/src/role/personality.js +370 -0
  122. package/src/role/readers.js +151 -0
  123. package/src/role/relationships.js +477 -0
  124. package/src/role/store.js +202 -0
  125. package/src/role/writeprotect.js +373 -0
  126. package/src/router/aliases.json +176 -25
  127. package/src/router/background/agent-runner.mjs +1 -1
  128. package/src/router/background/anchor.mjs +1 -1
  129. package/src/router/background/audit.mjs +2 -2
  130. package/src/router/background/budget-ledger.mjs +2 -2
  131. package/src/router/background/host-sim.mjs +1 -1
  132. package/src/router/background/memory.mjs +4 -4
  133. package/src/router/background/queue.mjs +1 -1
  134. package/src/router/background/retry.mjs +1 -1
  135. package/src/router/background/router.mjs +1 -1
  136. package/src/router/background/stream.mjs +1 -1
  137. package/src/router/background/tool-policy.mjs +1 -1
  138. package/src/router/design-headings.json +5 -5
  139. package/src/router/face/config.mjs +1 -1
  140. package/src/router/face/identity.mjs +3 -3
  141. package/src/router/judge.mjs +8 -7
  142. package/src/router/policies/generic.json +21 -4
  143. package/src/router/route.js +109 -22
  144. package/src/router/router.mjs +10 -6
  145. package/src/router/routing-rules.json +260 -445
  146. package/src/router/run-sim.mjs +8 -8
  147. package/src/router/runtime.js +23 -12
  148. package/src/router/service/board.mjs +95 -15
  149. package/src/router/service/config.mjs +5 -5
  150. package/src/router/service/context.mjs +1 -1
  151. package/src/router/service/hint.mjs +14 -0
  152. package/src/router/service/queue.mjs +1 -1
  153. package/src/router/service/service.mjs +27 -11
  154. package/src/router/shadow.mjs +4 -3
  155. package/src/surgery-recovery.js +2 -2
  156. package/src/tool-output.js +2 -2
  157. package/src/tools.js +39 -7
  158. package/src/truncate-visible.js +2 -2
  159. package/src/ui/actions.js +1312 -0
  160. package/src/ui/panel-api.js +367 -0
  161. package/src/ui/panel-auth.js +251 -0
  162. package/src/ui/panel-integrity.js +243 -0
  163. package/src/ui/routes-readonly.js +695 -0
  164. package/src/ui/routes.js +3 -0
  165. package/docs/DEV.md +0 -279
  166. package/docs/PRESENCE-BUS-WIRING.md +0 -491
  167. package/docs/PRESENCE-BUS.md +0 -694
  168. package/docs/SURGERY.md +0 -186
  169. package/scripts/mark-core-cards.mjs +0 -289
  170. package/scripts/pack.mjs +0 -392
  171. package/scripts/router-proposals.mjs +0 -386
  172. package/src/router/fixtures/M1.json +0 -16
  173. package/src/router/fixtures/M2.json +0 -16
  174. package/src/router/fixtures/M3.json +0 -20
  175. package/src/router/fixtures/M4.json +0 -20
  176. package/src/router/fixtures/M5.json +0 -45
  177. package/src/router/fixtures/M6.json +0 -53
  178. package/src/router/fixtures/M7.json +0 -46
  179. package/src/router/fixtures/S1.json +0 -20
  180. package/src/router/fixtures/S2.json +0 -23
  181. package/src/router/fixtures/S3.json +0 -20
  182. package/src/router/fixtures/S4.json +0 -34
  183. package/src/router/fixtures/S5.json +0 -43
  184. package/src/router/fixtures/S6.json +0 -47
  185. package/src/router/fixtures/T1.json +0 -23
  186. package/src/router/fixtures/T2.json +0 -16
  187. package/src/router/fixtures/T3.json +0 -19
  188. package/src/router/fixtures/T4.json +0 -16
  189. package/src/router/fixtures/X1.json +0 -17
  190. package/src/router/fixtures/X2.json +0 -20
  191. package/src/router/gen-design-headings.mjs +0 -107
  192. package/src/router/policies/owner-rulings-2026-11-03.json +0 -62
  193. package/test/auto-recall.test.mjs +0 -474
  194. package/test/auto-truncate.test.mjs +0 -931
  195. package/test/autobind.test.mjs +0 -385
  196. package/test/bus.test.mjs +0 -1572
  197. package/test/cli-guard.test.mjs +0 -198
  198. package/test/conclusion.test.mjs +0 -408
  199. package/test/config-schema.test.mjs +0 -204
  200. package/test/d6-output.test.mjs +0 -194
  201. package/test/d6.test.mjs +0 -395
  202. package/test/deps.test.mjs +0 -342
  203. package/test/doctor-setup.test.mjs +0 -297
  204. package/test/embedding-recall.test.mjs +0 -347
  205. package/test/feature-flags.test.mjs +0 -568
  206. package/test/filter-shadow.test.mjs +0 -170
  207. package/test/fixtures/baseline-0.8.0-registration.json +0 -556
  208. package/test/fixtures/d6-header-tools.json +0 -1
  209. package/test/fixtures/lock-child.mjs +0 -67
  210. package/test/fixtures/pre-step-container.mjs +0 -100
  211. package/test/fixtures/privacy-memory/topics/pii-unmarked.md +0 -9
  212. package/test/fixtures/privacy-memory/topics/secret-local-only.md +0 -11
  213. package/test/fixtures/profile-session-longlive-config.json +0 -20
  214. package/test/fixtures/proposal-cas-child.mjs +0 -66
  215. package/test/host-engine-status.test.mjs +0 -307
  216. package/test/hot-truncate.test.mjs +0 -1349
  217. package/test/identity-card-marker.test.mjs +0 -307
  218. package/test/identity-router/run.mjs +0 -721
  219. package/test/integration-pre-step.test.mjs +0 -553
  220. package/test/live.test.mjs +0 -1020
  221. package/test/maintenance-schedule.test.mjs +0 -538
  222. package/test/memory.test.mjs +0 -2828
  223. package/test/metrics.test.mjs +0 -478
  224. package/test/orchestrator.test.mjs +0 -266
  225. package/test/p1_probe.mjs +0 -97
  226. package/test/packaging.test.mjs +0 -182
  227. package/test/portability.test.mjs +0 -343
  228. package/test/rc4-regressions.test.mjs +0 -562
  229. package/test/rc5-regressions.test.mjs +0 -197
  230. package/test/rc6-chinese.test.mjs +0 -394
  231. package/test/router-1100/apply-off.test.mjs +0 -175
  232. package/test/router-1100/budget-reconcile.test.mjs +0 -215
  233. package/test/router-1100/config-context.test.mjs +0 -211
  234. package/test/router-1100/helpers.mjs +0 -129
  235. package/test/router-1100/hint-envelope.test.mjs +0 -150
  236. package/test/router-1100/lock-crossproc.test.mjs +0 -206
  237. package/test/router-1100/proposal-cas-crossproc.test.mjs +0 -184
  238. package/test/router-1100/router-apply.test.mjs +0 -372
  239. package/test/router-1100/router-fixb.test.mjs +0 -602
  240. package/test/router-1100/router-proposals.test.mjs +0 -405
  241. package/test/router-1100/router-queue-lease-wal.test.mjs +0 -355
  242. package/test/router-1100/router-security-cr.test.mjs +0 -333
  243. package/test/router-1100/service-lifecycle.test.mjs +0 -220
  244. package/test/router-1100/tools-contract.test.mjs +0 -164
  245. package/test/router-1100/turn-reflect-tick.test.mjs +0 -89
  246. package/test/router-1100/v6-contract.test.mjs +0 -158
  247. package/test/router-1100/v6b-contract.test.mjs +0 -293
  248. package/test/router-1100/v6c-contract.test.mjs +0 -249
  249. package/test/router-1100/wal-rotation.test.mjs +0 -375
  250. package/test/router-1100/wp1-config.test.mjs +0 -170
  251. package/test/router-1100/wp1-default-off.test.mjs +0 -77
  252. package/test/router-1100/wp1-model-status.test.mjs +0 -90
  253. package/test/router-1100/wp1-status.test.mjs +0 -220
  254. package/test/router-1100/wp1-tools.test.mjs +0 -146
  255. package/test/router-1100/wp5-cli.test.mjs +0 -240
  256. package/test/router-1100/wp5-model-auto.test.mjs +0 -418
  257. package/test/router-1100/wp6-merge.test.mjs +0 -386
  258. package/test/router-1100/wp6-wake.test.mjs +0 -502
  259. package/test/router-background/audit.test.mjs +0 -37
  260. package/test/router-background/budget-ledger.test.mjs +0 -330
  261. package/test/router-background/cross-process.test.mjs +0 -222
  262. package/test/router-background/fixtures/cross-child.mjs +0 -85
  263. package/test/router-background/fixtures/real-shapes.mjs +0 -239
  264. package/test/router-background/router.test.mjs +0 -1044
  265. package/test/router-background/stream-retry.test.mjs +0 -358
  266. package/test/router-background/tool-agent.test.mjs +0 -384
  267. package/test/router-face/bridge.test.mjs +0 -169
  268. package/test/router-face/face.test.mjs +0 -316
  269. package/test/router-failclosed.test.mjs +0 -466
  270. package/test/router-identity.test.mjs +0 -384
  271. package/test/router-l1-l2.contract.test.mjs +0 -1075
  272. package/test/router-memory-tools.test.mjs +0 -262
  273. package/test/router-policy.test.mjs +0 -225
  274. package/test/router-runtime.test.mjs +0 -438
  275. package/test/router-shadow.test.mjs +0 -287
  276. package/test/router.test.mjs +0 -903
  277. package/test/run-rc.mjs +0 -299
  278. package/test/run.mjs +0 -2469
  279. package/test/safety-defaults.test.mjs +0 -179
  280. package/test/seeded-load.test.mjs +0 -436
  281. package/test/session-original.test.mjs +0 -338
  282. package/test/surgery-recovery.test.mjs +0 -936
  283. package/test/t7_drive.mjs +0 -151
  284. package/test/tool-output.test.mjs +0 -393
  285. package/test/tool-schema.test.mjs +0 -177
  286. package/test/tools_contract.test.mjs +0 -716
  287. package/test/truncate-visible.test.mjs +0 -1150
  288. package/test/ui-flags.test.mjs +0 -477
  289. package/test/v4-hardening.test.mjs +0 -427
package/src/config.js CHANGED
@@ -49,33 +49,33 @@ const ZH = {
49
49
  strictMemoryRoot: '未配置 memoryRoot 时直接报错,而不是回落到推导出的默认目录。',
50
50
  filterEnabled: '记忆准入过滤器:启动后异步分析 journal 与卡片(只读,默认开启)。',
51
51
  shadowEnabled: '旧配置兼容位:默认路由判定已关闭;要开启请显式设 routerRuntime=shadow 或 on。',
52
- autoConclusion: '结论回流:每轮结束时把命中触发规则的结论写入 topics/(默认关闭)。',
52
+ autoConclusion: '结论回流:每轮结束时把命中触发规则的结论写入 topics/(默认开启;显式 false 关闭)。',
53
53
  surgeryRecovery: '启动时检查无人值守手术的恢复报告(默认开启)。',
54
54
  recoverOnStart: '启动时收尾或回滚未完成的可见截断事务(默认开启)。',
55
55
  keepEvents: 'session_truncate 默认保留的事件数(默认 20000)。',
56
56
  recentWriteWindowMs: '最近写入保护窗口;窗口内拒绝截断(默认 60000 毫秒)。',
57
- heartbeatMs: '活跃会话心跳间隔(默认 15000 毫秒;0 关闭自动写入)。',
58
- routerEnabled: '开启 Router 路由服务:判定工具调用并按策略记录/拦截(默认关闭)。',
57
+ heartbeatMs: '活跃会话心跳间隔(默认 15000 毫秒)。0 只关定时心跳与工具调用触发的写;turn 开始/结束仍按状态机维护 state/turn。',
58
+ routerEnabled: '开启 Router 路由服务:判定工具调用并按策略记录/拦截(默认开启;显式 false 关闭)。',
59
59
  routerRuntime: '路由运行时模式:off / shadow / on(默认 off;要记录判定须显式设 shadow 或 on)。',
60
60
  routerProvider: 'Router 使用的 provider;留空则用 deepseek-official。',
61
61
  routerModel: 'Router 使用的模型(auto = 由宿主解析)。',
62
62
  routerPolicyProfile: '路由策略档名,指向 src/router/policies/<name>.json(默认 generic)。',
63
- routerSharedBoard: '共享大脑提示:把 board 摘要注入 agent/pre-step(默认关闭)。',
63
+ routerSharedBoard: '共享大脑提示:把 board 摘要注入 agent/pre-step(默认开启;显式 false 关闭)。',
64
64
  routerRuntimeStatePath: '路由判定记录文件路径(默认 <memoryRoot>/.longlive/router-runtime.jsonl)。',
65
65
  routerRuntimeMaxRecords: '路由判定记录条数上限(默认 1000)。',
66
66
  routerTickMs: 'Router 定时 tick 间隔(默认 60000 毫秒)。',
67
67
  routerAutonomy: '路由自治级别:report / draft(默认 report)。',
68
68
  routerHintScope: '共享板提示作用域:root / all / off(默认 root)。',
69
- routerProposalEnabled: '第二道闸:允许 Router 写提案,不写工作区(默认关闭)。',
69
+ routerProposalEnabled: '第二道闸:允许 Router 写提案,不写工作区(默认开启;显式 false 关闭)。',
70
70
  routerApplyEnabled: '第三道闸:允许批准后的九步写入(默认关闭)。',
71
- routerL4MergeEnabled: '允许相邻小写合并(默认关闭)。',
72
- routerWakeEnabled: '允许 Router 唤醒会话(默认关闭)。',
71
+ routerL4MergeEnabled: '允许相邻小写合并(默认开启;显式 false 关闭)。',
72
+ routerWakeEnabled: '允许 Router 唤醒会话(默认开启;显式 false 关闭)。',
73
73
  routerWriterLeaseMs: '写入租约时长(默认 120000 毫秒,夹取到 60000–120000)。',
74
74
  metrics: '工作集度量(D1/D4):每轮追加一行账本;metrics:false 或 metrics.enabled:false 关闭。默认开启。',
75
- embedding: '自动想起的向量索引后端;仅在 autoRecall.enabled 时透传。默认关闭。',
75
+ embedding: '自动想起的向量索引后端;仅在 autoRecall.enabled 时透传。默认开启;本地模型不可用时静默退关键词。',
76
76
  d2: {
77
77
  $description: '工具输出裁剪(D2):超过上限的工具输出全文归档,只保留头尾内联。',
78
- enabled: '开启 D2 工具输出裁剪(默认关闭)。',
78
+ enabled: '开启 D2 工具输出裁剪(默认开启;显式 false 关闭)。',
79
79
  maxInlineChars: '内联保留的最大字符数(默认 4096,范围 64–1000000)。',
80
80
  headRatio: '内联预算中头部的比例(默认 0.6,范围 0.2–0.8)。',
81
81
  skipTools: '永不裁剪的工具名(默认 ["read"])。',
@@ -83,41 +83,80 @@ const ZH = {
83
83
  },
84
84
  d6: {
85
85
  $description: '工具面裁剪(D6):第一轮冻结按任务挑选的工具清单,其余工具用 tool_search 申请。',
86
- enabled: '开启 D6 工具面裁剪(默认关闭)。',
86
+ enabled: '开启 D6 工具面裁剪(默认开启;显式 false 关闭)。',
87
87
  dryRun: '只记录判定,不实际裁剪工具面(默认关闭)。',
88
88
  log: '输出 [d6] 决策日志(默认开启)。',
89
89
  keepTools: '无论任务如何都保留的工具名(默认空)。',
90
90
  },
91
91
  autoRecall: {
92
92
  $description: '自动想起:按轮次从记忆库召回卡片并注入上下文。',
93
- enabled: '开启自动想起(默认关闭)。',
93
+ enabled: '开启自动想起(默认开启;显式 false 关闭)。',
94
94
  topK: '每次召回的最大卡片数(默认 3,范围 1–10)。',
95
95
  budgetTokens: '每次召回的 token 预算(默认 2000,范围 200–2000)。',
96
96
  everyNTurns: '每 N 轮召回一次(默认 6)。',
97
97
  },
98
98
  identityCard: {
99
99
  $description: '身份卡:在每次对话前置注入 STATE.md 摘要。',
100
- enabled: '开启身份卡注入(默认关闭)。',
100
+ enabled: '开启身份卡注入(默认开启;显式 false 关闭)。',
101
101
  path: '身份卡路径(默认 <memoryRoot>/STATE.md)。',
102
102
  maxChars: '身份卡最多注入的字符数(默认 800,范围 120–4000)。',
103
103
  },
104
104
  presenceBus: {
105
105
  $description: '共享大脑:消费其他会话写入总线的消息。',
106
- enabled: '开启共享大脑总线(默认关闭)。',
106
+ enabled: '开启共享大脑总线(默认开启;显式 false 关闭)。',
107
107
  pollMs: '总线轮询间隔(默认 3000 毫秒;0 关闭轮询)。',
108
108
  root: '总线根目录;留空则使用记忆根。',
109
109
  },
110
+ sharedBrain: {
111
+ $description: '共享大脑活动流:把各会话「正在干什么」写进活动板,每轮只注入未读的新增条目。',
112
+ activity: {
113
+ $description: '活动流开关与注入预算(与 presenceBus 无关,失败静默)。',
114
+ enabled: '开启共享大脑活动流(默认开启;显式 false 关闭,关闭时不写活动板、不注入)。',
115
+ injectMaxChars: '每次注入的总字符上限,含固定头尾(默认 300,范围 60–2000)。',
116
+ maxItems: '每次最多注入的活动条数(默认 5,范围 1–10)。',
117
+ },
118
+ thinkingInjection: '开启 thinking 摘要注入(默认开启;显式 false 关闭;需 sharedBrain.activity.enabled=true。开启后把其他会话 assistant 可见 reasoning 的首句/≤200 字符摘要注入,单次最多 5 行)。',
119
+ },
120
+ memoryV2: {
121
+ $description: '记忆/回忆/遗忘 v2 面板接口(M2-F 只读面 + M2-G 动作面):1.8.0 默认开启,显式 false 为独立 kill switch(关闭时行为=1.6.8)。',
122
+ enabled: '开启面板 API(27 条只读路由 + 18 动作 + HMAC 审计;1.8.0 默认开启,false=kill switch)。',
123
+ },
124
+ role: {
125
+ $description: '角色内核(v2.8 §16.3):attention queue / channel adapter / relationship graph / personality projection + 三接口;1.8.0 默认开启,显式 false 为独立 kill switch(关闭后零 hook/零 IO)。',
126
+ enabled: '开启角色内核(1.8.0 默认开启;设为 false = 独立 kill switch,关闭后不注册 hook、零 IO)。',
127
+ },
128
+ answerGuard: {
129
+ $description: '有据才答(1.8.0 默认开启):会话历史问题强制轮号引用 + 生成后审计;显式 false / DSH_LONGLIVE_DISABLE_ANSWER_GUARD 为独立 kill switch。',
130
+ enabled: '开启有据才答层(1.8.0 默认开启;开启后注册 pre-step 注入、系统提示短规则、turn/end 审计与 answer_audit 工具;false=kill switch)。',
131
+ maxEvidenceTurns: '证据包最多列出的历史轮数(默认 3,范围 1–10)。',
132
+ evidenceMinScore: '证据检索的最低分(默认 1.8;调低召回更多、也更容易误命中)。',
133
+ evidenceMaxChars: '证据包正文的最大字符数(默认 4000,范围 400–4000)。',
134
+ maxHistoryTurns: '证据检索最多回看的历史轮数(默认 80,范围 5–400)。',
135
+ systemPromptSection: '通过宿主 ctx.systemPrompt.section 注入短规则(默认开启)。',
136
+ injectRule: '系统提示不可用时用隐藏消息兜底注入同一段规则(默认开启)。',
137
+ audit: 'turn/end 写生成后审计 <memoryRoot>/.longlive/answer-audit/(默认开启;仅在 answerGuard 开启时生效)。',
138
+ auditMaxBytes: '审计文件轮转阈值字节数(默认 2 MiB)。',
139
+ auditContextChars: '审计取证上下文的最大字符数(默认 40000)。',
140
+ panel: '注册只读面板路由 /api/longlive/answer-audit(默认开启)。',
141
+ knownTools: '假执行检测认可的工具名;留空用内置宿主工具表 + 本插件 22 个工具。',
142
+ gate: {
143
+ enabled: '信心闸(M1)灰度开关:默认 false(保持 1.8.0 现状);开启后 auditTurn 做三态判定并写 gate 字段。',
144
+ minCoverage: '降级阈值:有事实断言的句子中带引用或【推断】标注的最低比例(默认 0.15;R3 依据 A5 真实答案 coverage 均值 0.26 下调)。',
145
+ requireReadable: '要求草稿引用的轮号必须在证据包轮次内且 excerpt 可回读(默认 true)。',
146
+ conflictPolicy: '证据冲突时的策略:degrade(默认降级)/ abstain(弃答)。',
147
+ },
148
+ },
110
149
  autoMaintenance: {
111
150
  $description: '每日维护:本地午夜调度 consolidate 报告与 forget 候选清单。',
112
- enabled: '开启每日维护(默认关闭)。',
151
+ enabled: '开启每日维护(默认开启;显式 false 关闭)。',
113
152
  consolidate: '维护时生成合并报告(默认开启)。',
114
153
  forget: '维护时生成遗忘候选清单(默认开启)。',
115
154
  runOnStart: '启动后立即补跑一次(默认开启)。',
116
155
  startDelayMs: '启动后延迟毫秒数(默认 500)。',
117
156
  },
118
157
  routerFace: {
119
- $description: '后台面(routerFace v1):定时读取共享记忆,写 journal 与建议 outbox(默认关闭)。',
120
- enabled: '开启后台面(默认关闭)。',
158
+ $description: '后台面(routerFace v1):定时读取共享记忆,写 journal 与建议 outbox(默认开启;显式 false 关闭)。',
159
+ enabled: '开启后台面(默认开启;显式 false 关闭)。',
121
160
  tickMs: 'tick 间隔(默认 60000 毫秒,范围 30000–900000)。',
122
161
  dailyTokenBudget: '每个本地日的 token 预算(默认 50000)。',
123
162
  maxContextTokens: '单次组装的上下文上限(默认 30000)。',
@@ -127,8 +166,8 @@ const ZH = {
127
166
  maxSuggestions: '每次最多写入 outbox 的建议条数(默认 3,范围 0–10)。',
128
167
  },
129
168
  autoTruncate: {
130
- $description: '自动可见截断:在 turn/end 规划 log / dryrun / request(1.6.0 默认关闭,mode=dryrun)。',
131
- enabled: '开启自动可见截断(默认关闭;开启后仍默认只 dryrun,不写会话)。',
169
+ $description: '自动可见截断:在 turn/end 规划 log / dryrun / request(默认开启,mode=dryrun;显式 false 关闭)。',
170
+ enabled: '开启自动可见截断(默认开启;显式 false 关闭;开启后仍默认只 dryrun,不写会话)。',
132
171
  mode: '模式:log / dryrun / request(旧值 apply 会被改写为 request)。',
133
172
  tokensThreshold: '触发截断的估算 token 阈值(默认 300000)。',
134
173
  minTurns: '触发截断的最小轮数(默认 12,严格大于)。',
@@ -157,33 +196,33 @@ const EN = {
157
196
  strictMemoryRoot: 'Fail when memoryRoot is unset instead of falling back to the derived directory.',
158
197
  filterEnabled: 'Memory-admission filter: analyses the journal and cards asynchronously at startup (read-only; on by default).',
159
198
  shadowEnabled: 'Legacy compatibility: router evaluation is off by default; set routerRuntime=shadow or on to opt in.',
160
- autoConclusion: 'Conclusion write-back: writes trigger-matched conclusions into topics/ at turn end (off by default).',
199
+ autoConclusion: 'Conclusion write-back: writes trigger-matched conclusions into topics/ at turn end (on by default; explicitly false opts out).',
161
200
  surgeryRecovery: 'Check the unattended-surgery recovery report at startup (on by default).',
162
201
  recoverOnStart: 'Finish or roll back an interrupted visible-truncation transaction at startup (on by default).',
163
202
  keepEvents: 'Default events kept by session_truncate (20000).',
164
203
  recentWriteWindowMs: 'Recent-write guard window; truncation is refused inside it (60000 ms).',
165
- heartbeatMs: 'Live-session heartbeat interval (15000 ms; 0 disables automatic writes).',
166
- routerEnabled: 'Enable the Router service: evaluate tool calls and record/deny them by policy (off by default).',
204
+ heartbeatMs: 'Live-session heartbeat interval (15000 ms). 0 disables only the timer heartbeat and tool-touch writes; turn start/end still maintain state/turn.',
205
+ routerEnabled: 'Enable the Router service: evaluate tool calls and record/deny them by policy (on by default; explicitly false opts out).',
167
206
  routerRuntime: 'Router runtime mode: off / shadow / on (default off; set shadow or on to record evaluations).',
168
207
  routerProvider: 'Provider used by Router; empty means deepseek-official.',
169
208
  routerModel: 'Model used by Router (auto = resolved by the host).',
170
209
  routerPolicyProfile: 'Router policy profile under src/router/policies/<name>.json (generic by default).',
171
- routerSharedBoard: 'Shared-board hint: inject the board digest at agent/pre-step (off by default).',
210
+ routerSharedBoard: 'Shared-board hint: inject the board digest at agent/pre-step (on by default; explicitly false opts out).',
172
211
  routerRuntimeStatePath: 'Router-decision record path (default <memoryRoot>/.longlive/router-runtime.jsonl).',
173
212
  routerRuntimeMaxRecords: 'Maximum router-decision records (1000).',
174
213
  routerTickMs: 'Router tick interval (60000 ms).',
175
214
  routerAutonomy: 'Router autonomy level: report / draft (report by default).',
176
215
  routerHintScope: 'Shared-board hint scope: root / all / off (root by default).',
177
- routerProposalEnabled: 'Second gate: allow Router to write proposals without touching the workspace (off by default).',
216
+ routerProposalEnabled: 'Second gate: allow Router to write proposals without touching the workspace (on by default; explicitly false opts out).',
178
217
  routerApplyEnabled: 'Third gate: allow approved nine-step writes (off by default).',
179
- routerL4MergeEnabled: 'Enable merging of adjacent small writes (off by default).',
180
- routerWakeEnabled: 'Allow Router to wake sessions (off by default).',
218
+ routerL4MergeEnabled: 'Enable merging of adjacent small writes (on by default; explicitly false opts out).',
219
+ routerWakeEnabled: 'Allow Router to wake sessions (on by default; explicitly false opts out).',
181
220
  routerWriterLeaseMs: 'Writer lease duration (120000 ms, clamped to 60000–120000).',
182
221
  metrics: 'Working-set metrics (D1/D4): one ledger row per turn; `metrics: false` or `metrics.enabled: false` disables it. On by default.',
183
- embedding: 'Vector-index backend for auto-recall; passed through only when autoRecall.enabled. Off by default.',
222
+ embedding: 'Vector-index backend for auto-recall; passed through only when autoRecall.enabled. On by default; silently falls back to keyword when the local model is unavailable.',
184
223
  d2: {
185
224
  $description: 'Tool-output trimming (D2): archive oversized tool results and keep only head/tail inline.',
186
- enabled: 'Enable D2 tool-output trimming (off by default).',
225
+ enabled: 'Enable D2 tool-output trimming (on by default; explicitly false opts out).',
187
226
  maxInlineChars: 'Maximum inline characters kept (default 4096, range 64–1000000).',
188
227
  headRatio: 'Share of the inline budget given to the head (default 0.6, range 0.2–0.8).',
189
228
  skipTools: 'Tool names that are never trimmed (default ["read"]).',
@@ -191,41 +230,80 @@ const EN = {
191
230
  },
192
231
  d6: {
193
232
  $description: 'Tool-surface trimming (D6): freeze a task-derived tool list at turn 1 and expose the rest through tool_search.',
194
- enabled: 'Enable D6 tool-surface trimming (off by default).',
233
+ enabled: 'Enable D6 tool-surface trimming (on by default; explicitly false opts out).',
195
234
  dryRun: 'Log the decision without trimming the surface (off by default).',
196
235
  log: 'Emit [d6] decision logs (on by default).',
197
236
  keepTools: 'Tool names kept regardless of the task (empty by default).',
198
237
  },
199
238
  autoRecall: {
200
239
  $description: 'Auto-recall: retrieve cards from the memory store and inject them into context every N turns.',
201
- enabled: 'Enable auto-recall (off by default).',
240
+ enabled: 'Enable auto-recall (on by default; explicitly false opts out).',
202
241
  topK: 'Maximum cards per recall (default 3, range 1–10).',
203
242
  budgetTokens: 'Token budget per recall (default 2000, range 200–2000).',
204
243
  everyNTurns: 'Recall once every N turns (default 6).',
205
244
  },
206
245
  identityCard: {
207
246
  $description: 'Identity card: prepend a STATE.md digest at the start of the conversation.',
208
- enabled: 'Enable identity-card injection (off by default).',
247
+ enabled: 'Enable identity-card injection (on by default; explicitly false opts out).',
209
248
  path: 'Identity-card path (default <memoryRoot>/STATE.md).',
210
249
  maxChars: 'Maximum characters injected (default 800, range 120–4000).',
211
250
  },
212
251
  presenceBus: {
213
252
  $description: 'Shared brain: consume messages other sessions write to the bus.',
214
- enabled: 'Enable the shared-brain bus (off by default).',
253
+ enabled: 'Enable the shared-brain bus (on by default; explicitly false opts out).',
215
254
  pollMs: 'Bus polling interval (default 3000 ms; 0 disables polling).',
216
255
  root: 'Bus root directory; empty means the memory root.',
217
256
  },
257
+ sharedBrain: {
258
+ $description: 'Shared-brain activity stream: one board row per turn, and only unread rows are injected.',
259
+ activity: {
260
+ $description: 'Activity-stream switches and injection budget (independent of presenceBus; failures are silent).',
261
+ enabled: 'Enable the shared-brain activity stream (on by default; explicitly false opts out and writes/injects nothing).',
262
+ injectMaxChars: 'Total characters per injection, header/footer included (default 300, range 60–2000).',
263
+ maxItems: 'Maximum activity rows per injection (default 5, range 1–10).',
264
+ },
265
+ thinkingInjection: 'Inject thinking summaries (on by default; explicitly false opts out; requires sharedBrain.activity.enabled=true). Summaries are the first sentence or ≤200 chars of other sessions\' visible reasoning, max 5 lines per injection.',
266
+ },
267
+ memoryV2: {
268
+ $description: 'Memory/recall/forget v2 panel API (M2-F read-only face + M2-G action face): ON by default in 1.8.0; explicit false is an independent kill switch (behaviour = 1.6.8 when killed).',
269
+ enabled: 'Enable the panel API (27 read-only routes + 18 actions + HMAC audit; ON by default, false = kill switch).',
270
+ },
271
+ role: {
272
+ $description: 'Role kernel (v2.8 §16.3): attention queue / channel adapter / relationship graph / personality projection + the three interfaces; ON by default in 1.8.0, explicit false is an independent kill switch (no hooks, no IO when killed).',
273
+ enabled: 'Enable the role kernel (ON by default in 1.8.0; set false to kill it independently — no hooks and no IO).',
274
+ },
275
+ answerGuard: {
276
+ $description: 'Evidence-first answers (ON by default in 1.8.0): turn-number citations for history questions plus a post-generation audit; explicit false / DSH_LONGLIVE_DISABLE_ANSWER_GUARD is an independent kill switch.',
277
+ enabled: 'Enable the answer guard (ON by default in 1.8.0; enables the pre-step injection, system-prompt rule, turn/end audit and the answer_audit tool; false = kill switch).',
278
+ maxEvidenceTurns: 'Maximum historical turns listed in the evidence packet (default 3, range 1-10).',
279
+ evidenceMinScore: 'Minimum evidence-retrieval score (default 1.8; lower recalls more and is easier to mis-hit).',
280
+ evidenceMaxChars: 'Maximum characters of the evidence packet (default 4000, range 400-4000).',
281
+ maxHistoryTurns: 'Maximum historical turns scanned for evidence (default 80, range 5-400).',
282
+ systemPromptSection: 'Register the short rule through the host ctx.systemPrompt.section (on by default).',
283
+ injectRule: 'Fall back to one hidden rule message when the host has no systemPrompt.section (on by default).',
284
+ audit: 'Write the post-generation audit to <memoryRoot>/.longlive/answer-audit/ at turn end (on by default; only when answerGuard is enabled).',
285
+ auditMaxBytes: 'Audit-file rotation threshold in bytes (default 2 MiB).',
286
+ auditContextChars: 'Maximum grounding context stored for the audit (default 40000).',
287
+ panel: 'Register the read-only panel route /api/longlive/answer-audit (on by default).',
288
+ knownTools: 'Tool names accepted by the fake-execution check; empty uses the built-in host list plus this plugin\'s 22 tools.',
289
+ gate: {
290
+ enabled: 'Confidence gate (M1) gray switch: default false (keeps 1.8.0 behaviour); when on, auditTurn does the three-state decision and writes gate fields.',
291
+ minCoverage: 'Degraded threshold: minimum share of factual sentences that carry a citation or an 【推断】 mark (default 0.15; lowered in R3 because A5 real answers average 0.26).',
292
+ requireReadable: 'Require every cited turn number to be inside the evidence turns with a readable excerpt (default true).',
293
+ conflictPolicy: 'Policy on evidence conflicts: degrade (default) or abstain.',
294
+ },
295
+ },
218
296
  autoMaintenance: {
219
297
  $description: 'Daily maintenance: schedule consolidate reports and forget candidates at local midnight.',
220
- enabled: 'Enable daily maintenance (off by default).',
298
+ enabled: 'Enable daily maintenance (on by default; explicitly false opts out).',
221
299
  consolidate: 'Produce a consolidate report during maintenance (on by default).',
222
300
  forget: 'Produce a forget-candidate list during maintenance (on by default).',
223
301
  runOnStart: 'Run once shortly after startup (on by default).',
224
302
  startDelayMs: 'Startup delay in milliseconds (default 500).',
225
303
  },
226
304
  routerFace: {
227
- $description: 'Background face (routerFace v1): read shared memory on a timer and write a journal and suggestion outbox (off by default).',
228
- enabled: 'Enable the background face (off by default).',
305
+ $description: 'Background face (routerFace v1): read shared memory on a timer and write a journal and suggestion outbox (on by default; explicitly false opts out).',
306
+ enabled: 'Enable the background face (on by default; explicitly false opts out).',
229
307
  tickMs: 'Tick interval (default 60000 ms, range 30000–900000).',
230
308
  dailyTokenBudget: 'Token budget per local day (default 50000).',
231
309
  maxContextTokens: 'Context cap per assembly (default 30000).',
@@ -236,7 +314,7 @@ const EN = {
236
314
  },
237
315
  autoTruncate: {
238
316
  $description: 'Automatic visible truncation: plan log / dryrun / request at turn end (off by default in 1.6.0, mode=dryrun).',
239
- enabled: 'Enable automatic visible truncation (off by default; even when enabled it only dry-runs unless you change mode).',
317
+ enabled: 'Enable automatic visible truncation (on by default; explicitly false opts out; even when enabled it only dry-runs unless you change mode).',
240
318
  mode: 'Mode: log / dryrun / request (the legacy value apply is rewritten to request).',
241
319
  tokensThreshold: 'Estimated-token threshold that triggers truncation (default 300000).',
242
320
  minTurns: 'Minimum turns before truncation may trigger (default 12, strictly greater).',
@@ -259,7 +337,7 @@ const EN = {
259
337
 
260
338
  function schemaOf() {
261
339
  const d2 = z.object({
262
- enabled: z.boolean().default(false).description(ZH.d2.enabled),
340
+ enabled: z.boolean().default(true).description(ZH.d2.enabled),
263
341
  maxInlineChars: z.number().default(4096).description(ZH.d2.maxInlineChars),
264
342
  headRatio: z.number().default(0.6).description(ZH.d2.headRatio),
265
343
  skipTools: z.array(z.string()).default(['read']).description(ZH.d2.skipTools),
@@ -267,33 +345,52 @@ function schemaOf() {
267
345
  }).collapse();
268
346
 
269
347
  const d6 = z.object({
270
- enabled: z.boolean().default(false).description(ZH.d6.enabled),
348
+ enabled: z.boolean().default(true).description(ZH.d6.enabled),
271
349
  dryRun: z.boolean().default(false).description(ZH.d6.dryRun),
272
350
  log: z.boolean().default(true).description(ZH.d6.log),
273
351
  keepTools: z.array(z.string()).default([]).description(ZH.d6.keepTools),
274
352
  }).collapse();
275
353
 
276
354
  const autoRecall = z.object({
277
- enabled: z.boolean().default(false).description(ZH.autoRecall.enabled),
355
+ enabled: z.boolean().default(true).description(ZH.autoRecall.enabled),
278
356
  topK: z.number().default(3).description(ZH.autoRecall.topK),
279
357
  budgetTokens: z.number().default(2000).description(ZH.autoRecall.budgetTokens),
280
358
  everyNTurns: z.number().default(6).description(ZH.autoRecall.everyNTurns),
281
359
  }).collapse();
282
360
 
283
361
  const identityCard = z.object({
284
- enabled: z.boolean().default(false).description(ZH.identityCard.enabled),
362
+ enabled: z.boolean().default(true).description(ZH.identityCard.enabled),
285
363
  path: z.string().default('<memoryRoot>/STATE.md').description(ZH.identityCard.path),
286
364
  maxChars: z.number().default(800).description(ZH.identityCard.maxChars),
287
365
  }).collapse();
288
366
 
289
367
  const presenceBus = z.object({
290
- enabled: z.boolean().default(false).description(ZH.presenceBus.enabled),
368
+ enabled: z.boolean().default(true).description(ZH.presenceBus.enabled),
291
369
  pollMs: z.number().default(3000).description(ZH.presenceBus.pollMs),
292
370
  root: z.string().description(ZH.presenceBus.root),
293
371
  }).collapse();
294
372
 
373
+ const sharedBrain = z.object({
374
+ activity: z.object({
375
+ enabled: z.boolean().default(true).description(ZH.sharedBrain.activity.enabled),
376
+ injectMaxChars: z.number().default(300).description(ZH.sharedBrain.activity.injectMaxChars),
377
+ maxItems: z.number().default(5).description(ZH.sharedBrain.activity.maxItems),
378
+ }).collapse(),
379
+ thinkingInjection: z.boolean().default(true).description(ZH.sharedBrain.thinkingInjection),
380
+ }).collapse();
381
+
382
+ const memoryV2 = z.object({
383
+ enabled: z.boolean().default(true).description(ZH.memoryV2.enabled),
384
+ }).collapse().description(ZH.memoryV2.$description);
385
+
386
+ // v2.8 §16.3 角色内核:1.8.0 默认 ON(任务:功能必须真的跑起来);显式 false 是
387
+ // 独立 kill switch。子开关走代码默认(normalizeRoleConfig,默认全开),不放大 Config 节点数。
388
+ const role = z.object({
389
+ enabled: z.boolean().default(true).description(ZH.role.enabled),
390
+ }).collapse().description(ZH.role.$description);
391
+
295
392
  const autoMaintenance = z.object({
296
- enabled: z.boolean().default(false).description(ZH.autoMaintenance.enabled),
393
+ enabled: z.boolean().default(true).description(ZH.autoMaintenance.enabled),
297
394
  consolidate: z.boolean().default(true).description(ZH.autoMaintenance.consolidate),
298
395
  forget: z.boolean().default(true).description(ZH.autoMaintenance.forget),
299
396
  runOnStart: z.boolean().default(true).description(ZH.autoMaintenance.runOnStart),
@@ -301,7 +398,7 @@ function schemaOf() {
301
398
  }).collapse();
302
399
 
303
400
  const routerFace = z.object({
304
- enabled: z.boolean().default(false).description(ZH.routerFace.enabled),
401
+ enabled: z.boolean().default(true).description(ZH.routerFace.enabled),
305
402
  tickMs: z.number().default(60000).description(ZH.routerFace.tickMs),
306
403
  dailyTokenBudget: z.number().default(50000).description(ZH.routerFace.dailyTokenBudget),
307
404
  maxContextTokens: z.number().default(30000).description(ZH.routerFace.maxContextTokens),
@@ -312,7 +409,7 @@ function schemaOf() {
312
409
  }).collapse();
313
410
 
314
411
  const autoTruncate = z.object({
315
- enabled: z.boolean().default(false).description(ZH.autoTruncate.enabled),
412
+ enabled: z.boolean().default(true).description(ZH.autoTruncate.enabled),
316
413
  mode: z.string().default('dryrun').description(ZH.autoTruncate.mode),
317
414
  tokensThreshold: z.number().default(300000).description(ZH.autoTruncate.tokensThreshold),
318
415
  minTurns: z.number().default(12).description(ZH.autoTruncate.minTurns),
@@ -336,25 +433,48 @@ function schemaOf() {
336
433
  autoMinTokens: z.number().default(300000).description(ZH.hotTruncate.autoMinTokens),
337
434
  }).collapse();
338
435
 
436
+ const answerGuardGate = z.object({
437
+ enabled: z.boolean().default(false).description(ZH.answerGuard.gate.enabled),
438
+ minCoverage: z.number().default(0.15).description(ZH.answerGuard.gate.minCoverage),
439
+ requireReadable: z.boolean().default(true).description(ZH.answerGuard.gate.requireReadable),
440
+ conflictPolicy: z.string().default('degrade').description(ZH.answerGuard.gate.conflictPolicy),
441
+ }).collapse();
442
+
443
+ const answerGuard = z.object({
444
+ enabled: z.boolean().default(true).description(ZH.answerGuard.enabled),
445
+ maxEvidenceTurns: z.number().default(3).description(ZH.answerGuard.maxEvidenceTurns),
446
+ evidenceMinScore: z.number().default(1.8).description(ZH.answerGuard.evidenceMinScore),
447
+ evidenceMaxChars: z.number().default(4000).description(ZH.answerGuard.evidenceMaxChars),
448
+ maxHistoryTurns: z.number().default(80).description(ZH.answerGuard.maxHistoryTurns),
449
+ systemPromptSection: z.boolean().default(true).description(ZH.answerGuard.systemPromptSection),
450
+ injectRule: z.boolean().default(true).description(ZH.answerGuard.injectRule),
451
+ audit: z.boolean().default(true).description(ZH.answerGuard.audit),
452
+ auditMaxBytes: z.number().default(2097152).description(ZH.answerGuard.auditMaxBytes),
453
+ auditContextChars: z.number().default(40000).description(ZH.answerGuard.auditContextChars),
454
+ panel: z.boolean().default(true).description(ZH.answerGuard.panel),
455
+ knownTools: z.array(z.string()).description(ZH.answerGuard.knownTools),
456
+ gate: answerGuardGate,
457
+ }).collapse();
458
+
339
459
  return z.object({
340
460
  memoryRoot: z.string().description(ZH.memoryRoot).disabled(),
341
461
  memRoot: z.string().description(ZH.memRoot).disabled(),
342
462
  strictMemoryRoot: z.boolean().default(false).description(ZH.strictMemoryRoot),
343
463
  filterEnabled: z.boolean().default(true).description(ZH.filterEnabled),
344
464
  shadowEnabled: z.boolean().default(true).description(ZH.shadowEnabled),
345
- autoConclusion: z.boolean().default(false).description(ZH.autoConclusion),
465
+ autoConclusion: z.boolean().default(true).description(ZH.autoConclusion),
346
466
  surgeryRecovery: z.boolean().default(true).description(ZH.surgeryRecovery),
347
467
  recoverOnStart: z.boolean().default(true).description(ZH.recoverOnStart),
348
468
  keepEvents: z.number().default(20000).description(ZH.keepEvents),
349
469
  recentWriteWindowMs: z.number().default(60000).description(ZH.recentWriteWindowMs),
350
470
  heartbeatMs: z.number().default(15000).description(ZH.heartbeatMs),
351
471
 
352
- routerEnabled: z.boolean().default(false).description(ZH.routerEnabled),
472
+ routerEnabled: z.boolean().default(true).description(ZH.routerEnabled),
353
473
  routerRuntime: z.string().description(ZH.routerRuntime),
354
474
  routerProvider: z.string().description(ZH.routerProvider),
355
475
  routerModel: z.string().default('auto').description(ZH.routerModel),
356
476
  routerPolicyProfile: z.string().default('generic').description(ZH.routerPolicyProfile),
357
- routerSharedBoard: z.boolean().default(false).description(ZH.routerSharedBoard),
477
+ routerSharedBoard: z.boolean().default(true).description(ZH.routerSharedBoard),
358
478
  routerRuntimeStatePath: z.string().description(ZH.routerRuntimeStatePath),
359
479
  routerRuntimeMaxRecords: z.number().default(1000).description(ZH.routerRuntimeMaxRecords),
360
480
  routerTickMs: z.number().default(60000).description(ZH.routerTickMs),
@@ -366,7 +486,7 @@ function schemaOf() {
366
486
  routerProposalEnabled: z.boolean().description(ZH.routerProposalEnabled),
367
487
  routerApplyEnabled: z.boolean().default(false).description(ZH.routerApplyEnabled),
368
488
  routerL4MergeEnabled: z.boolean().description(ZH.routerL4MergeEnabled),
369
- routerWakeEnabled: z.boolean().default(false).description(ZH.routerWakeEnabled),
489
+ routerWakeEnabled: z.boolean().default(true).description(ZH.routerWakeEnabled),
370
490
  routerWriterLeaseMs: z.number().description(ZH.routerWriterLeaseMs),
371
491
 
372
492
  metrics: z.any().description(ZH.metrics),
@@ -377,6 +497,10 @@ function schemaOf() {
377
497
  autoRecall,
378
498
  identityCard,
379
499
  presenceBus,
500
+ sharedBrain,
501
+ memoryV2,
502
+ role,
503
+ answerGuard,
380
504
  autoMaintenance,
381
505
  routerFace,
382
506
  autoTruncate,
package/src/deps.js CHANGED
@@ -1,8 +1,10 @@
1
+ import { optionalPeerNames as adapterOptionalPeerNames } from './adapters/registry.js';
2
+
1
3
  // Optional runtime dependencies for dsh-longlive (0.8.0-rc.8).
2
4
  //
3
- // longlive has no hard runtime dependencies. It cooperates with the engram
4
- // memory plugin when that plugin is installed in the host profile, but it must
5
- // load and work without it. This module answers one question for the startup
5
+ // longlive has no hard runtime dependencies. It cooperates with optional
6
+ // external memory plugins (registered via src/adapters/) when one is installed
7
+ // in the host profile, but it must load and work without them. This module answers one question for the startup
6
8
  // path and for scripts/longlive-doctor.mjs:
7
9
  //
8
10
  // "Which DSH profiles are in scope, and is the optional peer enabled there?"
@@ -25,7 +27,7 @@ const PACKAGE_ROOT = path.resolve(HERE, '..');
25
27
  export const LONGLIVE_PLUGIN = '@jjh32456/dsh-longlive';
26
28
 
27
29
  /** Used only when package.json cannot be read or has no optional peers. */
28
- export const KNOWN_OPTIONAL_PEERS = Object.freeze(['@kenz1117/dsh-engram']);
30
+ export const KNOWN_OPTIONAL_PEERS = Object.freeze(adapterOptionalPeerNames());
29
31
 
30
32
  let manifestCache = null;
31
33