@lucern/contracts 0.3.0-alpha.9 → 1.0.0

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 (253) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/api-enums.contract.d.ts +5 -3
  3. package/dist/api-enums.contract.js +14 -12
  4. package/dist/api-enums.contract.js.map +1 -1
  5. package/dist/auth-context.contract.js +14 -2
  6. package/dist/auth-context.contract.js.map +1 -1
  7. package/dist/auth-session.contract.js +14 -2
  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 +14 -2
  11. package/dist/auth.contract.js.map +1 -1
  12. package/dist/component-boundary.contract.d.ts +1 -1
  13. package/dist/component-boundary.contract.js +46 -26
  14. package/dist/component-boundary.contract.js.map +1 -1
  15. package/dist/component-host-boundary.contract.d.ts +10 -5
  16. package/dist/component-host-boundary.contract.js +10 -4
  17. package/dist/component-host-boundary.contract.js.map +1 -1
  18. package/dist/{defineTable-CBQ03FXl.d.ts → defineTable-t1wr5wgn.d.ts} +1 -1
  19. package/dist/{dsl-djCRfuWC.d.ts → dsl-DVPthQGY.d.ts} +1 -1
  20. package/dist/dsl.d.ts +2 -2
  21. package/dist/dsl.js.map +1 -1
  22. package/dist/function-registry/beliefs.d.ts +23 -10
  23. package/dist/function-registry/beliefs.js +467 -36
  24. package/dist/function-registry/beliefs.js.map +1 -1
  25. package/dist/function-registry/coding.d.ts +15 -6
  26. package/dist/function-registry/coding.js +531 -22
  27. package/dist/function-registry/coding.js.map +1 -1
  28. package/dist/function-registry/context.d.ts +9 -3
  29. package/dist/function-registry/context.js +464 -21
  30. package/dist/function-registry/context.js.map +1 -1
  31. package/dist/function-registry/contracts.d.ts +9 -3
  32. package/dist/function-registry/contracts.js +464 -21
  33. package/dist/function-registry/contracts.js.map +1 -1
  34. package/dist/function-registry/coordination.d.ts +21 -9
  35. package/dist/function-registry/coordination.js +464 -21
  36. package/dist/function-registry/coordination.js.map +1 -1
  37. package/dist/function-registry/edges.d.ts +167 -2
  38. package/dist/function-registry/edges.js +619 -28
  39. package/dist/function-registry/edges.js.map +1 -1
  40. package/dist/function-registry/evidence.d.ts +19 -8
  41. package/dist/function-registry/evidence.js +469 -36
  42. package/dist/function-registry/evidence.js.map +1 -1
  43. package/dist/function-registry/graph.d.ts +33 -15
  44. package/dist/function-registry/graph.js +464 -21
  45. package/dist/function-registry/graph.js.map +1 -1
  46. package/dist/function-registry/helpers.d.ts +6 -3
  47. package/dist/function-registry/helpers.js +465 -22
  48. package/dist/function-registry/helpers.js.map +1 -1
  49. package/dist/function-registry/identity.d.ts +62 -16
  50. package/dist/function-registry/identity.js +487 -27
  51. package/dist/function-registry/identity.js.map +1 -1
  52. package/dist/function-registry/index.d.ts +4 -2
  53. package/dist/function-registry/index.js +468 -22
  54. package/dist/function-registry/index.js.map +1 -1
  55. package/dist/function-registry/judgments.d.ts +7 -2
  56. package/dist/function-registry/judgments.js +464 -21
  57. package/dist/function-registry/judgments.js.map +1 -1
  58. package/dist/function-registry/legacy.d.ts +5 -1
  59. package/dist/function-registry/legacy.js +464 -21
  60. package/dist/function-registry/legacy.js.map +1 -1
  61. package/dist/function-registry/lenses.d.ts +11 -4
  62. package/dist/function-registry/lenses.js +464 -21
  63. package/dist/function-registry/lenses.js.map +1 -1
  64. package/dist/function-registry/manifest.d.ts +4 -4
  65. package/dist/function-registry/manifest.js +16 -1
  66. package/dist/function-registry/manifest.js.map +1 -1
  67. package/dist/function-registry/nodes.d.ts +412 -0
  68. package/dist/function-registry/nodes.js +5354 -0
  69. package/dist/function-registry/nodes.js.map +1 -0
  70. package/dist/function-registry/ontologies.d.ts +25 -11
  71. package/dist/function-registry/ontologies.js +464 -21
  72. package/dist/function-registry/ontologies.js.map +1 -1
  73. package/dist/function-registry/pipeline.d.ts +9 -3
  74. package/dist/function-registry/pipeline.js +464 -21
  75. package/dist/function-registry/pipeline.js.map +1 -1
  76. package/dist/function-registry/questions.d.ts +27 -12
  77. package/dist/function-registry/questions.js +466 -26
  78. package/dist/function-registry/questions.js.map +1 -1
  79. package/dist/function-registry/tasks.d.ts +11 -4
  80. package/dist/function-registry/tasks.js +497 -30
  81. package/dist/function-registry/tasks.js.map +1 -1
  82. package/dist/function-registry/topics.d.ts +93 -5
  83. package/dist/function-registry/topics.js +534 -24
  84. package/dist/function-registry/topics.js.map +1 -1
  85. package/dist/function-registry/types.d.ts +7 -3
  86. package/dist/function-registry/worktrees.d.ts +25 -11
  87. package/dist/function-registry/worktrees.js +480 -21
  88. package/dist/function-registry/worktrees.js.map +1 -1
  89. package/dist/gateway.contract.d.ts +4 -0
  90. package/dist/gateway.contract.js.map +1 -1
  91. package/dist/generated/convexSchemas.d.ts +3 -3
  92. package/dist/generated/convexSchemas.js +37 -17
  93. package/dist/generated/convexSchemas.js.map +1 -1
  94. package/dist/generated/infisicalRuntimeEnv.d.ts +70 -0
  95. package/dist/generated/infisicalRuntimeEnv.js +27585 -0
  96. package/dist/generated/infisicalRuntimeEnv.js.map +1 -0
  97. package/dist/generated/lucernGatewayEnv.d.ts +17 -0
  98. package/dist/generated/lucernGatewayEnv.js +38 -0
  99. package/dist/generated/lucernGatewayEnv.js.map +1 -0
  100. package/dist/generated/lucernWebPublicEnv.d.ts +26 -0
  101. package/dist/generated/lucernWebPublicEnv.js +32 -0
  102. package/dist/generated/lucernWebPublicEnv.js.map +1 -0
  103. package/dist/generated/lucernWebServerEnv.d.ts +33 -0
  104. package/dist/generated/lucernWebServerEnv.js +51 -0
  105. package/dist/generated/lucernWebServerEnv.js.map +1 -0
  106. package/dist/generated/schema-manifest.json +1221 -114
  107. package/dist/generated/tableOwnership.d.ts +48 -28
  108. package/dist/generated/tableOwnership.js +66 -26
  109. package/dist/generated/tableOwnership.js.map +1 -1
  110. package/dist/generated/tier-expectations.json +64 -9
  111. package/dist/{index-O09U2xHk.d.ts → index-CM1Pl_vI.d.ts} +3 -3
  112. package/dist/index.d.ts +11 -6
  113. package/dist/index.js +32838 -413
  114. package/dist/index.js.map +1 -1
  115. package/dist/infisical-runtime.contract.d.ts +1763 -6
  116. package/dist/infisical-runtime.contract.js +2994 -15
  117. package/dist/infisical-runtime.contract.js.map +1 -1
  118. package/dist/manifests/infisical-runtime-manifest.d.ts +1689 -6
  119. package/dist/manifests/infisical-runtime-manifest.js +2847 -12
  120. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  121. package/dist/manifests/tenant-client-manifest.d.ts +19 -14
  122. package/dist/manifests/tenant-client-manifest.js +29 -12
  123. package/dist/manifests/tenant-client-manifest.js.map +1 -1
  124. package/dist/mcp-gateway-boundary.contract.d.ts +23 -3
  125. package/dist/mcp-gateway-boundary.contract.js +2 -0
  126. package/dist/mcp-gateway-boundary.contract.js.map +1 -1
  127. package/dist/permit-principal-projection.contract.d.ts +74 -0
  128. package/dist/permit-principal-projection.contract.js +167 -0
  129. package/dist/permit-principal-projection.contract.js.map +1 -0
  130. package/dist/projections/check-convex-args-shape.js +10 -6
  131. package/dist/projections/check-convex-args-shape.js.map +1 -1
  132. package/dist/projections/create-evidence.projection.d.ts +6 -6
  133. package/dist/projections/create-evidence.projection.js +2 -3
  134. package/dist/projections/create-evidence.projection.js.map +1 -1
  135. package/dist/projections/index.d.ts +3 -3
  136. package/dist/projections/index.js +10 -6
  137. package/dist/projections/index.js.map +1 -1
  138. package/dist/projections/list-tasks.projection.d.ts +20 -8
  139. package/dist/projections/list-tasks.projection.js +8 -3
  140. package/dist/projections/list-tasks.projection.js.map +1 -1
  141. package/dist/proof-attestation.json +45 -0
  142. package/dist/schemas/component-table-manifest.d.ts +6 -6
  143. package/dist/schemas/component-table-manifest.js +2 -2
  144. package/dist/schemas/component-table-manifest.js.map +1 -1
  145. package/dist/schemas/index.d.ts +2 -2
  146. package/dist/schemas/index.js +1123 -137
  147. package/dist/schemas/index.js.map +1 -1
  148. package/dist/schemas/manifest.d.ts +2102 -132
  149. package/dist/schemas/manifest.js +1121 -135
  150. package/dist/schemas/manifest.js.map +1 -1
  151. package/dist/schemas/tables/controlPlane/accessControl.d.ts +260 -0
  152. package/dist/schemas/tables/controlPlane/accessControl.js +658 -0
  153. package/dist/schemas/tables/controlPlane/accessControl.js.map +1 -0
  154. package/dist/schemas/tables/{identity → controlPlane}/agent.d.ts +1 -1
  155. package/dist/schemas/tables/{identity → controlPlane}/agent.js +3 -3
  156. package/dist/schemas/tables/controlPlane/agent.js.map +1 -0
  157. package/dist/schemas/tables/{identity → controlPlane}/epistemic.d.ts +1 -1
  158. package/dist/schemas/tables/{identity → controlPlane}/epistemic.js +3 -3
  159. package/dist/schemas/tables/controlPlane/epistemic.js.map +1 -0
  160. package/dist/schemas/tables/{identity → controlPlane}/model.d.ts +1 -1
  161. package/dist/schemas/tables/{identity → controlPlane}/model.js +6 -6
  162. package/dist/schemas/tables/controlPlane/model.js.map +1 -0
  163. package/dist/schemas/tables/{identity → controlPlane}/platform.d.ts +1 -1
  164. package/dist/schemas/tables/{identity → controlPlane}/platform.js +18 -18
  165. package/dist/schemas/tables/controlPlane/platform.js.map +1 -0
  166. package/dist/schemas/tables/{identity → controlPlane}/project.d.ts +1 -1
  167. package/dist/schemas/tables/{identity → controlPlane}/project.js +3 -3
  168. package/dist/schemas/tables/controlPlane/project.js.map +1 -0
  169. package/dist/schemas/tables/{identity → controlPlane}/user.d.ts +1 -1
  170. package/dist/schemas/tables/{identity → controlPlane}/user.js +3 -3
  171. package/dist/schemas/tables/controlPlane/user.js.map +1 -0
  172. package/dist/schemas/tables/kernel/config.d.ts +1 -1
  173. package/dist/schemas/tables/kernel/config.js.map +1 -1
  174. package/dist/schemas/tables/kernel/coordination.d.ts +1 -1
  175. package/dist/schemas/tables/kernel/coordination.js.map +1 -1
  176. package/dist/schemas/tables/kernel/decision.d.ts +1 -1
  177. package/dist/schemas/tables/kernel/decision.js.map +1 -1
  178. package/dist/schemas/tables/kernel/embedding.d.ts +1 -1
  179. package/dist/schemas/tables/kernel/embedding.js.map +1 -1
  180. package/dist/schemas/tables/kernel/epistemic.d.ts +1 -1
  181. package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
  182. package/dist/schemas/tables/kernel/events.d.ts +21 -0
  183. package/dist/schemas/tables/kernel/events.js +43 -0
  184. package/dist/schemas/tables/kernel/events.js.map +1 -0
  185. package/dist/schemas/tables/kernel/idempotency.d.ts +1 -1
  186. package/dist/schemas/tables/kernel/idempotency.js.map +1 -1
  187. package/dist/schemas/tables/kernel/infra.d.ts +1 -1
  188. package/dist/schemas/tables/kernel/infra.js.map +1 -1
  189. package/dist/schemas/tables/kernel/intelligence.d.ts +1 -1
  190. package/dist/schemas/tables/kernel/intelligence.js.map +1 -1
  191. package/dist/schemas/tables/kernel/lens.d.ts +1 -1
  192. package/dist/schemas/tables/kernel/lens.js.map +1 -1
  193. package/dist/schemas/tables/kernel/ontology.d.ts +1 -1
  194. package/dist/schemas/tables/kernel/ontology.js.map +1 -1
  195. package/dist/schemas/tables/kernel/platform.d.ts +1 -1
  196. package/dist/schemas/tables/kernel/platform.js.map +1 -1
  197. package/dist/schemas/tables/kernel/spine.d.ts +2 -1
  198. package/dist/schemas/tables/kernel/spine.js +1 -0
  199. package/dist/schemas/tables/kernel/spine.js.map +1 -1
  200. package/dist/schemas/tables/kernel/task.d.ts +1 -1
  201. package/dist/schemas/tables/kernel/task.js.map +1 -1
  202. package/dist/schemas/tables/kernel/topic.d.ts +1 -1
  203. package/dist/schemas/tables/kernel/topic.js +1 -0
  204. package/dist/schemas/tables/kernel/topic.js.map +1 -1
  205. package/dist/schemas/tables/kernel/workflow.d.ts +1 -1
  206. package/dist/schemas/tables/kernel/workflow.js.map +1 -1
  207. package/dist/schemas/tables/kernel/worktree.d.ts +17 -17
  208. package/dist/schemas/tables/kernel/worktree.js.map +1 -1
  209. package/dist/schemas/tables/mc/identity.d.ts +19 -2
  210. package/dist/schemas/tables/mc/identity.js +32 -1
  211. package/dist/schemas/tables/mc/identity.js.map +1 -1
  212. package/dist/schemas/tables/mc/methodology.d.ts +1 -1
  213. package/dist/schemas/tables/mc/methodology.js.map +1 -1
  214. package/dist/schemas/tables/mc/pack.d.ts +1 -1
  215. package/dist/schemas/tables/mc/pack.js.map +1 -1
  216. package/dist/schemas/tables/mc/policy.d.ts +2 -2
  217. package/dist/schemas/tables/mc/policy.js +1 -1
  218. package/dist/schemas/tables/mc/policy.js.map +1 -1
  219. package/dist/schemas/tables/mc/registry.d.ts +1 -1
  220. package/dist/schemas/tables/mc/registry.js.map +1 -1
  221. package/dist/schemas/tables/mc/runtime.d.ts +109 -3
  222. package/dist/schemas/tables/mc/runtime.js +330 -104
  223. package/dist/schemas/tables/mc/runtime.js.map +1 -1
  224. package/dist/schemas/tables/mc/tenant.d.ts +4 -2
  225. package/dist/schemas/tables/mc/tenant.js +3 -1
  226. package/dist/schemas/tables/mc/tenant.js.map +1 -1
  227. package/dist/schemas/tables/mc/workspace.d.ts +22 -5
  228. package/dist/schemas/tables/mc/workspace.js +34 -2
  229. package/dist/schemas/tables/mc/workspace.js.map +1 -1
  230. package/dist/{sdk-tools.contract-Ci8bkoai.d.ts → sdk-tools.contract-CKmSsrZ2.d.ts} +1 -1
  231. package/dist/sdk-tools.contract.d.ts +2 -2
  232. package/dist/sdk-tools.contract.js +417 -13
  233. package/dist/sdk-tools.contract.js.map +1 -1
  234. package/dist/tenant-bootstrap-seed.contract.d.ts +244 -56
  235. package/dist/tenant-bootstrap-seed.contract.js +139 -28
  236. package/dist/tenant-bootstrap-seed.contract.js.map +1 -1
  237. package/dist/tenant-bootstrap-seed.defaults.d.ts +2 -2
  238. package/dist/tenant-bootstrap-seed.defaults.js +31 -13
  239. package/dist/tenant-bootstrap-seed.defaults.js.map +1 -1
  240. package/dist/tenant-client.contract.d.ts +20 -15
  241. package/dist/tenant-client.contract.js +29 -12
  242. package/dist/tenant-client.contract.js.map +1 -1
  243. package/dist/{tool-contracts-B4iWhejG.d.ts → tool-contracts-C_xvM9q2.d.ts} +32 -2
  244. package/dist/tool-contracts.d.ts +1 -1
  245. package/dist/tool-contracts.js +418 -14
  246. package/dist/tool-contracts.js.map +1 -1
  247. package/package.json +22 -1
  248. package/dist/schemas/tables/identity/agent.js.map +0 -1
  249. package/dist/schemas/tables/identity/epistemic.js.map +0 -1
  250. package/dist/schemas/tables/identity/model.js.map +0 -1
  251. package/dist/schemas/tables/identity/platform.js.map +0 -1
  252. package/dist/schemas/tables/identity/project.js.map +0 -1
  253. package/dist/schemas/tables/identity/user.js.map +0 -1
@@ -1,3 +1,17 @@
1
+ // src/types/reasoning-method.ts
2
+ var REASONING_METHODS = [
3
+ "deductive",
4
+ "inductive",
5
+ "abductive",
6
+ "analogical",
7
+ "causal",
8
+ "correlational",
9
+ "testimonial",
10
+ "statistical",
11
+ "implicit",
12
+ "pattern_match"
13
+ ];
14
+
1
15
  // src/lens-workflow.contract.ts
2
16
  var LENS_PERSPECTIVE_TYPES = [
3
17
  "investigation",
@@ -829,19 +843,23 @@ var FIND_CONTRADICTIONS = {
829
843
  };
830
844
  var CREATE_EDGE = {
831
845
  name: "create_edge",
832
- 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).",
846
+ 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.",
833
847
  parameters: {
834
- sourceId: {
835
- type: "string",
836
- description: "Source node of the relationship"
848
+ from: {
849
+ type: "object",
850
+ description: "Source graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'topic' }"
837
851
  },
838
- targetId: {
839
- type: "string",
840
- description: "Target node of the relationship"
852
+ to: {
853
+ type: "object",
854
+ description: "Target graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'belief' }"
841
855
  },
842
856
  edgeType: {
843
857
  type: "string",
844
- description: "Relationship type (informs, tests, depends_on, supersedes, etc.)"
858
+ description: "Relationship type from the public epistemic edge enum."
859
+ },
860
+ globalId: {
861
+ type: "string",
862
+ description: "Optional idempotent edge global ID."
845
863
  },
846
864
  weight: {
847
865
  type: "number",
@@ -851,10 +869,14 @@ var CREATE_EDGE = {
851
869
  reasoningMethod: {
852
870
  type: "string",
853
871
  description: "How this was determined",
854
- enum: ["deductive", "inductive", "abductive", "analogical", "empirical"]
872
+ enum: [...REASONING_METHODS]
873
+ },
874
+ metadata: {
875
+ type: "object",
876
+ description: "Optional edge metadata."
855
877
  }
856
878
  },
857
- required: ["sourceId", "targetId", "edgeType"],
879
+ required: ["from", "to", "edgeType"],
858
880
  response: {
859
881
  description: "The created edge",
860
882
  fields: {
@@ -868,6 +890,240 @@ var CREATE_EDGE = {
868
890
  ontologyPrimitive: "edge",
869
891
  tier: "showcase"
870
892
  };
893
+ var UPDATE_EDGE = {
894
+ name: "update_edge",
895
+ description: "Amend metadata on an existing graph edge. Like `git commit --amend` \u2014 changes the edge annotation without recreating the relationship.",
896
+ parameters: {
897
+ edgeId: { type: "string", description: "Edge ID or global ID to update" },
898
+ weight: { type: "number", description: "Updated edge weight" },
899
+ confidence: { type: "number", description: "Updated confidence" },
900
+ context: { type: "string", description: "Updated human-readable context" },
901
+ derivationType: { type: "string", description: "Updated derivation type" },
902
+ metadata: { type: "object", description: "Updated metadata" }
903
+ },
904
+ required: ["edgeId"],
905
+ response: {
906
+ description: "Edge update result",
907
+ fields: { success: "boolean" }
908
+ },
909
+ ownerModule: "graph-primitives",
910
+ ontologyPrimitive: "edge",
911
+ tier: "workhorse"
912
+ };
913
+ var REMOVE_EDGE = {
914
+ name: "remove_edge",
915
+ description: "Remove one graph edge by ID. Like `git rm` \u2014 deletes a single explicit relationship from the spine.",
916
+ parameters: {
917
+ edgeId: { type: "string", description: "Edge ID or global ID to remove" }
918
+ },
919
+ required: ["edgeId"],
920
+ response: {
921
+ description: "Edge removal result",
922
+ fields: { success: "boolean" }
923
+ },
924
+ ownerModule: "graph-primitives",
925
+ ontologyPrimitive: "edge",
926
+ tier: "workhorse"
927
+ };
928
+ var REMOVE_EDGES_BETWEEN = {
929
+ name: "remove_edges_between",
930
+ description: "Remove graph edges between two nodes. Like `git rm <pathspec>` \u2014 deletes relationships matching a source, target, and optional type.",
931
+ parameters: {
932
+ fromNodeId: { type: "string", description: "Source node ID or global ID" },
933
+ toNodeId: { type: "string", description: "Target node ID or global ID" },
934
+ edgeType: { type: "string", description: "Optional edge type filter" }
935
+ },
936
+ required: ["fromNodeId", "toNodeId"],
937
+ response: {
938
+ description: "Matched edge removal result",
939
+ fields: { deleted: "number" }
940
+ },
941
+ ownerModule: "graph-primitives",
942
+ ontologyPrimitive: "edge",
943
+ tier: "workhorse"
944
+ };
945
+ var BATCH_CREATE_EDGES = {
946
+ name: "batch_create_edges",
947
+ description: "Commit multiple typed graph edges. Like `git commit` with many staged paths \u2014 writes a batch of explicit relationships atomically per edge.",
948
+ parameters: {
949
+ edges: {
950
+ type: "array",
951
+ description: "Edges to create, each with from, to, edgeType, and optional weight/confidence/context."
952
+ },
953
+ skipLayerValidation: {
954
+ type: "boolean",
955
+ description: "Skip kernel layer validation for trusted materialization flows."
956
+ }
957
+ },
958
+ required: ["edges"],
959
+ response: {
960
+ description: "Batch edge creation result",
961
+ fields: {
962
+ created: "number",
963
+ results: "array",
964
+ errors: "array"
965
+ }
966
+ },
967
+ ownerModule: "graph-primitives",
968
+ ontologyPrimitive: "edge",
969
+ tier: "workhorse"
970
+ };
971
+ var CREATE_EPISTEMIC_NODE = {
972
+ name: "create_epistemic_node",
973
+ 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.",
974
+ parameters: {
975
+ globalId: { type: "string", description: "Optional idempotent node global ID" },
976
+ nodeType: { type: "string", description: "Public epistemic node type" },
977
+ canonicalText: { type: "string", description: "Canonical node text" },
978
+ text: { type: "string", description: "Alias for canonicalText" },
979
+ contentHash: { type: "string", description: "Optional idempotency content hash" },
980
+ sourceType: { type: "string", description: "Source type for provenance" },
981
+ topicId: { type: "string", description: "Optional topic scope" },
982
+ content: { type: "string", description: "Extended content" },
983
+ title: { type: "string", description: "Display title" },
984
+ metadata: { type: "object", description: "Optional node metadata" }
985
+ },
986
+ required: ["nodeType"],
987
+ response: {
988
+ description: "Created node result",
989
+ fields: {
990
+ nodeId: "string",
991
+ nodeGlobalId: "string",
992
+ isDuplicate: "boolean"
993
+ }
994
+ },
995
+ ownerModule: "reasoning-kernel",
996
+ ontologyPrimitive: "graph",
997
+ tier: "showcase"
998
+ };
999
+ var GET_EPISTEMIC_NODE = {
1000
+ name: "get_epistemic_node",
1001
+ description: "Read one epistemic graph node. Like `git show` \u2014 resolves a canonical spine node by ID or global ID.",
1002
+ parameters: {
1003
+ nodeId: { type: "string", description: "Node ID or global ID" }
1004
+ },
1005
+ required: ["nodeId"],
1006
+ response: {
1007
+ description: "The resolved node",
1008
+ fields: { node: "object" }
1009
+ },
1010
+ ownerModule: "reasoning-kernel",
1011
+ ontologyPrimitive: "graph",
1012
+ tier: "workhorse"
1013
+ };
1014
+ var LIST_EPISTEMIC_NODES = {
1015
+ name: "list_epistemic_nodes",
1016
+ description: "List epistemic graph nodes. Like `git ls-tree` \u2014 lists canonical spine nodes by topic, type, status, or search query.",
1017
+ parameters: {
1018
+ topicId: { type: "string", description: "Optional topic scope" },
1019
+ nodeType: { type: "string", description: "Optional node type filter" },
1020
+ status: { type: "string", description: "Optional lifecycle status" },
1021
+ searchQuery: { type: "string", description: "Optional text search query" },
1022
+ limit: { type: "number", description: "Maximum nodes to return" }
1023
+ },
1024
+ required: [],
1025
+ response: {
1026
+ description: "Matching nodes",
1027
+ fields: { nodes: "array" }
1028
+ },
1029
+ ownerModule: "reasoning-kernel",
1030
+ ontologyPrimitive: "graph",
1031
+ tier: "workhorse"
1032
+ };
1033
+ var UPDATE_EPISTEMIC_NODE = {
1034
+ name: "update_epistemic_node",
1035
+ description: "Amend an epistemic graph node. Like `git commit --amend` \u2014 updates mutable node metadata, text, status, or verification fields.",
1036
+ parameters: {
1037
+ nodeId: { type: "string", description: "Node ID or global ID" },
1038
+ canonicalText: { type: "string", description: "Updated canonical text" },
1039
+ text: { type: "string", description: "Alias for canonicalText" },
1040
+ contentHash: { type: "string", description: "Updated content hash" },
1041
+ content: { type: "string", description: "Updated content" },
1042
+ title: { type: "string", description: "Updated display title" },
1043
+ metadata: { type: "object", description: "Updated metadata" },
1044
+ confidence: { type: "number", description: "Updated confidence" },
1045
+ verificationStatus: { type: "string", description: "Updated verification status" },
1046
+ status: { type: "string", description: "Updated lifecycle status" }
1047
+ },
1048
+ required: ["nodeId"],
1049
+ response: {
1050
+ description: "Node update result",
1051
+ fields: { success: "boolean" }
1052
+ },
1053
+ ownerModule: "reasoning-kernel",
1054
+ ontologyPrimitive: "graph",
1055
+ tier: "workhorse"
1056
+ };
1057
+ var ARCHIVE_EPISTEMIC_NODE = {
1058
+ name: "archive_epistemic_node",
1059
+ description: "Archive an epistemic graph node. Like `git rm --cached` \u2014 removes a node from active traversal without hard-deleting it.",
1060
+ parameters: {
1061
+ nodeId: { type: "string", description: "Node ID or global ID" }
1062
+ },
1063
+ required: ["nodeId"],
1064
+ response: {
1065
+ description: "Archive result",
1066
+ fields: { success: "boolean", effectiveStatus: "string" }
1067
+ },
1068
+ ownerModule: "reasoning-kernel",
1069
+ ontologyPrimitive: "graph",
1070
+ tier: "workhorse"
1071
+ };
1072
+ var VERIFY_EPISTEMIC_NODE = {
1073
+ name: "verify_epistemic_node",
1074
+ description: "Record verification state on an epistemic graph node. Like `git tag` \u2014 marks the node with a reviewed verification state.",
1075
+ parameters: {
1076
+ nodeId: { type: "string", description: "Node ID or global ID" },
1077
+ verificationStatus: { type: "string", description: "Verification status" },
1078
+ confidence: { type: "number", description: "Optional confidence update" }
1079
+ },
1080
+ required: ["nodeId", "verificationStatus"],
1081
+ response: {
1082
+ description: "Verification result",
1083
+ fields: { success: "boolean" }
1084
+ },
1085
+ ownerModule: "reasoning-kernel",
1086
+ ontologyPrimitive: "graph",
1087
+ tier: "workhorse"
1088
+ };
1089
+ var SUPERSEDE_EPISTEMIC_NODE = {
1090
+ name: "supersede_epistemic_node",
1091
+ 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.",
1092
+ parameters: {
1093
+ oldNodeId: { type: "string", description: "Node ID or global ID to supersede" },
1094
+ newGlobalId: { type: "string", description: "Optional replacement global ID" },
1095
+ newCanonicalText: { type: "string", description: "Replacement canonical text" },
1096
+ text: { type: "string", description: "Alias for newCanonicalText" },
1097
+ newContentHash: { type: "string", description: "Optional replacement content hash" },
1098
+ reason: { type: "string", description: "Reason for superseding" }
1099
+ },
1100
+ required: ["oldNodeId"],
1101
+ response: {
1102
+ description: "Supersede result",
1103
+ fields: { oldNodeId: "string", newNodeId: "string" }
1104
+ },
1105
+ ownerModule: "reasoning-kernel",
1106
+ ontologyPrimitive: "graph",
1107
+ tier: "workhorse"
1108
+ };
1109
+ var BATCH_CREATE_EPISTEMIC_NODES = {
1110
+ name: "batch_create_epistemic_nodes",
1111
+ description: "Commit multiple epistemic graph nodes. Like `git commit` with many staged files \u2014 writes a batch of canonical spine nodes.",
1112
+ parameters: {
1113
+ nodes: {
1114
+ type: "array",
1115
+ description: "Nodes to create with nodeType, canonicalText/text, and optional metadata."
1116
+ }
1117
+ },
1118
+ required: ["nodes"],
1119
+ response: {
1120
+ description: "Batch node creation result",
1121
+ fields: { created: "number", results: "array" }
1122
+ },
1123
+ ownerModule: "reasoning-kernel",
1124
+ ontologyPrimitive: "graph",
1125
+ tier: "workhorse"
1126
+ };
871
1127
  var RECORD_JUDGMENT = {
872
1128
  name: "record_judgment",
873
1129
  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).",
@@ -2067,8 +2323,8 @@ var IDENTITY_WHOAMI = {
2067
2323
  response: {
2068
2324
  description: "Canonical identity summary for the current session",
2069
2325
  fields: {
2070
- principalId: "string \u2014 canonical federated principal identifier",
2071
- principalType: "string \u2014 human, service, or agent",
2326
+ principalId: "string \u2014 canonical principal identifier; for humans this is the Clerk user_... ID",
2327
+ principalType: "string \u2014 human, service, agent, group, or external_viewer",
2072
2328
  tenantId: "string | undefined \u2014 resolved tenant scope",
2073
2329
  workspaceId: "string | undefined \u2014 resolved workspace scope",
2074
2330
  scopes: "string[] | undefined \u2014 granted scopes for this session",
@@ -2079,6 +2335,49 @@ var IDENTITY_WHOAMI = {
2079
2335
  ontologyPrimitive: "identity",
2080
2336
  tier: "workhorse"
2081
2337
  };
2338
+ var RESOLVE_INTERACTIVE_PRINCIPAL = {
2339
+ name: "resolve_interactive_principal",
2340
+ 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 Clerk subject into tenant/workspace authorization context.",
2341
+ parameters: {
2342
+ clerkId: {
2343
+ type: "string",
2344
+ description: "Authenticated Clerk subject (`sub`). Clerk proves identity only; it is not the authorization record."
2345
+ },
2346
+ tenantId: {
2347
+ type: "string",
2348
+ description: "Optional tenant scope. Omit only when the Clerk alias is globally unambiguous."
2349
+ },
2350
+ workspaceId: {
2351
+ type: "string",
2352
+ description: "Optional workspace scope. Required when the principal has access to multiple workspaces and no default can be inferred."
2353
+ },
2354
+ providerProjectId: {
2355
+ type: "string",
2356
+ description: "Optional Clerk project or provider instance id for tenants with multiple identity providers."
2357
+ }
2358
+ },
2359
+ required: ["clerkId"],
2360
+ response: {
2361
+ description: "Permit-backed Lucern principal context for tenant SDK bootstrap",
2362
+ fields: {
2363
+ principalId: "string \u2014 canonical Clerk user_... ID for human sessions",
2364
+ principalType: "string \u2014 human, service, agent, group, or external_viewer",
2365
+ clerkId: "string \u2014 authenticated Clerk subject alias",
2366
+ tenantId: "string \u2014 resolved tenant scope",
2367
+ workspaceId: "string | null \u2014 resolved workspace scope",
2368
+ roles: "string[] \u2014 effective Permit roles",
2369
+ scopes: "string[] \u2014 effective scopes derived from Permit/control-plane projection",
2370
+ groupIds: "string[] \u2014 active Permit group memberships",
2371
+ principalStatus: "string \u2014 active, invited, suspended, disabled, revoked, or missing",
2372
+ tenantStatus: "string \u2014 projected tenant resource status",
2373
+ workspaceStatus: "string \u2014 projected workspace resource status",
2374
+ permit: "object \u2014 Permit subject, tenant, and optional workspace tuple"
2375
+ }
2376
+ },
2377
+ ownerModule: "control-plane",
2378
+ ontologyPrimitive: "identity",
2379
+ tier: "workhorse"
2380
+ };
2082
2381
  var COMPILE_CONTEXT = {
2083
2382
  name: "compile_context",
2084
2383
  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.",
@@ -2340,6 +2639,10 @@ var CREATE_TASK = {
2340
2639
  tags: {
2341
2640
  type: "array",
2342
2641
  description: "Free-form string tags"
2642
+ },
2643
+ metadata: {
2644
+ type: "object",
2645
+ description: "Structured task metadata for handoff context and routing hints"
2343
2646
  }
2344
2647
  },
2345
2648
  required: ["title"],
@@ -2413,6 +2716,10 @@ var UPDATE_TASK = {
2413
2716
  type: "string",
2414
2717
  description: "Updated status",
2415
2718
  enum: ["todo", "in_progress", "blocked", "done"]
2719
+ },
2720
+ metadata: {
2721
+ type: "object",
2722
+ description: "Structured task metadata to replace or refine"
2416
2723
  }
2417
2724
  },
2418
2725
  required: ["taskId"],
@@ -2460,6 +2767,10 @@ var CREATE_TOPIC = {
2460
2767
  name: "create_topic",
2461
2768
  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.",
2462
2769
  parameters: {
2770
+ globalId: {
2771
+ type: "string",
2772
+ description: "Optional idempotent topic global ID"
2773
+ },
2463
2774
  name: { type: "string", description: "Topic name" },
2464
2775
  type: {
2465
2776
  type: "string",
@@ -2470,6 +2781,18 @@ var CREATE_TOPIC = {
2470
2781
  type: "string",
2471
2782
  description: "Optional parent topic for nesting"
2472
2783
  },
2784
+ parentTopicGlobalId: {
2785
+ type: "string",
2786
+ description: "Optional parent topic global ID for nesting"
2787
+ },
2788
+ tenantId: { type: "string", description: "Optional tenant scope" },
2789
+ workspaceId: { type: "string", description: "Optional workspace scope" },
2790
+ visibility: {
2791
+ type: "string",
2792
+ description: "Topic visibility",
2793
+ enum: ["private", "team", "firm", "external", "public"]
2794
+ },
2795
+ metadata: { type: "object", description: "Optional topic metadata" },
2473
2796
  createdBy: { type: "string", description: "Who created this topic" }
2474
2797
  },
2475
2798
  required: ["name", "type"],
@@ -2478,6 +2801,9 @@ var CREATE_TOPIC = {
2478
2801
  fields: {
2479
2802
  id: "string \u2014 topic ID",
2480
2803
  globalId: "string \u2014 globally unique ID",
2804
+ topicGlobalId: "string \u2014 topic global ID",
2805
+ epistemicNodeId: "string \u2014 materialized topic node ID",
2806
+ epistemicNodeGlobalId: "string \u2014 materialized topic node global ID",
2481
2807
  depth: "number \u2014 nesting depth"
2482
2808
  }
2483
2809
  },
@@ -2608,6 +2934,65 @@ var GET_TOPIC_TREE = {
2608
2934
  ontologyPrimitive: "graph",
2609
2935
  tier: "workhorse"
2610
2936
  };
2937
+ var MATERIALIZE_TOPIC_GRAPH = {
2938
+ name: "materialize_topic_graph",
2939
+ description: "Backfill the topic graph spine. Like `git fsck --connectivity-only` with repair enabled \u2014 creates missing topic nodes and parent-child edges idempotently.",
2940
+ parameters: {
2941
+ rootTopicId: {
2942
+ type: "string",
2943
+ description: "Optional root topic for a bounded materialization pass"
2944
+ },
2945
+ dryRun: {
2946
+ type: "boolean",
2947
+ description: "When true, report missing rows without writing them"
2948
+ }
2949
+ },
2950
+ required: [],
2951
+ response: {
2952
+ description: "Topic graph materialization counts",
2953
+ fields: {
2954
+ topicsSeen: "number",
2955
+ nodesCreated: "number",
2956
+ nodesExisting: "number",
2957
+ edgesCreated: "number",
2958
+ edgesExisting: "number",
2959
+ errors: "array"
2960
+ }
2961
+ },
2962
+ ownerModule: "reasoning-kernel",
2963
+ ontologyPrimitive: "graph",
2964
+ tier: "workhorse"
2965
+ };
2966
+ var GET_TOPIC_GRAPH_SPINE = {
2967
+ name: "get_topic_graph_spine",
2968
+ description: "Verify the topic graph spine. Like `git fsck` \u2014 reads topics, materialized topic nodes, parent-child edges, and missing spine rows.",
2969
+ parameters: {
2970
+ rootTopicId: {
2971
+ type: "string",
2972
+ description: "Optional root topic for a bounded verifier pass"
2973
+ },
2974
+ includeTopicBeliefEdges: {
2975
+ type: "boolean",
2976
+ description: "Include topic -> belief edges in the verifier payload"
2977
+ }
2978
+ },
2979
+ required: [],
2980
+ response: {
2981
+ description: "Topic graph spine verification payload",
2982
+ fields: {
2983
+ ok: "boolean",
2984
+ counts: "object",
2985
+ topics: "array",
2986
+ topicNodes: "array",
2987
+ parentEdges: "array",
2988
+ missingTopicNodes: "array",
2989
+ missingParentEdges: "array"
2990
+ }
2991
+ },
2992
+ ownerModule: "reasoning-kernel",
2993
+ ontologyPrimitive: "graph",
2994
+ tier: "workhorse"
2995
+ };
2611
2996
  var GET_CODE_CONTEXT = {
2612
2997
  name: "get_code_context",
2613
2998
  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.",
@@ -2803,7 +3188,7 @@ var MANAGE_WRITE_POLICY = {
2803
3188
  },
2804
3189
  role: {
2805
3190
  type: "string",
2806
- description: "Role to set policy for (required for 'set'). E.g. 'agent:internal', 'user:analyst'."
3191
+ description: "Role to set policy for (required for 'set'). E.g. 'agent:internal' or a Permit role key such as 'workspace_admin'."
2807
3192
  },
2808
3193
  permission: {
2809
3194
  type: "string",
@@ -3790,6 +4175,9 @@ var BEGIN_BUILD_SESSION = {
3790
4175
  sessionMode: "string \u2014 async | interactive",
3791
4176
  targetBeliefIds: "array \u2014 scoped belief IDs",
3792
4177
  targetQuestionIds: "array \u2014 scoped question IDs",
4178
+ taskIds: "array \u2014 assigned task IDs for this worktree",
4179
+ incompleteTaskIds: "array \u2014 assigned task IDs that still require done/deferred/blocked proof",
4180
+ tasks: "array \u2014 assigned task packet with id, title, status, priority, links, and summaries",
3793
4181
  topBeliefs: "array \u2014 highest-confidence scoped beliefs",
3794
4182
  openQuestions: "array \u2014 open scoped questions",
3795
4183
  resolvedDecisions: "array \u2014 answered questions summarized for the session",
@@ -3845,6 +4233,19 @@ var MCP_TOOL_CONTRACTS = {
3845
4233
  bisect_confidence: BISECT_CONFIDENCE,
3846
4234
  // Edges (commit)
3847
4235
  create_edge: CREATE_EDGE,
4236
+ update_edge: UPDATE_EDGE,
4237
+ remove_edge: REMOVE_EDGE,
4238
+ remove_edges_between: REMOVE_EDGES_BETWEEN,
4239
+ batch_create_edges: BATCH_CREATE_EDGES,
4240
+ // Epistemic node spine (commit/amend/show)
4241
+ create_epistemic_node: CREATE_EPISTEMIC_NODE,
4242
+ get_epistemic_node: GET_EPISTEMIC_NODE,
4243
+ list_epistemic_nodes: LIST_EPISTEMIC_NODES,
4244
+ update_epistemic_node: UPDATE_EPISTEMIC_NODE,
4245
+ archive_epistemic_node: ARCHIVE_EPISTEMIC_NODE,
4246
+ verify_epistemic_node: VERIFY_EPISTEMIC_NODE,
4247
+ supersede_epistemic_node: SUPERSEDE_EPISTEMIC_NODE,
4248
+ batch_create_epistemic_nodes: BATCH_CREATE_EPISTEMIC_NODES,
3848
4249
  // Judgments (tag)
3849
4250
  record_judgment: RECORD_JUDGMENT,
3850
4251
  // Graph intelligence (showcase)
@@ -3879,6 +4280,7 @@ var MCP_TOOL_CONTRACTS = {
3879
4280
  update_worktree_targets: UPDATE_WORKTREE_TARGETS,
3880
4281
  update_worktree_metadata: UPDATE_WORKTREE_METADATA,
3881
4282
  identity_whoami: IDENTITY_WHOAMI,
4283
+ resolve_interactive_principal: RESOLVE_INTERACTIVE_PRINCIPAL,
3882
4284
  compile_context: COMPILE_CONTEXT,
3883
4285
  record_scope_learning: RECORD_SCOPE_LEARNING,
3884
4286
  pipeline_snapshot: PIPELINE_SNAPSHOT,
@@ -3918,6 +4320,8 @@ var MCP_TOOL_CONTRACTS = {
3918
4320
  get_topic: GET_TOPIC,
3919
4321
  update_topic: UPDATE_TOPIC,
3920
4322
  get_topic_tree: GET_TOPIC_TREE,
4323
+ materialize_topic_graph: MATERIALIZE_TOPIC_GRAPH,
4324
+ get_topic_graph_spine: GET_TOPIC_GRAPH_SPINE,
3921
4325
  // Coding intelligence (code-grounded knowledge)
3922
4326
  get_code_context: GET_CODE_CONTEXT,
3923
4327
  get_change_history: GET_CHANGE_HISTORY,