jev-layer 0.1.0 → 0.3.0

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 (88) hide show
  1. package/CHANGELOG.md +73 -34
  2. package/CONTRIBUTING.md +146 -146
  3. package/LICENSE +21 -21
  4. package/README.md +125 -126
  5. package/README.ru.md +140 -117
  6. package/README.zh-CN.md +139 -117
  7. package/RELEASE.md +53 -53
  8. package/SECURITY.md +64 -56
  9. package/bin/jev.mjs +215 -213
  10. package/config/codex.mcp.toml +8 -8
  11. package/config/generic-mcp.json +13 -13
  12. package/config/hermes.mcp.yaml +9 -9
  13. package/config/jev.example.json +23 -22
  14. package/config/omp.mcp.json +14 -14
  15. package/config/providers.env.example +13 -13
  16. package/docs/AGENT-IMPLEMENTATION.md +306 -0
  17. package/docs/COMPATIBILITY.md +24 -15
  18. package/docs/HERMES-LOCAL-AGENT-HANDOFF.ru.md +187 -0
  19. package/docs/PROVIDERS.md +109 -0
  20. package/docs/SCHEMA-VERSIONING.md +101 -94
  21. package/docs/architecture.svg +77 -0
  22. package/docs/jev-layer-banner.svg +38 -0
  23. package/examples/capabilities.json +39 -39
  24. package/examples/route-request.json +28 -28
  25. package/integrations/codex/.codex-plugin/plugin.json +19 -19
  26. package/integrations/codex/.mcp.json +11 -11
  27. package/integrations/codex/AGENTS.md +1 -1
  28. package/integrations/codex/run-mcp.mjs +9 -9
  29. package/integrations/codex/skills/jev-route/SKILL.md +17 -17
  30. package/integrations/hermes/__init__.py +156 -51
  31. package/integrations/hermes/plugin.yaml +11 -5
  32. package/integrations/hermes/schemas.py +120 -12
  33. package/integrations/omp/extension.js +106 -105
  34. package/integrations/template/README.md +10 -10
  35. package/integrations/template/adapter.mjs +87 -87
  36. package/package.json +60 -59
  37. package/scripts/benchmark.mjs +35 -35
  38. package/scripts/browser-benchmark.mjs +92 -92
  39. package/scripts/browser-e2e.mjs +117 -117
  40. package/scripts/capability-e2e.mjs +31 -31
  41. package/scripts/clean-install-smoke.mjs +176 -162
  42. package/scripts/codex-mcp-smoke.mjs +119 -119
  43. package/scripts/context-filter-e2e.mjs +45 -45
  44. package/scripts/fail-open-smoke.mjs +120 -120
  45. package/scripts/feature-flags-smoke.mjs +46 -46
  46. package/scripts/mcp-receipt-smoke.mjs +115 -98
  47. package/scripts/model-route-report.mjs +15 -0
  48. package/scripts/openrouter-choice.mjs +59 -59
  49. package/scripts/replay-eval.mjs +124 -124
  50. package/scripts/smoke.mjs +34 -34
  51. package/scripts/supervision-e2e.mjs +138 -109
  52. package/src/browser.mjs +583 -569
  53. package/src/cli.mjs +33 -33
  54. package/src/computer.mjs +196 -0
  55. package/src/config.mjs +86 -75
  56. package/src/context-filter.mjs +56 -56
  57. package/src/contract.mjs +74 -72
  58. package/src/discovery.mjs +65 -65
  59. package/src/hermes-adapter.mjs +134 -0
  60. package/src/images.mjs +98 -0
  61. package/src/mcp-server.mjs +313 -210
  62. package/src/model-route-metrics.mjs +89 -0
  63. package/src/model-routing.mjs +87 -0
  64. package/src/providers/demo.mjs +52 -52
  65. package/src/providers/index.mjs +12 -0
  66. package/src/providers/typesafe.mjs +206 -126
  67. package/src/receipts.mjs +228 -226
  68. package/src/registry.mjs +109 -109
  69. package/src/relevance-filter.mjs +99 -99
  70. package/src/route.mjs +228 -221
  71. package/src/shadow-compaction.mjs +170 -0
  72. package/src/supervision.mjs +268 -244
  73. package/test/browser.test.mjs +222 -199
  74. package/test/capability.test.mjs +54 -54
  75. package/test/computer.test.mjs +195 -0
  76. package/test/context-filter.test.mjs +65 -65
  77. package/test/hermes-adapter.test.mjs +63 -0
  78. package/test/image-fixture.mjs +2 -0
  79. package/test/images.test.mjs +85 -0
  80. package/test/model-route-metrics.test.mjs +61 -0
  81. package/test/model-routing.test.mjs +59 -0
  82. package/test/openrouter-provider.test.mjs +55 -55
  83. package/test/provider-transports.test.mjs +205 -0
  84. package/test/providers.test.mjs +125 -0
  85. package/test/receipts.test.mjs +71 -71
  86. package/test/route.test.mjs +86 -74
  87. package/test/shadow-compaction.test.mjs +67 -0
  88. package/test/supervision.test.mjs +117 -99
package/README.zh-CN.md CHANGED
@@ -1,117 +1,139 @@
1
- # jev-layer
2
-
3
- [English](README.md) | [Русский](README.ru.md) | [简体中文](README.zh-CN.md)
4
-
5
- 面向 agent harness 的可移植 **System-1 决策层**。jev-layer 只负责路由有界决策并记录证据;host 保留执行、权限、审批、重试、恢复和最终结果的所有权。
6
-
7
- 提供 **Hermes、OMP、Codex 和 generic MCP-compatible agents** 的集成示例。
8
-
9
- ## 架构
10
-
11
- ```text
12
- +----------------------+ 有界请求 +----------------------+
13
- | Agent harness | --------------------------> | jev-layer |
14
- | Hermes / OMP / | | route / supervise / |
15
- | Codex / generic MCP | <-------------------------- | context filter |
16
- +----------+-----------+ 决策 + id +----------+-----------+
17
- | |
18
- | host 检查权限和审批 |
19
- v v
20
- +----------+-----------+ 执行结果 +----------+-----------+
21
- | Native host executor | --------------------------> | receipts + replay |
22
- | 负责所有副作用 | jev_record_execution | JSONL, correlation_id|
23
- +----------------------+ +----------------------+
24
- ```
25
-
26
- Jev 从不执行选中的 capability。可使用离线确定性的 `demo`、OpenRouter Decisions 或 TypeSafe;普通 CI 不需要 provider credentials。
27
-
28
- ## 快速开始
29
-
30
- 需要 Node.js 20 或更新版本。没有必需的 runtime 依赖。
31
-
32
- ```sh
33
- npm install
34
- npm link
35
- jev install --project /path/to/workspace
36
- jev add generic --project /path/to/workspace
37
- jev doctor --project /path/to/workspace
38
- ```
39
-
40
- `npm link` 仅用于本地安装,不会发布包。如果不想全局 link,可使用 `node /path/to/jev-layer/bin/jev.mjs ...`。默认 provider 是离线确定性的 `demo`。
41
-
42
- 直接运行 stdio MCP:
43
-
44
- ```sh
45
- jev mcp
46
- ```
47
-
48
- 凭据必须保存在仓库之外:
49
-
50
- ```sh
51
- export JEV_LAYER_PROVIDER=openrouter
52
- export OPENROUTER_API_KEY='provided-by-your-secret-store'
53
- jev doctor --project /path/to/workspace
54
- ```
55
-
56
- ## 核心能力
57
-
58
- - **Routing:** `jev_route` 从 host 提供的候选集合中选择一个 capability。host 会再次验证 id 和权限。
59
- - **Receipts/replay:** `jev_record_execution` 使用原始 `correlation_id` 关联 host 结果。JSONL 位于 `.jev/replay/cases.jsonl`,可用 `npm run replay:evaluate` 离线评估。
60
- - **Supervision:** `jev_supervise` 返回有界的工作状态判断;确定性的 host policy 将其映射为 `continue`、`verify`、`retry`、`finish` 或 `escalate`。Jev 不执行这些动作。
61
- - **Context filtering:** 可选的确定性 `shadow` 或 `conservative` 过滤器减少过期 context,不使用 LLM 摘要。
62
- - **Experimental browser fast-path:** `jev_browser_step` 根据 host observation 选择一个有界浏览器动作。observation、审批、原生执行和恢复都由 host 提供。
63
- - **Fail-open:** Jev 被禁用、不可用、出错或无法确定时,控制权返回 host 的正常路径。Jev 不扩大权限,也不猜测执行。
64
-
65
- 所有可选表面默认关闭:
66
-
67
- ```sh
68
- JEV_BROWSER_FAST_PATH=1 jev mcp
69
- JEV_SUPERVISION=1 jev mcp
70
- JEV_CONTEXT_FILTER=shadow jev cli --input examples/route-request.json
71
- ```
72
-
73
- ## Harness adapters
74
-
75
- 示例位于 `integrations/`:
76
-
77
- - `integrations/hermes/`
78
- - `integrations/omp/`
79
- - `integrations/codex/`
80
- - `integrations/template/`
81
-
82
- 发布基线记录了准备环境中观察到的 OMP `18.2.6`、Hermes `0.21.3`(`b675e6de`)和 Codex CLI `0.155.1`。这是版本与契约基线,不代表覆盖所有 provider/model 组合;详见 [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md)。
83
-
84
- ### 添加新的 harness
85
-
86
- 1. 复制 `integrations/template/adapter.mjs`。
87
- 2. 添加 `integrations/<harness>/` 和不含 secret 的 config/example。
88
- 3. 调用 `jev_route`,保留 `correlation_id`,仅通过 host registry 执行,然后调用 `jev_record_execution`。
89
- 4. 添加覆盖成功、fail-open、审批拒绝和 execution receipt 的离线 smoke fixture。
90
- 5. 记录支持的版本并通过 CI。
91
-
92
- 详见 [CONTRIBUTING.md](CONTRIBUTING.md) 和 [docs/SCHEMA-VERSIONING.md](docs/SCHEMA-VERSIONING.md)。
93
-
94
- ## Browser 状态
95
-
96
- Browser fast-path 的**可靠性已通过当前 real-browser fixtures 验证**,包括动作顺序、可见链接导航、原生 select、审批拒绝和恢复。**性能优化仍是实验性的**。不宣称任何浏览器加速倍数。
97
-
98
- ## 安全与兼容性
99
-
100
- - MIT 许可证:[LICENSE](LICENSE)。
101
- - jev-layer 不是 security boundary。权限和审批的权威来源是 host:[SECURITY.md](SECURITY.md)。
102
- - MCP tools、routing decisions、receipts、replay cases 和 adapter contract 当前都是 version 1。应优先添加可选字段,不要静默破坏 v1。
103
- - 不要提交 credentials、含 secret 的 logs、`.env` 或 machine-specific paths。
104
-
105
- ## 验证
106
-
107
- ```sh
108
- npm test
109
- npm run smoke
110
- npm run fail-open-smoke
111
- npm run clean-install-smoke
112
- npm pack --dry-run
113
- ```
114
-
115
- GitHub Actions 在 Node.js 20、22 和 24 上运行这些检查。Provider-backed 测试需要单独的 secret-managed 环境,不属于普通 PR CI。
116
-
117
- 文档:[CONTRIBUTING.md](CONTRIBUTING.md) · [SECURITY.md](SECURITY.md) · [RELEASE.md](RELEASE.md) · [CHANGELOG.md](CHANGELOG.md)。
1
+ <p align="center">
2
+ <img src="docs/jev-layer-banner.svg" alt="jev-layer — 面向 agent harness 的可移植 System-1 决策层" width="960">
3
+ </p>
4
+
5
+ <h1 align="center">jev-layer</h1>
6
+
7
+ <p align="center">
8
+ <strong>面向 agent harness 的可移植 System-1 决策层。</strong><br>
9
+ Host 保留 routing、receipts、replay 和 fail-open 集成的所有权。
10
+ </p>
11
+
12
+ <p align="center">
13
+ Hermes · OMP · Codex · generic MCP
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://github.com/typakon4/jev-layer/actions/workflows/ci.yml?query=branch%3Amain"><img alt="CI status" src="https://github.com/typakon4/jev-layer/actions/workflows/ci.yml/badge.svg?branch=main"></a>
18
+ <a href="https://www.npmjs.com/package/jev-layer"><img alt="npm version" src="https://img.shields.io/npm/v/jev-layer?logo=npm&amp;label=npm"></a>
19
+ <a href="https://github.com/typakon4/jev-layer/releases"><img alt="latest GitHub release" src="https://img.shields.io/github/v/release/typakon4/jev-layer?display_name=tag&amp;sort=semver"></a>
20
+ <a href="https://github.com/typakon4/jev-layer/blob/main/LICENSE"><img alt="MIT license" src="https://img.shields.io/github/license/typakon4/jev-layer"></a>
21
+ </p>
22
+
23
+ [English](README.md) · [Русский](README.ru.md) · [简体中文](README.zh-CN.md)
24
+
25
+ jev-layer 只负责路由有界决策并记录证据;host 保留执行、权限、审批、重试、恢复和最终结果的所有权。
26
+
27
+ > 将 jev-layer 集成到 harness 时,请先把 [Agent implementation guide](docs/AGENT-IMPLEMENTATION.md) 交给 agent,不要只发送 README 链接。
28
+
29
+ ## 架构
30
+
31
+ <p align="center">
32
+ <img src="docs/architecture.svg" alt="架构:agent harness 向 jev-layer 发送有界请求;host 负责权限和执行;receipts 支持 replay。" width="960">
33
+ </p>
34
+
35
+ Jev 从不执行选中的 capability。可使用离线确定性的 `demo`、OpenRouter Decisions 或 TypeSafe;普通 CI 不需要 provider credentials。
36
+
37
+ ## 快速开始
38
+
39
+ 需要 Node.js 20 或更新版本。没有必需的 runtime 依赖。
40
+
41
+ 安装已发布的 CLI:
42
+
43
+ ```sh
44
+ npm install --global jev-layer
45
+ ```
46
+
47
+ 或者使用本地 clone:
48
+
49
+ ```sh
50
+ npm install
51
+ npm link
52
+ jev install --project /path/to/workspace
53
+ jev add generic --project /path/to/workspace
54
+ jev doctor --project /path/to/workspace
55
+ ```
56
+
57
+ `npm link` 仅用于本地安装,不会发布包。如果不想全局 link,可使用 `node /path/to/jev-layer/bin/jev.mjs ...`。默认 provider 是离线确定性的 `demo`。
58
+
59
+ 直接运行 stdio MCP:
60
+
61
+ ```sh
62
+ jev mcp
63
+ ```
64
+
65
+ 凭据必须保存在仓库之外:
66
+
67
+ ```sh
68
+ export JEV_LAYER_PROVIDER=openrouter
69
+ export OPENROUTER_API_KEY='provided-by-your-secret-store'
70
+ jev doctor --project /path/to/workspace
71
+ ```
72
+
73
+ 三种模式(`demo`、`openrouter` 和直连 `typesafe`)、端点及配置优先级见[提供商指南](docs/PROVIDERS.md)。
74
+
75
+ ## 核心能力
76
+
77
+ - **Routing:** `jev_route` 从 host 提供的候选集合中选择一个 capability。host 会再次验证 id 和权限。
78
+ - **Receipts/replay:** `jev_record_execution` 使用原始 `correlation_id` 关联 host 结果。JSONL 位于 `.jev/replay/cases.jsonl`,可用 `npm run replay:evaluate` 离线评估。
79
+ - **Supervision:** `jev_supervise` 返回有界的工作状态判断;确定性的 host policy 将其映射为 `continue`、`verify`、`retry`、`finish` 或 `escalate`。receipt 记录确定性的 `evidence_state`:`present`、`missing` 或 `contradictory`;矛盾证据不能导致 `finish`。Jev 不执行这些动作。
80
+ - **Shadow compaction:** `jev_shadow_compaction` 为 host 提供的 context 生成批量、保守、只报告的 keep/drop 候选。它不会修改、总结或删除 context;path、error、command 和 requirement 在 provider review 前被保留,provider 失败时保留所有其他 items。
81
+ - **Context filtering:** 可选的确定性 `shadow` 或 `conservative` 过滤器减少过期 context,不使用 LLM 摘要。
82
+ - **Experimental browser fast-path:** `jev_browser_step` 根据 host observation 选择一个有界浏览器动作。observation、审批、原生执行和恢复都由 host 提供。
83
+ - **Jev 1.14 视觉与 computer use:** TypeSafe 和 OpenRouter 都支持 PNG/JPEG 截图,适配器会转换各 API 的图片格式。可选 `jev_computer_step` 仅推荐 host 声明的桌面动作;Box 定位需验证目标可见性,执行仍需 host 审批。见[契约](docs/AGENT-IMPLEMENTATION.md#vision-and-computer-use)。
84
+ - **Fail-open:** Jev 被禁用、不可用、出错或无法确定时,控制权返回 host 的正常路径。Jev 不扩大权限,也不猜测执行。
85
+
86
+ 所有可选表面默认关闭:
87
+
88
+ ```sh
89
+ JEV_BROWSER_FAST_PATH=1 jev mcp
90
+ JEV_LAYER_PROVIDER=openrouter JEV_COMPUTER_USE=1 jev mcp
91
+ JEV_SUPERVISION=1 jev mcp
92
+ JEV_CONTEXT_FILTER=shadow jev cli --input examples/route-request.json
93
+ ```
94
+
95
+ ## Harness adapters
96
+
97
+ 示例位于 `integrations/`:
98
+
99
+ - `integrations/hermes/`
100
+ - `integrations/omp/`
101
+ - `integrations/codex/`
102
+ - `integrations/template/`
103
+
104
+ 发布基线记录了准备环境中观察到的 OMP `18.2.6`、Hermes `0.21.3`(`b675e6de`)和 Codex CLI `0.155.1`。这是版本与契约基线,不代表覆盖所有 provider/model 组合;详见 [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md)。
105
+
106
+ ### 添加新的 harness
107
+
108
+ 1. 复制 `integrations/template/adapter.mjs`。
109
+ 2. 添加 `integrations/<harness>/` 和不含 secret 的 config/example。
110
+ 3. 调用 `jev_route`,保留 `correlation_id`,仅通过 host registry 执行,然后调用 `jev_record_execution`。
111
+ 4. 添加覆盖成功、fail-open、审批拒绝和 execution receipt 的离线 smoke fixture。
112
+ 5. 记录支持的版本并通过 CI。
113
+
114
+ 详见 [CONTRIBUTING.md](CONTRIBUTING.md) 和 [docs/SCHEMA-VERSIONING.md](docs/SCHEMA-VERSIONING.md)。
115
+
116
+ ## Browser 状态
117
+
118
+ Browser fast-path 的**可靠性已通过当前 real-browser fixtures 验证**,包括动作顺序、可见链接导航、原生 select、审批拒绝和恢复。**性能优化仍是实验性的**。不宣称任何浏览器加速倍数。
119
+
120
+ ## 安全与兼容性
121
+
122
+ - MIT 许可证:[LICENSE](LICENSE)。
123
+ - jev-layer 不是 security boundary。权限和审批的权威来源是 host:[SECURITY.md](SECURITY.md)。
124
+ - MCP tools、routing decisions、receipts、replay cases 和 adapter contract 当前都是 version 1。应优先添加可选字段,不要静默破坏 v1。
125
+ - 不要提交 credentials、含 secret 的 logs、`.env` 或 machine-specific paths。
126
+
127
+ ## 验证
128
+
129
+ ```sh
130
+ npm test
131
+ npm run smoke
132
+ npm run fail-open-smoke
133
+ npm run clean-install-smoke
134
+ npm pack --dry-run
135
+ ```
136
+
137
+ GitHub Actions 在 Node.js 20、22 和 24 上运行这些检查。Provider-backed 测试需要单独的 secret-managed 环境,不属于普通 PR CI。
138
+
139
+ 文档:[CONTRIBUTING.md](CONTRIBUTING.md) · [SECURITY.md](SECURITY.md) · [RELEASE.md](RELEASE.md) · [CHANGELOG.md](CHANGELOG.md) · [Agent implementation guide](docs/AGENT-IMPLEMENTATION.md)。
package/RELEASE.md CHANGED
@@ -1,53 +1,53 @@
1
- # Release checklist
2
-
3
- [English](README.md) | [Русский](README.ru.md) | [简体中文](README.zh-CN.md)
4
-
5
- This checklist prepares a public open-source release without publishing or pushing it. Do not run `git push`, create a GitHub release, or run `npm publish` without explicit release approval.
6
-
7
- ## Before the release commit
8
-
9
- - [ ] Confirm package name, ownership, repository metadata, and supported Node versions.
10
- - [ ] Set the intended semantic version in `package.json` and `package-lock.json`.
11
- - [ ] Keep `private: true` until the publish decision is explicit; set it false only in the release commit that is authorized to publish.
12
- - [ ] Confirm [LICENSE](LICENSE) is MIT and the copyright notice is correct.
13
- - [ ] Review `CONTRIBUTING.md` and [SECURITY.md](SECURITY.md).
14
- - [ ] Review schema v1 compatibility in [docs/SCHEMA-VERSIONING.md](docs/SCHEMA-VERSIONING.md).
15
- - [ ] Verify every supported adapter and its documented compatibility range.
16
-
17
- ## Verification
18
-
19
- - [ ] `npm install`
20
- - [ ] `npm test`
21
- - [ ] `npm run smoke`
22
- - [ ] `npm run fail-open-smoke`
23
- - [ ] `npm run clean-install-smoke`
24
- - [ ] Run relevant E2E checks for MCP, receipts, supervision, context filtering, discovery, and browser when changed.
25
- - [ ] Confirm provider-backed tests are either absent from ordinary CI or run only with secret-managed credentials.
26
- - [ ] Confirm fail-open and approval-denial paths still preserve host ownership.
27
-
28
- ## Package and documentation
29
-
30
- - [ ] Run `npm pack --dry-run` and inspect the file list.
31
- - [ ] Ensure no `.env`, credentials, private keys, machine-specific paths, or local state is packaged.
32
- - [ ] Confirm `README.md`, `README.ru.md`, and `README.zh-CN.md` all start with the language links and describe the same public behavior.
33
- - [ ] Confirm the README includes the architecture diagram, Quick Start, supported harnesses, routing, receipts/replay, supervision, context filtering, browser status, and fail-open behavior.
34
- - [ ] Update [CHANGELOG.md](CHANGELOG.md) with user-visible changes and compatibility notes.
35
- - [ ] Add release notes for schema, adapter, or provider changes.
36
-
37
- ## Tag and release
38
-
39
- - [ ] Review the final diff and `npm pack --dry-run` output.
40
- - [ ] Create the version commit.
41
- - [ ] Create an annotated tag matching the package version, for example `v0.1.0`.
42
- - [ ] Push the commit and tag only after explicit approval.
43
- - [ ] Create the GitHub release from the tag only after explicit approval.
44
- - [ ] Verify the release source archive and documentation links.
45
-
46
- ## npm publish
47
-
48
- - [ ] Confirm the package is no longer private and the intended npm account/organization is selected.
49
- - [ ] Confirm npm 2FA/trusted publishing policy and provenance requirements.
50
- - [ ] Run `npm publish --dry-run` and inspect the result.
51
- - [ ] Run `npm publish` only after explicit approval.
52
- - [ ] Install the published version in a clean temporary directory and run the smoke/clean-install checks.
53
- - [ ] Record the published version, tag, release URL, and rollback/contact plan in the changelog or release notes.
1
+ # Release checklist
2
+
3
+ [English](README.md) | [Русский](README.ru.md) | [简体中文](README.zh-CN.md)
4
+
5
+ This checklist prepares a public open-source release without publishing or pushing it. Do not run `git push`, create a GitHub release, or run `npm publish` without explicit release approval.
6
+
7
+ ## Before the release commit
8
+
9
+ - [ ] Confirm package name, ownership, repository metadata, and supported Node versions.
10
+ - [ ] Set the intended semantic version in `package.json` and `package-lock.json`.
11
+ - [ ] Keep `private: true` until the publish decision is explicit; set it false only in the release commit that is authorized to publish.
12
+ - [ ] Confirm [LICENSE](LICENSE) is MIT and the copyright notice is correct.
13
+ - [ ] Review `CONTRIBUTING.md` and [SECURITY.md](SECURITY.md).
14
+ - [ ] Review schema v1 compatibility in [docs/SCHEMA-VERSIONING.md](docs/SCHEMA-VERSIONING.md).
15
+ - [ ] Verify every supported adapter and its documented compatibility range.
16
+
17
+ ## Verification
18
+
19
+ - [ ] `npm install`
20
+ - [ ] `npm test`
21
+ - [ ] `npm run smoke`
22
+ - [ ] `npm run fail-open-smoke`
23
+ - [ ] `npm run clean-install-smoke`
24
+ - [ ] Run relevant E2E checks for MCP, receipts, supervision, context filtering, discovery, and browser when changed.
25
+ - [ ] Confirm provider-backed tests are either absent from ordinary CI or run only with secret-managed credentials.
26
+ - [ ] Confirm fail-open and approval-denial paths still preserve host ownership.
27
+
28
+ ## Package and documentation
29
+
30
+ - [ ] Run `npm pack --dry-run` and inspect the file list.
31
+ - [ ] Ensure no `.env`, credentials, private keys, machine-specific paths, or local state is packaged.
32
+ - [ ] Confirm `README.md`, `README.ru.md`, and `README.zh-CN.md` all start with the language links and describe the same public behavior.
33
+ - [ ] Confirm the README includes the architecture diagram, Quick Start, supported harnesses, routing, receipts/replay, supervision, context filtering, browser status, and fail-open behavior.
34
+ - [ ] Update [CHANGELOG.md](CHANGELOG.md) with user-visible changes and compatibility notes.
35
+ - [ ] Add release notes for schema, adapter, or provider changes.
36
+
37
+ ## Tag and release
38
+
39
+ - [ ] Review the final diff and `npm pack --dry-run` output.
40
+ - [ ] Create the version commit.
41
+ - [ ] Create an annotated tag matching the package version, for example `v0.1.0`.
42
+ - [ ] Push the commit and tag only after explicit approval.
43
+ - [ ] Create the GitHub release from the tag only after explicit approval.
44
+ - [ ] Verify the release source archive and documentation links.
45
+
46
+ ## npm publish
47
+
48
+ - [ ] Confirm the package is no longer private and the intended npm account/organization is selected.
49
+ - [ ] Confirm npm 2FA/trusted publishing policy and provenance requirements.
50
+ - [ ] Run `npm publish --dry-run` and inspect the result.
51
+ - [ ] Run `npm publish` only after explicit approval.
52
+ - [ ] Install the published version in a clean temporary directory and run the smoke/clean-install checks.
53
+ - [ ] Record the published version, tag, release URL, and rollback/contact plan in the changelog or release notes.
package/SECURITY.md CHANGED
@@ -1,56 +1,64 @@
1
- # Security policy
2
-
3
- [English](README.md) | [Русский](README.ru.md) | [简体中文](README.zh-CN.md)
4
-
5
- ## Scope and trust model
6
-
7
- jev-layer is a routing and evidence layer, not a security boundary. It can return a bounded recommendation and persist a receipt; it does not grant permissions, execute host capabilities, approve actions, isolate a process, or validate that a provider is truthful.
8
-
9
- The host remains the source of truth for:
10
-
11
- - capability availability and permissions;
12
- - approval and confirmation decisions;
13
- - native execution, retries, recovery, and cancellation;
14
- - final results and side effects.
15
-
16
- Adapters must fail open to the host's normal path when Jev is disabled, unavailable, inconclusive, or returns an error. A Jev response must never be treated as authorization by itself.
17
-
18
- ## API keys and credentials
19
-
20
- - Keep provider keys in process environment variables or user-owned secret storage.
21
- - Never commit `.env` files, API keys, bearer tokens, private keys, provider headers, or copied secret-bearing requests.
22
- - Do not put credentials in `context`, capabilities, prompts, replay fixtures, issue reports, or receipts.
23
- - Use the secret-free `demo` provider for local tests and ordinary pull requests.
24
- - If a credential is exposed, revoke it immediately, remove it from active systems, and report the incident privately.
25
-
26
- Supported provider environment names include `OPENROUTER_API_KEY` and `TYPESAFE_API_KEY`. The names may appear in configuration examples; their values must not.
27
-
28
- ## Logs, receipts, and replay data
29
-
30
- Routing cases and execution receipts can contain capability names, prompts or bounded context, host results, errors, URLs, timing, and provider metadata. Treat `.jev/replay/cases.jsonl` and CI logs as potentially sensitive.
31
-
32
- Before sharing logs or fixtures:
33
-
34
- 1. remove API keys, tokens, cookies, authorization headers, private paths, and personal data;
35
- 2. remove sensitive prompt/context and host output;
36
- 3. retain only the smallest correlation and status fields needed to reproduce the issue.
37
-
38
- Receipt fields are bounded, but bounded data can still be confidential. Do not use receipts as an authorization ledger.
39
-
40
- ## Prompt injection and provider limitations
41
-
42
- Provider output is untrusted data. Prompt injection, malicious capability descriptions, misleading browser text, compromised providers, and incorrect confidence values can cause a bad recommendation. jev-layer does not claim to detect or defeat prompt injection.
43
-
44
- The host must validate selected ids against its current registry, enforce permissions and approval, and reject stale, unavailable, or malformed selections. The browser fast-path is experimental, opt-in, and must not be used as a security control.
45
-
46
- ## Reporting a vulnerability
47
-
48
- Do not open a public issue for an unpatched vulnerability or include secrets in a report. Use a private GitHub Security Advisory for the repository when that channel is available. If it is not available, contact the project maintainers through the private contact channel listed by the repository owner and provide:
49
-
50
- - affected version or commit;
51
- - minimal reproduction;
52
- - impact and required permissions;
53
- - whether credentials or personal data were exposed;
54
- - a safe contact for coordinated follow-up.
55
-
56
- We will acknowledge a report when practicable, validate the impact, coordinate a fix or mitigation, and publish a release note after a fix is available. Please allow maintainers reasonable time for coordinated disclosure.
1
+ # Security policy
2
+
3
+ [English](README.md) | [Русский](README.ru.md) | [简体中文](README.zh-CN.md)
4
+
5
+ ## Scope and trust model
6
+
7
+ jev-layer is a routing and evidence layer, not a security boundary. It can return a bounded recommendation and persist a receipt; it does not grant permissions, execute host capabilities, approve actions, isolate a process, or validate that a provider is truthful.
8
+
9
+ The host remains the source of truth for:
10
+
11
+ - capability availability and permissions;
12
+ - approval and confirmation decisions;
13
+ - native execution, retries, recovery, and cancellation;
14
+ - final results and side effects.
15
+
16
+ Adapters must fail open to the host's normal path when Jev is disabled, unavailable, inconclusive, or returns an error. A Jev response must never be treated as authorization by itself.
17
+
18
+ ## API keys and credentials
19
+
20
+ - Keep provider keys in process environment variables or user-owned secret storage.
21
+ - Never commit `.env` files, API keys, bearer tokens, private keys, provider headers, or copied secret-bearing requests.
22
+ - Do not put credentials in `context`, capabilities, prompts, replay fixtures, issue reports, or receipts.
23
+ - Use the secret-free `demo` provider for local tests and ordinary pull requests.
24
+ - If a credential is exposed, revoke it immediately, remove it from active systems, and report the incident privately.
25
+
26
+ Supported provider environment names include `OPENROUTER_API_KEY` and `TYPESAFE_API_KEY`. The names may appear in configuration examples; their values must not.
27
+
28
+ ## Logs, receipts, and replay data
29
+
30
+ Routing cases and execution receipts can contain capability names, prompts or bounded context, host results, errors, URLs, timing, and provider metadata. Treat `.jev/replay/cases.jsonl` and CI logs as potentially sensitive.
31
+
32
+ Before sharing logs or fixtures:
33
+
34
+ 1. remove API keys, tokens, cookies, authorization headers, private paths, and personal data;
35
+ 2. remove sensitive prompt/context and host output;
36
+ 3. retain only the smallest correlation and status fields needed to reproduce the issue.
37
+
38
+ Receipt fields are bounded, but bounded data can still be confidential. Do not use receipts as an authorization ledger.
39
+
40
+ ## Prompt injection and provider limitations
41
+
42
+ Provider output is untrusted data. Prompt injection, malicious capability descriptions, misleading browser text, compromised providers, and incorrect confidence values can cause a bad recommendation. jev-layer does not claim to detect or defeat prompt injection.
43
+
44
+ The host must validate selected ids against its current registry, enforce permissions and approval, and reject stale, unavailable, or malformed selections. The browser fast-path is experimental, opt-in, and must not be used as a security control.
45
+
46
+ ## Screenshots and computer use
47
+
48
+ Screenshots can expose secrets even when text keys have been redacted. Capture/redact/crop them in the host before upload; image understanding is a remote, experimental provider feature, not local vision. Inline images are excluded from durable replay and pending receipt requests, and `data_base64` fields are redacted from context/host results.
49
+
50
+ `jev_computer_step` only chooses from host-declared click, type, key, scroll, or handoff actions. Computer permissions must be explicit. Click/type/key always require host confirmation, including when their declared risk is low. A Box is used only with a positive target-visibility probability and sufficient confidence; it is not proof that an action is safe.
51
+
52
+ Every returned computer action is bound to the supplied screenshot's SHA-256 and dimensions. Before acting, the host must verify that it is still current, re-observe if stale, map screenshot pixels to its desktop/window/crop/DPI coordinates, and enforce native permissions, focus, approvals and cancellation. The layer never captures the desktop or injects mouse/keyboard events.
53
+
54
+ ## Reporting a vulnerability
55
+
56
+ Do not open a public issue for an unpatched vulnerability or include secrets in a report. Use a private GitHub Security Advisory for the repository when that channel is available. If it is not available, contact the project maintainers through the private contact channel listed by the repository owner and provide:
57
+
58
+ - affected version or commit;
59
+ - minimal reproduction;
60
+ - impact and required permissions;
61
+ - whether credentials or personal data were exposed;
62
+ - a safe contact for coordinated follow-up.
63
+
64
+ We will acknowledge a report when practicable, validate the impact, coordinate a fix or mitigation, and publish a release note after a fix is available. Please allow maintainers reasonable time for coordinated disclosure.