@fuxi-ailabs/crowdmemory-codex-plugin 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "crowdmemory-codex",
3
+ "interface": { "displayName": "Crowd Memory" },
4
+ "plugins": [{ "name": "crowdmemory", "source": { "source": "local", "path": "./" }, "policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" }, "category": "Developer Tools" }]
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "crowdmemory",
3
+ "version": "0.1.1",
4
+ "description": "群体记忆:Codex 会话、失败召回与记忆工具",
5
+ "author": { "name": "cacheline", "email": "cacheline999@gmail.com" },
6
+ "hooks": "./hooks/hooks.json",
7
+ "mcpServers": "./.mcp.json"
8
+ }
package/.mcp.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "crowdmemory": {
4
+ "command": "node", "args": ["lib/mcp.js"], "cwd": ".",
5
+ "env_vars": ["CODEX_HOME", "CROWDMEMORY_ENDPOINT_FILE", "CROWDMEMORY_PROJECT", "CROWDMEMORY_PROFILE", "CROWDMEMORY_INJECT", "CROWDMEMORY_NOTES", "CROWDMEMORY_CODEX_STATE"]
6
+ }
7
+ }
8
+ }
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,100 @@
1
- # Temporary Holding Version
1
+ # Crowd Memory Codex 插件
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 把 Codex 的会话和工具 hooks 接到本机 Crowd Memory Runtime,提供 `memory_search`、`memory_read`、`memory_note`。
4
+ 插件只做宿主事件映射和引用资料投递,复用 `memory-adapter-core` 的协议、端点信任、脱敏、记忆工具和私有路由状态;
5
+ 不依赖其它 Agent framework 或业务工作流。
6
+
7
+ 要求 Node.js ≥22.18、Unix socket、Codex CLI 0.164.0(本次验证版本)。npm 包为 `@fuxi-ailabs/crowdmemory-codex-plugin@0.1.1`。
8
+ Runtime 可继续使用已发布的 0.1.1。桌面端与企业托管策略需要单独验收;云编排环境不支持本地插件 command hooks。
9
+
10
+ ## 独立安装与试用
11
+
12
+ 在独立目录下载并解包 npm 发行包,无需全局安装、克隆源码或安装开发依赖:
13
+
14
+ ```bash
15
+ mkdir CMLocalCodex
16
+ cd CMLocalCodex
17
+ npm pack @fuxi-ailabs/crowdmemory-codex-plugin@0.1.1 --registry=https://registry.npmjs.org
18
+ mkdir -p plugin
19
+ tar -xzf fuxi-ailabs-crowdmemory-codex-plugin-0.1.1.tgz -C plugin
20
+ ```
21
+
22
+ 可使用独立的 Codex 配置目录。以下命令只影响该目录,不覆盖现有的全局插件配置:
23
+
24
+ ```bash
25
+ export CODEX_HOME="$PWD/.codex-crowdmemory"
26
+ codex plugin marketplace add "$PWD/plugin/package" --json
27
+ codex plugin add crowdmemory@crowdmemory-codex --json
28
+ codex plugin list
29
+ codex login
30
+ export CROWDMEMORY_ENDPOINT_FILE="/absolute/runtime/state/endpoint.json"
31
+ export CROWDMEMORY_PROJECT="my-repository"
32
+ codex
33
+ ```
34
+
35
+ 先按 Runtime 文档启动记忆服务。安装后,在 Codex 的 hooks 信任提示中检查并信任本插件的 hook 定义;安装或启用插件不等于信任 hooks。
36
+ 正常使用不需要绕过 hooks 信任或沙箱。未信任时,记忆工具不能取得可靠的会话绑定,会返回不可用。
37
+ 保留 Codex 对 MCP 工具的审批策略:`PreToolUse` 只对本插件三个工具补会话字段(Codex 要求 `updatedInput` 与 `allow` 一起返回),
38
+ 不替其它工具放行,也不覆盖 MCP 自身的审批要求。不要同时注册另一个同名 `crowdmemory` MCP server。
39
+
40
+ 会话 A 修复问题并完成测试后,用 `memory_note` 写现象、原因、位置和实际修法;正常结束会话。
41
+ 会话 B 用 `memory_search` 查找、`memory_read` 核对来源;相关 shell 输出也可触发检索和读取,在下一次模型请求前交付引用资料。
42
+ 历史记录只是参考,当前代码仍需测试。
43
+
44
+ ## Codex 的接入范围
45
+
46
+ | Codex 事件 | 行为 |
47
+ |---|---|
48
+ | SessionStart | 绑定 Runtime 会话;resume / fork 使用宿主给出的身份,已结束绑定重开 |
49
+ | UserPromptSubmit | 首次提交调用 step.before,查询文本先脱敏 |
50
+ | PreToolUse(三个记忆工具) | 覆盖调用参数中的会话身份,保留其它字段;MCP 工具使用该绑定调用 Runtime |
51
+ | PostToolUse / Bash | 当前 CLI 只给 stdout:按输出检索并读取相关记录,保留出处与命中理由,不推断退出码 |
52
+ | PostToolUse / apply_patch | 明确成功时只记录修改路径,不上传补丁或文件内容 |
53
+ | SubagentStart / SubagentStop | 独立子会话绑定、召回及结束,保留父子关系;不按 FIFO 猜子任务 prompt |
54
+ | SessionStart / compact | 重新交付上一次引用资料;不读取不稳定的 transcript 来伪造压缩摘要 |
55
+ | SessionEnd | 同步结束父子会话,最长按 Codex 的 3 秒上限;Stop 不等于 SessionEnd |
56
+
57
+ ### 不把 stdout 当作退出状态
58
+
59
+ 在真实 Codex CLI 0.164.0 上,`printf 'error'; exit 2` 的 PostToolUse 也只收到字符串 `error`,没有退出码。
60
+ 所以普通字符串不能用来生成 `tool.result.ok`、机械成功率或失败签名;即使 stdout 含有“Process exited with code 2”,也不会信任它。
61
+ 若其它宿主明确给出结构化 `exit_code`,适配器才会上报该状态;当前 CLI 的路径仍用无成败断言的 query / read。
62
+ 这也意味着它不能提供与 DSH 完全相同的失败配对统计。没有 workflow / goal 事件、工作区快照或压缩摘要采集能力。
63
+
64
+ ### 配置
65
+
66
+ | 环境变量 | 默认 / 用途 |
67
+ |---|---|
68
+ | CROWDMEMORY_ENDPOINT_FILE | `~/.crowdmemory/state/endpoint.json`,必须为可信绝对路径 |
69
+ | CROWDMEMORY_PROJECT | 默认工作目录名;推荐显式使用稳定仓库名 |
70
+ | CROWDMEMORY_PROFILE | session-default |
71
+ | CROWDMEMORY_CODEX_STATE | 私有路由状态目录;默认 `$CODEX_HOME/crowdmemory/sessions`(未设置 CODEX_HOME 则为 `~/.codex/crowdmemory/sessions`),hooks 与 MCP 共用 |
72
+ | CROWDMEMORY_INJECT | `0` / `false` / `off` / `no` 关闭自动投递,记忆工具仍可使用 |
73
+ | CROWDMEMORY_NOTES | 同上,关闭 memory_note |
74
+ | CROWDMEMORY_DEBUG | `1` 只报告 hook 降级,不打印输入或令牌 |
75
+
76
+ MCP 通过 `.mcp.json` 的相对 `cwd` 启动,不能套用 OpenClaude 的 `${PLUGIN_ROOT}` 参数插值;配置变量通过显式 `env_vars` 传递。
77
+ 会话状态使用 0700 目录、0600 文件、锁和原子替换。会话字段是本机合作式路由,不是对恶意同用户进程的强认证。
78
+ project 也是相关性约定,不是多租户安全边界。Runtime 失联时 hooks 无输出并退出 0,工具返回不可用;笔记失败需调用方重试。
79
+
80
+ ## 开发与验证
81
+
82
+ 在仓库本包目录安装开发依赖;源码验证也可用 `npm pack` 打包,再解包交给下面的 CLI 测试。
83
+
84
+ ```bash
85
+ pnpm install --frozen-lockfile
86
+ pnpm typecheck
87
+ pnpm test
88
+ pnpm build
89
+ node e2e/run.mjs
90
+ CROWDMEMORY_E2E_PLUGIN_DIR=/absolute/unpacked/package node e2e/run.mjs
91
+ # 已有测试专用 Runtime 时,额外运行真实服务测试:
92
+ CROWDMEMORY_TEST_REAL_ENDPOINT_FILE=/absolute/runtime/state/endpoint.json pnpm test
93
+ ```
94
+
95
+ 单测覆盖合同、跨进程绑定、字段保留、父子会话、降级和 stdout 无状态场景。真实 Runtime 测试需显式给测试端点,否则跳过。
96
+ CLI e2e 使用真实 Codex、隔离 CODEX_HOME、本地脚本化 Responses 服务和假 Runtime,验证打包安装、写笔记、下一会话召回与读取。
97
+ 仅这个受控离线测试会绕过 hook 信任及审批;它不使用真实模型、服务密钥或生产工作区,也不代表设备或生产模型验收。
98
+
99
+ 公共源码改动请在 `../memory-adapter-core` 修改并执行 `npm run update`,不要直接编辑 `src/core/`、`contract/` 或测试夹具副本。
100
+ 官方合同依据:[Hooks](https://developers.openai.com/codex/hooks/)、[插件打包](https://developers.openai.com/plugins/build/plugins)。
@@ -0,0 +1,17 @@
1
+ {
2
+ "source": "crowdmemory-contracts",
3
+ "files": {
4
+ "error-signature-vectors.json": {
5
+ "source_path": "fixtures/agent/error-signature-vectors.json",
6
+ "sha256": "31be508ed2baec0051ef4cd6a2292e39d12c896df76158f9899770f3fefe925d"
7
+ },
8
+ "event-id-vectors.json": {
9
+ "source_path": "fixtures/agent/event-id-vectors.json",
10
+ "sha256": "c7f016a2251a9d53eb14346fb9823a8c53fee8c1935db06a1ed2b3ac5d5d4b7b"
11
+ },
12
+ "memory-agent-ingress-v1.schema.json": {
13
+ "source_path": "schemas/agent/memory-agent-ingress-v1.schema.json",
14
+ "sha256": "a0a1c79c0aaedeb076df7e15b069ad8d235bffe3477821e2c3e502049e43cd33"
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,143 @@
1
+ {
2
+ "schema": "memory-agent-error-signature-vectors/v1",
3
+ "algorithm": {
4
+ "id": "crowdmemory-error-signature/v1",
5
+ "steps": [
6
+ "split input into lines with line_split",
7
+ "take the first line that is non-empty after stripping whitespace (leading and trailing runs of the whitespace class); none -> normalized \"\" and signature null",
8
+ "replace every match of path with \"<path>\"",
9
+ "replace every match of hex with \"#\"",
10
+ "replace every match of digits with \"#\"",
11
+ "strip whitespace from both ends",
12
+ "signature = \"sha256:\" + lowercase hex sha256 of the UTF-8 bytes of normalized"
13
+ ],
14
+ "line_split": "\\r\\n|\\r|\\n",
15
+ "whitespace": "[ \\t\\u000b\\u000c\\u00a0\\u3000\\ufeff]",
16
+ "path": "(?<![A-Za-z0-9_.~/\\-])(?:~/[^ \\t\\u000b\\u000c\\u00a0\\u3000\\ufeff'\"`:;,()\\[\\]{}<>|\\uff0c\\u3002\\uff1a\\uff1b\\u3001\\uff08\\uff09\\u3010\\u3011\\u300c\\u300d\\u300a\\u300b\\uff01\\uff1f]*|/[^ \\t\\u000b\\u000c\\u00a0\\u3000\\ufeff'\"`:;,()\\[\\]{}<>|\\uff0c\\u3002\\uff1a\\uff1b\\u3001\\uff08\\uff09\\u3010\\u3011\\u300c\\u300d\\u300a\\u300b\\uff01\\uff1f]+)",
17
+ "hex": "0[xX][0-9a-fA-F]+",
18
+ "digits": "[0-9]+",
19
+ "regex_flags": "none (JavaScript: compile with flags 'g' or 'gu'; results are identical)"
20
+ },
21
+ "vectors": [
22
+ {
23
+ "name": "ac01-ld-undefined-symbol",
24
+ "input": "ld: undefined symbol deflate",
25
+ "normalized": "ld: undefined symbol deflate",
26
+ "signature": "sha256:d3edaf502f6fc71218f3317d4b9322145eda80702954373c9cf7cc404c90e467"
27
+ },
28
+ {
29
+ "name": "lld-undefined-with-path",
30
+ "input": "ld.lld: error: undefined symbol: deflate\n>>> referenced by /home/alice/zlib-1.3.1/build/gzlib.c:252",
31
+ "normalized": "ld.lld: error: undefined symbol: deflate",
32
+ "signature": "sha256:a060d3150de6839d0de5636a0a4cf3515482bcef7750af5301852def9a148180"
33
+ },
34
+ {
35
+ "name": "compiler-path-line-col",
36
+ "input": "/Users/bob/src/proj/a.c:301:17: error: 'foo' undeclared (first use in this function)",
37
+ "normalized": "<path>:#:#: error: 'foo' undeclared (first use in this function)",
38
+ "signature": "sha256:5a52476f0a3c57631f74f7657fa0d4bba6304f632f90be00350ec50cd362b9fb"
39
+ },
40
+ {
41
+ "name": "home-path",
42
+ "input": "fatal: cannot open ~/work/proj/CMakeLists.txt: No such file or directory",
43
+ "normalized": "fatal: cannot open <path>: No such file or directory",
44
+ "signature": "sha256:7f822aa33d3bdf37666d178d551efb91205654362c52dd9dd401cc2e68516760"
45
+ },
46
+ {
47
+ "name": "leading-blank-lines-crlf",
48
+ "input": "\r\n \r\n\tmake[2]: *** [Makefile:1234: all] Error 2\r\nmake: *** [all] Error 2",
49
+ "normalized": "make[#]: *** [Makefile:#: all] Error #",
50
+ "signature": "sha256:27cf2b48c8f4a25c5bbed2db28f81db741d7cf2414a2a4346e9025a3049501a8"
51
+ },
52
+ {
53
+ "name": "hex-address",
54
+ "input": "Segmentation fault at address 0x7ffe3a1f (pid 4242)",
55
+ "normalized": "Segmentation fault at address # (pid #)",
56
+ "signature": "sha256:9ec14b3f4c101c85b0bc279b614293e1c3ba41b62d5543fe3329ba83a7b515ac"
57
+ },
58
+ {
59
+ "name": "hex-uppercase-and-digits",
60
+ "input": "error 0XDEADBEEF in module v2.10.3",
61
+ "normalized": "error # in module v#.#.#",
62
+ "signature": "sha256:7fbfe4dc0c5f52c837d4c8e29408dfafd2f4ff0081fc784971768b9992e2246d"
63
+ },
64
+ {
65
+ "name": "cjk-message",
66
+ "input": "错误:找不到头文件 /opt/sdk/include/zlib.h,第 12 行",
67
+ "normalized": "错误:找不到头文件 <path>,第 # 行",
68
+ "signature": "sha256:69bca71d62c373d682636ed3e631c07ac3a5cc29b28369bbdb24af334a0a7f7d"
69
+ },
70
+ {
71
+ "name": "cjk-fullwidth-space",
72
+ "input": "  编译失败:退出码 127 ",
73
+ "normalized": "编译失败:退出码 #",
74
+ "signature": "sha256:6373e60cd9816ed277a49259951f96f29e4b3360300e820b20f504c881020d35"
75
+ },
76
+ {
77
+ "name": "windows-path",
78
+ "input": "C:\\Users\\dev\\lib2\\zlib1.dll not found (code 126)",
79
+ "normalized": "C:\\Users\\dev\\lib#\\zlib#.dll not found (code #)",
80
+ "signature": "sha256:ec9f0e9e955b0b1f1acce5221ece95a3679ff1a40a5cbd83f7edaafaf58ec212"
81
+ },
82
+ {
83
+ "name": "windows-forward-slash",
84
+ "input": "LINK : fatal error LNK1104: cannot open file 'C:/Program Files/zlib/lib/zlib.lib'",
85
+ "normalized": "LINK : fatal error LNK#: cannot open file 'C:<path> Files/zlib/lib/zlib.lib'",
86
+ "signature": "sha256:60d314e0fd9f7301500aa4fdcd86ce4bce3e3b3ffedd7cbe385f4c53ea2e3e69"
87
+ },
88
+ {
89
+ "name": "relative-path-kept",
90
+ "input": "./configure: line 88: ./build/run.sh: Permission denied",
91
+ "normalized": "./configure: line #: ./build/run.sh: Permission denied",
92
+ "signature": "sha256:4492dc461c7153c04caf76cb8a06a5308618851424d41f47eb083408fb42461b"
93
+ },
94
+ {
95
+ "name": "url",
96
+ "input": "curl: (6) Could not resolve host: https://example.com/pkg/v1.2.tar.gz",
97
+ "normalized": "curl: (#) Could not resolve host: https:<path>",
98
+ "signature": "sha256:f4f70a34a840eb4bfd12ed167d0ce870e10edcb70e66de6a0cc1e50b1a2c7450"
99
+ },
100
+ {
101
+ "name": "quoted-path",
102
+ "input": "No such file: \"/tmp/build-123/out.o\"",
103
+ "normalized": "No such file: \"<path>\"",
104
+ "signature": "sha256:b96acfdf62ae2c4f9d1f13af9162a8baf99d2d81d85e2ee2402eda490737cda9"
105
+ },
106
+ {
107
+ "name": "assignment-path",
108
+ "input": "invalid value --prefix=/usr/local/opt/zlib@1.3",
109
+ "normalized": "invalid value --prefix=<path>",
110
+ "signature": "sha256:c22ead0b9c649f9d52595a955774ecd684c55e75bee45e9d1a9da28397c7ca7f"
111
+ },
112
+ {
113
+ "name": "python-traceback-first-line",
114
+ "input": "Traceback (most recent call last):\n File \"/usr/lib/python3.11/runpy.py\", line 198, in _run_module_as_main",
115
+ "normalized": "Traceback (most recent call last):",
116
+ "signature": "sha256:5dd94ced5a2afb4af3a0a9521dc8f9306236b23b01882c52a80e482ae00be37f"
117
+ },
118
+ {
119
+ "name": "cr-only-lines",
120
+ "input": "\rwarning: 3 issues\rsecond",
121
+ "normalized": "warning: # issues",
122
+ "signature": "sha256:9e4bf262457ac21ae57deaaef52771269d17839818015ed6b790f39b16c9d17e"
123
+ },
124
+ {
125
+ "name": "symbol-with-digits",
126
+ "input": "undefined reference to `_PyLong_One'",
127
+ "normalized": "undefined reference to `_PyLong_One'",
128
+ "signature": "sha256:e48e8db4b536f113bfafe096ddbfc704f24ed7d8fd3cd8363d38c1626883a9ba"
129
+ },
130
+ {
131
+ "name": "empty",
132
+ "input": "",
133
+ "normalized": "",
134
+ "signature": null
135
+ },
136
+ {
137
+ "name": "whitespace-only",
138
+ "input": " \t\r\n \n",
139
+ "normalized": "",
140
+ "signature": null
141
+ }
142
+ ]
143
+ }
@@ -0,0 +1,128 @@
1
+ {
2
+ "algorithm": "crowdmemory-event-id/v1",
3
+ "description": "Cross-language vectors for the ingress event_id (memory-agent-ingress/v1). occurred_at = the client's clock truncated to whole seconds, UTC, 'Z'. canonical = canonical JSON of the envelope without event_id: object keys sorted by UTF-16 code unit, no insignificant whitespace, strings as JSON.stringify (only \" \\ and controls < U+0020 escaped, \\b \\f \\n \\r \\t short forms, other controls and lone surrogates as lowercase \\uXXXX), numbers as ECMAScript Number::toString (1.0 -> 1, -0 -> 0, 1e-7, 1e+21; integers only within +-2^53). event_id = 'sha256:' + hex(sha256(UTF-8(canonical + '\\n' + native_key))), lone surrogates encoded as U+FFFD. Generated by the TS adapter client (src/client.ts); the Python AgentIngressClient must reproduce every vector.",
4
+ "vectors": [
5
+ {
6
+ "name": "session-start-business",
7
+ "adapter_id": "example-pipeline",
8
+ "session_ref": "pipe-0001",
9
+ "parent_ref": null,
10
+ "now": "2026-10-20T08:00:00.000Z",
11
+ "occurred_at": "2026-10-20T08:00:00Z",
12
+ "kind": "session.start",
13
+ "payload": {
14
+ "project": "pipeline-demo",
15
+ "profile_ref": "example-pipeline",
16
+ "capabilities": [
17
+ "session_binding",
18
+ "step_injection",
19
+ "tool_capture",
20
+ "note_tool",
21
+ "query_tools",
22
+ "workflow_events"
23
+ ],
24
+ "dimensions": {
25
+ "platform": "linux-x86_64",
26
+ "toolchain": "gcc-13"
27
+ }
28
+ },
29
+ "native_key": "session.start",
30
+ "canonical": "{\"adapter_id\":\"example-pipeline\",\"kind\":\"session.start\",\"occurred_at\":\"2026-10-20T08:00:00Z\",\"parent_ref\":null,\"payload\":{\"capabilities\":[\"session_binding\",\"step_injection\",\"tool_capture\",\"note_tool\",\"query_tools\",\"workflow_events\"],\"dimensions\":{\"platform\":\"linux-x86_64\",\"toolchain\":\"gcc-13\"},\"profile_ref\":\"example-pipeline\",\"project\":\"pipeline-demo\"},\"session_ref\":\"pipe-0001\"}",
31
+ "event_id": "sha256:5f279b6cd45e51d6ee10357f01358b0878857beffc9eea4bc25704df4851a240"
32
+ },
33
+ {
34
+ "name": "tool-result-unicode-and-key-order",
35
+ "adapter_id": "dsh",
36
+ "session_ref": "dsh-session-0001",
37
+ "parent_ref": "dsh-parent-0001",
38
+ "now": "2026-10-20T08:00:01.999Z",
39
+ "occurred_at": "2026-10-20T08:00:01Z",
40
+ "kind": "tool.result",
41
+ "payload": {
42
+ "tool_name": "bash",
43
+ "session_handle": "ash_0123456789abcdef0123456789abcdef",
44
+ "ok": false,
45
+ "exit_code": 2,
46
+ "error_tail": "\u9519\u8bef\uff1a\u627e\u4e0d\u5230 <path>/zlib.h\ttab \"quoted\" \\ back\u0001ctl\u2028ls \ud83d\ude00 emoji",
47
+ "symbols": [
48
+ "zlib.h",
49
+ "deflate"
50
+ ],
51
+ "z": {
52
+ "\uffff": 1,
53
+ "\ud83d\ude00": 2,
54
+ "B": 3,
55
+ "a": 4,
56
+ "": 5
57
+ }
58
+ },
59
+ "native_key": "call_\u00fc_01",
60
+ "canonical": "{\"adapter_id\":\"dsh\",\"kind\":\"tool.result\",\"occurred_at\":\"2026-10-20T08:00:01Z\",\"parent_ref\":\"dsh-parent-0001\",\"payload\":{\"error_tail\":\"\u9519\u8bef\uff1a\u627e\u4e0d\u5230 <path>/zlib.h\\ttab \\\"quoted\\\" \\\\ back\\u0001ctl\u2028ls \ud83d\ude00 emoji\",\"exit_code\":2,\"ok\":false,\"session_handle\":\"ash_0123456789abcdef0123456789abcdef\",\"symbols\":[\"zlib.h\",\"deflate\"],\"tool_name\":\"bash\",\"z\":{\"\":5,\"B\":3,\"a\":4,\"\ud83d\ude00\":2,\"\uffff\":1}},\"session_ref\":\"dsh-session-0001\"}",
61
+ "event_id": "sha256:a2c24ea5485d87c8677f7fcd76d26a6341fb7fcee8511976d8343cb4e5e8e7dd"
62
+ },
63
+ {
64
+ "name": "numbers",
65
+ "adapter_id": "example-pipeline",
66
+ "session_ref": "pipe-0002",
67
+ "parent_ref": null,
68
+ "now": "2026-10-20T08:00:02Z",
69
+ "occurred_at": "2026-10-20T08:00:02Z",
70
+ "kind": "note",
71
+ "payload": {
72
+ "n": [
73
+ 0,
74
+ -0.0,
75
+ 1.0,
76
+ -1.5,
77
+ 0.1,
78
+ 1e-07,
79
+ 1e-06,
80
+ 1e+16,
81
+ 1e+21,
82
+ 123456789012345680000,
83
+ 2.5e-08,
84
+ 9007199254740991,
85
+ 3.14159,
86
+ -273.15,
87
+ 100,
88
+ 1.5e+300
89
+ ],
90
+ "flags": [
91
+ true,
92
+ false,
93
+ null
94
+ ],
95
+ "nested": {
96
+ "b": [
97
+ {
98
+ "y": 1,
99
+ "x": 2
100
+ }
101
+ ],
102
+ "a": {}
103
+ },
104
+ "empty": []
105
+ },
106
+ "native_key": "note:1",
107
+ "canonical": "{\"adapter_id\":\"example-pipeline\",\"kind\":\"note\",\"occurred_at\":\"2026-10-20T08:00:02Z\",\"parent_ref\":null,\"payload\":{\"empty\":[],\"flags\":[true,false,null],\"n\":[0,0,1,-1.5,0.1,1e-7,0.000001,10000000000000000,1e+21,123456789012345680000,2.5e-8,9007199254740991,3.14159,-273.15,100,1.5e+300],\"nested\":{\"a\":{},\"b\":[{\"x\":2,\"y\":1}]}},\"session_ref\":\"pipe-0002\"}",
108
+ "event_id": "sha256:c3485b5eb60d0e903e9ad7b5729a0ac3f73c117e8348a94e938dc5d4560669d1"
109
+ },
110
+ {
111
+ "name": "lone-surrogate",
112
+ "adapter_id": "dsh",
113
+ "session_ref": "dsh-session-0003",
114
+ "parent_ref": null,
115
+ "now": "2026-10-20T08:00:03Z",
116
+ "occurred_at": "2026-10-20T08:00:03Z",
117
+ "kind": "query",
118
+ "payload": {
119
+ "session_handle": "ash_0123456789abcdef0123456789abcdef",
120
+ "op": "search",
121
+ "query": "half \ud800 pair"
122
+ },
123
+ "native_key": "q:\ud800",
124
+ "canonical": "{\"adapter_id\":\"dsh\",\"kind\":\"query\",\"occurred_at\":\"2026-10-20T08:00:03Z\",\"parent_ref\":null,\"payload\":{\"op\":\"search\",\"query\":\"half \\ud800 pair\",\"session_handle\":\"ash_0123456789abcdef0123456789abcdef\"},\"session_ref\":\"dsh-session-0003\"}",
125
+ "event_id": "sha256:c2b337b0b5ad0ee362a9ff5a319ac48a613a6ff090365396093eeb98d98090a1"
126
+ }
127
+ ]
128
+ }