stratagate-dsh 0.2.95 → 0.2.97

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/docs/DSH.md CHANGED
@@ -87,7 +87,7 @@ Activated memory uses the current human message plus the latest two open-tail tu
87
87
 
88
88
  Automatic context contains only compact Event and fact fields from other conversations and is explicitly marked as historical background rather than instructions. Current-session Block evidence is excluded because each Block's current decayed representation already exists in native DSH history. Building automatic context never calls `recordMemoryUse`, increments `mentionCount`, or changes `lastAdoptedTurn`. The existing `memory_*` tools remain available for deeper, evidence-gated retrieval and are the only path to adoption reinforcement.
89
89
 
90
- Every explicit retrieval creates an independent batch. The model passes its `batch_id` to `memory_assess`, then closes that same batch with `memory_record_use`. It passes the exact `evidence_refs` from that batch used in its answer, or `[]` when it used none. Selected Event evidence is reinforced once; an empty list writes a zero-increment receipt with the real batch ID.
90
+ Every explicit retrieval creates an independent batch. All batches must complete Evidence Gate and `memory_record_use` before the final user answer starts: retrieve → assess → close all batches → answer. If the stop callback finds omitted receipts, it first steers cleanup; after all receipts succeed, the answer step receives an instruction to restate the complete user answer and exposes no tools. Internal batch status must never replace the answer. Normal turns do not repeat answers. Recovery with no progress reports an error instead of steering indefinitely. The model passes its `batch_id` to `memory_assess`, then closes that same batch with `memory_record_use`. It passes the exact `evidence_refs` from that batch used in its answer, or `[]` when it used none. Selected Event evidence is reinforced once; an empty list writes a zero-increment receipt with the real batch ID.
91
91
 
92
92
  ### Agent-recorded memory
93
93
 
@@ -170,7 +170,9 @@ Open DSH Settings and select **StrataGate-AgentMemory**. The page provides:
170
170
 
171
171
  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.
172
172
 
173
- 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.
173
+ The primary Persistent Profile tab shows eleven fixed fields in compact groups, one field at a time. An existing `homeCity` value adds a separate editable legacy row. 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. The stored Profile has twelve fields with Unicode code-point limits of 100/100/100/100/200/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 seven short fields. Event extraction and Graph projection never write Profile fields.
174
+
175
+ The Common addresses group has a usual/default address (`defaultLocation`, 200 characters) and current city (`currentCity`, 100 characters). A travel or business-trip city can be temporary while its saved value remains injected across sessions until the user updates or clears it; it does not expire automatically. Local tasks use an explicit task location first, otherwise current city when set, then default location. Existing `homeCity` (100 characters) retains its original residence meaning and remains editable when nonempty; it is never copied into current city. Updates retain the Profile explicit-request or proposal-and-consent rule. Old databases read missing fields as empty, using the existing field storage, revisions, and audit trail without a new database migration.
174
176
 
175
177
  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.
176
178
 
package/docs/DSH.zh-CN.md CHANGED
@@ -87,7 +87,7 @@ DSH_HOME/stratagate/memory.db
87
87
 
88
88
  自动上下文只包含来自其他会话的精简 Event 与 fact 字段,并明确标注为历史背景而非指令。当前会话 Block 的证据会被排除,因为每个 Block 当前衰减层级的表示已存在于 DSH 原生历史中。构建自动上下文不会调用 `recordMemoryUse`,不会增加 `mentionCount`,也不会更新 `lastAdoptedTurn`。现有 `memory_*` 工具仍用于更深入、经过 Evidence Gate 的主动检索,也是触发采用强化的唯一入口。
89
89
 
90
- 每次主动检索都会创建独立批次。模型先把该批次的 `batch_id` 传给 `memory_assess`,再用 `memory_record_use` 结算同一批次。模型需要传入回答中实际使用且属于该批次的 `evidence_refs`;若一条也没有使用,则传入 `[]`。被选中的 Event 证据会强化一次,空数组会写入一条包含真实批次 ID 的零强化回执。
90
+ 每次主动检索都会创建独立批次。所有批次必须在开始输出最终用户回答之前完成 Evidence Gate 与 `memory_record_use`:检索 → 评估 → 全部结算 → 最终回答。若停止回调发现漏关批次,它先要求补结算,全部完成后的回答步骤会收到重述完整用户答案的指令且不再提供工具;批次状态不能作为最终答案。无漏关批次时不补答。兜底连续没有进展时会报告错误,不会无限 steer。模型先把该批次的 `batch_id` 传给 `memory_assess`,再用 `memory_record_use` 结算同一批次。模型需要传入回答中实际使用且属于该批次的 `evidence_refs`;若一条也没有使用,则传入 `[]`。被选中的 Event 证据会强化一次,空数组会写入一条包含真实批次 ID 的零强化回执。
91
91
 
92
92
  ### Agent 主动记忆
93
93
 
@@ -142,7 +142,9 @@ ID、`blockId`、角色、轮次和有界摘录。`narrative`、`quotes`、来
142
142
 
143
143
  界面不允许直接编辑、删除或批准 Event、图谱事实和来源消息。用户可以手动展开 Block、导入其他 AI 的记忆,以及在“高级设置”中修改每个 Block 包含的完整对话轮数或全局 Block 衰减系数 λ。修改轮数时,界面会解释两者关系并给出保持单位对话衰减速度的建议 λ,是否采用由用户决定。保存后设置立即应用到所有已有工作区,同时成为新工作区默认值,并在重启后保持;已封存 Block 不会重新切分。
144
144
 
145
- 顶部“常驻画像”页面可编辑固定的九项字段。页面按身份与语言、交互偏好、关于用户、其他分组,默认紧凑显示;编辑时只展开一个字段。“默认回答语言”仅用于最终回复,“思考过程语言”仅用于宿主界面向用户展示的 reasoning/thinking 文本(若支持),两项互不推导;后者为空时不额外要求思考语言,也不控制隐藏的内部推理。页面可见时约每 5 秒读取最新画像,隐藏或离开时停止,并保留正在编辑的草稿。同一字段被其他来源修改时会提示冲突,保存不会覆盖新值。Settings 与 `memory_profile_update` 修改同一份安装级画像,跨会话、跨命名空间生效;保存后下一次模型调用立即看到新值,空字段不注入。字段按 Unicode 码点计数,上限依次为 100、100、100、100、1000、1000、1500、1000、1200 字符,总预算 6000 字符;总容量 4800 字符触发后台整理。SQLite 会记录 Settings、工具及后台整理的每次变更、旧值和来源。后台整理在首次写入非空画像或上次成功整理满 24 小时后,或达到容量阈值时执行;只读取当前画像,只压缩表达,不新增事实,也不语义改写四个短字段。Event 提取和 Graph 投影都不会写入画像。
145
+ 顶部“常驻画像”页面默认显示十一项字段;旧常驻城市有值时额外保留一项编辑入口。页面按身份与语言、交互偏好、常用地址、关于用户、其他分组,默认紧凑显示;编辑时只展开一个字段。“默认回答语言”仅用于最终回复,“思考过程语言”仅用于宿主界面向用户展示的 reasoning/thinking 文本(若支持),两项互不推导;后者为空时不额外要求思考语言,也不控制隐藏的内部推理。页面可见时约每 5 秒读取最新画像,隐藏或离开时停止,并保留正在编辑的草稿。同一字段被其他来源修改时会提示冲突,保存不会覆盖新值。Settings 与 `memory_profile_update` 修改同一份安装级画像,跨会话、跨命名空间生效;保存后下一次模型调用立即看到新值,空字段不注入。存储结构有十二项字段,按 Unicode 码点计数,上限依次为 100、100、100、100、200、100、100、1000、1000、1500、1000、1200 字符,总预算 6000 字符;总容量 4800 字符触发后台整理。SQLite 会记录 Settings、工具及后台整理的每次变更、旧值和来源。后台整理在首次写入非空画像或上次成功整理满 24 小时后,或达到容量阈值时执行;只读取当前画像,只压缩表达,不新增事实,也不语义改写七个短字段。Event 提取和 Graph 投影都不会写入画像。
146
+
147
+ “常用地址”显示“常驻地址(未说明时默认地址)”(`defaultLocation`,200 字符)和“当前所在城市(临时)”(`currentCity`,100 字符),没有附加说明段落。当前城市可记录旅游、出差所在地;“临时”不限制保存时长,值会跨会话持续注入,直到用户修改或清空,不自动过期。本地任务先用明确指定的地点,否则优先当前城市,为空时再用常驻/默认地址。旧 `homeCity`(100 字符)保留原来的稳定常驻城市含义,有值时仍可编辑,不自动复制成当前城市。所有更新沿用明确修改请求或先提议再获确认的授权规则。旧数据库缺少字段时读取为空,沿用原字段存储、修订与审计机制,无需新的数据库迁移。
146
148
 
147
149
  当前界面会在写入前校验并预览粘贴的 `stratagate.external-memory.v2` JSON:不合格内容会进入模型兜底恢复,恢复候选全部需要人工确认。完全重复项会被确定性忽略,其余候选由当前模型结合 Top-K 本地 Event 判断新增、合并、取代、冲突或忽略。分析任务和逐条进度持久化到 SQLite,关闭并重新打开页面后会恢复进度;高置信度判断自动采用,低置信度项可由用户选择具体动作;提交后可按批次撤销。消息内容和结构化工具轨迹中的常见令牌及凭证格式,会在离开本地服务器前被脱敏。SQLite 数据库始终是唯一可信数据源。
148
150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stratagate-dsh",
3
- "version": "0.2.95",
3
+ "version": "0.2.97",
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",