Skip to content

Commit 7194153

Browse files
committed
fix(spec): a contributed nav item with no id is not an entry; pin the schema describe's not-yet-served
Contract-review should-fixes: a contributed separator may omit its id, so it has no value for the nav entry's required name and is not an entry; the nav arm's describe says so and a test pins it. The schema-level describe's "(not yet served)" is pinned beside the member pin, so the slice that serves the kind cannot leave it behind. Claude-Session: https://claude.ai/code/session_01ADHkmQ28WWiNo3u94yGTPb Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3bdb413 commit 7194153

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎content/docs/references/api/package-lifecycle.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ A field or flow another package contributes to one of the base's objects.
215215

216216
### Nested Shape: `GetPackageCustomizationsResponse.contributions[number][option 2]`
217217

218-
[PLANNED — not yet served] Declared ahead of its producer (ADR-0049): the read lists no `nav` entry yet. A navigation item another installed package contributes to an app the base owns, one entry per item of the contribution's `items` (a contributed group's children ride inside it and are not entries of their own), read from the same contribution registry the served app's navigation fold reads (ADR-0029 D7). A disabled package's contributions are not listed, as the fold drops them.
218+
[PLANNED — not yet served] Declared ahead of its producer (ADR-0049): the read lists no `nav` entry yet. A navigation item another installed package contributes to an app the base owns, one entry per item of the contribution's `items` (a contributed group's children ride inside it and are not entries of their own), read from the same contribution registry the served app's navigation fold reads (ADR-0029 D7). An item that declares no `id` (a separator may omit it) has no `name` to give and is not an entry. A disabled package's contributions are not listed, as the fold drops them.
219219

220220
| Property | Type | Required | Description |
221221
| :--- | :--- | :--- | :--- |

‎packages/spec/src/api/package-lifecycle.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,14 @@ describe('the `nav` kind of `contributions` is declared ahead of its producer (A
417417
expect(objectArm.description).not.toMatch(/PLANNED/);
418418
expect(member.description).not.toMatch(/#\d{3,}/);
419419
});
420+
421+
it('the schema-level describe says the navigation items are not yet served, so serving them drops that too', () => {
422+
expect(GetPackageCustomizationsResponseSchema.description).toContain('not yet served');
423+
});
424+
425+
it('the nav arm says an item with no id (a separator may omit it) is not an entry: `name` is required', () => {
426+
expect(navArm.description).toContain('An item that declares no `id` (a separator may omit it) has no `name` to give and is not an entry.');
427+
const { name: _dropped, ...noName } = { kind: 'nav', app: 'crm', name: 'nav_sep', packageId: 'com.example.acme-sync' };
428+
expect(GetPackageCustomizationsResponseSchema.shape.contributions.element.safeParse(noName).success).toBe(false);
429+
});
420430
});

‎packages/spec/src/api/package-lifecycle.zod.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ export const GetPackageCustomizationsResponseSchema = lazySchema(() => z.object(
460460
+ 'A navigation item another installed package contributes to an app the base owns, one entry per item of '
461461
+ 'the contribution\'s `items` (a contributed group\'s children ride inside it and are not entries of their '
462462
+ 'own), read from the same contribution registry the served app\'s navigation fold reads (ADR-0029 D7). '
463+
+ 'An item that declares no `id` (a separator may omit it) has no `name` to give and is not an entry. '
463464
+ 'A disabled package\'s contributions are not listed, as the fold drops them.',
464465
),
465466
])).describe(

0 commit comments

Comments
 (0)