Repository navigation
Commit 1080f07
test(cli): set the command-population vacuity floors at about two thirds of the measured counts (#26555)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XUx5K9iqwUoraf1W95bhw8P)_
Fixes #26523
Part of #26444 (the CLI half; the ui half and the two-sided baselines
are other lanes' children, and the spec liveness floor is the spec
seat's).
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:CLI 两个命令总体钉测试里的六个「防空跑」底线,从接近实测值降到实测值的约三分之二(`this.error` 只有 3
个模块,保留为非空底线),每个底线旁注明实测值与测量日期。
- **为什么改**:底线贴着实测值,删一个命令就会红;按 #26444 的规则(先例 `vite-dts-wiring-ratchet`:实测
22,底线 15)改为防空值。
- **风险与回滚**:只动两个测试文件,不动产品代码;回滚即还原本 PR。六个底线各自清空总体时仍然转红(见 Tests)。
- **先看**:`packages/cli/test/refusal-renders-once.test.ts`
的三个常量(`ERROR_FILE_FLOOR` 是原先唯一等于实测的那个),再看
`packages/cli/test/exit-signal.pin.test.ts` 的三个常量。
- **两分钟验证**:`pnpm --filter @objectstack/cli exec vitest run
--maxWorkers=2 test/exit-signal.pin.test.ts
test/refusal-renders-once.test.ts`,预期 2 个文件、127 个用例全绿。
- **需要你做的**:无,席位落地。
## What changes
Each anti-vacuity floor in the two command-population pins moves to
about two thirds of its count, re-measured on `origin/main` `185512cc`
(2026-10-27), rounded down:
| File | Floor | Before | Measured | After | Margin |
|---|---|---|---|---|---|
| `exit-signal.pin.test.ts` | `POPULATION_FLOOR` (command modules) | 65
| 72 | 48 | 24 |
| `exit-signal.pin.test.ts` | `SITE_FLOOR` (signal-raising calls inside
a `try`) | 131 | 164 | 109 | 55 |
| `exit-signal.pin.test.ts` | `JSON_FACE_FLOOR` (JSON-capable commands)
| 46 | 53 | 35 | 18 |
| `refusal-renders-once.test.ts` | `FILE_FLOOR` (command modules) | 60 |
72 | 48 | 24 |
| `refusal-renders-once.test.ts` | `PRINTER_FILE_FLOOR` (modules calling
a refusal printer) | 50 | 64 | 42 | 22 |
| `refusal-renders-once.test.ts` | `ERROR_FILE_FLOOR` (modules raising
`this.error`) | 3 | 3 | 1 (non-empty) | 2 |
- A population of 3 or fewer keeps a non-empty floor rather than a
fraction, so `ERROR_FILE_FLOOR` is 1 under the existing
`toBeGreaterThanOrEqual`, which is `> 0`.
- Each floor is written once, as one constant, with a one-line comment
naming the measured value, the date and the commit. The docblocks above
them now describe them as vacuity floors and drop the per-commit count
history the old floors were derived from.
- The three floor messages that read "than this pin was widened over"
(or "written over") now read "than the vacuity floor", since the floor
is no longer that count.
## Why
A floor equal to today's count turns every legitimate deletion of a
command into a red run and a floor bump (#26444, after #26343 needed
five bumps for one deletion). A vacuity floor only needs to catch a
discovery or scan that silently resolves nothing.
## Tests
- **Each floor still reds on an emptied population.** One
filter-to-empty ablation per floor, through
`scripts/ablation-replace.mjs` on committed `f78d7c29`. Each landed
(anchor 1 to 0), turned exactly one test red with the floor's own
message, and was restored to the HEAD blob with `git diff HEAD` empty.
- **Deleting one CLI command keeps every floor green.**
`src/commands/datasource/introspect.ts` was deleted and both files were
run. It is the worst single deletion for these floors: it is a command
module, a refusal-printer module, and one of the three `this.error`
modules. Result: 2 files, 126 of 126 tests green. The file was then
restored to its HEAD blob.
- **Control on the base.** The same deletion with both files at
`185512cc` reds `ERROR_FILE_FLOOR` (`expected 2 to be greater than or
equal to 3`). This is the defect the card describes.
- Both files at HEAD: 2 files, 127 of 127 tests green.
<details><summary>Ablations, one per floor (f78d7c2)</summary>
```text
POPULATION_FLOOR expect(POPULATION.length, -> expect(POPULATION.filter(() => false).length,
AssertionError: fewer commands discovered than the vacuity floor: expected 0 to be greater than or equal to 48
Tests 1 failed | 115 passed (116) · ok restored: blob == HEAD (e63791d)
JSON_FACE_FLOOR POPULATION.filter((c) => !c.faces...) -> POPULATION.filter((c) => false && !c.faces...)
AssertionError: fewer JSON-capable commands labelled than the first population held: expected 0 to be greater than or equal to 35
Tests 1 failed | 115 passed (116) · ok restored: blob == HEAD (e63791d)
SITE_FLOOR [...FLOW.values()].reduce( -> [...FLOW.values()].filter(() => false).reduce(
AssertionError: fewer signal-raising calls inside a try found than the vacuity floor: expected 0 to be greater than or equal to 109
Tests 1 failed | 115 passed (116) · ok restored: blob == HEAD (e63791d)
FILE_FLOOR expect(FILES.length, -> expect(FILES.filter(() => false).length,
AssertionError: fewer command modules than the vacuity floor: expected 0 to be greater than or equal to 48
Tests 1 failed | 10 passed (11) · ok restored: blob == HEAD (6256e9a)
PRINTER_FILE_FLOOR SCANS.filter((s) => s.scan.printerCalls > 0) -> SCANS.filter((s) => false && s.scan.printerCalls > 0)
AssertionError: refusal printers not found: expected 0 to be greater than or equal to 42
Tests 1 failed | 10 passed (11) · ok restored: blob == HEAD (6256e9a)
ERROR_FILE_FLOOR SCANS.filter((s) => s.scan.errorCalls > 0) -> SCANS.filter((s) => false && s.scan.errorCalls > 0)
AssertionError: `this.error` not found: expected 0 to be greater than or equal to 1
Tests 1 failed | 10 passed (11) · ok restored: blob == HEAD (6256e9a)
```
</details>
<details><summary>One-command deletion dry run, and the base
control</summary>
```text
HEAD f78d7c2, src/commands/datasource/introspect.ts deleted:
vitest exit 0 · Test Files 2 passed (2) · Tests 126 passed (126)
restored blob 3d03b93 == HEAD blob; git diff HEAD empty
base 185512c test files, same deletion:
FAIL test/refusal-renders-once.test.ts > ... > the population is not vacuous — the floors hold
AssertionError: `this.error` not found: expected 2 to be greater than or equal to 3
Test Files 1 failed | 1 passed (2) · Tests 1 failed | 125 passed (126)
```
</details>
## Acceptance notes
- **The premise had partly drifted.** On `185512cc`, five of the six
floors already sat below today's counts (65 of 72, 131 of 164, 46 of 53,
60 of 72, 50 of 64). The card's "equal to the measured values" matches
the counts the old docblocks recorded, not today's. Only
`ERROR_FILE_FLOOR` still equalled its count (3 of 3), and the base
control shows that one deletion red it. All six were moved anyway, by
the parent's rule ("every anti-vacuity floor moves to roughly two thirds
of today's value") and this card's acceptance (every floor below its
re-measured value by a stated margin).
- **Both files floor the same population.** The command-module
population (72) is floored in both files, once in each. A constant
shared between the two files would need a helper module outside the
claimed file surface, so it was not added.
- **No census reads these floors.** A `git grep` for the two file names
outside themselves finds only prose references in
`refusal-renders-once.e2e.test.ts`, and no ledger carries their values.
No open PR touched either file at start or before this PR was opened.
- **Other `packages/cli` floors, not edited.**
`test/option-b-reader-acceptance.pin.test.ts:312` has floor 38 and
measured 38. It equals its count on purpose: its comment says "⛔ never
lower it", so it is a raise-only ratchet.
`test/platform-page-i18n-parity.test.ts:845` has floor 38, measured 40.
`test/print-metadata-stats-zero-row.test.ts:258` has floor 18, measured
19.
## Verification
- `pnpm --filter @objectstack/cli exec vitest run --project unit
--maxWorkers=2` under the verify lock: 336 files passed and 2 failed,
because `packages/cli` itself was not built yet
(`published-subpath-console.pin`, `published-subpath-hook-body.pin` say
"packages/cli is not built"). After `pnpm --filter @objectstack/cli
build`, those two pass (2 files, 29 tests). That makes 338 of 338 files
green, 4890 tests passed and 29 skipped. The `integration` tier is left
to CI: the diff touches only two unit-tier files and no spawn entry.
- `pnpm --filter @objectstack/cli typecheck`: exit 0
(`check:test-typecheck: OK`).
- `eslint --no-inline-config packages/cli`: exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 48 commands on `f78d7c29`. 47 ran
with exit 0. `pnpm check:dual-build-cjs-loads` exited 3 (PREREQUISITE
NOT MET: it needs every package's dist), so it is NOT MEASURED.
`check-plugin-teardown-shape --self-test` first exited 3 on the shallow
clone and exited 0 after fetching its positive-control commit.
Reconciliation: `✓ dispatch-gates --ran: 48 derived famil(ies) accounted
for — 47 run, 1 NOT-MEASURED`.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind. (no names
added)
- [x] 3. No formatter ran; `pnpm lint` passes. (eslint over
`packages/cli` exit 0)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset. (tests only:
`skip-changeset`)
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. (the 维护者速读 block is
Chinese by the dispatch convention)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5m4bTCRGQcuJTsnyfD)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 319d6fa commit 1080f07
2 files changed
Lines changed: 27 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
488 | 480 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
493 | 485 | | |
494 | 486 | | |
495 | 487 | | |
| |||
622 | 614 | | |
623 | 615 | | |
624 | 616 | | |
625 | | - | |
| 617 | + | |
626 | 618 | | |
627 | 619 | | |
628 | 620 | | |
| |||
643 | 635 | | |
644 | 636 | | |
645 | 637 | | |
646 | | - | |
| 638 | + | |
647 | 639 | | |
648 | 640 | | |
649 | 641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
225 | 227 | | |
226 | | - | |
227 | | - | |
228 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
232 | | - | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
| |||
0 commit comments