@theseus-whale/dsh-continuity 0.0.0-stage → 4.12.2
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/INSTALL.md +25 -0
- package/PANEL.md +92 -0
- package/README.md +286 -2
- package/RELEASE-NOTES.md +732 -0
- package/bin/bc-acceptance-full.mjs +91 -0
- package/bin/bc-acceptance-tight.mjs +66 -0
- package/bin/bc-acceptance.mjs +22 -0
- package/bin/bc-add-keywords.mjs +21 -0
- package/bin/bc-demo.mjs +47 -0
- package/bin/bc-expand-hint.mjs +179 -0
- package/bin/bc-ingest-index.mjs +35 -0
- package/bin/bc-ingest.mjs +31 -0
- package/bin/bc-label-demo.mjs +18 -0
- package/bin/bc-relabel.mjs +150 -0
- package/bin/bc-sessionize.mjs +59 -0
- package/bin/coref_pipeline.py +47 -0
- package/bin/coref_service.py +57 -0
- package/bin/debug_ckip.py +16 -0
- package/bin/debug_ner_zh.py +18 -0
- package/bin/doctor.mjs +275 -0
- package/bin/en_ner_error_audit.py +33 -0
- package/bin/eval-label-rules.mjs +342 -0
- package/bin/export-turns.py +68 -0
- package/bin/extract-user-paragraph.mjs +14 -0
- package/bin/extraction-composite-smoke.mjs +28 -0
- package/bin/extraction-latency.mjs +58 -0
- package/bin/extraction-user-smoke.mjs +28 -0
- package/bin/extraction_service.py +164 -0
- package/bin/facet-active-experiment.mjs +110 -0
- package/bin/facet-covid.mjs +8 -0
- package/bin/facet-curve.mjs +27 -0
- package/bin/facet-embedding-train.mjs +20 -0
- package/bin/facet-embedding-validate.mjs +83 -0
- package/bin/facet-eval-roleplay.mjs +42 -0
- package/bin/facet-eval.mjs +38 -0
- package/bin/facet-fold.mjs +31 -0
- package/bin/facet-load.mjs +16 -0
- package/bin/facet-mlp-scan.mjs +45 -0
- package/bin/facet-mvp.mjs +34 -0
- package/bin/facet-online-experiments.mjs +78 -0
- package/bin/facet-online-race.mjs +99 -0
- package/bin/facet-online-validate.mjs +51 -0
- package/bin/facet-panel.mjs +22 -0
- package/bin/facet-passage.mjs +41 -0
- package/bin/facet-random-validate.mjs +48 -0
- package/bin/facet-roleplay.mjs +33 -0
- package/bin/facet-scan.mjs +56 -0
- package/bin/facet-segment.mjs +34 -0
- package/bin/facet-train.mjs +19 -0
- package/bin/facet-validate.mjs +103 -0
- package/bin/facet-zeroshot.mjs +14 -0
- package/bin/install-templates.mjs +72 -0
- package/bin/memory-bench.mjs +53 -0
- package/bin/memory-build-summary.mjs +43 -0
- package/bin/memory-build-vector.mjs +31 -0
- package/bin/memory-build.mjs +41 -0
- package/bin/memory-calibration.mjs +70 -0
- package/bin/memory-closed-loop.mjs +119 -0
- package/bin/memory-dry-run.mjs +70 -0
- package/bin/memory-eval.mjs +104 -0
- package/bin/memory-event-alias-test.mjs +89 -0
- package/bin/memory-extraction-bench.mjs +58 -0
- package/bin/memory-load-gate-replay.mjs +137 -0
- package/bin/memory-loop-test.mjs +90 -0
- package/bin/memory-pre-turn-harness.mjs +63 -0
- package/bin/memory-query.mjs +39 -0
- package/bin/memory-replay-hints.mjs +84 -0
- package/bin/memory-scale.mjs +58 -0
- package/bin/memory-scenario-test.mjs +146 -0
- package/bin/memory-user-loop.mjs +95 -0
- package/bin/ner_bench_tiny_zh.py +59 -0
- package/bin/ner_bench_zh.py +60 -0
- package/bin/ner_conll_en.py +139 -0
- package/bin/ner_direct_en.py +123 -0
- package/bin/ner_direct_zh.py +100 -0
- package/bin/ner_pipeline.py +208 -0
- package/bin/noise-selfcheck.mjs +50 -0
- package/bin/pack-integrity.mjs +47 -0
- package/bin/panel-check.mjs +57 -0
- package/bin/plugin-integrity.mjs +74 -0
- package/bin/preview-live.mjs +13 -0
- package/bin/public-install-check.mjs +222 -0
- package/bin/relabel-apply.mjs +272 -0
- package/bin/relabel-dry-run.mjs +381 -0
- package/bin/relik_pipeline.py +39 -0
- package/bin/relik_service.py +52 -0
- package/bin/srl_pipeline.py +55 -0
- package/bin/srl_service.py +68 -0
- package/bin/summary-index.mjs +151 -0
- package/bin/summary-query.mjs +79 -0
- package/bin/vec-check.mjs +27 -0
- package/bin/zh_ner_error_audit.py +36 -0
- package/bin/zh_ner_slot_eval.py +38 -0
- package/client.js +760 -0
- package/cordis.patch.yml +378 -0
- package/docs/API-NOTES.md +1743 -0
- package/docs/ARCHITECTURE.md +355 -0
- package/docs/CACHE.md +253 -0
- package/docs/CONDUCT.md +30 -0
- package/docs/CREATOR-HANDOFF.md +102 -0
- package/docs/EXPERIMENT.md +136 -0
- package/docs/FACET-MVP-REPORT.md +473 -0
- package/docs/GUIDE-0.4.66.md +195 -0
- package/docs/GUIDE.md +127 -0
- package/docs/MECHANISM.md +243 -0
- package/docs/NEW-INSTANCE-HANDOFF.md +219 -0
- package/docs/README.md +37 -0
- package/docs/SESSION-LAYOUT.md +151 -0
- package/docs/history-map.md +249 -0
- package/docs/relabel-migration-wiring.md +366 -0
- package/guides/00-READ-FIRST.md +206 -0
- package/guides/01-INSTALL.md +207 -0
- package/guides/02-TABLES.md +225 -0
- package/guides/03-AUDIT.md +201 -0
- package/guides/04-REBUILD.md +306 -0
- package/guides/05-FIRST-RUN.md +191 -0
- package/guides/06-EMBEDDING.md +146 -0
- package/guides/07-PTC-AND-ASSETS.md +221 -0
- package/icon.svg +7 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/models/README.md +13 -0
- package/models/Xenova/bge-small-zh-v1.5/config.json +31 -0
- package/models/Xenova/bge-small-zh-v1.5/onnx/model_quantized.onnx +0 -0
- package/models/Xenova/bge-small-zh-v1.5/tokenizer.json +21278 -0
- package/models/Xenova/bge-small-zh-v1.5/tokenizer_config.json +15 -0
- package/package.json +139 -4
- package/src/asset-tool.mjs +237 -0
- package/src/assets.mjs +244 -0
- package/src/backfill.mjs +74 -0
- package/src/backup.mjs +80 -0
- package/src/deadend.mjs +95 -0
- package/src/deleted-store.mjs +35 -0
- package/src/engine.mjs +3831 -0
- package/src/facets/classifier.mjs +146 -0
- package/src/facets/embedding-service.mjs +53 -0
- package/src/facets/embedding-worker.mjs +27 -0
- package/src/facets/embedding.mjs +163 -0
- package/src/facets/extract.mjs +80 -0
- package/src/facets/fold-plan.mjs +84 -0
- package/src/facets/hybrid.mjs +29 -0
- package/src/facets/index.mjs +113 -0
- package/src/facets/linear-probe.mjs +43 -0
- package/src/facets/load.mjs +37 -0
- package/src/facets/mlp-probe.mjs +54 -0
- package/src/facets/mlp-service.mjs +53 -0
- package/src/facets/mlp-worker.mjs +26 -0
- package/src/facets/online-knn.mjs +58 -0
- package/src/facets/online-models.mjs +227 -0
- package/src/facets/panel-state.mjs +23 -0
- package/src/facets/panel.mjs +73 -0
- package/src/facets/random.mjs +26 -0
- package/src/facets/scanner.mjs +35 -0
- package/src/facets/schema.mjs +75 -0
- package/src/facets/seed-examples.mjs +58 -0
- package/src/facets/sensitivity.mjs +98 -0
- package/src/facets/service.mjs +53 -0
- package/src/facets/store.mjs +39 -0
- package/src/facets/worker.mjs +23 -0
- package/src/folds-store.mjs +109 -0
- package/src/groups.mjs +167 -0
- package/src/handoff-tool.mjs +51 -0
- package/src/handoff.mjs +127 -0
- package/src/index.mjs +649 -0
- package/src/inject-policy.mjs +17 -0
- package/src/learning.mjs +88 -0
- package/src/memory/alias-proposal.mjs +40 -0
- package/src/memory/bc-audit.mjs +245 -0
- package/src/memory/bc-index-updater.mjs +404 -0
- package/src/memory/bc-index.mjs +48 -0
- package/src/memory/bc-label.mjs +220 -0
- package/src/memory/bc-panel-state.mjs +107 -0
- package/src/memory/bc-pre-step.mjs +463 -0
- package/src/memory/bc-recall.mjs +470 -0
- package/src/memory/bc-shift.mjs +123 -0
- package/src/memory/bc-store.mjs +41 -0
- package/src/memory/bm25.mjs +112 -0
- package/src/memory/calibration.mjs +54 -0
- package/src/memory/chatter.mjs +29 -0
- package/src/memory/cmap-file.mjs +107 -0
- package/src/memory/concepts-file.mjs +41 -0
- package/src/memory/coref-slots.mjs +40 -0
- package/src/memory/event-alias-ledger.mjs +87 -0
- package/src/memory/event-log.mjs +95 -0
- package/src/memory/event-model.mjs +132 -0
- package/src/memory/event-segmenter.mjs +36 -0
- package/src/memory/event-summary-tree.mjs +122 -0
- package/src/memory/extraction-adapter.mjs +76 -0
- package/src/memory/extraction-composite.mjs +75 -0
- package/src/memory/extraction-core.mjs +76 -0
- package/src/memory/extraction-pre-step.mjs +161 -0
- package/src/memory/extraction-provider.mjs +300 -0
- package/src/memory/extraction-score.mjs +36 -0
- package/src/memory/facet-stabilizer.mjs +59 -0
- package/src/memory/history-map.mjs +139 -0
- package/src/memory/language-router.mjs +30 -0
- package/src/memory/load-gate.mjs +161 -0
- package/src/memory/mechanical-note.mjs +104 -0
- package/src/memory/onboarding.mjs +163 -0
- package/src/memory/persona.mjs +78 -0
- package/src/memory/planner.mjs +249 -0
- package/src/memory/pre-turn.mjs +80 -0
- package/src/memory/query-aliases.mjs +39 -0
- package/src/memory/recall-cue.mjs +43 -0
- package/src/memory/recall.mjs +65 -0
- package/src/memory/referent-candidates.mjs +55 -0
- package/src/memory/referent-ledger.mjs +86 -0
- package/src/memory/relabel-migrate.mjs +376 -0
- package/src/memory/relik-adapter.mjs +25 -0
- package/src/memory/special-keywords.mjs +60 -0
- package/src/memory/structured-adapters.mjs +75 -0
- package/src/memory/summary-index.mjs +335 -0
- package/src/memory/summary-tree.mjs +110 -0
- package/src/memory/term-extractor.mjs +44 -0
- package/src/memory/tokenize.mjs +9 -0
- package/src/memory/vector-index.mjs +54 -0
- package/src/memory/window-summary.mjs +133 -0
- package/src/mood.mjs +133 -0
- package/src/peer-tool.mjs +63 -0
- package/src/peer.mjs +144 -0
- package/src/policy.mjs +170 -0
- package/src/preflight.mjs +113 -0
- package/src/provenance.mjs +94 -0
- package/src/range.mjs +75 -0
- package/src/recall-exact-tool.mjs +267 -0
- package/src/recall-tool.mjs +521 -0
- package/src/recheck.mjs +99 -0
- package/src/save-start.mjs +29 -0
- package/src/session-guard.mjs +140 -0
- package/src/session-log-tool.mjs +322 -0
- package/src/session-log.mjs +606 -0
- package/src/skills.mjs +111 -0
- package/src/split-range.mjs +115 -0
- package/src/state.mjs +198 -0
- package/src/t0.mjs +149 -0
- package/src/tag-confirm.mjs +78 -0
- package/src/tag-detect.mjs +42 -0
- package/src/tag-maintenance.mjs +285 -0
- package/src/tag-reject.mjs +73 -0
- package/src/tags-store.mjs +94 -0
- package/src/tags.mjs +692 -0
- package/src/threads-backend.mjs +26 -0
- package/src/threads-core.mjs +1887 -0
- package/src/threads-store.mjs +207 -0
- package/src/threads-tool.mjs +522 -0
- package/src/threads.mjs +929 -0
- package/src/tool-preview.mjs +427 -0
- package/src/topic.mjs +63 -0
- package/src/training.mjs +75 -0
- package/src/turn-tag.mjs +62 -0
- package/src/user-turn.mjs +39 -0
- package/templates/cmap.md +11 -0
- package/templates/concepts.md +12 -0
- package/templates/habits.md +40 -0
- package/templates/keywords.md +6 -0
- package/templates/rebuild.md +134 -0
- package/templates/rules-safe.md +184 -0
- package/templates/rules.md +177 -0
package/INSTALL.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 安装
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
dsh plugin add ./dsh-continuity-4.11.36.tgz
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
装完重启 DSH。
|
|
8
|
+
|
|
9
|
+
第一次运行、首次 pre-step、空表含义、fold 验收,见:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
guides/00-READ-FIRST.md
|
|
13
|
+
guides/01-INSTALL.md
|
|
14
|
+
guides/05-FIRST-RUN.md
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
公共说明:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
README.md
|
|
21
|
+
PANEL.md
|
|
22
|
+
DISCLAIMER.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
不要跳过 `guides/00-READ-FIRST.md`。新 session 的 A/B/C/K 从空开始是正常状态。
|
package/PANEL.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# A/B/C/K 面板排错
|
|
2
|
+
|
|
3
|
+
A/B/C/K 不是 DSH 原生功能,是本插件注册的 UI:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
左侧栏“连续性”面板
|
|
7
|
+
右侧栏“A/B/C/K 标签”tab
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## 1. 先确认包里有 UI
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
client.js
|
|
14
|
+
package.json -> dsh.client.platform = "web"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
4.9.110+ 的 tgz 都带。
|
|
18
|
+
|
|
19
|
+
## 2. 连“连续性”入口都没有
|
|
20
|
+
|
|
21
|
+
说明 client 没加载,不是表为空。
|
|
22
|
+
|
|
23
|
+
按顺序检查:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
1. 装的是 dsh-continuity-*.tgz,不是只解压了 zip
|
|
27
|
+
2. 装进了当前使用的 profile
|
|
28
|
+
3. 安装后重启了 DSH
|
|
29
|
+
4. 当前 DSH 版本支持 sidebarRightTabs / sidebarRight
|
|
30
|
+
5. 浏览器刷新一次
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
可以运行诊断:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
node bin\panel-check.mjs --url http://127.0.0.1:<当前端口>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
它会告诉你:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
包版本
|
|
43
|
+
client.js 是否存在
|
|
44
|
+
dsh.client 是否声明
|
|
45
|
+
/dsh-continuity/state.json 是否能访问
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 3. 左侧有“连续性”,但右侧没有 ABCK
|
|
49
|
+
|
|
50
|
+
先在左侧面板里点:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
A / B / C / K 记忆标签
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
它会尝试调用:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
sidebarRight.openTab("continuityTags")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
如果提示“右侧栏服务不可用”,说明当前 DSH 版本没有 `sidebarRight` API,面板 tab 注册不了。
|
|
63
|
+
|
|
64
|
+
## 4. 有 tab,但打开是空表
|
|
65
|
+
|
|
66
|
+
正常:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
新 session 的 A/C/K 从空开始
|
|
70
|
+
B 从自己的第一轮开始
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
先发一轮消息,让 pre-step 建索引;面板会从:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
还没有 B 索引
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
变成:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
A/B/C/K 空表
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 5. 给对方的准确话术
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
A/B/C/K 是插件的右侧栏 UI,不是 DSH 自带。
|
|
89
|
+
如果连“连续性”都没有:插件 client 没加载,检查安装/重启/DSH 版本。
|
|
90
|
+
如果有“连续性”但没有 ABCK:DSH 缺少 sidebarRight API。
|
|
91
|
+
如果 tab 打开是空表:正常,先发一轮消息。
|
|
92
|
+
```
|
package/README.md
CHANGED
|
@@ -1,3 +1,287 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-continuity 4.12.2
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给 DSH 的长上下文连续性插件。每个 session 拥有自己完整的一套记忆;
|
|
4
|
+
persona 只是身份/启用标签。
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
session = 哪一段对话
|
|
8
|
+
persona = 哪个身份被允许运行(启用开关)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 它做什么
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
compaction 压缩带控制;session 内 pass 回执 + passes.jsonl
|
|
15
|
+
index 每个完成的人类轮次一条指针
|
|
16
|
+
A 每个 session 自己的概念表,分 topic / workflow
|
|
17
|
+
B 每轮标签(展示、特征材料)
|
|
18
|
+
C 每个 session 自己的用户词表
|
|
19
|
+
K 每个 session 自己的精确名
|
|
20
|
+
rules/habits 每个 session 自己的规则/偏好,从插件根模板起
|
|
21
|
+
recall A / B / C / K + 字面,只查当前 session
|
|
22
|
+
panel 每个 session 自己的 A/B/C/K
|
|
23
|
+
peer_message 明确投递给另一个 live session
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
不包含额外的提示词分类、自动标注或工作线注入;本包只负责记忆索引、压缩和检索。
|
|
27
|
+
|
|
28
|
+
## 每个 session 的完整一套
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
~/.dsh/continuity/sessions/<sessionId>/
|
|
32
|
+
bc-index.jsonl
|
|
33
|
+
bc-index-state.json
|
|
34
|
+
audit-state.json
|
|
35
|
+
expand-hint.jsonl
|
|
36
|
+
concepts.md A 表(名字 | 描述词 | 覆盖 | kind)
|
|
37
|
+
cmap.md C 表
|
|
38
|
+
keywords.md K 表
|
|
39
|
+
aliases.md 别名
|
|
40
|
+
rules.md 硬规则,从 templates/rules.md 起
|
|
41
|
+
habits.md 软偏好,从 templates/habits.md 起
|
|
42
|
+
rebuild.md 本地重建说明
|
|
43
|
+
dropped-ranges.json 本 session 的合并覆盖(seq 空间只属于本 session)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
共享/诊断:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
~/.dsh/continuity/
|
|
50
|
+
session-persona.json sessionId -> 身份
|
|
51
|
+
personas/<pid>/persona.json {"enabled": true}
|
|
52
|
+
folds.json
|
|
53
|
+
passes.jsonl
|
|
54
|
+
context-log.jsonl
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- A/C/K/rules/habits **不继承**另一个 session。
|
|
58
|
+
- 新 session:A/C/K 空,rules/habits 从插件根模板起。
|
|
59
|
+
- `personas/` 是弃用归档,已经不是读取路径。
|
|
60
|
+
- `session-persona.json` 只决定身份/启用,不决定词表路径。
|
|
61
|
+
|
|
62
|
+
## 安装
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
npm install @theseus-whale/dsh-continuity
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
装进目标 profile,备份 `~/.dsh/continuity`,重启 DSH。
|
|
69
|
+
进程是快照:只复制包不重启,运行时行为不变。
|
|
70
|
+
|
|
71
|
+
## 4.12.2 水位恢复
|
|
72
|
+
|
|
73
|
+
4.12.2 = 4.12.0 的水位线 + `maxPerBatch = high−protect`;**native LLM summary 保留,不启用 mechanical note。**
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
setpoint .76
|
|
77
|
+
high .76
|
|
78
|
+
low .38
|
|
79
|
+
emergency .85 -> .62
|
|
80
|
+
protect .20
|
|
81
|
+
maxPerBatch 443843
|
|
82
|
+
mechanicalNote false
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`protectCalibration` 不再显式关闭,回到 4.12.0 的默认行为。
|
|
86
|
+
|
|
87
|
+
`maxPerBatch 443843` 覆盖 high-protect 的 `443,842.56`:
|
|
88
|
+
实际 budget 仍是 `min(est − low, maxPerBatch)`,正常高线折约 301k,overshoot 不被 cap 截成二次小折。
|
|
89
|
+
|
|
90
|
+
`recall_exact` / `recall` / ABCK / gist / history-map 都不动。
|
|
91
|
+
4.13.x 的 mechanical note 只保留为实验代码,4.12.2 不启用。
|
|
92
|
+
|
|
93
|
+
## 4.12.0 新增
|
|
94
|
+
|
|
95
|
+
### recall_exact
|
|
96
|
+
|
|
97
|
+
字面搜索,独立于 `recall` 的语义路径;只读、不排序、不写。
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
recall_exact({ query: "0.2.17" })
|
|
101
|
+
recall_exact({ query: "stage19", since: 2200 })
|
|
102
|
+
recall_exact({ query: "coo-read-side", near: 2300, window: 20 })
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
规则:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
只搜 user + assistant 的 text
|
|
109
|
+
不搜 reasoning / tool-call
|
|
110
|
+
排除 continuity / 规则 / 系统注入文本
|
|
111
|
+
ASCII 用 [0-9A-Za-z] 边界;中文按子串
|
|
112
|
+
单个中文字必须白名单(目前只放“创”)
|
|
113
|
+
返回 totalTurns / totalIntervals / shown / turnShare
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
没有 path 参数;只查当前 session。
|
|
117
|
+
|
|
118
|
+
### native summary 是默认中间层
|
|
119
|
+
|
|
120
|
+
fold 仍由 DSH 原生 compaction 完成:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
系统选段 -> LLM 写 checkpoint -> replace 原区间
|
|
124
|
+
旧 summary 下次折入新 summary
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`history-map` 默认关闭:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
默认不注入 map
|
|
131
|
+
默认中间层就是 native checkpoint
|
|
132
|
+
auto / observe 只作实验档
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
需要时看 `docs/history-map.md`。
|
|
136
|
+
|
|
137
|
+
### summary-index / window 工具
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# 建当前 session 的摘要索引
|
|
141
|
+
node bin/summary-index.mjs --raw <session.v4.jsonl.zstd> \
|
|
142
|
+
--session-dir <continuity session dir> --apply
|
|
143
|
+
|
|
144
|
+
# 有 pending window 时生成抽取式摘要
|
|
145
|
+
node bin/summary-index.mjs ... --extract-pending --apply
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
默认不自动跑;`pendingWindows=0` 时不需要。
|
|
149
|
+
|
|
150
|
+
## recall
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
recall()
|
|
154
|
+
recall({ query: "跑团", recent: true })
|
|
155
|
+
recall({ query: "A标签" }) // 只看 topic
|
|
156
|
+
recall({ query: "A标签:topic" })
|
|
157
|
+
recall({ query: "A标签:workflow" })
|
|
158
|
+
recall({ query: "A标签:跑团叙事" }) // 任意 A 概念
|
|
159
|
+
recall({ query: "B标签" })
|
|
160
|
+
recall({ query: "C标签" })
|
|
161
|
+
recall({ query: "K标签" })
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
- 索引和 A/C/K 只读当前 session 的目录。
|
|
165
|
+
- A 直接查是“区域浏览”;B/C/K/字面是“精确点位”。
|
|
166
|
+
- `via` 是 `A | B | C | K | live`。
|
|
167
|
+
- 候选不是事实;必须打开对应 turn/seq。
|
|
168
|
+
|
|
169
|
+
### 词表刷新
|
|
170
|
+
|
|
171
|
+
- `concepts.md` / `cmap.md` 的 mtime 会在下一次 pre-step 检查,变了就重建本 session 的 labeler/cmap;不需要重启。
|
|
172
|
+
- `keywords.md` 在索引时读取,下一轮生效。
|
|
173
|
+
- `aliases.md` 由 recall 每次读取。
|
|
174
|
+
- 旧记录不会自动重标;新规则只作用于新轮次。
|
|
175
|
+
|
|
176
|
+
## 注入前缀
|
|
177
|
+
|
|
178
|
+
```text
|
|
179
|
+
[continuity:boot] 引导
|
|
180
|
+
[continuity:audit] 审计
|
|
181
|
+
[continuity:fold] 压缩回执
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
插件注入的 `role=user` 消息都以 `[continuity:*]` 开头。
|
|
185
|
+
`[追忆]` 是 recall 的 tool result,不是 user 通道注入。
|
|
186
|
+
|
|
187
|
+
## rules 头部
|
|
188
|
+
|
|
189
|
+
`rules.md` 按 H2 标题汇总。截断时写:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
…(共 18 节,仅显示前 13 节)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
数字从当前文件现算,不硬编码。
|
|
196
|
+
|
|
197
|
+
## session 启用 / 面板
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
session-persona.json:
|
|
201
|
+
<sessionId> -> continuity | <pid>
|
|
202
|
+
default -> continuity
|
|
203
|
+
|
|
204
|
+
personas/<pid>/persona.json:
|
|
205
|
+
{"enabled": true} -> 面板 + pre-step 启用
|
|
206
|
+
缺失/禁用 -> persona-disabled,关闭 tab
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
`continuity` 在旧安装里没文件也默认启用。
|
|
210
|
+
非 continuity session 也可以启用,但它的 A/C/K/rules/habits 仍然是
|
|
211
|
+
session-local,不继承 Continuity 的。
|
|
212
|
+
|
|
213
|
+
## 隔离边界
|
|
214
|
+
|
|
215
|
+
插件路径是 session-local。宿主还装了一个 best-effort 工具守卫:
|
|
216
|
+
session 只能碰自己的 `sessions/<id>/`,不能碰别的 session 的 continuity 文件。
|
|
217
|
+
|
|
218
|
+
这**不是 OS 安全边界**。拥有完整文件权限的任意代码可以绕过;强隔离需要
|
|
219
|
+
OS ACL/容器。守卫用于普通 edit/write/shell 工具。
|
|
220
|
+
|
|
221
|
+
## 标签版本
|
|
222
|
+
|
|
223
|
+
新记录用 `labelVersion: 2`:
|
|
224
|
+
|
|
225
|
+
```text
|
|
226
|
+
genericTopic [top topic]
|
|
227
|
+
topicScore top topic 分数
|
|
228
|
+
topicConfidence normal | low | weak(仅展示)
|
|
229
|
+
genericWorkflow [top1, top2]
|
|
230
|
+
generic topic + workflow 并集
|
|
231
|
+
conceptScores 选中的候选分数
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
旧记录是 `labelVersion: 1`,没有 `topicScore`;不原地回填。
|
|
235
|
+
|
|
236
|
+
## 代码地图
|
|
237
|
+
|
|
238
|
+
```text
|
|
239
|
+
src/index.mjs 宿主路由、面板 JSON、安装
|
|
240
|
+
src/engine.mjs 压缩带、pass 回执、gist/fold
|
|
241
|
+
src/state.mjs pass log、dropped-ranges
|
|
242
|
+
src/policy.mjs 压缩带数学与 floor
|
|
243
|
+
src/recall-tool.mjs A/B/C/K 检索,session 路径
|
|
244
|
+
src/memory/bc-pre-step.mjs 每 session 调度
|
|
245
|
+
src/memory/bc-index.mjs JSONL 指针编解码
|
|
246
|
+
src/memory/bc-index-updater.mjs 标签 + 追加一轮
|
|
247
|
+
src/memory/bc-panel-state.mjs 面板投影
|
|
248
|
+
src/memory/concepts-file.mjs A 解析(kind: topic|workflow)
|
|
249
|
+
src/memory/persona.mjs session -> 身份/路径
|
|
250
|
+
src/memory/onboarding.mjs boot marker/空壳
|
|
251
|
+
src/memory/bc-audit.mjs 审计 + 待注入提示
|
|
252
|
+
src/threads-store.mjs 每 session rules/habits
|
|
253
|
+
src/folds-store.mjs folds.json 历史
|
|
254
|
+
src/session-guard.mjs best-effort 工具路径守卫
|
|
255
|
+
client.js 右侧面板
|
|
256
|
+
cordis.patch.yml bundle patch
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## 文档
|
|
260
|
+
|
|
261
|
+
```text
|
|
262
|
+
README.md 本文件
|
|
263
|
+
RELEASE-NOTES.md 验收状态与已知限制
|
|
264
|
+
PANEL.md 面板排错与诊断
|
|
265
|
+
bin/panel-check.mjs 面板/宿主路由自检
|
|
266
|
+
docs/README.md 现行/历史文档索引
|
|
267
|
+
docs/SESSION-LAYOUT.md 权威路径、角色、权限
|
|
268
|
+
docs/ARCHITECTURE.md 当前架构
|
|
269
|
+
docs/NEW-INSTANCE-HANDOFF.md 新实例交接
|
|
270
|
+
guides/00-READ-FIRST.md 经典 00–07 说明书
|
|
271
|
+
guides/01-INSTALL.md
|
|
272
|
+
guides/02-TABLES.md
|
|
273
|
+
guides/03-AUDIT.md
|
|
274
|
+
guides/04-REBUILD.md 九步重建
|
|
275
|
+
guides/05-FIRST-RUN.md
|
|
276
|
+
guides/06-EMBEDDING.md 本地嵌入
|
|
277
|
+
guides/07-PTC-AND-ASSETS.md PTC / 子 agent / assets
|
|
278
|
+
templates/rebuild.md 当前布局的重建流程
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
`docs/*.md` 全部随包发布;`docs/README.md` 区分现行与历史。
|
|
282
|
+
历史文档是设计档案,不是现行操作说明。
|
|
283
|
+
|
|
284
|
+
## 安全
|
|
285
|
+
|
|
286
|
+
不要从 session 内修改已安装的插件、`cordis.patch.yml`、package 文件或
|
|
287
|
+
lockfile。插件变更走独立副本、测试、备份、替换。
|