@lucern/contracts 0.1.0 → 0.1.1-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.
- package/dist/index.d.ts +2003 -21
- package/dist/index.js +5627 -22
- package/package.json +15 -25
- package/src/agents/v1.ts +8 -0
- package/src/api-enums.contract.ts +183 -0
- package/src/auth-context.contract.ts +9 -0
- package/src/auth-session.contract.ts +9 -0
- package/src/auth.contract.ts +162 -0
- package/src/beliefs/v1.ts +8 -0
- package/src/context-pack.contract.ts +704 -0
- package/src/convex-admin.contract.ts +14 -0
- package/src/events-types.contract.ts +9 -0
- package/src/events.contract.ts +376 -0
- package/src/evidence/v1.ts +8 -0
- package/src/gateway.contract.ts +151 -0
- package/src/graph/v1.ts +8 -0
- package/src/ids.contract.ts +36 -0
- package/src/index.ts +30 -0
- package/src/lens-filter.contract.ts +183 -0
- package/src/lens-workflow.contract.ts +162 -0
- package/src/mcp-tools.contract.ts +3636 -0
- package/src/ontologies/v1.ts +8 -0
- package/src/ontology-matching.contract.ts +9 -0
- package/src/prompt.contract.ts +50 -0
- package/src/questions/v1.ts +8 -0
- package/src/sdk-methods.contract.ts +522 -0
- package/src/sdk-tools.contract.ts +1545 -0
- package/src/text-matching.contract.ts +347 -0
- package/src/topic-scope.contract.ts +9 -0
- package/src/topics/v1.ts +8 -0
- package/src/v1/agents/v1.ts +8 -0
- package/src/v1/beliefs/v1.ts +8 -0
- package/src/v1/evidence/v1.ts +8 -0
- package/src/v1/graph/v1.ts +8 -0
- package/src/v1/ontologies/v1.ts +276 -0
- package/src/v1/questions/v1.ts +8 -0
- package/src/v1/topics/v1.ts +79 -0
- package/src/v1/worktrees/v1.ts +8 -0
- package/src/workflow-runtime.contract.ts +440 -0
- package/src/worktrees/v1.ts +8 -0
- package/tsconfig.json +9 -0
- package/dist/api-enums.contract.d.ts +0 -59
- package/dist/api-enums.contract.d.ts.map +0 -1
- package/dist/api-enums.contract.js +0 -148
- package/dist/api-enums.contract.js.map +0 -1
- package/dist/auth-session.contract.d.ts +0 -54
- package/dist/auth-session.contract.d.ts.map +0 -1
- package/dist/auth-session.contract.js +0 -50
- package/dist/auth-session.contract.js.map +0 -1
- package/dist/context-pack.contract.d.ts +0 -495
- package/dist/context-pack.contract.d.ts.map +0 -1
- package/dist/context-pack.contract.js +0 -170
- package/dist/context-pack.contract.js.map +0 -1
- package/dist/gateway.contract.d.ts +0 -74
- package/dist/gateway.contract.d.ts.map +0 -1
- package/dist/gateway.contract.js +0 -12
- package/dist/gateway.contract.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lens-filter.contract.d.ts +0 -71
- package/dist/lens-filter.contract.d.ts.map +0 -1
- package/dist/lens-filter.contract.js +0 -96
- package/dist/lens-filter.contract.js.map +0 -1
- package/dist/lens-workflow.contract.d.ts +0 -85
- package/dist/lens-workflow.contract.d.ts.map +0 -1
- package/dist/lens-workflow.contract.js +0 -55
- package/dist/lens-workflow.contract.js.map +0 -1
- package/dist/mcp-tools.contract.d.ts +0 -152
- package/dist/mcp-tools.contract.d.ts.map +0 -1
- package/dist/mcp-tools.contract.js +0 -3282
- package/dist/mcp-tools.contract.js.map +0 -1
- package/dist/prompt.contract.d.ts +0 -25
- package/dist/prompt.contract.d.ts.map +0 -1
- package/dist/prompt.contract.js +0 -25
- package/dist/prompt.contract.js.map +0 -1
- package/dist/sdk-methods.contract.d.ts +0 -356
- package/dist/sdk-methods.contract.d.ts.map +0 -1
- package/dist/sdk-methods.contract.js +0 -17
- package/dist/sdk-methods.contract.js.map +0 -1
- package/dist/sdk-tools.contract.d.ts +0 -93
- package/dist/sdk-tools.contract.d.ts.map +0 -1
- package/dist/sdk-tools.contract.js +0 -1399
- package/dist/sdk-tools.contract.js.map +0 -1
- package/dist/workflow-runtime.contract.d.ts +0 -162
- package/dist/workflow-runtime.contract.d.ts.map +0 -1
- package/dist/workflow-runtime.contract.js +0 -258
- package/dist/workflow-runtime.contract.js.map +0 -1
|
@@ -1,1399 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SDK-Only Tool Contract Definitions
|
|
3
|
-
*
|
|
4
|
-
* Tools available in @lucern/sdk but NOT in the MCP gateway.
|
|
5
|
-
* The SDK unfolds deeper capabilities after the MCP gateway shows developers what's possible.
|
|
6
|
-
*
|
|
7
|
-
* Total SDK surface = MCP tools (44) + SDK-only tools (44) = 88 tools
|
|
8
|
-
*
|
|
9
|
-
* These tools are organized into capability tiers:
|
|
10
|
-
* - Advanced workflow & phase management (12 tools)
|
|
11
|
-
* - Deeper graph navigation (6 tools)
|
|
12
|
-
* - Conviction & analytics (7 tools)
|
|
13
|
-
* - Extended question & evidence analytics (1 tool; core lifecycle promoted to MCP)
|
|
14
|
-
* - Task lifecycle (5 tools)
|
|
15
|
-
* - Domain analytics (8 tools)
|
|
16
|
-
* - Bias detection suite (5 tools)
|
|
17
|
-
*
|
|
18
|
-
* CONTRACT SURFACE: These definitions are the external API for SDK consumers.
|
|
19
|
-
* Renaming a tool or changing its description is a BREAKING CHANGE.
|
|
20
|
-
*
|
|
21
|
-
* Git-native naming rules (same as MCP, enforced by lint):
|
|
22
|
-
* 1. Workflow tools use git verbs directly
|
|
23
|
-
* 2. Knowledge tools use epistemic verbs
|
|
24
|
-
* 3. First sentence of description includes the git analog verb
|
|
25
|
-
* 4. Description includes "Like `git X`" parenthetical
|
|
26
|
-
* 5. Parameter names use domain terms (canonicalText, nodeId, confidence)
|
|
27
|
-
*/
|
|
28
|
-
import { MCP_TOOL_CONTRACTS } from "./mcp-tools.contract";
|
|
29
|
-
// =============================================================================
|
|
30
|
-
// 3.1 ADVANCED WORKFLOW & PHASE MANAGEMENT (12 tools)
|
|
31
|
-
// =============================================================================
|
|
32
|
-
export const START_WORKTREE = {
|
|
33
|
-
name: "start_worktree",
|
|
34
|
-
description: "Transition a draft worktree to active. " +
|
|
35
|
-
"Like `git checkout -b` — the branch becomes your working context. " +
|
|
36
|
-
"A worktree must be started before beliefs can be committed to it.",
|
|
37
|
-
parameters: {
|
|
38
|
-
worktreeId: {
|
|
39
|
-
type: "string",
|
|
40
|
-
description: "The draft worktree to activate",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
required: ["worktreeId"],
|
|
44
|
-
response: {
|
|
45
|
-
description: "The activated worktree",
|
|
46
|
-
fields: {
|
|
47
|
-
worktreeId: "string",
|
|
48
|
-
status: "string — 'active'",
|
|
49
|
-
startedAt: "number",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
ownerModule: "workflow-engine",
|
|
53
|
-
ontologyPrimitive: "worktree",
|
|
54
|
-
tier: "sdk-only",
|
|
55
|
-
};
|
|
56
|
-
export const UPDATE_WORKTREE_PHASE = {
|
|
57
|
-
name: "update_worktree_phase",
|
|
58
|
-
description: "Set a worktree's phase explicitly. " +
|
|
59
|
-
"Like `git config` for workflow state — manually sets the current investigation phase. " +
|
|
60
|
-
"Phases: hypothesis_formation, evidence_collection, evidence_review, synthesis, scoring.",
|
|
61
|
-
parameters: {
|
|
62
|
-
worktreeId: { type: "string", description: "The worktree to update" },
|
|
63
|
-
phase: {
|
|
64
|
-
type: "string",
|
|
65
|
-
description: "Target phase",
|
|
66
|
-
enum: [
|
|
67
|
-
"hypothesis_formation",
|
|
68
|
-
"evidence_collection",
|
|
69
|
-
"evidence_review",
|
|
70
|
-
"synthesis",
|
|
71
|
-
"scoring",
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
reason: { type: "string", description: "Why the phase is being set" },
|
|
75
|
-
},
|
|
76
|
-
required: ["worktreeId", "phase"],
|
|
77
|
-
response: {
|
|
78
|
-
description: "Updated worktree phase",
|
|
79
|
-
fields: {
|
|
80
|
-
worktreeId: "string",
|
|
81
|
-
previousPhase: "string",
|
|
82
|
-
newPhase: "string",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
ownerModule: "workflow-engine",
|
|
86
|
-
ontologyPrimitive: "worktree",
|
|
87
|
-
tier: "sdk-only",
|
|
88
|
-
};
|
|
89
|
-
export const ADVANCE_WORKTREE_PHASE = {
|
|
90
|
-
name: "advance_worktree_phase",
|
|
91
|
-
description: "Auto-advance a worktree to the next phase after requirements pass. " +
|
|
92
|
-
"Like `git hooks` post-commit — automatic progression when phase gates are satisfied. " +
|
|
93
|
-
"Validates that all phase requirements are met before advancing.",
|
|
94
|
-
parameters: {
|
|
95
|
-
worktreeId: { type: "string", description: "The worktree to advance" },
|
|
96
|
-
},
|
|
97
|
-
required: ["worktreeId"],
|
|
98
|
-
response: {
|
|
99
|
-
description: "Phase advancement result",
|
|
100
|
-
fields: {
|
|
101
|
-
worktreeId: "string",
|
|
102
|
-
previousPhase: "string",
|
|
103
|
-
newPhase: "string",
|
|
104
|
-
requirementsMet: "boolean",
|
|
105
|
-
failedRequirements: "array | null — requirements that blocked advancement",
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
ownerModule: "workflow-engine",
|
|
109
|
-
ontologyPrimitive: "worktree",
|
|
110
|
-
tier: "sdk-only",
|
|
111
|
-
};
|
|
112
|
-
export const ADD_NOTE_TO_WORKTREE = {
|
|
113
|
-
name: "add_note_to_worktree",
|
|
114
|
-
description: "Attach contextual metadata to a worktree. " +
|
|
115
|
-
"Like `git notes` — annotations that don't change the commit itself. " +
|
|
116
|
-
"Notes persist across phase transitions and appear in the audit trail.",
|
|
117
|
-
parameters: {
|
|
118
|
-
worktreeId: { type: "string", description: "The worktree to annotate" },
|
|
119
|
-
content: { type: "string", description: "Note content" },
|
|
120
|
-
noteType: {
|
|
121
|
-
type: "string",
|
|
122
|
-
description: "Note category",
|
|
123
|
-
enum: ["observation", "decision", "risk", "context"],
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
required: ["worktreeId", "content"],
|
|
127
|
-
response: {
|
|
128
|
-
description: "The created note",
|
|
129
|
-
fields: { noteId: "string", worktreeId: "string", createdAt: "number" },
|
|
130
|
-
},
|
|
131
|
-
ownerModule: "workflow-engine",
|
|
132
|
-
ontologyPrimitive: "worktree",
|
|
133
|
-
tier: "sdk-only",
|
|
134
|
-
};
|
|
135
|
-
export const LINK_DOCUMENT_TO_WORKTREE = {
|
|
136
|
-
name: "link_document_to_worktree",
|
|
137
|
-
description: "Attach a source document to a worktree. " +
|
|
138
|
-
"Like `git submodule add` — external references tracked within the worktree context. " +
|
|
139
|
-
"Documents become available as evidence sources for the investigation.",
|
|
140
|
-
parameters: {
|
|
141
|
-
worktreeId: { type: "string", description: "The worktree to link to" },
|
|
142
|
-
documentUrl: {
|
|
143
|
-
type: "string",
|
|
144
|
-
description: "URL or ID of the source document",
|
|
145
|
-
},
|
|
146
|
-
title: { type: "string", description: "Document title for display" },
|
|
147
|
-
documentType: {
|
|
148
|
-
type: "string",
|
|
149
|
-
description: "Document category",
|
|
150
|
-
enum: ["report", "transcript", "filing", "article", "dataset"],
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
required: ["worktreeId", "documentUrl", "title"],
|
|
154
|
-
response: {
|
|
155
|
-
description: "The document link",
|
|
156
|
-
fields: { linkId: "string", worktreeId: "string", documentUrl: "string" },
|
|
157
|
-
},
|
|
158
|
-
ownerModule: "workflow-engine",
|
|
159
|
-
ontologyPrimitive: "worktree",
|
|
160
|
-
tier: "sdk-only",
|
|
161
|
-
};
|
|
162
|
-
export const LINK_EVIDENCE_TO_WORKTREE = {
|
|
163
|
-
name: "link_evidence_to_worktree",
|
|
164
|
-
description: "Stage evidence in a worktree for later processing. " +
|
|
165
|
-
"Like `git stash` — evidence waiting to be committed into the belief graph. " +
|
|
166
|
-
"Staged evidence is visible in the worktree but not yet linked to beliefs.",
|
|
167
|
-
parameters: {
|
|
168
|
-
worktreeId: { type: "string", description: "The worktree to stage in" },
|
|
169
|
-
evidenceId: { type: "string", description: "The evidence node to stage" },
|
|
170
|
-
rationale: {
|
|
171
|
-
type: "string",
|
|
172
|
-
description: "Why this evidence is relevant to the worktree",
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
required: ["worktreeId", "evidenceId"],
|
|
176
|
-
response: {
|
|
177
|
-
description: "The staged evidence link",
|
|
178
|
-
fields: { linkId: "string", worktreeId: "string", evidenceId: "string" },
|
|
179
|
-
},
|
|
180
|
-
ownerModule: "workflow-engine",
|
|
181
|
-
ontologyPrimitive: "worktree",
|
|
182
|
-
tier: "sdk-only",
|
|
183
|
-
};
|
|
184
|
-
export const LINK_QUESTION_TO_WORKTREE = {
|
|
185
|
-
name: "link_question_to_worktree",
|
|
186
|
-
description: "Attach a question to a worktree for tracking. " +
|
|
187
|
-
"Like `git issue link` — associates an open question with an active investigation. " +
|
|
188
|
-
"Questions linked to a worktree guide evidence collection within that scope.",
|
|
189
|
-
parameters: {
|
|
190
|
-
worktreeId: { type: "string", description: "The worktree to link to" },
|
|
191
|
-
questionId: { type: "string", description: "The question to attach" },
|
|
192
|
-
},
|
|
193
|
-
required: ["worktreeId", "questionId"],
|
|
194
|
-
response: {
|
|
195
|
-
description: "The question-worktree link",
|
|
196
|
-
fields: { linkId: "string", worktreeId: "string", questionId: "string" },
|
|
197
|
-
},
|
|
198
|
-
ownerModule: "workflow-engine",
|
|
199
|
-
ontologyPrimitive: "worktree",
|
|
200
|
-
tier: "sdk-only",
|
|
201
|
-
};
|
|
202
|
-
export const LINK_BELIEF_TO_WORKTREE = {
|
|
203
|
-
name: "link_belief_to_worktree",
|
|
204
|
-
description: "Attach beliefs to a worktree for investigation. " +
|
|
205
|
-
"Like `git cherry-pick` — selecting specific beliefs to investigate in this branch. " +
|
|
206
|
-
"Linked beliefs become the target of evidence collection and scoring.",
|
|
207
|
-
parameters: {
|
|
208
|
-
worktreeId: { type: "string", description: "The worktree to link to" },
|
|
209
|
-
beliefId: { type: "string", description: "The belief to attach" },
|
|
210
|
-
role: {
|
|
211
|
-
type: "string",
|
|
212
|
-
description: "Role of the belief in this worktree",
|
|
213
|
-
enum: ["primary", "supporting", "challenging"],
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
required: ["worktreeId", "beliefId"],
|
|
217
|
-
response: {
|
|
218
|
-
description: "The belief-worktree link",
|
|
219
|
-
fields: {
|
|
220
|
-
linkId: "string",
|
|
221
|
-
worktreeId: "string",
|
|
222
|
-
beliefId: "string",
|
|
223
|
-
role: "string",
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
ownerModule: "workflow-engine",
|
|
227
|
-
ontologyPrimitive: "worktree",
|
|
228
|
-
tier: "sdk-only",
|
|
229
|
-
};
|
|
230
|
-
export const CREATE_SYNTHESIZED_BELIEF = {
|
|
231
|
-
name: "create_synthesized_belief",
|
|
232
|
-
description: "Consolidate draft artifacts into a synthesized belief. " +
|
|
233
|
-
"Like `git squash` — combining multiple commits into a single coherent unit. " +
|
|
234
|
-
"Takes multiple draft beliefs, evidence, and notes and produces one synthesized belief.",
|
|
235
|
-
parameters: {
|
|
236
|
-
worktreeId: {
|
|
237
|
-
type: "string",
|
|
238
|
-
description: "The worktree context for synthesis",
|
|
239
|
-
},
|
|
240
|
-
sourceBeliefIds: {
|
|
241
|
-
type: "array",
|
|
242
|
-
description: "Draft beliefs to consolidate",
|
|
243
|
-
},
|
|
244
|
-
canonicalText: {
|
|
245
|
-
type: "string",
|
|
246
|
-
description: "The synthesized belief statement",
|
|
247
|
-
},
|
|
248
|
-
synthesisRationale: {
|
|
249
|
-
type: "string",
|
|
250
|
-
description: "How the synthesis was derived",
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
required: ["worktreeId", "sourceBeliefIds", "canonicalText"],
|
|
254
|
-
response: {
|
|
255
|
-
description: "The synthesized belief",
|
|
256
|
-
fields: {
|
|
257
|
-
nodeId: "string",
|
|
258
|
-
sourceCount: "number",
|
|
259
|
-
synthesisRationale: "string",
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
ownerModule: "workflow-engine",
|
|
263
|
-
ontologyPrimitive: "belief",
|
|
264
|
-
tier: "sdk-only",
|
|
265
|
-
};
|
|
266
|
-
export const COMPLETE_HYPOTHESIS_FORMATION = {
|
|
267
|
-
name: "complete_hypothesis_formation",
|
|
268
|
-
description: "Phase gate for hypothesis formation completion. " +
|
|
269
|
-
"Like `git tag` marking a milestone — certifies that the hypothesis formation phase is done. " +
|
|
270
|
-
"Validates that the worktree has a testable hypothesis and linked beliefs.",
|
|
271
|
-
parameters: {
|
|
272
|
-
worktreeId: {
|
|
273
|
-
type: "string",
|
|
274
|
-
description: "The worktree completing hypothesis formation",
|
|
275
|
-
},
|
|
276
|
-
summary: { type: "string", description: "Summary of hypotheses formed" },
|
|
277
|
-
},
|
|
278
|
-
required: ["worktreeId"],
|
|
279
|
-
response: {
|
|
280
|
-
description: "Phase gate result",
|
|
281
|
-
fields: {
|
|
282
|
-
worktreeId: "string",
|
|
283
|
-
passed: "boolean",
|
|
284
|
-
newPhase: "string",
|
|
285
|
-
failedChecks: "array | null",
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
ownerModule: "workflow-engine",
|
|
289
|
-
ontologyPrimitive: "worktree",
|
|
290
|
-
tier: "sdk-only",
|
|
291
|
-
};
|
|
292
|
-
export const COMPLETE_EVIDENCE_REVIEW = {
|
|
293
|
-
name: "complete_evidence_review",
|
|
294
|
-
description: "Phase gate for evidence review completion. " +
|
|
295
|
-
"Like `git tag` marking evidence collection complete — certifies that sufficient evidence " +
|
|
296
|
-
"has been gathered and reviewed for the worktree to proceed to synthesis.",
|
|
297
|
-
parameters: {
|
|
298
|
-
worktreeId: {
|
|
299
|
-
type: "string",
|
|
300
|
-
description: "The worktree completing evidence review",
|
|
301
|
-
},
|
|
302
|
-
summary: { type: "string", description: "Summary of evidence reviewed" },
|
|
303
|
-
},
|
|
304
|
-
required: ["worktreeId"],
|
|
305
|
-
response: {
|
|
306
|
-
description: "Phase gate result",
|
|
307
|
-
fields: {
|
|
308
|
-
worktreeId: "string",
|
|
309
|
-
passed: "boolean",
|
|
310
|
-
newPhase: "string",
|
|
311
|
-
evidenceCount: "number",
|
|
312
|
-
},
|
|
313
|
-
},
|
|
314
|
-
ownerModule: "workflow-engine",
|
|
315
|
-
ontologyPrimitive: "worktree",
|
|
316
|
-
tier: "sdk-only",
|
|
317
|
-
};
|
|
318
|
-
export const REFINE_WORKTREE_BELIEF = {
|
|
319
|
-
name: "refine_worktree_belief",
|
|
320
|
-
description: "Amend a belief within a worktree context. " +
|
|
321
|
-
"Like `git commit --amend` on a feature branch — rewrites draft belief text " +
|
|
322
|
-
"while maintaining worktree context and linked evidence.",
|
|
323
|
-
parameters: {
|
|
324
|
-
worktreeId: { type: "string", description: "The worktree context" },
|
|
325
|
-
beliefId: { type: "string", description: "The belief to refine" },
|
|
326
|
-
canonicalText: { type: "string", description: "Updated belief statement" },
|
|
327
|
-
rationale: { type: "string", description: "Why the refinement was made" },
|
|
328
|
-
},
|
|
329
|
-
required: ["worktreeId", "beliefId", "canonicalText"],
|
|
330
|
-
response: {
|
|
331
|
-
description: "The refined belief within worktree context",
|
|
332
|
-
fields: { beliefId: "string", worktreeId: "string", updatedAt: "number" },
|
|
333
|
-
},
|
|
334
|
-
ownerModule: "workflow-engine",
|
|
335
|
-
ontologyPrimitive: "belief",
|
|
336
|
-
tier: "sdk-only",
|
|
337
|
-
};
|
|
338
|
-
// =============================================================================
|
|
339
|
-
// 3.2 DEEPER GRAPH NAVIGATION (6 tools)
|
|
340
|
-
// =============================================================================
|
|
341
|
-
export const TRACE_PROVENANCE = {
|
|
342
|
-
name: "trace_provenance",
|
|
343
|
-
description: "Fast lineage trace for any node type in the reasoning graph. " +
|
|
344
|
-
"Like `git log --follow` — tracks renames, forks, and full ancestry chain. " +
|
|
345
|
-
"Works on beliefs, evidence, questions, and judgments alike.",
|
|
346
|
-
parameters: {
|
|
347
|
-
nodeId: { type: "string", description: "The node to trace provenance for" },
|
|
348
|
-
depth: {
|
|
349
|
-
type: "number",
|
|
350
|
-
description: "Maximum ancestry depth (default: 10)",
|
|
351
|
-
},
|
|
352
|
-
includeEdgeTypes: {
|
|
353
|
-
type: "array",
|
|
354
|
-
description: "Filter to specific edge types",
|
|
355
|
-
},
|
|
356
|
-
},
|
|
357
|
-
required: ["nodeId"],
|
|
358
|
-
response: {
|
|
359
|
-
description: "Provenance chain with typed ancestry",
|
|
360
|
-
fields: {
|
|
361
|
-
chain: "array — ancestry nodes",
|
|
362
|
-
edges: "array — connecting edges",
|
|
363
|
-
totalDepth: "number",
|
|
364
|
-
},
|
|
365
|
-
},
|
|
366
|
-
ownerModule: "graph-search",
|
|
367
|
-
ontologyPrimitive: "graph",
|
|
368
|
-
tier: "sdk-only",
|
|
369
|
-
};
|
|
370
|
-
export const GET_BELIEF_RELATIONSHIPS = {
|
|
371
|
-
name: "get_belief_relationships",
|
|
372
|
-
description: "Get structured cluster-edge map for a belief, grouped by relationship type. " +
|
|
373
|
-
"Like `git show --stat` — a relationship summary showing all connections. " +
|
|
374
|
-
"Returns evidence, questions, contradictions, forks, and dependent judgments.",
|
|
375
|
-
parameters: {
|
|
376
|
-
nodeId: { type: "string", description: "The belief to analyze" },
|
|
377
|
-
},
|
|
378
|
-
required: ["nodeId"],
|
|
379
|
-
response: {
|
|
380
|
-
description: "Relationships grouped by type",
|
|
381
|
-
fields: {
|
|
382
|
-
evidence: "array — linked evidence nodes",
|
|
383
|
-
questions: "array — testing questions",
|
|
384
|
-
contradictions: "array — flagged contradictions",
|
|
385
|
-
forks: "array — child forks",
|
|
386
|
-
judgments: "array — dependent judgments",
|
|
387
|
-
},
|
|
388
|
-
},
|
|
389
|
-
ownerModule: "graph-search",
|
|
390
|
-
ontologyPrimitive: "belief",
|
|
391
|
-
tier: "sdk-only",
|
|
392
|
-
};
|
|
393
|
-
export const GET_BELIEF_SUPPORT_CHAIN = {
|
|
394
|
-
name: "get_belief_support_chain",
|
|
395
|
-
description: "Full Neo4j traversal: Belief <- Question <- Evidence support chain. " +
|
|
396
|
-
"Like `git log --graph --all` — the richest evidence retrieval path. " +
|
|
397
|
-
"Returns the complete support structure showing how evidence flows through questions to beliefs.",
|
|
398
|
-
parameters: {
|
|
399
|
-
nodeId: { type: "string", description: "The belief to trace support for" },
|
|
400
|
-
includeWeights: {
|
|
401
|
-
type: "boolean",
|
|
402
|
-
description: "Include edge weights in response",
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
required: ["nodeId"],
|
|
406
|
-
response: {
|
|
407
|
-
description: "Full support chain from evidence through questions to belief",
|
|
408
|
-
fields: {
|
|
409
|
-
belief: "object — the target belief",
|
|
410
|
-
questions: "array — testing questions with their evidence",
|
|
411
|
-
totalEvidenceCount: "number",
|
|
412
|
-
netSupportWeight: "number",
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
ownerModule: "graph-search",
|
|
416
|
-
ontologyPrimitive: "belief",
|
|
417
|
-
tier: "sdk-only",
|
|
418
|
-
};
|
|
419
|
-
export const EXPLORE_CONNECTIONS = {
|
|
420
|
-
name: "explore_connections",
|
|
421
|
-
description: "Multi-hop neighbor exploration via Neo4j graph traversal. " +
|
|
422
|
-
"Like `git log --all --oneline` — broad discovery of connected nodes. " +
|
|
423
|
-
"Explores outward from a starting node across multiple hops, returning the discovered subgraph.",
|
|
424
|
-
parameters: {
|
|
425
|
-
nodeId: { type: "string", description: "Starting node for exploration" },
|
|
426
|
-
hops: {
|
|
427
|
-
type: "number",
|
|
428
|
-
description: "Number of hops to explore (default: 2, max: 5)",
|
|
429
|
-
},
|
|
430
|
-
nodeTypes: { type: "array", description: "Filter to specific node types" },
|
|
431
|
-
},
|
|
432
|
-
required: ["nodeId"],
|
|
433
|
-
response: {
|
|
434
|
-
description: "Discovered subgraph with nodes and edges",
|
|
435
|
-
fields: {
|
|
436
|
-
nodes: "array — discovered nodes",
|
|
437
|
-
edges: "array — connecting edges",
|
|
438
|
-
hopsTraversed: "number",
|
|
439
|
-
},
|
|
440
|
-
},
|
|
441
|
-
ownerModule: "graph-search",
|
|
442
|
-
ontologyPrimitive: "graph",
|
|
443
|
-
tier: "sdk-only",
|
|
444
|
-
};
|
|
445
|
-
export const GET_DEEP_LINEAGE = {
|
|
446
|
-
name: "get_deep_lineage",
|
|
447
|
-
description: "10-level Neo4j ancestry traversal for deep history. " +
|
|
448
|
-
"Like `git log -10 --graph` — traces deep fork chains, supersedes edges, and confidence evolution. " +
|
|
449
|
-
"Returns the full ancestor tree with fork reasons and scoring history at each level.",
|
|
450
|
-
parameters: {
|
|
451
|
-
nodeId: {
|
|
452
|
-
type: "string",
|
|
453
|
-
description: "The node to trace deep lineage for",
|
|
454
|
-
},
|
|
455
|
-
maxDepth: {
|
|
456
|
-
type: "number",
|
|
457
|
-
description: "Maximum depth (default: 10, max: 20)",
|
|
458
|
-
},
|
|
459
|
-
},
|
|
460
|
-
required: ["nodeId"],
|
|
461
|
-
response: {
|
|
462
|
-
description: "Deep lineage tree with fork reasons and scoring history",
|
|
463
|
-
fields: {
|
|
464
|
-
tree: "object — nested ancestry tree",
|
|
465
|
-
totalDepth: "number",
|
|
466
|
-
forkCount: "number",
|
|
467
|
-
oldestAncestor: "object — the root ancestor",
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
|
-
ownerModule: "graph-search",
|
|
471
|
-
ontologyPrimitive: "graph",
|
|
472
|
-
tier: "sdk-only",
|
|
473
|
-
};
|
|
474
|
-
export const GRAPH_AWARE_SEARCH = {
|
|
475
|
-
name: "graph_aware_search",
|
|
476
|
-
description: "Vector search enhanced with graph context expansion. " +
|
|
477
|
-
"Like `git grep` combined with graph neighborhood — finds semantically similar nodes " +
|
|
478
|
-
"then expands results by following graph edges to include structurally related context.",
|
|
479
|
-
parameters: {
|
|
480
|
-
query: { type: "string", description: "Semantic search query" },
|
|
481
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
482
|
-
projectId: {
|
|
483
|
-
type: "string",
|
|
484
|
-
description: "Deprecated legacy alias for topic scope",
|
|
485
|
-
},
|
|
486
|
-
expansionHops: {
|
|
487
|
-
type: "number",
|
|
488
|
-
description: "Graph expansion depth after vector search (default: 1)",
|
|
489
|
-
},
|
|
490
|
-
limit: { type: "number", description: "Maximum results (default: 10)" },
|
|
491
|
-
},
|
|
492
|
-
required: ["query", "topicId"],
|
|
493
|
-
response: {
|
|
494
|
-
description: "Search results with graph-expanded context",
|
|
495
|
-
fields: {
|
|
496
|
-
results: "array — { nodeId, canonicalText, score, graphContext }",
|
|
497
|
-
expandedNodes: "number — additional nodes from graph expansion",
|
|
498
|
-
},
|
|
499
|
-
},
|
|
500
|
-
ownerModule: "graph-search",
|
|
501
|
-
ontologyPrimitive: "graph",
|
|
502
|
-
tier: "sdk-only",
|
|
503
|
-
};
|
|
504
|
-
// =============================================================================
|
|
505
|
-
// 3.3 CONVICTION & ANALYTICS (7 tools)
|
|
506
|
-
// =============================================================================
|
|
507
|
-
export const GET_COLLECTION_CONVICTION = {
|
|
508
|
-
name: "get_collection_conviction",
|
|
509
|
-
description: "Aggregate conviction score across a set of beliefs. " +
|
|
510
|
-
"Like `git shortlog` — summary statistics for a belief collection. " +
|
|
511
|
-
"Computes weighted average, min, max, and distribution of confidence across the set.",
|
|
512
|
-
parameters: {
|
|
513
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
514
|
-
projectId: {
|
|
515
|
-
type: "string",
|
|
516
|
-
description: "Deprecated legacy alias for topic scope",
|
|
517
|
-
},
|
|
518
|
-
beliefIds: {
|
|
519
|
-
type: "array",
|
|
520
|
-
description: "Specific beliefs to aggregate (default: all project beliefs)",
|
|
521
|
-
},
|
|
522
|
-
groupBy: {
|
|
523
|
-
type: "string",
|
|
524
|
-
description: "Grouping dimension",
|
|
525
|
-
enum: ["domain", "branch", "worktree", "none"],
|
|
526
|
-
},
|
|
527
|
-
},
|
|
528
|
-
required: ["topicId"],
|
|
529
|
-
response: {
|
|
530
|
-
description: "Aggregate conviction metrics",
|
|
531
|
-
fields: {
|
|
532
|
-
averageConfidence: "number",
|
|
533
|
-
minConfidence: "number",
|
|
534
|
-
maxConfidence: "number",
|
|
535
|
-
distribution: "object — confidence histogram",
|
|
536
|
-
beliefCount: "number",
|
|
537
|
-
},
|
|
538
|
-
},
|
|
539
|
-
ownerModule: "graph-search",
|
|
540
|
-
ontologyPrimitive: "belief",
|
|
541
|
-
tier: "sdk-only",
|
|
542
|
-
};
|
|
543
|
-
export const GET_CONVICTION_TREND = {
|
|
544
|
-
name: "get_conviction_trend",
|
|
545
|
-
description: "Time-series conviction analysis with pillar-level breakdown. " +
|
|
546
|
-
"Like `git log --graph --stat` over time — tracks how conviction evolves across scoring events. " +
|
|
547
|
-
"Returns data points suitable for charting conviction trajectory.",
|
|
548
|
-
parameters: {
|
|
549
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
550
|
-
projectId: {
|
|
551
|
-
type: "string",
|
|
552
|
-
description: "Deprecated legacy alias for topic scope",
|
|
553
|
-
},
|
|
554
|
-
timeRange: {
|
|
555
|
-
type: "object",
|
|
556
|
-
description: "Time range: { start: number, end: number }",
|
|
557
|
-
},
|
|
558
|
-
granularity: {
|
|
559
|
-
type: "string",
|
|
560
|
-
description: "Time bucket size",
|
|
561
|
-
enum: ["day", "week", "month"],
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
required: ["topicId"],
|
|
565
|
-
response: {
|
|
566
|
-
description: "Time-series conviction data",
|
|
567
|
-
fields: {
|
|
568
|
-
dataPoints: "array — { timestamp, averageConfidence, beliefCount, scoringEvents }",
|
|
569
|
-
pillarBreakdown: "object — per-domain conviction trends",
|
|
570
|
-
},
|
|
571
|
-
},
|
|
572
|
-
ownerModule: "graph-search",
|
|
573
|
-
ontologyPrimitive: "belief",
|
|
574
|
-
tier: "sdk-only",
|
|
575
|
-
};
|
|
576
|
-
export const ANALYZE_BELIEF_CRITICALITY = {
|
|
577
|
-
name: "analyze_belief_criticality",
|
|
578
|
-
description: "Criticality scoring for belief validation prioritization. " +
|
|
579
|
-
"Like `git bisect` for importance — identifies which beliefs are most critical " +
|
|
580
|
-
"to validate based on dependent judgments, downstream beliefs, and graph centrality.",
|
|
581
|
-
parameters: {
|
|
582
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
583
|
-
projectId: {
|
|
584
|
-
type: "string",
|
|
585
|
-
description: "Deprecated legacy alias for topic scope",
|
|
586
|
-
},
|
|
587
|
-
limit: {
|
|
588
|
-
type: "number",
|
|
589
|
-
description: "Maximum beliefs to score (default: 20)",
|
|
590
|
-
},
|
|
591
|
-
},
|
|
592
|
-
required: ["topicId"],
|
|
593
|
-
response: {
|
|
594
|
-
description: "Beliefs ranked by criticality score",
|
|
595
|
-
fields: {
|
|
596
|
-
beliefs: "array — { nodeId, canonicalText, criticalityScore, dependentCount, centralityScore }",
|
|
597
|
-
},
|
|
598
|
-
},
|
|
599
|
-
ownerModule: "graph-search",
|
|
600
|
-
ontologyPrimitive: "belief",
|
|
601
|
-
tier: "sdk-only",
|
|
602
|
-
};
|
|
603
|
-
export const ANALYZE_BELIEF_CLUSTER_CANDIDATES = {
|
|
604
|
-
name: "analyze_belief_cluster_candidates",
|
|
605
|
-
description: "Cross-project deduplication and similarity discovery. " +
|
|
606
|
-
"Like `git cherry` — finding equivalent commits across branches. " +
|
|
607
|
-
"Identifies beliefs that are semantically similar across projects or domains for potential merging.",
|
|
608
|
-
parameters: {
|
|
609
|
-
topicId: { type: "string", description: "Primary topic to analyze" },
|
|
610
|
-
projectId: {
|
|
611
|
-
type: "string",
|
|
612
|
-
description: "Deprecated legacy alias for topic scope",
|
|
613
|
-
},
|
|
614
|
-
crossProjectIds: {
|
|
615
|
-
type: "array",
|
|
616
|
-
description: "Other projects to compare against",
|
|
617
|
-
},
|
|
618
|
-
similarityThreshold: {
|
|
619
|
-
type: "number",
|
|
620
|
-
description: "Minimum similarity score (0-1, default: 0.8)",
|
|
621
|
-
},
|
|
622
|
-
},
|
|
623
|
-
required: ["topicId"],
|
|
624
|
-
response: {
|
|
625
|
-
description: "Cluster candidates with similarity scores",
|
|
626
|
-
fields: {
|
|
627
|
-
clusters: "array — { beliefs: array, similarityScore: number, suggestedAction: string }",
|
|
628
|
-
},
|
|
629
|
-
},
|
|
630
|
-
ownerModule: "graph-search",
|
|
631
|
-
ontologyPrimitive: "belief",
|
|
632
|
-
tier: "sdk-only",
|
|
633
|
-
};
|
|
634
|
-
export const CREATE_BELIEF_CONDITIONAL = {
|
|
635
|
-
name: "create_belief_conditional",
|
|
636
|
-
description: "Create prerequisite or falsifier dependency edges between beliefs. " +
|
|
637
|
-
"Like `git config` for conditional logic — declares that one belief depends on or is falsified by another. " +
|
|
638
|
-
"These edges drive automated confidence cascading when conditions change.",
|
|
639
|
-
parameters: {
|
|
640
|
-
sourceBeliefId: { type: "string", description: "The dependent belief" },
|
|
641
|
-
targetBeliefId: {
|
|
642
|
-
type: "string",
|
|
643
|
-
description: "The prerequisite or falsifier belief",
|
|
644
|
-
},
|
|
645
|
-
conditionType: {
|
|
646
|
-
type: "string",
|
|
647
|
-
description: "Dependency type",
|
|
648
|
-
enum: ["prerequisite", "falsifier", "strengthener"],
|
|
649
|
-
},
|
|
650
|
-
rationale: { type: "string", description: "Why this dependency exists" },
|
|
651
|
-
},
|
|
652
|
-
required: ["sourceBeliefId", "targetBeliefId", "conditionType"],
|
|
653
|
-
response: {
|
|
654
|
-
description: "The conditional edge",
|
|
655
|
-
fields: {
|
|
656
|
-
edgeId: "string",
|
|
657
|
-
conditionType: "string",
|
|
658
|
-
sourceBeliefId: "string",
|
|
659
|
-
targetBeliefId: "string",
|
|
660
|
-
},
|
|
661
|
-
},
|
|
662
|
-
ownerModule: "graph-primitives",
|
|
663
|
-
ontologyPrimitive: "edge",
|
|
664
|
-
tier: "sdk-only",
|
|
665
|
-
};
|
|
666
|
-
export const GET_NECESSARY_EVIDENCE = {
|
|
667
|
-
name: "get_necessary_evidence",
|
|
668
|
-
description: "Identify evidence requirements for merge readiness. " +
|
|
669
|
-
"Like `git status` before merge — shows what evidence is missing, what questions are unanswered, " +
|
|
670
|
-
"and what gaps need filling before a worktree can be confidently merged.",
|
|
671
|
-
parameters: {
|
|
672
|
-
worktreeId: { type: "string", description: "The worktree to evaluate" },
|
|
673
|
-
},
|
|
674
|
-
required: ["worktreeId"],
|
|
675
|
-
response: {
|
|
676
|
-
description: "Evidence requirements and gaps",
|
|
677
|
-
fields: {
|
|
678
|
-
missingEvidence: "array — beliefs without supporting evidence",
|
|
679
|
-
unansweredQuestions: "array — open questions",
|
|
680
|
-
weakSupport: "array — beliefs with insufficient evidence weight",
|
|
681
|
-
mergeReadiness: "number — 0-1 readiness score",
|
|
682
|
-
},
|
|
683
|
-
},
|
|
684
|
-
ownerModule: "workflow-engine",
|
|
685
|
-
ontologyPrimitive: "evidence",
|
|
686
|
-
tier: "sdk-only",
|
|
687
|
-
};
|
|
688
|
-
export const ANALYZE_REASONING_DEPTH = {
|
|
689
|
-
name: "analyze_reasoning_depth",
|
|
690
|
-
description: "Per-belief evidence grounding depth analysis. " +
|
|
691
|
-
"Like `git log --graph` depth analysis — measures how deeply each belief is grounded " +
|
|
692
|
-
"in evidence layers, from L1 sources through L2 evidence to L3 beliefs.",
|
|
693
|
-
parameters: {
|
|
694
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
695
|
-
projectId: {
|
|
696
|
-
type: "string",
|
|
697
|
-
description: "Deprecated legacy alias for topic scope",
|
|
698
|
-
},
|
|
699
|
-
beliefIds: {
|
|
700
|
-
type: "array",
|
|
701
|
-
description: "Specific beliefs to analyze (default: all)",
|
|
702
|
-
},
|
|
703
|
-
},
|
|
704
|
-
required: ["topicId"],
|
|
705
|
-
response: {
|
|
706
|
-
description: "Reasoning depth metrics per belief",
|
|
707
|
-
fields: {
|
|
708
|
-
beliefs: "array — { nodeId, depth, evidenceCount, sourceCount, groundingScore }",
|
|
709
|
-
averageDepth: "number",
|
|
710
|
-
},
|
|
711
|
-
},
|
|
712
|
-
ownerModule: "graph-search",
|
|
713
|
-
ontologyPrimitive: "belief",
|
|
714
|
-
tier: "sdk-only",
|
|
715
|
-
};
|
|
716
|
-
// =============================================================================
|
|
717
|
-
// 3.4 EXTENDED QUESTION & EVIDENCE ANALYTICS (1 SDK-only tool; core lifecycle moved to MCP)
|
|
718
|
-
// =============================================================================
|
|
719
|
-
export const GET_EVIDENCE_BY_METHODOLOGY = {
|
|
720
|
-
name: "get_evidence_by_methodology",
|
|
721
|
-
description: "Evidence grouped by collection methodology. " +
|
|
722
|
-
"Like `git log --format` with custom grouping — organizes evidence by how it was gathered: " +
|
|
723
|
-
"primary research, secondary analysis, expert interview, quantitative data, etc.",
|
|
724
|
-
parameters: {
|
|
725
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
726
|
-
projectId: {
|
|
727
|
-
type: "string",
|
|
728
|
-
description: "Deprecated legacy alias for topic scope",
|
|
729
|
-
},
|
|
730
|
-
methodology: {
|
|
731
|
-
type: "string",
|
|
732
|
-
description: "Filter to specific methodology",
|
|
733
|
-
},
|
|
734
|
-
},
|
|
735
|
-
required: ["topicId"],
|
|
736
|
-
response: {
|
|
737
|
-
description: "Evidence organized by methodology",
|
|
738
|
-
fields: {
|
|
739
|
-
groups: "object — { methodology: array of evidence nodes }",
|
|
740
|
-
totalCount: "number",
|
|
741
|
-
methodologyCoverage: "object — percentage breakdown",
|
|
742
|
-
},
|
|
743
|
-
},
|
|
744
|
-
ownerModule: "graph-search",
|
|
745
|
-
ontologyPrimitive: "evidence",
|
|
746
|
-
tier: "sdk-only",
|
|
747
|
-
};
|
|
748
|
-
// =============================================================================
|
|
749
|
-
// 3.5 TASK LIFECYCLE (5 tools)
|
|
750
|
-
// =============================================================================
|
|
751
|
-
export const CREATE_EVIDENCE_TASK = {
|
|
752
|
-
name: "create_evidence_task",
|
|
753
|
-
description: "Create an evidence-focused work item with structured collection template. " +
|
|
754
|
-
"Like `git task` with evidence template — tracks concrete evidence-gathering actions " +
|
|
755
|
-
"with methodology, source requirements, and target beliefs pre-configured.",
|
|
756
|
-
parameters: {
|
|
757
|
-
title: { type: "string", description: "Task description" },
|
|
758
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
759
|
-
projectId: {
|
|
760
|
-
type: "string",
|
|
761
|
-
description: "Deprecated legacy alias for topic scope",
|
|
762
|
-
},
|
|
763
|
-
methodology: {
|
|
764
|
-
type: "string",
|
|
765
|
-
description: "Evidence collection method",
|
|
766
|
-
enum: [
|
|
767
|
-
"interview",
|
|
768
|
-
"survey",
|
|
769
|
-
"data_analysis",
|
|
770
|
-
"document_review",
|
|
771
|
-
"field_research",
|
|
772
|
-
],
|
|
773
|
-
},
|
|
774
|
-
targetBeliefId: {
|
|
775
|
-
type: "string",
|
|
776
|
-
description: "Belief this evidence task aims to test",
|
|
777
|
-
},
|
|
778
|
-
targetQuestionId: {
|
|
779
|
-
type: "string",
|
|
780
|
-
description: "Question this task addresses",
|
|
781
|
-
},
|
|
782
|
-
},
|
|
783
|
-
required: ["title", "topicId", "methodology"],
|
|
784
|
-
response: {
|
|
785
|
-
description: "The created evidence task",
|
|
786
|
-
fields: {
|
|
787
|
-
taskId: "string",
|
|
788
|
-
methodology: "string",
|
|
789
|
-
status: "string — 'pending'",
|
|
790
|
-
},
|
|
791
|
-
},
|
|
792
|
-
ownerModule: "workflow-engine",
|
|
793
|
-
ontologyPrimitive: "task",
|
|
794
|
-
tier: "sdk-only",
|
|
795
|
-
};
|
|
796
|
-
export const LIST_TASKS = {
|
|
797
|
-
name: "list_tasks",
|
|
798
|
-
description: "List tasks with filters for status, type, and assignment. " +
|
|
799
|
-
"Like `git task list` — returns work items with their current state, " +
|
|
800
|
-
"linked questions, and completion status.",
|
|
801
|
-
parameters: {
|
|
802
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
803
|
-
projectId: {
|
|
804
|
-
type: "string",
|
|
805
|
-
description: "Deprecated legacy alias for topic scope",
|
|
806
|
-
},
|
|
807
|
-
status: {
|
|
808
|
-
type: "string",
|
|
809
|
-
description: "Filter by status",
|
|
810
|
-
enum: ["pending", "in_progress", "completed", "cancelled"],
|
|
811
|
-
},
|
|
812
|
-
taskType: {
|
|
813
|
-
type: "string",
|
|
814
|
-
description: "Filter by type",
|
|
815
|
-
enum: ["research", "interview", "analysis", "data_collection"],
|
|
816
|
-
},
|
|
817
|
-
worktreeId: { type: "string", description: "Filter to worktree scope" },
|
|
818
|
-
},
|
|
819
|
-
required: ["topicId"],
|
|
820
|
-
response: {
|
|
821
|
-
description: "Task list with metadata",
|
|
822
|
-
fields: {
|
|
823
|
-
tasks: "array — { taskId, title, status, taskType, linkedQuestionId, createdAt }",
|
|
824
|
-
},
|
|
825
|
-
},
|
|
826
|
-
ownerModule: "workflow-engine",
|
|
827
|
-
ontologyPrimitive: "task",
|
|
828
|
-
tier: "sdk-only",
|
|
829
|
-
};
|
|
830
|
-
export const UPDATE_TASK = {
|
|
831
|
-
name: "update_task",
|
|
832
|
-
description: "Amend a task's details, status, or linked entities. " +
|
|
833
|
-
"Like `git task update` — updates task metadata, status transitions, reassignment, or relinks to a different worktree/belief/question. " +
|
|
834
|
-
"All changes are logged in the audit trail.",
|
|
835
|
-
parameters: {
|
|
836
|
-
taskId: { type: "string", description: "The task to update" },
|
|
837
|
-
linkedWorktreeId: {
|
|
838
|
-
type: "string",
|
|
839
|
-
description: "Reassign this task to a different worktree",
|
|
840
|
-
},
|
|
841
|
-
linkedBeliefId: {
|
|
842
|
-
type: "string",
|
|
843
|
-
description: "Link or relink this task to a belief node",
|
|
844
|
-
},
|
|
845
|
-
linkedQuestionId: {
|
|
846
|
-
type: "string",
|
|
847
|
-
description: "Link or relink this task to a question node",
|
|
848
|
-
},
|
|
849
|
-
title: { type: "string", description: "Updated title" },
|
|
850
|
-
description: {
|
|
851
|
-
type: "string",
|
|
852
|
-
description: "Updated task description",
|
|
853
|
-
},
|
|
854
|
-
priority: {
|
|
855
|
-
type: "string",
|
|
856
|
-
description: "Updated priority",
|
|
857
|
-
enum: ["critical", "high", "medium", "low"],
|
|
858
|
-
},
|
|
859
|
-
status: {
|
|
860
|
-
type: "string",
|
|
861
|
-
description: "New status",
|
|
862
|
-
enum: ["pending", "in_progress", "completed", "cancelled"],
|
|
863
|
-
},
|
|
864
|
-
notes: { type: "string", description: "Additional notes" },
|
|
865
|
-
},
|
|
866
|
-
required: ["taskId"],
|
|
867
|
-
response: {
|
|
868
|
-
description: "The updated task",
|
|
869
|
-
fields: { taskId: "string", status: "string", updatedAt: "number" },
|
|
870
|
-
},
|
|
871
|
-
ownerModule: "workflow-engine",
|
|
872
|
-
ontologyPrimitive: "task",
|
|
873
|
-
tier: "sdk-only",
|
|
874
|
-
};
|
|
875
|
-
export const GET_TASK_COUNTS = {
|
|
876
|
-
name: "get_task_counts",
|
|
877
|
-
description: "Dashboard aggregate counts for task status distribution. " +
|
|
878
|
-
"Like `git shortlog -s` for tasks — returns counts grouped by status, type, and assignment. " +
|
|
879
|
-
"Useful for progress dashboards and workload balancing.",
|
|
880
|
-
parameters: {
|
|
881
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
882
|
-
projectId: {
|
|
883
|
-
type: "string",
|
|
884
|
-
description: "Deprecated legacy alias for topic scope",
|
|
885
|
-
},
|
|
886
|
-
groupBy: {
|
|
887
|
-
type: "string",
|
|
888
|
-
description: "Grouping dimension",
|
|
889
|
-
enum: ["status", "type", "worktree", "assignee"],
|
|
890
|
-
},
|
|
891
|
-
},
|
|
892
|
-
required: ["topicId"],
|
|
893
|
-
response: {
|
|
894
|
-
description: "Task count aggregates",
|
|
895
|
-
fields: { counts: "object — { group: number }", total: "number" },
|
|
896
|
-
},
|
|
897
|
-
ownerModule: "workflow-engine",
|
|
898
|
-
ontologyPrimitive: "task",
|
|
899
|
-
tier: "sdk-only",
|
|
900
|
-
};
|
|
901
|
-
export const ADD_RESEARCH_ACTION = {
|
|
902
|
-
name: "add_research_action",
|
|
903
|
-
description: "Append a concrete next action to a task. " +
|
|
904
|
-
"Like `git notes append` for tasks — adds specific follow-up actions " +
|
|
905
|
-
"without modifying the original task description.",
|
|
906
|
-
parameters: {
|
|
907
|
-
taskId: { type: "string", description: "The task to add an action to" },
|
|
908
|
-
action: { type: "string", description: "The concrete next step" },
|
|
909
|
-
priority: {
|
|
910
|
-
type: "string",
|
|
911
|
-
description: "Action priority",
|
|
912
|
-
enum: ["critical", "high", "medium", "low"],
|
|
913
|
-
},
|
|
914
|
-
},
|
|
915
|
-
required: ["taskId", "action"],
|
|
916
|
-
response: {
|
|
917
|
-
description: "The appended action",
|
|
918
|
-
fields: { actionId: "string", taskId: "string", createdAt: "number" },
|
|
919
|
-
},
|
|
920
|
-
ownerModule: "workflow-engine",
|
|
921
|
-
ontologyPrimitive: "task",
|
|
922
|
-
tier: "sdk-only",
|
|
923
|
-
};
|
|
924
|
-
// =============================================================================
|
|
925
|
-
// 3.6 DOMAIN ANALYTICS (8 tools)
|
|
926
|
-
// =============================================================================
|
|
927
|
-
export const GET_PREDICTIONS = {
|
|
928
|
-
name: "get_predictions",
|
|
929
|
-
description: "Calibration tracking for prediction-bearing beliefs. " +
|
|
930
|
-
"Like `git tag --verify` for prediction accuracy — tracks beliefs with testable predictions, " +
|
|
931
|
-
"their stated confidence, and actual outcomes for calibration scoring.",
|
|
932
|
-
parameters: {
|
|
933
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
934
|
-
projectId: {
|
|
935
|
-
type: "string",
|
|
936
|
-
description: "Deprecated legacy alias for topic scope",
|
|
937
|
-
},
|
|
938
|
-
status: {
|
|
939
|
-
type: "string",
|
|
940
|
-
description: "Prediction status filter",
|
|
941
|
-
enum: ["pending", "verified", "falsified", "expired"],
|
|
942
|
-
},
|
|
943
|
-
},
|
|
944
|
-
required: ["topicId"],
|
|
945
|
-
response: {
|
|
946
|
-
description: "Predictions with calibration data",
|
|
947
|
-
fields: {
|
|
948
|
-
predictions: "array — { beliefId, prediction, statedConfidence, outcome, calibrationDelta }",
|
|
949
|
-
overallCalibration: "number — Brier score or equivalent",
|
|
950
|
-
},
|
|
951
|
-
},
|
|
952
|
-
ownerModule: "graph-search",
|
|
953
|
-
ontologyPrimitive: "belief",
|
|
954
|
-
tier: "sdk-only",
|
|
955
|
-
};
|
|
956
|
-
export const GET_SURPRISE_DETECTION = {
|
|
957
|
-
name: "get_surprise_detection",
|
|
958
|
-
description: "Analysis of ignored vs integrated surprise findings. " +
|
|
959
|
-
"Like `git diff --stat` for unexpected findings — identifies evidence that significantly " +
|
|
960
|
-
"deviated from prior beliefs and tracks whether it was integrated or dismissed.",
|
|
961
|
-
parameters: {
|
|
962
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
963
|
-
projectId: {
|
|
964
|
-
type: "string",
|
|
965
|
-
description: "Deprecated legacy alias for topic scope",
|
|
966
|
-
},
|
|
967
|
-
surpriseThreshold: {
|
|
968
|
-
type: "number",
|
|
969
|
-
description: "Minimum surprise score to include (0-1, default: 0.5)",
|
|
970
|
-
},
|
|
971
|
-
},
|
|
972
|
-
required: ["topicId"],
|
|
973
|
-
response: {
|
|
974
|
-
description: "Surprise analysis",
|
|
975
|
-
fields: {
|
|
976
|
-
surprises: "array — { evidenceId, surpriseScore, integrated, affectedBeliefs }",
|
|
977
|
-
ignoredCount: "number",
|
|
978
|
-
integratedCount: "number",
|
|
979
|
-
},
|
|
980
|
-
},
|
|
981
|
-
ownerModule: "graph-search",
|
|
982
|
-
ontologyPrimitive: "evidence",
|
|
983
|
-
tier: "sdk-only",
|
|
984
|
-
};
|
|
985
|
-
export const GET_CHALLENGED_BELIEFS = {
|
|
986
|
-
name: "get_challenged_beliefs",
|
|
987
|
-
description: "Find beliefs downstream of contradiction detection. " +
|
|
988
|
-
"Like `git log --grep=conflict` — identifies beliefs that have been challenged by contradictions, " +
|
|
989
|
-
"negative evidence, or confidence collapses.",
|
|
990
|
-
parameters: {
|
|
991
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
992
|
-
projectId: {
|
|
993
|
-
type: "string",
|
|
994
|
-
description: "Deprecated legacy alias for topic scope",
|
|
995
|
-
},
|
|
996
|
-
minChallengeCount: {
|
|
997
|
-
type: "number",
|
|
998
|
-
description: "Minimum number of challenges (default: 1)",
|
|
999
|
-
},
|
|
1000
|
-
},
|
|
1001
|
-
required: ["topicId"],
|
|
1002
|
-
response: {
|
|
1003
|
-
description: "Challenged beliefs with challenge details",
|
|
1004
|
-
fields: {
|
|
1005
|
-
beliefs: "array — { nodeId, canonicalText, challengeCount, contradictions, negativeEvidence }",
|
|
1006
|
-
},
|
|
1007
|
-
},
|
|
1008
|
-
ownerModule: "graph-search",
|
|
1009
|
-
ontologyPrimitive: "belief",
|
|
1010
|
-
tier: "sdk-only",
|
|
1011
|
-
};
|
|
1012
|
-
export const GET_CAUSAL_CHAINS = {
|
|
1013
|
-
name: "get_causal_chains",
|
|
1014
|
-
description: "Trace cause/effect lineage through the reasoning graph. " +
|
|
1015
|
-
"Like `git log --ancestry-path` — follows causal edges to build chains of reasoning " +
|
|
1016
|
-
"from root causes to downstream effects.",
|
|
1017
|
-
parameters: {
|
|
1018
|
-
nodeId: {
|
|
1019
|
-
type: "string",
|
|
1020
|
-
description: "Starting node for causal traversal",
|
|
1021
|
-
},
|
|
1022
|
-
direction: {
|
|
1023
|
-
type: "string",
|
|
1024
|
-
description: "Trace direction",
|
|
1025
|
-
enum: ["causes", "effects", "both"],
|
|
1026
|
-
},
|
|
1027
|
-
maxDepth: {
|
|
1028
|
-
type: "number",
|
|
1029
|
-
description: "Maximum chain depth (default: 5)",
|
|
1030
|
-
},
|
|
1031
|
-
},
|
|
1032
|
-
required: ["nodeId"],
|
|
1033
|
-
response: {
|
|
1034
|
-
description: "Causal chains with strength annotations",
|
|
1035
|
-
fields: {
|
|
1036
|
-
chains: "array — { path: array, strength: number, chainType: string }",
|
|
1037
|
-
totalChains: "number",
|
|
1038
|
-
},
|
|
1039
|
-
},
|
|
1040
|
-
ownerModule: "graph-search",
|
|
1041
|
-
ontologyPrimitive: "graph",
|
|
1042
|
-
tier: "sdk-only",
|
|
1043
|
-
};
|
|
1044
|
-
export const GET_NON_CONSENSUS_BELIEFS = {
|
|
1045
|
-
name: "get_non_consensus_beliefs",
|
|
1046
|
-
description: "Detect contrarian positions in the belief graph. " +
|
|
1047
|
-
"Like `git log --no-merges` — standalone positions that diverge from the majority view. " +
|
|
1048
|
-
"Identifies beliefs with low consensus among evidence sources or team members.",
|
|
1049
|
-
parameters: {
|
|
1050
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1051
|
-
projectId: {
|
|
1052
|
-
type: "string",
|
|
1053
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1054
|
-
},
|
|
1055
|
-
consensusThreshold: {
|
|
1056
|
-
type: "number",
|
|
1057
|
-
description: "Below this threshold marks non-consensus (default: 0.5)",
|
|
1058
|
-
},
|
|
1059
|
-
},
|
|
1060
|
-
required: ["topicId"],
|
|
1061
|
-
response: {
|
|
1062
|
-
description: "Non-consensus beliefs with dissent analysis",
|
|
1063
|
-
fields: {
|
|
1064
|
-
beliefs: "array — { nodeId, canonicalText, consensusScore, dissentingSources, supportingSources }",
|
|
1065
|
-
},
|
|
1066
|
-
},
|
|
1067
|
-
ownerModule: "graph-search",
|
|
1068
|
-
ontologyPrimitive: "belief",
|
|
1069
|
-
tier: "sdk-only",
|
|
1070
|
-
};
|
|
1071
|
-
export const GET_BELIEFS_BY_EPISTEMIC_STATUS = {
|
|
1072
|
-
name: "get_beliefs_by_epistemic_status",
|
|
1073
|
-
description: "Filter beliefs by epistemic taxonomy labels. " +
|
|
1074
|
-
"Like `git log --grep` with epistemic labels — filters beliefs by their epistemic classification: " +
|
|
1075
|
-
"hypothesis, established, speculative, contested, retracted.",
|
|
1076
|
-
parameters: {
|
|
1077
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1078
|
-
projectId: {
|
|
1079
|
-
type: "string",
|
|
1080
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1081
|
-
},
|
|
1082
|
-
epistemicStatus: {
|
|
1083
|
-
type: "string",
|
|
1084
|
-
description: "Epistemic classification",
|
|
1085
|
-
enum: [
|
|
1086
|
-
"hypothesis",
|
|
1087
|
-
"established",
|
|
1088
|
-
"speculative",
|
|
1089
|
-
"contested",
|
|
1090
|
-
"retracted",
|
|
1091
|
-
],
|
|
1092
|
-
},
|
|
1093
|
-
},
|
|
1094
|
-
required: ["topicId", "epistemicStatus"],
|
|
1095
|
-
response: {
|
|
1096
|
-
description: "Beliefs matching the epistemic status",
|
|
1097
|
-
fields: {
|
|
1098
|
-
beliefs: "array — { nodeId, canonicalText, confidence, epistemicStatus, lastModulated }",
|
|
1099
|
-
count: "number",
|
|
1100
|
-
},
|
|
1101
|
-
},
|
|
1102
|
-
ownerModule: "graph-search",
|
|
1103
|
-
ontologyPrimitive: "belief",
|
|
1104
|
-
tier: "sdk-only",
|
|
1105
|
-
};
|
|
1106
|
-
export const GET_PRIVILEGED_EVIDENCE = {
|
|
1107
|
-
name: "get_privileged_evidence",
|
|
1108
|
-
description: "Retrieve high-value evidence with access characteristics. " +
|
|
1109
|
-
"Like `git log --author` filtering for key sources — identifies evidence from privileged access: " +
|
|
1110
|
-
"primary interviews, proprietary data, non-public filings, expert networks.",
|
|
1111
|
-
parameters: {
|
|
1112
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1113
|
-
projectId: {
|
|
1114
|
-
type: "string",
|
|
1115
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1116
|
-
},
|
|
1117
|
-
accessType: {
|
|
1118
|
-
type: "string",
|
|
1119
|
-
description: "Filter by access type",
|
|
1120
|
-
enum: [
|
|
1121
|
-
"primary_interview",
|
|
1122
|
-
"proprietary_data",
|
|
1123
|
-
"non_public",
|
|
1124
|
-
"expert_network",
|
|
1125
|
-
"field_research",
|
|
1126
|
-
],
|
|
1127
|
-
},
|
|
1128
|
-
},
|
|
1129
|
-
required: ["topicId"],
|
|
1130
|
-
response: {
|
|
1131
|
-
description: "Privileged evidence items",
|
|
1132
|
-
fields: {
|
|
1133
|
-
evidence: "array — { nodeId, canonicalText, accessType, sourceDescription, linkedBeliefs }",
|
|
1134
|
-
totalCount: "number",
|
|
1135
|
-
},
|
|
1136
|
-
},
|
|
1137
|
-
ownerModule: "graph-search",
|
|
1138
|
-
ontologyPrimitive: "evidence",
|
|
1139
|
-
tier: "sdk-only",
|
|
1140
|
-
};
|
|
1141
|
-
export const GET_PRIVILEGED_SIGNALS = {
|
|
1142
|
-
name: "get_privileged_signals",
|
|
1143
|
-
description: "Aggregate high-signal patterns across evidence. " +
|
|
1144
|
-
"Like `git shortlog --summary` for signal strength — identifies recurring patterns " +
|
|
1145
|
-
"across privileged evidence sources that may indicate strong conviction drivers.",
|
|
1146
|
-
parameters: {
|
|
1147
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1148
|
-
projectId: {
|
|
1149
|
-
type: "string",
|
|
1150
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1151
|
-
},
|
|
1152
|
-
minSignalStrength: {
|
|
1153
|
-
type: "number",
|
|
1154
|
-
description: "Minimum signal score (0-1, default: 0.7)",
|
|
1155
|
-
},
|
|
1156
|
-
},
|
|
1157
|
-
required: ["topicId"],
|
|
1158
|
-
response: {
|
|
1159
|
-
description: "Aggregated signal patterns",
|
|
1160
|
-
fields: {
|
|
1161
|
-
signals: "array — { pattern, signalStrength, evidenceCount, sources, affectedBeliefs }",
|
|
1162
|
-
totalSignals: "number",
|
|
1163
|
-
},
|
|
1164
|
-
},
|
|
1165
|
-
ownerModule: "graph-search",
|
|
1166
|
-
ontologyPrimitive: "evidence",
|
|
1167
|
-
tier: "sdk-only",
|
|
1168
|
-
};
|
|
1169
|
-
// =============================================================================
|
|
1170
|
-
// 3.7 BIAS DETECTION SUITE (5 tools)
|
|
1171
|
-
// detect_confirmation_bias is in the MCP surface
|
|
1172
|
-
// =============================================================================
|
|
1173
|
-
export const DETECT_ANCHORING_BIAS = {
|
|
1174
|
-
name: "detect_anchoring_bias",
|
|
1175
|
-
description: "Detect old unchallenged beliefs that may anchor reasoning. " +
|
|
1176
|
-
"Like `git log --before` — finding stale commits that haven't been reviewed. " +
|
|
1177
|
-
"Flags beliefs that were established early and have not received new evidence or challenge.",
|
|
1178
|
-
parameters: {
|
|
1179
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1180
|
-
projectId: {
|
|
1181
|
-
type: "string",
|
|
1182
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1183
|
-
},
|
|
1184
|
-
staleThresholdDays: {
|
|
1185
|
-
type: "number",
|
|
1186
|
-
description: "Days without new evidence to flag as anchored (default: 30)",
|
|
1187
|
-
},
|
|
1188
|
-
},
|
|
1189
|
-
required: ["topicId"],
|
|
1190
|
-
response: {
|
|
1191
|
-
description: "Potentially anchored beliefs",
|
|
1192
|
-
fields: {
|
|
1193
|
-
beliefs: "array — { nodeId, canonicalText, daysSinceLastEvidence, originalConfidence, currentConfidence }",
|
|
1194
|
-
riskLevel: "string — overall anchoring risk",
|
|
1195
|
-
},
|
|
1196
|
-
},
|
|
1197
|
-
ownerModule: "graph-search",
|
|
1198
|
-
ontologyPrimitive: "belief",
|
|
1199
|
-
tier: "sdk-only",
|
|
1200
|
-
};
|
|
1201
|
-
export const DETECT_SOURCE_CONCENTRATION = {
|
|
1202
|
-
name: "detect_source_concentration",
|
|
1203
|
-
description: "Detect single-source evidence risk across beliefs. " +
|
|
1204
|
-
"Like `git shortlog` showing only one contributor — identifies beliefs " +
|
|
1205
|
-
"where all supporting evidence comes from a single source or methodology.",
|
|
1206
|
-
parameters: {
|
|
1207
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1208
|
-
projectId: {
|
|
1209
|
-
type: "string",
|
|
1210
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1211
|
-
},
|
|
1212
|
-
concentrationThreshold: {
|
|
1213
|
-
type: "number",
|
|
1214
|
-
description: "Max acceptable single-source ratio (0-1, default: 0.8)",
|
|
1215
|
-
},
|
|
1216
|
-
},
|
|
1217
|
-
required: ["topicId"],
|
|
1218
|
-
response: {
|
|
1219
|
-
description: "Source concentration analysis",
|
|
1220
|
-
fields: {
|
|
1221
|
-
beliefs: "array — { nodeId, canonicalText, dominantSource, concentrationRatio, uniqueSourceCount }",
|
|
1222
|
-
highRiskCount: "number",
|
|
1223
|
-
},
|
|
1224
|
-
},
|
|
1225
|
-
ownerModule: "graph-search",
|
|
1226
|
-
ontologyPrimitive: "evidence",
|
|
1227
|
-
tier: "sdk-only",
|
|
1228
|
-
};
|
|
1229
|
-
export const FIND_SOFT_CONTRADICTIONS = {
|
|
1230
|
-
name: "find_soft_contradictions",
|
|
1231
|
-
description: "Detect semantic and embedding-level contradictions not flagged by explicit contradiction objects. " +
|
|
1232
|
-
"Like `git diff --word-diff` for subtle conflicts — finds beliefs that are semantically " +
|
|
1233
|
-
"in tension even though no formal contradiction has been flagged.",
|
|
1234
|
-
parameters: {
|
|
1235
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1236
|
-
projectId: {
|
|
1237
|
-
type: "string",
|
|
1238
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1239
|
-
},
|
|
1240
|
-
similarityThreshold: {
|
|
1241
|
-
type: "number",
|
|
1242
|
-
description: "Semantic similarity for contradiction detection (0-1, default: 0.7)",
|
|
1243
|
-
},
|
|
1244
|
-
},
|
|
1245
|
-
required: ["topicId"],
|
|
1246
|
-
response: {
|
|
1247
|
-
description: "Soft contradiction pairs",
|
|
1248
|
-
fields: {
|
|
1249
|
-
pairs: "array — { beliefA, beliefB, tensionScore, tensionDescription }",
|
|
1250
|
-
totalPairs: "number",
|
|
1251
|
-
},
|
|
1252
|
-
},
|
|
1253
|
-
ownerModule: "graph-search",
|
|
1254
|
-
ontologyPrimitive: "belief",
|
|
1255
|
-
tier: "sdk-only",
|
|
1256
|
-
};
|
|
1257
|
-
export const FIND_SEMANTIC_BRIDGES = {
|
|
1258
|
-
name: "find_semantic_bridges",
|
|
1259
|
-
description: "Find semantically similar but graph-distant nodes. " +
|
|
1260
|
-
"Like `git cherry` — finding equivalent commits across branches that aren't connected. " +
|
|
1261
|
-
"Identifies nodes that share semantic meaning but have no graph edges between them.",
|
|
1262
|
-
parameters: {
|
|
1263
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1264
|
-
projectId: {
|
|
1265
|
-
type: "string",
|
|
1266
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1267
|
-
},
|
|
1268
|
-
minSemanticSimilarity: {
|
|
1269
|
-
type: "number",
|
|
1270
|
-
description: "Minimum embedding similarity (0-1, default: 0.75)",
|
|
1271
|
-
},
|
|
1272
|
-
minGraphDistance: {
|
|
1273
|
-
type: "number",
|
|
1274
|
-
description: "Minimum graph hops to qualify as distant (default: 3)",
|
|
1275
|
-
},
|
|
1276
|
-
},
|
|
1277
|
-
required: ["topicId"],
|
|
1278
|
-
response: {
|
|
1279
|
-
description: "Potential bridge pairs",
|
|
1280
|
-
fields: {
|
|
1281
|
-
bridges: "array — { nodeA, nodeB, semanticSimilarity, graphDistance, suggestedEdgeType }",
|
|
1282
|
-
totalBridges: "number",
|
|
1283
|
-
},
|
|
1284
|
-
},
|
|
1285
|
-
ownerModule: "graph-search",
|
|
1286
|
-
ontologyPrimitive: "graph",
|
|
1287
|
-
tier: "sdk-only",
|
|
1288
|
-
};
|
|
1289
|
-
export const FIND_SEMANTIC_ORPHANS = {
|
|
1290
|
-
name: "find_semantic_orphans",
|
|
1291
|
-
description: "Find structurally connected but semantically distant nodes. " +
|
|
1292
|
-
"Like `git fsck --lost-found` — nodes that are technically connected in the graph " +
|
|
1293
|
-
"but semantically don't belong, possibly indicating miscategorization or stale edges.",
|
|
1294
|
-
parameters: {
|
|
1295
|
-
topicId: { type: "string", description: "Topic scope" },
|
|
1296
|
-
projectId: {
|
|
1297
|
-
type: "string",
|
|
1298
|
-
description: "Deprecated legacy alias for topic scope",
|
|
1299
|
-
},
|
|
1300
|
-
maxSemanticSimilarity: {
|
|
1301
|
-
type: "number",
|
|
1302
|
-
description: "Maximum similarity to qualify as orphan (0-1, default: 0.3)",
|
|
1303
|
-
},
|
|
1304
|
-
},
|
|
1305
|
-
required: ["topicId"],
|
|
1306
|
-
response: {
|
|
1307
|
-
description: "Semantic orphan nodes",
|
|
1308
|
-
fields: {
|
|
1309
|
-
orphans: "array — { nodeId, connectedTo, semanticSimilarity, edgeType, suggestedAction }",
|
|
1310
|
-
totalOrphans: "number",
|
|
1311
|
-
},
|
|
1312
|
-
},
|
|
1313
|
-
ownerModule: "graph-search",
|
|
1314
|
-
ontologyPrimitive: "graph",
|
|
1315
|
-
tier: "sdk-only",
|
|
1316
|
-
};
|
|
1317
|
-
// =============================================================================
|
|
1318
|
-
// SDK-ONLY TOOL REGISTRY
|
|
1319
|
-
// =============================================================================
|
|
1320
|
-
/** All SDK-only tool contracts, indexed by name */
|
|
1321
|
-
export const SDK_ONLY_TOOL_CONTRACTS = {
|
|
1322
|
-
// 3.1 Advanced workflow & phase management
|
|
1323
|
-
start_worktree: START_WORKTREE,
|
|
1324
|
-
update_worktree_phase: UPDATE_WORKTREE_PHASE,
|
|
1325
|
-
advance_worktree_phase: ADVANCE_WORKTREE_PHASE,
|
|
1326
|
-
add_note_to_worktree: ADD_NOTE_TO_WORKTREE,
|
|
1327
|
-
link_document_to_worktree: LINK_DOCUMENT_TO_WORKTREE,
|
|
1328
|
-
link_evidence_to_worktree: LINK_EVIDENCE_TO_WORKTREE,
|
|
1329
|
-
link_question_to_worktree: LINK_QUESTION_TO_WORKTREE,
|
|
1330
|
-
link_belief_to_worktree: LINK_BELIEF_TO_WORKTREE,
|
|
1331
|
-
create_synthesized_belief: CREATE_SYNTHESIZED_BELIEF,
|
|
1332
|
-
complete_hypothesis_formation: COMPLETE_HYPOTHESIS_FORMATION,
|
|
1333
|
-
complete_evidence_review: COMPLETE_EVIDENCE_REVIEW,
|
|
1334
|
-
refine_worktree_belief: REFINE_WORKTREE_BELIEF,
|
|
1335
|
-
// 3.2 Deeper graph navigation
|
|
1336
|
-
trace_provenance: TRACE_PROVENANCE,
|
|
1337
|
-
get_belief_relationships: GET_BELIEF_RELATIONSHIPS,
|
|
1338
|
-
get_belief_support_chain: GET_BELIEF_SUPPORT_CHAIN,
|
|
1339
|
-
explore_connections: EXPLORE_CONNECTIONS,
|
|
1340
|
-
get_deep_lineage: GET_DEEP_LINEAGE,
|
|
1341
|
-
graph_aware_search: GRAPH_AWARE_SEARCH,
|
|
1342
|
-
// 3.3 Conviction & analytics
|
|
1343
|
-
get_collection_conviction: GET_COLLECTION_CONVICTION,
|
|
1344
|
-
get_conviction_trend: GET_CONVICTION_TREND,
|
|
1345
|
-
analyze_belief_criticality: ANALYZE_BELIEF_CRITICALITY,
|
|
1346
|
-
analyze_belief_cluster_candidates: ANALYZE_BELIEF_CLUSTER_CANDIDATES,
|
|
1347
|
-
create_belief_conditional: CREATE_BELIEF_CONDITIONAL,
|
|
1348
|
-
get_necessary_evidence: GET_NECESSARY_EVIDENCE,
|
|
1349
|
-
analyze_reasoning_depth: ANALYZE_REASONING_DEPTH,
|
|
1350
|
-
// 3.4 Extended question & evidence analytics
|
|
1351
|
-
get_evidence_by_methodology: GET_EVIDENCE_BY_METHODOLOGY,
|
|
1352
|
-
// 3.5 Task lifecycle (list_tasks + update_task are MCP tools, not SDK-only)
|
|
1353
|
-
create_evidence_task: CREATE_EVIDENCE_TASK,
|
|
1354
|
-
get_task_counts: GET_TASK_COUNTS,
|
|
1355
|
-
add_research_action: ADD_RESEARCH_ACTION,
|
|
1356
|
-
// 3.6 Domain analytics
|
|
1357
|
-
get_predictions: GET_PREDICTIONS,
|
|
1358
|
-
get_surprise_detection: GET_SURPRISE_DETECTION,
|
|
1359
|
-
get_challenged_beliefs: GET_CHALLENGED_BELIEFS,
|
|
1360
|
-
get_causal_chains: GET_CAUSAL_CHAINS,
|
|
1361
|
-
get_non_consensus_beliefs: GET_NON_CONSENSUS_BELIEFS,
|
|
1362
|
-
get_beliefs_by_epistemic_status: GET_BELIEFS_BY_EPISTEMIC_STATUS,
|
|
1363
|
-
get_privileged_evidence: GET_PRIVILEGED_EVIDENCE,
|
|
1364
|
-
get_privileged_signals: GET_PRIVILEGED_SIGNALS,
|
|
1365
|
-
// 3.7 Bias detection suite (detect_confirmation_bias is in MCP)
|
|
1366
|
-
detect_anchoring_bias: DETECT_ANCHORING_BIAS,
|
|
1367
|
-
detect_source_concentration: DETECT_SOURCE_CONCENTRATION,
|
|
1368
|
-
find_soft_contradictions: FIND_SOFT_CONTRADICTIONS,
|
|
1369
|
-
find_semantic_bridges: FIND_SEMANTIC_BRIDGES,
|
|
1370
|
-
find_semantic_orphans: FIND_SEMANTIC_ORPHANS,
|
|
1371
|
-
};
|
|
1372
|
-
// =============================================================================
|
|
1373
|
-
// MERGED SDK SURFACE
|
|
1374
|
-
// =============================================================================
|
|
1375
|
-
/** Complete SDK surface: MCP gateway tools + SDK-only advanced tools */
|
|
1376
|
-
export const ALL_SDK_TOOL_CONTRACTS = {
|
|
1377
|
-
...MCP_TOOL_CONTRACTS,
|
|
1378
|
-
...SDK_ONLY_TOOL_CONTRACTS,
|
|
1379
|
-
};
|
|
1380
|
-
/** All SDK-only tool names */
|
|
1381
|
-
export const SDK_ONLY_TOOL_NAMES = Object.keys(SDK_ONLY_TOOL_CONTRACTS);
|
|
1382
|
-
/** All tool names across the complete SDK surface */
|
|
1383
|
-
export const ALL_SDK_TOOL_NAMES = Object.keys(ALL_SDK_TOOL_CONTRACTS);
|
|
1384
|
-
/**
|
|
1385
|
-
* Lint validation: every SDK tool description must contain "Like `git" reference.
|
|
1386
|
-
* Reuses the same git-semantic validation rule as MCP tools.
|
|
1387
|
-
*/
|
|
1388
|
-
export function validateSdkGitSemantics(tool) {
|
|
1389
|
-
const desc = tool.description;
|
|
1390
|
-
const hasGitReference = /Like (`git |a `git |a merge conflict|opening a `git)/.test(desc);
|
|
1391
|
-
if (!hasGitReference) {
|
|
1392
|
-
return {
|
|
1393
|
-
valid: false,
|
|
1394
|
-
reason: `SDK tool "${tool.name}" description missing git-semantic reference`,
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
return { valid: true };
|
|
1398
|
-
}
|
|
1399
|
-
//# sourceMappingURL=sdk-tools.contract.js.map
|