Skip to content

fix(create-objectstack): startup banner reads its own version - #11030

Merged
os-elon merged 1 commit into
mainfrom
claude/issue-10325-banner-reads-own-version
Aug 22, 2026
Merged

fix(create-objectstack): startup banner reads its own version#11030
os-elon merged 1 commit into
mainfrom
claude/issue-10325-banner-reads-own-version

Conversation

@os-elon

Copy link
Copy Markdown
Collaborator

Fixes#10325

npm create objectstack@latest greeted a newcomer with a hardcoded
◆ Create ObjectStack v6.x — eleven majors stale, on the first line of
output anyone ever sees. readCliVersion() already resolves the real,
published version from package.json (.version() on the commander
program already uses it); the banner just never called it.

The trap this card names

The naive fix — dropping the real version into the old literal string —
would have reintroduced the exact defect this card exists to close: the
box's right border is a fixed run of computed for the 4-character
v6.x, and a longer real version (v17.1.0 is 7 characters) pushes the
border out of alignment without recomputing the trailing pad (the sibling
bug fixed in #10322, one function away in the same file).

renderVersionBanner() (new banner.ts, split out so it is unit-testable
without importing index.ts, which calls program.parse() at module
scope) derives the box width from the version string's PLAIN length and
widens the frame — never truncates — for a version long enough to need
more room. Ordinary versions still render at the historical 39-column box
size.

Rendered output (real build, real run)

Normal version (packages/create-objectstack/package.json declares 17.1.0):

 ╔═══════════════════════════════════╗
║ ◆ Create ObjectStack v17.1.0 ║
╚═══════════════════════════════════╝

Deliberately long version (18.0.0-beta.1+build.20260822, 29 chars — to
exercise the widening path):

 ╔════════════════════════════════════════════════════════╗
║ ◆ Create ObjectStack v18.0.0-beta.1+build.20260822 ║
╚════════════════════════════════════════════════════════╝

Both captured from the actual built dist/index.js run as a subprocess
(node dist/index.js <name> --template blank --skip-install --skip-skills),
not from the unit tests.

Tests

packages/create-objectstack/src/banner-version.test.ts, following the
scaffold-description.test.ts / scaffold-next-steps-pm.test.ts subprocess
convention (index.ts calls program.parse() at import time, so it is
exercised via tsx rather than imported). Two properties, pinned
separately so neither can go vacuous:

  1. The banner names the version package.json actually declares — read at
    test time, never a copy-pasted literal.
  2. The three box lines still render to equal display width with aligned
    borders
    , computed from ANSI-stripped plain text (chalk color is forced
    on for this specific assertion via FORCE_COLOR, since the padding math
    must never be done on a chalk-wrapped, escape-code-laden string).

Reverse-verified both halves (see dev report for the transcripts): restoring
the hardcoded v6.x literal turns the "names the declared version"
assertion red; hardcoding the old fixed 7-space trailing pad turns all
three alignment assertions red. Both restored to green.

Scope

Touches only the banner and its test — no changes under
packages/create-objectstack/src/templates/** (PR #11024 and #11022/#10990
own that tree) and nothing under content/docs/releases/.


Generated by Claude Code

`npm create objectstack@latest` greeted a newcomer with a hardcoded
`◆ Create ObjectStack v6.x` — eleven majors stale, on the first line of
output anyone ever sees. `readCliVersion()` already resolves the real,
published version from package.json (`.version()` on the commander program
already uses it); the banner just never called it.
The naive fix — dropping the real version into the old literal string —
would have reintroduced the exact defect class this card exists to close:
the box's right border is a fixed run of `═` computed for the 4-character
`v6.x`, and a longer real version (`v17.1.0` is 7 characters) pushes the
border out of alignment without recomputing the trailing pad (the sibling
bug fixed one function away in the same file). `renderVersionBanner()` (new
banner.ts, split out so it is unit-testable without importing index.ts,
which calls `program.parse()` at module scope) derives the box width from
the version string's PLAIN length and widens the frame — never truncates —
for a version long enough to need more room; ordinary versions still render
at the historical 39-column box size.
Pinned two properties separately so neither can go vacuous: the banner names
the version package.json actually declares (read at test time, not a
literal), and the three box lines still render to equal display width with
aligned borders, computed from ANSI-stripped plain text.
Fixes#10325
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

5 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ✅

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 45 of 221 client-bound route-ledger rows — the other 176 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run: node scripts/docs-audit/affected-docs.mjs --bridge-coverage

Coarse fallback — 8 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 8d21f7a76912df531c144f17bc3f5bedd07f79c5packageMentionDocs.

Which tree this was computed on

This run read content/docs from a3fd008a601a40f6bbb4e02aafcb631cbfd0a3a8 — the merge of head bfcb8d378ae6cc9b124d9ff23302da18dd418a9c into base 8d21f7a76912df531c144f17bc3f5bedd07f79c5, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a3fd008a601a40f6bbb4e02aafcb631cbfd0a3a8 && git checkout a3fd008a601a40f6bbb4e02aafcb631cbfd0a3a8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8d21f7a76912df531c144f17bc3f5bedd07f79c5 bfcb8d378ae6cc9b124d9ff23302da18dd418a9c && git checkout -B drift-repro 8d21f7a76912df531c144f17bc3f5bedd07f79c5 && git merge --no-ff bfcb8d378ae6cc9b124d9ff23302da18dd418a9c
node scripts/docs-audit/affected-docs.mjs --json 8d21f7a76912df531c144f17bc3f5bedd07f79c5

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation tests tooling labels Aug 22, 2026
@os-elon
os-elon marked this pull request as ready for review August 22, 2026 10:32
@os-elon
os-elon added this pull request to the merge queueAug 22, 2026
Merged via the queue into main with commit cec9d23Aug 22, 2026
34 checks passed
@os-elon
os-elon deleted the claude/issue-10325-banner-reads-own-version branch August 22, 2026 10:46
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 32567862060 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

失败的 job(日志抽取,best effort):

  • Console Pin Gate — 失败步骤: Build the Console SPA at the pinned objectui SHA

    ✗ Build failed in 4.34s
    

↳ 失败原因 是判读的关键:超时Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 95 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] create-objectstack@17.1.0 greets the user with a hardcoded "◆ Create ObjectStack v6.x" banner

2 participants

@os-elon@claude