@lucern/contracts 0.3.0-alpha.16 → 0.3.0-alpha.2

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 (316) hide show
  1. package/CHANGELOG.md +0 -7
  2. package/dist/api-enums.contract.d.ts +3 -5
  3. package/dist/api-enums.contract.js +12 -14
  4. package/dist/api-enums.contract.js.map +1 -1
  5. package/dist/auth-context.contract.js +1 -13
  6. package/dist/auth-context.contract.js.map +1 -1
  7. package/dist/auth-session.contract.js +1 -13
  8. package/dist/auth-session.contract.js.map +1 -1
  9. package/dist/auth.contract.d.ts +1 -1
  10. package/dist/auth.contract.js +1 -13
  11. package/dist/auth.contract.js.map +1 -1
  12. package/dist/context-pack.contract.d.ts +3 -5
  13. package/dist/context-pack.contract.js.map +1 -1
  14. package/dist/{defineTable-t1wr5wgn.d.ts → defineTable-CBQ03FXl.d.ts} +1 -1
  15. package/dist/{dsl-DVPthQGY.d.ts → dsl-BgpoVOVQ.d.ts} +2 -2
  16. package/dist/dsl.d.ts +2 -2
  17. package/dist/dsl.js +4 -1
  18. package/dist/dsl.js.map +1 -1
  19. package/dist/function-registry/beliefs.d.ts +51 -64
  20. package/dist/function-registry/beliefs.js +55 -815
  21. package/dist/function-registry/beliefs.js.map +1 -1
  22. package/dist/function-registry/coding.d.ts +6 -15
  23. package/dist/function-registry/coding.js +41 -864
  24. package/dist/function-registry/coding.js.map +1 -1
  25. package/dist/function-registry/context.d.ts +16 -22
  26. package/dist/function-registry/context.js +44 -803
  27. package/dist/function-registry/context.js.map +1 -1
  28. package/dist/function-registry/contracts.d.ts +3 -9
  29. package/dist/function-registry/contracts.js +37 -768
  30. package/dist/function-registry/contracts.js.map +1 -1
  31. package/dist/function-registry/coordination.d.ts +9 -21
  32. package/dist/function-registry/coordination.js +37 -768
  33. package/dist/function-registry/coordination.js.map +1 -1
  34. package/dist/function-registry/edges.d.ts +2 -167
  35. package/dist/function-registry/edges.js +69 -976
  36. package/dist/function-registry/edges.js.map +1 -1
  37. package/dist/function-registry/evidence.d.ts +41 -52
  38. package/dist/function-registry/evidence.js +60 -824
  39. package/dist/function-registry/evidence.js.map +1 -1
  40. package/dist/function-registry/graph.d.ts +66 -162
  41. package/dist/function-registry/graph.js +44 -884
  42. package/dist/function-registry/graph.js.map +1 -1
  43. package/dist/function-registry/helpers.d.ts +4 -7
  44. package/dist/function-registry/helpers.js +38 -769
  45. package/dist/function-registry/helpers.js.map +1 -1
  46. package/dist/function-registry/identity.d.ts +16 -62
  47. package/dist/function-registry/identity.js +43 -791
  48. package/dist/function-registry/identity.js.map +1 -1
  49. package/dist/function-registry/index.d.ts +3 -5
  50. package/dist/function-registry/index.js +41 -775
  51. package/dist/function-registry/index.js.map +1 -1
  52. package/dist/function-registry/judgments.d.ts +11 -16
  53. package/dist/function-registry/judgments.js +40 -780
  54. package/dist/function-registry/judgments.js.map +1 -1
  55. package/dist/function-registry/legacy.d.ts +1 -5
  56. package/dist/function-registry/legacy.js +37 -768
  57. package/dist/function-registry/legacy.js.map +1 -1
  58. package/dist/function-registry/lenses.d.ts +21 -28
  59. package/dist/function-registry/lenses.js +40 -791
  60. package/dist/function-registry/lenses.js.map +1 -1
  61. package/dist/function-registry/manifest.d.ts +6 -6
  62. package/dist/function-registry/manifest.js +2 -19
  63. package/dist/function-registry/manifest.js.map +1 -1
  64. package/dist/function-registry/ontologies.d.ts +56 -70
  65. package/dist/function-registry/ontologies.js +43 -786
  66. package/dist/function-registry/ontologies.js.map +1 -1
  67. package/dist/function-registry/pipeline.d.ts +16 -22
  68. package/dist/function-registry/pipeline.js +40 -777
  69. package/dist/function-registry/pipeline.js.map +1 -1
  70. package/dist/function-registry/questions.d.ts +61 -76
  71. package/dist/function-registry/questions.js +50 -867
  72. package/dist/function-registry/questions.js.map +1 -1
  73. package/dist/function-registry/tasks.d.ts +21 -28
  74. package/dist/function-registry/tasks.js +46 -843
  75. package/dist/function-registry/tasks.js.map +1 -1
  76. package/dist/function-registry/topics.d.ts +26 -114
  77. package/dist/function-registry/topics.js +41 -850
  78. package/dist/function-registry/topics.js.map +1 -1
  79. package/dist/function-registry/types.d.ts +3 -7
  80. package/dist/function-registry/worktrees.d.ts +51 -104
  81. package/dist/function-registry/worktrees.js +49 -907
  82. package/dist/function-registry/worktrees.js.map +1 -1
  83. package/dist/gateway.contract.d.ts +0 -5
  84. package/dist/gateway.contract.js.map +1 -1
  85. package/dist/generated/convexSchemas.d.ts +3 -3
  86. package/dist/generated/convexSchemas.js +18 -39
  87. package/dist/generated/convexSchemas.js.map +1 -1
  88. package/dist/generated/schema-manifest.json +98 -1244
  89. package/dist/generated/tableOwnership.d.ts +28 -49
  90. package/dist/generated/tableOwnership.js +26 -68
  91. package/dist/generated/tableOwnership.js.map +1 -1
  92. package/dist/generated/tier-expectations.json +9 -66
  93. package/dist/graph-types/index.d.ts +1 -5
  94. package/dist/graph-types/index.js +4 -15
  95. package/dist/graph-types/index.js.map +1 -1
  96. package/dist/index-CV-0_VWJ.d.ts +25 -0
  97. package/dist/index.d.ts +414 -30
  98. package/dist/index.js +339 -34916
  99. package/dist/index.js.map +1 -1
  100. package/dist/lens-filter.contract.js +3 -4
  101. package/dist/lens-filter.contract.js.map +1 -1
  102. package/dist/lens-workflow.contract.js +3 -4
  103. package/dist/lens-workflow.contract.js.map +1 -1
  104. package/dist/schema-helpers/enumValidation.js +5 -2
  105. package/dist/schema-helpers/enumValidation.js.map +1 -1
  106. package/dist/schema-helpers/spine/nodes/decision.js +1 -2
  107. package/dist/schema-helpers/spine/nodes/decision.js.map +1 -1
  108. package/dist/schema-helpers/spine/tables/epistemicNodes.js +27 -27
  109. package/dist/schema-helpers/spine/tables/epistemicNodes.js.map +1 -1
  110. package/dist/schemas/component-table-manifest.d.ts +6 -6
  111. package/dist/schemas/component-table-manifest.js +2 -2
  112. package/dist/schemas/component-table-manifest.js.map +1 -1
  113. package/dist/schemas/enums.d.ts +2 -5
  114. package/dist/schemas/enums.js +2 -5
  115. package/dist/schemas/enums.js.map +1 -1
  116. package/dist/schemas/index.d.ts +3 -3
  117. package/dist/schemas/index.js +139 -1165
  118. package/dist/schemas/index.js.map +1 -1
  119. package/dist/schemas/manifest.d.ts +932 -3042
  120. package/dist/schemas/manifest.js +137 -1163
  121. package/dist/schemas/manifest.js.map +1 -1
  122. package/dist/schemas/sl-opinion.d.ts +4 -4
  123. package/dist/schemas/tables/{controlPlane → identity}/agent.d.ts +1 -1
  124. package/dist/schemas/tables/{controlPlane → identity}/agent.js +3 -3
  125. package/dist/schemas/tables/identity/agent.js.map +1 -0
  126. package/dist/schemas/tables/{controlPlane → identity}/epistemic.d.ts +1 -1
  127. package/dist/schemas/tables/{controlPlane → identity}/epistemic.js +3 -3
  128. package/dist/schemas/tables/identity/epistemic.js.map +1 -0
  129. package/dist/schemas/tables/{controlPlane → identity}/model.d.ts +1 -1
  130. package/dist/schemas/tables/{controlPlane → identity}/model.js +6 -6
  131. package/dist/schemas/tables/identity/model.js.map +1 -0
  132. package/dist/schemas/tables/{controlPlane → identity}/platform.d.ts +11 -11
  133. package/dist/schemas/tables/{controlPlane → identity}/platform.js +18 -18
  134. package/dist/schemas/tables/identity/platform.js.map +1 -0
  135. package/dist/schemas/tables/{controlPlane → identity}/project.d.ts +1 -1
  136. package/dist/schemas/tables/{controlPlane → identity}/project.js +3 -3
  137. package/dist/schemas/tables/identity/project.js.map +1 -0
  138. package/dist/schemas/tables/{controlPlane → identity}/user.d.ts +1 -1
  139. package/dist/schemas/tables/{controlPlane → identity}/user.js +3 -3
  140. package/dist/schemas/tables/identity/user.js.map +1 -0
  141. package/dist/schemas/tables/kernel/config.d.ts +1 -1
  142. package/dist/schemas/tables/kernel/config.js.map +1 -1
  143. package/dist/schemas/tables/kernel/coordination.d.ts +1 -1
  144. package/dist/schemas/tables/kernel/coordination.js.map +1 -1
  145. package/dist/schemas/tables/kernel/decision.d.ts +1 -1
  146. package/dist/schemas/tables/kernel/decision.js.map +1 -1
  147. package/dist/schemas/tables/kernel/embedding.d.ts +1 -1
  148. package/dist/schemas/tables/kernel/embedding.js.map +1 -1
  149. package/dist/schemas/tables/kernel/epistemic.d.ts +7 -7
  150. package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
  151. package/dist/schemas/tables/kernel/idempotency.d.ts +1 -1
  152. package/dist/schemas/tables/kernel/idempotency.js.map +1 -1
  153. package/dist/schemas/tables/kernel/infra.d.ts +5 -5
  154. package/dist/schemas/tables/kernel/infra.js.map +1 -1
  155. package/dist/schemas/tables/kernel/intelligence.d.ts +11 -11
  156. package/dist/schemas/tables/kernel/intelligence.js.map +1 -1
  157. package/dist/schemas/tables/kernel/lens.d.ts +5 -5
  158. package/dist/schemas/tables/kernel/lens.js.map +1 -1
  159. package/dist/schemas/tables/kernel/ontology.d.ts +1 -1
  160. package/dist/schemas/tables/kernel/ontology.js.map +1 -1
  161. package/dist/schemas/tables/kernel/platform.d.ts +13 -13
  162. package/dist/schemas/tables/kernel/platform.js.map +1 -1
  163. package/dist/schemas/tables/kernel/spine.d.ts +4 -5
  164. package/dist/schemas/tables/kernel/spine.js +2 -6
  165. package/dist/schemas/tables/kernel/spine.js.map +1 -1
  166. package/dist/schemas/tables/kernel/task.d.ts +43 -43
  167. package/dist/schemas/tables/kernel/task.js.map +1 -1
  168. package/dist/schemas/tables/kernel/topic.d.ts +1 -1
  169. package/dist/schemas/tables/kernel/topic.js +1 -5
  170. package/dist/schemas/tables/kernel/topic.js.map +1 -1
  171. package/dist/schemas/tables/kernel/workflow.d.ts +1 -1
  172. package/dist/schemas/tables/kernel/workflow.js.map +1 -1
  173. package/dist/schemas/tables/kernel/worktree.d.ts +55 -55
  174. package/dist/schemas/tables/kernel/worktree.js.map +1 -1
  175. package/dist/schemas/tables/mc/identity.d.ts +4 -44
  176. package/dist/schemas/tables/mc/identity.js +1 -66
  177. package/dist/schemas/tables/mc/identity.js.map +1 -1
  178. package/dist/schemas/tables/mc/methodology.d.ts +1 -1
  179. package/dist/schemas/tables/mc/methodology.js.map +1 -1
  180. package/dist/schemas/tables/mc/pack.d.ts +21 -21
  181. package/dist/schemas/tables/mc/pack.js.map +1 -1
  182. package/dist/schemas/tables/mc/policy.d.ts +2 -2
  183. package/dist/schemas/tables/mc/policy.js +1 -1
  184. package/dist/schemas/tables/mc/policy.js.map +1 -1
  185. package/dist/schemas/tables/mc/registry.d.ts +5 -5
  186. package/dist/schemas/tables/mc/registry.js.map +1 -1
  187. package/dist/schemas/tables/mc/runtime.d.ts +3 -109
  188. package/dist/schemas/tables/mc/runtime.js +104 -330
  189. package/dist/schemas/tables/mc/runtime.js.map +1 -1
  190. package/dist/schemas/tables/mc/tenant.d.ts +2 -4
  191. package/dist/schemas/tables/mc/tenant.js +1 -3
  192. package/dist/schemas/tables/mc/tenant.js.map +1 -1
  193. package/dist/schemas/tables/mc/workspace.d.ts +5 -28
  194. package/dist/schemas/tables/mc/workspace.js +2 -36
  195. package/dist/schemas/tables/mc/workspace.js.map +1 -1
  196. package/dist/sdk-methods.contract.d.ts +2 -2
  197. package/dist/{sdk-tools.contract-CKmSsrZ2.d.ts → sdk-tools.contract-S4ia0TTo.d.ts} +2 -2
  198. package/dist/sdk-tools.contract.d.ts +2 -2
  199. package/dist/sdk-tools.contract.js +25 -717
  200. package/dist/sdk-tools.contract.js.map +1 -1
  201. package/dist/{tool-contracts-C_xvM9q2.d.ts → tool-contracts-C92-9ueT.d.ts} +2 -38
  202. package/dist/tool-contracts.d.ts +1 -1
  203. package/dist/tool-contracts.js +26 -718
  204. package/dist/tool-contracts.js.map +1 -1
  205. package/package.json +1 -30
  206. package/dist/component-boundary.contract.d.ts +0 -14
  207. package/dist/component-boundary.contract.js +0 -175
  208. package/dist/component-boundary.contract.js.map +0 -1
  209. package/dist/component-host-boundary.contract.d.ts +0 -46
  210. package/dist/component-host-boundary.contract.js +0 -60
  211. package/dist/component-host-boundary.contract.js.map +0 -1
  212. package/dist/edge-policy-manifest-Dw5IhT1L.d.ts +0 -133
  213. package/dist/function-registry/nodes.d.ts +0 -412
  214. package/dist/function-registry/nodes.js +0 -5354
  215. package/dist/function-registry/nodes.js.map +0 -1
  216. package/dist/function-registry-input-audit.d.ts +0 -13
  217. package/dist/function-registry-input-audit.js +0 -166
  218. package/dist/function-registry-input-audit.js.map +0 -1
  219. package/dist/generated/infisicalRuntimeEnv.d.ts +0 -70
  220. package/dist/generated/infisicalRuntimeEnv.js +0 -27051
  221. package/dist/generated/infisicalRuntimeEnv.js.map +0 -1
  222. package/dist/generated/lucernGatewayEnv.d.ts +0 -17
  223. package/dist/generated/lucernGatewayEnv.js +0 -38
  224. package/dist/generated/lucernGatewayEnv.js.map +0 -1
  225. package/dist/generated/lucernWebPublicEnv.d.ts +0 -26
  226. package/dist/generated/lucernWebPublicEnv.js +0 -32
  227. package/dist/generated/lucernWebPublicEnv.js.map +0 -1
  228. package/dist/generated/lucernWebServerEnv.d.ts +0 -33
  229. package/dist/generated/lucernWebServerEnv.js +0 -51
  230. package/dist/generated/lucernWebServerEnv.js.map +0 -1
  231. package/dist/graph-intelligence.contract.d.ts +0 -506
  232. package/dist/graph-intelligence.contract.js +0 -595
  233. package/dist/graph-intelligence.contract.js.map +0 -1
  234. package/dist/index-CM1Pl_vI.d.ts +0 -28
  235. package/dist/infisical-runtime.contract.d.ts +0 -1851
  236. package/dist/infisical-runtime.contract.js +0 -3189
  237. package/dist/infisical-runtime.contract.js.map +0 -1
  238. package/dist/manifests/edge-policy-manifest.d.ts +0 -2
  239. package/dist/manifests/edge-policy-manifest.data.d.ts +0 -13
  240. package/dist/manifests/edge-policy-manifest.data.js +0 -26
  241. package/dist/manifests/edge-policy-manifest.data.js.map +0 -1
  242. package/dist/manifests/edge-policy-manifest.js +0 -92
  243. package/dist/manifests/edge-policy-manifest.js.map +0 -1
  244. package/dist/manifests/infisical-runtime-manifest.d.ts +0 -1754
  245. package/dist/manifests/infisical-runtime-manifest.js +0 -3044
  246. package/dist/manifests/infisical-runtime-manifest.js.map +0 -1
  247. package/dist/manifests/invariant-manifest.d.ts +0 -65
  248. package/dist/manifests/invariant-manifest.js +0 -18
  249. package/dist/manifests/invariant-manifest.js.map +0 -1
  250. package/dist/manifests/invariants/ast-utils.d.ts +0 -14
  251. package/dist/manifests/invariants/ast-utils.js +0 -54
  252. package/dist/manifests/invariants/ast-utils.js.map +0 -1
  253. package/dist/manifests/invariants/index.d.ts +0 -15
  254. package/dist/manifests/invariants/index.js +0 -183
  255. package/dist/manifests/invariants/index.js.map +0 -1
  256. package/dist/manifests/invariants/inv-1-beliefs-append-only.d.ts +0 -12
  257. package/dist/manifests/invariants/inv-1-beliefs-append-only.js +0 -94
  258. package/dist/manifests/invariants/inv-1-beliefs-append-only.js.map +0 -1
  259. package/dist/manifests/invariants/inv-14-no-silent-transitions.d.ts +0 -12
  260. package/dist/manifests/invariants/inv-14-no-silent-transitions.js +0 -99
  261. package/dist/manifests/invariants/inv-14-no-silent-transitions.js.map +0 -1
  262. package/dist/manifests/invariants/manifest-1-projections-declare-audit.d.ts +0 -12
  263. package/dist/manifests/invariants/manifest-1-projections-declare-audit.js +0 -42
  264. package/dist/manifests/invariants/manifest-1-projections-declare-audit.js.map +0 -1
  265. package/dist/manifests/tenant-client-manifest.d.ts +0 -327
  266. package/dist/manifests/tenant-client-manifest.js +0 -449
  267. package/dist/manifests/tenant-client-manifest.js.map +0 -1
  268. package/dist/mcp-gateway-boundary.contract.d.ts +0 -201
  269. package/dist/mcp-gateway-boundary.contract.js +0 -45
  270. package/dist/mcp-gateway-boundary.contract.js.map +0 -1
  271. package/dist/permit-principal-projection.contract.d.ts +0 -74
  272. package/dist/permit-principal-projection.contract.js +0 -160
  273. package/dist/permit-principal-projection.contract.js.map +0 -1
  274. package/dist/projections/check-convex-args-shape.d.ts +0 -3
  275. package/dist/projections/check-convex-args-shape.js +0 -403
  276. package/dist/projections/check-convex-args-shape.js.map +0 -1
  277. package/dist/projections/create-evidence.projection.d.ts +0 -176
  278. package/dist/projections/create-evidence.projection.js +0 -130
  279. package/dist/projections/create-evidence.projection.js.map +0 -1
  280. package/dist/projections/index.d.ts +0 -102
  281. package/dist/projections/index.js +0 -352
  282. package/dist/projections/index.js.map +0 -1
  283. package/dist/projections/list-beliefs.projection.d.ts +0 -36
  284. package/dist/projections/list-beliefs.projection.js +0 -54
  285. package/dist/projections/list-beliefs.projection.js.map +0 -1
  286. package/dist/projections/list-tasks.projection.d.ts +0 -44
  287. package/dist/projections/list-tasks.projection.js +0 -57
  288. package/dist/projections/list-tasks.projection.js.map +0 -1
  289. package/dist/projections/modulate-confidence.projection.d.ts +0 -219
  290. package/dist/projections/modulate-confidence.projection.js +0 -148
  291. package/dist/projections/modulate-confidence.projection.js.map +0 -1
  292. package/dist/projections/projection-dsl.d.ts +0 -11
  293. package/dist/projections/projection-dsl.js +0 -8
  294. package/dist/projections/projection-dsl.js.map +0 -1
  295. package/dist/proof-attestation.json +0 -45
  296. package/dist/schemas/tables/controlPlane/accessControl.d.ts +0 -260
  297. package/dist/schemas/tables/controlPlane/accessControl.js +0 -658
  298. package/dist/schemas/tables/controlPlane/accessControl.js.map +0 -1
  299. package/dist/schemas/tables/controlPlane/agent.js.map +0 -1
  300. package/dist/schemas/tables/controlPlane/epistemic.js.map +0 -1
  301. package/dist/schemas/tables/controlPlane/model.js.map +0 -1
  302. package/dist/schemas/tables/controlPlane/platform.js.map +0 -1
  303. package/dist/schemas/tables/controlPlane/project.js.map +0 -1
  304. package/dist/schemas/tables/controlPlane/user.js.map +0 -1
  305. package/dist/schemas/tables/kernel/events.d.ts +0 -21
  306. package/dist/schemas/tables/kernel/events.js +0 -43
  307. package/dist/schemas/tables/kernel/events.js.map +0 -1
  308. package/dist/tenant-bootstrap-seed.contract.d.ts +0 -1289
  309. package/dist/tenant-bootstrap-seed.contract.js +0 -764
  310. package/dist/tenant-bootstrap-seed.contract.js.map +0 -1
  311. package/dist/tenant-bootstrap-seed.defaults.d.ts +0 -16
  312. package/dist/tenant-bootstrap-seed.defaults.js +0 -321
  313. package/dist/tenant-bootstrap-seed.defaults.js.map +0 -1
  314. package/dist/tenant-client.contract.d.ts +0 -354
  315. package/dist/tenant-client.contract.js +0 -505
  316. package/dist/tenant-client.contract.js.map +0 -1
@@ -3,20 +3,6 @@ import { v } from 'convex/values';
3
3
 
4
4
  // src/function-registry/helpers.ts
5
5
 
6
- // src/types/reasoning-method.ts
7
- var REASONING_METHODS = [
8
- "deductive",
9
- "inductive",
10
- "abductive",
11
- "analogical",
12
- "causal",
13
- "correlational",
14
- "testimonial",
15
- "statistical",
16
- "implicit",
17
- "pattern_match"
18
- ];
19
-
20
6
  // src/lens-workflow.contract.ts
21
7
  var LENS_PERSPECTIVE_TYPES = [
22
8
  "investigation",
@@ -437,22 +423,7 @@ var ADD_WORKTREE = {
437
423
  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.",
438
424
  parameters: {
439
425
  title: { type: "string", description: "Worktree name/objective" },
440
- name: {
441
- type: "string",
442
- description: "Optional storage-name alias for callers that already use backend naming"
443
- },
444
- projectId: {
445
- type: "string",
446
- description: "Legacy topicId alias or resolver hint"
447
- },
448
- topicId: {
449
- type: "string",
450
- description: "Optional topic scope hint for resolver validation"
451
- },
452
- topicHint: {
453
- type: "string",
454
- description: "Natural-language topic hint for automatic topic resolution"
455
- },
426
+ topicId: { type: "string", description: "Optional topic scope hint" },
456
427
  branchId: {
457
428
  type: "string",
458
429
  description: "The branch this worktree investigates"
@@ -465,107 +436,18 @@ var ADD_WORKTREE = {
465
436
  type: "string",
466
437
  description: "The testable claim this worktree investigates"
467
438
  },
468
- rationale: {
469
- type: "string",
470
- description: "Why this worktree exists and why it belongs in the campaign"
471
- },
472
- worktreeType: {
473
- type: "string",
474
- description: "Schema-enum worktree type used by the kernel lifecycle and retrieval layers"
475
- },
476
- gate: {
477
- type: "string",
478
- description: "Exit gate name for this worktree"
479
- },
480
- startDate: {
481
- type: "number",
482
- description: "Planned start timestamp in milliseconds since epoch"
483
- },
484
- endDate: {
485
- type: "number",
486
- description: "Planned end timestamp in milliseconds since epoch"
487
- },
488
- durationWeeks: {
489
- type: "number",
490
- description: "Planned duration in weeks"
491
- },
492
- confidenceImpact: {
493
- type: "string",
494
- description: "Expected confidence impact if the worktree succeeds",
495
- enum: ["high", "medium", "low"]
496
- },
497
- beliefFocus: {
498
- type: "string",
499
- description: "Natural-language focus spanning the target belief neighborhood"
500
- },
501
439
  beliefIds: {
502
440
  type: "array",
503
- description: "Legacy alias for targetBeliefIds"
504
- },
505
- beliefs: {
506
- type: "array",
507
- description: "Legacy alias for targetBeliefIds"
508
- },
509
- targetBeliefIds: {
510
- type: "array",
511
- description: "Belief node IDs this worktree is expected to test or update"
512
- },
513
- targetQuestionIds: {
514
- type: "array",
515
- description: "Question node IDs this worktree is expected to answer"
516
- },
517
- keyQuestions: {
518
- type: "array",
519
- description: "Inline key question objects with question, optional status, answer, answerConfidence, and linkedQuestionId"
520
- },
521
- evidenceSignals: {
522
- type: "array",
523
- description: "Evidence signal objects with signal, optional collected state, progress, and notes"
524
- },
525
- decisionGate: {
526
- type: "object",
527
- description: "Decision gate object with goCriteria, noGoSignals, optional verdict, rationale, decidedAt, and decidedBy"
528
- },
529
- goCriteria: {
530
- type: "array",
531
- description: "Shorthand go criteria used to build decisionGate"
532
- },
533
- noGoSignals: {
534
- type: "array",
535
- description: "Shorthand no-go signals used to build decisionGate"
536
- },
537
- proofArtifacts: {
538
- type: "array",
539
- description: "Expected proof artifacts required to close the worktree"
441
+ description: "Beliefs to test in this worktree"
540
442
  },
541
443
  autoShape: {
542
444
  type: "boolean",
543
445
  description: "Whether to invoke inquiry auto-shaping during worktree creation"
544
446
  },
545
- autoFixPolicy: {
546
- type: "object",
547
- description: "Policy for permitted automatic remediation inside the worktree"
548
- },
549
447
  domainPackId: {
550
448
  type: "string",
551
449
  description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
552
450
  },
553
- tags: {
554
- type: "array",
555
- description: "Additional topic-resolution tags for the worktree"
556
- },
557
- touchedPaths: {
558
- type: "array",
559
- description: "File paths used as topic-resolution signals"
560
- },
561
- sourceRef: {
562
- type: "string",
563
- description: "Source reference used as a topic-resolution signal"
564
- },
565
- sourceKind: {
566
- type: "string",
567
- description: "Source kind used as a topic-resolution signal"
568
- },
569
451
  campaign: {
570
452
  type: "number",
571
453
  description: "Top-level pipeline campaign number. Campaigns define the outer execution slice."
@@ -590,20 +472,12 @@ var ADD_WORKTREE = {
590
472
  type: "array",
591
473
  description: "Worktree IDs blocked by this worktree"
592
474
  },
593
- staffingHint: {
594
- type: "string",
595
- description: "Suggested staffing or agent allocation note"
596
- },
597
- lensId: {
475
+ gate: {
598
476
  type: "string",
599
- description: "Lens that scopes this worktree when applicable"
600
- },
601
- lastReconciledAt: {
602
- type: "number",
603
- description: "Timestamp when worktree metadata was last reconciled"
477
+ description: "Exit gate name for this worktree"
604
478
  }
605
479
  },
606
- required: ["title"],
480
+ required: ["title", "topicId"],
607
481
  response: {
608
482
  description: "The created worktree",
609
483
  fields: {
@@ -630,7 +504,7 @@ var MERGE = {
630
504
  worktreeId: { type: "string", description: "The worktree to merge" },
631
505
  outcomes: {
632
506
  type: "array",
633
- description: "Merge outcomes as key-finding strings, or scoring outcomes for beliefs: { beliefId, confidence, rationale }"
507
+ description: "Scoring outcomes for each belief: { beliefId, confidence, rationale }"
634
508
  },
635
509
  summary: { type: "string", description: "Overall findings summary" }
636
510
  },
@@ -848,23 +722,19 @@ var FIND_CONTRADICTIONS = {
848
722
  };
849
723
  var CREATE_EDGE = {
850
724
  name: "create_edge",
851
- 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
+ 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).",
852
726
  parameters: {
853
- from: {
854
- type: "object",
855
- description: "Source graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'topic' }"
856
- },
857
- to: {
858
- type: "object",
859
- description: "Target graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'belief' }"
727
+ sourceId: {
728
+ type: "string",
729
+ description: "Source node of the relationship"
860
730
  },
861
- edgeType: {
731
+ targetId: {
862
732
  type: "string",
863
- description: "Relationship type from the public epistemic edge enum."
733
+ description: "Target node of the relationship"
864
734
  },
865
- globalId: {
735
+ edgeType: {
866
736
  type: "string",
867
- description: "Optional idempotent edge global ID."
737
+ description: "Relationship type (informs, tests, depends_on, supersedes, etc.)"
868
738
  },
869
739
  weight: {
870
740
  type: "number",
@@ -874,14 +744,10 @@ var CREATE_EDGE = {
874
744
  reasoningMethod: {
875
745
  type: "string",
876
746
  description: "How this was determined",
877
- enum: [...REASONING_METHODS]
878
- },
879
- metadata: {
880
- type: "object",
881
- description: "Optional edge metadata."
747
+ enum: ["deductive", "inductive", "abductive", "analogical", "empirical"]
882
748
  }
883
749
  },
884
- required: ["from", "to", "edgeType"],
750
+ required: ["sourceId", "targetId", "edgeType"],
885
751
  response: {
886
752
  description: "The created edge",
887
753
  fields: {
@@ -895,240 +761,6 @@ var CREATE_EDGE = {
895
761
  ontologyPrimitive: "edge",
896
762
  tier: "showcase"
897
763
  };
898
- var UPDATE_EDGE = {
899
- name: "update_edge",
900
- description: "Amend metadata on an existing graph edge. Like `git commit --amend` \u2014 changes the edge annotation without recreating the relationship.",
901
- parameters: {
902
- edgeId: { type: "string", description: "Edge ID or global ID to update" },
903
- weight: { type: "number", description: "Updated edge weight" },
904
- confidence: { type: "number", description: "Updated confidence" },
905
- context: { type: "string", description: "Updated human-readable context" },
906
- derivationType: { type: "string", description: "Updated derivation type" },
907
- metadata: { type: "object", description: "Updated metadata" }
908
- },
909
- required: ["edgeId"],
910
- response: {
911
- description: "Edge update result",
912
- fields: { success: "boolean" }
913
- },
914
- ownerModule: "graph-primitives",
915
- ontologyPrimitive: "edge",
916
- tier: "workhorse"
917
- };
918
- var REMOVE_EDGE = {
919
- name: "remove_edge",
920
- description: "Remove one graph edge by ID. Like `git rm` \u2014 deletes a single explicit relationship from the spine.",
921
- parameters: {
922
- edgeId: { type: "string", description: "Edge ID or global ID to remove" }
923
- },
924
- required: ["edgeId"],
925
- response: {
926
- description: "Edge removal result",
927
- fields: { success: "boolean" }
928
- },
929
- ownerModule: "graph-primitives",
930
- ontologyPrimitive: "edge",
931
- tier: "workhorse"
932
- };
933
- var REMOVE_EDGES_BETWEEN = {
934
- name: "remove_edges_between",
935
- description: "Remove graph edges between two nodes. Like `git rm <pathspec>` \u2014 deletes relationships matching a source, target, and optional type.",
936
- parameters: {
937
- fromNodeId: { type: "string", description: "Source node ID or global ID" },
938
- toNodeId: { type: "string", description: "Target node ID or global ID" },
939
- edgeType: { type: "string", description: "Optional edge type filter" }
940
- },
941
- required: ["fromNodeId", "toNodeId"],
942
- response: {
943
- description: "Matched edge removal result",
944
- fields: { deleted: "number" }
945
- },
946
- ownerModule: "graph-primitives",
947
- ontologyPrimitive: "edge",
948
- tier: "workhorse"
949
- };
950
- var BATCH_CREATE_EDGES = {
951
- name: "batch_create_edges",
952
- description: "Commit multiple typed graph edges. Like `git commit` with many staged paths \u2014 writes a batch of explicit relationships atomically per edge.",
953
- parameters: {
954
- edges: {
955
- type: "array",
956
- description: "Edges to create, each with from, to, edgeType, and optional weight/confidence/context."
957
- },
958
- skipLayerValidation: {
959
- type: "boolean",
960
- description: "Skip kernel layer validation for trusted materialization flows."
961
- }
962
- },
963
- required: ["edges"],
964
- response: {
965
- description: "Batch edge creation result",
966
- fields: {
967
- created: "number",
968
- results: "array",
969
- errors: "array"
970
- }
971
- },
972
- ownerModule: "graph-primitives",
973
- ontologyPrimitive: "edge",
974
- tier: "workhorse"
975
- };
976
- var CREATE_EPISTEMIC_NODE = {
977
- name: "create_epistemic_node",
978
- 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.",
979
- parameters: {
980
- globalId: { type: "string", description: "Optional idempotent node global ID" },
981
- nodeType: { type: "string", description: "Public epistemic node type" },
982
- canonicalText: { type: "string", description: "Canonical node text" },
983
- text: { type: "string", description: "Alias for canonicalText" },
984
- contentHash: { type: "string", description: "Optional idempotency content hash" },
985
- sourceType: { type: "string", description: "Source type for provenance" },
986
- topicId: { type: "string", description: "Optional topic scope" },
987
- content: { type: "string", description: "Extended content" },
988
- title: { type: "string", description: "Display title" },
989
- metadata: { type: "object", description: "Optional node metadata" }
990
- },
991
- required: ["nodeType"],
992
- response: {
993
- description: "Created node result",
994
- fields: {
995
- nodeId: "string",
996
- nodeGlobalId: "string",
997
- isDuplicate: "boolean"
998
- }
999
- },
1000
- ownerModule: "reasoning-kernel",
1001
- ontologyPrimitive: "graph",
1002
- tier: "showcase"
1003
- };
1004
- var GET_EPISTEMIC_NODE = {
1005
- name: "get_epistemic_node",
1006
- description: "Read one epistemic graph node. Like `git show` \u2014 resolves a canonical spine node by ID or global ID.",
1007
- parameters: {
1008
- nodeId: { type: "string", description: "Node ID or global ID" }
1009
- },
1010
- required: ["nodeId"],
1011
- response: {
1012
- description: "The resolved node",
1013
- fields: { node: "object" }
1014
- },
1015
- ownerModule: "reasoning-kernel",
1016
- ontologyPrimitive: "graph",
1017
- tier: "workhorse"
1018
- };
1019
- var LIST_EPISTEMIC_NODES = {
1020
- name: "list_epistemic_nodes",
1021
- description: "List epistemic graph nodes. Like `git ls-tree` \u2014 lists canonical spine nodes by topic, type, status, or search query.",
1022
- parameters: {
1023
- topicId: { type: "string", description: "Optional topic scope" },
1024
- nodeType: { type: "string", description: "Optional node type filter" },
1025
- status: { type: "string", description: "Optional lifecycle status" },
1026
- searchQuery: { type: "string", description: "Optional text search query" },
1027
- limit: { type: "number", description: "Maximum nodes to return" }
1028
- },
1029
- required: [],
1030
- response: {
1031
- description: "Matching nodes",
1032
- fields: { nodes: "array" }
1033
- },
1034
- ownerModule: "reasoning-kernel",
1035
- ontologyPrimitive: "graph",
1036
- tier: "workhorse"
1037
- };
1038
- var UPDATE_EPISTEMIC_NODE = {
1039
- name: "update_epistemic_node",
1040
- description: "Amend an epistemic graph node. Like `git commit --amend` \u2014 updates mutable node metadata, text, status, or verification fields.",
1041
- parameters: {
1042
- nodeId: { type: "string", description: "Node ID or global ID" },
1043
- canonicalText: { type: "string", description: "Updated canonical text" },
1044
- text: { type: "string", description: "Alias for canonicalText" },
1045
- contentHash: { type: "string", description: "Updated content hash" },
1046
- content: { type: "string", description: "Updated content" },
1047
- title: { type: "string", description: "Updated display title" },
1048
- metadata: { type: "object", description: "Updated metadata" },
1049
- confidence: { type: "number", description: "Updated confidence" },
1050
- verificationStatus: { type: "string", description: "Updated verification status" },
1051
- status: { type: "string", description: "Updated lifecycle status" }
1052
- },
1053
- required: ["nodeId"],
1054
- response: {
1055
- description: "Node update result",
1056
- fields: { success: "boolean" }
1057
- },
1058
- ownerModule: "reasoning-kernel",
1059
- ontologyPrimitive: "graph",
1060
- tier: "workhorse"
1061
- };
1062
- var ARCHIVE_EPISTEMIC_NODE = {
1063
- name: "archive_epistemic_node",
1064
- description: "Archive an epistemic graph node. Like `git rm --cached` \u2014 removes a node from active traversal without hard-deleting it.",
1065
- parameters: {
1066
- nodeId: { type: "string", description: "Node ID or global ID" }
1067
- },
1068
- required: ["nodeId"],
1069
- response: {
1070
- description: "Archive result",
1071
- fields: { success: "boolean", effectiveStatus: "string" }
1072
- },
1073
- ownerModule: "reasoning-kernel",
1074
- ontologyPrimitive: "graph",
1075
- tier: "workhorse"
1076
- };
1077
- var VERIFY_EPISTEMIC_NODE = {
1078
- name: "verify_epistemic_node",
1079
- description: "Record verification state on an epistemic graph node. Like `git tag` \u2014 marks the node with a reviewed verification state.",
1080
- parameters: {
1081
- nodeId: { type: "string", description: "Node ID or global ID" },
1082
- verificationStatus: { type: "string", description: "Verification status" },
1083
- confidence: { type: "number", description: "Optional confidence update" }
1084
- },
1085
- required: ["nodeId", "verificationStatus"],
1086
- response: {
1087
- description: "Verification result",
1088
- fields: { success: "boolean" }
1089
- },
1090
- ownerModule: "reasoning-kernel",
1091
- ontologyPrimitive: "graph",
1092
- tier: "workhorse"
1093
- };
1094
- var SUPERSEDE_EPISTEMIC_NODE = {
1095
- name: "supersede_epistemic_node",
1096
- 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.",
1097
- parameters: {
1098
- oldNodeId: { type: "string", description: "Node ID or global ID to supersede" },
1099
- newGlobalId: { type: "string", description: "Optional replacement global ID" },
1100
- newCanonicalText: { type: "string", description: "Replacement canonical text" },
1101
- text: { type: "string", description: "Alias for newCanonicalText" },
1102
- newContentHash: { type: "string", description: "Optional replacement content hash" },
1103
- reason: { type: "string", description: "Reason for superseding" }
1104
- },
1105
- required: ["oldNodeId"],
1106
- response: {
1107
- description: "Supersede result",
1108
- fields: { oldNodeId: "string", newNodeId: "string" }
1109
- },
1110
- ownerModule: "reasoning-kernel",
1111
- ontologyPrimitive: "graph",
1112
- tier: "workhorse"
1113
- };
1114
- var BATCH_CREATE_EPISTEMIC_NODES = {
1115
- name: "batch_create_epistemic_nodes",
1116
- description: "Commit multiple epistemic graph nodes. Like `git commit` with many staged files \u2014 writes a batch of canonical spine nodes.",
1117
- parameters: {
1118
- nodes: {
1119
- type: "array",
1120
- description: "Nodes to create with nodeType, canonicalText/text, and optional metadata."
1121
- }
1122
- },
1123
- required: ["nodes"],
1124
- response: {
1125
- description: "Batch node creation result",
1126
- fields: { created: "number", results: "array" }
1127
- },
1128
- ownerModule: "reasoning-kernel",
1129
- ontologyPrimitive: "graph",
1130
- tier: "workhorse"
1131
- };
1132
764
  var RECORD_JUDGMENT = {
1133
765
  name: "record_judgment",
1134
766
  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).",
@@ -1426,74 +1058,6 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
1426
1058
  ontologyPrimitive: "graph",
1427
1059
  tier: "showcase"
1428
1060
  };
1429
- var LIST_GRAPH_INTELLIGENCE_QUERIES = {
1430
- name: "list_graph_intelligence_queries",
1431
- 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.",
1432
- parameters: {
1433
- categoryId: {
1434
- type: "string",
1435
- description: "Optional category filter, such as problems or strategic"
1436
- },
1437
- mode: {
1438
- type: "string",
1439
- description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
1440
- }
1441
- },
1442
- required: [],
1443
- response: {
1444
- description: "Graph Intelligence query catalog and mode-to-tool mapping",
1445
- fields: {
1446
- categories: "array \u2014 query categories",
1447
- queries: "array \u2014 query definitions with prompt templates and tools",
1448
- quickQueries: "array \u2014 recommended one-click query presets",
1449
- publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
1450
- }
1451
- },
1452
- ownerModule: "graph-intelligence",
1453
- ontologyPrimitive: "graph",
1454
- tier: "showcase"
1455
- };
1456
- var RUN_GRAPH_INTELLIGENCE_QUERY = {
1457
- name: "run_graph_intelligence_query",
1458
- 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.",
1459
- parameters: {
1460
- topicId: { type: "string", description: "Topic to analyze" },
1461
- queryId: {
1462
- type: "string",
1463
- description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
1464
- },
1465
- prompt: {
1466
- type: "string",
1467
- description: "Optional custom prompt for custom analysis runs"
1468
- },
1469
- input: {
1470
- type: "string",
1471
- description: "Optional entity, theme, belief, company, or search text for input-driven queries"
1472
- },
1473
- mode: {
1474
- type: "string",
1475
- description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
1476
- },
1477
- limit: {
1478
- type: "number",
1479
- description: "Maximum graph context rows to return"
1480
- }
1481
- },
1482
- required: ["topicId"],
1483
- response: {
1484
- description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
1485
- fields: {
1486
- query: "object \u2014 selected query definition",
1487
- prompt: "string \u2014 resolved prompt template",
1488
- toolPlan: "array \u2014 public tools and args the model can call next",
1489
- analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
1490
- context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
1491
- }
1492
- },
1493
- ownerModule: "graph-intelligence",
1494
- ontologyPrimitive: "graph",
1495
- tier: "showcase"
1496
- };
1497
1061
  var GET_FALSIFICATION_QUESTIONS = {
1498
1062
  name: "get_falsification_questions",
1499
1063
  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.",
@@ -2329,7 +1893,7 @@ var IDENTITY_WHOAMI = {
2329
1893
  description: "Canonical identity summary for the current session",
2330
1894
  fields: {
2331
1895
  principalId: "string \u2014 canonical federated principal identifier",
2332
- principalType: "string \u2014 human, service, agent, group, or external_viewer",
1896
+ principalType: "string \u2014 human, service, or agent",
2333
1897
  tenantId: "string | undefined \u2014 resolved tenant scope",
2334
1898
  workspaceId: "string | undefined \u2014 resolved workspace scope",
2335
1899
  scopes: "string[] | undefined \u2014 granted scopes for this session",
@@ -2340,60 +1904,17 @@ var IDENTITY_WHOAMI = {
2340
1904
  ontologyPrimitive: "identity",
2341
1905
  tier: "workhorse"
2342
1906
  };
2343
- var RESOLVE_INTERACTIVE_PRINCIPAL = {
2344
- name: "resolve_interactive_principal",
2345
- description: "Read the Permit-backed Lucern principal context for an authenticated Clerk user. Like `git config --get user.email` plus the repository ACL \u2014 resolves the identity alias into the canonical authorization subject.",
2346
- parameters: {
2347
- clerkId: {
2348
- type: "string",
2349
- description: "Authenticated Clerk subject (`sub`). Clerk proves identity only; it is not the authorization record."
2350
- },
2351
- tenantId: {
2352
- type: "string",
2353
- description: "Optional tenant scope. Omit only when the Clerk alias is globally unambiguous."
2354
- },
2355
- workspaceId: {
2356
- type: "string",
2357
- description: "Optional workspace scope. Required when the principal has access to multiple workspaces and no default can be inferred."
2358
- },
2359
- providerProjectId: {
2360
- type: "string",
2361
- description: "Optional Clerk project or provider instance id for tenants with multiple identity providers."
2362
- }
2363
- },
2364
- required: ["clerkId"],
2365
- response: {
2366
- description: "Permit-backed Lucern principal context for tenant SDK bootstrap",
2367
- fields: {
2368
- principalId: "string \u2014 canonical Lucern principal identifier",
2369
- principalType: "string \u2014 human, service, agent, group, or external_viewer",
2370
- clerkId: "string \u2014 authenticated Clerk subject alias",
2371
- tenantId: "string \u2014 resolved tenant scope",
2372
- workspaceId: "string | null \u2014 resolved workspace scope",
2373
- roles: "string[] \u2014 effective Permit roles",
2374
- scopes: "string[] \u2014 effective scopes derived from Permit/control-plane projection",
2375
- groupIds: "string[] \u2014 active Permit group memberships",
2376
- principalStatus: "string \u2014 active, invited, suspended, disabled, revoked, or missing",
2377
- tenantStatus: "string \u2014 projected tenant resource status",
2378
- workspaceStatus: "string \u2014 projected workspace resource status",
2379
- permit: "object \u2014 Permit subject, tenant, and optional workspace tuple"
2380
- }
2381
- },
2382
- ownerModule: "control-plane",
2383
- ontologyPrimitive: "identity",
2384
- tier: "workhorse"
2385
- };
2386
1907
  var COMPILE_CONTEXT = {
2387
1908
  name: "compile_context",
2388
- 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
+ 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.",
2389
1910
  parameters: {
2390
1911
  topicId: {
2391
1912
  type: "string",
2392
- description: "Optional topic scope ID. Omit to resolve the topic from query."
1913
+ description: "Topic scope ID to compile"
2393
1914
  },
2394
1915
  query: {
2395
1916
  type: "string",
2396
- description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
1917
+ description: "Optional focus query used to rank context items"
2397
1918
  },
2398
1919
  budget: {
2399
1920
  type: "number",
@@ -2417,7 +1938,7 @@ var COMPILE_CONTEXT = {
2417
1938
  description: "Include related ontological entities in the compiled result"
2418
1939
  }
2419
1940
  },
2420
- required: [],
1941
+ required: ["topicId"],
2421
1942
  response: {
2422
1943
  description: "Compiled context pack for the requested topic",
2423
1944
  fields: {
@@ -2591,64 +2112,18 @@ var CREATE_TASK = {
2591
2112
  name: "create_task",
2592
2113
  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.",
2593
2114
  parameters: {
2594
- title: { type: "string", description: "Task title" },
2115
+ title: { type: "string", description: "Task description" },
2595
2116
  topicId: { type: "string", description: "Topic scope" },
2596
- description: {
2597
- type: "string",
2598
- description: "Long-form task description"
2599
- },
2600
2117
  taskType: {
2601
2118
  type: "string",
2602
- description: "Task taxonomy",
2603
- enum: [
2604
- "general",
2605
- "find_evidence",
2606
- "verify_claim",
2607
- "research",
2608
- "review",
2609
- "interview",
2610
- "analysis",
2611
- "track_metrics"
2612
- ]
2613
- },
2614
- priority: {
2615
- type: "string",
2616
- description: "Priority",
2617
- enum: ["urgent", "high", "medium", "low"]
2618
- },
2619
- status: {
2620
- type: "string",
2621
- description: "Initial status (defaults to todo)",
2622
- enum: ["todo", "in_progress", "blocked", "done"]
2623
- },
2624
- linkedWorktreeId: {
2625
- type: "string",
2626
- description: "Worktree this task belongs to"
2627
- },
2628
- linkedBeliefId: {
2629
- type: "string",
2630
- description: "Belief this task supports"
2119
+ description: "Type: research, interview, analysis, data_collection",
2120
+ enum: ["research", "interview", "analysis", "data_collection"]
2631
2121
  },
2632
2122
  linkedQuestionId: {
2633
2123
  type: "string",
2634
2124
  description: "Question this task addresses"
2635
2125
  },
2636
- assigneeId: {
2637
- type: "string",
2638
- description: "Principal assigned to the task"
2639
- },
2640
- dueDate: {
2641
- type: "number",
2642
- description: "Due date as epoch milliseconds"
2643
- },
2644
- tags: {
2645
- type: "array",
2646
- description: "Free-form string tags"
2647
- },
2648
- metadata: {
2649
- type: "object",
2650
- description: "Structured task metadata for handoff context and routing hints"
2651
- }
2126
+ linkedWorktreeId: { type: "string", description: "Worktree scope" }
2652
2127
  },
2653
2128
  required: ["title"],
2654
2129
  response: {
@@ -2721,10 +2196,6 @@ var UPDATE_TASK = {
2721
2196
  type: "string",
2722
2197
  description: "Updated status",
2723
2198
  enum: ["todo", "in_progress", "blocked", "done"]
2724
- },
2725
- metadata: {
2726
- type: "object",
2727
- description: "Structured task metadata to replace or refine"
2728
2199
  }
2729
2200
  },
2730
2201
  required: ["taskId"],
@@ -2772,10 +2243,6 @@ var CREATE_TOPIC = {
2772
2243
  name: "create_topic",
2773
2244
  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.",
2774
2245
  parameters: {
2775
- globalId: {
2776
- type: "string",
2777
- description: "Optional idempotent topic global ID"
2778
- },
2779
2246
  name: { type: "string", description: "Topic name" },
2780
2247
  type: {
2781
2248
  type: "string",
@@ -2786,18 +2253,6 @@ var CREATE_TOPIC = {
2786
2253
  type: "string",
2787
2254
  description: "Optional parent topic for nesting"
2788
2255
  },
2789
- parentTopicGlobalId: {
2790
- type: "string",
2791
- description: "Optional parent topic global ID for nesting"
2792
- },
2793
- tenantId: { type: "string", description: "Optional tenant scope" },
2794
- workspaceId: { type: "string", description: "Optional workspace scope" },
2795
- visibility: {
2796
- type: "string",
2797
- description: "Topic visibility",
2798
- enum: ["private", "team", "firm", "external", "public"]
2799
- },
2800
- metadata: { type: "object", description: "Optional topic metadata" },
2801
2256
  createdBy: { type: "string", description: "Who created this topic" }
2802
2257
  },
2803
2258
  required: ["name", "type"],
@@ -2806,9 +2261,6 @@ var CREATE_TOPIC = {
2806
2261
  fields: {
2807
2262
  id: "string \u2014 topic ID",
2808
2263
  globalId: "string \u2014 globally unique ID",
2809
- topicGlobalId: "string \u2014 topic global ID",
2810
- epistemicNodeId: "string \u2014 materialized topic node ID",
2811
- epistemicNodeGlobalId: "string \u2014 materialized topic node global ID",
2812
2264
  depth: "number \u2014 nesting depth"
2813
2265
  }
2814
2266
  },
@@ -2939,65 +2391,6 @@ var GET_TOPIC_TREE = {
2939
2391
  ontologyPrimitive: "graph",
2940
2392
  tier: "workhorse"
2941
2393
  };
2942
- var MATERIALIZE_TOPIC_GRAPH = {
2943
- name: "materialize_topic_graph",
2944
- description: "Backfill the topic graph spine. Like `git fsck --connectivity-only` with repair enabled \u2014 creates missing topic nodes and parent-child edges idempotently.",
2945
- parameters: {
2946
- rootTopicId: {
2947
- type: "string",
2948
- description: "Optional root topic for a bounded materialization pass"
2949
- },
2950
- dryRun: {
2951
- type: "boolean",
2952
- description: "When true, report missing rows without writing them"
2953
- }
2954
- },
2955
- required: [],
2956
- response: {
2957
- description: "Topic graph materialization counts",
2958
- fields: {
2959
- topicsSeen: "number",
2960
- nodesCreated: "number",
2961
- nodesExisting: "number",
2962
- edgesCreated: "number",
2963
- edgesExisting: "number",
2964
- errors: "array"
2965
- }
2966
- },
2967
- ownerModule: "reasoning-kernel",
2968
- ontologyPrimitive: "graph",
2969
- tier: "workhorse"
2970
- };
2971
- var GET_TOPIC_GRAPH_SPINE = {
2972
- name: "get_topic_graph_spine",
2973
- description: "Verify the topic graph spine. Like `git fsck` \u2014 reads topics, materialized topic nodes, parent-child edges, and missing spine rows.",
2974
- parameters: {
2975
- rootTopicId: {
2976
- type: "string",
2977
- description: "Optional root topic for a bounded verifier pass"
2978
- },
2979
- includeTopicBeliefEdges: {
2980
- type: "boolean",
2981
- description: "Include topic -> belief edges in the verifier payload"
2982
- }
2983
- },
2984
- required: [],
2985
- response: {
2986
- description: "Topic graph spine verification payload",
2987
- fields: {
2988
- ok: "boolean",
2989
- counts: "object",
2990
- topics: "array",
2991
- topicNodes: "array",
2992
- parentEdges: "array",
2993
- missingTopicNodes: "array",
2994
- missingParentEdges: "array"
2995
- }
2996
- },
2997
- ownerModule: "reasoning-kernel",
2998
- ontologyPrimitive: "graph",
2999
- tier: "workhorse"
3000
- };
3001
2394
  var GET_CODE_CONTEXT = {
3002
2395
  name: "get_code_context",
3003
2396
  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.",
@@ -4130,72 +3523,6 @@ var GENERATE_SESSION_HANDOFF = {
4130
3523
  tier: "showcase",
4131
3524
  internal: true
4132
3525
  };
4133
- var BEGIN_BUILD_SESSION = {
4134
- name: "begin_build_session",
4135
- 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.",
4136
- parameters: {
4137
- worktreeId: {
4138
- type: "string",
4139
- description: "The Lucern worktree ID to bootstrap."
4140
- },
4141
- branch: {
4142
- type: "string",
4143
- description: "Optional git branch name. Auto-generated from the worktree name when omitted."
4144
- },
4145
- branchBase: {
4146
- type: "string",
4147
- description: 'Base branch for the feature branch. Default: "staging".'
4148
- },
4149
- prBase: {
4150
- type: "string",
4151
- description: 'Target branch for the PR. Default: "staging".'
4152
- },
4153
- sessionMode: {
4154
- type: "string",
4155
- description: 'Session mode: "async" for Codex/headless or "interactive" for live sessions.',
4156
- enum: ["async", "interactive"]
4157
- },
4158
- activateIfPlanning: {
4159
- type: "boolean",
4160
- description: "When true, automatically activate a planning worktree during bootstrap."
4161
- }
4162
- },
4163
- required: ["worktreeId"],
4164
- response: {
4165
- description: "A compact build-session packet with worktree metadata, graph anchors, questions, dependencies, and git defaults.",
4166
- fields: {
4167
- topicId: "string \u2014 canonical topic scope",
4168
- topicName: "string \u2014 human-readable topic name",
4169
- worktreeId: "string \u2014 worktree ID",
4170
- worktreeName: "string \u2014 human-readable worktree name",
4171
- branch: "string \u2014 git branch name",
4172
- branchBase: "string \u2014 base branch",
4173
- prBase: "string \u2014 PR target branch",
4174
- campaign: "number | null \u2014 top-level pipeline campaign",
4175
- lane: "string \u2014 campaign lane",
4176
- gate: "string \u2014 exit gate",
4177
- hypothesis: "string \u2014 worktree hypothesis",
4178
- focus: "string \u2014 session focus",
4179
- status: "string \u2014 worktree status after optional activation",
4180
- sessionMode: "string \u2014 async | interactive",
4181
- targetBeliefIds: "array \u2014 scoped belief IDs",
4182
- targetQuestionIds: "array \u2014 scoped question IDs",
4183
- taskIds: "array \u2014 assigned task IDs for this worktree",
4184
- incompleteTaskIds: "array \u2014 assigned task IDs that still require done/deferred/blocked proof",
4185
- tasks: "array \u2014 assigned task packet with id, title, status, priority, links, and summaries",
4186
- topBeliefs: "array \u2014 highest-confidence scoped beliefs",
4187
- openQuestions: "array \u2014 open scoped questions",
4188
- resolvedDecisions: "array \u2014 answered questions summarized for the session",
4189
- dependencies: "array \u2014 upstream worktrees",
4190
- unblocks: "array \u2014 downstream worktrees",
4191
- mergeOrderNotes: "string \u2014 merge ordering advisory"
4192
- }
4193
- },
4194
- ownerModule: "bootstrap",
4195
- ontologyPrimitive: "worktree",
4196
- tier: "showcase",
4197
- internal: true
4198
- };
4199
3526
  var MCP_TOOL_CONTRACTS = {
4200
3527
  // Belief lifecycle (commit, amend, fork, archive)
4201
3528
  create_belief: CREATE_BELIEF,
@@ -4238,26 +3565,11 @@ var MCP_TOOL_CONTRACTS = {
4238
3565
  bisect_confidence: BISECT_CONFIDENCE,
4239
3566
  // Edges (commit)
4240
3567
  create_edge: CREATE_EDGE,
4241
- update_edge: UPDATE_EDGE,
4242
- remove_edge: REMOVE_EDGE,
4243
- remove_edges_between: REMOVE_EDGES_BETWEEN,
4244
- batch_create_edges: BATCH_CREATE_EDGES,
4245
- // Epistemic node spine (commit/amend/show)
4246
- create_epistemic_node: CREATE_EPISTEMIC_NODE,
4247
- get_epistemic_node: GET_EPISTEMIC_NODE,
4248
- list_epistemic_nodes: LIST_EPISTEMIC_NODES,
4249
- update_epistemic_node: UPDATE_EPISTEMIC_NODE,
4250
- archive_epistemic_node: ARCHIVE_EPISTEMIC_NODE,
4251
- verify_epistemic_node: VERIFY_EPISTEMIC_NODE,
4252
- supersede_epistemic_node: SUPERSEDE_EPISTEMIC_NODE,
4253
- batch_create_epistemic_nodes: BATCH_CREATE_EPISTEMIC_NODES,
4254
3568
  // Judgments (tag)
4255
3569
  record_judgment: RECORD_JUDGMENT,
4256
3570
  // Graph intelligence (showcase)
4257
3571
  detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
4258
3572
  get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
4259
- list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
4260
- run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
4261
3573
  get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
4262
3574
  // Evidence operations (workhorse)
4263
3575
  search_evidence: SEARCH_EVIDENCE,
@@ -4285,7 +3597,6 @@ var MCP_TOOL_CONTRACTS = {
4285
3597
  update_worktree_targets: UPDATE_WORKTREE_TARGETS,
4286
3598
  update_worktree_metadata: UPDATE_WORKTREE_METADATA,
4287
3599
  identity_whoami: IDENTITY_WHOAMI,
4288
- resolve_interactive_principal: RESOLVE_INTERACTIVE_PRINCIPAL,
4289
3600
  compile_context: COMPILE_CONTEXT,
4290
3601
  record_scope_learning: RECORD_SCOPE_LEARNING,
4291
3602
  pipeline_snapshot: PIPELINE_SNAPSHOT,
@@ -4305,7 +3616,6 @@ var MCP_TOOL_CONTRACTS = {
4305
3616
  get_agent_inbox: GET_AGENT_INBOX,
4306
3617
  claim_files: CLAIM_FILES,
4307
3618
  generate_session_handoff: GENERATE_SESSION_HANDOFF,
4308
- begin_build_session: BEGIN_BUILD_SESSION,
4309
3619
  // Policy / ACL (workhorse)
4310
3620
  check_permission: CHECK_PERMISSION,
4311
3621
  filter_by_permission: FILTER_BY_PERMISSION,
@@ -4325,8 +3635,6 @@ var MCP_TOOL_CONTRACTS = {
4325
3635
  get_topic: GET_TOPIC,
4326
3636
  update_topic: UPDATE_TOPIC,
4327
3637
  get_topic_tree: GET_TOPIC_TREE,
4328
- materialize_topic_graph: MATERIALIZE_TOPIC_GRAPH,
4329
- get_topic_graph_spine: GET_TOPIC_GRAPH_SPINE,
4330
3638
  // Coding intelligence (code-grounded knowledge)
4331
3639
  get_code_context: GET_CODE_CONTEXT,
4332
3640
  get_change_history: GET_CHANGE_HISTORY,
@@ -4403,7 +3711,6 @@ function entries(names, surfaceClass, surfaceIntent, surfaces, rationale) {
4403
3711
  var MCP_CORE_OPERATION_NAMES = [
4404
3712
  "compile_context",
4405
3713
  "identity_whoami",
4406
- "resolve_interactive_principal",
4407
3714
  "check_permission",
4408
3715
  "filter_by_permission",
4409
3716
  "create_belief",
@@ -4432,34 +3739,18 @@ var MCP_CORE_OPERATION_NAMES = [
4432
3739
  "find_missing_questions",
4433
3740
  "get_high_priority_questions",
4434
3741
  "get_falsification_questions",
4435
- "create_epistemic_node",
4436
- "get_epistemic_node",
4437
- "list_epistemic_nodes",
4438
- "update_epistemic_node",
4439
- "archive_epistemic_node",
4440
- "verify_epistemic_node",
4441
- "supersede_epistemic_node",
4442
- "batch_create_epistemic_nodes",
4443
3742
  "create_topic",
4444
3743
  "get_topic",
4445
3744
  "list_topics",
4446
3745
  "update_topic",
4447
- "get_topic_tree",
4448
- "materialize_topic_graph",
4449
- "get_topic_graph_spine"
3746
+ "get_topic_tree"
4450
3747
  ];
4451
3748
  var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
4452
3749
  "create_edge",
4453
- "update_edge",
4454
- "remove_edge",
4455
- "remove_edges_between",
4456
- "batch_create_edges",
4457
3750
  "query_lineage",
4458
3751
  "traverse_graph",
4459
3752
  "get_graph_neighborhood",
4460
3753
  "get_graph_structure_analysis",
4461
- "list_graph_intelligence_queries",
4462
- "run_graph_intelligence_query",
4463
3754
  "find_contradictions",
4464
3755
  "flag_contradiction",
4465
3756
  "detect_confirmation_bias",
@@ -4538,7 +3829,6 @@ var PLATFORM_INTERNAL_OPERATION_NAMES = [
4538
3829
  "get_change_history",
4539
3830
  "get_failure_log",
4540
3831
  "record_attempt",
4541
- "begin_build_session",
4542
3832
  "push",
4543
3833
  "open_pull_request",
4544
3834
  "record_judgment",
@@ -4593,6 +3883,7 @@ var SDK_ONLY_OPERATION_NAMES = [
4593
3883
  "find_semantic_orphans"
4594
3884
  ];
4595
3885
  var MCP_ONLY_INTERNAL_OPERATION_NAMES = [
3886
+ "begin_build_session",
4596
3887
  "evaluate_engineering_contract",
4597
3888
  "evaluate_research_contract"
4598
3889
  ];
@@ -4689,13 +3980,6 @@ var LUCERN_OPERATION_MANIFEST = {
4689
3980
  "Lucern MCP-only platform operation for local agent/bootstrap or verification workflows. Hidden from public discovery."
4690
3981
  )
4691
3982
  };
4692
- z.enum(["decision", "belief", "question", "theme", "deal", "topic", "claim", "evidence", "synthesis", "answer", "atomic_fact", "excerpt", "source", "company", "person", "investor", "function", "value_chain"]);
4693
- var EDGE_TYPE_VALUES = ["supports", "informs", "depends_on", "derived_from", "contains", "tests", "supersedes", "responds_to", "belongs_to", "relates_to_thesis", "works_at", "invested_in", "competes_with", "participates_in", "founded_by", "evaluates", "performs", "function_in", "impacts", "raised_from", "mentioned_in", "perspective_on", "plays_theme", "answers", "explores", "qualifies", "based_on", "based_on_belief", "based_on_question", "blocked_by_contradiction", "informed_by_theme", "same_as", "reinforces", "parent_of", "child_of", "falsified_by", "exclusive_with", "collapses_if", "cascade_from", "counterfactual_of", "cascade_to", "mutually_exclusive", "correlates_with", "amplifies", "precondition_for", "in_tension_with", "strengthened_by", "weakened_by", "alternative_to", "subsumes", "validated_by", "required_for", "blocks", "prerequisite_for", "parallel_to", "corroborates", "extends", "same_source_as", "same_theme_as", "assumes", "would_predict", "analogous_to", "independent_of", "implements", "violates", "co_changes_with", "migrating_from", "migrating_to", "scoped_by", "about_entity", "entity_referenced_in", "contradicts", "cites", "summarizes", "related_to", "partially_answers", "refines", "branches_from"];
4694
- var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
4695
- z.enum(EDGE_TYPE_VALUES);
4696
- z.enum(STORAGE_EDGE_TYPE_VALUES);
4697
- z.enum(["active", "archived", "watching"]);
4698
- z.enum(["private", "team", "firm", "external", "public"]);
4699
3983
 
4700
3984
  // src/function-registry/helpers.ts
4701
3985
  var jsonObjectSchema = z.record(z.unknown());
@@ -4792,20 +4076,12 @@ function unwrapMcpParameterSchema(schema) {
4792
4076
  current = current._def.schema;
4793
4077
  continue;
4794
4078
  default:
4795
- return {
4796
- schema: current,
4797
- required,
4798
- description: description ?? current.description
4799
- };
4079
+ return { schema: current, required, description: description ?? current.description };
4800
4080
  }
4801
4081
  }
4802
4082
  }
4803
4083
  function mcpParameterFromZod(fieldName, schema, contractName) {
4804
- const {
4805
- schema: unwrapped,
4806
- required,
4807
- description: schemaDescription
4808
- } = unwrapMcpParameterSchema(schema);
4084
+ const { schema: unwrapped, required, description: schemaDescription } = unwrapMcpParameterSchema(schema);
4809
4085
  const description = schemaDescription ?? unwrapped.description ?? fieldName;
4810
4086
  switch (unwrapped._def.typeName) {
4811
4087
  case z.ZodFirstPartyTypeKind.ZodString:
@@ -4850,12 +4126,10 @@ function mcpContractFromArgsSchema(base, args, contractName) {
4850
4126
  const entries2 = Object.entries(getObjectShape(args)).sort(
4851
4127
  ([left], [right]) => left.localeCompare(right)
4852
4128
  );
4853
- const converted = entries2.map(
4854
- ([fieldName, schema]) => [
4855
- fieldName,
4856
- mcpParameterFromZod(fieldName, schema, contractName)
4857
- ]
4858
- );
4129
+ const converted = entries2.map(([fieldName, schema]) => [
4130
+ fieldName,
4131
+ mcpParameterFromZod(fieldName, schema, contractName)
4132
+ ]);
4859
4133
  return {
4860
4134
  ...base,
4861
4135
  parameters: Object.fromEntries(
@@ -4864,7 +4138,9 @@ function mcpContractFromArgsSchema(base, args, contractName) {
4864
4138
  required: converted.filter(([, field]) => field.required).map(([fieldName]) => fieldName)
4865
4139
  };
4866
4140
  }
4867
- var defineFunctionContract = (contract) => contract;
4141
+ function defineFunctionContract(contract) {
4142
+ return contract;
4143
+ }
4868
4144
  function authUserId(context) {
4869
4145
  return context.userId ?? context.principalId ?? "lucern-agent";
4870
4146
  }
@@ -4964,16 +4240,9 @@ function surfaceContract(args) {
4964
4240
  scopes: args.scopes ?? [
4965
4241
  args.kind === "query" ? `${args.domain}.read` : `${args.domain}.write`
4966
4242
  ],
4967
- allowedPrincipalTypes: [
4968
- "user",
4969
- "service",
4970
- "agent",
4971
- "group",
4972
- "external_viewer"
4973
- ]
4243
+ allowedPrincipalTypes: ["user", "service", "agent"]
4974
4244
  },
4975
4245
  convex: args.convex,
4976
- gateway: args.gateway,
4977
4246
  args: canonicalArgs,
4978
4247
  returns: canonicalReturns,
4979
4248
  input,
@@ -5013,7 +4282,7 @@ var createEvidenceInputSchemaBase = z.object({
5013
4282
  targetId: z.string().optional(),
5014
4283
  targetNodeId: z.string().optional(),
5015
4284
  linkedBeliefNodeId: z.string().optional(),
5016
- evidenceRelation: z.enum(["supports", "contradicts"]).optional(),
4285
+ evidenceRelation: z.enum(["supports", "contradicts", "neutral"]).optional(),
5017
4286
  confidence: z.number().optional(),
5018
4287
  weight: z.number().optional(),
5019
4288
  reasoning: z.string().optional(),
@@ -5033,11 +4302,8 @@ function compactRecord2(input) {
5033
4302
  Object.entries(input).filter(([, value]) => value !== void 0)
5034
4303
  );
5035
4304
  }
5036
- function isRecord(value) {
5037
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
5038
- }
5039
4305
  function recordValue2(value) {
5040
- return isRecord(value) ? value : {};
4306
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
5041
4307
  }
5042
4308
  var createEvidenceProjection = defineProjection({
5043
4309
  contractName: "create_evidence",
@@ -5098,7 +4364,8 @@ var createEvidenceProjection = defineProjection({
5098
4364
  evidenceRelation: v.optional(
5099
4365
  v.union(
5100
4366
  v.literal("supports"),
5101
- v.literal("contradicts")
4367
+ v.literal("contradicts"),
4368
+ v.literal("neutral")
5102
4369
  )
5103
4370
  ),
5104
4371
  confidence: v.optional(v.number()),
@@ -5106,51 +4373,19 @@ var createEvidenceProjection = defineProjection({
5106
4373
  trustedBypassAccessCheck: v.optional(v.boolean())
5107
4374
  })
5108
4375
  });
5109
- var jsonRecordSchema2 = z.record(z.unknown());
5110
- var evidenceRelationSchema = z.enum(["supports", "contradicts"]);
5111
- var createEvidenceArgs = z.object({
5112
- topicId: z.string().optional().describe("Topic scope for the evidence."),
5113
- text: z.string().describe("Canonical evidence text."),
5114
- source: z.string().optional().describe("Source URL or source label."),
5115
- sourceUrl: z.string().optional().describe("Canonical source URL."),
5116
- targetId: z.string().optional().describe("Belief or question identifier to link immediately."),
5117
- linkedBeliefNodeId: z.string().optional().describe("Belief node this evidence bears on."),
5118
- evidenceRelation: evidenceRelationSchema.optional().describe("How the evidence relates to the linked belief."),
5119
- confidence: z.number().optional().describe("Confidence in the evidence relation."),
5120
- weight: z.number().optional().describe("Support weight from -1.0 to +1.0."),
5121
- metadata: jsonRecordSchema2.optional().describe("Metadata merged into the canonical evidence node."),
5122
- rationale: z.string().describe("Why this evidence should enter the reasoning graph."),
5123
- reasoning: z.string().optional().describe("Reasoning note preserved in evidence metadata."),
5124
- title: z.string().optional().describe("Optional short title."),
5125
- content: z.string().optional().describe("Optional long-form content."),
5126
- contentType: z.string().optional().describe("Content format or MIME hint."),
5127
- kind: z.string().optional().describe("Evidence kind."),
5128
- tags: z.array(z.string()).optional().describe("Evidence tags."),
5129
- sourceType: z.string().optional().describe("Evidence source type."),
5130
- externalSourceType: z.string().optional().describe("External source type for imported evidence."),
5131
- sourceQuestionId: z.string().optional().describe("Question that sourced this evidence."),
5132
- methodology: z.string().optional().describe("Collection methodology."),
5133
- informationAsymmetry: z.string().optional().describe("Information asymmetry class."),
5134
- sourceDescription: z.string().optional().describe("Human-readable source description.")
5135
- });
5136
- var addEvidenceArgs = z.object({
5137
- canonicalText: z.string().describe("The evidence statement."),
5138
- text: z.string().optional().describe("Canonical evidence text alias used by newer callers."),
5139
- topicId: z.string().optional().describe("Topic scope hint."),
5140
- sourceUrl: z.string().optional().describe("URL of the source material."),
5141
- targetNodeId: z.string().describe("The belief this evidence bears on."),
5142
- weight: z.number().optional().describe("Support weight from -1.0 to +1.0."),
5143
- reasoning: z.string().describe("Why this evidence is relevant to the target belief."),
5144
- title: z.string().optional().describe("Optional short title."),
5145
- content: z.string().optional().describe("Optional long-form evidence content."),
5146
- contentType: z.string().optional().describe("Content format or MIME hint."),
5147
- metadata: jsonRecordSchema2.optional().describe("Optional metadata merged into the evidence node.")
5148
- });
4376
+
4377
+ // src/function-registry/evidence.ts
5149
4378
  var evidenceIdInput = (input) => compactRecord({
5150
4379
  evidenceId: input.evidenceId,
5151
4380
  insightId: input.insightId,
5152
4381
  nodeId: input.nodeId ?? input.id ?? input.evidenceId
5153
4382
  });
4383
+ var evidenceTopicInput = (input) => compactRecord({
4384
+ topicId: input.topicId,
4385
+ status: input.status,
4386
+ userId: input.userId,
4387
+ limit: input.limit
4388
+ });
5154
4389
  var createEvidenceInput = (input, context) => {
5155
4390
  const parsed = createEvidenceProjection.inputSchema.safeParse(input);
5156
4391
  if (!parsed.success) {
@@ -5167,12 +4402,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
5167
4402
  compactRecord({
5168
4403
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
5169
4404
  toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
5170
- edgeType: "informs",
4405
+ edgeType: "evidence_supports_belief",
5171
4406
  globalId: input.globalId ?? `edge:${String(
5172
4407
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
5173
4408
  )}:${String(
5174
4409
  input.beliefNodeId ?? input.beliefId ?? input.targetId
5175
- )}:informs`,
4410
+ )}:evidence_supports_belief`,
5176
4411
  weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
5177
4412
  context: input.rationale ?? input.context,
5178
4413
  skipLayerValidation: true,
@@ -5185,12 +4420,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
5185
4420
  compactRecord({
5186
4421
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
5187
4422
  toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
5188
- edgeType: "responds_to",
4423
+ edgeType: "evidence_supports_question",
5189
4424
  globalId: input.globalId ?? `edge:${String(
5190
4425
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
5191
4426
  )}:${String(
5192
4427
  input.questionId ?? input.questionNodeId ?? input.targetId
5193
- )}:responds_to`,
4428
+ )}:evidence_supports_question`,
5194
4429
  weight: input.impactScore ?? input.weight,
5195
4430
  context: input.rationale ?? input.context,
5196
4431
  skipLayerValidation: true,
@@ -5214,8 +4449,7 @@ var evidenceContracts = [
5214
4449
  functionName: "create",
5215
4450
  kind: "mutation",
5216
4451
  inputProjection: createEvidenceInput
5217
- },
5218
- args: createEvidenceArgs
4452
+ }
5219
4453
  }),
5220
4454
  surfaceContract({
5221
4455
  name: "add_evidence",
@@ -5251,8 +4485,7 @@ var evidenceContracts = [
5251
4485
  context
5252
4486
  );
5253
4487
  }
5254
- },
5255
- args: addEvidenceArgs
4488
+ }
5256
4489
  }),
5257
4490
  surfaceContract({
5258
4491
  name: "get_evidence",
@@ -5281,8 +4514,11 @@ var evidenceContracts = [
5281
4514
  sdkNamespace: "evidence",
5282
4515
  sdkMethod: "listEvidence",
5283
4516
  summary: "List evidence for a topic.",
5284
- gateway: {
5285
- handler: "evidence.list"
4517
+ convex: {
4518
+ module: "evidence",
4519
+ functionName: "getByTopic",
4520
+ kind: "query",
4521
+ inputProjection: evidenceTopicInput
5286
4522
  }
5287
4523
  }),
5288
4524
  surfaceContract({