@lucern/graph-primitives 1.0.32 → 1.0.34

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.
@@ -8,9 +8,9 @@ import { getCurrentUserId } from '@lucern/access-control/auth';
8
8
  import { throwStructuredMutationError } from '@lucern/access-control/structuredMutationError';
9
9
  import { normalizeTupleContradictionPolicy, mkOpinion, createInheritedContractRecord, readOpinionFromRecord, confidenceFromSL, conditionalDeduction, project, dampedDependencyCascade, trustDiscount, applyNegativeSupport, cumulativeFusion, applyNegativeEvidence, detectTupleContradiction, evaluateTupleContradictionTransition, hasProjectedOpinionChanged } from '@lucern/confidence';
10
10
  import { isNodeType, getLayerForNodeType } from '@lucern/contracts/schema-helpers/spine/tables/epistemicNodes';
11
+ import { generateUuidV7, generateGlobalId, assertUuidV7Identity, assertStorageEdgeVocabulary, isUuidV7, assertUuidShapedEdgeEndpoint } from '@lucern/contracts/ids';
11
12
  import { assertSchemaEnumValue } from '@lucern/contracts/schema-helpers/enumValidation';
12
13
  import { assertEdgePolicyAllowed, edgePolicyManifest } from '@lucern/contracts';
13
- import { generateGlobalId, assertUuidV7Identity, generateUuidV7, assertStorageEdgeVocabulary, isUuidV7, assertUuidShapedEdgeEndpoint } from '@lucern/contracts/ids';
14
14
  import { listAudienceRegistryRows } from '@lucern/access-control/audienceRegistry';
15
15
 
16
16
  // src/epistemicBeliefs.admin.ts
@@ -2498,13 +2498,16 @@ var backfillScoredBeliefEdges = internalMutation({
2498
2498
  if (!theme.globalId) {
2499
2499
  continue;
2500
2500
  }
2501
- const edgeGlobalId = `edge-${belief.globalId}-relates_to_thesis-${theme.globalId}`;
2502
- const existing = await ctx.db.query("epistemicEdges").filter((q) => q.eq(q.field("globalId"), edgeGlobalId)).first();
2501
+ const existing = await ctx.db.query("epistemicEdges").withIndex(
2502
+ "by_from_to",
2503
+ (q) => q.eq("fromNodeId", belief.globalId).eq("toNodeId", theme.globalId)
2504
+ ).filter((q) => q.eq(q.field("edgeType"), "relates_to_thesis")).first();
2503
2505
  if (existing) {
2504
2506
  skipped++;
2505
2507
  continue;
2506
2508
  }
2507
2509
  if (!dryRun) {
2510
+ const edgeGlobalId = generateUuidV7();
2508
2511
  await ctx.scheduler.runAfter(0, internal.neo4jEdgeAPI.createEdge, {
2509
2512
  globalId: edgeGlobalId,
2510
2513
  fromGlobalId: belief.globalId,
@@ -3431,7 +3434,7 @@ async function scheduleFirstScoringThemeEdges(ctx, args, node, state) {
3431
3434
  continue;
3432
3435
  }
3433
3436
  await ctx.scheduler.runAfter(0, internal.neo4jEdgeAPI.createEdge, {
3434
- globalId: `edge-${node.globalId}-relates_to_thesis-${theme.globalId}`,
3437
+ globalId: generateUuidV7(),
3435
3438
  fromGlobalId: node.globalId,
3436
3439
  toGlobalId: theme.globalId,
3437
3440
  edgeType: "relates_to_thesis",