stratagate-dsh 0.2.81 → 0.2.83
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/CHANGELOG.md +11 -0
- package/dist/client.js +7 -2
- package/dist/plugin.js +386 -14
- package/dist/plugin.js.map +1 -1
- package/docs/DSH.md +5 -2
- package/docs/DSH.zh-CN.md +5 -2
- package/docs/assets/stratagate-profile-0.2.83-conflict.png +0 -0
- package/docs/assets/stratagate-profile-0.2.83-lower.png +0 -0
- package/docs/assets/stratagate-profile-0.2.83-reasoning-conflict.png +0 -0
- package/docs/assets/stratagate-profile-0.2.83.png +0 -0
- package/package.json +3 -1
package/docs/DSH.md
CHANGED
|
@@ -81,7 +81,7 @@ Removing the plugin does not delete that database.
|
|
|
81
81
|
- Each DSH turn has a durable ingestion receipt, so replay or retry cannot store it twice.
|
|
82
82
|
- StrataGate performs Block summarization, Event extraction, versioned Knowledge Graph projection, search, Evidence Gate, and use-only reinforcement.
|
|
83
83
|
- When a Block reaches its boundary, StrataGate first seals durable L3-L5 without touching the DSH surface. Only after validated L0-L2 and Event processing make the Block ready does the plugin use native surface `replace`; pending or failed Blocks keep their original conversation messages. Later decay, manual lift, or λ changes update only ready checkpoints. Unsealed open-tail messages and complete tool-call/result chains remain native DSH messages.
|
|
84
|
-
- Before every main-model call, dynamic
|
|
84
|
+
- Before every main-model call, a separate Persistent Profile context injects its nonempty global fields without retrieval. The dynamic memory context injects up to four project-scoped activated Events and four active Graph nodes. It never serializes the current conversation, open tail, sealed Blocks, or tool calls into that prompt.
|
|
85
85
|
|
|
86
86
|
Activated memory uses the current human message plus the latest two open-tail turns from the current session as its query. Existing BM25 search remains the lexical relevance gate; pinned and safety memory are the only exceptions. Existing memory weights provide a second ranking, and RRF fuses the relevance and weight rankings. The activated section has a fixed budget of about 900 tokens, so it does not grow with the database.
|
|
87
87
|
|
|
@@ -97,6 +97,7 @@ memory_search_graph memory_expand_graph_node
|
|
|
97
97
|
memory_search_raw memory_get_blocks
|
|
98
98
|
memory_expand_block memory_assess
|
|
99
99
|
memory_record_use
|
|
100
|
+
memory_profile_update
|
|
100
101
|
```
|
|
101
102
|
|
|
102
103
|
`memory_get_blocks` accepts `scope=session` (the default, preserving the historical
|
|
@@ -131,7 +132,9 @@ Open DSH Settings and select **StrataGate-AgentMemory**. The page provides:
|
|
|
131
132
|
- manual Block expansion and a two-step external-memory import flow;
|
|
132
133
|
- a Usage Audit chain from a recorded answer turn, through the Evidence Gate verdict and selected memories, back to source messages.
|
|
133
134
|
|
|
134
|
-
Events, graph facts, and source messages cannot be edited, deleted, or approved in the UI. The UI can
|
|
135
|
+
Events, graph facts, and source messages cannot be edited, deleted, or approved in the UI. The UI can manually expand a Block, import memory exported by another AI, and change the completed turns per Block or the global Block decay coefficient λ in Advanced Settings. When the Block size changes, the UI explains their relationship and suggests a λ that preserves the decay rate per conversation turn; the user decides whether to adopt it. Saved settings immediately apply to every existing workspace, become the defaults for future workspaces, and survive restarts. Existing sealed Blocks are never repartitioned.
|
|
136
|
+
|
|
137
|
+
The primary Persistent Profile tab edits nine fixed fields in compact groups, one field at a time. It refreshes about every five seconds while visible, preserves an open draft, and prevents a stale same-field save from overwriting a concurrent change. The same installation-wide Profile is used by `memory_profile_update`, across sessions and namespaces. The preferred answer language applies only to the final answer; the independent visible reasoning language applies only to reasoning/thinking text exposed by the host UI when supported, never to hidden internal reasoning. An empty visible reasoning language adds no extra requirement. Each saved field takes effect on the next model call; empty fields are omitted. Profile values use Unicode code-point limits of 100/100/100/100/1000/1000/1500/1000/1200 characters, with a 6000-character total budget and a 4800-character maintenance trigger. The SQLite database records each Settings, tool, and maintenance change with its previous value and source. Maintenance runs when 24 hours have passed since the first nonempty write or the last successful run, or when a capacity threshold is reached; it sees only the current Profile and may compress wording without adding facts or semantically rewriting the four short fields. Event extraction and Graph projection never write Profile fields.
|
|
135
138
|
|
|
136
139
|
The UI validates and previews pasted `stratagate.external-memory.v2` JSON before writing. Malformed input uses a model-backed recovery fallback whose candidates always require review. Exact duplicates are ignored deterministically; the configured model adjudicates other candidates against Top-K local Events as add, merge, supersede, conflict, or ignore. Analysis jobs persist per-candidate progress in SQLite, resume after the import page is reopened, and let users choose the action for low-confidence decisions. High-confidence decisions remain automatic, and a committed import can be undone as one batch. Common token and credential patterns are redacted in message content and structured tool traces before they leave the local server. The SQLite database remains the source of truth.
|
|
137
140
|
|
package/docs/DSH.zh-CN.md
CHANGED
|
@@ -81,7 +81,7 @@ DSH_HOME/stratagate/memory.db
|
|
|
81
81
|
- 每个 DSH 对话轮次都有持久化的写入回执,因此重放或重试不会导致重复保存。
|
|
82
82
|
- StrataGate 会执行 Block 摘要、Event 提取、版本化 Knowledge Graph 投影、搜索、Evidence Gate(证据门控)以及仅在使用后触发的强化。
|
|
83
83
|
- Block 到达边界时,StrataGate 先持久化真实的 L3–L5,不修改 DSH surface。只有 L0–L2 校验通过且 Event 处理完成、Block 进入可衰减状态后,插件才使用原生 surface `replace`;待处理或失败的 Block 始终保留原始会话消息。后续衰减、手动提升或 λ 调整也只更新已就绪 checkpoint。尚未封存的 open tail 与完整工具调用/结果链继续作为 DSH 原生消息保留。
|
|
84
|
-
-
|
|
84
|
+
- 每次主模型调用前,独立的常驻画像上下文无需检索就注入非空的全局字段。动态记忆上下文另注入最多 4 条项目级激活 Event 和 4 个 active Graph Node,不会把当前对话、open tail、已封 Block 或工具调用序列化进该上下文。
|
|
85
85
|
|
|
86
86
|
激活查询由当前人类消息和当前会话 open tail 的最近两个 turn 组成。现有 BM25 搜索继续作为词面相关性门槛,只有 pinned 和 safety 记忆可以例外进入候选;现有记忆权重提供第二路排序,再由 RRF 融合相关性与权重排序。激活区固定使用约 900 tokens 的预算,不会随数据库增大而增长。
|
|
87
87
|
|
|
@@ -97,6 +97,7 @@ memory_search_graph memory_expand_graph_node
|
|
|
97
97
|
memory_search_raw memory_get_blocks
|
|
98
98
|
memory_expand_block memory_assess
|
|
99
99
|
memory_record_use
|
|
100
|
+
memory_profile_update
|
|
100
101
|
```
|
|
101
102
|
|
|
102
103
|
`memory_get_blocks` 支持 `scope=session`(默认值,保留历史上的当前会话隔离语义)和
|
|
@@ -128,7 +129,9 @@ ID、`blockId`、角色、轮次和有界摘录。`narrative`、`quotes`、来
|
|
|
128
129
|
- 手动展开 Block,以及分两步导入其他 AI 的记忆;
|
|
129
130
|
- Usage Audit(使用审计)链路:从已记录的回答轮次出发,经由 Evidence Gate 的判断与选中的记忆,追溯到来源消息。
|
|
130
131
|
|
|
131
|
-
界面不允许直接编辑、删除或批准 Event
|
|
132
|
+
界面不允许直接编辑、删除或批准 Event、图谱事实和来源消息。用户可以手动展开 Block、导入其他 AI 的记忆,以及在“高级设置”中修改每个 Block 包含的完整对话轮数或全局 Block 衰减系数 λ。修改轮数时,界面会解释两者关系并给出保持单位对话衰减速度的建议 λ,是否采用由用户决定。保存后设置立即应用到所有已有工作区,同时成为新工作区默认值,并在重启后保持;已封存 Block 不会重新切分。
|
|
133
|
+
|
|
134
|
+
顶部“常驻画像”页面可编辑固定的九项字段。页面按身份与语言、交互偏好、关于用户、其他分组,默认紧凑显示;编辑时只展开一个字段。“默认回答语言”仅用于最终回复,“思考过程语言”仅用于宿主界面向用户展示的 reasoning/thinking 文本(若支持),两项互不推导;后者为空时不额外要求思考语言,也不控制隐藏的内部推理。页面可见时约每 5 秒读取最新画像,隐藏或离开时停止,并保留正在编辑的草稿。同一字段被其他来源修改时会提示冲突,保存不会覆盖新值。Settings 与 `memory_profile_update` 修改同一份安装级画像,跨会话、跨命名空间生效;保存后下一次模型调用立即看到新值,空字段不注入。字段按 Unicode 码点计数,上限依次为 100、100、100、100、1000、1000、1500、1000、1200 字符,总预算 6000 字符;总容量 4800 字符触发后台整理。SQLite 会记录 Settings、工具及后台整理的每次变更、旧值和来源。后台整理在首次写入非空画像或上次成功整理满 24 小时后,或达到容量阈值时执行;只读取当前画像,只压缩表达,不新增事实,也不语义改写四个短字段。Event 提取和 Graph 投影都不会写入画像。
|
|
132
135
|
|
|
133
136
|
当前界面会在写入前校验并预览粘贴的 `stratagate.external-memory.v2` JSON:不合格内容会进入模型兜底恢复,恢复候选全部需要人工确认。完全重复项会被确定性忽略,其余候选由当前模型结合 Top-K 本地 Event 判断新增、合并、取代、冲突或忽略。分析任务和逐条进度持久化到 SQLite,关闭并重新打开页面后会恢复进度;高置信度判断自动采用,低置信度项可由用户选择具体动作;提交后可按批次撤销。消息内容和结构化工具轨迹中的常见令牌及凭证格式,会在离开本地服务器前被脱敏。SQLite 数据库始终是唯一可信数据源。
|
|
134
137
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stratagate-dsh",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.83",
|
|
4
4
|
"description": "Recent conversations stay vivid. Older ones fade into summaries, not oblivion. StrataGate gives DeepSeek Harness six-layer, time-decaying memory, while lasting events and relationships settle into a knowledge graph. Bring your memories from other AIs with you—no need to start over.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"check:workbuddy": "npm run check --workspace stratagate-workbuddy",
|
|
57
57
|
"test": "npm run test:core && npm run test:dsh && npm run test:workbuddy",
|
|
58
58
|
"test:dsh": "vitest run --config vitest.config.ts",
|
|
59
|
+
"test:profile-browser": "node scripts/test-profile-browser.mjs",
|
|
59
60
|
"test:core": "npm run test --workspace @diqier/stratagate",
|
|
60
61
|
"test:workbuddy": "npm run test --workspace stratagate-workbuddy",
|
|
61
62
|
"verify:dsh": "npm run build:dsh && node scripts/verify-package.mjs && npm pack --ignore-scripts --pack-destination . && node scripts/verify-dsh-install.mjs",
|
|
@@ -223,6 +224,7 @@
|
|
|
223
224
|
"cytoscape": "^3.34.1",
|
|
224
225
|
"cytoscape-fcose": "^2.2.0",
|
|
225
226
|
"esbuild": "^0.28.2",
|
|
227
|
+
"playwright-core": "^1.63.0",
|
|
226
228
|
"tsup": "^8.5.0",
|
|
227
229
|
"typescript": "^5.7.0",
|
|
228
230
|
"vitest": "^3.0.0"
|