Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/entry-nameability-generalized-closure.md
Original file line numberDiff line numberDiff line change
@@ -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.
2 changes: 2 additions & 0 deletions packages/spec/api-surface/ai.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@
"FileContentSchema (const)",
"FileKnowledgeSource (type)",
"FileKnowledgeSourceSchema (const)",
"FilterCondition (type)",
"FunctionCall (type)",
"FunctionCallSchema (const)",
"HttpKnowledgeSource (type)",
Expand DownExpand Up@@ -138,6 +139,7 @@
"SolutionBlueprintSchema (const)",
"SolutionBlueprintStrict (type)",
"SolutionBlueprintStrictSchema (const)",
"StateNodeConfig (type)",
"StructuredOutputConfig (type)",
"StructuredOutputConfigParsed (type)",
"StructuredOutputConfigSchema (const)",
Expand Down
1 change: 1 addition & 0 deletions packages/spec/api-surface/kernel.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -441,6 +441,7 @@
"UninstallPackageRequestSchema (const)",
"UninstallPackageResponse (type)",
"UninstallPackageResponseSchema (const)",
"UnknownAuthoringKeyFinding (interface)",
"UpgradeImpactLevel (type)",
"UpgradeImpactLevelSchema (const)",
"UpgradePackageRequest (type)",
Expand Down
3 changes: 3 additions & 0 deletions packages/spec/api-surface/root.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)",
Expand DownExpand Up@@ -61,6 +62,7 @@
"F (const)",
"FIELD_KEY_GUIDANCE (const)",
"FilterCondition (type)",
"FormField (type)",
"FormFieldInput (type)",
"GUEST_POSITION (const)",
"LintableAuthoringCollection (interface)",
Expand All@@ -82,6 +84,7 @@
"MigrationHopResult (interface)",
"MigrationStep (interface)",
"MigrationTodo (interface)",
"NavigationItem (type)",
"NavigationItemInput (type)",
"NormalizeStackInputOptions (interface)",
"OBJECT_KEY_GUIDANCE (const)",
Expand Down
1 change: 1 addition & 0 deletions packages/spec/api-surface/ui.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,6 +148,7 @@
"FieldWidgetProps (type)",
"FieldWidgetPropsParsed (type)",
"FieldWidgetPropsSchema (const)",
"FilterCondition (type)",
"FormButtonConfig (type)",
"FormButtonConfigSchema (const)",
"FormField (type)",
Expand Down
33 changes: 6 additions & 27 deletions packages/spec/entry-nameability.baseline.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -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": {}
}
2 changes: 2 additions & 0 deletions packages/spec/export-origins/ai.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)",
Expand DownExpand Up@@ -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)",
Expand Down
1 change: 1 addition & 0 deletions packages/spec/export-origins/kernel.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)",
Expand Down
3 changes: 3 additions & 0 deletions packages/spec/export-origins/root.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)",
Expand DownExpand Up@@ -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)",
Expand All@@ -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)",
Expand Down
1 change: 1 addition & 0 deletions packages/spec/export-origins/ui.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)",
Expand Down
8 changes: 8 additions & 0 deletions packages/spec/src/ai/index.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -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';
10 changes: 10 additions & 0 deletions packages/spec/src/index.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
7 changes: 7 additions & 0 deletions packages/spec/src/kernel/index.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -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';
Expand Down
6 changes: 6 additions & 0 deletions packages/spec/src/ui/index.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -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';
Loading