@lucern/contracts 0.3.0-alpha.0 → 0.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dsl.js +3 -0
- package/dist/dsl.js.map +1 -1
- package/dist/function-registry/beliefs.d.ts +11 -51
- package/dist/function-registry/beliefs.js +445 -94
- package/dist/function-registry/beliefs.js.map +1 -1
- package/dist/function-registry/coding.d.ts +7 -31
- package/dist/function-registry/coding.js +264 -81
- package/dist/function-registry/coding.js.map +1 -1
- package/dist/function-registry/context.d.ts +4 -16
- package/dist/function-registry/context.js +223 -62
- package/dist/function-registry/context.js.map +1 -1
- package/dist/function-registry/contracts.d.ts +4 -16
- package/dist/function-registry/contracts.js +195 -54
- package/dist/function-registry/contracts.js.map +1 -1
- package/dist/function-registry/coordination.d.ts +10 -46
- package/dist/function-registry/coordination.js +208 -57
- package/dist/function-registry/coordination.js.map +1 -1
- package/dist/function-registry/edges.d.ts +10 -18
- package/dist/function-registry/edges.js +343 -68
- package/dist/function-registry/edges.js.map +1 -1
- package/dist/function-registry/evidence.d.ts +17 -49
- package/dist/function-registry/evidence.js +395 -99
- package/dist/function-registry/evidence.js.map +1 -1
- package/dist/function-registry/graph.d.ts +14 -66
- package/dist/function-registry/graph.js +225 -65
- package/dist/function-registry/graph.js.map +1 -1
- package/dist/function-registry/helpers.d.ts +6 -8
- package/dist/function-registry/helpers.js +204 -55
- package/dist/function-registry/helpers.js.map +1 -1
- package/dist/function-registry/identity.d.ts +4 -16
- package/dist/function-registry/identity.js +195 -54
- package/dist/function-registry/identity.js.map +1 -1
- package/dist/function-registry/index.d.ts +2 -2
- package/dist/function-registry/index.js +204 -55
- package/dist/function-registry/index.js.map +1 -1
- package/dist/function-registry/judgments.d.ts +5 -13
- package/dist/function-registry/judgments.js +214 -63
- package/dist/function-registry/judgments.js.map +1 -1
- package/dist/function-registry/legacy.d.ts +2 -6
- package/dist/function-registry/legacy.js +195 -54
- package/dist/function-registry/legacy.js.map +1 -1
- package/dist/function-registry/lenses.d.ts +5 -21
- package/dist/function-registry/lenses.js +241 -58
- package/dist/function-registry/lenses.js.map +1 -1
- package/dist/function-registry/manifest.d.ts +3 -3
- package/dist/function-registry/manifest.js +1 -0
- package/dist/function-registry/manifest.js.map +1 -1
- package/dist/function-registry/ontologies.d.ts +12 -56
- package/dist/function-registry/ontologies.js +227 -77
- package/dist/function-registry/ontologies.js.map +1 -1
- package/dist/function-registry/pipeline.d.ts +4 -16
- package/dist/function-registry/pipeline.js +207 -55
- package/dist/function-registry/pipeline.js.map +1 -1
- package/dist/function-registry/questions.d.ts +13 -61
- package/dist/function-registry/questions.js +281 -82
- package/dist/function-registry/questions.js.map +1 -1
- package/dist/function-registry/tasks.d.ts +5 -21
- package/dist/function-registry/tasks.js +265 -58
- package/dist/function-registry/tasks.js.map +1 -1
- package/dist/function-registry/topics.d.ts +6 -26
- package/dist/function-registry/topics.js +214 -57
- package/dist/function-registry/topics.js.map +1 -1
- package/dist/function-registry/types.d.ts +2 -2
- package/dist/function-registry/worktrees.d.ts +49 -46
- package/dist/function-registry/worktrees.js +326 -81
- package/dist/function-registry/worktrees.js.map +1 -1
- package/dist/generated/convexSchemas.js +4 -3
- package/dist/generated/convexSchemas.js.map +1 -1
- package/dist/generated/schema-manifest.json +55 -3
- package/dist/generated/tableOwnership.d.ts +2 -1
- package/dist/generated/tableOwnership.js +2 -0
- package/dist/generated/tableOwnership.js.map +1 -1
- package/dist/generated/tier-expectations.json +6 -3
- package/dist/index-CV-0_VWJ.d.ts +25 -0
- package/dist/index.d.ts +414 -4
- package/dist/index.js +665 -62
- package/dist/index.js.map +1 -1
- package/dist/schema-helpers/validators.d.ts +1 -1
- package/dist/schema-helpers/validators.js +1 -1
- package/dist/schema-helpers/validators.js.map +1 -1
- package/dist/schemas/component-table-manifest.d.ts +74 -0
- package/dist/schemas/component-table-manifest.js +26 -0
- package/dist/schemas/component-table-manifest.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +68 -10
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/manifest.d.ts +110 -45
- package/dist/schemas/manifest.js +36 -9
- package/dist/schemas/manifest.js.map +1 -1
- package/dist/schemas/sl-opinion.d.ts +31 -0
- package/dist/schemas/sl-opinion.js +19 -0
- package/dist/schemas/sl-opinion.js.map +1 -0
- package/dist/schemas/tables/kernel/epistemic.d.ts +6 -4
- package/dist/schemas/tables/kernel/epistemic.js +6 -4
- package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
- package/dist/schemas/tables/kernel/infra.d.ts +13 -1
- package/dist/schemas/tables/kernel/infra.js +23 -1
- package/dist/schemas/tables/kernel/infra.js.map +1 -1
- package/dist/schemas/tables/kernel/worktree.d.ts +4 -4
- package/dist/schemas/tables/kernel/worktree.js +6 -4
- package/dist/schemas/tables/kernel/worktree.js.map +1 -1
- package/dist/schemas/tables/mc/runtime.d.ts +1 -1
- package/dist/schemas/tables/mc/runtime.js +1 -1
- package/dist/schemas/tables/mc/runtime.js.map +1 -1
- package/dist/sdk-methods.contract.d.ts +5 -2
- package/dist/{sdk-tools.contract-C2kQN_Xk.d.ts → sdk-tools.contract-S4ia0TTo.d.ts} +1 -1
- package/dist/sdk-tools.contract.d.ts +2 -2
- package/dist/sdk-tools.contract.js +154 -51
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/{tool-contracts-WCnuE9DW.d.ts → tool-contracts-C92-9ueT.d.ts} +5 -3
- package/dist/tool-contracts.d.ts +1 -1
- package/dist/tool-contracts.js +155 -52
- package/dist/tool-contracts.js.map +1 -1
- package/dist/workflow-runtime.contract.js +1 -1
- package/dist/workflow-runtime.contract.js.map +1 -1
- package/package.json +19 -1
- package/dist/index-DoDXl8KS.d.ts +0 -19
|
@@ -14,7 +14,7 @@ import * as zod from 'zod';
|
|
|
14
14
|
* 2. Knowledge tools use epistemic verbs (create_belief, fork_belief, modulate_confidence)
|
|
15
15
|
* 3. First sentence of description includes the git analog verb
|
|
16
16
|
* 4. Description includes "Like `git X`" parenthetical
|
|
17
|
-
* 5. Parameter names use domain terms (canonicalText, nodeId,
|
|
17
|
+
* 5. Parameter names use domain terms (canonicalText, nodeId, baseRate)
|
|
18
18
|
*/
|
|
19
19
|
type McpToolContract = {
|
|
20
20
|
/** Stable tool name — breaking change to rename */
|
|
@@ -115,11 +115,7 @@ declare const pipelineContracts: readonly [{
|
|
|
115
115
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
116
116
|
};
|
|
117
117
|
convex: FunctionConvexTarget | undefined;
|
|
118
|
-
args: zod.
|
|
119
|
-
[x: string]: any;
|
|
120
|
-
}, {
|
|
121
|
-
[x: string]: any;
|
|
122
|
-
}>;
|
|
118
|
+
args: zod.ZodTypeAny;
|
|
123
119
|
returns: zod.ZodTypeAny;
|
|
124
120
|
input: zod.ZodTypeAny;
|
|
125
121
|
output: zod.ZodTypeAny;
|
|
@@ -158,11 +154,7 @@ declare const pipelineContracts: readonly [{
|
|
|
158
154
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
159
155
|
};
|
|
160
156
|
convex: FunctionConvexTarget | undefined;
|
|
161
|
-
args: zod.
|
|
162
|
-
[x: string]: any;
|
|
163
|
-
}, {
|
|
164
|
-
[x: string]: any;
|
|
165
|
-
}>;
|
|
157
|
+
args: zod.ZodTypeAny;
|
|
166
158
|
returns: zod.ZodTypeAny;
|
|
167
159
|
input: zod.ZodTypeAny;
|
|
168
160
|
output: zod.ZodTypeAny;
|
|
@@ -201,11 +193,7 @@ declare const pipelineContracts: readonly [{
|
|
|
201
193
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
202
194
|
};
|
|
203
195
|
convex: FunctionConvexTarget | undefined;
|
|
204
|
-
args: zod.
|
|
205
|
-
[x: string]: any;
|
|
206
|
-
}, {
|
|
207
|
-
[x: string]: any;
|
|
208
|
-
}>;
|
|
196
|
+
args: zod.ZodTypeAny;
|
|
209
197
|
returns: zod.ZodTypeAny;
|
|
210
198
|
input: zod.ZodTypeAny;
|
|
211
199
|
output: zod.ZodTypeAny;
|
|
@@ -14,7 +14,7 @@ var LENS_PERSPECTIVE_TYPES = [
|
|
|
14
14
|
// src/tool-contracts.ts
|
|
15
15
|
var CREATE_BELIEF = {
|
|
16
16
|
name: "create_belief",
|
|
17
|
-
description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a
|
|
17
|
+
description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; use modulate_confidence to record the first evidential update.",
|
|
18
18
|
parameters: {
|
|
19
19
|
canonicalText: {
|
|
20
20
|
type: "string",
|
|
@@ -26,7 +26,7 @@ var CREATE_BELIEF = {
|
|
|
26
26
|
},
|
|
27
27
|
baseRate: {
|
|
28
28
|
type: "number",
|
|
29
|
-
description: "
|
|
29
|
+
description: "Prior probability used to seed the vacuous opinion `(0, 0, 1, a)` at creation time. Defaults to 0.5 when omitted."
|
|
30
30
|
},
|
|
31
31
|
beliefType: {
|
|
32
32
|
type: "string",
|
|
@@ -37,7 +37,7 @@ var CREATE_BELIEF = {
|
|
|
37
37
|
description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
required: ["canonicalText"
|
|
40
|
+
required: ["canonicalText"],
|
|
41
41
|
response: {
|
|
42
42
|
description: "The created canonical belief record",
|
|
43
43
|
fields: {
|
|
@@ -100,7 +100,7 @@ var REFINE_BELIEF = {
|
|
|
100
100
|
};
|
|
101
101
|
var MODULATE_CONFIDENCE = {
|
|
102
102
|
name: "modulate_confidence",
|
|
103
|
-
description: "Record a confidence change for a belief. Like `git commit` to the credence log \u2014 an atomic, append-only write. Each modulation is a new entry in the history, not an overwrite. Scoring happens via merge; this tool records the individual data points. Pass the full subjective-logic tuple (`belief`, `disbelief`, `uncertainty`, `baseRate`) directly. If a caller only has a scalar probability, use `@lucern/sdk` helpers `opinionFromBaseRate`, `opinionFromDogmatic`, or `opinionFromProjected` to name the intended interpretation before calling this tool. Triggers: evidence_added, evidence_removed, contradiction_detected, contradiction_resolved, agent_assessment, worktree_outcome, worktree_completed, fusion, discount, deduction
|
|
103
|
+
description: "Record a confidence change for a belief. Like `git commit` to the credence log \u2014 an atomic, append-only write. Each modulation is a new entry in the history, not an overwrite. Scoring happens via merge; this tool records the individual data points. Pass the full subjective-logic tuple (`belief`, `disbelief`, `uncertainty`, `baseRate`) directly. If a caller only has a scalar probability, use `@lucern/sdk` helpers `opinionFromBaseRate`, `opinionFromDogmatic`, or `opinionFromProjected` to name the intended interpretation before calling this tool. Every modulation must cite a truth-bearing artifact: triggeringEvidenceId, triggeringQuestionId, triggeringAnswerId, triggeringContradictionId, or triggeringWorktreeId. Triggers: evidence_added, evidence_removed, contradiction_detected, contradiction_resolved, agent_assessment, worktree_outcome, worktree_completed, fusion, discount, deduction.",
|
|
104
104
|
parameters: {
|
|
105
105
|
nodeId: { type: "string", description: "The belief to score" },
|
|
106
106
|
belief: {
|
|
@@ -119,9 +119,9 @@ var MODULATE_CONFIDENCE = {
|
|
|
119
119
|
type: "number",
|
|
120
120
|
description: "Subjective-logic base rate `a` in [0, 1]. Required for tuple payloads."
|
|
121
121
|
},
|
|
122
|
-
|
|
123
|
-
type: "
|
|
124
|
-
description: "
|
|
122
|
+
worktreeId: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Completed worktree that tested this belief when confidence policy requires merge-backed scoring."
|
|
125
125
|
},
|
|
126
126
|
trigger: {
|
|
127
127
|
type: "string",
|
|
@@ -136,17 +136,43 @@ var MODULATE_CONFIDENCE = {
|
|
|
136
136
|
"worktree_completed",
|
|
137
137
|
"fusion",
|
|
138
138
|
"discount",
|
|
139
|
-
"deduction"
|
|
140
|
-
"manual",
|
|
141
|
-
"decay"
|
|
139
|
+
"deduction"
|
|
142
140
|
]
|
|
143
141
|
},
|
|
142
|
+
triggeringEvidenceId: {
|
|
143
|
+
type: "string",
|
|
144
|
+
description: "Evidence node that caused an evidence-triggered modulation"
|
|
145
|
+
},
|
|
146
|
+
triggeringQuestionId: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: "Answered question whose resolution supports this modulation"
|
|
149
|
+
},
|
|
150
|
+
triggeringAnswerId: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Answer node whose content supports this modulation"
|
|
153
|
+
},
|
|
154
|
+
triggeringContradictionId: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "Contradiction record that caused a contradiction-triggered modulation"
|
|
157
|
+
},
|
|
158
|
+
triggeringWorktreeId: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "Completed worktree whose outcome caused a worktree-triggered modulation"
|
|
161
|
+
},
|
|
144
162
|
rationale: {
|
|
145
163
|
type: "string",
|
|
146
164
|
description: "Human-readable explanation of why confidence changed"
|
|
147
165
|
}
|
|
148
166
|
},
|
|
149
|
-
required: [
|
|
167
|
+
required: [
|
|
168
|
+
"nodeId",
|
|
169
|
+
"belief",
|
|
170
|
+
"disbelief",
|
|
171
|
+
"uncertainty",
|
|
172
|
+
"baseRate",
|
|
173
|
+
"trigger",
|
|
174
|
+
"rationale"
|
|
175
|
+
],
|
|
150
176
|
response: {
|
|
151
177
|
description: "Confidence modulation result",
|
|
152
178
|
fields: {
|
|
@@ -340,7 +366,7 @@ var ADD_EVIDENCE = {
|
|
|
340
366
|
description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'], failedApproach: true } for coding intelligence)"
|
|
341
367
|
}
|
|
342
368
|
},
|
|
343
|
-
required: ["canonicalText", "targetNodeId"],
|
|
369
|
+
required: ["canonicalText", "targetNodeId", "reasoning"],
|
|
344
370
|
response: {
|
|
345
371
|
description: "The created evidence node and its edge",
|
|
346
372
|
fields: {
|
|
@@ -421,9 +447,21 @@ var ADD_WORKTREE = {
|
|
|
421
447
|
type: "string",
|
|
422
448
|
description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
|
|
423
449
|
},
|
|
424
|
-
|
|
450
|
+
campaign: {
|
|
425
451
|
type: "number",
|
|
426
|
-
description: "
|
|
452
|
+
description: "Top-level pipeline campaign number. Campaigns define the outer execution slice."
|
|
453
|
+
},
|
|
454
|
+
lane: {
|
|
455
|
+
type: "string",
|
|
456
|
+
description: "GitButler-aligned workstream lane name inside the campaign."
|
|
457
|
+
},
|
|
458
|
+
laneOrderInCampaign: {
|
|
459
|
+
type: "number",
|
|
460
|
+
description: "Ordering for this lane within its campaign."
|
|
461
|
+
},
|
|
462
|
+
orderInLane: {
|
|
463
|
+
type: "number",
|
|
464
|
+
description: "Position of this worktree inside its lane."
|
|
427
465
|
},
|
|
428
466
|
dependsOn: {
|
|
429
467
|
type: "array",
|
|
@@ -1081,6 +1119,10 @@ var CREATE_EVIDENCE = {
|
|
|
1081
1119
|
type: "object",
|
|
1082
1120
|
description: "Optional metadata merged into the canonical evidence node"
|
|
1083
1121
|
},
|
|
1122
|
+
rationale: {
|
|
1123
|
+
type: "string",
|
|
1124
|
+
description: "Why this evidence should enter the reasoning graph"
|
|
1125
|
+
},
|
|
1084
1126
|
title: { type: "string", description: "Optional short title" },
|
|
1085
1127
|
content: { type: "string", description: "Optional long-form content" },
|
|
1086
1128
|
contentType: {
|
|
@@ -1089,7 +1131,7 @@ var CREATE_EVIDENCE = {
|
|
|
1089
1131
|
},
|
|
1090
1132
|
kind: { type: "string", description: "Optional evidence kind" }
|
|
1091
1133
|
},
|
|
1092
|
-
required: ["text"],
|
|
1134
|
+
required: ["text", "rationale"],
|
|
1093
1135
|
response: {
|
|
1094
1136
|
description: "The created canonical evidence record",
|
|
1095
1137
|
fields: {
|
|
@@ -1137,7 +1179,7 @@ var LIST_EVIDENCE = {
|
|
|
1137
1179
|
limit: { type: "number", description: "Max results" },
|
|
1138
1180
|
cursor: { type: "string", description: "Pagination cursor" }
|
|
1139
1181
|
},
|
|
1140
|
-
required: [],
|
|
1182
|
+
required: ["topicId"],
|
|
1141
1183
|
response: {
|
|
1142
1184
|
description: "Canonical evidence page",
|
|
1143
1185
|
fields: {
|
|
@@ -1322,6 +1364,7 @@ var ANSWER_QUESTION = {
|
|
|
1322
1364
|
description: "Answer a question with optional evidence links. Like `git commit` on the question thread \u2014 records the answer and closes the loop with a canonical answered state.",
|
|
1323
1365
|
parameters: {
|
|
1324
1366
|
id: { type: "string", description: "Canonical question ID" },
|
|
1367
|
+
topicId: { type: "string", description: "Topic scope for the answer" },
|
|
1325
1368
|
text: { type: "string", description: "Answer text" },
|
|
1326
1369
|
confidence: {
|
|
1327
1370
|
type: "string",
|
|
@@ -1334,7 +1377,7 @@ var ANSWER_QUESTION = {
|
|
|
1334
1377
|
},
|
|
1335
1378
|
rationale: { type: "string", description: "Why this answer is credible" }
|
|
1336
1379
|
},
|
|
1337
|
-
required: ["id", "text"],
|
|
1380
|
+
required: ["id", "topicId", "text"],
|
|
1338
1381
|
response: {
|
|
1339
1382
|
description: "Answer result",
|
|
1340
1383
|
fields: {
|
|
@@ -1553,6 +1596,10 @@ var LIST_BELIEFS = {
|
|
|
1553
1596
|
minConfidence: {
|
|
1554
1597
|
type: "number",
|
|
1555
1598
|
description: "Minimum confidence threshold"
|
|
1599
|
+
},
|
|
1600
|
+
limit: {
|
|
1601
|
+
type: "number",
|
|
1602
|
+
description: "Maximum results"
|
|
1556
1603
|
}
|
|
1557
1604
|
},
|
|
1558
1605
|
required: ["topicId"],
|
|
@@ -1569,20 +1616,37 @@ var LIST_BELIEFS = {
|
|
|
1569
1616
|
};
|
|
1570
1617
|
var LIST_WORKTREES = {
|
|
1571
1618
|
name: "list_worktrees",
|
|
1572
|
-
description: "List all worktrees for a topic. Like `git worktree list` \u2014 shows active and completed investigation branches with
|
|
1619
|
+
description: "List all worktrees for a topic. Like `git worktree list` \u2014 shows active and completed investigation branches with lifecycle phase, pipeline campaign/lane, status, and belief counts.",
|
|
1573
1620
|
parameters: {
|
|
1574
1621
|
topicId: { type: "string", description: "Topic scope" },
|
|
1575
1622
|
status: {
|
|
1576
1623
|
type: "string",
|
|
1577
1624
|
description: "Filter: active, merged, abandoned",
|
|
1578
1625
|
enum: ["active", "merged", "abandoned"]
|
|
1626
|
+
},
|
|
1627
|
+
groupBy: {
|
|
1628
|
+
type: "string",
|
|
1629
|
+
description: "Optional grouping mode for the response.",
|
|
1630
|
+
enum: ["campaign", "lane", "flat"]
|
|
1631
|
+
},
|
|
1632
|
+
lane: {
|
|
1633
|
+
type: "string",
|
|
1634
|
+
description: "Filter by GitButler-aligned lane name."
|
|
1635
|
+
},
|
|
1636
|
+
campaign: {
|
|
1637
|
+
type: "number",
|
|
1638
|
+
description: "Filter by top-level pipeline campaign number."
|
|
1639
|
+
},
|
|
1640
|
+
limit: {
|
|
1641
|
+
type: "number",
|
|
1642
|
+
description: "Maximum results to return."
|
|
1579
1643
|
}
|
|
1580
1644
|
},
|
|
1581
1645
|
required: ["topicId"],
|
|
1582
1646
|
response: {
|
|
1583
|
-
description: "Worktrees with phase, status, belief count, and creation time",
|
|
1647
|
+
description: "Worktrees with lifecycle phase, campaign, lane, status, belief count, and creation time",
|
|
1584
1648
|
fields: {
|
|
1585
|
-
worktrees: "array \u2014 { worktreeId, title, phase, status, beliefCount, createdAt }"
|
|
1649
|
+
worktrees: "array \u2014 { worktreeId, title, phase, campaign, lane, laneOrderInCampaign, orderInLane, status, beliefCount, createdAt }"
|
|
1586
1650
|
}
|
|
1587
1651
|
},
|
|
1588
1652
|
ownerModule: "workflow-engine",
|
|
@@ -1591,7 +1655,7 @@ var LIST_WORKTREES = {
|
|
|
1591
1655
|
};
|
|
1592
1656
|
var LIST_ALL_WORKTREES = {
|
|
1593
1657
|
name: "list_all_worktrees",
|
|
1594
|
-
description: "List ALL worktrees across ALL topics in one query. No topic scope required. Like `git worktree list --all` \u2014 returns the complete pipeline inventory with
|
|
1658
|
+
description: "List ALL worktrees across ALL topics in one query. No topic scope required. Like `git worktree list --all` \u2014 returns the complete pipeline inventory with campaign, lane, lane order, dependencies, and status. Supports filtering by status, lane, and campaign. This is the PM's primary pipeline query \u2014 one call, full picture.",
|
|
1595
1659
|
parameters: {
|
|
1596
1660
|
status: {
|
|
1597
1661
|
type: "string",
|
|
@@ -1609,13 +1673,18 @@ var LIST_ALL_WORKTREES = {
|
|
|
1609
1673
|
"dismissed"
|
|
1610
1674
|
]
|
|
1611
1675
|
},
|
|
1612
|
-
|
|
1676
|
+
lane: {
|
|
1613
1677
|
type: "string",
|
|
1614
|
-
description: "Filter by
|
|
1678
|
+
description: "Filter by lane name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity')"
|
|
1615
1679
|
},
|
|
1616
|
-
|
|
1680
|
+
campaign: {
|
|
1617
1681
|
type: "number",
|
|
1618
|
-
description: "Filter by
|
|
1682
|
+
description: "Filter by campaign number (e.g., 1, 2, 3). Returns only worktrees in that campaign."
|
|
1683
|
+
},
|
|
1684
|
+
groupBy: {
|
|
1685
|
+
type: "string",
|
|
1686
|
+
description: "Optional grouping mode for the response.",
|
|
1687
|
+
enum: ["campaign", "lane", "flat"]
|
|
1619
1688
|
},
|
|
1620
1689
|
limit: {
|
|
1621
1690
|
type: "number",
|
|
@@ -1626,10 +1695,39 @@ var LIST_ALL_WORKTREES = {
|
|
|
1626
1695
|
response: {
|
|
1627
1696
|
description: "All worktrees across all topics with full pipeline metadata",
|
|
1628
1697
|
fields: {
|
|
1629
|
-
worktrees: "array \u2014 { worktreeId, title, topicId, topicName, phase, status, hypothesis,
|
|
1698
|
+
worktrees: "array \u2014 { worktreeId, title, topicId, topicName, phase, status, hypothesis, campaign, lane, laneOrderInCampaign, orderInLane, dependsOn, blocks, gate, createdAt }",
|
|
1630
1699
|
total: "number \u2014 total count after filtering",
|
|
1631
|
-
|
|
1632
|
-
|
|
1700
|
+
lanes: "object \u2014 { laneName: count } summary of worktrees per lane",
|
|
1701
|
+
campaigns: "object \u2014 { campaignNumber: count } summary of worktrees per campaign"
|
|
1702
|
+
}
|
|
1703
|
+
},
|
|
1704
|
+
ownerModule: "workflow-engine",
|
|
1705
|
+
ontologyPrimitive: "worktree",
|
|
1706
|
+
tier: "showcase"
|
|
1707
|
+
};
|
|
1708
|
+
var LIST_CAMPAIGNS = {
|
|
1709
|
+
name: "list_campaigns",
|
|
1710
|
+
description: "List compact pipeline campaigns with their nested lanes. Use this to see the top-level campaign > lane > worktree shape without pulling the full worktree inventory.",
|
|
1711
|
+
parameters: {
|
|
1712
|
+
topicId: {
|
|
1713
|
+
type: "string",
|
|
1714
|
+
description: "Optional topic scope."
|
|
1715
|
+
},
|
|
1716
|
+
status: {
|
|
1717
|
+
type: "string",
|
|
1718
|
+
description: "Optional worktree status filter before grouping campaigns and lanes."
|
|
1719
|
+
},
|
|
1720
|
+
limit: {
|
|
1721
|
+
type: "number",
|
|
1722
|
+
description: "Maximum worktrees to scan before grouping."
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
required: [],
|
|
1726
|
+
response: {
|
|
1727
|
+
description: "Pipeline campaigns with nested lane summaries.",
|
|
1728
|
+
fields: {
|
|
1729
|
+
campaigns: "array \u2014 { campaign, lanes: [{ lane, laneOrderInCampaign, worktreeCount, activeCount, readyCount, blockedCount, completedCount, nextWorktree }] }",
|
|
1730
|
+
totalWorktrees: "number \u2014 total worktrees scanned after filtering"
|
|
1633
1731
|
}
|
|
1634
1732
|
},
|
|
1635
1733
|
ownerModule: "workflow-engine",
|
|
@@ -1692,16 +1790,28 @@ var UPDATE_WORKTREE_TARGETS = {
|
|
|
1692
1790
|
};
|
|
1693
1791
|
var UPDATE_WORKTREE_METADATA = {
|
|
1694
1792
|
name: "update_worktree_metadata",
|
|
1695
|
-
description: "Update worktree sequencing metadata \u2014
|
|
1793
|
+
description: "Update worktree sequencing metadata \u2014 campaign, lane, dependencies, blocking relations, and gates. Like `git config` for a worktree \u2014 sets the scheduling and dependency metadata that determines when this worktree can activate relative to others. Use to backfill or correct sequencing data.",
|
|
1696
1794
|
parameters: {
|
|
1697
1795
|
worktreeId: { type: "string", description: "The worktree to update" },
|
|
1698
1796
|
hypothesis: {
|
|
1699
1797
|
type: "string",
|
|
1700
1798
|
description: "Testable claim this worktree investigates"
|
|
1701
1799
|
},
|
|
1702
|
-
|
|
1800
|
+
campaign: {
|
|
1801
|
+
type: "number",
|
|
1802
|
+
description: "Top-level pipeline campaign number."
|
|
1803
|
+
},
|
|
1804
|
+
lane: {
|
|
1805
|
+
type: "string",
|
|
1806
|
+
description: "GitButler-aligned workstream lane name inside the campaign."
|
|
1807
|
+
},
|
|
1808
|
+
laneOrderInCampaign: {
|
|
1703
1809
|
type: "number",
|
|
1704
|
-
description: "
|
|
1810
|
+
description: "Ordering for this lane within the campaign."
|
|
1811
|
+
},
|
|
1812
|
+
orderInLane: {
|
|
1813
|
+
type: "number",
|
|
1814
|
+
description: "Position of this worktree inside its lane."
|
|
1705
1815
|
},
|
|
1706
1816
|
dependsOn: {
|
|
1707
1817
|
type: "array",
|
|
@@ -1739,18 +1849,6 @@ var UPDATE_WORKTREE_METADATA = {
|
|
|
1739
1849
|
type: "object",
|
|
1740
1850
|
description: "Calibrated auto-fix policy controlling dry-run vs safe execution, per-run action caps, and permitted mutation tiers."
|
|
1741
1851
|
},
|
|
1742
|
-
track: {
|
|
1743
|
-
type: "string",
|
|
1744
|
-
description: "Parallel workstream name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity', 'execution-program'). Groups worktrees into named lanes for pipeline visualization and PM analysis."
|
|
1745
|
-
},
|
|
1746
|
-
trackPosition: {
|
|
1747
|
-
type: "number",
|
|
1748
|
-
description: "Position within the track (1-indexed). E.g., TC-A=1, TC-B=2, TC-C=3 within the 'tc-scope' track."
|
|
1749
|
-
},
|
|
1750
|
-
executionBand: {
|
|
1751
|
-
type: "number",
|
|
1752
|
-
description: "Parallel execution band number. All worktrees in the same band can run simultaneously. Band 2 = OE-B + TC-A, Band 3 = TC-B + 11D-R + S2-13A, etc."
|
|
1753
|
-
},
|
|
1754
1852
|
status: {
|
|
1755
1853
|
type: "string",
|
|
1756
1854
|
description: "Override the worktree status. Use for lifecycle transitions like marking a worktree superseded, long-term, or as a raw idea.",
|
|
@@ -2120,6 +2218,10 @@ var LIST_TASKS = {
|
|
|
2120
2218
|
type: "string",
|
|
2121
2219
|
description: "Filter to tasks linked to this worktree"
|
|
2122
2220
|
},
|
|
2221
|
+
worktreeId: {
|
|
2222
|
+
type: "string",
|
|
2223
|
+
description: "Alias for linkedWorktreeId"
|
|
2224
|
+
},
|
|
2123
2225
|
status: {
|
|
2124
2226
|
type: "string",
|
|
2125
2227
|
description: "Filter by status: todo, in_progress, blocked, done",
|
|
@@ -2207,7 +2309,7 @@ var GET_TOPIC = {
|
|
|
2207
2309
|
description: "Legacy alias for topicId"
|
|
2208
2310
|
}
|
|
2209
2311
|
},
|
|
2210
|
-
required: [],
|
|
2312
|
+
required: ["topicId"],
|
|
2211
2313
|
response: {
|
|
2212
2314
|
description: "Single topic record",
|
|
2213
2315
|
fields: {
|
|
@@ -2562,7 +2664,7 @@ var GET_ONTOLOGY = {
|
|
|
2562
2664
|
description: "Tenant scope for key lookup. Omit for platform-level."
|
|
2563
2665
|
}
|
|
2564
2666
|
},
|
|
2565
|
-
required: [],
|
|
2667
|
+
required: ["id"],
|
|
2566
2668
|
response: {
|
|
2567
2669
|
description: "Ontology definition with latest published version",
|
|
2568
2670
|
fields: {
|
|
@@ -2629,7 +2731,7 @@ var MATCH_ENTITY_TYPE = {
|
|
|
2629
2731
|
description: "Optional maximum number of ranked matches to return"
|
|
2630
2732
|
}
|
|
2631
2733
|
},
|
|
2632
|
-
required: ["text"],
|
|
2734
|
+
required: ["text", "ontologyId"],
|
|
2633
2735
|
response: {
|
|
2634
2736
|
description: "Ranked ontology entity type matches",
|
|
2635
2737
|
fields: {
|
|
@@ -2883,7 +2985,7 @@ var RECORD_SCOPE_LEARNING = {
|
|
|
2883
2985
|
};
|
|
2884
2986
|
var PIPELINE_SNAPSHOT = {
|
|
2885
2987
|
name: "pipeline_snapshot",
|
|
2886
|
-
description: "Summarize a topic's worktree pipeline in
|
|
2988
|
+
description: "Summarize a topic's worktree pipeline in campaign-and-lane form. Like `git status --short` for Lucern execution \u2014 returns the hinge worktree, next planned wave, blockers, critical path, superseded work, and graph hygiene debt.",
|
|
2887
2989
|
parameters: {
|
|
2888
2990
|
topicId: { type: "string", description: "Topic scope ID" }
|
|
2889
2991
|
},
|
|
@@ -2893,14 +2995,14 @@ var PIPELINE_SNAPSHOT = {
|
|
|
2893
2995
|
fields: {
|
|
2894
2996
|
topicId: "string",
|
|
2895
2997
|
topicName: "string",
|
|
2896
|
-
|
|
2897
|
-
|
|
2998
|
+
currentCampaign: "number | null",
|
|
2999
|
+
nextCampaign: "number | null",
|
|
2898
3000
|
activeWorktrees: "array \u2014 current hinge worktree(s)",
|
|
2899
|
-
nextWave: "array \u2014 worktrees in the next planned
|
|
3001
|
+
nextWave: "array \u2014 worktrees in the next planned campaign",
|
|
2900
3002
|
readyNow: "array \u2014 planning worktrees with dependencies completed",
|
|
2901
3003
|
blockedBy: "array \u2014 grouped blockers",
|
|
2902
3004
|
criticalPath: "array \u2014 ordered incomplete worktree chain",
|
|
2903
|
-
|
|
3005
|
+
campaigns: "array \u2014 incomplete worktrees grouped by campaign",
|
|
2904
3006
|
superseded: "array \u2014 worktrees marked superseded or not for activation",
|
|
2905
3007
|
graphHygiene: "object \u2014 untargeted and taskless worktree debt",
|
|
2906
3008
|
riskQuestions: "array \u2014 critical/high open questions",
|
|
@@ -3489,6 +3591,7 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
3489
3591
|
list_beliefs: LIST_BELIEFS,
|
|
3490
3592
|
list_worktrees: LIST_WORKTREES,
|
|
3491
3593
|
list_all_worktrees: LIST_ALL_WORKTREES,
|
|
3594
|
+
list_campaigns: LIST_CAMPAIGNS,
|
|
3492
3595
|
activate_worktree: ACTIVATE_WORKTREE,
|
|
3493
3596
|
update_worktree_targets: UPDATE_WORKTREE_TARGETS,
|
|
3494
3597
|
update_worktree_metadata: UPDATE_WORKTREE_METADATA,
|
|
@@ -3671,6 +3774,7 @@ var MCP_WORKFLOW_PLATFORM_OPERATION_NAMES = [
|
|
|
3671
3774
|
"activate_worktree",
|
|
3672
3775
|
"list_worktrees",
|
|
3673
3776
|
"list_all_worktrees",
|
|
3777
|
+
"list_campaigns",
|
|
3674
3778
|
"update_worktree_targets",
|
|
3675
3779
|
"update_worktree_metadata",
|
|
3676
3780
|
"create_task",
|
|
@@ -3878,6 +3982,7 @@ var LUCERN_OPERATION_MANIFEST = {
|
|
|
3878
3982
|
|
|
3879
3983
|
// src/function-registry/helpers.ts
|
|
3880
3984
|
var jsonObjectSchema = z.record(z.unknown());
|
|
3985
|
+
var sdkSessionIdSchema = z.string().optional();
|
|
3881
3986
|
function mcpContractShape(contract) {
|
|
3882
3987
|
const required = new Set(contract.required);
|
|
3883
3988
|
return Object.fromEntries(
|
|
@@ -3912,10 +4017,40 @@ function argsSchemaFromMcpContract(contract) {
|
|
|
3912
4017
|
return z.object(mcpContractShape(contract));
|
|
3913
4018
|
}
|
|
3914
4019
|
function inputSchemaFromMcpContract(contract) {
|
|
3915
|
-
return argsSchemaFromMcpContract(contract)
|
|
4020
|
+
return withInternalSurfaceFields(argsSchemaFromMcpContract(contract));
|
|
4021
|
+
}
|
|
4022
|
+
function withInternalSurfaceFields(schema) {
|
|
4023
|
+
return schema.extend({ __sdkSessionId: sdkSessionIdSchema }).strict();
|
|
4024
|
+
}
|
|
4025
|
+
function normalizeInputSchema(schema) {
|
|
4026
|
+
if (schema instanceof z.ZodObject) {
|
|
4027
|
+
return withInternalSurfaceFields(schema);
|
|
4028
|
+
}
|
|
4029
|
+
return schema;
|
|
4030
|
+
}
|
|
4031
|
+
function unwrapObjectSchema(schema) {
|
|
4032
|
+
let current = schema;
|
|
4033
|
+
while (true) {
|
|
4034
|
+
switch (current._def.typeName) {
|
|
4035
|
+
case z.ZodFirstPartyTypeKind.ZodEffects:
|
|
4036
|
+
current = current._def.schema;
|
|
4037
|
+
continue;
|
|
4038
|
+
case z.ZodFirstPartyTypeKind.ZodBranded:
|
|
4039
|
+
current = current._def.type;
|
|
4040
|
+
continue;
|
|
4041
|
+
default:
|
|
4042
|
+
return current instanceof z.ZodObject ? current : void 0;
|
|
4043
|
+
}
|
|
4044
|
+
}
|
|
3916
4045
|
}
|
|
3917
4046
|
function getObjectShape(schema) {
|
|
3918
|
-
const
|
|
4047
|
+
const objectSchema = unwrapObjectSchema(schema);
|
|
4048
|
+
if (!objectSchema) {
|
|
4049
|
+
throw new Error(
|
|
4050
|
+
`Expected a Zod object schema, received ${schema._def.typeName}.`
|
|
4051
|
+
);
|
|
4052
|
+
}
|
|
4053
|
+
const shape = typeof objectSchema._def.shape === "function" ? objectSchema._def.shape() : objectSchema._def.shape;
|
|
3919
4054
|
return shape;
|
|
3920
4055
|
}
|
|
3921
4056
|
function unwrapMcpParameterSchema(schema) {
|
|
@@ -3936,6 +4071,9 @@ function unwrapMcpParameterSchema(schema) {
|
|
|
3936
4071
|
case z.ZodFirstPartyTypeKind.ZodBranded:
|
|
3937
4072
|
current = current._def.type;
|
|
3938
4073
|
continue;
|
|
4074
|
+
case z.ZodFirstPartyTypeKind.ZodEffects:
|
|
4075
|
+
current = current._def.schema;
|
|
4076
|
+
continue;
|
|
3939
4077
|
default:
|
|
3940
4078
|
return { schema: current, required, description: description ?? current.description };
|
|
3941
4079
|
}
|
|
@@ -3955,6 +4093,7 @@ function mcpParameterFromZod(fieldName, schema, contractName) {
|
|
|
3955
4093
|
return { parameter: { type: "array", description }, required };
|
|
3956
4094
|
case z.ZodFirstPartyTypeKind.ZodObject:
|
|
3957
4095
|
case z.ZodFirstPartyTypeKind.ZodRecord:
|
|
4096
|
+
case z.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
|
|
3958
4097
|
return { parameter: { type: "object", description }, required };
|
|
3959
4098
|
case z.ZodFirstPartyTypeKind.ZodEnum:
|
|
3960
4099
|
return {
|
|
@@ -4001,6 +4140,11 @@ function mcpContractFromArgsSchema(base, args, contractName) {
|
|
|
4001
4140
|
function defineFunctionContract(contract) {
|
|
4002
4141
|
return contract;
|
|
4003
4142
|
}
|
|
4143
|
+
function compactRecord(input) {
|
|
4144
|
+
return Object.fromEntries(
|
|
4145
|
+
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
4146
|
+
);
|
|
4147
|
+
}
|
|
4004
4148
|
function surfaceMcpContract(name) {
|
|
4005
4149
|
const contract = MCP_TOOL_CONTRACTS[name];
|
|
4006
4150
|
if (!contract) {
|
|
@@ -4045,7 +4189,9 @@ function surfaceContract(args) {
|
|
|
4045
4189
|
const canonicalArgs = args.args ?? argsSchemaFromMcpContract(baseMcp);
|
|
4046
4190
|
const mcp = args.args ? mcpContractFromArgsSchema(baseMcp, canonicalArgs, args.name) : baseMcp;
|
|
4047
4191
|
const canonicalReturns = args.returns ?? jsonObjectSchema;
|
|
4048
|
-
const input =
|
|
4192
|
+
const input = normalizeInputSchema(
|
|
4193
|
+
args.input ?? inputSchemaFromMcpContract(mcp)
|
|
4194
|
+
);
|
|
4049
4195
|
const output = args.output ?? canonicalReturns;
|
|
4050
4196
|
return defineFunctionContract({
|
|
4051
4197
|
name: args.name,
|
|
@@ -4103,7 +4249,13 @@ var pipelineContracts = [
|
|
|
4103
4249
|
convex: {
|
|
4104
4250
|
module: "worktrees",
|
|
4105
4251
|
functionName: "listAll",
|
|
4106
|
-
kind: "query"
|
|
4252
|
+
kind: "query",
|
|
4253
|
+
inputProjection: (input) => compactRecord({
|
|
4254
|
+
status: input.status,
|
|
4255
|
+
lane: input.lane,
|
|
4256
|
+
campaign: input.campaign,
|
|
4257
|
+
limit: input.limit
|
|
4258
|
+
})
|
|
4107
4259
|
}
|
|
4108
4260
|
}),
|
|
4109
4261
|
surfaceContract({
|