Skip to content

Commit 3789cc3

Browse files
committed
chore(changeset): declare the install answer correction as a non-protocol narrowing at patch
The schema now refuses the { package } wrapper it accepted and the PackageInstallResponse type loses four members, so the Clause-2 line carries the narrowing arm. An API answer shape is nothing a metadata author writes, so the kind is none and the level patch. The ADR-0087 disposition is not-required (no-migration-prescription), with D8 named. Claude-Session: https://claude.ai/code/session_01L6bhgVugtCCwBs98FeR27P Co-authored-by: Claude <noreply@anthropic.com>
1 parent a12be68 commit 3789cc3

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
---
2-
'@objectstack/spec': minor
2+
'@objectstack/spec': patch
33
---
44

55
fix(spec): `PackageInstallResponseSchema` declares the installed row that `POST /api/v1/packages` really answers
66

7-
Clause-②: yes
8-
Metadata-protocol: semantic
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
99

1010
`POST /api/v1/packages` answers `{ success: true, data: <row> }` with status `201`, where the row is the `InstalledPackage` the registry recorded. `PackageInstallResponseSchema` (the output `PackageApiContracts.installPackage` binds) declared `data: { package, dependencyResolution?, namespaceConflicts?, message? }` instead. No surface sent that wrapper, so code written against the contract read `data.package` and got `undefined`. The first-party client already followed the wire: `client.packages.install` resolves to `InstalledPackage`.
1111

1212
- **FROM** `data: { package: InstalledPackage, dependencyResolution?, namespaceConflicts?, message? }` **TO** `data: InstalledPackage`. The name, the type names (`PackageInstallResponse`, `PackageInstallResponseParsed`) and the binding are unchanged. The server's answer is unchanged.
13-
- **Both directions.** The schema now accepts the bare row the door serves, which it refused, and refuses the `{ package }` wrapper no server sends.
13+
- **Both directions.** The schema now accepts the bare row the door serves, which it refused, and refuses the `{ package }` wrapper no server sends. The type `PackageInstallResponse['data']` loses `package`, `dependencyResolution`, `namespaceConflicts` and `message`, so TypeScript code that reads them stops compiling. That code read `undefined` at runtime already.
1414
- **Fix for a consumer:** read the row from `data` itself. Replace `response.data.package` with `response.data`. Drop any read of `data.dependencyResolution`, `data.namespaceConflicts` or `data.message` on this route: the door never sent them.
15+
- **Level.** `patch`: this is the shape of an API answer, not anything a metadata author writes.
16+
17+
<!-- adr-0087: not-required (no-migration-prescription) an API answer shape, not metadata: no stored row or authored source holds it, so objectstack migrate meta has nothing to rewrite. The consumer line above is for integrator source code, which the compiler now flags (ADR-0087 D8); type-surface-only is closed to it only because the schema lives in packages/spec -->

0 commit comments

Comments
 (0)