@lucern/contracts 0.1.2-alpha.4 → 0.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/defineFunction-DO97DKs4.d.ts +14 -0
- package/dist/defineTable-CBQ03FXl.d.ts +36 -0
- package/dist/dsl-BgpoVOVQ.d.ts +110 -0
- package/dist/dsl.d.ts +5 -0
- package/dist/dsl.js +675 -0
- package/dist/dsl.js.map +1 -0
- package/dist/function-registry/beliefs.d.ts +519 -0
- package/dist/function-registry/beliefs.js +4326 -0
- package/dist/function-registry/beliefs.js.map +1 -0
- package/dist/function-registry/coding.d.ts +347 -0
- package/dist/function-registry/coding.js +4268 -0
- package/dist/function-registry/coding.js.map +1 -0
- package/dist/function-registry/context.d.ts +218 -0
- package/dist/function-registry/context.js +4175 -0
- package/dist/function-registry/context.js.map +1 -0
- package/dist/function-registry/contracts.d.ts +218 -0
- package/dist/function-registry/contracts.js +4143 -0
- package/dist/function-registry/contracts.js.map +1 -0
- package/dist/function-registry/coordination.d.ts +476 -0
- package/dist/function-registry/coordination.js +4254 -0
- package/dist/function-registry/coordination.js.map +1 -0
- package/dist/function-registry/edges.d.ts +175 -0
- package/dist/function-registry/edges.js +4150 -0
- package/dist/function-registry/edges.js.map +1 -0
- package/dist/function-registry/evidence.d.ts +433 -0
- package/dist/function-registry/evidence.js +4302 -0
- package/dist/function-registry/evidence.js.map +1 -0
- package/dist/function-registry/graph.d.ts +648 -0
- package/dist/function-registry/graph.js +4329 -0
- package/dist/function-registry/graph.js.map +1 -0
- package/dist/function-registry/helpers.d.ts +86 -0
- package/dist/function-registry/helpers.js +4131 -0
- package/dist/function-registry/helpers.js.map +1 -0
- package/dist/function-registry/identity.d.ts +218 -0
- package/dist/function-registry/identity.js +4154 -0
- package/dist/function-registry/identity.js.map +1 -0
- package/dist/function-registry/index.d.ts +32 -0
- package/dist/function-registry/index.js +4235 -0
- package/dist/function-registry/index.js.map +1 -0
- package/dist/function-registry/judgments.d.ts +175 -0
- package/dist/function-registry/judgments.js +4157 -0
- package/dist/function-registry/judgments.js.map +1 -0
- package/dist/function-registry/legacy.d.ts +132 -0
- package/dist/function-registry/legacy.js +4118 -0
- package/dist/function-registry/legacy.js.map +1 -0
- package/dist/function-registry/lenses.d.ts +261 -0
- package/dist/function-registry/lenses.js +4160 -0
- package/dist/function-registry/lenses.js.map +1 -0
- package/dist/function-registry/manifest.d.ts +36 -0
- package/dist/function-registry/manifest.js +366 -0
- package/dist/function-registry/manifest.js.map +1 -0
- package/dist/function-registry/ontologies.d.ts +562 -0
- package/dist/function-registry/ontologies.js +4292 -0
- package/dist/function-registry/ontologies.js.map +1 -0
- package/dist/function-registry/pipeline.d.ts +218 -0
- package/dist/function-registry/pipeline.js +4143 -0
- package/dist/function-registry/pipeline.js.map +1 -0
- package/dist/function-registry/questions.d.ts +605 -0
- package/dist/function-registry/questions.js +4329 -0
- package/dist/function-registry/questions.js.map +1 -0
- package/dist/function-registry/tasks.d.ts +261 -0
- package/dist/function-registry/tasks.js +4166 -0
- package/dist/function-registry/tasks.js.map +1 -0
- package/dist/function-registry/topics.d.ts +304 -0
- package/dist/function-registry/topics.js +4193 -0
- package/dist/function-registry/topics.js.map +1 -0
- package/dist/function-registry/types.d.ts +84 -0
- package/dist/function-registry/types.js +3 -0
- package/dist/function-registry/types.js.map +1 -0
- package/dist/function-registry/worktrees.d.ts +476 -0
- package/dist/function-registry/worktrees.js +4277 -0
- package/dist/function-registry/worktrees.js.map +1 -0
- package/dist/generated/convexSchemas.d.ts +20 -0
- package/dist/generated/convexSchemas.js +160 -0
- package/dist/generated/convexSchemas.js.map +1 -0
- package/dist/generated/schema-manifest.json +5179 -0
- package/dist/generated/tableOwnership.d.ts +127 -0
- package/dist/generated/tableOwnership.js +276 -0
- package/dist/generated/tableOwnership.js.map +1 -0
- package/dist/generated/tier-expectations.json +360 -0
- package/dist/idOf-DR8tkhQS.d.ts +10 -0
- package/dist/index-DoDXl8KS.d.ts +19 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.js +5739 -315
- package/dist/index.js.map +1 -1
- package/dist/schema-helpers/enumValidation.d.ts +17 -0
- package/dist/schema-helpers/enumValidation.js +143 -0
- package/dist/schema-helpers/enumValidation.js.map +1 -0
- package/dist/schema-helpers/spine/nodes/decision.d.ts +19 -0
- package/dist/schema-helpers/spine/nodes/decision.js +81 -0
- package/dist/schema-helpers/spine/nodes/decision.js.map +1 -0
- package/dist/schema-helpers/spine/tables/epistemicNodes.d.ts +9 -0
- package/dist/schema-helpers/spine/tables/epistemicNodes.js +62 -0
- package/dist/schema-helpers/spine/tables/epistemicNodes.js.map +1 -0
- package/dist/schema-helpers/topicIds.d.ts +17 -0
- package/dist/schema-helpers/topicIds.js +21 -0
- package/dist/schema-helpers/topicIds.js.map +1 -0
- package/dist/schema-helpers/topicLegacyScope.d.ts +19 -0
- package/dist/schema-helpers/topicLegacyScope.js +44 -0
- package/dist/schema-helpers/topicLegacyScope.js.map +1 -0
- package/dist/schema-helpers/validators.d.ts +8 -0
- package/dist/schema-helpers/validators.js +18 -0
- package/dist/schema-helpers/validators.js.map +1 -0
- package/dist/schemas/enums.d.ts +12 -0
- package/dist/schemas/enums.js +11 -0
- package/dist/schemas/enums.js.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.js +4240 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/manifest.d.ts +24521 -0
- package/dist/schemas/manifest.js +4242 -0
- package/dist/schemas/manifest.js.map +1 -0
- package/dist/schemas/tables/identity/agent.d.ts +21 -0
- package/dist/schemas/tables/identity/agent.js +41 -0
- package/dist/schemas/tables/identity/agent.js.map +1 -0
- package/dist/schemas/tables/identity/epistemic.d.ts +18 -0
- package/dist/schemas/tables/identity/epistemic.js +38 -0
- package/dist/schemas/tables/identity/epistemic.js.map +1 -0
- package/dist/schemas/tables/identity/model.d.ts +62 -0
- package/dist/schemas/tables/identity/model.js +110 -0
- package/dist/schemas/tables/identity/model.js.map +1 -0
- package/dist/schemas/tables/identity/platform.d.ts +392 -0
- package/dist/schemas/tables/identity/platform.js +475 -0
- package/dist/schemas/tables/identity/platform.js.map +1 -0
- package/dist/schemas/tables/identity/project.d.ts +22 -0
- package/dist/schemas/tables/identity/project.js +48 -0
- package/dist/schemas/tables/identity/project.js.map +1 -0
- package/dist/schemas/tables/identity/user.d.ts +26 -0
- package/dist/schemas/tables/identity/user.js +47 -0
- package/dist/schemas/tables/identity/user.js.map +1 -0
- package/dist/schemas/tables/kernel/config.d.ts +20 -0
- package/dist/schemas/tables/kernel/config.js +39 -0
- package/dist/schemas/tables/kernel/config.js.map +1 -0
- package/dist/schemas/tables/kernel/coordination.d.ts +30 -0
- package/dist/schemas/tables/kernel/coordination.js +57 -0
- package/dist/schemas/tables/kernel/coordination.js.map +1 -0
- package/dist/schemas/tables/kernel/decision.d.ts +246 -0
- package/dist/schemas/tables/kernel/decision.js +371 -0
- package/dist/schemas/tables/kernel/decision.js.map +1 -0
- package/dist/schemas/tables/kernel/embedding.d.ts +18 -0
- package/dist/schemas/tables/kernel/embedding.js +48 -0
- package/dist/schemas/tables/kernel/embedding.js.map +1 -0
- package/dist/schemas/tables/kernel/epistemic.d.ts +315 -0
- package/dist/schemas/tables/kernel/epistemic.js +327 -0
- package/dist/schemas/tables/kernel/epistemic.js.map +1 -0
- package/dist/schemas/tables/kernel/idempotency.d.ts +13 -0
- package/dist/schemas/tables/kernel/idempotency.js +31 -0
- package/dist/schemas/tables/kernel/idempotency.js.map +1 -0
- package/dist/schemas/tables/kernel/infra.d.ts +171 -0
- package/dist/schemas/tables/kernel/infra.js +160 -0
- package/dist/schemas/tables/kernel/infra.js.map +1 -0
- package/dist/schemas/tables/kernel/intelligence.d.ts +293 -0
- package/dist/schemas/tables/kernel/intelligence.js +207 -0
- package/dist/schemas/tables/kernel/intelligence.js.map +1 -0
- package/dist/schemas/tables/kernel/lens.d.ts +192 -0
- package/dist/schemas/tables/kernel/lens.js +122 -0
- package/dist/schemas/tables/kernel/lens.js.map +1 -0
- package/dist/schemas/tables/kernel/ontology.d.ts +89 -0
- package/dist/schemas/tables/kernel/ontology.js +91 -0
- package/dist/schemas/tables/kernel/ontology.js.map +1 -0
- package/dist/schemas/tables/kernel/platform.d.ts +353 -0
- package/dist/schemas/tables/kernel/platform.js +349 -0
- package/dist/schemas/tables/kernel/platform.js.map +1 -0
- package/dist/schemas/tables/kernel/spine.d.ts +206 -0
- package/dist/schemas/tables/kernel/spine.js +243 -0
- package/dist/schemas/tables/kernel/spine.js.map +1 -0
- package/dist/schemas/tables/kernel/task.d.ts +614 -0
- package/dist/schemas/tables/kernel/task.js +189 -0
- package/dist/schemas/tables/kernel/task.js.map +1 -0
- package/dist/schemas/tables/kernel/topic.d.ts +25 -0
- package/dist/schemas/tables/kernel/topic.js +62 -0
- package/dist/schemas/tables/kernel/topic.js.map +1 -0
- package/dist/schemas/tables/kernel/workflow.d.ts +45 -0
- package/dist/schemas/tables/kernel/workflow.js +94 -0
- package/dist/schemas/tables/kernel/workflow.js.map +1 -0
- package/dist/schemas/tables/kernel/worktree.d.ts +823 -0
- package/dist/schemas/tables/kernel/worktree.js +328 -0
- package/dist/schemas/tables/kernel/worktree.js.map +1 -0
- package/dist/schemas/tables/mc/identity.d.ts +134 -0
- package/dist/schemas/tables/mc/identity.js +221 -0
- package/dist/schemas/tables/mc/identity.js.map +1 -0
- package/dist/schemas/tables/mc/methodology.d.ts +46 -0
- package/dist/schemas/tables/mc/methodology.js +69 -0
- package/dist/schemas/tables/mc/methodology.js.map +1 -0
- package/dist/schemas/tables/mc/pack.d.ts +540 -0
- package/dist/schemas/tables/mc/pack.js +294 -0
- package/dist/schemas/tables/mc/pack.js.map +1 -0
- package/dist/schemas/tables/mc/policy.d.ts +57 -0
- package/dist/schemas/tables/mc/policy.js +121 -0
- package/dist/schemas/tables/mc/policy.js.map +1 -0
- package/dist/schemas/tables/mc/registry.d.ts +155 -0
- package/dist/schemas/tables/mc/registry.js +164 -0
- package/dist/schemas/tables/mc/registry.js.map +1 -0
- package/dist/schemas/tables/mc/runtime.d.ts +119 -0
- package/dist/schemas/tables/mc/runtime.js +199 -0
- package/dist/schemas/tables/mc/runtime.js.map +1 -0
- package/dist/schemas/tables/mc/tenant.d.ts +106 -0
- package/dist/schemas/tables/mc/tenant.js +114 -0
- package/dist/schemas/tables/mc/tenant.js.map +1 -0
- package/dist/schemas/tables/mc/workspace.d.ts +28 -0
- package/dist/schemas/tables/mc/workspace.js +52 -0
- package/dist/schemas/tables/mc/workspace.js.map +1 -0
- package/dist/{sdk-tools.contract-BnV0hKLp.d.ts → sdk-tools.contract-C2kQN_Xk.d.ts} +3 -7
- package/dist/sdk-tools.contract.d.ts +2 -2
- package/dist/sdk-tools.contract.js +664 -175
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/tool-contracts-WCnuE9DW.d.ts +288 -0
- package/dist/tool-contracts.d.ts +1 -0
- package/dist/{mcp-tools.contract.js → tool-contracts.js} +666 -116
- package/dist/tool-contracts.js.map +1 -0
- package/package.json +119 -2
- package/dist/mcp-tools.contract-D8kXcP6d.d.ts +0 -254
- package/dist/mcp-tools.contract.d.ts +0 -1
- package/dist/mcp-tools.contract.js.map +0 -1
|
@@ -0,0 +1,4131 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/function-registry/helpers.ts
|
|
4
|
+
|
|
5
|
+
// src/lens-workflow.contract.ts
|
|
6
|
+
var LENS_PERSPECTIVE_TYPES = [
|
|
7
|
+
"investigation",
|
|
8
|
+
"monitoring",
|
|
9
|
+
"analysis",
|
|
10
|
+
"comparison",
|
|
11
|
+
"taxonomy"
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
// src/tool-contracts.ts
|
|
15
|
+
var CREATE_BELIEF = {
|
|
16
|
+
name: "create_belief",
|
|
17
|
+
description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a mandatory prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; use modulate_confidence to record the first evidential update.",
|
|
18
|
+
parameters: {
|
|
19
|
+
canonicalText: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "The belief statement \u2014 what the agent holds to be true"
|
|
22
|
+
},
|
|
23
|
+
topicId: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Optional topic scope hint for the belief"
|
|
26
|
+
},
|
|
27
|
+
baseRate: {
|
|
28
|
+
type: "number",
|
|
29
|
+
description: "Required prior probability used to seed the vacuous opinion `(0, 0, 1, a)` at creation time."
|
|
30
|
+
},
|
|
31
|
+
beliefType: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Belief type (e.g., hypothesis, belief, principle, invariant, tenet, forecast). Validated against schemaEnumConfig."
|
|
34
|
+
},
|
|
35
|
+
metadata: {
|
|
36
|
+
type: "object",
|
|
37
|
+
description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
required: ["canonicalText", "baseRate"],
|
|
41
|
+
response: {
|
|
42
|
+
description: "The created canonical belief record",
|
|
43
|
+
fields: {
|
|
44
|
+
id: "string \u2014 canonical belief ID",
|
|
45
|
+
nodeId: "string \u2014 canonical belief ID",
|
|
46
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
47
|
+
text: "string \u2014 canonical belief formulation",
|
|
48
|
+
topicId: "string",
|
|
49
|
+
status: "string \u2014 active | superseded | archived",
|
|
50
|
+
scoringState: "string \u2014 unscored | scored"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
ownerModule: "graph-primitives",
|
|
54
|
+
ontologyPrimitive: "belief",
|
|
55
|
+
tier: "showcase"
|
|
56
|
+
};
|
|
57
|
+
var GET_BELIEF = {
|
|
58
|
+
name: "get_belief",
|
|
59
|
+
description: "Read one belief by ID. Like `git show` \u2014 resolves the canonical belief payload for a single identifier.",
|
|
60
|
+
parameters: {
|
|
61
|
+
id: { type: "string", description: "Canonical belief ID" }
|
|
62
|
+
},
|
|
63
|
+
required: ["id"],
|
|
64
|
+
response: {
|
|
65
|
+
description: "The canonical belief record",
|
|
66
|
+
fields: {
|
|
67
|
+
id: "string \u2014 canonical belief ID",
|
|
68
|
+
nodeId: "string \u2014 canonical belief ID",
|
|
69
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
70
|
+
text: "string \u2014 canonical belief formulation",
|
|
71
|
+
topicId: "string",
|
|
72
|
+
status: "string \u2014 active | superseded | archived",
|
|
73
|
+
scoringState: "string \u2014 unscored | scored"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
ownerModule: "graph-primitives",
|
|
77
|
+
ontologyPrimitive: "belief",
|
|
78
|
+
tier: "workhorse"
|
|
79
|
+
};
|
|
80
|
+
var REFINE_BELIEF = {
|
|
81
|
+
name: "refine_belief",
|
|
82
|
+
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.",
|
|
83
|
+
parameters: {
|
|
84
|
+
nodeId: { type: "string", description: "The belief to refine" },
|
|
85
|
+
canonicalText: { type: "string", description: "Updated belief statement" },
|
|
86
|
+
rationale: { type: "string", description: "Why the refinement was made" }
|
|
87
|
+
},
|
|
88
|
+
required: ["nodeId", "canonicalText"],
|
|
89
|
+
response: {
|
|
90
|
+
description: "The updated belief node",
|
|
91
|
+
fields: {
|
|
92
|
+
nodeId: "string",
|
|
93
|
+
canonicalText: "string \u2014 updated text",
|
|
94
|
+
updatedAt: "number \u2014 timestamp"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
ownerModule: "graph-primitives",
|
|
98
|
+
ontologyPrimitive: "belief",
|
|
99
|
+
tier: "showcase"
|
|
100
|
+
};
|
|
101
|
+
var MODULATE_CONFIDENCE = {
|
|
102
|
+
name: "modulate_confidence",
|
|
103
|
+
description: "Record a confidence change for a belief. Like `git commit` to the credence log \u2014 an atomic, append-only write. Each modulation is a new entry in the history, not an overwrite. Scoring happens via merge; this tool records the individual data points. Pass the full subjective-logic tuple (`belief`, `disbelief`, `uncertainty`, `baseRate`) directly. If a caller only has a scalar probability, use `@lucern/sdk` helpers `opinionFromBaseRate`, `opinionFromDogmatic`, or `opinionFromProjected` to name the intended interpretation before calling this tool. Triggers: evidence_added, evidence_removed, contradiction_detected, contradiction_resolved, agent_assessment, worktree_outcome, worktree_completed, fusion, discount, deduction, manual, decay.",
|
|
104
|
+
parameters: {
|
|
105
|
+
nodeId: { type: "string", description: "The belief to score" },
|
|
106
|
+
belief: {
|
|
107
|
+
type: "number",
|
|
108
|
+
description: "Subjective-logic belief mass `b` in [0, 1]"
|
|
109
|
+
},
|
|
110
|
+
disbelief: {
|
|
111
|
+
type: "number",
|
|
112
|
+
description: "Subjective-logic disbelief mass `d` in [0, 1]"
|
|
113
|
+
},
|
|
114
|
+
uncertainty: {
|
|
115
|
+
type: "number",
|
|
116
|
+
description: "Subjective-logic uncertainty mass `u` in [0, 1]"
|
|
117
|
+
},
|
|
118
|
+
baseRate: {
|
|
119
|
+
type: "number",
|
|
120
|
+
description: "Subjective-logic base rate `a` in [0, 1]. Required for tuple payloads."
|
|
121
|
+
},
|
|
122
|
+
confidence: {
|
|
123
|
+
type: "number",
|
|
124
|
+
description: "Deprecated scalar confidence value in [0, 1]. Scalar-only payloads are rejected as AMBIGUOUS_SCALAR."
|
|
125
|
+
},
|
|
126
|
+
trigger: {
|
|
127
|
+
type: "string",
|
|
128
|
+
description: "What caused this confidence change",
|
|
129
|
+
enum: [
|
|
130
|
+
"evidence_added",
|
|
131
|
+
"evidence_removed",
|
|
132
|
+
"contradiction_detected",
|
|
133
|
+
"contradiction_resolved",
|
|
134
|
+
"agent_assessment",
|
|
135
|
+
"worktree_outcome",
|
|
136
|
+
"worktree_completed",
|
|
137
|
+
"fusion",
|
|
138
|
+
"discount",
|
|
139
|
+
"deduction",
|
|
140
|
+
"manual",
|
|
141
|
+
"decay"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
rationale: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description: "Human-readable explanation of why confidence changed"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
required: ["nodeId", "trigger", "rationale"],
|
|
150
|
+
response: {
|
|
151
|
+
description: "Confidence modulation result",
|
|
152
|
+
fields: {
|
|
153
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
154
|
+
nodeId: "string \u2014 canonical belief ID",
|
|
155
|
+
newConfidence: "number",
|
|
156
|
+
previousConfidence: "number",
|
|
157
|
+
trigger: "string",
|
|
158
|
+
requestId: "string \u2014 request identifier for the scheduled cascade",
|
|
159
|
+
propagationSummary: "object \u2014 bounded inline cascade summary with totalCandidateTargets, inlineTargets, and remainingTargetCount"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
ownerModule: "graph-primitives",
|
|
163
|
+
ontologyPrimitive: "belief",
|
|
164
|
+
tier: "showcase"
|
|
165
|
+
};
|
|
166
|
+
var FORK_BELIEF = {
|
|
167
|
+
name: "fork_belief",
|
|
168
|
+
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.",
|
|
169
|
+
parameters: {
|
|
170
|
+
nodeId: { type: "string", description: "The scored belief to fork from" },
|
|
171
|
+
newFormulation: {
|
|
172
|
+
type: "string",
|
|
173
|
+
description: "The evolved belief statement"
|
|
174
|
+
},
|
|
175
|
+
forkReason: {
|
|
176
|
+
type: "string",
|
|
177
|
+
description: "Why this fork was created",
|
|
178
|
+
enum: [
|
|
179
|
+
"refinement",
|
|
180
|
+
"contradiction_response",
|
|
181
|
+
"scope_change",
|
|
182
|
+
"confidence_collapse",
|
|
183
|
+
"manual"
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
required: ["nodeId", "newFormulation", "forkReason"],
|
|
188
|
+
response: {
|
|
189
|
+
description: "The forked canonical belief record",
|
|
190
|
+
fields: {
|
|
191
|
+
id: "string \u2014 canonical child belief ID",
|
|
192
|
+
nodeId: "string \u2014 canonical child belief ID",
|
|
193
|
+
beliefId: "string \u2014 canonical child belief ID",
|
|
194
|
+
parentBeliefId: "string \u2014 canonical parent belief ID",
|
|
195
|
+
forkReason: "string"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
ownerModule: "graph-primitives",
|
|
199
|
+
ontologyPrimitive: "belief",
|
|
200
|
+
tier: "showcase"
|
|
201
|
+
};
|
|
202
|
+
var ARCHIVE_BELIEF = {
|
|
203
|
+
name: "archive_belief",
|
|
204
|
+
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.",
|
|
205
|
+
parameters: {
|
|
206
|
+
nodeId: { type: "string", description: "The belief to archive" },
|
|
207
|
+
rationale: {
|
|
208
|
+
type: "string",
|
|
209
|
+
description: "Why this belief is being archived"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
required: ["nodeId"],
|
|
213
|
+
response: {
|
|
214
|
+
description: "Archived canonical belief record",
|
|
215
|
+
fields: {
|
|
216
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
217
|
+
nodeId: "string \u2014 canonical belief ID",
|
|
218
|
+
previousStatus: "string | undefined",
|
|
219
|
+
newStatus: "string \u2014 'archived'",
|
|
220
|
+
status: "string \u2014 'archived'"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
ownerModule: "graph-primitives",
|
|
224
|
+
ontologyPrimitive: "belief",
|
|
225
|
+
tier: "showcase"
|
|
226
|
+
};
|
|
227
|
+
var CREATE_EPISTEMIC_CONTRACT = {
|
|
228
|
+
name: "create_epistemic_contract",
|
|
229
|
+
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.",
|
|
230
|
+
parameters: {
|
|
231
|
+
beliefNodeId: {
|
|
232
|
+
type: "string",
|
|
233
|
+
description: "The belief node to bind this contract to"
|
|
234
|
+
},
|
|
235
|
+
title: {
|
|
236
|
+
type: "string",
|
|
237
|
+
description: "Contract title"
|
|
238
|
+
},
|
|
239
|
+
description: {
|
|
240
|
+
type: "string",
|
|
241
|
+
description: "Optional contract description"
|
|
242
|
+
},
|
|
243
|
+
conditionType: {
|
|
244
|
+
type: "string",
|
|
245
|
+
description: "What kind of contract condition to evaluate",
|
|
246
|
+
enum: ["assertion", "temporal", "evidential", "threshold", "composite"]
|
|
247
|
+
},
|
|
248
|
+
direction: {
|
|
249
|
+
type: "string",
|
|
250
|
+
description: "Whether satisfying the condition confirms or falsifies",
|
|
251
|
+
enum: ["confirms", "falsifies"]
|
|
252
|
+
},
|
|
253
|
+
condition: {
|
|
254
|
+
type: "object",
|
|
255
|
+
description: "Condition payload: { expression, evaluator, evaluatorConfig? }"
|
|
256
|
+
},
|
|
257
|
+
deadline: {
|
|
258
|
+
type: "number",
|
|
259
|
+
description: "Optional Unix timestamp deadline for temporal contracts"
|
|
260
|
+
},
|
|
261
|
+
compositeOf: {
|
|
262
|
+
type: "array",
|
|
263
|
+
description: "Optional array of sub-contract IDs for composite contracts"
|
|
264
|
+
},
|
|
265
|
+
compositeOperator: {
|
|
266
|
+
type: "string",
|
|
267
|
+
description: "How composite sub-contracts should be combined",
|
|
268
|
+
enum: ["all", "any", "majority"]
|
|
269
|
+
},
|
|
270
|
+
modulation: {
|
|
271
|
+
type: "object",
|
|
272
|
+
description: "Asymmetric modulation rules for confirmed, disconfirmed, expired, and partial outcomes"
|
|
273
|
+
},
|
|
274
|
+
evaluationSchedule: {
|
|
275
|
+
type: "string",
|
|
276
|
+
description: "When this contract should be evaluated",
|
|
277
|
+
enum: ["on_demand", "on_evidence", "periodic", "event_driven"]
|
|
278
|
+
},
|
|
279
|
+
periodicIntervalMs: {
|
|
280
|
+
type: "number",
|
|
281
|
+
description: "Optional interval in milliseconds for periodic contracts"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
required: [
|
|
285
|
+
"beliefNodeId",
|
|
286
|
+
"title",
|
|
287
|
+
"conditionType",
|
|
288
|
+
"direction",
|
|
289
|
+
"condition",
|
|
290
|
+
"modulation",
|
|
291
|
+
"evaluationSchedule"
|
|
292
|
+
],
|
|
293
|
+
response: {
|
|
294
|
+
description: "The created epistemic contract binding",
|
|
295
|
+
fields: {
|
|
296
|
+
id: "string \u2014 storage record ID",
|
|
297
|
+
contractId: "string \u2014 contract identifier",
|
|
298
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
299
|
+
status: "string \u2014 initial contract status",
|
|
300
|
+
title: "string \u2014 contract title"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
ownerModule: "graph-primitives",
|
|
304
|
+
ontologyPrimitive: "belief",
|
|
305
|
+
tier: "workhorse"
|
|
306
|
+
};
|
|
307
|
+
var ADD_EVIDENCE = {
|
|
308
|
+
name: "add_evidence",
|
|
309
|
+
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.",
|
|
310
|
+
parameters: {
|
|
311
|
+
canonicalText: { type: "string", description: "The evidence statement" },
|
|
312
|
+
topicId: { type: "string", description: "Optional topic scope hint" },
|
|
313
|
+
sourceUrl: { type: "string", description: "URL of the source material" },
|
|
314
|
+
targetNodeId: {
|
|
315
|
+
type: "string",
|
|
316
|
+
description: "The belief this evidence bears on"
|
|
317
|
+
},
|
|
318
|
+
weight: {
|
|
319
|
+
type: "number",
|
|
320
|
+
description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
|
|
321
|
+
},
|
|
322
|
+
reasoning: {
|
|
323
|
+
type: "string",
|
|
324
|
+
description: "Why this evidence is relevant to the target belief"
|
|
325
|
+
},
|
|
326
|
+
title: {
|
|
327
|
+
type: "string",
|
|
328
|
+
description: "Optional short title for the evidence node"
|
|
329
|
+
},
|
|
330
|
+
content: {
|
|
331
|
+
type: "string",
|
|
332
|
+
description: "Optional long-form content (separate from canonicalText summary)"
|
|
333
|
+
},
|
|
334
|
+
contentType: {
|
|
335
|
+
type: "string",
|
|
336
|
+
description: "Content MIME type or format hint (e.g., 'text/markdown', 'code')"
|
|
337
|
+
},
|
|
338
|
+
metadata: {
|
|
339
|
+
type: "object",
|
|
340
|
+
description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'], failedApproach: true } for coding intelligence)"
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
required: ["canonicalText", "targetNodeId"],
|
|
344
|
+
response: {
|
|
345
|
+
description: "The created evidence node and its edge",
|
|
346
|
+
fields: {
|
|
347
|
+
nodeId: "string \u2014 evidence node ID",
|
|
348
|
+
edgeId: "string \u2014 edge to target belief"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
ownerModule: "graph-primitives",
|
|
352
|
+
ontologyPrimitive: "evidence",
|
|
353
|
+
tier: "showcase"
|
|
354
|
+
};
|
|
355
|
+
var FLAG_CONTRADICTION = {
|
|
356
|
+
name: "flag_contradiction",
|
|
357
|
+
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.",
|
|
358
|
+
parameters: {
|
|
359
|
+
beliefA: {
|
|
360
|
+
type: "string",
|
|
361
|
+
description: "First belief in the contradiction"
|
|
362
|
+
},
|
|
363
|
+
beliefB: {
|
|
364
|
+
type: "string",
|
|
365
|
+
description: "Second belief in the contradiction"
|
|
366
|
+
},
|
|
367
|
+
description: { type: "string", description: "What the tension is about" },
|
|
368
|
+
severity: {
|
|
369
|
+
type: "string",
|
|
370
|
+
description: "How serious the contradiction is",
|
|
371
|
+
enum: ["low", "medium", "high", "critical"]
|
|
372
|
+
},
|
|
373
|
+
topicId: { type: "string", description: "Optional topic scope hint" },
|
|
374
|
+
defeatType: {
|
|
375
|
+
type: "string",
|
|
376
|
+
description: "Pollock defeat classification: rebuts (direct contradiction), undercuts (attacks the inferential link), undermines (attacks a premise)",
|
|
377
|
+
enum: ["rebuts", "undercuts", "undermines"]
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
required: ["beliefA", "beliefB", "description"],
|
|
381
|
+
response: {
|
|
382
|
+
description: "The created contradiction object",
|
|
383
|
+
fields: {
|
|
384
|
+
contradictionId: "string",
|
|
385
|
+
status: "string \u2014 'unresolved'",
|
|
386
|
+
beliefA: "string",
|
|
387
|
+
beliefB: "string"
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
ownerModule: "graph-primitives",
|
|
391
|
+
ontologyPrimitive: "belief",
|
|
392
|
+
tier: "showcase"
|
|
393
|
+
};
|
|
394
|
+
var ADD_WORKTREE = {
|
|
395
|
+
name: "add_worktree",
|
|
396
|
+
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.",
|
|
397
|
+
parameters: {
|
|
398
|
+
title: { type: "string", description: "Worktree name/objective" },
|
|
399
|
+
topicId: { type: "string", description: "Optional topic scope hint" },
|
|
400
|
+
branchId: {
|
|
401
|
+
type: "string",
|
|
402
|
+
description: "The branch this worktree investigates"
|
|
403
|
+
},
|
|
404
|
+
objective: {
|
|
405
|
+
type: "string",
|
|
406
|
+
description: "Plain-text reasoning objective to auto-shape into a hypothesis, questions, tasks, and dependencies"
|
|
407
|
+
},
|
|
408
|
+
hypothesis: {
|
|
409
|
+
type: "string",
|
|
410
|
+
description: "The testable claim this worktree investigates"
|
|
411
|
+
},
|
|
412
|
+
beliefIds: {
|
|
413
|
+
type: "array",
|
|
414
|
+
description: "Beliefs to test in this worktree"
|
|
415
|
+
},
|
|
416
|
+
autoShape: {
|
|
417
|
+
type: "boolean",
|
|
418
|
+
description: "Whether to invoke inquiry auto-shaping during worktree creation"
|
|
419
|
+
},
|
|
420
|
+
domainPackId: {
|
|
421
|
+
type: "string",
|
|
422
|
+
description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
|
|
423
|
+
},
|
|
424
|
+
executionOrder: {
|
|
425
|
+
type: "number",
|
|
426
|
+
description: "Global execution order for this worktree"
|
|
427
|
+
},
|
|
428
|
+
dependsOn: {
|
|
429
|
+
type: "array",
|
|
430
|
+
description: "Worktree IDs that must complete before this one can activate"
|
|
431
|
+
},
|
|
432
|
+
blocks: {
|
|
433
|
+
type: "array",
|
|
434
|
+
description: "Worktree IDs blocked by this worktree"
|
|
435
|
+
},
|
|
436
|
+
gate: {
|
|
437
|
+
type: "string",
|
|
438
|
+
description: "Exit gate name for this worktree"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
required: ["title", "topicId"],
|
|
442
|
+
response: {
|
|
443
|
+
description: "The created worktree",
|
|
444
|
+
fields: {
|
|
445
|
+
worktreeId: "string",
|
|
446
|
+
branchId: "string | null",
|
|
447
|
+
status: "string \u2014 usually 'planning' or 'active'",
|
|
448
|
+
title: "string",
|
|
449
|
+
hypothesis: "string | null",
|
|
450
|
+
questionCount: "number",
|
|
451
|
+
taskCount: "number",
|
|
452
|
+
autoShapeApplied: "boolean",
|
|
453
|
+
frameworkSuggestions: "array",
|
|
454
|
+
dependencySuggestions: "array"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
ownerModule: "workflow-engine",
|
|
458
|
+
ontologyPrimitive: "worktree",
|
|
459
|
+
tier: "showcase"
|
|
460
|
+
};
|
|
461
|
+
var MERGE = {
|
|
462
|
+
name: "merge",
|
|
463
|
+
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.",
|
|
464
|
+
parameters: {
|
|
465
|
+
worktreeId: { type: "string", description: "The worktree to merge" },
|
|
466
|
+
outcomes: {
|
|
467
|
+
type: "array",
|
|
468
|
+
description: "Scoring outcomes for each belief: { beliefId, confidence, rationale }"
|
|
469
|
+
},
|
|
470
|
+
summary: { type: "string", description: "Overall findings summary" }
|
|
471
|
+
},
|
|
472
|
+
required: ["worktreeId", "outcomes"],
|
|
473
|
+
response: {
|
|
474
|
+
description: "Merge result",
|
|
475
|
+
fields: {
|
|
476
|
+
worktreeId: "string",
|
|
477
|
+
status: "string \u2014 'merged'",
|
|
478
|
+
beliefsScored: "number"
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
ownerModule: "workflow-engine",
|
|
482
|
+
ontologyPrimitive: "worktree",
|
|
483
|
+
tier: "showcase"
|
|
484
|
+
};
|
|
485
|
+
var QUERY_LINEAGE = {
|
|
486
|
+
name: "query_lineage",
|
|
487
|
+
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).",
|
|
488
|
+
parameters: {
|
|
489
|
+
nodeId: { type: "string", description: "Starting node to trace from" },
|
|
490
|
+
depth: {
|
|
491
|
+
type: "number",
|
|
492
|
+
description: "How many generations to traverse (default: 5)"
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
required: ["nodeId"],
|
|
496
|
+
response: {
|
|
497
|
+
description: "Canonical lineage result",
|
|
498
|
+
fields: {
|
|
499
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
500
|
+
lineage: "array \u2014 ancestry entries with beliefId, nodeId, formulation, forkReason, and createdAt"
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
ownerModule: "graph-search",
|
|
504
|
+
ontologyPrimitive: "belief",
|
|
505
|
+
tier: "workhorse"
|
|
506
|
+
};
|
|
507
|
+
var GET_CONFIDENCE_HISTORY = {
|
|
508
|
+
name: "get_confidence_history",
|
|
509
|
+
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.",
|
|
510
|
+
parameters: {
|
|
511
|
+
nodeId: { type: "string", description: "The belief to get history for" }
|
|
512
|
+
},
|
|
513
|
+
required: ["nodeId"],
|
|
514
|
+
response: {
|
|
515
|
+
description: "Confidence history entries",
|
|
516
|
+
fields: {
|
|
517
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
518
|
+
entries: "array \u2014 { confidence, trigger, rationale, timestamp, userId }",
|
|
519
|
+
nextCursor: "string | null"
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
ownerModule: "graph-primitives",
|
|
523
|
+
ontologyPrimitive: "belief",
|
|
524
|
+
tier: "workhorse"
|
|
525
|
+
};
|
|
526
|
+
var GET_AUDIT_TRAIL = {
|
|
527
|
+
name: "get_audit_trail",
|
|
528
|
+
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).",
|
|
529
|
+
parameters: {
|
|
530
|
+
nodeId: { type: "string", description: "The node to audit" },
|
|
531
|
+
limit: {
|
|
532
|
+
type: "number",
|
|
533
|
+
description: "Maximum entries to return (default: 50)"
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
required: ["nodeId"],
|
|
537
|
+
response: {
|
|
538
|
+
description: "Audit trail entries",
|
|
539
|
+
fields: {
|
|
540
|
+
entries: "array \u2014 { action, actor, timestamp, before, after, rationale }"
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
ownerModule: "graph-primitives",
|
|
544
|
+
ontologyPrimitive: "graph",
|
|
545
|
+
tier: "workhorse"
|
|
546
|
+
};
|
|
547
|
+
var TRAVERSE_GRAPH = {
|
|
548
|
+
name: "traverse_graph",
|
|
549
|
+
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.",
|
|
550
|
+
parameters: {
|
|
551
|
+
startNode: { type: "string", description: "Node to start traversal from" },
|
|
552
|
+
direction: {
|
|
553
|
+
type: "string",
|
|
554
|
+
description: "Traversal direction",
|
|
555
|
+
enum: ["up", "down", "both"]
|
|
556
|
+
},
|
|
557
|
+
maxDepth: {
|
|
558
|
+
type: "number",
|
|
559
|
+
description: "Maximum traversal depth (default: 3)"
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
required: ["startNode"],
|
|
563
|
+
response: {
|
|
564
|
+
description: "Subgraph of traversed nodes and edges",
|
|
565
|
+
fields: {
|
|
566
|
+
nodes: "array \u2014 traversed nodes",
|
|
567
|
+
edges: "array \u2014 traversed edges",
|
|
568
|
+
depth: "number"
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
ownerModule: "graph-search",
|
|
572
|
+
ontologyPrimitive: "graph",
|
|
573
|
+
tier: "workhorse"
|
|
574
|
+
};
|
|
575
|
+
var GET_GRAPH_NEIGHBORHOOD = {
|
|
576
|
+
name: "get_graph_neighborhood",
|
|
577
|
+
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.",
|
|
578
|
+
parameters: {
|
|
579
|
+
globalId: {
|
|
580
|
+
type: "string",
|
|
581
|
+
description: "Single root node global identifier."
|
|
582
|
+
},
|
|
583
|
+
globalIds: {
|
|
584
|
+
type: "array",
|
|
585
|
+
description: "Optional list of root node global identifiers."
|
|
586
|
+
},
|
|
587
|
+
maxDepth: {
|
|
588
|
+
type: "number",
|
|
589
|
+
description: "Maximum traversal depth (default: 2)."
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
required: [],
|
|
593
|
+
response: {
|
|
594
|
+
description: "Canonical graph neighborhood payload",
|
|
595
|
+
fields: {
|
|
596
|
+
nodes: "array \u2014 graph nodes in the returned neighborhood",
|
|
597
|
+
edges: "array \u2014 graph edges in the returned neighborhood",
|
|
598
|
+
depth: "number \u2014 deepest traversed node depth"
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
ownerModule: "graph-search",
|
|
602
|
+
ontologyPrimitive: "graph",
|
|
603
|
+
tier: "workhorse"
|
|
604
|
+
};
|
|
605
|
+
var TRACE_ENTITY_IMPACT = {
|
|
606
|
+
name: "trace_entity_impact",
|
|
607
|
+
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.",
|
|
608
|
+
parameters: {
|
|
609
|
+
nodeId: {
|
|
610
|
+
type: "string",
|
|
611
|
+
description: "Entity node ID to trace impact from"
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
required: ["nodeId"],
|
|
615
|
+
response: {
|
|
616
|
+
description: "Entity impact trace: direct beliefs, evidence, and indirect belief reach",
|
|
617
|
+
fields: {
|
|
618
|
+
entityNodeId: "string \u2014 the traced entity",
|
|
619
|
+
entityType: "string \u2014 nodeType of the entity",
|
|
620
|
+
directBeliefConnections: "array \u2014 beliefs directly connected via bridge edges",
|
|
621
|
+
evidenceConnections: "array \u2014 evidence referencing this entity",
|
|
622
|
+
indirectBeliefConnections: "array \u2014 beliefs reached through evidence",
|
|
623
|
+
totalBeliefReach: "number \u2014 total unique beliefs impacted"
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
ownerModule: "graph-search",
|
|
627
|
+
ontologyPrimitive: "graph",
|
|
628
|
+
tier: "workhorse"
|
|
629
|
+
};
|
|
630
|
+
var SEARCH_BELIEFS = {
|
|
631
|
+
name: "search_beliefs",
|
|
632
|
+
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.",
|
|
633
|
+
parameters: {
|
|
634
|
+
query: { type: "string", description: "Semantic search query" },
|
|
635
|
+
status: {
|
|
636
|
+
type: "string",
|
|
637
|
+
description: "Filter by belief status",
|
|
638
|
+
enum: ["unscored", "scored", "archived"]
|
|
639
|
+
},
|
|
640
|
+
minConfidence: {
|
|
641
|
+
type: "number",
|
|
642
|
+
description: "Minimum confidence threshold (0-1)"
|
|
643
|
+
},
|
|
644
|
+
topicId: { type: "string", description: "Filter by topic" },
|
|
645
|
+
limit: { type: "number", description: "Maximum results (default: 10)" }
|
|
646
|
+
},
|
|
647
|
+
required: ["query"],
|
|
648
|
+
response: {
|
|
649
|
+
description: "Matching beliefs with metadata",
|
|
650
|
+
fields: {
|
|
651
|
+
results: "array \u2014 { nodeId, canonicalText, confidence, status, contradictionCount }"
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
ownerModule: "graph-search",
|
|
655
|
+
ontologyPrimitive: "belief",
|
|
656
|
+
tier: "workhorse"
|
|
657
|
+
};
|
|
658
|
+
var FIND_CONTRADICTIONS = {
|
|
659
|
+
name: "find_contradictions",
|
|
660
|
+
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.",
|
|
661
|
+
parameters: {
|
|
662
|
+
topicId: { type: "string", description: "Filter by topic" },
|
|
663
|
+
nodeId: {
|
|
664
|
+
type: "string",
|
|
665
|
+
description: "Find contradictions involving a specific belief"
|
|
666
|
+
},
|
|
667
|
+
status: {
|
|
668
|
+
type: "string",
|
|
669
|
+
description: "Filter by status",
|
|
670
|
+
enum: ["unresolved", "resolved", "accepted"]
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
required: [],
|
|
674
|
+
response: {
|
|
675
|
+
description: "Contradiction objects",
|
|
676
|
+
fields: {
|
|
677
|
+
contradictions: "array \u2014 { beliefA, beliefB, description, severity, status, defeatType }"
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
ownerModule: "graph-search",
|
|
681
|
+
ontologyPrimitive: "belief",
|
|
682
|
+
tier: "showcase"
|
|
683
|
+
};
|
|
684
|
+
var CREATE_EDGE = {
|
|
685
|
+
name: "create_edge",
|
|
686
|
+
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).",
|
|
687
|
+
parameters: {
|
|
688
|
+
sourceId: {
|
|
689
|
+
type: "string",
|
|
690
|
+
description: "Source node of the relationship"
|
|
691
|
+
},
|
|
692
|
+
targetId: {
|
|
693
|
+
type: "string",
|
|
694
|
+
description: "Target node of the relationship"
|
|
695
|
+
},
|
|
696
|
+
edgeType: {
|
|
697
|
+
type: "string",
|
|
698
|
+
description: "Relationship type (informs, tests, depends_on, supersedes, etc.)"
|
|
699
|
+
},
|
|
700
|
+
weight: {
|
|
701
|
+
type: "number",
|
|
702
|
+
description: "Edge weight: -1.0 to +1.0 for informs edges, 0-1 for structural"
|
|
703
|
+
},
|
|
704
|
+
reasoning: { type: "string", description: "Why this relationship exists" },
|
|
705
|
+
reasoningMethod: {
|
|
706
|
+
type: "string",
|
|
707
|
+
description: "How this was determined",
|
|
708
|
+
enum: ["deductive", "inductive", "abductive", "analogical", "empirical"]
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
required: ["sourceId", "targetId", "edgeType"],
|
|
712
|
+
response: {
|
|
713
|
+
description: "The created edge",
|
|
714
|
+
fields: {
|
|
715
|
+
globalId: "string \u2014 edge identifier",
|
|
716
|
+
edgeType: "string",
|
|
717
|
+
fromLayer: "string",
|
|
718
|
+
toLayer: "string"
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
ownerModule: "graph-primitives",
|
|
722
|
+
ontologyPrimitive: "edge",
|
|
723
|
+
tier: "showcase"
|
|
724
|
+
};
|
|
725
|
+
var RECORD_JUDGMENT = {
|
|
726
|
+
name: "record_judgment",
|
|
727
|
+
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).",
|
|
728
|
+
parameters: {
|
|
729
|
+
title: { type: "string", description: "Short judgment statement" },
|
|
730
|
+
rationale: {
|
|
731
|
+
type: "string",
|
|
732
|
+
description: "Full reasoning behind the judgment"
|
|
733
|
+
},
|
|
734
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
735
|
+
beliefIds: {
|
|
736
|
+
type: "array",
|
|
737
|
+
description: "Beliefs that warrant this judgment"
|
|
738
|
+
},
|
|
739
|
+
confidence: {
|
|
740
|
+
type: "number",
|
|
741
|
+
description: "Confidence in the judgment (0-1)"
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
required: ["title", "rationale"],
|
|
745
|
+
response: {
|
|
746
|
+
description: "The recorded judgment",
|
|
747
|
+
fields: {
|
|
748
|
+
judgmentId: "string",
|
|
749
|
+
title: "string",
|
|
750
|
+
status: "string \u2014 'issued'"
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
ownerModule: "decisions",
|
|
754
|
+
ontologyPrimitive: "judgment",
|
|
755
|
+
tier: "showcase"
|
|
756
|
+
};
|
|
757
|
+
var CREATE_LENS = {
|
|
758
|
+
name: "create_lens",
|
|
759
|
+
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.",
|
|
760
|
+
parameters: {
|
|
761
|
+
name: {
|
|
762
|
+
type: "string",
|
|
763
|
+
description: "Lens name (e.g., 'market dynamics', 'team quality')"
|
|
764
|
+
},
|
|
765
|
+
workspaceId: {
|
|
766
|
+
type: "string",
|
|
767
|
+
description: "Workspace scope for the lens. Required unless topicId resolves to a workspace-scoped topic."
|
|
768
|
+
},
|
|
769
|
+
topicId: {
|
|
770
|
+
type: "string",
|
|
771
|
+
description: "Optional originating topic scope. Lenses remain reusable across topics even when this is set."
|
|
772
|
+
},
|
|
773
|
+
description: {
|
|
774
|
+
type: "string",
|
|
775
|
+
description: "What this lens is designed to investigate or monitor"
|
|
776
|
+
},
|
|
777
|
+
perspectiveType: {
|
|
778
|
+
type: "string",
|
|
779
|
+
description: "Perspective type for the lens. Validated against schemaEnumConfig category 'lens_perspective_type'.",
|
|
780
|
+
enum: [...LENS_PERSPECTIVE_TYPES]
|
|
781
|
+
},
|
|
782
|
+
promptTemplates: {
|
|
783
|
+
type: "array",
|
|
784
|
+
description: "Langfuse prompt references used when operating through this lens"
|
|
785
|
+
},
|
|
786
|
+
workflowTemplates: {
|
|
787
|
+
type: "array",
|
|
788
|
+
description: "Guided workflow templates for lens-driven investigations"
|
|
789
|
+
},
|
|
790
|
+
taskTemplates: {
|
|
791
|
+
type: "array",
|
|
792
|
+
description: "Default task templates instantiated when the lens is applied"
|
|
793
|
+
},
|
|
794
|
+
filterCriteria: {
|
|
795
|
+
type: "object",
|
|
796
|
+
description: "Belief/evidence filtering rules applied by the lens"
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
required: ["name", "perspectiveType"],
|
|
800
|
+
response: {
|
|
801
|
+
description: "The created lens",
|
|
802
|
+
fields: {
|
|
803
|
+
lensId: "string",
|
|
804
|
+
name: "string",
|
|
805
|
+
workspaceId: "string",
|
|
806
|
+
status: "string \u2014 'active'"
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
ownerModule: "reasoning-kernel",
|
|
810
|
+
ontologyPrimitive: "lens",
|
|
811
|
+
tier: "showcase"
|
|
812
|
+
};
|
|
813
|
+
var LIST_LENSES = {
|
|
814
|
+
name: "list_lenses",
|
|
815
|
+
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.",
|
|
816
|
+
parameters: {
|
|
817
|
+
workspaceId: {
|
|
818
|
+
type: "string",
|
|
819
|
+
description: "Workspace scope to list lenses from"
|
|
820
|
+
},
|
|
821
|
+
topicId: {
|
|
822
|
+
type: "string",
|
|
823
|
+
description: "Optional topic scope used to derive workspace and annotate applied lenses"
|
|
824
|
+
},
|
|
825
|
+
status: {
|
|
826
|
+
type: "string",
|
|
827
|
+
description: "Filter by lens lifecycle status",
|
|
828
|
+
enum: ["draft", "active", "archived"]
|
|
829
|
+
},
|
|
830
|
+
perspectiveType: {
|
|
831
|
+
type: "string",
|
|
832
|
+
description: "Filter by perspective type",
|
|
833
|
+
enum: [...LENS_PERSPECTIVE_TYPES]
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
required: [],
|
|
837
|
+
response: {
|
|
838
|
+
description: "Available lenses",
|
|
839
|
+
fields: {
|
|
840
|
+
lenses: "array \u2014 each item includes lensId, name, workspaceId, perspectiveType, status, and optional isAppliedToTopic"
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
ownerModule: "reasoning-kernel",
|
|
844
|
+
ontologyPrimitive: "lens",
|
|
845
|
+
tier: "workhorse"
|
|
846
|
+
};
|
|
847
|
+
var APPLY_LENS_TO_TOPIC = {
|
|
848
|
+
name: "apply_lens_to_topic",
|
|
849
|
+
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.",
|
|
850
|
+
parameters: {
|
|
851
|
+
lensId: { type: "string", description: "Lens to activate on the topic" },
|
|
852
|
+
topicId: { type: "string", description: "Topic that should receive the lens" }
|
|
853
|
+
},
|
|
854
|
+
required: ["lensId", "topicId"],
|
|
855
|
+
response: {
|
|
856
|
+
description: "Lens activation result",
|
|
857
|
+
fields: {
|
|
858
|
+
bindingId: "string",
|
|
859
|
+
lensId: "string",
|
|
860
|
+
topicId: "string",
|
|
861
|
+
status: "string \u2014 'active'"
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
ownerModule: "reasoning-kernel",
|
|
865
|
+
ontologyPrimitive: "lens",
|
|
866
|
+
tier: "workhorse"
|
|
867
|
+
};
|
|
868
|
+
var REMOVE_LENS_FROM_TOPIC = {
|
|
869
|
+
name: "remove_lens_from_topic",
|
|
870
|
+
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.",
|
|
871
|
+
parameters: {
|
|
872
|
+
lensId: { type: "string", description: "Lens to remove from the topic" },
|
|
873
|
+
topicId: { type: "string", description: "Topic that currently has the lens applied" }
|
|
874
|
+
},
|
|
875
|
+
required: ["lensId", "topicId"],
|
|
876
|
+
response: {
|
|
877
|
+
description: "Lens removal result",
|
|
878
|
+
fields: {
|
|
879
|
+
bindingId: "string",
|
|
880
|
+
lensId: "string",
|
|
881
|
+
topicId: "string",
|
|
882
|
+
status: "string \u2014 'removed'"
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
ownerModule: "reasoning-kernel",
|
|
886
|
+
ontologyPrimitive: "lens",
|
|
887
|
+
tier: "workhorse"
|
|
888
|
+
};
|
|
889
|
+
var PUSH = {
|
|
890
|
+
name: "push",
|
|
891
|
+
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.",
|
|
892
|
+
parameters: {
|
|
893
|
+
worktreeId: {
|
|
894
|
+
type: "string",
|
|
895
|
+
description: "The merged worktree whose findings to push"
|
|
896
|
+
},
|
|
897
|
+
targetContext: {
|
|
898
|
+
type: "string",
|
|
899
|
+
description: "Where to push (e.g., 'portfolio', 'ic_review', 'external')"
|
|
900
|
+
},
|
|
901
|
+
beliefIds: {
|
|
902
|
+
type: "array",
|
|
903
|
+
description: "Optional subset of beliefs to push (default: all scored)"
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
required: ["worktreeId", "targetContext"],
|
|
907
|
+
response: {
|
|
908
|
+
description: "Push result",
|
|
909
|
+
fields: {
|
|
910
|
+
pushedCount: "number",
|
|
911
|
+
targetContext: "string",
|
|
912
|
+
pushedAt: "number"
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
ownerModule: "workflow-engine",
|
|
916
|
+
ontologyPrimitive: "worktree",
|
|
917
|
+
tier: "workhorse"
|
|
918
|
+
};
|
|
919
|
+
var OPEN_PULL_REQUEST = {
|
|
920
|
+
name: "open_pull_request",
|
|
921
|
+
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.",
|
|
922
|
+
parameters: {
|
|
923
|
+
worktreeId: {
|
|
924
|
+
type: "string",
|
|
925
|
+
description: "The worktree to submit for review"
|
|
926
|
+
},
|
|
927
|
+
reviewers: {
|
|
928
|
+
type: "array",
|
|
929
|
+
description: "User IDs of requested reviewers"
|
|
930
|
+
},
|
|
931
|
+
summary: {
|
|
932
|
+
type: "string",
|
|
933
|
+
description: "Summary of findings and why they're ready for merge"
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
required: ["worktreeId", "summary"],
|
|
937
|
+
response: {
|
|
938
|
+
description: "The pull request",
|
|
939
|
+
fields: {
|
|
940
|
+
pullRequestId: "string",
|
|
941
|
+
worktreeId: "string",
|
|
942
|
+
status: "string \u2014 'pending_review'"
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
ownerModule: "workflow-engine",
|
|
946
|
+
ontologyPrimitive: "worktree",
|
|
947
|
+
tier: "showcase"
|
|
948
|
+
};
|
|
949
|
+
var BISECT_CONFIDENCE = {
|
|
950
|
+
name: "bisect_confidence",
|
|
951
|
+
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.",
|
|
952
|
+
parameters: {
|
|
953
|
+
nodeId: { type: "string", description: "The belief to bisect" },
|
|
954
|
+
expectedDirection: {
|
|
955
|
+
type: "string",
|
|
956
|
+
description: "Was confidence too high or too low?",
|
|
957
|
+
enum: ["overconfident", "underconfident"]
|
|
958
|
+
},
|
|
959
|
+
timeRange: {
|
|
960
|
+
type: "object",
|
|
961
|
+
description: "Optional time range to search within: { start: number, end: number }"
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
required: ["nodeId", "expectedDirection"],
|
|
965
|
+
response: {
|
|
966
|
+
description: "The inflection point in confidence history",
|
|
967
|
+
fields: {
|
|
968
|
+
beliefId: "string \u2014 canonical belief ID",
|
|
969
|
+
expectedDirection: "string \u2014 overconfident | underconfident",
|
|
970
|
+
inflectionEntry: "object \u2014 the confidence modulation where divergence began",
|
|
971
|
+
triggerEvent: "string | null \u2014 what caused the divergence",
|
|
972
|
+
confidenceBefore: "number | null",
|
|
973
|
+
confidenceAfter: "number | null",
|
|
974
|
+
totalEntries: "number",
|
|
975
|
+
inflectionIndex: "number | null"
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
ownerModule: "graph-search",
|
|
979
|
+
ontologyPrimitive: "belief",
|
|
980
|
+
tier: "showcase"
|
|
981
|
+
};
|
|
982
|
+
var DETECT_CONFIRMATION_BIAS = {
|
|
983
|
+
name: "detect_confirmation_bias",
|
|
984
|
+
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).",
|
|
985
|
+
parameters: {
|
|
986
|
+
topicId: { type: "string", description: "Topic to analyze" },
|
|
987
|
+
threshold: {
|
|
988
|
+
type: "number",
|
|
989
|
+
description: "Bias threshold (0-1, default 0.7)"
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
required: ["topicId"],
|
|
993
|
+
response: {
|
|
994
|
+
description: "Beliefs with bias scores, risk levels, and evidence counts",
|
|
995
|
+
fields: {
|
|
996
|
+
beliefs: "array \u2014 { nodeId, biasScore, riskLevel, supportingCount, challengingCount }"
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
ownerModule: "graph-search",
|
|
1000
|
+
ontologyPrimitive: "graph",
|
|
1001
|
+
tier: "showcase"
|
|
1002
|
+
};
|
|
1003
|
+
var GET_GRAPH_STRUCTURE_ANALYSIS = {
|
|
1004
|
+
name: "get_graph_structure_analysis",
|
|
1005
|
+
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.",
|
|
1006
|
+
parameters: {
|
|
1007
|
+
topicId: { type: "string", description: "Topic to analyze" }
|
|
1008
|
+
},
|
|
1009
|
+
required: ["topicId"],
|
|
1010
|
+
response: {
|
|
1011
|
+
description: "Structural analysis with detector results and recommendations",
|
|
1012
|
+
fields: {
|
|
1013
|
+
topicId: "string \u2014 canonical topic scope",
|
|
1014
|
+
metric: "string \u2014 analysis metric identifier",
|
|
1015
|
+
payload: "object \u2014 detector results, recommendations, graph metrics"
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
ownerModule: "graph-search",
|
|
1019
|
+
ontologyPrimitive: "graph",
|
|
1020
|
+
tier: "showcase"
|
|
1021
|
+
};
|
|
1022
|
+
var GET_FALSIFICATION_QUESTIONS = {
|
|
1023
|
+
name: "get_falsification_questions",
|
|
1024
|
+
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.",
|
|
1025
|
+
parameters: {
|
|
1026
|
+
topicId: { type: "string", description: "Topic to analyze" },
|
|
1027
|
+
beliefIds: { type: "array", description: "Specific beliefs to target" }
|
|
1028
|
+
},
|
|
1029
|
+
required: ["topicId"],
|
|
1030
|
+
response: {
|
|
1031
|
+
description: "Questions with falsification potential scores and target beliefs",
|
|
1032
|
+
fields: {
|
|
1033
|
+
questions: "array \u2014 { questionText, falsificationPotential, targetBeliefId, targetBeliefText }"
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
ownerModule: "graph-search",
|
|
1037
|
+
ontologyPrimitive: "question",
|
|
1038
|
+
tier: "showcase"
|
|
1039
|
+
};
|
|
1040
|
+
var SEARCH_EVIDENCE = {
|
|
1041
|
+
name: "search_evidence",
|
|
1042
|
+
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.",
|
|
1043
|
+
parameters: {
|
|
1044
|
+
q: { type: "string", description: "Search text" },
|
|
1045
|
+
topicId: { type: "string", description: "Topic scope filter" },
|
|
1046
|
+
targetId: {
|
|
1047
|
+
type: "string",
|
|
1048
|
+
description: "Optional belief or question identifier to scope the search"
|
|
1049
|
+
},
|
|
1050
|
+
limit: { type: "number", description: "Max results" },
|
|
1051
|
+
cursor: { type: "string", description: "Pagination cursor" }
|
|
1052
|
+
},
|
|
1053
|
+
required: ["q"],
|
|
1054
|
+
response: {
|
|
1055
|
+
description: "Canonical evidence search results page",
|
|
1056
|
+
fields: {
|
|
1057
|
+
results: "array \u2014 { evidenceId, nodeId, globalId?, text, source?, kind?, relevanceScore }",
|
|
1058
|
+
nextCursor: "string | null"
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
ownerModule: "graph-search",
|
|
1062
|
+
ontologyPrimitive: "evidence",
|
|
1063
|
+
tier: "workhorse"
|
|
1064
|
+
};
|
|
1065
|
+
var CREATE_EVIDENCE = {
|
|
1066
|
+
name: "create_evidence",
|
|
1067
|
+
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.",
|
|
1068
|
+
parameters: {
|
|
1069
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
1070
|
+
text: { type: "string", description: "Canonical evidence text" },
|
|
1071
|
+
source: { type: "string", description: "Source URL or source label" },
|
|
1072
|
+
targetId: {
|
|
1073
|
+
type: "string",
|
|
1074
|
+
description: "Optional belief or question identifier to link immediately"
|
|
1075
|
+
},
|
|
1076
|
+
weight: {
|
|
1077
|
+
type: "number",
|
|
1078
|
+
description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
|
|
1079
|
+
},
|
|
1080
|
+
metadata: {
|
|
1081
|
+
type: "object",
|
|
1082
|
+
description: "Optional metadata merged into the canonical evidence node"
|
|
1083
|
+
},
|
|
1084
|
+
title: { type: "string", description: "Optional short title" },
|
|
1085
|
+
content: { type: "string", description: "Optional long-form content" },
|
|
1086
|
+
contentType: {
|
|
1087
|
+
type: "string",
|
|
1088
|
+
description: "Optional content format or MIME hint"
|
|
1089
|
+
},
|
|
1090
|
+
kind: { type: "string", description: "Optional evidence kind" }
|
|
1091
|
+
},
|
|
1092
|
+
required: ["text"],
|
|
1093
|
+
response: {
|
|
1094
|
+
description: "The created canonical evidence record",
|
|
1095
|
+
fields: {
|
|
1096
|
+
id: "string \u2014 canonical evidence ID",
|
|
1097
|
+
nodeId: "string \u2014 canonical evidence ID",
|
|
1098
|
+
evidenceId: "string \u2014 canonical evidence ID",
|
|
1099
|
+
text: "string",
|
|
1100
|
+
topicId: "string"
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
ownerModule: "graph-primitives",
|
|
1104
|
+
ontologyPrimitive: "evidence",
|
|
1105
|
+
tier: "workhorse"
|
|
1106
|
+
};
|
|
1107
|
+
var GET_EVIDENCE = {
|
|
1108
|
+
name: "get_evidence",
|
|
1109
|
+
description: "Read one evidence record by ID. Like `git show` \u2014 resolves the canonical evidence payload for a single identifier.",
|
|
1110
|
+
parameters: {
|
|
1111
|
+
id: { type: "string", description: "Canonical evidence ID" }
|
|
1112
|
+
},
|
|
1113
|
+
required: ["id"],
|
|
1114
|
+
response: {
|
|
1115
|
+
description: "The canonical evidence record",
|
|
1116
|
+
fields: {
|
|
1117
|
+
id: "string \u2014 canonical evidence ID",
|
|
1118
|
+
nodeId: "string \u2014 canonical evidence ID",
|
|
1119
|
+
evidenceId: "string \u2014 canonical evidence ID",
|
|
1120
|
+
text: "string",
|
|
1121
|
+
topicId: "string"
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
ownerModule: "graph-primitives",
|
|
1125
|
+
ontologyPrimitive: "evidence",
|
|
1126
|
+
tier: "workhorse"
|
|
1127
|
+
};
|
|
1128
|
+
var LIST_EVIDENCE = {
|
|
1129
|
+
name: "list_evidence",
|
|
1130
|
+
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.",
|
|
1131
|
+
parameters: {
|
|
1132
|
+
topicId: { type: "string", description: "Topic scope filter" },
|
|
1133
|
+
targetId: {
|
|
1134
|
+
type: "string",
|
|
1135
|
+
description: "Optional belief or question identifier to scope by linkage"
|
|
1136
|
+
},
|
|
1137
|
+
limit: { type: "number", description: "Max results" },
|
|
1138
|
+
cursor: { type: "string", description: "Pagination cursor" }
|
|
1139
|
+
},
|
|
1140
|
+
required: [],
|
|
1141
|
+
response: {
|
|
1142
|
+
description: "Canonical evidence page",
|
|
1143
|
+
fields: {
|
|
1144
|
+
evidence: "array \u2014 canonical evidence records",
|
|
1145
|
+
nextCursor: "string | null"
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
ownerModule: "graph-primitives",
|
|
1149
|
+
ontologyPrimitive: "evidence",
|
|
1150
|
+
tier: "workhorse"
|
|
1151
|
+
};
|
|
1152
|
+
var LINK_EVIDENCE = {
|
|
1153
|
+
name: "link_evidence",
|
|
1154
|
+
description: "Link evidence to a belief or question. Like `git notes add` \u2014 attaches a supporting or contradicting edge without rewriting the evidence itself.",
|
|
1155
|
+
parameters: {
|
|
1156
|
+
evidenceId: { type: "string", description: "Canonical evidence ID" },
|
|
1157
|
+
targetId: {
|
|
1158
|
+
type: "string",
|
|
1159
|
+
description: "Canonical belief or question ID"
|
|
1160
|
+
},
|
|
1161
|
+
weight: {
|
|
1162
|
+
type: "number",
|
|
1163
|
+
description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
|
|
1164
|
+
},
|
|
1165
|
+
rationale: { type: "string", description: "Why this link exists" }
|
|
1166
|
+
},
|
|
1167
|
+
required: ["evidenceId", "targetId"],
|
|
1168
|
+
response: {
|
|
1169
|
+
description: "The created canonical evidence edge summary",
|
|
1170
|
+
fields: {
|
|
1171
|
+
edgeId: "string",
|
|
1172
|
+
evidenceId: "string",
|
|
1173
|
+
targetId: "string",
|
|
1174
|
+
targetType: "string \u2014 belief | question",
|
|
1175
|
+
weight: "number"
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
ownerModule: "graph-primitives",
|
|
1179
|
+
ontologyPrimitive: "edge",
|
|
1180
|
+
tier: "workhorse"
|
|
1181
|
+
};
|
|
1182
|
+
var LINK_EVIDENCE_TO_BELIEF = {
|
|
1183
|
+
name: "link_evidence_to_belief",
|
|
1184
|
+
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).",
|
|
1185
|
+
parameters: {
|
|
1186
|
+
evidenceId: { type: "string", description: "The evidence node ID" },
|
|
1187
|
+
beliefId: { type: "string", description: "The belief node ID" },
|
|
1188
|
+
weight: {
|
|
1189
|
+
type: "number",
|
|
1190
|
+
description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
|
|
1191
|
+
},
|
|
1192
|
+
rationale: { type: "string", description: "Why this evidence is relevant" }
|
|
1193
|
+
},
|
|
1194
|
+
required: ["evidenceId", "beliefId", "weight"],
|
|
1195
|
+
response: {
|
|
1196
|
+
description: "The created edge linking evidence to belief",
|
|
1197
|
+
fields: {
|
|
1198
|
+
edgeId: "string",
|
|
1199
|
+
evidenceId: "string",
|
|
1200
|
+
beliefId: "string",
|
|
1201
|
+
weight: "number"
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
ownerModule: "graph-primitives",
|
|
1205
|
+
ontologyPrimitive: "edge",
|
|
1206
|
+
tier: "workhorse"
|
|
1207
|
+
};
|
|
1208
|
+
var CREATE_QUESTION = {
|
|
1209
|
+
name: "create_question",
|
|
1210
|
+
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.",
|
|
1211
|
+
parameters: {
|
|
1212
|
+
text: { type: "string", description: "The question text" },
|
|
1213
|
+
topicId: { type: "string", description: "Optional topic scope hint" },
|
|
1214
|
+
priority: {
|
|
1215
|
+
type: "string",
|
|
1216
|
+
description: "Priority: urgent, high, medium, low",
|
|
1217
|
+
enum: ["urgent", "high", "medium", "low"]
|
|
1218
|
+
},
|
|
1219
|
+
linkedBeliefId: {
|
|
1220
|
+
type: "string",
|
|
1221
|
+
description: "Belief this question tests"
|
|
1222
|
+
},
|
|
1223
|
+
metadata: {
|
|
1224
|
+
type: "object",
|
|
1225
|
+
description: "Optional metadata merged into the question record"
|
|
1226
|
+
}
|
|
1227
|
+
},
|
|
1228
|
+
required: ["text"],
|
|
1229
|
+
response: {
|
|
1230
|
+
description: "The created canonical question record",
|
|
1231
|
+
fields: {
|
|
1232
|
+
id: "string \u2014 canonical question ID",
|
|
1233
|
+
nodeId: "string \u2014 canonical question ID",
|
|
1234
|
+
questionId: "string \u2014 canonical question ID",
|
|
1235
|
+
text: "string",
|
|
1236
|
+
status: "string"
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
ownerModule: "graph-primitives",
|
|
1240
|
+
ontologyPrimitive: "question",
|
|
1241
|
+
tier: "workhorse"
|
|
1242
|
+
};
|
|
1243
|
+
var GET_QUESTION = {
|
|
1244
|
+
name: "get_question",
|
|
1245
|
+
description: "Read one question by ID. Like `git show` \u2014 resolves the canonical question payload for a single identifier.",
|
|
1246
|
+
parameters: {
|
|
1247
|
+
id: { type: "string", description: "Canonical question ID" }
|
|
1248
|
+
},
|
|
1249
|
+
required: ["id"],
|
|
1250
|
+
response: {
|
|
1251
|
+
description: "The canonical question record",
|
|
1252
|
+
fields: {
|
|
1253
|
+
id: "string \u2014 canonical question ID",
|
|
1254
|
+
nodeId: "string \u2014 canonical question ID",
|
|
1255
|
+
questionId: "string \u2014 canonical question ID",
|
|
1256
|
+
text: "string",
|
|
1257
|
+
status: "string"
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
ownerModule: "graph-primitives",
|
|
1261
|
+
ontologyPrimitive: "question",
|
|
1262
|
+
tier: "workhorse"
|
|
1263
|
+
};
|
|
1264
|
+
var REFINE_QUESTION = {
|
|
1265
|
+
name: "refine_question",
|
|
1266
|
+
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.",
|
|
1267
|
+
parameters: {
|
|
1268
|
+
id: { type: "string", description: "The question to refine" },
|
|
1269
|
+
text: { type: "string", description: "Updated question text" },
|
|
1270
|
+
rationale: {
|
|
1271
|
+
type: "string",
|
|
1272
|
+
description: "Why the question is being refined"
|
|
1273
|
+
}
|
|
1274
|
+
},
|
|
1275
|
+
required: ["id", "text"],
|
|
1276
|
+
response: {
|
|
1277
|
+
description: "The refined question",
|
|
1278
|
+
fields: {
|
|
1279
|
+
id: "string",
|
|
1280
|
+
questionId: "string",
|
|
1281
|
+
updatedText: "string",
|
|
1282
|
+
previousText: "string"
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
ownerModule: "graph-primitives",
|
|
1286
|
+
ontologyPrimitive: "question",
|
|
1287
|
+
tier: "workhorse"
|
|
1288
|
+
};
|
|
1289
|
+
var LIST_QUESTIONS = {
|
|
1290
|
+
name: "list_questions",
|
|
1291
|
+
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.",
|
|
1292
|
+
parameters: {
|
|
1293
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
1294
|
+
worktreeId: { type: "string", description: "Filter to worktree scope" },
|
|
1295
|
+
status: {
|
|
1296
|
+
type: "string",
|
|
1297
|
+
description: "Filter by canonical question status",
|
|
1298
|
+
enum: ["open", "researching", "answered", "parked", "closed"]
|
|
1299
|
+
},
|
|
1300
|
+
priority: {
|
|
1301
|
+
type: "string",
|
|
1302
|
+
description: "Filter by canonical question priority",
|
|
1303
|
+
enum: ["urgent", "high", "medium", "low"]
|
|
1304
|
+
},
|
|
1305
|
+
limit: { type: "number", description: "Max results" },
|
|
1306
|
+
cursor: { type: "string", description: "Pagination cursor" }
|
|
1307
|
+
},
|
|
1308
|
+
required: ["topicId"],
|
|
1309
|
+
response: {
|
|
1310
|
+
description: "Canonical question page",
|
|
1311
|
+
fields: {
|
|
1312
|
+
questions: "array \u2014 canonical question records",
|
|
1313
|
+
nextCursor: "string | null"
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
ownerModule: "graph-primitives",
|
|
1317
|
+
ontologyPrimitive: "question",
|
|
1318
|
+
tier: "workhorse"
|
|
1319
|
+
};
|
|
1320
|
+
var ANSWER_QUESTION = {
|
|
1321
|
+
name: "answer_question",
|
|
1322
|
+
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.",
|
|
1323
|
+
parameters: {
|
|
1324
|
+
id: { type: "string", description: "Canonical question ID" },
|
|
1325
|
+
text: { type: "string", description: "Answer text" },
|
|
1326
|
+
confidence: {
|
|
1327
|
+
type: "string",
|
|
1328
|
+
description: "Optional answer confidence",
|
|
1329
|
+
enum: ["weak", "medium", "strong"]
|
|
1330
|
+
},
|
|
1331
|
+
evidenceIds: {
|
|
1332
|
+
type: "array",
|
|
1333
|
+
description: "Optional canonical evidence IDs supporting the answer"
|
|
1334
|
+
},
|
|
1335
|
+
rationale: { type: "string", description: "Why this answer is credible" }
|
|
1336
|
+
},
|
|
1337
|
+
required: ["id", "text"],
|
|
1338
|
+
response: {
|
|
1339
|
+
description: "Answer result",
|
|
1340
|
+
fields: {
|
|
1341
|
+
questionId: "string",
|
|
1342
|
+
answerId: "string",
|
|
1343
|
+
status: "string \u2014 answered"
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
ownerModule: "graph-primitives",
|
|
1347
|
+
ontologyPrimitive: "question",
|
|
1348
|
+
tier: "workhorse"
|
|
1349
|
+
};
|
|
1350
|
+
var UPDATE_QUESTION_STATUS = {
|
|
1351
|
+
name: "update_question_status",
|
|
1352
|
+
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.",
|
|
1353
|
+
parameters: {
|
|
1354
|
+
id: { type: "string", description: "The question to update" },
|
|
1355
|
+
status: {
|
|
1356
|
+
type: "string",
|
|
1357
|
+
description: "New status",
|
|
1358
|
+
enum: ["open", "researching", "answered", "parked", "closed"]
|
|
1359
|
+
},
|
|
1360
|
+
rationale: { type: "string", description: "Why the status is changing" }
|
|
1361
|
+
},
|
|
1362
|
+
required: ["id", "status"],
|
|
1363
|
+
response: {
|
|
1364
|
+
description: "Updated question status",
|
|
1365
|
+
fields: {
|
|
1366
|
+
id: "string",
|
|
1367
|
+
questionId: "string",
|
|
1368
|
+
previousStatus: "string",
|
|
1369
|
+
newStatus: "string"
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
ownerModule: "graph-primitives",
|
|
1373
|
+
ontologyPrimitive: "question",
|
|
1374
|
+
tier: "workhorse"
|
|
1375
|
+
};
|
|
1376
|
+
var ARCHIVE_QUESTION = {
|
|
1377
|
+
name: "archive_question",
|
|
1378
|
+
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.",
|
|
1379
|
+
parameters: {
|
|
1380
|
+
questionId: { type: "string", description: "The question to archive" },
|
|
1381
|
+
reason: {
|
|
1382
|
+
type: "string",
|
|
1383
|
+
description: "Why the question is being archived"
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1386
|
+
required: ["questionId"],
|
|
1387
|
+
response: {
|
|
1388
|
+
description: "Archive confirmation",
|
|
1389
|
+
fields: {
|
|
1390
|
+
questionId: "string",
|
|
1391
|
+
status: "string \u2014 'archived'",
|
|
1392
|
+
archivedAt: "number"
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
ownerModule: "graph-primitives",
|
|
1396
|
+
ontologyPrimitive: "question",
|
|
1397
|
+
tier: "workhorse"
|
|
1398
|
+
};
|
|
1399
|
+
var LINK_EVIDENCE_TO_QUESTION = {
|
|
1400
|
+
name: "link_evidence_to_question",
|
|
1401
|
+
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.",
|
|
1402
|
+
parameters: {
|
|
1403
|
+
evidenceId: { type: "string", description: "The evidence to link" },
|
|
1404
|
+
questionId: {
|
|
1405
|
+
type: "string",
|
|
1406
|
+
description: "The question this evidence addresses"
|
|
1407
|
+
},
|
|
1408
|
+
relevance: { type: "number", description: "Relevance score in [0,1]" },
|
|
1409
|
+
rationale: {
|
|
1410
|
+
type: "string",
|
|
1411
|
+
description: "How this evidence bears on the question"
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
required: ["evidenceId", "questionId"],
|
|
1415
|
+
response: {
|
|
1416
|
+
description: "The created edge",
|
|
1417
|
+
fields: {
|
|
1418
|
+
edgeId: "string",
|
|
1419
|
+
evidenceId: "string",
|
|
1420
|
+
questionId: "string",
|
|
1421
|
+
relevance: "number"
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
ownerModule: "graph-primitives",
|
|
1425
|
+
ontologyPrimitive: "edge",
|
|
1426
|
+
tier: "workhorse"
|
|
1427
|
+
};
|
|
1428
|
+
var CREATE_ANSWER = {
|
|
1429
|
+
name: "create_answer",
|
|
1430
|
+
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.",
|
|
1431
|
+
parameters: {
|
|
1432
|
+
questionNodeId: {
|
|
1433
|
+
type: "string",
|
|
1434
|
+
description: "The question node ID this answers"
|
|
1435
|
+
},
|
|
1436
|
+
answerText: {
|
|
1437
|
+
type: "string",
|
|
1438
|
+
description: "The answer content \u2014 the actual response to the question"
|
|
1439
|
+
},
|
|
1440
|
+
topicId: {
|
|
1441
|
+
type: "string",
|
|
1442
|
+
description: "Topic scope (optional if question already has topicId)"
|
|
1443
|
+
},
|
|
1444
|
+
confidence: {
|
|
1445
|
+
type: "string",
|
|
1446
|
+
description: "Answer confidence: definitive, strong, moderate, weak, speculative"
|
|
1447
|
+
},
|
|
1448
|
+
evidenceNodeIds: {
|
|
1449
|
+
type: "array",
|
|
1450
|
+
description: "Supporting evidence node IDs to link via based_on edges"
|
|
1451
|
+
},
|
|
1452
|
+
answerSource: {
|
|
1453
|
+
type: "string",
|
|
1454
|
+
description: "How the answer was produced: human, ai_generated, deep_research, synthesis"
|
|
1455
|
+
}
|
|
1456
|
+
},
|
|
1457
|
+
required: ["questionNodeId", "answerText"],
|
|
1458
|
+
response: {
|
|
1459
|
+
description: "The created answer node with version metadata",
|
|
1460
|
+
fields: {
|
|
1461
|
+
nodeId: "string \u2014 unique node identifier",
|
|
1462
|
+
globalId: "string \u2014 globally unique ID",
|
|
1463
|
+
versionNumber: "number \u2014 version of this answer (auto-incremented)",
|
|
1464
|
+
questionNodeId: "string \u2014 the question this answers",
|
|
1465
|
+
confidence: "string \u2014 answer confidence level"
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
ownerModule: "graph-primitives",
|
|
1469
|
+
ontologyPrimitive: "evidence",
|
|
1470
|
+
tier: "showcase"
|
|
1471
|
+
};
|
|
1472
|
+
var GET_ANSWER = {
|
|
1473
|
+
name: "get_answer",
|
|
1474
|
+
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.",
|
|
1475
|
+
parameters: {
|
|
1476
|
+
questionNodeId: {
|
|
1477
|
+
type: "string",
|
|
1478
|
+
description: "The question node ID to get the answer for"
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
required: ["questionNodeId"],
|
|
1482
|
+
response: {
|
|
1483
|
+
description: "The active answer node or null",
|
|
1484
|
+
fields: {
|
|
1485
|
+
nodeId: "string | null",
|
|
1486
|
+
globalId: "string | null",
|
|
1487
|
+
answerText: "string | null",
|
|
1488
|
+
versionNumber: "number",
|
|
1489
|
+
isLatest: "boolean",
|
|
1490
|
+
evidenceCount: "number",
|
|
1491
|
+
confidence: "string"
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
ownerModule: "graph-primitives",
|
|
1495
|
+
ontologyPrimitive: "evidence",
|
|
1496
|
+
tier: "workhorse"
|
|
1497
|
+
};
|
|
1498
|
+
var GET_HIGH_PRIORITY_QUESTIONS = {
|
|
1499
|
+
name: "get_high_priority_questions",
|
|
1500
|
+
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.",
|
|
1501
|
+
parameters: {
|
|
1502
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
1503
|
+
limit: { type: "number", description: "Maximum results (default: 20)" },
|
|
1504
|
+
includeAnswered: {
|
|
1505
|
+
type: "boolean",
|
|
1506
|
+
description: "Include answered questions (default: false)"
|
|
1507
|
+
}
|
|
1508
|
+
},
|
|
1509
|
+
required: ["topicId"],
|
|
1510
|
+
response: {
|
|
1511
|
+
description: "Priority-ranked questions",
|
|
1512
|
+
fields: {
|
|
1513
|
+
questions: "array \u2014 { questionId, text, priority, urgencyScore, linkedBeliefCount, evidenceGapCount }"
|
|
1514
|
+
}
|
|
1515
|
+
},
|
|
1516
|
+
ownerModule: "graph-search",
|
|
1517
|
+
ontologyPrimitive: "question",
|
|
1518
|
+
tier: "workhorse"
|
|
1519
|
+
};
|
|
1520
|
+
var FIND_MISSING_QUESTIONS = {
|
|
1521
|
+
name: "find_missing_questions",
|
|
1522
|
+
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.",
|
|
1523
|
+
parameters: {
|
|
1524
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
1525
|
+
minConfidence: {
|
|
1526
|
+
type: "number",
|
|
1527
|
+
description: "Only check beliefs above this confidence (default: 0)"
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
required: ["topicId"],
|
|
1531
|
+
response: {
|
|
1532
|
+
description: "Beliefs missing testing questions",
|
|
1533
|
+
fields: {
|
|
1534
|
+
gaps: "array \u2014 { beliefId, canonicalText, confidence, suggestedQuestions }",
|
|
1535
|
+
totalGaps: "number"
|
|
1536
|
+
}
|
|
1537
|
+
},
|
|
1538
|
+
ownerModule: "graph-search",
|
|
1539
|
+
ontologyPrimitive: "question",
|
|
1540
|
+
tier: "workhorse"
|
|
1541
|
+
};
|
|
1542
|
+
var LIST_BELIEFS = {
|
|
1543
|
+
name: "list_beliefs",
|
|
1544
|
+
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.",
|
|
1545
|
+
parameters: {
|
|
1546
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
1547
|
+
worktreeId: { type: "string", description: "Filter to worktree scope" },
|
|
1548
|
+
status: {
|
|
1549
|
+
type: "string",
|
|
1550
|
+
description: "Filter: unscored, scored, archived",
|
|
1551
|
+
enum: ["unscored", "scored", "archived"]
|
|
1552
|
+
},
|
|
1553
|
+
minConfidence: {
|
|
1554
|
+
type: "number",
|
|
1555
|
+
description: "Minimum confidence threshold"
|
|
1556
|
+
}
|
|
1557
|
+
},
|
|
1558
|
+
required: ["topicId"],
|
|
1559
|
+
response: {
|
|
1560
|
+
description: "Canonical belief page",
|
|
1561
|
+
fields: {
|
|
1562
|
+
beliefs: "array \u2014 canonical belief records",
|
|
1563
|
+
nextCursor: "string | null"
|
|
1564
|
+
}
|
|
1565
|
+
},
|
|
1566
|
+
ownerModule: "graph-primitives",
|
|
1567
|
+
ontologyPrimitive: "belief",
|
|
1568
|
+
tier: "workhorse"
|
|
1569
|
+
};
|
|
1570
|
+
var LIST_WORKTREES = {
|
|
1571
|
+
name: "list_worktrees",
|
|
1572
|
+
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.",
|
|
1573
|
+
parameters: {
|
|
1574
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
1575
|
+
status: {
|
|
1576
|
+
type: "string",
|
|
1577
|
+
description: "Filter: active, merged, abandoned",
|
|
1578
|
+
enum: ["active", "merged", "abandoned"]
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1581
|
+
required: ["topicId"],
|
|
1582
|
+
response: {
|
|
1583
|
+
description: "Worktrees with phase, status, belief count, and creation time",
|
|
1584
|
+
fields: {
|
|
1585
|
+
worktrees: "array \u2014 { worktreeId, title, phase, status, beliefCount, createdAt }"
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
ownerModule: "workflow-engine",
|
|
1589
|
+
ontologyPrimitive: "worktree",
|
|
1590
|
+
tier: "workhorse"
|
|
1591
|
+
};
|
|
1592
|
+
var LIST_ALL_WORKTREES = {
|
|
1593
|
+
name: "list_all_worktrees",
|
|
1594
|
+
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.",
|
|
1595
|
+
parameters: {
|
|
1596
|
+
status: {
|
|
1597
|
+
type: "string",
|
|
1598
|
+
description: "Filter by status: planning, active, completed, abandoned, superseded, long_term, idea, paused, suggested, dismissed",
|
|
1599
|
+
enum: [
|
|
1600
|
+
"planning",
|
|
1601
|
+
"active",
|
|
1602
|
+
"completed",
|
|
1603
|
+
"abandoned",
|
|
1604
|
+
"superseded",
|
|
1605
|
+
"long_term",
|
|
1606
|
+
"idea",
|
|
1607
|
+
"paused",
|
|
1608
|
+
"suggested",
|
|
1609
|
+
"dismissed"
|
|
1610
|
+
]
|
|
1611
|
+
},
|
|
1612
|
+
track: {
|
|
1613
|
+
type: "string",
|
|
1614
|
+
description: "Filter by track name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity')"
|
|
1615
|
+
},
|
|
1616
|
+
executionBand: {
|
|
1617
|
+
type: "number",
|
|
1618
|
+
description: "Filter by execution band number (e.g., 1, 2, 3). Returns only worktrees in that parallel execution group."
|
|
1619
|
+
},
|
|
1620
|
+
limit: {
|
|
1621
|
+
type: "number",
|
|
1622
|
+
description: "Maximum results to return (default: 500, max: 1000)"
|
|
1623
|
+
}
|
|
1624
|
+
},
|
|
1625
|
+
required: [],
|
|
1626
|
+
response: {
|
|
1627
|
+
description: "All worktrees across all topics with full pipeline metadata",
|
|
1628
|
+
fields: {
|
|
1629
|
+
worktrees: "array \u2014 { worktreeId, title, topicId, topicName, phase, status, hypothesis, track, trackPosition, executionBand, executionOrder, dependsOn, blocks, gate, createdAt }",
|
|
1630
|
+
total: "number \u2014 total count after filtering",
|
|
1631
|
+
tracks: "object \u2014 { trackName: count } summary of worktrees per track",
|
|
1632
|
+
bands: "object \u2014 { bandNumber: count } summary of worktrees per execution band"
|
|
1633
|
+
}
|
|
1634
|
+
},
|
|
1635
|
+
ownerModule: "workflow-engine",
|
|
1636
|
+
ontologyPrimitive: "worktree",
|
|
1637
|
+
tier: "showcase"
|
|
1638
|
+
};
|
|
1639
|
+
var ACTIVATE_WORKTREE = {
|
|
1640
|
+
name: "activate_worktree",
|
|
1641
|
+
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.",
|
|
1642
|
+
parameters: {
|
|
1643
|
+
worktreeId: { type: "string", description: "The worktree to activate" }
|
|
1644
|
+
},
|
|
1645
|
+
required: ["worktreeId"],
|
|
1646
|
+
response: {
|
|
1647
|
+
description: "Activation result with initial phase",
|
|
1648
|
+
fields: {
|
|
1649
|
+
worktreeId: "string",
|
|
1650
|
+
status: "string \u2014 'active'",
|
|
1651
|
+
phase: "string"
|
|
1652
|
+
}
|
|
1653
|
+
},
|
|
1654
|
+
ownerModule: "workflow-engine",
|
|
1655
|
+
ontologyPrimitive: "worktree",
|
|
1656
|
+
tier: "workhorse"
|
|
1657
|
+
};
|
|
1658
|
+
var UPDATE_WORKTREE_TARGETS = {
|
|
1659
|
+
name: "update_worktree_targets",
|
|
1660
|
+
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.",
|
|
1661
|
+
parameters: {
|
|
1662
|
+
worktreeId: { type: "string", description: "The worktree to update" },
|
|
1663
|
+
addBeliefIds: {
|
|
1664
|
+
type: "array",
|
|
1665
|
+
description: "Belief node IDs to add to the worktree"
|
|
1666
|
+
},
|
|
1667
|
+
addQuestionIds: {
|
|
1668
|
+
type: "array",
|
|
1669
|
+
description: "Question node IDs to add to the worktree"
|
|
1670
|
+
},
|
|
1671
|
+
removeBeliefIds: {
|
|
1672
|
+
type: "array",
|
|
1673
|
+
description: "Belief node IDs to remove from the worktree"
|
|
1674
|
+
},
|
|
1675
|
+
removeQuestionIds: {
|
|
1676
|
+
type: "array",
|
|
1677
|
+
description: "Question node IDs to remove from the worktree"
|
|
1678
|
+
}
|
|
1679
|
+
},
|
|
1680
|
+
required: ["worktreeId"],
|
|
1681
|
+
response: {
|
|
1682
|
+
description: "Updated target counts",
|
|
1683
|
+
fields: {
|
|
1684
|
+
worktreeId: "string",
|
|
1685
|
+
beliefCount: "number",
|
|
1686
|
+
questionCount: "number"
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
ownerModule: "workflow-engine",
|
|
1690
|
+
ontologyPrimitive: "worktree",
|
|
1691
|
+
tier: "workhorse"
|
|
1692
|
+
};
|
|
1693
|
+
var UPDATE_WORKTREE_METADATA = {
|
|
1694
|
+
name: "update_worktree_metadata",
|
|
1695
|
+
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.",
|
|
1696
|
+
parameters: {
|
|
1697
|
+
worktreeId: { type: "string", description: "The worktree to update" },
|
|
1698
|
+
hypothesis: {
|
|
1699
|
+
type: "string",
|
|
1700
|
+
description: "Testable claim this worktree investigates"
|
|
1701
|
+
},
|
|
1702
|
+
executionOrder: {
|
|
1703
|
+
type: "number",
|
|
1704
|
+
description: "Global execution order (1 = first, higher = later)"
|
|
1705
|
+
},
|
|
1706
|
+
dependsOn: {
|
|
1707
|
+
type: "array",
|
|
1708
|
+
description: "Worktree IDs that must complete before this one can activate"
|
|
1709
|
+
},
|
|
1710
|
+
blocks: {
|
|
1711
|
+
type: "array",
|
|
1712
|
+
description: "Worktree IDs that are blocked until this one completes"
|
|
1713
|
+
},
|
|
1714
|
+
gate: {
|
|
1715
|
+
type: "string",
|
|
1716
|
+
description: "Exit gate name (e.g., 'gate:ontology-schema-hardened')"
|
|
1717
|
+
},
|
|
1718
|
+
rationale: {
|
|
1719
|
+
type: "string",
|
|
1720
|
+
description: "Why this worktree is sequenced here"
|
|
1721
|
+
},
|
|
1722
|
+
objective: {
|
|
1723
|
+
type: "string",
|
|
1724
|
+
description: "What we're trying to learn/prove"
|
|
1725
|
+
},
|
|
1726
|
+
proofArtifacts: {
|
|
1727
|
+
type: "array",
|
|
1728
|
+
description: "Typed proof artifacts that define what evidence or deliverables this worktree must emit before it can claim success."
|
|
1729
|
+
},
|
|
1730
|
+
staffingHint: {
|
|
1731
|
+
type: "string",
|
|
1732
|
+
description: "Advisory staffing shape for the worktree (for example `backend+tests` or `fullstack`)."
|
|
1733
|
+
},
|
|
1734
|
+
lastReconciledAt: {
|
|
1735
|
+
type: "number",
|
|
1736
|
+
description: "Timestamp of the last deterministic workflow reconciliation pass against this worktree."
|
|
1737
|
+
},
|
|
1738
|
+
autoFixPolicy: {
|
|
1739
|
+
type: "object",
|
|
1740
|
+
description: "Calibrated auto-fix policy controlling dry-run vs safe execution, per-run action caps, and permitted mutation tiers."
|
|
1741
|
+
},
|
|
1742
|
+
track: {
|
|
1743
|
+
type: "string",
|
|
1744
|
+
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."
|
|
1745
|
+
},
|
|
1746
|
+
trackPosition: {
|
|
1747
|
+
type: "number",
|
|
1748
|
+
description: "Position within the track (1-indexed). E.g., TC-A=1, TC-B=2, TC-C=3 within the 'tc-scope' track."
|
|
1749
|
+
},
|
|
1750
|
+
executionBand: {
|
|
1751
|
+
type: "number",
|
|
1752
|
+
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."
|
|
1753
|
+
},
|
|
1754
|
+
status: {
|
|
1755
|
+
type: "string",
|
|
1756
|
+
description: "Override the worktree status. Use for lifecycle transitions like marking a worktree superseded, long-term, or as a raw idea.",
|
|
1757
|
+
enum: [
|
|
1758
|
+
"suggested",
|
|
1759
|
+
"planning",
|
|
1760
|
+
"active",
|
|
1761
|
+
"paused",
|
|
1762
|
+
"completed",
|
|
1763
|
+
"dismissed",
|
|
1764
|
+
"abandoned",
|
|
1765
|
+
"superseded",
|
|
1766
|
+
"long_term",
|
|
1767
|
+
"idea"
|
|
1768
|
+
]
|
|
1769
|
+
},
|
|
1770
|
+
topicId: {
|
|
1771
|
+
type: "string",
|
|
1772
|
+
description: "Reassign this worktree's primary topic. Validates the target topic exists before updating."
|
|
1773
|
+
},
|
|
1774
|
+
additionalTopicIds: {
|
|
1775
|
+
type: "array",
|
|
1776
|
+
description: "Set additional topic associations for cross-topic worktrees. Each topic ID is validated before updating. Use when a worktree spans multiple knowledge domains."
|
|
1777
|
+
}
|
|
1778
|
+
},
|
|
1779
|
+
required: ["worktreeId"],
|
|
1780
|
+
response: {
|
|
1781
|
+
description: "Update confirmation",
|
|
1782
|
+
fields: { worktreeId: "string", success: "boolean" }
|
|
1783
|
+
},
|
|
1784
|
+
ownerModule: "workflow-engine",
|
|
1785
|
+
ontologyPrimitive: "worktree",
|
|
1786
|
+
tier: "workhorse"
|
|
1787
|
+
};
|
|
1788
|
+
var IDENTITY_WHOAMI = {
|
|
1789
|
+
name: "identity_whoami",
|
|
1790
|
+
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.",
|
|
1791
|
+
parameters: {},
|
|
1792
|
+
required: [],
|
|
1793
|
+
response: {
|
|
1794
|
+
description: "Canonical identity summary for the current session",
|
|
1795
|
+
fields: {
|
|
1796
|
+
principalId: "string \u2014 canonical federated principal identifier",
|
|
1797
|
+
principalType: "string \u2014 human, service, or agent",
|
|
1798
|
+
tenantId: "string | undefined \u2014 resolved tenant scope",
|
|
1799
|
+
workspaceId: "string | undefined \u2014 resolved workspace scope",
|
|
1800
|
+
scopes: "string[] | undefined \u2014 granted scopes for this session",
|
|
1801
|
+
roles: "string[] | undefined \u2014 canonical roles for this session"
|
|
1802
|
+
}
|
|
1803
|
+
},
|
|
1804
|
+
ownerModule: "identity-core",
|
|
1805
|
+
ontologyPrimitive: "identity",
|
|
1806
|
+
tier: "workhorse"
|
|
1807
|
+
};
|
|
1808
|
+
var COMPILE_CONTEXT = {
|
|
1809
|
+
name: "compile_context",
|
|
1810
|
+
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.",
|
|
1811
|
+
parameters: {
|
|
1812
|
+
topicId: {
|
|
1813
|
+
type: "string",
|
|
1814
|
+
description: "Topic scope ID to compile"
|
|
1815
|
+
},
|
|
1816
|
+
query: {
|
|
1817
|
+
type: "string",
|
|
1818
|
+
description: "Optional focus query used to rank context items"
|
|
1819
|
+
},
|
|
1820
|
+
budget: {
|
|
1821
|
+
type: "number",
|
|
1822
|
+
description: "Token budget for prompt injection planning"
|
|
1823
|
+
},
|
|
1824
|
+
ranking: {
|
|
1825
|
+
type: "string",
|
|
1826
|
+
description: "Ranking profile for context ordering",
|
|
1827
|
+
enum: ["baseline_v1", "weighted_v1"]
|
|
1828
|
+
},
|
|
1829
|
+
limit: {
|
|
1830
|
+
type: "number",
|
|
1831
|
+
description: "Optional per-section item limit"
|
|
1832
|
+
},
|
|
1833
|
+
maxDepth: {
|
|
1834
|
+
type: "number",
|
|
1835
|
+
description: "Optional descendant topic depth for neighborhood expansion"
|
|
1836
|
+
},
|
|
1837
|
+
includeEntities: {
|
|
1838
|
+
type: "boolean",
|
|
1839
|
+
description: "Include related ontological entities in the compiled result"
|
|
1840
|
+
}
|
|
1841
|
+
},
|
|
1842
|
+
required: ["topicId"],
|
|
1843
|
+
response: {
|
|
1844
|
+
description: "Compiled context pack for the requested topic",
|
|
1845
|
+
fields: {
|
|
1846
|
+
schemaVersion: "string",
|
|
1847
|
+
topicId: "string",
|
|
1848
|
+
topicName: "string",
|
|
1849
|
+
scopedTopicIds: "array \u2014 topic IDs included in the compilation neighborhood",
|
|
1850
|
+
generatedAt: "number \u2014 deterministic graph-backed reference timestamp for this compilation",
|
|
1851
|
+
ranking: "string \u2014 baseline_v1 | weighted_v1",
|
|
1852
|
+
summary: "object \u2014 counts and scoped health signals",
|
|
1853
|
+
invariants: "array \u2014 high-confidence invariant beliefs",
|
|
1854
|
+
activeBeliefs: "array \u2014 current high-signal beliefs",
|
|
1855
|
+
openQuestions: "array \u2014 unresolved questions ranked for this query",
|
|
1856
|
+
recentEvidence: "array \u2014 recent evidence ranked for this query",
|
|
1857
|
+
contradictions: "array \u2014 unresolved contradiction records",
|
|
1858
|
+
relatedEntities: "array | undefined \u2014 ranked ontological entities in scope",
|
|
1859
|
+
contextNarrative: "array \u2014 guidance for prompt assembly",
|
|
1860
|
+
injectionPolicy: "object \u2014 token-budgeted section selections",
|
|
1861
|
+
diagnostics: "object \u2014 scoring and utilization telemetry"
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
ownerModule: "reasoning-kernel",
|
|
1865
|
+
ontologyPrimitive: "graph",
|
|
1866
|
+
tier: "showcase"
|
|
1867
|
+
};
|
|
1868
|
+
var CHECK_PERMISSION = {
|
|
1869
|
+
name: "check_permission",
|
|
1870
|
+
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.",
|
|
1871
|
+
parameters: {
|
|
1872
|
+
topicId: { type: "string", description: "Topic scope to evaluate" },
|
|
1873
|
+
permission: {
|
|
1874
|
+
type: "string",
|
|
1875
|
+
description: "Permission to evaluate",
|
|
1876
|
+
enum: ["read", "write"]
|
|
1877
|
+
},
|
|
1878
|
+
principal: {
|
|
1879
|
+
type: "string",
|
|
1880
|
+
description: "Optional principal override (defaults to current principal)"
|
|
1881
|
+
},
|
|
1882
|
+
beliefClusterId: {
|
|
1883
|
+
type: "string",
|
|
1884
|
+
description: "Optional neighborhood scope within a topic"
|
|
1885
|
+
}
|
|
1886
|
+
},
|
|
1887
|
+
required: ["topicId", "permission"],
|
|
1888
|
+
response: {
|
|
1889
|
+
description: "Permission evaluation result",
|
|
1890
|
+
fields: {
|
|
1891
|
+
allowed: "boolean",
|
|
1892
|
+
decision: "string \u2014 allow | deny",
|
|
1893
|
+
reasonCode: "string",
|
|
1894
|
+
principalId: "string",
|
|
1895
|
+
topicId: "string",
|
|
1896
|
+
permission: "string \u2014 read | write"
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
ownerModule: "access-control",
|
|
1900
|
+
ontologyPrimitive: "policy",
|
|
1901
|
+
tier: "workhorse"
|
|
1902
|
+
};
|
|
1903
|
+
var FILTER_BY_PERMISSION = {
|
|
1904
|
+
name: "filter_by_permission",
|
|
1905
|
+
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.",
|
|
1906
|
+
parameters: {
|
|
1907
|
+
topicIds: { type: "array", description: "Topic IDs to evaluate" },
|
|
1908
|
+
permission: {
|
|
1909
|
+
type: "string",
|
|
1910
|
+
description: "Permission filter",
|
|
1911
|
+
enum: ["read", "write"]
|
|
1912
|
+
},
|
|
1913
|
+
principal: {
|
|
1914
|
+
type: "string",
|
|
1915
|
+
description: "Optional principal override (tenant admin only)"
|
|
1916
|
+
}
|
|
1917
|
+
},
|
|
1918
|
+
required: ["topicIds", "permission"],
|
|
1919
|
+
response: {
|
|
1920
|
+
description: "Allowed/denied split for the requested topic set",
|
|
1921
|
+
fields: {
|
|
1922
|
+
permission: "string \u2014 read | write",
|
|
1923
|
+
allowedTopicIds: "array \u2014 topic IDs allowed by policy",
|
|
1924
|
+
deniedTopics: "array \u2014 { topicId, reasonCode }",
|
|
1925
|
+
count: "number"
|
|
1926
|
+
}
|
|
1927
|
+
},
|
|
1928
|
+
ownerModule: "access-control",
|
|
1929
|
+
ontologyPrimitive: "policy",
|
|
1930
|
+
tier: "workhorse"
|
|
1931
|
+
};
|
|
1932
|
+
var INGEST_OBSERVATION = {
|
|
1933
|
+
name: "ingest_observation",
|
|
1934
|
+
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.",
|
|
1935
|
+
parameters: {
|
|
1936
|
+
topicId: {
|
|
1937
|
+
type: "string",
|
|
1938
|
+
description: "Optional topic scope hint for the observation"
|
|
1939
|
+
},
|
|
1940
|
+
observationType: {
|
|
1941
|
+
type: "string",
|
|
1942
|
+
description: "Observation class",
|
|
1943
|
+
enum: [
|
|
1944
|
+
"claim",
|
|
1945
|
+
"evidence",
|
|
1946
|
+
"question",
|
|
1947
|
+
"contradiction",
|
|
1948
|
+
"judgment",
|
|
1949
|
+
"note"
|
|
1950
|
+
]
|
|
1951
|
+
},
|
|
1952
|
+
summary: {
|
|
1953
|
+
type: "string",
|
|
1954
|
+
description: "Human-readable observation summary"
|
|
1955
|
+
},
|
|
1956
|
+
source: {
|
|
1957
|
+
type: "string",
|
|
1958
|
+
description: "Optional source (message ID, tool name, URL, etc.)"
|
|
1959
|
+
},
|
|
1960
|
+
confidence: { type: "number", description: "Optional confidence in [0,1]" },
|
|
1961
|
+
tags: { type: "array", description: "Optional observation tags" },
|
|
1962
|
+
metadata: {
|
|
1963
|
+
type: "object",
|
|
1964
|
+
description: "Optional structured metadata payload"
|
|
1965
|
+
}
|
|
1966
|
+
},
|
|
1967
|
+
required: ["observationType", "summary"],
|
|
1968
|
+
response: {
|
|
1969
|
+
description: "Recorded observation entry",
|
|
1970
|
+
fields: {
|
|
1971
|
+
observationId: "string",
|
|
1972
|
+
topicId: "string",
|
|
1973
|
+
observationType: "string",
|
|
1974
|
+
createdAt: "number",
|
|
1975
|
+
contextResourceUri: "string"
|
|
1976
|
+
}
|
|
1977
|
+
},
|
|
1978
|
+
ownerModule: "agent-frameworks",
|
|
1979
|
+
ontologyPrimitive: "graph",
|
|
1980
|
+
tier: "workhorse"
|
|
1981
|
+
};
|
|
1982
|
+
var GET_OBSERVATION_CONTEXT = {
|
|
1983
|
+
name: "get_observation_context",
|
|
1984
|
+
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.",
|
|
1985
|
+
parameters: {
|
|
1986
|
+
topicId: { type: "string", description: "Optional topic scope hint" },
|
|
1987
|
+
query: {
|
|
1988
|
+
type: "string",
|
|
1989
|
+
description: "Optional semantic query over observation history"
|
|
1990
|
+
},
|
|
1991
|
+
limit: {
|
|
1992
|
+
type: "number",
|
|
1993
|
+
description: "Maximum entries in each returned collection"
|
|
1994
|
+
}
|
|
1995
|
+
},
|
|
1996
|
+
required: ["topicId"],
|
|
1997
|
+
response: {
|
|
1998
|
+
description: "Observation context payload",
|
|
1999
|
+
fields: {
|
|
2000
|
+
topicId: "string",
|
|
2001
|
+
totalObservations: "number",
|
|
2002
|
+
latest: "array",
|
|
2003
|
+
semanticMatches: "array",
|
|
2004
|
+
byType: "object",
|
|
2005
|
+
generatedAt: "number"
|
|
2006
|
+
}
|
|
2007
|
+
},
|
|
2008
|
+
ownerModule: "agent-frameworks",
|
|
2009
|
+
ontologyPrimitive: "graph",
|
|
2010
|
+
tier: "workhorse"
|
|
2011
|
+
};
|
|
2012
|
+
var CREATE_TASK = {
|
|
2013
|
+
name: "create_task",
|
|
2014
|
+
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.",
|
|
2015
|
+
parameters: {
|
|
2016
|
+
title: { type: "string", description: "Task description" },
|
|
2017
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
2018
|
+
taskType: {
|
|
2019
|
+
type: "string",
|
|
2020
|
+
description: "Type: research, interview, analysis, data_collection",
|
|
2021
|
+
enum: ["research", "interview", "analysis", "data_collection"]
|
|
2022
|
+
},
|
|
2023
|
+
linkedQuestionId: {
|
|
2024
|
+
type: "string",
|
|
2025
|
+
description: "Question this task addresses"
|
|
2026
|
+
},
|
|
2027
|
+
linkedWorktreeId: { type: "string", description: "Worktree scope" }
|
|
2028
|
+
},
|
|
2029
|
+
required: ["title"],
|
|
2030
|
+
response: {
|
|
2031
|
+
description: "The created task",
|
|
2032
|
+
fields: {
|
|
2033
|
+
taskId: "string",
|
|
2034
|
+
status: "string \u2014 'pending'",
|
|
2035
|
+
createdAt: "number"
|
|
2036
|
+
}
|
|
2037
|
+
},
|
|
2038
|
+
ownerModule: "workflow-engine",
|
|
2039
|
+
ontologyPrimitive: "task",
|
|
2040
|
+
tier: "workhorse"
|
|
2041
|
+
};
|
|
2042
|
+
var COMPLETE_TASK = {
|
|
2043
|
+
name: "complete_task",
|
|
2044
|
+
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.",
|
|
2045
|
+
parameters: {
|
|
2046
|
+
taskId: { type: "string", description: "The task to complete" },
|
|
2047
|
+
outputSummary: {
|
|
2048
|
+
type: "string",
|
|
2049
|
+
description: "What was accomplished or learned"
|
|
2050
|
+
},
|
|
2051
|
+
evidenceCreated: {
|
|
2052
|
+
type: "boolean",
|
|
2053
|
+
description: "Whether new evidence was created from this task"
|
|
2054
|
+
}
|
|
2055
|
+
},
|
|
2056
|
+
required: ["taskId", "outputSummary"],
|
|
2057
|
+
response: {
|
|
2058
|
+
description: "The completed task",
|
|
2059
|
+
fields: {
|
|
2060
|
+
taskId: "string",
|
|
2061
|
+
completedAt: "number",
|
|
2062
|
+
outputSummary: "string"
|
|
2063
|
+
}
|
|
2064
|
+
},
|
|
2065
|
+
ownerModule: "workflow-engine",
|
|
2066
|
+
ontologyPrimitive: "task",
|
|
2067
|
+
tier: "workhorse"
|
|
2068
|
+
};
|
|
2069
|
+
var UPDATE_TASK = {
|
|
2070
|
+
name: "update_task",
|
|
2071
|
+
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.",
|
|
2072
|
+
parameters: {
|
|
2073
|
+
taskId: { type: "string", description: "The task to update" },
|
|
2074
|
+
linkedWorktreeId: {
|
|
2075
|
+
type: "string",
|
|
2076
|
+
description: "Reassign this task to a different worktree"
|
|
2077
|
+
},
|
|
2078
|
+
linkedBeliefId: {
|
|
2079
|
+
type: "string",
|
|
2080
|
+
description: "Link or relink this task to a belief node"
|
|
2081
|
+
},
|
|
2082
|
+
linkedQuestionId: {
|
|
2083
|
+
type: "string",
|
|
2084
|
+
description: "Link or relink this task to a question node"
|
|
2085
|
+
},
|
|
2086
|
+
title: { type: "string", description: "Updated task title" },
|
|
2087
|
+
description: {
|
|
2088
|
+
type: "string",
|
|
2089
|
+
description: "Updated task description"
|
|
2090
|
+
},
|
|
2091
|
+
priority: {
|
|
2092
|
+
type: "string",
|
|
2093
|
+
description: "Updated priority",
|
|
2094
|
+
enum: ["critical", "high", "medium", "low"]
|
|
2095
|
+
},
|
|
2096
|
+
status: {
|
|
2097
|
+
type: "string",
|
|
2098
|
+
description: "Updated status",
|
|
2099
|
+
enum: ["todo", "in_progress", "blocked", "done"]
|
|
2100
|
+
}
|
|
2101
|
+
},
|
|
2102
|
+
required: ["taskId"],
|
|
2103
|
+
response: {
|
|
2104
|
+
description: "The updated task",
|
|
2105
|
+
fields: {
|
|
2106
|
+
taskId: "string",
|
|
2107
|
+
updatedAt: "number"
|
|
2108
|
+
}
|
|
2109
|
+
},
|
|
2110
|
+
ownerModule: "workflow-engine",
|
|
2111
|
+
ontologyPrimitive: "task",
|
|
2112
|
+
tier: "workhorse"
|
|
2113
|
+
};
|
|
2114
|
+
var LIST_TASKS = {
|
|
2115
|
+
name: "list_tasks",
|
|
2116
|
+
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.",
|
|
2117
|
+
parameters: {
|
|
2118
|
+
topicId: { type: "string", description: "Topic scope" },
|
|
2119
|
+
linkedWorktreeId: {
|
|
2120
|
+
type: "string",
|
|
2121
|
+
description: "Filter to tasks linked to this worktree"
|
|
2122
|
+
},
|
|
2123
|
+
status: {
|
|
2124
|
+
type: "string",
|
|
2125
|
+
description: "Filter by status: todo, in_progress, blocked, done",
|
|
2126
|
+
enum: ["todo", "in_progress", "blocked", "done"]
|
|
2127
|
+
},
|
|
2128
|
+
limit: { type: "number", description: "Maximum results (default: 100)" }
|
|
2129
|
+
},
|
|
2130
|
+
required: ["topicId"],
|
|
2131
|
+
response: {
|
|
2132
|
+
description: "List of tasks with metadata",
|
|
2133
|
+
fields: { tasks: "array of task objects", count: "number" }
|
|
2134
|
+
},
|
|
2135
|
+
ownerModule: "workflow-engine",
|
|
2136
|
+
ontologyPrimitive: "task",
|
|
2137
|
+
tier: "workhorse"
|
|
2138
|
+
};
|
|
2139
|
+
var CREATE_TOPIC = {
|
|
2140
|
+
name: "create_topic",
|
|
2141
|
+
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.",
|
|
2142
|
+
parameters: {
|
|
2143
|
+
name: { type: "string", description: "Topic name" },
|
|
2144
|
+
type: {
|
|
2145
|
+
type: "string",
|
|
2146
|
+
description: "Topic type. Validated against schemaEnumConfig category 'topic_type'."
|
|
2147
|
+
},
|
|
2148
|
+
description: { type: "string", description: "What this topic covers" },
|
|
2149
|
+
parentTopicId: {
|
|
2150
|
+
type: "string",
|
|
2151
|
+
description: "Optional parent topic for nesting"
|
|
2152
|
+
},
|
|
2153
|
+
createdBy: { type: "string", description: "Who created this topic" }
|
|
2154
|
+
},
|
|
2155
|
+
required: ["name", "type"],
|
|
2156
|
+
response: {
|
|
2157
|
+
description: "The created topic",
|
|
2158
|
+
fields: {
|
|
2159
|
+
id: "string \u2014 topic ID",
|
|
2160
|
+
globalId: "string \u2014 globally unique ID",
|
|
2161
|
+
depth: "number \u2014 nesting depth"
|
|
2162
|
+
}
|
|
2163
|
+
},
|
|
2164
|
+
ownerModule: "reasoning-kernel",
|
|
2165
|
+
ontologyPrimitive: "graph",
|
|
2166
|
+
tier: "showcase"
|
|
2167
|
+
};
|
|
2168
|
+
var LIST_TOPICS = {
|
|
2169
|
+
name: "list_topics",
|
|
2170
|
+
description: "List topics, optionally filtered by type or parent. Like `git remote -v` \u2014 shows all knowledge containers with their types and hierarchy.",
|
|
2171
|
+
parameters: {
|
|
2172
|
+
type: {
|
|
2173
|
+
type: "string",
|
|
2174
|
+
description: "Filter by topic type (e.g., 'theme', 'deal')"
|
|
2175
|
+
},
|
|
2176
|
+
parentTopicId: {
|
|
2177
|
+
type: "string",
|
|
2178
|
+
description: "Filter to children of this parent"
|
|
2179
|
+
},
|
|
2180
|
+
status: {
|
|
2181
|
+
type: "string",
|
|
2182
|
+
description: "Filter by status",
|
|
2183
|
+
enum: ["active", "archived", "watching"]
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
required: [],
|
|
2187
|
+
response: {
|
|
2188
|
+
description: "List of topics with metadata",
|
|
2189
|
+
fields: {
|
|
2190
|
+
topics: "array \u2014 { id, name, type, depth, status, parentTopicId }"
|
|
2191
|
+
}
|
|
2192
|
+
},
|
|
2193
|
+
ownerModule: "reasoning-kernel",
|
|
2194
|
+
ontologyPrimitive: "graph",
|
|
2195
|
+
tier: "workhorse"
|
|
2196
|
+
};
|
|
2197
|
+
var GET_TOPIC = {
|
|
2198
|
+
name: "get_topic",
|
|
2199
|
+
description: "Get one topic by ID. Like `git remote show origin` \u2014 inspects a single knowledge container in detail.",
|
|
2200
|
+
parameters: {
|
|
2201
|
+
topicId: {
|
|
2202
|
+
type: "string",
|
|
2203
|
+
description: "Canonical topic ID to retrieve"
|
|
2204
|
+
},
|
|
2205
|
+
id: {
|
|
2206
|
+
type: "string",
|
|
2207
|
+
description: "Legacy alias for topicId"
|
|
2208
|
+
}
|
|
2209
|
+
},
|
|
2210
|
+
required: [],
|
|
2211
|
+
response: {
|
|
2212
|
+
description: "Single topic record",
|
|
2213
|
+
fields: {
|
|
2214
|
+
topic: "object \u2014 { id, globalId, name, type, depth, status, parentTopicId, description }"
|
|
2215
|
+
}
|
|
2216
|
+
},
|
|
2217
|
+
ownerModule: "reasoning-kernel",
|
|
2218
|
+
ontologyPrimitive: "graph",
|
|
2219
|
+
tier: "workhorse"
|
|
2220
|
+
};
|
|
2221
|
+
var UPDATE_TOPIC = {
|
|
2222
|
+
name: "update_topic",
|
|
2223
|
+
description: "Update an existing topic's metadata. Like `git remote set-url` \u2014 changes the canonical configuration for a knowledge container without recreating it.",
|
|
2224
|
+
parameters: {
|
|
2225
|
+
topicId: {
|
|
2226
|
+
type: "string",
|
|
2227
|
+
description: "Canonical topic ID to update"
|
|
2228
|
+
},
|
|
2229
|
+
id: {
|
|
2230
|
+
type: "string",
|
|
2231
|
+
description: "Legacy alias for topicId"
|
|
2232
|
+
},
|
|
2233
|
+
name: { type: "string", description: "Updated topic name" },
|
|
2234
|
+
description: { type: "string", description: "Updated topic description" },
|
|
2235
|
+
type: {
|
|
2236
|
+
type: "string",
|
|
2237
|
+
description: "Updated topic type. Validated against schemaEnumConfig category 'topic_type'."
|
|
2238
|
+
},
|
|
2239
|
+
ontologyId: {
|
|
2240
|
+
type: "string",
|
|
2241
|
+
description: "Updated ontology binding"
|
|
2242
|
+
},
|
|
2243
|
+
clearOntologyId: {
|
|
2244
|
+
type: "boolean",
|
|
2245
|
+
description: "Clear the current ontology binding"
|
|
2246
|
+
},
|
|
2247
|
+
status: {
|
|
2248
|
+
type: "string",
|
|
2249
|
+
description: "Updated topic status",
|
|
2250
|
+
enum: ["active", "archived", "watching"]
|
|
2251
|
+
},
|
|
2252
|
+
visibility: {
|
|
2253
|
+
type: "string",
|
|
2254
|
+
description: "Updated topic visibility",
|
|
2255
|
+
enum: ["private", "team", "firm", "external", "public"]
|
|
2256
|
+
}
|
|
2257
|
+
},
|
|
2258
|
+
required: [],
|
|
2259
|
+
response: {
|
|
2260
|
+
description: "The updated topic",
|
|
2261
|
+
fields: {
|
|
2262
|
+
id: "string \u2014 topic ID",
|
|
2263
|
+
globalId: "string \u2014 globally unique ID",
|
|
2264
|
+
status: "string \u2014 topic lifecycle status",
|
|
2265
|
+
visibility: "string \u2014 topic visibility"
|
|
2266
|
+
}
|
|
2267
|
+
},
|
|
2268
|
+
ownerModule: "reasoning-kernel",
|
|
2269
|
+
ontologyPrimitive: "graph",
|
|
2270
|
+
tier: "workhorse"
|
|
2271
|
+
};
|
|
2272
|
+
var GET_TOPIC_TREE = {
|
|
2273
|
+
name: "get_topic_tree",
|
|
2274
|
+
description: "Get the full topic hierarchy from a root. Like `git log --graph --all` \u2014 shows the complete tree of nested topics.",
|
|
2275
|
+
parameters: {
|
|
2276
|
+
rootId: { type: "string", description: "Root topic to start from" },
|
|
2277
|
+
maxDepth: {
|
|
2278
|
+
type: "number",
|
|
2279
|
+
description: "Maximum depth to traverse (default: 5)"
|
|
2280
|
+
}
|
|
2281
|
+
},
|
|
2282
|
+
required: ["rootId"],
|
|
2283
|
+
response: {
|
|
2284
|
+
description: "Tree of topics with nesting",
|
|
2285
|
+
fields: { tree: "array \u2014 topics in BFS order with depth and path" }
|
|
2286
|
+
},
|
|
2287
|
+
ownerModule: "reasoning-kernel",
|
|
2288
|
+
ontologyPrimitive: "graph",
|
|
2289
|
+
tier: "workhorse"
|
|
2290
|
+
};
|
|
2291
|
+
var GET_CODE_CONTEXT = {
|
|
2292
|
+
name: "get_code_context",
|
|
2293
|
+
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.",
|
|
2294
|
+
parameters: {
|
|
2295
|
+
filePath: {
|
|
2296
|
+
type: "string",
|
|
2297
|
+
description: "File path to search for (partial matches supported, e.g. 'epistemicBeliefs.ts' or 'convex/epistemicBeliefs.ts')"
|
|
2298
|
+
},
|
|
2299
|
+
topicId: {
|
|
2300
|
+
type: "string",
|
|
2301
|
+
description: "Topic scope (optional, uses default if not provided)"
|
|
2302
|
+
},
|
|
2303
|
+
includeFailures: {
|
|
2304
|
+
type: "boolean",
|
|
2305
|
+
description: "Whether to include failed attempt evidence (default: true)"
|
|
2306
|
+
}
|
|
2307
|
+
},
|
|
2308
|
+
required: ["filePath"],
|
|
2309
|
+
response: {
|
|
2310
|
+
description: "Code-anchored beliefs and evidence grouped by type",
|
|
2311
|
+
fields: {
|
|
2312
|
+
filePath: "string \u2014 queried path",
|
|
2313
|
+
decisions: "array \u2014 implementation_decision beliefs",
|
|
2314
|
+
contracts: "array \u2014 interface_contract beliefs",
|
|
2315
|
+
migrations: "array \u2014 migration_state beliefs",
|
|
2316
|
+
patterns: "array \u2014 code_pattern beliefs",
|
|
2317
|
+
deprecations: "array \u2014 deprecation_notice beliefs",
|
|
2318
|
+
failures: "array \u2014 failed attempt evidence",
|
|
2319
|
+
totalMatched: "number"
|
|
2320
|
+
}
|
|
2321
|
+
},
|
|
2322
|
+
ownerModule: "coding-intelligence",
|
|
2323
|
+
ontologyPrimitive: "belief",
|
|
2324
|
+
tier: "showcase"
|
|
2325
|
+
};
|
|
2326
|
+
var GET_CHANGE_HISTORY = {
|
|
2327
|
+
name: "get_change_history",
|
|
2328
|
+
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.",
|
|
2329
|
+
parameters: {
|
|
2330
|
+
filePath: { type: "string", description: "File path to get history for" },
|
|
2331
|
+
topicId: { type: "string", description: "Topic scope (optional)" },
|
|
2332
|
+
limit: { type: "number", description: "Max results (default: 10)" }
|
|
2333
|
+
},
|
|
2334
|
+
required: ["filePath"],
|
|
2335
|
+
response: {
|
|
2336
|
+
description: "Recent code-anchored changes sorted by recency",
|
|
2337
|
+
fields: {
|
|
2338
|
+
filePath: "string \u2014 queried path",
|
|
2339
|
+
changes: "array \u2014 nodes with coding view (nodeId, beliefType, canonicalText, codeAnchors, timestamps)",
|
|
2340
|
+
totalFound: "number",
|
|
2341
|
+
showing: "number"
|
|
2342
|
+
}
|
|
2343
|
+
},
|
|
2344
|
+
ownerModule: "coding-intelligence",
|
|
2345
|
+
ontologyPrimitive: "belief",
|
|
2346
|
+
tier: "workhorse"
|
|
2347
|
+
};
|
|
2348
|
+
var RECORD_ATTEMPT = {
|
|
2349
|
+
name: "record_attempt",
|
|
2350
|
+
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.",
|
|
2351
|
+
parameters: {
|
|
2352
|
+
description: {
|
|
2353
|
+
type: "string",
|
|
2354
|
+
description: "What was attempted and why it failed"
|
|
2355
|
+
},
|
|
2356
|
+
filePaths: {
|
|
2357
|
+
type: "array",
|
|
2358
|
+
description: "File paths involved in the attempt"
|
|
2359
|
+
},
|
|
2360
|
+
errorMessage: {
|
|
2361
|
+
type: "string",
|
|
2362
|
+
description: "Error message or failure reason"
|
|
2363
|
+
},
|
|
2364
|
+
linkedBeliefId: {
|
|
2365
|
+
type: "string",
|
|
2366
|
+
description: "Belief this attempt was targeting (creates -0.5 weight edge)"
|
|
2367
|
+
},
|
|
2368
|
+
topicId: { type: "string", description: "Topic scope (optional)" }
|
|
2369
|
+
},
|
|
2370
|
+
required: ["description"],
|
|
2371
|
+
response: {
|
|
2372
|
+
description: "The recorded failed attempt evidence node",
|
|
2373
|
+
fields: {
|
|
2374
|
+
nodeId: "string \u2014 evidence node ID",
|
|
2375
|
+
edgeId: "string | null \u2014 edge to linked belief",
|
|
2376
|
+
recorded: "boolean \u2014 true",
|
|
2377
|
+
filePaths: "array \u2014 anchored file paths"
|
|
2378
|
+
}
|
|
2379
|
+
},
|
|
2380
|
+
ownerModule: "coding-intelligence",
|
|
2381
|
+
ontologyPrimitive: "evidence",
|
|
2382
|
+
tier: "showcase"
|
|
2383
|
+
};
|
|
2384
|
+
var GET_FAILURE_LOG = {
|
|
2385
|
+
name: "get_failure_log",
|
|
2386
|
+
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.",
|
|
2387
|
+
parameters: {
|
|
2388
|
+
query: {
|
|
2389
|
+
type: "string",
|
|
2390
|
+
description: "Description of the task or approach to search for"
|
|
2391
|
+
},
|
|
2392
|
+
filePath: {
|
|
2393
|
+
type: "string",
|
|
2394
|
+
description: "Optional file path to narrow results"
|
|
2395
|
+
},
|
|
2396
|
+
topicId: { type: "string", description: "Topic scope (optional)" },
|
|
2397
|
+
limit: { type: "number", description: "Max results (default: 5)" }
|
|
2398
|
+
},
|
|
2399
|
+
required: ["query"],
|
|
2400
|
+
response: {
|
|
2401
|
+
description: "Failed attempts matching the query",
|
|
2402
|
+
fields: {
|
|
2403
|
+
query: "string \u2014 search query",
|
|
2404
|
+
failures: "array \u2014 failed attempt evidence with coding view",
|
|
2405
|
+
totalFound: "number",
|
|
2406
|
+
showing: "number"
|
|
2407
|
+
}
|
|
2408
|
+
},
|
|
2409
|
+
ownerModule: "coding-intelligence",
|
|
2410
|
+
ontologyPrimitive: "evidence",
|
|
2411
|
+
tier: "showcase"
|
|
2412
|
+
};
|
|
2413
|
+
var GET_TOPIC_COVERAGE = {
|
|
2414
|
+
name: "get_topic_coverage",
|
|
2415
|
+
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.",
|
|
2416
|
+
parameters: {
|
|
2417
|
+
topicId: {
|
|
2418
|
+
type: "string",
|
|
2419
|
+
description: "Topic scope ID (optional, uses default if not provided)"
|
|
2420
|
+
},
|
|
2421
|
+
includeDescendants: {
|
|
2422
|
+
type: "boolean",
|
|
2423
|
+
description: "Whether to include descendant topics in the coverage report (default: true)"
|
|
2424
|
+
},
|
|
2425
|
+
maxDepth: {
|
|
2426
|
+
type: "number",
|
|
2427
|
+
description: "Maximum descendant topic depth for neighborhood expansion. Defaults to 4 for root/theme scopes, 2 for deeper scopes."
|
|
2428
|
+
}
|
|
2429
|
+
},
|
|
2430
|
+
required: [],
|
|
2431
|
+
response: {
|
|
2432
|
+
description: "Per-topic coverage metrics and aggregate summary",
|
|
2433
|
+
fields: {
|
|
2434
|
+
topics: "array \u2014 per-topic { topicId, name, type, depth, beliefs, questions, evidence, coverage }",
|
|
2435
|
+
summary: "object \u2014 { totalTopics, coveredTopics, emptyTopics, coveragePercent, totalBeliefs, totalQuestions, totalEvidence }",
|
|
2436
|
+
scopeTopicId: "string \u2014 the root topic used for scoping"
|
|
2437
|
+
}
|
|
2438
|
+
},
|
|
2439
|
+
ownerModule: "coverage-intelligence",
|
|
2440
|
+
ontologyPrimitive: "graph",
|
|
2441
|
+
tier: "showcase"
|
|
2442
|
+
};
|
|
2443
|
+
var GET_GRAPH_GAPS = {
|
|
2444
|
+
name: "get_graph_gaps",
|
|
2445
|
+
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.",
|
|
2446
|
+
parameters: {
|
|
2447
|
+
topicId: {
|
|
2448
|
+
type: "string",
|
|
2449
|
+
description: "Topic scope ID (optional, uses default if not provided)"
|
|
2450
|
+
},
|
|
2451
|
+
maxDepth: {
|
|
2452
|
+
type: "number",
|
|
2453
|
+
description: "Maximum descendant topic depth for neighborhood expansion (default: 4)"
|
|
2454
|
+
}
|
|
2455
|
+
},
|
|
2456
|
+
required: ["topicId"],
|
|
2457
|
+
response: {
|
|
2458
|
+
description: "Prioritized list of graph gaps by category",
|
|
2459
|
+
fields: {
|
|
2460
|
+
emptyTopics: "array \u2014 topics with zero beliefs { topicId, name, type, depth }",
|
|
2461
|
+
beliefsWithoutQuestions: "array \u2014 beliefs that have no testing questions { nodeId, canonicalText, topicId }",
|
|
2462
|
+
beliefsWithoutEvidence: "array \u2014 beliefs that have no supporting evidence { nodeId, canonicalText, topicId }",
|
|
2463
|
+
summary: "object \u2014 { totalGaps, emptyTopicCount, untestedBeliefCount, unsupportedBeliefCount }",
|
|
2464
|
+
scopeTopicId: "string \u2014 the root topic used for scoping"
|
|
2465
|
+
}
|
|
2466
|
+
},
|
|
2467
|
+
ownerModule: "coverage-intelligence",
|
|
2468
|
+
ontologyPrimitive: "graph",
|
|
2469
|
+
tier: "showcase"
|
|
2470
|
+
};
|
|
2471
|
+
var MANAGE_WRITE_POLICY = {
|
|
2472
|
+
name: "manage_write_policy",
|
|
2473
|
+
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.",
|
|
2474
|
+
parameters: {
|
|
2475
|
+
action: {
|
|
2476
|
+
type: "string",
|
|
2477
|
+
description: "Action to perform: 'get' (read policies) or 'set' (upsert a policy)",
|
|
2478
|
+
enum: ["get", "set"]
|
|
2479
|
+
},
|
|
2480
|
+
topicId: {
|
|
2481
|
+
type: "string",
|
|
2482
|
+
description: "Topic scope for the policy. Omit for global policies."
|
|
2483
|
+
},
|
|
2484
|
+
role: {
|
|
2485
|
+
type: "string",
|
|
2486
|
+
description: "Role to set policy for (required for 'set'). E.g. 'agent:internal', 'user:analyst'."
|
|
2487
|
+
},
|
|
2488
|
+
permission: {
|
|
2489
|
+
type: "string",
|
|
2490
|
+
description: "Permission level (required for 'set').",
|
|
2491
|
+
enum: ["allow", "deny", "read_only"]
|
|
2492
|
+
},
|
|
2493
|
+
maxWritesPerSession: {
|
|
2494
|
+
type: "number",
|
|
2495
|
+
description: "Optional per-session write limit for this role+scope."
|
|
2496
|
+
},
|
|
2497
|
+
rationale: {
|
|
2498
|
+
type: "string",
|
|
2499
|
+
description: "Why this policy is being set (audit trail)."
|
|
2500
|
+
}
|
|
2501
|
+
},
|
|
2502
|
+
required: ["action"],
|
|
2503
|
+
response: {
|
|
2504
|
+
description: "Policy operation result",
|
|
2505
|
+
fields: {
|
|
2506
|
+
action: "string \u2014 get | set",
|
|
2507
|
+
topicId: "string|null \u2014 topic scope or null for global",
|
|
2508
|
+
policies: "array \u2014 (for get) list of matching policies",
|
|
2509
|
+
role: "string \u2014 (for set) role that was updated",
|
|
2510
|
+
permission: "string \u2014 (for set) new permission level",
|
|
2511
|
+
maxWritesPerSession: "number|null \u2014 (for set) session write cap"
|
|
2512
|
+
}
|
|
2513
|
+
},
|
|
2514
|
+
ownerModule: "access-control",
|
|
2515
|
+
ontologyPrimitive: "policy",
|
|
2516
|
+
tier: "workhorse"
|
|
2517
|
+
};
|
|
2518
|
+
var LIST_ONTOLOGIES = {
|
|
2519
|
+
name: "list_ontologies",
|
|
2520
|
+
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.",
|
|
2521
|
+
parameters: {
|
|
2522
|
+
tenantId: {
|
|
2523
|
+
type: "string",
|
|
2524
|
+
description: "Filter by tenant ID. Omit for platform-level ontologies."
|
|
2525
|
+
},
|
|
2526
|
+
tier: {
|
|
2527
|
+
type: "string",
|
|
2528
|
+
description: "Filter by tier",
|
|
2529
|
+
enum: ["platform", "pack", "tenant"]
|
|
2530
|
+
},
|
|
2531
|
+
status: {
|
|
2532
|
+
type: "string",
|
|
2533
|
+
description: "Filter by status",
|
|
2534
|
+
enum: ["draft", "active", "deprecated", "archived"]
|
|
2535
|
+
}
|
|
2536
|
+
},
|
|
2537
|
+
required: [],
|
|
2538
|
+
response: {
|
|
2539
|
+
description: "Array of ontology definitions",
|
|
2540
|
+
fields: {
|
|
2541
|
+
ontologies: "array \u2014 ontology definitions with id, ontologyKey, name, tier, status"
|
|
2542
|
+
}
|
|
2543
|
+
},
|
|
2544
|
+
ownerModule: "graph-primitives",
|
|
2545
|
+
ontologyPrimitive: "ontology",
|
|
2546
|
+
tier: "showcase"
|
|
2547
|
+
};
|
|
2548
|
+
var GET_ONTOLOGY = {
|
|
2549
|
+
name: "get_ontology",
|
|
2550
|
+
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.",
|
|
2551
|
+
parameters: {
|
|
2552
|
+
id: {
|
|
2553
|
+
type: "string",
|
|
2554
|
+
description: "Ontology definition ID (Convex document ID)"
|
|
2555
|
+
},
|
|
2556
|
+
ontologyKey: {
|
|
2557
|
+
type: "string",
|
|
2558
|
+
description: "Ontology key (e.g., 'investment-ontology'). Alternative to id."
|
|
2559
|
+
},
|
|
2560
|
+
tenantId: {
|
|
2561
|
+
type: "string",
|
|
2562
|
+
description: "Tenant scope for key lookup. Omit for platform-level."
|
|
2563
|
+
}
|
|
2564
|
+
},
|
|
2565
|
+
required: [],
|
|
2566
|
+
response: {
|
|
2567
|
+
description: "Ontology definition with latest published version",
|
|
2568
|
+
fields: {
|
|
2569
|
+
id: "string \u2014 definition ID",
|
|
2570
|
+
ontologyKey: "string \u2014 unique key",
|
|
2571
|
+
name: "string \u2014 display name",
|
|
2572
|
+
publishedVersion: "object|null \u2014 latest published version with entityTypes and edgeTypes"
|
|
2573
|
+
}
|
|
2574
|
+
},
|
|
2575
|
+
ownerModule: "graph-primitives",
|
|
2576
|
+
ontologyPrimitive: "ontology",
|
|
2577
|
+
tier: "showcase"
|
|
2578
|
+
};
|
|
2579
|
+
var APPLY_ONTOLOGY = {
|
|
2580
|
+
name: "apply_ontology",
|
|
2581
|
+
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.",
|
|
2582
|
+
parameters: {
|
|
2583
|
+
ontologyId: {
|
|
2584
|
+
type: "string",
|
|
2585
|
+
description: "Canonical ontology identifier to bind"
|
|
2586
|
+
},
|
|
2587
|
+
topicId: {
|
|
2588
|
+
type: "string",
|
|
2589
|
+
description: "Canonical topic identifier to receive the binding"
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
required: ["ontologyId", "topicId"],
|
|
2593
|
+
response: {
|
|
2594
|
+
description: "Ontology binding summary",
|
|
2595
|
+
fields: {
|
|
2596
|
+
applied: "boolean \u2014 true when the binding was written",
|
|
2597
|
+
source: "string \u2014 always 'direct' for an explicit bind",
|
|
2598
|
+
ontologyId: "string \u2014 canonical ontology ID",
|
|
2599
|
+
ontologyKey: "string \u2014 ontology key",
|
|
2600
|
+
topicId: "string \u2014 canonical topic ID"
|
|
2601
|
+
}
|
|
2602
|
+
},
|
|
2603
|
+
ownerModule: "reasoning-kernel",
|
|
2604
|
+
ontologyPrimitive: "ontology",
|
|
2605
|
+
tier: "showcase"
|
|
2606
|
+
};
|
|
2607
|
+
var MATCH_ENTITY_TYPE = {
|
|
2608
|
+
name: "match_entity_type",
|
|
2609
|
+
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.",
|
|
2610
|
+
parameters: {
|
|
2611
|
+
text: {
|
|
2612
|
+
type: "string",
|
|
2613
|
+
description: "Free text to classify against ontology entity types"
|
|
2614
|
+
},
|
|
2615
|
+
topicId: {
|
|
2616
|
+
type: "string",
|
|
2617
|
+
description: "Canonical topic ID used to resolve the effective ontology when ontologyId is omitted"
|
|
2618
|
+
},
|
|
2619
|
+
ontologyId: {
|
|
2620
|
+
type: "string",
|
|
2621
|
+
description: "Optional ontology definition ID to match against instead of the topic-bound ontology"
|
|
2622
|
+
},
|
|
2623
|
+
minScore: {
|
|
2624
|
+
type: "number",
|
|
2625
|
+
description: "Optional lower similarity bound for returned matches"
|
|
2626
|
+
},
|
|
2627
|
+
limit: {
|
|
2628
|
+
type: "number",
|
|
2629
|
+
description: "Optional maximum number of ranked matches to return"
|
|
2630
|
+
}
|
|
2631
|
+
},
|
|
2632
|
+
required: ["text"],
|
|
2633
|
+
response: {
|
|
2634
|
+
description: "Ranked ontology entity type matches",
|
|
2635
|
+
fields: {
|
|
2636
|
+
matches: "array \u2014 ranked entity type matches with score, entityType, label, and optional description",
|
|
2637
|
+
ontologyId: "string|null \u2014 ontology used for matching",
|
|
2638
|
+
topicId: "string|null \u2014 topic scope used for ontology resolution"
|
|
2639
|
+
}
|
|
2640
|
+
},
|
|
2641
|
+
ownerModule: "reasoning-kernel",
|
|
2642
|
+
ontologyPrimitive: "ontology",
|
|
2643
|
+
tier: "showcase"
|
|
2644
|
+
};
|
|
2645
|
+
var CREATE_ONTOLOGY = {
|
|
2646
|
+
name: "create_ontology",
|
|
2647
|
+
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.",
|
|
2648
|
+
parameters: {
|
|
2649
|
+
ontologyKey: {
|
|
2650
|
+
type: "string",
|
|
2651
|
+
description: "Unique key (lowercase, hyphens, e.g., 'investment-ontology')"
|
|
2652
|
+
},
|
|
2653
|
+
name: { type: "string", description: "Human-readable name" },
|
|
2654
|
+
description: { type: "string", description: "What this ontology covers" },
|
|
2655
|
+
tenantId: {
|
|
2656
|
+
type: "string",
|
|
2657
|
+
description: "Tenant scope. Omit for platform-level."
|
|
2658
|
+
},
|
|
2659
|
+
tier: {
|
|
2660
|
+
type: "string",
|
|
2661
|
+
description: "Ontology tier",
|
|
2662
|
+
enum: ["platform", "pack", "tenant"]
|
|
2663
|
+
},
|
|
2664
|
+
parentOntologyId: {
|
|
2665
|
+
type: "string",
|
|
2666
|
+
description: "Parent ontology ID for layered composition"
|
|
2667
|
+
}
|
|
2668
|
+
},
|
|
2669
|
+
required: ["ontologyKey", "name", "tier"],
|
|
2670
|
+
response: {
|
|
2671
|
+
description: "Created ontology definition",
|
|
2672
|
+
fields: {
|
|
2673
|
+
id: "string \u2014 new definition ID",
|
|
2674
|
+
ontologyKey: "string \u2014 normalized key"
|
|
2675
|
+
}
|
|
2676
|
+
},
|
|
2677
|
+
ownerModule: "graph-primitives",
|
|
2678
|
+
ontologyPrimitive: "ontology",
|
|
2679
|
+
tier: "showcase"
|
|
2680
|
+
};
|
|
2681
|
+
var UPDATE_ONTOLOGY = {
|
|
2682
|
+
name: "update_ontology",
|
|
2683
|
+
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.",
|
|
2684
|
+
parameters: {
|
|
2685
|
+
id: { type: "string", description: "Ontology definition ID" },
|
|
2686
|
+
name: { type: "string", description: "New display name" },
|
|
2687
|
+
description: { type: "string", description: "New description" },
|
|
2688
|
+
status: {
|
|
2689
|
+
type: "string",
|
|
2690
|
+
description: "New status",
|
|
2691
|
+
enum: ["draft", "active", "deprecated"]
|
|
2692
|
+
}
|
|
2693
|
+
},
|
|
2694
|
+
required: ["id"],
|
|
2695
|
+
response: {
|
|
2696
|
+
description: "Update confirmation",
|
|
2697
|
+
fields: { success: "boolean" }
|
|
2698
|
+
},
|
|
2699
|
+
ownerModule: "graph-primitives",
|
|
2700
|
+
ontologyPrimitive: "ontology",
|
|
2701
|
+
tier: "workhorse"
|
|
2702
|
+
};
|
|
2703
|
+
var ARCHIVE_ONTOLOGY = {
|
|
2704
|
+
name: "archive_ontology",
|
|
2705
|
+
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.",
|
|
2706
|
+
parameters: {
|
|
2707
|
+
id: { type: "string", description: "Ontology definition ID to archive" }
|
|
2708
|
+
},
|
|
2709
|
+
required: ["id"],
|
|
2710
|
+
response: {
|
|
2711
|
+
description: "Archive confirmation",
|
|
2712
|
+
fields: { success: "boolean" }
|
|
2713
|
+
},
|
|
2714
|
+
ownerModule: "graph-primitives",
|
|
2715
|
+
ontologyPrimitive: "ontology",
|
|
2716
|
+
tier: "workhorse"
|
|
2717
|
+
};
|
|
2718
|
+
var CREATE_ONTOLOGY_VERSION = {
|
|
2719
|
+
name: "create_ontology_version",
|
|
2720
|
+
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.",
|
|
2721
|
+
parameters: {
|
|
2722
|
+
ontologyId: {
|
|
2723
|
+
type: "string",
|
|
2724
|
+
description: "Parent ontology definition ID"
|
|
2725
|
+
},
|
|
2726
|
+
version: {
|
|
2727
|
+
type: "string",
|
|
2728
|
+
description: "Semantic version string (X.Y.Z format)"
|
|
2729
|
+
},
|
|
2730
|
+
entityTypes: {
|
|
2731
|
+
type: "array",
|
|
2732
|
+
description: "Array of entity type definitions: [{ value, label, description?, schema?, subtypes? }]"
|
|
2733
|
+
},
|
|
2734
|
+
edgeTypes: {
|
|
2735
|
+
type: "array",
|
|
2736
|
+
description: "Array of edge type definitions: [{ value, label, description?, sourceTypes?, targetTypes?, constraintSeverity? }]"
|
|
2737
|
+
},
|
|
2738
|
+
releaseNotes: {
|
|
2739
|
+
type: "string",
|
|
2740
|
+
description: "Optional release notes for this version"
|
|
2741
|
+
}
|
|
2742
|
+
},
|
|
2743
|
+
required: ["ontologyId", "version", "entityTypes", "edgeTypes"],
|
|
2744
|
+
response: {
|
|
2745
|
+
description: "Created version",
|
|
2746
|
+
fields: {
|
|
2747
|
+
id: "string \u2014 new version ID",
|
|
2748
|
+
version: "string \u2014 version string"
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
ownerModule: "graph-primitives",
|
|
2752
|
+
ontologyPrimitive: "ontology",
|
|
2753
|
+
tier: "showcase"
|
|
2754
|
+
};
|
|
2755
|
+
var PUBLISH_ONTOLOGY_VERSION = {
|
|
2756
|
+
name: "publish_ontology_version",
|
|
2757
|
+
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'.",
|
|
2758
|
+
parameters: {
|
|
2759
|
+
id: { type: "string", description: "Ontology version ID to publish" }
|
|
2760
|
+
},
|
|
2761
|
+
required: ["id"],
|
|
2762
|
+
response: {
|
|
2763
|
+
description: "Publish confirmation",
|
|
2764
|
+
fields: {
|
|
2765
|
+
success: "boolean",
|
|
2766
|
+
publishedAt: "number \u2014 timestamp"
|
|
2767
|
+
}
|
|
2768
|
+
},
|
|
2769
|
+
ownerModule: "graph-primitives",
|
|
2770
|
+
ontologyPrimitive: "ontology",
|
|
2771
|
+
tier: "showcase"
|
|
2772
|
+
};
|
|
2773
|
+
var DEPRECATE_ONTOLOGY_VERSION = {
|
|
2774
|
+
name: "deprecate_ontology_version",
|
|
2775
|
+
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.",
|
|
2776
|
+
parameters: {
|
|
2777
|
+
id: { type: "string", description: "Ontology version ID to deprecate" }
|
|
2778
|
+
},
|
|
2779
|
+
required: ["id"],
|
|
2780
|
+
response: {
|
|
2781
|
+
description: "Deprecation confirmation",
|
|
2782
|
+
fields: { success: "boolean" }
|
|
2783
|
+
},
|
|
2784
|
+
ownerModule: "graph-primitives",
|
|
2785
|
+
ontologyPrimitive: "ontology",
|
|
2786
|
+
tier: "workhorse"
|
|
2787
|
+
};
|
|
2788
|
+
var RESOLVE_EFFECTIVE_ONTOLOGY = {
|
|
2789
|
+
name: "resolve_effective_ontology",
|
|
2790
|
+
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).",
|
|
2791
|
+
parameters: {
|
|
2792
|
+
ontologyId: {
|
|
2793
|
+
type: "string",
|
|
2794
|
+
description: "Ontology definition ID to resolve from"
|
|
2795
|
+
}
|
|
2796
|
+
},
|
|
2797
|
+
required: ["ontologyId"],
|
|
2798
|
+
response: {
|
|
2799
|
+
description: "Merged ontology with composed entity and edge types",
|
|
2800
|
+
fields: {
|
|
2801
|
+
entityTypes: "array \u2014 merged entity types from all layers",
|
|
2802
|
+
edgeTypes: "array \u2014 merged edge types from all layers",
|
|
2803
|
+
layers: "array \u2014 ontology keys in composition order"
|
|
2804
|
+
}
|
|
2805
|
+
},
|
|
2806
|
+
ownerModule: "graph-primitives",
|
|
2807
|
+
ontologyPrimitive: "ontology",
|
|
2808
|
+
tier: "workhorse"
|
|
2809
|
+
};
|
|
2810
|
+
var RECORD_SCOPE_LEARNING = {
|
|
2811
|
+
name: "record_scope_learning",
|
|
2812
|
+
description: "Write a structured learning entry into the epistemic spine. Like `git commit` for scope learnings \u2014 records evidence, can attach to a belief, and can open a follow-up belief/question in one atomic workflow.",
|
|
2813
|
+
parameters: {
|
|
2814
|
+
topicId: { type: "string", description: "Topic scope ID" },
|
|
2815
|
+
summary: { type: "string", description: "Atomic learning statement" },
|
|
2816
|
+
title: {
|
|
2817
|
+
type: "string",
|
|
2818
|
+
description: "Optional evidence title, such as a commit, doc, or issue."
|
|
2819
|
+
},
|
|
2820
|
+
body: {
|
|
2821
|
+
type: "string",
|
|
2822
|
+
description: "Optional rich evidence body. If omitted, body is synthesized from summary and touched paths."
|
|
2823
|
+
},
|
|
2824
|
+
contentType: {
|
|
2825
|
+
type: "string",
|
|
2826
|
+
description: "Optional evidence body format, such as markdown or text."
|
|
2827
|
+
},
|
|
2828
|
+
sourceKind: {
|
|
2829
|
+
type: "string",
|
|
2830
|
+
description: "Source type for the learning event",
|
|
2831
|
+
enum: ["commit", "merge", "doc", "issue", "manual"]
|
|
2832
|
+
},
|
|
2833
|
+
sourceRef: {
|
|
2834
|
+
type: "string",
|
|
2835
|
+
description: "Optional source reference, such as SHA, PR number, or URL slug."
|
|
2836
|
+
},
|
|
2837
|
+
sourceUrl: { type: "string", description: "Optional canonical source URL" },
|
|
2838
|
+
touchedPaths: {
|
|
2839
|
+
type: "array",
|
|
2840
|
+
description: "Optional touched file paths for retrieval hints"
|
|
2841
|
+
},
|
|
2842
|
+
tags: { type: "array", description: "Optional tags" },
|
|
2843
|
+
linkedBeliefNodeId: {
|
|
2844
|
+
type: "string",
|
|
2845
|
+
description: "Optional belief to attach evidence to"
|
|
2846
|
+
},
|
|
2847
|
+
evidenceRelation: {
|
|
2848
|
+
type: "string",
|
|
2849
|
+
description: "Relation to linked belief",
|
|
2850
|
+
enum: ["supports", "contradicts"]
|
|
2851
|
+
},
|
|
2852
|
+
confidence: { type: "number", description: "Optional confidence in [0,1]" },
|
|
2853
|
+
createQuestionText: {
|
|
2854
|
+
type: "string",
|
|
2855
|
+
description: "Optional follow-up question text"
|
|
2856
|
+
},
|
|
2857
|
+
createBeliefText: {
|
|
2858
|
+
type: "string",
|
|
2859
|
+
description: "Optional new belief text"
|
|
2860
|
+
},
|
|
2861
|
+
beliefType: {
|
|
2862
|
+
type: "string",
|
|
2863
|
+
description: "Optional belief type for createBeliefText"
|
|
2864
|
+
}
|
|
2865
|
+
},
|
|
2866
|
+
required: ["summary"],
|
|
2867
|
+
response: {
|
|
2868
|
+
description: "Created learning artifacts",
|
|
2869
|
+
fields: {
|
|
2870
|
+
topicId: "string \u2014 resolved topic ID",
|
|
2871
|
+
evidenceNodeId: "string",
|
|
2872
|
+
linkedBeliefNodeId: "string | null",
|
|
2873
|
+
createdQuestionId: "string | null",
|
|
2874
|
+
createdBeliefId: "string | null",
|
|
2875
|
+
sourceUrl: "string",
|
|
2876
|
+
createdAt: "number"
|
|
2877
|
+
}
|
|
2878
|
+
},
|
|
2879
|
+
ownerModule: "reasoning-kernel",
|
|
2880
|
+
ontologyPrimitive: "evidence",
|
|
2881
|
+
tier: "workhorse",
|
|
2882
|
+
internal: true
|
|
2883
|
+
};
|
|
2884
|
+
var PIPELINE_SNAPSHOT = {
|
|
2885
|
+
name: "pipeline_snapshot",
|
|
2886
|
+
description: "Summarize a topic's worktree pipeline in band-and-lane form. Like `git status --short` for Lucern execution \u2014 returns the hinge worktree, next planned wave, blockers, critical path, superseded work, and graph hygiene debt.",
|
|
2887
|
+
parameters: {
|
|
2888
|
+
topicId: { type: "string", description: "Topic scope ID" }
|
|
2889
|
+
},
|
|
2890
|
+
required: ["topicId"],
|
|
2891
|
+
response: {
|
|
2892
|
+
description: "Human-oriented pipeline summary for a single topic scope",
|
|
2893
|
+
fields: {
|
|
2894
|
+
topicId: "string",
|
|
2895
|
+
topicName: "string",
|
|
2896
|
+
currentBand: "number | null",
|
|
2897
|
+
nextBand: "number | null",
|
|
2898
|
+
activeWorktrees: "array \u2014 current hinge worktree(s)",
|
|
2899
|
+
nextWave: "array \u2014 worktrees in the next planned band",
|
|
2900
|
+
readyNow: "array \u2014 planning worktrees with dependencies completed",
|
|
2901
|
+
blockedBy: "array \u2014 grouped blockers",
|
|
2902
|
+
criticalPath: "array \u2014 ordered incomplete worktree chain",
|
|
2903
|
+
bands: "array \u2014 incomplete worktrees grouped by executionBand",
|
|
2904
|
+
superseded: "array \u2014 worktrees marked superseded or not for activation",
|
|
2905
|
+
graphHygiene: "object \u2014 untargeted and taskless worktree debt",
|
|
2906
|
+
riskQuestions: "array \u2014 critical/high open questions",
|
|
2907
|
+
narrative: "array \u2014 concise natural-language summary lines"
|
|
2908
|
+
}
|
|
2909
|
+
},
|
|
2910
|
+
ownerModule: "reasoning-kernel",
|
|
2911
|
+
ontologyPrimitive: "graph",
|
|
2912
|
+
tier: "workhorse",
|
|
2913
|
+
internal: true
|
|
2914
|
+
};
|
|
2915
|
+
var DISCOVER = {
|
|
2916
|
+
name: "discover",
|
|
2917
|
+
description: "Navigate the topic tree to find where knowledge lives. Like `git log --all --grep` \u2014 searches across the graph using bottom-up content matching plus top-down structural scoring.",
|
|
2918
|
+
parameters: {
|
|
2919
|
+
query: {
|
|
2920
|
+
type: "string",
|
|
2921
|
+
description: "What to look for across the topic tree"
|
|
2922
|
+
},
|
|
2923
|
+
topK: {
|
|
2924
|
+
type: "number",
|
|
2925
|
+
description: "How many matching topics to return (default: 3, max: 10)"
|
|
2926
|
+
},
|
|
2927
|
+
includeNeighborhood: {
|
|
2928
|
+
type: "boolean",
|
|
2929
|
+
description: "Whether to include beliefs/questions/evidence for matched topics"
|
|
2930
|
+
}
|
|
2931
|
+
},
|
|
2932
|
+
required: ["query"],
|
|
2933
|
+
response: {
|
|
2934
|
+
description: "Ranked topic matches with optional neighborhood content",
|
|
2935
|
+
fields: {
|
|
2936
|
+
query: "string \u2014 original query",
|
|
2937
|
+
matchedTopics: "array \u2014 ranked topics with scores and paths",
|
|
2938
|
+
neighborhoods: "array \u2014 beliefs, questions, evidence for each match",
|
|
2939
|
+
totalTopicsScored: "number",
|
|
2940
|
+
topicTreeSize: "number"
|
|
2941
|
+
}
|
|
2942
|
+
},
|
|
2943
|
+
ownerModule: "reasoning-kernel",
|
|
2944
|
+
ontologyPrimitive: "graph",
|
|
2945
|
+
tier: "showcase",
|
|
2946
|
+
deprecated: "Deprecated: use lucern.context.compile() with topicId"
|
|
2947
|
+
};
|
|
2948
|
+
var ANALYZE_TOPIC_DENSITY = {
|
|
2949
|
+
name: "analyze_topic_density",
|
|
2950
|
+
description: "Analyze topic belief density and identify natural conceptual clusters. Like `git diff --stat` for topic organization \u2014 detects when a topic has accumulated too many beliefs and suggests subtopic decomposition.",
|
|
2951
|
+
parameters: {
|
|
2952
|
+
topicId: { type: "string", description: "Topic ID to analyze" },
|
|
2953
|
+
threshold: {
|
|
2954
|
+
type: "number",
|
|
2955
|
+
description: "Belief count threshold for density warning"
|
|
2956
|
+
},
|
|
2957
|
+
minModularity: {
|
|
2958
|
+
type: "number",
|
|
2959
|
+
description: "Minimum modularity score for suggesting decomposition"
|
|
2960
|
+
}
|
|
2961
|
+
},
|
|
2962
|
+
required: ["topicId"],
|
|
2963
|
+
response: {
|
|
2964
|
+
description: "Density analysis with cluster suggestions",
|
|
2965
|
+
fields: {
|
|
2966
|
+
topicId: "string",
|
|
2967
|
+
topicName: "string",
|
|
2968
|
+
beliefCount: "number",
|
|
2969
|
+
edgeCount: "number",
|
|
2970
|
+
threshold: "number",
|
|
2971
|
+
isDense: "boolean",
|
|
2972
|
+
modularity: "number",
|
|
2973
|
+
clusterCount: "number",
|
|
2974
|
+
clusters: "array \u2014 suggested belief clusters",
|
|
2975
|
+
recommendation: "string"
|
|
2976
|
+
}
|
|
2977
|
+
},
|
|
2978
|
+
ownerModule: "reasoning-kernel",
|
|
2979
|
+
ontologyPrimitive: "graph",
|
|
2980
|
+
tier: "showcase"
|
|
2981
|
+
};
|
|
2982
|
+
var APPLY_AUTO_BRANCHING = {
|
|
2983
|
+
name: "apply_auto_branching",
|
|
2984
|
+
description: "Execute topic decomposition by creating subtopics and reassigning beliefs. Like `git subtree split` \u2014 splits a dense topic into focused subtopics while preserving belief identity and edges.",
|
|
2985
|
+
parameters: {
|
|
2986
|
+
topicId: { type: "string", description: "Parent topic ID to decompose" },
|
|
2987
|
+
clusters: {
|
|
2988
|
+
type: "array",
|
|
2989
|
+
description: "Cluster definitions from analyze_topic_density, each with name and beliefIds"
|
|
2990
|
+
},
|
|
2991
|
+
dryRun: {
|
|
2992
|
+
type: "boolean",
|
|
2993
|
+
description: "Preview changes without applying them"
|
|
2994
|
+
}
|
|
2995
|
+
},
|
|
2996
|
+
required: ["topicId", "clusters"],
|
|
2997
|
+
response: {
|
|
2998
|
+
description: "Results of the auto-branching operation",
|
|
2999
|
+
fields: {
|
|
3000
|
+
success: "boolean",
|
|
3001
|
+
parentTopicId: "string",
|
|
3002
|
+
createdSubtopics: "array",
|
|
3003
|
+
totalReassigned: "number",
|
|
3004
|
+
totalSkipped: "number",
|
|
3005
|
+
dryRun: "boolean"
|
|
3006
|
+
}
|
|
3007
|
+
},
|
|
3008
|
+
ownerModule: "reasoning-kernel",
|
|
3009
|
+
ontologyPrimitive: "graph",
|
|
3010
|
+
tier: "showcase"
|
|
3011
|
+
};
|
|
3012
|
+
var SEED_BELIEF_LATTICE = {
|
|
3013
|
+
name: "seed_belief_lattice",
|
|
3014
|
+
description: "Seed belief lattice coverage for a topic based on its resolved ontology. Like `git init` for ontology coverage \u2014 creates or previews seed beliefs for entity types that need a baseline anchor.",
|
|
3015
|
+
parameters: {
|
|
3016
|
+
topicId: {
|
|
3017
|
+
type: "string",
|
|
3018
|
+
description: "Topic scope ID. Lattice seeding must target a child topic."
|
|
3019
|
+
},
|
|
3020
|
+
dryRun: {
|
|
3021
|
+
type: "boolean",
|
|
3022
|
+
description: "Preview seeds without creating them"
|
|
3023
|
+
}
|
|
3024
|
+
},
|
|
3025
|
+
required: [],
|
|
3026
|
+
response: {
|
|
3027
|
+
description: "Lattice seed results with per-entity-type status",
|
|
3028
|
+
fields: {
|
|
3029
|
+
topicId: "string",
|
|
3030
|
+
ontologyResolved: "boolean",
|
|
3031
|
+
ontologyKey: "string | null",
|
|
3032
|
+
ontologyVersion: "string | null",
|
|
3033
|
+
entityTypeCount: "number",
|
|
3034
|
+
seeds: "array \u2014 per-entity-type seed status",
|
|
3035
|
+
summary: "object \u2014 created/existing/scored/total counts",
|
|
3036
|
+
dryRun: "boolean"
|
|
3037
|
+
}
|
|
3038
|
+
},
|
|
3039
|
+
ownerModule: "reasoning-kernel",
|
|
3040
|
+
ontologyPrimitive: "belief",
|
|
3041
|
+
tier: "workhorse",
|
|
3042
|
+
internal: true
|
|
3043
|
+
};
|
|
3044
|
+
var GET_LATTICE_COVERAGE = {
|
|
3045
|
+
name: "get_lattice_coverage",
|
|
3046
|
+
description: "Report belief lattice coverage for a topic. Like `git fsck` for ontology coverage \u2014 identifies anchored, hollow, and missing entity-type belief coverage.",
|
|
3047
|
+
parameters: {
|
|
3048
|
+
topicId: {
|
|
3049
|
+
type: "string",
|
|
3050
|
+
description: "Topic scope ID to check lattice coverage for"
|
|
3051
|
+
}
|
|
3052
|
+
},
|
|
3053
|
+
required: [],
|
|
3054
|
+
response: {
|
|
3055
|
+
description: "Per-entity-type coverage with overall score",
|
|
3056
|
+
fields: {
|
|
3057
|
+
topicId: "string",
|
|
3058
|
+
ontologyKey: "string | null",
|
|
3059
|
+
ontologyVersion: "string | null",
|
|
3060
|
+
entityTypes: "array \u2014 per-entity-type coverage rows",
|
|
3061
|
+
summary: "object \u2014 total/anchored/hollow/missing/coverageScore"
|
|
3062
|
+
}
|
|
3063
|
+
},
|
|
3064
|
+
ownerModule: "reasoning-kernel",
|
|
3065
|
+
ontologyPrimitive: "belief",
|
|
3066
|
+
tier: "workhorse",
|
|
3067
|
+
internal: true
|
|
3068
|
+
};
|
|
3069
|
+
var DISCOVER_ENTITY_CONNECTIONS = {
|
|
3070
|
+
name: "discover_entity_connections",
|
|
3071
|
+
description: "Find existing entities that should be connected to a belief/question/evidence node. Like `git log --diff-filter=M` for missing entity connections \u2014 scans entities in scope and suggests bridge edge types.",
|
|
3072
|
+
parameters: {
|
|
3073
|
+
nodeId: {
|
|
3074
|
+
type: "string",
|
|
3075
|
+
description: "Epistemic node ID to find entity connections for"
|
|
3076
|
+
},
|
|
3077
|
+
topicId: {
|
|
3078
|
+
type: "string",
|
|
3079
|
+
description: "Optional topic scope override"
|
|
3080
|
+
},
|
|
3081
|
+
minScore: {
|
|
3082
|
+
type: "number",
|
|
3083
|
+
description: "Minimum match score threshold"
|
|
3084
|
+
},
|
|
3085
|
+
limit: {
|
|
3086
|
+
type: "number",
|
|
3087
|
+
description: "Maximum candidates to return"
|
|
3088
|
+
}
|
|
3089
|
+
},
|
|
3090
|
+
required: ["nodeId"],
|
|
3091
|
+
response: {
|
|
3092
|
+
description: "Ranked entity connection candidates",
|
|
3093
|
+
fields: {
|
|
3094
|
+
nodeId: "string",
|
|
3095
|
+
candidateCount: "number",
|
|
3096
|
+
candidates: "array \u2014 suggested entity bridge candidates"
|
|
3097
|
+
}
|
|
3098
|
+
},
|
|
3099
|
+
ownerModule: "reasoning-kernel",
|
|
3100
|
+
ontologyPrimitive: "ontology",
|
|
3101
|
+
tier: "workhorse"
|
|
3102
|
+
};
|
|
3103
|
+
var TRIGGER_BELIEF_REVIEW = {
|
|
3104
|
+
name: "trigger_belief_review",
|
|
3105
|
+
description: "Flag beliefs for review after an entity changes. Like `git bisect` for stale beliefs \u2014 traverses bridge edges from the changed entity and creates review questions for stale connected beliefs.",
|
|
3106
|
+
parameters: {
|
|
3107
|
+
entityNodeId: {
|
|
3108
|
+
type: "string",
|
|
3109
|
+
description: "The entity node that changed"
|
|
3110
|
+
},
|
|
3111
|
+
changeDescription: {
|
|
3112
|
+
type: "string",
|
|
3113
|
+
description: "What changed about the entity"
|
|
3114
|
+
},
|
|
3115
|
+
maxQuestions: {
|
|
3116
|
+
type: "number",
|
|
3117
|
+
description: "Maximum review questions to create"
|
|
3118
|
+
}
|
|
3119
|
+
},
|
|
3120
|
+
required: ["entityNodeId"],
|
|
3121
|
+
response: {
|
|
3122
|
+
description: "Affected beliefs and created review questions",
|
|
3123
|
+
fields: {
|
|
3124
|
+
entityNodeId: "string",
|
|
3125
|
+
entityTitle: "string",
|
|
3126
|
+
entityType: "string",
|
|
3127
|
+
changeDescription: "string",
|
|
3128
|
+
affectedBeliefCount: "number",
|
|
3129
|
+
questionsCreated: "number",
|
|
3130
|
+
reviewedBeliefs: "array",
|
|
3131
|
+
questions: "array"
|
|
3132
|
+
}
|
|
3133
|
+
},
|
|
3134
|
+
ownerModule: "reasoning-kernel",
|
|
3135
|
+
ontologyPrimitive: "ontology",
|
|
3136
|
+
tier: "workhorse"
|
|
3137
|
+
};
|
|
3138
|
+
var EVALUATE_CONTRACT = {
|
|
3139
|
+
name: "evaluate_contract",
|
|
3140
|
+
description: "Run a contract evaluation and record the append-only result. Like `git test` for a belief binding \u2014 executes the evaluator, logs the result, and applies any allowed confidence modulation.",
|
|
3141
|
+
parameters: {
|
|
3142
|
+
contractId: { type: "string", description: "Which contract to evaluate" },
|
|
3143
|
+
trigger: {
|
|
3144
|
+
type: "string",
|
|
3145
|
+
description: "What caused this evaluation"
|
|
3146
|
+
}
|
|
3147
|
+
},
|
|
3148
|
+
required: ["contractId"],
|
|
3149
|
+
response: {
|
|
3150
|
+
description: "The most recent contract evaluation result",
|
|
3151
|
+
fields: {
|
|
3152
|
+
evaluationId: "string",
|
|
3153
|
+
result: "string",
|
|
3154
|
+
status: "string",
|
|
3155
|
+
confidenceBefore: "number",
|
|
3156
|
+
confidenceAfter: "number",
|
|
3157
|
+
rationale: "string"
|
|
3158
|
+
}
|
|
3159
|
+
},
|
|
3160
|
+
ownerModule: "graph-primitives",
|
|
3161
|
+
ontologyPrimitive: "belief",
|
|
3162
|
+
tier: "workhorse"
|
|
3163
|
+
};
|
|
3164
|
+
var GET_CONTRACT_STATUS = {
|
|
3165
|
+
name: "get_contract_status",
|
|
3166
|
+
description: "Inspect epistemic contracts and their latest evaluations. Like `git status` for verification bindings \u2014 returns the contract rows plus the freshest recorded evaluation for each one.",
|
|
3167
|
+
parameters: {
|
|
3168
|
+
beliefNodeId: {
|
|
3169
|
+
type: "string",
|
|
3170
|
+
description: "Return all contracts attached to a specific belief"
|
|
3171
|
+
},
|
|
3172
|
+
contractId: {
|
|
3173
|
+
type: "string",
|
|
3174
|
+
description: "Return one specific contract by contractId"
|
|
3175
|
+
},
|
|
3176
|
+
status: {
|
|
3177
|
+
type: "string",
|
|
3178
|
+
description: "Optional status filter applied after lookup",
|
|
3179
|
+
enum: ["active", "satisfied", "violated", "expired", "suspended", "archived"]
|
|
3180
|
+
}
|
|
3181
|
+
},
|
|
3182
|
+
required: [],
|
|
3183
|
+
response: {
|
|
3184
|
+
description: "Matching contract rows with latest evaluation context",
|
|
3185
|
+
fields: {
|
|
3186
|
+
contracts: "array \u2014 matching contracts with latestEvaluation attached",
|
|
3187
|
+
count: "number"
|
|
3188
|
+
}
|
|
3189
|
+
},
|
|
3190
|
+
ownerModule: "graph-primitives",
|
|
3191
|
+
ontologyPrimitive: "belief",
|
|
3192
|
+
tier: "workhorse"
|
|
3193
|
+
};
|
|
3194
|
+
var REGISTER_SESSION = {
|
|
3195
|
+
name: "register_session",
|
|
3196
|
+
description: "Announce this agent session's presence to other parallel sessions. Like `git init` for coordination \u2014 creates a session record so other agents can discover you.",
|
|
3197
|
+
parameters: {
|
|
3198
|
+
sessionName: { type: "string", description: "Human-readable session label" },
|
|
3199
|
+
agentType: { type: "string", description: "Agent type" },
|
|
3200
|
+
topicId: { type: "string", description: "Current Lucern topic scope ID" },
|
|
3201
|
+
worktreeId: { type: "string", description: "Active Lucern worktree ID" },
|
|
3202
|
+
gitBranch: { type: "string", description: "Current git branch name" }
|
|
3203
|
+
},
|
|
3204
|
+
required: [],
|
|
3205
|
+
response: {
|
|
3206
|
+
description: "Session registration result",
|
|
3207
|
+
fields: {
|
|
3208
|
+
sessionId: "string",
|
|
3209
|
+
status: "string \u2014 active",
|
|
3210
|
+
isNew: "boolean"
|
|
3211
|
+
}
|
|
3212
|
+
},
|
|
3213
|
+
ownerModule: "coordination",
|
|
3214
|
+
ontologyPrimitive: "graph",
|
|
3215
|
+
tier: "workhorse",
|
|
3216
|
+
internal: true
|
|
3217
|
+
};
|
|
3218
|
+
var HEARTBEAT_SESSION = {
|
|
3219
|
+
name: "heartbeat_session",
|
|
3220
|
+
description: "Update this session's heartbeat and optional status fields. Like `git status` \u2014 signals liveness and updates what you are working on.",
|
|
3221
|
+
parameters: {
|
|
3222
|
+
topicId: { type: "string", description: "Updated topic scope" },
|
|
3223
|
+
worktreeId: { type: "string", description: "Updated worktree ID" },
|
|
3224
|
+
gitBranch: { type: "string", description: "Updated git branch" },
|
|
3225
|
+
status: {
|
|
3226
|
+
type: "string",
|
|
3227
|
+
description: "Session status update",
|
|
3228
|
+
enum: ["active", "idle"]
|
|
3229
|
+
}
|
|
3230
|
+
},
|
|
3231
|
+
required: [],
|
|
3232
|
+
response: {
|
|
3233
|
+
description: "Heartbeat result",
|
|
3234
|
+
fields: {
|
|
3235
|
+
success: "boolean",
|
|
3236
|
+
message: "string"
|
|
3237
|
+
}
|
|
3238
|
+
},
|
|
3239
|
+
ownerModule: "coordination",
|
|
3240
|
+
ontologyPrimitive: "graph",
|
|
3241
|
+
tier: "workhorse",
|
|
3242
|
+
internal: true
|
|
3243
|
+
};
|
|
3244
|
+
var END_SESSION = {
|
|
3245
|
+
name: "end_session",
|
|
3246
|
+
description: "Gracefully end this agent session. Like `git stash` \u2014 marks the session as ended so other agents know you are gone.",
|
|
3247
|
+
parameters: {},
|
|
3248
|
+
required: [],
|
|
3249
|
+
response: {
|
|
3250
|
+
description: "Session end result",
|
|
3251
|
+
fields: {
|
|
3252
|
+
success: "boolean",
|
|
3253
|
+
message: "string"
|
|
3254
|
+
}
|
|
3255
|
+
},
|
|
3256
|
+
ownerModule: "coordination",
|
|
3257
|
+
ontologyPrimitive: "graph",
|
|
3258
|
+
tier: "workhorse",
|
|
3259
|
+
internal: true
|
|
3260
|
+
};
|
|
3261
|
+
var LIST_ACTIVE_SESSIONS = {
|
|
3262
|
+
name: "list_active_sessions",
|
|
3263
|
+
description: "See who else is online with active agent sessions, scope, branch, and file claims. Like `git branch --list` for live agents \u2014 shows active and idle sessions before editing.",
|
|
3264
|
+
parameters: {
|
|
3265
|
+
includeIdle: {
|
|
3266
|
+
type: "boolean",
|
|
3267
|
+
description: "Include idle sessions"
|
|
3268
|
+
}
|
|
3269
|
+
},
|
|
3270
|
+
required: [],
|
|
3271
|
+
response: {
|
|
3272
|
+
description: "List of active/idle agent sessions",
|
|
3273
|
+
fields: {
|
|
3274
|
+
sessions: "array \u2014 active session records"
|
|
3275
|
+
}
|
|
3276
|
+
},
|
|
3277
|
+
ownerModule: "coordination",
|
|
3278
|
+
ontologyPrimitive: "graph",
|
|
3279
|
+
tier: "workhorse",
|
|
3280
|
+
internal: true
|
|
3281
|
+
};
|
|
3282
|
+
var SEND_AGENT_MESSAGE = {
|
|
3283
|
+
name: "send_agent_message",
|
|
3284
|
+
description: "Send a directed message to a specific agent session. Like `git notes` \u2014 leaves a coordination note for a specific peer.",
|
|
3285
|
+
parameters: {
|
|
3286
|
+
toSessionId: { type: "string", description: "Target session ID" },
|
|
3287
|
+
content: { type: "string", description: "Message text" },
|
|
3288
|
+
messageType: {
|
|
3289
|
+
type: "string",
|
|
3290
|
+
description: "Message intent",
|
|
3291
|
+
enum: ["note", "question", "answer", "alert", "handoff"]
|
|
3292
|
+
},
|
|
3293
|
+
relatedBeliefId: {
|
|
3294
|
+
type: "string",
|
|
3295
|
+
description: "Optional related belief node ID"
|
|
3296
|
+
},
|
|
3297
|
+
relatedWorktreeId: {
|
|
3298
|
+
type: "string",
|
|
3299
|
+
description: "Optional related worktree ID"
|
|
3300
|
+
}
|
|
3301
|
+
},
|
|
3302
|
+
required: ["toSessionId", "content"],
|
|
3303
|
+
response: {
|
|
3304
|
+
description: "Message delivery result",
|
|
3305
|
+
fields: { messageId: "string" }
|
|
3306
|
+
},
|
|
3307
|
+
ownerModule: "coordination",
|
|
3308
|
+
ontologyPrimitive: "graph",
|
|
3309
|
+
tier: "workhorse",
|
|
3310
|
+
internal: true
|
|
3311
|
+
};
|
|
3312
|
+
var BROADCAST_MESSAGE = {
|
|
3313
|
+
name: "broadcast_message",
|
|
3314
|
+
description: "Send a message to all active agent sessions. Like `git tag` \u2014 marks an important event visible to everyone.",
|
|
3315
|
+
parameters: {
|
|
3316
|
+
content: { type: "string", description: "Broadcast message text" },
|
|
3317
|
+
messageType: {
|
|
3318
|
+
type: "string",
|
|
3319
|
+
description: "Message intent",
|
|
3320
|
+
enum: ["note", "alert", "handoff"]
|
|
3321
|
+
},
|
|
3322
|
+
relatedBeliefId: {
|
|
3323
|
+
type: "string",
|
|
3324
|
+
description: "Optional related belief node ID"
|
|
3325
|
+
},
|
|
3326
|
+
relatedWorktreeId: {
|
|
3327
|
+
type: "string",
|
|
3328
|
+
description: "Optional related worktree ID"
|
|
3329
|
+
}
|
|
3330
|
+
},
|
|
3331
|
+
required: ["content"],
|
|
3332
|
+
response: {
|
|
3333
|
+
description: "Broadcast result",
|
|
3334
|
+
fields: { messageId: "string" }
|
|
3335
|
+
},
|
|
3336
|
+
ownerModule: "coordination",
|
|
3337
|
+
ontologyPrimitive: "graph",
|
|
3338
|
+
tier: "workhorse",
|
|
3339
|
+
internal: true
|
|
3340
|
+
};
|
|
3341
|
+
var GET_AGENT_INBOX = {
|
|
3342
|
+
name: "get_agent_inbox",
|
|
3343
|
+
description: "Check unread messages addressed to this session. Like `git log --incoming` \u2014 shows direct and broadcast messages from other agents.",
|
|
3344
|
+
parameters: {
|
|
3345
|
+
limit: { type: "number", description: "Max messages to return" },
|
|
3346
|
+
markAsRead: {
|
|
3347
|
+
type: "boolean",
|
|
3348
|
+
description: "Mark returned messages as read"
|
|
3349
|
+
}
|
|
3350
|
+
},
|
|
3351
|
+
required: [],
|
|
3352
|
+
response: {
|
|
3353
|
+
description: "Inbox messages",
|
|
3354
|
+
fields: {
|
|
3355
|
+
messages: "array \u2014 unread direct and broadcast messages"
|
|
3356
|
+
}
|
|
3357
|
+
},
|
|
3358
|
+
ownerModule: "coordination",
|
|
3359
|
+
ontologyPrimitive: "graph",
|
|
3360
|
+
tier: "workhorse",
|
|
3361
|
+
internal: true
|
|
3362
|
+
};
|
|
3363
|
+
var CLAIM_FILES = {
|
|
3364
|
+
name: "claim_files",
|
|
3365
|
+
description: "Declare which files this session is actively editing. Like `git add` for coordination \u2014 tells other sessions what you are touching and returns advisory conflicts.",
|
|
3366
|
+
parameters: {
|
|
3367
|
+
files: {
|
|
3368
|
+
type: "array",
|
|
3369
|
+
description: "File paths this session is actively editing"
|
|
3370
|
+
}
|
|
3371
|
+
},
|
|
3372
|
+
required: ["files"],
|
|
3373
|
+
response: {
|
|
3374
|
+
description: "File claim result with conflict detection",
|
|
3375
|
+
fields: {
|
|
3376
|
+
success: "boolean",
|
|
3377
|
+
conflicts: "array \u2014 conflicting file claims"
|
|
3378
|
+
}
|
|
3379
|
+
},
|
|
3380
|
+
ownerModule: "coordination",
|
|
3381
|
+
ontologyPrimitive: "graph",
|
|
3382
|
+
tier: "workhorse",
|
|
3383
|
+
internal: true
|
|
3384
|
+
};
|
|
3385
|
+
var GENERATE_SESSION_HANDOFF = {
|
|
3386
|
+
name: "generate_session_handoff",
|
|
3387
|
+
description: "Generate a complete, zero-context handoff message for a new coding session. Like `git format-patch` \u2014 produces a self-contained instruction set that bootstraps a fresh Lucern worktree session.",
|
|
3388
|
+
parameters: {
|
|
3389
|
+
worktreeId: {
|
|
3390
|
+
type: "string",
|
|
3391
|
+
description: "The Lucern worktree ID to generate handoff instructions for"
|
|
3392
|
+
},
|
|
3393
|
+
gitWorktreePath: {
|
|
3394
|
+
type: "string",
|
|
3395
|
+
description: "Optional existing git worktree path"
|
|
3396
|
+
},
|
|
3397
|
+
gitBranchName: {
|
|
3398
|
+
type: "string",
|
|
3399
|
+
description: "Optional branch name for the session"
|
|
3400
|
+
},
|
|
3401
|
+
additionalContext: {
|
|
3402
|
+
type: "string",
|
|
3403
|
+
description: "Optional extra context to include in the handoff"
|
|
3404
|
+
}
|
|
3405
|
+
},
|
|
3406
|
+
required: ["worktreeId"],
|
|
3407
|
+
response: {
|
|
3408
|
+
description: "A complete handoff message ready for a new coding session",
|
|
3409
|
+
fields: {
|
|
3410
|
+
handoffMessage: "string",
|
|
3411
|
+
worktreeId: "string",
|
|
3412
|
+
worktreeName: "string",
|
|
3413
|
+
trackBoundary: "object",
|
|
3414
|
+
needsActivation: "boolean",
|
|
3415
|
+
needsGitSetup: "string \u2014 create | fast-forward | ready"
|
|
3416
|
+
}
|
|
3417
|
+
},
|
|
3418
|
+
ownerModule: "bootstrap",
|
|
3419
|
+
ontologyPrimitive: "worktree",
|
|
3420
|
+
tier: "showcase",
|
|
3421
|
+
internal: true
|
|
3422
|
+
};
|
|
3423
|
+
var MCP_TOOL_CONTRACTS = {
|
|
3424
|
+
// Belief lifecycle (commit, amend, fork, archive)
|
|
3425
|
+
create_belief: CREATE_BELIEF,
|
|
3426
|
+
get_belief: GET_BELIEF,
|
|
3427
|
+
refine_belief: REFINE_BELIEF,
|
|
3428
|
+
modulate_confidence: MODULATE_CONFIDENCE,
|
|
3429
|
+
fork_belief: FORK_BELIEF,
|
|
3430
|
+
archive_belief: ARCHIVE_BELIEF,
|
|
3431
|
+
create_epistemic_contract: CREATE_EPISTEMIC_CONTRACT,
|
|
3432
|
+
evaluate_contract: EVALUATE_CONTRACT,
|
|
3433
|
+
get_contract_status: GET_CONTRACT_STATUS,
|
|
3434
|
+
// Evidence (commit)
|
|
3435
|
+
create_evidence: CREATE_EVIDENCE,
|
|
3436
|
+
get_evidence: GET_EVIDENCE,
|
|
3437
|
+
list_evidence: LIST_EVIDENCE,
|
|
3438
|
+
link_evidence: LINK_EVIDENCE,
|
|
3439
|
+
add_evidence: ADD_EVIDENCE,
|
|
3440
|
+
// Contradictions (merge conflict)
|
|
3441
|
+
flag_contradiction: FLAG_CONTRADICTION,
|
|
3442
|
+
// Lens lifecycle (workspace-scoped operational frames)
|
|
3443
|
+
create_lens: CREATE_LENS,
|
|
3444
|
+
list_lenses: LIST_LENSES,
|
|
3445
|
+
apply_lens_to_topic: APPLY_LENS_TO_TOPIC,
|
|
3446
|
+
remove_lens_from_topic: REMOVE_LENS_FROM_TOPIC,
|
|
3447
|
+
// Worktree lifecycle (git worktree add → merge → push → pull request)
|
|
3448
|
+
add_worktree: ADD_WORKTREE,
|
|
3449
|
+
merge: MERGE,
|
|
3450
|
+
push: PUSH,
|
|
3451
|
+
open_pull_request: OPEN_PULL_REQUEST,
|
|
3452
|
+
// Lineage and audit (log, blame)
|
|
3453
|
+
query_lineage: QUERY_LINEAGE,
|
|
3454
|
+
get_confidence_history: GET_CONFIDENCE_HISTORY,
|
|
3455
|
+
get_audit_trail: GET_AUDIT_TRAIL,
|
|
3456
|
+
// Graph queries (traverse, search, bisect, entity impact)
|
|
3457
|
+
traverse_graph: TRAVERSE_GRAPH,
|
|
3458
|
+
get_graph_neighborhood: GET_GRAPH_NEIGHBORHOOD,
|
|
3459
|
+
trace_entity_impact: TRACE_ENTITY_IMPACT,
|
|
3460
|
+
search_beliefs: SEARCH_BELIEFS,
|
|
3461
|
+
find_contradictions: FIND_CONTRADICTIONS,
|
|
3462
|
+
bisect_confidence: BISECT_CONFIDENCE,
|
|
3463
|
+
// Edges (commit)
|
|
3464
|
+
create_edge: CREATE_EDGE,
|
|
3465
|
+
// Judgments (tag)
|
|
3466
|
+
record_judgment: RECORD_JUDGMENT,
|
|
3467
|
+
// Graph intelligence (showcase)
|
|
3468
|
+
detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
|
|
3469
|
+
get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
|
|
3470
|
+
get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
|
|
3471
|
+
// Evidence operations (workhorse)
|
|
3472
|
+
search_evidence: SEARCH_EVIDENCE,
|
|
3473
|
+
link_evidence_to_belief: LINK_EVIDENCE_TO_BELIEF,
|
|
3474
|
+
// Answer lifecycle (L2 question responses)
|
|
3475
|
+
create_answer: CREATE_ANSWER,
|
|
3476
|
+
get_answer: GET_ANSWER,
|
|
3477
|
+
// Question operations (workhorse)
|
|
3478
|
+
create_question: CREATE_QUESTION,
|
|
3479
|
+
get_question: GET_QUESTION,
|
|
3480
|
+
refine_question: REFINE_QUESTION,
|
|
3481
|
+
list_questions: LIST_QUESTIONS,
|
|
3482
|
+
answer_question: ANSWER_QUESTION,
|
|
3483
|
+
update_question_status: UPDATE_QUESTION_STATUS,
|
|
3484
|
+
archive_question: ARCHIVE_QUESTION,
|
|
3485
|
+
link_evidence_to_question: LINK_EVIDENCE_TO_QUESTION,
|
|
3486
|
+
get_high_priority_questions: GET_HIGH_PRIORITY_QUESTIONS,
|
|
3487
|
+
find_missing_questions: FIND_MISSING_QUESTIONS,
|
|
3488
|
+
// Listing & query (workhorse)
|
|
3489
|
+
list_beliefs: LIST_BELIEFS,
|
|
3490
|
+
list_worktrees: LIST_WORKTREES,
|
|
3491
|
+
list_all_worktrees: LIST_ALL_WORKTREES,
|
|
3492
|
+
activate_worktree: ACTIVATE_WORKTREE,
|
|
3493
|
+
update_worktree_targets: UPDATE_WORKTREE_TARGETS,
|
|
3494
|
+
update_worktree_metadata: UPDATE_WORKTREE_METADATA,
|
|
3495
|
+
identity_whoami: IDENTITY_WHOAMI,
|
|
3496
|
+
compile_context: COMPILE_CONTEXT,
|
|
3497
|
+
record_scope_learning: RECORD_SCOPE_LEARNING,
|
|
3498
|
+
pipeline_snapshot: PIPELINE_SNAPSHOT,
|
|
3499
|
+
discover: DISCOVER,
|
|
3500
|
+
analyze_topic_density: ANALYZE_TOPIC_DENSITY,
|
|
3501
|
+
apply_auto_branching: APPLY_AUTO_BRANCHING,
|
|
3502
|
+
seed_belief_lattice: SEED_BELIEF_LATTICE,
|
|
3503
|
+
get_lattice_coverage: GET_LATTICE_COVERAGE,
|
|
3504
|
+
discover_entity_connections: DISCOVER_ENTITY_CONNECTIONS,
|
|
3505
|
+
trigger_belief_review: TRIGGER_BELIEF_REVIEW,
|
|
3506
|
+
register_session: REGISTER_SESSION,
|
|
3507
|
+
heartbeat_session: HEARTBEAT_SESSION,
|
|
3508
|
+
end_session: END_SESSION,
|
|
3509
|
+
list_active_sessions: LIST_ACTIVE_SESSIONS,
|
|
3510
|
+
send_agent_message: SEND_AGENT_MESSAGE,
|
|
3511
|
+
broadcast_message: BROADCAST_MESSAGE,
|
|
3512
|
+
get_agent_inbox: GET_AGENT_INBOX,
|
|
3513
|
+
claim_files: CLAIM_FILES,
|
|
3514
|
+
generate_session_handoff: GENERATE_SESSION_HANDOFF,
|
|
3515
|
+
// Policy / ACL (workhorse)
|
|
3516
|
+
check_permission: CHECK_PERMISSION,
|
|
3517
|
+
filter_by_permission: FILTER_BY_PERMISSION,
|
|
3518
|
+
// Write policy (S2-13K Graph Compounding)
|
|
3519
|
+
manage_write_policy: MANAGE_WRITE_POLICY,
|
|
3520
|
+
// Observation context (workhorse)
|
|
3521
|
+
ingest_observation: INGEST_OBSERVATION,
|
|
3522
|
+
get_observation_context: GET_OBSERVATION_CONTEXT,
|
|
3523
|
+
// Task lifecycle (workhorse)
|
|
3524
|
+
create_task: CREATE_TASK,
|
|
3525
|
+
complete_task: COMPLETE_TASK,
|
|
3526
|
+
update_task: UPDATE_TASK,
|
|
3527
|
+
list_tasks: LIST_TASKS,
|
|
3528
|
+
// Topic lifecycle (init, remote)
|
|
3529
|
+
create_topic: CREATE_TOPIC,
|
|
3530
|
+
list_topics: LIST_TOPICS,
|
|
3531
|
+
get_topic: GET_TOPIC,
|
|
3532
|
+
update_topic: UPDATE_TOPIC,
|
|
3533
|
+
get_topic_tree: GET_TOPIC_TREE,
|
|
3534
|
+
// Coding intelligence (code-grounded knowledge)
|
|
3535
|
+
get_code_context: GET_CODE_CONTEXT,
|
|
3536
|
+
get_change_history: GET_CHANGE_HISTORY,
|
|
3537
|
+
record_attempt: RECORD_ATTEMPT,
|
|
3538
|
+
get_failure_log: GET_FAILURE_LOG,
|
|
3539
|
+
// Graph self-intelligence (coverage, gaps)
|
|
3540
|
+
get_topic_coverage: GET_TOPIC_COVERAGE,
|
|
3541
|
+
get_graph_gaps: GET_GRAPH_GAPS,
|
|
3542
|
+
// Ontology lifecycle (definition CRUD, version management)
|
|
3543
|
+
list_ontologies: LIST_ONTOLOGIES,
|
|
3544
|
+
get_ontology: GET_ONTOLOGY,
|
|
3545
|
+
apply_ontology: APPLY_ONTOLOGY,
|
|
3546
|
+
match_entity_type: MATCH_ENTITY_TYPE,
|
|
3547
|
+
create_ontology: CREATE_ONTOLOGY,
|
|
3548
|
+
update_ontology: UPDATE_ONTOLOGY,
|
|
3549
|
+
archive_ontology: ARCHIVE_ONTOLOGY,
|
|
3550
|
+
create_ontology_version: CREATE_ONTOLOGY_VERSION,
|
|
3551
|
+
publish_ontology_version: PUBLISH_ONTOLOGY_VERSION,
|
|
3552
|
+
deprecate_ontology_version: DEPRECATE_ONTOLOGY_VERSION,
|
|
3553
|
+
resolve_effective_ontology: RESOLVE_EFFECTIVE_ONTOLOGY
|
|
3554
|
+
};
|
|
3555
|
+
|
|
3556
|
+
// src/function-registry/manifest.ts
|
|
3557
|
+
var publicEverywhere = {
|
|
3558
|
+
sdk: "public",
|
|
3559
|
+
rest: "public",
|
|
3560
|
+
mcp: "public",
|
|
3561
|
+
cli: "public"
|
|
3562
|
+
};
|
|
3563
|
+
var internalSystem = {
|
|
3564
|
+
sdk: "internal",
|
|
3565
|
+
rest: "internal",
|
|
3566
|
+
mcp: "internal",
|
|
3567
|
+
cli: "internal"
|
|
3568
|
+
};
|
|
3569
|
+
var publicWithInternalMcp = {
|
|
3570
|
+
sdk: "public",
|
|
3571
|
+
rest: "public",
|
|
3572
|
+
mcp: "internal",
|
|
3573
|
+
cli: "public"
|
|
3574
|
+
};
|
|
3575
|
+
var publicWithoutMcp = {
|
|
3576
|
+
sdk: "public",
|
|
3577
|
+
rest: "public",
|
|
3578
|
+
mcp: "none",
|
|
3579
|
+
cli: "none"
|
|
3580
|
+
};
|
|
3581
|
+
var sdkOnlyPublic = {
|
|
3582
|
+
sdk: "public",
|
|
3583
|
+
rest: "none",
|
|
3584
|
+
mcp: "none",
|
|
3585
|
+
cli: "none"
|
|
3586
|
+
};
|
|
3587
|
+
var mcpOnlyInternal = {
|
|
3588
|
+
sdk: "none",
|
|
3589
|
+
rest: "none",
|
|
3590
|
+
mcp: "internal",
|
|
3591
|
+
cli: "none"
|
|
3592
|
+
};
|
|
3593
|
+
function entries(names, surfaceClass, surfaceIntent, surfaces, rationale) {
|
|
3594
|
+
return Object.fromEntries(
|
|
3595
|
+
names.map((name) => [
|
|
3596
|
+
name,
|
|
3597
|
+
{
|
|
3598
|
+
name,
|
|
3599
|
+
surfaceClass,
|
|
3600
|
+
surfaceIntent,
|
|
3601
|
+
surfaces,
|
|
3602
|
+
rationale
|
|
3603
|
+
}
|
|
3604
|
+
])
|
|
3605
|
+
);
|
|
3606
|
+
}
|
|
3607
|
+
var MCP_CORE_OPERATION_NAMES = [
|
|
3608
|
+
"compile_context",
|
|
3609
|
+
"identity_whoami",
|
|
3610
|
+
"check_permission",
|
|
3611
|
+
"filter_by_permission",
|
|
3612
|
+
"create_belief",
|
|
3613
|
+
"get_belief",
|
|
3614
|
+
"list_beliefs",
|
|
3615
|
+
"refine_belief",
|
|
3616
|
+
"modulate_confidence",
|
|
3617
|
+
"fork_belief",
|
|
3618
|
+
"archive_belief",
|
|
3619
|
+
"search_beliefs",
|
|
3620
|
+
"bisect_confidence",
|
|
3621
|
+
"create_evidence",
|
|
3622
|
+
"get_evidence",
|
|
3623
|
+
"list_evidence",
|
|
3624
|
+
"search_evidence",
|
|
3625
|
+
"link_evidence_to_belief",
|
|
3626
|
+
"link_evidence_to_question",
|
|
3627
|
+
"create_question",
|
|
3628
|
+
"get_question",
|
|
3629
|
+
"list_questions",
|
|
3630
|
+
"refine_question",
|
|
3631
|
+
"update_question_status",
|
|
3632
|
+
"archive_question",
|
|
3633
|
+
"create_answer",
|
|
3634
|
+
"get_answer",
|
|
3635
|
+
"find_missing_questions",
|
|
3636
|
+
"get_high_priority_questions",
|
|
3637
|
+
"get_falsification_questions",
|
|
3638
|
+
"create_topic",
|
|
3639
|
+
"get_topic",
|
|
3640
|
+
"list_topics",
|
|
3641
|
+
"update_topic",
|
|
3642
|
+
"get_topic_tree"
|
|
3643
|
+
];
|
|
3644
|
+
var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
|
|
3645
|
+
"create_edge",
|
|
3646
|
+
"query_lineage",
|
|
3647
|
+
"traverse_graph",
|
|
3648
|
+
"get_graph_neighborhood",
|
|
3649
|
+
"get_graph_structure_analysis",
|
|
3650
|
+
"find_contradictions",
|
|
3651
|
+
"flag_contradiction",
|
|
3652
|
+
"detect_confirmation_bias",
|
|
3653
|
+
"get_topic_coverage",
|
|
3654
|
+
"get_graph_gaps"
|
|
3655
|
+
];
|
|
3656
|
+
var MCP_ANALYSIS_TENANT_OPERATION_NAMES = [
|
|
3657
|
+
"analyze_topic_density",
|
|
3658
|
+
"discover_entity_connections",
|
|
3659
|
+
"trace_entity_impact"
|
|
3660
|
+
];
|
|
3661
|
+
var MCP_WORKFLOW_PLATFORM_OPERATION_NAMES = [
|
|
3662
|
+
"list_lenses",
|
|
3663
|
+
"apply_lens_to_topic",
|
|
3664
|
+
"remove_lens_from_topic",
|
|
3665
|
+
"get_ontology",
|
|
3666
|
+
"list_ontologies",
|
|
3667
|
+
"apply_ontology",
|
|
3668
|
+
"match_entity_type",
|
|
3669
|
+
"resolve_effective_ontology",
|
|
3670
|
+
"add_worktree",
|
|
3671
|
+
"activate_worktree",
|
|
3672
|
+
"list_worktrees",
|
|
3673
|
+
"list_all_worktrees",
|
|
3674
|
+
"update_worktree_targets",
|
|
3675
|
+
"update_worktree_metadata",
|
|
3676
|
+
"create_task",
|
|
3677
|
+
"list_tasks",
|
|
3678
|
+
"update_task",
|
|
3679
|
+
"complete_task"
|
|
3680
|
+
];
|
|
3681
|
+
var MCP_WORKFLOW_TENANT_OPERATION_NAMES = [
|
|
3682
|
+
"resolve_effective_ontology",
|
|
3683
|
+
"get_observation_context",
|
|
3684
|
+
"ingest_observation",
|
|
3685
|
+
"merge"
|
|
3686
|
+
];
|
|
3687
|
+
var MCP_GOVERNANCE_PLATFORM_OPERATION_NAMES = [
|
|
3688
|
+
"create_lens",
|
|
3689
|
+
"create_ontology",
|
|
3690
|
+
"update_ontology",
|
|
3691
|
+
"archive_ontology",
|
|
3692
|
+
"create_ontology_version"
|
|
3693
|
+
];
|
|
3694
|
+
var MCP_GOVERNANCE_TENANT_OPERATION_NAMES = [
|
|
3695
|
+
"create_epistemic_contract",
|
|
3696
|
+
"evaluate_contract",
|
|
3697
|
+
"get_contract_status",
|
|
3698
|
+
"publish_ontology_version",
|
|
3699
|
+
"deprecate_ontology_version",
|
|
3700
|
+
"manage_write_policy"
|
|
3701
|
+
];
|
|
3702
|
+
var MCP_AUTOMATION_OPERATION_NAMES = [
|
|
3703
|
+
"apply_auto_branching",
|
|
3704
|
+
"trigger_belief_review"
|
|
3705
|
+
];
|
|
3706
|
+
var DUPLICATE_OPERATION_NAMES = [
|
|
3707
|
+
"link_evidence"
|
|
3708
|
+
];
|
|
3709
|
+
var PLATFORM_INTERNAL_OPERATION_NAMES = [
|
|
3710
|
+
"register_session",
|
|
3711
|
+
"heartbeat_session",
|
|
3712
|
+
"end_session",
|
|
3713
|
+
"list_active_sessions",
|
|
3714
|
+
"send_agent_message",
|
|
3715
|
+
"broadcast_message",
|
|
3716
|
+
"get_agent_inbox",
|
|
3717
|
+
"claim_files",
|
|
3718
|
+
"generate_session_handoff",
|
|
3719
|
+
"record_scope_learning",
|
|
3720
|
+
"pipeline_snapshot",
|
|
3721
|
+
"seed_belief_lattice",
|
|
3722
|
+
"get_lattice_coverage",
|
|
3723
|
+
"get_code_context",
|
|
3724
|
+
"get_change_history",
|
|
3725
|
+
"get_failure_log",
|
|
3726
|
+
"record_attempt",
|
|
3727
|
+
"push",
|
|
3728
|
+
"open_pull_request",
|
|
3729
|
+
"record_judgment",
|
|
3730
|
+
"get_audit_trail"
|
|
3731
|
+
];
|
|
3732
|
+
var LEGACY_COMPAT_OPERATION_NAMES = [
|
|
3733
|
+
"discover",
|
|
3734
|
+
"add_evidence",
|
|
3735
|
+
"answer_question",
|
|
3736
|
+
"get_confidence_history"
|
|
3737
|
+
];
|
|
3738
|
+
var SDK_ONLY_OPERATION_NAMES = [
|
|
3739
|
+
"start_worktree",
|
|
3740
|
+
"update_worktree_phase",
|
|
3741
|
+
"advance_worktree_phase",
|
|
3742
|
+
"add_note_to_worktree",
|
|
3743
|
+
"link_document_to_worktree",
|
|
3744
|
+
"link_evidence_to_worktree",
|
|
3745
|
+
"link_question_to_worktree",
|
|
3746
|
+
"link_belief_to_worktree",
|
|
3747
|
+
"create_synthesized_belief",
|
|
3748
|
+
"complete_hypothesis_formation",
|
|
3749
|
+
"complete_evidence_review",
|
|
3750
|
+
"refine_worktree_belief",
|
|
3751
|
+
"trace_provenance",
|
|
3752
|
+
"get_belief_relationships",
|
|
3753
|
+
"get_belief_support_chain",
|
|
3754
|
+
"explore_connections",
|
|
3755
|
+
"get_deep_lineage",
|
|
3756
|
+
"graph_aware_search",
|
|
3757
|
+
"get_collection_conviction",
|
|
3758
|
+
"get_conviction_trend",
|
|
3759
|
+
"analyze_belief_criticality",
|
|
3760
|
+
"analyze_belief_cluster_candidates",
|
|
3761
|
+
"create_belief_conditional",
|
|
3762
|
+
"get_necessary_evidence",
|
|
3763
|
+
"analyze_reasoning_depth",
|
|
3764
|
+
"get_evidence_by_methodology",
|
|
3765
|
+
"create_evidence_task",
|
|
3766
|
+
"get_task_counts",
|
|
3767
|
+
"add_research_action",
|
|
3768
|
+
"get_predictions",
|
|
3769
|
+
"get_surprise_detection",
|
|
3770
|
+
"get_challenged_beliefs",
|
|
3771
|
+
"get_causal_chains",
|
|
3772
|
+
"get_non_consensus_beliefs",
|
|
3773
|
+
"get_beliefs_by_epistemic_status",
|
|
3774
|
+
"detect_anchoring_bias",
|
|
3775
|
+
"detect_source_concentration",
|
|
3776
|
+
"find_soft_contradictions",
|
|
3777
|
+
"find_semantic_bridges",
|
|
3778
|
+
"find_semantic_orphans"
|
|
3779
|
+
];
|
|
3780
|
+
var MCP_ONLY_INTERNAL_OPERATION_NAMES = [
|
|
3781
|
+
"begin_build_session",
|
|
3782
|
+
"evaluate_engineering_contract",
|
|
3783
|
+
"evaluate_research_contract"
|
|
3784
|
+
];
|
|
3785
|
+
var LUCERN_OPERATION_MANIFEST = {
|
|
3786
|
+
...entries(
|
|
3787
|
+
MCP_CORE_OPERATION_NAMES,
|
|
3788
|
+
"platform_public",
|
|
3789
|
+
"mcp_core",
|
|
3790
|
+
publicEverywhere,
|
|
3791
|
+
"Default conversational Lucern MCP primitive for reading, writing, and shaping the reasoning graph."
|
|
3792
|
+
),
|
|
3793
|
+
...entries(
|
|
3794
|
+
MCP_ANALYSIS_PLATFORM_OPERATION_NAMES,
|
|
3795
|
+
"platform_public",
|
|
3796
|
+
"mcp_analysis",
|
|
3797
|
+
publicEverywhere,
|
|
3798
|
+
"High-signal graph analysis operation that belongs in chat/MCP because users naturally ask for gaps, contradictions, lineage, and coverage."
|
|
3799
|
+
),
|
|
3800
|
+
...entries(
|
|
3801
|
+
MCP_ANALYSIS_TENANT_OPERATION_NAMES,
|
|
3802
|
+
"tenant_public",
|
|
3803
|
+
"mcp_analysis",
|
|
3804
|
+
publicEverywhere,
|
|
3805
|
+
"Tenant-scoped analysis operation that remains MCP-visible because agents can answer graph-quality and impact questions from chat."
|
|
3806
|
+
),
|
|
3807
|
+
...entries(
|
|
3808
|
+
MCP_WORKFLOW_PLATFORM_OPERATION_NAMES,
|
|
3809
|
+
"platform_public",
|
|
3810
|
+
"mcp_workflow",
|
|
3811
|
+
publicEverywhere,
|
|
3812
|
+
"Workflow operation expected by coding agents and human MCP users managing Lucern worktrees, tasks, lenses, and observations."
|
|
3813
|
+
),
|
|
3814
|
+
...entries(
|
|
3815
|
+
MCP_WORKFLOW_TENANT_OPERATION_NAMES,
|
|
3816
|
+
"tenant_public",
|
|
3817
|
+
"mcp_workflow",
|
|
3818
|
+
publicEverywhere,
|
|
3819
|
+
"Tenant-scoped workflow operation expected by coding agents and human MCP users managing observations and worktree lifecycle."
|
|
3820
|
+
),
|
|
3821
|
+
...entries(
|
|
3822
|
+
MCP_AUTOMATION_OPERATION_NAMES,
|
|
3823
|
+
"tenant_public",
|
|
3824
|
+
"mcp_analysis",
|
|
3825
|
+
publicEverywhere,
|
|
3826
|
+
"Tenant-scoped automation that remains MCP-visible because agents can explicitly request review or branching assistance."
|
|
3827
|
+
),
|
|
3828
|
+
...entries(
|
|
3829
|
+
MCP_GOVERNANCE_PLATFORM_OPERATION_NAMES,
|
|
3830
|
+
"platform_public",
|
|
3831
|
+
"mcp_governance",
|
|
3832
|
+
publicWithInternalMcp,
|
|
3833
|
+
"Governance/admin operation. SDK, REST, and CLI remain public, but MCP is internal by default to keep chat surfaces focused."
|
|
3834
|
+
),
|
|
3835
|
+
...entries(
|
|
3836
|
+
MCP_GOVERNANCE_TENANT_OPERATION_NAMES,
|
|
3837
|
+
"tenant_public",
|
|
3838
|
+
"mcp_governance",
|
|
3839
|
+
publicWithInternalMcp,
|
|
3840
|
+
"Governance/admin operation. SDK, REST, and CLI remain public, but MCP is internal by default to keep chat surfaces focused."
|
|
3841
|
+
),
|
|
3842
|
+
...entries(
|
|
3843
|
+
DUPLICATE_OPERATION_NAMES,
|
|
3844
|
+
"platform_public",
|
|
3845
|
+
"compatibility",
|
|
3846
|
+
publicWithoutMcp,
|
|
3847
|
+
"Duplicate compatibility operation kept for SDK/REST callers, removed from MCP/CLI discovery in favor of the canonical specific tool."
|
|
3848
|
+
),
|
|
3849
|
+
...entries(
|
|
3850
|
+
PLATFORM_INTERNAL_OPERATION_NAMES,
|
|
3851
|
+
"platform_internal",
|
|
3852
|
+
"system",
|
|
3853
|
+
internalSystem,
|
|
3854
|
+
"Lucern system/background operation. Available to platform code paths, hidden from public MCP discovery."
|
|
3855
|
+
),
|
|
3856
|
+
...entries(
|
|
3857
|
+
LEGACY_COMPAT_OPERATION_NAMES,
|
|
3858
|
+
"legacy_compat",
|
|
3859
|
+
"compatibility",
|
|
3860
|
+
publicWithoutMcp,
|
|
3861
|
+
"Temporary compatibility operation. Must name a canonical replacement before removal."
|
|
3862
|
+
),
|
|
3863
|
+
...entries(
|
|
3864
|
+
SDK_ONLY_OPERATION_NAMES,
|
|
3865
|
+
"tenant_public",
|
|
3866
|
+
"sdk_granular",
|
|
3867
|
+
sdkOnlyPublic,
|
|
3868
|
+
"Granular Lucern SDK operation. Not an MCP, REST, or CLI tool until backed by the generated function pipe."
|
|
3869
|
+
),
|
|
3870
|
+
...entries(
|
|
3871
|
+
MCP_ONLY_INTERNAL_OPERATION_NAMES,
|
|
3872
|
+
"platform_internal",
|
|
3873
|
+
"system",
|
|
3874
|
+
mcpOnlyInternal,
|
|
3875
|
+
"Lucern MCP-only platform operation for local agent/bootstrap or verification workflows. Hidden from public discovery."
|
|
3876
|
+
)
|
|
3877
|
+
};
|
|
3878
|
+
|
|
3879
|
+
// src/function-registry/helpers.ts
|
|
3880
|
+
var jsonObjectSchema = z.record(z.unknown());
|
|
3881
|
+
function mcpContractShape(contract) {
|
|
3882
|
+
const required = new Set(contract.required);
|
|
3883
|
+
return Object.fromEntries(
|
|
3884
|
+
Object.entries(contract.parameters).map(([name, parameter]) => {
|
|
3885
|
+
const schema = schemaForMcpParameter(parameter);
|
|
3886
|
+
return [
|
|
3887
|
+
name,
|
|
3888
|
+
required.has(name) || parameter.required ? schema : schema.optional()
|
|
3889
|
+
];
|
|
3890
|
+
})
|
|
3891
|
+
);
|
|
3892
|
+
}
|
|
3893
|
+
function schemaForMcpParameter(parameter) {
|
|
3894
|
+
if (parameter.enum && parameter.enum.length > 0) {
|
|
3895
|
+
const [first, ...rest] = parameter.enum;
|
|
3896
|
+
return z.enum([first, ...rest]);
|
|
3897
|
+
}
|
|
3898
|
+
switch (parameter.type) {
|
|
3899
|
+
case "array":
|
|
3900
|
+
return z.array(z.unknown());
|
|
3901
|
+
case "boolean":
|
|
3902
|
+
return z.boolean();
|
|
3903
|
+
case "number":
|
|
3904
|
+
return z.number();
|
|
3905
|
+
case "object":
|
|
3906
|
+
return z.record(z.unknown());
|
|
3907
|
+
case "string":
|
|
3908
|
+
return z.string();
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
function argsSchemaFromMcpContract(contract) {
|
|
3912
|
+
return z.object(mcpContractShape(contract));
|
|
3913
|
+
}
|
|
3914
|
+
function inputSchemaFromMcpContract(contract) {
|
|
3915
|
+
return argsSchemaFromMcpContract(contract).passthrough();
|
|
3916
|
+
}
|
|
3917
|
+
function getObjectShape(schema) {
|
|
3918
|
+
const shape = typeof schema._def.shape === "function" ? schema._def.shape() : schema._def.shape;
|
|
3919
|
+
return shape;
|
|
3920
|
+
}
|
|
3921
|
+
function unwrapMcpParameterSchema(schema) {
|
|
3922
|
+
let current = schema;
|
|
3923
|
+
let required = true;
|
|
3924
|
+
let description = schema.description;
|
|
3925
|
+
while (true) {
|
|
3926
|
+
description ??= current.description;
|
|
3927
|
+
switch (current._def.typeName) {
|
|
3928
|
+
case z.ZodFirstPartyTypeKind.ZodOptional:
|
|
3929
|
+
case z.ZodFirstPartyTypeKind.ZodDefault:
|
|
3930
|
+
required = false;
|
|
3931
|
+
current = current._def.innerType;
|
|
3932
|
+
continue;
|
|
3933
|
+
case z.ZodFirstPartyTypeKind.ZodNullable:
|
|
3934
|
+
current = current._def.innerType;
|
|
3935
|
+
continue;
|
|
3936
|
+
case z.ZodFirstPartyTypeKind.ZodBranded:
|
|
3937
|
+
current = current._def.type;
|
|
3938
|
+
continue;
|
|
3939
|
+
default:
|
|
3940
|
+
return { schema: current, required, description: description ?? current.description };
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3944
|
+
function mcpParameterFromZod(fieldName, schema, contractName) {
|
|
3945
|
+
const { schema: unwrapped, required, description: schemaDescription } = unwrapMcpParameterSchema(schema);
|
|
3946
|
+
const description = schemaDescription ?? unwrapped.description ?? fieldName;
|
|
3947
|
+
switch (unwrapped._def.typeName) {
|
|
3948
|
+
case z.ZodFirstPartyTypeKind.ZodString:
|
|
3949
|
+
return { parameter: { type: "string", description }, required };
|
|
3950
|
+
case z.ZodFirstPartyTypeKind.ZodNumber:
|
|
3951
|
+
return { parameter: { type: "number", description }, required };
|
|
3952
|
+
case z.ZodFirstPartyTypeKind.ZodBoolean:
|
|
3953
|
+
return { parameter: { type: "boolean", description }, required };
|
|
3954
|
+
case z.ZodFirstPartyTypeKind.ZodArray:
|
|
3955
|
+
return { parameter: { type: "array", description }, required };
|
|
3956
|
+
case z.ZodFirstPartyTypeKind.ZodObject:
|
|
3957
|
+
case z.ZodFirstPartyTypeKind.ZodRecord:
|
|
3958
|
+
return { parameter: { type: "object", description }, required };
|
|
3959
|
+
case z.ZodFirstPartyTypeKind.ZodEnum:
|
|
3960
|
+
return {
|
|
3961
|
+
parameter: {
|
|
3962
|
+
type: "string",
|
|
3963
|
+
description,
|
|
3964
|
+
enum: [...unwrapped._def.values]
|
|
3965
|
+
},
|
|
3966
|
+
required
|
|
3967
|
+
};
|
|
3968
|
+
case z.ZodFirstPartyTypeKind.ZodLiteral:
|
|
3969
|
+
if (typeof unwrapped._def.value === "string") {
|
|
3970
|
+
return {
|
|
3971
|
+
parameter: {
|
|
3972
|
+
type: "string",
|
|
3973
|
+
description,
|
|
3974
|
+
enum: [unwrapped._def.value]
|
|
3975
|
+
},
|
|
3976
|
+
required
|
|
3977
|
+
};
|
|
3978
|
+
}
|
|
3979
|
+
break;
|
|
3980
|
+
}
|
|
3981
|
+
throw new Error(
|
|
3982
|
+
`Function surface contract ${contractName}.${fieldName} cannot be lowered to an MCP parameter from ${unwrapped._def.typeName}.`
|
|
3983
|
+
);
|
|
3984
|
+
}
|
|
3985
|
+
function mcpContractFromArgsSchema(base, args, contractName) {
|
|
3986
|
+
const entries2 = Object.entries(getObjectShape(args)).sort(
|
|
3987
|
+
([left], [right]) => left.localeCompare(right)
|
|
3988
|
+
);
|
|
3989
|
+
const converted = entries2.map(([fieldName, schema]) => [
|
|
3990
|
+
fieldName,
|
|
3991
|
+
mcpParameterFromZod(fieldName, schema, contractName)
|
|
3992
|
+
]);
|
|
3993
|
+
return {
|
|
3994
|
+
...base,
|
|
3995
|
+
parameters: Object.fromEntries(
|
|
3996
|
+
converted.map(([fieldName, field]) => [fieldName, field.parameter])
|
|
3997
|
+
),
|
|
3998
|
+
required: converted.filter(([, field]) => field.required).map(([fieldName]) => fieldName)
|
|
3999
|
+
};
|
|
4000
|
+
}
|
|
4001
|
+
function defineFunctionContract(contract) {
|
|
4002
|
+
return contract;
|
|
4003
|
+
}
|
|
4004
|
+
function classifyContract(contract, surfaceClass) {
|
|
4005
|
+
return {
|
|
4006
|
+
...contract,
|
|
4007
|
+
surfaceClass: contract.surfaceClass ?? surfaceClass
|
|
4008
|
+
};
|
|
4009
|
+
}
|
|
4010
|
+
function authUserId(context) {
|
|
4011
|
+
return context.userId ?? context.principalId ?? "lucern-agent";
|
|
4012
|
+
}
|
|
4013
|
+
function withUserId(input, context) {
|
|
4014
|
+
return {
|
|
4015
|
+
...input,
|
|
4016
|
+
userId: typeof input.userId === "string" ? input.userId : authUserId(context)
|
|
4017
|
+
};
|
|
4018
|
+
}
|
|
4019
|
+
function withCreatedBy(input, context) {
|
|
4020
|
+
return {
|
|
4021
|
+
...input,
|
|
4022
|
+
createdBy: typeof input.createdBy === "string" ? input.createdBy : authUserId(context)
|
|
4023
|
+
};
|
|
4024
|
+
}
|
|
4025
|
+
function surfaceMcpContract(name) {
|
|
4026
|
+
const contract = MCP_TOOL_CONTRACTS[name];
|
|
4027
|
+
if (!contract) {
|
|
4028
|
+
throw new Error(
|
|
4029
|
+
`Function surface contract ${name} is missing from MCP_TOOL_CONTRACTS.`
|
|
4030
|
+
);
|
|
4031
|
+
}
|
|
4032
|
+
return {
|
|
4033
|
+
...contract,
|
|
4034
|
+
exposed: true,
|
|
4035
|
+
toolName: contract.name
|
|
4036
|
+
};
|
|
4037
|
+
}
|
|
4038
|
+
function deriveFunctionEffects(args) {
|
|
4039
|
+
if (args.kind === "query") {
|
|
4040
|
+
return ["read"];
|
|
4041
|
+
}
|
|
4042
|
+
if (args.surfaceIntent === "system" || args.surfaceIntent === "mcp_governance" || args.domain === "identity" || args.domain === "contracts" || args.domain === "coordination" || args.domain === "pipeline") {
|
|
4043
|
+
return ["admin"];
|
|
4044
|
+
}
|
|
4045
|
+
return ["write"];
|
|
4046
|
+
}
|
|
4047
|
+
function surfaceContract(args) {
|
|
4048
|
+
const manifest = LUCERN_OPERATION_MANIFEST;
|
|
4049
|
+
const manifestEntry = manifest[args.name];
|
|
4050
|
+
if (!manifestEntry) {
|
|
4051
|
+
throw new Error(
|
|
4052
|
+
`Function surface contract ${args.name} is not in LUCERN_OPERATION_MANIFEST.`
|
|
4053
|
+
);
|
|
4054
|
+
}
|
|
4055
|
+
if (manifestEntry.surfaceClass !== args.surfaceClass) {
|
|
4056
|
+
throw new Error(
|
|
4057
|
+
`Function surface contract ${args.name} is classified as ${args.surfaceClass}, but manifest requires ${manifestEntry.surfaceClass}.`
|
|
4058
|
+
);
|
|
4059
|
+
}
|
|
4060
|
+
if (manifestEntry.surfaces.sdk === "none" && manifestEntry.surfaces.rest === "none") {
|
|
4061
|
+
throw new Error(
|
|
4062
|
+
`Function surface contract ${args.name} has no SDK or REST exposure in the manifest.`
|
|
4063
|
+
);
|
|
4064
|
+
}
|
|
4065
|
+
const baseMcp = surfaceMcpContract(args.name);
|
|
4066
|
+
const canonicalArgs = args.args ?? argsSchemaFromMcpContract(baseMcp);
|
|
4067
|
+
const mcp = args.args ? mcpContractFromArgsSchema(baseMcp, canonicalArgs, args.name) : baseMcp;
|
|
4068
|
+
const canonicalReturns = args.returns ?? jsonObjectSchema;
|
|
4069
|
+
const input = args.input ?? inputSchemaFromMcpContract(mcp);
|
|
4070
|
+
const output = args.output ?? canonicalReturns;
|
|
4071
|
+
return defineFunctionContract({
|
|
4072
|
+
name: args.name,
|
|
4073
|
+
kind: args.kind,
|
|
4074
|
+
idempotent: args.idempotent ?? (args.kind === "query" ? false : true),
|
|
4075
|
+
effects: args.effects ?? deriveFunctionEffects({
|
|
4076
|
+
kind: args.kind,
|
|
4077
|
+
domain: args.domain,
|
|
4078
|
+
surfaceIntent: manifestEntry.surfaceIntent
|
|
4079
|
+
}),
|
|
4080
|
+
invariants: args.invariants,
|
|
4081
|
+
surfaceIntent: manifestEntry.surfaceIntent,
|
|
4082
|
+
domain: args.domain,
|
|
4083
|
+
surfaceClass: manifestEntry.surfaceClass,
|
|
4084
|
+
surfaces: manifestEntry.surfaces,
|
|
4085
|
+
replacedBy: args.replacedBy,
|
|
4086
|
+
rest: {
|
|
4087
|
+
method: args.method ?? "POST",
|
|
4088
|
+
path: args.path
|
|
4089
|
+
},
|
|
4090
|
+
sdk: {
|
|
4091
|
+
namespace: args.sdkNamespace,
|
|
4092
|
+
method: args.sdkMethod
|
|
4093
|
+
},
|
|
4094
|
+
mcp,
|
|
4095
|
+
auth: {
|
|
4096
|
+
scopes: args.scopes ?? [
|
|
4097
|
+
args.kind === "query" ? `${args.domain}.read` : `${args.domain}.write`
|
|
4098
|
+
],
|
|
4099
|
+
allowedPrincipalTypes: ["user", "service", "agent"]
|
|
4100
|
+
},
|
|
4101
|
+
convex: args.convex,
|
|
4102
|
+
args: canonicalArgs,
|
|
4103
|
+
returns: canonicalReturns,
|
|
4104
|
+
input,
|
|
4105
|
+
output,
|
|
4106
|
+
openapi: {
|
|
4107
|
+
summary: args.summary,
|
|
4108
|
+
tags: args.tags ?? [args.domain]
|
|
4109
|
+
}
|
|
4110
|
+
});
|
|
4111
|
+
}
|
|
4112
|
+
function assertSurfaceCoverage(contracts) {
|
|
4113
|
+
const names = /* @__PURE__ */ new Set();
|
|
4114
|
+
for (const contract of contracts) {
|
|
4115
|
+
if (names.has(contract.name)) {
|
|
4116
|
+
throw new Error(`Duplicate function contract name: ${contract.name}`);
|
|
4117
|
+
}
|
|
4118
|
+
names.add(contract.name);
|
|
4119
|
+
}
|
|
4120
|
+
for (const contract of contracts) {
|
|
4121
|
+
if (contract.replacedBy && !names.has(contract.replacedBy)) {
|
|
4122
|
+
throw new Error(
|
|
4123
|
+
`Function contract ${contract.name} replacedBy target ${contract.replacedBy} is not registered.`
|
|
4124
|
+
);
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
export { argsSchemaFromMcpContract, assertSurfaceCoverage, authUserId, classifyContract, defineFunctionContract, inputSchemaFromMcpContract, jsonObjectSchema, surfaceContract, surfaceMcpContract, withCreatedBy, withUserId };
|
|
4130
|
+
//# sourceMappingURL=helpers.js.map
|
|
4131
|
+
//# sourceMappingURL=helpers.js.map
|