Skip to content

Commit 90e7e6d

Browse files
huangyiireneclaude
andauthored
fix(spec): emit one api-surface row per declared kind, so deleting the value half of a dual declaration is breaking (#15919) (#16554)
* fix(spec): emit one api-surface row per declared kind TypeScript merges `export const X` and `export type X` into one symbol carrying both flags. `build-api-surface.ts` mapped that symbol through a first-match-wins `kindOf` that tested TypeAlias before Variable, so the shard recorded `X (type)` alone and the value half was never enumerated. Deleting `export const X` therefore left the shard byte-identical and `check:api-surface` green on a removed public value export. `kindsOf` now returns every kind the flags declare, and `buildSurface` emits one row per kind. The row grammar `Name (kind)` is unchanged; only completeness moves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno * chore(spec): regenerate api-surface with the const half of dual declarations Mechanical `gen:api-surface` output. +134 rows over 10 of 17 entry points, every one of them the previously-unenumerated `(const)` half of a name that also declares a type. Pure insertion: 0 rows removed, 0 modified, no reordering — the code-unit sort places `Name (const)` immediately before its existing `Name (type)`. Export total 5277 -> 5411; api-surface-signatures.json unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno * test(spec): pin the dual-kind rows and add the changeset api-surface-dual-kind-rows.pin.test.ts asserts the committed shards carry both halves of a dual-declared name, with negative controls so a generator that stamped every kind onto every name fails here too. check:api-surface cannot catch that regression on its own: it compares the generator against its own regenerated output. docs-import-surface's fixture now models the merged declaration as the two rows the generator really emits, and two new cases pin why two rows and not a combined kind: the extra row leaves both resolvers unmoved, while a combined kind throws and, after widening the parser, silently resolves to no type at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5e7ff5f commit 90e7e6d

15 files changed

Lines changed: 358 additions & 29 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
`api-surface/` now records the value half of a name declared as both a const and a type, so deleting it is a breaking change the gate reports.
6+
7+
TypeScript merges an `export const X` and an `export type X` into ONE symbol whose flags carry both. `build-api-surface.ts` mapped that symbol through a first-match-wins lookup that tested `TypeAlias` before `Variable`, so the shard recorded `X (type)` alone and the value half was never enumerated. Ablated: deleting `export const RestApiRouteRegistration` while keeping its type alias left all 17 shards byte-identical, the export total unmoved, and `check:api-surface` printing "public API surface + factory signatures unchanged" at exit 0 — on a removed public value export, which is the exact removal the ADR-0059 breadth gate exists to make loud. On the fixed generator the same deletion reports `- RestApiRouteRegistration (const)` as 1 breaking change and exits 1.
8+
9+
The generator now emits one row per DECLARED kind. The shipped `api-surface/` shards gain **134 rows across 10 of 17 entry points** — every one of them the previously-missing `(const)` half of a name that also declares a type — as a pure insertion: zero rows removed, zero modified, no reordering.
10+
11+
**Why `patch` and not `minor`, measured against what a consumer can observe.** No export was added, removed or renamed: `dist/` is byte-identical across this change, and the row grammar `Name (kind)` is untouched, so anything that parsed the artifact before parses it now. The 134 new rows describe exports that already existed — the record got more complete, no capability arrived. What changes is the accuracy of a shipped record and the strictness of this repo's own gate, which is a fix.
12+
13+
One consequence for the release seat, stated because it is not visible from the diff: `build-spec-changes.ts --previous-surface` is a release-time join, so a release crossing this change will list those 134 rows as `added` surface entries. They are not new API — they are the same exports, newly recorded.

packages/spec/api-surface/api.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"AiPendingActionStatusSchema (const)",
3131
"AiStreamChunk (type)",
3232
"AiStreamChunkSchema (const)",
33+
"AnalyticsEndpoint (const)",
3334
"AnalyticsEndpoint (type)",
3435
"AnalyticsMetadataResponse (type)",
3536
"AnalyticsMetadataResponseParsed (type)",
@@ -46,9 +47,11 @@
4647
"ApiChangelogEntry (type)",
4748
"ApiChangelogEntryParsed (type)",
4849
"ApiChangelogEntrySchema (const)",
50+
"ApiDocumentationConfig (const)",
4951
"ApiDocumentationConfig (type)",
5052
"ApiDocumentationConfigParsed (type)",
5153
"ApiDocumentationConfigSchema (const)",
54+
"ApiEndpoint (const)",
5255
"ApiEndpoint (type)",
5356
"ApiEndpointParsed (type)",
5457
"ApiEndpointSchema (const)",
@@ -59,6 +62,7 @@
5962
"ApiMappingSchema (const)",
6063
"ApiRoutes (type)",
6164
"ApiRoutesSchema (const)",
65+
"ApiTestCollection (const)",
6266
"ApiTestCollection (type)",
6367
"ApiTestCollectionParsed (type)",
6468
"ApiTestCollectionSchema (const)",
@@ -68,6 +72,7 @@
6872
"ApiTestingUiConfig (type)",
6973
"ApiTestingUiConfigParsed (type)",
7074
"ApiTestingUiConfigSchema (const)",
75+
"ApiTestingUiType (const)",
7176
"ApiTestingUiType (type)",
7277
"AppDefinitionResponse (type)",
7378
"AppDefinitionResponseParsed (type)",
@@ -87,6 +92,7 @@
8792
"AuthFeaturesConfig (type)",
8893
"AuthFeaturesConfigParsed (type)",
8994
"AuthFeaturesConfigSchema (const)",
95+
"AuthProvider (const)",
9096
"AuthProvider (type)",
9197
"AuthProviderInfo (type)",
9298
"AuthProviderInfoParsed (type)",
@@ -95,6 +101,7 @@
95101
"AutomationActionsResponseParsed (type)",
96102
"AutomationActionsResponseSchema (const)",
97103
"AutomationApiContracts (const)",
104+
"AutomationApiErrorCode (const)",
98105
"AutomationApiErrorCode (type)",
99106
"AutomationFlowPathParams (type)",
100107
"AutomationFlowPathParamsSchema (const)",
@@ -129,6 +136,7 @@
129136
"BatchOperationResult (type)",
130137
"BatchOperationResultParsed (type)",
131138
"BatchOperationResultSchema (const)",
139+
"BatchOperationType (const)",
132140
"BatchOperationType (type)",
133141
"BatchOptions (type)",
134142
"BatchOptionsParsed (type)",
@@ -143,6 +151,7 @@
143151
"BatchUpdateResponseSchema (const)",
144152
"BulkDataEvent (type)",
145153
"BulkDataEventSchema (const)",
154+
"BulkDataEventType (const)",
146155
"BulkDataEventType (type)",
147156
"BulkRequest (type)",
148157
"BulkRequestParsed (type)",
@@ -153,12 +162,14 @@
153162
"CHANNEL_SURFACE_SLOTS (const)",
154163
"CacheControl (type)",
155164
"CacheControlSchema (const)",
165+
"CacheDirective (const)",
156166
"CacheDirective (type)",
157167
"CacheInvalidationRequest (type)",
158168
"CacheInvalidationRequestParsed (type)",
159169
"CacheInvalidationRequestSchema (const)",
160170
"CacheInvalidationResponse (type)",
161171
"CacheInvalidationResponseSchema (const)",
172+
"CacheInvalidationTarget (const)",
162173
"CacheInvalidationTarget (type)",
163174
"CapabilityDescriptor (type)",
164175
"CapabilityDescriptorSchema (const)",
@@ -180,6 +191,7 @@
180191
"ConceptListResponse (type)",
181192
"ConceptListResponseParsed (type)",
182193
"ConceptListResponseSchema (const)",
194+
"ConflictResolutionStrategy (const)",
183195
"ConflictResolutionStrategy (type)",
184196
"CreateAiConversationRequest (type)",
185197
"CreateAiConversationRequestSchema (const)",
@@ -223,6 +235,7 @@
223235
"CrudEndpointsConfig (type)",
224236
"CrudEndpointsConfigParsed (type)",
225237
"CrudEndpointsConfigSchema (const)",
238+
"CrudOperation (const)",
226239
"CrudOperation (type)",
227240
"CursorMessage (type)",
228241
"CursorMessageSchema (const)",
@@ -239,11 +252,13 @@
239252
"DEFAULT_VERSIONING_CONFIG (const)",
240253
"DataEvent (type)",
241254
"DataEventSchema (const)",
255+
"DataEventType (const)",
242256
"DataEventType (type)",
243257
"DataLoaderConfig (type)",
244258
"DataLoaderConfigParsed (type)",
245259
"DataLoaderConfigSchema (const)",
246260
"DataProtocol (interface)",
261+
"DeduplicationStrategy (const)",
247262
"DeduplicationStrategy (type)",
248263
"DeleteDataRequest (type)",
249264
"DeleteDataRequestSchema (const)",
@@ -292,6 +307,7 @@
292307
"DispatcherConfig (type)",
293308
"DispatcherConfigParsed (type)",
294309
"DispatcherConfigSchema (const)",
310+
"DispatcherErrorCode (const)",
295311
"DispatcherErrorCode (type)",
296312
"DispatcherErrorResponse (type)",
297313
"DispatcherErrorResponseSchema (const)",
@@ -311,6 +327,7 @@
311327
"EditMessageSchema (const)",
312328
"EditOperation (type)",
313329
"EditOperationSchema (const)",
330+
"EditOperationType (const)",
314331
"EditOperationType (type)",
315332
"EmailPasswordConfigPublic (type)",
316333
"EmailPasswordConfigPublicSchema (const)",
@@ -327,7 +344,9 @@
327344
"EnhancedApiError (type)",
328345
"EnhancedApiErrorParsed (type)",
329346
"EnhancedApiErrorSchema (const)",
347+
"ErrorCategory (const)",
330348
"ErrorCategory (type)",
349+
"ErrorCode (const)",
331350
"ErrorCode (type)",
332351
"ErrorHandlingConfig (type)",
333352
"ErrorHandlingConfigParsed (type)",
@@ -345,13 +364,15 @@
345364
"EventSubscription (type)",
346365
"EventSubscriptionSchema (const)",
347366
"ExportApiContracts (const)",
367+
"ExportFormat (const)",
348368
"ExportFormat (type)",
349369
"ExportImportTemplate (type)",
350370
"ExportImportTemplateParsed (type)",
351371
"ExportImportTemplateSchema (const)",
352372
"ExportJobProgress (type)",
353373
"ExportJobProgressParsed (type)",
354374
"ExportJobProgressSchema (const)",
375+
"ExportJobStatus (const)",
355376
"ExportJobStatus (type)",
356377
"ExportJobSummary (type)",
357378
"ExportJobSummarySchema (const)",
@@ -361,6 +382,7 @@
361382
"FIELD_SORTABLE_UNPROVISIONED_ANCHOR (const)",
362383
"FIELD_UNSORTABLE_VIRTUAL_TYPE (const)",
363384
"FieldError (type)",
385+
"FieldErrorCode (const)",
364386
"FieldErrorCode (type)",
365387
"FieldErrorSchema (const)",
366388
"FieldMappingEntry (type)",
@@ -499,6 +521,7 @@
499521
"HistoryMetaItemResponse (type)",
500522
"HistoryMetaItemResponseSchema (const)",
501523
"HttpFindQueryParamsSchema (const)",
524+
"HttpMethod (const)",
502525
"HttpMethod (type)",
503526
"HttpStatusErrorCodeMap (const)",
504527
"I18nProtocol (interface)",
@@ -510,6 +533,7 @@
510533
"ImportJobProgressSchema (const)",
511534
"ImportJobResults (type)",
512535
"ImportJobResultsSchema (const)",
536+
"ImportJobStatus (const)",
513537
"ImportJobStatus (type)",
514538
"ImportJobSummary (type)",
515539
"ImportJobSummarySchema (const)",
@@ -526,10 +550,12 @@
526550
"ImportValidationConfig (type)",
527551
"ImportValidationConfigParsed (type)",
528552
"ImportValidationConfigSchema (const)",
553+
"ImportValidationMode (const)",
529554
"ImportValidationMode (type)",
530555
"ImportValidationResult (type)",
531556
"ImportValidationResultParsed (type)",
532557
"ImportValidationResultSchema (const)",
558+
"ImportWriteMode (const)",
533559
"ImportWriteMode (type)",
534560
"InitiateChunkedUploadRequest (type)",
535561
"InitiateChunkedUploadRequestParsed (type)",
@@ -601,6 +627,7 @@
601627
"LoginRequest (type)",
602628
"LoginRequestParsed (type)",
603629
"LoginRequestSchema (const)",
630+
"LoginType (const)",
604631
"LoginType (type)",
605632
"MarkAllNotificationsReadRequest (type)",
606633
"MarkAllNotificationsReadRequestSchema (const)",
@@ -639,6 +666,7 @@
639666
"MetadataEvent (type)",
640667
"MetadataEventSchema (const)",
641668
"MetadataEventSubject (type)",
669+
"MetadataEventType (const)",
642670
"MetadataEventType (type)",
643671
"MetadataExistsResponse (type)",
644672
"MetadataExistsResponseParsed (type)",
@@ -718,13 +746,15 @@
718746
"OpenApiSecuritySchemeSchema (const)",
719747
"OpenApiServer (type)",
720748
"OpenApiServerSchema (const)",
749+
"OpenApiSpec (const)",
721750
"OpenApiSpec (type)",
722751
"OpenApiSpecParsed (type)",
723752
"OpenApiSpecSchema (const)",
724753
"OperatorMapping (type)",
725754
"OperatorMappingSchema (const)",
726755
"PROVENANCE_WAIVERS (const)",
727756
"PackageApiContracts (const)",
757+
"PackageApiErrorCode (const)",
728758
"PackageApiErrorCode (type)",
729759
"PackageExportManifest (type)",
730760
"PackageExportManifestParsed (type)",
@@ -759,6 +789,7 @@
759789
"PresenceMessageSchema (const)",
760790
"PresenceState (type)",
761791
"PresenceStateSchema (const)",
792+
"PresenceStatus (const)",
762793
"PresenceStatus (type)",
763794
"PresenceUpdate (type)",
764795
"PresenceUpdateSchema (const)",
@@ -798,10 +829,12 @@
798829
"RealtimeDisconnectResponseSchema (const)",
799830
"RealtimeEvent (type)",
800831
"RealtimeEventSchema (const)",
832+
"RealtimeEventType (const)",
801833
"RealtimeEventType (type)",
802834
"RealtimePresence (type)",
803835
"RealtimePresenceSchema (const)",
804836
"RealtimeProtocol (interface)",
837+
"RealtimeRecordAction (const)",
805838
"RealtimeRecordAction (type)",
806839
"RealtimeSubscribeRequest (type)",
807840
"RealtimeSubscribeRequestSchema (const)",
@@ -845,25 +878,31 @@
845878
"ResponseEnvelopeConfig (type)",
846879
"ResponseEnvelopeConfigParsed (type)",
847880
"ResponseEnvelopeConfigSchema (const)",
881+
"RestApiConfig (const)",
848882
"RestApiConfig (type)",
849883
"RestApiConfigParsed (type)",
850884
"RestApiConfigSchema (const)",
851885
"RestApiEndpoint (type)",
852886
"RestApiEndpointParsed (type)",
853887
"RestApiEndpointSchema (const)",
888+
"RestApiPluginConfig (const)",
854889
"RestApiPluginConfig (type)",
855890
"RestApiPluginConfigParsed (type)",
856891
"RestApiPluginConfigSchema (const)",
892+
"RestApiRouteCategory (const)",
857893
"RestApiRouteCategory (type)",
894+
"RestApiRouteRegistration (const)",
858895
"RestApiRouteRegistration (type)",
859896
"RestApiRouteRegistrationParsed (type)",
860897
"RestApiRouteRegistrationSchema (const)",
861898
"RestQueryAdapter (type)",
862899
"RestQueryAdapterParsed (type)",
863900
"RestQueryAdapterSchema (const)",
901+
"RestServerConfig (const)",
864902
"RestServerConfig (type)",
865903
"RestServerConfigParsed (type)",
866904
"RestServerConfigSchema (const)",
905+
"RetryStrategy (const)",
867906
"RetryStrategy (type)",
868907
"RevertPackageCommitResponse (type)",
869908
"RevertPackageCommitResponseParsed (type)",
@@ -874,6 +913,7 @@
874913
"RollbackToPackageCommitResponse (type)",
875914
"RollbackToPackageCommitResponseParsed (type)",
876915
"RollbackToPackageCommitResponseSchema (const)",
916+
"RouteCategory (const)",
877917
"RouteCategory (type)",
878918
"RouteDefinition (type)",
879919
"RouteDefinitionParsed (type)",
@@ -915,6 +955,7 @@
915955
"ServiceInfoSchema (const)",
916956
"ServiceSelfInfo (type)",
917957
"ServiceSelfInfoSchema (const)",
958+
"ServiceStatus (const)",
918959
"ServiceStatus (type)",
919960
"Session (type)",
920961
"SessionResponse (type)",
@@ -936,6 +977,7 @@
936977
"SingleRecordResponseParsed (type)",
937978
"SingleRecordResponseSchema (const)",
938979
"StandardApiContracts (const)",
980+
"StandardErrorCode (const)",
939981
"StandardErrorCode (type)",
940982
"StandardSynonymViolation (interface)",
941983
"StandardSynonymWaiver (type)",
@@ -952,6 +994,7 @@
952994
"ToggleFlowResponse (type)",
953995
"ToggleFlowResponseParsed (type)",
954996
"ToggleFlowResponseSchema (const)",
997+
"TransportProtocol (const)",
955998
"TransportProtocol (type)",
956999
"TriggerFlowRequest (type)",
9571000
"TriggerFlowRequestSchema (const)",
@@ -1031,15 +1074,18 @@
10311074
"ValidateDataRequestSchema (const)",
10321075
"ValidateDataResponse (type)",
10331076
"ValidateDataResponseSchema (const)",
1077+
"ValidationMode (const)",
10341078
"ValidationMode (type)",
10351079
"VersionDefinition (type)",
10361080
"VersionDefinitionSchema (const)",
10371081
"VersionNegotiationResponse (type)",
10381082
"VersionNegotiationResponseSchema (const)",
1083+
"VersionStatus (const)",
10391084
"VersionStatus (type)",
10401085
"VersioningConfig (type)",
10411086
"VersioningConfigParsed (type)",
10421087
"VersioningConfigSchema (const)",
1088+
"VersioningStrategy (const)",
10431089
"VersioningStrategy (type)",
10441090
"WELL_KNOWN_CAPABILITY_KEYS (const)",
10451091
"WebSocketConfig (type)",
@@ -1049,7 +1095,9 @@
10491095
"WebSocketEventSchema (const)",
10501096
"WebSocketMessage (type)",
10511097
"WebSocketMessageSchema (const)",
1098+
"WebSocketMessageType (const)",
10521099
"WebSocketMessageType (type)",
1100+
"WebSocketPresenceStatus (const)",
10531101
"WebSocketPresenceStatus (type)",
10541102
"WebSocketServerConfig (type)",
10551103
"WebSocketServerConfigParsed (type)",

packages/spec/api-surface/automation.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"ActionParadigmSchema (const)",
2222
"ActionRef (type)",
2323
"ActionRefSchema (const)",
24+
"ApprovalDecision (const)",
2425
"ApprovalDecision (type)",
2526
"ApprovalEscalation (type)",
2627
"ApprovalEscalationParsed (type)",
@@ -31,6 +32,7 @@
3132
"ApprovalNodeConfigParsed (type)",
3233
"ApprovalNodeConfigSchema (const)",
3334
"ApproverOrgSymbol (type)",
35+
"ApproverType (const)",
3436
"ApproverType (type)",
3537
"ApproverValueBinding (type)",
3638
"AssignmentConfig (type)",
@@ -93,10 +95,12 @@
9395
"ExecutionError (type)",
9496
"ExecutionErrorParsed (type)",
9597
"ExecutionErrorSchema (const)",
98+
"ExecutionErrorSeverity (const)",
9699
"ExecutionErrorSeverity (type)",
97100
"ExecutionLog (type)",
98101
"ExecutionLogParsed (type)",
99102
"ExecutionLogSchema (const)",
103+
"ExecutionStatus (const)",
100104
"ExecutionStatus (type)",
101105
"ExecutionStepLog (type)",
102106
"ExecutionStepLogParsed (type)",
@@ -127,6 +131,7 @@
127131
"FlowFunctionEntrySchema (const)",
128132
"FlowGraph (interface)",
129133
"FlowNode (type)",
134+
"FlowNodeAction (const)",
130135
"FlowNodeAction (type)",
131136
"FlowNodeExpressionPath (interface)",
132137
"FlowNodeExpressionRole (type)",
@@ -245,6 +250,7 @@
245250
"Webhook (type)",
246251
"WebhookParsed (type)",
247252
"WebhookSchema (const)",
253+
"WebhookTriggerType (const)",
248254
"WebhookTriggerType (type)",
249255
"analyzeRegion (function)",
250256
"approverTypeIsOrgScoped (function)",

0 commit comments

Comments
 (0)