@lucern/contracts 1.0.16 → 1.0.17
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/CHANGELOG.md +3 -0
- package/dist/api-enums.contract.d.ts +2 -2
- package/dist/api-enums.contract.js +2 -8
- package/dist/api-enums.contract.js.map +1 -1
- package/dist/context-pack.contract.d.ts +27 -7
- package/dist/context-pack.contract.js.map +1 -1
- package/dist/function-registry/beliefs.js +109 -115
- package/dist/function-registry/beliefs.js.map +1 -1
- package/dist/function-registry/coding.js +68 -91
- package/dist/function-registry/coding.js.map +1 -1
- package/dist/function-registry/context.js +68 -91
- package/dist/function-registry/context.js.map +1 -1
- package/dist/function-registry/contracts.js +68 -91
- package/dist/function-registry/contracts.js.map +1 -1
- package/dist/function-registry/coordination.js +68 -91
- package/dist/function-registry/coordination.js.map +1 -1
- package/dist/function-registry/edges.js +68 -91
- package/dist/function-registry/edges.js.map +1 -1
- package/dist/function-registry/evidence.js +182 -125
- package/dist/function-registry/evidence.js.map +1 -1
- package/dist/function-registry/graph.js +68 -91
- package/dist/function-registry/graph.js.map +1 -1
- package/dist/function-registry/helpers.js +68 -91
- package/dist/function-registry/helpers.js.map +1 -1
- package/dist/function-registry/identity.js +68 -91
- package/dist/function-registry/identity.js.map +1 -1
- package/dist/function-registry/index.js +68 -91
- package/dist/function-registry/index.js.map +1 -1
- package/dist/function-registry/judgments.js +68 -91
- package/dist/function-registry/judgments.js.map +1 -1
- package/dist/function-registry/legacy.js +68 -91
- package/dist/function-registry/legacy.js.map +1 -1
- package/dist/function-registry/lenses.js +68 -91
- package/dist/function-registry/lenses.js.map +1 -1
- package/dist/function-registry/manifest.d.ts +3 -3
- package/dist/function-registry/manifest.js +3 -3
- package/dist/function-registry/manifest.js.map +1 -1
- package/dist/function-registry/nodes.js +68 -91
- package/dist/function-registry/nodes.js.map +1 -1
- package/dist/function-registry/ontologies.js +68 -91
- package/dist/function-registry/ontologies.js.map +1 -1
- package/dist/function-registry/pipeline.js +68 -91
- package/dist/function-registry/pipeline.js.map +1 -1
- package/dist/function-registry/questions.js +68 -91
- package/dist/function-registry/questions.js.map +1 -1
- package/dist/function-registry/tasks.js +68 -91
- package/dist/function-registry/tasks.js.map +1 -1
- package/dist/function-registry/topics.js +68 -91
- package/dist/function-registry/topics.js.map +1 -1
- package/dist/function-registry/worktrees.js +68 -91
- package/dist/function-registry/worktrees.js.map +1 -1
- package/dist/generated/convexSchemas.js +2 -2
- package/dist/generated/convexSchemas.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +162 -130
- package/dist/index.js.map +1 -1
- package/dist/manifests/invariant-manifest.d.ts +1 -1
- package/dist/manifests/invariants/index.d.ts +1 -1
- package/dist/manifests/invariants/index.js +1 -1
- package/dist/manifests/invariants/index.js.map +1 -1
- package/dist/manifests/invariants/inv-1-beliefs-append-only.d.ts +1 -1
- package/dist/manifests/invariants/inv-14-no-silent-transitions.d.ts +1 -1
- package/dist/manifests/invariants/manifest-1-projections-declare-audit.d.ts +1 -1
- package/dist/manifests/invariants/manifest-1-projections-declare-audit.js +1 -1
- package/dist/manifests/invariants/manifest-1-projections-declare-audit.js.map +1 -1
- package/dist/projections/{modulate-confidence.projection.d.ts → append-sl-scoring.projection.d.ts} +69 -69
- package/dist/projections/{modulate-confidence.projection.js → append-sl-scoring.projection.js} +14 -14
- package/dist/projections/append-sl-scoring.projection.js.map +1 -0
- package/dist/projections/check-convex-args-shape.js +88 -29
- package/dist/projections/check-convex-args-shape.js.map +1 -1
- package/dist/projections/create-evidence.projection.js +76 -17
- package/dist/projections/create-evidence.projection.js.map +1 -1
- package/dist/projections/index.d.ts +47 -47
- package/dist/projections/index.js +88 -29
- package/dist/projections/index.js.map +1 -1
- package/dist/proof-attestation.json +3 -3
- package/dist/schemas/index.js +6 -4
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/manifest.d.ts +110 -60
- package/dist/schemas/manifest.js +6 -4
- package/dist/schemas/manifest.js.map +1 -1
- package/dist/schemas/tables/kernel/intelligence.d.ts +20 -10
- package/dist/schemas/tables/kernel/intelligence.js +4 -2
- package/dist/schemas/tables/kernel/intelligence.js.map +1 -1
- package/dist/schemas/tables/kernel/spine.d.ts +2 -2
- package/dist/schemas/tables/kernel/spine.js +2 -2
- package/dist/schemas/tables/kernel/spine.js.map +1 -1
- package/dist/schemas.values.js +6 -4
- package/dist/schemas.values.js.map +1 -1
- package/dist/sdk-methods.contract.d.ts +6 -16
- package/dist/sdk-tools.contract.js +65 -88
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/sdk-tools.contract.registry.js +65 -88
- package/dist/sdk-tools.contract.registry.js.map +1 -1
- package/dist/sdk-tools.contract.values.js +65 -88
- package/dist/sdk-tools.contract.values.js.map +1 -1
- package/dist/tool-contracts.d.ts +1 -1
- package/dist/tool-contracts.graph.js +3 -3
- package/dist/tool-contracts.graph.js.map +1 -1
- package/dist/tool-contracts.intelligence-evidence.js +7 -7
- package/dist/tool-contracts.intelligence-evidence.js.map +1 -1
- package/dist/tool-contracts.js +66 -89
- package/dist/tool-contracts.js.map +1 -1
- package/dist/tool-contracts.lifecycle.d.ts +2 -2
- package/dist/tool-contracts.lifecycle.js +49 -68
- package/dist/tool-contracts.lifecycle.js.map +1 -1
- package/dist/tool-contracts.pipeline-coordination.js +1 -1
- package/dist/tool-contracts.pipeline-coordination.js.map +1 -1
- package/dist/tool-contracts.questions-listing.js +5 -9
- package/dist/tool-contracts.questions-listing.js.map +1 -1
- package/dist/{tool-contracts.values-BhxfrXS5.d.ts → tool-contracts.values-CCoI3qQY.d.ts} +3 -3
- package/dist/tool-contracts.values.d.ts +1 -1
- package/dist/tool-contracts.values.js +66 -89
- package/dist/tool-contracts.values.js.map +1 -1
- package/package.json +1 -1
- package/dist/projections/modulate-confidence.projection.js.map +0 -1
|
@@ -3,11 +3,11 @@ import { McpToolContract } from './tool-contracts.types.js';
|
|
|
3
3
|
declare const CREATE_BELIEF: McpToolContract;
|
|
4
4
|
declare const GET_BELIEF: McpToolContract;
|
|
5
5
|
declare const REFINE_BELIEF: McpToolContract;
|
|
6
|
-
declare const
|
|
6
|
+
declare const APPEND_SL_SCORING: McpToolContract;
|
|
7
7
|
declare const FORK_BELIEF: McpToolContract;
|
|
8
8
|
declare const ARCHIVE_BELIEF: McpToolContract;
|
|
9
9
|
declare const CREATE_EPISTEMIC_CONTRACT: McpToolContract;
|
|
10
10
|
declare const ADD_EVIDENCE: McpToolContract;
|
|
11
11
|
declare const FLAG_CONTRADICTION: McpToolContract;
|
|
12
12
|
|
|
13
|
-
export { ADD_EVIDENCE, ARCHIVE_BELIEF, CREATE_BELIEF, CREATE_EPISTEMIC_CONTRACT, FLAG_CONTRADICTION, FORK_BELIEF, GET_BELIEF,
|
|
13
|
+
export { ADD_EVIDENCE, APPEND_SL_SCORING, ARCHIVE_BELIEF, CREATE_BELIEF, CREATE_EPISTEMIC_CONTRACT, FLAG_CONTRADICTION, FORK_BELIEF, GET_BELIEF, REFINE_BELIEF };
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
// src/tool-contracts.lifecycle.ts
|
|
2
2
|
var CREATE_BELIEF = {
|
|
3
3
|
name: "create_belief",
|
|
4
|
-
description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; attach supporting or contradicting evidence with create_evidence or link_evidence_to_belief to record evidential updates.",
|
|
4
|
+
description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation requires a topic epistemic-node anchor and writes a `scoped_by` edge directly from belief node to topic node; orphan beliefs are invalid. Creation stores the vacuous opinion `(0, 0, 1, a)`; attach supporting or contradicting evidence with create_evidence or link_evidence_to_belief to record evidential updates.",
|
|
5
5
|
parameters: {
|
|
6
6
|
canonicalText: {
|
|
7
7
|
type: "string",
|
|
8
8
|
description: "The belief statement \u2014 what the agent holds to be true"
|
|
9
9
|
},
|
|
10
|
+
topicGlobalId: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Required globalId (UUID) of the topic node in epistemicNodes that anchors the belief"
|
|
13
|
+
},
|
|
14
|
+
topicNodeId: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "Optional internal epistemicNodes _id for the topic anchor. Prefer topicGlobalId for public callers."
|
|
17
|
+
},
|
|
10
18
|
topicId: {
|
|
11
19
|
type: "string",
|
|
12
|
-
description: "
|
|
20
|
+
description: "Deprecated compatibility alias for topicGlobalId. Must identify a topic epistemicNode, not a legacy topics-table row."
|
|
13
21
|
},
|
|
14
22
|
baseRate: {
|
|
15
23
|
type: "number",
|
|
@@ -24,7 +32,7 @@ var CREATE_BELIEF = {
|
|
|
24
32
|
description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)"
|
|
25
33
|
}
|
|
26
34
|
},
|
|
27
|
-
required: ["canonicalText"],
|
|
35
|
+
required: ["canonicalText", "topicGlobalId"],
|
|
28
36
|
response: {
|
|
29
37
|
description: "The created canonical belief record",
|
|
30
38
|
fields: {
|
|
@@ -33,7 +41,7 @@ var CREATE_BELIEF = {
|
|
|
33
41
|
beliefId: "string \u2014 canonical belief ID",
|
|
34
42
|
text: "string \u2014 canonical belief formulation",
|
|
35
43
|
topicId: "string",
|
|
36
|
-
|
|
44
|
+
beliefStatus: "string \u2014 assumption | hypothesis | active | superseded | resolved_true | resolved_false",
|
|
37
45
|
scoringState: "string \u2014 unscored | scored"
|
|
38
46
|
}
|
|
39
47
|
},
|
|
@@ -56,7 +64,7 @@ var GET_BELIEF = {
|
|
|
56
64
|
beliefId: "string \u2014 canonical belief ID",
|
|
57
65
|
text: "string \u2014 canonical belief formulation",
|
|
58
66
|
topicId: "string",
|
|
59
|
-
|
|
67
|
+
beliefStatus: "string \u2014 assumption | hypothesis | active | superseded | resolved_true | resolved_false",
|
|
60
68
|
scoringState: "string \u2014 unscored | scored"
|
|
61
69
|
}
|
|
62
70
|
},
|
|
@@ -85,34 +93,24 @@ var REFINE_BELIEF = {
|
|
|
85
93
|
ontologyPrimitive: "belief",
|
|
86
94
|
tier: "showcase"
|
|
87
95
|
};
|
|
88
|
-
var
|
|
89
|
-
name: "
|
|
90
|
-
description: "Internal
|
|
96
|
+
var APPEND_SL_SCORING = {
|
|
97
|
+
name: "append_sl_scoring",
|
|
98
|
+
description: "Internal evidence-backed Subjective Logic scoring append. This is not a public MCP tool: callers should attach supporting or contradicting evidence, and governed system paths append the derived SL tuple.",
|
|
91
99
|
parameters: {
|
|
92
|
-
nodeId: { type: "string", description: "The belief
|
|
93
|
-
belief: {
|
|
94
|
-
type: "number",
|
|
95
|
-
description: "Subjective-logic belief mass `b` in [0, 1]"
|
|
96
|
-
},
|
|
100
|
+
nodeId: { type: "string", description: "The belief receiving the SL score" },
|
|
101
|
+
belief: { type: "number", description: "Subjective Logic belief mass b" },
|
|
97
102
|
disbelief: {
|
|
98
103
|
type: "number",
|
|
99
|
-
description: "Subjective
|
|
104
|
+
description: "Subjective Logic disbelief mass d"
|
|
100
105
|
},
|
|
101
106
|
uncertainty: {
|
|
102
107
|
type: "number",
|
|
103
|
-
description: "Subjective
|
|
104
|
-
},
|
|
105
|
-
baseRate: {
|
|
106
|
-
type: "number",
|
|
107
|
-
description: "Subjective-logic base rate `a` in [0, 1]. Required for tuple payloads."
|
|
108
|
-
},
|
|
109
|
-
worktreeId: {
|
|
110
|
-
type: "string",
|
|
111
|
-
description: "Completed worktree that tested this belief when confidence policy requires merge-backed scoring."
|
|
108
|
+
description: "Subjective Logic uncertainty mass u"
|
|
112
109
|
},
|
|
110
|
+
baseRate: { type: "number", description: "Subjective Logic base rate a" },
|
|
113
111
|
trigger: {
|
|
114
112
|
type: "string",
|
|
115
|
-
description: "
|
|
113
|
+
description: "Evidence-bearing cause of the scoring event",
|
|
116
114
|
enum: [
|
|
117
115
|
"evidence_added",
|
|
118
116
|
"evidence_removed",
|
|
@@ -123,64 +121,39 @@ var MODULATE_CONFIDENCE = {
|
|
|
123
121
|
"worktree_completed",
|
|
124
122
|
"fusion",
|
|
125
123
|
"discount",
|
|
126
|
-
"deduction"
|
|
124
|
+
"deduction",
|
|
125
|
+
"backfill_synthetic"
|
|
127
126
|
]
|
|
128
127
|
},
|
|
129
|
-
|
|
130
|
-
type: "
|
|
131
|
-
description: "
|
|
132
|
-
},
|
|
133
|
-
triggeringQuestionId: {
|
|
134
|
-
type: "string",
|
|
135
|
-
description: "Answered question whose resolution supports this modulation"
|
|
136
|
-
},
|
|
137
|
-
triggeringAnswerId: {
|
|
138
|
-
type: "string",
|
|
139
|
-
description: "Answer node whose content supports this modulation"
|
|
140
|
-
},
|
|
141
|
-
triggeringContradictionId: {
|
|
142
|
-
type: "string",
|
|
143
|
-
description: "Contradiction record that caused a contradiction-triggered modulation"
|
|
144
|
-
},
|
|
145
|
-
triggeringWorktreeId: {
|
|
146
|
-
type: "string",
|
|
147
|
-
description: "Completed worktree whose outcome caused a worktree-triggered modulation"
|
|
128
|
+
provenance: {
|
|
129
|
+
type: "object",
|
|
130
|
+
description: "At least one of evidence, question, answer, contradiction, or worktree."
|
|
148
131
|
},
|
|
149
132
|
rationale: {
|
|
150
133
|
type: "string",
|
|
151
|
-
description: "
|
|
134
|
+
description: "Why this evidence-bearing event moved the SL tuple"
|
|
152
135
|
}
|
|
153
136
|
},
|
|
154
|
-
required: [
|
|
155
|
-
"nodeId",
|
|
156
|
-
"belief",
|
|
157
|
-
"disbelief",
|
|
158
|
-
"uncertainty",
|
|
159
|
-
"baseRate",
|
|
160
|
-
"trigger",
|
|
161
|
-
"rationale"
|
|
162
|
-
],
|
|
137
|
+
required: ["nodeId", "belief", "disbelief", "uncertainty", "baseRate", "trigger", "rationale"],
|
|
163
138
|
response: {
|
|
164
|
-
description: "
|
|
139
|
+
description: "Internal SL scoring append receipt",
|
|
165
140
|
fields: {
|
|
166
|
-
|
|
167
|
-
nodeId: "string \u2014 canonical belief ID",
|
|
168
|
-
newConfidence: "number",
|
|
141
|
+
nodeId: "string",
|
|
169
142
|
previousConfidence: "number",
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
propagationSummary: "object \u2014 bounded inline cascade summary with totalCandidateTargets, inlineTargets, and remainingTargetCount"
|
|
143
|
+
newConfidence: "number",
|
|
144
|
+
beliefConfidenceId: "string"
|
|
173
145
|
}
|
|
174
146
|
},
|
|
175
147
|
ownerModule: "graph-primitives",
|
|
176
148
|
ontologyPrimitive: "belief",
|
|
177
|
-
tier: "
|
|
149
|
+
tier: "workhorse",
|
|
150
|
+
internal: true
|
|
178
151
|
};
|
|
179
152
|
var FORK_BELIEF = {
|
|
180
153
|
name: "fork_belief",
|
|
181
|
-
description: "Branch off
|
|
154
|
+
description: "Branch off an evidence-bearing belief to create a new formulation. Like `git fork` \u2014 the parent remains immutable with full history, and every fork must cite evidence already attached to the parent through SL scoring. `forkMode=supersede` marks the parent superseded and requires contradicting evidence; `forkMode=branch` preserves the parent and creates a derived child.",
|
|
182
155
|
parameters: {
|
|
183
|
-
nodeId: { type: "string", description: "The
|
|
156
|
+
nodeId: { type: "string", description: "The belief to fork from" },
|
|
184
157
|
newFormulation: {
|
|
185
158
|
type: "string",
|
|
186
159
|
description: "The evolved belief statement"
|
|
@@ -192,12 +165,20 @@ var FORK_BELIEF = {
|
|
|
192
165
|
"refinement",
|
|
193
166
|
"contradiction_response",
|
|
194
167
|
"scope_change",
|
|
195
|
-
"confidence_collapse"
|
|
196
|
-
"manual"
|
|
168
|
+
"confidence_collapse"
|
|
197
169
|
]
|
|
170
|
+
},
|
|
171
|
+
forkMode: {
|
|
172
|
+
type: "string",
|
|
173
|
+
description: "supersede replaces the parent; branch creates a child while preserving the parent.",
|
|
174
|
+
enum: ["supersede", "branch"]
|
|
175
|
+
},
|
|
176
|
+
triggeringEvidenceId: {
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "Evidence already attached to the parent belief that caused the fork."
|
|
198
179
|
}
|
|
199
180
|
},
|
|
200
|
-
required: ["nodeId", "newFormulation", "forkReason"],
|
|
181
|
+
required: ["nodeId", "newFormulation", "forkReason", "triggeringEvidenceId"],
|
|
201
182
|
response: {
|
|
202
183
|
description: "The forked canonical belief record",
|
|
203
184
|
fields: {
|
|
@@ -405,6 +386,6 @@ var FLAG_CONTRADICTION = {
|
|
|
405
386
|
tier: "showcase"
|
|
406
387
|
};
|
|
407
388
|
|
|
408
|
-
export { ADD_EVIDENCE, ARCHIVE_BELIEF, CREATE_BELIEF, CREATE_EPISTEMIC_CONTRACT, FLAG_CONTRADICTION, FORK_BELIEF, GET_BELIEF,
|
|
389
|
+
export { ADD_EVIDENCE, APPEND_SL_SCORING, ARCHIVE_BELIEF, CREATE_BELIEF, CREATE_EPISTEMIC_CONTRACT, FLAG_CONTRADICTION, FORK_BELIEF, GET_BELIEF, REFINE_BELIEF };
|
|
409
390
|
//# sourceMappingURL=tool-contracts.lifecycle.js.map
|
|
410
391
|
//# sourceMappingURL=tool-contracts.lifecycle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tool-contracts.lifecycle.ts"],"names":[],"mappings":";AAEO,IAAM,aAAA,GAAiC;AAAA,EAC5C,IAAA,EAAM,eAAA;AAAA,EACN,WAAA,EACE,iUAAA;AAAA,EAGF,UAAA,EAAY;AAAA,IACV,aAAA,EAAe;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE;AAAA,KACJ;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE;AAAA,KACJ;AAAA,IACA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE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A,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,WAAA,EAAa,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA,EAA4B;AAAA,IACxE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa,kCAAA;AAAA,MACb,IAAA,EAAM,CAAC,KAAA,EAAO,QAAA,EAAU,QAAQ,UAAU;AAAA,KAC5C;AAAA,IACA,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA,EAA4B;AAAA,IACpE,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE,wIAAA;AAAA,MACF,IAAA,EAAM,CAAC,QAAA,EAAU,WAAA,EAAa,YAAY;AAAA;AAC5C,GACF;AAAA,EACA,QAAA,EAAU,CAAC,SAAA,EAAW,SAAA,EAAW,aAAa,CAAA;AAAA,EAC9C,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,kCAAA;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,eAAA,EAAiB,QAAA;AAAA,MACjB,MAAA,EAAQ,4BAAA;AAAA,MACR,OAAA,EAAS,QAAA;AAAA,MACT,OAAA,EAAS;AAAA;AACX,GACF;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,QAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.lifecycle.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const CREATE_BELIEF: McpToolContract = {\n name: \"create_belief\",\n description:\n \"Commit a new belief (knowledge unit) to the reasoning graph. \" +\n \"Like `git commit` — creates an atomic, traceable knowledge object with a prior. \" +\n \"Creation stores the vacuous opinion `(0, 0, 1, a)`; attach supporting or contradicting evidence with create_evidence or link_evidence_to_belief to record evidential updates.\",\n parameters: {\n canonicalText: {\n type: \"string\",\n description: \"The belief statement — what the agent holds to be true\",\n },\n topicId: {\n type: \"string\",\n description: \"Optional topic scope hint for the belief\",\n },\n baseRate: {\n type: \"number\",\n description:\n \"Prior probability used to seed the vacuous opinion `(0, 0, 1, a)` at creation time. Defaults to 0.5 when omitted.\",\n },\n beliefType: {\n type: \"string\",\n description:\n \"Belief type (e.g., hypothesis, belief, principle, invariant, tenet, forecast). Validated against schemaEnumConfig.\",\n },\n metadata: {\n type: \"object\",\n description:\n \"Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)\",\n },\n },\n required: [\"canonicalText\"],\n response: {\n description: \"The created canonical belief record\",\n fields: {\n id: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n beliefId: \"string — canonical belief ID\",\n text: \"string — canonical belief formulation\",\n topicId: \"string\",\n status: \"string — active | superseded | archived\",\n scoringState: \"string — unscored | scored\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const GET_BELIEF: McpToolContract = {\n name: \"get_belief\",\n description:\n \"Read one belief by ID. \" +\n \"Like `git show` — resolves the canonical belief payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical belief ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical belief record\",\n fields: {\n id: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n beliefId: \"string — canonical belief ID\",\n text: \"string — canonical belief formulation\",\n topicId: \"string\",\n status: \"string — active | superseded | archived\",\n scoringState: \"string — unscored | scored\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const REFINE_BELIEF: McpToolContract = {\n name: \"refine_belief\",\n description:\n \"Amend a draft belief in-place within an active worktree. \" +\n \"Like `git commit --amend` — rewrites the last commit on a feature branch. \" +\n \"Only valid before merge to main. Fails if the belief is already scored.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to refine\" },\n canonicalText: { type: \"string\", description: \"Updated belief statement\" },\n rationale: { type: \"string\", description: \"Why the refinement was made\" },\n },\n required: [\"nodeId\", \"canonicalText\"],\n response: {\n description: \"The updated belief node\",\n fields: {\n nodeId: \"string\",\n canonicalText: \"string — updated text\",\n updatedAt: \"number — timestamp\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const MODULATE_CONFIDENCE: McpToolContract = {\n name: \"modulate_confidence\",\n description:\n \"Internal-only subjective-logic ledger append. \" +\n \"Like `git commit` to the credence log for the scoring engine — never an operator-facing way to assert confidence. \" +\n \"Agents, SDK callers, CLI users, and MCP clients must instead create or link evidence with `evidenceRelation: supports|contradicts`; the kernel derives the next opinion from that evidence. \" +\n \"This compatibility primitive is reserved for governed system scoring paths that already hold a full subjective-logic tuple and truth-bearing provenance.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to score\" },\n belief: {\n type: \"number\",\n description: \"Subjective-logic belief mass `b` in [0, 1]\",\n },\n disbelief: {\n type: \"number\",\n description: \"Subjective-logic disbelief mass `d` in [0, 1]\",\n },\n uncertainty: {\n type: \"number\",\n description: \"Subjective-logic uncertainty mass `u` in [0, 1]\",\n },\n baseRate: {\n type: \"number\",\n description:\n \"Subjective-logic base rate `a` in [0, 1]. Required for tuple payloads.\",\n },\n worktreeId: {\n type: \"string\",\n description:\n \"Completed worktree that tested this belief when confidence policy requires merge-backed scoring.\",\n },\n trigger: {\n type: \"string\",\n description: \"What caused this confidence change\",\n enum: [\n \"evidence_added\",\n \"evidence_removed\",\n \"contradiction_detected\",\n \"contradiction_resolved\",\n \"agent_assessment\",\n \"worktree_outcome\",\n \"worktree_completed\",\n \"fusion\",\n \"discount\",\n \"deduction\",\n ],\n },\n triggeringEvidenceId: {\n type: \"string\",\n description: \"Evidence node that caused an evidence-triggered modulation\",\n },\n triggeringQuestionId: {\n type: \"string\",\n description: \"Answered question whose resolution supports this modulation\",\n },\n triggeringAnswerId: {\n type: \"string\",\n description: \"Answer node whose content supports this modulation\",\n },\n triggeringContradictionId: {\n type: \"string\",\n description:\n \"Contradiction record that caused a contradiction-triggered modulation\",\n },\n triggeringWorktreeId: {\n type: \"string\",\n description:\n \"Completed worktree whose outcome caused a worktree-triggered modulation\",\n },\n rationale: {\n type: \"string\",\n description: \"Human-readable explanation of why confidence changed\",\n },\n },\n required: [\n \"nodeId\",\n \"belief\",\n \"disbelief\",\n \"uncertainty\",\n \"baseRate\",\n \"trigger\",\n \"rationale\",\n ],\n response: {\n description: \"Confidence modulation result\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n newConfidence: \"number\",\n previousConfidence: \"number\",\n trigger: \"string\",\n requestId: \"string — request identifier for the scheduled cascade\",\n propagationSummary:\n \"object — bounded inline cascade summary with totalCandidateTargets, inlineTargets, and remainingTargetCount\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const FORK_BELIEF: McpToolContract = {\n name: \"fork_belief\",\n description:\n \"Branch off a scored belief to create a new version with a different formulation. \" +\n \"Like `git fork` — the parent remains immutable with full history. \" +\n \"The new belief gets a `supersedes` edge to the parent. \" +\n \"Fork reasons: refinement, contradiction_response, scope_change, confidence_collapse, manual.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The scored belief to fork from\" },\n newFormulation: {\n type: \"string\",\n description: \"The evolved belief statement\",\n },\n forkReason: {\n type: \"string\",\n description: \"Why this fork was created\",\n enum: [\n \"refinement\",\n \"contradiction_response\",\n \"scope_change\",\n \"confidence_collapse\",\n \"manual\",\n ],\n },\n },\n required: [\"nodeId\", \"newFormulation\", \"forkReason\"],\n response: {\n description: \"The forked canonical belief record\",\n fields: {\n id: \"string — canonical child belief ID\",\n nodeId: \"string — canonical child belief ID\",\n beliefId: \"string — canonical child belief ID\",\n parentBeliefId: \"string — canonical parent belief ID\",\n forkReason: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const ARCHIVE_BELIEF: McpToolContract = {\n name: \"archive_belief\",\n description:\n \"Soft-delete a belief by setting its status to archived. \" +\n \"Like `git rm` — removed from the working tree but preserved in history. \" +\n \"Beliefs are never truly deleted. Archived beliefs retain full lineage and confidence history.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to archive\" },\n rationale: {\n type: \"string\",\n description: \"Why this belief is being archived\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Archived canonical belief record\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n previousStatus: \"string | undefined\",\n newStatus: \"string — 'archived'\",\n status: \"string — 'archived'\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const CREATE_EPISTEMIC_CONTRACT: McpToolContract = {\n name: \"create_epistemic_contract\",\n description:\n \"Bind a machine-evaluable epistemic contract to a belief. \" +\n \"Like `git add` for falsification rules — records the verification condition, modulation policy, \" +\n \"and evaluation schedule that keep a belief accountable to reality.\",\n parameters: {\n beliefNodeId: {\n type: \"string\",\n description: \"The belief node to bind this contract to\",\n },\n title: {\n type: \"string\",\n description: \"Contract title\",\n },\n description: {\n type: \"string\",\n description: \"Optional contract description\",\n },\n conditionType: {\n type: \"string\",\n description: \"What kind of contract condition to evaluate\",\n enum: [\"assertion\", \"temporal\", \"evidential\", \"threshold\", \"composite\"],\n },\n direction: {\n type: \"string\",\n description: \"Whether satisfying the condition confirms or falsifies\",\n enum: [\"confirms\", \"falsifies\"],\n },\n condition: {\n type: \"object\",\n description:\n \"Condition payload: { expression, evaluator, evaluatorConfig? }\",\n },\n deadline: {\n type: \"number\",\n description: \"Optional Unix timestamp deadline for temporal contracts\",\n },\n compositeOf: {\n type: \"array\",\n description: \"Optional array of sub-contract IDs for composite contracts\",\n },\n compositeOperator: {\n type: \"string\",\n description: \"How composite sub-contracts should be combined\",\n enum: [\"all\", \"any\", \"majority\"],\n },\n modulation: {\n type: \"object\",\n description:\n \"Asymmetric modulation rules for confirmed, disconfirmed, expired, and partial outcomes\",\n },\n evaluationSchedule: {\n type: \"string\",\n description: \"When this contract should be evaluated\",\n enum: [\"on_demand\", \"on_evidence\", \"periodic\", \"event_driven\"],\n },\n periodicIntervalMs: {\n type: \"number\",\n description: \"Optional interval in milliseconds for periodic contracts\",\n },\n },\n required: [\n \"beliefNodeId\",\n \"title\",\n \"conditionType\",\n \"direction\",\n \"condition\",\n \"modulation\",\n \"evaluationSchedule\",\n ],\n response: {\n description: \"The created epistemic contract binding\",\n fields: {\n id: \"string — storage record ID\",\n contractId: \"string — contract identifier\",\n beliefId: \"string — canonical belief ID\",\n status: \"string — initial contract status\",\n title: \"string — contract title\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// EVIDENCE TOOLS\n// =============================================================================\n\nexport const ADD_EVIDENCE: McpToolContract = {\n name: \"add_evidence\",\n description:\n \"Commit evidence to the reasoning graph and attach it to a belief. \" +\n \"Like `git add && git commit` — an atomic write that creates a traceable evidence object. \" +\n \"Weight ranges from -1.0 (contradicts) to +1.0 (strongly supports). \" +\n \"Evidence is always context-bound: tied to its source, the time it was captured, and the belief it informs.\",\n parameters: {\n canonicalText: { type: \"string\", description: \"The evidence statement\" },\n topicId: { type: \"string\", description: \"Optional topic scope hint\" },\n sourceUrl: { type: \"string\", description: \"URL of the source material\" },\n targetNodeId: {\n type: \"string\",\n description: \"The belief this evidence bears on\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n reasoning: {\n type: \"string\",\n description: \"Why this evidence is relevant to the target belief\",\n },\n title: {\n type: \"string\",\n description: \"Optional short title for the evidence node\",\n },\n content: {\n type: \"string\",\n description:\n \"Optional long-form content (separate from canonicalText summary)\",\n },\n contentType: {\n type: \"string\",\n description:\n \"Content MIME type or format hint (e.g., 'text/markdown', 'code')\",\n },\n metadata: {\n type: \"object\",\n description:\n \"Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'], failedApproach: true } for coding intelligence)\",\n },\n },\n required: [\"canonicalText\", \"targetNodeId\", \"reasoning\"],\n response: {\n description: \"The created evidence node and its edge\",\n fields: {\n nodeId: \"string — evidence node ID\",\n edgeId: \"string — edge to target belief\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// CONTRADICTION TOOLS\n// =============================================================================\n\nexport const FLAG_CONTRADICTION: McpToolContract = {\n name: \"flag_contradiction\",\n description:\n \"Flag a contradiction between two beliefs. Contradictions are first-class objects \" +\n \"with their own lifecycle — they may remain permanently unresolved. \" +\n \"Like a merge conflict that is allowed to persist. \" +\n \"Contradictions can trigger structural changes: forking, confidence collapse, or decision blocking. \" +\n \"Resolution is NEVER automatic — always surfaces for human review.\",\n parameters: {\n beliefA: {\n type: \"string\",\n description: \"First belief in the contradiction\",\n },\n beliefB: {\n type: \"string\",\n description: \"Second belief in the contradiction\",\n },\n description: { type: \"string\", description: \"What the tension is about\" },\n severity: {\n type: \"string\",\n description: \"How serious the contradiction is\",\n enum: [\"low\", \"medium\", \"high\", \"critical\"],\n },\n topicId: { type: \"string\", description: \"Optional topic scope hint\" },\n defeatType: {\n type: \"string\",\n description:\n \"Pollock defeat classification: rebuts (direct contradiction), undercuts (attacks the inferential link), undermines (attacks a premise)\",\n enum: [\"rebuts\", \"undercuts\", \"undermines\"],\n },\n },\n required: [\"beliefA\", \"beliefB\", \"description\"],\n response: {\n description: \"The created contradiction object\",\n fields: {\n contradictionId: \"string\",\n status: \"string — 'unresolved'\",\n beliefA: \"string\",\n beliefB: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// WORKTREE TOOLS (git worktree add, git merge)\n// =============================================================================\n"]}
|
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ACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,QAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.lifecycle.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const CREATE_BELIEF: McpToolContract = {\n name: \"create_belief\",\n description:\n \"Commit a new belief (knowledge unit) to the reasoning graph. \" +\n \"Like `git commit` — creates an atomic, traceable knowledge object with a prior. \" +\n \"Creation requires a topic epistemic-node anchor and writes a `scoped_by` edge directly from belief node to topic node; orphan beliefs are invalid. \" +\n \"Creation stores the vacuous opinion `(0, 0, 1, a)`; attach supporting or contradicting evidence with create_evidence or link_evidence_to_belief to record evidential updates.\",\n parameters: {\n canonicalText: {\n type: \"string\",\n description: \"The belief statement — what the agent holds to be true\",\n },\n topicGlobalId: {\n type: \"string\",\n description:\n \"Required globalId (UUID) of the topic node in epistemicNodes that anchors the belief\",\n },\n topicNodeId: {\n type: \"string\",\n description:\n \"Optional internal epistemicNodes _id for the topic anchor. Prefer topicGlobalId for public callers.\",\n },\n topicId: {\n type: \"string\",\n description:\n \"Deprecated compatibility alias for topicGlobalId. Must identify a topic epistemicNode, not a legacy topics-table row.\",\n },\n baseRate: {\n type: \"number\",\n description:\n \"Prior probability used to seed the vacuous opinion `(0, 0, 1, a)` at creation time. Defaults to 0.5 when omitted.\",\n },\n beliefType: {\n type: \"string\",\n description:\n \"Belief type (e.g., hypothesis, belief, principle, invariant, tenet, forecast). Validated against schemaEnumConfig.\",\n },\n metadata: {\n type: \"object\",\n description:\n \"Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)\",\n },\n },\n required: [\"canonicalText\", \"topicGlobalId\"],\n response: {\n description: \"The created canonical belief record\",\n fields: {\n id: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n beliefId: \"string — canonical belief ID\",\n text: \"string — canonical belief formulation\",\n topicId: \"string\",\n beliefStatus:\n \"string — assumption | hypothesis | active | superseded | resolved_true | resolved_false\",\n scoringState: \"string — unscored | scored\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const GET_BELIEF: McpToolContract = {\n name: \"get_belief\",\n description:\n \"Read one belief by ID. \" +\n \"Like `git show` — resolves the canonical belief payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical belief ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical belief record\",\n fields: {\n id: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n beliefId: \"string — canonical belief ID\",\n text: \"string — canonical belief formulation\",\n topicId: \"string\",\n beliefStatus:\n \"string — assumption | hypothesis | active | superseded | resolved_true | resolved_false\",\n scoringState: \"string — unscored | scored\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const REFINE_BELIEF: McpToolContract = {\n name: \"refine_belief\",\n description:\n \"Amend a draft belief in-place within an active worktree. \" +\n \"Like `git commit --amend` — rewrites the last commit on a feature branch. \" +\n \"Only valid before merge to main. Fails if the belief is already scored.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to refine\" },\n canonicalText: { type: \"string\", description: \"Updated belief statement\" },\n rationale: { type: \"string\", description: \"Why the refinement was made\" },\n },\n required: [\"nodeId\", \"canonicalText\"],\n response: {\n description: \"The updated belief node\",\n fields: {\n nodeId: \"string\",\n canonicalText: \"string — updated text\",\n updatedAt: \"number — timestamp\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const APPEND_SL_SCORING: McpToolContract = {\n name: \"append_sl_scoring\",\n description:\n \"Internal evidence-backed Subjective Logic scoring append. \" +\n \"This is not a public MCP tool: callers should attach supporting or contradicting evidence, and governed system paths append the derived SL tuple.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief receiving the SL score\" },\n belief: { type: \"number\", description: \"Subjective Logic belief mass b\" },\n disbelief: {\n type: \"number\",\n description: \"Subjective Logic disbelief mass d\",\n },\n uncertainty: {\n type: \"number\",\n description: \"Subjective Logic uncertainty mass u\",\n },\n baseRate: { type: \"number\", description: \"Subjective Logic base rate a\" },\n trigger: {\n type: \"string\",\n description: \"Evidence-bearing cause of the scoring event\",\n enum: [\n \"evidence_added\",\n \"evidence_removed\",\n \"contradiction_detected\",\n \"contradiction_resolved\",\n \"agent_assessment\",\n \"worktree_outcome\",\n \"worktree_completed\",\n \"fusion\",\n \"discount\",\n \"deduction\",\n \"backfill_synthetic\",\n ],\n },\n provenance: {\n type: \"object\",\n description:\n \"At least one of evidence, question, answer, contradiction, or worktree.\",\n },\n rationale: {\n type: \"string\",\n description: \"Why this evidence-bearing event moved the SL tuple\",\n },\n },\n required: [\"nodeId\", \"belief\", \"disbelief\", \"uncertainty\", \"baseRate\", \"trigger\", \"rationale\"],\n response: {\n description: \"Internal SL scoring append receipt\",\n fields: {\n nodeId: \"string\",\n previousConfidence: \"number\",\n newConfidence: \"number\",\n beliefConfidenceId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const FORK_BELIEF: McpToolContract = {\n name: \"fork_belief\",\n description:\n \"Branch off an evidence-bearing belief to create a new formulation. \" +\n \"Like `git fork` — the parent remains immutable with full history, and every fork must cite evidence already attached to the parent through SL scoring. \" +\n \"`forkMode=supersede` marks the parent superseded and requires contradicting evidence; `forkMode=branch` preserves the parent and creates a derived child.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to fork from\" },\n newFormulation: {\n type: \"string\",\n description: \"The evolved belief statement\",\n },\n forkReason: {\n type: \"string\",\n description: \"Why this fork was created\",\n enum: [\n \"refinement\",\n \"contradiction_response\",\n \"scope_change\",\n \"confidence_collapse\",\n ],\n },\n forkMode: {\n type: \"string\",\n description:\n \"supersede replaces the parent; branch creates a child while preserving the parent.\",\n enum: [\"supersede\", \"branch\"],\n },\n triggeringEvidenceId: {\n type: \"string\",\n description:\n \"Evidence already attached to the parent belief that caused the fork.\",\n },\n },\n required: [\"nodeId\", \"newFormulation\", \"forkReason\", \"triggeringEvidenceId\"],\n response: {\n description: \"The forked canonical belief record\",\n fields: {\n id: \"string — canonical child belief ID\",\n nodeId: \"string — canonical child belief ID\",\n beliefId: \"string — canonical child belief ID\",\n parentBeliefId: \"string — canonical parent belief ID\",\n forkReason: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const ARCHIVE_BELIEF: McpToolContract = {\n name: \"archive_belief\",\n description:\n \"Soft-delete a belief by setting its status to archived. \" +\n \"Like `git rm` — removed from the working tree but preserved in history. \" +\n \"Beliefs are never truly deleted. Archived beliefs retain full lineage and confidence history.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to archive\" },\n rationale: {\n type: \"string\",\n description: \"Why this belief is being archived\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Archived canonical belief record\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n previousStatus: \"string | undefined\",\n newStatus: \"string — 'archived'\",\n status: \"string — 'archived'\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const CREATE_EPISTEMIC_CONTRACT: McpToolContract = {\n name: \"create_epistemic_contract\",\n description:\n \"Bind a machine-evaluable epistemic contract to a belief. \" +\n \"Like `git add` for falsification rules — records the verification condition, modulation policy, \" +\n \"and evaluation schedule that keep a belief accountable to reality.\",\n parameters: {\n beliefNodeId: {\n type: \"string\",\n description: \"The belief node to bind this contract to\",\n },\n title: {\n type: \"string\",\n description: \"Contract title\",\n },\n description: {\n type: \"string\",\n description: \"Optional contract description\",\n },\n conditionType: {\n type: \"string\",\n description: \"What kind of contract condition to evaluate\",\n enum: [\"assertion\", \"temporal\", \"evidential\", \"threshold\", \"composite\"],\n },\n direction: {\n type: \"string\",\n description: \"Whether satisfying the condition confirms or falsifies\",\n enum: [\"confirms\", \"falsifies\"],\n },\n condition: {\n type: \"object\",\n description:\n \"Condition payload: { expression, evaluator, evaluatorConfig? }\",\n },\n deadline: {\n type: \"number\",\n description: \"Optional Unix timestamp deadline for temporal contracts\",\n },\n compositeOf: {\n type: \"array\",\n description: \"Optional array of sub-contract IDs for composite contracts\",\n },\n compositeOperator: {\n type: \"string\",\n description: \"How composite sub-contracts should be combined\",\n enum: [\"all\", \"any\", \"majority\"],\n },\n modulation: {\n type: \"object\",\n description:\n \"Asymmetric modulation rules for confirmed, disconfirmed, expired, and partial outcomes\",\n },\n evaluationSchedule: {\n type: \"string\",\n description: \"When this contract should be evaluated\",\n enum: [\"on_demand\", \"on_evidence\", \"periodic\", \"event_driven\"],\n },\n periodicIntervalMs: {\n type: \"number\",\n description: \"Optional interval in milliseconds for periodic contracts\",\n },\n },\n required: [\n \"beliefNodeId\",\n \"title\",\n \"conditionType\",\n \"direction\",\n \"condition\",\n \"modulation\",\n \"evaluationSchedule\",\n ],\n response: {\n description: \"The created epistemic contract binding\",\n fields: {\n id: \"string — storage record ID\",\n contractId: \"string — contract identifier\",\n beliefId: \"string — canonical belief ID\",\n status: \"string — initial contract status\",\n title: \"string — contract title\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// EVIDENCE TOOLS\n// =============================================================================\n\nexport const ADD_EVIDENCE: McpToolContract = {\n name: \"add_evidence\",\n description:\n \"Commit evidence to the reasoning graph and attach it to a belief. \" +\n \"Like `git add && git commit` — an atomic write that creates a traceable evidence object. \" +\n \"Weight ranges from -1.0 (contradicts) to +1.0 (strongly supports). \" +\n \"Evidence is always context-bound: tied to its source, the time it was captured, and the belief it informs.\",\n parameters: {\n canonicalText: { type: \"string\", description: \"The evidence statement\" },\n topicId: { type: \"string\", description: \"Optional topic scope hint\" },\n sourceUrl: { type: \"string\", description: \"URL of the source material\" },\n targetNodeId: {\n type: \"string\",\n description: \"The belief this evidence bears on\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n reasoning: {\n type: \"string\",\n description: \"Why this evidence is relevant to the target belief\",\n },\n title: {\n type: \"string\",\n description: \"Optional short title for the evidence node\",\n },\n content: {\n type: \"string\",\n description:\n \"Optional long-form content (separate from canonicalText summary)\",\n },\n contentType: {\n type: \"string\",\n description:\n \"Content MIME type or format hint (e.g., 'text/markdown', 'code')\",\n },\n metadata: {\n type: \"object\",\n description:\n \"Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'], failedApproach: true } for coding intelligence)\",\n },\n },\n required: [\"canonicalText\", \"targetNodeId\", \"reasoning\"],\n response: {\n description: \"The created evidence node and its edge\",\n fields: {\n nodeId: \"string — evidence node ID\",\n edgeId: \"string — edge to target belief\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// CONTRADICTION TOOLS\n// =============================================================================\n\nexport const FLAG_CONTRADICTION: McpToolContract = {\n name: \"flag_contradiction\",\n description:\n \"Flag a contradiction between two beliefs. Contradictions are first-class objects \" +\n \"with their own lifecycle — they may remain permanently unresolved. \" +\n \"Like a merge conflict that is allowed to persist. \" +\n \"Contradictions can trigger structural changes: forking, confidence collapse, or decision blocking. \" +\n \"Resolution is NEVER automatic — always surfaces for human review.\",\n parameters: {\n beliefA: {\n type: \"string\",\n description: \"First belief in the contradiction\",\n },\n beliefB: {\n type: \"string\",\n description: \"Second belief in the contradiction\",\n },\n description: { type: \"string\", description: \"What the tension is about\" },\n severity: {\n type: \"string\",\n description: \"How serious the contradiction is\",\n enum: [\"low\", \"medium\", \"high\", \"critical\"],\n },\n topicId: { type: \"string\", description: \"Optional topic scope hint\" },\n defeatType: {\n type: \"string\",\n description:\n \"Pollock defeat classification: rebuts (direct contradiction), undercuts (attacks the inferential link), undermines (attacks a premise)\",\n enum: [\"rebuts\", \"undercuts\", \"undermines\"],\n },\n },\n required: [\"beliefA\", \"beliefB\", \"description\"],\n response: {\n description: \"The created contradiction object\",\n fields: {\n contradictionId: \"string\",\n status: \"string — 'unresolved'\",\n beliefA: \"string\",\n beliefB: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// WORKTREE TOOLS (git worktree add, git merge)\n// =============================================================================\n"]}
|
|
@@ -329,7 +329,7 @@ var TRIGGER_BELIEF_REVIEW = {
|
|
|
329
329
|
};
|
|
330
330
|
var EVALUATE_CONTRACT = {
|
|
331
331
|
name: "evaluate_contract",
|
|
332
|
-
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
|
|
332
|
+
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 SL scoring action.",
|
|
333
333
|
parameters: {
|
|
334
334
|
contractId: { type: "string", description: "Which contract to evaluate" },
|
|
335
335
|
trigger: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tool-contracts.pipeline-coordination.ts"],"names":[],"mappings":";AAEO,IAAM,qBAAA,GAAyC;AAAA,EACpD,IAAA,EAAM,uBAAA;AAAA,EACN,WAAA,EACE,qNAAA;AAAA,EAEF,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,gBAAA,EAAiB;AAAA,IACzD,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA,EAA4B;AAAA,IACpE,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE;AAAA,KACJ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AY,CAAA;AAAA,EACvB,QAAA,EAAU;AAAA,IACR,WAAA,EACE,kHAAA;AAAA,IACF,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,qCAAA;AAAA,MACT,SAAA,EAAW,yCAAA;AAAA,MACX,UAAA,EAAY,2BAAA;AAAA,MACZ,YAAA,EAAc,4CAAA;AAAA,MACd,MAAA,EAAQ,+BAAA;AAAA,MACR,UAAA,EAAY,2BAAA;AAAA,MACZ,MAAA,EAAQ,gCAAA;AAAA,MACR,QAAA,EAAU,kDAAA;AAAA,MACV,IAAA,EAAM,6BAAA;AAAA,MACN,IAAA,EAAM,yBAAA;AAAA,MACN,UAAA,EAAY,mCAAA;AAAA,MACZ,KAAA,EAAO,6BAAA;AAAA,MACP,MAAA,EAAQ,yDAAA;AAAA,MACR,WAAA,EAAa,mCAAA;AAAA,MACb,eAAA,EAAiB,gCAAA;AAAA,MACjB,iBAAA,EAAmB,kCAAA;AAAA,MACnB,OAAA,EAAS,kDAAA;AAAA,MACT,iBAAA,EACE,+EAAA;AAAA,MACF,KAAA,EACE,0FAAA;AAAA,MACF,UAAA,EAAY,gDAAA;AAAA,MACZ,aAAA,EAAe,oCAAA;AAAA,MACf,iBAAA,EAAmB,4DAAA;AAAA,MACnB,YAAA,EAAc,iCAAA;AAAA,MACd,QAAA,EAAU,mCAAA;AAAA,MACV,eAAA,EAAiB;AAAA;AACnB,GACF;AAAA,EACA,WAAA,EAAa,WAAA;AAAA,EACb,iBAAA,EAAmB,UAAA;AAAA,EACnB,IAAA,EAAM,UAAA;AAAA,EACN,QAAA,EAAU;AACZ","file":"tool-contracts.pipeline-coordination.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const RECORD_SCOPE_LEARNING: McpToolContract = {\n name: \"record_scope_learning\",\n description:\n \"Write a structured learning entry into the epistemic spine. \" +\n \"Like `git commit` for scope learnings — records evidence, can attach to a belief, and can open a follow-up belief/question in one atomic workflow.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope ID\" },\n summary: { type: \"string\", description: \"Atomic learning statement\" },\n title: {\n type: \"string\",\n description: \"Optional evidence title, such as a commit, doc, or issue.\",\n },\n body: {\n type: \"string\",\n description:\n \"Optional rich evidence body. If omitted, body is synthesized from summary and touched paths.\",\n },\n contentType: {\n type: \"string\",\n description: \"Optional evidence body format, such as markdown or text.\",\n },\n sourceKind: {\n type: \"string\",\n description: \"Source type for the learning event\",\n enum: [\"commit\", \"merge\", \"doc\", \"issue\", \"manual\"],\n },\n sourceRef: {\n type: \"string\",\n description: \"Optional source reference, such as SHA, PR number, or URL slug.\",\n },\n sourceUrl: { type: \"string\", description: \"Optional canonical source URL\" },\n touchedPaths: {\n type: \"array\",\n description: \"Optional touched file paths for retrieval hints\",\n },\n tags: { type: \"array\", description: \"Optional tags\" },\n linkedBeliefNodeId: {\n type: \"string\",\n description: \"Optional belief to attach evidence to\",\n },\n evidenceRelation: {\n type: \"string\",\n description: \"Relation to linked belief\",\n enum: [\"supports\", \"contradicts\"],\n },\n confidence: { type: \"number\", description: \"Optional confidence in [0,1]\" },\n createQuestionText: {\n type: \"string\",\n description: \"Optional follow-up question text\",\n },\n createBeliefText: {\n type: \"string\",\n description: \"Optional new belief text\",\n },\n beliefType: {\n type: \"string\",\n description: \"Optional belief type for createBeliefText\",\n },\n },\n required: [\"summary\"],\n response: {\n description: \"Created learning artifacts\",\n fields: {\n topicId: \"string — resolved topic ID\",\n evidenceNodeId: \"string\",\n linkedBeliefNodeId: \"string | null\",\n createdQuestionId: \"string | null\",\n createdBeliefId: \"string | null\",\n sourceUrl: \"string\",\n createdAt: \"number\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const PIPELINE_SNAPSHOT: McpToolContract = {\n name: \"pipeline_snapshot\",\n description:\n \"Summarize a topic's worktree pipeline in campaign-and-lane form. \" +\n \"Like `git status --short` for Lucern execution — returns the hinge worktree, next planned wave, blockers, critical path, superseded work, and graph hygiene debt.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope ID\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"Human-oriented pipeline summary for a single topic scope\",\n fields: {\n topicId: \"string\",\n topicName: \"string\",\n currentCampaign: \"number | null\",\n nextCampaign: \"number | null\",\n activeWorktrees: \"array — current hinge worktree(s)\",\n nextWave: \"array — worktrees in the next planned campaign\",\n readyNow: \"array — planning worktrees with dependencies completed\",\n blockedBy: \"array — grouped blockers\",\n criticalPath: \"array — ordered incomplete worktree chain\",\n campaigns: \"array — incomplete worktrees grouped by campaign\",\n superseded: \"array — worktrees marked superseded or not for activation\",\n graphHygiene: \"object — untargeted and taskless worktree debt\",\n riskQuestions: \"array — critical/high open questions\",\n narrative: \"array — concise natural-language summary lines\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const DISCOVER: McpToolContract = {\n name: \"discover\",\n description:\n \"Navigate the topic tree to find where knowledge lives. \" +\n \"Like `git log --all --grep` — searches across the graph using bottom-up content matching plus top-down structural scoring.\",\n parameters: {\n query: {\n type: \"string\",\n description: \"What to look for across the topic tree\",\n },\n topK: {\n type: \"number\",\n description: \"How many matching topics to return (default: 3, max: 10)\",\n },\n includeNeighborhood: {\n type: \"boolean\",\n description:\n \"Whether to include beliefs/questions/evidence for matched topics\",\n },\n },\n required: [\"query\"],\n response: {\n description: \"Ranked topic matches with optional neighborhood content\",\n fields: {\n query: \"string — original query\",\n matchedTopics: \"array — ranked topics with scores and paths\",\n neighborhoods: \"array — beliefs, questions, evidence for each match\",\n totalTopicsScored: \"number\",\n topicTreeSize: \"number\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n deprecated: \"Deprecated: use lucern.context.compile() with topicId\",\n};\n\nexport const ANALYZE_TOPIC_DENSITY: McpToolContract = {\n name: \"analyze_topic_density\",\n description:\n \"Analyze topic belief density and identify natural conceptual clusters. \" +\n \"Like `git diff --stat` for topic organization — detects when a topic has accumulated too many beliefs and suggests subtopic decomposition.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic ID to analyze\" },\n threshold: {\n type: \"number\",\n description: \"Belief count threshold for density warning\",\n },\n minModularity: {\n type: \"number\",\n description: \"Minimum modularity score for suggesting decomposition\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Density analysis with cluster suggestions\",\n fields: {\n topicId: \"string\",\n topicName: \"string\",\n beliefCount: \"number\",\n edgeCount: \"number\",\n threshold: \"number\",\n isDense: \"boolean\",\n modularity: \"number\",\n clusterCount: \"number\",\n clusters: \"array — suggested belief clusters\",\n recommendation: \"string\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const APPLY_AUTO_BRANCHING: McpToolContract = {\n name: \"apply_auto_branching\",\n description:\n \"Execute topic decomposition by creating subtopics and reassigning beliefs. \" +\n \"Like `git subtree split` — splits a dense topic into focused subtopics while preserving belief identity and edges.\",\n parameters: {\n topicId: { type: \"string\", description: \"Parent topic ID to decompose\" },\n clusters: {\n type: \"array\",\n description:\n \"Cluster definitions from analyze_topic_density, each with name and beliefIds\",\n },\n dryRun: {\n type: \"boolean\",\n description: \"Preview changes without applying them\",\n },\n },\n required: [\"topicId\", \"clusters\"],\n response: {\n description: \"Results of the auto-branching operation\",\n fields: {\n success: \"boolean\",\n parentTopicId: \"string\",\n createdSubtopics: \"array\",\n totalReassigned: \"number\",\n totalSkipped: \"number\",\n dryRun: \"boolean\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const SEED_BELIEF_LATTICE: McpToolContract = {\n name: \"seed_belief_lattice\",\n description:\n \"Seed belief lattice coverage for a topic based on its resolved ontology. \" +\n \"Like `git init` for ontology coverage — creates or previews seed beliefs for entity types that need a baseline anchor.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Topic scope ID. Lattice seeding must target a child topic.\",\n },\n dryRun: {\n type: \"boolean\",\n description: \"Preview seeds without creating them\",\n },\n },\n required: [],\n response: {\n description: \"Lattice seed results with per-entity-type status\",\n fields: {\n topicId: \"string\",\n ontologyResolved: \"boolean\",\n ontologyKey: \"string | null\",\n ontologyVersion: \"string | null\",\n entityTypeCount: \"number\",\n seeds: \"array — per-entity-type seed status\",\n summary: \"object — created/existing/scored/total counts\",\n dryRun: \"boolean\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const GET_LATTICE_COVERAGE: McpToolContract = {\n name: \"get_lattice_coverage\",\n description:\n \"Report belief lattice coverage for a topic. \" +\n \"Like `git fsck` for ontology coverage — identifies anchored, hollow, and missing entity-type belief coverage.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Topic scope ID to check lattice coverage for\",\n },\n },\n required: [],\n response: {\n description: \"Per-entity-type coverage with overall score\",\n fields: {\n topicId: \"string\",\n ontologyKey: \"string | null\",\n ontologyVersion: \"string | null\",\n entityTypes: \"array — per-entity-type coverage rows\",\n summary: \"object — total/anchored/hollow/missing/coverageScore\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const DISCOVER_ENTITY_CONNECTIONS: McpToolContract = {\n name: \"discover_entity_connections\",\n description:\n \"Find existing entities that should be connected to a belief/question/evidence node. \" +\n \"Like `git log --diff-filter=M` for missing entity connections — scans entities in scope and suggests bridge edge types.\",\n parameters: {\n nodeId: {\n type: \"string\",\n description: \"Epistemic node ID to find entity connections for\",\n },\n topicId: {\n type: \"string\",\n description: \"Optional topic scope override\",\n },\n minScore: {\n type: \"number\",\n description: \"Minimum match score threshold\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum candidates to return\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Ranked entity connection candidates\",\n fields: {\n nodeId: \"string\",\n candidateCount: \"number\",\n candidates: \"array — suggested entity bridge candidates\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\nexport const TRIGGER_BELIEF_REVIEW: McpToolContract = {\n name: \"trigger_belief_review\",\n description:\n \"Flag beliefs for review after an entity changes. \" +\n \"Like `git bisect` for stale beliefs — traverses bridge edges from the changed entity and creates review questions for stale connected beliefs.\",\n parameters: {\n entityNodeId: {\n type: \"string\",\n description: \"The entity node that changed\",\n },\n changeDescription: {\n type: \"string\",\n description: \"What changed about the entity\",\n },\n maxQuestions: {\n type: \"number\",\n description: \"Maximum review questions to create\",\n },\n },\n required: [\"entityNodeId\"],\n response: {\n description: \"Affected beliefs and created review questions\",\n fields: {\n entityNodeId: \"string\",\n entityTitle: \"string\",\n entityType: \"string\",\n changeDescription: \"string\",\n affectedBeliefCount: \"number\",\n questionsCreated: \"number\",\n reviewedBeliefs: \"array\",\n questions: \"array\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\nexport const EVALUATE_CONTRACT: McpToolContract = {\n name: \"evaluate_contract\",\n description:\n \"Run a contract evaluation and record the append-only result. \" +\n \"Like `git test` for a belief binding — executes the evaluator, logs the result, and applies any allowed confidence modulation.\",\n parameters: {\n contractId: { type: \"string\", description: \"Which contract to evaluate\" },\n trigger: {\n type: \"string\",\n description: \"What caused this evaluation\",\n },\n },\n required: [\"contractId\"],\n response: {\n description: \"The most recent contract evaluation result\",\n fields: {\n evaluationId: \"string\",\n result: \"string\",\n status: \"string\",\n confidenceBefore: \"number\",\n confidenceAfter: \"number\",\n rationale: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const GET_CONTRACT_STATUS: McpToolContract = {\n name: \"get_contract_status\",\n description:\n \"Inspect epistemic contracts and their latest evaluations. \" +\n \"Like `git status` for verification bindings — returns the contract rows plus the freshest recorded evaluation for each one.\",\n parameters: {\n beliefNodeId: {\n type: \"string\",\n description: \"Return all contracts attached to a specific belief\",\n },\n contractId: {\n type: \"string\",\n description: \"Return one specific contract by contractId\",\n },\n status: {\n type: \"string\",\n description: \"Optional status filter applied after lookup\",\n enum: [\"active\", \"satisfied\", \"violated\", \"expired\", \"suspended\", \"archived\"],\n },\n },\n required: [],\n response: {\n description: \"Matching contract rows with latest evaluation context\",\n fields: {\n contracts: \"array — matching contracts with latestEvaluation attached\",\n count: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const REGISTER_SESSION: McpToolContract = {\n name: \"register_session\",\n description:\n \"Announce this agent session's presence to other parallel sessions. \" +\n \"Like `git init` for coordination — creates a session record so other agents can discover you.\",\n parameters: {\n sessionName: { type: \"string\", description: \"Human-readable session label\" },\n agentType: { type: \"string\", description: \"Agent type\" },\n topicId: { type: \"string\", description: \"Current Lucern topic scope ID\" },\n worktreeId: { type: \"string\", description: \"Active Lucern worktree ID\" },\n gitBranch: { type: \"string\", description: \"Current git branch name\" },\n },\n required: [],\n response: {\n description: \"Session registration result\",\n fields: {\n sessionId: \"string\",\n status: \"string — active\",\n isNew: \"boolean\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const HEARTBEAT_SESSION: McpToolContract = {\n name: \"heartbeat_session\",\n description:\n \"Update this session's heartbeat and optional status fields. \" +\n \"Like `git status` — signals liveness and updates what you are working on.\",\n parameters: {\n topicId: { type: \"string\", description: \"Updated topic scope\" },\n worktreeId: { type: \"string\", description: \"Updated worktree ID\" },\n gitBranch: { type: \"string\", description: \"Updated git branch\" },\n status: {\n type: \"string\",\n description: \"Session status update\",\n enum: [\"active\", \"idle\"],\n },\n },\n required: [],\n response: {\n description: \"Heartbeat result\",\n fields: {\n success: \"boolean\",\n message: \"string\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const END_SESSION: McpToolContract = {\n name: \"end_session\",\n description:\n \"Gracefully end this agent session. \" +\n \"Like `git stash` — marks the session as ended so other agents know you are gone.\",\n parameters: {},\n required: [],\n response: {\n description: \"Session end result\",\n fields: {\n success: \"boolean\",\n message: \"string\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const LIST_ACTIVE_SESSIONS: McpToolContract = {\n name: \"list_active_sessions\",\n description:\n \"See who else is online with active agent sessions, scope, branch, and file claims. \" +\n \"Like `git branch --list` for live agents — shows active and idle sessions before editing.\",\n parameters: {\n includeIdle: {\n type: \"boolean\",\n description: \"Include idle sessions\",\n },\n },\n required: [],\n response: {\n description: \"List of active/idle agent sessions\",\n fields: {\n sessions: \"array — active session records\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const SEND_AGENT_MESSAGE: McpToolContract = {\n name: \"send_agent_message\",\n description:\n \"Send a directed message to a specific agent session. \" +\n \"Like `git notes` — leaves a coordination note for a specific peer.\",\n parameters: {\n toSessionId: { type: \"string\", description: \"Target session ID\" },\n content: { type: \"string\", description: \"Message text\" },\n messageType: {\n type: \"string\",\n description: \"Message intent\",\n enum: [\"note\", \"question\", \"answer\", \"alert\", \"handoff\"],\n },\n relatedBeliefId: {\n type: \"string\",\n description: \"Optional related belief node ID\",\n },\n relatedWorktreeId: {\n type: \"string\",\n description: \"Optional related worktree ID\",\n },\n },\n required: [\"toSessionId\", \"content\"],\n response: {\n description: \"Message delivery result\",\n fields: { messageId: \"string\" },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const BROADCAST_MESSAGE: McpToolContract = {\n name: \"broadcast_message\",\n description:\n \"Send a message to all active agent sessions. \" +\n \"Like `git tag` — marks an important event visible to everyone.\",\n parameters: {\n content: { type: \"string\", description: \"Broadcast message text\" },\n messageType: {\n type: \"string\",\n description: \"Message intent\",\n enum: [\"note\", \"alert\", \"handoff\"],\n },\n relatedBeliefId: {\n type: \"string\",\n description: \"Optional related belief node ID\",\n },\n relatedWorktreeId: {\n type: \"string\",\n description: \"Optional related worktree ID\",\n },\n },\n required: [\"content\"],\n response: {\n description: \"Broadcast result\",\n fields: { messageId: \"string\" },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const GET_AGENT_INBOX: McpToolContract = {\n name: \"get_agent_inbox\",\n description:\n \"Check unread messages addressed to this session. \" +\n \"Like `git log --incoming` — shows direct and broadcast messages from other agents.\",\n parameters: {\n limit: { type: \"number\", description: \"Max messages to return\" },\n markAsRead: {\n type: \"boolean\",\n description: \"Mark returned messages as read\",\n },\n },\n required: [],\n response: {\n description: \"Inbox messages\",\n fields: {\n messages: \"array — unread direct and broadcast messages\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const CLAIM_FILES: McpToolContract = {\n name: \"claim_files\",\n description:\n \"Declare which files this session is actively editing. \" +\n \"Like `git add` for coordination — tells other sessions what you are touching and returns advisory conflicts.\",\n parameters: {\n files: {\n type: \"array\",\n description: \"File paths this session is actively editing\",\n },\n },\n required: [\"files\"],\n response: {\n description: \"File claim result with conflict detection\",\n fields: {\n success: \"boolean\",\n conflicts: \"array — conflicting file claims\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const GENERATE_SESSION_HANDOFF: McpToolContract = {\n name: \"generate_session_handoff\",\n description:\n \"Generate a complete, zero-context handoff message for a new coding session. \" +\n \"Like `git format-patch` — produces a self-contained instruction set that bootstraps a fresh Lucern worktree session.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The Lucern worktree ID to generate handoff instructions for\",\n },\n gitWorktreePath: {\n type: \"string\",\n description: \"Optional existing git worktree path\",\n },\n gitBranchName: {\n type: \"string\",\n description: \"Optional branch name for the session\",\n },\n additionalContext: {\n type: \"string\",\n description: \"Optional extra context to include in the handoff\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"A complete handoff message ready for a new coding session\",\n fields: {\n handoffMessage: \"string\",\n worktreeId: \"string\",\n worktreeName: \"string\",\n trackBoundary: \"object\",\n needsActivation: \"boolean\",\n needsGitSetup: \"string — create | fast-forward | ready\",\n },\n },\n ownerModule: \"bootstrap\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n internal: true,\n};\n\nexport const BEGIN_BUILD_SESSION: McpToolContract = {\n name: \"begin_build_session\",\n description:\n \"Bootstrap a coding build session for a Lucern worktree. \" +\n \"Like `git worktree add` plus `git status` — returns the compact context packet an agent needs before editing.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The Lucern worktree ID to bootstrap.\",\n },\n branch: {\n type: \"string\",\n description:\n \"Optional git branch name. Auto-generated from the worktree name when omitted.\",\n },\n branchBase: {\n type: \"string\",\n description: 'Base branch for the feature branch. Default: \"staging\".',\n },\n prBase: {\n type: \"string\",\n description: 'Target branch for the PR. Default: \"staging\".',\n },\n sessionMode: {\n type: \"string\",\n description:\n 'Session mode: \"async\" for Codex/headless or \"interactive\" for live sessions.',\n enum: [\"async\", \"interactive\"],\n },\n activateIfPlanning: {\n type: \"boolean\",\n description:\n \"When true, automatically activate a planning worktree during bootstrap.\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description:\n \"A compact build-session packet with worktree metadata, graph anchors, questions, dependencies, and git defaults.\",\n fields: {\n topicId: \"string — canonical topic scope\",\n topicName: \"string — human-readable topic name\",\n worktreeId: \"string — worktree ID\",\n worktreeName: \"string — human-readable worktree name\",\n branch: \"string — git branch name\",\n branchBase: \"string — base branch\",\n prBase: \"string — PR target branch\",\n campaign: \"number | null — top-level pipeline campaign\",\n lane: \"string — campaign lane\",\n gate: \"string — exit gate\",\n hypothesis: \"string — worktree hypothesis\",\n focus: \"string — session focus\",\n status: \"string — worktree status after optional activation\",\n sessionMode: \"string — async | interactive\",\n targetBeliefIds: \"array — scoped belief IDs\",\n targetQuestionIds: \"array — scoped question IDs\",\n taskIds: \"array — assigned task IDs for this worktree\",\n incompleteTaskIds:\n \"array — assigned task IDs that still require done/deferred/blocked proof\",\n tasks:\n \"array — assigned task packet with id, title, status, priority, links, and summaries\",\n topBeliefs: \"array — highest-confidence scoped beliefs\",\n openQuestions: \"array — open scoped questions\",\n resolvedDecisions: \"array — answered questions summarized for the session\",\n dependencies: \"array — upstream worktrees\",\n unblocks: \"array — downstream worktrees\",\n mergeOrderNotes: \"string — merge ordering advisory\",\n },\n },\n ownerModule: \"bootstrap\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n internal: true,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tool-contracts.pipeline-coordination.ts"],"names":[],"mappings":";AAEO,IAAM,qBAAA,GAAyC;AAAA,EACpD,IAAA,EAAM,uBAAA;AAAA,EACN,WAAA,EACE,qNAAA;AAAA,EAEF,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,gBAAA,EAAiB;AAAA,IACzD,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA,EAA4B;AAAA,IACpE,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE;AAAA,KACJ;AAAA,IACA,WAAA,EAAa;AAAA,MACX,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,UAAA,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AAS,qCAAA;AAAA,MACT,SAAA,EAAW,yCAAA;AAAA,MACX,UAAA,EAAY,2BAAA;AAAA,MACZ,YAAA,EAAc,4CAAA;AAAA,MACd,MAAA,EAAQ,+BAAA;AAAA,MACR,UAAA,EAAY,2BAAA;AAAA,MACZ,MAAA,EAAQ,gCAAA;AAAA,MACR,QAAA,EAAU,kDAAA;AAAA,MACV,IAAA,EAAM,6BAAA;AAAA,MACN,IAAA,EAAM,yBAAA;AAAA,MACN,UAAA,EAAY,mCAAA;AAAA,MACZ,KAAA,EAAO,6BAAA;AAAA,MACP,MAAA,EAAQ,yDAAA;AAAA,MACR,WAAA,EAAa,mCAAA;AAAA,MACb,eAAA,EAAiB,gCAAA;AAAA,MACjB,iBAAA,EAAmB,kCAAA;AAAA,MACnB,OAAA,EAAS,kDAAA;AAAA,MACT,iBAAA,EACE,+EAAA;AAAA,MACF,KAAA,EACE,0FAAA;AAAA,MACF,UAAA,EAAY,gDAAA;AAAA,MACZ,aAAA,EAAe,oCAAA;AAAA,MACf,iBAAA,EAAmB,4DAAA;AAAA,MACnB,YAAA,EAAc,iCAAA;AAAA,MACd,QAAA,EAAU,mCAAA;AAAA,MACV,eAAA,EAAiB;AAAA;AACnB,GACF;AAAA,EACA,WAAA,EAAa,WAAA;AAAA,EACb,iBAAA,EAAmB,UAAA;AAAA,EACnB,IAAA,EAAM,UAAA;AAAA,EACN,QAAA,EAAU;AACZ","file":"tool-contracts.pipeline-coordination.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const RECORD_SCOPE_LEARNING: McpToolContract = {\n name: \"record_scope_learning\",\n description:\n \"Write a structured learning entry into the epistemic spine. \" +\n \"Like `git commit` for scope learnings — records evidence, can attach to a belief, and can open a follow-up belief/question in one atomic workflow.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope ID\" },\n summary: { type: \"string\", description: \"Atomic learning statement\" },\n title: {\n type: \"string\",\n description: \"Optional evidence title, such as a commit, doc, or issue.\",\n },\n body: {\n type: \"string\",\n description:\n \"Optional rich evidence body. If omitted, body is synthesized from summary and touched paths.\",\n },\n contentType: {\n type: \"string\",\n description: \"Optional evidence body format, such as markdown or text.\",\n },\n sourceKind: {\n type: \"string\",\n description: \"Source type for the learning event\",\n enum: [\"commit\", \"merge\", \"doc\", \"issue\", \"manual\"],\n },\n sourceRef: {\n type: \"string\",\n description: \"Optional source reference, such as SHA, PR number, or URL slug.\",\n },\n sourceUrl: { type: \"string\", description: \"Optional canonical source URL\" },\n touchedPaths: {\n type: \"array\",\n description: \"Optional touched file paths for retrieval hints\",\n },\n tags: { type: \"array\", description: \"Optional tags\" },\n linkedBeliefNodeId: {\n type: \"string\",\n description: \"Optional belief to attach evidence to\",\n },\n evidenceRelation: {\n type: \"string\",\n description: \"Relation to linked belief\",\n enum: [\"supports\", \"contradicts\"],\n },\n confidence: { type: \"number\", description: \"Optional confidence in [0,1]\" },\n createQuestionText: {\n type: \"string\",\n description: \"Optional follow-up question text\",\n },\n createBeliefText: {\n type: \"string\",\n description: \"Optional new belief text\",\n },\n beliefType: {\n type: \"string\",\n description: \"Optional belief type for createBeliefText\",\n },\n },\n required: [\"summary\"],\n response: {\n description: \"Created learning artifacts\",\n fields: {\n topicId: \"string — resolved topic ID\",\n evidenceNodeId: \"string\",\n linkedBeliefNodeId: \"string | null\",\n createdQuestionId: \"string | null\",\n createdBeliefId: \"string | null\",\n sourceUrl: \"string\",\n createdAt: \"number\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const PIPELINE_SNAPSHOT: McpToolContract = {\n name: \"pipeline_snapshot\",\n description:\n \"Summarize a topic's worktree pipeline in campaign-and-lane form. \" +\n \"Like `git status --short` for Lucern execution — returns the hinge worktree, next planned wave, blockers, critical path, superseded work, and graph hygiene debt.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope ID\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"Human-oriented pipeline summary for a single topic scope\",\n fields: {\n topicId: \"string\",\n topicName: \"string\",\n currentCampaign: \"number | null\",\n nextCampaign: \"number | null\",\n activeWorktrees: \"array — current hinge worktree(s)\",\n nextWave: \"array — worktrees in the next planned campaign\",\n readyNow: \"array — planning worktrees with dependencies completed\",\n blockedBy: \"array — grouped blockers\",\n criticalPath: \"array — ordered incomplete worktree chain\",\n campaigns: \"array — incomplete worktrees grouped by campaign\",\n superseded: \"array — worktrees marked superseded or not for activation\",\n graphHygiene: \"object — untargeted and taskless worktree debt\",\n riskQuestions: \"array — critical/high open questions\",\n narrative: \"array — concise natural-language summary lines\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const DISCOVER: McpToolContract = {\n name: \"discover\",\n description:\n \"Navigate the topic tree to find where knowledge lives. \" +\n \"Like `git log --all --grep` — searches across the graph using bottom-up content matching plus top-down structural scoring.\",\n parameters: {\n query: {\n type: \"string\",\n description: \"What to look for across the topic tree\",\n },\n topK: {\n type: \"number\",\n description: \"How many matching topics to return (default: 3, max: 10)\",\n },\n includeNeighborhood: {\n type: \"boolean\",\n description:\n \"Whether to include beliefs/questions/evidence for matched topics\",\n },\n },\n required: [\"query\"],\n response: {\n description: \"Ranked topic matches with optional neighborhood content\",\n fields: {\n query: \"string — original query\",\n matchedTopics: \"array — ranked topics with scores and paths\",\n neighborhoods: \"array — beliefs, questions, evidence for each match\",\n totalTopicsScored: \"number\",\n topicTreeSize: \"number\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n deprecated: \"Deprecated: use lucern.context.compile() with topicId\",\n};\n\nexport const ANALYZE_TOPIC_DENSITY: McpToolContract = {\n name: \"analyze_topic_density\",\n description:\n \"Analyze topic belief density and identify natural conceptual clusters. \" +\n \"Like `git diff --stat` for topic organization — detects when a topic has accumulated too many beliefs and suggests subtopic decomposition.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic ID to analyze\" },\n threshold: {\n type: \"number\",\n description: \"Belief count threshold for density warning\",\n },\n minModularity: {\n type: \"number\",\n description: \"Minimum modularity score for suggesting decomposition\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Density analysis with cluster suggestions\",\n fields: {\n topicId: \"string\",\n topicName: \"string\",\n beliefCount: \"number\",\n edgeCount: \"number\",\n threshold: \"number\",\n isDense: \"boolean\",\n modularity: \"number\",\n clusterCount: \"number\",\n clusters: \"array — suggested belief clusters\",\n recommendation: \"string\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const APPLY_AUTO_BRANCHING: McpToolContract = {\n name: \"apply_auto_branching\",\n description:\n \"Execute topic decomposition by creating subtopics and reassigning beliefs. \" +\n \"Like `git subtree split` — splits a dense topic into focused subtopics while preserving belief identity and edges.\",\n parameters: {\n topicId: { type: \"string\", description: \"Parent topic ID to decompose\" },\n clusters: {\n type: \"array\",\n description:\n \"Cluster definitions from analyze_topic_density, each with name and beliefIds\",\n },\n dryRun: {\n type: \"boolean\",\n description: \"Preview changes without applying them\",\n },\n },\n required: [\"topicId\", \"clusters\"],\n response: {\n description: \"Results of the auto-branching operation\",\n fields: {\n success: \"boolean\",\n parentTopicId: \"string\",\n createdSubtopics: \"array\",\n totalReassigned: \"number\",\n totalSkipped: \"number\",\n dryRun: \"boolean\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const SEED_BELIEF_LATTICE: McpToolContract = {\n name: \"seed_belief_lattice\",\n description:\n \"Seed belief lattice coverage for a topic based on its resolved ontology. \" +\n \"Like `git init` for ontology coverage — creates or previews seed beliefs for entity types that need a baseline anchor.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Topic scope ID. Lattice seeding must target a child topic.\",\n },\n dryRun: {\n type: \"boolean\",\n description: \"Preview seeds without creating them\",\n },\n },\n required: [],\n response: {\n description: \"Lattice seed results with per-entity-type status\",\n fields: {\n topicId: \"string\",\n ontologyResolved: \"boolean\",\n ontologyKey: \"string | null\",\n ontologyVersion: \"string | null\",\n entityTypeCount: \"number\",\n seeds: \"array — per-entity-type seed status\",\n summary: \"object — created/existing/scored/total counts\",\n dryRun: \"boolean\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const GET_LATTICE_COVERAGE: McpToolContract = {\n name: \"get_lattice_coverage\",\n description:\n \"Report belief lattice coverage for a topic. \" +\n \"Like `git fsck` for ontology coverage — identifies anchored, hollow, and missing entity-type belief coverage.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Topic scope ID to check lattice coverage for\",\n },\n },\n required: [],\n response: {\n description: \"Per-entity-type coverage with overall score\",\n fields: {\n topicId: \"string\",\n ontologyKey: \"string | null\",\n ontologyVersion: \"string | null\",\n entityTypes: \"array — per-entity-type coverage rows\",\n summary: \"object — total/anchored/hollow/missing/coverageScore\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const DISCOVER_ENTITY_CONNECTIONS: McpToolContract = {\n name: \"discover_entity_connections\",\n description:\n \"Find existing entities that should be connected to a belief/question/evidence node. \" +\n \"Like `git log --diff-filter=M` for missing entity connections — scans entities in scope and suggests bridge edge types.\",\n parameters: {\n nodeId: {\n type: \"string\",\n description: \"Epistemic node ID to find entity connections for\",\n },\n topicId: {\n type: \"string\",\n description: \"Optional topic scope override\",\n },\n minScore: {\n type: \"number\",\n description: \"Minimum match score threshold\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum candidates to return\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Ranked entity connection candidates\",\n fields: {\n nodeId: \"string\",\n candidateCount: \"number\",\n candidates: \"array — suggested entity bridge candidates\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\nexport const TRIGGER_BELIEF_REVIEW: McpToolContract = {\n name: \"trigger_belief_review\",\n description:\n \"Flag beliefs for review after an entity changes. \" +\n \"Like `git bisect` for stale beliefs — traverses bridge edges from the changed entity and creates review questions for stale connected beliefs.\",\n parameters: {\n entityNodeId: {\n type: \"string\",\n description: \"The entity node that changed\",\n },\n changeDescription: {\n type: \"string\",\n description: \"What changed about the entity\",\n },\n maxQuestions: {\n type: \"number\",\n description: \"Maximum review questions to create\",\n },\n },\n required: [\"entityNodeId\"],\n response: {\n description: \"Affected beliefs and created review questions\",\n fields: {\n entityNodeId: \"string\",\n entityTitle: \"string\",\n entityType: \"string\",\n changeDescription: \"string\",\n affectedBeliefCount: \"number\",\n questionsCreated: \"number\",\n reviewedBeliefs: \"array\",\n questions: \"array\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\nexport const EVALUATE_CONTRACT: McpToolContract = {\n name: \"evaluate_contract\",\n description:\n \"Run a contract evaluation and record the append-only result. \" +\n \"Like `git test` for a belief binding — executes the evaluator, logs the result, and applies any allowed SL scoring action.\",\n parameters: {\n contractId: { type: \"string\", description: \"Which contract to evaluate\" },\n trigger: {\n type: \"string\",\n description: \"What caused this evaluation\",\n },\n },\n required: [\"contractId\"],\n response: {\n description: \"The most recent contract evaluation result\",\n fields: {\n evaluationId: \"string\",\n result: \"string\",\n status: \"string\",\n confidenceBefore: \"number\",\n confidenceAfter: \"number\",\n rationale: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const GET_CONTRACT_STATUS: McpToolContract = {\n name: \"get_contract_status\",\n description:\n \"Inspect epistemic contracts and their latest evaluations. \" +\n \"Like `git status` for verification bindings — returns the contract rows plus the freshest recorded evaluation for each one.\",\n parameters: {\n beliefNodeId: {\n type: \"string\",\n description: \"Return all contracts attached to a specific belief\",\n },\n contractId: {\n type: \"string\",\n description: \"Return one specific contract by contractId\",\n },\n status: {\n type: \"string\",\n description: \"Optional status filter applied after lookup\",\n enum: [\"active\", \"satisfied\", \"violated\", \"expired\", \"suspended\", \"archived\"],\n },\n },\n required: [],\n response: {\n description: \"Matching contract rows with latest evaluation context\",\n fields: {\n contracts: \"array — matching contracts with latestEvaluation attached\",\n count: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const REGISTER_SESSION: McpToolContract = {\n name: \"register_session\",\n description:\n \"Announce this agent session's presence to other parallel sessions. \" +\n \"Like `git init` for coordination — creates a session record so other agents can discover you.\",\n parameters: {\n sessionName: { type: \"string\", description: \"Human-readable session label\" },\n agentType: { type: \"string\", description: \"Agent type\" },\n topicId: { type: \"string\", description: \"Current Lucern topic scope ID\" },\n worktreeId: { type: \"string\", description: \"Active Lucern worktree ID\" },\n gitBranch: { type: \"string\", description: \"Current git branch name\" },\n },\n required: [],\n response: {\n description: \"Session registration result\",\n fields: {\n sessionId: \"string\",\n status: \"string — active\",\n isNew: \"boolean\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const HEARTBEAT_SESSION: McpToolContract = {\n name: \"heartbeat_session\",\n description:\n \"Update this session's heartbeat and optional status fields. \" +\n \"Like `git status` — signals liveness and updates what you are working on.\",\n parameters: {\n topicId: { type: \"string\", description: \"Updated topic scope\" },\n worktreeId: { type: \"string\", description: \"Updated worktree ID\" },\n gitBranch: { type: \"string\", description: \"Updated git branch\" },\n status: {\n type: \"string\",\n description: \"Session status update\",\n enum: [\"active\", \"idle\"],\n },\n },\n required: [],\n response: {\n description: \"Heartbeat result\",\n fields: {\n success: \"boolean\",\n message: \"string\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const END_SESSION: McpToolContract = {\n name: \"end_session\",\n description:\n \"Gracefully end this agent session. \" +\n \"Like `git stash` — marks the session as ended so other agents know you are gone.\",\n parameters: {},\n required: [],\n response: {\n description: \"Session end result\",\n fields: {\n success: \"boolean\",\n message: \"string\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const LIST_ACTIVE_SESSIONS: McpToolContract = {\n name: \"list_active_sessions\",\n description:\n \"See who else is online with active agent sessions, scope, branch, and file claims. \" +\n \"Like `git branch --list` for live agents — shows active and idle sessions before editing.\",\n parameters: {\n includeIdle: {\n type: \"boolean\",\n description: \"Include idle sessions\",\n },\n },\n required: [],\n response: {\n description: \"List of active/idle agent sessions\",\n fields: {\n sessions: \"array — active session records\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const SEND_AGENT_MESSAGE: McpToolContract = {\n name: \"send_agent_message\",\n description:\n \"Send a directed message to a specific agent session. \" +\n \"Like `git notes` — leaves a coordination note for a specific peer.\",\n parameters: {\n toSessionId: { type: \"string\", description: \"Target session ID\" },\n content: { type: \"string\", description: \"Message text\" },\n messageType: {\n type: \"string\",\n description: \"Message intent\",\n enum: [\"note\", \"question\", \"answer\", \"alert\", \"handoff\"],\n },\n relatedBeliefId: {\n type: \"string\",\n description: \"Optional related belief node ID\",\n },\n relatedWorktreeId: {\n type: \"string\",\n description: \"Optional related worktree ID\",\n },\n },\n required: [\"toSessionId\", \"content\"],\n response: {\n description: \"Message delivery result\",\n fields: { messageId: \"string\" },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const BROADCAST_MESSAGE: McpToolContract = {\n name: \"broadcast_message\",\n description:\n \"Send a message to all active agent sessions. \" +\n \"Like `git tag` — marks an important event visible to everyone.\",\n parameters: {\n content: { type: \"string\", description: \"Broadcast message text\" },\n messageType: {\n type: \"string\",\n description: \"Message intent\",\n enum: [\"note\", \"alert\", \"handoff\"],\n },\n relatedBeliefId: {\n type: \"string\",\n description: \"Optional related belief node ID\",\n },\n relatedWorktreeId: {\n type: \"string\",\n description: \"Optional related worktree ID\",\n },\n },\n required: [\"content\"],\n response: {\n description: \"Broadcast result\",\n fields: { messageId: \"string\" },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const GET_AGENT_INBOX: McpToolContract = {\n name: \"get_agent_inbox\",\n description:\n \"Check unread messages addressed to this session. \" +\n \"Like `git log --incoming` — shows direct and broadcast messages from other agents.\",\n parameters: {\n limit: { type: \"number\", description: \"Max messages to return\" },\n markAsRead: {\n type: \"boolean\",\n description: \"Mark returned messages as read\",\n },\n },\n required: [],\n response: {\n description: \"Inbox messages\",\n fields: {\n messages: \"array — unread direct and broadcast messages\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const CLAIM_FILES: McpToolContract = {\n name: \"claim_files\",\n description:\n \"Declare which files this session is actively editing. \" +\n \"Like `git add` for coordination — tells other sessions what you are touching and returns advisory conflicts.\",\n parameters: {\n files: {\n type: \"array\",\n description: \"File paths this session is actively editing\",\n },\n },\n required: [\"files\"],\n response: {\n description: \"File claim result with conflict detection\",\n fields: {\n success: \"boolean\",\n conflicts: \"array — conflicting file claims\",\n },\n },\n ownerModule: \"coordination\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n internal: true,\n};\n\nexport const GENERATE_SESSION_HANDOFF: McpToolContract = {\n name: \"generate_session_handoff\",\n description:\n \"Generate a complete, zero-context handoff message for a new coding session. \" +\n \"Like `git format-patch` — produces a self-contained instruction set that bootstraps a fresh Lucern worktree session.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The Lucern worktree ID to generate handoff instructions for\",\n },\n gitWorktreePath: {\n type: \"string\",\n description: \"Optional existing git worktree path\",\n },\n gitBranchName: {\n type: \"string\",\n description: \"Optional branch name for the session\",\n },\n additionalContext: {\n type: \"string\",\n description: \"Optional extra context to include in the handoff\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"A complete handoff message ready for a new coding session\",\n fields: {\n handoffMessage: \"string\",\n worktreeId: \"string\",\n worktreeName: \"string\",\n trackBoundary: \"object\",\n needsActivation: \"boolean\",\n needsGitSetup: \"string — create | fast-forward | ready\",\n },\n },\n ownerModule: \"bootstrap\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n internal: true,\n};\n\nexport const BEGIN_BUILD_SESSION: McpToolContract = {\n name: \"begin_build_session\",\n description:\n \"Bootstrap a coding build session for a Lucern worktree. \" +\n \"Like `git worktree add` plus `git status` — returns the compact context packet an agent needs before editing.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The Lucern worktree ID to bootstrap.\",\n },\n branch: {\n type: \"string\",\n description:\n \"Optional git branch name. Auto-generated from the worktree name when omitted.\",\n },\n branchBase: {\n type: \"string\",\n description: 'Base branch for the feature branch. Default: \"staging\".',\n },\n prBase: {\n type: \"string\",\n description: 'Target branch for the PR. Default: \"staging\".',\n },\n sessionMode: {\n type: \"string\",\n description:\n 'Session mode: \"async\" for Codex/headless or \"interactive\" for live sessions.',\n enum: [\"async\", \"interactive\"],\n },\n activateIfPlanning: {\n type: \"boolean\",\n description:\n \"When true, automatically activate a planning worktree during bootstrap.\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description:\n \"A compact build-session packet with worktree metadata, graph anchors, questions, dependencies, and git defaults.\",\n fields: {\n topicId: \"string — canonical topic scope\",\n topicName: \"string — human-readable topic name\",\n worktreeId: \"string — worktree ID\",\n worktreeName: \"string — human-readable worktree name\",\n branch: \"string — git branch name\",\n branchBase: \"string — base branch\",\n prBase: \"string — PR target branch\",\n campaign: \"number | null — top-level pipeline campaign\",\n lane: \"string — campaign lane\",\n gate: \"string — exit gate\",\n hypothesis: \"string — worktree hypothesis\",\n focus: \"string — session focus\",\n status: \"string — worktree status after optional activation\",\n sessionMode: \"string — async | interactive\",\n targetBeliefIds: \"array — scoped belief IDs\",\n targetQuestionIds: \"array — scoped question IDs\",\n taskIds: \"array — assigned task IDs for this worktree\",\n incompleteTaskIds:\n \"array — assigned task IDs that still require done/deferred/blocked proof\",\n tasks:\n \"array — assigned task packet with id, title, status, priority, links, and summaries\",\n topBeliefs: \"array — highest-confidence scoped beliefs\",\n openQuestions: \"array — open scoped questions\",\n resolvedDecisions: \"array — answered questions summarized for the session\",\n dependencies: \"array — upstream worktrees\",\n unblocks: \"array — downstream worktrees\",\n mergeOrderNotes: \"string — merge ordering advisory\",\n },\n },\n ownerModule: \"bootstrap\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n internal: true,\n};\n"]}
|
|
@@ -802,6 +802,11 @@ var COMPILE_CONTEXT = {
|
|
|
802
802
|
response: {
|
|
803
803
|
description: "Compiled context pack for the requested topic",
|
|
804
804
|
fields: {
|
|
805
|
+
contextNarrative: "array \u2014 first field; ordered synthesis blocks with kind/text, starting with executive_summary and canonical narrative blocks before raw objects",
|
|
806
|
+
narrativeCoverage: "object \u2014 recordsSynthesized, recordsNamed, recordsOmitted, topicsSynthesized, topicsEnriched, topicContentOmitted, enrichmentMode, and blocksEmitted for the narrative",
|
|
807
|
+
synthesisLints: "array \u2014 inline quality warnings for degenerate synthesis blocks or weak narrative coverage",
|
|
808
|
+
retrievalReceipt: "object \u2014 candidateCounts, coverageWarning, narrativeCoverage, synthesisLints, and suggestedNextActions",
|
|
809
|
+
supportingObjects: "object \u2014 raw graph records grouped behind the synthesis: invariants, activeBeliefs, openQuestions, recentEvidence, worktrees, lanes, entities, and contradictions",
|
|
805
810
|
schemaVersion: "string",
|
|
806
811
|
topicId: "string",
|
|
807
812
|
topicName: "string",
|
|
@@ -809,15 +814,6 @@ var COMPILE_CONTEXT = {
|
|
|
809
814
|
generatedAt: "number \u2014 deterministic graph-backed reference timestamp for this compilation",
|
|
810
815
|
ranking: "string \u2014 baseline_v1 | weighted_v1",
|
|
811
816
|
summary: "object \u2014 counts and scoped health signals",
|
|
812
|
-
invariants: "array \u2014 high-confidence invariant beliefs",
|
|
813
|
-
activeBeliefs: "array \u2014 current high-signal beliefs",
|
|
814
|
-
openQuestions: "array \u2014 unresolved questions ranked for this query",
|
|
815
|
-
recentEvidence: "array \u2014 recent evidence ranked for this query",
|
|
816
|
-
contradictions: "array \u2014 unresolved contradiction records",
|
|
817
|
-
relatedEntities: "array | undefined \u2014 ranked ontological entities in scope",
|
|
818
|
-
contextNarrative: "array \u2014 ordered synthesis blocks with kind/text, starting with executive_summary and canonical narrative blocks before raw objects",
|
|
819
|
-
retrievalReceipt: "object \u2014 candidateCounts, coverageWarning, narrativeCoverage, synthesisLints, and suggestedNextActions",
|
|
820
|
-
narrativeCoverage: "object \u2014 recordsSynthesized, recordsNamed, recordsOmitted, topicsSynthesized, topicsEnriched, topicContentOmitted, enrichmentMode, and blocksEmitted for the narrative",
|
|
821
817
|
injectionPolicy: "object \u2014 token-budgeted section selections",
|
|
822
818
|
diagnostics: "object \u2014 scoring and utilization telemetry"
|
|
823
819
|
}
|