@lucern/contracts 0.3.0-alpha.1 → 0.3.0-alpha.10

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 (213) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/component-boundary.contract.d.ts +14 -0
  3. package/dist/component-boundary.contract.js +155 -0
  4. package/dist/component-boundary.contract.js.map +1 -0
  5. package/dist/component-host-boundary.contract.d.ts +41 -0
  6. package/dist/component-host-boundary.contract.js +54 -0
  7. package/dist/component-host-boundary.contract.js.map +1 -0
  8. package/dist/context-pack.contract.d.ts +5 -3
  9. package/dist/context-pack.contract.js.map +1 -1
  10. package/dist/{dsl-BgpoVOVQ.d.ts → dsl-djCRfuWC.d.ts} +1 -1
  11. package/dist/dsl.d.ts +1 -1
  12. package/dist/dsl.js +1 -4
  13. package/dist/dsl.js.map +1 -1
  14. package/dist/edge-policy-manifest-Dw5IhT1L.d.ts +133 -0
  15. package/dist/function-registry/beliefs.d.ts +41 -41
  16. package/dist/function-registry/beliefs.js +709 -31
  17. package/dist/function-registry/beliefs.js.map +1 -1
  18. package/dist/function-registry/coding.js +694 -31
  19. package/dist/function-registry/coding.js.map +1 -1
  20. package/dist/function-registry/context.d.ts +13 -13
  21. package/dist/function-registry/context.js +700 -35
  22. package/dist/function-registry/context.js.map +1 -1
  23. package/dist/function-registry/contracts.js +665 -28
  24. package/dist/function-registry/contracts.js.map +1 -1
  25. package/dist/function-registry/coordination.js +665 -28
  26. package/dist/function-registry/coordination.js.map +1 -1
  27. package/dist/function-registry/edges.d.ts +156 -0
  28. package/dist/function-registry/edges.js +876 -60
  29. package/dist/function-registry/edges.js.map +1 -1
  30. package/dist/function-registry/evidence.d.ts +33 -33
  31. package/dist/function-registry/evidence.js +717 -37
  32. package/dist/function-registry/evidence.js.map +1 -1
  33. package/dist/function-registry/graph.d.ts +131 -53
  34. package/dist/function-registry/graph.js +781 -35
  35. package/dist/function-registry/graph.js.map +1 -1
  36. package/dist/function-registry/helpers.d.ts +3 -3
  37. package/dist/function-registry/helpers.js +665 -28
  38. package/dist/function-registry/helpers.js.map +1 -1
  39. package/dist/function-registry/identity.js +665 -28
  40. package/dist/function-registry/identity.js.map +1 -1
  41. package/dist/function-registry/index.d.ts +321 -7
  42. package/dist/function-registry/index.js +1046 -33
  43. package/dist/function-registry/index.js.map +1 -1
  44. package/dist/function-registry/judgments.d.ts +9 -9
  45. package/dist/function-registry/judgments.js +677 -31
  46. package/dist/function-registry/judgments.js.map +1 -1
  47. package/dist/function-registry/legacy.js +665 -28
  48. package/dist/function-registry/legacy.js.map +1 -1
  49. package/dist/function-registry/lenses.d.ts +17 -17
  50. package/dist/function-registry/lenses.js +688 -31
  51. package/dist/function-registry/lenses.js.map +1 -1
  52. package/dist/function-registry/manifest.d.ts +6 -6
  53. package/dist/function-registry/manifest.js +18 -2
  54. package/dist/function-registry/manifest.js.map +1 -1
  55. package/dist/function-registry/ontologies.d.ts +45 -45
  56. package/dist/function-registry/ontologies.js +683 -34
  57. package/dist/function-registry/ontologies.js.map +1 -1
  58. package/dist/function-registry/pipeline.d.ts +13 -13
  59. package/dist/function-registry/pipeline.js +674 -31
  60. package/dist/function-registry/pipeline.js.map +1 -1
  61. package/dist/function-registry/questions.d.ts +49 -49
  62. package/dist/function-registry/questions.js +762 -36
  63. package/dist/function-registry/questions.js.map +1 -1
  64. package/dist/function-registry/tasks.d.ts +17 -17
  65. package/dist/function-registry/tasks.js +709 -30
  66. package/dist/function-registry/tasks.js.map +1 -1
  67. package/dist/function-registry/topics.d.ts +99 -21
  68. package/dist/function-registry/topics.js +747 -32
  69. package/dist/function-registry/topics.js.map +1 -1
  70. package/dist/function-registry/types.d.ts +1 -1
  71. package/dist/function-registry/worktrees.d.ts +80 -41
  72. package/dist/function-registry/worktrees.js +804 -40
  73. package/dist/function-registry/worktrees.js.map +1 -1
  74. package/dist/function-registry-input-audit.d.ts +13 -0
  75. package/dist/function-registry-input-audit.js +166 -0
  76. package/dist/function-registry-input-audit.js.map +1 -0
  77. package/dist/gateway.contract.d.ts +2 -0
  78. package/dist/gateway.contract.js.map +1 -1
  79. package/dist/generated/convexSchemas.js +4 -3
  80. package/dist/generated/convexSchemas.js.map +1 -1
  81. package/dist/generated/schema-manifest.json +49 -3
  82. package/dist/generated/tableOwnership.d.ts +2 -1
  83. package/dist/generated/tableOwnership.js +2 -0
  84. package/dist/generated/tableOwnership.js.map +1 -1
  85. package/dist/generated/tier-expectations.json +4 -2
  86. package/dist/graph-intelligence.contract.d.ts +506 -0
  87. package/dist/graph-intelligence.contract.js +595 -0
  88. package/dist/graph-intelligence.contract.js.map +1 -0
  89. package/dist/graph-types/index.d.ts +5 -1
  90. package/dist/graph-types/index.js +15 -4
  91. package/dist/graph-types/index.js.map +1 -1
  92. package/dist/{index-CV-0_VWJ.d.ts → index-O09U2xHk.d.ts} +5 -2
  93. package/dist/index.d.ts +24 -413
  94. package/dist/index.js +3286 -136
  95. package/dist/index.js.map +1 -1
  96. package/dist/infisical-runtime.contract.d.ts +174 -0
  97. package/dist/infisical-runtime.contract.js +317 -0
  98. package/dist/infisical-runtime.contract.js.map +1 -0
  99. package/dist/lens-filter.contract.js +4 -3
  100. package/dist/lens-filter.contract.js.map +1 -1
  101. package/dist/lens-workflow.contract.js +4 -3
  102. package/dist/lens-workflow.contract.js.map +1 -1
  103. package/dist/manifests/edge-policy-manifest.d.ts +2 -0
  104. package/dist/manifests/edge-policy-manifest.data.d.ts +13 -0
  105. package/dist/manifests/edge-policy-manifest.data.js +26 -0
  106. package/dist/manifests/edge-policy-manifest.data.js.map +1 -0
  107. package/dist/manifests/edge-policy-manifest.js +92 -0
  108. package/dist/manifests/edge-policy-manifest.js.map +1 -0
  109. package/dist/manifests/infisical-runtime-manifest.d.ts +151 -0
  110. package/dist/manifests/infisical-runtime-manifest.js +316 -0
  111. package/dist/manifests/infisical-runtime-manifest.js.map +1 -0
  112. package/dist/manifests/invariant-manifest.d.ts +65 -0
  113. package/dist/manifests/invariant-manifest.js +18 -0
  114. package/dist/manifests/invariant-manifest.js.map +1 -0
  115. package/dist/manifests/invariants/ast-utils.d.ts +14 -0
  116. package/dist/manifests/invariants/ast-utils.js +54 -0
  117. package/dist/manifests/invariants/ast-utils.js.map +1 -0
  118. package/dist/manifests/invariants/index.d.ts +15 -0
  119. package/dist/manifests/invariants/index.js +183 -0
  120. package/dist/manifests/invariants/index.js.map +1 -0
  121. package/dist/manifests/invariants/inv-1-beliefs-append-only.d.ts +12 -0
  122. package/dist/manifests/invariants/inv-1-beliefs-append-only.js +94 -0
  123. package/dist/manifests/invariants/inv-1-beliefs-append-only.js.map +1 -0
  124. package/dist/manifests/invariants/inv-14-no-silent-transitions.d.ts +12 -0
  125. package/dist/manifests/invariants/inv-14-no-silent-transitions.js +99 -0
  126. package/dist/manifests/invariants/inv-14-no-silent-transitions.js.map +1 -0
  127. package/dist/manifests/invariants/manifest-1-projections-declare-audit.d.ts +12 -0
  128. package/dist/manifests/invariants/manifest-1-projections-declare-audit.js +42 -0
  129. package/dist/manifests/invariants/manifest-1-projections-declare-audit.js.map +1 -0
  130. package/dist/manifests/tenant-client-manifest.d.ts +322 -0
  131. package/dist/manifests/tenant-client-manifest.js +432 -0
  132. package/dist/manifests/tenant-client-manifest.js.map +1 -0
  133. package/dist/mcp-gateway-boundary.contract.d.ts +181 -0
  134. package/dist/mcp-gateway-boundary.contract.js +43 -0
  135. package/dist/mcp-gateway-boundary.contract.js.map +1 -0
  136. package/dist/projections/check-convex-args-shape.d.ts +3 -0
  137. package/dist/projections/check-convex-args-shape.js +399 -0
  138. package/dist/projections/check-convex-args-shape.js.map +1 -0
  139. package/dist/projections/create-evidence.projection.d.ts +176 -0
  140. package/dist/projections/create-evidence.projection.js +131 -0
  141. package/dist/projections/create-evidence.projection.js.map +1 -0
  142. package/dist/projections/index.d.ts +102 -0
  143. package/dist/projections/index.js +348 -0
  144. package/dist/projections/index.js.map +1 -0
  145. package/dist/projections/list-beliefs.projection.d.ts +36 -0
  146. package/dist/projections/list-beliefs.projection.js +54 -0
  147. package/dist/projections/list-beliefs.projection.js.map +1 -0
  148. package/dist/projections/list-tasks.projection.d.ts +32 -0
  149. package/dist/projections/list-tasks.projection.js +52 -0
  150. package/dist/projections/list-tasks.projection.js.map +1 -0
  151. package/dist/projections/modulate-confidence.projection.d.ts +219 -0
  152. package/dist/projections/modulate-confidence.projection.js +148 -0
  153. package/dist/projections/modulate-confidence.projection.js.map +1 -0
  154. package/dist/projections/projection-dsl.d.ts +11 -0
  155. package/dist/projections/projection-dsl.js +8 -0
  156. package/dist/projections/projection-dsl.js.map +1 -0
  157. package/dist/schema-helpers/enumValidation.js +2 -5
  158. package/dist/schema-helpers/enumValidation.js.map +1 -1
  159. package/dist/schema-helpers/spine/nodes/decision.js +2 -1
  160. package/dist/schema-helpers/spine/nodes/decision.js.map +1 -1
  161. package/dist/schema-helpers/spine/tables/epistemicNodes.js +27 -27
  162. package/dist/schema-helpers/spine/tables/epistemicNodes.js.map +1 -1
  163. package/dist/schemas/component-table-manifest.d.ts +2 -2
  164. package/dist/schemas/enums.d.ts +5 -2
  165. package/dist/schemas/enums.js +5 -2
  166. package/dist/schemas/enums.js.map +1 -1
  167. package/dist/schemas/index.d.ts +1 -1
  168. package/dist/schemas/index.js +45 -4
  169. package/dist/schemas/index.js.map +1 -1
  170. package/dist/schemas/manifest.d.ts +1030 -890
  171. package/dist/schemas/manifest.js +44 -3
  172. package/dist/schemas/manifest.js.map +1 -1
  173. package/dist/schemas/sl-opinion.d.ts +4 -4
  174. package/dist/schemas/tables/identity/platform.d.ts +10 -10
  175. package/dist/schemas/tables/kernel/epistemic.d.ts +6 -6
  176. package/dist/schemas/tables/kernel/infra.d.ts +4 -4
  177. package/dist/schemas/tables/kernel/intelligence.d.ts +10 -10
  178. package/dist/schemas/tables/kernel/lens.d.ts +4 -4
  179. package/dist/schemas/tables/kernel/platform.d.ts +12 -12
  180. package/dist/schemas/tables/kernel/spine.d.ts +3 -3
  181. package/dist/schemas/tables/kernel/spine.js +5 -2
  182. package/dist/schemas/tables/kernel/spine.js.map +1 -1
  183. package/dist/schemas/tables/kernel/task.d.ts +42 -42
  184. package/dist/schemas/tables/kernel/topic.js +5 -1
  185. package/dist/schemas/tables/kernel/topic.js.map +1 -1
  186. package/dist/schemas/tables/kernel/worktree.d.ts +58 -58
  187. package/dist/schemas/tables/mc/identity.d.ts +26 -3
  188. package/dist/schemas/tables/mc/identity.js +35 -1
  189. package/dist/schemas/tables/mc/identity.js.map +1 -1
  190. package/dist/schemas/tables/mc/pack.d.ts +20 -20
  191. package/dist/schemas/tables/mc/registry.d.ts +4 -4
  192. package/dist/schemas/tables/mc/workspace.d.ts +9 -3
  193. package/dist/schemas/tables/mc/workspace.js +3 -1
  194. package/dist/schemas/tables/mc/workspace.js.map +1 -1
  195. package/dist/sdk-methods.contract.d.ts +2 -2
  196. package/dist/{sdk-tools.contract-S4ia0TTo.d.ts → sdk-tools.contract-BNklQDfB.d.ts} +2 -2
  197. package/dist/sdk-tools.contract.d.ts +2 -2
  198. package/dist/sdk-tools.contract.js +646 -23
  199. package/dist/sdk-tools.contract.js.map +1 -1
  200. package/dist/tenant-bootstrap-seed.contract.d.ts +1101 -0
  201. package/dist/tenant-bootstrap-seed.contract.js +653 -0
  202. package/dist/tenant-bootstrap-seed.contract.js.map +1 -0
  203. package/dist/tenant-bootstrap-seed.defaults.d.ts +16 -0
  204. package/dist/tenant-bootstrap-seed.defaults.js +303 -0
  205. package/dist/tenant-bootstrap-seed.defaults.js.map +1 -0
  206. package/dist/tenant-client.contract.d.ts +349 -0
  207. package/dist/tenant-client.contract.js +488 -0
  208. package/dist/tenant-client.contract.js.map +1 -0
  209. package/dist/{tool-contracts-C92-9ueT.d.ts → tool-contracts-BevD9Ho2.d.ts} +36 -2
  210. package/dist/tool-contracts.d.ts +1 -1
  211. package/dist/tool-contracts.js +647 -24
  212. package/dist/tool-contracts.js.map +1 -1
  213. package/package.json +9 -1
@@ -422,7 +422,22 @@ var ADD_WORKTREE = {
422
422
  description: "Check out a branch into an active worktree for investigation. Like `git worktree add <branch>` \u2014 creates independent working state on a thematic branch. Beliefs committed within the worktree can be freely amended (draft code on a feature branch). When investigation is complete, `merge` integrates findings into main.",
423
423
  parameters: {
424
424
  title: { type: "string", description: "Worktree name/objective" },
425
- topicId: { type: "string", description: "Optional topic scope hint" },
425
+ name: {
426
+ type: "string",
427
+ description: "Optional storage-name alias for callers that already use backend naming"
428
+ },
429
+ projectId: {
430
+ type: "string",
431
+ description: "Legacy topicId alias or resolver hint"
432
+ },
433
+ topicId: {
434
+ type: "string",
435
+ description: "Optional topic scope hint for resolver validation"
436
+ },
437
+ topicHint: {
438
+ type: "string",
439
+ description: "Natural-language topic hint for automatic topic resolution"
440
+ },
426
441
  branchId: {
427
442
  type: "string",
428
443
  description: "The branch this worktree investigates"
@@ -435,18 +450,107 @@ var ADD_WORKTREE = {
435
450
  type: "string",
436
451
  description: "The testable claim this worktree investigates"
437
452
  },
453
+ rationale: {
454
+ type: "string",
455
+ description: "Why this worktree exists and why it belongs in the campaign"
456
+ },
457
+ worktreeType: {
458
+ type: "string",
459
+ description: "Schema-enum worktree type used by the kernel lifecycle and retrieval layers"
460
+ },
461
+ gate: {
462
+ type: "string",
463
+ description: "Exit gate name for this worktree"
464
+ },
465
+ startDate: {
466
+ type: "number",
467
+ description: "Planned start timestamp in milliseconds since epoch"
468
+ },
469
+ endDate: {
470
+ type: "number",
471
+ description: "Planned end timestamp in milliseconds since epoch"
472
+ },
473
+ durationWeeks: {
474
+ type: "number",
475
+ description: "Planned duration in weeks"
476
+ },
477
+ confidenceImpact: {
478
+ type: "string",
479
+ description: "Expected confidence impact if the worktree succeeds",
480
+ enum: ["high", "medium", "low"]
481
+ },
482
+ beliefFocus: {
483
+ type: "string",
484
+ description: "Natural-language focus spanning the target belief neighborhood"
485
+ },
438
486
  beliefIds: {
439
487
  type: "array",
440
- description: "Beliefs to test in this worktree"
488
+ description: "Legacy alias for targetBeliefIds"
489
+ },
490
+ beliefs: {
491
+ type: "array",
492
+ description: "Legacy alias for targetBeliefIds"
493
+ },
494
+ targetBeliefIds: {
495
+ type: "array",
496
+ description: "Belief node IDs this worktree is expected to test or update"
497
+ },
498
+ targetQuestionIds: {
499
+ type: "array",
500
+ description: "Question node IDs this worktree is expected to answer"
501
+ },
502
+ keyQuestions: {
503
+ type: "array",
504
+ description: "Inline key question objects with question, optional status, answer, answerConfidence, and linkedQuestionId"
505
+ },
506
+ evidenceSignals: {
507
+ type: "array",
508
+ description: "Evidence signal objects with signal, optional collected state, progress, and notes"
509
+ },
510
+ decisionGate: {
511
+ type: "object",
512
+ description: "Decision gate object with goCriteria, noGoSignals, optional verdict, rationale, decidedAt, and decidedBy"
513
+ },
514
+ goCriteria: {
515
+ type: "array",
516
+ description: "Shorthand go criteria used to build decisionGate"
517
+ },
518
+ noGoSignals: {
519
+ type: "array",
520
+ description: "Shorthand no-go signals used to build decisionGate"
521
+ },
522
+ proofArtifacts: {
523
+ type: "array",
524
+ description: "Expected proof artifacts required to close the worktree"
441
525
  },
442
526
  autoShape: {
443
527
  type: "boolean",
444
528
  description: "Whether to invoke inquiry auto-shaping during worktree creation"
445
529
  },
530
+ autoFixPolicy: {
531
+ type: "object",
532
+ description: "Policy for permitted automatic remediation inside the worktree"
533
+ },
446
534
  domainPackId: {
447
535
  type: "string",
448
536
  description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
449
537
  },
538
+ tags: {
539
+ type: "array",
540
+ description: "Additional topic-resolution tags for the worktree"
541
+ },
542
+ touchedPaths: {
543
+ type: "array",
544
+ description: "File paths used as topic-resolution signals"
545
+ },
546
+ sourceRef: {
547
+ type: "string",
548
+ description: "Source reference used as a topic-resolution signal"
549
+ },
550
+ sourceKind: {
551
+ type: "string",
552
+ description: "Source kind used as a topic-resolution signal"
553
+ },
450
554
  campaign: {
451
555
  type: "number",
452
556
  description: "Top-level pipeline campaign number. Campaigns define the outer execution slice."
@@ -471,12 +575,20 @@ var ADD_WORKTREE = {
471
575
  type: "array",
472
576
  description: "Worktree IDs blocked by this worktree"
473
577
  },
474
- gate: {
578
+ staffingHint: {
475
579
  type: "string",
476
- description: "Exit gate name for this worktree"
580
+ description: "Suggested staffing or agent allocation note"
581
+ },
582
+ lensId: {
583
+ type: "string",
584
+ description: "Lens that scopes this worktree when applicable"
585
+ },
586
+ lastReconciledAt: {
587
+ type: "number",
588
+ description: "Timestamp when worktree metadata was last reconciled"
477
589
  }
478
590
  },
479
- required: ["title", "topicId"],
591
+ required: ["title"],
480
592
  response: {
481
593
  description: "The created worktree",
482
594
  fields: {
@@ -503,7 +615,7 @@ var MERGE = {
503
615
  worktreeId: { type: "string", description: "The worktree to merge" },
504
616
  outcomes: {
505
617
  type: "array",
506
- description: "Scoring outcomes for each belief: { beliefId, confidence, rationale }"
618
+ description: "Merge outcomes as key-finding strings, or scoring outcomes for beliefs: { beliefId, confidence, rationale }"
507
619
  },
508
620
  summary: { type: "string", description: "Overall findings summary" }
509
621
  },
@@ -721,19 +833,23 @@ var FIND_CONTRADICTIONS = {
721
833
  };
722
834
  var CREATE_EDGE = {
723
835
  name: "create_edge",
724
- description: "Commit a typed relationship between two nodes in the reasoning graph. Like `git commit` \u2014 an atomic write that declares a dependency between nodes. The engine enforces layer transition rules \u2014 for example, L1 \u2192 L3 direct edges are forbidden (must go through L2).",
836
+ description: "Commit a typed relationship between two nodes in the reasoning graph. Like `git commit` \u2014 an atomic write that declares a dependency between nodes. Accepts any public epistemic edge type between public graph node refs so agents can author the full spine.",
725
837
  parameters: {
726
- sourceId: {
727
- type: "string",
728
- description: "Source node of the relationship"
838
+ from: {
839
+ type: "object",
840
+ description: "Source graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'topic' }"
729
841
  },
730
- targetId: {
731
- type: "string",
732
- description: "Target node of the relationship"
842
+ to: {
843
+ type: "object",
844
+ description: "Target graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'belief' }"
733
845
  },
734
846
  edgeType: {
735
847
  type: "string",
736
- description: "Relationship type (informs, tests, depends_on, supersedes, etc.)"
848
+ description: "Relationship type from the public epistemic edge enum."
849
+ },
850
+ globalId: {
851
+ type: "string",
852
+ description: "Optional idempotent edge global ID."
737
853
  },
738
854
  weight: {
739
855
  type: "number",
@@ -744,9 +860,13 @@ var CREATE_EDGE = {
744
860
  type: "string",
745
861
  description: "How this was determined",
746
862
  enum: ["deductive", "inductive", "abductive", "analogical", "empirical"]
863
+ },
864
+ metadata: {
865
+ type: "object",
866
+ description: "Optional edge metadata."
747
867
  }
748
868
  },
749
- required: ["sourceId", "targetId", "edgeType"],
869
+ required: ["from", "to", "edgeType"],
750
870
  response: {
751
871
  description: "The created edge",
752
872
  fields: {
@@ -760,6 +880,240 @@ var CREATE_EDGE = {
760
880
  ontologyPrimitive: "edge",
761
881
  tier: "showcase"
762
882
  };
883
+ var UPDATE_EDGE = {
884
+ name: "update_edge",
885
+ description: "Amend metadata on an existing graph edge. Like `git commit --amend` \u2014 changes the edge annotation without recreating the relationship.",
886
+ parameters: {
887
+ edgeId: { type: "string", description: "Edge ID or global ID to update" },
888
+ weight: { type: "number", description: "Updated edge weight" },
889
+ confidence: { type: "number", description: "Updated confidence" },
890
+ context: { type: "string", description: "Updated human-readable context" },
891
+ derivationType: { type: "string", description: "Updated derivation type" },
892
+ metadata: { type: "object", description: "Updated metadata" }
893
+ },
894
+ required: ["edgeId"],
895
+ response: {
896
+ description: "Edge update result",
897
+ fields: { success: "boolean" }
898
+ },
899
+ ownerModule: "graph-primitives",
900
+ ontologyPrimitive: "edge",
901
+ tier: "workhorse"
902
+ };
903
+ var REMOVE_EDGE = {
904
+ name: "remove_edge",
905
+ description: "Remove one graph edge by ID. Like `git rm` \u2014 deletes a single explicit relationship from the spine.",
906
+ parameters: {
907
+ edgeId: { type: "string", description: "Edge ID or global ID to remove" }
908
+ },
909
+ required: ["edgeId"],
910
+ response: {
911
+ description: "Edge removal result",
912
+ fields: { success: "boolean" }
913
+ },
914
+ ownerModule: "graph-primitives",
915
+ ontologyPrimitive: "edge",
916
+ tier: "workhorse"
917
+ };
918
+ var REMOVE_EDGES_BETWEEN = {
919
+ name: "remove_edges_between",
920
+ description: "Remove graph edges between two nodes. Like `git rm <pathspec>` \u2014 deletes relationships matching a source, target, and optional type.",
921
+ parameters: {
922
+ fromNodeId: { type: "string", description: "Source node ID or global ID" },
923
+ toNodeId: { type: "string", description: "Target node ID or global ID" },
924
+ edgeType: { type: "string", description: "Optional edge type filter" }
925
+ },
926
+ required: ["fromNodeId", "toNodeId"],
927
+ response: {
928
+ description: "Matched edge removal result",
929
+ fields: { deleted: "number" }
930
+ },
931
+ ownerModule: "graph-primitives",
932
+ ontologyPrimitive: "edge",
933
+ tier: "workhorse"
934
+ };
935
+ var BATCH_CREATE_EDGES = {
936
+ name: "batch_create_edges",
937
+ description: "Commit multiple typed graph edges. Like `git commit` with many staged paths \u2014 writes a batch of explicit relationships atomically per edge.",
938
+ parameters: {
939
+ edges: {
940
+ type: "array",
941
+ description: "Edges to create, each with from, to, edgeType, and optional weight/confidence/context."
942
+ },
943
+ skipLayerValidation: {
944
+ type: "boolean",
945
+ description: "Skip kernel layer validation for trusted materialization flows."
946
+ }
947
+ },
948
+ required: ["edges"],
949
+ response: {
950
+ description: "Batch edge creation result",
951
+ fields: {
952
+ created: "number",
953
+ results: "array",
954
+ errors: "array"
955
+ }
956
+ },
957
+ ownerModule: "graph-primitives",
958
+ ontologyPrimitive: "edge",
959
+ tier: "workhorse"
960
+ };
961
+ var CREATE_EPISTEMIC_NODE = {
962
+ name: "create_epistemic_node",
963
+ description: "Commit a generic epistemic graph node. Like `git commit` \u2014 creates a canonical node in the public spine for topics, beliefs, evidence, questions, answers, sources, and entities.",
964
+ parameters: {
965
+ globalId: { type: "string", description: "Optional idempotent node global ID" },
966
+ nodeType: { type: "string", description: "Public epistemic node type" },
967
+ canonicalText: { type: "string", description: "Canonical node text" },
968
+ text: { type: "string", description: "Alias for canonicalText" },
969
+ contentHash: { type: "string", description: "Optional idempotency content hash" },
970
+ sourceType: { type: "string", description: "Source type for provenance" },
971
+ topicId: { type: "string", description: "Optional topic scope" },
972
+ content: { type: "string", description: "Extended content" },
973
+ title: { type: "string", description: "Display title" },
974
+ metadata: { type: "object", description: "Optional node metadata" }
975
+ },
976
+ required: ["nodeType"],
977
+ response: {
978
+ description: "Created node result",
979
+ fields: {
980
+ nodeId: "string",
981
+ nodeGlobalId: "string",
982
+ isDuplicate: "boolean"
983
+ }
984
+ },
985
+ ownerModule: "reasoning-kernel",
986
+ ontologyPrimitive: "graph",
987
+ tier: "showcase"
988
+ };
989
+ var GET_EPISTEMIC_NODE = {
990
+ name: "get_epistemic_node",
991
+ description: "Read one epistemic graph node. Like `git show` \u2014 resolves a canonical spine node by ID or global ID.",
992
+ parameters: {
993
+ nodeId: { type: "string", description: "Node ID or global ID" }
994
+ },
995
+ required: ["nodeId"],
996
+ response: {
997
+ description: "The resolved node",
998
+ fields: { node: "object" }
999
+ },
1000
+ ownerModule: "reasoning-kernel",
1001
+ ontologyPrimitive: "graph",
1002
+ tier: "workhorse"
1003
+ };
1004
+ var LIST_EPISTEMIC_NODES = {
1005
+ name: "list_epistemic_nodes",
1006
+ description: "List epistemic graph nodes. Like `git ls-tree` \u2014 lists canonical spine nodes by topic, type, status, or search query.",
1007
+ parameters: {
1008
+ topicId: { type: "string", description: "Optional topic scope" },
1009
+ nodeType: { type: "string", description: "Optional node type filter" },
1010
+ status: { type: "string", description: "Optional lifecycle status" },
1011
+ searchQuery: { type: "string", description: "Optional text search query" },
1012
+ limit: { type: "number", description: "Maximum nodes to return" }
1013
+ },
1014
+ required: [],
1015
+ response: {
1016
+ description: "Matching nodes",
1017
+ fields: { nodes: "array" }
1018
+ },
1019
+ ownerModule: "reasoning-kernel",
1020
+ ontologyPrimitive: "graph",
1021
+ tier: "workhorse"
1022
+ };
1023
+ var UPDATE_EPISTEMIC_NODE = {
1024
+ name: "update_epistemic_node",
1025
+ description: "Amend an epistemic graph node. Like `git commit --amend` \u2014 updates mutable node metadata, text, status, or verification fields.",
1026
+ parameters: {
1027
+ nodeId: { type: "string", description: "Node ID or global ID" },
1028
+ canonicalText: { type: "string", description: "Updated canonical text" },
1029
+ text: { type: "string", description: "Alias for canonicalText" },
1030
+ contentHash: { type: "string", description: "Updated content hash" },
1031
+ content: { type: "string", description: "Updated content" },
1032
+ title: { type: "string", description: "Updated display title" },
1033
+ metadata: { type: "object", description: "Updated metadata" },
1034
+ confidence: { type: "number", description: "Updated confidence" },
1035
+ verificationStatus: { type: "string", description: "Updated verification status" },
1036
+ status: { type: "string", description: "Updated lifecycle status" }
1037
+ },
1038
+ required: ["nodeId"],
1039
+ response: {
1040
+ description: "Node update result",
1041
+ fields: { success: "boolean" }
1042
+ },
1043
+ ownerModule: "reasoning-kernel",
1044
+ ontologyPrimitive: "graph",
1045
+ tier: "workhorse"
1046
+ };
1047
+ var ARCHIVE_EPISTEMIC_NODE = {
1048
+ name: "archive_epistemic_node",
1049
+ description: "Archive an epistemic graph node. Like `git rm --cached` \u2014 removes a node from active traversal without hard-deleting it.",
1050
+ parameters: {
1051
+ nodeId: { type: "string", description: "Node ID or global ID" }
1052
+ },
1053
+ required: ["nodeId"],
1054
+ response: {
1055
+ description: "Archive result",
1056
+ fields: { success: "boolean", effectiveStatus: "string" }
1057
+ },
1058
+ ownerModule: "reasoning-kernel",
1059
+ ontologyPrimitive: "graph",
1060
+ tier: "workhorse"
1061
+ };
1062
+ var VERIFY_EPISTEMIC_NODE = {
1063
+ name: "verify_epistemic_node",
1064
+ description: "Record verification state on an epistemic graph node. Like `git tag` \u2014 marks the node with a reviewed verification state.",
1065
+ parameters: {
1066
+ nodeId: { type: "string", description: "Node ID or global ID" },
1067
+ verificationStatus: { type: "string", description: "Verification status" },
1068
+ confidence: { type: "number", description: "Optional confidence update" }
1069
+ },
1070
+ required: ["nodeId", "verificationStatus"],
1071
+ response: {
1072
+ description: "Verification result",
1073
+ fields: { success: "boolean" }
1074
+ },
1075
+ ownerModule: "reasoning-kernel",
1076
+ ontologyPrimitive: "graph",
1077
+ tier: "workhorse"
1078
+ };
1079
+ var SUPERSEDE_EPISTEMIC_NODE = {
1080
+ name: "supersede_epistemic_node",
1081
+ description: "Supersede an epistemic graph node with a new version. Like `git commit --amend` on an immutable history branch \u2014 creates the replacement and marks the old node superseded.",
1082
+ parameters: {
1083
+ oldNodeId: { type: "string", description: "Node ID or global ID to supersede" },
1084
+ newGlobalId: { type: "string", description: "Optional replacement global ID" },
1085
+ newCanonicalText: { type: "string", description: "Replacement canonical text" },
1086
+ text: { type: "string", description: "Alias for newCanonicalText" },
1087
+ newContentHash: { type: "string", description: "Optional replacement content hash" },
1088
+ reason: { type: "string", description: "Reason for superseding" }
1089
+ },
1090
+ required: ["oldNodeId"],
1091
+ response: {
1092
+ description: "Supersede result",
1093
+ fields: { oldNodeId: "string", newNodeId: "string" }
1094
+ },
1095
+ ownerModule: "reasoning-kernel",
1096
+ ontologyPrimitive: "graph",
1097
+ tier: "workhorse"
1098
+ };
1099
+ var BATCH_CREATE_EPISTEMIC_NODES = {
1100
+ name: "batch_create_epistemic_nodes",
1101
+ description: "Commit multiple epistemic graph nodes. Like `git commit` with many staged files \u2014 writes a batch of canonical spine nodes.",
1102
+ parameters: {
1103
+ nodes: {
1104
+ type: "array",
1105
+ description: "Nodes to create with nodeType, canonicalText/text, and optional metadata."
1106
+ }
1107
+ },
1108
+ required: ["nodes"],
1109
+ response: {
1110
+ description: "Batch node creation result",
1111
+ fields: { created: "number", results: "array" }
1112
+ },
1113
+ ownerModule: "reasoning-kernel",
1114
+ ontologyPrimitive: "graph",
1115
+ tier: "workhorse"
1116
+ };
763
1117
  var RECORD_JUDGMENT = {
764
1118
  name: "record_judgment",
765
1119
  description: "Record a judgment \u2014 an irreversible commitment based on the current epistemic state. Like a `git tag` marking a release. A judgment synthesizes beliefs, evidence, and uncertainties into a determination. Once issued, a judgment is evaluated against the epistemic state that existed when it was made (knowledge horizon evaluation, Invariant #10).",
@@ -1057,6 +1411,74 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
1057
1411
  ontologyPrimitive: "graph",
1058
1412
  tier: "showcase"
1059
1413
  };
1414
+ var LIST_GRAPH_INTELLIGENCE_QUERIES = {
1415
+ name: "list_graph_intelligence_queries",
1416
+ description: "List the Graph Intelligence query catalog that powers structural graph analysis experiences. Returns categories, query IDs, prompt templates, modes, and the public tool plan each query can use.",
1417
+ parameters: {
1418
+ categoryId: {
1419
+ type: "string",
1420
+ description: "Optional category filter, such as problems or strategic"
1421
+ },
1422
+ mode: {
1423
+ type: "string",
1424
+ description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
1425
+ }
1426
+ },
1427
+ required: [],
1428
+ response: {
1429
+ description: "Graph Intelligence query catalog and mode-to-tool mapping",
1430
+ fields: {
1431
+ categories: "array \u2014 query categories",
1432
+ queries: "array \u2014 query definitions with prompt templates and tools",
1433
+ quickQueries: "array \u2014 recommended one-click query presets",
1434
+ publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
1435
+ }
1436
+ },
1437
+ ownerModule: "graph-intelligence",
1438
+ ontologyPrimitive: "graph",
1439
+ tier: "showcase"
1440
+ };
1441
+ var RUN_GRAPH_INTELLIGENCE_QUERY = {
1442
+ name: "run_graph_intelligence_query",
1443
+ description: "Run a named Graph Intelligence query against a tenant topic graph. Returns the selected query, prompt, deterministic graph-analysis bundle, graph context, and public tool plan for model synthesis.",
1444
+ parameters: {
1445
+ topicId: { type: "string", description: "Topic to analyze" },
1446
+ queryId: {
1447
+ type: "string",
1448
+ description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
1449
+ },
1450
+ prompt: {
1451
+ type: "string",
1452
+ description: "Optional custom prompt for custom analysis runs"
1453
+ },
1454
+ input: {
1455
+ type: "string",
1456
+ description: "Optional entity, theme, belief, company, or search text for input-driven queries"
1457
+ },
1458
+ mode: {
1459
+ type: "string",
1460
+ description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
1461
+ },
1462
+ limit: {
1463
+ type: "number",
1464
+ description: "Maximum graph context rows to return"
1465
+ }
1466
+ },
1467
+ required: ["topicId"],
1468
+ response: {
1469
+ description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
1470
+ fields: {
1471
+ query: "object \u2014 selected query definition",
1472
+ prompt: "string \u2014 resolved prompt template",
1473
+ toolPlan: "array \u2014 public tools and args the model can call next",
1474
+ analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
1475
+ context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
1476
+ }
1477
+ },
1478
+ ownerModule: "graph-intelligence",
1479
+ ontologyPrimitive: "graph",
1480
+ tier: "showcase"
1481
+ };
1060
1482
  var GET_FALSIFICATION_QUESTIONS = {
1061
1483
  name: "get_falsification_questions",
1062
1484
  description: "Generate Popperian falsification questions for beliefs. Like `git test` \u2014 identifies the questions most likely to disprove current beliefs. Karl Popper as a tool: surfaces what would need to be true to invalidate each belief.",
@@ -1905,15 +2327,15 @@ var IDENTITY_WHOAMI = {
1905
2327
  };
1906
2328
  var COMPILE_CONTEXT = {
1907
2329
  name: "compile_context",
1908
- description: "Compile a focused reasoning context for a topic. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
2330
+ description: "Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
1909
2331
  parameters: {
1910
2332
  topicId: {
1911
2333
  type: "string",
1912
- description: "Topic scope ID to compile"
2334
+ description: "Optional topic scope ID. Omit to resolve the topic from query."
1913
2335
  },
1914
2336
  query: {
1915
2337
  type: "string",
1916
- description: "Optional focus query used to rank context items"
2338
+ description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
1917
2339
  },
1918
2340
  budget: {
1919
2341
  type: "number",
@@ -1937,7 +2359,7 @@ var COMPILE_CONTEXT = {
1937
2359
  description: "Include related ontological entities in the compiled result"
1938
2360
  }
1939
2361
  },
1940
- required: ["topicId"],
2362
+ required: [],
1941
2363
  response: {
1942
2364
  description: "Compiled context pack for the requested topic",
1943
2365
  fields: {
@@ -2111,18 +2533,60 @@ var CREATE_TASK = {
2111
2533
  name: "create_task",
2112
2534
  description: "Create an execution task tied to the reasoning state. Like `git task` \u2014 tracks concrete work items (calls to make, data to gather, analyses to run) linked to questions, beliefs, or worktrees.",
2113
2535
  parameters: {
2114
- title: { type: "string", description: "Task description" },
2536
+ title: { type: "string", description: "Task title" },
2115
2537
  topicId: { type: "string", description: "Topic scope" },
2538
+ description: {
2539
+ type: "string",
2540
+ description: "Long-form task description"
2541
+ },
2116
2542
  taskType: {
2117
2543
  type: "string",
2118
- description: "Type: research, interview, analysis, data_collection",
2119
- enum: ["research", "interview", "analysis", "data_collection"]
2544
+ description: "Task taxonomy",
2545
+ enum: [
2546
+ "general",
2547
+ "find_evidence",
2548
+ "verify_claim",
2549
+ "research",
2550
+ "review",
2551
+ "interview",
2552
+ "analysis",
2553
+ "track_metrics"
2554
+ ]
2555
+ },
2556
+ priority: {
2557
+ type: "string",
2558
+ description: "Priority",
2559
+ enum: ["urgent", "high", "medium", "low"]
2560
+ },
2561
+ status: {
2562
+ type: "string",
2563
+ description: "Initial status (defaults to todo)",
2564
+ enum: ["todo", "in_progress", "blocked", "done"]
2565
+ },
2566
+ linkedWorktreeId: {
2567
+ type: "string",
2568
+ description: "Worktree this task belongs to"
2569
+ },
2570
+ linkedBeliefId: {
2571
+ type: "string",
2572
+ description: "Belief this task supports"
2120
2573
  },
2121
2574
  linkedQuestionId: {
2122
2575
  type: "string",
2123
2576
  description: "Question this task addresses"
2124
2577
  },
2125
- linkedWorktreeId: { type: "string", description: "Worktree scope" }
2578
+ assigneeId: {
2579
+ type: "string",
2580
+ description: "Principal assigned to the task"
2581
+ },
2582
+ dueDate: {
2583
+ type: "number",
2584
+ description: "Due date as epoch milliseconds"
2585
+ },
2586
+ tags: {
2587
+ type: "array",
2588
+ description: "Free-form string tags"
2589
+ }
2126
2590
  },
2127
2591
  required: ["title"],
2128
2592
  response: {
@@ -2242,6 +2706,10 @@ var CREATE_TOPIC = {
2242
2706
  name: "create_topic",
2243
2707
  description: "Create a new topic container for scoping knowledge. Like `git init` \u2014 initializes a new repository for a knowledge domain. Topics are hierarchical: a deal topic can nest under a theme topic. Types: domain, theme, deal, strategy, constitution, project, portfolio.",
2244
2708
  parameters: {
2709
+ globalId: {
2710
+ type: "string",
2711
+ description: "Optional idempotent topic global ID"
2712
+ },
2245
2713
  name: { type: "string", description: "Topic name" },
2246
2714
  type: {
2247
2715
  type: "string",
@@ -2252,6 +2720,18 @@ var CREATE_TOPIC = {
2252
2720
  type: "string",
2253
2721
  description: "Optional parent topic for nesting"
2254
2722
  },
2723
+ parentTopicGlobalId: {
2724
+ type: "string",
2725
+ description: "Optional parent topic global ID for nesting"
2726
+ },
2727
+ tenantId: { type: "string", description: "Optional tenant scope" },
2728
+ workspaceId: { type: "string", description: "Optional workspace scope" },
2729
+ visibility: {
2730
+ type: "string",
2731
+ description: "Topic visibility",
2732
+ enum: ["private", "team", "firm", "external", "public"]
2733
+ },
2734
+ metadata: { type: "object", description: "Optional topic metadata" },
2255
2735
  createdBy: { type: "string", description: "Who created this topic" }
2256
2736
  },
2257
2737
  required: ["name", "type"],
@@ -2260,6 +2740,9 @@ var CREATE_TOPIC = {
2260
2740
  fields: {
2261
2741
  id: "string \u2014 topic ID",
2262
2742
  globalId: "string \u2014 globally unique ID",
2743
+ topicGlobalId: "string \u2014 topic global ID",
2744
+ epistemicNodeId: "string \u2014 materialized topic node ID",
2745
+ epistemicNodeGlobalId: "string \u2014 materialized topic node global ID",
2263
2746
  depth: "number \u2014 nesting depth"
2264
2747
  }
2265
2748
  },
@@ -2390,6 +2873,65 @@ var GET_TOPIC_TREE = {
2390
2873
  ontologyPrimitive: "graph",
2391
2874
  tier: "workhorse"
2392
2875
  };
2876
+ var MATERIALIZE_TOPIC_GRAPH = {
2877
+ name: "materialize_topic_graph",
2878
+ description: "Backfill the topic graph spine. Like `git fsck --connectivity-only` with repair enabled \u2014 creates missing topic nodes and parent-child edges idempotently.",
2879
+ parameters: {
2880
+ rootTopicId: {
2881
+ type: "string",
2882
+ description: "Optional root topic for a bounded materialization pass"
2883
+ },
2884
+ dryRun: {
2885
+ type: "boolean",
2886
+ description: "When true, report missing rows without writing them"
2887
+ }
2888
+ },
2889
+ required: [],
2890
+ response: {
2891
+ description: "Topic graph materialization counts",
2892
+ fields: {
2893
+ topicsSeen: "number",
2894
+ nodesCreated: "number",
2895
+ nodesExisting: "number",
2896
+ edgesCreated: "number",
2897
+ edgesExisting: "number",
2898
+ errors: "array"
2899
+ }
2900
+ },
2901
+ ownerModule: "reasoning-kernel",
2902
+ ontologyPrimitive: "graph",
2903
+ tier: "workhorse"
2904
+ };
2905
+ var GET_TOPIC_GRAPH_SPINE = {
2906
+ name: "get_topic_graph_spine",
2907
+ description: "Verify the topic graph spine. Like `git fsck` \u2014 reads topics, materialized topic nodes, parent-child edges, and missing spine rows.",
2908
+ parameters: {
2909
+ rootTopicId: {
2910
+ type: "string",
2911
+ description: "Optional root topic for a bounded verifier pass"
2912
+ },
2913
+ includeTopicBeliefEdges: {
2914
+ type: "boolean",
2915
+ description: "Include topic -> belief edges in the verifier payload"
2916
+ }
2917
+ },
2918
+ required: [],
2919
+ response: {
2920
+ description: "Topic graph spine verification payload",
2921
+ fields: {
2922
+ ok: "boolean",
2923
+ counts: "object",
2924
+ topics: "array",
2925
+ topicNodes: "array",
2926
+ parentEdges: "array",
2927
+ missingTopicNodes: "array",
2928
+ missingParentEdges: "array"
2929
+ }
2930
+ },
2931
+ ownerModule: "reasoning-kernel",
2932
+ ontologyPrimitive: "graph",
2933
+ tier: "workhorse"
2934
+ };
2393
2935
  var GET_CODE_CONTEXT = {
2394
2936
  name: "get_code_context",
2395
2937
  description: "Returns code-grounded beliefs, contracts, migration states, and failed attempts anchored to a specific file or function path. Like `git log -- <path>` \u2014 filters the knowledge graph to nodes anchored to a file path via metadata.codeAnchors. Results are separated by coding belief type: decisions, contracts, migrations, patterns, deprecations, and failures.",
@@ -3522,6 +4064,69 @@ var GENERATE_SESSION_HANDOFF = {
3522
4064
  tier: "showcase",
3523
4065
  internal: true
3524
4066
  };
4067
+ var BEGIN_BUILD_SESSION = {
4068
+ name: "begin_build_session",
4069
+ description: "Bootstrap a coding build session for a Lucern worktree. Like `git worktree add` plus `git status` \u2014 returns the compact context packet an agent needs before editing.",
4070
+ parameters: {
4071
+ worktreeId: {
4072
+ type: "string",
4073
+ description: "The Lucern worktree ID to bootstrap."
4074
+ },
4075
+ branch: {
4076
+ type: "string",
4077
+ description: "Optional git branch name. Auto-generated from the worktree name when omitted."
4078
+ },
4079
+ branchBase: {
4080
+ type: "string",
4081
+ description: 'Base branch for the feature branch. Default: "staging".'
4082
+ },
4083
+ prBase: {
4084
+ type: "string",
4085
+ description: 'Target branch for the PR. Default: "staging".'
4086
+ },
4087
+ sessionMode: {
4088
+ type: "string",
4089
+ description: 'Session mode: "async" for Codex/headless or "interactive" for live sessions.',
4090
+ enum: ["async", "interactive"]
4091
+ },
4092
+ activateIfPlanning: {
4093
+ type: "boolean",
4094
+ description: "When true, automatically activate a planning worktree during bootstrap."
4095
+ }
4096
+ },
4097
+ required: ["worktreeId"],
4098
+ response: {
4099
+ description: "A compact build-session packet with worktree metadata, graph anchors, questions, dependencies, and git defaults.",
4100
+ fields: {
4101
+ topicId: "string \u2014 canonical topic scope",
4102
+ topicName: "string \u2014 human-readable topic name",
4103
+ worktreeId: "string \u2014 worktree ID",
4104
+ worktreeName: "string \u2014 human-readable worktree name",
4105
+ branch: "string \u2014 git branch name",
4106
+ branchBase: "string \u2014 base branch",
4107
+ prBase: "string \u2014 PR target branch",
4108
+ campaign: "number | null \u2014 top-level pipeline campaign",
4109
+ lane: "string \u2014 campaign lane",
4110
+ gate: "string \u2014 exit gate",
4111
+ hypothesis: "string \u2014 worktree hypothesis",
4112
+ focus: "string \u2014 session focus",
4113
+ status: "string \u2014 worktree status after optional activation",
4114
+ sessionMode: "string \u2014 async | interactive",
4115
+ targetBeliefIds: "array \u2014 scoped belief IDs",
4116
+ targetQuestionIds: "array \u2014 scoped question IDs",
4117
+ topBeliefs: "array \u2014 highest-confidence scoped beliefs",
4118
+ openQuestions: "array \u2014 open scoped questions",
4119
+ resolvedDecisions: "array \u2014 answered questions summarized for the session",
4120
+ dependencies: "array \u2014 upstream worktrees",
4121
+ unblocks: "array \u2014 downstream worktrees",
4122
+ mergeOrderNotes: "string \u2014 merge ordering advisory"
4123
+ }
4124
+ },
4125
+ ownerModule: "bootstrap",
4126
+ ontologyPrimitive: "worktree",
4127
+ tier: "showcase",
4128
+ internal: true
4129
+ };
3525
4130
  var MCP_TOOL_CONTRACTS = {
3526
4131
  // Belief lifecycle (commit, amend, fork, archive)
3527
4132
  create_belief: CREATE_BELIEF,
@@ -3564,11 +4169,26 @@ var MCP_TOOL_CONTRACTS = {
3564
4169
  bisect_confidence: BISECT_CONFIDENCE,
3565
4170
  // Edges (commit)
3566
4171
  create_edge: CREATE_EDGE,
4172
+ update_edge: UPDATE_EDGE,
4173
+ remove_edge: REMOVE_EDGE,
4174
+ remove_edges_between: REMOVE_EDGES_BETWEEN,
4175
+ batch_create_edges: BATCH_CREATE_EDGES,
4176
+ // Epistemic node spine (commit/amend/show)
4177
+ create_epistemic_node: CREATE_EPISTEMIC_NODE,
4178
+ get_epistemic_node: GET_EPISTEMIC_NODE,
4179
+ list_epistemic_nodes: LIST_EPISTEMIC_NODES,
4180
+ update_epistemic_node: UPDATE_EPISTEMIC_NODE,
4181
+ archive_epistemic_node: ARCHIVE_EPISTEMIC_NODE,
4182
+ verify_epistemic_node: VERIFY_EPISTEMIC_NODE,
4183
+ supersede_epistemic_node: SUPERSEDE_EPISTEMIC_NODE,
4184
+ batch_create_epistemic_nodes: BATCH_CREATE_EPISTEMIC_NODES,
3567
4185
  // Judgments (tag)
3568
4186
  record_judgment: RECORD_JUDGMENT,
3569
4187
  // Graph intelligence (showcase)
3570
4188
  detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
3571
4189
  get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
4190
+ list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
4191
+ run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
3572
4192
  get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
3573
4193
  // Evidence operations (workhorse)
3574
4194
  search_evidence: SEARCH_EVIDENCE,
@@ -3615,6 +4235,7 @@ var MCP_TOOL_CONTRACTS = {
3615
4235
  get_agent_inbox: GET_AGENT_INBOX,
3616
4236
  claim_files: CLAIM_FILES,
3617
4237
  generate_session_handoff: GENERATE_SESSION_HANDOFF,
4238
+ begin_build_session: BEGIN_BUILD_SESSION,
3618
4239
  // Policy / ACL (workhorse)
3619
4240
  check_permission: CHECK_PERMISSION,
3620
4241
  filter_by_permission: FILTER_BY_PERMISSION,
@@ -3634,6 +4255,8 @@ var MCP_TOOL_CONTRACTS = {
3634
4255
  get_topic: GET_TOPIC,
3635
4256
  update_topic: UPDATE_TOPIC,
3636
4257
  get_topic_tree: GET_TOPIC_TREE,
4258
+ materialize_topic_graph: MATERIALIZE_TOPIC_GRAPH,
4259
+ get_topic_graph_spine: GET_TOPIC_GRAPH_SPINE,
3637
4260
  // Coding intelligence (code-grounded knowledge)
3638
4261
  get_code_context: GET_CODE_CONTEXT,
3639
4262
  get_change_history: GET_CHANGE_HISTORY,
@@ -3738,18 +4361,34 @@ var MCP_CORE_OPERATION_NAMES = [
3738
4361
  "find_missing_questions",
3739
4362
  "get_high_priority_questions",
3740
4363
  "get_falsification_questions",
4364
+ "create_epistemic_node",
4365
+ "get_epistemic_node",
4366
+ "list_epistemic_nodes",
4367
+ "update_epistemic_node",
4368
+ "archive_epistemic_node",
4369
+ "verify_epistemic_node",
4370
+ "supersede_epistemic_node",
4371
+ "batch_create_epistemic_nodes",
3741
4372
  "create_topic",
3742
4373
  "get_topic",
3743
4374
  "list_topics",
3744
4375
  "update_topic",
3745
- "get_topic_tree"
4376
+ "get_topic_tree",
4377
+ "materialize_topic_graph",
4378
+ "get_topic_graph_spine"
3746
4379
  ];
3747
4380
  var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
3748
4381
  "create_edge",
4382
+ "update_edge",
4383
+ "remove_edge",
4384
+ "remove_edges_between",
4385
+ "batch_create_edges",
3749
4386
  "query_lineage",
3750
4387
  "traverse_graph",
3751
4388
  "get_graph_neighborhood",
3752
4389
  "get_graph_structure_analysis",
4390
+ "list_graph_intelligence_queries",
4391
+ "run_graph_intelligence_query",
3753
4392
  "find_contradictions",
3754
4393
  "flag_contradiction",
3755
4394
  "detect_confirmation_bias",
@@ -3828,6 +4467,7 @@ var PLATFORM_INTERNAL_OPERATION_NAMES = [
3828
4467
  "get_change_history",
3829
4468
  "get_failure_log",
3830
4469
  "record_attempt",
4470
+ "begin_build_session",
3831
4471
  "push",
3832
4472
  "open_pull_request",
3833
4473
  "record_judgment",
@@ -3882,7 +4522,6 @@ var SDK_ONLY_OPERATION_NAMES = [
3882
4522
  "find_semantic_orphans"
3883
4523
  ];
3884
4524
  var MCP_ONLY_INTERNAL_OPERATION_NAMES = [
3885
- "begin_build_session",
3886
4525
  "evaluate_engineering_contract",
3887
4526
  "evaluate_research_contract"
3888
4527
  ];
@@ -4137,9 +4776,7 @@ function mcpContractFromArgsSchema(base, args, contractName) {
4137
4776
  required: converted.filter(([, field]) => field.required).map(([fieldName]) => fieldName)
4138
4777
  };
4139
4778
  }
4140
- function defineFunctionContract(contract) {
4141
- return contract;
4142
- }
4779
+ var defineFunctionContract = (contract) => contract;
4143
4780
  function authUserId(context) {
4144
4781
  return context.userId ?? context.principalId ?? "lucern-agent";
4145
4782
  }
@@ -4243,8 +4880,50 @@ function surfaceContract(args) {
4243
4880
  }
4244
4881
  });
4245
4882
  }
4246
-
4247
- // src/function-registry/topics.ts
4883
+ var topicVisibilitySchema = z.enum([
4884
+ "private",
4885
+ "team",
4886
+ "firm",
4887
+ "external",
4888
+ "public"
4889
+ ]);
4890
+ var topicStatusSchema = z.enum(["active", "archived", "watching"]);
4891
+ var createTopicArgs = z.object({
4892
+ globalId: z.string().optional().describe("Optional idempotent topic global ID."),
4893
+ name: z.string().describe("Topic name."),
4894
+ description: z.string().optional().describe("Topic description."),
4895
+ type: z.string().describe("Topic type."),
4896
+ parentTopicId: z.string().optional().describe("Optional parent topic ID."),
4897
+ parentTopicGlobalId: z.string().optional().describe("Optional parent topic global ID."),
4898
+ ontologyId: z.string().optional().describe("Ontology to bind."),
4899
+ tenantId: z.string().optional().describe("Optional tenant scope."),
4900
+ workspaceId: z.string().optional().describe("Optional workspace scope."),
4901
+ visibility: topicVisibilitySchema.optional().describe("Topic visibility."),
4902
+ metadata: z.record(z.unknown()).optional().describe("Topic metadata."),
4903
+ graphScopeProjectId: z.string().optional(),
4904
+ createdBy: z.string().optional()
4905
+ });
4906
+ var updateTopicArgs = z.object({
4907
+ id: z.string().describe("Topic ID."),
4908
+ topicId: z.string().optional().describe("Topic ID alias."),
4909
+ name: z.string().optional().describe("Topic name."),
4910
+ description: z.string().optional().describe("Topic description."),
4911
+ type: z.string().optional().describe("Topic type."),
4912
+ status: topicStatusSchema.optional().describe("Topic status."),
4913
+ visibility: topicVisibilitySchema.optional().describe("Topic visibility."),
4914
+ ontologyId: z.string().optional().describe("Ontology to bind."),
4915
+ clearOntologyId: z.boolean().optional().describe("Whether to clear the ontology binding."),
4916
+ metadata: z.record(z.unknown()).optional().describe("Topic metadata.")
4917
+ });
4918
+ var materializeTopicGraphArgs = z.object({
4919
+ rootTopicId: z.string().optional().describe("Optional root topic ID."),
4920
+ dryRun: z.boolean().optional().describe("Report missing rows without writing."),
4921
+ createdBy: z.string().optional()
4922
+ });
4923
+ var getTopicGraphSpineArgs = z.object({
4924
+ rootTopicId: z.string().optional().describe("Optional root topic ID."),
4925
+ includeTopicBeliefEdges: z.boolean().optional()
4926
+ });
4248
4927
  var topicIdInput = (input) => compactRecord({
4249
4928
  id: input.id ?? input.topicId
4250
4929
  });
@@ -4275,7 +4954,8 @@ var topicsContracts = [
4275
4954
  functionName: "create",
4276
4955
  kind: "mutation",
4277
4956
  inputProjection: withCreatedBy
4278
- }
4957
+ },
4958
+ args: createTopicArgs
4279
4959
  }),
4280
4960
  surfaceContract({
4281
4961
  name: "get_topic",
@@ -4325,7 +5005,8 @@ var topicsContracts = [
4325
5005
  functionName: "update",
4326
5006
  kind: "mutation",
4327
5007
  inputProjection: updateTopicInput
4328
- }
5008
+ },
5009
+ args: updateTopicArgs
4329
5010
  }),
4330
5011
  surfaceContract({
4331
5012
  name: "get_topic_tree",
@@ -4342,6 +5023,40 @@ var topicsContracts = [
4342
5023
  functionName: "getTree",
4343
5024
  kind: "query"
4344
5025
  }
5026
+ }),
5027
+ surfaceContract({
5028
+ name: "materialize_topic_graph",
5029
+ kind: "mutation",
5030
+ domain: "topics",
5031
+ surfaceClass: "platform_public",
5032
+ path: "/topics/materialize-graph",
5033
+ sdkNamespace: "topics",
5034
+ sdkMethod: "materializeTopicGraph",
5035
+ summary: "Materialize topic nodes and parent-child graph edges.",
5036
+ convex: {
5037
+ module: "topics",
5038
+ functionName: "materializeTopicGraph",
5039
+ kind: "mutation",
5040
+ inputProjection: withCreatedBy
5041
+ },
5042
+ args: materializeTopicGraphArgs
5043
+ }),
5044
+ surfaceContract({
5045
+ name: "get_topic_graph_spine",
5046
+ kind: "query",
5047
+ domain: "topics",
5048
+ surfaceClass: "platform_public",
5049
+ method: "GET",
5050
+ path: "/topics/graph-spine",
5051
+ sdkNamespace: "topics",
5052
+ sdkMethod: "getTopicGraphSpine",
5053
+ summary: "Verify topic nodes and parent-child graph edges.",
5054
+ convex: {
5055
+ module: "topics",
5056
+ functionName: "getTopicGraphSpine",
5057
+ kind: "query"
5058
+ },
5059
+ args: getTopicGraphSpineArgs
4345
5060
  })
4346
5061
  ];
4347
5062