diff --git a/.changeset/entry-nameability-generalized-closure.md b/.changeset/entry-nameability-generalized-closure.md new file mode 100644 index 0000000000..12b67f253f --- /dev/null +++ b/.changeset/entry-nameability-generalized-closure.md @@ -0,0 +1,5 @@ +--- +"@objectstack/spec": minor +--- + +Close the entry-nameability invariant on the four remaining public entries that leaked it (#12414). Generalizing #11350/#11709's `defineStack`-only probe to every public entry found the class was never fully closed: seven (entry, type) pairs across four entries still had a `define*` factory's return type expand to mention a type the entry itself did not re-export — `Book`, `FormField`, `NavigationItem` from the root `@objectstack/spec` entry, `UnknownAuthoringKeyFinding` from `@objectstack/spec/kernel`, `FilterCondition` and `StateNodeConfig` from `@objectstack/spec/ai`, and `FilterCondition` from `@objectstack/spec/ui`. Each is repaired the same way as the prior two rounds: one re-export line on the leaking entry, from the module that already declares the type as public on its own subpath. A consumer writing an un-annotated `export const x = defineBook(...)` (or the `/ui`, `/ai`, `/kernel` equivalent) previously hit TS2883 naming an unaddressable hash-named internal dist chunk and could not build; all seven now declaration-emit cleanly with no annotation required. No runtime change. `packages/spec/entry-nameability.baseline.json`, the shrink-only ledger `check:entry-nameability` (#11986) reads, is now empty — the class it was tracking is closed. diff --git a/packages/spec/api-surface/ai.json b/packages/spec/api-surface/ai.json index 80b47f6e6e..6a8122026f 100644 --- a/packages/spec/api-surface/ai.json +++ b/packages/spec/api-surface/ai.json @@ -51,6 +51,7 @@ "FileContentSchema (const)", "FileKnowledgeSource (type)", "FileKnowledgeSourceSchema (const)", + "FilterCondition (type)", "FunctionCall (type)", "FunctionCallSchema (const)", "HttpKnowledgeSource (type)", @@ -138,6 +139,7 @@ "SolutionBlueprintSchema (const)", "SolutionBlueprintStrict (type)", "SolutionBlueprintStrictSchema (const)", + "StateNodeConfig (type)", "StructuredOutputConfig (type)", "StructuredOutputConfigParsed (type)", "StructuredOutputConfigSchema (const)", diff --git a/packages/spec/api-surface/kernel.json b/packages/spec/api-surface/kernel.json index f4c61813bb..ca8f39685b 100644 --- a/packages/spec/api-surface/kernel.json +++ b/packages/spec/api-surface/kernel.json @@ -441,6 +441,7 @@ "UninstallPackageRequestSchema (const)", "UninstallPackageResponse (type)", "UninstallPackageResponseSchema (const)", + "UnknownAuthoringKeyFinding (interface)", "UpgradeImpactLevel (type)", "UpgradeImpactLevelSchema (const)", "UpgradePackageRequest (type)", diff --git a/packages/spec/api-surface/root.json b/packages/spec/api-surface/root.json index acce710909..501ca7cf70 100644 --- a/packages/spec/api-surface/root.json +++ b/packages/spec/api-surface/root.json @@ -23,6 +23,7 @@ "BUILTIN_MEMBERSHIP_ROLES (const)", "BUILTIN_MEMBERSHIP_ROLE_OPTIONS (const)", "BaseValidationRuleShape (interface)", + "Book (type)", "BuiltinIdentityName (type)", "BuiltinMembershipRole (type)", "CONVERSIONS_BY_MAJOR (const)", @@ -61,6 +62,7 @@ "F (const)", "FIELD_KEY_GUIDANCE (const)", "FilterCondition (type)", + "FormField (type)", "FormFieldInput (type)", "GUEST_POSITION (const)", "LintableAuthoringCollection (interface)", @@ -82,6 +84,7 @@ "MigrationHopResult (interface)", "MigrationStep (interface)", "MigrationTodo (interface)", + "NavigationItem (type)", "NavigationItemInput (type)", "NormalizeStackInputOptions (interface)", "OBJECT_KEY_GUIDANCE (const)", diff --git a/packages/spec/api-surface/ui.json b/packages/spec/api-surface/ui.json index 072c606a6b..a81ecdfc09 100644 --- a/packages/spec/api-surface/ui.json +++ b/packages/spec/api-surface/ui.json @@ -148,6 +148,7 @@ "FieldWidgetProps (type)", "FieldWidgetPropsParsed (type)", "FieldWidgetPropsSchema (const)", + "FilterCondition (type)", "FormButtonConfig (type)", "FormButtonConfigSchema (const)", "FormField (type)", diff --git a/packages/spec/entry-nameability.baseline.json b/packages/spec/entry-nameability.baseline.json index 00bde656a0..182c12922b 100644 --- a/packages/spec/entry-nameability.baseline.json +++ b/packages/spec/entry-nameability.baseline.json @@ -16,32 +16,11 @@ "instruction to delete the line: a ledger that keeps entries after they are repaired", "stops describing the tree and starts covering for it.", "", - "THE SHRINK PATH IS ONE LINE PER ROW. Each of these is repaired exactly the way", - "#11350 and #11709 were: re-export the named type, on the leaking entry, from the", - "module that declares it. They are NOT repaired here because doing so edits four", - "entry barrels and regenerates `api-surface/` — a different file surface and a", - "different gate family from this card's, and two of those barrels were claimed by", - "other in-flight work when this landed. They are filed for triage instead; see the", - "PR body for the measurement and the issue link.", - "", - "MEASURED ON: cdbd9204b65ae4ebec63f90f61669fb498efaa55 (2026-08-26)." + "#12414 repaired the seven (entry, type) pairs this ledger was carrying — one", + "re-export line per name, on the leaking entry, from the module that declares", + "it — and deleted them here per the shrink-only rule above. `entries` is empty", + "on purpose: the class #11986 measured is closed, and a name that leaks again", + "fails the gate rather than landing pre-accommodated." ], - "entries": { - "@objectstack/spec": { - "leaks": ["Book", "FormField", "NavigationItem"], - "why": "Root-entry factories whose return type expands to mention a `/system`, `/ui` type the root entry does not re-export. Same class and same repair as #11350's three names and #11709's two — A′ closed the `defineStack` instance only. Repair: re-export each from its declaring module in `src/index.ts`." - }, - "@objectstack/spec/kernel": { - "leaks": ["UnknownAuthoringKeyFinding"], - "why": "A `/kernel` export's call result mentions a finding type declared in an internal module and not re-exported from the `/kernel` entry. Repair: re-export it from `src/kernel/index.ts`." - }, - "@objectstack/spec/ai": { - "leaks": ["FilterCondition", "StateNodeConfig"], - "why": "`/ai` factory return types expand to mention a `/data` filter type and an `/automation` state-machine type; both are public on their own subpaths but not nameable from `/ai`. Repair: re-export both from `src/ai/index.ts`." - }, - "@objectstack/spec/ui": { - "leaks": ["FilterCondition"], - "why": "`/ui` factory return types expand to mention `/data`'s `FilterCondition`, which `/ui` does not re-export. Repair: re-export it from `src/ui/index.ts`." - } - } + "entries": {} } diff --git a/packages/spec/export-origins/ai.json b/packages/spec/export-origins/ai.json index e87553c3e9..13e696d5c3 100644 --- a/packages/spec/export-origins/ai.json +++ b/packages/spec/export-origins/ai.json @@ -51,6 +51,7 @@ "FileContentSchema": "src/ai/conversation.zod.ts#FileContentSchema (const)", "FileKnowledgeSource": "src/ai/knowledge-source.zod.ts#FileKnowledgeSource (type)", "FileKnowledgeSourceSchema": "src/ai/knowledge-source.zod.ts#FileKnowledgeSourceSchema (const)", + "FilterCondition": "src/data/filter.zod.ts#FilterCondition (type)", "FunctionCall": "src/ai/conversation.zod.ts#FunctionCall (type)", "FunctionCallSchema": "src/ai/conversation.zod.ts#FunctionCallSchema (const)", "HttpKnowledgeSource": "src/ai/knowledge-source.zod.ts#HttpKnowledgeSource (type)", @@ -138,6 +139,7 @@ "SolutionBlueprintSchema": "src/ai/solution-blueprint.zod.ts#SolutionBlueprintSchema (const)", "SolutionBlueprintStrict": "src/ai/solution-blueprint.zod.ts#SolutionBlueprintStrict (type)", "SolutionBlueprintStrictSchema": "src/ai/solution-blueprint.zod.ts#SolutionBlueprintStrictSchema (const)", + "StateNodeConfig": "src/automation/state-machine.zod.ts#StateNodeConfig (type)", "StructuredOutputConfig": "src/ai/agent.zod.ts#StructuredOutputConfig (type)", "StructuredOutputConfigParsed": "src/ai/agent.zod.ts#StructuredOutputConfigParsed (type)", "StructuredOutputConfigSchema": "src/ai/agent.zod.ts#StructuredOutputConfigSchema (const)", diff --git a/packages/spec/export-origins/kernel.json b/packages/spec/export-origins/kernel.json index 6347ed682a..4d5fb99470 100644 --- a/packages/spec/export-origins/kernel.json +++ b/packages/spec/export-origins/kernel.json @@ -441,6 +441,7 @@ "UninstallPackageRequestSchema": "src/kernel/package-registry.zod.ts#UninstallPackageRequestSchema (const)", "UninstallPackageResponse": "src/kernel/package-registry.zod.ts#UninstallPackageResponse (type)", "UninstallPackageResponseSchema": "src/kernel/package-registry.zod.ts#UninstallPackageResponseSchema (const)", + "UnknownAuthoringKeyFinding": "src/data/authoring-key-lint.ts#UnknownAuthoringKeyFinding (interface)", "UpgradeImpactLevel": "src/kernel/package-upgrade.zod.ts#UpgradeImpactLevel (type)", "UpgradeImpactLevelSchema": "src/kernel/package-upgrade.zod.ts#UpgradeImpactLevelSchema (const)", "UpgradePackageRequest": "src/kernel/package-upgrade.zod.ts#UpgradePackageRequest (type)", diff --git a/packages/spec/export-origins/root.json b/packages/spec/export-origins/root.json index 5a8916ac1d..a4f7c068aa 100644 --- a/packages/spec/export-origins/root.json +++ b/packages/spec/export-origins/root.json @@ -23,6 +23,7 @@ "BUILTIN_MEMBERSHIP_ROLES": "src/identity/membership-role.ts#BUILTIN_MEMBERSHIP_ROLES (const)", "BUILTIN_MEMBERSHIP_ROLE_OPTIONS": "src/identity/membership-role.ts#BUILTIN_MEMBERSHIP_ROLE_OPTIONS (const)", "BaseValidationRuleShape": "src/data/validation.zod.ts#BaseValidationRuleShape (interface)", + "Book": "src/system/book.zod.ts#Book (type)", "BuiltinIdentityName": "src/identity/eval-user.zod.ts#BuiltinIdentityName (type)", "BuiltinMembershipRole": "src/identity/membership-role.ts#BuiltinMembershipRole (type)", "CONVERSIONS_BY_MAJOR": "src/conversions/registry.ts#CONVERSIONS_BY_MAJOR (const)", @@ -61,6 +62,7 @@ "F": "src/shared/expression.zod.ts#F (const)", "FIELD_KEY_GUIDANCE": "src/data/authoring-key-lint.ts#FIELD_KEY_GUIDANCE (const)", "FilterCondition": "src/data/filter.zod.ts#FilterCondition (type)", + "FormField": "src/ui/view.zod.ts#FormField (type)", "FormFieldInput": "src/ui/view.zod.ts#FormFieldInput (type)", "GUEST_POSITION": "src/identity/position.zod.ts#GUEST_POSITION (const)", "LintableAuthoringCollection": "src/kernel/metadata-authoring-lint.ts#LintableAuthoringCollection (interface)", @@ -82,6 +84,7 @@ "MigrationHopResult": "src/migrations/types.ts#MigrationHopResult (interface)", "MigrationStep": "src/migrations/types.ts#MigrationStep (interface)", "MigrationTodo": "src/migrations/types.ts#MigrationTodo (interface)", + "NavigationItem": "src/ui/app.zod.ts#NavigationItem (type)", "NavigationItemInput": "src/ui/app.zod.ts#NavigationItemInput (type)", "NormalizeStackInputOptions": "src/shared/metadata-collection.zod.ts#NormalizeStackInputOptions (interface)", "OBJECT_KEY_GUIDANCE": "src/data/authoring-key-lint.ts#OBJECT_KEY_GUIDANCE (const)", diff --git a/packages/spec/export-origins/ui.json b/packages/spec/export-origins/ui.json index c57a6f5d81..30fd33aa29 100644 --- a/packages/spec/export-origins/ui.json +++ b/packages/spec/export-origins/ui.json @@ -148,6 +148,7 @@ "FieldWidgetProps": "src/ui/widget.zod.ts#FieldWidgetProps (type)", "FieldWidgetPropsParsed": "src/ui/widget.zod.ts#FieldWidgetPropsParsed (type)", "FieldWidgetPropsSchema": "src/ui/widget.zod.ts#FieldWidgetPropsSchema (const)", + "FilterCondition": "src/data/filter.zod.ts#FilterCondition (type)", "FormButtonConfig": "src/ui/view.zod.ts#FormButtonConfig (type)", "FormButtonConfigSchema": "src/ui/view.zod.ts#FormButtonConfigSchema (const)", "FormField": "src/ui/view.zod.ts#FormField (type)", diff --git a/packages/spec/src/ai/index.ts b/packages/spec/src/ai/index.ts index c0cbfc3da6..55a878bacd 100644 --- a/packages/spec/src/ai/index.ts +++ b/packages/spec/src/ai/index.ts @@ -35,3 +35,11 @@ export * from './mcp.zod'; export * from './knowledge-source.zod'; export * from './knowledge-document.zod'; export * from './solution-blueprint.zod'; + +// [#12414] entry-nameability: these factories' return types expand to mention +// `/data`'s `FilterCondition` and `/automation`'s `StateNodeConfig` — both +// public on their own subpaths but not nameable from `/ai`. Same invariant +// (maintainer ruling recorded on #11350), same repair: re-export from the +// declaring module. +export type { FilterCondition } from '../data/filter.zod'; +export type { StateNodeConfig } from '../automation/state-machine.zod'; diff --git a/packages/spec/src/index.ts b/packages/spec/src/index.ts index 4acfd285a6..e0e1f9565f 100644 --- a/packages/spec/src/index.ts +++ b/packages/spec/src/index.ts @@ -153,6 +153,16 @@ export type { StateNodeConfig } from './automation/state-machine.zod'; // declaring module (both already public on `/data`). export type { BaseValidationRuleShape } from './data/validation.zod'; export type { FilterCondition } from './data/filter.zod'; +// [#12414] The invariant generalized to every public entry, not just the root: +// probing every `define*` factory across all 17 subpaths found the class was +// never closed by #11350/#11709 — four more entries leak a structurally- +// mentioned type through a factory return value. Same invariant (maintainer +// ruling recorded on #11350), same one-line-per-name repair: re-export from +// the declaring module. All three are already public on their own subpaths +// (`/system`, `/ui`). +export type { Book } from './system/book.zod'; +export type { FormField } from './ui/view.zod'; +export type { NavigationItem } from './ui/app.zod'; // DX factories for the remaining authoring domains (issue #2035) — one type-safe // entry per writable domain, mirroring the 19 factories above. `defineX` is a diff --git a/packages/spec/src/kernel/index.ts b/packages/spec/src/kernel/index.ts index b9d5c1802e..851e248211 100644 --- a/packages/spec/src/kernel/index.ts +++ b/packages/spec/src/kernel/index.ts @@ -38,6 +38,13 @@ export * from './metadata-type-redaction'; // Pre-parse unknown-key walker over EVERY metadata collection (#3786). Lives // here, not in data/, because covering every type means importing every schema. export * from './metadata-authoring-lint'; +// [#12414] entry-nameability: `metadata-authoring-lint` IMPORTS (does not +// re-declare) `UnknownAuthoringKeyFinding` from `../data/authoring-key-lint`, +// so the `export *` above does not carry it — the finding type its lint +// functions return was unnameable from this entry. Same invariant (maintainer +// ruling recorded on #11350), same repair: re-export from the declaring +// module, which is already public on `/data`. +export type { UnknownAuthoringKeyFinding } from '../data/authoring-key-lint'; export * from './package-artifact.zod'; export * from './package-registry.zod'; export * from './package-upgrade.zod'; diff --git a/packages/spec/src/ui/index.ts b/packages/spec/src/ui/index.ts index be6415cf21..6546e4c47a 100644 --- a/packages/spec/src/ui/index.ts +++ b/packages/spec/src/ui/index.ts @@ -92,3 +92,9 @@ export * from './sharing.zod'; // memo may evaluate at a node's top level, plus the per-component carriage // map the objectui memo consumes instead of hard-coding a twin list. export * from './expression-bindable-text-keys.zod'; + +// [#12414] entry-nameability: factory return types expand to mention +// `/data`'s `FilterCondition`, which `/ui` does not re-export. Same invariant +// (maintainer ruling recorded on #11350), same repair: re-export from the +// declaring module. +export type { FilterCondition } from '../data/filter.zod';