@lucern/sdk 0.2.0-alpha.9 → 0.3.0-alpha.1

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 (108) hide show
  1. package/README.md +33 -15
  2. package/dist/adminClient.d.ts +15 -9
  3. package/dist/adminClient.js.map +1 -1
  4. package/dist/audience/index.d.ts +38 -0
  5. package/dist/audience/index.js +110 -0
  6. package/dist/audience/index.js.map +1 -0
  7. package/dist/beliefs/index.d.ts +463 -0
  8. package/dist/beliefs/index.js +6695 -0
  9. package/dist/beliefs/index.js.map +1 -0
  10. package/dist/beliefs/lifecycle.d.ts +24 -0
  11. package/dist/beliefs/lifecycle.js +98 -0
  12. package/dist/beliefs/lifecycle.js.map +1 -0
  13. package/dist/beliefsClient.d.ts +76 -12
  14. package/dist/beliefsClient.js +139 -7
  15. package/dist/beliefsClient.js.map +1 -1
  16. package/dist/client-B6aWUUwp.d.ts +2552 -0
  17. package/dist/client.d.ts +31 -2377
  18. package/dist/client.js +802 -263
  19. package/dist/client.js.map +1 -1
  20. package/dist/contracts/api-enums.contract.d.ts +1 -1
  21. package/dist/contracts/api-enums.contract.js +8 -2
  22. package/dist/contracts/api-enums.contract.js.map +1 -1
  23. package/dist/contracts/index.d.ts +4 -2
  24. package/dist/contracts/index.js +119 -4283
  25. package/dist/contracts/index.js.map +1 -1
  26. package/dist/contracts/mcpTools.d.ts +2 -1
  27. package/dist/contracts/mcpTools.js +22 -2981
  28. package/dist/contracts/mcpTools.js.map +1 -1
  29. package/dist/contracts/sdk-tools.contract.d.ts +1 -2
  30. package/dist/contracts/sdk-tools.contract.js +1 -4132
  31. package/dist/contracts/sdk-tools.contract.js.map +1 -1
  32. package/dist/contracts/sdkTools.d.ts +1 -2
  33. package/dist/contracts/sdkTools.js +20 -4127
  34. package/dist/contracts/sdkTools.js.map +1 -1
  35. package/dist/contracts/tool-contracts.d.ts +1 -0
  36. package/dist/contracts/tool-contracts.js +3 -0
  37. package/dist/contracts/tool-contracts.js.map +1 -0
  38. package/dist/contracts/workflow-runtime.contract.js +1 -1
  39. package/dist/contracts/workflow-runtime.contract.js.map +1 -1
  40. package/dist/contracts/workflowRuntime.js +1 -1
  41. package/dist/contracts/workflowRuntime.js.map +1 -1
  42. package/dist/contradictions/index.d.ts +156 -0
  43. package/dist/contradictions/index.js +6689 -0
  44. package/dist/contradictions/index.js.map +1 -0
  45. package/dist/customTools.d.ts +1 -1
  46. package/dist/decisions/index.d.ts +66 -0
  47. package/dist/decisions/index.js +6691 -0
  48. package/dist/decisions/index.js.map +1 -0
  49. package/dist/edges/index.d.ts +202 -0
  50. package/dist/edges/index.js +6690 -0
  51. package/dist/edges/index.js.map +1 -0
  52. package/dist/events.js +7 -5
  53. package/dist/events.js.map +1 -1
  54. package/dist/evidence/index.d.ts +294 -0
  55. package/dist/evidence/index.js +6690 -0
  56. package/dist/evidence/index.js.map +1 -0
  57. package/dist/evidenceClient.d.ts +119 -0
  58. package/dist/evidenceClient.js +350 -0
  59. package/dist/evidenceClient.js.map +1 -0
  60. package/dist/gatewayFacades.d.ts +25 -15
  61. package/dist/gatewayFacades.js +39 -5
  62. package/dist/gatewayFacades.js.map +1 -1
  63. package/dist/identityClient.d.ts +3 -3
  64. package/dist/identityClient.js.map +1 -1
  65. package/dist/index.d.ts +7 -6
  66. package/dist/index.js +1145 -3313
  67. package/dist/index.js.map +1 -1
  68. package/dist/lenses/index.d.ts +194 -0
  69. package/dist/lenses/index.js +6689 -0
  70. package/dist/lenses/index.js.map +1 -0
  71. package/dist/nodes/index.d.ts +61 -0
  72. package/dist/nodes/index.js +6691 -0
  73. package/dist/nodes/index.js.map +1 -0
  74. package/dist/ontologies/index.d.ts +179 -0
  75. package/dist/ontologies/index.js +6692 -0
  76. package/dist/ontologies/index.js.map +1 -0
  77. package/dist/opinion.d.ts +11 -0
  78. package/dist/opinion.js +35 -0
  79. package/dist/opinion.js.map +1 -0
  80. package/dist/questions/index.d.ts +295 -0
  81. package/dist/questions/index.js +6692 -0
  82. package/dist/questions/index.js.map +1 -0
  83. package/dist/sdk-tools.contract-B4c1Zr1o.d.ts +22 -0
  84. package/dist/sourcesClient.d.ts +24 -0
  85. package/dist/{mcpParityClient.js → sourcesClient.js} +15 -192
  86. package/dist/sourcesClient.js.map +1 -0
  87. package/dist/tool-contracts-BUiL9P6z.d.ts +22 -0
  88. package/dist/topics/index.d.ts +66 -0
  89. package/dist/topics/index.js +6690 -0
  90. package/dist/topics/index.js.map +1 -0
  91. package/dist/types.d.ts +27 -8
  92. package/dist/workflowClient.d.ts +18 -5
  93. package/dist/workflowClient.js +19 -7
  94. package/dist/workflowClient.js.map +1 -1
  95. package/dist/worktrees/index.d.ts +211 -0
  96. package/dist/worktrees/index.js +6692 -0
  97. package/dist/worktrees/index.js.map +1 -0
  98. package/package.json +56 -3
  99. package/dist/contracts/mcp-tools.contract.d.ts +0 -1
  100. package/dist/contracts/mcp-tools.contract.js +0 -2986
  101. package/dist/contracts/mcp-tools.contract.js.map +0 -1
  102. package/dist/mcpParityClient.d.ts +0 -74
  103. package/dist/mcpParityClient.js.map +0 -1
  104. package/dist/mcpParitySurface.d.ts +0 -12
  105. package/dist/mcpParitySurface.js +0 -65
  106. package/dist/mcpParitySurface.js.map +0 -1
  107. package/dist/mcpTools-DPZxowDX.d.ts +0 -254
  108. package/dist/sdkTools-CwXJDACb.d.ts +0 -150
@@ -1,4134 +1,27 @@
1
- // src/contracts/lens-workflow.contract.ts
2
- var LENS_PERSPECTIVE_TYPES = [
3
- "investigation",
4
- "monitoring",
5
- "analysis",
6
- "comparison",
7
- "taxonomy"
8
- ];
1
+ import * as sdk_tools_star from '@lucern/contracts/sdk-tools.contract';
9
2
 
10
- // src/contracts/mcp-tools.contract.ts
11
- var CREATE_BELIEF = {
12
- name: "create_belief",
13
- description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object. The belief starts as unscored (draft). Score it with modulate_confidence to freeze the formulation.",
14
- parameters: {
15
- canonicalText: {
16
- type: "string",
17
- description: "The belief statement \u2014 what the agent holds to be true"
18
- },
19
- topicId: { type: "string", description: "Topic scope for the belief" },
20
- beliefType: {
21
- type: "string",
22
- description: "Belief type (e.g., hypothesis, belief, principle, invariant, tenet, forecast). Validated against schemaEnumConfig."
23
- },
24
- metadata: {
25
- type: "object",
26
- description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)"
27
- }
28
- },
29
- required: ["canonicalText", "topicId"],
30
- response: {
31
- description: "The created canonical belief record",
32
- fields: {
33
- id: "string \u2014 canonical belief ID",
34
- nodeId: "string \u2014 canonical belief ID",
35
- beliefId: "string \u2014 canonical belief ID",
36
- text: "string \u2014 canonical belief formulation",
37
- topicId: "string",
38
- status: "string \u2014 active | superseded | archived",
39
- scoringState: "string \u2014 unscored | scored"
40
- }
41
- },
42
- ownerModule: "graph-primitives",
43
- ontologyPrimitive: "belief",
44
- tier: "showcase"
45
- };
46
- var GET_BELIEF = {
47
- name: "get_belief",
48
- description: "Read one belief by ID. Like `git show` \u2014 resolves the canonical belief payload for a single identifier.",
49
- parameters: {
50
- id: { type: "string", description: "Canonical belief ID" }
51
- },
52
- required: ["id"],
53
- response: {
54
- description: "The canonical belief record",
55
- fields: {
56
- id: "string \u2014 canonical belief ID",
57
- nodeId: "string \u2014 canonical belief ID",
58
- beliefId: "string \u2014 canonical belief ID",
59
- text: "string \u2014 canonical belief formulation",
60
- topicId: "string",
61
- status: "string \u2014 active | superseded | archived",
62
- scoringState: "string \u2014 unscored | scored"
63
- }
64
- },
65
- ownerModule: "graph-primitives",
66
- ontologyPrimitive: "belief",
67
- tier: "workhorse"
68
- };
69
- var REFINE_BELIEF = {
70
- name: "refine_belief",
71
- description: "Amend a draft belief in-place within an active worktree. Like `git commit --amend` \u2014 rewrites the last commit on a feature branch. Only valid before merge to main. Fails if the belief is already scored.",
72
- parameters: {
73
- nodeId: { type: "string", description: "The belief to refine" },
74
- canonicalText: { type: "string", description: "Updated belief statement" },
75
- rationale: { type: "string", description: "Why the refinement was made" }
76
- },
77
- required: ["nodeId", "canonicalText"],
78
- response: {
79
- description: "The updated belief node",
80
- fields: {
81
- nodeId: "string",
82
- canonicalText: "string \u2014 updated text",
83
- updatedAt: "number \u2014 timestamp"
84
- }
85
- },
86
- ownerModule: "graph-primitives",
87
- ontologyPrimitive: "belief",
88
- tier: "showcase"
89
- };
90
- var MODULATE_CONFIDENCE = {
91
- name: "modulate_confidence",
92
- 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. Triggers: evidence_added, contradiction_detected, merge_outcome, manual, decay.",
93
- parameters: {
94
- nodeId: { type: "string", description: "The belief to score" },
95
- confidence: { type: "number", description: "Confidence level in [0, 1]" },
96
- trigger: {
97
- type: "string",
98
- description: "What caused this confidence change",
99
- enum: [
100
- "evidence_added",
101
- "contradiction_detected",
102
- "merge_outcome",
103
- "manual",
104
- "decay"
105
- ]
106
- },
107
- rationale: {
108
- type: "string",
109
- description: "Human-readable explanation of why confidence changed"
110
- }
111
- },
112
- required: ["nodeId", "confidence", "trigger", "rationale"],
113
- response: {
114
- description: "Confidence modulation result",
115
- fields: {
116
- beliefId: "string \u2014 canonical belief ID",
117
- nodeId: "string \u2014 canonical belief ID",
118
- newConfidence: "number",
119
- previousConfidence: "number",
120
- trigger: "string",
121
- requestId: "string \u2014 request identifier for the scheduled cascade",
122
- propagationSummary: "object \u2014 bounded inline cascade summary with totalCandidateTargets, inlineTargets, and remainingTargetCount"
123
- }
124
- },
125
- ownerModule: "graph-primitives",
126
- ontologyPrimitive: "belief",
127
- tier: "showcase"
128
- };
129
- var FORK_BELIEF = {
130
- name: "fork_belief",
131
- description: "Branch off a scored belief to create a new version with a different formulation. Like `git fork` \u2014 the parent remains immutable with full history. The new belief gets a `supersedes` edge to the parent. Fork reasons: refinement, contradiction_response, scope_change, confidence_collapse, manual.",
132
- parameters: {
133
- nodeId: { type: "string", description: "The scored belief to fork from" },
134
- newFormulation: {
135
- type: "string",
136
- description: "The evolved belief statement"
137
- },
138
- forkReason: {
139
- type: "string",
140
- description: "Why this fork was created",
141
- enum: [
142
- "refinement",
143
- "contradiction_response",
144
- "scope_change",
145
- "confidence_collapse",
146
- "manual"
147
- ]
148
- }
149
- },
150
- required: ["nodeId", "newFormulation", "forkReason"],
151
- response: {
152
- description: "The forked canonical belief record",
153
- fields: {
154
- id: "string \u2014 canonical child belief ID",
155
- nodeId: "string \u2014 canonical child belief ID",
156
- beliefId: "string \u2014 canonical child belief ID",
157
- parentBeliefId: "string \u2014 canonical parent belief ID",
158
- forkReason: "string"
159
- }
160
- },
161
- ownerModule: "graph-primitives",
162
- ontologyPrimitive: "belief",
163
- tier: "showcase"
164
- };
165
- var ARCHIVE_BELIEF = {
166
- name: "archive_belief",
167
- description: "Soft-delete a belief by setting its status to archived. Like `git rm` \u2014 removed from the working tree but preserved in history. Beliefs are never truly deleted. Archived beliefs retain full lineage and confidence history.",
168
- parameters: {
169
- nodeId: { type: "string", description: "The belief to archive" },
170
- rationale: {
171
- type: "string",
172
- description: "Why this belief is being archived"
173
- }
174
- },
175
- required: ["nodeId"],
176
- response: {
177
- description: "Archived canonical belief record",
178
- fields: {
179
- beliefId: "string \u2014 canonical belief ID",
180
- nodeId: "string \u2014 canonical belief ID",
181
- previousStatus: "string | undefined",
182
- newStatus: "string \u2014 'archived'",
183
- status: "string \u2014 'archived'"
184
- }
185
- },
186
- ownerModule: "graph-primitives",
187
- ontologyPrimitive: "belief",
188
- tier: "showcase"
189
- };
190
- var CREATE_EPISTEMIC_CONTRACT = {
191
- name: "create_epistemic_contract",
192
- description: "Bind a machine-evaluable epistemic contract to a belief. Like `git add` for falsification rules \u2014 records the verification condition, modulation policy, and evaluation schedule that keep a belief accountable to reality.",
193
- parameters: {
194
- beliefNodeId: {
195
- type: "string",
196
- description: "The belief node to bind this contract to"
197
- },
198
- title: {
199
- type: "string",
200
- description: "Contract title"
201
- },
202
- description: {
203
- type: "string",
204
- description: "Optional contract description"
205
- },
206
- conditionType: {
207
- type: "string",
208
- description: "What kind of contract condition to evaluate",
209
- enum: ["assertion", "temporal", "evidential", "threshold", "composite"]
210
- },
211
- direction: {
212
- type: "string",
213
- description: "Whether satisfying the condition confirms or falsifies",
214
- enum: ["confirms", "falsifies"]
215
- },
216
- condition: {
217
- type: "object",
218
- description: "Condition payload: { expression, evaluator, evaluatorConfig? }"
219
- },
220
- deadline: {
221
- type: "number",
222
- description: "Optional Unix timestamp deadline for temporal contracts"
223
- },
224
- compositeOf: {
225
- type: "array",
226
- description: "Optional array of sub-contract IDs for composite contracts"
227
- },
228
- compositeOperator: {
229
- type: "string",
230
- description: "How composite sub-contracts should be combined",
231
- enum: ["all", "any", "majority"]
232
- },
233
- modulation: {
234
- type: "object",
235
- description: "Asymmetric modulation rules for confirmed, disconfirmed, expired, and partial outcomes"
236
- },
237
- evaluationSchedule: {
238
- type: "string",
239
- description: "When this contract should be evaluated",
240
- enum: ["on_demand", "on_evidence", "periodic", "event_driven"]
241
- },
242
- periodicIntervalMs: {
243
- type: "number",
244
- description: "Optional interval in milliseconds for periodic contracts"
245
- }
246
- },
247
- required: [
248
- "beliefNodeId",
249
- "title",
250
- "conditionType",
251
- "direction",
252
- "condition",
253
- "modulation",
254
- "evaluationSchedule"
255
- ],
256
- response: {
257
- description: "The created epistemic contract binding",
258
- fields: {
259
- id: "string \u2014 storage record ID",
260
- contractId: "string \u2014 contract identifier",
261
- beliefId: "string \u2014 canonical belief ID",
262
- status: "string \u2014 initial contract status",
263
- title: "string \u2014 contract title"
264
- }
265
- },
266
- ownerModule: "graph-primitives",
267
- ontologyPrimitive: "belief",
268
- tier: "workhorse"
269
- };
270
- var ADD_EVIDENCE = {
271
- name: "add_evidence",
272
- description: "Commit evidence to the reasoning graph and attach it to a belief. Like `git add && git commit` \u2014 an atomic write that creates a traceable evidence object. Weight ranges from -1.0 (contradicts) to +1.0 (strongly supports). Evidence is always context-bound: tied to its source, the time it was captured, and the belief it informs.",
273
- parameters: {
274
- canonicalText: { type: "string", description: "The evidence statement" },
275
- topicId: { type: "string", description: "Topic scope" },
276
- sourceUrl: { type: "string", description: "URL of the source material" },
277
- targetNodeId: {
278
- type: "string",
279
- description: "The belief this evidence bears on"
280
- },
281
- weight: {
282
- type: "number",
283
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
284
- },
285
- reasoning: {
286
- type: "string",
287
- description: "Why this evidence is relevant to the target belief"
288
- },
289
- title: {
290
- type: "string",
291
- description: "Optional short title for the evidence node"
292
- },
293
- content: {
294
- type: "string",
295
- description: "Optional long-form content (separate from canonicalText summary)"
296
- },
297
- contentType: {
298
- type: "string",
299
- description: "Content MIME type or format hint (e.g., 'text/markdown', 'code')"
300
- },
301
- metadata: {
302
- type: "object",
303
- description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'], failedApproach: true } for coding intelligence)"
304
- }
305
- },
306
- required: ["canonicalText", "topicId", "targetNodeId"],
307
- response: {
308
- description: "The created evidence node and its edge",
309
- fields: {
310
- nodeId: "string \u2014 evidence node ID",
311
- edgeId: "string \u2014 edge to target belief"
312
- }
313
- },
314
- ownerModule: "graph-primitives",
315
- ontologyPrimitive: "evidence",
316
- tier: "showcase"
317
- };
318
- var FLAG_CONTRADICTION = {
319
- name: "flag_contradiction",
320
- description: "Flag a contradiction between two beliefs. Contradictions are first-class objects with their own lifecycle \u2014 they may remain permanently unresolved. Like a merge conflict that is allowed to persist. Contradictions can trigger structural changes: forking, confidence collapse, or decision blocking. Resolution is NEVER automatic \u2014 always surfaces for human review.",
321
- parameters: {
322
- beliefA: {
323
- type: "string",
324
- description: "First belief in the contradiction"
325
- },
326
- beliefB: {
327
- type: "string",
328
- description: "Second belief in the contradiction"
329
- },
330
- description: { type: "string", description: "What the tension is about" },
331
- severity: {
332
- type: "string",
333
- description: "How serious the contradiction is",
334
- enum: ["low", "medium", "high", "critical"]
335
- },
336
- topicId: { type: "string", description: "Topic scope" },
337
- defeatType: {
338
- type: "string",
339
- description: "Pollock defeat classification: rebuts (direct contradiction), undercuts (attacks the inferential link), undermines (attacks a premise)",
340
- enum: ["rebuts", "undercuts", "undermines"]
341
- }
342
- },
343
- required: ["beliefA", "beliefB", "description", "topicId"],
344
- response: {
345
- description: "The created contradiction object",
346
- fields: {
347
- contradictionId: "string",
348
- status: "string \u2014 'unresolved'",
349
- beliefA: "string",
350
- beliefB: "string"
351
- }
352
- },
353
- ownerModule: "graph-primitives",
354
- ontologyPrimitive: "belief",
355
- tier: "showcase"
356
- };
357
- var ADD_WORKTREE = {
358
- name: "add_worktree",
359
- description: "Check out a branch into an active worktree for investigation. Like `git worktree add <branch>` \u2014 creates independent working state on a thematic branch. Beliefs committed within the worktree can be freely amended (draft code on a feature branch). When investigation is complete, `merge` integrates findings into main.",
360
- parameters: {
361
- title: { type: "string", description: "Worktree name/objective" },
362
- topicId: { type: "string", description: "Topic scope" },
363
- branchId: {
364
- type: "string",
365
- description: "The branch this worktree investigates"
366
- },
367
- objective: {
368
- type: "string",
369
- description: "Plain-text reasoning objective to auto-shape into a hypothesis, questions, tasks, and dependencies"
370
- },
371
- hypothesis: {
372
- type: "string",
373
- description: "The testable claim this worktree investigates"
374
- },
375
- beliefIds: {
376
- type: "array",
377
- description: "Beliefs to test in this worktree"
378
- },
379
- autoShape: {
380
- type: "boolean",
381
- description: "Whether to invoke inquiry auto-shaping during worktree creation"
382
- },
383
- domainPackId: {
384
- type: "string",
385
- description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
386
- },
387
- executionOrder: {
388
- type: "number",
389
- description: "Global execution order for this worktree"
390
- },
391
- dependsOn: {
392
- type: "array",
393
- description: "Worktree IDs that must complete before this one can activate"
394
- },
395
- blocks: {
396
- type: "array",
397
- description: "Worktree IDs blocked by this worktree"
398
- },
399
- gate: {
400
- type: "string",
401
- description: "Exit gate name for this worktree"
402
- }
403
- },
404
- required: ["title", "topicId"],
405
- response: {
406
- description: "The created worktree",
407
- fields: {
408
- worktreeId: "string",
409
- branchId: "string | null",
410
- status: "string \u2014 usually 'planning' or 'active'",
411
- title: "string",
412
- hypothesis: "string | null",
413
- questionCount: "number",
414
- taskCount: "number",
415
- autoShapeApplied: "boolean",
416
- frameworkSuggestions: "array",
417
- dependencySuggestions: "array"
418
- }
419
- },
420
- ownerModule: "workflow-engine",
421
- ontologyPrimitive: "worktree",
422
- tier: "showcase"
423
- };
424
- var MERGE = {
425
- name: "merge",
426
- description: "Merge a worktree's findings into the stable knowledge base (main). Like `git merge` to main \u2014 formulations freeze, confidence is recorded, findings are integrated. Each belief gets a confidence score and rationale. After merge, beliefs can only evolve via fork. Low-confidence beliefs may need forking.",
427
- parameters: {
428
- worktreeId: { type: "string", description: "The worktree to merge" },
429
- outcomes: {
430
- type: "array",
431
- description: "Scoring outcomes for each belief: { beliefId, confidence, rationale }"
432
- },
433
- summary: { type: "string", description: "Overall findings summary" }
434
- },
435
- required: ["worktreeId", "outcomes"],
436
- response: {
437
- description: "Merge result",
438
- fields: {
439
- worktreeId: "string",
440
- status: "string \u2014 'merged'",
441
- beliefsScored: "number"
442
- }
443
- },
444
- ownerModule: "workflow-engine",
445
- ontologyPrimitive: "worktree",
446
- tier: "showcase"
447
- };
448
- var QUERY_LINEAGE = {
449
- name: "query_lineage",
450
- description: "Trace a belief's full ancestry \u2014 every fork, score, and confidence modulation. Like `git log --graph`. Returns the complete evolution chain showing how understanding developed over time. Lineage is permanent and can never be erased (Invariant #3).",
451
- parameters: {
452
- nodeId: { type: "string", description: "Starting node to trace from" },
453
- depth: {
454
- type: "number",
455
- description: "How many generations to traverse (default: 5)"
456
- }
457
- },
458
- required: ["nodeId"],
459
- response: {
460
- description: "Canonical lineage result",
461
- fields: {
462
- beliefId: "string \u2014 canonical belief ID",
463
- lineage: "array \u2014 ancestry entries with beliefId, nodeId, formulation, forkReason, and createdAt"
464
- }
465
- },
466
- ownerModule: "graph-search",
467
- ontologyPrimitive: "belief",
468
- tier: "workhorse"
469
- };
470
- var GET_CONFIDENCE_HISTORY = {
471
- name: "get_confidence_history",
472
- description: "Get the full confidence history for a belief. Each entry records the confidence level, trigger, rationale, and actor. Like `git log` for a single metric \u2014 append-only, never overwritten.",
473
- parameters: {
474
- nodeId: { type: "string", description: "The belief to get history for" }
475
- },
476
- required: ["nodeId"],
477
- response: {
478
- description: "Confidence history entries",
479
- fields: {
480
- beliefId: "string \u2014 canonical belief ID",
481
- entries: "array \u2014 { confidence, trigger, rationale, timestamp, userId }",
482
- nextCursor: "string | null"
483
- }
484
- },
485
- ownerModule: "graph-primitives",
486
- ontologyPrimitive: "belief",
487
- tier: "workhorse"
488
- };
489
- var GET_AUDIT_TRAIL = {
490
- name: "get_audit_trail",
491
- description: "Get the full audit trail for a node \u2014 every mutation, who made it, when, and why. Like `git blame` for knowledge. All state transitions are explicit, attributable, and permanently queryable. No silent changes are possible (Invariant #14).",
492
- parameters: {
493
- nodeId: { type: "string", description: "The node to audit" },
494
- limit: {
495
- type: "number",
496
- description: "Maximum entries to return (default: 50)"
497
- }
498
- },
499
- required: ["nodeId"],
500
- response: {
501
- description: "Audit trail entries",
502
- fields: {
503
- entries: "array \u2014 { action, actor, timestamp, before, after, rationale }"
504
- }
505
- },
506
- ownerModule: "graph-primitives",
507
- ontologyPrimitive: "graph",
508
- tier: "workhorse"
509
- };
510
- var TRAVERSE_GRAPH = {
511
- name: "traverse_graph",
512
- description: "Walk the reasoning graph from a starting node. Like `git log --graph` \u2014 traverses connected lineage across nodes and edges. Traversal follows epistemic layers: L4 (judgments) \u2192 L3 (beliefs, questions) \u2192 L2 (evidence) \u2192 L1 (sources). Never skips layers. Use direction 'up' to trace what a piece of evidence supports, 'down' to trace what supports a judgment.",
513
- parameters: {
514
- startNode: { type: "string", description: "Node to start traversal from" },
515
- direction: {
516
- type: "string",
517
- description: "Traversal direction",
518
- enum: ["up", "down", "both"]
519
- },
520
- maxDepth: {
521
- type: "number",
522
- description: "Maximum traversal depth (default: 3)"
523
- }
524
- },
525
- required: ["startNode"],
526
- response: {
527
- description: "Subgraph of traversed nodes and edges",
528
- fields: {
529
- nodes: "array \u2014 traversed nodes",
530
- edges: "array \u2014 traversed edges",
531
- depth: "number"
532
- }
533
- },
534
- ownerModule: "graph-search",
535
- ontologyPrimitive: "graph",
536
- tier: "workhorse"
537
- };
538
- var GET_GRAPH_NEIGHBORHOOD = {
539
- name: "get_graph_neighborhood",
540
- description: "Retrieve the local neighborhood around one or more graph nodes. Like `git log --graph --boundary` for a focused reasoning window. Returns the canonical neighborhood payload shared by HTTP and SDK graph surfaces.",
541
- parameters: {
542
- globalId: {
543
- type: "string",
544
- description: "Single root node global identifier."
545
- },
546
- globalIds: {
547
- type: "array",
548
- description: "Optional list of root node global identifiers."
549
- },
550
- maxDepth: {
551
- type: "number",
552
- description: "Maximum traversal depth (default: 2)."
553
- }
554
- },
555
- required: [],
556
- response: {
557
- description: "Canonical graph neighborhood payload",
558
- fields: {
559
- nodes: "array \u2014 graph nodes in the returned neighborhood",
560
- edges: "array \u2014 graph edges in the returned neighborhood",
561
- depth: "number \u2014 deepest traversed node depth"
562
- }
563
- },
564
- ownerModule: "graph-search",
565
- ontologyPrimitive: "graph",
566
- tier: "workhorse"
567
- };
568
- var TRACE_ENTITY_IMPACT = {
569
- name: "trace_entity_impact",
570
- 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.",
571
- parameters: {
572
- nodeId: {
573
- type: "string",
574
- description: "Entity node ID to trace impact from"
575
- }
576
- },
577
- required: ["nodeId"],
578
- response: {
579
- description: "Entity impact trace: direct beliefs, evidence, and indirect belief reach",
580
- fields: {
581
- entityNodeId: "string \u2014 the traced entity",
582
- entityType: "string \u2014 nodeType of the entity",
583
- directBeliefConnections: "array \u2014 beliefs directly connected via bridge edges",
584
- evidenceConnections: "array \u2014 evidence referencing this entity",
585
- indirectBeliefConnections: "array \u2014 beliefs reached through evidence",
586
- totalBeliefReach: "number \u2014 total unique beliefs impacted"
587
- }
588
- },
589
- ownerModule: "graph-search",
590
- ontologyPrimitive: "graph",
591
- tier: "workhorse"
592
- };
593
- var SEARCH_BELIEFS = {
594
- name: "search_beliefs",
595
- description: "Search for beliefs in the reasoning graph. Like `git grep` \u2014 finds relevant beliefs across the full history and active state. Supports semantic search, filtering by status (unscored, scored, archived), confidence thresholds, and topic scope. Returns beliefs with their current confidence, lineage depth, and contradiction count.",
596
- parameters: {
597
- query: { type: "string", description: "Semantic search query" },
598
- status: {
599
- type: "string",
600
- description: "Filter by belief status",
601
- enum: ["unscored", "scored", "archived"]
602
- },
603
- minConfidence: {
604
- type: "number",
605
- description: "Minimum confidence threshold (0-1)"
606
- },
607
- topicId: { type: "string", description: "Filter by topic" },
608
- limit: { type: "number", description: "Maximum results (default: 10)" }
609
- },
610
- required: ["query"],
611
- response: {
612
- description: "Matching beliefs with metadata",
613
- fields: {
614
- results: "array \u2014 { nodeId, canonicalText, confidence, status, contradictionCount }"
615
- }
616
- },
617
- ownerModule: "graph-search",
618
- ontologyPrimitive: "belief",
619
- tier: "workhorse"
620
- };
621
- var SEARCH_RESOURCES = {
622
- name: "search_resources",
623
- description: "Search beliefs, evidence, and questions in one cross-resource call. Like `git grep` across the reasoning stack \u2014 returns one ranked payload with grouped hits by resource type.",
624
- parameters: {
625
- q: { type: "string", description: "Search query" },
626
- topicId: { type: "string", description: "Topic scope" },
627
- types: {
628
- type: "array",
629
- description: "Optional resource filters: belief, evidence, question"
630
- },
631
- status: {
632
- type: "string",
633
- description: "Optional belief/question status filter"
634
- },
635
- minConfidence: {
636
- type: "number",
637
- description: "Optional minimum belief confidence threshold"
638
- },
639
- limit: { type: "number", description: "Maximum results (default: 25)" },
640
- cursor: { type: "string", description: "Optional pagination cursor" }
641
- },
642
- required: ["q", "topicId"],
643
- response: {
644
- description: "Canonical cross-resource search payload",
645
- fields: {
646
- q: "string \u2014 echoed query text",
647
- topicId: "string \u2014 canonical topic scope",
648
- types: "array \u2014 the resource types included in the search",
649
- results: "array \u2014 ranked mixed resource hits",
650
- beliefs: "array \u2014 grouped belief hits",
651
- evidence: "array \u2014 grouped evidence hits",
652
- questions: "array \u2014 grouped question hits"
653
- }
654
- },
655
- ownerModule: "graph-search",
656
- ontologyPrimitive: "graph",
657
- tier: "workhorse"
658
- };
659
- var FIND_CONTRADICTIONS = {
660
- name: "find_contradictions",
661
- description: "Find contradictions in the reasoning graph \u2014 beliefs that are in tension with each other. Like a merge conflict in `git` \u2014 surfaces incompatible states that require explicit resolution. Contradictions are first-class objects that may remain permanently unresolved. They can block judgments, trigger forks, or collapse confidence. Filter by project, status (unresolved, resolved, accepted), and severity.",
662
- parameters: {
663
- topicId: { type: "string", description: "Filter by topic" },
664
- nodeId: {
665
- type: "string",
666
- description: "Find contradictions involving a specific belief"
667
- },
668
- status: {
669
- type: "string",
670
- description: "Filter by status",
671
- enum: ["unresolved", "resolved", "accepted"]
672
- }
673
- },
674
- required: [],
675
- response: {
676
- description: "Contradiction objects",
677
- fields: {
678
- contradictions: "array \u2014 { beliefA, beliefB, description, severity, status, defeatType }"
679
- }
680
- },
681
- ownerModule: "graph-search",
682
- ontologyPrimitive: "belief",
683
- tier: "showcase"
684
- };
685
- var CREATE_EDGE = {
686
- name: "create_edge",
687
- 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).",
688
- parameters: {
689
- sourceId: {
690
- type: "string",
691
- description: "Source node of the relationship"
692
- },
693
- targetId: {
694
- type: "string",
695
- description: "Target node of the relationship"
696
- },
697
- edgeType: {
698
- type: "string",
699
- description: "Relationship type (informs, tests, depends_on, supersedes, etc.)"
700
- },
701
- weight: {
702
- type: "number",
703
- description: "Edge weight: -1.0 to +1.0 for informs edges, 0-1 for structural"
704
- },
705
- reasoning: { type: "string", description: "Why this relationship exists" },
706
- reasoningMethod: {
707
- type: "string",
708
- description: "How this was determined",
709
- enum: ["deductive", "inductive", "abductive", "analogical", "empirical"]
710
- }
711
- },
712
- required: ["sourceId", "targetId", "edgeType"],
713
- response: {
714
- description: "The created edge",
715
- fields: {
716
- globalId: "string \u2014 edge identifier",
717
- edgeType: "string",
718
- fromLayer: "string",
719
- toLayer: "string"
720
- }
721
- },
722
- ownerModule: "graph-primitives",
723
- ontologyPrimitive: "edge",
724
- tier: "showcase"
725
- };
726
- var RECORD_JUDGMENT = {
727
- name: "record_judgment",
728
- 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).",
729
- parameters: {
730
- title: { type: "string", description: "Short judgment statement" },
731
- rationale: {
732
- type: "string",
733
- description: "Full reasoning behind the judgment"
734
- },
735
- topicId: { type: "string", description: "Topic scope" },
736
- beliefIds: {
737
- type: "array",
738
- description: "Beliefs that warrant this judgment"
739
- },
740
- confidence: {
741
- type: "number",
742
- description: "Confidence in the judgment (0-1)"
743
- }
744
- },
745
- required: ["title", "rationale", "topicId"],
746
- response: {
747
- description: "The recorded judgment",
748
- fields: {
749
- judgmentId: "string",
750
- title: "string",
751
- status: "string \u2014 'issued'"
752
- }
753
- },
754
- ownerModule: "decision-state",
755
- ontologyPrimitive: "judgment",
756
- tier: "showcase"
757
- };
758
- var CREATE_LENS = {
759
- name: "create_lens",
760
- description: "Create a reusable lens that overlays a workspace topic with a specific analytical perspective. Like `git branch <name>` for operational scaffolding \u2014 a lens persists across worktrees and carries prompts, workflows, and task templates. Multiple topics in the same workspace can reuse the same lens.",
761
- parameters: {
762
- name: {
763
- type: "string",
764
- description: "Lens name (e.g., 'market dynamics', 'team quality')"
765
- },
766
- workspaceId: {
767
- type: "string",
768
- description: "Workspace scope for the lens. Required unless topicId resolves to a workspace-scoped topic."
769
- },
770
- topicId: {
771
- type: "string",
772
- description: "Optional originating topic scope. Lenses remain reusable across topics even when this is set."
773
- },
774
- description: {
775
- type: "string",
776
- description: "What this lens is designed to investigate or monitor"
777
- },
778
- perspectiveType: {
779
- type: "string",
780
- description: "Perspective type for the lens. Validated against schemaEnumConfig category 'lens_perspective_type'.",
781
- enum: [...LENS_PERSPECTIVE_TYPES]
782
- },
783
- promptTemplates: {
784
- type: "array",
785
- description: "Langfuse prompt references used when operating through this lens"
786
- },
787
- workflowTemplates: {
788
- type: "array",
789
- description: "Guided workflow templates for lens-driven investigations"
790
- },
791
- taskTemplates: {
792
- type: "array",
793
- description: "Default task templates instantiated when the lens is applied"
794
- },
795
- filterCriteria: {
796
- type: "object",
797
- description: "Belief/evidence filtering rules applied by the lens"
798
- }
799
- },
800
- required: ["name", "perspectiveType"],
801
- response: {
802
- description: "The created lens",
803
- fields: {
804
- lensId: "string",
805
- name: "string",
806
- workspaceId: "string",
807
- status: "string \u2014 'active'"
808
- }
809
- },
810
- ownerModule: "schema-management",
811
- ontologyPrimitive: "lens",
812
- tier: "showcase"
813
- };
814
- var LIST_LENSES = {
815
- name: "list_lenses",
816
- description: "List reusable lenses for a workspace, optionally scored by whether they are active on a topic. Like `git branch --list` \u2014 shows the available named frames you can activate. When topicId is provided, the response can indicate which lenses are already applied there.",
817
- parameters: {
818
- workspaceId: {
819
- type: "string",
820
- description: "Workspace scope to list lenses from"
821
- },
822
- topicId: {
823
- type: "string",
824
- description: "Optional topic scope used to derive workspace and annotate applied lenses"
825
- },
826
- status: {
827
- type: "string",
828
- description: "Filter by lens lifecycle status",
829
- enum: ["draft", "active", "archived"]
830
- },
831
- perspectiveType: {
832
- type: "string",
833
- description: "Filter by perspective type",
834
- enum: [...LENS_PERSPECTIVE_TYPES]
835
- }
836
- },
837
- required: [],
838
- response: {
839
- description: "Available lenses",
840
- fields: {
841
- lenses: "array \u2014 each item includes lensId, name, workspaceId, perspectiveType, status, and optional isAppliedToTopic"
842
- }
843
- },
844
- ownerModule: "schema-management",
845
- ontologyPrimitive: "lens",
846
- tier: "workhorse"
847
- };
848
- var APPLY_LENS_TO_TOPIC = {
849
- name: "apply_lens_to_topic",
850
- description: "Apply a lens to a topic so it becomes an active perspective overlay. Like `git checkout <branch>` for a reusable frame \u2014 the topic keeps its knowledge, but the active lens shapes guidance and retrieval. Multiple active lenses can coexist on the same topic.",
851
- parameters: {
852
- lensId: { type: "string", description: "Lens to activate on the topic" },
853
- topicId: { type: "string", description: "Topic that should receive the lens" }
854
- },
855
- required: ["lensId", "topicId"],
856
- response: {
857
- description: "Lens activation result",
858
- fields: {
859
- bindingId: "string",
860
- lensId: "string",
861
- topicId: "string",
862
- status: "string \u2014 'active'"
863
- }
864
- },
865
- ownerModule: "schema-management",
866
- ontologyPrimitive: "lens",
867
- tier: "workhorse"
868
- };
869
- var REMOVE_LENS_FROM_TOPIC = {
870
- name: "remove_lens_from_topic",
871
- description: "Remove an active lens overlay from a topic. Like `git switch` away from a frame \u2014 the topic remains, but the lens stops shaping the investigation context. Historical binding state is preserved for auditability.",
872
- parameters: {
873
- lensId: { type: "string", description: "Lens to remove from the topic" },
874
- topicId: { type: "string", description: "Topic that currently has the lens applied" }
875
- },
876
- required: ["lensId", "topicId"],
877
- response: {
878
- description: "Lens removal result",
879
- fields: {
880
- bindingId: "string",
881
- lensId: "string",
882
- topicId: "string",
883
- status: "string \u2014 'removed'"
884
- }
885
- },
886
- ownerModule: "schema-management",
887
- ontologyPrimitive: "lens",
888
- tier: "workhorse"
889
- };
890
- var PUSH = {
891
- name: "push",
892
- description: "Push scored beliefs from a merged worktree to other contexts. Like `git push` \u2014 makes local findings available on the remote. Only merged beliefs can be pushed. Publication makes findings visible to other projects, teams, or external consumers.",
893
- parameters: {
894
- worktreeId: {
895
- type: "string",
896
- description: "The merged worktree whose findings to push"
897
- },
898
- targetContext: {
899
- type: "string",
900
- description: "Where to push (e.g., 'portfolio', 'ic_review', 'external')"
901
- },
902
- beliefIds: {
903
- type: "array",
904
- description: "Optional subset of beliefs to push (default: all scored)"
905
- }
906
- },
907
- required: ["worktreeId", "targetContext"],
908
- response: {
909
- description: "Push result",
910
- fields: {
911
- pushedCount: "number",
912
- targetContext: "string",
913
- pushedAt: "number"
914
- }
915
- },
916
- ownerModule: "workflow-engine",
917
- ontologyPrimitive: "worktree",
918
- tier: "workhorse"
919
- };
920
- var OPEN_PULL_REQUEST = {
921
- name: "open_pull_request",
922
- description: "Open a pull request for peer review before merging a worktree. Like opening a `git pull request` \u2014 the worktree's findings are ready but await approval before merge. Reviewers can approve, request changes, or block the merge. This is the gate between draft work and scored knowledge.",
923
- parameters: {
924
- worktreeId: {
925
- type: "string",
926
- description: "The worktree to submit for review"
927
- },
928
- reviewers: {
929
- type: "array",
930
- description: "User IDs of requested reviewers"
931
- },
932
- summary: {
933
- type: "string",
934
- description: "Summary of findings and why they're ready for merge"
935
- }
936
- },
937
- required: ["worktreeId", "summary"],
938
- response: {
939
- description: "The pull request",
940
- fields: {
941
- pullRequestId: "string",
942
- worktreeId: "string",
943
- status: "string \u2014 'pending_review'"
944
- }
945
- },
946
- ownerModule: "workflow-engine",
947
- ontologyPrimitive: "worktree",
948
- tier: "showcase"
949
- };
950
- var BISECT_CONFIDENCE = {
951
- name: "bisect_confidence",
952
- description: "Find when a belief's confidence diverged from reality. Like `git bisect` \u2014 binary search through the credence history to find the inflection point. Given a belief that is now known to be wrong (or right), traces back through confidence modulations to identify which evidence or event caused the divergence.",
953
- parameters: {
954
- nodeId: { type: "string", description: "The belief to bisect" },
955
- expectedDirection: {
956
- type: "string",
957
- description: "Was confidence too high or too low?",
958
- enum: ["overconfident", "underconfident"]
959
- },
960
- timeRange: {
961
- type: "object",
962
- description: "Optional time range to search within: { start: number, end: number }"
963
- }
964
- },
965
- required: ["nodeId", "expectedDirection"],
966
- response: {
967
- description: "The inflection point in confidence history",
968
- fields: {
969
- beliefId: "string \u2014 canonical belief ID",
970
- expectedDirection: "string \u2014 overconfident | underconfident",
971
- inflectionEntry: "object \u2014 the confidence modulation where divergence began",
972
- triggerEvent: "string | null \u2014 what caused the divergence",
973
- confidenceBefore: "number | null",
974
- confidenceAfter: "number | null",
975
- totalEntries: "number",
976
- inflectionIndex: "number | null"
977
- }
978
- },
979
- ownerModule: "graph-search",
980
- ontologyPrimitive: "belief",
981
- tier: "showcase"
982
- };
983
- var DETECT_CONFIRMATION_BIAS = {
984
- name: "detect_confirmation_bias",
985
- description: "Detect confirmation bias in the evidence graph. Like `git diff --stat` for reasoning \u2014 analyzes the ratio of supporting vs challenging evidence per belief and flags beliefs where the evidence is suspiciously one-sided. Returns risk classification (critical/high/moderate/healthy).",
986
- parameters: {
987
- topicId: { type: "string", description: "Topic to analyze" },
988
- threshold: {
989
- type: "number",
990
- description: "Bias threshold (0-1, default 0.7)"
991
- }
992
- },
993
- required: ["topicId"],
994
- response: {
995
- description: "Beliefs with bias scores, risk levels, and evidence counts",
996
- fields: {
997
- beliefs: "array \u2014 { nodeId, biasScore, riskLevel, supportingCount, challengingCount }"
998
- }
999
- },
1000
- ownerModule: "graph-search",
1001
- ontologyPrimitive: "graph",
1002
- tier: "showcase"
1003
- };
1004
- var GET_GRAPH_STRUCTURE_ANALYSIS = {
1005
- name: "get_graph_structure_analysis",
1006
- description: "Run comprehensive structural analysis on the knowledge graph. Like `git fsck` combined with PageRank \u2014 runs 14 algorithmic detectors including PageRank centrality, Louvain community detection, Tarjan SCC, Fiedler vector spectral analysis, Bayesian surprise, and overconfidence detection.",
1007
- parameters: {
1008
- topicId: { type: "string", description: "Topic to analyze" }
1009
- },
1010
- required: ["topicId"],
1011
- response: {
1012
- description: "Structural analysis with detector results and recommendations",
1013
- fields: {
1014
- topicId: "string \u2014 canonical topic scope",
1015
- metric: "string \u2014 analysis metric identifier",
1016
- payload: "object \u2014 detector results, recommendations, graph metrics"
1017
- }
1018
- },
1019
- ownerModule: "graph-search",
1020
- ontologyPrimitive: "graph",
1021
- tier: "showcase"
1022
- };
1023
- var GET_FALSIFICATION_QUESTIONS = {
1024
- name: "get_falsification_questions",
1025
- description: "Generate Popperian falsification questions for beliefs. Like `git test` \u2014 identifies the questions most likely to disprove current beliefs. Karl Popper as a tool: surfaces what would need to be true to invalidate each belief.",
1026
- parameters: {
1027
- topicId: { type: "string", description: "Topic to analyze" },
1028
- beliefIds: { type: "array", description: "Specific beliefs to target" }
1029
- },
1030
- required: ["topicId"],
1031
- response: {
1032
- description: "Questions with falsification potential scores and target beliefs",
1033
- fields: {
1034
- questions: "array \u2014 { questionText, falsificationPotential, targetBeliefId, targetBeliefText }"
1035
- }
1036
- },
1037
- ownerModule: "graph-search",
1038
- ontologyPrimitive: "question",
1039
- tier: "showcase"
1040
- };
1041
- var SEARCH_SOURCES = {
1042
- name: "search_sources",
1043
- description: "Search and ingest external sources into the knowledge graph. Like `git fetch` \u2014 pulls information from external sources (web, documents, APIs) and stages it for evidence creation. Does not commit \u2014 you decide what becomes evidence.",
1044
- parameters: {
1045
- query: { type: "string", description: "Search query" },
1046
- sources: {
1047
- type: "array",
1048
- description: "Source types to search: web, news, academic"
1049
- }
1050
- },
1051
- required: ["query"],
1052
- response: {
1053
- description: "Results with source metadata, relevance scores, and suggested evidence",
1054
- fields: {
1055
- results: "array \u2014 { title, url, snippet, relevanceScore, suggestedEvidence }"
1056
- }
1057
- },
1058
- ownerModule: "research-engine",
1059
- ontologyPrimitive: "source",
1060
- tier: "showcase"
1061
- };
1062
- var EXECUTE_DEEP_RESEARCH = {
1063
- name: "execute_deep_research",
1064
- description: "Execute multi-source deep research on a topic. Like `git submodule update --recursive` \u2014 launches a comprehensive research agent that searches multiple sources, synthesizes findings, and produces a structured report. Auto-links results to relevant questions and beliefs.",
1065
- parameters: {
1066
- query: { type: "string", description: "Research question or topic" },
1067
- topicId: { type: "string", description: "Topic scope" },
1068
- depth: {
1069
- type: "string",
1070
- description: "Research depth: quick, standard, deep",
1071
- enum: ["quick", "standard", "deep"]
1072
- }
1073
- },
1074
- required: ["query", "topicId"],
1075
- response: {
1076
- description: "Report with findings, sources, auto-linked evidence and questions",
1077
- fields: {
1078
- report: "object \u2014 { summary, findings, sources, linkedEvidence, linkedQuestions }"
1079
- }
1080
- },
1081
- ownerModule: "research-engine",
1082
- ontologyPrimitive: "source",
1083
- tier: "showcase"
1084
- };
1085
- var SEARCH_EVIDENCE = {
1086
- name: "search_evidence",
1087
- description: "Search for evidence across the reasoning graph. Like `git grep` \u2014 returns the evidence records that best match a textual query. Results share the same canonical semantics as the HTTP and SDK evidence search surface.",
1088
- parameters: {
1089
- q: { type: "string", description: "Search text" },
1090
- topicId: { type: "string", description: "Topic scope filter" },
1091
- targetId: {
1092
- type: "string",
1093
- description: "Optional belief or question identifier to scope the search"
1094
- },
1095
- limit: { type: "number", description: "Max results" },
1096
- cursor: { type: "string", description: "Pagination cursor" }
1097
- },
1098
- required: ["q"],
1099
- response: {
1100
- description: "Canonical evidence search results page",
1101
- fields: {
1102
- results: "array \u2014 { evidenceId, nodeId, globalId?, text, source?, kind?, relevanceScore }",
1103
- nextCursor: "string | null"
1104
- }
1105
- },
1106
- ownerModule: "graph-search",
1107
- ontologyPrimitive: "evidence",
1108
- tier: "workhorse"
1109
- };
1110
- var CREATE_EVIDENCE = {
1111
- name: "create_evidence",
1112
- 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.",
1113
- parameters: {
1114
- topicId: { type: "string", description: "Topic scope" },
1115
- text: { type: "string", description: "Canonical evidence text" },
1116
- source: { type: "string", description: "Source URL or source label" },
1117
- targetId: {
1118
- type: "string",
1119
- description: "Optional belief or question identifier to link immediately"
1120
- },
1121
- weight: {
1122
- type: "number",
1123
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
1124
- },
1125
- metadata: {
1126
- type: "object",
1127
- description: "Optional metadata merged into the canonical evidence node"
1128
- },
1129
- title: { type: "string", description: "Optional short title" },
1130
- content: { type: "string", description: "Optional long-form content" },
1131
- contentType: {
1132
- type: "string",
1133
- description: "Optional content format or MIME hint"
1134
- },
1135
- kind: { type: "string", description: "Optional evidence kind" }
1136
- },
1137
- required: ["topicId", "text"],
1138
- response: {
1139
- description: "The created canonical evidence record",
1140
- fields: {
1141
- id: "string \u2014 canonical evidence ID",
1142
- nodeId: "string \u2014 canonical evidence ID",
1143
- evidenceId: "string \u2014 canonical evidence ID",
1144
- text: "string",
1145
- topicId: "string"
1146
- }
1147
- },
1148
- ownerModule: "graph-primitives",
1149
- ontologyPrimitive: "evidence",
1150
- tier: "workhorse"
1151
- };
1152
- var GET_EVIDENCE = {
1153
- name: "get_evidence",
1154
- description: "Read one evidence record by ID. Like `git show` \u2014 resolves the canonical evidence payload for a single identifier.",
1155
- parameters: {
1156
- id: { type: "string", description: "Canonical evidence ID" }
1157
- },
1158
- required: ["id"],
1159
- response: {
1160
- description: "The canonical evidence record",
1161
- fields: {
1162
- id: "string \u2014 canonical evidence ID",
1163
- nodeId: "string \u2014 canonical evidence ID",
1164
- evidenceId: "string \u2014 canonical evidence ID",
1165
- text: "string",
1166
- topicId: "string"
1167
- }
1168
- },
1169
- ownerModule: "graph-primitives",
1170
- ontologyPrimitive: "evidence",
1171
- tier: "workhorse"
1172
- };
1173
- var LIST_EVIDENCE = {
1174
- name: "list_evidence",
1175
- description: "List evidence records within a topic or linked to a target. Like `git log -- path` \u2014 returns the canonical evidence page for a topic, belief, or question scope.",
1176
- parameters: {
1177
- topicId: { type: "string", description: "Topic scope filter" },
1178
- targetId: {
1179
- type: "string",
1180
- description: "Optional belief or question identifier to scope by linkage"
1181
- },
1182
- limit: { type: "number", description: "Max results" },
1183
- cursor: { type: "string", description: "Pagination cursor" }
1184
- },
1185
- required: [],
1186
- response: {
1187
- description: "Canonical evidence page",
1188
- fields: {
1189
- evidence: "array \u2014 canonical evidence records",
1190
- nextCursor: "string | null"
1191
- }
1192
- },
1193
- ownerModule: "graph-primitives",
1194
- ontologyPrimitive: "evidence",
1195
- tier: "workhorse"
1196
- };
1197
- var LINK_EVIDENCE = {
1198
- name: "link_evidence",
1199
- description: "Link evidence to a belief or question. Like `git notes add` \u2014 attaches a supporting or contradicting edge without rewriting the evidence itself.",
1200
- parameters: {
1201
- evidenceId: { type: "string", description: "Canonical evidence ID" },
1202
- targetId: {
1203
- type: "string",
1204
- description: "Canonical belief or question ID"
1205
- },
1206
- weight: {
1207
- type: "number",
1208
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
1209
- },
1210
- rationale: { type: "string", description: "Why this link exists" }
1211
- },
1212
- required: ["evidenceId", "targetId"],
1213
- response: {
1214
- description: "The created canonical evidence edge summary",
1215
- fields: {
1216
- edgeId: "string",
1217
- evidenceId: "string",
1218
- targetId: "string",
1219
- targetType: "string \u2014 belief | question",
1220
- weight: "number"
1221
- }
1222
- },
1223
- ownerModule: "graph-primitives",
1224
- ontologyPrimitive: "edge",
1225
- tier: "workhorse"
1226
- };
1227
- var LINK_EVIDENCE_TO_BELIEF = {
1228
- name: "link_evidence_to_belief",
1229
- 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).",
1230
- parameters: {
1231
- evidenceId: { type: "string", description: "The evidence node ID" },
1232
- beliefId: { type: "string", description: "The belief node ID" },
1233
- weight: {
1234
- type: "number",
1235
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
1236
- },
1237
- rationale: { type: "string", description: "Why this evidence is relevant" }
1238
- },
1239
- required: ["evidenceId", "beliefId", "weight"],
1240
- response: {
1241
- description: "The created edge linking evidence to belief",
1242
- fields: {
1243
- edgeId: "string",
1244
- evidenceId: "string",
1245
- beliefId: "string",
1246
- weight: "number"
1247
- }
1248
- },
1249
- ownerModule: "graph-primitives",
1250
- ontologyPrimitive: "edge",
1251
- tier: "workhorse"
1252
- };
1253
- var CREATE_QUESTION = {
1254
- name: "create_question",
1255
- description: "Commit an investigation question to the reasoning graph. Like `git issue` \u2014 creates a traceable question that drives research and evidence collection. Questions test beliefs and guide worktree investigation.",
1256
- parameters: {
1257
- text: { type: "string", description: "The question text" },
1258
- topicId: { type: "string", description: "Topic scope" },
1259
- priority: {
1260
- type: "string",
1261
- description: "Priority: urgent, high, medium, low",
1262
- enum: ["urgent", "high", "medium", "low"]
1263
- },
1264
- linkedBeliefId: {
1265
- type: "string",
1266
- description: "Belief this question tests"
1267
- },
1268
- metadata: {
1269
- type: "object",
1270
- description: "Optional metadata merged into the question record"
1271
- }
1272
- },
1273
- required: ["text", "topicId"],
1274
- response: {
1275
- description: "The created canonical question record",
1276
- fields: {
1277
- id: "string \u2014 canonical question ID",
1278
- nodeId: "string \u2014 canonical question ID",
1279
- questionId: "string \u2014 canonical question ID",
1280
- text: "string",
1281
- status: "string"
1282
- }
1283
- },
1284
- ownerModule: "graph-primitives",
1285
- ontologyPrimitive: "question",
1286
- tier: "workhorse"
1287
- };
1288
- var GET_QUESTION = {
1289
- name: "get_question",
1290
- description: "Read one question by ID. Like `git show` \u2014 resolves the canonical question payload for a single identifier.",
1291
- parameters: {
1292
- id: { type: "string", description: "Canonical question ID" }
1293
- },
1294
- required: ["id"],
1295
- response: {
1296
- description: "The canonical question record",
1297
- fields: {
1298
- id: "string \u2014 canonical question ID",
1299
- nodeId: "string \u2014 canonical question ID",
1300
- questionId: "string \u2014 canonical question ID",
1301
- text: "string",
1302
- status: "string"
1303
- }
1304
- },
1305
- ownerModule: "graph-primitives",
1306
- ontologyPrimitive: "question",
1307
- tier: "workhorse"
1308
- };
1309
- var REFINE_QUESTION = {
1310
- name: "refine_question",
1311
- description: "Refine a question's framing or scope. Like `git commit --amend` for questions \u2014 updates the question text while preserving its identity and linked evidence.",
1312
- parameters: {
1313
- id: { type: "string", description: "The question to refine" },
1314
- text: { type: "string", description: "Updated question text" },
1315
- rationale: {
1316
- type: "string",
1317
- description: "Why the question is being refined"
1318
- }
1319
- },
1320
- required: ["id", "text"],
1321
- response: {
1322
- description: "The refined question",
1323
- fields: {
1324
- id: "string",
1325
- questionId: "string",
1326
- updatedText: "string",
1327
- previousText: "string"
1328
- }
1329
- },
1330
- ownerModule: "graph-primitives",
1331
- ontologyPrimitive: "question",
1332
- tier: "workhorse"
1333
- };
1334
- var LIST_QUESTIONS = {
1335
- name: "list_questions",
1336
- description: "List questions scoped to a topic or worktree. Like `git issue list` \u2014 returns questions with their status, priority, and linked belief context. Supports filtering by status and priority.",
1337
- parameters: {
1338
- topicId: { type: "string", description: "Topic scope" },
1339
- worktreeId: { type: "string", description: "Filter to worktree scope" },
1340
- status: {
1341
- type: "string",
1342
- description: "Filter by canonical question status",
1343
- enum: ["open", "researching", "answered", "parked", "closed"]
1344
- },
1345
- priority: {
1346
- type: "string",
1347
- description: "Filter by canonical question priority",
1348
- enum: ["urgent", "high", "medium", "low"]
1349
- },
1350
- limit: { type: "number", description: "Max results" },
1351
- cursor: { type: "string", description: "Pagination cursor" }
1352
- },
1353
- required: ["topicId"],
1354
- response: {
1355
- description: "Canonical question page",
1356
- fields: {
1357
- questions: "array \u2014 canonical question records",
1358
- nextCursor: "string | null"
1359
- }
1360
- },
1361
- ownerModule: "graph-primitives",
1362
- ontologyPrimitive: "question",
1363
- tier: "workhorse"
1364
- };
1365
- var ANSWER_QUESTION = {
1366
- name: "answer_question",
1367
- description: "Answer a question with optional evidence links. Like `git commit` on the question thread \u2014 records the answer and closes the loop with a canonical answered state.",
1368
- parameters: {
1369
- id: { type: "string", description: "Canonical question ID" },
1370
- text: { type: "string", description: "Answer text" },
1371
- confidence: {
1372
- type: "string",
1373
- description: "Optional answer confidence",
1374
- enum: ["weak", "medium", "strong"]
1375
- },
1376
- evidenceIds: {
1377
- type: "array",
1378
- description: "Optional canonical evidence IDs supporting the answer"
1379
- },
1380
- rationale: { type: "string", description: "Why this answer is credible" }
1381
- },
1382
- required: ["id", "text"],
1383
- response: {
1384
- description: "Answer result",
1385
- fields: {
1386
- questionId: "string",
1387
- answerId: "string",
1388
- status: "string \u2014 answered"
1389
- }
1390
- },
1391
- ownerModule: "graph-primitives",
1392
- ontologyPrimitive: "question",
1393
- tier: "workhorse"
1394
- };
1395
- var UPDATE_QUESTION_STATUS = {
1396
- name: "update_question_status",
1397
- description: "Transition a question's status through its lifecycle. Like `git issue update` \u2014 moves a question through the canonical reasoning lifecycle. Status transitions preserve history and keep linked evidence intact.",
1398
- parameters: {
1399
- id: { type: "string", description: "The question to update" },
1400
- status: {
1401
- type: "string",
1402
- description: "New status",
1403
- enum: ["open", "researching", "answered", "parked", "closed"]
1404
- },
1405
- rationale: { type: "string", description: "Why the status is changing" }
1406
- },
1407
- required: ["id", "status"],
1408
- response: {
1409
- description: "Updated question status",
1410
- fields: {
1411
- id: "string",
1412
- questionId: "string",
1413
- previousStatus: "string",
1414
- newStatus: "string"
1415
- }
1416
- },
1417
- ownerModule: "graph-primitives",
1418
- ontologyPrimitive: "question",
1419
- tier: "workhorse"
1420
- };
1421
- var ARCHIVE_QUESTION = {
1422
- name: "archive_question",
1423
- description: "Archive a question no longer relevant to current investigation scope. Like `git issue close` \u2014 removes it from active work while preserving audit history. Archived questions keep their existing links to beliefs and evidence.",
1424
- parameters: {
1425
- questionId: { type: "string", description: "The question to archive" },
1426
- reason: {
1427
- type: "string",
1428
- description: "Why the question is being archived"
1429
- }
1430
- },
1431
- required: ["questionId"],
1432
- response: {
1433
- description: "Archive confirmation",
1434
- fields: {
1435
- questionId: "string",
1436
- status: "string \u2014 'archived'",
1437
- archivedAt: "number"
1438
- }
1439
- },
1440
- ownerModule: "graph-primitives",
1441
- ontologyPrimitive: "question",
1442
- tier: "workhorse"
1443
- };
1444
- var LINK_EVIDENCE_TO_QUESTION = {
1445
- name: "link_evidence_to_question",
1446
- description: "Link evidence to the question it helps answer. Like `git notes add` \u2014 attaches supporting detail to an active question. Question-level links improve answer quality and traceability to beliefs.",
1447
- parameters: {
1448
- evidenceId: { type: "string", description: "The evidence to link" },
1449
- questionId: {
1450
- type: "string",
1451
- description: "The question this evidence addresses"
1452
- },
1453
- relevance: { type: "number", description: "Relevance score in [0,1]" },
1454
- rationale: {
1455
- type: "string",
1456
- description: "How this evidence bears on the question"
1457
- }
1458
- },
1459
- required: ["evidenceId", "questionId"],
1460
- response: {
1461
- description: "The created edge",
1462
- fields: {
1463
- edgeId: "string",
1464
- evidenceId: "string",
1465
- questionId: "string",
1466
- relevance: "number"
1467
- }
1468
- },
1469
- ownerModule: "graph-primitives",
1470
- ontologyPrimitive: "edge",
1471
- tier: "workhorse"
1472
- };
1473
- var CREATE_ANSWER = {
1474
- name: "create_answer",
1475
- description: "Create an answer node responding to a question. Like `git commit` for resolved questions \u2014 creates an immutable answer snapshot at L2. New answers supersede old ones, preserving full version history. Answers link to supporting evidence via based_on edges.",
1476
- parameters: {
1477
- questionNodeId: {
1478
- type: "string",
1479
- description: "The question node ID this answers"
1480
- },
1481
- answerText: {
1482
- type: "string",
1483
- description: "The answer content \u2014 the actual response to the question"
1484
- },
1485
- topicId: {
1486
- type: "string",
1487
- description: "Topic scope (optional if question already has topicId)"
1488
- },
1489
- confidence: {
1490
- type: "string",
1491
- description: "Answer confidence: definitive, strong, moderate, weak, speculative"
1492
- },
1493
- evidenceNodeIds: {
1494
- type: "array",
1495
- description: "Supporting evidence node IDs to link via based_on edges"
1496
- },
1497
- answerSource: {
1498
- type: "string",
1499
- description: "How the answer was produced: human, ai_generated, deep_research, synthesis"
1500
- }
1501
- },
1502
- required: ["questionNodeId", "answerText"],
1503
- response: {
1504
- description: "The created answer node with version metadata",
1505
- fields: {
1506
- nodeId: "string \u2014 unique node identifier",
1507
- globalId: "string \u2014 globally unique ID",
1508
- versionNumber: "number \u2014 version of this answer (auto-incremented)",
1509
- questionNodeId: "string \u2014 the question this answers",
1510
- confidence: "string \u2014 answer confidence level"
1511
- }
1512
- },
1513
- ownerModule: "graph-primitives",
1514
- ontologyPrimitive: "evidence",
1515
- tier: "showcase"
1516
- };
1517
- var GET_ANSWER = {
1518
- name: "get_answer",
1519
- description: "Get the latest answer for a question. Like `git show HEAD` for a question's resolution \u2014 returns the active answer snapshot. Returns null if the question is unanswered.",
1520
- parameters: {
1521
- questionNodeId: {
1522
- type: "string",
1523
- description: "The question node ID to get the answer for"
1524
- }
1525
- },
1526
- required: ["questionNodeId"],
1527
- response: {
1528
- description: "The active answer node or null",
1529
- fields: {
1530
- nodeId: "string | null",
1531
- globalId: "string | null",
1532
- answerText: "string | null",
1533
- versionNumber: "number",
1534
- isLatest: "boolean",
1535
- evidenceCount: "number",
1536
- confidence: "string"
1537
- }
1538
- },
1539
- ownerModule: "graph-primitives",
1540
- ontologyPrimitive: "evidence",
1541
- tier: "workhorse"
1542
- };
1543
- var GET_HIGH_PRIORITY_QUESTIONS = {
1544
- name: "get_high_priority_questions",
1545
- description: "Rank open questions by urgency and expected decision impact. Like `git issue list --sort=priority` \u2014 brings the highest-leverage open questions to the top. Ranking accounts for linked belief criticality and evidence gaps.",
1546
- parameters: {
1547
- topicId: { type: "string", description: "Topic scope" },
1548
- limit: { type: "number", description: "Maximum results (default: 20)" },
1549
- includeAnswered: {
1550
- type: "boolean",
1551
- description: "Include answered questions (default: false)"
1552
- }
1553
- },
1554
- required: ["topicId"],
1555
- response: {
1556
- description: "Priority-ranked questions",
1557
- fields: {
1558
- questions: "array \u2014 { questionId, text, priority, urgencyScore, linkedBeliefCount, evidenceGapCount }"
1559
- }
1560
- },
1561
- ownerModule: "graph-search",
1562
- ontologyPrimitive: "question",
1563
- tier: "workhorse"
1564
- };
1565
- var FIND_MISSING_QUESTIONS = {
1566
- name: "find_missing_questions",
1567
- description: "Identify beliefs missing testing questions. Like `git diff --check` \u2014 surfaces reasoning coverage gaps before merge. Returns candidate beliefs that need explicit question coverage.",
1568
- parameters: {
1569
- topicId: { type: "string", description: "Topic scope" },
1570
- minConfidence: {
1571
- type: "number",
1572
- description: "Only check beliefs above this confidence (default: 0)"
1573
- }
1574
- },
1575
- required: ["topicId"],
1576
- response: {
1577
- description: "Beliefs missing testing questions",
1578
- fields: {
1579
- gaps: "array \u2014 { beliefId, canonicalText, confidence, suggestedQuestions }",
1580
- totalGaps: "number"
1581
- }
1582
- },
1583
- ownerModule: "graph-search",
1584
- ontologyPrimitive: "question",
1585
- tier: "workhorse"
1586
- };
1587
- var LIST_BELIEFS = {
1588
- name: "list_beliefs",
1589
- description: "List beliefs scoped to a topic or worktree. Like `git log --oneline` \u2014 returns beliefs with their confidence, status, and scoring state. Supports filtering by status and confidence threshold.",
1590
- parameters: {
1591
- topicId: { type: "string", description: "Topic scope" },
1592
- worktreeId: { type: "string", description: "Filter to worktree scope" },
1593
- status: {
1594
- type: "string",
1595
- description: "Filter: unscored, scored, archived",
1596
- enum: ["unscored", "scored", "archived"]
1597
- },
1598
- minConfidence: {
1599
- type: "number",
1600
- description: "Minimum confidence threshold"
1601
- }
1602
- },
1603
- required: ["topicId"],
1604
- response: {
1605
- description: "Canonical belief page",
1606
- fields: {
1607
- beliefs: "array \u2014 canonical belief records",
1608
- nextCursor: "string | null"
1609
- }
1610
- },
1611
- ownerModule: "graph-primitives",
1612
- ontologyPrimitive: "belief",
1613
- tier: "workhorse"
1614
- };
1615
- var LIST_WORKTREES = {
1616
- name: "list_worktrees",
1617
- description: "List all worktrees for a topic. Like `git worktree list` \u2014 shows active and completed investigation branches with their phase, status, and belief counts.",
1618
- parameters: {
1619
- topicId: { type: "string", description: "Topic scope" },
1620
- status: {
1621
- type: "string",
1622
- description: "Filter: active, merged, abandoned",
1623
- enum: ["active", "merged", "abandoned"]
1624
- }
1625
- },
1626
- required: ["topicId"],
1627
- response: {
1628
- description: "Worktrees with phase, status, belief count, and creation time",
1629
- fields: {
1630
- worktrees: "array \u2014 { worktreeId, title, phase, status, beliefCount, createdAt }"
1631
- }
1632
- },
1633
- ownerModule: "workflow-engine",
1634
- ontologyPrimitive: "worktree",
1635
- tier: "workhorse"
1636
- };
1637
- var LIST_ALL_WORKTREES = {
1638
- name: "list_all_worktrees",
1639
- description: "List ALL worktrees across ALL topics in one query. No topic scope required. Like `git worktree list --all` \u2014 returns the complete pipeline inventory with track, trackPosition, executionBand, dependencies, and status. Supports filtering by status, track, and executionBand. This is the PM's primary pipeline query \u2014 one call, full picture.",
1640
- parameters: {
1641
- status: {
1642
- type: "string",
1643
- description: "Filter by status: planning, active, completed, abandoned, superseded, long_term, idea, paused, suggested, dismissed",
1644
- enum: [
1645
- "planning",
1646
- "active",
1647
- "completed",
1648
- "abandoned",
1649
- "superseded",
1650
- "long_term",
1651
- "idea",
1652
- "paused",
1653
- "suggested",
1654
- "dismissed"
1655
- ]
1656
- },
1657
- track: {
1658
- type: "string",
1659
- description: "Filter by track name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity')"
1660
- },
1661
- executionBand: {
1662
- type: "number",
1663
- description: "Filter by execution band number (e.g., 1, 2, 3). Returns only worktrees in that parallel execution group."
1664
- },
1665
- limit: {
1666
- type: "number",
1667
- description: "Maximum results to return (default: 500, max: 1000)"
1668
- }
1669
- },
1670
- required: [],
1671
- response: {
1672
- description: "All worktrees across all topics with full pipeline metadata",
1673
- fields: {
1674
- worktrees: "array \u2014 { worktreeId, title, topicId, topicName, phase, status, hypothesis, track, trackPosition, executionBand, executionOrder, dependsOn, blocks, gate, createdAt }",
1675
- total: "number \u2014 total count after filtering",
1676
- tracks: "object \u2014 { trackName: count } summary of worktrees per track",
1677
- bands: "object \u2014 { bandNumber: count } summary of worktrees per execution band"
1678
- }
1679
- },
1680
- ownerModule: "workflow-engine",
1681
- ontologyPrimitive: "worktree",
1682
- tier: "showcase"
1683
- };
1684
- var ACTIVATE_WORKTREE = {
1685
- name: "activate_worktree",
1686
- description: "Activate a worktree to begin investigation. Like `git checkout <branch>` \u2014 transitions a worktree from planning to active status. Sets the initial phase and enables belief/question editing within the worktree scope.",
1687
- parameters: {
1688
- worktreeId: { type: "string", description: "The worktree to activate" }
1689
- },
1690
- required: ["worktreeId"],
1691
- response: {
1692
- description: "Activation result with initial phase",
1693
- fields: {
1694
- worktreeId: "string",
1695
- status: "string \u2014 'active'",
1696
- phase: "string"
1697
- }
1698
- },
1699
- ownerModule: "workflow-engine",
1700
- ontologyPrimitive: "worktree",
1701
- tier: "workhorse"
1702
- };
1703
- var UPDATE_WORKTREE_TARGETS = {
1704
- name: "update_worktree_targets",
1705
- description: "Update the target beliefs and questions tracked by a worktree. Like `git add/rm <files>` \u2014 stages or unstages beliefs/questions for investigation within the worktree scope. Supports adding and removing targets atomically.",
1706
- parameters: {
1707
- worktreeId: { type: "string", description: "The worktree to update" },
1708
- addBeliefIds: {
1709
- type: "array",
1710
- description: "Belief node IDs to add to the worktree"
1711
- },
1712
- addQuestionIds: {
1713
- type: "array",
1714
- description: "Question node IDs to add to the worktree"
1715
- },
1716
- removeBeliefIds: {
1717
- type: "array",
1718
- description: "Belief node IDs to remove from the worktree"
1719
- },
1720
- removeQuestionIds: {
1721
- type: "array",
1722
- description: "Question node IDs to remove from the worktree"
1723
- }
1724
- },
1725
- required: ["worktreeId"],
1726
- response: {
1727
- description: "Updated target counts",
1728
- fields: {
1729
- worktreeId: "string",
1730
- beliefCount: "number",
1731
- questionCount: "number"
1732
- }
1733
- },
1734
- ownerModule: "workflow-engine",
1735
- ontologyPrimitive: "worktree",
1736
- tier: "workhorse"
1737
- };
1738
- var UPDATE_WORKTREE_METADATA = {
1739
- name: "update_worktree_metadata",
1740
- description: "Update worktree sequencing metadata \u2014 execution order, dependencies, blocking relations, and gates. Like `git config` for a worktree \u2014 sets the scheduling and dependency metadata that determines when this worktree can activate relative to others. Use to backfill or correct sequencing data.",
1741
- parameters: {
1742
- worktreeId: { type: "string", description: "The worktree to update" },
1743
- hypothesis: {
1744
- type: "string",
1745
- description: "Testable claim this worktree investigates"
1746
- },
1747
- executionOrder: {
1748
- type: "number",
1749
- description: "Global execution order (1 = first, higher = later)"
1750
- },
1751
- dependsOn: {
1752
- type: "array",
1753
- description: "Worktree IDs that must complete before this one can activate"
1754
- },
1755
- blocks: {
1756
- type: "array",
1757
- description: "Worktree IDs that are blocked until this one completes"
1758
- },
1759
- gate: {
1760
- type: "string",
1761
- description: "Exit gate name (e.g., 'gate:ontology-schema-hardened')"
1762
- },
1763
- rationale: {
1764
- type: "string",
1765
- description: "Why this worktree is sequenced here"
1766
- },
1767
- objective: {
1768
- type: "string",
1769
- description: "What we're trying to learn/prove"
1770
- },
1771
- proofArtifacts: {
1772
- type: "array",
1773
- description: "Typed proof artifacts that define what evidence or deliverables this worktree must emit before it can claim success."
1774
- },
1775
- staffingHint: {
1776
- type: "string",
1777
- description: "Advisory staffing shape for the worktree (for example `backend+tests` or `fullstack`)."
1778
- },
1779
- lastReconciledAt: {
1780
- type: "number",
1781
- description: "Timestamp of the last deterministic workflow reconciliation pass against this worktree."
1782
- },
1783
- autoFixPolicy: {
1784
- type: "object",
1785
- description: "Calibrated auto-fix policy controlling dry-run vs safe execution, per-run action caps, and permitted mutation tiers."
1786
- },
1787
- track: {
1788
- type: "string",
1789
- description: "Parallel workstream name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity', 'execution-program'). Groups worktrees into named lanes for pipeline visualization and PM analysis."
1790
- },
1791
- trackPosition: {
1792
- type: "number",
1793
- description: "Position within the track (1-indexed). E.g., TC-A=1, TC-B=2, TC-C=3 within the 'tc-scope' track."
1794
- },
1795
- executionBand: {
1796
- type: "number",
1797
- description: "Parallel execution band number. All worktrees in the same band can run simultaneously. Band 2 = OE-B + TC-A, Band 3 = TC-B + 11D-R + S2-13A, etc."
1798
- },
1799
- status: {
1800
- type: "string",
1801
- description: "Override the worktree status. Use for lifecycle transitions like marking a worktree superseded, long-term, or as a raw idea.",
1802
- enum: [
1803
- "suggested",
1804
- "planning",
1805
- "active",
1806
- "paused",
1807
- "completed",
1808
- "dismissed",
1809
- "abandoned",
1810
- "superseded",
1811
- "long_term",
1812
- "idea"
1813
- ]
1814
- },
1815
- topicId: {
1816
- type: "string",
1817
- description: "Reassign this worktree's primary topic. Validates the target topic exists before updating."
1818
- },
1819
- additionalTopicIds: {
1820
- type: "array",
1821
- description: "Set additional topic associations for cross-topic worktrees. Each topic ID is validated before updating. Use when a worktree spans multiple knowledge domains."
1822
- }
1823
- },
1824
- required: ["worktreeId"],
1825
- response: {
1826
- description: "Update confirmation",
1827
- fields: { worktreeId: "string", success: "boolean" }
1828
- },
1829
- ownerModule: "workflow-engine",
1830
- ontologyPrimitive: "worktree",
1831
- tier: "workhorse"
1832
- };
1833
- var IDENTITY_WHOAMI = {
1834
- name: "identity_whoami",
1835
- description: "Read the authenticated identity summary for the current session. Like `git config --get user.name` \u2014 shows who the current MCP session is acting as.",
1836
- parameters: {},
1837
- required: [],
1838
- response: {
1839
- description: "Canonical identity summary for the current session",
1840
- fields: {
1841
- principalId: "string \u2014 canonical federated principal identifier",
1842
- principalType: "string \u2014 human, service, or agent",
1843
- tenantId: "string | undefined \u2014 resolved tenant scope",
1844
- workspaceId: "string | undefined \u2014 resolved workspace scope",
1845
- scopes: "string[] | undefined \u2014 granted scopes for this session",
1846
- roles: "string[] | undefined \u2014 canonical roles for this session"
1847
- }
1848
- },
1849
- ownerModule: "identity-core",
1850
- ontologyPrimitive: "identity",
1851
- tier: "workhorse"
1852
- };
1853
- var COMPILE_CONTEXT = {
1854
- name: "compile_context",
1855
- description: "Compile a focused reasoning context for a topic. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
1856
- parameters: {
1857
- topicId: {
1858
- type: "string",
1859
- description: "Topic scope ID to compile"
1860
- },
1861
- query: {
1862
- type: "string",
1863
- description: "Optional focus query used to rank context items"
1864
- },
1865
- budget: {
1866
- type: "number",
1867
- description: "Token budget for prompt injection planning"
1868
- },
1869
- ranking: {
1870
- type: "string",
1871
- description: "Ranking profile for context ordering",
1872
- enum: ["baseline_v1", "weighted_v1"]
1873
- },
1874
- limit: {
1875
- type: "number",
1876
- description: "Optional per-section item limit"
1877
- },
1878
- maxDepth: {
1879
- type: "number",
1880
- description: "Optional descendant topic depth for neighborhood expansion"
1881
- },
1882
- includeEntities: {
1883
- type: "boolean",
1884
- description: "Include related ontological entities in the compiled result"
1885
- }
1886
- },
1887
- required: ["topicId"],
1888
- response: {
1889
- description: "Compiled context pack for the requested topic",
1890
- fields: {
1891
- schemaVersion: "string",
1892
- topicId: "string",
1893
- topicName: "string",
1894
- scopedTopicIds: "array \u2014 topic IDs included in the compilation neighborhood",
1895
- generatedAt: "number \u2014 deterministic graph-backed reference timestamp for this compilation",
1896
- ranking: "string \u2014 baseline_v1 | weighted_v1",
1897
- summary: "object \u2014 counts and scoped health signals",
1898
- invariants: "array \u2014 high-confidence invariant beliefs",
1899
- activeBeliefs: "array \u2014 current high-signal beliefs",
1900
- openQuestions: "array \u2014 unresolved questions ranked for this query",
1901
- recentEvidence: "array \u2014 recent evidence ranked for this query",
1902
- contradictions: "array \u2014 unresolved contradiction records",
1903
- relatedEntities: "array | undefined \u2014 ranked ontological entities in scope",
1904
- contextNarrative: "array \u2014 guidance for prompt assembly",
1905
- injectionPolicy: "object \u2014 token-budgeted section selections",
1906
- diagnostics: "object \u2014 scoring and utilization telemetry"
1907
- }
1908
- },
1909
- ownerModule: "reasoning-kernel",
1910
- ontologyPrimitive: "graph",
1911
- tier: "showcase"
1912
- };
1913
- var CHECK_PERMISSION = {
1914
- name: "check_permission",
1915
- description: "Check whether a principal can read or mutate a topic scope. Like `git check-ref-format` for ACLs \u2014 validates whether the requested operation is allowed before execution.",
1916
- parameters: {
1917
- topicId: { type: "string", description: "Topic scope to evaluate" },
1918
- permission: {
1919
- type: "string",
1920
- description: "Permission to evaluate",
1921
- enum: ["read", "write"]
1922
- },
1923
- principal: {
1924
- type: "string",
1925
- description: "Optional principal override (defaults to current principal)"
1926
- },
1927
- beliefClusterId: {
1928
- type: "string",
1929
- description: "Optional neighborhood scope within a topic"
1930
- }
1931
- },
1932
- required: ["topicId", "permission"],
1933
- response: {
1934
- description: "Permission evaluation result",
1935
- fields: {
1936
- allowed: "boolean",
1937
- decision: "string \u2014 allow | deny",
1938
- reasonCode: "string",
1939
- principalId: "string",
1940
- topicId: "string",
1941
- permission: "string \u2014 read | write"
1942
- }
1943
- },
1944
- ownerModule: "access-control",
1945
- ontologyPrimitive: "policy",
1946
- tier: "workhorse"
1947
- };
1948
- var FILTER_BY_PERMISSION = {
1949
- name: "filter_by_permission",
1950
- description: "Filter a topic set down to ACL-authorized topics. Like `git rev-list --ancestry-path` for policy boundaries \u2014 keeps only topics permitted for the requested action.",
1951
- parameters: {
1952
- topicIds: { type: "array", description: "Topic IDs to evaluate" },
1953
- permission: {
1954
- type: "string",
1955
- description: "Permission filter",
1956
- enum: ["read", "write"]
1957
- },
1958
- principal: {
1959
- type: "string",
1960
- description: "Optional principal override (tenant admin only)"
1961
- }
1962
- },
1963
- required: ["topicIds", "permission"],
1964
- response: {
1965
- description: "Allowed/denied split for the requested topic set",
1966
- fields: {
1967
- permission: "string \u2014 read | write",
1968
- allowedTopicIds: "array \u2014 topic IDs allowed by policy",
1969
- deniedTopics: "array \u2014 { topicId, reasonCode }",
1970
- count: "number"
1971
- }
1972
- },
1973
- ownerModule: "access-control",
1974
- ontologyPrimitive: "policy",
1975
- tier: "workhorse"
1976
- };
1977
- var INGEST_OBSERVATION = {
1978
- name: "ingest_observation",
1979
- description: "Record an observational delta for a topic context stream. Like `git notes add` \u2014 attaches structured observation metadata without mutating graph state directly. Used by watcher/cowork agents to stage candidate updates before explicit write confirmation.",
1980
- parameters: {
1981
- topicId: {
1982
- type: "string",
1983
- description: "Topic scope for the observation"
1984
- },
1985
- observationType: {
1986
- type: "string",
1987
- description: "Observation class",
1988
- enum: [
1989
- "claim",
1990
- "evidence",
1991
- "question",
1992
- "contradiction",
1993
- "judgment",
1994
- "note"
1995
- ]
1996
- },
1997
- summary: {
1998
- type: "string",
1999
- description: "Human-readable observation summary"
2000
- },
2001
- source: {
2002
- type: "string",
2003
- description: "Optional source (message ID, tool name, URL, etc.)"
2004
- },
2005
- confidence: { type: "number", description: "Optional confidence in [0,1]" },
2006
- tags: { type: "array", description: "Optional observation tags" },
2007
- metadata: {
2008
- type: "object",
2009
- description: "Optional structured metadata payload"
2010
- }
2011
- },
2012
- required: ["topicId", "observationType", "summary"],
2013
- response: {
2014
- description: "Recorded observation entry",
2015
- fields: {
2016
- observationId: "string",
2017
- topicId: "string",
2018
- observationType: "string",
2019
- createdAt: "number",
2020
- contextResourceUri: "string"
2021
- }
2022
- },
2023
- ownerModule: "agent-harness",
2024
- ontologyPrimitive: "graph",
2025
- tier: "workhorse"
2026
- };
2027
- var GET_OBSERVATION_CONTEXT = {
2028
- name: "get_observation_context",
2029
- description: "Retrieve observer-ready context for a topic, including recent deltas and semantic matches. Like `git log --grep` \u2014 shows recent context and filtered matches across observation history. This powers prompt context injection without mutating graph state.",
2030
- parameters: {
2031
- topicId: { type: "string", description: "Topic scope" },
2032
- query: {
2033
- type: "string",
2034
- description: "Optional semantic query over observation history"
2035
- },
2036
- limit: {
2037
- type: "number",
2038
- description: "Maximum entries in each returned collection"
2039
- }
2040
- },
2041
- required: ["topicId"],
2042
- response: {
2043
- description: "Observation context payload",
2044
- fields: {
2045
- topicId: "string",
2046
- totalObservations: "number",
2047
- latest: "array",
2048
- semanticMatches: "array",
2049
- byType: "object",
2050
- generatedAt: "number"
2051
- }
2052
- },
2053
- ownerModule: "agent-harness",
2054
- ontologyPrimitive: "graph",
2055
- tier: "workhorse"
2056
- };
2057
- var CREATE_TASK = {
2058
- name: "create_task",
2059
- description: "Create an execution task tied to the reasoning state. Like `git task` \u2014 tracks concrete work items (calls to make, data to gather, analyses to run) linked to questions, beliefs, or worktrees.",
2060
- parameters: {
2061
- title: { type: "string", description: "Task description" },
2062
- topicId: { type: "string", description: "Topic scope" },
2063
- taskType: {
2064
- type: "string",
2065
- description: "Type: research, interview, analysis, data_collection",
2066
- enum: ["research", "interview", "analysis", "data_collection"]
2067
- },
2068
- linkedQuestionId: {
2069
- type: "string",
2070
- description: "Question this task addresses"
2071
- },
2072
- linkedWorktreeId: { type: "string", description: "Worktree scope" }
2073
- },
2074
- required: ["title", "topicId"],
2075
- response: {
2076
- description: "The created task",
2077
- fields: {
2078
- taskId: "string",
2079
- status: "string \u2014 'pending'",
2080
- createdAt: "number"
2081
- }
2082
- },
2083
- ownerModule: "workflow-engine",
2084
- ontologyPrimitive: "task",
2085
- tier: "workhorse"
2086
- };
2087
- var COMPLETE_TASK = {
2088
- name: "complete_task",
2089
- description: "Mark a task as complete with an output summary. Like `git tag` for work items \u2014 records the discrete completion event and captures what was learned. Completed tasks feed back into the evidence graph.",
2090
- parameters: {
2091
- taskId: { type: "string", description: "The task to complete" },
2092
- outputSummary: {
2093
- type: "string",
2094
- description: "What was accomplished or learned"
2095
- },
2096
- evidenceCreated: {
2097
- type: "boolean",
2098
- description: "Whether new evidence was created from this task"
2099
- }
2100
- },
2101
- required: ["taskId", "outputSummary"],
2102
- response: {
2103
- description: "The completed task",
2104
- fields: {
2105
- taskId: "string",
2106
- completedAt: "number",
2107
- outputSummary: "string"
2108
- }
2109
- },
2110
- ownerModule: "workflow-engine",
2111
- ontologyPrimitive: "task",
2112
- tier: "workhorse"
2113
- };
2114
- var UPDATE_TASK = {
2115
- name: "update_task",
2116
- description: "Update a task's fields \u2014 relink to a different worktree, belief, or question, change title/priority/status. Like `git task edit` \u2014 mutates an existing task in place instead of requiring recreate-plus-supersede.",
2117
- parameters: {
2118
- taskId: { type: "string", description: "The task to update" },
2119
- linkedWorktreeId: {
2120
- type: "string",
2121
- description: "Reassign this task to a different worktree"
2122
- },
2123
- linkedBeliefId: {
2124
- type: "string",
2125
- description: "Link or relink this task to a belief node"
2126
- },
2127
- linkedQuestionId: {
2128
- type: "string",
2129
- description: "Link or relink this task to a question node"
2130
- },
2131
- title: { type: "string", description: "Updated task title" },
2132
- description: {
2133
- type: "string",
2134
- description: "Updated task description"
2135
- },
2136
- priority: {
2137
- type: "string",
2138
- description: "Updated priority",
2139
- enum: ["critical", "high", "medium", "low"]
2140
- },
2141
- status: {
2142
- type: "string",
2143
- description: "Updated status",
2144
- enum: ["todo", "in_progress", "blocked", "done"]
2145
- }
2146
- },
2147
- required: ["taskId"],
2148
- response: {
2149
- description: "The updated task",
2150
- fields: {
2151
- taskId: "string",
2152
- updatedAt: "number"
2153
- }
2154
- },
2155
- ownerModule: "workflow-engine",
2156
- ontologyPrimitive: "task",
2157
- tier: "workhorse"
2158
- };
2159
- var LIST_TASKS = {
2160
- name: "list_tasks",
2161
- description: "List tasks for a topic or worktree. Like `git task list` \u2014 returns tasks with status, priority, and linked nodes. Filter by worktree to see tasks for a specific investigation, or by status to find incomplete work.",
2162
- parameters: {
2163
- topicId: { type: "string", description: "Topic scope" },
2164
- linkedWorktreeId: {
2165
- type: "string",
2166
- description: "Filter to tasks linked to this worktree"
2167
- },
2168
- status: {
2169
- type: "string",
2170
- description: "Filter by status: todo, in_progress, blocked, done",
2171
- enum: ["todo", "in_progress", "blocked", "done"]
2172
- },
2173
- limit: { type: "number", description: "Maximum results (default: 100)" }
2174
- },
2175
- required: ["topicId"],
2176
- response: {
2177
- description: "List of tasks with metadata",
2178
- fields: { tasks: "array of task objects", count: "number" }
2179
- },
2180
- ownerModule: "workflow-engine",
2181
- ontologyPrimitive: "task",
2182
- tier: "workhorse"
2183
- };
2184
- var CREATE_TOPIC = {
2185
- name: "create_topic",
2186
- 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.",
2187
- parameters: {
2188
- name: { type: "string", description: "Topic name" },
2189
- type: {
2190
- type: "string",
2191
- description: "Topic type. Validated against schemaEnumConfig category 'topic_type'."
2192
- },
2193
- description: { type: "string", description: "What this topic covers" },
2194
- parentTopicId: {
2195
- type: "string",
2196
- description: "Optional parent topic for nesting"
2197
- },
2198
- createdBy: { type: "string", description: "Who created this topic" }
2199
- },
2200
- required: ["name", "type"],
2201
- response: {
2202
- description: "The created topic",
2203
- fields: {
2204
- id: "string \u2014 topic ID",
2205
- globalId: "string \u2014 globally unique ID",
2206
- depth: "number \u2014 nesting depth"
2207
- }
2208
- },
2209
- ownerModule: "schema-management",
2210
- ontologyPrimitive: "graph",
2211
- tier: "showcase"
2212
- };
2213
- var LIST_TOPICS = {
2214
- name: "list_topics",
2215
- description: "List topics, optionally filtered by type or parent. Like `git remote -v` \u2014 shows all knowledge containers with their types and hierarchy.",
2216
- parameters: {
2217
- type: {
2218
- type: "string",
2219
- description: "Filter by topic type (e.g., 'theme', 'deal')"
2220
- },
2221
- parentTopicId: {
2222
- type: "string",
2223
- description: "Filter to children of this parent"
2224
- },
2225
- status: {
2226
- type: "string",
2227
- description: "Filter by status",
2228
- enum: ["active", "archived", "watching"]
2229
- }
2230
- },
2231
- required: [],
2232
- response: {
2233
- description: "List of topics with metadata",
2234
- fields: {
2235
- topics: "array \u2014 { id, name, type, depth, status, parentTopicId }"
2236
- }
2237
- },
2238
- ownerModule: "schema-management",
2239
- ontologyPrimitive: "graph",
2240
- tier: "workhorse"
2241
- };
2242
- var GET_TOPIC = {
2243
- name: "get_topic",
2244
- description: "Get one topic by ID. Like `git remote show origin` \u2014 inspects a single knowledge container in detail.",
2245
- parameters: {
2246
- topicId: {
2247
- type: "string",
2248
- description: "Canonical topic ID to retrieve"
2249
- },
2250
- id: {
2251
- type: "string",
2252
- description: "Legacy alias for topicId"
2253
- }
2254
- },
2255
- required: [],
2256
- response: {
2257
- description: "Single topic record",
2258
- fields: {
2259
- topic: "object \u2014 { id, globalId, name, type, depth, status, parentTopicId, description }"
2260
- }
2261
- },
2262
- ownerModule: "schema-management",
2263
- ontologyPrimitive: "graph",
2264
- tier: "workhorse"
2265
- };
2266
- var UPDATE_TOPIC = {
2267
- name: "update_topic",
2268
- description: "Update an existing topic's metadata. Like `git remote set-url` \u2014 changes the canonical configuration for a knowledge container without recreating it.",
2269
- parameters: {
2270
- topicId: {
2271
- type: "string",
2272
- description: "Canonical topic ID to update"
2273
- },
2274
- id: {
2275
- type: "string",
2276
- description: "Legacy alias for topicId"
2277
- },
2278
- name: { type: "string", description: "Updated topic name" },
2279
- description: { type: "string", description: "Updated topic description" },
2280
- type: {
2281
- type: "string",
2282
- description: "Updated topic type. Validated against schemaEnumConfig category 'topic_type'."
2283
- },
2284
- ontologyId: {
2285
- type: "string",
2286
- description: "Updated ontology binding"
2287
- },
2288
- clearOntologyId: {
2289
- type: "boolean",
2290
- description: "Clear the current ontology binding"
2291
- },
2292
- status: {
2293
- type: "string",
2294
- description: "Updated topic status",
2295
- enum: ["active", "archived", "watching"]
2296
- },
2297
- visibility: {
2298
- type: "string",
2299
- description: "Updated topic visibility",
2300
- enum: ["private", "team", "firm", "external", "public"]
2301
- }
2302
- },
2303
- required: [],
2304
- response: {
2305
- description: "The updated topic",
2306
- fields: {
2307
- id: "string \u2014 topic ID",
2308
- globalId: "string \u2014 globally unique ID",
2309
- status: "string \u2014 topic lifecycle status",
2310
- visibility: "string \u2014 topic visibility"
2311
- }
2312
- },
2313
- ownerModule: "schema-management",
2314
- ontologyPrimitive: "graph",
2315
- tier: "workhorse"
2316
- };
2317
- var GET_TOPIC_TREE = {
2318
- name: "get_topic_tree",
2319
- description: "Get the full topic hierarchy from a root. Like `git log --graph --all` \u2014 shows the complete tree of nested topics.",
2320
- parameters: {
2321
- rootId: { type: "string", description: "Root topic to start from" },
2322
- maxDepth: {
2323
- type: "number",
2324
- description: "Maximum depth to traverse (default: 5)"
2325
- }
2326
- },
2327
- required: ["rootId"],
2328
- response: {
2329
- description: "Tree of topics with nesting",
2330
- fields: { tree: "array \u2014 topics in BFS order with depth and path" }
2331
- },
2332
- ownerModule: "schema-management",
2333
- ontologyPrimitive: "graph",
2334
- tier: "workhorse"
2335
- };
2336
- var GET_CODE_CONTEXT = {
2337
- name: "get_code_context",
2338
- 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.",
2339
- parameters: {
2340
- filePath: {
2341
- type: "string",
2342
- description: "File path to search for (partial matches supported, e.g. 'epistemicBeliefs.ts' or 'convex/epistemicBeliefs.ts')"
2343
- },
2344
- topicId: {
2345
- type: "string",
2346
- description: "Topic scope (optional, uses default if not provided)"
2347
- },
2348
- includeFailures: {
2349
- type: "boolean",
2350
- description: "Whether to include failed attempt evidence (default: true)"
2351
- }
2352
- },
2353
- required: ["filePath"],
2354
- response: {
2355
- description: "Code-anchored beliefs and evidence grouped by type",
2356
- fields: {
2357
- filePath: "string \u2014 queried path",
2358
- decisions: "array \u2014 implementation_decision beliefs",
2359
- contracts: "array \u2014 interface_contract beliefs",
2360
- migrations: "array \u2014 migration_state beliefs",
2361
- patterns: "array \u2014 code_pattern beliefs",
2362
- deprecations: "array \u2014 deprecation_notice beliefs",
2363
- failures: "array \u2014 failed attempt evidence",
2364
- totalMatched: "number"
2365
- }
2366
- },
2367
- ownerModule: "coding-intelligence",
2368
- ontologyPrimitive: "belief",
2369
- tier: "showcase"
2370
- };
2371
- var GET_CHANGE_HISTORY = {
2372
- name: "get_change_history",
2373
- description: "Returns recent changes and decisions for a file path \u2014 the 'why' behind recent code changes. Like `git log --follow <path>` \u2014 shows the evolution of understanding anchored to a specific file. Searches beliefs and evidence updated recently, sorted by most recent first.",
2374
- parameters: {
2375
- filePath: { type: "string", description: "File path to get history for" },
2376
- topicId: { type: "string", description: "Topic scope (optional)" },
2377
- limit: { type: "number", description: "Max results (default: 10)" }
2378
- },
2379
- required: ["filePath"],
2380
- response: {
2381
- description: "Recent code-anchored changes sorted by recency",
2382
- fields: {
2383
- filePath: "string \u2014 queried path",
2384
- changes: "array \u2014 nodes with coding view (nodeId, beliefType, canonicalText, codeAnchors, timestamps)",
2385
- totalFound: "number",
2386
- showing: "number"
2387
- }
2388
- },
2389
- ownerModule: "coding-intelligence",
2390
- ontologyPrimitive: "belief",
2391
- tier: "workhorse"
2392
- };
2393
- var RECORD_ATTEMPT = {
2394
- name: "record_attempt",
2395
- description: "Log a failed approach as evidence linked to a belief. Like `git stash` for failed experiments \u2014 preserves what was tried so the same mistake isn't repeated. Creates evidence with metadata.failedApproach=true and metadata.codeAnchors. The key anti-repetition mechanism: future agents check the failure log before trying new approaches.",
2396
- parameters: {
2397
- description: {
2398
- type: "string",
2399
- description: "What was attempted and why it failed"
2400
- },
2401
- filePaths: {
2402
- type: "array",
2403
- description: "File paths involved in the attempt"
2404
- },
2405
- errorMessage: {
2406
- type: "string",
2407
- description: "Error message or failure reason"
2408
- },
2409
- linkedBeliefId: {
2410
- type: "string",
2411
- description: "Belief this attempt was targeting (creates -0.5 weight edge)"
2412
- },
2413
- topicId: { type: "string", description: "Topic scope (optional)" }
2414
- },
2415
- required: ["description"],
2416
- response: {
2417
- description: "The recorded failed attempt evidence node",
2418
- fields: {
2419
- nodeId: "string \u2014 evidence node ID",
2420
- edgeId: "string | null \u2014 edge to linked belief",
2421
- recorded: "boolean \u2014 true",
2422
- filePaths: "array \u2014 anchored file paths"
2423
- }
2424
- },
2425
- ownerModule: "coding-intelligence",
2426
- ontologyPrimitive: "evidence",
2427
- tier: "showcase"
2428
- };
2429
- var GET_FAILURE_LOG = {
2430
- name: "get_failure_log",
2431
- description: "Search past failed attempts matching a task description. Like `git log --grep='FAILED'` \u2014 finds evidence of what was tried before and didn't work. Before trying a new approach, check this log to avoid repeating the same mistake. Filters to evidence with metadata.failedApproach=true, sorted by recency.",
2432
- parameters: {
2433
- query: {
2434
- type: "string",
2435
- description: "Description of the task or approach to search for"
2436
- },
2437
- filePath: {
2438
- type: "string",
2439
- description: "Optional file path to narrow results"
2440
- },
2441
- topicId: { type: "string", description: "Topic scope (optional)" },
2442
- limit: { type: "number", description: "Max results (default: 5)" }
2443
- },
2444
- required: ["query"],
2445
- response: {
2446
- description: "Failed attempts matching the query",
2447
- fields: {
2448
- query: "string \u2014 search query",
2449
- failures: "array \u2014 failed attempt evidence with coding view",
2450
- totalFound: "number",
2451
- showing: "number"
2452
- }
2453
- },
2454
- ownerModule: "coding-intelligence",
2455
- ontologyPrimitive: "evidence",
2456
- tier: "showcase"
2457
- };
2458
- var GET_TOPIC_COVERAGE = {
2459
- name: "get_topic_coverage",
2460
- description: "Returns per-topic belief/question/evidence counts across the topic tree. Like `git diff --stat` for the knowledge graph \u2014 shows coverage density and empty spots across the topic hierarchy. Use to identify which topics need more beliefs, which lack questions, and overall graph health.",
2461
- parameters: {
2462
- topicId: {
2463
- type: "string",
2464
- description: "Topic scope ID (optional, uses default if not provided)"
2465
- },
2466
- includeDescendants: {
2467
- type: "boolean",
2468
- description: "Whether to include descendant topics in the coverage report (default: true)"
2469
- },
2470
- maxDepth: {
2471
- type: "number",
2472
- description: "Maximum descendant topic depth for neighborhood expansion. Defaults to 4 for root/theme scopes, 2 for deeper scopes."
2473
- }
2474
- },
2475
- required: [],
2476
- response: {
2477
- description: "Per-topic coverage metrics and aggregate summary",
2478
- fields: {
2479
- topics: "array \u2014 per-topic { topicId, name, type, depth, beliefs, questions, evidence, coverage }",
2480
- summary: "object \u2014 { totalTopics, coveredTopics, emptyTopics, coveragePercent, totalBeliefs, totalQuestions, totalEvidence }",
2481
- scopeTopicId: "string \u2014 the root topic used for scoping"
2482
- }
2483
- },
2484
- ownerModule: "coverage-intelligence",
2485
- ontologyPrimitive: "graph",
2486
- tier: "showcase"
2487
- };
2488
- var GET_GRAPH_GAPS = {
2489
- name: "get_graph_gaps",
2490
- description: "Identify structural gaps in the knowledge graph \u2014 empty topics, beliefs without questions, beliefs without evidence, and orphan edges. Like `git fsck` for reasoning coverage \u2014 surfaces holes that weaken the epistemic foundation. Returns prioritized gap list.",
2491
- parameters: {
2492
- topicId: {
2493
- type: "string",
2494
- description: "Topic scope ID (optional, uses default if not provided)"
2495
- },
2496
- maxDepth: {
2497
- type: "number",
2498
- description: "Maximum descendant topic depth for neighborhood expansion (default: 4)"
2499
- }
2500
- },
2501
- required: ["topicId"],
2502
- response: {
2503
- description: "Prioritized list of graph gaps by category",
2504
- fields: {
2505
- emptyTopics: "array \u2014 topics with zero beliefs { topicId, name, type, depth }",
2506
- beliefsWithoutQuestions: "array \u2014 beliefs that have no testing questions { nodeId, canonicalText, topicId }",
2507
- beliefsWithoutEvidence: "array \u2014 beliefs that have no supporting evidence { nodeId, canonicalText, topicId }",
2508
- summary: "object \u2014 { totalGaps, emptyTopicCount, untestedBeliefCount, unsupportedBeliefCount }",
2509
- scopeTopicId: "string \u2014 the root topic used for scoping"
2510
- }
2511
- },
2512
- ownerModule: "coverage-intelligence",
2513
- ontologyPrimitive: "graph",
2514
- tier: "showcase"
2515
- };
2516
- var MANAGE_WRITE_POLICY = {
2517
- name: "manage_write_policy",
2518
- description: "Manage write policies for MCP mutation tools. Like `git config` for write permissions \u2014 sets per-topic or global policies that control which roles can mutate the graph.",
2519
- parameters: {
2520
- action: {
2521
- type: "string",
2522
- description: "Action to perform: 'get' (read policies) or 'set' (upsert a policy)",
2523
- enum: ["get", "set"]
2524
- },
2525
- topicId: {
2526
- type: "string",
2527
- description: "Topic scope for the policy. Omit for global policies."
2528
- },
2529
- role: {
2530
- type: "string",
2531
- description: "Role to set policy for (required for 'set'). E.g. 'agent:internal', 'user:analyst'."
2532
- },
2533
- permission: {
2534
- type: "string",
2535
- description: "Permission level (required for 'set').",
2536
- enum: ["allow", "deny", "read_only"]
2537
- },
2538
- maxWritesPerSession: {
2539
- type: "number",
2540
- description: "Optional per-session write limit for this role+scope."
2541
- },
2542
- rationale: {
2543
- type: "string",
2544
- description: "Why this policy is being set (audit trail)."
2545
- }
2546
- },
2547
- required: ["action"],
2548
- response: {
2549
- description: "Policy operation result",
2550
- fields: {
2551
- action: "string \u2014 get | set",
2552
- topicId: "string|null \u2014 topic scope or null for global",
2553
- policies: "array \u2014 (for get) list of matching policies",
2554
- role: "string \u2014 (for set) role that was updated",
2555
- permission: "string \u2014 (for set) new permission level",
2556
- maxWritesPerSession: "number|null \u2014 (for set) session write cap"
2557
- }
2558
- },
2559
- ownerModule: "access-control",
2560
- ontologyPrimitive: "policy",
2561
- tier: "workhorse"
2562
- };
2563
- var LIST_ONTOLOGIES = {
2564
- name: "list_ontologies",
2565
- description: "List ontology definitions with optional filters. Like `git remote -v` for ontologies \u2014 shows all registered ontology definitions with their tier, status, and tenant scope.",
2566
- parameters: {
2567
- tenantId: {
2568
- type: "string",
2569
- description: "Filter by tenant ID. Omit for platform-level ontologies."
2570
- },
2571
- tier: {
2572
- type: "string",
2573
- description: "Filter by tier",
2574
- enum: ["platform", "pack", "tenant"]
2575
- },
2576
- status: {
2577
- type: "string",
2578
- description: "Filter by status",
2579
- enum: ["draft", "active", "deprecated", "archived"]
2580
- }
2581
- },
2582
- required: [],
2583
- response: {
2584
- description: "Array of ontology definitions",
2585
- fields: {
2586
- ontologies: "array \u2014 ontology definitions with id, ontologyKey, name, tier, status"
2587
- }
2588
- },
2589
- ownerModule: "graph-primitives",
2590
- ontologyPrimitive: "ontology",
2591
- tier: "showcase"
2592
- };
2593
- var GET_ONTOLOGY = {
2594
- name: "get_ontology",
2595
- description: "Get a single ontology definition by ID or ontologyKey. Like `git show` for an ontology \u2014 returns the definition metadata plus the latest published version with entity types and edge types.",
2596
- parameters: {
2597
- id: {
2598
- type: "string",
2599
- description: "Ontology definition ID (Convex document ID)"
2600
- },
2601
- ontologyKey: {
2602
- type: "string",
2603
- description: "Ontology key (e.g., 'investment-ontology'). Alternative to id."
2604
- },
2605
- tenantId: {
2606
- type: "string",
2607
- description: "Tenant scope for key lookup. Omit for platform-level."
2608
- }
2609
- },
2610
- required: [],
2611
- response: {
2612
- description: "Ontology definition with latest published version",
2613
- fields: {
2614
- id: "string \u2014 definition ID",
2615
- ontologyKey: "string \u2014 unique key",
2616
- name: "string \u2014 display name",
2617
- publishedVersion: "object|null \u2014 latest published version with entityTypes and edgeTypes"
2618
- }
2619
- },
2620
- ownerModule: "graph-primitives",
2621
- ontologyPrimitive: "ontology",
2622
- tier: "showcase"
2623
- };
2624
- var APPLY_ONTOLOGY = {
2625
- name: "apply_ontology",
2626
- description: "Bind an ontology definition directly to a topic. Like `git checkout` for a domain vocabulary \u2014 applies an ontology to a topic so the topic and its descendants inherit the configured entity and edge schema.",
2627
- parameters: {
2628
- ontologyId: {
2629
- type: "string",
2630
- description: "Canonical ontology identifier to bind"
2631
- },
2632
- topicId: {
2633
- type: "string",
2634
- description: "Canonical topic identifier to receive the binding"
2635
- }
2636
- },
2637
- required: ["ontologyId", "topicId"],
2638
- response: {
2639
- description: "Ontology binding summary",
2640
- fields: {
2641
- applied: "boolean \u2014 true when the binding was written",
2642
- source: "string \u2014 always 'direct' for an explicit bind",
2643
- ontologyId: "string \u2014 canonical ontology ID",
2644
- ontologyKey: "string \u2014 ontology key",
2645
- topicId: "string \u2014 canonical topic ID"
2646
- }
2647
- },
2648
- ownerModule: "schema-management",
2649
- ontologyPrimitive: "ontology",
2650
- tier: "showcase"
2651
- };
2652
- var MATCH_ENTITY_TYPE = {
2653
- name: "match_entity_type",
2654
- description: "Classify free text against the effective ontology vocabulary. Like `git grep` for ontology types \u2014 ranks the most likely entity types for the supplied text using the topic-bound or explicitly selected ontology.",
2655
- parameters: {
2656
- text: {
2657
- type: "string",
2658
- description: "Free text to classify against ontology entity types"
2659
- },
2660
- topicId: {
2661
- type: "string",
2662
- description: "Canonical topic ID used to resolve the effective ontology when ontologyId is omitted"
2663
- },
2664
- ontologyId: {
2665
- type: "string",
2666
- description: "Optional ontology definition ID to match against instead of the topic-bound ontology"
2667
- },
2668
- minScore: {
2669
- type: "number",
2670
- description: "Optional lower similarity bound for returned matches"
2671
- },
2672
- limit: {
2673
- type: "number",
2674
- description: "Optional maximum number of ranked matches to return"
2675
- }
2676
- },
2677
- required: ["text"],
2678
- response: {
2679
- description: "Ranked ontology entity type matches",
2680
- fields: {
2681
- matches: "array \u2014 ranked entity type matches with score, entityType, label, and optional description",
2682
- ontologyId: "string|null \u2014 ontology used for matching",
2683
- topicId: "string|null \u2014 topic scope used for ontology resolution"
2684
- }
2685
- },
2686
- ownerModule: "schema-management",
2687
- ontologyPrimitive: "ontology",
2688
- tier: "showcase"
2689
- };
2690
- var CREATE_ONTOLOGY = {
2691
- name: "create_ontology",
2692
- description: "Create a new ontology definition. Like `git init` for a domain vocabulary \u2014 creates a named, versioned container for entity types and edge types. Starts in 'draft' status.",
2693
- parameters: {
2694
- ontologyKey: {
2695
- type: "string",
2696
- description: "Unique key (lowercase, hyphens, e.g., 'investment-ontology')"
2697
- },
2698
- name: { type: "string", description: "Human-readable name" },
2699
- description: { type: "string", description: "What this ontology covers" },
2700
- tenantId: {
2701
- type: "string",
2702
- description: "Tenant scope. Omit for platform-level."
2703
- },
2704
- tier: {
2705
- type: "string",
2706
- description: "Ontology tier",
2707
- enum: ["platform", "pack", "tenant"]
2708
- },
2709
- parentOntologyId: {
2710
- type: "string",
2711
- description: "Parent ontology ID for layered composition"
2712
- }
2713
- },
2714
- required: ["ontologyKey", "name", "tier"],
2715
- response: {
2716
- description: "Created ontology definition",
2717
- fields: {
2718
- id: "string \u2014 new definition ID",
2719
- ontologyKey: "string \u2014 normalized key"
2720
- }
2721
- },
2722
- ownerModule: "graph-primitives",
2723
- ontologyPrimitive: "ontology",
2724
- tier: "showcase"
2725
- };
2726
- var UPDATE_ONTOLOGY = {
2727
- name: "update_ontology",
2728
- description: "Update an ontology definition's metadata (name, description, status). Like `git config` for an ontology \u2014 updates mutable fields on the definition. Only allowed while the ontology is in draft or active status.",
2729
- parameters: {
2730
- id: { type: "string", description: "Ontology definition ID" },
2731
- name: { type: "string", description: "New display name" },
2732
- description: { type: "string", description: "New description" },
2733
- status: {
2734
- type: "string",
2735
- description: "New status",
2736
- enum: ["draft", "active", "deprecated"]
2737
- }
2738
- },
2739
- required: ["id"],
2740
- response: {
2741
- description: "Update confirmation",
2742
- fields: { success: "boolean" }
2743
- },
2744
- ownerModule: "graph-primitives",
2745
- ontologyPrimitive: "ontology",
2746
- tier: "workhorse"
2747
- };
2748
- var ARCHIVE_ONTOLOGY = {
2749
- name: "archive_ontology",
2750
- description: "Archive an ontology definition. Like `git rm` for an ontology \u2014 soft-deletes the definition. Archived ontologies are preserved in history but no longer active.",
2751
- parameters: {
2752
- id: { type: "string", description: "Ontology definition ID to archive" }
2753
- },
2754
- required: ["id"],
2755
- response: {
2756
- description: "Archive confirmation",
2757
- fields: { success: "boolean" }
2758
- },
2759
- ownerModule: "graph-primitives",
2760
- ontologyPrimitive: "ontology",
2761
- tier: "workhorse"
2762
- };
2763
- var CREATE_ONTOLOGY_VERSION = {
2764
- name: "create_ontology_version",
2765
- description: "Create a new version snapshot for an ontology definition. Like `git commit` for ontology content \u2014 captures entity types and edge types in a versioned snapshot. Starts in 'draft' status. Publish to freeze.",
2766
- parameters: {
2767
- ontologyId: {
2768
- type: "string",
2769
- description: "Parent ontology definition ID"
2770
- },
2771
- version: {
2772
- type: "string",
2773
- description: "Semantic version string (X.Y.Z format)"
2774
- },
2775
- entityTypes: {
2776
- type: "array",
2777
- description: "Array of entity type definitions: [{ value, label, description?, schema?, subtypes? }]"
2778
- },
2779
- edgeTypes: {
2780
- type: "array",
2781
- description: "Array of edge type definitions: [{ value, label, description?, sourceTypes?, targetTypes?, constraintSeverity? }]"
2782
- },
2783
- releaseNotes: {
2784
- type: "string",
2785
- description: "Optional release notes for this version"
2786
- }
2787
- },
2788
- required: ["ontologyId", "version", "entityTypes", "edgeTypes"],
2789
- response: {
2790
- description: "Created version",
2791
- fields: {
2792
- id: "string \u2014 new version ID",
2793
- version: "string \u2014 version string"
2794
- }
2795
- },
2796
- ownerModule: "graph-primitives",
2797
- ontologyPrimitive: "ontology",
2798
- tier: "showcase"
2799
- };
2800
- var PUBLISH_ONTOLOGY_VERSION = {
2801
- name: "publish_ontology_version",
2802
- description: "Publish a draft ontology version \u2014 freezes it permanently. Like `git tag` for an ontology release \u2014 the version becomes immutable after publish. If the parent definition is still in 'draft', promotes it to 'active'.",
2803
- parameters: {
2804
- id: { type: "string", description: "Ontology version ID to publish" }
2805
- },
2806
- required: ["id"],
2807
- response: {
2808
- description: "Publish confirmation",
2809
- fields: {
2810
- success: "boolean",
2811
- publishedAt: "number \u2014 timestamp"
2812
- }
2813
- },
2814
- ownerModule: "graph-primitives",
2815
- ontologyPrimitive: "ontology",
2816
- tier: "showcase"
2817
- };
2818
- var DEPRECATE_ONTOLOGY_VERSION = {
2819
- name: "deprecate_ontology_version",
2820
- description: "Deprecate a published ontology version. Like `git tag -d` for an ontology release \u2014 marks the version as deprecated. Only published versions can be deprecated.",
2821
- parameters: {
2822
- id: { type: "string", description: "Ontology version ID to deprecate" }
2823
- },
2824
- required: ["id"],
2825
- response: {
2826
- description: "Deprecation confirmation",
2827
- fields: { success: "boolean" }
2828
- },
2829
- ownerModule: "graph-primitives",
2830
- ontologyPrimitive: "ontology",
2831
- tier: "workhorse"
2832
- };
2833
- var RESOLVE_EFFECTIVE_ONTOLOGY = {
2834
- name: "resolve_effective_ontology",
2835
- description: "Resolve the effective ontology by composing the parent chain. Like `git merge --squash` for ontology layers \u2014 walks parentOntologyId chain (max depth 3) and merges entity/edge types additively from root (platform) to leaf (tenant).",
2836
- parameters: {
2837
- ontologyId: {
2838
- type: "string",
2839
- description: "Ontology definition ID to resolve from"
2840
- }
2841
- },
2842
- required: ["ontologyId"],
2843
- response: {
2844
- description: "Merged ontology with composed entity and edge types",
2845
- fields: {
2846
- entityTypes: "array \u2014 merged entity types from all layers",
2847
- edgeTypes: "array \u2014 merged edge types from all layers",
2848
- layers: "array \u2014 ontology keys in composition order"
2849
- }
2850
- },
2851
- ownerModule: "graph-primitives",
2852
- ontologyPrimitive: "ontology",
2853
- tier: "workhorse"
2854
- };
2855
- var MCP_TOOL_CONTRACTS = {
2856
- // Belief lifecycle (commit, amend, fork, archive)
2857
- create_belief: CREATE_BELIEF,
2858
- get_belief: GET_BELIEF,
2859
- refine_belief: REFINE_BELIEF,
2860
- modulate_confidence: MODULATE_CONFIDENCE,
2861
- fork_belief: FORK_BELIEF,
2862
- archive_belief: ARCHIVE_BELIEF,
2863
- create_epistemic_contract: CREATE_EPISTEMIC_CONTRACT,
2864
- // Evidence (commit)
2865
- create_evidence: CREATE_EVIDENCE,
2866
- get_evidence: GET_EVIDENCE,
2867
- list_evidence: LIST_EVIDENCE,
2868
- link_evidence: LINK_EVIDENCE,
2869
- add_evidence: ADD_EVIDENCE,
2870
- // Contradictions (merge conflict)
2871
- flag_contradiction: FLAG_CONTRADICTION,
2872
- // Lens lifecycle (workspace-scoped operational frames)
2873
- create_lens: CREATE_LENS,
2874
- list_lenses: LIST_LENSES,
2875
- apply_lens_to_topic: APPLY_LENS_TO_TOPIC,
2876
- remove_lens_from_topic: REMOVE_LENS_FROM_TOPIC,
2877
- // Worktree lifecycle (git worktree add → merge → push → pull request)
2878
- add_worktree: ADD_WORKTREE,
2879
- merge: MERGE,
2880
- push: PUSH,
2881
- open_pull_request: OPEN_PULL_REQUEST,
2882
- // Lineage and audit (log, blame)
2883
- query_lineage: QUERY_LINEAGE,
2884
- get_confidence_history: GET_CONFIDENCE_HISTORY,
2885
- get_audit_trail: GET_AUDIT_TRAIL,
2886
- // Graph queries (traverse, search, bisect, entity impact)
2887
- traverse_graph: TRAVERSE_GRAPH,
2888
- get_graph_neighborhood: GET_GRAPH_NEIGHBORHOOD,
2889
- trace_entity_impact: TRACE_ENTITY_IMPACT,
2890
- search_beliefs: SEARCH_BELIEFS,
2891
- search_resources: SEARCH_RESOURCES,
2892
- find_contradictions: FIND_CONTRADICTIONS,
2893
- bisect_confidence: BISECT_CONFIDENCE,
2894
- // Edges (commit)
2895
- create_edge: CREATE_EDGE,
2896
- // Judgments (tag)
2897
- record_judgment: RECORD_JUDGMENT,
2898
- // Graph intelligence (showcase)
2899
- detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
2900
- get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
2901
- get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
2902
- // Sources & research (showcase)
2903
- search_sources: SEARCH_SOURCES,
2904
- execute_deep_research: EXECUTE_DEEP_RESEARCH,
2905
- // Evidence operations (workhorse)
2906
- search_evidence: SEARCH_EVIDENCE,
2907
- link_evidence_to_belief: LINK_EVIDENCE_TO_BELIEF,
2908
- // Answer lifecycle (L2 question responses)
2909
- create_answer: CREATE_ANSWER,
2910
- get_answer: GET_ANSWER,
2911
- // Question operations (workhorse)
2912
- create_question: CREATE_QUESTION,
2913
- get_question: GET_QUESTION,
2914
- refine_question: REFINE_QUESTION,
2915
- list_questions: LIST_QUESTIONS,
2916
- answer_question: ANSWER_QUESTION,
2917
- update_question_status: UPDATE_QUESTION_STATUS,
2918
- archive_question: ARCHIVE_QUESTION,
2919
- link_evidence_to_question: LINK_EVIDENCE_TO_QUESTION,
2920
- get_high_priority_questions: GET_HIGH_PRIORITY_QUESTIONS,
2921
- find_missing_questions: FIND_MISSING_QUESTIONS,
2922
- // Listing & query (workhorse)
2923
- list_beliefs: LIST_BELIEFS,
2924
- list_worktrees: LIST_WORKTREES,
2925
- list_all_worktrees: LIST_ALL_WORKTREES,
2926
- activate_worktree: ACTIVATE_WORKTREE,
2927
- update_worktree_targets: UPDATE_WORKTREE_TARGETS,
2928
- update_worktree_metadata: UPDATE_WORKTREE_METADATA,
2929
- identity_whoami: IDENTITY_WHOAMI,
2930
- compile_context: COMPILE_CONTEXT,
2931
- // Policy / ACL (workhorse)
2932
- check_permission: CHECK_PERMISSION,
2933
- filter_by_permission: FILTER_BY_PERMISSION,
2934
- // Write policy (S2-13K Graph Compounding)
2935
- manage_write_policy: MANAGE_WRITE_POLICY,
2936
- // Observation context (workhorse)
2937
- ingest_observation: INGEST_OBSERVATION,
2938
- get_observation_context: GET_OBSERVATION_CONTEXT,
2939
- // Task lifecycle (workhorse)
2940
- create_task: CREATE_TASK,
2941
- complete_task: COMPLETE_TASK,
2942
- update_task: UPDATE_TASK,
2943
- list_tasks: LIST_TASKS,
2944
- // Topic lifecycle (init, remote)
2945
- create_topic: CREATE_TOPIC,
2946
- list_topics: LIST_TOPICS,
2947
- get_topic: GET_TOPIC,
2948
- update_topic: UPDATE_TOPIC,
2949
- get_topic_tree: GET_TOPIC_TREE,
2950
- // Coding intelligence (code-grounded knowledge)
2951
- get_code_context: GET_CODE_CONTEXT,
2952
- get_change_history: GET_CHANGE_HISTORY,
2953
- record_attempt: RECORD_ATTEMPT,
2954
- get_failure_log: GET_FAILURE_LOG,
2955
- // Graph self-intelligence (coverage, gaps)
2956
- get_topic_coverage: GET_TOPIC_COVERAGE,
2957
- get_graph_gaps: GET_GRAPH_GAPS,
2958
- // Ontology lifecycle (definition CRUD, version management)
2959
- list_ontologies: LIST_ONTOLOGIES,
2960
- get_ontology: GET_ONTOLOGY,
2961
- apply_ontology: APPLY_ONTOLOGY,
2962
- match_entity_type: MATCH_ENTITY_TYPE,
2963
- create_ontology: CREATE_ONTOLOGY,
2964
- update_ontology: UPDATE_ONTOLOGY,
2965
- archive_ontology: ARCHIVE_ONTOLOGY,
2966
- create_ontology_version: CREATE_ONTOLOGY_VERSION,
2967
- publish_ontology_version: PUBLISH_ONTOLOGY_VERSION,
2968
- deprecate_ontology_version: DEPRECATE_ONTOLOGY_VERSION,
2969
- resolve_effective_ontology: RESOLVE_EFFECTIVE_ONTOLOGY
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from))
10
+ if (!__hasOwnProp.call(to, key) && key !== except)
11
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ }
13
+ return to;
2970
14
  };
15
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
16
+
17
+ // src/contracts/sdkTools.ts
18
+ var sdkTools_exports = {};
2971
19
 
2972
20
  // src/contracts/sdk-tools.contract.ts
2973
- var START_WORKTREE = {
2974
- name: "start_worktree",
2975
- description: "Transition a draft worktree to active. Like `git checkout -b` \u2014 the branch becomes your working context. A worktree must be started before beliefs can be committed to it.",
2976
- parameters: {
2977
- worktreeId: {
2978
- type: "string",
2979
- description: "The draft worktree to activate"
2980
- }
2981
- },
2982
- required: ["worktreeId"],
2983
- response: {
2984
- description: "The activated worktree",
2985
- fields: {
2986
- worktreeId: "string",
2987
- status: "string \u2014 'active'",
2988
- startedAt: "number"
2989
- }
2990
- },
2991
- ownerModule: "workflow-engine",
2992
- ontologyPrimitive: "worktree",
2993
- tier: "sdk-only"
2994
- };
2995
- var UPDATE_WORKTREE_PHASE = {
2996
- name: "update_worktree_phase",
2997
- description: "Set a worktree's phase explicitly. Like `git config` for workflow state \u2014 manually sets the current investigation phase. Phases: hypothesis_formation, evidence_collection, evidence_review, synthesis, scoring.",
2998
- parameters: {
2999
- worktreeId: { type: "string", description: "The worktree to update" },
3000
- phase: {
3001
- type: "string",
3002
- description: "Target phase",
3003
- enum: [
3004
- "hypothesis_formation",
3005
- "evidence_collection",
3006
- "evidence_review",
3007
- "synthesis",
3008
- "scoring"
3009
- ]
3010
- },
3011
- reason: { type: "string", description: "Why the phase is being set" }
3012
- },
3013
- required: ["worktreeId", "phase"],
3014
- response: {
3015
- description: "Updated worktree phase",
3016
- fields: {
3017
- worktreeId: "string",
3018
- previousPhase: "string",
3019
- newPhase: "string"
3020
- }
3021
- },
3022
- ownerModule: "workflow-engine",
3023
- ontologyPrimitive: "worktree",
3024
- tier: "sdk-only"
3025
- };
3026
- var ADVANCE_WORKTREE_PHASE = {
3027
- name: "advance_worktree_phase",
3028
- description: "Auto-advance a worktree to the next phase after requirements pass. Like `git hooks` post-commit \u2014 automatic progression when phase gates are satisfied. Validates that all phase requirements are met before advancing.",
3029
- parameters: {
3030
- worktreeId: { type: "string", description: "The worktree to advance" }
3031
- },
3032
- required: ["worktreeId"],
3033
- response: {
3034
- description: "Phase advancement result",
3035
- fields: {
3036
- worktreeId: "string",
3037
- previousPhase: "string",
3038
- newPhase: "string",
3039
- requirementsMet: "boolean",
3040
- failedRequirements: "array | null \u2014 requirements that blocked advancement"
3041
- }
3042
- },
3043
- ownerModule: "workflow-engine",
3044
- ontologyPrimitive: "worktree",
3045
- tier: "sdk-only"
3046
- };
3047
- var ADD_NOTE_TO_WORKTREE = {
3048
- name: "add_note_to_worktree",
3049
- description: "Attach contextual metadata to a worktree. Like `git notes` \u2014 annotations that don't change the commit itself. Notes persist across phase transitions and appear in the audit trail.",
3050
- parameters: {
3051
- worktreeId: { type: "string", description: "The worktree to annotate" },
3052
- content: { type: "string", description: "Note content" },
3053
- noteType: {
3054
- type: "string",
3055
- description: "Note category",
3056
- enum: ["observation", "decision", "risk", "context"]
3057
- }
3058
- },
3059
- required: ["worktreeId", "content"],
3060
- response: {
3061
- description: "The created note",
3062
- fields: { noteId: "string", worktreeId: "string", createdAt: "number" }
3063
- },
3064
- ownerModule: "workflow-engine",
3065
- ontologyPrimitive: "worktree",
3066
- tier: "sdk-only"
3067
- };
3068
- var LINK_DOCUMENT_TO_WORKTREE = {
3069
- name: "link_document_to_worktree",
3070
- description: "Attach a source document to a worktree. Like `git submodule add` \u2014 external references tracked within the worktree context. Documents become available as evidence sources for the investigation.",
3071
- parameters: {
3072
- worktreeId: { type: "string", description: "The worktree to link to" },
3073
- documentUrl: {
3074
- type: "string",
3075
- description: "URL or ID of the source document"
3076
- },
3077
- title: { type: "string", description: "Document title for display" },
3078
- documentType: {
3079
- type: "string",
3080
- description: "Document category",
3081
- enum: ["report", "transcript", "filing", "article", "dataset"]
3082
- }
3083
- },
3084
- required: ["worktreeId", "documentUrl", "title"],
3085
- response: {
3086
- description: "The document link",
3087
- fields: { linkId: "string", worktreeId: "string", documentUrl: "string" }
3088
- },
3089
- ownerModule: "workflow-engine",
3090
- ontologyPrimitive: "worktree",
3091
- tier: "sdk-only"
3092
- };
3093
- var LINK_EVIDENCE_TO_WORKTREE = {
3094
- name: "link_evidence_to_worktree",
3095
- description: "Stage evidence in a worktree for later processing. Like `git stash` \u2014 evidence waiting to be committed into the belief graph. Staged evidence is visible in the worktree but not yet linked to beliefs.",
3096
- parameters: {
3097
- worktreeId: { type: "string", description: "The worktree to stage in" },
3098
- evidenceId: { type: "string", description: "The evidence node to stage" },
3099
- rationale: {
3100
- type: "string",
3101
- description: "Why this evidence is relevant to the worktree"
3102
- }
3103
- },
3104
- required: ["worktreeId", "evidenceId"],
3105
- response: {
3106
- description: "The staged evidence link",
3107
- fields: { linkId: "string", worktreeId: "string", evidenceId: "string" }
3108
- },
3109
- ownerModule: "workflow-engine",
3110
- ontologyPrimitive: "worktree",
3111
- tier: "sdk-only"
3112
- };
3113
- var LINK_QUESTION_TO_WORKTREE = {
3114
- name: "link_question_to_worktree",
3115
- description: "Attach a question to a worktree for tracking. Like `git issue link` \u2014 associates an open question with an active investigation. Questions linked to a worktree guide evidence collection within that scope.",
3116
- parameters: {
3117
- worktreeId: { type: "string", description: "The worktree to link to" },
3118
- questionId: { type: "string", description: "The question to attach" }
3119
- },
3120
- required: ["worktreeId", "questionId"],
3121
- response: {
3122
- description: "The question-worktree link",
3123
- fields: { linkId: "string", worktreeId: "string", questionId: "string" }
3124
- },
3125
- ownerModule: "workflow-engine",
3126
- ontologyPrimitive: "worktree",
3127
- tier: "sdk-only"
3128
- };
3129
- var LINK_BELIEF_TO_WORKTREE = {
3130
- name: "link_belief_to_worktree",
3131
- description: "Attach beliefs to a worktree for investigation. Like `git cherry-pick` \u2014 selecting specific beliefs to investigate in this branch. Linked beliefs become the target of evidence collection and scoring.",
3132
- parameters: {
3133
- worktreeId: { type: "string", description: "The worktree to link to" },
3134
- beliefId: { type: "string", description: "The belief to attach" },
3135
- role: {
3136
- type: "string",
3137
- description: "Role of the belief in this worktree",
3138
- enum: ["primary", "supporting", "challenging"]
3139
- }
3140
- },
3141
- required: ["worktreeId", "beliefId"],
3142
- response: {
3143
- description: "The belief-worktree link",
3144
- fields: {
3145
- linkId: "string",
3146
- worktreeId: "string",
3147
- beliefId: "string",
3148
- role: "string"
3149
- }
3150
- },
3151
- ownerModule: "workflow-engine",
3152
- ontologyPrimitive: "worktree",
3153
- tier: "sdk-only"
3154
- };
3155
- var CREATE_SYNTHESIZED_BELIEF = {
3156
- name: "create_synthesized_belief",
3157
- description: "Consolidate draft artifacts into a synthesized belief. Like `git squash` \u2014 combining multiple commits into a single coherent unit. Takes multiple draft beliefs, evidence, and notes and produces one synthesized belief.",
3158
- parameters: {
3159
- worktreeId: {
3160
- type: "string",
3161
- description: "The worktree context for synthesis"
3162
- },
3163
- sourceBeliefIds: {
3164
- type: "array",
3165
- description: "Draft beliefs to consolidate"
3166
- },
3167
- canonicalText: {
3168
- type: "string",
3169
- description: "The synthesized belief statement"
3170
- },
3171
- synthesisRationale: {
3172
- type: "string",
3173
- description: "How the synthesis was derived"
3174
- }
3175
- },
3176
- required: ["worktreeId", "sourceBeliefIds", "canonicalText"],
3177
- response: {
3178
- description: "The synthesized belief",
3179
- fields: {
3180
- nodeId: "string",
3181
- sourceCount: "number",
3182
- synthesisRationale: "string"
3183
- }
3184
- },
3185
- ownerModule: "workflow-engine",
3186
- ontologyPrimitive: "belief",
3187
- tier: "sdk-only"
3188
- };
3189
- var COMPLETE_HYPOTHESIS_FORMATION = {
3190
- name: "complete_hypothesis_formation",
3191
- description: "Phase gate for hypothesis formation completion. Like `git tag` marking a milestone \u2014 certifies that the hypothesis formation phase is done. Validates that the worktree has a testable hypothesis and linked beliefs.",
3192
- parameters: {
3193
- worktreeId: {
3194
- type: "string",
3195
- description: "The worktree completing hypothesis formation"
3196
- },
3197
- summary: { type: "string", description: "Summary of hypotheses formed" }
3198
- },
3199
- required: ["worktreeId"],
3200
- response: {
3201
- description: "Phase gate result",
3202
- fields: {
3203
- worktreeId: "string",
3204
- passed: "boolean",
3205
- newPhase: "string",
3206
- failedChecks: "array | null"
3207
- }
3208
- },
3209
- ownerModule: "workflow-engine",
3210
- ontologyPrimitive: "worktree",
3211
- tier: "sdk-only"
3212
- };
3213
- var COMPLETE_EVIDENCE_REVIEW = {
3214
- name: "complete_evidence_review",
3215
- description: "Phase gate for evidence review completion. Like `git tag` marking evidence collection complete \u2014 certifies that sufficient evidence has been gathered and reviewed for the worktree to proceed to synthesis.",
3216
- parameters: {
3217
- worktreeId: {
3218
- type: "string",
3219
- description: "The worktree completing evidence review"
3220
- },
3221
- summary: { type: "string", description: "Summary of evidence reviewed" }
3222
- },
3223
- required: ["worktreeId"],
3224
- response: {
3225
- description: "Phase gate result",
3226
- fields: {
3227
- worktreeId: "string",
3228
- passed: "boolean",
3229
- newPhase: "string",
3230
- evidenceCount: "number"
3231
- }
3232
- },
3233
- ownerModule: "workflow-engine",
3234
- ontologyPrimitive: "worktree",
3235
- tier: "sdk-only"
3236
- };
3237
- var REFINE_WORKTREE_BELIEF = {
3238
- name: "refine_worktree_belief",
3239
- description: "Amend a belief within a worktree context. Like `git commit --amend` on a feature branch \u2014 rewrites draft belief text while maintaining worktree context and linked evidence.",
3240
- parameters: {
3241
- worktreeId: { type: "string", description: "The worktree context" },
3242
- beliefId: { type: "string", description: "The belief to refine" },
3243
- canonicalText: { type: "string", description: "Updated belief statement" },
3244
- rationale: { type: "string", description: "Why the refinement was made" }
3245
- },
3246
- required: ["worktreeId", "beliefId", "canonicalText"],
3247
- response: {
3248
- description: "The refined belief within worktree context",
3249
- fields: { beliefId: "string", worktreeId: "string", updatedAt: "number" }
3250
- },
3251
- ownerModule: "workflow-engine",
3252
- ontologyPrimitive: "belief",
3253
- tier: "sdk-only"
3254
- };
3255
- var TRACE_PROVENANCE = {
3256
- name: "trace_provenance",
3257
- description: "Fast lineage trace for any node type in the reasoning graph. Like `git log --follow` \u2014 tracks renames, forks, and full ancestry chain. Works on beliefs, evidence, questions, and judgments alike.",
3258
- parameters: {
3259
- nodeId: { type: "string", description: "The node to trace provenance for" },
3260
- depth: {
3261
- type: "number",
3262
- description: "Maximum ancestry depth (default: 10)"
3263
- },
3264
- includeEdgeTypes: {
3265
- type: "array",
3266
- description: "Filter to specific edge types"
3267
- }
3268
- },
3269
- required: ["nodeId"],
3270
- response: {
3271
- description: "Provenance chain with typed ancestry",
3272
- fields: {
3273
- chain: "array \u2014 ancestry nodes",
3274
- edges: "array \u2014 connecting edges",
3275
- totalDepth: "number"
3276
- }
3277
- },
3278
- ownerModule: "graph-search",
3279
- ontologyPrimitive: "graph",
3280
- tier: "sdk-only"
3281
- };
3282
- var GET_BELIEF_RELATIONSHIPS = {
3283
- name: "get_belief_relationships",
3284
- description: "Get structured cluster-edge map for a belief, grouped by relationship type. Like `git show --stat` \u2014 a relationship summary showing all connections. Returns evidence, questions, contradictions, forks, and dependent judgments.",
3285
- parameters: {
3286
- nodeId: { type: "string", description: "The belief to analyze" }
3287
- },
3288
- required: ["nodeId"],
3289
- response: {
3290
- description: "Relationships grouped by type",
3291
- fields: {
3292
- evidence: "array \u2014 linked evidence nodes",
3293
- questions: "array \u2014 testing questions",
3294
- contradictions: "array \u2014 flagged contradictions",
3295
- forks: "array \u2014 child forks",
3296
- judgments: "array \u2014 dependent judgments"
3297
- }
3298
- },
3299
- ownerModule: "graph-search",
3300
- ontologyPrimitive: "belief",
3301
- tier: "sdk-only"
3302
- };
3303
- var GET_BELIEF_SUPPORT_CHAIN = {
3304
- name: "get_belief_support_chain",
3305
- description: "Full Neo4j traversal: Belief <- Question <- Evidence support chain. Like `git log --graph --all` \u2014 the richest evidence retrieval path. Returns the complete support structure showing how evidence flows through questions to beliefs.",
3306
- parameters: {
3307
- nodeId: { type: "string", description: "The belief to trace support for" },
3308
- includeWeights: {
3309
- type: "boolean",
3310
- description: "Include edge weights in response"
3311
- }
3312
- },
3313
- required: ["nodeId"],
3314
- response: {
3315
- description: "Full support chain from evidence through questions to belief",
3316
- fields: {
3317
- belief: "object \u2014 the target belief",
3318
- questions: "array \u2014 testing questions with their evidence",
3319
- totalEvidenceCount: "number",
3320
- netSupportWeight: "number"
3321
- }
3322
- },
3323
- ownerModule: "graph-search",
3324
- ontologyPrimitive: "belief",
3325
- tier: "sdk-only"
3326
- };
3327
- var EXPLORE_CONNECTIONS = {
3328
- name: "explore_connections",
3329
- description: "Multi-hop neighbor exploration via Neo4j graph traversal. Like `git log --all --oneline` \u2014 broad discovery of connected nodes. Explores outward from a starting node across multiple hops, returning the discovered subgraph.",
3330
- parameters: {
3331
- nodeId: { type: "string", description: "Starting node for exploration" },
3332
- hops: {
3333
- type: "number",
3334
- description: "Number of hops to explore (default: 2, max: 5)"
3335
- },
3336
- nodeTypes: { type: "array", description: "Filter to specific node types" }
3337
- },
3338
- required: ["nodeId"],
3339
- response: {
3340
- description: "Discovered subgraph with nodes and edges",
3341
- fields: {
3342
- nodes: "array \u2014 discovered nodes",
3343
- edges: "array \u2014 connecting edges",
3344
- hopsTraversed: "number"
3345
- }
3346
- },
3347
- ownerModule: "graph-search",
3348
- ontologyPrimitive: "graph",
3349
- tier: "sdk-only"
3350
- };
3351
- var GET_DEEP_LINEAGE = {
3352
- name: "get_deep_lineage",
3353
- description: "10-level Neo4j ancestry traversal for deep history. Like `git log -10 --graph` \u2014 traces deep fork chains, supersedes edges, and confidence evolution. Returns the full ancestor tree with fork reasons and scoring history at each level.",
3354
- parameters: {
3355
- nodeId: {
3356
- type: "string",
3357
- description: "The node to trace deep lineage for"
3358
- },
3359
- maxDepth: {
3360
- type: "number",
3361
- description: "Maximum depth (default: 10, max: 20)"
3362
- }
3363
- },
3364
- required: ["nodeId"],
3365
- response: {
3366
- description: "Deep lineage tree with fork reasons and scoring history",
3367
- fields: {
3368
- tree: "object \u2014 nested ancestry tree",
3369
- totalDepth: "number",
3370
- forkCount: "number",
3371
- oldestAncestor: "object \u2014 the root ancestor"
3372
- }
3373
- },
3374
- ownerModule: "graph-search",
3375
- ontologyPrimitive: "graph",
3376
- tier: "sdk-only"
3377
- };
3378
- var GRAPH_AWARE_SEARCH = {
3379
- name: "graph_aware_search",
3380
- description: "Vector search enhanced with graph context expansion. Like `git grep` combined with graph neighborhood \u2014 finds semantically similar nodes then expands results by following graph edges to include structurally related context.",
3381
- parameters: {
3382
- query: { type: "string", description: "Semantic search query" },
3383
- topicId: { type: "string", description: "Topic scope" },
3384
- expansionHops: {
3385
- type: "number",
3386
- description: "Graph expansion depth after vector search (default: 1)"
3387
- },
3388
- limit: { type: "number", description: "Maximum results (default: 10)" }
3389
- },
3390
- required: ["query", "topicId"],
3391
- response: {
3392
- description: "Search results with graph-expanded context",
3393
- fields: {
3394
- results: "array \u2014 { nodeId, canonicalText, score, graphContext }",
3395
- expandedNodes: "number \u2014 additional nodes from graph expansion"
3396
- }
3397
- },
3398
- ownerModule: "graph-search",
3399
- ontologyPrimitive: "graph",
3400
- tier: "sdk-only"
3401
- };
3402
- var GET_COLLECTION_CONVICTION = {
3403
- name: "get_collection_conviction",
3404
- description: "Aggregate conviction score across a set of beliefs. Like `git shortlog` \u2014 summary statistics for a belief collection. Computes weighted average, min, max, and distribution of confidence across the set.",
3405
- parameters: {
3406
- topicId: { type: "string", description: "Topic scope" },
3407
- beliefIds: {
3408
- type: "array",
3409
- description: "Specific beliefs to aggregate (default: all project beliefs)"
3410
- },
3411
- groupBy: {
3412
- type: "string",
3413
- description: "Grouping dimension",
3414
- enum: ["domain", "branch", "worktree", "none"]
3415
- }
3416
- },
3417
- required: ["topicId"],
3418
- response: {
3419
- description: "Aggregate conviction metrics",
3420
- fields: {
3421
- averageConfidence: "number",
3422
- minConfidence: "number",
3423
- maxConfidence: "number",
3424
- distribution: "object \u2014 confidence histogram",
3425
- beliefCount: "number"
3426
- }
3427
- },
3428
- ownerModule: "graph-search",
3429
- ontologyPrimitive: "belief",
3430
- tier: "sdk-only"
3431
- };
3432
- var GET_CONVICTION_TREND = {
3433
- name: "get_conviction_trend",
3434
- description: "Time-series conviction analysis with pillar-level breakdown. Like `git log --graph --stat` over time \u2014 tracks how conviction evolves across scoring events. Returns data points suitable for charting conviction trajectory.",
3435
- parameters: {
3436
- topicId: { type: "string", description: "Topic scope" },
3437
- timeRange: {
3438
- type: "object",
3439
- description: "Time range: { start: number, end: number }"
3440
- },
3441
- granularity: {
3442
- type: "string",
3443
- description: "Time bucket size",
3444
- enum: ["day", "week", "month"]
3445
- }
3446
- },
3447
- required: ["topicId"],
3448
- response: {
3449
- description: "Time-series conviction data",
3450
- fields: {
3451
- dataPoints: "array \u2014 { timestamp, averageConfidence, beliefCount, scoringEvents }",
3452
- pillarBreakdown: "object \u2014 per-domain conviction trends"
3453
- }
3454
- },
3455
- ownerModule: "graph-search",
3456
- ontologyPrimitive: "belief",
3457
- tier: "sdk-only"
3458
- };
3459
- var ANALYZE_BELIEF_CRITICALITY = {
3460
- name: "analyze_belief_criticality",
3461
- description: "Criticality scoring for belief validation prioritization. Like `git bisect` for importance \u2014 identifies which beliefs are most critical to validate based on dependent judgments, downstream beliefs, and graph centrality.",
3462
- parameters: {
3463
- topicId: { type: "string", description: "Topic scope" },
3464
- limit: {
3465
- type: "number",
3466
- description: "Maximum beliefs to score (default: 20)"
3467
- }
3468
- },
3469
- required: ["topicId"],
3470
- response: {
3471
- description: "Beliefs ranked by criticality score",
3472
- fields: {
3473
- beliefs: "array \u2014 { nodeId, canonicalText, criticalityScore, dependentCount, centralityScore }"
3474
- }
3475
- },
3476
- ownerModule: "graph-search",
3477
- ontologyPrimitive: "belief",
3478
- tier: "sdk-only"
3479
- };
3480
- var ANALYZE_BELIEF_CLUSTER_CANDIDATES = {
3481
- name: "analyze_belief_cluster_candidates",
3482
- description: "Cross-project deduplication and similarity discovery. Like `git cherry` \u2014 finding equivalent commits across branches. Identifies beliefs that are semantically similar across projects or domains for potential merging.",
3483
- parameters: {
3484
- topicId: { type: "string", description: "Primary topic to analyze" },
3485
- crossProjectIds: {
3486
- type: "array",
3487
- description: "Other projects to compare against"
3488
- },
3489
- similarityThreshold: {
3490
- type: "number",
3491
- description: "Minimum similarity score (0-1, default: 0.8)"
3492
- }
3493
- },
3494
- required: ["topicId"],
3495
- response: {
3496
- description: "Cluster candidates with similarity scores",
3497
- fields: {
3498
- clusters: "array \u2014 { beliefs: array, similarityScore: number, suggestedAction: string }"
3499
- }
3500
- },
3501
- ownerModule: "graph-search",
3502
- ontologyPrimitive: "belief",
3503
- tier: "sdk-only"
3504
- };
3505
- var CREATE_BELIEF_CONDITIONAL = {
3506
- name: "create_belief_conditional",
3507
- description: "Create prerequisite or falsifier dependency edges between beliefs. Like `git config` for conditional logic \u2014 declares that one belief depends on or is falsified by another. These edges drive automated confidence cascading when conditions change.",
3508
- parameters: {
3509
- sourceBeliefId: { type: "string", description: "The dependent belief" },
3510
- targetBeliefId: {
3511
- type: "string",
3512
- description: "The prerequisite or falsifier belief"
3513
- },
3514
- conditionType: {
3515
- type: "string",
3516
- description: "Dependency type",
3517
- enum: ["prerequisite", "falsifier", "strengthener"]
3518
- },
3519
- rationale: { type: "string", description: "Why this dependency exists" }
3520
- },
3521
- required: ["sourceBeliefId", "targetBeliefId", "conditionType"],
3522
- response: {
3523
- description: "The conditional edge",
3524
- fields: {
3525
- edgeId: "string",
3526
- conditionType: "string",
3527
- sourceBeliefId: "string",
3528
- targetBeliefId: "string"
3529
- }
3530
- },
3531
- ownerModule: "graph-primitives",
3532
- ontologyPrimitive: "edge",
3533
- tier: "sdk-only"
3534
- };
3535
- var GET_NECESSARY_EVIDENCE = {
3536
- name: "get_necessary_evidence",
3537
- description: "Identify evidence requirements for merge readiness. Like `git status` before merge \u2014 shows what evidence is missing, what questions are unanswered, and what gaps need filling before a worktree can be confidently merged.",
3538
- parameters: {
3539
- worktreeId: { type: "string", description: "The worktree to evaluate" }
3540
- },
3541
- required: ["worktreeId"],
3542
- response: {
3543
- description: "Evidence requirements and gaps",
3544
- fields: {
3545
- missingEvidence: "array \u2014 beliefs without supporting evidence",
3546
- unansweredQuestions: "array \u2014 open questions",
3547
- weakSupport: "array \u2014 beliefs with insufficient evidence weight",
3548
- mergeReadiness: "number \u2014 0-1 readiness score"
3549
- }
3550
- },
3551
- ownerModule: "workflow-engine",
3552
- ontologyPrimitive: "evidence",
3553
- tier: "sdk-only"
3554
- };
3555
- var ANALYZE_REASONING_DEPTH = {
3556
- name: "analyze_reasoning_depth",
3557
- description: "Per-belief evidence grounding depth analysis. Like `git log --graph` depth analysis \u2014 measures how deeply each belief is grounded in evidence layers, from L1 sources through L2 evidence to L3 beliefs.",
3558
- parameters: {
3559
- topicId: { type: "string", description: "Topic scope" },
3560
- beliefIds: {
3561
- type: "array",
3562
- description: "Specific beliefs to analyze (default: all)"
3563
- }
3564
- },
3565
- required: ["topicId"],
3566
- response: {
3567
- description: "Reasoning depth metrics per belief",
3568
- fields: {
3569
- beliefs: "array \u2014 { nodeId, depth, evidenceCount, sourceCount, groundingScore }",
3570
- averageDepth: "number"
3571
- }
3572
- },
3573
- ownerModule: "graph-search",
3574
- ontologyPrimitive: "belief",
3575
- tier: "sdk-only"
3576
- };
3577
- var GET_EVIDENCE_BY_METHODOLOGY = {
3578
- name: "get_evidence_by_methodology",
3579
- description: "Evidence grouped by collection methodology. Like `git log --format` with custom grouping \u2014 organizes evidence by how it was gathered: primary research, secondary analysis, expert interview, quantitative data, etc.",
3580
- parameters: {
3581
- topicId: { type: "string", description: "Topic scope" },
3582
- methodology: {
3583
- type: "string",
3584
- description: "Filter to specific methodology"
3585
- }
3586
- },
3587
- required: ["topicId"],
3588
- response: {
3589
- description: "Evidence organized by methodology",
3590
- fields: {
3591
- groups: "object \u2014 { methodology: array of evidence nodes }",
3592
- totalCount: "number",
3593
- methodologyCoverage: "object \u2014 percentage breakdown"
3594
- }
3595
- },
3596
- ownerModule: "graph-search",
3597
- ontologyPrimitive: "evidence",
3598
- tier: "sdk-only"
3599
- };
3600
- var CREATE_EVIDENCE_TASK = {
3601
- name: "create_evidence_task",
3602
- description: "Create an evidence-focused work item with structured collection template. Like `git task` with evidence template \u2014 tracks concrete evidence-gathering actions with methodology, source requirements, and target beliefs pre-configured.",
3603
- parameters: {
3604
- title: { type: "string", description: "Task description" },
3605
- topicId: { type: "string", description: "Topic scope" },
3606
- methodology: {
3607
- type: "string",
3608
- description: "Evidence collection method",
3609
- enum: [
3610
- "interview",
3611
- "survey",
3612
- "data_analysis",
3613
- "document_review",
3614
- "field_research"
3615
- ]
3616
- },
3617
- targetBeliefId: {
3618
- type: "string",
3619
- description: "Belief this evidence task aims to test"
3620
- },
3621
- targetQuestionId: {
3622
- type: "string",
3623
- description: "Question this task addresses"
3624
- }
3625
- },
3626
- required: ["title", "topicId", "methodology"],
3627
- response: {
3628
- description: "The created evidence task",
3629
- fields: {
3630
- taskId: "string",
3631
- methodology: "string",
3632
- status: "string \u2014 'pending'"
3633
- }
3634
- },
3635
- ownerModule: "workflow-engine",
3636
- ontologyPrimitive: "task",
3637
- tier: "sdk-only"
3638
- };
3639
- var LIST_TASKS2 = {
3640
- name: "list_tasks",
3641
- description: "List tasks with filters for status, type, and assignment. Like `git task list` \u2014 returns work items with their current state, linked questions, and completion status.",
3642
- parameters: {
3643
- topicId: { type: "string", description: "Topic scope" },
3644
- status: {
3645
- type: "string",
3646
- description: "Filter by status",
3647
- enum: ["pending", "in_progress", "completed", "cancelled"]
3648
- },
3649
- taskType: {
3650
- type: "string",
3651
- description: "Filter by type",
3652
- enum: ["research", "interview", "analysis", "data_collection"]
3653
- },
3654
- worktreeId: { type: "string", description: "Filter to worktree scope" }
3655
- },
3656
- required: ["topicId"],
3657
- response: {
3658
- description: "Task list with metadata",
3659
- fields: {
3660
- tasks: "array \u2014 { taskId, title, status, taskType, linkedQuestionId, createdAt }"
3661
- }
3662
- },
3663
- ownerModule: "workflow-engine",
3664
- ontologyPrimitive: "task",
3665
- tier: "sdk-only"
3666
- };
3667
- var UPDATE_TASK2 = {
3668
- name: "update_task",
3669
- description: "Amend a task's details, status, or linked entities. Like `git task update` \u2014 updates task metadata, status transitions, reassignment, or relinks to a different worktree/belief/question. All changes are logged in the audit trail.",
3670
- parameters: {
3671
- taskId: { type: "string", description: "The task to update" },
3672
- linkedWorktreeId: {
3673
- type: "string",
3674
- description: "Reassign this task to a different worktree"
3675
- },
3676
- linkedBeliefId: {
3677
- type: "string",
3678
- description: "Link or relink this task to a belief node"
3679
- },
3680
- linkedQuestionId: {
3681
- type: "string",
3682
- description: "Link or relink this task to a question node"
3683
- },
3684
- title: { type: "string", description: "Updated title" },
3685
- description: {
3686
- type: "string",
3687
- description: "Updated task description"
3688
- },
3689
- priority: {
3690
- type: "string",
3691
- description: "Updated priority",
3692
- enum: ["critical", "high", "medium", "low"]
3693
- },
3694
- status: {
3695
- type: "string",
3696
- description: "New status",
3697
- enum: ["pending", "in_progress", "completed", "cancelled"]
3698
- },
3699
- notes: { type: "string", description: "Additional notes" }
3700
- },
3701
- required: ["taskId"],
3702
- response: {
3703
- description: "The updated task",
3704
- fields: { taskId: "string", status: "string", updatedAt: "number" }
3705
- },
3706
- ownerModule: "workflow-engine",
3707
- ontologyPrimitive: "task",
3708
- tier: "sdk-only"
3709
- };
3710
- var GET_TASK_COUNTS = {
3711
- name: "get_task_counts",
3712
- description: "Dashboard aggregate counts for task status distribution. Like `git shortlog -s` for tasks \u2014 returns counts grouped by status, type, and assignment. Useful for progress dashboards and workload balancing.",
3713
- parameters: {
3714
- topicId: { type: "string", description: "Topic scope" },
3715
- groupBy: {
3716
- type: "string",
3717
- description: "Grouping dimension",
3718
- enum: ["status", "type", "worktree", "assignee"]
3719
- }
3720
- },
3721
- required: ["topicId"],
3722
- response: {
3723
- description: "Task count aggregates",
3724
- fields: { counts: "object \u2014 { group: number }", total: "number" }
3725
- },
3726
- ownerModule: "workflow-engine",
3727
- ontologyPrimitive: "task",
3728
- tier: "sdk-only"
3729
- };
3730
- var ADD_RESEARCH_ACTION = {
3731
- name: "add_research_action",
3732
- description: "Append a concrete next action to a task. Like `git notes append` for tasks \u2014 adds specific follow-up actions without modifying the original task description.",
3733
- parameters: {
3734
- taskId: { type: "string", description: "The task to add an action to" },
3735
- action: { type: "string", description: "The concrete next step" },
3736
- priority: {
3737
- type: "string",
3738
- description: "Action priority",
3739
- enum: ["critical", "high", "medium", "low"]
3740
- }
3741
- },
3742
- required: ["taskId", "action"],
3743
- response: {
3744
- description: "The appended action",
3745
- fields: { actionId: "string", taskId: "string", createdAt: "number" }
3746
- },
3747
- ownerModule: "workflow-engine",
3748
- ontologyPrimitive: "task",
3749
- tier: "sdk-only"
3750
- };
3751
- var GET_PREDICTIONS = {
3752
- name: "get_predictions",
3753
- description: "Calibration tracking for prediction-bearing beliefs. Like `git tag --verify` for prediction accuracy \u2014 tracks beliefs with testable predictions, their stated confidence, and actual outcomes for calibration scoring.",
3754
- parameters: {
3755
- topicId: { type: "string", description: "Topic scope" },
3756
- status: {
3757
- type: "string",
3758
- description: "Prediction status filter",
3759
- enum: ["pending", "verified", "falsified", "expired"]
3760
- }
3761
- },
3762
- required: ["topicId"],
3763
- response: {
3764
- description: "Predictions with calibration data",
3765
- fields: {
3766
- predictions: "array \u2014 { beliefId, prediction, statedConfidence, outcome, calibrationDelta }",
3767
- overallCalibration: "number \u2014 Brier score or equivalent"
3768
- }
3769
- },
3770
- ownerModule: "graph-search",
3771
- ontologyPrimitive: "belief",
3772
- tier: "sdk-only"
3773
- };
3774
- var GET_SURPRISE_DETECTION = {
3775
- name: "get_surprise_detection",
3776
- description: "Analysis of ignored vs integrated surprise findings. Like `git diff --stat` for unexpected findings \u2014 identifies evidence that significantly deviated from prior beliefs and tracks whether it was integrated or dismissed.",
3777
- parameters: {
3778
- topicId: { type: "string", description: "Topic scope" },
3779
- surpriseThreshold: {
3780
- type: "number",
3781
- description: "Minimum surprise score to include (0-1, default: 0.5)"
3782
- }
3783
- },
3784
- required: ["topicId"],
3785
- response: {
3786
- description: "Surprise analysis",
3787
- fields: {
3788
- surprises: "array \u2014 { evidenceId, surpriseScore, integrated, affectedBeliefs }",
3789
- ignoredCount: "number",
3790
- integratedCount: "number"
3791
- }
3792
- },
3793
- ownerModule: "graph-search",
3794
- ontologyPrimitive: "evidence",
3795
- tier: "sdk-only"
3796
- };
3797
- var GET_CHALLENGED_BELIEFS = {
3798
- name: "get_challenged_beliefs",
3799
- description: "Find beliefs downstream of contradiction detection. Like `git log --grep=conflict` \u2014 identifies beliefs that have been challenged by contradictions, negative evidence, or confidence collapses.",
3800
- parameters: {
3801
- topicId: { type: "string", description: "Topic scope" },
3802
- minChallengeCount: {
3803
- type: "number",
3804
- description: "Minimum number of challenges (default: 1)"
3805
- }
3806
- },
3807
- required: ["topicId"],
3808
- response: {
3809
- description: "Challenged beliefs with challenge details",
3810
- fields: {
3811
- beliefs: "array \u2014 { nodeId, canonicalText, challengeCount, contradictions, negativeEvidence }"
3812
- }
3813
- },
3814
- ownerModule: "graph-search",
3815
- ontologyPrimitive: "belief",
3816
- tier: "sdk-only"
3817
- };
3818
- var GET_CAUSAL_CHAINS = {
3819
- name: "get_causal_chains",
3820
- description: "Trace cause/effect lineage through the reasoning graph. Like `git log --ancestry-path` \u2014 follows causal edges to build chains of reasoning from root causes to downstream effects.",
3821
- parameters: {
3822
- nodeId: {
3823
- type: "string",
3824
- description: "Starting node for causal traversal"
3825
- },
3826
- direction: {
3827
- type: "string",
3828
- description: "Trace direction",
3829
- enum: ["causes", "effects", "both"]
3830
- },
3831
- maxDepth: {
3832
- type: "number",
3833
- description: "Maximum chain depth (default: 5)"
3834
- }
3835
- },
3836
- required: ["nodeId"],
3837
- response: {
3838
- description: "Causal chains with strength annotations",
3839
- fields: {
3840
- chains: "array \u2014 { path: array, strength: number, chainType: string }",
3841
- totalChains: "number"
3842
- }
3843
- },
3844
- ownerModule: "graph-search",
3845
- ontologyPrimitive: "graph",
3846
- tier: "sdk-only"
3847
- };
3848
- var GET_NON_CONSENSUS_BELIEFS = {
3849
- name: "get_non_consensus_beliefs",
3850
- description: "Detect contrarian positions in the belief graph. Like `git log --no-merges` \u2014 standalone positions that diverge from the majority view. Identifies beliefs with low consensus among evidence sources or team members.",
3851
- parameters: {
3852
- topicId: { type: "string", description: "Topic scope" },
3853
- consensusThreshold: {
3854
- type: "number",
3855
- description: "Below this threshold marks non-consensus (default: 0.5)"
3856
- }
3857
- },
3858
- required: ["topicId"],
3859
- response: {
3860
- description: "Non-consensus beliefs with dissent analysis",
3861
- fields: {
3862
- beliefs: "array \u2014 { nodeId, canonicalText, consensusScore, dissentingSources, supportingSources }"
3863
- }
3864
- },
3865
- ownerModule: "graph-search",
3866
- ontologyPrimitive: "belief",
3867
- tier: "sdk-only"
3868
- };
3869
- var GET_BELIEFS_BY_EPISTEMIC_STATUS = {
3870
- name: "get_beliefs_by_epistemic_status",
3871
- description: "Filter beliefs by epistemic taxonomy labels. Like `git log --grep` with epistemic labels \u2014 filters beliefs by their epistemic classification: hypothesis, established, speculative, contested, retracted.",
3872
- parameters: {
3873
- topicId: { type: "string", description: "Topic scope" },
3874
- epistemicStatus: {
3875
- type: "string",
3876
- description: "Epistemic classification",
3877
- enum: [
3878
- "hypothesis",
3879
- "established",
3880
- "speculative",
3881
- "contested",
3882
- "retracted"
3883
- ]
3884
- }
3885
- },
3886
- required: ["topicId", "epistemicStatus"],
3887
- response: {
3888
- description: "Beliefs matching the epistemic status",
3889
- fields: {
3890
- beliefs: "array \u2014 { nodeId, canonicalText, confidence, epistemicStatus, lastModulated }",
3891
- count: "number"
3892
- }
3893
- },
3894
- ownerModule: "graph-search",
3895
- ontologyPrimitive: "belief",
3896
- tier: "sdk-only"
3897
- };
3898
- var GET_PRIVILEGED_EVIDENCE = {
3899
- name: "get_privileged_evidence",
3900
- description: "Retrieve high-value evidence with access characteristics. Like `git log --author` filtering for key sources \u2014 identifies evidence from privileged access: primary interviews, proprietary data, non-public filings, expert networks.",
3901
- parameters: {
3902
- topicId: { type: "string", description: "Topic scope" },
3903
- accessType: {
3904
- type: "string",
3905
- description: "Filter by access type",
3906
- enum: [
3907
- "primary_interview",
3908
- "proprietary_data",
3909
- "non_public",
3910
- "expert_network",
3911
- "field_research"
3912
- ]
3913
- }
3914
- },
3915
- required: ["topicId"],
3916
- response: {
3917
- description: "Privileged evidence items",
3918
- fields: {
3919
- evidence: "array \u2014 { nodeId, canonicalText, accessType, sourceDescription, linkedBeliefs }",
3920
- totalCount: "number"
3921
- }
3922
- },
3923
- ownerModule: "graph-search",
3924
- ontologyPrimitive: "evidence",
3925
- tier: "sdk-only"
3926
- };
3927
- var GET_PRIVILEGED_SIGNALS = {
3928
- name: "get_privileged_signals",
3929
- description: "Aggregate high-signal patterns across evidence. Like `git shortlog --summary` for signal strength \u2014 identifies recurring patterns across privileged evidence sources that may indicate strong conviction drivers.",
3930
- parameters: {
3931
- topicId: { type: "string", description: "Topic scope" },
3932
- minSignalStrength: {
3933
- type: "number",
3934
- description: "Minimum signal score (0-1, default: 0.7)"
3935
- }
3936
- },
3937
- required: ["topicId"],
3938
- response: {
3939
- description: "Aggregated signal patterns",
3940
- fields: {
3941
- signals: "array \u2014 { pattern, signalStrength, evidenceCount, sources, affectedBeliefs }",
3942
- totalSignals: "number"
3943
- }
3944
- },
3945
- ownerModule: "graph-search",
3946
- ontologyPrimitive: "evidence",
3947
- tier: "sdk-only"
3948
- };
3949
- var DETECT_ANCHORING_BIAS = {
3950
- name: "detect_anchoring_bias",
3951
- description: "Detect old unchallenged beliefs that may anchor reasoning. Like `git log --before` \u2014 finding stale commits that haven't been reviewed. Flags beliefs that were established early and have not received new evidence or challenge.",
3952
- parameters: {
3953
- topicId: { type: "string", description: "Topic scope" },
3954
- staleThresholdDays: {
3955
- type: "number",
3956
- description: "Days without new evidence to flag as anchored (default: 30)"
3957
- }
3958
- },
3959
- required: ["topicId"],
3960
- response: {
3961
- description: "Potentially anchored beliefs",
3962
- fields: {
3963
- beliefs: "array \u2014 { nodeId, canonicalText, daysSinceLastEvidence, originalConfidence, currentConfidence }",
3964
- riskLevel: "string \u2014 overall anchoring risk"
3965
- }
3966
- },
3967
- ownerModule: "graph-search",
3968
- ontologyPrimitive: "belief",
3969
- tier: "sdk-only"
3970
- };
3971
- var DETECT_SOURCE_CONCENTRATION = {
3972
- name: "detect_source_concentration",
3973
- description: "Detect single-source evidence risk across beliefs. Like `git shortlog` showing only one contributor \u2014 identifies beliefs where all supporting evidence comes from a single source or methodology.",
3974
- parameters: {
3975
- topicId: { type: "string", description: "Topic scope" },
3976
- concentrationThreshold: {
3977
- type: "number",
3978
- description: "Max acceptable single-source ratio (0-1, default: 0.8)"
3979
- }
3980
- },
3981
- required: ["topicId"],
3982
- response: {
3983
- description: "Source concentration analysis",
3984
- fields: {
3985
- beliefs: "array \u2014 { nodeId, canonicalText, dominantSource, concentrationRatio, uniqueSourceCount }",
3986
- highRiskCount: "number"
3987
- }
3988
- },
3989
- ownerModule: "graph-search",
3990
- ontologyPrimitive: "evidence",
3991
- tier: "sdk-only"
3992
- };
3993
- var FIND_SOFT_CONTRADICTIONS = {
3994
- name: "find_soft_contradictions",
3995
- description: "Detect semantic and embedding-level contradictions not flagged by explicit contradiction objects. Like `git diff --word-diff` for subtle conflicts \u2014 finds beliefs that are semantically in tension even though no formal contradiction has been flagged.",
3996
- parameters: {
3997
- topicId: { type: "string", description: "Topic scope" },
3998
- similarityThreshold: {
3999
- type: "number",
4000
- description: "Semantic similarity for contradiction detection (0-1, default: 0.7)"
4001
- }
4002
- },
4003
- required: ["topicId"],
4004
- response: {
4005
- description: "Soft contradiction pairs",
4006
- fields: {
4007
- pairs: "array \u2014 { beliefA, beliefB, tensionScore, tensionDescription }",
4008
- totalPairs: "number"
4009
- }
4010
- },
4011
- ownerModule: "graph-search",
4012
- ontologyPrimitive: "belief",
4013
- tier: "sdk-only"
4014
- };
4015
- var FIND_SEMANTIC_BRIDGES = {
4016
- name: "find_semantic_bridges",
4017
- description: "Find semantically similar but graph-distant nodes. Like `git cherry` \u2014 finding equivalent commits across branches that aren't connected. Identifies nodes that share semantic meaning but have no graph edges between them.",
4018
- parameters: {
4019
- topicId: { type: "string", description: "Topic scope" },
4020
- minSemanticSimilarity: {
4021
- type: "number",
4022
- description: "Minimum embedding similarity (0-1, default: 0.75)"
4023
- },
4024
- minGraphDistance: {
4025
- type: "number",
4026
- description: "Minimum graph hops to qualify as distant (default: 3)"
4027
- }
4028
- },
4029
- required: ["topicId"],
4030
- response: {
4031
- description: "Potential bridge pairs",
4032
- fields: {
4033
- bridges: "array \u2014 { nodeA, nodeB, semanticSimilarity, graphDistance, suggestedEdgeType }",
4034
- totalBridges: "number"
4035
- }
4036
- },
4037
- ownerModule: "graph-search",
4038
- ontologyPrimitive: "graph",
4039
- tier: "sdk-only"
4040
- };
4041
- var FIND_SEMANTIC_ORPHANS = {
4042
- name: "find_semantic_orphans",
4043
- description: "Find structurally connected but semantically distant nodes. Like `git fsck --lost-found` \u2014 nodes that are technically connected in the graph but semantically don't belong, possibly indicating miscategorization or stale edges.",
4044
- parameters: {
4045
- topicId: { type: "string", description: "Topic scope" },
4046
- maxSemanticSimilarity: {
4047
- type: "number",
4048
- description: "Maximum similarity to qualify as orphan (0-1, default: 0.3)"
4049
- }
4050
- },
4051
- required: ["topicId"],
4052
- response: {
4053
- description: "Semantic orphan nodes",
4054
- fields: {
4055
- orphans: "array \u2014 { nodeId, connectedTo, semanticSimilarity, edgeType, suggestedAction }",
4056
- totalOrphans: "number"
4057
- }
4058
- },
4059
- ownerModule: "graph-search",
4060
- ontologyPrimitive: "graph",
4061
- tier: "sdk-only"
4062
- };
4063
- var SDK_ONLY_TOOL_CONTRACTS = {
4064
- // 3.1 Advanced workflow & phase management
4065
- start_worktree: START_WORKTREE,
4066
- update_worktree_phase: UPDATE_WORKTREE_PHASE,
4067
- advance_worktree_phase: ADVANCE_WORKTREE_PHASE,
4068
- add_note_to_worktree: ADD_NOTE_TO_WORKTREE,
4069
- link_document_to_worktree: LINK_DOCUMENT_TO_WORKTREE,
4070
- link_evidence_to_worktree: LINK_EVIDENCE_TO_WORKTREE,
4071
- link_question_to_worktree: LINK_QUESTION_TO_WORKTREE,
4072
- link_belief_to_worktree: LINK_BELIEF_TO_WORKTREE,
4073
- create_synthesized_belief: CREATE_SYNTHESIZED_BELIEF,
4074
- complete_hypothesis_formation: COMPLETE_HYPOTHESIS_FORMATION,
4075
- complete_evidence_review: COMPLETE_EVIDENCE_REVIEW,
4076
- refine_worktree_belief: REFINE_WORKTREE_BELIEF,
4077
- // 3.2 Deeper graph navigation
4078
- trace_provenance: TRACE_PROVENANCE,
4079
- get_belief_relationships: GET_BELIEF_RELATIONSHIPS,
4080
- get_belief_support_chain: GET_BELIEF_SUPPORT_CHAIN,
4081
- explore_connections: EXPLORE_CONNECTIONS,
4082
- get_deep_lineage: GET_DEEP_LINEAGE,
4083
- graph_aware_search: GRAPH_AWARE_SEARCH,
4084
- // 3.3 Conviction & analytics
4085
- get_collection_conviction: GET_COLLECTION_CONVICTION,
4086
- get_conviction_trend: GET_CONVICTION_TREND,
4087
- analyze_belief_criticality: ANALYZE_BELIEF_CRITICALITY,
4088
- analyze_belief_cluster_candidates: ANALYZE_BELIEF_CLUSTER_CANDIDATES,
4089
- create_belief_conditional: CREATE_BELIEF_CONDITIONAL,
4090
- get_necessary_evidence: GET_NECESSARY_EVIDENCE,
4091
- analyze_reasoning_depth: ANALYZE_REASONING_DEPTH,
4092
- // 3.4 Extended question & evidence analytics
4093
- get_evidence_by_methodology: GET_EVIDENCE_BY_METHODOLOGY,
4094
- // 3.5 Task lifecycle (list_tasks + update_task are MCP tools, not SDK-only)
4095
- create_evidence_task: CREATE_EVIDENCE_TASK,
4096
- get_task_counts: GET_TASK_COUNTS,
4097
- add_research_action: ADD_RESEARCH_ACTION,
4098
- // 3.6 Domain analytics
4099
- get_predictions: GET_PREDICTIONS,
4100
- get_surprise_detection: GET_SURPRISE_DETECTION,
4101
- get_challenged_beliefs: GET_CHALLENGED_BELIEFS,
4102
- get_causal_chains: GET_CAUSAL_CHAINS,
4103
- get_non_consensus_beliefs: GET_NON_CONSENSUS_BELIEFS,
4104
- get_beliefs_by_epistemic_status: GET_BELIEFS_BY_EPISTEMIC_STATUS,
4105
- get_privileged_evidence: GET_PRIVILEGED_EVIDENCE,
4106
- get_privileged_signals: GET_PRIVILEGED_SIGNALS,
4107
- // 3.7 Bias detection suite (detect_confirmation_bias is in MCP)
4108
- detect_anchoring_bias: DETECT_ANCHORING_BIAS,
4109
- detect_source_concentration: DETECT_SOURCE_CONCENTRATION,
4110
- find_soft_contradictions: FIND_SOFT_CONTRADICTIONS,
4111
- find_semantic_bridges: FIND_SEMANTIC_BRIDGES,
4112
- find_semantic_orphans: FIND_SEMANTIC_ORPHANS
4113
- };
4114
- var ALL_SDK_TOOL_CONTRACTS = {
4115
- ...MCP_TOOL_CONTRACTS,
4116
- ...SDK_ONLY_TOOL_CONTRACTS
4117
- };
4118
- var SDK_ONLY_TOOL_NAMES = Object.keys(SDK_ONLY_TOOL_CONTRACTS);
4119
- var ALL_SDK_TOOL_NAMES = Object.keys(ALL_SDK_TOOL_CONTRACTS);
4120
- function validateSdkGitSemantics(tool) {
4121
- const desc = tool.description;
4122
- const hasGitReference = /Like (`git |a `git |a merge conflict|opening a `git)/.test(desc);
4123
- if (!hasGitReference) {
4124
- return {
4125
- valid: false,
4126
- reason: `SDK tool "${tool.name}" description missing git-semantic reference`
4127
- };
4128
- }
4129
- return { valid: true };
4130
- }
21
+ var sdk_tools_contract_exports = {};
22
+ __reExport(sdk_tools_contract_exports, sdk_tools_star);
4131
23
 
4132
- export { ADD_NOTE_TO_WORKTREE, ADD_RESEARCH_ACTION, ADVANCE_WORKTREE_PHASE, ALL_SDK_TOOL_CONTRACTS, ALL_SDK_TOOL_NAMES, ANALYZE_BELIEF_CLUSTER_CANDIDATES, ANALYZE_BELIEF_CRITICALITY, ANALYZE_REASONING_DEPTH, COMPLETE_EVIDENCE_REVIEW, COMPLETE_HYPOTHESIS_FORMATION, CREATE_BELIEF_CONDITIONAL, CREATE_EVIDENCE_TASK, CREATE_SYNTHESIZED_BELIEF, DETECT_ANCHORING_BIAS, DETECT_SOURCE_CONCENTRATION, EXPLORE_CONNECTIONS, FIND_SEMANTIC_BRIDGES, FIND_SEMANTIC_ORPHANS, FIND_SOFT_CONTRADICTIONS, GET_BELIEFS_BY_EPISTEMIC_STATUS, GET_BELIEF_RELATIONSHIPS, GET_BELIEF_SUPPORT_CHAIN, GET_CAUSAL_CHAINS, GET_CHALLENGED_BELIEFS, GET_COLLECTION_CONVICTION, GET_CONVICTION_TREND, GET_DEEP_LINEAGE, GET_EVIDENCE_BY_METHODOLOGY, GET_NECESSARY_EVIDENCE, GET_NON_CONSENSUS_BELIEFS, GET_PREDICTIONS, GET_PRIVILEGED_EVIDENCE, GET_PRIVILEGED_SIGNALS, GET_SURPRISE_DETECTION, GET_TASK_COUNTS, GRAPH_AWARE_SEARCH, LINK_BELIEF_TO_WORKTREE, LINK_DOCUMENT_TO_WORKTREE, LINK_EVIDENCE_TO_WORKTREE, LINK_QUESTION_TO_WORKTREE, LIST_TASKS2 as LIST_TASKS, REFINE_WORKTREE_BELIEF, SDK_ONLY_TOOL_CONTRACTS, SDK_ONLY_TOOL_NAMES, START_WORKTREE, TRACE_PROVENANCE, UPDATE_TASK2 as UPDATE_TASK, UPDATE_WORKTREE_PHASE, validateSdkGitSemantics };
24
+ // src/contracts/sdkTools.ts
25
+ __reExport(sdkTools_exports, sdk_tools_contract_exports);
4133
26
  //# sourceMappingURL=sdkTools.js.map
4134
27
  //# sourceMappingURL=sdkTools.js.map