@lucern/graph-primitives 0.3.0-alpha.17 → 0.3.0-alpha.3

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 (123) hide show
  1. package/dist/{beliefDecay-DZ6tkLYq.d.ts → beliefDecay-Q_26RTc-.d.ts} +1 -1
  2. package/dist/beliefDecay.d.ts +1 -1
  3. package/dist/beliefDecay.js +47 -158
  4. package/dist/beliefDecay.js.map +1 -1
  5. package/dist/{beliefEvidenceLinks-CWOXxxJg.d.ts → beliefEvidenceLinks-42FlR48t.d.ts} +1 -1
  6. package/dist/beliefEvidenceLinks.d.ts +1 -1
  7. package/dist/beliefEvidenceLinks.js +45 -141
  8. package/dist/beliefEvidenceLinks.js.map +1 -1
  9. package/dist/{beliefLifecycle-y8WLXqQj.d.ts → beliefLifecycle-C-AehZgF.d.ts} +1 -1
  10. package/dist/beliefLifecycle.d.ts +1 -1
  11. package/dist/confidencePropagationDispatch.d.ts +1 -1
  12. package/dist/confidencePropagationDispatch.js +3 -1
  13. package/dist/confidencePropagationDispatch.js.map +1 -1
  14. package/dist/{contradictions-51VLsESq.d.ts → contradictions-Hdwl7zid.d.ts} +1 -1
  15. package/dist/contradictions.d.ts +1 -1
  16. package/dist/contradictions.js +8 -67
  17. package/dist/contradictions.js.map +1 -1
  18. package/dist/edges/contradicts.js.map +1 -1
  19. package/dist/edges/dependsOn.js.map +1 -1
  20. package/dist/edges/elaborates.js.map +1 -1
  21. package/dist/edges/index.js +3 -1
  22. package/dist/edges/index.js.map +1 -1
  23. package/dist/edges/informs.js +3 -1
  24. package/dist/edges/informs.js.map +1 -1
  25. package/dist/edges/refutes.js +3 -1
  26. package/dist/edges/refutes.js.map +1 -1
  27. package/dist/edges/supports.js.map +1 -1
  28. package/dist/edges/utils.d.ts +3 -3
  29. package/dist/edges/utils.js +4 -2
  30. package/dist/edges/utils.js.map +1 -1
  31. package/dist/embeddingTrigger.js +1 -21
  32. package/dist/embeddingTrigger.js.map +1 -1
  33. package/dist/entityBridge.js +1 -1
  34. package/dist/entityBridge.js.map +1 -1
  35. package/dist/{entityLifecycle-CvgSK5FV.d.ts → entityLifecycle-BkhRJ-XI.d.ts} +1 -1
  36. package/dist/entityLifecycle.d.ts +1 -1
  37. package/dist/entityLifecycle.js +47 -134
  38. package/dist/entityLifecycle.js.map +1 -1
  39. package/dist/{epistemicAnswers-C5ib4z6_.d.ts → epistemicAnswers-DSP1slZ9.d.ts} +1 -1
  40. package/dist/epistemicAnswers.d.ts +1 -1
  41. package/dist/epistemicAnswers.js +8 -67
  42. package/dist/epistemicAnswers.js.map +1 -1
  43. package/dist/{epistemicBeliefs-DzKjZAeC.d.ts → epistemicBeliefs-DtFVTp-k.d.ts} +3 -3
  44. package/dist/epistemicBeliefs.d.ts +2 -2
  45. package/dist/epistemicBeliefs.js +114 -289
  46. package/dist/epistemicBeliefs.js.map +1 -1
  47. package/dist/epistemicContracts.d.ts +1 -1
  48. package/dist/epistemicContracts.js +115 -297
  49. package/dist/epistemicContracts.js.map +1 -1
  50. package/dist/{epistemicEdges-CvlKnEyy.d.ts → epistemicEdges-DcA8ErUG.d.ts} +1 -1
  51. package/dist/epistemicEdges.d.ts +1 -1
  52. package/dist/epistemicEdges.js +60 -192
  53. package/dist/epistemicEdges.js.map +1 -1
  54. package/dist/{epistemicEvidence-xw6UUrwh.d.ts → epistemicEvidence-Bo638XDP.d.ts} +1 -1
  55. package/dist/epistemicEvidence.d.ts +1 -1
  56. package/dist/epistemicEvidence.js +49 -163
  57. package/dist/epistemicEvidence.js.map +1 -1
  58. package/dist/{epistemicHelpers-DevrYgPN.d.ts → epistemicHelpers-Bd9xbaib.d.ts} +1 -1
  59. package/dist/epistemicHelpers.d.ts +1 -1
  60. package/dist/{epistemicLinking-CfE00tHJ.d.ts → epistemicLinking-CyeLOIzN.d.ts} +1 -1
  61. package/dist/epistemicLinking.d.ts +1 -1
  62. package/dist/epistemicLinking.js +1 -1
  63. package/dist/{epistemicNodes-DjSUfvyD.d.ts → epistemicNodes-BpD6Koud.d.ts} +1 -1
  64. package/dist/epistemicNodes.d.ts +1 -1
  65. package/dist/epistemicNodes.js +33 -163
  66. package/dist/epistemicNodes.js.map +1 -1
  67. package/dist/{epistemicQuestions-B_nUclrH.d.ts → epistemicQuestions-CmEeY6zQ.d.ts} +1 -1
  68. package/dist/epistemicQuestions.d.ts +1 -1
  69. package/dist/epistemicQuestions.js +62 -311
  70. package/dist/epistemicQuestions.js.map +1 -1
  71. package/dist/{epistemicSources-dlKj58Jp.d.ts → epistemicSources-ZazxHOK1.d.ts} +1 -1
  72. package/dist/epistemicSources.d.ts +1 -1
  73. package/dist/epistemicSources.js +8 -65
  74. package/dist/epistemicSources.js.map +1 -1
  75. package/dist/evaluators/index.js +115 -297
  76. package/dist/evaluators/index.js.map +1 -1
  77. package/dist/evaluators/lintCheckerEvaluator.js.map +1 -1
  78. package/dist/evaluators/sentryCheckerEvaluator.js.map +1 -1
  79. package/dist/evaluators/shared.js +1 -20
  80. package/dist/evaluators/shared.js.map +1 -1
  81. package/dist/evaluators/testRunnerEvaluator.js +1 -20
  82. package/dist/evaluators/testRunnerEvaluator.js.map +1 -1
  83. package/dist/evaluators/tscCheckerEvaluator.js.map +1 -1
  84. package/dist/index.d.ts +20 -20
  85. package/dist/index.js +206 -729
  86. package/dist/index.js.map +1 -1
  87. package/dist/{ontology-matching-C6rrz2VP.d.ts → ontology-matching-Buhu23ss.d.ts} +1 -1
  88. package/dist/ontology-matching.d.ts +1 -1
  89. package/dist/{ontologyApproval-CFYmqKmk.d.ts → ontologyApproval-Ba0Jjk1k.d.ts} +1 -1
  90. package/dist/ontologyApproval.d.ts +1 -1
  91. package/dist/ontologyDefinitions.js +3 -4
  92. package/dist/ontologyDefinitions.js.map +1 -1
  93. package/dist/ontologyHelpers.d.ts +1 -1
  94. package/dist/ontologyHelpers.js +3 -4
  95. package/dist/ontologyHelpers.js.map +1 -1
  96. package/dist/{projectionReconciliation-jww2fBI0.d.ts → projectionReconciliation-CxrXYGaB.d.ts} +1 -1
  97. package/dist/projectionReconciliation.d.ts +1 -1
  98. package/dist/projectionReconciliation.js +20 -14
  99. package/dist/projectionReconciliation.js.map +1 -1
  100. package/dist/{projectionStaleness-CmdbpjVK.d.ts → projectionStaleness-CAdpIsaW.d.ts} +1 -1
  101. package/dist/projectionStaleness.d.ts +1 -1
  102. package/dist/{questionEvidenceLinks-DFlyPpAj.d.ts → questionEvidenceLinks-BdQD0TkM.d.ts} +1 -1
  103. package/dist/questionEvidenceLinks.d.ts +1 -1
  104. package/dist/questionEvidenceLinks.js +45 -144
  105. package/dist/questionEvidenceLinks.js.map +1 -1
  106. package/dist/resolvers.js +37 -86
  107. package/dist/resolvers.js.map +1 -1
  108. package/dist/scopeResolverCompat.js +7 -64
  109. package/dist/scopeResolverCompat.js.map +1 -1
  110. package/dist/{text-matching-DNg4M5Wd.d.ts → text-matching-CMn2WnVD.d.ts} +1 -1
  111. package/dist/text-matching.d.ts +1 -1
  112. package/dist/topicProjectOverlay.js +13 -56
  113. package/dist/topicProjectOverlay.js.map +1 -1
  114. package/dist/topicScope.js +6 -55
  115. package/dist/topicScope.js.map +1 -1
  116. package/dist/workflowBridge.js +6 -55
  117. package/dist/workflowBridge.js.map +1 -1
  118. package/dist/workspaceIsolation.js +6 -55
  119. package/dist/workspaceIsolation.js.map +1 -1
  120. package/package.json +5 -5
  121. package/dist/debug.d.ts +0 -4
  122. package/dist/debug.js +0 -34
  123. package/dist/debug.js.map +0 -1
@@ -326,4 +326,4 @@ declare namespace epistemicHelpers {
326
326
  export { epistemicHelpers_EDGE_LAYER_RULES as EDGE_LAYER_RULES, type epistemicHelpers_EpistemicLayer as EpistemicLayer, epistemicHelpers_LAYER_TRAVERSAL_RULES as LAYER_TRAVERSAL_RULES, type epistemicHelpers_TraversalMode as TraversalMode, type epistemicHelpers_TraversalOptions as TraversalOptions, epistemicHelpers_canTraverseToLayer as canTraverseToLayer, epistemicHelpers_createEdgeForInsightQuestionLink as createEdgeForInsightQuestionLink, epistemicHelpers_createEpistemicEdge as createEpistemicEdge, epistemicHelpers_createEpistemicNodeForArtifact as createEpistemicNodeForArtifact, epistemicHelpers_createEpistemicNodeForBelief as createEpistemicNodeForBelief, epistemicHelpers_createEpistemicNodeForInsight as createEpistemicNodeForInsight, epistemicHelpers_createEpistemicNodeForQuestion as createEpistemicNodeForQuestion, epistemicHelpers_getDefaultEdgeTypesForMode as getDefaultEdgeTypesForMode, epistemicHelpers_getDefaultMinLayer as getDefaultMinLayer, epistemicHelpers_getLayerDepth as getLayerDepth, epistemicHelpers_getNeo4jLabel as getNeo4jLabel, epistemicHelpers_getNeo4jRelType as getNeo4jRelType, epistemicHelpers_getNodeLayer as getNodeLayer, epistemicHelpers_isDeprecatedEdgeType as isDeprecatedEdgeType, epistemicHelpers_isValidLayerConnection as isValidLayerConnection, epistemicHelpers_normalizeConfidence as normalizeConfidence, epistemicHelpers_shouldContinueTraversal as shouldContinueTraversal, epistemicHelpers_validateEdgeLayers as validateEdgeLayers };
327
327
  }
328
328
 
329
- export { EDGE_LAYER_RULES as E, LAYER_TRAVERSAL_RULES as L, type TraversalMode as T, type EpistemicLayer as a, type TraversalOptions as b, canTraverseToLayer as c, createEdgeForInsightQuestionLink as d, epistemicHelpers as e, createEpistemicEdge as f, createEpistemicNodeForArtifact as g, createEpistemicNodeForBelief as h, createEpistemicNodeForInsight as i, createEpistemicNodeForQuestion as j, getDefaultEdgeTypesForMode as k, getDefaultMinLayer as l, getLayerDepth as m, getNodeLayer as n, isValidLayerConnection as o, normalizeConfidence as p, shouldContinueTraversal as s, validateEdgeLayers as v };
329
+ export { type EpistemicLayer as E, LAYER_TRAVERSAL_RULES as L, type TraversalMode as T, getLayerDepth as a, type TraversalOptions as b, canTraverseToLayer as c, getDefaultMinLayer as d, epistemicHelpers as e, getDefaultEdgeTypesForMode as f, getNodeLayer as g, EDGE_LAYER_RULES as h, isValidLayerConnection as i, createEpistemicNodeForInsight as j, createEpistemicNodeForBelief as k, createEpistemicNodeForQuestion as l, createEpistemicNodeForArtifact as m, normalizeConfidence as n, createEpistemicEdge as o, createEdgeForInsightQuestionLink as p, shouldContinueTraversal as s, validateEdgeLayers as v };
@@ -1,4 +1,4 @@
1
1
  import './convex.js';
2
2
  export { a as getNeo4jLabel, b as getNeo4jRelType, i as isDeprecatedEdgeType } from './graphTypes-CpgIuCdo.js';
3
- export { E as EDGE_LAYER_RULES, a as EpistemicLayer, L as LAYER_TRAVERSAL_RULES, T as TraversalMode, b as TraversalOptions, c as canTraverseToLayer, d as createEdgeForInsightQuestionLink, f as createEpistemicEdge, g as createEpistemicNodeForArtifact, h as createEpistemicNodeForBelief, i as createEpistemicNodeForInsight, j as createEpistemicNodeForQuestion, k as getDefaultEdgeTypesForMode, l as getDefaultMinLayer, m as getLayerDepth, n as getNodeLayer, o as isValidLayerConnection, p as normalizeConfidence, s as shouldContinueTraversal, v as validateEdgeLayers } from './epistemicHelpers-DevrYgPN.js';
3
+ export { h as EDGE_LAYER_RULES, E as EpistemicLayer, L as LAYER_TRAVERSAL_RULES, T as TraversalMode, b as TraversalOptions, c as canTraverseToLayer, p as createEdgeForInsightQuestionLink, o as createEpistemicEdge, m as createEpistemicNodeForArtifact, k as createEpistemicNodeForBelief, j as createEpistemicNodeForInsight, l as createEpistemicNodeForQuestion, f as getDefaultEdgeTypesForMode, d as getDefaultMinLayer, a as getLayerDepth, g as getNodeLayer, i as isValidLayerConnection, n as normalizeConfidence, s as shouldContinueTraversal, v as validateEdgeLayers } from './epistemicHelpers-Bd9xbaib.js';
4
4
  import 'convex/values';
@@ -32,4 +32,4 @@ declare namespace epistemicLinking {
32
32
  export { epistemicLinking_linkBeliefToBelief as linkBeliefToBelief, epistemicLinking_linkEvidenceToEvidence as linkEvidenceToEvidence, epistemicLinking_linkQuestionToQuestion as linkQuestionToQuestion };
33
33
  }
34
34
 
35
- export { linkEvidenceToEvidence as a, linkQuestionToQuestion as b, epistemicLinking as e, linkBeliefToBelief as l };
35
+ export { linkQuestionToQuestion as a, linkEvidenceToEvidence as b, epistemicLinking as e, linkBeliefToBelief as l };
@@ -1 +1 @@
1
- export { l as linkBeliefToBelief, a as linkEvidenceToEvidence, b as linkQuestionToQuestion } from './epistemicLinking-CfE00tHJ.js';
1
+ export { l as linkBeliefToBelief, b as linkEvidenceToEvidence, a as linkQuestionToQuestion } from './epistemicLinking-CyeLOIzN.js';
@@ -1,5 +1,5 @@
1
1
  import { v } from 'convex/values';
2
- import { componentsGeneric, anyApi, mutationGeneric } from 'convex/server';
2
+ import { componentsGeneric, mutationGeneric, anyApi } from 'convex/server';
3
3
  import { checkProjectAccess } from '@lucern/access-control/access';
4
4
  import { permissiveReturn } from '@lucern/contracts/schema-helpers/validators';
5
5
 
@@ -164,4 +164,4 @@ declare namespace epistemicNodes {
164
164
  export { epistemicNodes_archive as archive, epistemicNodes_backfillTopicId as backfillTopicId, epistemicNodes_batchCreate as batchCreate, epistemicNodes_create as create, epistemicNodes_createInternal as createInternal, epistemicNodes_epistemicLayerValidator as epistemicLayerValidator, epistemicNodes_epistemicNodeTypeValidator as epistemicNodeTypeValidator, epistemicNodes_get as get, epistemicNodes_getByContentHash as getByContentHash, epistemicNodes_getByGlobalId as getByGlobalId, epistemicNodes_getByProject as getByProject, epistemicNodes_getByProjectAndType as getByProjectAndType, epistemicNodes_getByProjectAndTypeLite as getByProjectAndTypeLite, epistemicNodes_getByTopic as getByTopic, epistemicNodes_getInternal as getInternal, epistemicNodes_getNodesPendingEdgeSync as getNodesPendingEdgeSync, epistemicNodes_hardDelete as hardDelete, epistemicNodes_l1NodeTypeValidator as l1NodeTypeValidator, epistemicNodes_l2NodeTypeValidator as l2NodeTypeValidator, epistemicNodes_l3NodeTypeValidator as l3NodeTypeValidator, epistemicNodes_l4NodeTypeValidator as l4NodeTypeValidator, epistemicNodes_listAll as listAll, epistemicNodes_nodeTypeValidator as nodeTypeValidator, epistemicNodes_ontologicalNodeTypeValidator as ontologicalNodeTypeValidator, epistemicNodes_organizationalNodeTypeValidator as organizationalNodeTypeValidator, epistemicNodes_search as search, epistemicNodes_sourceTypeValidator as sourceTypeValidator, epistemicNodes_statusValidator as statusValidator, epistemicNodes_supersede as supersede, epistemicNodes_update as update, epistemicNodes_updateSyncStatus as updateSyncStatus, epistemicNodes_verificationStatusValidator as verificationStatusValidator, epistemicNodes_verify as verify };
165
165
  }
166
166
 
167
- export { search as A, sourceTypeValidator as B, statusValidator as C, supersede as D, update as E, updateSyncStatus as F, verificationStatusValidator as G, verify as H, archive as a, backfillTopicId as b, batchCreate as c, create as d, epistemicNodes as e, createInternal as f, epistemicLayerValidator as g, epistemicNodeTypeValidator as h, get as i, getByContentHash as j, getByGlobalId as k, getByProject as l, getByProjectAndType as m, getByProjectAndTypeLite as n, getByTopic as o, getInternal as p, getNodesPendingEdgeSync as q, hardDelete as r, l1NodeTypeValidator as s, l2NodeTypeValidator as t, l3NodeTypeValidator as u, l4NodeTypeValidator as v, listAll as w, nodeTypeValidator as x, ontologicalNodeTypeValidator as y, organizationalNodeTypeValidator as z };
167
+ export { hardDelete as A, verify as B, batchCreate as C, createInternal as D, getInternal as E, updateSyncStatus as F, backfillTopicId as G, getNodesPendingEdgeSync as H, epistemicLayerValidator as a, l3NodeTypeValidator as b, l2NodeTypeValidator as c, l1NodeTypeValidator as d, epistemicNodes as e, epistemicNodeTypeValidator as f, organizationalNodeTypeValidator as g, statusValidator as h, get as i, getByGlobalId as j, getByContentHash as k, l4NodeTypeValidator as l, getByProjectAndType as m, nodeTypeValidator as n, ontologicalNodeTypeValidator as o, getByProjectAndTypeLite as p, getByProject as q, getByTopic as r, sourceTypeValidator as s, listAll as t, search as u, verificationStatusValidator as v, create as w, update as x, supersede as y, archive as z };
@@ -1,2 +1,2 @@
1
1
  import 'convex/values';
2
- export { a as archive, b as backfillTopicId, c as batchCreate, d as create, f as createInternal, g as epistemicLayerValidator, h as epistemicNodeTypeValidator, i as get, j as getByContentHash, k as getByGlobalId, l as getByProject, m as getByProjectAndType, n as getByProjectAndTypeLite, o as getByTopic, p as getInternal, q as getNodesPendingEdgeSync, r as hardDelete, s as l1NodeTypeValidator, t as l2NodeTypeValidator, u as l3NodeTypeValidator, v as l4NodeTypeValidator, w as listAll, x as nodeTypeValidator, y as ontologicalNodeTypeValidator, z as organizationalNodeTypeValidator, A as search, B as sourceTypeValidator, C as statusValidator, D as supersede, E as update, F as updateSyncStatus, G as verificationStatusValidator, H as verify } from './epistemicNodes-DjSUfvyD.js';
2
+ export { z as archive, G as backfillTopicId, C as batchCreate, w as create, D as createInternal, a as epistemicLayerValidator, f as epistemicNodeTypeValidator, i as get, k as getByContentHash, j as getByGlobalId, q as getByProject, m as getByProjectAndType, p as getByProjectAndTypeLite, r as getByTopic, E as getInternal, H as getNodesPendingEdgeSync, A as hardDelete, d as l1NodeTypeValidator, c as l2NodeTypeValidator, b as l3NodeTypeValidator, l as l4NodeTypeValidator, t as listAll, n as nodeTypeValidator, o as ontologicalNodeTypeValidator, g as organizationalNodeTypeValidator, u as search, s as sourceTypeValidator, h as statusValidator, y as supersede, x as update, F as updateSyncStatus, v as verificationStatusValidator, B as verify } from './epistemicNodes-BpD6Koud.js';
@@ -1,7 +1,7 @@
1
1
  import { v } from 'convex/values';
2
2
  import { checkScopeAccess, requireProjectAccess } from '@lucern/access-control/access';
3
3
  import { permissiveReturn } from '@lucern/contracts/schema-helpers/validators';
4
- import { componentsGeneric, anyApi, queryGeneric, mutationGeneric, internalMutationGeneric, internalQueryGeneric } from 'convex/server';
4
+ import { componentsGeneric, queryGeneric, mutationGeneric, anyApi, internalMutationGeneric, internalQueryGeneric } from 'convex/server';
5
5
  import { isNodeType, getLayerForNodeType } from '@lucern/contracts/schema-helpers/spine/tables/epistemicNodes';
6
6
 
7
7
  // src/epistemicNodes.ts
@@ -13,18 +13,6 @@ var internalQuery = internalQueryGeneric;
13
13
  var mutation = mutationGeneric;
14
14
  var query = queryGeneric;
15
15
 
16
- // src/debug.ts
17
- function isGraphPrimitiveDebugEnabled() {
18
- const env = globalThis.process?.env;
19
- return env?.LUCERN_COMPAT_FALLBACK_DEBUG === "1" || env?.LUCERN_GRAPH_DEBUG === "1";
20
- }
21
- function debugGraphPrimitiveFallback(message, context) {
22
- if (!isGraphPrimitiveDebugEnabled()) {
23
- return;
24
- }
25
- console.debug(message, context ?? {});
26
- }
27
-
28
16
  // src/graphTypes.ts
29
17
  function getNodeLayer(nodeType) {
30
18
  const L4_TYPES = ["decision"];
@@ -329,14 +317,7 @@ async function findTopicsByScopeAlias(ctx, scopeId) {
329
317
  "by_graph_scope_project",
330
318
  (q) => q.eq(LEGACY_SCOPE_FIELD, scopeId)
331
319
  ).collect();
332
- } catch (error) {
333
- debugGraphPrimitiveFallback(
334
- "[topicScope] Failed to resolve scope alias via index",
335
- {
336
- error,
337
- scopeId
338
- }
339
- );
320
+ } catch {
340
321
  const topics = await ctx.db.query("topics").collect();
341
322
  return topics.filter((topic) => {
342
323
  const normalizedGlobalId = normalizeScopeValue(topic.globalId);
@@ -353,14 +334,7 @@ async function tryResolveHostTopicById(ctx, topicId) {
353
334
  return await ctx.runQuery(api.topics.get, {
354
335
  id: topicId
355
336
  }) ?? null;
356
- } catch (error) {
357
- debugGraphPrimitiveFallback(
358
- "[topicScope] Failed to resolve topic by host query",
359
- {
360
- error,
361
- topicId
362
- }
363
- );
337
+ } catch {
364
338
  return null;
365
339
  }
366
340
  }
@@ -372,14 +346,7 @@ async function tryResolveHostTopicByLegacyScope(ctx, legacyScopeId) {
372
346
  return await ctx.runQuery(api.topics.getByLegacyScopeId, {
373
347
  projectId: legacyScopeId
374
348
  }) ?? null;
375
- } catch (error) {
376
- debugGraphPrimitiveFallback(
377
- "[topicScope] Failed to resolve topic by legacy scope",
378
- {
379
- error,
380
- legacyScopeId
381
- }
382
- );
349
+ } catch {
383
350
  return null;
384
351
  }
385
352
  }
@@ -408,17 +375,8 @@ async function resolveTopicProjectScope(ctx, args) {
408
375
  if (args.topicId) {
409
376
  let topic = null;
410
377
  try {
411
- topic = await ctx.db.get(
412
- args.topicId
413
- );
414
- } catch (error) {
415
- debugGraphPrimitiveFallback(
416
- "[topicScope] Failed to load topic by direct id",
417
- {
418
- error,
419
- topicId: args.topicId
420
- }
421
- );
378
+ topic = await ctx.db.get(args.topicId);
379
+ } catch {
422
380
  }
423
381
  if (!topic) {
424
382
  topic = await tryResolveHostTopicById(ctx, String(args.topicId));
@@ -455,14 +413,7 @@ async function resolveTopicProjectScope(ctx, args) {
455
413
  directTopic = await ctx.db.get(
456
414
  args.projectId
457
415
  );
458
- } catch (error) {
459
- debugGraphPrimitiveFallback(
460
- "[topicScope] Failed to load direct project topic",
461
- {
462
- error,
463
- projectId: args.projectId
464
- }
465
- );
416
+ } catch {
466
417
  }
467
418
  if (directTopic) {
468
419
  const inherited = await resolveInheritedWorkspaceScope(ctx, directTopic);
@@ -721,15 +672,7 @@ var getByProjectAndType = query({
721
672
  projectId: args.projectId,
722
673
  topicId: args.topicId
723
674
  });
724
- } catch (error) {
725
- debugGraphPrimitiveFallback(
726
- "[epistemicNodes] Failed to resolve getByProjectAndType scope",
727
- {
728
- error,
729
- projectId: args.projectId,
730
- topicId: args.topicId
731
- }
732
- );
675
+ } catch {
733
676
  return [];
734
677
  }
735
678
  const pageSize = clampNodeLimit(args.limit);
@@ -766,15 +709,7 @@ var getByProjectAndTypeLite = query({
766
709
  projectId: args.projectId,
767
710
  topicId: args.topicId
768
711
  });
769
- } catch (error) {
770
- debugGraphPrimitiveFallback(
771
- "[epistemicNodes] Failed to resolve getByNodeType scope",
772
- {
773
- error,
774
- projectId: args.projectId,
775
- topicId: args.topicId
776
- }
777
- );
712
+ } catch {
778
713
  return [];
779
714
  }
780
715
  const pageSize = clampNodeLimit(args.limit);
@@ -806,27 +741,6 @@ function clampNodeLimit(limit, fallback = DEFAULT_NODE_PAGE_SIZE) {
806
741
  }
807
742
  return Math.max(1, Math.min(Math.floor(limit), MAX_NODE_PAGE_SIZE));
808
743
  }
809
- function buildNodeStatusSuccessResult() {
810
- return { success: true };
811
- }
812
- function buildNodeArchivedResult() {
813
- return {
814
- success: true,
815
- effectiveStatus: "archived"
816
- };
817
- }
818
- function buildNodeNotFoundResult() {
819
- const result = {};
820
- result.success = false;
821
- result.error = "Node not found";
822
- return result;
823
- }
824
- function buildNodeDeletedResult(deletedEdgeCount) {
825
- return {
826
- success: true,
827
- deletedEdgeCount
828
- };
829
- }
830
744
  function dedupeWorkspaceNodes(nodes) {
831
745
  const seen = /* @__PURE__ */ new Set();
832
746
  const deduped = [];
@@ -858,13 +772,14 @@ async function collectScopedNodes(ctx, scope, args) {
858
772
  args.nodeType ? ctx.db.query("epistemicNodes").withIndex(
859
773
  "by_topic_type",
860
774
  (q) => q.eq("topicId", scope.projectId).eq("nodeType", args.nodeType)
861
- ).order("desc").take(args.scanLimit) : ctx.db.query("epistemicNodes").withIndex("by_topic", (q) => q.eq("topicId", scope.projectId)).order("desc").take(args.scanLimit)
775
+ ).order("desc").take(args.scanLimit) : ctx.db.query("epistemicNodes").withIndex(
776
+ "by_topic",
777
+ (q) => q.eq("topicId", scope.projectId)
778
+ ).order("desc").take(args.scanLimit)
862
779
  );
863
780
  }
864
781
  const combined = dedupeWorkspaceNodes((await Promise.all(queries)).flat());
865
- return combined.filter(
866
- (node) => nodeMatchesWorkspaceReasoningScope(node, scope)
867
- );
782
+ return combined.filter((node) => nodeMatchesWorkspaceReasoningScope(node, scope));
868
783
  }
869
784
  var getByProject = query({
870
785
  args: {
@@ -886,15 +801,7 @@ var getByProject = query({
886
801
  projectId: args.projectId,
887
802
  topicId: args.topicId
888
803
  });
889
- } catch (error) {
890
- debugGraphPrimitiveFallback(
891
- "[epistemicNodes] Failed to resolve list scope",
892
- {
893
- error,
894
- projectId: args.projectId,
895
- topicId: args.topicId
896
- }
897
- );
804
+ } catch {
898
805
  return [];
899
806
  }
900
807
  if (args.userId) {
@@ -948,15 +855,7 @@ var search = query({
948
855
  projectId: args.projectId,
949
856
  topicId: args.topicId
950
857
  });
951
- } catch (error) {
952
- debugGraphPrimitiveFallback(
953
- "[epistemicNodes] Failed to resolve search scope",
954
- {
955
- error,
956
- projectId: args.projectId,
957
- topicId: args.topicId
958
- }
959
- );
858
+ } catch {
960
859
  return [];
961
860
  }
962
861
  }
@@ -1183,7 +1082,7 @@ var update = mutation({
1183
1082
  nodeId,
1184
1083
  operation: "upsert"
1185
1084
  });
1186
- return buildNodeStatusSuccessResult();
1085
+ return { success: true };
1187
1086
  }
1188
1087
  });
1189
1088
  var supersede = mutation({
@@ -1305,7 +1204,7 @@ var archive = mutation({
1305
1204
  projectId: node.projectId
1306
1205
  });
1307
1206
  }
1308
- return buildNodeArchivedResult();
1207
+ return { success: true, effectiveStatus: "archived" };
1309
1208
  }
1310
1209
  });
1311
1210
  var hardDelete = internalMutation({
@@ -1319,7 +1218,7 @@ var hardDelete = internalMutation({
1319
1218
  handler: async (ctx, args) => {
1320
1219
  const node = await ctx.db.get(args.nodeId);
1321
1220
  if (!node) {
1322
- return buildNodeNotFoundResult();
1221
+ return { success: false, error: "Node not found" };
1323
1222
  }
1324
1223
  assertBeliefNodeHardDeleteAllowed({
1325
1224
  node,
@@ -1355,7 +1254,10 @@ var hardDelete = internalMutation({
1355
1254
  await ctx.db.delete(edge._id);
1356
1255
  }
1357
1256
  await ctx.db.delete(args.nodeId);
1358
- return buildNodeDeletedResult(uniqueEdges.size);
1257
+ return {
1258
+ success: true,
1259
+ deletedEdgeCount: uniqueEdges.size
1260
+ };
1359
1261
  }
1360
1262
  });
1361
1263
  var verify = mutation({
@@ -1402,7 +1304,7 @@ var verify = mutation({
1402
1304
  projectId: node.projectId,
1403
1305
  triggeringAction: "epistemicNodes.verify"
1404
1306
  });
1405
- return buildNodeStatusSuccessResult();
1307
+ return { success: true };
1406
1308
  }
1407
1309
  });
1408
1310
  var batchCreate = mutation({
@@ -1440,27 +1342,6 @@ var batchCreate = mutation({
1440
1342
  },
1441
1343
  returns: permissiveReturn,
1442
1344
  handler: async (ctx, args) => {
1443
- const resolveNodeScope = async (node) => {
1444
- if (!(node.topicId || node.projectId)) {
1445
- return void 0;
1446
- }
1447
- try {
1448
- return await resolveTopicProjectScope(ctx, {
1449
- topicId: node.topicId,
1450
- projectId: node.projectId
1451
- });
1452
- } catch (error) {
1453
- debugGraphPrimitiveFallback(
1454
- "[epistemicNodes] Failed to resolve scope for batch create node",
1455
- {
1456
- error,
1457
- topicId: node.topicId,
1458
- projectId: node.projectId
1459
- }
1460
- );
1461
- return void 0;
1462
- }
1463
- };
1464
1345
  const now = Date.now();
1465
1346
  const results = [];
1466
1347
  for (const node of args.nodes) {
@@ -1469,7 +1350,10 @@ var batchCreate = mutation({
1469
1350
  mutationName: "epistemicNodes.batchCreate"
1470
1351
  });
1471
1352
  const epistemicLayer = getNodeLayer(node.nodeType);
1472
- const resolvedScope = await resolveNodeScope(node);
1353
+ const resolvedScope = node.topicId || node.projectId ? await resolveTopicProjectScope(ctx, {
1354
+ topicId: node.topicId,
1355
+ projectId: node.projectId
1356
+ }).catch(() => void 0) : void 0;
1473
1357
  const nodeId = await ctx.db.insert("epistemicNodes", {
1474
1358
  ...node,
1475
1359
  epistemicLayer,
@@ -1551,24 +1435,10 @@ var createInternal = internalMutation({
1551
1435
  returns: permissiveReturn,
1552
1436
  handler: async (ctx, args) => {
1553
1437
  const now = Date.now();
1554
- const resolvedScope = args.topicId || args.projectId ? await (async () => {
1555
- try {
1556
- return await resolveTopicProjectScope(ctx, {
1557
- topicId: args.topicId,
1558
- projectId: args.projectId
1559
- });
1560
- } catch (error) {
1561
- debugGraphPrimitiveFallback(
1562
- "[epistemicNodes] Failed to resolve create scope",
1563
- {
1564
- error,
1565
- topicId: args.topicId,
1566
- projectId: args.projectId
1567
- }
1568
- );
1569
- return void 0;
1570
- }
1571
- })() : void 0;
1438
+ const resolvedScope = args.topicId || args.projectId ? await resolveTopicProjectScope(ctx, {
1439
+ topicId: args.topicId,
1440
+ projectId: args.projectId
1441
+ }).catch(() => void 0) : void 0;
1572
1442
  const contentHash = args.contentHash || `${args.nodeType}:${args.canonicalText}`.slice(0, 64);
1573
1443
  const epistemicLayer = args.epistemicLayer || getNodeLayer(args.nodeType);
1574
1444
  const nodeId = await ctx.db.insert("epistemicNodes", {
@@ -1635,7 +1505,7 @@ var updateSyncStatus = internalMutation({
1635
1505
  updates.syncError = args.syncError;
1636
1506
  }
1637
1507
  await ctx.db.patch(args.nodeId, updates);
1638
- return buildNodeStatusSuccessResult();
1508
+ return { success: true };
1639
1509
  }
1640
1510
  });
1641
1511
  var backfillTopicId = internalMutation({