Skip to content

fix(deps): OSV 公告波收口 —— js-yaml 3.15.1/4.3.1 + mermaid 11.16.1 定向锁文件 bump (#6088) - #6091

Merged
qq9340100 merged 1 commit into
mainfrom
claude/issue-6088-osv-jsyaml-mermaid
Aug 7, 2026
Merged

fix(deps): OSV 公告波收口 —— js-yaml 3.15.1/4.3.1 + mermaid 11.16.1 定向锁文件 bump (#6088)#6091
qq9340100 merged 1 commit into
mainfrom
claude/issue-6088-osv-jsyaml-mermaid

Conversation

@qq9340100

Copy link
Copy Markdown
Collaborator

Fixes #6088

背景

新一波上游 OSV 公告(js-yaml + mermaid)把 Validate Package Dependencies 判红。该 workflow 是路径触发的,只对 diff 碰到 **/package.json / pnpm-lock.yaml / pnpm-workspace.yaml 等依赖文件的 PR 生效 —— 所以症状表现为「偶发地只咬部分 PR」。这不是任何 PR 引入的,是共享门禁被上游公告波打红,需要一次锁文件收口。

前提复核(立单前提仍然成立)

派发时与动手前分别复核了 origin/main:

  • pnpm-lock.yaml 仍解析出 js-yaml@3.15.0js-yaml@4.3.0mermaid@11.16.0(6 处条目,packages:snapshots: 各 3 处);
  • 锁文件最后一笔提交仍是 9c90ea0b7(sms 功能,非 OSV 修复),期间 main 已推进到 1eb13a0d2,但锁文件零变化,无在飞依赖 bump 撞车。

改动

纯锁文件定向重解析,12 增 12 删,不动任何 package.json:

OSV CVSS 现版本 修复版本
GHSA-5p4m-2wfm-xmqj 7.5 High js-yaml 3.15.0 3.15.1
GHSA-5p4m-2wfm-xmqj 7.5 High js-yaml 4.3.0 4.3.1
GHSA-2v8p-3f2j-5mp7 5.3 mermaid 11.16.0 11.16.1
GHSA-3rrr-jr9j-h3q3 6.5 mermaid 11.16.0 11.16.1
GHSA-6x64-9x62-f2gx 5.3 mermaid 11.16.0 11.16.1
GHSA-c4c3-pg64-4m4v 2.4 mermaid 11.16.0 11.16.1
GHSA-rhh3-jpg6-66xh 5.3 mermaid 11.16.0 11.16.1

为什么没有 overrides、没有 package.json 改动

三个修复版本都是 patch 级,且都落在各自父包已声明的 range 之内,所以普通解析位移就能到达,不需要 pnpm.overrides 永久钉版(overrides 是「将来必须有人记得摘掉」的债,能不加就不加):

  • read-yaml-file@1.1.0 声明 js-yaml: ^3.6.1 → 3.15.1 在范围内
  • @changesets/parse@0.4.3 声明 js-yaml: ^4.1.1 → 4.3.1 在范围内
  • apps/docs 声明 mermaid: ^11.16.0 → 11.16.1 在范围内

三对版本的 dependencies 集合逐字节一致(已用 registry 元数据比对),所以 diff 只有版本号与 integrity 两类行。

归因(pnpm why)

js-yaml@3.15.1
└─ read-yaml-file@1.1.0 ─ @manypkg/get-packages@1.1.3 ─ @changesets/* ─ @changesets/cli@2.31.1
   └─ @objectstack/spec-monorepo (devDependencies)

js-yaml@4.3.1
└─ @changesets/parse@0.4.3 ─ @changesets/read@0.6.7 ─ @changesets/cli@2.31.1
   └─ @objectstack/spec-monorepo (devDependencies)

mermaid@11.16.1
└─ @objectstack/docs@4.2.1 (dependencies) —— 该包 private: true,不发布

两条 js-yaml 都只经由根 devDependency @changesets/cli 进入(纯发布工具链,不随任何产物出货);mermaid 的唯一消费者是 apps/docs,而 apps/docsprivate: true 的站点应用。没有任何已发布包的依赖图发生变化。

刻意不动的部分

  • js-yaml@5.2.2(packages/metadata 的直接依赖)未被公告命中,原样保留。中途试过 pnpm update --recursive js-yaml@3.15.1,它会把 packages/metadata/package.json^5.2.2 改写成 ^3.15.1(降级已发布 manifest),并顺带扫动 postcss / seroval / ws / nanoid 等无关依赖 —— 已全部回滚,改用定向编辑。
  • 未新增 osv-scanner.toml 豁免(7 条全部有修复版本,豁免只留给无修复的公告)。
  • 未触碰 .github/workflows/validate-deps.yml(devx 车道)。

验证

1. osv-scanner 实跑(与 CI 同版本 v2.3.8),红 → 绿

api.osv.dev 在本会话出口策略下被 403 拦截,故改用 scanner 自带的离线库模式(--offline-vulnerabilities --download-offline-databases),扫的是同一份 OSV 数据。

改动前(origin/main 的锁文件)—— 精确复现立单表格的 7 条:

Total 3 packages affected by 7 known vulnerabilities (0 Critical, 2 High, 4 Medium, 1 Low, 0 Unknown)
7 vulnerabilities can be fixed.
| https://osv.dev/GHSA-5p4m-2wfm-xmqj | 7.5 | npm | js-yaml | 3.15.0  | 3.15.1  |
| https://osv.dev/GHSA-5p4m-2wfm-xmqj | 7.5 | npm | js-yaml | 4.3.0   | 4.3.1   |
| https://osv.dev/GHSA-2v8p-3f2j-5mp7 | 5.3 | npm | mermaid | 11.16.0 | 11.16.1 |
| https://osv.dev/GHSA-3rrr-jr9j-h3q3 | 6.5 | npm | mermaid | 11.16.0 | 11.16.1 |
| https://osv.dev/GHSA-6x64-9x62-f2gx | 5.3 | npm | mermaid | 11.16.0 | 11.16.1 |
| https://osv.dev/GHSA-c4c3-pg64-4m4v | 2.4 | npm | mermaid | 11.16.0 | 11.16.1 |
| https://osv.dev/GHSA-rhh3-jpg6-66xh | 5.3 | npm | mermaid | 11.16.0 | 11.16.1 |
exit 1

改动后(本 PR 的锁文件):

Scanned pnpm-lock.yaml file and found 1387 packages
No issues found
exit 0

两次扫描的包总数都是 1387,这正是「零附带位移」的量化证据。

2. Validate Package Dependencies 其余步骤本地全绿

pnpm install --frozen-lockfile --prefer-offline
  → Lockfile is up to date, resolution step is skipped ... Done in 8s   (exit 0)
node scripts/check-changeset-fixed.mjs
  → ✓ "fixed" group is in sync with 69 public workspace packages        (exit 0)
node scripts/check-override-consistency.mjs
  → ✓ 2 published-manifest declaration(s) ... resolve to their override targets (exit 0)
node scripts/check-osv-exemptions.mjs --self-test && node scripts/check-osv-exemptions.mjs
  → ✓ self-test passed / ✓ zero OSV exemptions (the intended steady state) (exit 0)

其中 Lockfile is up to date, resolution step is skipped 是关键一行:pnpm 认定手工定向编辑后的锁文件与所有 manifest 完全自洽。

3. 消费者侧验证

pnpm --filter @objectstack/docs types:check       → ✓ Types generated successfully   (exit 0)
pnpm --filter @objectstack/metadata test          → Test Files 25 passed (25) / Tests 508 passed (508)
pnpm exec changeset status --since=origin/main    → info NO packages to be bumped     (exit 0)

运行时冒烟(三条改动版本逐个实际加载):

js-yaml 3.15.1 -> load OK: {"a":1,"b":["x","y"]}
js-yaml 4.3.1  -> load OK: {"a":1,"b":["x","y"]}
@changesets/parse 经 js-yaml@4.3.1 解析 frontmatter -> {"releases":[{"name":"@objectstack/spec","type":"patch"}],"summary":"hello world"}
read-yaml-file 经 js-yaml@3.15.1 读取 .changeset/config.json -> OK
mermaid version: 11.16.1 —— initialize / render / run / parse / registerIconPacks 全部为 function

符号链接实测:read-yaml-file 现指向 js-yaml@3.15.1,@changesets/parse 现指向 js-yaml@4.3.1,旧版本目录零活引用。

Changeset

本 PR 不带 changeset。 判断依据:改动面只有 pnpm-lock.yaml,零 package.json 变更;两条 js-yaml 只经根 devDependency 进入工具链,mermaid 的唯一消费者 apps/docsprivate: true。因此没有任何已发布包的版本或依赖声明发生变化,changeset status 也确认 NO packages to be bumped。按仓库惯例,这类纯锁文件安全 bump 走 skip-changeset 路线 —— 标签留给 PM 在验收时按车道统一施加(本次派发明确要求 dev 不自行施加标签)。


Generated by Claude Code

…V advisory wave (#6088)

Targeted lockfile-only re-resolution clearing all 7 advisories that turned
`Validate Package Dependencies` red on every PR whose diff touches a
dependency file:

  GHSA-5p4m-2wfm-xmqj (7.5 High)  js-yaml   3.15.0 -> 3.15.1
  GHSA-5p4m-2wfm-xmqj (7.5 High)  js-yaml   4.3.0  -> 4.3.1
  GHSA-2v8p-3f2j-5mp7 (5.3)       mermaid   11.16.0 -> 11.16.1
  GHSA-3rrr-jr9j-h3q3 (6.5)       mermaid   11.16.0 -> 11.16.1
  GHSA-6x64-9x62-f2gx (5.3)       mermaid   11.16.0 -> 11.16.1
  GHSA-c4c3-pg64-4m4v (2.4)       mermaid   11.16.0 -> 11.16.1
  GHSA-rhh3-jpg6-66xh (5.3)       mermaid   11.16.0 -> 11.16.1

All three fixed versions are patch releases inside the ranges their parents
already declare (read-yaml-file js-yaml@^3.6.1, @changesets/parse
js-yaml@^4.1.1, apps/docs mermaid@^11.16.0) and carry byte-identical
dependency sets, so no manifest, override or changeset is needed.

js-yaml@5.2.2 (packages/metadata, not flagged) is deliberately untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wbxm29qPKnLf44AbSxizqW
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 7, 2026 12:48am

Request Review

@github-actions github-actions Bot added size/xs dependencies Pull requests that update a dependency file labels Aug 7, 2026
@qq9340100 qq9340100 added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 7, 2026 — with Claude
@qq9340100
qq9340100 marked this pull request as ready for review August 7, 2026 01:06
@qq9340100
qq9340100 added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit d1151ac Aug 7, 2026
29 of 30 checks passed
@qq9340100
qq9340100 deleted the claude/issue-6088-osv-jsyaml-mermaid branch August 7, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OSV 新公告波:js-yaml(GHSA-5p4m-2wfm-xmqj,High 7.5)+ mermaid 11.16.0 五条 —— Validate Dependencies 对触发它的 PR 全数转红

2 participants