@lucern/events 0.3.0-alpha.8 → 0.3.0-alpha.9

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.
package/dist/types.js CHANGED
@@ -4714,17 +4714,44 @@ z.object({
4714
4714
  message: "SL invariant b+d+u=1 violated at API boundary"
4715
4715
  }
4716
4716
  );
4717
- var EpistemicNodeTypeSchema = z.enum([
4717
+
4718
+ // ../contracts/src/schema-helpers/spine/tables/epistemicNodes.ts
4719
+ var NODE_TYPES = [
4720
+ "decision",
4718
4721
  "belief",
4719
- "evidence",
4720
4722
  "question",
4721
- "answer",
4723
+ "theme",
4724
+ "deal",
4722
4725
  "topic",
4726
+ "claim",
4727
+ "evidence",
4728
+ "synthesis",
4729
+ "answer",
4730
+ "atomic_fact",
4731
+ "excerpt",
4732
+ "source",
4733
+ "company",
4734
+ "person",
4735
+ "investor",
4736
+ "function",
4737
+ "value_chain"
4738
+ ];
4739
+ new Set(NODE_TYPES);
4740
+
4741
+ // ../contracts/src/types/graph-ref.ts
4742
+ var GRAPH_REF_EXTRA_NODE_TYPES = [
4723
4743
  "edge",
4724
4744
  "ontology",
4725
4745
  "lens",
4726
4746
  "contradiction"
4727
- ]);
4747
+ ];
4748
+ var GRAPH_REF_NODE_TYPES = [
4749
+ ...NODE_TYPES,
4750
+ ...GRAPH_REF_EXTRA_NODE_TYPES
4751
+ ];
4752
+ var EpistemicNodeTypeSchema = z.enum(
4753
+ GRAPH_REF_NODE_TYPES
4754
+ );
4728
4755
  var GraphRefSchema = z.discriminatedUnion("kind", [
4729
4756
  z.object({
4730
4757
  kind: z.literal("epistemic_node"),
@@ -4772,33 +4799,14 @@ function assertEdgePolicyAllowed(manifest, edgeType, from, to) {
4772
4799
  }
4773
4800
 
4774
4801
  // ../contracts/src/manifests/edge-policy-manifest.data.ts
4802
+ var publicEpistemicNodeEdgePolicy = (edgeType) => ({
4803
+ edgeType,
4804
+ fromKinds: ["epistemic_node"],
4805
+ toKinds: ["epistemic_node"],
4806
+ description: "Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics."
4807
+ });
4775
4808
  var edgePolicyManifest = {
4776
- policies: [
4777
- {
4778
- edgeType: "evidence_derived_from_evidence",
4779
- fromKinds: ["epistemic_node"],
4780
- fromNodeTypes: ["evidence"],
4781
- toKinds: ["epistemic_node"],
4782
- toNodeTypes: ["evidence"],
4783
- description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
4784
- },
4785
- {
4786
- edgeType: "evidence_supports_belief",
4787
- fromKinds: ["epistemic_node"],
4788
- fromNodeTypes: ["evidence"],
4789
- toKinds: ["epistemic_node"],
4790
- toNodeTypes: ["belief"],
4791
- description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
4792
- },
4793
- {
4794
- edgeType: "evidence_supports_question",
4795
- fromKinds: ["epistemic_node"],
4796
- fromNodeTypes: ["evidence"],
4797
- toKinds: ["epistemic_node"],
4798
- toNodeTypes: ["question"],
4799
- description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
4800
- }
4801
- ]
4809
+ policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
4802
4810
  };
4803
4811
 
4804
4812
  // ../contracts/src/tenant-client.contract.ts
@@ -10351,12 +10359,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
10351
10359
  compactRecord4({
10352
10360
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10353
10361
  toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
10354
- edgeType: "evidence_supports_belief",
10362
+ edgeType: "informs",
10355
10363
  globalId: input.globalId ?? `edge:${String(
10356
10364
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10357
10365
  )}:${String(
10358
10366
  input.beliefNodeId ?? input.beliefId ?? input.targetId
10359
- )}:evidence_supports_belief`,
10367
+ )}:informs`,
10360
10368
  weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
10361
10369
  context: input.rationale ?? input.context,
10362
10370
  skipLayerValidation: true,
@@ -10369,12 +10377,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
10369
10377
  compactRecord4({
10370
10378
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10371
10379
  toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
10372
- edgeType: "evidence_supports_question",
10380
+ edgeType: "responds_to",
10373
10381
  globalId: input.globalId ?? `edge:${String(
10374
10382
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10375
10383
  )}:${String(
10376
10384
  input.questionId ?? input.questionNodeId ?? input.targetId
10377
- )}:evidence_supports_question`,
10385
+ )}:responds_to`,
10378
10386
  weight: input.impactScore ?? input.weight,
10379
10387
  context: input.rationale ?? input.context,
10380
10388
  skipLayerValidation: true,
@@ -11879,10 +11887,13 @@ var tasksContracts = [
11879
11887
  }
11880
11888
  })
11881
11889
  ];
11890
+ var CREATE_EDGE_TYPES = edgePolicyManifest.policies.map(
11891
+ (policy) => policy.edgeType
11892
+ );
11882
11893
  var createEdgeArgs = z.object({
11883
11894
  from: GraphRefSchema,
11884
11895
  to: GraphRefSchema,
11885
- edgeType: z.string(),
11896
+ edgeType: z.enum(CREATE_EDGE_TYPES),
11886
11897
  globalId: z.string().optional(),
11887
11898
  weight: z.number().optional(),
11888
11899
  confidence: z.number().optional(),