@lucern/contracts 1.0.12 → 1.0.13

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 (81) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/function-registry/beliefs.js +48 -11
  3. package/dist/function-registry/beliefs.js.map +1 -1
  4. package/dist/function-registry/coding.js +46 -9
  5. package/dist/function-registry/coding.js.map +1 -1
  6. package/dist/function-registry/context.js +46 -9
  7. package/dist/function-registry/context.js.map +1 -1
  8. package/dist/function-registry/contracts.js +46 -9
  9. package/dist/function-registry/contracts.js.map +1 -1
  10. package/dist/function-registry/coordination.js +46 -9
  11. package/dist/function-registry/coordination.js.map +1 -1
  12. package/dist/function-registry/edges.js +46 -9
  13. package/dist/function-registry/edges.js.map +1 -1
  14. package/dist/function-registry/evidence.js +166 -17
  15. package/dist/function-registry/evidence.js.map +1 -1
  16. package/dist/function-registry/graph.js +46 -9
  17. package/dist/function-registry/graph.js.map +1 -1
  18. package/dist/function-registry/helpers.js +46 -9
  19. package/dist/function-registry/helpers.js.map +1 -1
  20. package/dist/function-registry/identity.js +46 -9
  21. package/dist/function-registry/identity.js.map +1 -1
  22. package/dist/function-registry/index.js +46 -9
  23. package/dist/function-registry/index.js.map +1 -1
  24. package/dist/function-registry/judgments.js +46 -9
  25. package/dist/function-registry/judgments.js.map +1 -1
  26. package/dist/function-registry/legacy.js +46 -9
  27. package/dist/function-registry/legacy.js.map +1 -1
  28. package/dist/function-registry/lenses.js +46 -9
  29. package/dist/function-registry/lenses.js.map +1 -1
  30. package/dist/function-registry/manifest.d.ts +10 -4
  31. package/dist/function-registry/manifest.js +13 -1
  32. package/dist/function-registry/manifest.js.map +1 -1
  33. package/dist/function-registry/nodes.js +46 -9
  34. package/dist/function-registry/nodes.js.map +1 -1
  35. package/dist/function-registry/ontologies.js +46 -9
  36. package/dist/function-registry/ontologies.js.map +1 -1
  37. package/dist/function-registry/pipeline.js +46 -9
  38. package/dist/function-registry/pipeline.js.map +1 -1
  39. package/dist/function-registry/questions.js +46 -9
  40. package/dist/function-registry/questions.js.map +1 -1
  41. package/dist/function-registry/tasks.js +46 -9
  42. package/dist/function-registry/tasks.js.map +1 -1
  43. package/dist/function-registry/topics.js +46 -9
  44. package/dist/function-registry/topics.js.map +1 -1
  45. package/dist/function-registry/worktrees.js +46 -9
  46. package/dist/function-registry/worktrees.js.map +1 -1
  47. package/dist/index.js +111 -11
  48. package/dist/index.js.map +1 -1
  49. package/dist/manifests/invariants/index.js +24 -5
  50. package/dist/manifests/invariants/index.js.map +1 -1
  51. package/dist/manifests/invariants/inv-1-beliefs-append-only.js +24 -5
  52. package/dist/manifests/invariants/inv-1-beliefs-append-only.js.map +1 -1
  53. package/dist/projections/check-convex-args-shape.js +78 -3
  54. package/dist/projections/check-convex-args-shape.js.map +1 -1
  55. package/dist/projections/create-evidence.projection.d.ts +168 -0
  56. package/dist/projections/create-evidence.projection.js +78 -3
  57. package/dist/projections/create-evidence.projection.js.map +1 -1
  58. package/dist/projections/index.d.ts +28 -0
  59. package/dist/projections/index.js +78 -3
  60. package/dist/projections/index.js.map +1 -1
  61. package/dist/proof-attestation.json +1 -1
  62. package/dist/sdk-methods.contract.d.ts +3 -2
  63. package/dist/sdk-tools.contract.js +33 -8
  64. package/dist/sdk-tools.contract.js.map +1 -1
  65. package/dist/sdk-tools.contract.registry.js +33 -8
  66. package/dist/sdk-tools.contract.registry.js.map +1 -1
  67. package/dist/sdk-tools.contract.values.js +33 -8
  68. package/dist/sdk-tools.contract.values.js.map +1 -1
  69. package/dist/tool-contracts.context-orientation.js +2 -1
  70. package/dist/tool-contracts.context-orientation.js.map +1 -1
  71. package/dist/tool-contracts.intelligence-evidence.js +26 -4
  72. package/dist/tool-contracts.intelligence-evidence.js.map +1 -1
  73. package/dist/tool-contracts.js +33 -8
  74. package/dist/tool-contracts.js.map +1 -1
  75. package/dist/tool-contracts.lifecycle.js +2 -2
  76. package/dist/tool-contracts.lifecycle.js.map +1 -1
  77. package/dist/tool-contracts.questions-listing.js +3 -1
  78. package/dist/tool-contracts.questions-listing.js.map +1 -1
  79. package/dist/tool-contracts.values.js +33 -8
  80. package/dist/tool-contracts.values.js.map +1 -1
  81. package/package.json +1 -1
@@ -39,10 +39,11 @@ var LUCERN_ORIENT = {
39
39
  workflow: "array - recommended branch -> investigate -> prove gate -> merge workflow",
40
40
  grammarMap: "array - primitive-to-git-analogy map for topics, campaigns, worktrees, beliefs, questions, evidence, edges, contradictions, and gates",
41
41
  firstMoves: "array - recommended first tools for a cold-start agent",
42
- receiptRules: "array - how to interpret candidateCounts, broadening, coverageWarning, and noDefaultGlobalScan",
42
+ receiptRules: "array - how to interpret candidateCounts, broadening, coverageWarning, narrativeCoverage, synthesisLints, and noDefaultGlobalScan",
43
43
  safetyRules: "array - mutation and completion rules that preserve reasoning lineage",
44
44
  toolMap: "array | undefined - situation-to-tool routing map when requested",
45
45
  examples: "array | undefined - concrete tool-call examples when requested",
46
+ futureCapabilities: "array | undefined - exemplar, gauntlet, trace-corpus, and native-model-training capabilities when requested",
46
47
  suggestedNextCalls: "array - safe next tool calls for the current situation"
47
48
  }
48
49
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tool-contracts.context-orientation.ts"],"names":[],"mappings":";AAEO,IAAM,aAAA,GAAiC;AAAA,EAC5C,IAAA,EAAM,eAAA;AAAA,EACN,WAAA,EACE,gQAAA;AAAA,EAEF,UAAA,EAAY;AAAA,IACV,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa,gEAAA;AAAA,MACb,IAAA,EAAM,CAAC,OAAA,EAAS,OAAA,EAAS,YAAY,WAAW;AAAA,KAClD;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa,8CAAA;AAAA,MACb,IAAA,EAAM,CAAC,OAAA,EAAS,UAAA,EAAY,MAAM;AAAA,KACpC;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE;AAAA,KACJ;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,aAAA,EAAe;AAAA,MACb,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,UAAU,EAAC;AAAA,EACX,QAAA,EAAU;AAAA,IACR,WAAA,EACE,wEAAA;AAAA,IACF,MAAA,EAAQ;AAAA,MACN,aAAA,EAAe,gCAAA;AAAA,MACf,oBAAA,EACE,gEAAA;AAAA,MACF,QAAA,EACE,2EAAA;AAAA,MACF,UAAA,EACE,uIAAA;AAAA,MACF,UAAA,EAAY,wDAAA;AAAA,MACZ,YAAA,EACE,gGAAA;AAAA,MACF,WAAA,EACE,uEAAA;AAAA,MACF,OAAA,EACE,kEAAA;AAAA,MACF,QAAA,EAAU,gEAAA;AAAA,MACV,kBAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,OAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.context-orientation.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const LUCERN_ORIENT: McpToolContract = {\n name: \"lucern_orient\",\n description:\n \"Load the Lucern reasoning grammar before operating. \" +\n \"Like `git help` plus a repository CONTRIBUTING guide for reasoning state - teaches the git-shaped model of topics, campaigns, lanes, worktrees, beliefs, questions, evidence, receipts, gates, and merges.\",\n parameters: {\n audience: {\n type: \"string\",\n description: \"Audience for the primer: agent, human, operator, or developer.\",\n enum: [\"agent\", \"human\", \"operator\", \"developer\"],\n },\n depth: {\n type: \"string\",\n description: \"Orientation depth: quick, standard, or deep.\",\n enum: [\"quick\", \"standard\", \"deep\"],\n },\n situation: {\n type: \"string\",\n description:\n \"Optional task or query context used to tailor suggested next calls.\",\n },\n includeExamples: {\n type: \"boolean\",\n description: \"Whether to include concrete tool-call examples.\",\n },\n includeToolMap: {\n type: \"boolean\",\n description: \"Whether to include situation-to-tool routing guidance.\",\n },\n includeFuture: {\n type: \"boolean\",\n description:\n \"Whether to include future exemplar, gauntlet, and training-data capabilities.\",\n },\n },\n required: [],\n response: {\n description:\n \"Canonical operator primer for Lucern's git-shaped reasoning substrate.\",\n fields: {\n schemaVersion: \"string - lucern_orientation.v1\",\n canonicalMentalModel:\n \"object - concise model of Lucern as git-shaped reasoning state\",\n workflow:\n \"array - recommended branch -> investigate -> prove gate -> merge workflow\",\n grammarMap:\n \"array - primitive-to-git-analogy map for topics, campaigns, worktrees, beliefs, questions, evidence, edges, contradictions, and gates\",\n firstMoves: \"array - recommended first tools for a cold-start agent\",\n receiptRules:\n \"array - how to interpret candidateCounts, broadening, coverageWarning, and noDefaultGlobalScan\",\n safetyRules:\n \"array - mutation and completion rules that preserve reasoning lineage\",\n toolMap:\n \"array | undefined - situation-to-tool routing map when requested\",\n examples: \"array | undefined - concrete tool-call examples when requested\",\n suggestedNextCalls:\n \"array - safe next tool calls for the current situation\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n"]}
1
+ {"version":3,"sources":["../src/tool-contracts.context-orientation.ts"],"names":[],"mappings":";AAEO,IAAM,aAAA,GAAiC;AAAA,EAC5C,IAAA,EAAM,eAAA;AAAA,EACN,WAAA,EACE,gQAAA;AAAA,EAEF,UAAA,EAAY;AAAA,IACV,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa,gEAAA;AAAA,MACb,IAAA,EAAM,CAAC,OAAA,EAAS,OAAA,EAAS,YAAY,WAAW;AAAA,KAClD;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa,8CAAA;AAAA,MACb,IAAA,EAAM,CAAC,OAAA,EAAS,UAAA,EAAY,MAAM;AAAA,KACpC;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE;AAAA,KACJ;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,aAAA,EAAe;AAAA,MACb,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,UAAU,EAAC;AAAA,EACX,QAAA,EAAU;AAAA,IACR,WAAA,EACE,wEAAA;AAAA,IACF,MAAA,EAAQ;AAAA,MACN,aAAA,EAAe,gCAAA;AAAA,MACf,oBAAA,EACE,gEAAA;AAAA,MACF,QAAA,EACE,2EAAA;AAAA,MACF,UAAA,EACE,uIAAA;AAAA,MACF,UAAA,EAAY,wDAAA;AAAA,MACZ,YAAA,EACE,mIAAA;AAAA,MACF,WAAA,EACE,uEAAA;AAAA,MACF,OAAA,EACE,kEAAA;AAAA,MACF,QAAA,EAAU,gEAAA;AAAA,MACV,kBAAA,EACE,6GAAA;AAAA,MACF,kBAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,OAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.context-orientation.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const LUCERN_ORIENT: McpToolContract = {\n name: \"lucern_orient\",\n description:\n \"Load the Lucern reasoning grammar before operating. \" +\n \"Like `git help` plus a repository CONTRIBUTING guide for reasoning state - teaches the git-shaped model of topics, campaigns, lanes, worktrees, beliefs, questions, evidence, receipts, gates, and merges.\",\n parameters: {\n audience: {\n type: \"string\",\n description: \"Audience for the primer: agent, human, operator, or developer.\",\n enum: [\"agent\", \"human\", \"operator\", \"developer\"],\n },\n depth: {\n type: \"string\",\n description: \"Orientation depth: quick, standard, or deep.\",\n enum: [\"quick\", \"standard\", \"deep\"],\n },\n situation: {\n type: \"string\",\n description:\n \"Optional task or query context used to tailor suggested next calls.\",\n },\n includeExamples: {\n type: \"boolean\",\n description: \"Whether to include concrete tool-call examples.\",\n },\n includeToolMap: {\n type: \"boolean\",\n description: \"Whether to include situation-to-tool routing guidance.\",\n },\n includeFuture: {\n type: \"boolean\",\n description:\n \"Whether to include future exemplar, gauntlet, and training-data capabilities.\",\n },\n },\n required: [],\n response: {\n description:\n \"Canonical operator primer for Lucern's git-shaped reasoning substrate.\",\n fields: {\n schemaVersion: \"string - lucern_orientation.v1\",\n canonicalMentalModel:\n \"object - concise model of Lucern as git-shaped reasoning state\",\n workflow:\n \"array - recommended branch -> investigate -> prove gate -> merge workflow\",\n grammarMap:\n \"array - primitive-to-git-analogy map for topics, campaigns, worktrees, beliefs, questions, evidence, edges, contradictions, and gates\",\n firstMoves: \"array - recommended first tools for a cold-start agent\",\n receiptRules:\n \"array - how to interpret candidateCounts, broadening, coverageWarning, narrativeCoverage, synthesisLints, and noDefaultGlobalScan\",\n safetyRules:\n \"array - mutation and completion rules that preserve reasoning lineage\",\n toolMap:\n \"array | undefined - situation-to-tool routing map when requested\",\n examples: \"array | undefined - concrete tool-call examples when requested\",\n futureCapabilities:\n \"array | undefined - exemplar, gauntlet, trace-corpus, and native-model-training capabilities when requested\",\n suggestedNextCalls:\n \"array - safe next tool calls for the current situation\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n"]}
@@ -152,7 +152,7 @@ var SEARCH_EVIDENCE = {
152
152
  };
153
153
  var CREATE_EVIDENCE = {
154
154
  name: "create_evidence",
155
- description: "Commit evidence to the reasoning graph. Like `git commit` \u2014 creates a traceable evidence record with canonical public IDs. Optionally links the evidence to a belief or question in the same operation.",
155
+ description: "Commit evidence to the reasoning graph. Like `git commit` \u2014 creates a traceable evidence record with canonical public IDs. Optionally links the evidence to a belief or question in the same operation. When evidence bears on beliefs, state whether it supports or contradicts; SL confidence is derived from these evidence relations.",
156
156
  parameters: {
157
157
  topicId: { type: "string", description: "Topic scope" },
158
158
  text: { type: "string", description: "Canonical evidence text" },
@@ -163,7 +163,20 @@ var CREATE_EVIDENCE = {
163
163
  },
164
164
  weight: {
165
165
  type: "number",
166
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
166
+ description: "Optional support weight: -1.0 (contradicts) to +1.0 (supports). If omitted, evidenceRelation + confidence determine the weight."
167
+ },
168
+ evidenceRelation: {
169
+ type: "string",
170
+ enum: ["supports", "contradicts"],
171
+ description: "Canonical relation to targetId/linkedBeliefNodeId. Prefer this over relying on signed weight inference."
172
+ },
173
+ confidence: {
174
+ type: "number",
175
+ description: "Confidence in the evidence relation, 0.0 to 1.0"
176
+ },
177
+ beliefRelations: {
178
+ type: "array",
179
+ description: "Optional additional belief relations: [{ beliefId|beliefNodeId|targetId, evidenceRelation|relation, confidence?, weight?, rationale? }]. Use one evidence node with multiple relations when the same fact supports or contradicts several beliefs."
167
180
  },
168
181
  metadata: {
169
182
  type: "object",
@@ -273,7 +286,7 @@ var LINK_EVIDENCE = {
273
286
  };
274
287
  var LINK_EVIDENCE_TO_BELIEF = {
275
288
  name: "link_evidence_to_belief",
276
- description: "Link evidence to a belief with a support weight. Like `git add` \u2014 stages evidence in support of (or against) a belief. The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports).",
289
+ description: "Link evidence to a belief with a support weight. Like `git add` \u2014 stages evidence in support of (or against) a belief. The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports). This relation appends to the SL confidence ledger; do not hand-write confidence separately.",
277
290
  parameters: {
278
291
  evidenceId: { type: "string", description: "The evidence node ID" },
279
292
  beliefId: { type: "string", description: "The belief node ID" },
@@ -281,9 +294,18 @@ var LINK_EVIDENCE_TO_BELIEF = {
281
294
  type: "number",
282
295
  description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
283
296
  },
297
+ evidenceRelation: {
298
+ type: "string",
299
+ enum: ["supports", "contradicts"],
300
+ description: "Canonical semantic relation. If omitted, the sign of weight is used."
301
+ },
302
+ confidence: {
303
+ type: "number",
304
+ description: "Confidence in this evidence-to-belief relation, 0.0 to 1.0"
305
+ },
284
306
  rationale: { type: "string", description: "Why this evidence is relevant" }
285
307
  },
286
- required: ["evidenceId", "beliefId", "weight"],
308
+ required: ["evidenceId", "beliefId"],
287
309
  response: {
288
310
  description: "The created edge linking evidence to belief",
289
311
  fields: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tool-contracts.intelligence-evidence.ts"],"names":[],"mappings":";AAEO,IAAM,wBAAA,GAA4C;AAAA,EACvD,IAAA,EAAM,0BAAA;AAAA,EACN,WAAA,EACE,+RAAA;AAAA,EAIF,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,kBAAA,EAAmB;AAAA,IAC3D,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,EACpB,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,4DAAA;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,OAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,WAAA,EAAa,cAAA;AAAA,EACb,iBAAA,EAAmB,OAAA;AAAA,EACnB,IAAA,EAAM;AACR;AAEO,IAAM,4BAAA,GAAgD;AAAA,EAC3D,IAAA,EAAM,8BAAA;AAAA,EACN,WAAA,EACE,sSAAA;AAAA,EAIF,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,kBAAA;AAAmB,GAC7D;AAA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,EAAmB,MAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.intelligence-evidence.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const DETECT_CONFIRMATION_BIAS: McpToolContract = {\n name: \"detect_confirmation_bias\",\n description:\n \"Detect confirmation bias in the evidence graph. \" +\n \"Like `git diff --stat` for reasoning — analyzes the ratio of supporting vs challenging evidence \" +\n \"per belief and flags beliefs where the evidence is suspiciously one-sided. \" +\n \"Returns risk classification (critical/high/moderate/healthy).\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n threshold: {\n type: \"number\",\n description: \"Bias threshold (0-1, default 0.7)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Beliefs with bias scores, risk levels, and evidence counts\",\n fields: {\n beliefs:\n \"array — { nodeId, biasScore, riskLevel, supportingCount, challengingCount }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const GET_GRAPH_STRUCTURE_ANALYSIS: McpToolContract = {\n name: \"get_graph_structure_analysis\",\n description:\n \"Run comprehensive structural analysis on the knowledge graph. \" +\n \"Like `git fsck` combined with PageRank — runs 14 algorithmic detectors including \" +\n \"PageRank centrality, Louvain community detection, Tarjan SCC, Fiedler vector spectral analysis, \" +\n \"Bayesian surprise, and overconfidence detection.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Structural analysis with detector results and recommendations\",\n fields: {\n topicId: \"string — canonical topic scope\",\n metric: \"string — analysis metric identifier\",\n payload: \"object — detector results, recommendations, graph metrics\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const LIST_GRAPH_INTELLIGENCE_QUERIES: McpToolContract = {\n name: \"list_graph_intelligence_queries\",\n description:\n \"List the Graph Intelligence query catalog that powers structural graph analysis experiences. \" +\n \"Returns categories, query IDs, prompt templates, modes, and the public tool plan each query can use.\",\n parameters: {\n categoryId: {\n type: \"string\",\n description: \"Optional category filter, such as problems or strategic\",\n },\n mode: {\n type: \"string\",\n description:\n \"Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence\",\n },\n },\n required: [],\n response: {\n description:\n \"Graph Intelligence query catalog and mode-to-tool mapping\",\n fields: {\n categories: \"array — query categories\",\n queries: \"array — query definitions with prompt templates and tools\",\n quickQueries: \"array — recommended one-click query presets\",\n publicToolNamesByMode:\n \"object — public tool names available to each Graph Intelligence mode\",\n },\n },\n ownerModule: \"graph-intelligence\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const RUN_GRAPH_INTELLIGENCE_QUERY: McpToolContract = {\n name: \"run_graph_intelligence_query\",\n description:\n \"Run a named Graph Intelligence query against a tenant topic graph. \" +\n \"Returns the selected query, prompt, deterministic graph-analysis bundle, graph context, and public tool plan for model synthesis.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n queryId: {\n type: \"string\",\n description:\n \"Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary\",\n },\n prompt: {\n type: \"string\",\n description: \"Optional custom prompt for custom analysis runs\",\n },\n input: {\n type: \"string\",\n description:\n \"Optional entity, theme, belief, company, or search text for input-driven queries\",\n },\n mode: {\n type: \"string\",\n description:\n \"Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum graph context rows to return\",\n },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Graph Intelligence query result bundle ready for model or prompt-library synthesis\",\n fields: {\n query: \"object — selected query definition\",\n prompt: \"string — resolved prompt template\",\n toolPlan: \"array — public tools and args the model can call next\",\n analysis:\n \"object — structure, coverage, gap, and confirmation-bias analysis\",\n context: \"object — sampled beliefs, questions, evidence, edges, and contradictions\",\n },\n },\n ownerModule: \"graph-intelligence\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const GET_FALSIFICATION_QUESTIONS: McpToolContract = {\n name: \"get_falsification_questions\",\n description:\n \"Generate Popperian falsification questions for beliefs. \" +\n \"Like `git test` — identifies the questions most likely to disprove current beliefs. \" +\n \"Karl Popper as a tool: surfaces what would need to be true to invalidate each belief.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n beliefIds: { type: \"array\", description: \"Specific beliefs to target\" },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Questions with falsification potential scores and target beliefs\",\n fields: {\n questions:\n \"array — { questionText, falsificationPotential, targetBeliefId, targetBeliefText }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"question\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// EVIDENCE OPERATION TOOLS\n// =============================================================================\n\nexport const SEARCH_EVIDENCE: McpToolContract = {\n name: \"search_evidence\",\n description:\n \"Search for evidence across the reasoning graph. \" +\n \"Like `git grep` — returns the evidence records that best match a textual query. \" +\n \"Results share the same canonical semantics as the HTTP and SDK evidence search surface.\",\n parameters: {\n q: { type: \"string\", description: \"Search text\" },\n topicId: { type: \"string\", description: \"Topic scope filter\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to scope the search\",\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [\"q\"],\n response: {\n description: \"Canonical evidence search results page\",\n fields: {\n results:\n \"array — { evidenceId, nodeId, globalId?, text, source?, kind?, relevanceScore }\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const CREATE_EVIDENCE: McpToolContract = {\n name: \"create_evidence\",\n description:\n \"Commit evidence to the reasoning graph. \" +\n \"Like `git commit` — creates a traceable evidence record with canonical public IDs. \" +\n \"Optionally links the evidence to a belief or question in the same operation.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n text: { type: \"string\", description: \"Canonical evidence text\" },\n source: { type: \"string\", description: \"Source URL or source label\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to link immediately\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n metadata: {\n type: \"object\",\n description: \"Optional metadata merged into the canonical evidence node\",\n },\n rationale: {\n type: \"string\",\n description: \"Why this evidence should enter the reasoning graph\",\n },\n title: { type: \"string\", description: \"Optional short title\" },\n content: { type: \"string\", description: \"Optional long-form content\" },\n contentType: {\n type: \"string\",\n description: \"Optional content format or MIME hint\",\n },\n kind: { type: \"string\", description: \"Optional evidence kind\" },\n },\n required: [\"text\", \"rationale\"],\n response: {\n description: \"The created canonical evidence record\",\n fields: {\n id: \"string — canonical evidence ID\",\n nodeId: \"string — canonical evidence ID\",\n evidenceId: \"string — canonical evidence ID\",\n text: \"string\",\n topicId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const GET_EVIDENCE: McpToolContract = {\n name: \"get_evidence\",\n description:\n \"Read one evidence record by ID. \" +\n \"Like `git show` — resolves the canonical evidence payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical evidence ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical evidence record\",\n fields: {\n id: \"string — canonical evidence ID\",\n nodeId: \"string — canonical evidence ID\",\n evidenceId: \"string — canonical evidence ID\",\n text: \"string\",\n topicId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const LIST_EVIDENCE: McpToolContract = {\n name: \"list_evidence\",\n description:\n \"List evidence records within a topic or linked to a target. \" +\n \"Like `git log -- path` — returns the canonical evidence page for a topic, belief, or question scope.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope filter\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to scope by linkage\",\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"Canonical evidence page\",\n fields: {\n evidence: \"array — canonical evidence records\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE: McpToolContract = {\n name: \"link_evidence\",\n description:\n \"Link evidence to a belief or question. \" +\n \"Like `git notes add` — attaches a supporting or contradicting edge without rewriting the evidence itself.\",\n parameters: {\n evidenceId: { type: \"string\", description: \"Canonical evidence ID\" },\n targetId: {\n type: \"string\",\n description: \"Canonical belief or question ID\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n rationale: { type: \"string\", description: \"Why this link exists\" },\n },\n required: [\"evidenceId\", \"targetId\"],\n response: {\n description: \"The created canonical evidence edge summary\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n targetId: \"string\",\n targetType: \"string — belief | question\",\n weight: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE_TO_BELIEF: McpToolContract = {\n name: \"link_evidence_to_belief\",\n description:\n \"Link evidence to a belief with a support weight. \" +\n \"Like `git add` — stages evidence in support of (or against) a belief. \" +\n \"The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports).\",\n parameters: {\n evidenceId: { type: \"string\", description: \"The evidence node ID\" },\n beliefId: { type: \"string\", description: \"The belief node ID\" },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n rationale: { type: \"string\", description: \"Why this evidence is relevant\" },\n },\n required: [\"evidenceId\", \"beliefId\", \"weight\"],\n response: {\n description: \"The created edge linking evidence to belief\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n beliefId: \"string\",\n weight: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// QUESTION OPERATION TOOLS\n// =============================================================================\n"]}
1
+ {"version":3,"sources":["../src/tool-contracts.intelligence-evidence.ts"],"names":[],"mappings":";AAEO,IAAM,wBAAA,GAA4C;AAAA,EACvD,IAAA,EAAM,0BAAA;AAAA,EACN,WAAA,EACE,+RAAA;AAAA,EAIF,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,kBAAA,EAAmB;AAAA,IAC3D,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,EACpB,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,4DAAA;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,OAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,WAAA,EAAa,cAAA;AAAA,EACb,iBAAA,EAAmB,OAAA;AAAA,EACnB,IAAA,EAAM;AACR;AAEO,IAAM,4BAAA,GAAgD;AAAA,EAC3D,IAAA,EAAM,8BAAA;AAAA,EACN,WAAA,EACE,sSAAA;AAAA,EAIF,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,kBAAA;AAAmB,GAC7D;AAAA,EACA,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,EACpB,QAAA,EAAU;AAAA,IACR,WAAA,EACE,+DAAA;AAAA,IACF,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,qCAAA;AAAA,MACT,MAAA,EAAQ,0CAAA;AAAA,MACR,OAAA,EAAS;AAAA;AACX,GACF;AAAA,EACA,WAAA,EAAa,cAAA;AAAA,EACb,iBAAA,EAAmB,OAAA;AAAA,EACnB,IAAA,EAAM;AACR;AAEO,IAAM,+BAAA,GAAmD;AAA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A,IACb,MAAA,EAAQ;AAAA,MACN,MAAA,EAAQ,QAAA;AAAA,MACR,UAAA,EAAY,QAAA;AAAA,MACZ,QAAA,EAAU,QAAA;AAAA,MACV,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,MAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.intelligence-evidence.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const DETECT_CONFIRMATION_BIAS: McpToolContract = {\n name: \"detect_confirmation_bias\",\n description:\n \"Detect confirmation bias in the evidence graph. \" +\n \"Like `git diff --stat` for reasoning — analyzes the ratio of supporting vs challenging evidence \" +\n \"per belief and flags beliefs where the evidence is suspiciously one-sided. \" +\n \"Returns risk classification (critical/high/moderate/healthy).\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n threshold: {\n type: \"number\",\n description: \"Bias threshold (0-1, default 0.7)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Beliefs with bias scores, risk levels, and evidence counts\",\n fields: {\n beliefs:\n \"array — { nodeId, biasScore, riskLevel, supportingCount, challengingCount }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const GET_GRAPH_STRUCTURE_ANALYSIS: McpToolContract = {\n name: \"get_graph_structure_analysis\",\n description:\n \"Run comprehensive structural analysis on the knowledge graph. \" +\n \"Like `git fsck` combined with PageRank — runs 14 algorithmic detectors including \" +\n \"PageRank centrality, Louvain community detection, Tarjan SCC, Fiedler vector spectral analysis, \" +\n \"Bayesian surprise, and overconfidence detection.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Structural analysis with detector results and recommendations\",\n fields: {\n topicId: \"string — canonical topic scope\",\n metric: \"string — analysis metric identifier\",\n payload: \"object — detector results, recommendations, graph metrics\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const LIST_GRAPH_INTELLIGENCE_QUERIES: McpToolContract = {\n name: \"list_graph_intelligence_queries\",\n description:\n \"List the Graph Intelligence query catalog that powers structural graph analysis experiences. \" +\n \"Returns categories, query IDs, prompt templates, modes, and the public tool plan each query can use.\",\n parameters: {\n categoryId: {\n type: \"string\",\n description: \"Optional category filter, such as problems or strategic\",\n },\n mode: {\n type: \"string\",\n description:\n \"Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence\",\n },\n },\n required: [],\n response: {\n description:\n \"Graph Intelligence query catalog and mode-to-tool mapping\",\n fields: {\n categories: \"array — query categories\",\n queries: \"array — query definitions with prompt templates and tools\",\n quickQueries: \"array — recommended one-click query presets\",\n publicToolNamesByMode:\n \"object — public tool names available to each Graph Intelligence mode\",\n },\n },\n ownerModule: \"graph-intelligence\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const RUN_GRAPH_INTELLIGENCE_QUERY: McpToolContract = {\n name: \"run_graph_intelligence_query\",\n description:\n \"Run a named Graph Intelligence query against a tenant topic graph. \" +\n \"Returns the selected query, prompt, deterministic graph-analysis bundle, graph context, and public tool plan for model synthesis.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n queryId: {\n type: \"string\",\n description:\n \"Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary\",\n },\n prompt: {\n type: \"string\",\n description: \"Optional custom prompt for custom analysis runs\",\n },\n input: {\n type: \"string\",\n description:\n \"Optional entity, theme, belief, company, or search text for input-driven queries\",\n },\n mode: {\n type: \"string\",\n description:\n \"Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum graph context rows to return\",\n },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Graph Intelligence query result bundle ready for model or prompt-library synthesis\",\n fields: {\n query: \"object — selected query definition\",\n prompt: \"string — resolved prompt template\",\n toolPlan: \"array — public tools and args the model can call next\",\n analysis:\n \"object — structure, coverage, gap, and confirmation-bias analysis\",\n context: \"object — sampled beliefs, questions, evidence, edges, and contradictions\",\n },\n },\n ownerModule: \"graph-intelligence\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const GET_FALSIFICATION_QUESTIONS: McpToolContract = {\n name: \"get_falsification_questions\",\n description:\n \"Generate Popperian falsification questions for beliefs. \" +\n \"Like `git test` — identifies the questions most likely to disprove current beliefs. \" +\n \"Karl Popper as a tool: surfaces what would need to be true to invalidate each belief.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n beliefIds: { type: \"array\", description: \"Specific beliefs to target\" },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Questions with falsification potential scores and target beliefs\",\n fields: {\n questions:\n \"array — { questionText, falsificationPotential, targetBeliefId, targetBeliefText }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"question\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// EVIDENCE OPERATION TOOLS\n// =============================================================================\n\nexport const SEARCH_EVIDENCE: McpToolContract = {\n name: \"search_evidence\",\n description:\n \"Search for evidence across the reasoning graph. \" +\n \"Like `git grep` — returns the evidence records that best match a textual query. \" +\n \"Results share the same canonical semantics as the HTTP and SDK evidence search surface.\",\n parameters: {\n q: { type: \"string\", description: \"Search text\" },\n topicId: { type: \"string\", description: \"Topic scope filter\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to scope the search\",\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [\"q\"],\n response: {\n description: \"Canonical evidence search results page\",\n fields: {\n results:\n \"array — { evidenceId, nodeId, globalId?, text, source?, kind?, relevanceScore }\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const CREATE_EVIDENCE: McpToolContract = {\n name: \"create_evidence\",\n description:\n \"Commit evidence to the reasoning graph. \" +\n \"Like `git commit` — creates a traceable evidence record with canonical public IDs. \" +\n \"Optionally links the evidence to a belief or question in the same operation. \" +\n \"When evidence bears on beliefs, state whether it supports or contradicts; SL confidence is derived from these evidence relations.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n text: { type: \"string\", description: \"Canonical evidence text\" },\n source: { type: \"string\", description: \"Source URL or source label\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to link immediately\",\n },\n weight: {\n type: \"number\",\n description:\n \"Optional support weight: -1.0 (contradicts) to +1.0 (supports). If omitted, evidenceRelation + confidence determine the weight.\",\n },\n evidenceRelation: {\n type: \"string\",\n enum: [\"supports\", \"contradicts\"],\n description:\n \"Canonical relation to targetId/linkedBeliefNodeId. Prefer this over relying on signed weight inference.\",\n },\n confidence: {\n type: \"number\",\n description: \"Confidence in the evidence relation, 0.0 to 1.0\",\n },\n beliefRelations: {\n type: \"array\",\n description:\n \"Optional additional belief relations: [{ beliefId|beliefNodeId|targetId, evidenceRelation|relation, confidence?, weight?, rationale? }]. Use one evidence node with multiple relations when the same fact supports or contradicts several beliefs.\",\n },\n metadata: {\n type: \"object\",\n description: \"Optional metadata merged into the canonical evidence node\",\n },\n rationale: {\n type: \"string\",\n description: \"Why this evidence should enter the reasoning graph\",\n },\n title: { type: \"string\", description: \"Optional short title\" },\n content: { type: \"string\", description: \"Optional long-form content\" },\n contentType: {\n type: \"string\",\n description: \"Optional content format or MIME hint\",\n },\n kind: { type: \"string\", description: \"Optional evidence kind\" },\n },\n required: [\"text\", \"rationale\"],\n response: {\n description: \"The created canonical evidence record\",\n fields: {\n id: \"string — canonical evidence ID\",\n nodeId: \"string — canonical evidence ID\",\n evidenceId: \"string — canonical evidence ID\",\n text: \"string\",\n topicId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const GET_EVIDENCE: McpToolContract = {\n name: \"get_evidence\",\n description:\n \"Read one evidence record by ID. \" +\n \"Like `git show` — resolves the canonical evidence payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical evidence ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical evidence record\",\n fields: {\n id: \"string — canonical evidence ID\",\n nodeId: \"string — canonical evidence ID\",\n evidenceId: \"string — canonical evidence ID\",\n text: \"string\",\n topicId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const LIST_EVIDENCE: McpToolContract = {\n name: \"list_evidence\",\n description:\n \"List evidence records within a topic or linked to a target. \" +\n \"Like `git log -- path` — returns the canonical evidence page for a topic, belief, or question scope.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope filter\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to scope by linkage\",\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"Canonical evidence page\",\n fields: {\n evidence: \"array — canonical evidence records\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE: McpToolContract = {\n name: \"link_evidence\",\n description:\n \"Link evidence to a belief or question. \" +\n \"Like `git notes add` — attaches a supporting or contradicting edge without rewriting the evidence itself.\",\n parameters: {\n evidenceId: { type: \"string\", description: \"Canonical evidence ID\" },\n targetId: {\n type: \"string\",\n description: \"Canonical belief or question ID\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n rationale: { type: \"string\", description: \"Why this link exists\" },\n },\n required: [\"evidenceId\", \"targetId\"],\n response: {\n description: \"The created canonical evidence edge summary\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n targetId: \"string\",\n targetType: \"string — belief | question\",\n weight: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE_TO_BELIEF: McpToolContract = {\n name: \"link_evidence_to_belief\",\n description:\n \"Link evidence to a belief with a support weight. \" +\n \"Like `git add` — stages evidence in support of (or against) a belief. \" +\n \"The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports). \" +\n \"This relation appends to the SL confidence ledger; do not hand-write confidence separately.\",\n parameters: {\n evidenceId: { type: \"string\", description: \"The evidence node ID\" },\n beliefId: { type: \"string\", description: \"The belief node ID\" },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n evidenceRelation: {\n type: \"string\",\n enum: [\"supports\", \"contradicts\"],\n description:\n \"Canonical semantic relation. If omitted, the sign of weight is used.\",\n },\n confidence: {\n type: \"number\",\n description: \"Confidence in this evidence-to-belief relation, 0.0 to 1.0\",\n },\n rationale: { type: \"string\", description: \"Why this evidence is relevant\" },\n },\n required: [\"evidenceId\", \"beliefId\"],\n response: {\n description: \"The created edge linking evidence to belief\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n beliefId: \"string\",\n weight: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// QUESTION OPERATION TOOLS\n// =============================================================================\n"]}
@@ -1,7 +1,7 @@
1
1
  // src/tool-contracts.lifecycle.ts
2
2
  var CREATE_BELIEF = {
3
3
  name: "create_belief",
4
- description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; use modulate_confidence to record the first evidential update.",
4
+ description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; attach supporting or contradicting evidence with create_evidence or link_evidence_to_belief to record evidential updates.",
5
5
  parameters: {
6
6
  canonicalText: {
7
7
  type: "string",
@@ -87,7 +87,7 @@ var REFINE_BELIEF = {
87
87
  };
88
88
  var MODULATE_CONFIDENCE = {
89
89
  name: "modulate_confidence",
90
- description: "Record a confidence change for a belief. Like `git commit` to the credence log \u2014 an atomic, append-only write. Each modulation is a new entry in the history, not an overwrite. Scoring happens via merge; this tool records the individual data points. Pass the full subjective-logic tuple (`belief`, `disbelief`, `uncertainty`, `baseRate`) directly. If a caller only has a scalar probability, use `@lucern/sdk` helpers `opinionFromBaseRate`, `opinionFromDogmatic`, or `opinionFromProjected` to name the intended interpretation before calling this tool. Every modulation must cite a truth-bearing artifact: triggeringEvidenceId, triggeringQuestionId, triggeringAnswerId, triggeringContradictionId, or triggeringWorktreeId. Triggers: evidence_added, evidence_removed, contradiction_detected, contradiction_resolved, agent_assessment, worktree_outcome, worktree_completed, fusion, discount, deduction.",
90
+ description: "Internal-only subjective-logic ledger append. Like `git commit` to the credence log for the scoring engine \u2014 never an operator-facing way to assert confidence. Agents, SDK callers, CLI users, and MCP clients must instead create or link evidence with `evidenceRelation: supports|contradicts`; the kernel derives the next opinion from that evidence. This compatibility primitive is reserved for governed system scoring paths that already hold a full subjective-logic tuple and truth-bearing provenance.",
91
91
  parameters: {
92
92
  nodeId: { type: "string", description: "The belief to score" },
93
93
  belief: {
@@ -1695,10 +1695,11 @@ var LUCERN_ORIENT = {
1695
1695
  workflow: "array - recommended branch -> investigate -> prove gate -> merge workflow",
1696
1696
  grammarMap: "array - primitive-to-git-analogy map for topics, campaigns, worktrees, beliefs, questions, evidence, edges, contradictions, and gates",
1697
1697
  firstMoves: "array - recommended first tools for a cold-start agent",
1698
- receiptRules: "array - how to interpret candidateCounts, broadening, coverageWarning, and noDefaultGlobalScan",
1698
+ receiptRules: "array - how to interpret candidateCounts, broadening, coverageWarning, narrativeCoverage, synthesisLints, and noDefaultGlobalScan",
1699
1699
  safetyRules: "array - mutation and completion rules that preserve reasoning lineage",
1700
1700
  toolMap: "array | undefined - situation-to-tool routing map when requested",
1701
1701
  examples: "array | undefined - concrete tool-call examples when requested",
1702
+ futureCapabilities: "array | undefined - exemplar, gauntlet, trace-corpus, and native-model-training capabilities when requested",
1702
1703
  suggestedNextCalls: "array - safe next tool calls for the current situation"
1703
1704
  }
1704
1705
  },
@@ -1861,7 +1862,7 @@ var SEARCH_EVIDENCE = {
1861
1862
  };
1862
1863
  var CREATE_EVIDENCE = {
1863
1864
  name: "create_evidence",
1864
- description: "Commit evidence to the reasoning graph. Like `git commit` \u2014 creates a traceable evidence record with canonical public IDs. Optionally links the evidence to a belief or question in the same operation.",
1865
+ description: "Commit evidence to the reasoning graph. Like `git commit` \u2014 creates a traceable evidence record with canonical public IDs. Optionally links the evidence to a belief or question in the same operation. When evidence bears on beliefs, state whether it supports or contradicts; SL confidence is derived from these evidence relations.",
1865
1866
  parameters: {
1866
1867
  topicId: { type: "string", description: "Topic scope" },
1867
1868
  text: { type: "string", description: "Canonical evidence text" },
@@ -1872,7 +1873,20 @@ var CREATE_EVIDENCE = {
1872
1873
  },
1873
1874
  weight: {
1874
1875
  type: "number",
1875
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
1876
+ description: "Optional support weight: -1.0 (contradicts) to +1.0 (supports). If omitted, evidenceRelation + confidence determine the weight."
1877
+ },
1878
+ evidenceRelation: {
1879
+ type: "string",
1880
+ enum: ["supports", "contradicts"],
1881
+ description: "Canonical relation to targetId/linkedBeliefNodeId. Prefer this over relying on signed weight inference."
1882
+ },
1883
+ confidence: {
1884
+ type: "number",
1885
+ description: "Confidence in the evidence relation, 0.0 to 1.0"
1886
+ },
1887
+ beliefRelations: {
1888
+ type: "array",
1889
+ description: "Optional additional belief relations: [{ beliefId|beliefNodeId|targetId, evidenceRelation|relation, confidence?, weight?, rationale? }]. Use one evidence node with multiple relations when the same fact supports or contradicts several beliefs."
1876
1890
  },
1877
1891
  metadata: {
1878
1892
  type: "object",
@@ -1982,7 +1996,7 @@ var LINK_EVIDENCE = {
1982
1996
  };
1983
1997
  var LINK_EVIDENCE_TO_BELIEF = {
1984
1998
  name: "link_evidence_to_belief",
1985
- description: "Link evidence to a belief with a support weight. Like `git add` \u2014 stages evidence in support of (or against) a belief. The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports).",
1999
+ description: "Link evidence to a belief with a support weight. Like `git add` \u2014 stages evidence in support of (or against) a belief. The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports). This relation appends to the SL confidence ledger; do not hand-write confidence separately.",
1986
2000
  parameters: {
1987
2001
  evidenceId: { type: "string", description: "The evidence node ID" },
1988
2002
  beliefId: { type: "string", description: "The belief node ID" },
@@ -1990,9 +2004,18 @@ var LINK_EVIDENCE_TO_BELIEF = {
1990
2004
  type: "number",
1991
2005
  description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
1992
2006
  },
2007
+ evidenceRelation: {
2008
+ type: "string",
2009
+ enum: ["supports", "contradicts"],
2010
+ description: "Canonical semantic relation. If omitted, the sign of weight is used."
2011
+ },
2012
+ confidence: {
2013
+ type: "number",
2014
+ description: "Confidence in this evidence-to-belief relation, 0.0 to 1.0"
2015
+ },
1993
2016
  rationale: { type: "string", description: "Why this evidence is relevant" }
1994
2017
  },
1995
- required: ["evidenceId", "beliefId", "weight"],
2018
+ required: ["evidenceId", "beliefId"],
1996
2019
  response: {
1997
2020
  description: "The created edge linking evidence to belief",
1998
2021
  fields: {
@@ -2820,7 +2843,9 @@ var COMPILE_CONTEXT = {
2820
2843
  recentEvidence: "array \u2014 recent evidence ranked for this query",
2821
2844
  contradictions: "array \u2014 unresolved contradiction records",
2822
2845
  relatedEntities: "array | undefined \u2014 ranked ontological entities in scope",
2823
- contextNarrative: "array \u2014 guidance for prompt assembly",
2846
+ contextNarrative: "array \u2014 ordered synthesis blocks with kind/text, starting with executive_summary and canonical narrative blocks before raw objects",
2847
+ retrievalReceipt: "object \u2014 candidateCounts, coverageWarning, narrativeCoverage, synthesisLints, and suggestedNextActions",
2848
+ narrativeCoverage: "object \u2014 recordsSynthesized, recordsNamed, recordsOmitted, and blocksEmitted for the narrative",
2824
2849
  injectionPolicy: "object \u2014 token-budgeted section selections",
2825
2850
  diagnostics: "object \u2014 scoring and utilization telemetry"
2826
2851
  }