@disclosureos/origins 1.0.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 (55) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +95 -0
  4. package/dist/classification/index.d.ts +75 -0
  5. package/dist/classification/index.js +35 -0
  6. package/dist/classification/index.js.map +1 -0
  7. package/dist/constants/index.d.ts +41 -0
  8. package/dist/constants/index.js +1027 -0
  9. package/dist/constants/index.js.map +1 -0
  10. package/dist/factories/index.d.ts +25 -0
  11. package/dist/factories/index.js +1067 -0
  12. package/dist/factories/index.js.map +1 -0
  13. package/dist/formatters/index.d.ts +9 -0
  14. package/dist/formatters/index.js +1036 -0
  15. package/dist/formatters/index.js.map +1 -0
  16. package/dist/guards/index.d.ts +3 -0
  17. package/dist/guards/index.js +1059 -0
  18. package/dist/guards/index.js.map +1 -0
  19. package/dist/index-BUFnYJ1s.d.ts +21 -0
  20. package/dist/index.d.ts +53 -0
  21. package/dist/index.js +1231 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/labels/index.d.ts +7 -0
  24. package/dist/labels/index.js +1002 -0
  25. package/dist/labels/index.js.map +1 -0
  26. package/dist/reference/aaro/index.d.ts +26 -0
  27. package/dist/reference/aaro/index.js +47 -0
  28. package/dist/reference/aaro/index.js.map +1 -0
  29. package/dist/reference/geipan/index.d.ts +34 -0
  30. package/dist/reference/geipan/index.js +53 -0
  31. package/dist/reference/geipan/index.js.map +1 -0
  32. package/dist/reference/hynek/index.d.ts +37 -0
  33. package/dist/reference/hynek/index.js +27 -0
  34. package/dist/reference/hynek/index.js.map +1 -0
  35. package/dist/reference/index.d.ts +5 -0
  36. package/dist/reference/index.js +143 -0
  37. package/dist/reference/index.js.map +1 -0
  38. package/dist/reference/vallee/index.d.ts +40 -0
  39. package/dist/reference/vallee/index.js +37 -0
  40. package/dist/reference/vallee/index.js.map +1 -0
  41. package/dist/taxonomy/index.d.ts +20 -0
  42. package/dist/taxonomy/index.js +1071 -0
  43. package/dist/taxonomy/index.js.map +1 -0
  44. package/dist/taxonomy/metaphysical/index.d.ts +6 -0
  45. package/dist/taxonomy/metaphysical/index.js +995 -0
  46. package/dist/taxonomy/metaphysical/index.js.map +1 -0
  47. package/dist/taxonomy/physical/index.d.ts +6 -0
  48. package/dist/taxonomy/physical/index.js +995 -0
  49. package/dist/taxonomy/physical/index.js.map +1 -0
  50. package/dist/taxonomy/psychosocial/index.d.ts +6 -0
  51. package/dist/taxonomy/psychosocial/index.js +995 -0
  52. package/dist/taxonomy/psychosocial/index.js.map +1 -0
  53. package/dist/types-DhroHNFf.d.ts +62 -0
  54. package/package.json +136 -0
  55. package/schema/origins.schema.json +88 -0
package/dist/index.js ADDED
@@ -0,0 +1,1231 @@
1
+ import { z } from 'zod';
2
+ import { ConfidenceSchema, ClaimSchema, createEnumGuard, schemaId, jsonSchemaEnvelope, validateWith } from '@disclosureos/records/shared';
3
+ export { isConfidence } from '@disclosureos/records/shared';
4
+
5
+ // src/taxonomy/types.ts
6
+ var OriginDomainSchema = z.enum(["physical", "psychosocial", "metaphysical"]).describe("Top-level OCS origin domain.");
7
+ var PhysicalSubdomainSchema = z.enum(["intradimensional", "extradimensional", "interdimensional"]).describe("Subdomain of the physical origin domain.");
8
+ var PsychosocialSubdomainSchema = z.enum(["sociological", "psychological", "neurological"]).describe("Subdomain of the psychosocial origin domain.");
9
+ var MetaphysicalSubdomainSchema = z.enum(["paranormal", "occult", "transcendental"]).describe("Subdomain of the metaphysical origin domain.");
10
+ var OriginSubdomainSchema = z.union([PhysicalSubdomainSchema, PsychosocialSubdomainSchema, MetaphysicalSubdomainSchema]).describe("Any OCS subdomain across the three origin domains.");
11
+ var OCSNodeSchema = z.object({
12
+ id: z.string().min(1).describe('Numeric dot-path identifier (e.g., "1.1.2.1").'),
13
+ label: z.string().min(1).describe("Human-readable name for this OCS hypothesis node."),
14
+ description: z.string().describe("Plain-language explanation of what this hypothesis node covers."),
15
+ domain: OriginDomainSchema.describe("Top-level domain this node belongs to."),
16
+ depth: z.number().int().min(0).describe("Tree depth: 0=domain, 1=subdomain, 2=category, 3=subcategory, 4=leaf."),
17
+ parentId: z.string().nullable().describe("Parent node id, or null for a domain root."),
18
+ children: z.array(z.string()).describe("Child node ids, referenced by id rather than nested inline."),
19
+ scientificallyTestable: z.boolean().describe("Whether this hypothesis can be empirically falsified."),
20
+ aliases: z.array(z.string()).optional().describe('Alternative names (e.g., "ETH", "CTH").')
21
+ }).meta({ id: "OCSNode" }).describe("A node in the OCS origin-hypothesis taxonomy.");
22
+
23
+ // src/taxonomy/tree.ts
24
+ var OCS_TAXONOMY = [
25
+ // ============================================================
26
+ // DOMAIN 1.0 — PHYSICAL
27
+ // ============================================================
28
+ {
29
+ id: "1",
30
+ label: "Physical",
31
+ description: "Theories attributing UAP to tangible, material objects or phenomena.",
32
+ domain: "physical",
33
+ depth: 0,
34
+ parentId: null,
35
+ children: ["1.1", "1.2", "1.3"],
36
+ scientificallyTestable: true
37
+ },
38
+ // --- 1.1 Intradimensional ---
39
+ {
40
+ id: "1.1",
41
+ label: "Intradimensional",
42
+ description: "Manifestations from dimensions/realms within our own physical reality.",
43
+ domain: "physical",
44
+ depth: 1,
45
+ parentId: "1",
46
+ children: ["1.1.1", "1.1.2", "1.1.3"],
47
+ scientificallyTestable: true
48
+ },
49
+ // 1.1.1 Prosaic
50
+ {
51
+ id: "1.1.1",
52
+ label: "Prosaic",
53
+ description: "Ordinary or conventional explanations for observed phenomena.",
54
+ domain: "physical",
55
+ depth: 2,
56
+ parentId: "1.1",
57
+ children: ["1.1.1.1", "1.1.1.2"],
58
+ scientificallyTestable: true
59
+ },
60
+ {
61
+ id: "1.1.1.1",
62
+ label: "Natural",
63
+ description: "Atmospheric, celestial, or geological phenomena misidentified as anomalous.",
64
+ domain: "physical",
65
+ depth: 3,
66
+ parentId: "1.1.1",
67
+ children: ["1.1.1.1.1", "1.1.1.1.2", "1.1.1.1.3", "1.1.1.1.4"],
68
+ scientificallyTestable: true
69
+ },
70
+ {
71
+ id: "1.1.1.1.1",
72
+ label: "Optical Artifact / Illusion",
73
+ description: "Lens flares, reflections, mirages, temperature inversions, or other optical effects.",
74
+ domain: "physical",
75
+ depth: 4,
76
+ parentId: "1.1.1.1",
77
+ children: [],
78
+ scientificallyTestable: true
79
+ },
80
+ {
81
+ id: "1.1.1.1.2",
82
+ label: "Celestial",
83
+ description: "Stars, planets, meteors, satellites, or space debris misidentified.",
84
+ domain: "physical",
85
+ depth: 4,
86
+ parentId: "1.1.1.1",
87
+ children: [],
88
+ scientificallyTestable: true
89
+ },
90
+ {
91
+ id: "1.1.1.1.3",
92
+ label: "Meteorological",
93
+ description: "Ball lightning, lenticular clouds, sprites, or other atmospheric phenomena.",
94
+ domain: "physical",
95
+ depth: 4,
96
+ parentId: "1.1.1.1",
97
+ children: [],
98
+ scientificallyTestable: true
99
+ },
100
+ {
101
+ id: "1.1.1.1.4",
102
+ label: "Geophysical",
103
+ description: "Earthquake lights, piezoelectric effects, or volcanic phenomena.",
104
+ domain: "physical",
105
+ depth: 4,
106
+ parentId: "1.1.1.1",
107
+ children: [],
108
+ scientificallyTestable: true
109
+ },
110
+ {
111
+ id: "1.1.1.2",
112
+ label: "Human",
113
+ description: "Human activities or technologies misidentified as anomalous.",
114
+ domain: "physical",
115
+ depth: 3,
116
+ parentId: "1.1.1",
117
+ children: ["1.1.1.2.1", "1.1.1.2.2", "1.1.1.2.3", "1.1.1.2.4"],
118
+ scientificallyTestable: true
119
+ },
120
+ {
121
+ id: "1.1.1.2.1",
122
+ label: "Governmental",
123
+ description: "Military aircraft, drones, or test vehicles from known government programs.",
124
+ domain: "physical",
125
+ depth: 4,
126
+ parentId: "1.1.1.2",
127
+ children: [],
128
+ scientificallyTestable: true
129
+ },
130
+ {
131
+ id: "1.1.1.2.2",
132
+ label: "Extra-Governmental",
133
+ description: "Black budget programs, Special Access Programs (SAPs), or unacknowledged projects.",
134
+ domain: "physical",
135
+ depth: 4,
136
+ parentId: "1.1.1.2",
137
+ children: [],
138
+ scientificallyTestable: true
139
+ },
140
+ {
141
+ id: "1.1.1.2.3",
142
+ label: "Inter-governmental",
143
+ description: "Foreign adversary technology or multinational classified programs.",
144
+ domain: "physical",
145
+ depth: 4,
146
+ parentId: "1.1.1.2",
147
+ children: [],
148
+ scientificallyTestable: true
149
+ },
150
+ {
151
+ id: "1.1.1.2.4",
152
+ label: "Private / Commercial",
153
+ description: "Commercial drones, private aerospace ventures, or civilian technology.",
154
+ domain: "physical",
155
+ depth: 4,
156
+ parentId: "1.1.1.2",
157
+ children: [],
158
+ scientificallyTestable: true
159
+ },
160
+ // 1.1.2 Cryptoterrestrial
161
+ {
162
+ id: "1.1.2",
163
+ label: "Cryptoterrestrial",
164
+ description: "Hidden Earth-based civilizations or entities operating outside known history.",
165
+ domain: "physical",
166
+ depth: 2,
167
+ parentId: "1.1",
168
+ children: ["1.1.2.1", "1.1.2.2", "1.1.2.3", "1.1.2.4"],
169
+ scientificallyTestable: true,
170
+ aliases: ["CTH"]
171
+ },
172
+ {
173
+ id: "1.1.2.1",
174
+ label: "Ancient / Proto-Human Survival",
175
+ description: "Remnant populations of earlier hominid species or ancient civilizations that survived in isolation.",
176
+ domain: "physical",
177
+ depth: 3,
178
+ parentId: "1.1.2",
179
+ children: [],
180
+ scientificallyTestable: true
181
+ },
182
+ {
183
+ id: "1.1.2.2",
184
+ label: "Breakaway Civilization",
185
+ description: "Human splinter groups that developed advanced technology in secret.",
186
+ domain: "physical",
187
+ depth: 3,
188
+ parentId: "1.1.2",
189
+ children: [],
190
+ scientificallyTestable: true
191
+ },
192
+ {
193
+ id: "1.1.2.3",
194
+ label: "Cryptids / Humanoids",
195
+ description: "Non-human intelligent entities indigenous to Earth but outside the known tree of life.",
196
+ domain: "physical",
197
+ depth: 3,
198
+ parentId: "1.1.2",
199
+ children: [],
200
+ scientificallyTestable: true
201
+ },
202
+ {
203
+ id: "1.1.2.4",
204
+ label: 'Stranded "Gods"',
205
+ description: "Entities from ancient mythological accounts interpreted as literal stranded visitors.",
206
+ domain: "physical",
207
+ depth: 3,
208
+ parentId: "1.1.2",
209
+ children: [],
210
+ scientificallyTestable: true
211
+ },
212
+ // 1.1.3 Extraterrestrial
213
+ {
214
+ id: "1.1.3",
215
+ label: "Extraterrestrial",
216
+ description: "Intelligence visiting from other locations in spacetime.",
217
+ domain: "physical",
218
+ depth: 2,
219
+ parentId: "1.1",
220
+ children: ["1.1.3.1", "1.1.3.2", "1.1.3.3", "1.1.3.4"],
221
+ scientificallyTestable: true,
222
+ aliases: ["ETH"]
223
+ },
224
+ {
225
+ id: "1.1.3.1",
226
+ label: "Solar System",
227
+ description: "Intelligence originating from elsewhere in our solar system.",
228
+ domain: "physical",
229
+ depth: 3,
230
+ parentId: "1.1.3",
231
+ children: [],
232
+ scientificallyTestable: true
233
+ },
234
+ {
235
+ id: "1.1.3.2",
236
+ label: "Interstellar",
237
+ description: "Intelligence from other star systems within our galaxy.",
238
+ domain: "physical",
239
+ depth: 3,
240
+ parentId: "1.1.3",
241
+ children: [],
242
+ scientificallyTestable: true
243
+ },
244
+ {
245
+ id: "1.1.3.3",
246
+ label: "Intergalactic",
247
+ description: "Intelligence from other galaxies.",
248
+ domain: "physical",
249
+ depth: 3,
250
+ parentId: "1.1.3",
251
+ children: [],
252
+ scientificallyTestable: true
253
+ },
254
+ {
255
+ id: "1.1.3.4",
256
+ label: "Unknown Region of Space-Time",
257
+ description: "Intelligence from an uncharacterized region of our physical universe.",
258
+ domain: "physical",
259
+ depth: 3,
260
+ parentId: "1.1.3",
261
+ children: [],
262
+ scientificallyTestable: true
263
+ },
264
+ // --- 1.2 Extradimensional ---
265
+ {
266
+ id: "1.2",
267
+ label: "Extradimensional",
268
+ description: "UAPs from other dimensions, parallel universes, or realms beyond our physical reality.",
269
+ domain: "physical",
270
+ depth: 1,
271
+ parentId: "1",
272
+ children: ["1.2.1", "1.2.2"],
273
+ scientificallyTestable: true
274
+ },
275
+ {
276
+ id: "1.2.1",
277
+ label: "3-D Entity From Hyperspace",
278
+ description: "Entities projecting into our 3+1 dimensional spacetime from higher dimensions.",
279
+ domain: "physical",
280
+ depth: 2,
281
+ parentId: "1.2",
282
+ children: ["1.2.1.1", "1.2.1.2", "1.2.1.3"],
283
+ scientificallyTestable: true
284
+ },
285
+ {
286
+ id: "1.2.1.1",
287
+ label: "Compactified Dimensions",
288
+ description: "Entities from string theory / Kaluza-Klein compactified extra dimensions.",
289
+ domain: "physical",
290
+ depth: 3,
291
+ parentId: "1.2.1",
292
+ children: [],
293
+ scientificallyTestable: true
294
+ },
295
+ {
296
+ id: "1.2.1.2",
297
+ label: 'Hyperspace "Bulk"',
298
+ description: "Entities from the bulk space of Randall-Sundrum brane models.",
299
+ domain: "physical",
300
+ depth: 3,
301
+ parentId: "1.2.1",
302
+ children: [],
303
+ scientificallyTestable: true
304
+ },
305
+ {
306
+ id: "1.2.1.3",
307
+ label: "Disconnected Hyperspace",
308
+ description: "Entities from higher-dimensional spaces not connected to our brane.",
309
+ domain: "physical",
310
+ depth: 3,
311
+ parentId: "1.2.1",
312
+ children: [],
313
+ scientificallyTestable: true
314
+ },
315
+ {
316
+ id: "1.2.2",
317
+ label: 'Hyper-D "Brane"',
318
+ description: "Brane interactions from string/M-theory producing observable effects.",
319
+ domain: "physical",
320
+ depth: 2,
321
+ parentId: "1.2",
322
+ children: ["1.2.2.1", "1.2.2.2"],
323
+ scientificallyTestable: true
324
+ },
325
+ {
326
+ id: "1.2.2.1",
327
+ label: 'Projection / "Shadow"',
328
+ description: "Lower-dimensional projections of higher-dimensional objects.",
329
+ domain: "physical",
330
+ depth: 3,
331
+ parentId: "1.2.2",
332
+ children: ["1.2.2.1.1", "1.2.2.1.2", "1.2.2.1.3"],
333
+ scientificallyTestable: true
334
+ },
335
+ {
336
+ id: "1.2.2.1.1",
337
+ label: "0-to-2 Dimensional",
338
+ description: "Point or plane-like projections from higher dimensions.",
339
+ domain: "physical",
340
+ depth: 4,
341
+ parentId: "1.2.2.1",
342
+ children: [],
343
+ scientificallyTestable: true
344
+ },
345
+ {
346
+ id: "1.2.2.1.2",
347
+ label: "3-Dimensional",
348
+ description: "Full volumetric projections appearing as solid objects.",
349
+ domain: "physical",
350
+ depth: 4,
351
+ parentId: "1.2.2.1",
352
+ children: [],
353
+ scientificallyTestable: true
354
+ },
355
+ {
356
+ id: "1.2.2.1.3",
357
+ label: "Fractal Dimensional",
358
+ description: "Non-integer dimensional projections with fractal geometry.",
359
+ domain: "physical",
360
+ depth: 4,
361
+ parentId: "1.2.2.1",
362
+ children: [],
363
+ scientificallyTestable: true
364
+ },
365
+ {
366
+ id: "1.2.2.2",
367
+ label: '\u2264 3-D "Avatar"',
368
+ description: "Controlled projections or constructs operating as proxies.",
369
+ domain: "physical",
370
+ depth: 3,
371
+ parentId: "1.2.2",
372
+ children: ["1.2.2.2.1", "1.2.2.2.2", "1.2.2.2.3"],
373
+ scientificallyTestable: true
374
+ },
375
+ {
376
+ id: "1.2.2.2.1",
377
+ label: 'Hologram / "Telepresence"',
378
+ description: "Remote presence via holographic or light-based projection.",
379
+ domain: "physical",
380
+ depth: 4,
381
+ parentId: "1.2.2.2",
382
+ children: [],
383
+ scientificallyTestable: true
384
+ },
385
+ {
386
+ id: "1.2.2.2.2",
387
+ label: "Automaton",
388
+ description: "Self-operating mechanical or energetic construct.",
389
+ domain: "physical",
390
+ depth: 4,
391
+ parentId: "1.2.2.2",
392
+ children: [],
393
+ scientificallyTestable: true
394
+ },
395
+ {
396
+ id: "1.2.2.2.3",
397
+ label: "Artificial Lifeform",
398
+ description: "Engineered biological or hybrid entity operating as a proxy.",
399
+ domain: "physical",
400
+ depth: 4,
401
+ parentId: "1.2.2.2",
402
+ children: [],
403
+ scientificallyTestable: true
404
+ },
405
+ // --- 1.3 Interdimensional ---
406
+ {
407
+ id: "1.3",
408
+ label: "Interdimensional",
409
+ description: "UAPs traversing between different dimensions or realities.",
410
+ domain: "physical",
411
+ depth: 1,
412
+ parentId: "1",
413
+ children: ["1.3.1", "1.3.2", "1.3.3"],
414
+ scientificallyTestable: true
415
+ },
416
+ {
417
+ id: "1.3.1",
418
+ label: "Multiverse",
419
+ description: "Entities or phenomena crossing between parallel universes.",
420
+ domain: "physical",
421
+ depth: 2,
422
+ parentId: "1.3",
423
+ children: ["1.3.1.1", "1.3.1.2", "1.3.1.3", "1.3.1.4"],
424
+ scientificallyTestable: true
425
+ },
426
+ {
427
+ id: "1.3.1.1",
428
+ label: "Portal / Wormhole",
429
+ description: "Traversal via Einstein-Rosen bridges or manufactured gateways.",
430
+ domain: "physical",
431
+ depth: 3,
432
+ parentId: "1.3.1",
433
+ children: [],
434
+ scientificallyTestable: true
435
+ },
436
+ {
437
+ id: "1.3.1.2",
438
+ label: "Colliding Universe(s)",
439
+ description: "Phenomena from brane collision events (ekpyrotic cosmology).",
440
+ domain: "physical",
441
+ depth: 3,
442
+ parentId: "1.3.1",
443
+ children: [],
444
+ scientificallyTestable: true
445
+ },
446
+ {
447
+ id: "1.3.1.3",
448
+ label: "Parallel Universe(s)",
449
+ description: "Entities from parallel but non-interacting universe branches.",
450
+ domain: "physical",
451
+ depth: 3,
452
+ parentId: "1.3.1",
453
+ children: [],
454
+ scientificallyTestable: true
455
+ },
456
+ {
457
+ id: "1.3.1.4",
458
+ label: 'QFT "Many Worlds"',
459
+ description: "Quantum-mechanical many-worlds interpretation producing observable crossover.",
460
+ domain: "physical",
461
+ depth: 3,
462
+ parentId: "1.3.1",
463
+ children: [],
464
+ scientificallyTestable: true
465
+ },
466
+ {
467
+ id: "1.3.2",
468
+ label: "Time Travel",
469
+ description: "Entities or vehicles traversing temporal dimensions.",
470
+ domain: "physical",
471
+ depth: 2,
472
+ parentId: "1.3",
473
+ children: ["1.3.2.1", "1.3.2.2", "1.3.2.3", "1.3.2.4", "1.3.2.5"],
474
+ scientificallyTestable: true
475
+ },
476
+ {
477
+ id: "1.3.2.1",
478
+ label: "Humans From Future",
479
+ description: "Time-traveling humans from our future timeline.",
480
+ domain: "physical",
481
+ depth: 3,
482
+ parentId: "1.3.2",
483
+ children: [],
484
+ scientificallyTestable: true
485
+ },
486
+ {
487
+ id: "1.3.2.2",
488
+ label: "Humans From Past",
489
+ description: "Time-traveling humans from our past (advanced pre-history).",
490
+ domain: "physical",
491
+ depth: 3,
492
+ parentId: "1.3.2",
493
+ children: [],
494
+ scientificallyTestable: true
495
+ },
496
+ {
497
+ id: "1.3.2.3",
498
+ label: "Humans From Alternate Timeline",
499
+ description: "Humans from divergent timeline branches.",
500
+ domain: "physical",
501
+ depth: 3,
502
+ parentId: "1.3.2",
503
+ children: [],
504
+ scientificallyTestable: true
505
+ },
506
+ {
507
+ id: "1.3.2.4",
508
+ label: "Non-Human Entity",
509
+ description: "Non-human intelligence traversing time dimensions.",
510
+ domain: "physical",
511
+ depth: 3,
512
+ parentId: "1.3.2",
513
+ children: [],
514
+ scientificallyTestable: true
515
+ },
516
+ {
517
+ id: "1.3.2.5",
518
+ label: "Additional Time Dimension(s)",
519
+ description: "Traversal via hypothetical extra temporal dimensions beyond our single time axis.",
520
+ domain: "physical",
521
+ depth: 3,
522
+ parentId: "1.3.2",
523
+ children: [],
524
+ scientificallyTestable: true
525
+ },
526
+ {
527
+ id: "1.3.3",
528
+ label: "Scale Invariance",
529
+ description: "Phenomena emerging from scale-dependent physics or quantum-cosmological effects.",
530
+ domain: "physical",
531
+ depth: 2,
532
+ parentId: "1.3",
533
+ children: ["1.3.3.1", "1.3.3.2", "1.3.3.3", "1.3.3.4", "1.3.3.5"],
534
+ scientificallyTestable: true
535
+ },
536
+ {
537
+ id: "1.3.3.1",
538
+ label: "Macro Quantum Fluctuation",
539
+ description: "Macroscopic manifestation of quantum vacuum fluctuations.",
540
+ domain: "physical",
541
+ depth: 3,
542
+ parentId: "1.3.3",
543
+ children: [],
544
+ scientificallyTestable: true
545
+ },
546
+ {
547
+ id: "1.3.3.2",
548
+ label: "Distance Recursion",
549
+ description: "Self-similar structure at different scales producing observable anomalies.",
550
+ domain: "physical",
551
+ depth: 3,
552
+ parentId: "1.3.3",
553
+ children: [],
554
+ scientificallyTestable: true
555
+ },
556
+ {
557
+ id: "1.3.3.3",
558
+ label: "Pan-Galactic Entanglement",
559
+ description: "Non-local quantum entanglement effects at galactic scales.",
560
+ domain: "physical",
561
+ depth: 3,
562
+ parentId: "1.3.3",
563
+ children: [],
564
+ scientificallyTestable: true
565
+ },
566
+ {
567
+ id: "1.3.3.4",
568
+ label: 'Unobserved "Vibratory Modes"',
569
+ description: "Hidden vibrational modes of spacetime not yet detected by instruments.",
570
+ domain: "physical",
571
+ depth: 3,
572
+ parentId: "1.3.3",
573
+ children: [],
574
+ scientificallyTestable: true
575
+ },
576
+ {
577
+ id: "1.3.3.5",
578
+ label: "Conformal Cyclic Cosmology",
579
+ description: "Signals or entities from previous cosmic aeons (Penrose CCC).",
580
+ domain: "physical",
581
+ depth: 3,
582
+ parentId: "1.3.3",
583
+ children: [],
584
+ scientificallyTestable: true
585
+ },
586
+ // ============================================================
587
+ // DOMAIN 2.0 — PSYCHOSOCIAL
588
+ // ============================================================
589
+ {
590
+ id: "2",
591
+ label: "Psychosocial",
592
+ description: "Theories attributing UAP to psychological, perceptual, and sociological factors.",
593
+ domain: "psychosocial",
594
+ depth: 0,
595
+ parentId: null,
596
+ children: ["2.1", "2.2", "2.3"],
597
+ scientificallyTestable: true,
598
+ aliases: ["PSH"]
599
+ },
600
+ // --- 2.1 Sociological ---
601
+ {
602
+ id: "2.1",
603
+ label: "Sociological",
604
+ description: "Social dynamics, group phenomena, and cultural factors producing UAP reports.",
605
+ domain: "psychosocial",
606
+ depth: 1,
607
+ parentId: "2",
608
+ children: ["2.1.1", "2.1.2", "2.1.3", "2.1.4", "2.1.5"],
609
+ scientificallyTestable: true
610
+ },
611
+ {
612
+ id: "2.1.1",
613
+ label: "Hypnosis",
614
+ description: "Hypnotic suggestion producing false UAP memories or experiences.",
615
+ domain: "psychosocial",
616
+ depth: 2,
617
+ parentId: "2.1",
618
+ children: [],
619
+ scientificallyTestable: true
620
+ },
621
+ {
622
+ id: "2.1.2",
623
+ label: "Mass Hysteria",
624
+ description: "Collective delusion or social contagion producing shared UAP reports.",
625
+ domain: "psychosocial",
626
+ depth: 2,
627
+ parentId: "2.1",
628
+ children: [],
629
+ scientificallyTestable: true
630
+ },
631
+ {
632
+ id: "2.1.3",
633
+ label: "Memetic Virus",
634
+ description: "Self-propagating cultural narratives that generate UAP reports.",
635
+ domain: "psychosocial",
636
+ depth: 2,
637
+ parentId: "2.1",
638
+ children: [],
639
+ scientificallyTestable: true
640
+ },
641
+ {
642
+ id: "2.1.4",
643
+ label: "Conditioning / Disinformation",
644
+ description: "Deliberate manipulation, propaganda, or psyops creating UAP narratives.",
645
+ domain: "psychosocial",
646
+ depth: 2,
647
+ parentId: "2.1",
648
+ children: [],
649
+ scientificallyTestable: true
650
+ },
651
+ {
652
+ id: "2.1.5",
653
+ label: "Hoax",
654
+ description: "Deliberate fabrication for attention, profit, or amusement.",
655
+ domain: "psychosocial",
656
+ depth: 2,
657
+ parentId: "2.1",
658
+ children: [],
659
+ scientificallyTestable: true
660
+ },
661
+ // --- 2.2 Psychological ---
662
+ {
663
+ id: "2.2",
664
+ label: "Psychological",
665
+ description: "Individual psychological processes producing UAP perceptions.",
666
+ domain: "psychosocial",
667
+ depth: 1,
668
+ parentId: "2",
669
+ children: ["2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.5"],
670
+ scientificallyTestable: true
671
+ },
672
+ {
673
+ id: "2.2.1",
674
+ label: "False Belief / Misinterpretation",
675
+ description: "Cognitive bias or perceptual error leading to misidentification.",
676
+ domain: "psychosocial",
677
+ depth: 2,
678
+ parentId: "2.2",
679
+ children: [],
680
+ scientificallyTestable: true
681
+ },
682
+ {
683
+ id: "2.2.2",
684
+ label: "Fallible / Screen Memory",
685
+ description: "False or constructed memories obscuring actual events.",
686
+ domain: "psychosocial",
687
+ depth: 2,
688
+ parentId: "2.2",
689
+ children: [],
690
+ scientificallyTestable: true
691
+ },
692
+ {
693
+ id: "2.2.3",
694
+ label: "Psychosomatic Disorder",
695
+ description: "Physical symptoms produced by psychological distress attributed to UAP.",
696
+ domain: "psychosocial",
697
+ depth: 2,
698
+ parentId: "2.2",
699
+ children: [],
700
+ scientificallyTestable: true
701
+ },
702
+ {
703
+ id: "2.2.4",
704
+ label: "Psychosis / Hallucination",
705
+ description: "Clinical psychiatric conditions producing UAP perceptions.",
706
+ domain: "psychosocial",
707
+ depth: 2,
708
+ parentId: "2.2",
709
+ children: [],
710
+ scientificallyTestable: true
711
+ },
712
+ {
713
+ id: "2.2.5",
714
+ label: "Collective Unconscious",
715
+ description: "Jungian archetypes manifesting as UAP experiences across cultures.",
716
+ domain: "psychosocial",
717
+ depth: 2,
718
+ parentId: "2.2",
719
+ children: [],
720
+ scientificallyTestable: true
721
+ },
722
+ // --- 2.3 Neurological ---
723
+ {
724
+ id: "2.3",
725
+ label: "Neurological",
726
+ description: "Neurobiological factors producing anomalous perceptions.",
727
+ domain: "psychosocial",
728
+ depth: 1,
729
+ parentId: "2",
730
+ children: ["2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5"],
731
+ scientificallyTestable: true
732
+ },
733
+ {
734
+ id: "2.3.1",
735
+ label: "Psychedelics / Pharmacology",
736
+ description: "Drug-induced altered states producing UAP-like perceptions.",
737
+ domain: "psychosocial",
738
+ depth: 2,
739
+ parentId: "2.3",
740
+ children: [],
741
+ scientificallyTestable: true
742
+ },
743
+ {
744
+ id: "2.3.2",
745
+ label: "Pathology / Trauma",
746
+ description: "Brain injury, disease, or trauma producing anomalous perceptions.",
747
+ domain: "psychosocial",
748
+ depth: 2,
749
+ parentId: "2.3",
750
+ children: [],
751
+ scientificallyTestable: true
752
+ },
753
+ {
754
+ id: "2.3.3",
755
+ label: "Neurodivergence",
756
+ description: "Atypical neural architecture producing enhanced or anomalous perception.",
757
+ domain: "psychosocial",
758
+ depth: 2,
759
+ parentId: "2.3",
760
+ children: [],
761
+ scientificallyTestable: true
762
+ },
763
+ {
764
+ id: "2.3.4",
765
+ label: "High Intuition / Functioning",
766
+ description: "Heightened perceptual sensitivity or cognitive function.",
767
+ domain: "psychosocial",
768
+ depth: 2,
769
+ parentId: "2.3",
770
+ children: [],
771
+ scientificallyTestable: true
772
+ },
773
+ {
774
+ id: "2.3.5",
775
+ label: '"Alien" Implants',
776
+ description: "Neurological effects attributed to foreign objects or stimulation.",
777
+ domain: "psychosocial",
778
+ depth: 2,
779
+ parentId: "2.3",
780
+ children: [],
781
+ scientificallyTestable: true
782
+ },
783
+ // ============================================================
784
+ // DOMAIN 3.0 — METAPHYSICAL
785
+ // ============================================================
786
+ {
787
+ id: "3",
788
+ label: "Metaphysical",
789
+ description: "Theories with origins beyond conventional scientific understanding.",
790
+ domain: "metaphysical",
791
+ depth: 0,
792
+ parentId: null,
793
+ children: ["3.1", "3.2", "3.3"],
794
+ scientificallyTestable: false,
795
+ aliases: ["MPH"]
796
+ },
797
+ // --- 3.1 Paranormal ---
798
+ {
799
+ id: "3.1",
800
+ label: "Paranormal",
801
+ description: "Phenomena involving extraordinary human potential or non-material entities.",
802
+ domain: "metaphysical",
803
+ depth: 1,
804
+ parentId: "3",
805
+ children: ["3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6"],
806
+ scientificallyTestable: true
807
+ },
808
+ {
809
+ id: "3.1.1",
810
+ label: "Psychotronics / Extraordinary Potential",
811
+ description: "Latent human psychic abilities (telekinesis, remote viewing) producing observable effects.",
812
+ domain: "metaphysical",
813
+ depth: 2,
814
+ parentId: "3.1",
815
+ children: [],
816
+ scientificallyTestable: true
817
+ },
818
+ {
819
+ id: "3.1.2",
820
+ label: "NDE / OBE",
821
+ description: "Near-death or out-of-body experiences suggesting non-physical consciousness.",
822
+ domain: "metaphysical",
823
+ depth: 2,
824
+ parentId: "3.1",
825
+ children: [],
826
+ scientificallyTestable: true
827
+ },
828
+ {
829
+ id: "3.1.3",
830
+ label: "Disembodied Spirits / Consciousness",
831
+ description: "Non-physical conscious entities interacting with physical reality.",
832
+ domain: "metaphysical",
833
+ depth: 2,
834
+ parentId: "3.1",
835
+ children: [],
836
+ scientificallyTestable: true
837
+ },
838
+ {
839
+ id: "3.1.4",
840
+ label: "Incorporeal / Bosonic Lifeforms",
841
+ description: "Entities composed of force-carrier particles or non-baryonic matter.",
842
+ domain: "metaphysical",
843
+ depth: 2,
844
+ parentId: "3.1",
845
+ children: [],
846
+ scientificallyTestable: true
847
+ },
848
+ {
849
+ id: "3.1.5",
850
+ label: "Mediumship / Possession",
851
+ description: "External entities communicating through or controlling human hosts.",
852
+ domain: "metaphysical",
853
+ depth: 2,
854
+ parentId: "3.1",
855
+ children: [],
856
+ scientificallyTestable: true
857
+ },
858
+ {
859
+ id: "3.1.6",
860
+ label: "New Physics",
861
+ description: "Undiscovered physical laws that explain anomalous phenomena.",
862
+ domain: "metaphysical",
863
+ depth: 2,
864
+ parentId: "3.1",
865
+ children: [],
866
+ scientificallyTestable: true
867
+ },
868
+ // --- 3.2 Occult ---
869
+ {
870
+ id: "3.2",
871
+ label: "Occult",
872
+ description: "Hidden knowledge traditions and reality models outside mainstream science.",
873
+ domain: "metaphysical",
874
+ depth: 1,
875
+ parentId: "3",
876
+ children: ["3.2.1", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6"],
877
+ scientificallyTestable: false
878
+ },
879
+ {
880
+ id: "3.2.1",
881
+ label: "Hidden Powers of Nature",
882
+ description: "Esoteric natural forces not yet recognized by science.",
883
+ domain: "metaphysical",
884
+ depth: 2,
885
+ parentId: "3.2",
886
+ children: [],
887
+ scientificallyTestable: false
888
+ },
889
+ {
890
+ id: "3.2.2",
891
+ label: 'Ascended "Masters"',
892
+ description: "Spiritually evolved beings guiding humanity from higher planes.",
893
+ domain: "metaphysical",
894
+ depth: 2,
895
+ parentId: "3.2",
896
+ children: [],
897
+ scientificallyTestable: false
898
+ },
899
+ {
900
+ id: "3.2.3",
901
+ label: '"Maya" / Sensory Delusion',
902
+ description: "Physical reality as fundamental illusion (Vedantic/Buddhist ontology).",
903
+ domain: "metaphysical",
904
+ depth: 2,
905
+ parentId: "3.2",
906
+ children: [],
907
+ scientificallyTestable: false
908
+ },
909
+ {
910
+ id: "3.2.4",
911
+ label: "Artificial Reality / Matrix Simulation",
912
+ description: "Reality as a computational simulation with UAP as glitches or features.",
913
+ domain: "metaphysical",
914
+ depth: 2,
915
+ parentId: "3.2",
916
+ children: [],
917
+ scientificallyTestable: true
918
+ },
919
+ {
920
+ id: "3.2.5",
921
+ label: "Altered / Alternate Reality",
922
+ description: "Consensus reality as one of many equally valid experiential frames.",
923
+ domain: "metaphysical",
924
+ depth: 2,
925
+ parentId: "3.2",
926
+ children: [],
927
+ scientificallyTestable: false
928
+ },
929
+ {
930
+ id: "3.2.6",
931
+ label: "Absolute World of Archetypes",
932
+ description: "Platonic realm of forms manifesting in physical experience.",
933
+ domain: "metaphysical",
934
+ depth: 2,
935
+ parentId: "3.2",
936
+ children: [],
937
+ scientificallyTestable: false
938
+ },
939
+ // --- 3.3 Transcendental ---
940
+ {
941
+ id: "3.3",
942
+ label: "Transcendental",
943
+ description: "Religious, spiritual, and theological explanations for UAP.",
944
+ domain: "metaphysical",
945
+ depth: 1,
946
+ parentId: "3",
947
+ children: ["3.3.1", "3.3.2", "3.3.3", "3.3.4", "3.3.5", "3.3.6"],
948
+ scientificallyTestable: false
949
+ },
950
+ {
951
+ id: "3.3.1",
952
+ label: '"Gaia" / Nature Spirits',
953
+ description: "Animistic intelligence of the Earth or natural world.",
954
+ domain: "metaphysical",
955
+ depth: 2,
956
+ parentId: "3.3",
957
+ children: [],
958
+ scientificallyTestable: false
959
+ },
960
+ {
961
+ id: "3.3.2",
962
+ label: "Angelic Beings",
963
+ description: "Benevolent spiritual entities from monotheistic traditions.",
964
+ domain: "metaphysical",
965
+ depth: 2,
966
+ parentId: "3.3",
967
+ children: [],
968
+ scientificallyTestable: false
969
+ },
970
+ {
971
+ id: "3.3.3",
972
+ label: '"Djinn" / Neutral Powers',
973
+ description: "Morally neutral spiritual entities (Islamic jinn, fae folk, trickster spirits).",
974
+ domain: "metaphysical",
975
+ depth: 2,
976
+ parentId: "3.3",
977
+ children: [],
978
+ scientificallyTestable: false
979
+ },
980
+ {
981
+ id: "3.3.4",
982
+ label: "Demonic Forces",
983
+ description: "Malevolent spiritual entities from various religious traditions.",
984
+ domain: "metaphysical",
985
+ depth: 2,
986
+ parentId: "3.3",
987
+ children: [],
988
+ scientificallyTestable: false
989
+ },
990
+ {
991
+ id: "3.3.5",
992
+ label: "Hierarchy of Being",
993
+ description: "Neo-Platonic great chain of being with UAP as higher-order entities.",
994
+ domain: "metaphysical",
995
+ depth: 2,
996
+ parentId: "3.3",
997
+ children: [],
998
+ scientificallyTestable: false
999
+ },
1000
+ {
1001
+ id: "3.3.6",
1002
+ label: "Emanations of Godhead",
1003
+ description: "Direct manifestations of divine creative force or cosmic consciousness.",
1004
+ domain: "metaphysical",
1005
+ depth: 2,
1006
+ parentId: "3.3",
1007
+ children: [],
1008
+ scientificallyTestable: false
1009
+ }
1010
+ ];
1011
+
1012
+ // src/taxonomy/traversal.ts
1013
+ var nodeMap = new Map(OCS_TAXONOMY.map((n) => [n.id, n]));
1014
+ function getNode(id) {
1015
+ return nodeMap.get(id);
1016
+ }
1017
+ function getChildren(id) {
1018
+ const node = nodeMap.get(id);
1019
+ if (!node) return [];
1020
+ return node.children.map((cid) => nodeMap.get(cid)).filter((n) => n !== void 0);
1021
+ }
1022
+ function getAncestors(id) {
1023
+ const ancestors = [];
1024
+ let current = nodeMap.get(id);
1025
+ while (current?.parentId) {
1026
+ const parent = nodeMap.get(current.parentId);
1027
+ if (!parent) break;
1028
+ ancestors.unshift(parent);
1029
+ current = parent;
1030
+ }
1031
+ return ancestors;
1032
+ }
1033
+ function getSiblings(id) {
1034
+ const node = nodeMap.get(id);
1035
+ if (!node?.parentId) return [];
1036
+ const parent = nodeMap.get(node.parentId);
1037
+ if (!parent) return [];
1038
+ return parent.children.filter((cid) => cid !== id).map((cid) => nodeMap.get(cid)).filter((n) => n !== void 0);
1039
+ }
1040
+ function getDomain(domain) {
1041
+ return OCS_TAXONOMY.filter((n) => n.domain === domain);
1042
+ }
1043
+ function getTestableNodes() {
1044
+ return OCS_TAXONOMY.filter((n) => n.scientificallyTestable);
1045
+ }
1046
+ function getLeafNodes() {
1047
+ return OCS_TAXONOMY.filter((n) => n.children.length === 0);
1048
+ }
1049
+ function searchNodes(query) {
1050
+ const lower = query.toLowerCase();
1051
+ return OCS_TAXONOMY.filter(
1052
+ (n) => n.label.toLowerCase().includes(lower) || n.description.toLowerCase().includes(lower) || n.aliases?.some((a) => a.toLowerCase().includes(lower))
1053
+ );
1054
+ }
1055
+ function getPath(id) {
1056
+ const ancestors = getAncestors(id);
1057
+ const node = nodeMap.get(id);
1058
+ if (!node) return "";
1059
+ return [...ancestors, node].map((n) => n.label).join(" > ");
1060
+ }
1061
+
1062
+ // src/taxonomy/physical/index.ts
1063
+ var PHYSICAL_NODES = OCS_TAXONOMY.filter((n) => n.domain === "physical");
1064
+
1065
+ // src/taxonomy/psychosocial/index.ts
1066
+ var PSYCHOSOCIAL_NODES = OCS_TAXONOMY.filter((n) => n.domain === "psychosocial");
1067
+
1068
+ // src/taxonomy/metaphysical/index.ts
1069
+ var METAPHYSICAL_NODES = OCS_TAXONOMY.filter((n) => n.domain === "metaphysical");
1070
+ var HypothesisWeightSchema = z.object({
1071
+ nodeId: z.string().min(1).describe('OCS node id (e.g., "1.1.3").'),
1072
+ confidence: ConfidenceSchema,
1073
+ label: z.string().optional()
1074
+ }).meta({ id: "HypothesisWeight" }).describe("A weighted origin hypothesis (OCS node + confidence).");
1075
+ var OriginClaimSchema = ClaimSchema.extend({
1076
+ primaryHypothesis: z.string().min(1).describe("OCS node id of the primary hypothesis."),
1077
+ confidence: ConfidenceSchema.describe("Confidence in the primary hypothesis, in [0,1]."),
1078
+ alternativeHypotheses: z.array(HypothesisWeightSchema).optional().describe(
1079
+ "Other OCS hypotheses this same evaluator weighs as possible, each with its own confidence \u2014 the intra-claim uncertainty axis."
1080
+ )
1081
+ }).meta({ id: "OriginClaim" }).describe("An attributed origin-hypothesis classification for an observation.");
1082
+ var ConfidenceDistributionSchema = z.object({
1083
+ hypotheses: z.array(HypothesisWeightSchema),
1084
+ unresolved: ConfidenceSchema.describe("Remaining confidence not assigned to any hypothesis."),
1085
+ evaluatedAt: z.iso.datetime()
1086
+ }).meta({ id: "ConfidenceDistribution" }).describe("Confidence distribution across origin hypotheses.");
1087
+ var CategoryConfidenceSchema = z.object({
1088
+ conventional: ConfidenceSchema,
1089
+ cryptoterrestrial: ConfidenceSchema,
1090
+ extraterrestrial: ConfidenceSchema,
1091
+ extradimensional: ConfidenceSchema,
1092
+ interdimensional: ConfidenceSchema,
1093
+ psychosocial: ConfidenceSchema,
1094
+ metaphysical: ConfidenceSchema,
1095
+ insufficientData: ConfidenceSchema
1096
+ }).meta({ id: "CategoryConfidence" }).describe("Quick category-level confidence distribution across broad OCS categories.");
1097
+
1098
+ // src/labels/index.ts
1099
+ var OCS_LABELS = Object.fromEntries(
1100
+ OCS_TAXONOMY.map((n) => [n.id, n.label])
1101
+ );
1102
+ var ORIGIN_DOMAIN_LABELS = {
1103
+ physical: "Physical",
1104
+ psychosocial: "Psychosocial",
1105
+ metaphysical: "Metaphysical"
1106
+ };
1107
+
1108
+ // src/constants/index.ts
1109
+ var ORIGIN_DOMAINS = OriginDomainSchema.options;
1110
+ var OCS_PROVENANCE = {
1111
+ author: "Col. Karl Nell (U.S. Army, ret.)",
1112
+ work: "Proposed Taxonomy of UAP Origin Hypotheses",
1113
+ venue: "Sol Foundation Symposium, Stanford University",
1114
+ date: "November 2023"
1115
+ };
1116
+ var ALL_OCS_IDS = OCS_TAXONOMY.map((n) => n.id);
1117
+ var TESTABLE_IDS = OCS_TAXONOMY.filter((n) => n.scientificallyTestable).map((n) => n.id);
1118
+ var LEAF_IDS = OCS_TAXONOMY.filter((n) => n.children.length === 0).map((n) => n.id);
1119
+ var PHYSICAL_IDS = OCS_TAXONOMY.filter((n) => n.domain === "physical").map((n) => n.id);
1120
+ var PSYCHOSOCIAL_IDS = OCS_TAXONOMY.filter((n) => n.domain === "psychosocial").map((n) => n.id);
1121
+ var METAPHYSICAL_IDS = OCS_TAXONOMY.filter((n) => n.domain === "metaphysical").map((n) => n.id);
1122
+
1123
+ // src/brands.ts
1124
+ function asOCSNodeId(value) {
1125
+ return value;
1126
+ }
1127
+ var isOriginDomain = createEnumGuard(OriginDomainSchema.options);
1128
+ var isOCSNodeId = createEnumGuard(ALL_OCS_IDS);
1129
+ function isOriginClaim(value) {
1130
+ return OriginClaimSchema.safeParse(value).success;
1131
+ }
1132
+ function isConfidenceDistribution(value) {
1133
+ return ConfidenceDistributionSchema.safeParse(value).success;
1134
+ }
1135
+
1136
+ // src/factories/index.ts
1137
+ function assertKnownNode(nodeId, label) {
1138
+ if (!getNode(nodeId)) {
1139
+ throw new Error(`Unknown OCS node ID in ${label}: "${nodeId}"`);
1140
+ }
1141
+ }
1142
+ function createOriginClaim(primaryHypothesis, confidence, options) {
1143
+ assertKnownNode(primaryHypothesis, "primaryHypothesis");
1144
+ const { alternativeHypotheses, rationale, evaluatedBy, evaluatedAt, evidenceRefs } = options ?? {};
1145
+ for (const alt of alternativeHypotheses ?? []) {
1146
+ assertKnownNode(alt.nodeId, "alternativeHypothesis");
1147
+ }
1148
+ return OriginClaimSchema.parse({
1149
+ primaryHypothesis,
1150
+ confidence,
1151
+ evaluatedAt: evaluatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
1152
+ ...alternativeHypotheses !== void 0 && { alternativeHypotheses },
1153
+ ...rationale !== void 0 && { rationale },
1154
+ ...evaluatedBy !== void 0 && { evaluatedBy },
1155
+ ...evidenceRefs !== void 0 && { evidenceRefs }
1156
+ });
1157
+ }
1158
+ function createConfidenceDistribution(hypotheses, options) {
1159
+ for (const h of hypotheses) {
1160
+ assertKnownNode(h.nodeId, "hypothesis");
1161
+ }
1162
+ const total = hypotheses.reduce((sum, h) => sum + h.confidence, 0);
1163
+ if (total > 1 + 1e-9) {
1164
+ throw new RangeError(`hypothesis confidences sum to ${total}, exceeding 1.0`);
1165
+ }
1166
+ return ConfidenceDistributionSchema.parse({
1167
+ hypotheses,
1168
+ unresolved: Math.max(0, 1 - total),
1169
+ evaluatedAt: options?.evaluatedAt ?? (/* @__PURE__ */ new Date()).toISOString()
1170
+ });
1171
+ }
1172
+
1173
+ // src/formatters/index.ts
1174
+ function formatOCSCode(id) {
1175
+ return getPath(id) || id;
1176
+ }
1177
+ function formatDomainLabel(domain) {
1178
+ return ORIGIN_DOMAIN_LABELS[domain];
1179
+ }
1180
+ function formatNodeLabel(id) {
1181
+ return OCS_LABELS[id] ?? id;
1182
+ }
1183
+ function formatTestability(node) {
1184
+ return node.scientificallyTestable ? "Scientifically testable" : "Not empirically falsifiable";
1185
+ }
1186
+ var ORIGINS_SCHEMA_VERSION = "2.0.0";
1187
+ var ORIGINS_SCHEMA_ID = schemaId(
1188
+ "origins",
1189
+ "origin-classification",
1190
+ ORIGINS_SCHEMA_VERSION
1191
+ );
1192
+ var OriginSlotSchema = z.array(OriginClaimSchema).describe("Competing origin claims for an observation (one per evaluator/verdict).");
1193
+ function originsJsonSchema() {
1194
+ const schema = z.toJSONSchema(OriginSlotSchema, {
1195
+ target: "draft-2020-12"
1196
+ });
1197
+ return jsonSchemaEnvelope(schema, { id: ORIGINS_SCHEMA_ID, version: ORIGINS_SCHEMA_VERSION });
1198
+ }
1199
+ function checkClaimNodes(claim, prefix, issues) {
1200
+ const c = claim;
1201
+ if (typeof c.primaryHypothesis === "string" && !getNode(c.primaryHypothesis)) {
1202
+ issues.push({
1203
+ path: `${prefix}primaryHypothesis`,
1204
+ message: `unknown OCS node id: ${c.primaryHypothesis}`
1205
+ });
1206
+ }
1207
+ if (Array.isArray(c.alternativeHypotheses)) {
1208
+ c.alternativeHypotheses.forEach((alt, i) => {
1209
+ const nodeId = alt?.nodeId;
1210
+ if (typeof nodeId === "string" && !getNode(nodeId)) {
1211
+ issues.push({
1212
+ path: `${prefix}alternativeHypotheses.${i}.nodeId`,
1213
+ message: `unknown OCS node id: ${nodeId}`
1214
+ });
1215
+ }
1216
+ });
1217
+ }
1218
+ }
1219
+ function validateOriginClassification(value) {
1220
+ const structural = validateWith(OriginSlotSchema, value);
1221
+ if (structural.length > 0) return structural;
1222
+ const issues = [];
1223
+ value.forEach((claim, i) => {
1224
+ checkClaimNodes(claim, `${i}.`, issues);
1225
+ });
1226
+ return issues;
1227
+ }
1228
+
1229
+ export { ALL_OCS_IDS, CategoryConfidenceSchema, ConfidenceDistributionSchema, HypothesisWeightSchema, LEAF_IDS, METAPHYSICAL_IDS, METAPHYSICAL_NODES, MetaphysicalSubdomainSchema, OCSNodeSchema, OCS_LABELS, OCS_PROVENANCE, OCS_TAXONOMY, ORIGINS_SCHEMA_ID, ORIGINS_SCHEMA_VERSION, ORIGIN_DOMAINS, ORIGIN_DOMAIN_LABELS, OriginClaimSchema, OriginDomainSchema, OriginSubdomainSchema, PHYSICAL_IDS, PHYSICAL_NODES, PSYCHOSOCIAL_IDS, PSYCHOSOCIAL_NODES, PhysicalSubdomainSchema, PsychosocialSubdomainSchema, TESTABLE_IDS, asOCSNodeId, createConfidenceDistribution, createOriginClaim, formatDomainLabel, formatNodeLabel, formatOCSCode, formatTestability, getAncestors, getChildren, getDomain, getLeafNodes, getNode, getPath, getSiblings, getTestableNodes, isConfidenceDistribution, isOCSNodeId, isOriginClaim, isOriginDomain, originsJsonSchema, searchNodes, validateOriginClassification };
1230
+ //# sourceMappingURL=index.js.map
1231
+ //# sourceMappingURL=index.js.map