From 685883fb4de5c176069280b1ea1cb731cf41fab3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 23 Aug 2026 17:21:00 +0000 Subject: [PATCH] docs(agents): show the targeted-vitest spelling and refuse the bare separator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `os-dev.md` rule 3 named `pnpm --filter `, `--maxWorkers=2` and `--concurrency=2` without ever showing how they join, so every reader had to invent the join and npm semantics supplied `--`. Measured: the separator makes vitest discard the file pattern AND `--maxWorkers`, the whole package suite runs, and it exits 0 — a false green that reads as the narrow run that was asked for. Rule 3 now carries the literal working command and refuses the separator. `AGENTS.md`'s dev-server parenthetical ("flags after `--` are forwarded") is re-scoped, since what pnpm forwards is the separator itself. Both files sit at zero-headroom line ratchets, so this is a net-zero rewrite: the measurements stay on the card, per the ratchet's own rule that stories live on cards and not in operational text. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx --- .claude/agents/os-dev.md | 4 ++-- AGENTS.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 016caf1896..9ebc826f0e 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -75,8 +75,8 @@ JSON,所以终报消息就是 JSON 本身,别无其它。 收尾打印本次持锁时长,过长自己喊出来。只包**命令本身**,不包你的阅读与判断;结论读它 印的 VERDICT 行,不读裸 `$?`。排队是常态,不是挂死。 2. **压住堆**:重命令前缀 `NODE_OPTIONS=--max-old-space-size=4096`(要抬需给理由)。 -3. **定向,不扫全**:只 build/test 受影响的包(`pnpm --filter …`),vitest - `--maxWorkers=2`,turbo `--concurrency=2`。 +3. **定向,不扫全**:只 build/test 受影响的包 —— `pnpm --filter exec vitest run --maxWorkers=2 `,turbo `--concurrency=2`。 + ⛔ 参数永不经裸 `--` 转交:`--` 之后的一切被 vitest 静默丢弃,文件模式与 `--maxWorkers` 一并失效,整包跑完、退出码 0、读起来像一次通过。 4. **清理是任务的一步**:PR 开出后, `rm -rf /node_modules && git worktree remove ` —— **不加 force**。⛔ 永不 上来就 `--force`:node_modules 已删的情况下,拒绝移除说明里面有东西没提交 —— 你自己 diff --git a/AGENTS.md b/AGENTS.md index 775fcc4422..7785a2f80b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -127,7 +127,7 @@ pays its first load at module top; `pnpm check:test-source-alias` gates it. `--fresh`: ephemeral tempdir (auto-deleted on exit) + `--seed-admin` (POSTs sign-up, prints creds — default `admin@objectos.ai` / `admin123`, override via `--admin-email`/`--admin-password`). The seeded admin is auto-promoted to **platform admin** (the system seed identity `usr_system` is skipped), so Setup/Studio are reachable on first login. -Rules: never run two backends on port 3000; for backend tasks pick a random port and tear it down; **never kill a server you didn't start** (other agents/the user may be using it — see Multi-agent discipline §8); always use a `pnpm dev`/`dev:crm`/`dev:showcase` script (flags after `--` are forwarded), not raw `pnpm --filter`. +Rules: never run two backends on port 3000; for backend tasks pick a random port and tear it down; **never kill a server you didn't start** (other agents/the user may be using it — see Multi-agent discipline §8); always use a `pnpm dev`/`dev:crm`/`dev:showcase` script, not raw `pnpm --filter` — but note what pnpm actually does with `--`: it forwards the **separator itself** into the child's argv, so this spelling only works where the receiving CLI tolerates a leading `--`. ⛔ Do not carry it over to test commands — vitest silently discards everything after a bare `--` (measured; see `.claude/agents/os-dev.md` → Toolchain traps). ```bash pnpm dev:crm -- --fresh -p 38421 # start; debug via curl