From 81fdbc826a2a08fa5e2d0735442b0c245b59c5df Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 22:02:23 +0000 Subject: [PATCH 1/2] =?UTF-8?q?test(scripts):=20=E6=A3=98=E8=BD=AE?= =?UTF-8?q?=E9=99=88=E6=97=A7=E6=B6=88=E6=81=AF=E6=8C=89=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E6=88=90=E5=9B=A0=E5=88=86=E5=8F=A5,=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E4=B8=89=E6=9D=A1=E9=80=80=E4=BC=91=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=20(#3674)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `the objectui#3647 baseline only shrinks` 的失败消息首行写死 「the path now resolves, so the defect is fixed」,而一条 KNOWN_MISSING 条目离开 `missing` 有三条路径 —— 恰好就是同文件存在性断言已经列举的三个 修复方向:建出文件、删掉 `files` 声明、git-ignore 加 build 脚本使其成为 构建产物。只有第一条会让路径 resolve,另外两条下该归因与现场矛盾 (#3665 实测撞上第二条)。 改动限于该断言的消息:新增 causeOf(),从断言谓词读的同一份 declared/missing 数据里逐条推出成因。stale 谓词与 toEqual([]) 一字未动。 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt --- scripts/__tests__/package-files-exist.test.ts | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/__tests__/package-files-exist.test.ts b/scripts/__tests__/package-files-exist.test.ts index e593bad681..3886924bc6 100644 --- a/scripts/__tests__/package-files-exist.test.ts +++ b/scripts/__tests__/package-files-exist.test.ts @@ -305,13 +305,33 @@ describe('package.json `files` entries exist on disk (objectui#3663)', () => { const stillMissing = new Set(missing.map((d) => d.relPath)); const stale = Object.keys(KNOWN_MISSING).filter((relPath) => !stillMissing.has(relPath)); + // WHY an entry stopped being a live defect, reported per entry instead of + // assumed. An entry leaves `missing` by exactly the three routes the + // assertion above sanctions as fixes, and only the first makes the path + // resolve — so a message hardcoded to "the path now resolves" is wrong two + // times in three, and sends the reader off to `ls` a path that is still + // absent (objectui#3674, seen for real in objectui#3665). Derived from the + // same `declared`/`missing` data the predicate reads, so it cannot drift + // from the verdict it explains. + const causeOf = (relPath: string): string => { + const entry = declared.find((d) => d.relPath === relPath); + if (!entry) return 'the `files` entry that declared it is gone (deleted, or its package left the workspace)'; + if (entry.onDisk) return 'the path now exists on disk'; + return 'still declared and still absent, but now excused as build output (git-ignored, untracked, package has a `build` script)'; + }; + expect( stale, [ - 'A KNOWN_MISSING entry is stale — the path now resolves, so the defect is fixed.', - 'Delete its line from KNOWN_MISSING in this file to bank the progress.', + 'A KNOWN_MISSING entry no longer describes a live defect.', + 'Delete its line from KNOWN_MISSING in this file to bank the progress — that is the', + 'right move under every cause below.', + '', + 'The cause is reported per entry rather than assumed, because only one of the three', + 'routes out of the baseline makes the path resolve; do not read a stale line as', + 'proof that the file is now there.', '', - ...stale.map((relPath) => `${relPath} (${KNOWN_MISSING[relPath].issue})`), + ...stale.map((relPath) => `${relPath} (${KNOWN_MISSING[relPath].issue}) — ${causeOf(relPath)}`), ].join('\n'), ).toEqual([]); }); From a0c0be9415831255bcaded25522329747e7a293b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 22:07:22 +0000 Subject: [PATCH 2/2] =?UTF-8?q?test(scripts):=20=E7=AC=AC=202=20=E6=9D=A1?= =?UTF-8?q?=E6=88=90=E5=9B=A0=E6=94=B9=E4=B8=BA=E5=8F=AA=E9=99=88=E8=BF=B0?= =?UTF-8?q?=E5=8F=AF=E8=A7=82=E5=AF=9F=E4=BA=8B=E5=AE=9E,=E4=B8=8D?= =?UTF-8?q?=E5=AE=A3=E7=A7=B0=E6=97=A0=E6=B3=95=E8=A7=82=E5=AF=9F=E7=9A=84?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=20(#3674)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 「声明没了」的措辞原为「the `files` entry that declared it is gone」, 但谓词分辨不出「声明被删」与「这条基线键从来就没匹配过任何声明」 (手写的 KNOWN_MISSING 键拼错时即为后者)。改为先陈述可观察事实 (no `files` entry declares it),再并列三种可能历史而不断言是哪一种 —— 与本 PR 反对的那种「宣称观察不到的因果」保持一致。 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt --- scripts/__tests__/package-files-exist.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/__tests__/package-files-exist.test.ts b/scripts/__tests__/package-files-exist.test.ts index 3886924bc6..3278e2468e 100644 --- a/scripts/__tests__/package-files-exist.test.ts +++ b/scripts/__tests__/package-files-exist.test.ts @@ -315,7 +315,8 @@ describe('package.json `files` entries exist on disk (objectui#3663)', () => { // from the verdict it explains. const causeOf = (relPath: string): string => { const entry = declared.find((d) => d.relPath === relPath); - if (!entry) return 'the `files` entry that declared it is gone (deleted, or its package left the workspace)'; + if (!entry) + return 'no `files` entry declares it: the declaration was deleted, its package left the workspace, or this baseline key never matched one'; if (entry.onDisk) return 'the path now exists on disk'; return 'still declared and still absent, but now excused as build output (git-ignored, untracked, package has a `build` script)'; };