upstream-radar 0.29.0 → 0.31.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.
- package/README.md +19 -22
- package/dist/src/cli.js +96 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/doctor.js +1 -1
- package/dist/src/doctor.js.map +1 -1
- package/dist/src/dsh-plugin.d.ts.map +1 -1
- package/dist/src/dsh-plugin.js +0 -2
- package/dist/src/dsh-plugin.js.map +1 -1
- package/dist/src/graph.d.ts.map +1 -1
- package/dist/src/graph.js +14 -4
- package/dist/src/graph.js.map +1 -1
- package/dist/src/installed-graph.d.ts.map +1 -1
- package/dist/src/installed-graph.js +5 -4
- package/dist/src/installed-graph.js.map +1 -1
- package/dist/src/inventory.d.ts.map +1 -1
- package/dist/src/inventory.js +20 -0
- package/dist/src/inventory.js.map +1 -1
- package/dist/src/radar-status.d.ts +2 -0
- package/dist/src/radar-status.d.ts.map +1 -1
- package/dist/src/radar-status.js +17 -5
- package/dist/src/radar-status.js.map +1 -1
- package/dist/src/radar-types.d.ts +4 -0
- package/dist/src/radar-types.d.ts.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/README.zh-CN.md +18 -23
- package/package.json +1 -1
package/docs/README.zh-CN.md
CHANGED
|
@@ -21,15 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
# 终端 1
|
|
24
|
-
|
|
25
|
-
pnpm dlx --package=upstream-radar@latest upstream-radar init \
|
|
24
|
+
pnpm dlx --package=upstream-radar@latest upstream-radar setup \
|
|
26
25
|
--profile web \
|
|
27
26
|
--project-name "我的 DSH 项目" \
|
|
28
27
|
--output ./upstream-radar.config.json \
|
|
29
28
|
--dsh-patch ./upstream-radar.dsh.yml
|
|
30
|
-
pnpm dlx --package=upstream-radar@latest upstream-radar doctor ./upstream-radar.config.json \
|
|
31
|
-
--profile web \
|
|
32
|
-
--patch ./upstream-radar.dsh.yml
|
|
33
29
|
dsh --profile web --patch ./upstream-radar.dsh.yml
|
|
34
30
|
```
|
|
35
31
|
|
|
@@ -40,7 +36,7 @@ DSH 启动后,在第二个终端执行只读状态检查:
|
|
|
40
36
|
pnpm dlx --package=upstream-radar@latest upstream-radar radar status ./upstream-radar.config.json
|
|
41
37
|
```
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
`setup` 会明确调用 DSH 的安装命令,把当前正在运行的精确 Radar 版本放进选中的 profile,然后写出可审查的清单和 DSH overlay,并运行不联网的本地接线检查。它不会启动 DSH,也不会执行插件业务动作;检查生成文件后再启动。已经安装过 bundle 时加 `--no-install`。`radar status` 会在不重新请求网络的情况下确认第一次完整检查。完整的状态文件、兼容的旧环境变量方式、profile 边界和真实运行证明见[完整 DSH 配置](#安装到-dsh)。
|
|
44
40
|
|
|
45
41
|
如果只想先试跑一次监控,而不启动 DSH profile,可以使用同一份清单:
|
|
46
42
|
|
|
@@ -111,19 +107,14 @@ Route: payments-platform via feishu:payments-security
|
|
|
111
107
|
Upstream Radar 发布的是已经构建好的 npm bundle,不需要开放安装期构建权限:
|
|
112
108
|
|
|
113
109
|
```bash
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
不用手写依赖图,可以直接从 DSH profile 生成项目清单:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
pnpm dlx --package=upstream-radar@latest upstream-radar init \
|
|
110
|
+
pnpm dlx --package=upstream-radar@latest upstream-radar setup \
|
|
111
|
+
--profile web \
|
|
121
112
|
--project-name "我的 DSH 项目" \
|
|
122
113
|
--output ./upstream-radar.config.json \
|
|
123
114
|
--dsh-patch ./upstream-radar.dsh.yml
|
|
124
115
|
```
|
|
125
116
|
|
|
126
|
-
|
|
117
|
+
`setup` 会使用当前命令对应的精确 Radar 版本调用 DSH 安装器,生成项目清单和 overlay,并运行不联网的 `doctor`。它不会启动 DSH。检查两个生成文件后启动 profile:
|
|
127
118
|
|
|
128
119
|
```bash
|
|
129
120
|
dsh --profile web --patch ./upstream-radar.dsh.yml --dump-config
|
|
@@ -131,6 +122,10 @@ dsh --profile web --patch ./upstream-radar.dsh.yml
|
|
|
131
122
|
pnpm dlx --package=upstream-radar@latest upstream-radar radar status ./upstream-radar.config.json
|
|
132
123
|
```
|
|
133
124
|
|
|
125
|
+
如果 bundle 已经在 profile 中,加入 `--no-install`。如果你想把安装单独拿出来审查,也可以使用底层路径:先运行 `dsh plugin --profile web add upstream-radar@<精确版本>`,再运行 `init --profile web --dsh-patch ...` 和 `doctor`。
|
|
126
|
+
|
|
127
|
+
初始化命令会读取 profile 中实际安装的第三方 bundle,并沿着该 profile 暴露的 `node_modules` 目录构建依赖图,包括重复版本、override 和本地 package-manager 选择。默认把 workspace 写成 `.`,因此配置可以提交并在另一台机器复用;请从项目根目录启动 DSH。如果 DSH 从其他目录启动,再传入 `--workspace <绝对路径>`。它只读取 manifest,不会导入插件代码、运行 lifecycle scripts、启动 DSH 或开启轮询。
|
|
128
|
+
|
|
134
129
|
如果启动结果不对,先运行本地接线检查,不需要访问漏洞源:
|
|
135
130
|
|
|
136
131
|
```bash
|
|
@@ -143,7 +138,7 @@ pnpm dlx --package=upstream-radar@latest upstream-radar doctor ./upstream-radar.
|
|
|
143
138
|
|
|
144
139
|
生成的 overlay 会记录选中的 profile;如果初始化时传入了 `--registry <url>`,它也会被带入 DSH 运行时,避免后续 release 和候选依赖检查悄悄切回公共 npm。原生 DSH 每次轮询前,以及 CLI 的 `radar check/watch` 每次轮询前,都会重新读取这个 profile 的实际依赖图,因此之后安装、升级、卸载插件,或 DSH 宿主运行时发生变化时,不会继续悄悄监控旧快照;如果重读失败,本轮会停止,不会替换最后一次持久化状态。`radar status` 仍然只读取本地配置和状态,不会刷新 OSV/npm/GitHub;它还会列出最重要的活动事件、精确依赖路径或候选信号,以及建议的下一步。`radar compare` 也只比较你明确提供的文件。如果不使用 `--dsh-patch`,仍可以使用 `UPSTREAM_RADAR_CONFIG`、`UPSTREAM_RADAR_STATE`、`UPSTREAM_RADAR_INTERVAL_SECONDS`、`UPSTREAM_RADAR_REGISTRY` 和 `UPSTREAM_RADAR_DEEP_CANDIDATES` 环境变量方式。
|
|
145
140
|
|
|
146
|
-
生成的依赖图对应 profile 当前实际安装的树。DSH 还会在 `profiles/node_modules` 维护一层共享的宿主运行时依赖;Radar 会把从这里解析到的包纳入漏洞查询,并明确标成 `dsh-host`,不会和插件自己带的依赖混在一起。如果一个必需依赖在 profile
|
|
141
|
+
生成的依赖图对应 profile 当前实际安装的树。DSH 还会在 `profiles/node_modules` 维护一层共享的宿主运行时依赖;Radar 会把从这里解析到的包纳入漏洞查询,并明确标成 `dsh-host`,不会和插件自己带的依赖混在一起。如果一个必需依赖在 profile 和宿主依赖平面中都找不到,它会保留为“覆盖不完整”,不会被当成安全或不存在。当前平台没有安装的可选原生包仍会记录,但不会制造“必需依赖缺失”的假警报。对于 `@deepseek-ai/dsh-*`、Cordis 这类宿主 peer,如果 profile 没有暴露准确版本,`doctor` 和 `radar status` 会单独写明“DSH 宿主依赖未观察到”,而不是把它和普通缺失依赖混成一个数字。这意味着漏洞查询没有覆盖该宿主边界,结果不能当作完整安全结论。显式传入 `--registry <url>` 才会使用公共 npm artifact 图,适合和 registry 解析结果做比较,但不是默认路径。
|
|
147
142
|
|
|
148
143
|
如果需要手写配置或制作 CI fixture,可以参考[示例清单](../examples/radar/config.json)。如果既没有 `--patch` overlay,也没有设置 `UPSTREAM_RADAR_CONFIG`,插件会保持休眠,不发起轮询。
|
|
149
144
|
|
|
@@ -189,7 +184,7 @@ pnpm run try:dsh
|
|
|
189
184
|
在把项目接入兼容性门禁前,可以先运行离线规则 benchmark:
|
|
190
185
|
|
|
191
186
|
```bash
|
|
192
|
-
pnpm dlx --package=upstream-radar@0.
|
|
187
|
+
pnpm dlx --package=upstream-radar@0.31.0 upstream-radar benchmark compatibility
|
|
193
188
|
```
|
|
194
189
|
|
|
195
190
|
它覆盖六类契约:安全补丁、只需要项目分析的变化、不兼容的 DSH peer、发布者明确声明 breaking、候选传递依赖漏洞,以及候选依赖图不完整。这个命令不会联网、安装包、加载插件或启动 DSH;它验证的是 Radar 的确定性规则以及 `breaking`/`any` 门禁行为,不是运行时兼容性证明。
|
|
@@ -202,7 +197,7 @@ pnpm dlx --package=upstream-radar@0.29.0 upstream-radar benchmark compatibility
|
|
|
202
197
|
# 打包精确版本,并明确不运行它的 lifecycle script。
|
|
203
198
|
npm pack --ignore-scripts dsh-plugin@1.2.3
|
|
204
199
|
|
|
205
|
-
pnpm dlx --package=upstream-radar@0.
|
|
200
|
+
pnpm dlx --package=upstream-radar@0.31.0 upstream-radar probe dsh-load \
|
|
206
201
|
./dsh-plugin-1.2.3.tgz \
|
|
207
202
|
--dsh-version 0.1.0-rc.6
|
|
208
203
|
```
|
|
@@ -228,7 +223,7 @@ pnpm run showcase:dsh-probe
|
|
|
228
223
|
如果要比较多个 DSH 版本,可以使用矩阵入口:
|
|
229
224
|
|
|
230
225
|
```bash
|
|
231
|
-
pnpm dlx --package=upstream-radar@0.
|
|
226
|
+
pnpm dlx --package=upstream-radar@0.31.0 upstream-radar probe dsh-matrix \
|
|
232
227
|
./dsh-plugin-1.2.3.tgz \
|
|
233
228
|
--dsh-version 0.1.0-rc.3 \
|
|
234
229
|
--dsh-version 0.1.0-rc.6 \
|
|
@@ -246,7 +241,7 @@ JSON 结果结构见[矩阵结果 schema](../schemas/dsh-load-matrix.schema.json
|
|
|
246
241
|
```yaml
|
|
247
242
|
steps:
|
|
248
243
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
249
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
244
|
+
- uses: MicroMilo/upstream-radar@v0.31.0
|
|
250
245
|
with:
|
|
251
246
|
config: upstream-radar.config.json
|
|
252
247
|
fail-on: high
|
|
@@ -254,12 +249,12 @@ steps:
|
|
|
254
249
|
fail-on-compatibility: breaking
|
|
255
250
|
```
|
|
256
251
|
|
|
257
|
-
这个 Action 只是 `radar check --frozen --state :memory: --fail-on high --fail-on-compatibility breaking --json` 的薄封装。`--frozen` 是有意的:它只使用配置文件里的依赖图,不会尝试读取 runner 上不存在的本地 DSH profile。每次运行彼此独立;发现达到阈值的漏洞或选择的兼容性变化时返回 `2`,运行或漏洞源出错时返回 `1`。`breaking` 只拦截有 confirmed/strong 信号的兼容性事件,`any` 会拦截所有活动兼容性事件,默认值是 `never`。这个入口不会投递 DSH Agent 任务,也不会修改分支;需要持续监控和项目级分析时,仍使用原生 DSH bundle。建议把 Action 固定到类似 `v0.
|
|
252
|
+
这个 Action 只是 `radar check --frozen --state :memory: --fail-on high --fail-on-compatibility breaking --json` 的薄封装。`--frozen` 是有意的:它只使用配置文件里的依赖图,不会尝试读取 runner 上不存在的本地 DSH profile。每次运行彼此独立;发现达到阈值的漏洞或选择的兼容性变化时返回 `2`,运行或漏洞源出错时返回 `1`。`breaking` 只拦截有 confirmed/strong 信号的兼容性事件,`any` 会拦截所有活动兼容性事件,默认值是 `never`。这个入口不会投递 DSH Agent 任务,也不会修改分支;需要持续监控和项目级分析时,仍使用原生 DSH bundle。建议把 Action 固定到类似 `v0.31.0` 的发布标签,并根据团队策略固定 checkout Action。
|
|
258
253
|
|
|
259
254
|
调用方需要先 checkout 仓库。这个 Action 不会安装项目依赖,也不会执行项目的 lifecycle script;它只读取提交到仓库的依赖图并查询配置中的上游漏洞源。如果需要完全显式的底层命令,等价写法是:
|
|
260
255
|
|
|
261
256
|
```bash
|
|
262
|
-
pnpm dlx --package=upstream-radar@0.
|
|
257
|
+
pnpm dlx --package=upstream-radar@0.31.0 upstream-radar radar check \
|
|
263
258
|
./upstream-radar.config.json --frozen --state :memory: --fail-on high \
|
|
264
259
|
--fail-on-compatibility breaking --json
|
|
265
260
|
```
|
|
@@ -267,7 +262,7 @@ pnpm dlx --package=upstream-radar@0.29.0 upstream-radar radar check \
|
|
|
267
262
|
如果还要检查一个已发布插件能否跨多个 DSH 版本加载,可以增加三个 input:
|
|
268
263
|
|
|
269
264
|
```yaml
|
|
270
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
265
|
+
- uses: MicroMilo/upstream-radar@v0.31.0
|
|
271
266
|
id: radar
|
|
272
267
|
with:
|
|
273
268
|
config: upstream-radar.config.json
|
|
@@ -354,7 +349,7 @@ DSH Agent 收到的任务要求:只读分析、引用项目证据、保留不
|
|
|
354
349
|
|
|
355
350
|
## 当前能力与边界
|
|
356
351
|
|
|
357
|
-
已经支持:DSH profile 实际安装树和 npm lock
|
|
352
|
+
已经支持:DSH profile 实际安装树和 npm lock 依赖图、重复版本路径、未解析依赖的覆盖提示、可选 peer 与 DSH 宿主 peer 的区分、OSV 精确版本匹配、恶意包记录、npm release 监听(只接受高于当前安装版本的候选;npm 的 `latest` 回退不会制造 breaking 告警;最新版本有确定性阻断时会检查历史候选的 OSV 状态和最早一小段传递依赖图,并筛出第一个没有确定性阻断且没有已知漏洞路径、值得交给 DSH 分析的候选;图不完整、图解析或 OSV 失败时不推荐候选)、公开 GitHub Release 说明、OSV 故障时保留已确认状态、连续失败后的 source-health DSH notice、持久事件、按项目 workspace 精确路由到 DSH Agent、严格绑定消息/会话/task/event 的 DSH 结果写回、以及 Node/peer/exports/入口/bundle/版本边界检查;还包括不联网的 `doctor` 接线检查、默认可提交的相对 workspace、把审查过的图接入 CI 的可复用 GitHub Action、可选的 breaking/any 兼容性门禁、可选的 DSH 版本加载矩阵、离线的 `benchmark compatibility` 规则契约检查,以及基于真实 DSH 插件的 consumer smoke。
|
|
358
353
|
|
|
359
354
|
此外支持一次性的 `probe dsh-load` 和有界的 `probe dsh-matrix`:在临时 DSH profile 中针对一个或多个精确 DSH 版本加载一个精确 tarball,并返回 `compatible`、`incompatible` 或 `unknown`。它是加载兼容性证据,不是安全准入,也不是插件能力 benchmark。
|
|
360
355
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "upstream-radar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Always-on dependency security monitoring for DeepSeek Harness (DSH) plugins: find exact installed or candidate transitive vulnerable paths and breaking updates, then route evidence to a DSH Agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|