@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/outbox.js CHANGED
@@ -4766,17 +4766,44 @@ z.object({
4766
4766
  message: "SL invariant b+d+u=1 violated at API boundary"
4767
4767
  }
4768
4768
  );
4769
- var EpistemicNodeTypeSchema = z.enum([
4769
+
4770
+ // ../contracts/src/schema-helpers/spine/tables/epistemicNodes.ts
4771
+ var NODE_TYPES = [
4772
+ "decision",
4770
4773
  "belief",
4771
- "evidence",
4772
4774
  "question",
4773
- "answer",
4775
+ "theme",
4776
+ "deal",
4774
4777
  "topic",
4778
+ "claim",
4779
+ "evidence",
4780
+ "synthesis",
4781
+ "answer",
4782
+ "atomic_fact",
4783
+ "excerpt",
4784
+ "source",
4785
+ "company",
4786
+ "person",
4787
+ "investor",
4788
+ "function",
4789
+ "value_chain"
4790
+ ];
4791
+ new Set(NODE_TYPES);
4792
+
4793
+ // ../contracts/src/types/graph-ref.ts
4794
+ var GRAPH_REF_EXTRA_NODE_TYPES = [
4775
4795
  "edge",
4776
4796
  "ontology",
4777
4797
  "lens",
4778
4798
  "contradiction"
4779
- ]);
4799
+ ];
4800
+ var GRAPH_REF_NODE_TYPES = [
4801
+ ...NODE_TYPES,
4802
+ ...GRAPH_REF_EXTRA_NODE_TYPES
4803
+ ];
4804
+ var EpistemicNodeTypeSchema = z.enum(
4805
+ GRAPH_REF_NODE_TYPES
4806
+ );
4780
4807
  var GraphRefSchema = z.discriminatedUnion("kind", [
4781
4808
  z.object({
4782
4809
  kind: z.literal("epistemic_node"),
@@ -4824,33 +4851,14 @@ function assertEdgePolicyAllowed(manifest, edgeType, from, to) {
4824
4851
  }
4825
4852
 
4826
4853
  // ../contracts/src/manifests/edge-policy-manifest.data.ts
4854
+ var publicEpistemicNodeEdgePolicy = (edgeType) => ({
4855
+ edgeType,
4856
+ fromKinds: ["epistemic_node"],
4857
+ toKinds: ["epistemic_node"],
4858
+ description: "Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics."
4859
+ });
4827
4860
  var edgePolicyManifest = {
4828
- policies: [
4829
- {
4830
- edgeType: "evidence_derived_from_evidence",
4831
- fromKinds: ["epistemic_node"],
4832
- fromNodeTypes: ["evidence"],
4833
- toKinds: ["epistemic_node"],
4834
- toNodeTypes: ["evidence"],
4835
- description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
4836
- },
4837
- {
4838
- edgeType: "evidence_supports_belief",
4839
- fromKinds: ["epistemic_node"],
4840
- fromNodeTypes: ["evidence"],
4841
- toKinds: ["epistemic_node"],
4842
- toNodeTypes: ["belief"],
4843
- description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
4844
- },
4845
- {
4846
- edgeType: "evidence_supports_question",
4847
- fromKinds: ["epistemic_node"],
4848
- fromNodeTypes: ["evidence"],
4849
- toKinds: ["epistemic_node"],
4850
- toNodeTypes: ["question"],
4851
- description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
4852
- }
4853
- ]
4861
+ policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
4854
4862
  };
4855
4863
 
4856
4864
  // ../contracts/src/tenant-client.contract.ts
@@ -10403,12 +10411,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
10403
10411
  compactRecord4({
10404
10412
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10405
10413
  toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
10406
- edgeType: "evidence_supports_belief",
10414
+ edgeType: "informs",
10407
10415
  globalId: input.globalId ?? `edge:${String(
10408
10416
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10409
10417
  )}:${String(
10410
10418
  input.beliefNodeId ?? input.beliefId ?? input.targetId
10411
- )}:evidence_supports_belief`,
10419
+ )}:informs`,
10412
10420
  weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
10413
10421
  context: input.rationale ?? input.context,
10414
10422
  skipLayerValidation: true,
@@ -10421,12 +10429,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
10421
10429
  compactRecord4({
10422
10430
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10423
10431
  toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
10424
- edgeType: "evidence_supports_question",
10432
+ edgeType: "responds_to",
10425
10433
  globalId: input.globalId ?? `edge:${String(
10426
10434
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10427
10435
  )}:${String(
10428
10436
  input.questionId ?? input.questionNodeId ?? input.targetId
10429
- )}:evidence_supports_question`,
10437
+ )}:responds_to`,
10430
10438
  weight: input.impactScore ?? input.weight,
10431
10439
  context: input.rationale ?? input.context,
10432
10440
  skipLayerValidation: true,
@@ -11931,10 +11939,13 @@ var tasksContracts = [
11931
11939
  }
11932
11940
  })
11933
11941
  ];
11942
+ var CREATE_EDGE_TYPES = edgePolicyManifest.policies.map(
11943
+ (policy) => policy.edgeType
11944
+ );
11934
11945
  var createEdgeArgs = z.object({
11935
11946
  from: GraphRefSchema,
11936
11947
  to: GraphRefSchema,
11937
- edgeType: z.string(),
11948
+ edgeType: z.enum(CREATE_EDGE_TYPES),
11938
11949
  globalId: z.string().optional(),
11939
11950
  weight: z.number().optional(),
11940
11951
  confidence: z.number().optional(),