Skip to content

[finding] create-objectstack: non-blank remote templates fail first npm run build on published 16.1.0 — fix is at HEAD, needs 17.0.0 release + canary verification #7644

Description

@huangyiirene

Symptom

create-objectstack@16.1.0 (current npm latest) scaffolds a project from any non-blank published remote template, and its very first npm run build exits 2 with a namespace-prefix validation error. Reproduced on 4 independent templates in the QA run — todo / compliance / content / contracts (2 / 4 / 5 / 3 issues respectively); procurement was blocked(environment) (codeload 503/403 in the sandbox). The blank template is clean end to end. This triggers for any project name whose sanitized namespace differs from the template's own — i.e. every real user, and CI's own canary-app.

Root cause

Located, and already fixed at repo HEAD — the residual action is a release, not a repair.

  • Published 16.1.0 rewrites namespace: in objectstack.config.ts to the sanitized project name but not the object-name literals, because it reads the template's original namespace from objectstack.manifest.json only. A remote template's manifest is the template-registry document, which has no namespace key, so the guard falls through and the literal rewrite is silently skipped (config says namespace tpl_todo while the object literal still says name: 'todo_task').
  • The fix is present on origin/main (confirmed at filing time): packages/create-objectstack/src/rewrite-identity.ts makes objectstack.config.ts the authority and self-verifies via findStaleNamespacePrefixes, wired in at packages/create-objectstack/src/index.ts:311. The file's own comment names the prior incident fix(devx): init-service 门禁认全部服务访问器,不只 getService (#4835) #4902 ("all five published remote templates failed this way, and the nightly registry canary had been red on every one of them for weeks with nobody watching"). Pin packages/create-objectstack/src/rewrite-identity.test.ts is present (10/10 pass per the run).
  • Related prior code-bug issue: P0:5 个已发布模板对真实新用户是坏的 —— 脚手架的对象名前缀改写对所有远程模板静默跳过,夜间金丝雀连红 20 次无人察觉 #4926 (closed).

Reproduction

npx -y create-objectstack@latest canary-app -t todo --skip-skills --skip-install
cd canary-app && npm install && npm run build

Expected exit 0. Actual (with published 16.1.0) exit 2:

defineStack namespace-prefix validation failed (2 issues):
Object todo_label is missing the package namespace prefix.
Rename it to canary_app_todo_label (namespace = canary_app)

Residual asks (release-verification, not code repair)

  1. Confirm the rewrite-identity.ts fix ships in the create-objectstack@17.0.0 release — npm latest is still 16.1.0, so every new user picking a non-blank template today gets a project that fails first build.
  2. Confirm the nightly registry canary goes green once 17.0.0 is published.

Source

Extracted from the QA run #7628 (framework 92f26f7, console 6314e87f).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions