Skip to content

Commit 631dcbd

Browse files
docs(manifest-snippets): declare the elision in five defineStack manifest examples (#18838)
Fixes #18777 ## What changed Five `defineStack({ manifest: … })` documentation snippets carried an **incomplete manifest literal with no elision marker**, so a reader copying the block is refused at `ObjectStackDefinitionSchema`. Seven sibling snippets in the same corpora already declare their elision; these five were silent. This PR makes the elision explicit at all five, in a form that already exists in this tree. | site | manifest keys (unchanged by this PR) | elision marker: before / after | |---|---|---| | `content/docs/kernel/services-checklist.mdx` | `id`, `namespace` | none / present | | `content/docs/permissions/authorization.mdx` | `namespace` | none / present | | `content/docs/permissions/capabilities.mdx` | `name`, `namespace`, `version` | none / present | | `content/docs/permissions/record-view-auditing.mdx` | `name`, `version` | none / present | | `docs/design/marketplace-publishing.md` | `id`, `type`, `namespace`, `version` | none / present | The seven sites that already carry a marker are **not touched** — the card explicitly does not assert that they need anything. ## Which existing form, and why Re-measured over the seven sibling sites on `objectstack-ai/objectstack` @ `ad1f94e8e` (this branch's base). The dispatch's 3 / 3 / 1 count is **confirmed exactly**: | form | spelling | count | sites | |---|---|---|---| | A | inline, Unicode ellipsis — `manifest: { /* … */ },` | 3 | `protocol/kernel/http-protocol.mdx`, `data-modeling/object-extensions.mdx`, `data-modeling/import-mappings.mdx` | | B | inline, ASCII three dots — `manifest: { /* ... */ },` | 3 | `deployment/cli.mdx`, `plugins/index.mdx`, `packages/mcp/README.md` | | C | multi-line: real keys kept, elision comment on its own line | 1 | `packages/services/service-package/README.md` | **Form C is used at all five sites.** One reason, and it is the same at every site: Form C is the only one of the three that is **additive**. Forms A and B replace the literal's contents, which would delete the very keys each of these five snippets exists to demonstrate — `authorization.mdx` is teaching `namespace`, `capabilities.mdx` is teaching the `name`/`namespace`/`version` triple next to a capability declaration, `record-view-auditing.mdx` is teaching a stack that names itself while opting into the audit plugin, and `marketplace-publishing.md`'s prose one paragraph above says "Compose all internal plugins into a single `type: 'app'` package", which is the `type` key in that literal. A snippet that loses its subject to gain a marker is worse at its job. No fourth form was invented: the comment text is `/* …full ObjectStackManifest… */`, byte for byte the one Form C's site already uses. Proof the edit is purely additive — the post-change literal was extracted from each file by brace matching, evaluated as JS, and its key list read back: ```text content/docs/kernel/services-checklist.mdx keys after edit : ["id","namespace"] content/docs/permissions/authorization.mdx keys after edit : ["namespace"] content/docs/permissions/capabilities.mdx keys after edit : ["name","namespace","version"] content/docs/permissions/record-view-auditing.mdx keys after edit : ["name","version"] docs/design/marketplace-publishing.md keys after edit : ["id","type","namespace","version"] ``` Identical to the before-lists in the card's table. No key was added, removed or reworded. ## Premise re-taken at the real door Each literal driven through `ObjectStackDefinitionSchema` from the built `packages/spec/dist/index.mjs` (spec built at this branch's base): ```text REFUSED content/docs/kernel/services-checklist.mdx invalid_type[manifest,version] · invalid_value[manifest,type] · invalid_type[manifest,name] REFUSED content/docs/permissions/authorization.mdx invalid_type[manifest,id] · invalid_type[manifest,version] · invalid_value[manifest,type] · invalid_type[manifest,name] REFUSED content/docs/permissions/capabilities.mdx invalid_type[manifest,id] · invalid_value[manifest,type] REFUSED content/docs/permissions/record-view-auditing.mdx invalid_type[manifest,id] · invalid_value[manifest,type] REFUSED docs/design/marketplace-publishing.md invalid_type[manifest,name] POSITIVE CONTROL (complete manifest): ACCEPTED ``` Row for row identical to the card's table, and the card's correction holds: the `/* … */` on the same line as the fifth site's manifest sits in **`plugins:`**, not in `manifest:`. ## Read this before reviewing: what this PR does NOT do **An elision marker is a comment. It does not make any of these five snippets parse.** The same door, driven against the post-change literals, returns the same refusal codes at all five sites. What changes is the snippet's *status*: a silent omission becomes a declared partial, which is the boundary #18776 drew when it judged `content/docs/api/metadata-api.mdx` "incomplete, not an error" because its elision was written down. That is the remedy the card's triage chose, of the two the card offered. If the intent was instead that a reader can copy any of these five blocks and have it run, that is the card's other arm — completing each manifest to `id` + `name` + `type` + `version` — and this PR is not it. Reviewer's call; the measurement above is the same either way. ## Corpus-wide closing measurement Every `manifest: {` literal in the prose corpora (`content/**`, `docs/**`, every `README.md`, `skills/**`, `examples/**`; CHANGELOGs excluded) was brace-matched, evaluated and driven at the same door — 44 literals across 1224 files. After this change: - 24 accepted at the door; - 13 refused **with** a declared elision — the 7 siblings, the 5 in this PR, and `content/docs/upgrading.mdx:156`, which declares its elision with a `// ...` line comment; - 2 refused **without** one, both in `.changeset/*.md` release-note prose, which is a fragment describing a diff rather than a copyable stack config and is consumed at release. So the class this card names is empty on the published docs surface after this PR. That `// ...` line-comment spelling at `upgrading.mdx:156` is a **fourth** elision spelling in the corpus; it is reported, not changed — the site is a manifest fragment, not a `defineStack` call, and the card asserts nothing about already-declared partials. ## Verification `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derives **43 commands** from this change set (5 paths, merge base `ad1f94e8e`). All 43 were run: - **39 exit 0.** - **4 refused on an unmet prerequisite, then re-run green after building what they named** (`check:doc-formula-expressions`, `check:doc-security-posture`, `check:docs-transcript-drift`, `check:skill-examples`). `pnpm lint` is not implicated, and this is a measurement rather than a skipped step: eslint's own population, read from `eslint.config.mjs`, is `**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}` and narrower subsets of it — the string `mdx` does not occur in that file, and no block names `.md`. Running eslint over the five changed files with `--format json` returns 5 results, every one of them `File ignored because no matching configuration was supplied`, 0 errors, 0 warnings other than that notice, exit 0. Type-aware linting is not enabled for this diff's file kinds, so no untouched file's verdict can move. ## Changeset `skip-changeset`: nothing published moves. All five edited paths sit at the repository root (`content/docs/**`, `docs/design/**`), outside every workspace package directory, and the root package is `private: true` — an npm tarball can only contain files under its own package directory, so no `files[]` entry in this repo can reach them. Positive control, same method: `packages/services/service-package/README.md` (the untouched Form C sibling, the same kind of prose) **does** ship, as a README of a published package, and `packages/spec/src/kernel/manifest.zod.ts` ships too — `npm pack --dry-run` in `packages/spec` lists `44.3kB src/kernel/manifest.zod.ts` in the tarball contents. ## Acceptance notes Findings noted while working, none filed: - The corpus carries **two inline spellings of the same inline elision** — three sites with the Unicode ellipsis `/* … */` and three with the ASCII `/* ... */` — plus the multi-line Form C and the `// ...` line comment at `upgrading.mdx:156`. Four spellings of one idea. Noted, not filed: this is a consistency observation, not a reproducible defect, and the card explicitly does not assert that already-declared partials need anything. - `packages/services/service-package/README.md`'s own manifest literal (Form C's site) is refused at the door too — `invalid_value[manifest,type]`. Noted, not filed: it is a declared partial, which is precisely the disposition this card adopts. --- _Generated by [Claude Code](https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 939f3ea commit 631dcbd

5 files changed

Lines changed: 27 additions & 5 deletions

File tree

‎content/docs/kernel/services-checklist.mdx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,11 @@ When an app bundle includes an `i18n` config and `translations` array, `AppPlugi
470470

471471
```typescript
472472
export default defineStack({
473-
manifest: { id: 'com.example.crm', namespace: 'crm' },
473+
manifest: {
474+
id: 'com.example.crm',
475+
namespace: 'crm',
476+
/* …full ObjectStackManifest… */
477+
},
474478
i18n: { defaultLocale: 'en', supportedLocales: ['en', 'zh-CN'], fallbackLocale: 'en' },
475479
translations: [CrmTranslations], // TranslationBundle[]
476480
});

‎content/docs/permissions/authorization.mdx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ export const ExportDataCapability = defineCapability({
173173
});
174174

175175
export default defineStack({
176-
manifest: { namespace: 'billing' },
176+
manifest: {
177+
namespace: 'billing',
178+
/* …full ObjectStackManifest… */
179+
},
177180
capabilities: [ExportDataCapability], // ← DEFINE
178181
permissions: [{ name: 'billing_admin', systemPermissions: ['export_data'] }], // ← GRANT
179182
// a resource REQUIRES it: requiredPermissions: ['export_data']

‎content/docs/permissions/capabilities.mdx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ import { defineStack } from '@objectstack/spec';
100100
import { ExportDataCapability } from './capabilities/export-data.capability';
101101

102102
export default defineStack({
103-
manifest: { name: 'billing', namespace: 'billing', version: '1.0.0' },
103+
manifest: {
104+
name: 'billing',
105+
namespace: 'billing',
106+
version: '1.0.0',
107+
/* …full ObjectStackManifest… */
108+
},
104109
capabilities: [ExportDataCapability], // ← ① DEFINE
105110
permissions: [
106111
{ name: 'billing_admin', systemPermissions: ['export_data'] }, // ← ④ GRANT

‎content/docs/permissions/record-view-auditing.mdx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ import { defineStack } from '@objectstack/spec';
8383
import { AuditPlugin } from '@objectstack/plugin-audit';
8484

8585
export default defineStack({
86-
manifest: { name: 'my-app', version: '1.0.0' },
86+
manifest: {
87+
name: 'my-app',
88+
version: '1.0.0',
89+
/* …full ObjectStackManifest… */
90+
},
8791
plugins: [
8892
new AuditPlugin({ readAudit: { objects: ['contact', 'account'] } }),
8993
],

‎docs/design/marketplace-publishing.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,13 @@ set of namespaces its plugins use.
395395
```typescript
396396
// objectstack.config.ts
397397
export default defineStack({
398-
manifest: { id: 'com.hotcrm', type: 'app', namespace: 'hotcrm', version: '2.0.0' },
398+
manifest: {
399+
id: 'com.hotcrm',
400+
type: 'app',
401+
namespace: 'hotcrm',
402+
version: '2.0.0',
403+
/* …full ObjectStackManifest… */
404+
},
399405
plugins: [crmPlugin, financePlugin, marketingPlugin, /* … */], // invisible internals
400406
apps: [hotcrmApp], // exactly one consumer app surface (multiple tabs), not a suite
401407
});

0 commit comments

Comments
 (0)