@elevasis/core 0.25.0 → 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 (66) hide show
  1. package/dist/index.d.ts +166 -85
  2. package/dist/index.js +146 -1346
  3. package/dist/knowledge/index.d.ts +27 -38
  4. package/dist/knowledge/index.js +1 -1
  5. package/dist/organization-model/index.d.ts +166 -85
  6. package/dist/organization-model/index.js +146 -1346
  7. package/dist/test-utils/index.d.ts +23 -31
  8. package/dist/test-utils/index.js +75 -1238
  9. package/package.json +1 -1
  10. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +14 -2
  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/knowledge/queries.ts +0 -1
  18. package/src/organization-model/__tests__/content-kinds-registry.test.ts +35 -210
  19. package/src/organization-model/__tests__/defaults.test.ts +4 -4
  20. package/src/organization-model/__tests__/domains/actions.test.ts +12 -36
  21. package/src/organization-model/__tests__/domains/offerings.test.ts +13 -6
  22. package/src/organization-model/__tests__/domains/resources.test.ts +497 -350
  23. package/src/organization-model/__tests__/domains/systems.test.ts +6 -7
  24. package/src/organization-model/__tests__/flatten-additive-merge.test.ts +68 -80
  25. package/src/organization-model/__tests__/foundation.test.ts +81 -14
  26. package/src/organization-model/__tests__/graph.test.ts +662 -694
  27. package/src/organization-model/__tests__/knowledge.test.ts +31 -17
  28. package/src/organization-model/__tests__/lookup-helpers.test.ts +128 -438
  29. package/src/organization-model/__tests__/migration-helpers.test.ts +362 -591
  30. package/src/organization-model/__tests__/prospecting-ssot.test.ts +68 -103
  31. package/src/organization-model/__tests__/published-zero-leak.test.ts +17 -0
  32. package/src/organization-model/__tests__/recursive-system-schema.test.ts +159 -532
  33. package/src/organization-model/__tests__/resolve.test.ts +79 -42
  34. package/src/organization-model/__tests__/schema.test.ts +65 -56
  35. package/src/organization-model/catalogs/lead-gen.ts +0 -103
  36. package/src/organization-model/defaults.ts +17 -702
  37. package/src/organization-model/domains/actions.ts +116 -333
  38. package/src/organization-model/domains/knowledge.ts +15 -7
  39. package/src/organization-model/domains/projects.ts +4 -4
  40. package/src/organization-model/domains/prospecting.ts +405 -395
  41. package/src/organization-model/domains/resources.ts +206 -135
  42. package/src/organization-model/domains/sales.ts +5 -5
  43. package/src/organization-model/domains/systems.ts +8 -23
  44. package/src/organization-model/graph/build.ts +223 -294
  45. package/src/organization-model/graph/schema.ts +2 -3
  46. package/src/organization-model/graph/types.ts +12 -14
  47. package/src/organization-model/helpers.ts +130 -218
  48. package/src/organization-model/index.ts +104 -124
  49. package/src/organization-model/migration-helpers.ts +211 -249
  50. package/src/organization-model/ontology.ts +0 -60
  51. package/src/organization-model/organization-graph.mdx +4 -5
  52. package/src/organization-model/organization-model.mdx +1 -1
  53. package/src/organization-model/published.ts +236 -226
  54. package/src/organization-model/resolve.ts +4 -5
  55. package/src/organization-model/schema.ts +610 -704
  56. package/src/organization-model/types.ts +167 -161
  57. package/src/platform/registry/__tests__/validation.test.ts +23 -0
  58. package/src/platform/registry/validation.ts +13 -2
  59. package/src/reference/_generated/contracts.md +14 -2
  60. package/src/organization-model/content-kinds/config.ts +0 -36
  61. package/src/organization-model/content-kinds/index.ts +0 -78
  62. package/src/organization-model/content-kinds/pipeline.ts +0 -68
  63. package/src/organization-model/content-kinds/registry.ts +0 -44
  64. package/src/organization-model/content-kinds/status.ts +0 -71
  65. package/src/organization-model/content-kinds/template.ts +0 -83
  66. package/src/organization-model/content-kinds/types.ts +0 -117
@@ -94,24 +94,6 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
94
94
  }, z.core.$strip>>;
95
95
  type OntologyScope = z.infer<typeof OntologyScopeSchema>;
96
96
 
97
- /**
98
- * Placeholder discriminated union for ContentNode (Wave 1A).
99
- * Wave 2A wires concrete (kind, type) pairs via the registry.
100
- *
101
- * Per D2: unregistered (kind, type) pairs are allowed and pass through validation.
102
- * Per L14: every node carries BOTH `kind` and `type`.
103
- */
104
- declare const ContentNodeSchema: z.ZodObject<{
105
- label: z.ZodString;
106
- description: z.ZodOptional<z.ZodString>;
107
- order: z.ZodOptional<z.ZodNumber>;
108
- parentContentId: z.ZodOptional<z.ZodString>;
109
- kind: z.ZodString;
110
- type: z.ZodString;
111
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
112
- }, z.core.$strip>;
113
- type ContentNode = z.infer<typeof ContentNodeSchema>;
114
-
115
97
  type JsonPrimitive = string | number | boolean | null;
116
98
  type JsonValue = JsonPrimitive | JsonValue[] | {
117
99
  [key: string]: JsonValue;
@@ -153,11 +135,6 @@ interface SystemEntry {
153
135
  config?: Record<string, JsonValue>;
154
136
  ontology?: OntologyScope;
155
137
  systems?: Record<string, SystemEntry>;
156
- /**
157
- * @deprecated Compatibility-only bridge for old tenant data and migration readers.
158
- * Author new semantic catalogs in `ontology` and local settings in `config`.
159
- */
160
- content?: Record<string, ContentNode>;
161
138
  subsystems?: Record<string, SystemEntry>;
162
139
  }
163
140
 
@@ -303,11 +280,10 @@ declare const OrgKnowledgeNodeSchema: z.ZodObject<{
303
280
  ontology: "ontology";
304
281
  role: "role";
305
282
  goal: "goal";
306
- stage: "stage";
307
283
  resource: "resource";
284
+ stage: "stage";
308
285
  "customer-segment": "customer-segment";
309
286
  offering: "offering";
310
- "content-node": "content-node";
311
287
  }>;
312
288
  id: z.ZodString;
313
289
  }, z.core.$strip>;
@@ -315,7 +291,7 @@ declare const OrgKnowledgeNodeSchema: z.ZodObject<{
315
291
  nodeId: z.ZodUnion<readonly [z.ZodString, z.ZodTemplateLiteral<`ontology:${string}`>]>;
316
292
  }, z.core.$strip>]>, z.ZodTransform<{
317
293
  target: {
318
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "stage" | "resource" | "customer-segment" | "offering" | "content-node";
294
+ kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
319
295
  id: string;
320
296
  };
321
297
  nodeId: string;
@@ -323,7 +299,7 @@ declare const OrgKnowledgeNodeSchema: z.ZodObject<{
323
299
  nodeId: string;
324
300
  } | {
325
301
  target: {
326
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "stage" | "resource" | "customer-segment" | "offering" | "content-node";
302
+ kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
327
303
  id: string;
328
304
  };
329
305
  }>>>>;
@@ -812,14 +788,18 @@ declare const OrganizationModelSchema: z.ZodObject<{
812
788
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
813
789
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
814
790
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
791
+ contract: z.ZodOptional<z.ZodObject<{
792
+ input: z.ZodOptional<z.ZodString>;
793
+ output: z.ZodOptional<z.ZodString>;
794
+ }, z.core.$strip>>;
815
795
  }, z.core.$strip>>;
816
796
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
817
797
  path: z.ZodString;
818
798
  role: z.ZodEnum<{
819
- schema: "schema";
820
799
  config: "config";
821
800
  entrypoint: "entrypoint";
822
801
  handler: "handler";
802
+ schema: "schema";
823
803
  test: "test";
824
804
  docs: "docs";
825
805
  }>;
@@ -858,14 +838,18 @@ declare const OrganizationModelSchema: z.ZodObject<{
858
838
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
859
839
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
860
840
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
841
+ contract: z.ZodOptional<z.ZodObject<{
842
+ input: z.ZodOptional<z.ZodString>;
843
+ output: z.ZodOptional<z.ZodString>;
844
+ }, z.core.$strip>>;
861
845
  }, z.core.$strip>>;
862
846
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
863
847
  path: z.ZodString;
864
848
  role: z.ZodEnum<{
865
- schema: "schema";
866
849
  config: "config";
867
850
  entrypoint: "entrypoint";
868
851
  handler: "handler";
852
+ schema: "schema";
869
853
  test: "test";
870
854
  docs: "docs";
871
855
  }>;
@@ -935,14 +919,18 @@ declare const OrganizationModelSchema: z.ZodObject<{
935
919
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
936
920
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
937
921
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
922
+ contract: z.ZodOptional<z.ZodObject<{
923
+ input: z.ZodOptional<z.ZodString>;
924
+ output: z.ZodOptional<z.ZodString>;
925
+ }, z.core.$strip>>;
938
926
  }, z.core.$strip>>;
939
927
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
940
928
  path: z.ZodString;
941
929
  role: z.ZodEnum<{
942
- schema: "schema";
943
930
  config: "config";
944
931
  entrypoint: "entrypoint";
945
932
  handler: "handler";
933
+ schema: "schema";
946
934
  test: "test";
947
935
  docs: "docs";
948
936
  }>;
@@ -970,14 +958,18 @@ declare const OrganizationModelSchema: z.ZodObject<{
970
958
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
971
959
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
972
960
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
961
+ contract: z.ZodOptional<z.ZodObject<{
962
+ input: z.ZodOptional<z.ZodString>;
963
+ output: z.ZodOptional<z.ZodString>;
964
+ }, z.core.$strip>>;
973
965
  }, z.core.$strip>>;
974
966
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
975
967
  path: z.ZodString;
976
968
  role: z.ZodEnum<{
977
- schema: "schema";
978
969
  config: "config";
979
970
  entrypoint: "entrypoint";
980
971
  handler: "handler";
972
+ schema: "schema";
981
973
  test: "test";
982
974
  docs: "docs";
983
975
  }>;
@@ -1264,11 +1256,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
1264
1256
  ontology: "ontology";
1265
1257
  role: "role";
1266
1258
  goal: "goal";
1267
- stage: "stage";
1268
1259
  resource: "resource";
1260
+ stage: "stage";
1269
1261
  "customer-segment": "customer-segment";
1270
1262
  offering: "offering";
1271
- "content-node": "content-node";
1272
1263
  }>;
1273
1264
  id: z.ZodString;
1274
1265
  }, z.core.$strip>;
@@ -1276,7 +1267,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
1276
1267
  nodeId: z.ZodUnion<readonly [z.ZodString, z.ZodTemplateLiteral<`ontology:${string}`>]>;
1277
1268
  }, z.core.$strip>]>, z.ZodTransform<{
1278
1269
  target: {
1279
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "stage" | "resource" | "customer-segment" | "offering" | "content-node";
1270
+ kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
1280
1271
  id: string;
1281
1272
  };
1282
1273
  nodeId: string;
@@ -1284,7 +1275,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
1284
1275
  nodeId: string;
1285
1276
  } | {
1286
1277
  target: {
1287
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "stage" | "resource" | "customer-segment" | "offering" | "content-node";
1278
+ kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
1288
1279
  id: string;
1289
1280
  };
1290
1281
  }>>>>;
@@ -1295,9 +1286,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
1295
1286
 
1296
1287
  type OrganizationModel = z.infer<typeof OrganizationModelSchema>;
1297
1288
 
1298
- type OrganizationGraphNodeKind = 'organization' | 'system' | 'role' | 'action' | 'entity' | 'event' | 'policy' | 'stage' | 'resource' | 'knowledge' | 'customer-segment' | 'offering' | 'goal' | 'surface' | 'navigation-group'
1299
- /** Phase 3 preview — Phase 4 populates this kind via graph projection of system.content entries. */
1300
- | 'ontology' | 'content-node';
1289
+ type OrganizationGraphNodeKind = 'organization' | 'system' | 'role' | 'action' | 'entity' | 'event' | 'policy' | 'stage' | 'resource' | 'knowledge' | 'customer-segment' | 'offering' | 'goal' | 'surface' | 'navigation-group' | 'ontology';
1301
1290
  type OrganizationGraphEdgeKind = 'contains' | 'references' | 'maps_to' | 'uses' | 'governs' | 'links' | 'affects' | 'emits' | 'originates_from' | 'triggers' | 'approval' | 'applies_to' | 'effects' | 'actions' | 'reads' | 'writes' | 'uses_catalog';
1302
1291
 
1303
1292
  interface OrganizationGraphNode {
@@ -90,7 +90,7 @@ function toGraphNodeId(omNodeId) {
90
90
  return `knowledge:${omNodeId}`;
91
91
  }
92
92
  function toTargetGraphNodeId(nodeId) {
93
- if (nodeId.startsWith("system:") || nodeId.startsWith("knowledge:") || nodeId.startsWith("resource:") || nodeId.startsWith("content-node:") || nodeId.startsWith("ontology:")) {
93
+ if (nodeId.startsWith("system:") || nodeId.startsWith("knowledge:") || nodeId.startsWith("resource:") || nodeId.startsWith("ontology:")) {
94
94
  return nodeId;
95
95
  }
96
96
  const ontologyId = OntologyIdSchema.safeParse(nodeId);