Uh oh!
There was an error while loading. Please reload this page.
fix(scripts): bound objectui-range --help's self-read to the header prefix - #12040
Merged
yinlianghui merged 1 commit intoAug 25, 2026
Merged
Conversation
…refix --help built its usage text by keeping every column-0 `//` line in the whole file, not just the header. Six mid-file implementation comments (the pinAt() helper's rationale, and this file's own self-test section banner) leaked into the usage text a reader pastes. The header IS a contiguous prefix of the file (right after the shebang), so printHelp() now walks lines in order and stops at the first non-`//` line once the block has started -- a takeWhile, not a filter -- so a column-0 comment added anywhere later in the file can never reach --help again. Pinned as a self-test assertion (the file's own #4843 idiom): --help still carries the real header, and none of the six measured stray lines. Reverse-verified: mutating printHelp() back to the old unbounded filter flips the new pin red; rebuilding the fix restores green. column-0 `//` count is unchanged at 79 -- the new rationale uses a `/** */` block, per PR #11951's byte-identity concern for this file.
yinlianghui
marked this pull request as ready for review
August 25, 2026 06:45
Uh oh!
There was an error while loading. Please reload this page.
yinlianghui
deleted the
claude/issue-11952-objectui-range-help-header-bound
branch
August 25, 2026 07:03
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 freeto 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.
Fixes#11952
What
objectui-range --helpbuilt its usage text from every column-0//line in
scripts/objectui-range.mjs, not just the header block. Sixmid-file implementation comments (the
pinAt()helper's one-linerationale at old line 129, and this file's own self-test section banner
at old lines 333-337) leaked into the usage text a reader pastes.
Triage's acceptance pin (quoted verbatim in the issue): "
--helpoutput contains the header and none of the six measured stray lines."
Fix
The header is a contiguous prefix of the file (right after the
shebang) — measured on today's
origin/main(1e79aa4f8), lines 2-74are all column-0
//, then line 75 (import { execFileSync } ...)breaks it, and no other column-0
//line appears again until 129. SoprintHelp()now walks the file's lines in order and stops at thefirst non-
//line once the header block has started — atakeWhile, not afilter— the repair triage's option 1 named ascheapest and structurally closing the "add a comment anywhere later"
hazard. The self-read itself is kept (no-drift property preserved) —
only its boundary changed.
Total column-0
//line count is unchanged at 79 (PR #11951'sbyte-identity pin); the new rationale prose is a
/** */JSDoc block onprintHelp(), matching #11951's own reason for choosing that commentstyle on this file.
Pin
Per the standing requirement to ship the acceptance criterion as a
mechanically-checkable test, not a PR-body claim: extended this file's
own self-test idiom (
--self-test, cited from #4843) with two newchecks —
--helpstill carries the real header (Usage:, the old-rev/new-revline,
OBJECTUI_ROOT=...).--helpdoes not contain any of the six measured stray lines(the
pinAt()rationale and the self-test banner text).Reverse-verified: committed the fix, then mutated
printHelp()back to the old unbounded
.filter()in place (confirmed the mutationlanded on disk via
grep -cbefore running), re-ran--self-test—the new stray-line check went red (
✗ --help does NOT leak mid-file implementation comments), confirming the pin actually detectsthe regression it exists to catch.
git checkout --with the target path (via atrap ... EXITin the mutation script) restored the fix; working treeconfirmed clean afterward.
Byte diff
Captured
--helpoutput before/after into two files and diffed them —exactly the six stray lines are gone, nothing else moved:
--helpbyte length: 4693 → 4237 (content-asserted in the pin, notbyte-count-asserted, per the standing guidance that a byte-count
assertion rots).
Scope
Only
scripts/objectui-range.mjstouched. No reformatting/restructuringelsewhere in the file —
git diff origin/main -- scripts/objectui-range.mjsis exactly two hunks: the
printHelp()body + its doc-comment, and thenew self-test block.
Gates (derived via `node scripts/pm/dispatch-gates.mjs --repo
objectstack-ai/objectstack
at final HEAD05f5dec`)All 8 matched local gate families green (exit 0, captured before any
pipe; verdict line quoted from each gate's own output):
pnpm check:agent-test-spelling—✓ check-agent-test-spelling: 0 violations — 367 file(s) · 3681 bare '--' token(s) · 1139 launcher-rooted run(s) · 9 separator(s) JUDGED · 5 vitest-backed script name(s) derived from 80 manifest(s)pnpm check:cross-package-test-inputs—OK: 16 package(s) read outside themselves, all declared, and turbo.json hashes every declared glob.pnpm check:entry-guard—✓ check:entry-guard: 157 scripts/ file(s) — every entry guard goes through invoked-as.mjs; 113 export bindings, 111 of them inert on import (2 known-unsafe, ⛔ SHRINK-ONLY).pnpm check:objectui-changeset(runs this file's own--self-test, including the two new checks) —✓ objectui-range --self-test: all checks passedpnpm check:parse-guard—✓ check:parse-guard: 156 scripts/ file(s) — every TypeScript parse goes through ts-parse.mjs.pnpm check:pnpm-filter-targets—✓ check:pnpm-filter-targets: 135/168 '--filter' occurrence(s) across 26 file(s) resolve against 78 workspace package(s); ...node scripts/check-ci-filter-parity.mjs—OK: all 96 declared cross-package glob(s) (81 unique) are covered by 'core' or 'crosspkg', ...node scripts/check-cross-package-test-inputs.mjs—OK: 16 package(s) read outside themselves, all declared, and turbo.json hashes every declared glob.Plus
pnpm check:nul-bytes(any edit warrants it) —check-nul-bytes: OK (scanned 6672 text file(s) ... no raw ASCII control bytes).pnpm --stack-size=4000 eslint scripts/objectui-range.mjs --no-inline-config --format json— 0 errors, 0 warnings, 1 file linted (scoped-run evidence: population read fromeslint's own JSON output, not a guess; this repo'seslint.config.mjsnever enables type-aware linting for any file — measured with a positive control in the config's own header comment — so this scoped run cannot have missed a judgment on any untouched file).No package's
typecheck/testcovers this file: roottsconfig.jsonexcludes
packages//apps//examples/and has noallowJs, andscripts/is not itself a workspace package, soturbo run typecheck/testnever touches it — the file's real correctness gateis
check:objectui-changeset's--self-testabove, which does.Changeset
Root
scripts/tooling only, nothing published —skip-changesetapplies. Labeled and read back — confirmed present on this PR.
Generated by Claude Code