@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/index.js CHANGED
@@ -4830,17 +4830,44 @@ z.object({
4830
4830
  message: "SL invariant b+d+u=1 violated at API boundary"
4831
4831
  }
4832
4832
  );
4833
- var EpistemicNodeTypeSchema = z.enum([
4833
+
4834
+ // ../contracts/src/schema-helpers/spine/tables/epistemicNodes.ts
4835
+ var NODE_TYPES = [
4836
+ "decision",
4834
4837
  "belief",
4835
- "evidence",
4836
4838
  "question",
4837
- "answer",
4839
+ "theme",
4840
+ "deal",
4838
4841
  "topic",
4842
+ "claim",
4843
+ "evidence",
4844
+ "synthesis",
4845
+ "answer",
4846
+ "atomic_fact",
4847
+ "excerpt",
4848
+ "source",
4849
+ "company",
4850
+ "person",
4851
+ "investor",
4852
+ "function",
4853
+ "value_chain"
4854
+ ];
4855
+ new Set(NODE_TYPES);
4856
+
4857
+ // ../contracts/src/types/graph-ref.ts
4858
+ var GRAPH_REF_EXTRA_NODE_TYPES = [
4839
4859
  "edge",
4840
4860
  "ontology",
4841
4861
  "lens",
4842
4862
  "contradiction"
4843
- ]);
4863
+ ];
4864
+ var GRAPH_REF_NODE_TYPES = [
4865
+ ...NODE_TYPES,
4866
+ ...GRAPH_REF_EXTRA_NODE_TYPES
4867
+ ];
4868
+ var EpistemicNodeTypeSchema = z.enum(
4869
+ GRAPH_REF_NODE_TYPES
4870
+ );
4844
4871
  var GraphRefSchema = z.discriminatedUnion("kind", [
4845
4872
  z.object({
4846
4873
  kind: z.literal("epistemic_node"),
@@ -4888,33 +4915,14 @@ function assertEdgePolicyAllowed(manifest, edgeType, from, to) {
4888
4915
  }
4889
4916
 
4890
4917
  // ../contracts/src/manifests/edge-policy-manifest.data.ts
4918
+ var publicEpistemicNodeEdgePolicy = (edgeType) => ({
4919
+ edgeType,
4920
+ fromKinds: ["epistemic_node"],
4921
+ toKinds: ["epistemic_node"],
4922
+ description: "Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics."
4923
+ });
4891
4924
  var edgePolicyManifest = {
4892
- policies: [
4893
- {
4894
- edgeType: "evidence_derived_from_evidence",
4895
- fromKinds: ["epistemic_node"],
4896
- fromNodeTypes: ["evidence"],
4897
- toKinds: ["epistemic_node"],
4898
- toNodeTypes: ["evidence"],
4899
- description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
4900
- },
4901
- {
4902
- edgeType: "evidence_supports_belief",
4903
- fromKinds: ["epistemic_node"],
4904
- fromNodeTypes: ["evidence"],
4905
- toKinds: ["epistemic_node"],
4906
- toNodeTypes: ["belief"],
4907
- description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
4908
- },
4909
- {
4910
- edgeType: "evidence_supports_question",
4911
- fromKinds: ["epistemic_node"],
4912
- fromNodeTypes: ["evidence"],
4913
- toKinds: ["epistemic_node"],
4914
- toNodeTypes: ["question"],
4915
- description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
4916
- }
4917
- ]
4925
+ policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
4918
4926
  };
4919
4927
 
4920
4928
  // ../contracts/src/tenant-client.contract.ts
@@ -10467,12 +10475,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
10467
10475
  compactRecord4({
10468
10476
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10469
10477
  toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
10470
- edgeType: "evidence_supports_belief",
10478
+ edgeType: "informs",
10471
10479
  globalId: input.globalId ?? `edge:${String(
10472
10480
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10473
10481
  )}:${String(
10474
10482
  input.beliefNodeId ?? input.beliefId ?? input.targetId
10475
- )}:evidence_supports_belief`,
10483
+ )}:informs`,
10476
10484
  weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
10477
10485
  context: input.rationale ?? input.context,
10478
10486
  skipLayerValidation: true,
@@ -10485,12 +10493,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
10485
10493
  compactRecord4({
10486
10494
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10487
10495
  toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
10488
- edgeType: "evidence_supports_question",
10496
+ edgeType: "responds_to",
10489
10497
  globalId: input.globalId ?? `edge:${String(
10490
10498
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10491
10499
  )}:${String(
10492
10500
  input.questionId ?? input.questionNodeId ?? input.targetId
10493
- )}:evidence_supports_question`,
10501
+ )}:responds_to`,
10494
10502
  weight: input.impactScore ?? input.weight,
10495
10503
  context: input.rationale ?? input.context,
10496
10504
  skipLayerValidation: true,
@@ -11995,10 +12003,13 @@ var tasksContracts = [
11995
12003
  }
11996
12004
  })
11997
12005
  ];
12006
+ var CREATE_EDGE_TYPES = edgePolicyManifest.policies.map(
12007
+ (policy) => policy.edgeType
12008
+ );
11998
12009
  var createEdgeArgs = z.object({
11999
12010
  from: GraphRefSchema,
12000
12011
  to: GraphRefSchema,
12001
- edgeType: z.string(),
12012
+ edgeType: z.enum(CREATE_EDGE_TYPES),
12002
12013
  globalId: z.string().optional(),
12003
12014
  weight: z.number().optional(),
12004
12015
  confidence: z.number().optional(),