Skip to content

Commit 424f73c

Browse files
huangyiireneclaude
andauthored
fix(spec): route the stored-envelope refusal to os package publish (#12439)
The refusal an author meets when hand-writing a stored-envelope key onto an `api` declaration named `objectstack publish`, which resolves to no command — `os publish` was retired with the direct-to-environment path. Re-measured against the BUILT oclif Config on this tree (not against docs): 61 registered ids, the only two containing `publish` are `package publish` and `plugin publish`, no bare `publish` id and no `publish` topic. Same stale spelling corrected in the `publisher` doc comment of `cloud/package.zod.ts` and in `content/docs/api/declarative-endpoints.mdx` (the `objectstack validate` on that line is valid and is left alone). The gate's baselined-violation entry is self-retiring by design: fixing the string makes it stop reproducing and reds `check:cli-command-ids` until the row is deleted, so it goes in the same commit. Text only — no accept/reject behaviour change. Claude-Session: https://claude.ai/code/session_01E5LFCYBJ3q2s6yW6oMLxwy Co-authored-by: Claude <noreply@anthropic.com>
1 parent a5ef1d8 commit 424f73c

5 files changed

Lines changed: 45 additions & 15 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
Route the stored-envelope refusal to a command that exists — `os package publish`, not the retired `objectstack publish` (#12223)
6+
7+
An author who hand-writes one of the seven `STORED_ENVELOPE_KEYS` onto an `api`
8+
declaration is refused, and the refusal tells them where publication state actually
9+
comes from. It named a command that resolves to nothing:
10+
11+
```text
12+
before: Remove it — publication state is managed by `objectstack publish`, not authored.
13+
after: Remove it — publication state is managed by `os package publish`, not authored.
14+
```
15+
16+
`os publish` was the legacy direct-to-environment command, retired with the path that
17+
wrote `sys_environment_revision`. Re-measured on this tree against the **built oclif
18+
`Config`** rather than against docs — loading the CLI's plugin and reading the command
19+
table oclif derives from `dist/commands/**`: **61** ids, of which the only two containing
20+
`publish` are `package publish` and `plugin publish`. There is no bare `publish` id and no
21+
`publish` topic, so the old spelling exits as an unknown command. The message's own
22+
neighbouring sentence already names `publishPackage` as the writer, and
23+
`packages/cli/src/commands/package/publish.ts` is the command that runs it.
24+
25+
This is the shape #12177 deliberately left alone elsewhere inverted: those sentences are
26+
*about* the removal and are correct as history, while this one is **present tense and
27+
prescriptive** — text an AI author obeys at the moment its write is refused.
28+
29+
Text only. No accept/reject behaviour changes: the same seven keys are refused on the same
30+
declarations, with the same `unrecognized_keys` upgrade path; only the sentence an author
31+
reads is corrected. The same stale spelling is fixed in the `publisher` doc comment of
32+
`packages/spec/src/cloud/package.zod.ts`, which ships to consumers in the package's type
33+
declarations.

content/docs/api/declarative-endpoints.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default defineStack({
8686
});
8787
```
8888

89-
Publish it (`objectstack publish`), and the two URLs answer. `objectstack validate` — and
89+
Publish it (`os package publish`), and the two URLs answer. `objectstack validate` — and
9090
`os build` — run the same gates the publish path runs, so a declaration that would be
9191
refused is refused before you deploy.
9292

packages/spec/src/api/endpoint.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const STORED_BOOKKEEPING_GUIDANCE =
3636
'This is the metadata layer\'s own storage bookkeeping, not endpoint vocabulary. It is written onto '
3737
+ 'the stored ROW by `register` / `publishPackage` and peeled off before this schema sees a body '
3838
+ '(#5309), so writing it on a declaration configures nothing. Remove it — publication state is '
39-
+ 'managed by `objectstack publish`, not authored.';
39+
+ 'managed by `os package publish`, not authored.';
4040

4141
/**
4242
* API Endpoint Schema

packages/spec/src/cloud/package.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export const PackageSchema = lazySchema(() => z.object({
234234
/**
235235
* Publisher provenance tier — surfaced as a trust badge in the Marketplace
236236
* and Studio. Defaults to `private` for org-scoped packages; the
237-
* `objectstack publish` CLI sets it explicitly when promoting first-party
237+
* `os package publish` command sets it explicitly when promoting first-party
238238
* or partner content.
239239
*/
240240
publisher: PackagePublisherSchema.default('private'),

scripts/check-cli-command-ids.mjs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,16 @@ const FIXTURE_EXEMPTIONS = [
213213
* follow in the owning lane, which is the same order `check-cli-test-child-env` shipped in
214214
* and for the same reason: sweeping without the gate restates a convention instead of
215215
* enforcing it.
216+
*
217+
* EMPTY, and that is the design working rather than a list nobody kept. The gate shipped
218+
* with exactly one entry -- the `objectstack publish` refusal message in
219+
* `packages/spec/src/api/endpoint.zod.ts` (#12223) -- and it retired ITSELF: fixing the
220+
* string to `os package publish` made the entry stop reproducing, the `stale` check below
221+
* RED, and deleting it the only way back to green. A baseline here cannot outlive its
222+
* defect, so this list stays a record of work in flight and never becomes a silent
223+
* exemption. Add to it only under the rule above: a real defect, filed and linked.
216224
*/
217-
const BASELINED_VIOLATIONS = [
218-
{
219-
file: 'packages/spec/src/api/endpoint.zod.ts',
220-
text: 'objectstack publish',
221-
why: 'STALE. `os publish` was retired with the direct-to-environment path (#11465 measured '
222-
+ 'it against the built oclif Config: the registered publish ids are `package publish` and '
223-
+ '`plugin publish`). This is a present-tense AUTHOR-FACING refusal message -- "publication '
224-
+ 'state is managed by `objectstack publish`" -- so an author who trips it is sent to a '
225-
+ 'command that does not exist. Correct spelling: `os package publish`.',
226-
issue: '#12223',
227-
},
228-
];
225+
const BASELINED_VIOLATIONS = [];
229226

230227
const isExempt = (file, text) =>
231228
FIXTURE_EXEMPTIONS.some((e) => e.file === file && e.text === text)

0 commit comments

Comments
 (0)