Skip to content

fix(design-lab): use the current product name in the homepage preview - #3377

Open
czs914893385 wants to merge 1 commit into
GCWing:mainfrom
czs914893385:fix/design-lab-retired-product-name
Open

czs914893385 wants to merge 1 commit into
GCWing:mainfrom
czs914893385:fix/design-lab-retired-product-name

Conversation

@czs914893385

@czs914893385 czs914893385 commented Oct 13, 2026 •

Copy link
Copy Markdown

Symptom

main's CI workflow is red at the Frontend Build job, step Check repository hygiene
(run: pnpm run check:repo-hygiene). That step runs before pnpm install, so once it fails every
later step of the job is skipped: Install dependencies, Lint web UI, Run web UI tests,
Build web UI and the mobile checks never run. Since Frontend Build is part of the required CI set,
every open PR inherits the red check and no PR can see its own lint / test / build results.

On main the last green push run was c39bfb33; the two runs after it are red. This failure is not
introduced by any PR under review.

Root cause

check:repo-hygiene is a chain of six commands. Its first link, product:identity:audit
(node scripts/product-identity-audit.mjs), exits 1 with 6 findings, all of them in one file,
all retired product name (retired-product-name):

finding line
design-system/apps/design-lab/src/pages/OverviewPage.tsx:94:12 { id: "bitfun", icon: "folder", name: "BitFun" },
design-system/apps/design-lab/src/pages/OverviewPage.tsx:94:44 same line, the name field
design-system/apps/design-lab/src/pages/OverviewPage.tsx:95:12 { id: "bitfun-session", indent: true, name: "New Code Session" },
design-system/apps/design-lab/src/pages/OverviewPage.tsx:96:12 { id: "bitfun-welcome", indent: true, ... },
design-system/apps/design-lab/src/pages/OverviewPage.tsx:97:12 { id: "bitfun-more", name: t("design.homePreview.showMore"), ... },
design-system/apps/design-lab/src/pages/OverviewPage.tsx:187:118 <Button ... variant="text">BitFun</Button>

Raw output on main:

OpenBitFun product identity audit failed:
- design-system/apps/design-lab/src/pages/OverviewPage.tsx:94:12  retired product name (retired-product-name)
- design-system/apps/design-lab/src/pages/OverviewPage.tsx:94:44  retired product name (retired-product-name)
- design-system/apps/design-lab/src/pages/OverviewPage.tsx:95:12  retired product name (retired-product-name)
- design-system/apps/design-lab/src/pages/OverviewPage.tsx:96:12  retired product name (retired-product-name)
- design-system/apps/design-lab/src/pages/OverviewPage.tsx:97:12  retired product name (retired-product-name)
- design-system/apps/design-lab/src/pages/OverviewPage.tsx:187:118 retired product name (retired-product-name)

The rule lives in scripts/product-identity-audit.mjs: the retired token is banned in production
sources (matched as (?<!open)bitfun, case-insensitive). Its allowlist covers only the
data-directory ignore entry, the one-time migration documents / host deploy files and two external
GitHub identifiers. design-system is deliberately not allowlisted, and it should stay that way:
this file is a picture of the product's own UI, so the canonical name is the correct copy.

The lines were introduced by 5d27431c
(feat(design-lab): Cover every surface and unify the Lab's chrome type). The same audit passes on
that commit's parent.

The change

One file, 5 lines: design-system/apps/design-lab/src/pages/OverviewPage.tsx.

-    { id: "bitfun", icon: "folder", name: "BitFun" },
-    { id: "bitfun-session", indent: true, name: "New Code Session" },
-    { id: "bitfun-welcome", indent: true, name: t("design.homePreview.welcome"), selected: true },
-    { id: "bitfun-more", name: t("design.homePreview.showMore"), metadata: <NumberBadge value="+14" /> },
+    { id: "openbitfun", icon: "folder", name: "OpenBitFun" },
+    { id: "openbitfun-session", indent: true, name: "New Code Session" },
+    { id: "openbitfun-welcome", indent: true, name: t("design.homePreview.welcome"), selected: true },
+    { id: "openbitfun-more", name: t("design.homePreview.showMore"), metadata: <NumberBadge value="+14" /> },
...
-                          <Button size="xs" tabIndex={-1} trailingIcon={<Icon name="chevron-down" />} variant="text">BitFun</Button>
+                          <Button size="xs" tabIndex={-1} trailingIcon={<Icon name="chevron-down" />} variant="text">OpenBitFun</Button>

The demo row id values are renamed together with the display strings, because the audit matches the
retired token anywhere on the line, not just in user-visible copy. No other line is touched: no
reformatting, no reordering, no unrelated edits.

Before renaming, the whole repository was searched for the affected demo ids
(bitfun, bitfun-session, bitfun-welcome, bitfun-more) and for the retired display string.
No test, snapshot, e2e spec or sibling component references these ids - the only hits are the flagged
lines themselves (plus already-canonical openbitfun-session-* names and the allowlisted
legacy-migration data). So this stays a one-file change.

Verification (on a clone of main at base sha 7ac47e65, patch applied)

command before after
node scripts/product-identity-audit.mjs exit 1, 6 findings exit 0 (8767 text files scanned, 9100 repository files checked)
pnpm run check:repo-hygiene (the CI step) exit 1 (aborts at the audit) exit 0 (all six links green)
pnpm --dir design-system/apps/design-lab run type-check n/a exit 0
pnpm --dir design-system/apps/design-lab run build n/a exit 0
pnpm --dir design-system/apps/design-lab run test n/a 71 subtests, 70 pass, 1 pre-existing failure (see out of scope)
pnpm run lint:web n/a exit 0, 0 errors / 10 pre-existing warnings
git status --porcelain dirty (the 5 lines) only design-system/apps/design-lab/src/pages/OverviewPage.tsx

The other five links of the hygiene chain were also run individually on pristine main, to make sure
the audit was the only blocker: product:identity:audit:test exit 0, release:version:check exit 0,
check-repo-hygiene.test.mjs exit 0, check-repo-hygiene.mjs exit 0,
update-models-dev-snapshot.mjs --check exit 0. With the rename applied, the full chain exits 0
end to end, so the CI step passes and the job finally reaches pnpm install and the steps after it.

CI evidence on this PR

Run: https://github.com/GCWing/OpenBitFun/actions/runs/38443072449, head sha b49b7686,
Frontend Build job 115454553765.

step result
#5 Check repository hygiene success
#6 Install dependencies success
#7 Validate interactive capability contract success
#8 Test core boundary contracts success
#9 Check core boundaries failure (inherited from main, different check)

Check repository hygiene is green and the job now runs past it, so the step that was blocking the CI
of every open PR is fixed by this change.

The job then stops at Check core boundaries, which is a different check that main itself
currently fails: the contract reports
src/crates/execution/agent-runtime/src/agents.rs:1: agent-runtime builtin agent catalog must own latest-main mode/subagent categories, visibility, and default model facts; missing GeneralPurpose runtime default model mapping. That finding is absent at aed8c001 and aff65fa6 and present at
7ac47e65 (the newest commit on main, fix(agents): expose swarm configuration and align subagent defaults, which also last touched that file). It is a separate inherited defect, unrelated to product
identity, so this PR deliberately does not touch it. Until it is fixed separately, the lint / test /
build steps of that job stay skipped - but they now skip after the hygiene gate instead of before
dependency installation.

Note on the preview copy

This page renders a preview of the product's own home surface, so a user of the real app sees
OpenBitFun there; the retired spelling was stale demo data. The canonical name is therefore the
right copy, and the id values now match it. If the design-lab authors would rather use different
wording or ids (for example a neutral placeholder), we are happy to adapt - the only hard requirement
is that the retired product token does not reappear in production sources.

Out of scope (reported, deliberately not changed here)

pnpm --dir design-system/apps/design-lab run test has one failing subtest,
flow-chat-mock-contract.test.mjs - conversation bubble geometry and color stay aligned with production: .flow-chat-mock__user-bubble sets background: var(--openbitfun-color-action-quiet-hover)
while the product's .user-message-item uses transparent. It fails identically on a pristine
worktree of base sha 7ac47e65, so it is pre-existing and unrelated to this rename. It is not part of
the CI gate (no workflow references design-system at all), and fixing it would be an unrelated
design-system change, so it is left untouched.

中文说明

症状

main 的 CI 在 Frontend Build 任务的 Check repository hygiene(pnpm run check:repo-hygiene)
一步变红。该步骤在 pnpm install 之前执行,因此它一失败,同一个 job 里后面的步骤
(安装依赖、Lint web UI、Web UI 测试、Web UI 构建、移动端检查)全部被跳过。由于这个 job 属于必需检查,
所有 open PR 都会继承这条红叉,任何 PR 都看不到自己的 lint / 测试 / 构建结果。

main 上最近一次绿色的 push 运行是 c39bfb33,之后两次都是红的。该失败与任何在审 PR 无关。

根因

check:repo-hygiene 是一条由六条命令组成的链,第一条 product:identity:audit
(node scripts/product-identity-audit.mjs)就以 6 条 finding 退出 1,全部集中在同一个文件,
类型都是 retired product name (retired-product-name):OverviewPage.tsx 的 :94:12、:94:44、
:95:12、:96:12、:97:12、:187:118(上表已按行列出行内容)。

规则位于 scripts/product-identity-audit.mjs:旧 token 在生产源码中被禁(匹配 (?<!open)bitfun,
大小写不敏感),白名单只放行数据目录忽略项、一次性数据迁移文档 / host 部署文件,以及两个外部 GitHub 标识。
design-system 不在白名单里,而且也不应该进去:这个文件是产品自身界面的预览图,正式产品名才是正确的文案。

这些行由 5d27431c(feat(design-lab): Cover every surface and unify the Lab's chrome type)引入,
其父提交上同一审计是通过的。

改动

只改一个文件、5 行:design-system/apps/design-lab/src/pages/OverviewPage.tsx。演示行的 id 与显示名
一起改成正式名 OpenBitFun / openbitfun-*,因为审计是按 token 匹配整行,id 里的旧 token 同样会命中。
没有重新格式化、没有调整顺序、没有触碰无关行。

改名前已对全仓库检索这些演示 id(bitfun、bitfun-session、bitfun-welcome、bitfun-more)与旧显示名:
没有任何测试、快照、e2e 用例或兄弟组件引用它们,命中的只有被标记的那几行本身,
因此本次改动保持单文件。

验证

在 main(base sha 7ac47e65)的克隆上加补丁:node scripts/product-identity-audit.mjs 由 exit 1
变为 exit 0;完整 CI 步骤 pnpm run check:repo-hygiene 由 exit 1 变为 exit 0;
design-lab 的 type-check 与 build 均为 exit 0,lint:web 为 0 error / 10 个既有 warning;
git status --porcelain 只剩这一个预期文件。链条其余五条命令在干净 main 上单独跑也都是 exit 0,
说明唯一阻塞点就是产品身份审计;补丁之后整条链全部通过,CI 将能够走到安装依赖与后续的 lint / 测试 / 构建步骤。

CI 实测结果

运行:https://github.com/GCWing/OpenBitFun/actions/runs/38443072449(head sha b49b7686,
Frontend Build job 115454553765)。第 5 步 Check repository hygiene 已 success,
第 6 步 Install dependencies、第 7 / 8 步也均 success,说明原先阻断所有 PR 的关卡已经修好。

job 随后停在第 9 步 Check core boundaries——这是另一条检查,main 自身当前也不通过:
src/crates/execution/agent-runtime/src/agents.rs:1 缺少 GeneralPurpose 的 runtime 默认模型映射。
该问题在 aed8c001、aff65fa6 上不存在,只出现在 main 最新提交 7ac47e65
(fix(agents): expose swarm configuration and align subagent defaults,也正是最后改动该文件的提交)。
它属于另一类遗留缺陷、与产品身份无关,因此本 PR 有意不动它;在它被单独修复前,
该 job 的 lint / 测试 / 构建步骤仍会被跳过,但跳过的位置已经变成"卫生关卡之后、依赖安装之后"。

说明

该页面预览的是产品自有界面的样子,真实应用里用户看到的就是 OpenBitFun,旧拼写属于过期的演示数据。
如果 design-lab 的作者更希望用别的措辞或 id(例如中性的占位名),我们很乐意配合调整,
唯一硬性要求是旧产品 token 不要重新出现在生产源码中。

本次不处理(已报告)

design-lab 的测试里有 1 个既有失败(flow-chat-mock-contract.test.mjs:.flow-chat-mock__user-bubble
的 background 与产品侧 .user-message-item 不一致),在 base sha 7ac47e65 的干净工作树上同样失败,
与本次改名无关,也不在 CI 关卡范围(没有任何 workflow 引用 design-system),故保持原样、不在本 PR 扩大范围。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant