From 41833ad1c7fc160c3011d8e7ed6b4deb91fbecfd Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 03:05:25 +0000 Subject: [PATCH] docs(AGENTS.md): re-take the trap-one app-shell test-file count with its instrument The wrong-cwd false-green passage cited app-shell as having 281 test files. That figure is 2.4x stale: on 4857776 the package has 664. The number is not decoration there -- it is the evidence the passage uses to teach why `Test Files 22 passed (22)` is the console's suite and not app-shell's, so a stale count weakens the lesson exactly where the reader is asked to trust one. Both live instruments are written out with the command that produced each, rather than collapsing them into a bare number: a `find` over `*.test.ts` / `*.test.tsx` under `packages/app-shell/src`, and the runner's own collection count from `vitest list --filesOnly packages/app-shell/`. Both read 664 on this tree; the added note says why they are not guaranteed to agree (the `find` sees only `src/`, while the three projects' `include` walks `packages/**` and each carries an `exclude`) and that today's equality holds only because app-shell's test files all happen to live under `src/`. The mechanism argument of the passage is untouched, and the historical `Test Files 22 passed (22)` reading is left alone: it is a quoted observation from the objectui#3378 incident, not a present-tense claim about this tree. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01HxLw5aKDPR5RJgyUR7Exkd --- AGENTS.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 797b680757..172386b61e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -184,8 +184,13 @@ AGENTS.md 的「只跑受影响的包」指的是**用上面的路径过滤缩 目录,根级 projects(`unit`/`dom`/`dom-heavy`)的 include(`packages/**`、`examples/**`、 `scripts/**`)相对它匹配不到任何文件;只有以**绝对路径**引入的 `apps/console` project 仍解析 成功。于是跑的是 `@object-ui/console` 的 22 个文件、报 `Test Files 22 passed (22)`,而本包 - (app-shell 有 281 个)一个都没跑。**没有 "0 tests matched" 信号** —— 计数是 22 不是 0, + (app-shell 有 664 个)一个都没跑。**没有 "0 tests matched" 信号** —— 计数是 22 不是 0, `passWithNoTests` 根本不参与,按包级约定验证的 agent 会据此报「整包绿」。 + - ⚠️ 那个 664 连**仪器**一起读、别照抄(objectui#8390:上一版写的 281 陈旧了 2.4 倍)。在 + `4857776` 上,`find packages/app-shell/src -name '*.test.ts' -o -name '*.test.tsx'` 与 runner + 自己的收集数 `pnpm exec vitest list --filesOnly packages/app-shell/` 同为 **664**,但**两者 + 不保证相等** —— find 只看 `src/`,而三个 project 的 include 走 `packages/**` 且各带 `exclude`; + 今天相等,只因 app-shell 的测试文件恰好全在 `src/` 下。 - **陷阱二:把路径挂在 `--` 后面(objectui#3288)。** `pnpm --filter test -- --run `: pnpm 把 `--` **原样**转发进脚本,vitest 的 CLI 解析在 `--` 处停止,后面的一切(包括你的路径) 在 vitest 看到之前就没了 —— 不是「被忽略并警告」,是压根不存在。于是退回默认集合(叠加陷阱一