fix(cli): the #12525 read-back's anti-vacuity pins read CODE, and bind the argument rather than the argument list - #18519
Merged
os-support-ai merged 1 commit intoSep 16, 2026
Conversation
…d the argument rather than the argument list
`serve-port-readback.e2e.test.ts` runs only in the nightly `e2e` tier, so no
pull request can redden it. Two source-text pins in its ANTI-VACUITY describe
read the raw file, and both went red on `main` for reasons that were never
about the product:
- the print-order pin did `indexOf` over the whole of `src/utils/format.ts`.
#17892 added a docblock quoting `Press Ctrl+C to stop` 281 lines above the
`console.error` that prints it, so the raw read put the tail at offset
38075 and the `API:` row at 47343 and the assertion reported a print order
that had never changed. In code position the two are 47343 and 53551, i.e.
line 984 before line 1081, exactly as the pin claims.
- the banner pin held the byte-exact `resolveAuthBaseUrl(boundPort)` call.
#17725 added a `boundProtocol` argument. The per-PR sibling
`src/commands/serve-bound-port-publication.test.ts` was updated in that
same commit; this nightly-only copy could not be, and had no way to say so
until the next sweep.
Both pins now read through `scripts/js-comment-mask.mjs`, the tree's one
answer to code-versus-prose, which also closes the other direction: a comment
naming a pinned spelling can no longer satisfy the pin with no code behind it.
The mask carries its own anti-vacuity control (blanked in place, and blanked
something).
The banner pin now binds the ARGUMENT — the row is derived from `boundPort` —
and tolerates whatever else the call grows, which is the division of labour
the two tiers imply: the per-PR sibling keeps the byte-exact line and reddens
on the PR that moves it. That this is narrower rather than looser is proven in
the test on synthetic text: the matcher rejects `resolveAuthBaseUrl(port)` and
`resolveAuthBaseUrl(requestedPort, boundProtocol)`, and a standing negative
asserts neither requested-port spelling is in `serve.ts`.
⛔ No test renamed, skipped or deleted, and no assertion dropped: the describe
gains four assertions and loses none.
Claude-Session: https://claude.ai/code/session_01DvvamiacK328idtBYJBxV3
Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-support-ai
marked this pull request as ready for review
September 16, 2026 18:43
os-support-ai
deleted the
claude/issue-17633-serve-port-readback-nightly
branch
September 16, 2026 19:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #17633
Clause-②: no
The nightly
e2etier was red onmaininpackages/cli/test/serve-port-readback.e2e.test.ts. Reproduced first, at the base this branch was cut from, with the tier switch the nightly uses. Two assertions failed, and neither was about the product — both source-text pins in the file'sANTI-VACUITYdescribe had decayed while the invariants they claim still hold.What was red, and why
vitest run --project integration test/serve-port-readback.e2e.test.tsunderOS_TEST_TIERS=nightly, at8cf527f8e:Both pins read the raw source file, and a raw read is unsound in both directions.
1. The print-order pin fabricated. It ran
indexOfover the whole ofsrc/utils/format.ts.ed5a1e7f2(#17892) added a docblock quotingPress Ctrl+C to stopat line 800 — 281 lines above theconsole.errorat line 1081 that prints it. So the raw read put the tail at offset 38075 and theAPI:row at 47343, and the assertion reported a print order that had never changed. Read in code position the two offsets are 47343 and 53551, i.e. line 984 before line 1081, exactly as the pin claims.2. The banner pin held a byte-exact call that a legitimate refactor moved.
89a652b83(#17725,dev --cert/--key) made the callresolveAuthBaseUrl(boundPort, boundProtocol). The port argument is unchanged and still the bound one; only the argument list grew. That commit updated the per-PR sibling pin,packages/cli/src/commands/serve-bound-port-publication.test.ts, in the same diff — and could not update this copy, because this file runs only on the nightlymainsweep and no pull request can redden it.The fix
Both pins now read through
scripts/js-comment-mask.mjs, this tree's one answer to code-versus-prose, which blanks comment spans in place so every offset and line number survives. That repairs the fabrication and closes the other direction at the same time: a comment naming a pinned spelling can no longer satisfy a pin with no code behind it, which is exactly the vacuum the describe exists to prevent. The mask carries its own control — blanked in place (code.length === raw.length) and blanked something (code !== raw).The banner pin now binds the argument rather than the argument list: the row is derived from
boundPort, whatever else the call grows. That is the division of labour the two tiers imply — the per-PR sibling keeps the byte-exact line and reddens on the PR that moves it, with that PR's author reading the failure; a nightly-only copy of the same byte-exact claim can only go red a day later on a card nobody can attribute.That this is narrower, not looser, is proven rather than asserted — inside the test, on synthetic text, so the proof survives any future rewording of
serve.ts:…beside a standing negative asserting neither requested-port spelling is in
serve.tsat all.⛔ No test renamed, skipped, quarantined or deleted, and no assertion dropped. The describe gains four assertions and loses none.
Verification
Everything below was run in a dedicated worktree at
63d19926e, with the dependency closure built first.Red, then green, same command, both with the tier env set. The red leg restores the base copy of the test file onto the built tree, so the only variable is this diff:
8cf527f8e(base)Tests 2 failed | 11 passed (13), the two assertions quoted aboveTests 13 passed (13)— both realos serveboots included, 17.36sRestore proven by blob equality (
d00e065c02c1b76bf42b641abed34b094cddf4c1back on disk) and an emptygit diff HEADwith an emptygit status --porcelain.Ablation — two legs, each mutating product code on disk to prove the repaired pin still binds. No product code is changed by this PR; these mutations were made, measured and reverted.
resolveAuthBaseUrl(boundPort, boundProtocol)becomesresolveAuthBaseUrl(port, boundProtocol)inserve.ts803b955ftoa2f0aef3API:row print informat.tsrenamed so it no longer printsAPI:e3dda5c8to9ac9622fprintServerReady no longer prints an API: rowBoth restored: blob equal to the
HEADblob,git diff HEADempty,git status --porcelainempty.Gate families.
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackfrom the actual changed path, reconciled with--ran: 49 derived / 49 run / 0 NOT-MEASURED / 0 UNRUN.pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET, packages with nodist/) on the first pass — recorded as neither pass nor fail, then re-run after a fullturbo run buildand green: 104 published require entry points across 67 packages load, 620 emitted CommonJS files parse.pnpm check:cross-package-test-inputsexits 1, rooted inpackages/cli/test/init-created-files-summary.e2e.test.ts— pre-existing whereverpackages/spec/distis built, already filed as [finding] check:cross-package-test-inputs passes in CI and fails on a built tree — its verdict is a function of gitignored build state #18353 / [regression] check:cross-package-test-inputs 的裁决取决于被 gitignore 的空目录 packages/spec/dist 存不存在 —— 构建过的工作树一律红,CI 绿只因那一步跑在构建之前(#18340 引入) #18348, and not a path this diff touches. It does not name this PR's file (0 occurrences in its output).Beyond the derivation (the standing blind spot — the derivation never names the lint family):
pnpm lint— repo-wide,eslint . --no-inline-config, exit 0 at63d19926e.pnpm --filter @objectstack/cli typecheck— exit 0, test layer included (tsconfig.test.json, ledger unchanged at 3 files / 28 errors / 6 pinned signatures).pnpm --filter @objectstack/cli exec vitest run --project unit—Test Files 211 passed (211),Tests 3003 passed (3003). That tier carriestest/vitest-tiers-partition.test.ts, which is what would notice if the new import had moved this file between tiers. It did not.Changeset
skip-changeset, graded from what actually moves rather than from the shape of the diff.packages/clideclaresfiles: ["dist", "README.md", "CHANGELOG.md"];npm pack --dry-run --jsonships 533 files, 0 of them undertest/and 0 matchingserve-port-readback. The one changed path is not in any published tarball, so no released package moves.Acceptance notes
os-nightly-tiersmarker if the next sweep is red for any other reason.priority:p1and everything in its comment thread were graded fresh and not inherited: the thread discusses older, already-repaired defects in other files, and the body — rewritten in place by the nightly'sreportjob — names only this file.packages/cli/src/commands/serve-bound-port-publication.test.ts, which runs per-PR. A byte-exact source pin that lives only in a nightly-only tier cannot be kept honest by the PR that moves the source — that is the mechanism behind this red, and this file is unlikely to be the only place it holds. Whether such pins belong in the nightly tier at all is a wider question than this card.Generated by Claude Code