|
| 1 | +--- |
| 2 | +'@objectstack/cli': minor |
| 3 | +--- |
| 4 | + |
| 5 | +fix(cli): **BREAKING** — `os generate schema` is retired, and it now says why and points at `os validate` and the per-type JSON Schemas `@objectstack/spec` publishes (#19098) |
| 6 | + |
| 7 | +Clause-②: no (narrowing) |
| 8 | + |
| 9 | +<!-- adr-0087: not-required (no-migration-prescription) A CLI COMMAND NAME is an invocation surface, not authorable metadata. There is no authorable key, no `sys_metadata` row and no schema to tombstone here, so there is nothing for `objectstack migrate meta` to rewrite, nothing for `spec-changes.json` to project and no FROM -> TO spelling for the upgrade guide to carry: the ruling generates no replacement file, so there is no call to rename, only one to delete. Nor is the ledger the notification channel: the command itself now refuses, exits 1 and names `os validate` and the published per-type schemas at the exact moment and place of use. Same reasoning shape as the `os g agent` retirement, one command over. --> |
| 10 | + |
| 11 | +**⛔ If a script, a Makefile or a CI step in your project runs `os generate schema` |
| 12 | +(or `os g schema`), it will now exit 1 and write nothing.** That is the intended |
| 13 | +outcome: the command is gone by maintainer ruling, and the failure is how you find |
| 14 | +out. Nothing in this repository reads the file it wrote. |
| 15 | + |
| 16 | +`minor`, not `major`: during the launch window this stack ships breaking changes as |
| 17 | +`minor` (pre-1.0 semantics under lockstep versioning — see |
| 18 | +`scripts/check-changeset-no-major.mjs`). |
| 19 | + |
| 20 | +**What the command actually did.** `os generate schema` wrote |
| 21 | +`objectstack.schema.json`, a JSON Schema of the whole stack definition for an editor |
| 22 | +to check `objectstack.config.ts` against. It projected `ObjectStackDefinitionSchema` |
| 23 | +through a bare `z.toJSONSchema`, so the refinements the platform enforces beyond the |
| 24 | +shape — a non-blank string, a required one-of, a banned key — were missing from the |
| 25 | +file. Measured against the published projection on the tree the ruling was made on, |
| 26 | +the file lacked 874 keywords, every one of them an absence. An editor pointed at it |
| 27 | +reported a config as valid, and the platform then refused that config. |
| 28 | + |
| 29 | +**Why it is retired rather than repaired.** A TypeScript configuration is typed by its |
| 30 | +own `define*` helper, and `objectstack.config.ts` is typed end to end by |
| 31 | +`defineStack`, so no config format this CLI loads is one an editor validates against |
| 32 | +a JSON Schema. JSON metadata already has the per-type schemas `@objectstack/spec` |
| 33 | +publishes, which carry the published projection. Repairing the command would have |
| 34 | +added a permanent public export to `@objectstack/spec` for a file with no reader. The |
| 35 | +ruling generates no replacement file. What you see now: |
| 36 | + |
| 37 | +``` |
| 38 | + ✗ `os g schema` was retired — its JSON Schema passed configs the platform refuses (maintainer ruling). |
| 39 | +
|
| 40 | + The file it wrote described only the shape of a stack. Every rule the |
| 41 | + platform enforces beyond that shape — a non-blank string, a required |
| 42 | + one-of, a banned key — was missing from it, so an editor showed a config |
| 43 | + as valid and the platform then refused it. By maintainer ruling it is |
| 44 | + retired, not repaired, and no replacement file is generated. |
| 45 | +
|
| 46 | + Check a project against the rules that actually run: |
| 47 | +
|
| 48 | + os validate |
| 49 | +
|
| 50 | + For JSON metadata, point your editor at the per-type schemas that |
| 51 | + @objectstack/spec publishes. They state the rules a JSON Schema can |
| 52 | + express, and name the ones it cannot under `x-dropped-refinements`: |
| 53 | +
|
| 54 | + node_modules/@objectstack/spec/json-schema/<category>/<Type>.json |
| 55 | +
|
| 56 | + `objectstack.config.ts` needs neither: `defineStack` types it in your |
| 57 | + editor. Delete the `os generate schema` call, and any editor setting |
| 58 | + that maps `objectstack.schema.json` — nothing writes that file now. |
| 59 | +
|
| 60 | + Docs: https://objectstack.ai/docs/deployment/cli |
| 61 | +``` |
| 62 | + |
| 63 | +**What to do.** The refusal's pointer is the whole of it. Delete the |
| 64 | +`os generate schema` call, and any editor setting that maps `objectstack.schema.json` |
| 65 | +(a `json.schemas` or `yaml.schemas` entry, for example). Run `os validate` to check a |
| 66 | +project against the rules that actually run. For JSON metadata, point the editor at |
| 67 | +`node_modules/@objectstack/spec/json-schema/`, one file per metadata type. There is no |
| 68 | +call to rename: nothing replaces the command. |
| 69 | + |
| 70 | +**Reach outside this repository is NOT MEASURED.** There is no telemetry, so whether |
| 71 | +any project runs the command or reads its file is unknown. Inside this repository |
| 72 | +nothing does: no reader and no editor mapping of `objectstack.schema.json` exists. |
| 73 | +If these release notes also record that `os generate schema` can now write its file, |
| 74 | +this retirement supersedes that repair. |
| 75 | + |
| 76 | +**Two neighbouring answers change with it.** The retirement ledger is now read before |
| 77 | +the command routes its sub-commands and before it asks for a `<name>`, which is what |
| 78 | +lets `os generate schema` (no name) reach the refusal at all. So `os g agent` with no |
| 79 | +name now prints the agent retirement instead of `Missing required argument: <name>`. |
| 80 | +The ledger lookup also reads its own keys only: `os g constructor <name>` used to be |
| 81 | +taken for a retired type and crashed with a `TypeError`, and it now falls through to |
| 82 | +the ordinary type checks. |
| 83 | + |
| 84 | +The docs row that advertised the command — "Autocomplete and validation for |
| 85 | +`objectstack.config.ts` (via `os generate schema`)" in |
| 86 | +`content/docs/api/data-flow.mdx` — is gone, with the diagram's JSON Schema node above |
| 87 | +it. |
0 commit comments