@elevasis/core 0.24.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/index.d.ts +239 -86
  2. package/dist/index.js +474 -1346
  3. package/dist/knowledge/index.d.ts +57 -39
  4. package/dist/knowledge/index.js +1 -1
  5. package/dist/organization-model/index.d.ts +239 -86
  6. package/dist/organization-model/index.js +474 -1346
  7. package/dist/test-utils/index.d.ts +24 -31
  8. package/dist/test-utils/index.js +76 -1238
  9. package/package.json +1 -1
  10. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +108 -96
  11. package/src/business/acquisition/api-schemas.test.ts +70 -77
  12. package/src/business/acquisition/api-schemas.ts +21 -42
  13. package/src/business/acquisition/derive-actions.test.ts +11 -21
  14. package/src/business/acquisition/derive-actions.ts +61 -14
  15. package/src/business/acquisition/ontology-validation.ts +4 -4
  16. package/src/business/acquisition/types.ts +7 -8
  17. package/src/execution/engine/llm/adapters/__tests__/openrouter.integration.test.ts +10 -10
  18. package/src/knowledge/__tests__/queries.test.ts +960 -546
  19. package/src/knowledge/format.ts +322 -100
  20. package/src/knowledge/index.ts +18 -5
  21. package/src/knowledge/queries.ts +1004 -240
  22. package/src/organization-model/__tests__/content-kinds-registry.test.ts +35 -210
  23. package/src/organization-model/__tests__/defaults.test.ts +4 -4
  24. package/src/organization-model/__tests__/deprecate-helpers.test.ts +71 -0
  25. package/src/organization-model/__tests__/domains/actions.test.ts +12 -36
  26. package/src/organization-model/__tests__/domains/offerings.test.ts +13 -6
  27. package/src/organization-model/__tests__/domains/resources.test.ts +497 -350
  28. package/src/organization-model/__tests__/domains/systems.test.ts +6 -7
  29. package/src/organization-model/__tests__/flatten-additive-merge.test.ts +68 -80
  30. package/src/organization-model/__tests__/foundation.test.ts +81 -14
  31. package/src/organization-model/__tests__/graph.test.ts +662 -694
  32. package/src/organization-model/__tests__/knowledge.test.ts +31 -17
  33. package/src/organization-model/__tests__/lookup-helpers.test.ts +128 -438
  34. package/src/organization-model/__tests__/migration-helpers.test.ts +362 -591
  35. package/src/organization-model/__tests__/prospecting-ssot.test.ts +68 -103
  36. package/src/organization-model/__tests__/published-zero-leak.test.ts +17 -0
  37. package/src/organization-model/__tests__/recursive-system-schema.test.ts +159 -532
  38. package/src/organization-model/__tests__/resolve.test.ts +88 -49
  39. package/src/organization-model/__tests__/scaffolders.test.ts +93 -0
  40. package/src/organization-model/__tests__/schema.test.ts +65 -56
  41. package/src/organization-model/catalogs/lead-gen.ts +0 -103
  42. package/src/organization-model/defaults.ts +17 -702
  43. package/src/organization-model/domains/actions.ts +116 -333
  44. package/src/organization-model/domains/knowledge.ts +15 -7
  45. package/src/organization-model/domains/projects.ts +4 -4
  46. package/src/organization-model/domains/prospecting.ts +405 -395
  47. package/src/organization-model/domains/resources.ts +206 -135
  48. package/src/organization-model/domains/sales.ts +5 -5
  49. package/src/organization-model/domains/systems.ts +8 -23
  50. package/src/organization-model/graph/build.ts +223 -294
  51. package/src/organization-model/graph/schema.ts +2 -3
  52. package/src/organization-model/graph/types.ts +12 -14
  53. package/src/organization-model/helpers.ts +120 -141
  54. package/src/organization-model/icons.ts +1 -0
  55. package/src/organization-model/index.ts +107 -126
  56. package/src/organization-model/migration-helpers.ts +211 -249
  57. package/src/organization-model/ontology.ts +0 -60
  58. package/src/organization-model/organization-graph.mdx +4 -5
  59. package/src/organization-model/organization-model.mdx +1 -1
  60. package/src/organization-model/published.ts +251 -228
  61. package/src/organization-model/resolve.ts +4 -5
  62. package/src/organization-model/scaffolders/helpers.ts +84 -0
  63. package/src/organization-model/scaffolders/index.ts +19 -0
  64. package/src/organization-model/scaffolders/scaffoldKnowledgeNode.ts +48 -0
  65. package/src/organization-model/scaffolders/scaffoldOntologyRecord.ts +38 -0
  66. package/src/organization-model/scaffolders/scaffoldResource.ts +59 -0
  67. package/src/organization-model/scaffolders/scaffoldSystem.ts +110 -0
  68. package/src/organization-model/scaffolders/types.ts +81 -0
  69. package/src/organization-model/schema.ts +610 -704
  70. package/src/organization-model/types.ts +167 -161
  71. package/src/platform/constants/versions.ts +1 -1
  72. package/src/platform/registry/__tests__/validation.test.ts +23 -0
  73. package/src/platform/registry/validation.ts +13 -2
  74. package/src/reference/_generated/contracts.md +108 -96
  75. package/src/reference/glossary.md +71 -69
  76. package/src/organization-model/content-kinds/config.ts +0 -36
  77. package/src/organization-model/content-kinds/index.ts +0 -78
  78. package/src/organization-model/content-kinds/pipeline.ts +0 -68
  79. package/src/organization-model/content-kinds/registry.ts +0 -44
  80. package/src/organization-model/content-kinds/status.ts +0 -71
  81. package/src/organization-model/content-kinds/template.ts +0 -83
  82. package/src/organization-model/content-kinds/types.ts +0 -117
@@ -1,57 +1,58 @@
1
- import type { z } from 'zod'
2
- import { OrganizationModelBrandingSchema } from './domains/branding'
3
- import { SalesPipelineSchema, SalesStageSchema } from './domains/sales'
4
- import { ProjectsDomainStateSchema } from './domains/projects'
5
- import { NodeIdPathSchema, NodeIdStringSchema } from './domains/systems'
6
- import { ProspectingBuildTemplateSchema, ProspectingLifecycleStageSchema } from './domains/prospecting'
7
- import {
8
- NavigationGroupSchema,
9
- OrganizationModelNavigationSchema,
10
- SidebarNavigationSchema,
11
- SidebarNodeSchema,
12
- SidebarSectionSchema,
13
- SidebarSurfaceTargetsSchema,
14
- SurfaceDefinitionSchema
15
- } from './domains/navigation'
16
- import { TechStackEntrySchema } from './domains/shared'
17
- import { StatusesDomainSchema, StatusEntrySchema, StatusSemanticClassSchema } from './domains/statuses'
18
- import { CustomersDomainSchema, CustomerSegmentSchema, FirmographicsSchema } from './domains/customers'
19
- import { OfferingsDomainSchema, ProductSchema, PricingModelSchema } from './domains/offerings'
20
- import {
21
- AgentRoleHolderSchema,
22
- HumanRoleHolderSchema,
23
- RoleHolderSchema,
24
- RoleIdSchema,
25
- RolesDomainSchema,
26
- RoleSchema,
27
- TeamRoleHolderSchema
28
- } from './domains/roles'
29
- import { GoalsDomainSchema, ObjectiveSchema, KeyResultSchema } from './domains/goals'
30
- import {
31
- KnowledgeDomainSchema,
32
- KnowledgeLinkSchema,
33
- KnowledgeTargetKindSchema,
34
- KnowledgeTargetRefSchema,
35
- OrgKnowledgeKindSchema,
36
- OrgKnowledgeNodeSchema
37
- } from './domains/knowledge'
38
- import {
1
+ import type { z } from 'zod'
2
+ import { OrganizationModelBrandingSchema } from './domains/branding'
3
+ import { SalesPipelineSchema, SalesStageSchema } from './domains/sales'
4
+ import { ProjectsDomainStateSchema } from './domains/projects'
5
+ import { NodeIdPathSchema, NodeIdStringSchema } from './domains/systems'
6
+ import { ProspectingBuildTemplateSchema, ProspectingLifecycleStageSchema } from './domains/prospecting'
7
+ import {
8
+ NavigationGroupSchema,
9
+ OrganizationModelNavigationSchema,
10
+ SidebarNavigationSchema,
11
+ SidebarNodeSchema,
12
+ SidebarSectionSchema,
13
+ SidebarSurfaceTargetsSchema,
14
+ SurfaceDefinitionSchema
15
+ } from './domains/navigation'
16
+ import { TechStackEntrySchema } from './domains/shared'
17
+ import { StatusesDomainSchema, StatusEntrySchema, StatusSemanticClassSchema } from './domains/statuses'
18
+ import { CustomersDomainSchema, CustomerSegmentSchema, FirmographicsSchema } from './domains/customers'
19
+ import { OfferingsDomainSchema, ProductSchema, PricingModelSchema } from './domains/offerings'
20
+ import {
21
+ AgentRoleHolderSchema,
22
+ HumanRoleHolderSchema,
23
+ RoleHolderSchema,
24
+ RoleIdSchema,
25
+ RolesDomainSchema,
26
+ RoleSchema,
27
+ TeamRoleHolderSchema
28
+ } from './domains/roles'
29
+ import { GoalsDomainSchema, ObjectiveSchema, KeyResultSchema } from './domains/goals'
30
+ import {
31
+ KnowledgeDomainSchema,
32
+ KnowledgeLinkSchema,
33
+ KnowledgeTargetKindSchema,
34
+ KnowledgeTargetRefSchema,
35
+ OrgKnowledgeKindSchema,
36
+ OrgKnowledgeNodeSchema
37
+ } from './domains/knowledge'
38
+ import {
39
39
  SystemEntrySchema,
40
40
  SystemConfigSchema,
41
41
  SystemIdSchema,
42
- SystemKindSchema,
43
- SystemLifecycleSchema,
44
- SystemPathSchema,
45
- SystemStatusSchema,
46
- SystemsDomainSchema
47
- } from './domains/systems'
48
- import {
49
- AgentKindSchema,
50
- AgentResourceEntrySchema,
51
- CodeReferenceRoleSchema,
52
- CodeReferenceSchema,
53
- EventDescriptorSchema,
54
- EventEmissionDescriptorSchema,
42
+ SystemKindSchema,
43
+ SystemLifecycleSchema,
44
+ SystemPathSchema,
45
+ SystemStatusSchema,
46
+ SystemsDomainSchema
47
+ } from './domains/systems'
48
+ import {
49
+ AgentKindSchema,
50
+ AgentResourceEntrySchema,
51
+ CodeReferenceRoleSchema,
52
+ CodeReferenceSchema,
53
+ ContractRefSchema,
54
+ EventDescriptorSchema,
55
+ EventEmissionDescriptorSchema,
55
56
  EventIdSchema,
56
57
  IntegrationResourceEntrySchema,
57
58
  ResourceEntrySchema,
@@ -63,7 +64,9 @@ import {
63
64
  ScriptResourceEntrySchema,
64
65
  ScriptResourceLanguageSchema,
65
66
  ScriptResourceSourceSchema,
66
- WorkflowResourceEntrySchema
67
+ WorkflowResourceEntrySchema,
68
+ type ParsedContractRef,
69
+ type ResourceOntologyBindingContract
67
70
  } from './domains/resources'
68
71
  import {
69
72
  OmTopologyDomainSchema,
@@ -73,75 +76,75 @@ import {
73
76
  OmTopologyRelationshipKindSchema,
74
77
  OmTopologyRelationshipSchema
75
78
  } from './domains/topology'
76
- import {
77
- ActionsDomainSchema,
78
- ActionIdSchema,
79
- ActionInvocationKindSchema,
80
- ActionInvocationSchema,
81
- ActionRefSchema,
82
- ActionSchema,
83
- ActionScopeSchema
84
- } from './domains/actions'
85
- import { EntitiesDomainSchema, EntityIdSchema, EntityLinkSchema, EntitySchema } from './domains/entities'
86
- import {
87
- PoliciesDomainSchema,
88
- PolicyEffectSchema,
89
- PolicyApplicabilitySchema,
90
- PolicyIdSchema,
91
- PolicyPredicateSchema,
92
- PolicySchema,
93
- PolicyTriggerSchema
94
- } from './domains/policies'
79
+ import {
80
+ ActionsDomainSchema,
81
+ ActionIdSchema,
82
+ ActionInvocationKindSchema,
83
+ ActionInvocationSchema,
84
+ ActionRefSchema,
85
+ ActionSchema,
86
+ ActionScopeSchema
87
+ } from './domains/actions'
88
+ import { EntitiesDomainSchema, EntityIdSchema, EntityLinkSchema, EntitySchema } from './domains/entities'
89
+ import {
90
+ PoliciesDomainSchema,
91
+ PolicyEffectSchema,
92
+ PolicyApplicabilitySchema,
93
+ PolicyIdSchema,
94
+ PolicyPredicateSchema,
95
+ PolicySchema,
96
+ PolicyTriggerSchema
97
+ } from './domains/policies'
95
98
  import { OrganizationModelIconTokenSchema, OrganizationModelBuiltinIconTokenSchema } from './icons'
96
99
  import { OntologyScopeSchema } from './ontology'
97
100
  import {
98
101
  OrganizationModelDomainKeySchema,
99
- OrganizationModelDomainMetadataByDomainSchema,
100
- OrganizationModelDomainMetadataSchema,
101
- OrganizationModelSchema
102
- } from './schema'
103
-
104
- export type OrganizationModel = z.infer<typeof OrganizationModelSchema>
105
- export type OrganizationModelDomainKey = z.infer<typeof OrganizationModelDomainKeySchema>
106
- export type OrganizationModelDomainMetadata = z.infer<typeof OrganizationModelDomainMetadataSchema>
107
- export type OrganizationModelDomainMetadataByDomain = z.infer<typeof OrganizationModelDomainMetadataByDomainSchema>
108
- export type OrganizationModelBranding = z.infer<typeof OrganizationModelBrandingSchema>
109
- // Phase 4: OrganizationModelSales, OrganizationModelProspecting, OrganizationModelProjects,
110
- // OrganizationModelNavigation removed — compound domain top-level fields deleted per D8/D1.
111
- // Retained as local aliases for content-kind payload shapes used in migration-helpers:
112
- export type SalesPipeline = z.infer<typeof SalesPipelineSchema>
113
- export type SalesStage = z.infer<typeof SalesStageSchema>
114
- export type ProspectingBuildTemplate = z.infer<typeof ProspectingBuildTemplateSchema>
115
- export type ProspectingLifecycleStage = z.infer<typeof ProspectingLifecycleStageSchema>
116
- export type ProjectsDomainState = z.infer<typeof ProjectsDomainStateSchema>
117
- export type NodeIdPath = z.infer<typeof NodeIdPathSchema>
118
- export type NodeIdString = z.infer<typeof NodeIdStringSchema>
119
- export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
120
- export type OrganizationModelNavigationGroup = z.infer<typeof NavigationGroupSchema>
121
- export type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>
122
- export type OrganizationModelSidebar = z.infer<typeof SidebarNavigationSchema>
123
- export type OrganizationModelSidebarSection = z.infer<typeof SidebarSectionSchema>
124
- export type OrganizationModelSidebarNode = z.infer<typeof SidebarNodeSchema>
125
- export type OrganizationModelSidebarSurfaceTargets = z.infer<typeof SidebarSurfaceTargetsSchema>
126
- export type OrganizationModelSidebarSurfaceNode = Extract<OrganizationModelSidebarNode, { type: 'surface' }>
127
- export type OrganizationModelSidebarGroupNode = Extract<OrganizationModelSidebarNode, { type: 'group' }>
128
- export type OrganizationModelTechStackEntry = z.infer<typeof TechStackEntrySchema>
129
- export type OrganizationModelStatuses = z.infer<typeof StatusesDomainSchema>
130
- export type OrganizationModelStatusEntry = z.infer<typeof StatusEntrySchema>
131
- export type OrganizationModelStatusSemanticClass = z.infer<typeof StatusSemanticClassSchema>
132
- export type OrganizationModelCustomers = z.infer<typeof CustomersDomainSchema>
133
- export type OrganizationModelCustomerSegment = z.infer<typeof CustomerSegmentSchema>
134
- export type OrganizationModelCustomerFirmographics = z.infer<typeof FirmographicsSchema>
135
- export type OrganizationModelOfferings = z.infer<typeof OfferingsDomainSchema>
136
- export type OrganizationModelProduct = z.infer<typeof ProductSchema>
137
- export type OrganizationModelPricingModel = z.infer<typeof PricingModelSchema>
138
- export type OrganizationModelRoles = z.infer<typeof RolesDomainSchema>
139
- export type OrganizationModelRole = z.infer<typeof RoleSchema>
140
- export type OrganizationModelRoleId = z.infer<typeof RoleIdSchema>
141
- export type OrganizationModelRoleHolder = z.infer<typeof RoleHolderSchema>
142
- export type OrganizationModelHumanRoleHolder = z.infer<typeof HumanRoleHolderSchema>
143
- export type OrganizationModelAgentRoleHolder = z.infer<typeof AgentRoleHolderSchema>
144
- export type OrganizationModelTeamRoleHolder = z.infer<typeof TeamRoleHolderSchema>
102
+ OrganizationModelDomainMetadataByDomainSchema,
103
+ OrganizationModelDomainMetadataSchema,
104
+ OrganizationModelSchema
105
+ } from './schema'
106
+
107
+ export type OrganizationModel = z.infer<typeof OrganizationModelSchema>
108
+ export type OrganizationModelDomainKey = z.infer<typeof OrganizationModelDomainKeySchema>
109
+ export type OrganizationModelDomainMetadata = z.infer<typeof OrganizationModelDomainMetadataSchema>
110
+ export type OrganizationModelDomainMetadataByDomain = z.infer<typeof OrganizationModelDomainMetadataByDomainSchema>
111
+ export type OrganizationModelBranding = z.infer<typeof OrganizationModelBrandingSchema>
112
+ // Phase 4: OrganizationModelSales, OrganizationModelProspecting, OrganizationModelProjects,
113
+ // OrganizationModelNavigation removed — compound domain top-level fields deleted per D8/D1.
114
+ // Retained as local aliases for content-kind payload shapes used in migration-helpers:
115
+ export type SalesPipeline = z.infer<typeof SalesPipelineSchema>
116
+ export type SalesStage = z.infer<typeof SalesStageSchema>
117
+ export type ProspectingBuildTemplate = z.infer<typeof ProspectingBuildTemplateSchema>
118
+ export type ProspectingLifecycleStage = z.infer<typeof ProspectingLifecycleStageSchema>
119
+ export type ProjectsDomainState = z.infer<typeof ProjectsDomainStateSchema>
120
+ export type NodeIdPath = z.infer<typeof NodeIdPathSchema>
121
+ export type NodeIdString = z.infer<typeof NodeIdStringSchema>
122
+ export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
123
+ export type OrganizationModelNavigationGroup = z.infer<typeof NavigationGroupSchema>
124
+ export type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>
125
+ export type OrganizationModelSidebar = z.infer<typeof SidebarNavigationSchema>
126
+ export type OrganizationModelSidebarSection = z.infer<typeof SidebarSectionSchema>
127
+ export type OrganizationModelSidebarNode = z.infer<typeof SidebarNodeSchema>
128
+ export type OrganizationModelSidebarSurfaceTargets = z.infer<typeof SidebarSurfaceTargetsSchema>
129
+ export type OrganizationModelSidebarSurfaceNode = Extract<OrganizationModelSidebarNode, { type: 'surface' }>
130
+ export type OrganizationModelSidebarGroupNode = Extract<OrganizationModelSidebarNode, { type: 'group' }>
131
+ export type OrganizationModelTechStackEntry = z.infer<typeof TechStackEntrySchema>
132
+ export type OrganizationModelStatuses = z.infer<typeof StatusesDomainSchema>
133
+ export type OrganizationModelStatusEntry = z.infer<typeof StatusEntrySchema>
134
+ export type OrganizationModelStatusSemanticClass = z.infer<typeof StatusSemanticClassSchema>
135
+ export type OrganizationModelCustomers = z.infer<typeof CustomersDomainSchema>
136
+ export type OrganizationModelCustomerSegment = z.infer<typeof CustomerSegmentSchema>
137
+ export type OrganizationModelCustomerFirmographics = z.infer<typeof FirmographicsSchema>
138
+ export type OrganizationModelOfferings = z.infer<typeof OfferingsDomainSchema>
139
+ export type OrganizationModelProduct = z.infer<typeof ProductSchema>
140
+ export type OrganizationModelPricingModel = z.infer<typeof PricingModelSchema>
141
+ export type OrganizationModelRoles = z.infer<typeof RolesDomainSchema>
142
+ export type OrganizationModelRole = z.infer<typeof RoleSchema>
143
+ export type OrganizationModelRoleId = z.infer<typeof RoleIdSchema>
144
+ export type OrganizationModelRoleHolder = z.infer<typeof RoleHolderSchema>
145
+ export type OrganizationModelHumanRoleHolder = z.infer<typeof HumanRoleHolderSchema>
146
+ export type OrganizationModelAgentRoleHolder = z.infer<typeof AgentRoleHolderSchema>
147
+ export type OrganizationModelTeamRoleHolder = z.infer<typeof TeamRoleHolderSchema>
145
148
  export type OrganizationModelGoals = z.infer<typeof GoalsDomainSchema>
146
149
  export type OrganizationModelObjective = z.infer<typeof ObjectiveSchema>
147
150
  export type OrganizationModelKeyResult = z.infer<typeof KeyResultSchema>
@@ -150,22 +153,25 @@ export type OrganizationModelSystems = z.infer<typeof SystemsDomainSchema>
150
153
  export type OrganizationModelSystemEntry = z.infer<typeof SystemEntrySchema>
151
154
  export type OrganizationModelSystemConfig = z.infer<typeof SystemConfigSchema>
152
155
  export type OrganizationModelSystemId = z.infer<typeof SystemIdSchema>
153
- export type OrganizationModelSystemPath = z.infer<typeof SystemPathSchema>
154
- export type OrganizationModelSystemKind = z.infer<typeof SystemKindSchema>
155
- export type OrganizationModelSystemLifecycle = z.infer<typeof SystemLifecycleSchema>
156
- /** @deprecated Use OrganizationModelSystemLifecycle. Accepted for one publish cycle. */
157
- export type OrganizationModelSystemStatus = z.infer<typeof SystemStatusSchema>
158
- export type OrganizationModelResources = z.infer<typeof ResourcesDomainSchema>
159
- export type OrganizationModelResourceEntry = z.infer<typeof ResourceEntrySchema>
160
- export type OrganizationModelResourceId = z.infer<typeof ResourceIdSchema>
161
- export type OrganizationModelCodeReference = z.infer<typeof CodeReferenceSchema>
162
- export type OrganizationModelCodeReferenceRole = z.infer<typeof CodeReferenceRoleSchema>
163
- export type EventId = z.infer<typeof EventIdSchema>
164
- export type EventEmissionDescriptor = z.infer<typeof EventEmissionDescriptorSchema>
165
- export type EventDescriptor = z.infer<typeof EventDescriptorSchema>
166
- export type OrganizationModelResourceKind = z.infer<typeof ResourceKindSchema>
156
+ export type OrganizationModelSystemPath = z.infer<typeof SystemPathSchema>
157
+ export type OrganizationModelSystemKind = z.infer<typeof SystemKindSchema>
158
+ export type OrganizationModelSystemLifecycle = z.infer<typeof SystemLifecycleSchema>
159
+ /** @deprecated Use OrganizationModelSystemLifecycle. Accepted for one publish cycle. */
160
+ export type OrganizationModelSystemStatus = z.infer<typeof SystemStatusSchema>
161
+ export type OrganizationModelResources = z.infer<typeof ResourcesDomainSchema>
162
+ export type OrganizationModelResourceEntry = z.infer<typeof ResourceEntrySchema>
163
+ export type OrganizationModelResourceId = z.infer<typeof ResourceIdSchema>
164
+ export type OrganizationModelCodeReference = z.infer<typeof CodeReferenceSchema>
165
+ export type OrganizationModelCodeReferenceRole = z.infer<typeof CodeReferenceRoleSchema>
166
+ export type EventId = z.infer<typeof EventIdSchema>
167
+ export type EventEmissionDescriptor = z.infer<typeof EventEmissionDescriptorSchema>
168
+ export type EventDescriptor = z.infer<typeof EventDescriptorSchema>
169
+ export type OrganizationModelResourceKind = z.infer<typeof ResourceKindSchema>
167
170
  export type OrganizationModelResourceGovernanceStatus = z.infer<typeof ResourceGovernanceStatusSchema>
168
171
  export type OrganizationModelResourceOntologyBinding = z.infer<typeof ResourceOntologyBindingSchema>
172
+ export type OrganizationModelContractRef = z.infer<typeof ContractRefSchema>
173
+ export type OrganizationModelResourceOntologyBindingContract = ResourceOntologyBindingContract
174
+ export type { ParsedContractRef }
169
175
  export type OrganizationModelAgentKind = z.infer<typeof AgentKindSchema>
170
176
  export type OrganizationModelScriptResourceLanguage = z.infer<typeof ScriptResourceLanguageSchema>
171
177
  export type OrganizationModelScriptResourceSource = z.infer<typeof ScriptResourceSourceSchema>
@@ -180,33 +186,33 @@ export type OrganizationModelTopologyRelationshipKind = z.infer<typeof OmTopolog
180
186
  export type OrganizationModelTopologyRelationship = z.infer<typeof OmTopologyRelationshipSchema>
181
187
  export type OrganizationModelTopologyMetadata = z.infer<typeof OmTopologyMetadataSchema>
182
188
  export type OrganizationModelActions = z.infer<typeof ActionsDomainSchema>
183
- export type OrganizationModelAction = z.infer<typeof ActionSchema>
184
- export type OrganizationModelActionId = z.infer<typeof ActionIdSchema>
185
- export type OrganizationModelActionScope = z.infer<typeof ActionScopeSchema>
186
- export type OrganizationModelActionRef = z.infer<typeof ActionRefSchema>
187
- export type OrganizationModelActionInvocationKind = z.infer<typeof ActionInvocationKindSchema>
188
- export type OrganizationModelActionInvocation = z.infer<typeof ActionInvocationSchema>
189
- export type EntityId = z.infer<typeof EntityIdSchema>
190
- export type EntityLink = z.infer<typeof EntityLinkSchema>
191
- export type Entity = z.infer<typeof EntitySchema>
192
- export type OrganizationModelEntity = z.infer<typeof EntitySchema>
193
- export type OrganizationModelEntities = z.infer<typeof EntitiesDomainSchema>
194
- export type OrganizationModelPolicies = z.infer<typeof PoliciesDomainSchema>
195
- export type OrganizationModelPolicy = z.infer<typeof PolicySchema>
196
- export type OrganizationModelPolicyId = z.infer<typeof PolicyIdSchema>
197
- export type OrganizationModelPolicyApplicability = z.infer<typeof PolicyApplicabilitySchema>
198
- export type OrganizationModelPolicyTrigger = z.infer<typeof PolicyTriggerSchema>
199
- export type OrganizationModelPolicyPredicate = z.infer<typeof PolicyPredicateSchema>
200
- export type OrganizationModelPolicyEffect = z.infer<typeof PolicyEffectSchema>
201
- export type OrganizationModelKnowledge = z.infer<typeof KnowledgeDomainSchema>
202
- export type OrgKnowledgeNode = z.infer<typeof OrgKnowledgeNodeSchema>
203
- export type OrgKnowledgeNodeInput = z.input<typeof OrgKnowledgeNodeSchema>
204
- export type OrgKnowledgeKind = z.infer<typeof OrgKnowledgeKindSchema>
205
- export type KnowledgeTargetKind = z.infer<typeof KnowledgeTargetKindSchema>
206
- export type KnowledgeTargetRef = z.infer<typeof KnowledgeTargetRefSchema>
207
- export type KnowledgeLink = z.infer<typeof KnowledgeLinkSchema>
208
- export type OrganizationModelIconToken = z.infer<typeof OrganizationModelIconTokenSchema>
209
- export type OrganizationModelBuiltinIconToken = z.infer<typeof OrganizationModelBuiltinIconTokenSchema>
210
-
211
- export type DeepPartial<T> =
212
- T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T
189
+ export type OrganizationModelAction = z.infer<typeof ActionSchema>
190
+ export type OrganizationModelActionId = z.infer<typeof ActionIdSchema>
191
+ export type OrganizationModelActionScope = z.infer<typeof ActionScopeSchema>
192
+ export type OrganizationModelActionRef = z.infer<typeof ActionRefSchema>
193
+ export type OrganizationModelActionInvocationKind = z.infer<typeof ActionInvocationKindSchema>
194
+ export type OrganizationModelActionInvocation = z.infer<typeof ActionInvocationSchema>
195
+ export type EntityId = z.infer<typeof EntityIdSchema>
196
+ export type EntityLink = z.infer<typeof EntityLinkSchema>
197
+ export type Entity = z.infer<typeof EntitySchema>
198
+ export type OrganizationModelEntity = z.infer<typeof EntitySchema>
199
+ export type OrganizationModelEntities = z.infer<typeof EntitiesDomainSchema>
200
+ export type OrganizationModelPolicies = z.infer<typeof PoliciesDomainSchema>
201
+ export type OrganizationModelPolicy = z.infer<typeof PolicySchema>
202
+ export type OrganizationModelPolicyId = z.infer<typeof PolicyIdSchema>
203
+ export type OrganizationModelPolicyApplicability = z.infer<typeof PolicyApplicabilitySchema>
204
+ export type OrganizationModelPolicyTrigger = z.infer<typeof PolicyTriggerSchema>
205
+ export type OrganizationModelPolicyPredicate = z.infer<typeof PolicyPredicateSchema>
206
+ export type OrganizationModelPolicyEffect = z.infer<typeof PolicyEffectSchema>
207
+ export type OrganizationModelKnowledge = z.infer<typeof KnowledgeDomainSchema>
208
+ export type OrgKnowledgeNode = z.infer<typeof OrgKnowledgeNodeSchema>
209
+ export type OrgKnowledgeNodeInput = z.input<typeof OrgKnowledgeNodeSchema>
210
+ export type OrgKnowledgeKind = z.infer<typeof OrgKnowledgeKindSchema>
211
+ export type KnowledgeTargetKind = z.infer<typeof KnowledgeTargetKindSchema>
212
+ export type KnowledgeTargetRef = z.infer<typeof KnowledgeTargetRefSchema>
213
+ export type KnowledgeLink = z.infer<typeof KnowledgeLinkSchema>
214
+ export type OrganizationModelIconToken = z.infer<typeof OrganizationModelIconTokenSchema>
215
+ export type OrganizationModelBuiltinIconToken = z.infer<typeof OrganizationModelBuiltinIconTokenSchema>
216
+
217
+ export type DeepPartial<T> =
218
+ T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T
@@ -1,3 +1,3 @@
1
1
  export const VERSION = {
2
- CURRENT: '1.9.2'
2
+ CURRENT: '1.10.2'
3
3
  }
@@ -662,6 +662,29 @@ describe('validateResourceGovernance', () => {
662
662
  ).toThrow("Resource 'lead-import' declares ontology bindings but no ontology actions")
663
663
  })
664
664
 
665
+ it('accepts contract-only workflow ontology bindings without ontology.actions', () => {
666
+ const contractOnlyResource: ResourceEntry = {
667
+ ...workflowResource,
668
+ ontology: {
669
+ contract: {
670
+ input: '@repo/elevasis-core/contracts/full-diagnostic#inputSchema'
671
+ }
672
+ }
673
+ }
674
+
675
+ const result = validateResourceGovernance(
676
+ 'test-org',
677
+ {
678
+ version: '1.0.0',
679
+ workflows: [createGovernedWorkflow(contractOnlyResource)]
680
+ },
681
+ createModel([contractOnlyResource], [systemA], { ontology: validOntology }),
682
+ { mode: 'strict' }
683
+ )
684
+
685
+ expect(result.valid).toBe(true)
686
+ })
687
+
665
688
  it('reports dangling required topology refs', () => {
666
689
  expect(() =>
667
690
  validateResourceGovernance(
@@ -156,7 +156,7 @@ function hasOntologySources(organizationModel: ResourceGovernanceModel): boolean
156
156
  }
157
157
 
158
158
  function systemHasOntologySource(system: SystemEntry): boolean {
159
- if (system.ontology !== undefined || (system.content !== undefined && Object.keys(system.content).length > 0)) return true
159
+ if (system.ontology !== undefined) return true
160
160
  return Object.values(system.systems ?? system.subsystems ?? {}).some(systemHasOntologySource)
161
161
  }
162
162
 
@@ -198,7 +198,18 @@ function addOntologyBindingIssues(
198
198
  const binding = resource.ontology
199
199
  if (binding === undefined) return
200
200
 
201
- if ((resource.kind === 'workflow' || resource.kind === 'agent') && (binding.actions?.length ?? 0) === 0) {
201
+ const hasOperationalOntologyBinding =
202
+ binding.primaryAction !== undefined ||
203
+ (binding.reads?.length ?? 0) > 0 ||
204
+ (binding.writes?.length ?? 0) > 0 ||
205
+ (binding.usesCatalogs?.length ?? 0) > 0 ||
206
+ (binding.emits?.length ?? 0) > 0
207
+
208
+ if (
209
+ (resource.kind === 'workflow' || resource.kind === 'agent') &&
210
+ hasOperationalOntologyBinding &&
211
+ (binding.actions?.length ?? 0) === 0
212
+ ) {
202
213
  addGovernanceIssue(
203
214
  issues,
204
215
  'missing-ontology-actions',