stratagate-dsh 0.3.39 → 0.3.41

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 (42) hide show
  1. package/CHANGELOG.md +732 -731
  2. package/CONTRIBUTING.md +99 -88
  3. package/CONTRIBUTING.zh-CN.md +90 -88
  4. package/LICENSE +21 -21
  5. package/README.md +510 -489
  6. package/README.zh-CN.md +514 -493
  7. package/benchmarks/locomo-conv26-r8-final.json +146 -146
  8. package/cordis.patch.yml +16 -16
  9. package/dist/client.d.ts +1 -1
  10. package/dist/client.js +3 -2
  11. package/dist/index.js.map +1 -1
  12. package/dist/plugin.js +137 -52
  13. package/dist/plugin.js.map +1 -1
  14. package/dist/repair-profile.js +0 -0
  15. package/dist/repair-profile.js.map +1 -1
  16. package/docs/ARCHITECTURE.md +282 -282
  17. package/docs/DSH.md +337 -337
  18. package/docs/DSH.zh-CN.md +325 -319
  19. package/docs/EVALUATION.md +189 -189
  20. package/docs/EXTERNAL_MEMORY_IMPORT.zh-CN.md +99 -99
  21. package/docs/MEMORY_TOPICS.zh-CN.md +51 -51
  22. package/docs/benchmarks/issue-128-windows-review.json +104 -104
  23. package/docs/benchmarks/issue-128-windows.json +103 -103
  24. package/docs/database-access.md +32 -32
  25. package/docs/dreaming-agent.md +69 -69
  26. package/docs/event-extractor.md +48 -48
  27. package/docs/feedback.md +50 -50
  28. package/docs/issue-128-lease-cache-review-followup.md +55 -55
  29. package/docs/issue-128-review-followup.md +58 -58
  30. package/docs/knowledge-graph.md +38 -38
  31. package/docs/npm-release.md +55 -53
  32. package/docs/surface-maintenance.md +36 -36
  33. package/docs/user-operation-priority.md +46 -39
  34. package/docs/validation/issue119-after.json +30 -0
  35. package/docs/validation/issue119-before.json +94 -0
  36. package/docs/validation/issue119.md +41 -41
  37. package/docs/validation/workspace-cleanup-20261020.md +36 -36
  38. package/package.json +2 -1
  39. package/packages/core/examples/basic.ts +87 -87
  40. package/packages/core/src/blocks.ts +442 -442
  41. package/packages/core/src/weights.ts +21 -21
  42. package/screenshots.json +8 -8
package/CONTRIBUTING.md CHANGED
@@ -1,88 +1,99 @@
1
- # Contributing to StrataGate
2
-
3
- Thank you for helping improve StrataGate. Contributions of code, tests, documentation, bug reports, design feedback, and reproducible evaluations are all valuable.
4
-
5
- [中文贡献指南](CONTRIBUTING.zh-CN.md)
6
-
7
- ## Before you start
8
-
9
- - Search the [existing Gitee issues](https://gitee.com/diqier4123/StrataGate-AgentMemory/issues) before opening a new one.
10
- - For a bug, include the relevant integration, Node.js version, reproduction steps, expected behavior, and actual behavior.
11
- - For a substantial feature or architectural change, open an issue first so the approach and scope can be discussed before implementation.
12
- - Never include private conversations, credentials, API keys, or other sensitive data in issues, tests, fixtures, or pull requests. Report security issues according to [`SECURITY.md`](SECURITY.md).
13
-
14
- By participating, you agree to follow the [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
15
-
16
- ## Ways to contribute
17
-
18
- Useful contributions include:
19
-
20
- - fixing a reproducible bug or adding a regression test;
21
- - clarifying setup, usage, architecture, or evaluation documentation;
22
- - improving the shared memory engine in `packages/core/`;
23
- - improving the DeepSeek Harness adapter in `src/`;
24
- - improving an integration such as `integrations/workbuddy/`;
25
- - adding a carefully documented benchmark or evaluation;
26
- - improving accessibility, error messages, or developer experience.
27
-
28
- Small, focused changes are welcome. A pull request does not need to introduce a large feature to be useful.
29
-
30
- ## Development setup
31
-
32
- StrataGate is an npm workspace monorepo. Use Node.js `22.19.0` or a newer 22.x release, or Node.js 24 and above. The project runs the local checks below while GitHub CI remains unavailable.
33
-
34
- ```bash
35
- git clone https://gitee.com/diqier4123/StrataGate-AgentMemory.git
36
- cd StrataGate-AgentMemory
37
- npm ci
38
- ```
39
-
40
- Run the main local checks:
41
-
42
- ```bash
43
- npm run check
44
- npm test
45
- npm run build
46
- ```
47
-
48
- You can also run a narrower command while iterating:
49
-
50
- ```bash
51
- npm run check:core
52
- npm run test:core
53
- npm run check:dsh
54
- npm run test:dsh
55
- npm run check:workbuddy
56
- npm run test:workbuddy
57
- ```
58
-
59
- ## Making a change
60
-
61
- 1. Create a branch from the latest `main`.
62
- 2. Keep the change focused and avoid unrelated formatting or refactoring.
63
- 3. Add or update tests when behavior changes. A bug fix should ideally include a regression test.
64
- 4. Update the relevant English and Chinese documentation when user-facing behavior changes.
65
- 5. Run the checks that cover your change; run the complete check, test, and build suite before opening a pull request when practical.
66
-
67
- Memory behavior is especially sensitive to provenance, timestamps, scope isolation, deterministic ordering, and evidence sufficiency. Changes in these areas should include focused tests for their invariants and edge cases.
68
-
69
- ## Pull requests
70
-
71
- A helpful pull request includes:
72
-
73
- - a concise explanation of the problem and the chosen solution;
74
- - links to relevant issues or discussions;
75
- - the tests and commands used to verify the change;
76
- - screenshots or recordings for visible UI changes;
77
- - documentation updates for changed behavior or configuration;
78
- - benchmark details and machine-readable artifacts for performance or accuracy claims.
79
-
80
- Please keep commits reviewable and respond to review feedback constructively. Maintainers may ask to split a broad pull request into smaller changes.
81
-
82
- ## Reporting evaluation results
83
-
84
- Evaluation claims should be reproducible. Record the dataset or subset, model and configuration, prompts, run count, scoring method, comparison conditions, and relevant artifact hashes. Clearly distinguish complete-system comparisons from component ablations, and avoid generalizing beyond the evaluated scope.
85
-
86
- ## License
87
-
88
- By contributing, you agree that your contributions will be licensed under the project's [MIT License](LICENSE).
1
+ # Contributing to StrataGate
2
+
3
+ Thank you for helping improve StrataGate. Contributions of code, tests, documentation, bug reports, design feedback, and reproducible evaluations are all valuable.
4
+
5
+ [中文贡献指南](CONTRIBUTING.zh-CN.md)
6
+
7
+ ## Before you start
8
+
9
+ - Search the [existing Gitee issues](https://gitee.com/diqier4123/StrataGate-AgentMemory/issues) before opening a new one.
10
+ - For a bug, include the relevant integration, Node.js version, reproduction steps, expected behavior, and actual behavior.
11
+ - For a substantial feature or architectural change, open an issue first so the approach and scope can be discussed before implementation.
12
+ - Never include private conversations, credentials, API keys, or other sensitive data in issues, tests, fixtures, or pull requests. Report security issues according to [`SECURITY.md`](SECURITY.md).
13
+
14
+ By participating, you agree to follow the [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
15
+
16
+ ## Ways to contribute
17
+
18
+ Useful contributions include:
19
+
20
+ - fixing a reproducible bug or adding a regression test;
21
+ - clarifying setup, usage, architecture, or evaluation documentation;
22
+ - improving the shared memory engine in `packages/core/`;
23
+ - improving the DeepSeek Harness adapter in `src/`;
24
+ - improving an integration such as `integrations/workbuddy/`;
25
+ - adding a carefully documented benchmark or evaluation;
26
+ - improving accessibility, error messages, or developer experience.
27
+
28
+ Small, focused changes are welcome. A pull request does not need to introduce a large feature to be useful.
29
+
30
+ ## Development setup
31
+
32
+ StrataGate is an npm workspace monorepo. Use Node.js `22.19.0` or a newer 22.x release, or Node.js 24 and above. Run the local checks below; GitHub CI is required again following account recovery on 2026-11-05.
33
+
34
+ ```bash
35
+ git clone https://gitee.com/diqier4123/StrataGate-AgentMemory.git
36
+ cd StrataGate-AgentMemory
37
+ npm ci
38
+ ```
39
+
40
+ Run the main local checks:
41
+
42
+ ```bash
43
+ npm run check
44
+ npm test
45
+ npm run build
46
+ ```
47
+
48
+ You can also run a narrower command while iterating:
49
+
50
+ ```bash
51
+ npm run check:core
52
+ npm run test:core
53
+ npm run check:dsh
54
+ npm run test:dsh
55
+ npm run check:workbuddy
56
+ npm run test:workbuddy
57
+ ```
58
+
59
+ DSH compatibility checks are tiered. Pull requests run the oldest supported
60
+ boundary (`0.1.2-rc.1`), the last 0.1 host (`0.1.7-rc.2`), and the current
61
+ host (`0.2.1-rc.5`) on Ubuntu and Windows. The 0.2 migration boundary
62
+ (`0.2.0-rc.2`) stays in the historical matrix because its Windows tests are
63
+ timing/lock sensitive. The complete historical matrix runs nightly from
64
+ `.github/workflows/dsh-compatibility-full.yml`; release verification can opt
65
+ into it with the `full_dsh_matrix` input when a change affects host interfaces,
66
+ migrations, storage, installation, or package structure. A new DSH patch
67
+ version replaces the current-host slot instead of being added permanently to
68
+ the matrix.
69
+
70
+ ## Making a change
71
+
72
+ 1. Create a branch from the latest `main`.
73
+ 2. Keep the change focused and avoid unrelated formatting or refactoring.
74
+ 3. Add or update tests when behavior changes. A bug fix should ideally include a regression test.
75
+ 4. Update the relevant English and Chinese documentation when user-facing behavior changes.
76
+ 5. Run the checks that cover your change; run the complete check, test, and build suite before opening a pull request when practical.
77
+
78
+ Memory behavior is especially sensitive to provenance, timestamps, scope isolation, deterministic ordering, and evidence sufficiency. Changes in these areas should include focused tests for their invariants and edge cases.
79
+
80
+ ## Pull requests
81
+
82
+ A helpful pull request includes:
83
+
84
+ - a concise explanation of the problem and the chosen solution;
85
+ - links to relevant issues or discussions;
86
+ - the tests and commands used to verify the change;
87
+ - screenshots or recordings for visible UI changes;
88
+ - documentation updates for changed behavior or configuration;
89
+ - benchmark details and machine-readable artifacts for performance or accuracy claims.
90
+
91
+ Please keep commits reviewable and respond to review feedback constructively. Maintainers may ask to split a broad pull request into smaller changes.
92
+
93
+ ## Reporting evaluation results
94
+
95
+ Evaluation claims should be reproducible. Record the dataset or subset, model and configuration, prompts, run count, scoring method, comparison conditions, and relevant artifact hashes. Clearly distinguish complete-system comparisons from component ablations, and avoid generalizing beyond the evaluated scope.
96
+
97
+ ## License
98
+
99
+ By contributing, you agree that your contributions will be licensed under the project's [MIT License](LICENSE).
@@ -1,88 +1,90 @@
1
- # 为 StrataGate 做贡献
2
-
3
- 感谢你帮助改进 StrataGate。代码、测试、文档、问题报告、设计反馈和可复现评测都很有价值。
4
-
5
- [English guide](CONTRIBUTING.md)
6
-
7
- ## 开始之前
8
-
9
- - 创建新 Issue 前,请先搜索[已有 Issue](https://gitee.com/diqier4123/StrataGate-AgentMemory/issues)。
10
- - 报告问题时,请注明相关集成、Node.js 版本、复现步骤、预期行为和实际行为。
11
- - 如果准备实现较大的功能或调整架构,请先创建 Issue 讨论方案和范围,再开始开发。
12
- - 不要在 Issue、测试、fixture 或 Pull Request 中提交私人对话、凭据、API Key 或其他敏感信息。安全问题请按照 [`SECURITY.md`](SECURITY.md) 报告。
13
-
14
- 参与本项目即表示你同意遵守 [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)。
15
-
16
- ## 可以贡献什么
17
-
18
- 以下贡献都很有帮助:
19
-
20
- - 修复可复现的问题,或补充回归测试;
21
- - 完善安装、使用、架构或评测文档;
22
- - 改进 `packages/core/` 中的共享记忆引擎;
23
- - 改进 `src/` 中的 DeepSeek Harness 适配层;
24
- - 改进 `integrations/workbuddy/` 等集成;
25
- - 增加说明充分、可复现的 benchmark 或评测;
26
- - 改善无障碍体验、错误提示或开发体验。
27
-
28
- 我们同样欢迎小而专注的改动。一个 Pull Request 不需要包含大型功能,也可以非常有价值。
29
-
30
- ## 开发环境
31
-
32
- StrataGate 是 npm workspace monorepo。请使用 Node.js `22.19.0` 或更新的 22.x 版本,也可以使用 Node.js 24 及以上版本。GitHub CI 暂停期间,以本地检查、测试和构建结果为准。
33
-
34
- ```bash
35
- git clone https://gitee.com/diqier4123/StrataGate-AgentMemory.git
36
- cd StrataGate-AgentMemory
37
- npm ci
38
- ```
39
-
40
- 运行以下主要本地检查:
41
-
42
- ```bash
43
- npm run check
44
- npm test
45
- npm run build
46
- ```
47
-
48
- 开发过程中也可以只运行相关部分:
49
-
50
- ```bash
51
- npm run check:core
52
- npm run test:core
53
- npm run check:dsh
54
- npm run test:dsh
55
- npm run check:workbuddy
56
- npm run test:workbuddy
57
- ```
58
-
59
- ## 修改代码
60
-
61
- 1. 从最新的 `main` 创建分支。
62
- 2. 保持改动聚焦,避免夹带无关的格式调整或重构。
63
- 3. 行为发生变化时,请增加或更新测试;修复问题时最好补充回归测试。
64
- 4. 面向用户的行为发生变化时,请同步更新相关中英文文档。
65
- 5. 提交 Pull Request 前运行覆盖本次改动的检查;条件允许时,请运行完整的类型检查、测试和构建。
66
-
67
- 记忆系统尤其依赖来源追溯、时间戳、作用域隔离、确定性排序和证据充分性。修改这些部分时,请为相关不变量和边界情况补充有针对性的测试。
68
-
69
- ## 提交 Pull Request
70
-
71
- 一份便于审查的 Pull Request 应包含:
72
-
73
- - 对问题和解决方案的简洁说明;
74
- - 相关 Issue 或讨论的链接;
75
- - 用于验证改动的测试和命令;
76
- - 可见界面改动的截图或录屏;
77
- - 行为或配置变化所需的文档更新;
78
- - 涉及性能或准确率声明时的评测细节和机器可读产物。
79
-
80
- 请让提交记录便于审查,并积极回应审查意见。如果 Pull Request 范围过大,维护者可能会建议拆分成多个更小的改动。
81
-
82
- ## 提交评测结果
83
-
84
- 评测结论应当可以复现。请记录数据集或子集、模型与配置、提示词、运行次数、评分方法、对比条件和相关产物哈希。请明确区分完整系统对比与单组件消融,并避免把结论推广到未经评测的范围。
85
-
86
- ## 许可证
87
-
88
- 提交贡献即表示你同意按本项目的 [MIT License](LICENSE) 授权你的贡献。
1
+ # 为 StrataGate 做贡献
2
+
3
+ 感谢你帮助改进 StrataGate。代码、测试、文档、问题报告、设计反馈和可复现评测都很有价值。
4
+
5
+ [English guide](CONTRIBUTING.md)
6
+
7
+ ## 开始之前
8
+
9
+ - 创建新 Issue 前,请先搜索[已有 Issue](https://gitee.com/diqier4123/StrataGate-AgentMemory/issues)。
10
+ - 报告问题时,请注明相关集成、Node.js 版本、复现步骤、预期行为和实际行为。
11
+ - 如果准备实现较大的功能或调整架构,请先创建 Issue 讨论方案和范围,再开始开发。
12
+ - 不要在 Issue、测试、fixture 或 Pull Request 中提交私人对话、凭据、API Key 或其他敏感信息。安全问题请按照 [`SECURITY.md`](SECURITY.md) 报告。
13
+
14
+ 参与本项目即表示你同意遵守 [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)。
15
+
16
+ ## 可以贡献什么
17
+
18
+ 以下贡献都很有帮助:
19
+
20
+ - 修复可复现的问题,或补充回归测试;
21
+ - 完善安装、使用、架构或评测文档;
22
+ - 改进 `packages/core/` 中的共享记忆引擎;
23
+ - 改进 `src/` 中的 DeepSeek Harness 适配层;
24
+ - 改进 `integrations/workbuddy/` 等集成;
25
+ - 增加说明充分、可复现的 benchmark 或评测;
26
+ - 改善无障碍体验、错误提示或开发体验。
27
+
28
+ 我们同样欢迎小而专注的改动。一个 Pull Request 不需要包含大型功能,也可以非常有价值。
29
+
30
+ ## 开发环境
31
+
32
+ StrataGate 是 npm workspace monorepo。请使用 Node.js `22.19.0` 或更新的 22.x 版本,也可以使用 Node.js 24 及以上版本。运行以下本地检查;2026-11-05 账号恢复后,重新要求完成 GitHub CI。
33
+
34
+ ```bash
35
+ git clone https://gitee.com/diqier4123/StrataGate-AgentMemory.git
36
+ cd StrataGate-AgentMemory
37
+ npm ci
38
+ ```
39
+
40
+ 运行以下主要本地检查:
41
+
42
+ ```bash
43
+ npm run check
44
+ npm test
45
+ npm run build
46
+ ```
47
+
48
+ 开发过程中也可以只运行相关部分:
49
+
50
+ ```bash
51
+ npm run check:core
52
+ npm run test:core
53
+ npm run check:dsh
54
+ npm run test:dsh
55
+ npm run check:workbuddy
56
+ npm run test:workbuddy
57
+ ```
58
+
59
+ DSH 兼容检查按风险分层。Pull Request 在 Ubuntu 和 Windows 上检查最老支持边界(`0.1.2-rc.1`)、最后一个 0.1 宿主(`0.1.7-rc.2`)和当前宿主(`0.2.1-rc.5`)。0.2 迁移边界(`0.2.0-rc.2`)因 Windows 测试对时序和文件锁敏感,保留在历史矩阵中。完整历史矩阵由 `.github/workflows/dsh-compatibility-full.yml` 每天运行;涉及宿主接口、迁移、存储、安装或包结构的高风险发布,可在发布流程中选择 `full_dsh_matrix`。新的 DSH 补丁版本替换当前宿主位置,不永久追加到矩阵。
60
+
61
+ ## 修改代码
62
+
63
+ 1. 从最新的 `main` 创建分支。
64
+ 2. 保持改动聚焦,避免夹带无关的格式调整或重构。
65
+ 3. 行为发生变化时,请增加或更新测试;修复问题时最好补充回归测试。
66
+ 4. 面向用户的行为发生变化时,请同步更新相关中英文文档。
67
+ 5. 提交 Pull Request 前运行覆盖本次改动的检查;条件允许时,请运行完整的类型检查、测试和构建。
68
+
69
+ 记忆系统尤其依赖来源追溯、时间戳、作用域隔离、确定性排序和证据充分性。修改这些部分时,请为相关不变量和边界情况补充有针对性的测试。
70
+
71
+ ## 提交 Pull Request
72
+
73
+ 一份便于审查的 Pull Request 应包含:
74
+
75
+ - 对问题和解决方案的简洁说明;
76
+ - 相关 Issue 或讨论的链接;
77
+ - 用于验证改动的测试和命令;
78
+ - 可见界面改动的截图或录屏;
79
+ - 行为或配置变化所需的文档更新;
80
+ - 涉及性能或准确率声明时的评测细节和机器可读产物。
81
+
82
+ 请让提交记录便于审查,并积极回应审查意见。如果 Pull Request 范围过大,维护者可能会建议拆分成多个更小的改动。
83
+
84
+ ## 提交评测结果
85
+
86
+ 评测结论应当可以复现。请记录数据集或子集、模型与配置、提示词、运行次数、评分方法、对比条件和相关产物哈希。请明确区分完整系统对比与单组件消融,并避免把结论推广到未经评测的范围。
87
+
88
+ ## 许可证
89
+
90
+ 提交贡献即表示你同意按本项目的 [MIT License](LICENSE) 授权你的贡献。
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 diqier
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 diqier
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.