From 07b4a448fd9de765edaf791a78d67d5763c0b6f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Aug 2026 18:14:49 +0000 Subject: [PATCH] =?UTF-8?q?ci(lint):=20=E6=8A=8A=20`check:merge-driver`=20?= =?UTF-8?q?=E7=9A=84=E4=B8=A4=E4=B8=AA=20self-test=20=E6=8E=A5=E8=BF=9B=20?= =?UTF-8?q?lint.yml=20=E6=A0=B9=20check=20=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `check:merge-driver`(`git-merge-regen.mjs --self-test` + `check-regen-pending.mjs --self-test`)此前没有出现在任何 workflow 里: `.githooks/pre-commit` 跑的是 check-regen-pending 的**主路径**(无 pending marker 时立即退出),不是 `--self-test`,所以这两个 self-test 在 CI 上从未 执行 —— 只有有人手工跑根脚本时才现形(#4690 同类形态)。 它们守的是 #4675「生成物不走文本合并」的地基:`.gitattributes` 与 `scripts/regen-artifacts.mjs` 的双向对账、表里 `gen:`/`check:` 名字在 `@objectstack/spec` 可解析、pre-commit 在 index 里可执行(100755)、本 clone 的 `merge.os-regen.driver` 可解析(#4868),外加一次对真 git 的端到端合并证明; 第二个 self-test 钉住陈旧判定的危险方向(「该说 stale 时说了 fresh」)。 对账一旦失衡,合并驱动会对某个路径静默失效。 按分诊裁定加在 lint.yml 既有的那排根 `check:*` 步骤之后(同形先例: `check:nul-bytes` / `check:doc-authoring` / `check:node-version`),⛔ 不新建 job。纯 git + fs,不需要 build,秒级。 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014wsZeReNTqiceBfLb5Pyf5 --- .github/workflows/lint.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e9cc49b8f1..01bf0d85d3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -399,6 +399,33 @@ jobs: - name: Resume-authority declaration gate run: pnpm check:resume-authority-declared + # Merge-driver wiring gate (#6008, from #4675 / #4868). `merge=os-regen` + # is what stops generator-owned artifacts (spec-changes.json, the ADR-0087 + # registries, the api-surface baselines) from text-merging into a + # plausible-looking wrong file: the driver defers the path and records it, + # and `.githooks/pre-commit` refuses the commit until the regeneration has + # actually happened. Both halves are CONFIG — `.gitattributes` routing on + # one side, the table in scripts/regen-artifacts.mjs on the other — and + # they drift apart in either direction with nothing failing: a path + # declared in the table but unmapped still text-merges, and a path mapped + # but undeclared leaves the merge CONFLICTED with no explanation. The + # self-test reconciles them both ways, checks the gen:/check: names the + # driver advises still resolve, that the hook is executable IN THE INDEX + # (git ignores a non-executable hook and says only `advice.ignoredHook`), + # that the driver registered in THIS clone resolves here (#4868: it + # pointed at a deleted worktree for weeks while every other check stayed + # green), and proves the behaviour end to end against real git. The + # second half pins the staleness rules' dangerous direction — "says fresh + # when stale". + # It ran nowhere until now: `pre-commit` runs check-regen-pending's MAIN + # path (which exits immediately with no pending marker), never + # `--self-test`, and no workflow named the command — so the reconciliation + # was verified only when someone happened to run the root script by hand + # (#4690's family: a gate archived as "runs elsewhere" that ran nowhere). + # Pure git + fs, no build, seconds — so it belongs in this job. + - name: Merge-driver wiring gate + run: pnpm check:merge-driver + typecheck: name: TypeScript Type Check runs-on: ubuntu-latest