Skip to content

Commit 4cf3f44

Browse files
committed
chore(changeset): grade the scaffolder annotation fix patch, not minor
AGENTS.md: "A bug fix in a released package takes a `patch` changeset -- never none, and never `skip-changeset`". This is that shape -- a scaffolder emitted broken text and now emits working text -- matching two `@objectstack/cli` 17.3.0 Patch-section precedents, 5dee191 (#13871, `os generate` ghost field types) and 9786d39 (`os create example` manifest identity block). The `minor` grade rested on a precedent of the wrong class (an additive key on a machine-readable --json payload, i.e. a contract widening), and on the claim that "patch would assert no surface moved" -- which is not what patch asserts, since every fix moves output bytes. The body now rests the annotation choice on ADR-0122 D1, which already ruled that the bare alias denotes the author state and is the name authoring surfaces use, rather than on two docs-page citations that do not support it: `metadata-driven.mdx`'s `const Account: ServiceObject` line is that page's "Deprecated" example, and `quick-reference.mdx` only names the type in an import list. Adds the measured result for the parsed-state alias: TS2740 on all three emissions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
1 parent c2587f6 commit 4cf3f44

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.changeset/init-generate-emit-service-object-annotation.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"@objectstack/cli": minor
2+
"@objectstack/cli": patch
33
---
44

55
`os init -t app`, `os init -t plugin` and `os g object` now emit an object file that compiles. All three wrote `const … : Data.Object`, and `@objectstack/spec/data` exports no member named `Object`, so the first command a new user runs produced a project that failed its own `pnpm typecheck`.
@@ -13,7 +13,11 @@ tsc exit 2
1313

1414
Identical at TypeScript 5.3.3, 5.8.3 and 6.0.3, so it was never a compiler-version effect. `os create example` type-checked clean on the same tarball in the same run — the failure was specific to these emissions.
1515

16-
The annotation is now `Data.ServiceObject`, which is `z.input<typeof ObjectSchemaBase>` — the authoring shape of an object, and the exact structural analogue of the annotations the sibling generators already emit (`UI.View`, `UI.Action`, `UI.Dashboard`, `Automation.Flow` are each the `z.input` of their own schema). **Nothing was added to `@objectstack/spec`**: `ServiceObject` has always been exported from `@objectstack/spec/data`, and the hand-written docs already annotate authored objects with it (`concepts/metadata-driven.mdx`, `getting-started/quick-reference.mdx`). The scaffolders had simply drifted off the spelling the rest of the repo uses.
16+
The annotation is now `Data.ServiceObject`. That name was not chosen here — it is what [ADR-0122](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0122-schema-type-alias-naming-convention.md) D1 already ruled: for a schema `XSchema`, the **bare** alias denotes the author state (`z.input<typeof XSchema>`), and it is "the name documentation, examples, skills and AI authoring surfaces use for the thing an author writes". An emitted scaffold is the thing an author writes, so the bare alias is the one it owes. The sibling generators were already on that convention — `UI.View`, `UI.Action`, `UI.Dashboard` and `Automation.Flow` are each the bare alias of their own schema — and only the object emitters had drifted off it.
17+
18+
**Nothing was added to `@objectstack/spec`**: `ServiceObject` has been exported from `@objectstack/spec/data` throughout.
19+
20+
The parsed-state alias is not an alternative here. Annotating the same emitted literal `Data.ServiceObjectParsed` fails all three cases with `error TS2740`, because every field literal is then missing the keys the schema supplies by default — which is exactly the author-state/parsed-state distinction ADR-0122 D2 draws.
1721

1822
`content/docs/deployment/cli.mdx` taught the broken spelling too, and is corrected with them — a reader copying from the docs wrote the same uncompilable line.
1923

0 commit comments

Comments
 (0)