@@ -351,14 +351,29 @@ export const GetPackageCustomizationsRequestSchema = lazySchema(() => z.object({
351351 * the same read names what OTHER installed packages bring to X's surface, so
352352 * Studio can draw those items greyed with their source: `contributions`, one
353353 * entry per item, each stamped with the package that contributes it. What is
354- * listed is exactly two kinds: the fields another package's object extension
355- * adds to an object X owns, and the flows another package ships whose trigger
356- * object X owns. The stamp is on the item, so two packages adding a field of
357- * the same name are two entries and nothing is joined by name on the client.
358- * Neither X's own items nor its pair's are contributions: a pair item that
359- * overrides one of X's (a flow included) is in `overrides`, the pair's
360- * extension members are in `extensions`, and any other pair flow is in no
361- * list of this answer.
354+ * listed is exactly three kinds: the fields another package's object extension
355+ * adds to an object X owns, the flows another package ships whose trigger
356+ * object X owns, and the navigation items another package's
357+ * `navigationContributions` add to an app X owns. The entry shape is per kind:
358+ * a `field` or `flow` entry names the base-owned `object` it is on; a `nav`
359+ * entry names the base-owned `app` and, when the contribution targets one,
360+ * its `group`, and never an `object`. The stamp is on the item, so two
361+ * packages adding a field of the same name are two entries and nothing is
362+ * joined by name on the client. Neither X's own items nor its pair's are
363+ * contributions: a pair item that overrides one of X's (a flow included) is in
364+ * `overrides`, the pair's extension members are in `extensions`, and any other
365+ * pair flow is in no list of this answer.
366+ *
367+ * [#27928, ruling 6566915346 letter E] DECLARED AHEAD OF ITS PRODUCER
368+ * (ADR-0049): the `nav` kind is declared before the runtime serves it. Until
369+ * the server slice of #28722 (Wanted 3) reads the navigation-contribution
370+ * registry, this read lists no `nav` entry; the `nav` arm's describe opens
371+ * `[PLANNED — not yet served]`, and that slice drops the marker in the change
372+ * that serves the kind. When served, a `nav` entry MUST be read from the same
373+ * `appNavContributions` registry the served app's navigation fold reads
374+ * (ADR-0029 D7), never joined by name; a disabled package's contributions
375+ * MUST NOT be listed, as the fold drops them; and the served app's
376+ * `navigation` stays as declared: no nav item carries a contributor key.
362377 */
363378export const GetPackageCustomizationsResponseSchema = lazySchema ( ( ) => z . object ( {
364379 packageId : z . string ( ) . describe ( 'The base package the customizations are of (the request\'s id).' ) ,
@@ -403,23 +418,59 @@ export const GetPackageCustomizationsResponseSchema = lazySchema(() => z.object(
403418 'Every activation-ledger row (`sys_metadata_activation`) that records the base as its package and '
404419 + '`active: false`: the base\'s items this deployment switched off. Ordered by type and name.' ,
405420 ) ,
406- contributions : z . array ( z . object ( {
407- kind : z . enum ( [ 'field' , 'flow' ] ) . describe (
408- 'What is contributed: `field`, a field another package\'s object extension (`objectExtensions`) adds to '
409- + 'one of the base\'s objects; `flow`, a flow another package ships whose trigger object (its `start` '
410- + 'node\'s `config.objectName`) is one of the base\'s objects.' ,
411- ) ,
412- object : z . string ( ) . describe ( 'The base-owned object the item is on: the extended object, or the flow\'s trigger object.' ) ,
413- name : z . string ( ) . describe ( 'The item\'s name: the field name as the extension declares it, or the flow\'s name.' ) ,
414- packageId : z . string ( ) . describe (
415- 'The package that contributes the item: the extension\'s package, or the package the flow is registered '
416- + 'under. Never the base and never its `<base>.custom` pair.' ,
421+ // The entry shape is per kind (#27928, ruling 6566915346 letter E): a
422+ // `field` / `flow` entry is on an `object`, a `nav` entry on an `app`. The
423+ // `field` / `flow` arm accepts exactly what the member's one entry shape
424+ // accepted before the `nav` kind (the CONTROL pins in the test).
425+ contributions : z . array ( z . discriminatedUnion ( 'kind' , [
426+ z . object ( {
427+ kind : z . enum ( [ 'field' , 'flow' ] ) . describe (
428+ 'What is contributed: `field`, a field another package\'s object extension (`objectExtensions`) adds to '
429+ + 'one of the base\'s objects; `flow`, a flow another package ships whose trigger object (its `start` '
430+ + 'node\'s `config.objectName`) is one of the base\'s objects.' ,
431+ ) ,
432+ object : z . string ( ) . describe ( 'The base-owned object the item is on: the extended object, or the flow\'s trigger object.' ) ,
433+ name : z . string ( ) . describe ( 'The item\'s name: the field name as the extension declares it, or the flow\'s name.' ) ,
434+ packageId : z . string ( ) . describe (
435+ 'The package that contributes the item: the extension\'s package, or the package the flow is registered '
436+ + 'under. Never the base and never its `<base>.custom` pair.' ,
437+ ) ,
438+ } ) . strict ( ) . describe ( 'A field or flow another package contributes to one of the base\'s objects.' ) ,
439+ // Declared ahead of its producer: the server slice of #28722 (Wanted 3)
440+ // serves this arm and drops the `[PLANNED — not yet served]` marker in the
441+ // same change (the pin is in `package-lifecycle.test.ts`).
442+ z . object ( {
443+ kind : z . literal ( 'nav' ) . describe (
444+ 'What is contributed: `nav`, a navigation item another package\'s `navigationContributions` entry adds '
445+ + 'to the navigation of an app the base owns.' ,
446+ ) ,
447+ app : z . string ( ) . describe ( 'The base-owned app the item is contributed to: the contribution\'s `app`.' ) ,
448+ group : z . string ( ) . optional ( ) . describe (
449+ 'The group nav item the contribution targets: its `group`, as the contribution declares it. Absent when '
450+ + 'the contribution targets the app\'s top level. A group the app does not declare is still named here, '
451+ + 'though the served navigation appends those items at the app\'s top level.' ,
452+ ) ,
453+ name : z . string ( ) . describe ( 'The nav item\'s id, as the contribution\'s `items` declare it.' ) ,
454+ packageId : z . string ( ) . describe (
455+ 'The package that contributes the item: the package whose `navigationContributions` declares it. Never '
456+ + 'the base and never its `<base>.custom` pair.' ,
457+ ) ,
458+ } ) . strict ( ) . describe (
459+ '[PLANNED — not yet served] Declared ahead of its producer (ADR-0049): the read lists no `nav` entry yet. '
460+ + 'A navigation item another installed package contributes to an app the base owns, one entry per item of '
461+ + 'the contribution\'s `items` (a contributed group\'s children ride inside it and are not entries of their '
462+ + 'own), read from the same contribution registry the served app\'s navigation fold reads (ADR-0029 D7). '
463+ + 'A disabled package\'s contributions are not listed, as the fold drops them.' ,
417464 ) ,
418- } ) . strict ( ) ) . describe (
419- 'Every field and flow another installed package contributes to the base\'s objects, one entry per item and '
420- + 'contributing package: the fields of every object extension of an object the base owns, from any package '
421- + 'but the base and its pair, and every flow registered under such a package whose trigger object the base '
422- + 'owns (a flow of a disabled package is not served, so not listed). Ordered by object, kind, name and package.' ,
465+ ] ) ) . describe (
466+ 'Every field, flow and navigation item another installed package contributes to the base, one entry per '
467+ + 'item and contributing package: the fields of every object extension of an object the base owns, from any '
468+ + 'package but the base and its pair; every flow registered under such a package whose trigger object the '
469+ + 'base owns (a flow of a disabled package is not served, so not listed); and, declared ahead of its producer '
470+ + 'and not yet served, every navigation item such a package contributes to an app the base owns. The entry '
471+ + 'shape is per `kind`: `object` for `field` and `flow`, `app` and an optional `group` for `nav`. Ordered: '
472+ + 'the `field` and `flow` entries first, by object, kind, name and package; then the `nav` entries, by app, '
473+ + 'group (an entry with no group first), name and package.' ,
423474 ) ,
424475 counts : z . object ( {
425476 overrides : z . number ( ) . int ( ) . nonnegative ( ) . describe ( '`overrides.length`.' ) ,
@@ -429,7 +480,7 @@ export const GetPackageCustomizationsResponseSchema = lazySchema(() => z.object(
429480 } ) . strict ( ) . describe ( 'Each list\'s length, derived from the lists in this same answer.' ) ,
430481} ) . strict ( ) . describe (
431482 'Per-package customization read: overrides, extensions and switched-off items of one installed base, and the '
432- + 'fields and flows other packages contribute to it.' ,
483+ + 'fields, flows and (not yet served) navigation items other packages contribute to it.' ,
433484) ) ;
434485
435486/**
0 commit comments