Skip to content

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

Description

@os-zhuang

Found while measuring CLI output for the ObjectOS docs (objectstack-ai/objectos#94). Different defect class from that card — filed here because the fix lands in this repo, not in the docs.

Measured

latest on npm is 17.0.0 (npm view @objectstack/cli dist-tags gives {"latest":"17.0.0","rc":"17.0.0-rc.6"}), so this is what a reader following the published quickstart gets.

npx @objectstack/cli@17.0.0 init my-app -t app --install # exit 0, scaffold validated
cd my-app && npm run dev # -> objectstack dev

The scaffold is created and self-validates at init time:

 → Validating scaffold...
✓ Scaffold validated (namespace: my_app)
✓ Project initialized!

But the very first dev run fails to compile:

 → Running author-time rules (40)...
✗ Author-time rules failed (1 issue)
• object "my_app_item": custom object "my_app_item" declares no sharingModel (OWD). The runtime fails CLOSED to 'private' (ADR-0090 D1), but the baseline must be an authored decision, not an accident — this is the exact shape of the leave_request incident (objectui#2348).
Declare sharingModel explicitly: 'private' (owner + shares; recommended default), 'public_read', 'public_read_write', or 'controlled_by_parent' (master-detail children).
rule: security-owd-unset at objects[0].sharingModel
✗ Compile failed — fix errors above before starting dev server

The dev server never starts. There is no readiness banner to reach.

Cause

The -t app template emits src/objects/my_app_item.ts with no sharingModel:

import*asDatafrom'@objectstack/spec/data';constmyAppItem: Data.Object={name: 'my_app_item',label: 'My App Item',fields: {name: {type: 'text',label: 'Name',required: true},description: {type: 'textarea',label: 'Description'},status: {type: 'select',label: 'Status',options: [/* … */],defaultValue: 'draft'},},};exportdefaultmyAppItem;

security-owd-unset is one of the 40 author-time rules the same CLI ships and runs. So the shipped template and the shipped rule set disagree: the scaffold the CLI writes is rejected by the validation the CLI runs.

Why the init-time check did not catch it

init prints ✓ Scaffold validated, which reads as "this project is good to go". Whatever that step checks, it is not the author-time rule set that dev runs a moment later. That gap is arguably the more interesting half of this report — a scaffold validator that green-lights a scaffold the next command rejects will keep letting template regressions ship.

Suggested shape

Two independent fixes, and I think both are wanted:

  1. The template declares sharingModel: 'private' — the rule's own recommended default, and the authored-decision baseline ADR-0090 D1 is asking for. One line.
  2. init's scaffold validation runs the author-time rules, so a template that cannot compile fails at the point it is generated rather than at the user's first dev.

Impact

The documented developer on-ramp is dead on the current published CLI. os start (the operator path) is unaffected — it boots fine; only the init + dev path is broken.

Filed unassigned for triage. Back-link: objectstack-ai/objectos#94.


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