upstream-radar 0.34.0 → 0.35.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 +69 -24
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/upstream-alignment.d.ts +67 -0
- package/dist/src/upstream-alignment.d.ts.map +1 -0
- package/dist/src/upstream-alignment.js +263 -0
- package/dist/src/upstream-alignment.js.map +1 -0
- package/dist/src/upstream-observer.d.ts +7 -0
- package/dist/src/upstream-observer.d.ts.map +1 -1
- package/dist/src/upstream-observer.js +77 -1
- package/dist/src/upstream-observer.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/README.zh-CN.md +35 -18
- package/package.json +1 -1
- package/schemas/upstream-downstream-ir.schema.json +87 -0
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const TOOL_VERSION = "0.
|
|
1
|
+
export declare const TOOL_VERSION = "0.35.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const TOOL_VERSION = '0.
|
|
1
|
+
export const TOOL_VERSION = '0.35.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -96,7 +96,7 @@ FIRST EPSS estimated exploitation probability: 97.2% (percentile 100.0%)
|
|
|
96
96
|
想立即检查一个真实发布的 DSH 插件,可以在空目录直接运行:
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
npx --yes upstream-radar@0.
|
|
99
|
+
npx --yes upstream-radar@0.35.0 inspect dsh-feishu-bot@0.15.8 --deep
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
它会直接输出简短的准入结论、覆盖情况、依赖数量、漏洞数量和下一步,不需要先
|
|
@@ -109,7 +109,7 @@ npx --yes upstream-radar@0.34.0 inspect dsh-feishu-bot@0.15.8 --deep
|
|
|
109
109
|
npm 解析环境中目前无法建立完整依赖图:
|
|
110
110
|
|
|
111
111
|
```bash
|
|
112
|
-
npx --yes upstream-radar@0.
|
|
112
|
+
npx --yes upstream-radar@0.35.0 inspect \
|
|
113
113
|
@sanqi-normal/dsh-webui-market-plugin@0.5.4 \
|
|
114
114
|
--deep --fail-on never
|
|
115
115
|
```
|
|
@@ -292,6 +292,23 @@ old → new 变化比较
|
|
|
292
292
|
只有重要变化 → DSH Agent 任务 → 报告
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
+
每个观察点还会保存一份 upstream/downstream 对齐 IR:上游是 Git commit 和
|
|
296
|
+
`package.json` 身份,下游是实际观察到的 npm 包、lockfile 根节点和依赖图覆盖率。
|
|
297
|
+
结果只有三种:`aligned`(证据一致)、`mismatch`(身份或根节点不一致)、
|
|
298
|
+
`unknown`(缺少发布物或依赖图证据)。例如公开飞书插件当前是:
|
|
299
|
+
|
|
300
|
+
```text
|
|
301
|
+
源码: dsh-lark-bot@0.15.8
|
|
302
|
+
npm: dsh-feishu-bot@0.15.8
|
|
303
|
+
图根: dsh-lark-bot@0.15.8
|
|
304
|
+
结果: mismatch
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
这不是恶意插件或运行不兼容的结论,而是“源码 → 发布物 → 依赖图”无法完全对上的
|
|
308
|
+
供应链证据缺口。Radar 会在首次 baseline 报告中指出它,并给出作者修复方向;不会
|
|
309
|
+
因为一个持续存在的 mismatch 每天重复唤醒 Agent。机器可读定义见
|
|
310
|
+
[`upstream-downstream-ir.schema.json`](../schemas/upstream-downstream-ir.schema.json)。
|
|
311
|
+
|
|
295
312
|
可以从[可复制的真实 targets 示例](../examples/upstream-observer/targets.yml)开始。它默认观察公开的 DSH/飞书插件 `PlutoKeating/dsh-lark-bot`,不是模拟项目:
|
|
296
313
|
|
|
297
314
|
```yaml
|
|
@@ -315,7 +332,7 @@ Radar 会在三层目录内自动找到它;npm 名称和源码 manifest 不一
|
|
|
315
332
|
想明确选择锁文件时再加 `--lockfile`:
|
|
316
333
|
|
|
317
334
|
```bash
|
|
318
|
-
npx --yes upstream-radar@0.
|
|
335
|
+
npx --yes upstream-radar@0.35.0 observe \
|
|
319
336
|
https://github.com/PlutoKeating/dsh-lark-bot \
|
|
320
337
|
--state ./observations.json --report ./upstream-radar-observer.md
|
|
321
338
|
```
|
|
@@ -338,7 +355,7 @@ workspace 边保留为未解析证据;不会安装或启动 DSH。
|
|
|
338
355
|
会额外指定 `--package`:
|
|
339
356
|
|
|
340
357
|
```bash
|
|
341
|
-
npx --yes upstream-radar@0.
|
|
358
|
+
npx --yes upstream-radar@0.35.0 observe \
|
|
342
359
|
https://github.com/PlutoKeating/dsh-lark-bot \
|
|
343
360
|
--package dsh-feishu-bot \
|
|
344
361
|
--lockfile pnpm-lock.yaml --lockfile-type pnpm \
|
|
@@ -616,7 +633,7 @@ cd my-dsh-plugin
|
|
|
616
633
|
pnpm install --ignore-scripts
|
|
617
634
|
|
|
618
635
|
# 把插件放进 DSH profile 前,先读取精确依赖图。
|
|
619
|
-
pnpm dlx --package=upstream-radar@0.
|
|
636
|
+
pnpm dlx --package=upstream-radar@0.35.0 upstream-radar graph pnpm-lock pnpm-lock.yaml --json
|
|
620
637
|
```
|
|
621
638
|
|
|
622
639
|
这棵图会保留精确的 DSH 包版本,也会把未解析的可选 peer 明确显示出来;它不会加载生成的插件,也不会运行 lifecycle script。审查后,把下面这个完整 workflow 复制到 `.github/workflows/upstream-radar.yml`:
|
|
@@ -638,7 +655,7 @@ jobs:
|
|
|
638
655
|
runs-on: ubuntu-latest
|
|
639
656
|
steps:
|
|
640
657
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
641
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
658
|
+
- uses: MicroMilo/upstream-radar@v0.35.0
|
|
642
659
|
with:
|
|
643
660
|
fail-on: high
|
|
644
661
|
fail-on-compatibility: breaking
|
|
@@ -649,7 +666,7 @@ Action 会自动识别唯一的 `pnpm-lock.yaml`,检查同一棵精确依赖
|
|
|
649
666
|
也可以直接检查一个真实发布的 DSH 包:
|
|
650
667
|
|
|
651
668
|
```bash
|
|
652
|
-
npx --yes upstream-radar@0.
|
|
669
|
+
npx --yes upstream-radar@0.35.0 inspect dsh-feishu-bot@0.15.8 --deep
|
|
653
670
|
```
|
|
654
671
|
|
|
655
672
|
这次检查的结论是 `REVIEW`:registry 完整性、签名、provenance 和 89 个已解析包都
|
|
@@ -662,7 +679,7 @@ npx --yes upstream-radar@0.34.0 inspect dsh-feishu-bot@0.15.8 --deep
|
|
|
662
679
|
如果不想分别执行 `inspect`、打包和 `probe`,可以用一个命令完成一次 DSH 插件审查:
|
|
663
680
|
|
|
664
681
|
```bash
|
|
665
|
-
pnpm dlx --package=upstream-radar@0.
|
|
682
|
+
pnpm dlx --package=upstream-radar@0.35.0 upstream-radar review dsh-plugin \
|
|
666
683
|
dsh-cloudflare-browser-run@0.1.1 \
|
|
667
684
|
--dsh-version 0.1.0-rc.6,0.1.0-rc.7
|
|
668
685
|
```
|
|
@@ -828,7 +845,7 @@ pnpm run try:dsh
|
|
|
828
845
|
在把项目接入兼容性门禁前,可以先运行离线规则 benchmark:
|
|
829
846
|
|
|
830
847
|
```bash
|
|
831
|
-
pnpm dlx --package=upstream-radar@0.
|
|
848
|
+
pnpm dlx --package=upstream-radar@0.35.0 upstream-radar benchmark compatibility
|
|
832
849
|
```
|
|
833
850
|
|
|
834
851
|
它覆盖六类契约:安全补丁、只需要项目分析的变化、不兼容的 DSH peer、发布者明确声明 breaking、候选传递依赖漏洞,以及候选依赖图不完整。这个命令不会联网、安装包、加载插件或启动 DSH;它验证的是 Radar 的确定性规则以及 `breaking`/`any` 门禁行为,不是运行时兼容性证明。
|
|
@@ -841,7 +858,7 @@ pnpm dlx --package=upstream-radar@0.34.0 upstream-radar benchmark compatibility
|
|
|
841
858
|
# 打包精确版本,并明确不运行它的 lifecycle script。
|
|
842
859
|
npm pack --ignore-scripts dsh-plugin@1.2.3
|
|
843
860
|
|
|
844
|
-
pnpm dlx --package=upstream-radar@0.
|
|
861
|
+
pnpm dlx --package=upstream-radar@0.35.0 upstream-radar probe dsh-load \
|
|
845
862
|
./dsh-plugin-1.2.3.tgz \
|
|
846
863
|
--dsh-version 0.1.0-rc.6
|
|
847
864
|
```
|
|
@@ -867,7 +884,7 @@ pnpm run showcase:dsh-probe
|
|
|
867
884
|
如果要比较多个 DSH 版本,可以使用矩阵入口:
|
|
868
885
|
|
|
869
886
|
```bash
|
|
870
|
-
pnpm dlx --package=upstream-radar@0.
|
|
887
|
+
pnpm dlx --package=upstream-radar@0.35.0 upstream-radar probe dsh-matrix \
|
|
871
888
|
./dsh-plugin-1.2.3.tgz \
|
|
872
889
|
--dsh-version 0.1.0-rc.3 \
|
|
873
890
|
--dsh-version 0.1.0-rc.6 \
|
|
@@ -885,7 +902,7 @@ JSON 结果结构见[矩阵结果 schema](../schemas/dsh-load-matrix.schema.json
|
|
|
885
902
|
```yaml
|
|
886
903
|
steps:
|
|
887
904
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
888
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
905
|
+
- uses: MicroMilo/upstream-radar@v0.35.0
|
|
889
906
|
with:
|
|
890
907
|
fail-on: high
|
|
891
908
|
# 可选:把确定性的 DSH/插件兼容性破坏也作为 CI 失败条件
|
|
@@ -894,12 +911,12 @@ steps:
|
|
|
894
911
|
threat-intel: true
|
|
895
912
|
```
|
|
896
913
|
|
|
897
|
-
这个 Action 只是 `radar check --frozen --state :memory: --fail-on high --fail-on-compatibility breaking --json` 的薄封装。`--frozen` 是有意的:它只使用配置文件里的依赖图,不会尝试读取 runner 上不存在的本地 DSH profile。`threat-intel` 默认是 `false`,这样普通 CI 门禁不会因为额外查询变重;设置为 `true` 后,Job Summary 和原始 JSON 会包含 CISA KEV 与 FIRST EPSS 的优先级证据。每次运行彼此独立;发现达到阈值的漏洞或选择的兼容性变化时返回 `2`,运行或漏洞源出错时返回 `1`。`breaking` 只拦截有 confirmed/strong 信号的兼容性事件,`any` 会拦截所有活动兼容性事件,默认值是 `never`。除了原始 JSON 日志,Action 还会把经过转义的简短摘要写入 GitHub Job Summary,定时任务失败时可以直接看到受影响的包、准确依赖路径、已经发布的修复版本(如果有)、一行优先级证据和建议的下一步。这个入口不会投递 DSH Agent 任务,也不会修改分支;需要持续监控和项目级分析时,仍使用原生 DSH bundle。建议把 Action 固定到类似 `v0.
|
|
914
|
+
这个 Action 只是 `radar check --frozen --state :memory: --fail-on high --fail-on-compatibility breaking --json` 的薄封装。`--frozen` 是有意的:它只使用配置文件里的依赖图,不会尝试读取 runner 上不存在的本地 DSH profile。`threat-intel` 默认是 `false`,这样普通 CI 门禁不会因为额外查询变重;设置为 `true` 后,Job Summary 和原始 JSON 会包含 CISA KEV 与 FIRST EPSS 的优先级证据。每次运行彼此独立;发现达到阈值的漏洞或选择的兼容性变化时返回 `2`,运行或漏洞源出错时返回 `1`。`breaking` 只拦截有 confirmed/strong 信号的兼容性事件,`any` 会拦截所有活动兼容性事件,默认值是 `never`。除了原始 JSON 日志,Action 还会把经过转义的简短摘要写入 GitHub Job Summary,定时任务失败时可以直接看到受影响的包、准确依赖路径、已经发布的修复版本(如果有)、一行优先级证据和建议的下一步。这个入口不会投递 DSH Agent 任务,也不会修改分支;需要持续监控和项目级分析时,仍使用原生 DSH bundle。建议把 Action 固定到类似 `v0.35.0` 的发布标签,并根据团队策略固定 checkout Action。
|
|
898
915
|
|
|
899
916
|
如果仓库还没有提交 Radar 配置,最短接入方式是省略 `config`、`pnpm-lock` 和 `npm-lock`。checkout 之后,Action 会自动使用唯一存在的 `pnpm-lock.yaml` 或 `package-lock.json`,生成临时的审查清单,再执行同一个 frozen 检查:
|
|
900
917
|
|
|
901
918
|
```yaml
|
|
902
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
919
|
+
- uses: MicroMilo/upstream-radar@v0.35.0
|
|
903
920
|
with:
|
|
904
921
|
fail-on: high
|
|
905
922
|
```
|
|
@@ -909,7 +926,7 @@ steps:
|
|
|
909
926
|
如果要在插件进入 DSH 前审查精确发布物,可以增加 `inspect-package`:
|
|
910
927
|
|
|
911
928
|
```yaml
|
|
912
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
929
|
+
- uses: MicroMilo/upstream-radar@v0.35.0
|
|
913
930
|
with:
|
|
914
931
|
inspect-package: dsh-cloudflare-browser-run@0.1.1
|
|
915
932
|
# review 是安全默认值;只有允许覆盖不完整时才使用 block
|
|
@@ -921,7 +938,7 @@ steps:
|
|
|
921
938
|
如果仓库只有 pnpm 锁文件,还没有提交 Radar 配置,可以让 Action 在同一个 job 中生成配置;可直接复制[pnpm workflow 示例](../examples/github-actions/upstream-radar-pnpm.yml):
|
|
922
939
|
|
|
923
940
|
```yaml
|
|
924
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
941
|
+
- uses: MicroMilo/upstream-radar@v0.35.0
|
|
925
942
|
with:
|
|
926
943
|
pnpm-lock: pnpm-lock.yaml
|
|
927
944
|
fail-on: high
|
|
@@ -935,7 +952,7 @@ npm 项目可以改用 `npm-lock: package-lock.json`;`pnpm-lock` 和 `npm-lock
|
|
|
935
952
|
调用方需要先 checkout 仓库。这个 Action 不会安装项目依赖,也不会执行项目的 lifecycle script;它只读取提交到仓库的依赖图并查询配置中的上游漏洞源。如果需要完全显式的底层命令,等价写法是:
|
|
936
953
|
|
|
937
954
|
```bash
|
|
938
|
-
pnpm dlx --package=upstream-radar@0.
|
|
955
|
+
pnpm dlx --package=upstream-radar@0.35.0 upstream-radar radar check \
|
|
939
956
|
./upstream-radar.config.json --frozen --state :memory: --fail-on high \
|
|
940
957
|
--fail-on-compatibility breaking --json
|
|
941
958
|
```
|
|
@@ -943,7 +960,7 @@ pnpm dlx --package=upstream-radar@0.34.0 upstream-radar radar check \
|
|
|
943
960
|
如果还要检查一个已发布插件能否跨多个 DSH 版本加载,可以增加三个 input:
|
|
944
961
|
|
|
945
962
|
```yaml
|
|
946
|
-
- uses: MicroMilo/upstream-radar@v0.
|
|
963
|
+
- uses: MicroMilo/upstream-radar@v0.35.0
|
|
947
964
|
id: radar
|
|
948
965
|
with:
|
|
949
966
|
config: upstream-radar.config.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "upstream-radar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.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",
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/MicroMilo/upstream-radar/blob/main/schemas/upstream-downstream-ir.schema.json",
|
|
4
|
+
"title": "Upstream Radar upstream/downstream alignment IR",
|
|
5
|
+
"description": "Evidence-only alignment between a source package and the published package/dependency graph consumed downstream.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schema", "targetId", "ecosystem", "upstream", "downstream", "status", "checks"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema": { "const": "upstream-radar.upstream-downstream-ir/v1alpha1" },
|
|
11
|
+
"targetId": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
12
|
+
"ecosystem": { "enum": ["dsh", "codex", "pi"] },
|
|
13
|
+
"upstream": {
|
|
14
|
+
"$ref": "#/$defs/upstream"
|
|
15
|
+
},
|
|
16
|
+
"downstream": {
|
|
17
|
+
"$ref": "#/$defs/downstream"
|
|
18
|
+
},
|
|
19
|
+
"status": { "$ref": "#/$defs/status" },
|
|
20
|
+
"checks": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"minItems": 1,
|
|
23
|
+
"maxItems": 32,
|
|
24
|
+
"items": { "$ref": "#/$defs/check" }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"$defs": {
|
|
28
|
+
"status": {
|
|
29
|
+
"enum": ["aligned", "mismatch", "unknown"]
|
|
30
|
+
},
|
|
31
|
+
"coordinate": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["name", "version"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
37
|
+
"version": { "type": "string", "minLength": 1, "maxLength": 512 }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"upstream": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["repository", "commit", "packagePath", "coordinate"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"repository": { "type": "string", "minLength": 1, "maxLength": 4096 },
|
|
46
|
+
"commit": { "type": "string", "minLength": 1, "maxLength": 256 },
|
|
47
|
+
"packagePath": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
48
|
+
"coordinate": { "$ref": "#/$defs/coordinate" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"graph": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": ["status", "nodes", "edges", "unresolved"],
|
|
55
|
+
"properties": {
|
|
56
|
+
"status": { "enum": ["complete", "incomplete", "unavailable"] },
|
|
57
|
+
"root": { "$ref": "#/$defs/coordinate" },
|
|
58
|
+
"digest": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
59
|
+
"nodes": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
60
|
+
"edges": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
61
|
+
"unresolved": { "type": "integer", "minimum": 0, "maximum": 1000000 }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"downstream": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["graph"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"published": { "$ref": "#/$defs/coordinate" },
|
|
70
|
+
"graph": { "$ref": "#/$defs/graph" }
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"check": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": ["code", "status", "summary"],
|
|
77
|
+
"properties": {
|
|
78
|
+
"code": { "enum": ["source-published-identity", "source-graph-root", "published-graph-root", "dependency-graph-coverage"] },
|
|
79
|
+
"status": { "$ref": "#/$defs/status" },
|
|
80
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 4096 },
|
|
81
|
+
"upstream": { "type": "string", "minLength": 1, "maxLength": 1024 },
|
|
82
|
+
"downstream": { "type": "string", "minLength": 1, "maxLength": 1024 },
|
|
83
|
+
"remediation": { "type": "string", "minLength": 1, "maxLength": 4096 }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|