Skip to content

Commit 93809a3

Browse files
os-warrenclaude
andauthored
spec: generate declaration-map/ — TS declaration names to spec registry names (docs-audit option D, spec half) (#13939)
* feat(spec): generate declaration-map/ — TS declaration name to spec registry name WIP: generator + artifact; wiring (scripts, check:generated row, merge-driver routing, pins, changeset) follows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2 * feat(spec): wire declaration-map into check:generated, merge driver, pins, changeset - package.json: gen:declaration-map / check:declaration-map (self-test + --check) - check-generated.ts: GATED row after its two input artifacts - .gitattributes + regen-artifacts.mjs: merge=os-regen routing - scripts/declaration-map.test.ts: pins ObjectSchemaBase→data/Object, DatasourceSchema→data/Datasource, non-empty floor, positive control, manifest cross-consistency - changeset (patch) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 949a751 commit 93809a3

21 files changed

Lines changed: 3854 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
New generated artifact `declaration-map/` (with `gen:declaration-map` / `check:declaration-map`, covered by `check:generated`): maps TS declaration names of authorable containers to their spec registry names — `ObjectSchemaBase` resolves to `data/Object`, `DatasourceSchema` to `data/Datasource` — composed from `json-schema.manifest/`, `export-origins/`, and a syntactic unwinding pass that recovers module-private base declarations. Repo-internal (not published to npm, like `export-origins/`); diff-side tooling reads it to decide whether a changed declaration is an authorable container.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ packages/spec/json-schema.manifest/** merge=os-regen
126126
packages/spec/api-surface/** merge=os-regen
127127
packages/spec/src/meta-spelling/meta-url-data.generated.ts merge=os-regen
128128
packages/spec/export-origins/** merge=os-regen
129+
packages/spec/declaration-map/** merge=os-regen
129130
packages/spec/api-surface-signatures.json merge=os-regen
130131
docs/protocol-upgrade-guide.md merge=os-regen
131132
docs/audits/2026-07-unknown-key-strictness-ledger.counts.md merge=os-regen
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"description": "TS declaration name → spec registry name (def key) for the schemas @objectstack/spec publishes: entries['ObjectSchemaBase'] === 'data/Object'. Composed from json-schema.manifest/ (the def keys), export-origins/ (which declaration each export resolves to), and a syntactic unwinding of wrapper initializers that recovers module-private base declarations (the ObjectSchemaBase case — see scripts/build-declaration-map.ts). A name that maps to two different def keys is DROPPED into `collisions` rather than guessed, so a lookup miss means \"not known to be an authorable container\". Consumers hold a changed line’s enclosing declaration name and ask which authorable container it declares (docs-audit anchor qualification is the funding one). Generated — never hand-edited; regenerate with `pnpm --filter @objectstack/spec gen:declaration-map` and read the diff.",
3+
"category": "ai",
4+
"entries": {
5+
"AIModelConfigSchema": "ai/AIModelConfig",
6+
"AIUsageRecord": "ai/AIUsageRecord",
7+
"AIUsageRecordSchema": "ai/AIUsageRecord",
8+
"Agent": "ai/Agent",
9+
"AgentSchema": "ai/Agent",
10+
"BlueprintApp": "ai/BlueprintApp",
11+
"BlueprintAppSchema": "ai/BlueprintApp",
12+
"BlueprintCondition": "ai/BlueprintCondition",
13+
"BlueprintConditionSchema": "ai/BlueprintCondition",
14+
"BlueprintDashboard": "ai/BlueprintDashboard",
15+
"BlueprintDashboardSchema": "ai/BlueprintDashboard",
16+
"BlueprintField": "ai/BlueprintField",
17+
"BlueprintFieldSchema": "ai/BlueprintField",
18+
"BlueprintNavItem": "ai/BlueprintNavItem",
19+
"BlueprintNavItemSchema": "ai/BlueprintNavItem",
20+
"BlueprintObject": "ai/BlueprintObject",
21+
"BlueprintObjectSchema": "ai/BlueprintObject",
22+
"BlueprintSeed": "ai/BlueprintSeed",
23+
"BlueprintSeedSchema": "ai/BlueprintSeed",
24+
"BlueprintSummaryOperations": "ai/BlueprintSummaryOperations",
25+
"BlueprintSummaryOperationsSchema": "ai/BlueprintSummaryOperations",
26+
"BlueprintView": "ai/BlueprintView",
27+
"BlueprintViewSchema": "ai/BlueprintView",
28+
"BlueprintWidgetCondition": "ai/BlueprintWidgetCondition",
29+
"BlueprintWidgetConditionSchema": "ai/BlueprintWidgetCondition",
30+
"CodeContentSchema": "ai/CodeContent",
31+
"ConversationAnalytics": "ai/ConversationAnalytics",
32+
"ConversationAnalyticsSchema": "ai/ConversationAnalytics",
33+
"ConversationContext": "ai/ConversationContext",
34+
"ConversationContextSchema": "ai/ConversationContext",
35+
"ConversationMessage": "ai/ConversationMessage",
36+
"ConversationMessageSchema": "ai/ConversationMessage",
37+
"ConversationSession": "ai/ConversationSession",
38+
"ConversationSessionSchema": "ai/ConversationSession",
39+
"ConversationSummary": "ai/ConversationSummary",
40+
"ConversationSummarySchema": "ai/ConversationSummary",
41+
"EmbeddingModel": "ai/EmbeddingModel",
42+
"EmbeddingModelSchema": "ai/EmbeddingModel",
43+
"FileContent": "ai/FileContent",
44+
"FileContentSchema": "ai/FileContent",
45+
"FileKnowledgeSource": "ai/FileKnowledgeSource",
46+
"FileKnowledgeSourceSchema": "ai/FileKnowledgeSource",
47+
"FunctionCall": "ai/FunctionCall",
48+
"FunctionCallSchema": "ai/FunctionCall",
49+
"HttpKnowledgeSource": "ai/HttpKnowledgeSource",
50+
"HttpKnowledgeSourceSchema": "ai/HttpKnowledgeSource",
51+
"ImageContentSchema": "ai/ImageContent",
52+
"KnowledgeChunk": "ai/KnowledgeChunk",
53+
"KnowledgeChunkSchema": "ai/KnowledgeChunk",
54+
"KnowledgeDocument": "ai/KnowledgeDocument",
55+
"KnowledgeDocumentSchema": "ai/KnowledgeDocument",
56+
"KnowledgeHit": "ai/KnowledgeHit",
57+
"KnowledgeHitSchema": "ai/KnowledgeHit",
58+
"KnowledgeRefreshPolicy": "ai/KnowledgeRefreshPolicy",
59+
"KnowledgeRefreshPolicySchema": "ai/KnowledgeRefreshPolicy",
60+
"KnowledgeSource": "ai/KnowledgeSource",
61+
"KnowledgeSourceKind": "ai/KnowledgeSourceKind",
62+
"KnowledgeSourceKindSchema": "ai/KnowledgeSourceKind",
63+
"KnowledgeSourceSchema": "ai/KnowledgeSource",
64+
"MCPApprovalPolicy": "ai/MCPApprovalPolicy",
65+
"MCPApprovalPolicySchema": "ai/MCPApprovalPolicy",
66+
"MCPServerRef": "ai/MCPServerRef",
67+
"MCPServerRefSchema": "ai/MCPServerRef",
68+
"MCPToolBinding": "ai/MCPToolBinding",
69+
"MCPToolBindingSchema": "ai/MCPToolBinding",
70+
"MCPTransport": "ai/MCPTransport",
71+
"MCPTransportSchema": "ai/MCPTransport",
72+
"MessageContent": "ai/MessageContent",
73+
"MessageContentSchema": "ai/MessageContent",
74+
"MessageContentType": "ai/MessageContentType",
75+
"MessageContentTypeSchema": "ai/MessageContentType",
76+
"MessagePruningEvent": "ai/MessagePruningEvent",
77+
"MessagePruningEventSchema": "ai/MessagePruningEvent",
78+
"MessageRole": "ai/MessageRole",
79+
"MessageRoleSchema": "ai/MessageRole",
80+
"ModelCapability": "ai/ModelCapability",
81+
"ModelCapabilitySchema": "ai/ModelCapability",
82+
"ModelConfig": "ai/ModelConfig",
83+
"ModelConfigSchema": "ai/ModelConfig",
84+
"ModelLimits": "ai/ModelLimits",
85+
"ModelLimitsSchema": "ai/ModelLimits",
86+
"ModelPricing": "ai/ModelPricing",
87+
"ModelPricingSchema": "ai/ModelPricing",
88+
"ModelProvider": "ai/ModelProvider",
89+
"ModelProviderSchema": "ai/ModelProvider",
90+
"ModelRegistry": "ai/ModelRegistry",
91+
"ModelRegistryEntry": "ai/ModelRegistryEntry",
92+
"ModelRegistryEntrySchema": "ai/ModelRegistryEntry",
93+
"ModelRegistrySchema": "ai/ModelRegistry",
94+
"ModelSelectionCriteria": "ai/ModelSelectionCriteria",
95+
"ModelSelectionCriteriaSchema": "ai/ModelSelectionCriteria",
96+
"ObjectKnowledgeSource": "ai/ObjectKnowledgeSource",
97+
"ObjectKnowledgeSourceSchema": "ai/ObjectKnowledgeSource",
98+
"PromptTemplate": "ai/PromptTemplate",
99+
"PromptTemplateSchema": "ai/PromptTemplate",
100+
"PromptVariable": "ai/PromptVariable",
101+
"PromptVariableSchema": "ai/PromptVariable",
102+
"Skill": "ai/Skill",
103+
"SkillSchema": "ai/Skill",
104+
"SkillTriggerCondition": "ai/SkillTriggerCondition",
105+
"SkillTriggerConditionSchema": "ai/SkillTriggerCondition",
106+
"SolutionBlueprint": "ai/SolutionBlueprint",
107+
"SolutionBlueprintSchema": "ai/SolutionBlueprint",
108+
"SolutionBlueprintStrict": "ai/SolutionBlueprintStrict",
109+
"SolutionBlueprintStrictSchema": "ai/SolutionBlueprintStrict",
110+
"StructuredOutputConfig": "ai/StructuredOutputConfig",
111+
"StructuredOutputConfigSchema": "ai/StructuredOutputConfig",
112+
"StructuredOutputFormat": "ai/StructuredOutputFormat",
113+
"StructuredOutputFormatSchema": "ai/StructuredOutputFormat",
114+
"TextContent": "ai/TextContent",
115+
"TextContentSchema": "ai/TextContent",
116+
"TokenBudgetConfig": "ai/TokenBudgetConfig",
117+
"TokenBudgetConfigSchema": "ai/TokenBudgetConfig",
118+
"TokenBudgetStrategy": "ai/TokenBudgetStrategy",
119+
"TokenBudgetStrategySchema": "ai/TokenBudgetStrategy",
120+
"TokenUsage": "ai/TokenUsage",
121+
"TokenUsageSchema": "ai/TokenUsage",
122+
"TokenUsageStats": "ai/TokenUsageStats",
123+
"TokenUsageStatsSchema": "ai/TokenUsageStats",
124+
"Tool": "ai/Tool",
125+
"ToolCall": "ai/ToolCall",
126+
"ToolCallSchema": "ai/ToolCall",
127+
"ToolSchema": "ai/Tool",
128+
"TransformPipelineStep": "ai/TransformPipelineStep",
129+
"TransformPipelineStepSchema": "ai/TransformPipelineStep",
130+
"VectorStore": "ai/VectorStore",
131+
"VectorStoreProvider": "ai/VectorStoreProvider",
132+
"VectorStoreProviderSchema": "ai/VectorStoreProvider",
133+
"VectorStoreSchema": "ai/VectorStore"
134+
},
135+
"collisions": []
136+
}

0 commit comments

Comments
 (0)