Skip to content

os init template descriptions advertise views/actions/extensions that no template emits #9737

Description

@os-zhuang

Found while working #9666 (init templates vs. the author-time rule set). Filed separately rather than fixed there: it is a different defect class — advertised-vs-emitted accuracy, not the OWD/rule-set defect that card is about — and the repair is a product call (reword, or actually emit the extra metadata), not a mechanical one.

The mismatch

packages/cli/src/commands/init.ts describes two of its three built-in templates as producing metadata kinds they never write:

templateadvertisedactually emitted (srcFiles)
appinit.ts:105 — "Full application with objects, views, and actions"src/objects/index.ts + src/objects/{namespace}_item.ts. No views, no actions.
plugininit.ts:198 — "Reusable plugin with objects and extensions"src/objects/index.ts + src/objects/{namespace}_item.ts. No extensions.
emptyinit.ts:264 — "Minimal project with just a config file"srcFiles: {} — accurate.

The published docs carry the same claim: content/docs/deployment/cli.mdx:104 lists the app template as "Full application with objects, views, barrel imports".

These strings are what os init --help and the docs table show a user at the moment they pick a template, so the inaccuracy is load-bearing: someone choosing -t app over -t empty to get a view scaffold gets objects only.

Control

Not a stale reading of an old tree — verified on origin/main at e196c6a9b. grep over both srcFiles maps returns exactly two entries each, both under src/objects/. The control that the query works: the same enumeration correctly reports empty as {}, and correctly finds the object files it does emit.

Two directions, needs a decision

  1. Reword the descriptions (and the docs table) to match what is emitted — cheapest, and honest immediately.
  2. Emit a starter view (and action) in the app template so the description becomes true — larger, and it widens what every generated project must keep passing the author-time rules (see os init -t app scaffold does not compile on CLI 17.0.0 — the template's own object trips the security-owd-unset author-time rule #9666, which makes init run those rules over its own output).

Option 1 is the safer default; option 2 is a scaffold-scope question worth a maintainer call, since the app template is the documented on-ramp and a view is arguably what makes it "full".

Whichever is chosen, content/docs/deployment/cli.mdx:104 moves with it.

Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions