docs(#2775): align package-legitimacy docs to the ADR-0656 registry-API gate (#3010)

* docs(#2775): align package-legitimacy docs to the ADR-0656 registry-API gate

security-model.md, USER-GUIDE.md, ARCHITECTURE.md, COMMANDS.md,
FEATURES.md, and gsd-planner.md's STRIDE template (+ ja-JP mirrors)
described the pre-ADR-0656 design: slopcheck as the install-or-degrade
gate, with unavailability degrading every package to [ASSUMED].
ADR-0656 inverted this months ago — registry-API verdicts (npm/PyPI/
crates.io) are the gate; slopcheck is an optional escalate-only adapter
that no shipped configuration wires. Verified every replacement claim
against src/package-legitimacy.cts (checkPackages, classifyPackage,
lookupNpm/lookupPypi/lookupCrates) via Memtrace before writing it, so
the corrected prose matches the live implementation rather than
restating the ADR from memory.

Restored docs/explanation/security-model.md:79-84 (and its ja-JP
mirror) to original wording after an orthogonal spec review caught
that an earlier draft had edited the "Why WebSearch packages are
always [ASSUMED]" paragraph — inside the range issue #2775 explicitly
named as correct and to leave alone.

The ja-JP mirror was missing the closing clause present in the
corrected English original ("its absence leaves registry-API verdicts
intact rather than downgrading everything to [ASSUMED]") — added for
parity. This completes the ja-JP mirror the issue's acceptance
criteria named explicitly.

zh-CN/ko-KR/pt-BR (not named by #2775, but carrying the same stale
design) get the mechanical portion of the same fix: command-string
swaps, table headers, ARCHITECTURE.md diagram labels, and technical-
term swaps that reuse a word already attested elsewhere in the same
file (合法性/적법성/legitimidade for "legitimacy") — surrounding prose
untouched. The remainder in those three locales — full-paragraph
rewrites of the corrected degrade-path mechanism, deleted "External
dependency" bullets, and "manually install slopcheck" code blocks —
needs prose composed by a fluent speaker of each language and is filed
as open-gsd/gsd-core#3002 with an exact file:line inventory.

* test(#2775): acknowledge gsd-planner.md byte growth from the STRIDE-row fix

agents/gsd-planner.md grew 14 bytes (49309 -> 49323) from the STRIDE
supply-chain row correction (slopcheck -> package-legitimacy gate).
Emitted agent/workflow files are byte-tracked; this fragment
acknowledges the growth per tests/emitted-attribution.test.cjs's
"differential attribution over the real tree" check.

* docs(#2775): close ja-JP FEATURES.md gap; fix a ko-KR transliterated heading

docs/ja-JP/FEATURES.md:2808 still read the katakana transliteration
"スロップチェック verdict" in REQ-PKG-GATE-01 — invisible to a literal
"slopcheck" grep, so it was missed when ja-JP parity was checked and
declared complete. Corrected to "正当性判定" (legitimacy verdict),
matching the term already established in ja-JP/explanation/
security-model.md and ja-JP/USER-GUIDE.md. This was the only
remaining ja-JP gap; a full sweep for the transliterated form across
docs/ja-JP/ now returns zero hits, and the ja-JP mirror is genuinely
at parity.

docs/ko-KR/USER-GUIDE.md:398's heading "슬롭체크 판정:" had the same
transliteration problem. Fixed inline to "적법성 판정:", reusing the
적법성/legitimacy word already attested two lines below in the same
table. A parallel sweep of zh-CN and pt-BR found no transliterated
forms of "slopcheck" in either locale. The remaining transliterated
occurrence in ko-KR (USER-GUIDE.md:406, the lead-in to the
pip-install code block) needs prose composition like the rest of that
block and is added to open-gsd/gsd-core#3002's inventory.

* chore(#2775): backfill changeset PR number to 3010

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-08-02 20:24:42 -04:00
committed by GitHub
parent 97f2af29da
commit de78f2eef2
26 changed files with 96 additions and 88 deletions

View File

@@ -413,7 +413,7 @@ ui-phase → UI-SPEC.md (design contract, optional)
plan-phase
├── Research gate (blocks if RESEARCH.md has unresolved open questions)
├── Phase Researcher → RESEARCH.md
│ └── Package Legitimacy Gate: slopcheck on every package; [SLOP] removed,
│ └── Package Legitimacy Gate: registry-API verdict on every package; [SLOP] removed,
│ [SUS]/[ASSUMED] flagged; Audit table written to RESEARCH.md
├── Planner (with reachability check) → PLAN.md files
│ └── checkpoint:human-verify injected before [ASSUMED]/[SUS] installs;
@@ -655,7 +655,7 @@ Runtime Engine (Claude Code / Gemini CLI)
| 层次 | 组件 | 操作 |
|-------|-----------|--------|
| 研究 | `gsd-phase-researcher` | 运行 `slopcheck install <pkgs> --json`;向 RESEARCH.md 写入 `## Package Legitimacy Audit` 表格;在写入 RESEARCH.md 之前剥离 `[SLOP]` 软件包 |
| 研究 | `gsd-phase-researcher` | 运行 `gsd-tools query package-legitimacy check --ecosystem <npm\|pypi\|crates> <pkgs>`;向 RESEARCH.md 写入 `## Package Legitimacy Audit` 表格;在写入 RESEARCH.md 之前剥离 `[SLOP]` 软件包 |
| 规划 | `gsd-planner` | 读取审计表;在任何 `[ASSUMED]` 或 `[SUS]` 安装任务之前插入 `checkpoint:human-verify`;向 `<threat_model>` 添加 `T-{phase}-SC` STRIDE 供应链行 |
| 执行 | `gsd-executor` | 规则 3 将软件包安装排除在自动修复范围之外;失败的安装以检查点形式呈现,而非静默替换 |

View File

@@ -185,7 +185,7 @@ v1.40 中,六个命名空间路由器作为第一阶段入口点随附发布
- 加 `--view`:将现有 RESEARCH.md 打印到标准输出,不生成新报告。RESEARCH.md 不存在时报错。
**包合法性检查门(v1.42.1):**
当研究者推荐外部包时,会对每个包运行 `slopcheck install <pkg> --json` 并在 RESEARCH.md 中写入 `## Package Legitimacy Audit` 表格,记录注册表、年龄、下载量、源码仓库和 slopcheck 裁决。裁决结果:
当研究者推荐外部包时,会对每个包运行 `gsd-tools query package-legitimacy check --ecosystem <npm|pypi|crates> <pkg>` 并在 RESEARCH.md 中写入 `## Package Legitimacy Audit` 表格,记录注册表、年龄、下载量、源码仓库和合法性裁决。裁决结果:
- `[SLOP]` — 包从 RESEARCH.md 中完全移除,永远不会进入规划器
- `[SUS]` — 包被标记;规划器在安装任务前插入 `checkpoint:human-verify`

View File

@@ -2821,7 +2821,7 @@ Source commit: abc1234 (3 commits behind HEAD)
- 执行器安装失败会暂停进行人工验证,而不是自动尝试类似命名的包。
**需求:**
- REQ-PKG-GATE-01:研究必须记录包注册表、年龄、下载/来源信号、slopcheck 判决和处置。
- REQ-PKG-GATE-01:研究必须记录包注册表、年龄、下载/来源信号、合法性判决和处置。
- REQ-PKG-GATE-02:规划器必须在执行前门控未验证或可疑的包安装。
- REQ-PKG-GATE-03:执行器在包管理器安装失败后不得自动替换包名。

View File

@@ -381,8 +381,8 @@ AI 编码工具会幻觉出包名。攻击者会在 npm、PyPI 和 crates.io 上
```markdown
## Package Legitimacy Audit
| Package | Registry | Age | Downloads | Source Repo | slopcheck | Disposition |
|---------|----------|-----|-----------|-------------|-----------|-------------|
| Package | Registry | Age | Downloads | Source Repo | Verdict | Disposition |
|---------|----------|-----|-----------|-------------|---------|-------------|
| express | npm | 13 yrs | 100M+/wk | github.com/expressjs/express | [OK] | Approved |
| some-new-util | npm | 3 days | 47 | none | [SLOP] | REMOVED |
| api-bridge | npm | 6 mo | 1.2k/wk | github.com/user/api-bridge | [SUS] | Flagged |
@@ -394,7 +394,7 @@ AI 编码工具会幻觉出包名。攻击者会在 npm、PyPI 和 crates.io 上
**执行期间** — 如果安装失败,执行器会显示检查点并停止,而不是静默尝试替代方案。
**Slopcheck 判定:**
**合法性判定:**
| 判定 | 含义 | GSD 操作 |
|---------|---------|------------|

View File

@@ -24,7 +24,7 @@ Slopsquatting 的隐蔽之处在于,通过 `npm view` 验证的幻觉名称*
门控机制跨三个流水线阶段运行:
**研究阶段。** 当 `gsd-phase-researcher` 推荐外部软件包时,它会对每个软件包运行 `slopcheck install <pkgs> --json`。结果会以 `## Package Legitimacy Audit` 表格的形式写入 `RESEARCH.md`。标记为 `[SLOP]`(高置信度幻觉或攻击者注册)的软件包在保存前会**从 `RESEARCH.md` 中完全删除**,永远不会到达规划员。
**研究阶段。** 当 `gsd-phase-researcher` 推荐外部软件包时,它会对每个软件包运行 `gsd-tools query package-legitimacy check --ecosystem <npm|pypi|crates> <pkgs>`。结果会以 `## Package Legitimacy Audit` 表格的形式写入 `RESEARCH.md`。标记为 `[SLOP]`(高置信度幻觉或攻击者注册)的软件包在保存前会**从 `RESEARCH.md` 中完全删除**,永远不会到达规划员。
**规划阶段。** `gsd-planner` 读取审计表。对于任何标记为 `[SUS]`(可疑:新注册、下载量低、无源代码仓库,或命名模式接近某热门软件包)或 `[ASSUMED]`(来自 WebSearch 而非直接注册表验证)的软件包,规划员会在安装步骤之前**插入一个 `checkpoint:human-verify` 任务**。该检查点包含指向注册表页面的直接链接,以及需要重点核查的内容:维护者历史、问题跟踪器活动、是否存在可疑的安装脚本。