Repository navigation
Commit f0a7a35
committed
docs(client): say what the either-stage union buys TODAY, and pin the type-level gap (#17536)
The at-tier contract review of PR #19323 FAILed this diff on its TEXT, not its
types: four passages asserted a stage discrimination and a closed shape the
published declaration measurably does not provide. The declarations stay exactly
as ruled; the prose around them is corrected, and the gap it used to hide is
pinned.
Measured at this head with `tsc` against the built spec, in a private worktree:
AssembledInstalledPackage['manifest'] Record<string, unknown>
(union).manifest.objects unknown
{ ...authoringRow, manifest: { bogus: 1, objects: 'not-even-an-array' } }
against the union AND against
Awaited<ReturnType<typeof client.packages.get>> compiles
`if (Array.isArray(pkg.manifest.objects))` same union in BOTH branches
manifest: 'com.acme.crm@1.0.0' (a string) refused by both branches
runtime control, built spec:
InstalledPackageAtEitherStageSchema.safeParse(bogusRow).success false
... .safeParse(rowWithNoObjects) against each stage schema both true
So: the runtime parse is strict, the TYPE is tolerant of any object manifest,
and `Array.isArray` separates the stages on neither level — at runtime both
stages' `objects` are arrays.
- changeset: drops the "not a tolerant shape" and "the compiler now says so"
claims; states the runtime/type asymmetry, names #19324 and its root cause
(`packages/spec/src/stack.zod.ts:1283`, #14513), and replaces the prescribed
discriminator with a worked `packages/spec` parse.
- `ObjectStackClient.packages.list` docblock: same correction, at the door a
consumer actually reads; `Array.isArray` is now the documented wrong answer.
- the import-site comment: the closedness belongs to the RUNTIME declaration.
- direction-2 test docblock: says what that pin measures — a string primitive —
and what it does not.
- new pin `objectToleranceGap19324`: the object tolerance recorded as the
behaviour it is, with no suppression, so tsc reds on it the day #19324 closes.
- the WRITE-member count was wrong in three places: four members stayed, not
three (`install`, `enable`, `disable`, `update`).
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCdUBjM47SxioST9z5Zwdf1 parent 39ba6e6 commit f0a7a35
3 files changed
Lines changed: 131 additions & 36 deletions
File tree
- .changeset
- packages/client/src
Lines changed: 23 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
20 | 40 | | |
21 | 41 | | |
22 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| |||
2477 | 2480 | | |
2478 | 2481 | | |
2479 | 2482 | | |
2480 | | - | |
2481 | | - | |
2482 | | - | |
2483 | | - | |
2484 | | - | |
2485 | | - | |
2486 | | - | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
2487 | 2523 | | |
2488 | 2524 | | |
2489 | 2525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
601 | 603 | | |
602 | 604 | | |
603 | 605 | | |
| |||
676 | 678 | | |
677 | 679 | | |
678 | 680 | | |
679 | | - | |
| 681 | + | |
680 | 682 | | |
681 | 683 | | |
682 | 684 | | |
683 | 685 | | |
684 | 686 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
690 | 703 | | |
691 | 704 | | |
692 | 705 | | |
| |||
727 | 740 | | |
728 | 741 | | |
729 | 742 | | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
736 | 750 | | |
737 | 751 | | |
738 | 752 | | |
739 | 753 | | |
740 | 754 | | |
741 | 755 | | |
742 | 756 | | |
743 | | - | |
| 757 | + | |
744 | 758 | | |
745 | 759 | | |
746 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
747 | 785 | | |
748 | 786 | | |
749 | 787 | | |
750 | 788 | | |
751 | 789 | | |
752 | 790 | | |
753 | 791 | | |
| 792 | + | |
754 | 793 | | |
755 | 794 | | |
756 | 795 | | |
| |||
0 commit comments