Skip to content

Commit 82cc3c1

Browse files
committed
docs(changeset): declare the judgesPackageLessRows return-type change as Clause-② yes (narrowing)
The exported function's .d.ts return type moves from a type predicate to boolean, so a TypeScript caller narrowing through its true branch no longer compiles (review#3 contract record). Title gains `!`, a BREAKING paragraph names the remedy (isPackageScopedType first), and one ADR-0087 not-required marker. Level stays patch. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
1 parent 4bb529d commit 82cc3c1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎.changeset/32716-judges-package-less-rows-boolean.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
'@objectstack/metadata-protocol': patch
33
---
44

5-
fix(metadata-protocol): `judgesPackageLessRows` returns a plain `boolean`, not a type predicate
5+
fix(metadata-protocol)!: `judgesPackageLessRows` returns a plain `boolean`, not a type predicate
66

7-
Clause-②: no
7+
Clause-②: yes (narrowing) — the exported `judgesPackageLessRows`'s return type moves from the predicate `type is PackageScopedType` to `boolean`, so a TypeScript caller that narrowed `type` through its `true` branch no longer compiles. Its runtime answer is unchanged.
88
Metadata-protocol: none
99

10+
<!-- adr-0087: not-required (no-migration-prescription) no key of any schema is added, removed, renamed or re-shaped and no stored row changes shape: what moves is one exported function's TypeScript return type, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a TypeScript caller that narrows `type` to `PackageScopedType` through `judgesPackageLessRows(registry, type)` (for example `if (judgesPackageLessRows(r, t)) useScoped(t)`): it no longer compiles. Call `isPackageScopedType(type)` from `@objectstack/core` first, as `packageLessRowOwners` now does.
13+
1014
`judgesPackageLessRows(registry, type)` was declared `type is PackageScopedType`. Its `false` answer depends on the registry (`readsByPackage`), not on the type alone, so TypeScript narrowed a package-scoped type to `never` in a caller's `false` branch, although a package-scoped type the registry does not read by package (`hook`, for one) lands there. It now returns `boolean`. Its runtime answer is unchanged. To narrow a `string` to `PackageScopedType`, call `isPackageScopedType` from `@objectstack/core`, whose answer depends on the type alone.
1115

1216
No read moves. A stored package-less row of a sealed type (`action`, `queue`, `tool`) of a name a package ships, read at a holder's exact address (`?package=`), gets the holder's own item before and after the boot load (`loadMetaFromDb`), around the list read's hydrator, and with a copy in the registry's bare slot. This holds with one holder and with two. The boot load is now pinned beside the other hydration states.

0 commit comments

Comments
 (0)