@lucern/events 0.3.0-alpha.3 → 0.3.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2034 -85
- package/dist/index.js.map +1 -1
- package/dist/outbox.js +2034 -85
- package/dist/outbox.js.map +1 -1
- package/dist/types.js +2034 -85
- package/dist/types.js.map +1 -1
- package/dist/webhooks.js +2034 -85
- package/dist/webhooks.js.map +1 -1
- package/package.json +2 -2
package/dist/types.js
CHANGED
|
@@ -1,6 +1,487 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { v } from 'convex/values';
|
|
3
3
|
|
|
4
|
+
// ../contracts/src/graph-intelligence.contract.ts
|
|
5
|
+
var GRAPH_INTELLIGENCE_MODE_TOOL_NAMES = {
|
|
6
|
+
core: [
|
|
7
|
+
"get_graph_structure_analysis",
|
|
8
|
+
"get_topic_coverage",
|
|
9
|
+
"get_graph_gaps",
|
|
10
|
+
"list_beliefs",
|
|
11
|
+
"list_questions",
|
|
12
|
+
"search_evidence"
|
|
13
|
+
],
|
|
14
|
+
bias: [
|
|
15
|
+
"get_graph_structure_analysis",
|
|
16
|
+
"detect_confirmation_bias",
|
|
17
|
+
"find_contradictions",
|
|
18
|
+
"search_evidence",
|
|
19
|
+
"list_beliefs"
|
|
20
|
+
],
|
|
21
|
+
stress: [
|
|
22
|
+
"get_graph_structure_analysis",
|
|
23
|
+
"get_graph_gaps",
|
|
24
|
+
"find_contradictions",
|
|
25
|
+
"get_falsification_questions",
|
|
26
|
+
"list_beliefs",
|
|
27
|
+
"list_questions"
|
|
28
|
+
],
|
|
29
|
+
operational: [
|
|
30
|
+
"get_topic_coverage",
|
|
31
|
+
"get_graph_gaps",
|
|
32
|
+
"list_beliefs",
|
|
33
|
+
"list_questions",
|
|
34
|
+
"search_evidence"
|
|
35
|
+
],
|
|
36
|
+
alpha: [
|
|
37
|
+
"get_graph_structure_analysis",
|
|
38
|
+
"detect_confirmation_bias",
|
|
39
|
+
"find_contradictions",
|
|
40
|
+
"search_beliefs",
|
|
41
|
+
"search_evidence"
|
|
42
|
+
],
|
|
43
|
+
semantic: [
|
|
44
|
+
"get_graph_structure_analysis",
|
|
45
|
+
"search_beliefs",
|
|
46
|
+
"search_evidence",
|
|
47
|
+
"traverse_graph",
|
|
48
|
+
"query_lineage",
|
|
49
|
+
"get_graph_neighborhood"
|
|
50
|
+
],
|
|
51
|
+
evidence: [
|
|
52
|
+
"get_graph_structure_analysis",
|
|
53
|
+
"get_topic_coverage",
|
|
54
|
+
"search_evidence",
|
|
55
|
+
"get_falsification_questions",
|
|
56
|
+
"find_contradictions"
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
var byMode = (mode) => GRAPH_INTELLIGENCE_MODE_TOOL_NAMES[mode];
|
|
60
|
+
var GRAPH_INTELLIGENCE_QUERIES = [
|
|
61
|
+
{
|
|
62
|
+
id: "confirmation-bias",
|
|
63
|
+
categoryId: "problems",
|
|
64
|
+
mode: "bias",
|
|
65
|
+
name: "Find Confirmation Bias",
|
|
66
|
+
description: "Find beliefs supported mainly by confirming evidence.",
|
|
67
|
+
prompt: "Find beliefs where supporting evidence overwhelms challenging evidence. Prioritize high-conviction beliefs with few defeaters.",
|
|
68
|
+
highlightStrategy: "bias-risk",
|
|
69
|
+
riskLevel: "high"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "contradiction-map",
|
|
73
|
+
categoryId: "problems",
|
|
74
|
+
mode: "stress",
|
|
75
|
+
name: "Map Contradictions",
|
|
76
|
+
description: "Surface direct and indirect contradiction clusters.",
|
|
77
|
+
prompt: "Map the graph's contradiction clusters and explain which tensions matter most.",
|
|
78
|
+
highlightStrategy: "contradictions",
|
|
79
|
+
riskLevel: "high"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "weak-evidence",
|
|
83
|
+
categoryId: "problems",
|
|
84
|
+
mode: "stress",
|
|
85
|
+
name: "Weak Evidence Chains",
|
|
86
|
+
description: "Find important claims with thin or indirect evidence.",
|
|
87
|
+
prompt: "Find high-importance beliefs whose evidence support is thin, indirect, stale, or low quality.",
|
|
88
|
+
highlightStrategy: "weak-support",
|
|
89
|
+
riskLevel: "medium"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "single-source",
|
|
93
|
+
categoryId: "problems",
|
|
94
|
+
mode: "bias",
|
|
95
|
+
name: "Single-Source Risk",
|
|
96
|
+
description: "Find claims overly dependent on one source or source type.",
|
|
97
|
+
prompt: "Identify beliefs that rely on a single source, one methodology, or one repeated perspective.",
|
|
98
|
+
highlightStrategy: "source-concentration",
|
|
99
|
+
riskLevel: "medium"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "untested-assumptions",
|
|
103
|
+
categoryId: "problems",
|
|
104
|
+
mode: "stress",
|
|
105
|
+
name: "Untested Assumptions",
|
|
106
|
+
description: "Find load-bearing assumptions without falsification paths.",
|
|
107
|
+
prompt: "Find assumptions that appear load-bearing but do not have direct testing questions or falsification evidence.",
|
|
108
|
+
highlightStrategy: "untested",
|
|
109
|
+
riskLevel: "high"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "load-bearing-beliefs",
|
|
113
|
+
categoryId: "problems",
|
|
114
|
+
mode: "stress",
|
|
115
|
+
name: "Load-Bearing Beliefs",
|
|
116
|
+
description: "Find central beliefs whose failure would affect many claims.",
|
|
117
|
+
prompt: "Find the beliefs with the largest downstream impact if they are wrong.",
|
|
118
|
+
highlightStrategy: "load-bearing",
|
|
119
|
+
riskLevel: "high"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: "cascade-analysis",
|
|
123
|
+
categoryId: "problems",
|
|
124
|
+
mode: "stress",
|
|
125
|
+
name: "Cascade Analysis",
|
|
126
|
+
description: "Trace what changes if a belief is weakened or invalidated.",
|
|
127
|
+
prompt: "Analyze likely downstream cascades if the most central or uncertain beliefs are weakened.",
|
|
128
|
+
highlightStrategy: "cascade",
|
|
129
|
+
riskLevel: "high"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "unanswered-questions",
|
|
133
|
+
categoryId: "gaps",
|
|
134
|
+
mode: "operational",
|
|
135
|
+
name: "Unanswered Questions",
|
|
136
|
+
description: "Find important open questions that block confidence.",
|
|
137
|
+
prompt: "Identify the most important unanswered questions and explain which beliefs they block.",
|
|
138
|
+
highlightStrategy: "open-questions"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "thin-themes",
|
|
142
|
+
categoryId: "gaps",
|
|
143
|
+
mode: "operational",
|
|
144
|
+
name: "Thin Themes",
|
|
145
|
+
description: "Find topics with shallow belief or evidence coverage.",
|
|
146
|
+
prompt: "Find themes that look underdeveloped relative to their role in the graph.",
|
|
147
|
+
highlightStrategy: "thin-themes"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: "missing-evidence",
|
|
151
|
+
categoryId: "gaps",
|
|
152
|
+
mode: "stress",
|
|
153
|
+
name: "Missing Evidence",
|
|
154
|
+
description: "Find beliefs that need specific missing evidence.",
|
|
155
|
+
prompt: "Find the most valuable missing evidence needed to strengthen or falsify the graph.",
|
|
156
|
+
highlightStrategy: "missing-evidence"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: "isolated-clusters",
|
|
160
|
+
categoryId: "gaps",
|
|
161
|
+
mode: "operational",
|
|
162
|
+
name: "Isolated Clusters",
|
|
163
|
+
description: "Find clusters not connected to the broader graph.",
|
|
164
|
+
prompt: "Find isolated graph clusters and recommend bridge questions or bridge evidence.",
|
|
165
|
+
highlightStrategy: "isolated-clusters"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "source-contribution",
|
|
169
|
+
categoryId: "gaps",
|
|
170
|
+
mode: "evidence",
|
|
171
|
+
name: "Source Contribution",
|
|
172
|
+
description: "Assess how source mix shapes the graph.",
|
|
173
|
+
prompt: "Assess whether the source mix is balanced enough for the graph's strongest claims.",
|
|
174
|
+
highlightStrategy: "source-mix"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: "stale-beliefs",
|
|
178
|
+
categoryId: "gaps",
|
|
179
|
+
mode: "operational",
|
|
180
|
+
name: "Stale Beliefs",
|
|
181
|
+
description: "Find beliefs that need review because they are old or stale.",
|
|
182
|
+
prompt: "Find beliefs that should be revisited because they are stale, unsupported by recent evidence, or contradicted by newer context.",
|
|
183
|
+
highlightStrategy: "staleness"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "assumption-pyramid",
|
|
187
|
+
categoryId: "reasoning",
|
|
188
|
+
mode: "operational",
|
|
189
|
+
name: "Assumption Pyramid",
|
|
190
|
+
description: "Show which conclusions rest on which assumptions.",
|
|
191
|
+
prompt: "Build an assumption pyramid from the graph: foundational assumptions, intermediate claims, and top-level conclusions.",
|
|
192
|
+
highlightStrategy: "assumptions"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: "converging-evidence",
|
|
196
|
+
categoryId: "reasoning",
|
|
197
|
+
mode: "evidence",
|
|
198
|
+
name: "Converging Evidence",
|
|
199
|
+
description: "Find claims supported by independent evidence streams.",
|
|
200
|
+
prompt: "Find beliefs with genuinely independent converging evidence and explain why they are robust.",
|
|
201
|
+
highlightStrategy: "convergence"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "weakest-links",
|
|
205
|
+
categoryId: "reasoning",
|
|
206
|
+
mode: "stress",
|
|
207
|
+
name: "Weakest Links",
|
|
208
|
+
description: "Find the weakest links in important reasoning chains.",
|
|
209
|
+
prompt: "Find the weakest links in important reasoning chains and explain how to test them.",
|
|
210
|
+
highlightStrategy: "weak-links",
|
|
211
|
+
riskLevel: "medium"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "challenged-beliefs",
|
|
215
|
+
categoryId: "reasoning",
|
|
216
|
+
mode: "stress",
|
|
217
|
+
name: "Challenged Beliefs",
|
|
218
|
+
description: "Find beliefs with active challenges or defeaters.",
|
|
219
|
+
prompt: "Find beliefs with active challenges, contradiction edges, or unresolved defeaters.",
|
|
220
|
+
highlightStrategy: "challenged"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: "contrarian-map",
|
|
224
|
+
categoryId: "strategic",
|
|
225
|
+
mode: "alpha",
|
|
226
|
+
name: "Contrarian Map",
|
|
227
|
+
description: "Find non-consensus beliefs and where they are grounded.",
|
|
228
|
+
prompt: "Find the graph's strongest contrarian or non-consensus beliefs and explain their support.",
|
|
229
|
+
highlightStrategy: "contrarian"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: "irreversibility-audit",
|
|
233
|
+
categoryId: "strategic",
|
|
234
|
+
mode: "stress",
|
|
235
|
+
name: "Irreversibility Audit",
|
|
236
|
+
description: "Find irreversible bets and assumptions behind them.",
|
|
237
|
+
prompt: "Audit irreversible decisions or beliefs and identify what must be true before acting.",
|
|
238
|
+
highlightStrategy: "irreversible",
|
|
239
|
+
riskLevel: "high"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: "pre-mortem",
|
|
243
|
+
categoryId: "strategic",
|
|
244
|
+
mode: "stress",
|
|
245
|
+
name: "Pre-Mortem",
|
|
246
|
+
description: "Explain how the graph could be wrong.",
|
|
247
|
+
prompt: "Run a pre-mortem: assume the current thesis fails and identify the most plausible failure paths.",
|
|
248
|
+
highlightStrategy: "failure-paths",
|
|
249
|
+
riskLevel: "high"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: "devils-advocate",
|
|
253
|
+
categoryId: "strategic",
|
|
254
|
+
mode: "stress",
|
|
255
|
+
name: "Devil's Advocate",
|
|
256
|
+
description: "Generate the strongest critique of the graph.",
|
|
257
|
+
prompt: "Produce the strongest evidence-grounded critique of the current graph and its main thesis.",
|
|
258
|
+
highlightStrategy: "critique"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: "falsification-map",
|
|
262
|
+
categoryId: "strategic",
|
|
263
|
+
mode: "stress",
|
|
264
|
+
name: "Falsification Map",
|
|
265
|
+
description: "Find the cheapest tests that would disprove key beliefs.",
|
|
266
|
+
prompt: "Map the cheapest, clearest falsification tests for the graph's key claims.",
|
|
267
|
+
highlightStrategy: "falsification",
|
|
268
|
+
riskLevel: "high"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: "prediction-tracker",
|
|
272
|
+
categoryId: "strategic",
|
|
273
|
+
mode: "evidence",
|
|
274
|
+
name: "Prediction Tracker",
|
|
275
|
+
description: "Find beliefs that imply measurable predictions.",
|
|
276
|
+
prompt: "Find beliefs that imply measurable predictions and suggest tracking signals.",
|
|
277
|
+
highlightStrategy: "predictions"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
id: "belief-pagerank",
|
|
281
|
+
categoryId: "deep",
|
|
282
|
+
mode: "semantic",
|
|
283
|
+
name: "Belief PageRank",
|
|
284
|
+
description: "Identify structurally central beliefs.",
|
|
285
|
+
prompt: "Use graph centrality to identify the most structurally important beliefs.",
|
|
286
|
+
highlightStrategy: "centrality"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
id: "underdetermination",
|
|
290
|
+
categoryId: "deep",
|
|
291
|
+
mode: "semantic",
|
|
292
|
+
name: "Underdetermination",
|
|
293
|
+
description: "Find places where evidence supports multiple explanations.",
|
|
294
|
+
prompt: "Find places where the same evidence could support multiple incompatible explanations.",
|
|
295
|
+
highlightStrategy: "underdetermination"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "confidence-propagation",
|
|
299
|
+
categoryId: "deep",
|
|
300
|
+
mode: "semantic",
|
|
301
|
+
name: "Confidence Propagation",
|
|
302
|
+
description: "Assess how uncertainty moves through the graph.",
|
|
303
|
+
prompt: "Explain how uncertainty propagates from weak or contested beliefs through downstream conclusions.",
|
|
304
|
+
highlightStrategy: "confidence-flow"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
id: "argument-depth",
|
|
308
|
+
categoryId: "deep",
|
|
309
|
+
mode: "evidence",
|
|
310
|
+
name: "Argument Depth",
|
|
311
|
+
description: "Assess reasoning depth and chain quality.",
|
|
312
|
+
prompt: "Assess reasoning depth: where claims are shallow, deeply supported, or overextended.",
|
|
313
|
+
highlightStrategy: "depth"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: "information-edge",
|
|
317
|
+
categoryId: "deep",
|
|
318
|
+
mode: "alpha",
|
|
319
|
+
name: "Information Edge",
|
|
320
|
+
description: "Find differentiated evidence or signals.",
|
|
321
|
+
prompt: "Find evidence, sources, or beliefs that could represent differentiated information edge.",
|
|
322
|
+
highlightStrategy: "information-edge"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: "thesis-summary",
|
|
326
|
+
categoryId: "browse",
|
|
327
|
+
mode: "semantic",
|
|
328
|
+
name: "Thesis Summary",
|
|
329
|
+
description: "Summarize the graph's core thesis and support.",
|
|
330
|
+
prompt: "Summarize the graph's core thesis, strongest support, weakest support, and open questions.",
|
|
331
|
+
highlightStrategy: "summary"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
id: "theme-deep-dive",
|
|
335
|
+
categoryId: "browse",
|
|
336
|
+
mode: "semantic",
|
|
337
|
+
name: "Theme Deep Dive",
|
|
338
|
+
description: "Deep dive into a named theme.",
|
|
339
|
+
prompt: "Deep dive into {input}. Explain the key beliefs, evidence, contradictions, and open questions.",
|
|
340
|
+
inputType: "theme",
|
|
341
|
+
highlightStrategy: "theme"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "belief-detail",
|
|
345
|
+
categoryId: "browse",
|
|
346
|
+
mode: "semantic",
|
|
347
|
+
name: "Belief Detail",
|
|
348
|
+
description: "Explain one belief and its graph neighborhood.",
|
|
349
|
+
prompt: "Explain {input} and its support, challenges, related beliefs, and downstream implications.",
|
|
350
|
+
inputType: "belief",
|
|
351
|
+
highlightStrategy: "belief"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: "strongest-beliefs",
|
|
355
|
+
categoryId: "browse",
|
|
356
|
+
mode: "operational",
|
|
357
|
+
name: "Strongest Beliefs",
|
|
358
|
+
description: "Find the graph's strongest current beliefs.",
|
|
359
|
+
prompt: "Find the strongest current beliefs and explain why each one deserves confidence.",
|
|
360
|
+
highlightStrategy: "strongest"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: "cross-theme-connection",
|
|
364
|
+
categoryId: "browse",
|
|
365
|
+
mode: "semantic",
|
|
366
|
+
name: "Cross-Theme Connections",
|
|
367
|
+
description: "Find bridges between themes.",
|
|
368
|
+
prompt: "Find meaningful connections across themes and explain which bridge beliefs matter.",
|
|
369
|
+
highlightStrategy: "bridges"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: "research-velocity",
|
|
373
|
+
categoryId: "browse",
|
|
374
|
+
mode: "operational",
|
|
375
|
+
name: "Research Velocity",
|
|
376
|
+
description: "Summarize recent graph movement and momentum.",
|
|
377
|
+
prompt: "Assess research velocity: what changed recently, where progress is fastest, and what is stuck.",
|
|
378
|
+
highlightStrategy: "velocity"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: "search",
|
|
382
|
+
categoryId: "browse",
|
|
383
|
+
mode: "semantic",
|
|
384
|
+
name: "Graph Search",
|
|
385
|
+
description: "Search the graph with semantic context.",
|
|
386
|
+
prompt: "Search the graph for {input}. Return the most relevant beliefs, evidence, and questions.",
|
|
387
|
+
inputType: "search",
|
|
388
|
+
highlightStrategy: "search"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
id: "expert-coverage",
|
|
392
|
+
categoryId: "browse",
|
|
393
|
+
mode: "semantic",
|
|
394
|
+
name: "Expert Coverage",
|
|
395
|
+
description: "Assess coverage from expert/source perspectives.",
|
|
396
|
+
prompt: "Assess whether the graph has enough expert, primary, and dissenting coverage.",
|
|
397
|
+
highlightStrategy: "expert-coverage"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: "value-chain-map",
|
|
401
|
+
categoryId: "browse",
|
|
402
|
+
mode: "semantic",
|
|
403
|
+
name: "Value Chain Map",
|
|
404
|
+
description: "Map entities, dependencies, and value-chain logic.",
|
|
405
|
+
prompt: "Map the value chain implied by this graph: entities, dependencies, pressure points, and missing links.",
|
|
406
|
+
highlightStrategy: "value-chain"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: "meeting-brief",
|
|
410
|
+
categoryId: "prep",
|
|
411
|
+
mode: "semantic",
|
|
412
|
+
name: "Meeting Brief",
|
|
413
|
+
description: "Prepare a meeting brief from graph context.",
|
|
414
|
+
prompt: "Prepare a concise meeting brief using the graph: thesis, open questions, risks, and recommended asks.",
|
|
415
|
+
highlightStrategy: "brief"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: "open-questions-entity",
|
|
419
|
+
categoryId: "prep",
|
|
420
|
+
mode: "semantic",
|
|
421
|
+
name: "Entity Open Questions",
|
|
422
|
+
description: "Find open questions about a specific entity.",
|
|
423
|
+
prompt: "Find the most important open questions about {input} and the beliefs those questions would unlock.",
|
|
424
|
+
inputType: "entity",
|
|
425
|
+
highlightStrategy: "entity-questions"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: "company-context",
|
|
429
|
+
categoryId: "prep",
|
|
430
|
+
mode: "semantic",
|
|
431
|
+
name: "Company Context",
|
|
432
|
+
description: "Summarize graph context about a company.",
|
|
433
|
+
prompt: "Summarize what the graph knows about {input}: thesis relevance, evidence, risks, and open questions.",
|
|
434
|
+
inputType: "company",
|
|
435
|
+
highlightStrategy: "company"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
id: "company-theme-fit",
|
|
439
|
+
categoryId: "prep",
|
|
440
|
+
mode: "semantic",
|
|
441
|
+
name: "Company Theme Fit",
|
|
442
|
+
description: "Assess how a company fits graph themes.",
|
|
443
|
+
prompt: "Assess how {input} fits the graph's themes and where the fit is weak or uncertain.",
|
|
444
|
+
inputType: "company",
|
|
445
|
+
highlightStrategy: "fit"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: "company-comparison",
|
|
449
|
+
categoryId: "prep",
|
|
450
|
+
mode: "semantic",
|
|
451
|
+
name: "Company Comparison",
|
|
452
|
+
description: "Compare companies through graph context.",
|
|
453
|
+
prompt: "Compare {input} using graph beliefs, evidence, risks, and open questions.",
|
|
454
|
+
inputType: "company-list",
|
|
455
|
+
highlightStrategy: "comparison"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: "questions-to-ask",
|
|
459
|
+
categoryId: "prep",
|
|
460
|
+
mode: "operational",
|
|
461
|
+
name: "Questions to Ask",
|
|
462
|
+
description: "Generate high-signal questions from graph gaps.",
|
|
463
|
+
prompt: "Generate the highest-signal questions to ask next, grounded in current graph gaps.",
|
|
464
|
+
highlightStrategy: "questions"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: "beliefs-to-test",
|
|
468
|
+
categoryId: "prep",
|
|
469
|
+
mode: "stress",
|
|
470
|
+
name: "Beliefs to Test",
|
|
471
|
+
description: "Prioritize beliefs that should be tested next.",
|
|
472
|
+
prompt: "Prioritize the beliefs that should be tested next and explain the cheapest test for each.",
|
|
473
|
+
highlightStrategy: "tests",
|
|
474
|
+
riskLevel: "medium"
|
|
475
|
+
}
|
|
476
|
+
];
|
|
477
|
+
GRAPH_INTELLIGENCE_QUERIES.map((query) => {
|
|
478
|
+
const definition = query;
|
|
479
|
+
return {
|
|
480
|
+
...definition,
|
|
481
|
+
tools: definition.tools ?? byMode(definition.mode)
|
|
482
|
+
};
|
|
483
|
+
});
|
|
484
|
+
|
|
4
485
|
// ../contracts/src/events.contract.ts
|
|
5
486
|
var DOMAIN_EVENT_VERSION = "1.0";
|
|
6
487
|
var EVENT_RETENTION_DEFAULT_DAYS = 30;
|
|
@@ -60,7 +541,10 @@ function idOf(table) {
|
|
|
60
541
|
return schema;
|
|
61
542
|
}
|
|
62
543
|
var NODE_TYPE = z.enum(["decision", "belief", "question", "theme", "deal", "topic", "claim", "evidence", "synthesis", "answer", "atomic_fact", "excerpt", "source", "company", "person", "investor", "function", "value_chain"]);
|
|
63
|
-
var
|
|
544
|
+
var EDGE_TYPE_VALUES = ["supports", "informs", "depends_on", "derived_from", "contains", "tests", "supersedes", "responds_to", "belongs_to", "relates_to_thesis", "works_at", "invested_in", "competes_with", "participates_in", "founded_by", "evaluates", "performs", "function_in", "impacts", "raised_from", "mentioned_in", "perspective_on", "plays_theme", "answers", "explores", "qualifies", "based_on", "based_on_belief", "based_on_question", "blocked_by_contradiction", "informed_by_theme", "same_as", "reinforces", "parent_of", "child_of", "falsified_by", "exclusive_with", "collapses_if", "cascade_from", "counterfactual_of", "cascade_to", "mutually_exclusive", "correlates_with", "amplifies", "precondition_for", "in_tension_with", "strengthened_by", "weakened_by", "alternative_to", "subsumes", "validated_by", "required_for", "blocks", "prerequisite_for", "parallel_to", "corroborates", "extends", "same_source_as", "same_theme_as", "assumes", "would_predict", "analogous_to", "independent_of", "implements", "violates", "co_changes_with", "migrating_from", "migrating_to", "scoped_by", "about_entity", "entity_referenced_in", "contradicts", "cites", "summarizes", "related_to", "partially_answers", "refines", "branches_from"];
|
|
545
|
+
var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
|
|
546
|
+
z.enum(EDGE_TYPE_VALUES);
|
|
547
|
+
var STORAGE_EDGE_TYPE = z.enum(STORAGE_EDGE_TYPE_VALUES);
|
|
64
548
|
var TOPIC_STATUS = z.enum(["active", "archived", "watching"]);
|
|
65
549
|
var TOPIC_VISIBILITY = z.enum(["private", "team", "firm", "external", "public"]);
|
|
66
550
|
defineTable({
|
|
@@ -1545,7 +2029,7 @@ defineTable({
|
|
|
1545
2029
|
"toNodeId": z.string().optional(),
|
|
1546
2030
|
"sourceGlobalId": z.string().optional(),
|
|
1547
2031
|
"targetGlobalId": z.string().optional(),
|
|
1548
|
-
"edgeType":
|
|
2032
|
+
"edgeType": STORAGE_EDGE_TYPE,
|
|
1549
2033
|
"edgeTier": z.string().optional(),
|
|
1550
2034
|
"domainNamespace": z.string().optional(),
|
|
1551
2035
|
"constraint": z.string().optional(),
|
|
@@ -3878,7 +4362,9 @@ defineTable({
|
|
|
3878
4362
|
"defaultProjectVisibility": z.enum(["private", "team", "firm", "external", "public"]).optional(),
|
|
3879
4363
|
"deployments": z.record(z.object({
|
|
3880
4364
|
"url": z.string(),
|
|
3881
|
-
"
|
|
4365
|
+
"target": z.enum(["kernelDeployment", "appDeployment"]).optional(),
|
|
4366
|
+
"encryptedDeployKey": z.string().optional(),
|
|
4367
|
+
"credentialRef": z.string().optional()
|
|
3882
4368
|
})).optional(),
|
|
3883
4369
|
"metadata": z.record(z.any()).optional(),
|
|
3884
4370
|
"createdBy": z.string().optional(),
|
|
@@ -4314,6 +4800,128 @@ var edgePolicyManifest = {
|
|
|
4314
4800
|
}
|
|
4315
4801
|
]
|
|
4316
4802
|
};
|
|
4803
|
+
|
|
4804
|
+
// ../contracts/src/tenant-client.contract.ts
|
|
4805
|
+
var TENANT_CLIENT_INSTALLABLE_PACKAGES = [
|
|
4806
|
+
{
|
|
4807
|
+
packageName: "@lucern/access-control",
|
|
4808
|
+
role: "runtime_entrypoint",
|
|
4809
|
+
directTenantImport: true
|
|
4810
|
+
},
|
|
4811
|
+
{
|
|
4812
|
+
packageName: "@lucern/agent",
|
|
4813
|
+
role: "platform_runtime",
|
|
4814
|
+
directTenantImport: false
|
|
4815
|
+
},
|
|
4816
|
+
{
|
|
4817
|
+
packageName: "@lucern/auth",
|
|
4818
|
+
role: "sdk_dependency",
|
|
4819
|
+
directTenantImport: false
|
|
4820
|
+
},
|
|
4821
|
+
{
|
|
4822
|
+
packageName: "@lucern/cli",
|
|
4823
|
+
role: "developer_tool",
|
|
4824
|
+
directTenantImport: false
|
|
4825
|
+
},
|
|
4826
|
+
{
|
|
4827
|
+
packageName: "@lucern/client-core",
|
|
4828
|
+
role: "sdk_dependency",
|
|
4829
|
+
directTenantImport: false
|
|
4830
|
+
},
|
|
4831
|
+
{
|
|
4832
|
+
packageName: "@lucern/confidence",
|
|
4833
|
+
role: "sdk_dependency",
|
|
4834
|
+
directTenantImport: false
|
|
4835
|
+
},
|
|
4836
|
+
{
|
|
4837
|
+
packageName: "@lucern/config",
|
|
4838
|
+
role: "configuration",
|
|
4839
|
+
directTenantImport: false
|
|
4840
|
+
},
|
|
4841
|
+
{
|
|
4842
|
+
packageName: "@lucern/contracts",
|
|
4843
|
+
role: "contract_entrypoint",
|
|
4844
|
+
directTenantImport: true
|
|
4845
|
+
},
|
|
4846
|
+
{
|
|
4847
|
+
packageName: "@lucern/control-plane",
|
|
4848
|
+
role: "platform_runtime",
|
|
4849
|
+
directTenantImport: false
|
|
4850
|
+
},
|
|
4851
|
+
{
|
|
4852
|
+
packageName: "@lucern/developer-kit",
|
|
4853
|
+
role: "developer_tool",
|
|
4854
|
+
directTenantImport: false
|
|
4855
|
+
},
|
|
4856
|
+
{
|
|
4857
|
+
packageName: "@lucern/events",
|
|
4858
|
+
role: "sdk_dependency",
|
|
4859
|
+
directTenantImport: false
|
|
4860
|
+
},
|
|
4861
|
+
{
|
|
4862
|
+
packageName: "@lucern/graph-primitives",
|
|
4863
|
+
role: "sdk_dependency",
|
|
4864
|
+
directTenantImport: false
|
|
4865
|
+
},
|
|
4866
|
+
{
|
|
4867
|
+
packageName: "@lucern/identity",
|
|
4868
|
+
role: "component_runtime",
|
|
4869
|
+
directTenantImport: false
|
|
4870
|
+
},
|
|
4871
|
+
{
|
|
4872
|
+
packageName: "@lucern/mcp",
|
|
4873
|
+
role: "runtime_entrypoint",
|
|
4874
|
+
directTenantImport: true
|
|
4875
|
+
},
|
|
4876
|
+
{
|
|
4877
|
+
packageName: "@lucern/pack-host",
|
|
4878
|
+
role: "platform_runtime",
|
|
4879
|
+
directTenantImport: false
|
|
4880
|
+
},
|
|
4881
|
+
{
|
|
4882
|
+
packageName: "@lucern/pack-installer",
|
|
4883
|
+
role: "developer_tool",
|
|
4884
|
+
directTenantImport: false
|
|
4885
|
+
},
|
|
4886
|
+
{
|
|
4887
|
+
packageName: "@lucern/proof-compiler",
|
|
4888
|
+
role: "developer_tool",
|
|
4889
|
+
directTenantImport: false
|
|
4890
|
+
},
|
|
4891
|
+
{
|
|
4892
|
+
packageName: "@lucern/react",
|
|
4893
|
+
role: "runtime_entrypoint",
|
|
4894
|
+
directTenantImport: true
|
|
4895
|
+
},
|
|
4896
|
+
{
|
|
4897
|
+
packageName: "@lucern/reasoning-kernel",
|
|
4898
|
+
role: "component_runtime",
|
|
4899
|
+
directTenantImport: false
|
|
4900
|
+
},
|
|
4901
|
+
{
|
|
4902
|
+
packageName: "@lucern/sdk",
|
|
4903
|
+
role: "runtime_entrypoint",
|
|
4904
|
+
directTenantImport: true
|
|
4905
|
+
},
|
|
4906
|
+
{
|
|
4907
|
+
packageName: "@lucern/server-core",
|
|
4908
|
+
role: "platform_runtime",
|
|
4909
|
+
directTenantImport: false
|
|
4910
|
+
},
|
|
4911
|
+
{
|
|
4912
|
+
packageName: "@lucern/testing",
|
|
4913
|
+
role: "test_support",
|
|
4914
|
+
directTenantImport: false
|
|
4915
|
+
},
|
|
4916
|
+
{
|
|
4917
|
+
packageName: "@lucern/types",
|
|
4918
|
+
role: "contract_entrypoint",
|
|
4919
|
+
directTenantImport: true
|
|
4920
|
+
}
|
|
4921
|
+
];
|
|
4922
|
+
TENANT_CLIENT_INSTALLABLE_PACKAGES.map(
|
|
4923
|
+
(entry) => entry.packageName
|
|
4924
|
+
);
|
|
4317
4925
|
z.object({
|
|
4318
4926
|
manifestVersion: z.literal("1.0.0"),
|
|
4319
4927
|
rules: z.array(
|
|
@@ -5075,6 +5683,14 @@ var ADD_WORKTREE = {
|
|
|
5075
5683
|
description: "Check out a branch into an active worktree for investigation. Like `git worktree add <branch>` \u2014 creates independent working state on a thematic branch. Beliefs committed within the worktree can be freely amended (draft code on a feature branch). When investigation is complete, `merge` integrates findings into main.",
|
|
5076
5684
|
parameters: {
|
|
5077
5685
|
title: { type: "string", description: "Worktree name/objective" },
|
|
5686
|
+
name: {
|
|
5687
|
+
type: "string",
|
|
5688
|
+
description: "Optional storage-name alias for callers that already use backend naming"
|
|
5689
|
+
},
|
|
5690
|
+
projectId: {
|
|
5691
|
+
type: "string",
|
|
5692
|
+
description: "Legacy topicId alias"
|
|
5693
|
+
},
|
|
5078
5694
|
topicId: { type: "string", description: "Optional topic scope hint" },
|
|
5079
5695
|
branchId: {
|
|
5080
5696
|
type: "string",
|
|
@@ -5088,14 +5704,87 @@ var ADD_WORKTREE = {
|
|
|
5088
5704
|
type: "string",
|
|
5089
5705
|
description: "The testable claim this worktree investigates"
|
|
5090
5706
|
},
|
|
5707
|
+
rationale: {
|
|
5708
|
+
type: "string",
|
|
5709
|
+
description: "Why this worktree exists and why it belongs in the campaign"
|
|
5710
|
+
},
|
|
5711
|
+
worktreeType: {
|
|
5712
|
+
type: "string",
|
|
5713
|
+
description: "Schema-enum worktree type used by the kernel lifecycle and retrieval layers"
|
|
5714
|
+
},
|
|
5715
|
+
gate: {
|
|
5716
|
+
type: "string",
|
|
5717
|
+
description: "Exit gate name for this worktree"
|
|
5718
|
+
},
|
|
5719
|
+
startDate: {
|
|
5720
|
+
type: "number",
|
|
5721
|
+
description: "Planned start timestamp in milliseconds since epoch"
|
|
5722
|
+
},
|
|
5723
|
+
endDate: {
|
|
5724
|
+
type: "number",
|
|
5725
|
+
description: "Planned end timestamp in milliseconds since epoch"
|
|
5726
|
+
},
|
|
5727
|
+
durationWeeks: {
|
|
5728
|
+
type: "number",
|
|
5729
|
+
description: "Planned duration in weeks"
|
|
5730
|
+
},
|
|
5731
|
+
confidenceImpact: {
|
|
5732
|
+
type: "string",
|
|
5733
|
+
description: "Expected confidence impact if the worktree succeeds",
|
|
5734
|
+
enum: ["high", "medium", "low"]
|
|
5735
|
+
},
|
|
5736
|
+
beliefFocus: {
|
|
5737
|
+
type: "string",
|
|
5738
|
+
description: "Natural-language focus spanning the target belief neighborhood"
|
|
5739
|
+
},
|
|
5091
5740
|
beliefIds: {
|
|
5092
5741
|
type: "array",
|
|
5093
|
-
description: "
|
|
5742
|
+
description: "Legacy alias for targetBeliefIds"
|
|
5743
|
+
},
|
|
5744
|
+
beliefs: {
|
|
5745
|
+
type: "array",
|
|
5746
|
+
description: "Legacy alias for targetBeliefIds"
|
|
5747
|
+
},
|
|
5748
|
+
targetBeliefIds: {
|
|
5749
|
+
type: "array",
|
|
5750
|
+
description: "Belief node IDs this worktree is expected to test or update"
|
|
5751
|
+
},
|
|
5752
|
+
targetQuestionIds: {
|
|
5753
|
+
type: "array",
|
|
5754
|
+
description: "Question node IDs this worktree is expected to answer"
|
|
5755
|
+
},
|
|
5756
|
+
keyQuestions: {
|
|
5757
|
+
type: "array",
|
|
5758
|
+
description: "Inline key question objects with question, optional status, answer, answerConfidence, and linkedQuestionId"
|
|
5759
|
+
},
|
|
5760
|
+
evidenceSignals: {
|
|
5761
|
+
type: "array",
|
|
5762
|
+
description: "Evidence signal objects with signal, optional collected state, progress, and notes"
|
|
5763
|
+
},
|
|
5764
|
+
decisionGate: {
|
|
5765
|
+
type: "object",
|
|
5766
|
+
description: "Decision gate object with goCriteria, noGoSignals, optional verdict, rationale, decidedAt, and decidedBy"
|
|
5767
|
+
},
|
|
5768
|
+
goCriteria: {
|
|
5769
|
+
type: "array",
|
|
5770
|
+
description: "Shorthand go criteria used to build decisionGate"
|
|
5771
|
+
},
|
|
5772
|
+
noGoSignals: {
|
|
5773
|
+
type: "array",
|
|
5774
|
+
description: "Shorthand no-go signals used to build decisionGate"
|
|
5775
|
+
},
|
|
5776
|
+
proofArtifacts: {
|
|
5777
|
+
type: "array",
|
|
5778
|
+
description: "Expected proof artifacts required to close the worktree"
|
|
5094
5779
|
},
|
|
5095
5780
|
autoShape: {
|
|
5096
5781
|
type: "boolean",
|
|
5097
5782
|
description: "Whether to invoke inquiry auto-shaping during worktree creation"
|
|
5098
5783
|
},
|
|
5784
|
+
autoFixPolicy: {
|
|
5785
|
+
type: "object",
|
|
5786
|
+
description: "Policy for permitted automatic remediation inside the worktree"
|
|
5787
|
+
},
|
|
5099
5788
|
domainPackId: {
|
|
5100
5789
|
type: "string",
|
|
5101
5790
|
description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
|
|
@@ -5124,9 +5813,17 @@ var ADD_WORKTREE = {
|
|
|
5124
5813
|
type: "array",
|
|
5125
5814
|
description: "Worktree IDs blocked by this worktree"
|
|
5126
5815
|
},
|
|
5127
|
-
|
|
5816
|
+
staffingHint: {
|
|
5128
5817
|
type: "string",
|
|
5129
|
-
description: "
|
|
5818
|
+
description: "Suggested staffing or agent allocation note"
|
|
5819
|
+
},
|
|
5820
|
+
lensId: {
|
|
5821
|
+
type: "string",
|
|
5822
|
+
description: "Lens that scopes this worktree when applicable"
|
|
5823
|
+
},
|
|
5824
|
+
lastReconciledAt: {
|
|
5825
|
+
type: "number",
|
|
5826
|
+
description: "Timestamp when worktree metadata was last reconciled"
|
|
5130
5827
|
}
|
|
5131
5828
|
},
|
|
5132
5829
|
required: ["title", "topicId"],
|
|
@@ -5156,7 +5853,7 @@ var MERGE = {
|
|
|
5156
5853
|
worktreeId: { type: "string", description: "The worktree to merge" },
|
|
5157
5854
|
outcomes: {
|
|
5158
5855
|
type: "array",
|
|
5159
|
-
description: "
|
|
5856
|
+
description: "Merge outcomes as key-finding strings, or scoring outcomes for beliefs: { beliefId, confidence, rationale }"
|
|
5160
5857
|
},
|
|
5161
5858
|
summary: { type: "string", description: "Overall findings summary" }
|
|
5162
5859
|
},
|
|
@@ -5710,6 +6407,74 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
|
|
|
5710
6407
|
ontologyPrimitive: "graph",
|
|
5711
6408
|
tier: "showcase"
|
|
5712
6409
|
};
|
|
6410
|
+
var LIST_GRAPH_INTELLIGENCE_QUERIES = {
|
|
6411
|
+
name: "list_graph_intelligence_queries",
|
|
6412
|
+
description: "List the Graph Intelligence query catalog that powers structural graph analysis experiences. Returns categories, query IDs, prompt templates, modes, and the public tool plan each query can use.",
|
|
6413
|
+
parameters: {
|
|
6414
|
+
categoryId: {
|
|
6415
|
+
type: "string",
|
|
6416
|
+
description: "Optional category filter, such as problems or strategic"
|
|
6417
|
+
},
|
|
6418
|
+
mode: {
|
|
6419
|
+
type: "string",
|
|
6420
|
+
description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
6421
|
+
}
|
|
6422
|
+
},
|
|
6423
|
+
required: [],
|
|
6424
|
+
response: {
|
|
6425
|
+
description: "Graph Intelligence query catalog and mode-to-tool mapping",
|
|
6426
|
+
fields: {
|
|
6427
|
+
categories: "array \u2014 query categories",
|
|
6428
|
+
queries: "array \u2014 query definitions with prompt templates and tools",
|
|
6429
|
+
quickQueries: "array \u2014 recommended one-click query presets",
|
|
6430
|
+
publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
|
|
6431
|
+
}
|
|
6432
|
+
},
|
|
6433
|
+
ownerModule: "graph-intelligence",
|
|
6434
|
+
ontologyPrimitive: "graph",
|
|
6435
|
+
tier: "showcase"
|
|
6436
|
+
};
|
|
6437
|
+
var RUN_GRAPH_INTELLIGENCE_QUERY = {
|
|
6438
|
+
name: "run_graph_intelligence_query",
|
|
6439
|
+
description: "Run a named Graph Intelligence query against a tenant topic graph. Returns the selected query, prompt, deterministic graph-analysis bundle, graph context, and public tool plan for model synthesis.",
|
|
6440
|
+
parameters: {
|
|
6441
|
+
topicId: { type: "string", description: "Topic to analyze" },
|
|
6442
|
+
queryId: {
|
|
6443
|
+
type: "string",
|
|
6444
|
+
description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
|
|
6445
|
+
},
|
|
6446
|
+
prompt: {
|
|
6447
|
+
type: "string",
|
|
6448
|
+
description: "Optional custom prompt for custom analysis runs"
|
|
6449
|
+
},
|
|
6450
|
+
input: {
|
|
6451
|
+
type: "string",
|
|
6452
|
+
description: "Optional entity, theme, belief, company, or search text for input-driven queries"
|
|
6453
|
+
},
|
|
6454
|
+
mode: {
|
|
6455
|
+
type: "string",
|
|
6456
|
+
description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
6457
|
+
},
|
|
6458
|
+
limit: {
|
|
6459
|
+
type: "number",
|
|
6460
|
+
description: "Maximum graph context rows to return"
|
|
6461
|
+
}
|
|
6462
|
+
},
|
|
6463
|
+
required: ["topicId"],
|
|
6464
|
+
response: {
|
|
6465
|
+
description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
|
|
6466
|
+
fields: {
|
|
6467
|
+
query: "object \u2014 selected query definition",
|
|
6468
|
+
prompt: "string \u2014 resolved prompt template",
|
|
6469
|
+
toolPlan: "array \u2014 public tools and args the model can call next",
|
|
6470
|
+
analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
|
|
6471
|
+
context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
|
|
6472
|
+
}
|
|
6473
|
+
},
|
|
6474
|
+
ownerModule: "graph-intelligence",
|
|
6475
|
+
ontologyPrimitive: "graph",
|
|
6476
|
+
tier: "showcase"
|
|
6477
|
+
};
|
|
5713
6478
|
var GET_FALSIFICATION_QUESTIONS = {
|
|
5714
6479
|
name: "get_falsification_questions",
|
|
5715
6480
|
description: "Generate Popperian falsification questions for beliefs. Like `git test` \u2014 identifies the questions most likely to disprove current beliefs. Karl Popper as a tool: surfaces what would need to be true to invalidate each belief.",
|
|
@@ -8175,22 +8940,85 @@ var GENERATE_SESSION_HANDOFF = {
|
|
|
8175
8940
|
tier: "showcase",
|
|
8176
8941
|
internal: true
|
|
8177
8942
|
};
|
|
8178
|
-
var
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8943
|
+
var BEGIN_BUILD_SESSION = {
|
|
8944
|
+
name: "begin_build_session",
|
|
8945
|
+
description: "Bootstrap a coding build session for a Lucern worktree. Like `git worktree add` plus `git status` \u2014 returns the compact context packet an agent needs before editing.",
|
|
8946
|
+
parameters: {
|
|
8947
|
+
worktreeId: {
|
|
8948
|
+
type: "string",
|
|
8949
|
+
description: "The Lucern worktree ID to bootstrap."
|
|
8950
|
+
},
|
|
8951
|
+
branch: {
|
|
8952
|
+
type: "string",
|
|
8953
|
+
description: "Optional git branch name. Auto-generated from the worktree name when omitted."
|
|
8954
|
+
},
|
|
8955
|
+
branchBase: {
|
|
8956
|
+
type: "string",
|
|
8957
|
+
description: 'Base branch for the feature branch. Default: "staging".'
|
|
8958
|
+
},
|
|
8959
|
+
prBase: {
|
|
8960
|
+
type: "string",
|
|
8961
|
+
description: 'Target branch for the PR. Default: "staging".'
|
|
8962
|
+
},
|
|
8963
|
+
sessionMode: {
|
|
8964
|
+
type: "string",
|
|
8965
|
+
description: 'Session mode: "async" for Codex/headless or "interactive" for live sessions.',
|
|
8966
|
+
enum: ["async", "interactive"]
|
|
8967
|
+
},
|
|
8968
|
+
activateIfPlanning: {
|
|
8969
|
+
type: "boolean",
|
|
8970
|
+
description: "When true, automatically activate a planning worktree during bootstrap."
|
|
8971
|
+
}
|
|
8972
|
+
},
|
|
8973
|
+
required: ["worktreeId"],
|
|
8974
|
+
response: {
|
|
8975
|
+
description: "A compact build-session packet with worktree metadata, graph anchors, questions, dependencies, and git defaults.",
|
|
8976
|
+
fields: {
|
|
8977
|
+
topicId: "string \u2014 canonical topic scope",
|
|
8978
|
+
topicName: "string \u2014 human-readable topic name",
|
|
8979
|
+
worktreeId: "string \u2014 worktree ID",
|
|
8980
|
+
worktreeName: "string \u2014 human-readable worktree name",
|
|
8981
|
+
branch: "string \u2014 git branch name",
|
|
8982
|
+
branchBase: "string \u2014 base branch",
|
|
8983
|
+
prBase: "string \u2014 PR target branch",
|
|
8984
|
+
campaign: "number | null \u2014 top-level pipeline campaign",
|
|
8985
|
+
lane: "string \u2014 campaign lane",
|
|
8986
|
+
gate: "string \u2014 exit gate",
|
|
8987
|
+
hypothesis: "string \u2014 worktree hypothesis",
|
|
8988
|
+
focus: "string \u2014 session focus",
|
|
8989
|
+
status: "string \u2014 worktree status after optional activation",
|
|
8990
|
+
sessionMode: "string \u2014 async | interactive",
|
|
8991
|
+
targetBeliefIds: "array \u2014 scoped belief IDs",
|
|
8992
|
+
targetQuestionIds: "array \u2014 scoped question IDs",
|
|
8993
|
+
topBeliefs: "array \u2014 highest-confidence scoped beliefs",
|
|
8994
|
+
openQuestions: "array \u2014 open scoped questions",
|
|
8995
|
+
resolvedDecisions: "array \u2014 answered questions summarized for the session",
|
|
8996
|
+
dependencies: "array \u2014 upstream worktrees",
|
|
8997
|
+
unblocks: "array \u2014 downstream worktrees",
|
|
8998
|
+
mergeOrderNotes: "string \u2014 merge ordering advisory"
|
|
8999
|
+
}
|
|
9000
|
+
},
|
|
9001
|
+
ownerModule: "bootstrap",
|
|
9002
|
+
ontologyPrimitive: "worktree",
|
|
9003
|
+
tier: "showcase",
|
|
9004
|
+
internal: true
|
|
9005
|
+
};
|
|
9006
|
+
var MCP_TOOL_CONTRACTS = {
|
|
9007
|
+
// Belief lifecycle (commit, amend, fork, archive)
|
|
9008
|
+
create_belief: CREATE_BELIEF,
|
|
9009
|
+
get_belief: GET_BELIEF,
|
|
9010
|
+
refine_belief: REFINE_BELIEF,
|
|
9011
|
+
modulate_confidence: MODULATE_CONFIDENCE,
|
|
9012
|
+
fork_belief: FORK_BELIEF,
|
|
9013
|
+
archive_belief: ARCHIVE_BELIEF,
|
|
9014
|
+
create_epistemic_contract: CREATE_EPISTEMIC_CONTRACT,
|
|
9015
|
+
evaluate_contract: EVALUATE_CONTRACT,
|
|
9016
|
+
get_contract_status: GET_CONTRACT_STATUS,
|
|
9017
|
+
// Evidence (commit)
|
|
9018
|
+
create_evidence: CREATE_EVIDENCE,
|
|
9019
|
+
get_evidence: GET_EVIDENCE,
|
|
9020
|
+
list_evidence: LIST_EVIDENCE,
|
|
9021
|
+
link_evidence: LINK_EVIDENCE,
|
|
8194
9022
|
add_evidence: ADD_EVIDENCE,
|
|
8195
9023
|
// Contradictions (merge conflict)
|
|
8196
9024
|
flag_contradiction: FLAG_CONTRADICTION,
|
|
@@ -8222,6 +9050,8 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
8222
9050
|
// Graph intelligence (showcase)
|
|
8223
9051
|
detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
|
|
8224
9052
|
get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
|
|
9053
|
+
list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
|
|
9054
|
+
run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
|
|
8225
9055
|
get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
|
|
8226
9056
|
// Evidence operations (workhorse)
|
|
8227
9057
|
search_evidence: SEARCH_EVIDENCE,
|
|
@@ -8268,6 +9098,7 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
8268
9098
|
get_agent_inbox: GET_AGENT_INBOX,
|
|
8269
9099
|
claim_files: CLAIM_FILES,
|
|
8270
9100
|
generate_session_handoff: GENERATE_SESSION_HANDOFF,
|
|
9101
|
+
begin_build_session: BEGIN_BUILD_SESSION,
|
|
8271
9102
|
// Policy / ACL (workhorse)
|
|
8272
9103
|
check_permission: CHECK_PERMISSION,
|
|
8273
9104
|
filter_by_permission: FILTER_BY_PERMISSION,
|
|
@@ -8403,6 +9234,8 @@ var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
|
|
|
8403
9234
|
"traverse_graph",
|
|
8404
9235
|
"get_graph_neighborhood",
|
|
8405
9236
|
"get_graph_structure_analysis",
|
|
9237
|
+
"list_graph_intelligence_queries",
|
|
9238
|
+
"run_graph_intelligence_query",
|
|
8406
9239
|
"find_contradictions",
|
|
8407
9240
|
"flag_contradiction",
|
|
8408
9241
|
"detect_confirmation_bias",
|
|
@@ -8481,6 +9314,7 @@ var PLATFORM_INTERNAL_OPERATION_NAMES = [
|
|
|
8481
9314
|
"get_change_history",
|
|
8482
9315
|
"get_failure_log",
|
|
8483
9316
|
"record_attempt",
|
|
9317
|
+
"begin_build_session",
|
|
8484
9318
|
"push",
|
|
8485
9319
|
"open_pull_request",
|
|
8486
9320
|
"record_judgment",
|
|
@@ -8535,7 +9369,6 @@ var SDK_ONLY_OPERATION_NAMES = [
|
|
|
8535
9369
|
"find_semantic_orphans"
|
|
8536
9370
|
];
|
|
8537
9371
|
var MCP_ONLY_INTERNAL_OPERATION_NAMES = [
|
|
8538
|
-
"begin_build_session",
|
|
8539
9372
|
"evaluate_engineering_contract",
|
|
8540
9373
|
"evaluate_research_contract"
|
|
8541
9374
|
];
|
|
@@ -8921,8 +9754,31 @@ function assertSurfaceCoverage(contracts) {
|
|
|
8921
9754
|
}
|
|
8922
9755
|
}
|
|
8923
9756
|
}
|
|
8924
|
-
|
|
8925
|
-
|
|
9757
|
+
var jsonRecordSchema2 = z.record(z.unknown());
|
|
9758
|
+
var observationArgs = z.object({
|
|
9759
|
+
topicId: z.string().optional().describe("Topic scope for the observation."),
|
|
9760
|
+
summary: z.string().describe("Short observation summary."),
|
|
9761
|
+
text: z.string().optional().describe("Canonical observation text alias."),
|
|
9762
|
+
title: z.string().optional().describe("Optional observation title."),
|
|
9763
|
+
content: z.string().optional().describe("Optional rich observation content."),
|
|
9764
|
+
contentType: z.string().optional().describe("Observation content type."),
|
|
9765
|
+
kind: z.string().optional().describe("Evidence kind to store."),
|
|
9766
|
+
observationType: z.string().optional().describe("Observation type."),
|
|
9767
|
+
tags: z.array(z.string()).optional().describe("Observation tags."),
|
|
9768
|
+
source: z.string().optional().describe("Observation source label."),
|
|
9769
|
+
sourceType: z.string().optional().describe("Evidence source type."),
|
|
9770
|
+
externalSourceType: z.string().optional().describe("External source type for imported observations."),
|
|
9771
|
+
sourceUrl: z.string().optional().describe("Canonical source URL."),
|
|
9772
|
+
confidence: z.number().optional().describe("Observation confidence."),
|
|
9773
|
+
metadata: jsonRecordSchema2.optional().describe("Observation metadata."),
|
|
9774
|
+
rationale: z.string().optional().describe("Why this observation should be recorded.")
|
|
9775
|
+
});
|
|
9776
|
+
var observationContextArgs = z.object({
|
|
9777
|
+
topicId: z.string().describe("Topic scope."),
|
|
9778
|
+
query: z.string().optional().describe("Optional context query."),
|
|
9779
|
+
limit: z.number().optional().describe("Maximum observations to return."),
|
|
9780
|
+
status: z.string().optional().describe("Observation status filter.")
|
|
9781
|
+
});
|
|
8926
9782
|
var observationInput = (input, context) => withUserId(
|
|
8927
9783
|
compactRecord4({
|
|
8928
9784
|
projectId: input.projectId,
|
|
@@ -8981,7 +9837,8 @@ var contextContracts = [
|
|
|
8981
9837
|
observationId: output && typeof output === "object" ? output.nodeId : void 0,
|
|
8982
9838
|
observationType: input.observationType
|
|
8983
9839
|
})
|
|
8984
|
-
}
|
|
9840
|
+
},
|
|
9841
|
+
args: observationArgs
|
|
8985
9842
|
}),
|
|
8986
9843
|
surfaceContract({
|
|
8987
9844
|
name: "get_observation_context",
|
|
@@ -9002,7 +9859,8 @@ var contextContracts = [
|
|
|
9002
9859
|
status: input.status,
|
|
9003
9860
|
userId: input.userId
|
|
9004
9861
|
})
|
|
9005
|
-
}
|
|
9862
|
+
},
|
|
9863
|
+
args: observationContextArgs
|
|
9006
9864
|
})
|
|
9007
9865
|
];
|
|
9008
9866
|
|
|
@@ -9065,8 +9923,45 @@ var identityContracts = [
|
|
|
9065
9923
|
}
|
|
9066
9924
|
})
|
|
9067
9925
|
];
|
|
9068
|
-
|
|
9069
|
-
|
|
9926
|
+
var jsonRecordSchema3 = z.record(z.unknown());
|
|
9927
|
+
var sourceTypeSchema = z.enum(["human", "ai_extracted", "ai_generated"]);
|
|
9928
|
+
var reversibilitySchema = z.enum([
|
|
9929
|
+
"irreversible",
|
|
9930
|
+
"hard_to_reverse",
|
|
9931
|
+
"reversible",
|
|
9932
|
+
"trivial"
|
|
9933
|
+
]);
|
|
9934
|
+
var predictionMetaSchema = z.object({
|
|
9935
|
+
isPrediction: z.boolean().describe("Whether this belief is a prediction."),
|
|
9936
|
+
registeredAt: z.number().describe("Timestamp when the prediction was registered."),
|
|
9937
|
+
expectedBy: z.number().optional().describe("Timestamp when the prediction should be evaluated.")
|
|
9938
|
+
});
|
|
9939
|
+
var createBeliefArgs = z.object({
|
|
9940
|
+
canonicalText: z.string().describe("The belief statement the agent holds to be true."),
|
|
9941
|
+
topicId: z.string().optional().describe("Topic scope hint for the belief."),
|
|
9942
|
+
baseRate: z.number().optional().describe("Prior base rate used to seed the vacuous opinion."),
|
|
9943
|
+
beliefType: z.string().optional().describe("Schema belief type."),
|
|
9944
|
+
metadata: jsonRecordSchema3.optional().describe("Extra metadata merged into the belief node."),
|
|
9945
|
+
rationale: z.string().optional().describe("Why this belief should enter the reasoning graph."),
|
|
9946
|
+
pillar: z.string().optional().describe("Innovation pillar or product pillar associated with the belief."),
|
|
9947
|
+
worktreeId: z.string().optional().describe("Worktree responsible for creating or testing this belief."),
|
|
9948
|
+
sourceBeliefIds: z.array(z.string()).optional().describe("Source belief IDs this belief derives from."),
|
|
9949
|
+
sourceType: sourceTypeSchema.optional().describe("Actor/source class that produced the belief."),
|
|
9950
|
+
reversibility: reversibilitySchema.optional().describe("How reversible the belief's implied decision is."),
|
|
9951
|
+
predictionMeta: predictionMetaSchema.optional().describe("Prediction lifecycle metadata when this belief is a forecast.")
|
|
9952
|
+
});
|
|
9953
|
+
var forkBeliefArgs = z.object({
|
|
9954
|
+
nodeId: z.string().describe("The scored belief to fork from."),
|
|
9955
|
+
newFormulation: z.string().describe("The evolved belief statement."),
|
|
9956
|
+
forkReason: z.enum([
|
|
9957
|
+
"refinement",
|
|
9958
|
+
"contradiction_response",
|
|
9959
|
+
"scope_change",
|
|
9960
|
+
"confidence_collapse",
|
|
9961
|
+
"manual"
|
|
9962
|
+
]).describe("Why this fork was created."),
|
|
9963
|
+
rationale: z.string().optional().describe("Why the fork is warranted.")
|
|
9964
|
+
});
|
|
9070
9965
|
var beliefLookupInput = (input) => compactRecord4({
|
|
9071
9966
|
nodeId: input.nodeId ?? input.id ?? input.beliefId,
|
|
9072
9967
|
beliefId: input.beliefId
|
|
@@ -9141,7 +10036,8 @@ var beliefsContracts = [
|
|
|
9141
10036
|
functionName: "create",
|
|
9142
10037
|
kind: "mutation",
|
|
9143
10038
|
inputProjection: createBeliefInput
|
|
9144
|
-
}
|
|
10039
|
+
},
|
|
10040
|
+
args: createBeliefArgs
|
|
9145
10041
|
}),
|
|
9146
10042
|
surfaceContract({
|
|
9147
10043
|
name: "get_belief",
|
|
@@ -9232,7 +10128,8 @@ var beliefsContracts = [
|
|
|
9232
10128
|
functionName: "forkBelief",
|
|
9233
10129
|
kind: "mutation",
|
|
9234
10130
|
inputProjection: forkBeliefInput
|
|
9235
|
-
}
|
|
10131
|
+
},
|
|
10132
|
+
args: forkBeliefArgs
|
|
9236
10133
|
}),
|
|
9237
10134
|
surfaceContract({
|
|
9238
10135
|
name: "archive_belief",
|
|
@@ -9313,8 +10210,46 @@ var beliefsContracts = [
|
|
|
9313
10210
|
}
|
|
9314
10211
|
})
|
|
9315
10212
|
];
|
|
9316
|
-
|
|
9317
|
-
|
|
10213
|
+
var jsonRecordSchema4 = z.record(z.unknown());
|
|
10214
|
+
var evidenceRelationSchema = z.enum(["supports", "contradicts", "neutral"]);
|
|
10215
|
+
var createEvidenceArgs = z.object({
|
|
10216
|
+
topicId: z.string().optional().describe("Topic scope for the evidence."),
|
|
10217
|
+
text: z.string().describe("Canonical evidence text."),
|
|
10218
|
+
source: z.string().optional().describe("Source URL or source label."),
|
|
10219
|
+
sourceUrl: z.string().optional().describe("Canonical source URL."),
|
|
10220
|
+
targetId: z.string().optional().describe("Belief or question identifier to link immediately."),
|
|
10221
|
+
linkedBeliefNodeId: z.string().optional().describe("Belief node this evidence bears on."),
|
|
10222
|
+
evidenceRelation: evidenceRelationSchema.optional().describe("How the evidence relates to the linked belief."),
|
|
10223
|
+
confidence: z.number().optional().describe("Confidence in the evidence relation."),
|
|
10224
|
+
weight: z.number().optional().describe("Support weight from -1.0 to +1.0."),
|
|
10225
|
+
metadata: jsonRecordSchema4.optional().describe("Metadata merged into the canonical evidence node."),
|
|
10226
|
+
rationale: z.string().describe("Why this evidence should enter the reasoning graph."),
|
|
10227
|
+
reasoning: z.string().optional().describe("Reasoning note preserved in evidence metadata."),
|
|
10228
|
+
title: z.string().optional().describe("Optional short title."),
|
|
10229
|
+
content: z.string().optional().describe("Optional long-form content."),
|
|
10230
|
+
contentType: z.string().optional().describe("Content format or MIME hint."),
|
|
10231
|
+
kind: z.string().optional().describe("Evidence kind."),
|
|
10232
|
+
tags: z.array(z.string()).optional().describe("Evidence tags."),
|
|
10233
|
+
sourceType: z.string().optional().describe("Evidence source type."),
|
|
10234
|
+
externalSourceType: z.string().optional().describe("External source type for imported evidence."),
|
|
10235
|
+
sourceQuestionId: z.string().optional().describe("Question that sourced this evidence."),
|
|
10236
|
+
methodology: z.string().optional().describe("Collection methodology."),
|
|
10237
|
+
informationAsymmetry: z.string().optional().describe("Information asymmetry class."),
|
|
10238
|
+
sourceDescription: z.string().optional().describe("Human-readable source description.")
|
|
10239
|
+
});
|
|
10240
|
+
var addEvidenceArgs = z.object({
|
|
10241
|
+
canonicalText: z.string().describe("The evidence statement."),
|
|
10242
|
+
text: z.string().optional().describe("Canonical evidence text alias used by newer callers."),
|
|
10243
|
+
topicId: z.string().optional().describe("Topic scope hint."),
|
|
10244
|
+
sourceUrl: z.string().optional().describe("URL of the source material."),
|
|
10245
|
+
targetNodeId: z.string().describe("The belief this evidence bears on."),
|
|
10246
|
+
weight: z.number().optional().describe("Support weight from -1.0 to +1.0."),
|
|
10247
|
+
reasoning: z.string().describe("Why this evidence is relevant to the target belief."),
|
|
10248
|
+
title: z.string().optional().describe("Optional short title."),
|
|
10249
|
+
content: z.string().optional().describe("Optional long-form evidence content."),
|
|
10250
|
+
contentType: z.string().optional().describe("Content format or MIME hint."),
|
|
10251
|
+
metadata: jsonRecordSchema4.optional().describe("Optional metadata merged into the evidence node.")
|
|
10252
|
+
});
|
|
9318
10253
|
var evidenceIdInput = (input) => compactRecord4({
|
|
9319
10254
|
evidenceId: input.evidenceId,
|
|
9320
10255
|
insightId: input.insightId,
|
|
@@ -9389,7 +10324,8 @@ var evidenceContracts = [
|
|
|
9389
10324
|
functionName: "create",
|
|
9390
10325
|
kind: "mutation",
|
|
9391
10326
|
inputProjection: createEvidenceInput
|
|
9392
|
-
}
|
|
10327
|
+
},
|
|
10328
|
+
args: createEvidenceArgs
|
|
9393
10329
|
}),
|
|
9394
10330
|
surfaceContract({
|
|
9395
10331
|
name: "add_evidence",
|
|
@@ -9425,7 +10361,8 @@ var evidenceContracts = [
|
|
|
9425
10361
|
context
|
|
9426
10362
|
);
|
|
9427
10363
|
}
|
|
9428
|
-
}
|
|
10364
|
+
},
|
|
10365
|
+
args: addEvidenceArgs
|
|
9429
10366
|
}),
|
|
9430
10367
|
surfaceContract({
|
|
9431
10368
|
name: "get_evidence",
|
|
@@ -9532,8 +10469,91 @@ var evidenceContracts = [
|
|
|
9532
10469
|
}
|
|
9533
10470
|
})
|
|
9534
10471
|
];
|
|
9535
|
-
|
|
9536
|
-
|
|
10472
|
+
var jsonRecordSchema5 = z.record(z.unknown());
|
|
10473
|
+
var questionPrioritySchema = z.enum(["urgent", "high", "medium", "low"]);
|
|
10474
|
+
var kernelQuestionPrioritySchema = z.enum([
|
|
10475
|
+
"critical",
|
|
10476
|
+
"high",
|
|
10477
|
+
"medium",
|
|
10478
|
+
"low"
|
|
10479
|
+
]);
|
|
10480
|
+
var questionTypeSchema = z.enum([
|
|
10481
|
+
"validation",
|
|
10482
|
+
"falsification",
|
|
10483
|
+
"assumption_probe",
|
|
10484
|
+
"prediction_test",
|
|
10485
|
+
"counterfactual",
|
|
10486
|
+
"discovery",
|
|
10487
|
+
"clarification",
|
|
10488
|
+
"comparison",
|
|
10489
|
+
"causal",
|
|
10490
|
+
"mechanism",
|
|
10491
|
+
"general"
|
|
10492
|
+
]);
|
|
10493
|
+
var createQuestionArgs = z.object({
|
|
10494
|
+
text: z.string().describe("The question text."),
|
|
10495
|
+
question: z.string().optional().describe("Backend question text alias for kernel-native callers."),
|
|
10496
|
+
topicId: z.string().optional().describe("Topic scope hint."),
|
|
10497
|
+
priority: questionPrioritySchema.optional().describe("Human-facing question priority."),
|
|
10498
|
+
linkedBeliefId: z.string().optional().describe("Belief this question tests."),
|
|
10499
|
+
linkedBeliefNodeId: z.string().optional().describe("Belief node this question tests."),
|
|
10500
|
+
metadata: jsonRecordSchema5.optional().describe("Optional metadata merged into the question record."),
|
|
10501
|
+
category: z.string().optional().describe("Question category."),
|
|
10502
|
+
source: z.string().optional().describe("Question source."),
|
|
10503
|
+
testType: z.enum(["validates", "invalidates", "clarifies"]).optional().describe("How this question tests its linked belief."),
|
|
10504
|
+
importance: z.number().optional().describe("Numeric importance score."),
|
|
10505
|
+
epistemicUnlock: z.string().optional().describe("What this question unlocks if answered."),
|
|
10506
|
+
sourceQuestionIds: z.array(z.string()).optional().describe("Question IDs this question derives from."),
|
|
10507
|
+
linkedWorktreeId: z.string().optional().describe("Worktree this question belongs to."),
|
|
10508
|
+
questionType: questionTypeSchema.optional().describe("Question type."),
|
|
10509
|
+
questionPriority: kernelQuestionPrioritySchema.optional().describe("Kernel-native question priority.")
|
|
10510
|
+
});
|
|
10511
|
+
var refineQuestionArgs = z.object({
|
|
10512
|
+
id: z.string().describe("The question to refine."),
|
|
10513
|
+
text: z.string().describe("Updated question text."),
|
|
10514
|
+
question: z.string().optional().describe("Backend question text alias for kernel-native callers."),
|
|
10515
|
+
rationale: z.string().optional().describe("Why the question is refined."),
|
|
10516
|
+
category: z.string().optional().describe("Updated question category."),
|
|
10517
|
+
priority: questionPrioritySchema.optional().describe("Updated human-facing priority.")
|
|
10518
|
+
});
|
|
10519
|
+
var createAnswerArgs = z.object({
|
|
10520
|
+
questionNodeId: z.string().describe("The question node ID this answer responds to."),
|
|
10521
|
+
questionId: z.string().optional().describe("Question ID alias accepted by the projection."),
|
|
10522
|
+
answerText: z.string().describe("The answer content."),
|
|
10523
|
+
topicId: z.string().optional().describe("Topic scope for the answer."),
|
|
10524
|
+
confidence: z.string().optional().describe("Answer confidence."),
|
|
10525
|
+
evidenceNodeIds: z.array(z.string()).optional().describe("Evidence node IDs supporting the answer."),
|
|
10526
|
+
answerSource: z.string().optional().describe("How the answer was produced."),
|
|
10527
|
+
worktreeId: z.string().optional().describe("Worktree whose outcome produced this answer."),
|
|
10528
|
+
sprintId: z.string().optional().describe("Legacy sprint identifier.")
|
|
10529
|
+
});
|
|
10530
|
+
var answerQuestionArgs = z.object({
|
|
10531
|
+
id: z.string().describe("Canonical question ID."),
|
|
10532
|
+
topicId: z.string().describe("Topic scope for the answer."),
|
|
10533
|
+
text: z.string().describe("Answer text."),
|
|
10534
|
+
confidence: z.enum(["weak", "medium", "strong"]).optional().describe("Optional answer confidence."),
|
|
10535
|
+
evidenceIds: z.array(z.string()).optional().describe("Canonical evidence IDs supporting the answer."),
|
|
10536
|
+
rationale: z.string().optional().describe("Why this answer is credible."),
|
|
10537
|
+
questionId: z.string().optional().describe("Question ID alias accepted by the projection."),
|
|
10538
|
+
questionNodeId: z.string().optional().describe("Question node ID alias accepted by the projection."),
|
|
10539
|
+
answerText: z.string().optional().describe("Canonical answer text alias accepted by newer callers."),
|
|
10540
|
+
evidenceNodeIds: z.array(z.string()).optional().describe("Evidence node ID alias accepted by newer callers."),
|
|
10541
|
+
answerSource: z.string().optional().describe("How the answer was produced."),
|
|
10542
|
+
worktreeId: z.string().optional().describe("Worktree whose outcome produced this answer."),
|
|
10543
|
+
sprintId: z.string().optional().describe("Legacy sprint identifier.")
|
|
10544
|
+
});
|
|
10545
|
+
var missingQuestionsArgs = z.object({
|
|
10546
|
+
topicId: z.string().describe("Topic scope."),
|
|
10547
|
+
minConfidence: z.number().optional().describe("Minimum confidence threshold for missing-question checks."),
|
|
10548
|
+
status: z.string().optional().describe("Question status filter."),
|
|
10549
|
+
limit: z.number().optional().describe("Maximum questions to inspect.")
|
|
10550
|
+
});
|
|
10551
|
+
var falsificationQuestionsArgs = z.object({
|
|
10552
|
+
topicId: z.string().describe("Topic scope."),
|
|
10553
|
+
beliefIds: z.array(z.string()).optional().describe("Beliefs to generate falsification questions for."),
|
|
10554
|
+
status: z.string().optional().describe("Question status filter."),
|
|
10555
|
+
limit: z.number().optional().describe("Maximum questions to inspect.")
|
|
10556
|
+
});
|
|
9537
10557
|
var questionNodeInput = (input) => compactRecord4({
|
|
9538
10558
|
nodeId: input.nodeId ?? input.id ?? input.questionId,
|
|
9539
10559
|
questionId: input.questionId
|
|
@@ -9580,7 +10600,8 @@ var questionsContracts = [
|
|
|
9580
10600
|
functionName: "create",
|
|
9581
10601
|
kind: "mutation",
|
|
9582
10602
|
inputProjection: createQuestionInput
|
|
9583
|
-
}
|
|
10603
|
+
},
|
|
10604
|
+
args: createQuestionArgs
|
|
9584
10605
|
}),
|
|
9585
10606
|
surfaceContract({
|
|
9586
10607
|
name: "get_question",
|
|
@@ -9636,7 +10657,8 @@ var questionsContracts = [
|
|
|
9636
10657
|
category: input.category,
|
|
9637
10658
|
priority: input.priority
|
|
9638
10659
|
})
|
|
9639
|
-
}
|
|
10660
|
+
},
|
|
10661
|
+
args: refineQuestionArgs
|
|
9640
10662
|
}),
|
|
9641
10663
|
surfaceContract({
|
|
9642
10664
|
name: "update_question_status",
|
|
@@ -9712,7 +10734,8 @@ var questionsContracts = [
|
|
|
9712
10734
|
}),
|
|
9713
10735
|
context
|
|
9714
10736
|
)
|
|
9715
|
-
}
|
|
10737
|
+
},
|
|
10738
|
+
args: createAnswerArgs
|
|
9716
10739
|
}),
|
|
9717
10740
|
surfaceContract({
|
|
9718
10741
|
name: "answer_question",
|
|
@@ -9741,7 +10764,8 @@ var questionsContracts = [
|
|
|
9741
10764
|
}),
|
|
9742
10765
|
context
|
|
9743
10766
|
)
|
|
9744
|
-
}
|
|
10767
|
+
},
|
|
10768
|
+
args: answerQuestionArgs
|
|
9745
10769
|
}),
|
|
9746
10770
|
surfaceContract({
|
|
9747
10771
|
name: "get_answer",
|
|
@@ -9773,7 +10797,8 @@ var questionsContracts = [
|
|
|
9773
10797
|
functionName: "getByTopic",
|
|
9774
10798
|
kind: "query",
|
|
9775
10799
|
inputProjection: questionTopicInput
|
|
9776
|
-
}
|
|
10800
|
+
},
|
|
10801
|
+
args: missingQuestionsArgs
|
|
9777
10802
|
}),
|
|
9778
10803
|
surfaceContract({
|
|
9779
10804
|
name: "get_high_priority_questions",
|
|
@@ -9808,11 +10833,22 @@ var questionsContracts = [
|
|
|
9808
10833
|
functionName: "getByTopic",
|
|
9809
10834
|
kind: "query",
|
|
9810
10835
|
inputProjection: questionTopicInput
|
|
9811
|
-
}
|
|
10836
|
+
},
|
|
10837
|
+
args: falsificationQuestionsArgs
|
|
9812
10838
|
})
|
|
9813
10839
|
];
|
|
9814
|
-
|
|
9815
|
-
|
|
10840
|
+
var updateTopicArgs = z.object({
|
|
10841
|
+
id: z.string().describe("Topic ID."),
|
|
10842
|
+
topicId: z.string().optional().describe("Topic ID alias."),
|
|
10843
|
+
name: z.string().optional().describe("Topic name."),
|
|
10844
|
+
description: z.string().optional().describe("Topic description."),
|
|
10845
|
+
type: z.string().optional().describe("Topic type."),
|
|
10846
|
+
status: z.string().optional().describe("Topic status."),
|
|
10847
|
+
visibility: z.string().optional().describe("Topic visibility."),
|
|
10848
|
+
ontologyId: z.string().optional().describe("Ontology to bind."),
|
|
10849
|
+
clearOntologyId: z.boolean().optional().describe("Whether to clear the ontology binding."),
|
|
10850
|
+
metadata: z.record(z.unknown()).optional().describe("Topic metadata.")
|
|
10851
|
+
});
|
|
9816
10852
|
var topicIdInput = (input) => compactRecord4({
|
|
9817
10853
|
id: input.id ?? input.topicId
|
|
9818
10854
|
});
|
|
@@ -9893,7 +10929,8 @@ var topicsContracts = [
|
|
|
9893
10929
|
functionName: "update",
|
|
9894
10930
|
kind: "mutation",
|
|
9895
10931
|
inputProjection: updateTopicInput
|
|
9896
|
-
}
|
|
10932
|
+
},
|
|
10933
|
+
args: updateTopicArgs
|
|
9897
10934
|
}),
|
|
9898
10935
|
surfaceContract({
|
|
9899
10936
|
name: "get_topic_tree",
|
|
@@ -9912,8 +10949,27 @@ var topicsContracts = [
|
|
|
9912
10949
|
}
|
|
9913
10950
|
})
|
|
9914
10951
|
];
|
|
9915
|
-
|
|
9916
|
-
|
|
10952
|
+
var lensPerspectiveSchema = z.enum([
|
|
10953
|
+
"investigation",
|
|
10954
|
+
"monitoring",
|
|
10955
|
+
"analysis",
|
|
10956
|
+
"comparison",
|
|
10957
|
+
"taxonomy"
|
|
10958
|
+
]);
|
|
10959
|
+
var jsonRecordSchema6 = z.record(z.unknown());
|
|
10960
|
+
var createLensArgs = z.object({
|
|
10961
|
+
name: z.string().describe("Lens name."),
|
|
10962
|
+
workspaceId: z.string().optional().describe("Workspace scope for the lens."),
|
|
10963
|
+
topicId: z.string().optional().describe("Originating topic scope."),
|
|
10964
|
+
description: z.string().optional().describe("What this lens investigates or monitors."),
|
|
10965
|
+
perspectiveType: lensPerspectiveSchema.describe("Perspective type."),
|
|
10966
|
+
promptTemplates: z.array(jsonRecordSchema6).optional().describe("Prompt templates used through this lens."),
|
|
10967
|
+
workflowTemplates: z.array(jsonRecordSchema6).optional().describe("Guided workflow templates."),
|
|
10968
|
+
taskTemplates: z.array(jsonRecordSchema6).optional().describe("Default task templates."),
|
|
10969
|
+
questionTemplates: z.array(jsonRecordSchema6).optional().describe("Default question templates."),
|
|
10970
|
+
filterCriteria: jsonRecordSchema6.optional().describe("Belief/evidence filtering criteria."),
|
|
10971
|
+
metadata: jsonRecordSchema6.optional().describe("Additional lens metadata.")
|
|
10972
|
+
});
|
|
9917
10973
|
var createLensInput = (input, context) => compactRecord4({
|
|
9918
10974
|
name: input.name,
|
|
9919
10975
|
description: input.description,
|
|
@@ -9950,7 +11006,8 @@ var lensesContracts = [
|
|
|
9950
11006
|
functionName: "create",
|
|
9951
11007
|
kind: "mutation",
|
|
9952
11008
|
inputProjection: createLensInput
|
|
9953
|
-
}
|
|
11009
|
+
},
|
|
11010
|
+
args: createLensArgs
|
|
9954
11011
|
}),
|
|
9955
11012
|
surfaceContract({
|
|
9956
11013
|
name: "list_lenses",
|
|
@@ -10012,8 +11069,18 @@ var lensesContracts = [
|
|
|
10012
11069
|
}
|
|
10013
11070
|
})
|
|
10014
11071
|
];
|
|
10015
|
-
|
|
10016
|
-
|
|
11072
|
+
var updateOntologyArgs = z.object({
|
|
11073
|
+
id: z.string().describe("Ontology definition ID."),
|
|
11074
|
+
ontologyId: z.string().optional().describe("Ontology ID alias."),
|
|
11075
|
+
name: z.string().optional().describe("Ontology display name."),
|
|
11076
|
+
description: z.string().optional().describe("Ontology description."),
|
|
11077
|
+
status: z.string().optional().describe("Ontology lifecycle status.")
|
|
11078
|
+
});
|
|
11079
|
+
var ontologyVersionLifecycleArgs = z.object({
|
|
11080
|
+
id: z.string().describe("Ontology version ID."),
|
|
11081
|
+
versionId: z.string().optional().describe("Ontology version ID alias."),
|
|
11082
|
+
ontologyId: z.string().optional().describe("Ontology definition ID.")
|
|
11083
|
+
});
|
|
10017
11084
|
var ontologyIdInput = (input) => compactRecord4({
|
|
10018
11085
|
id: input.id ?? input.ontologyId
|
|
10019
11086
|
});
|
|
@@ -10092,11 +11159,11 @@ var ontologiesContracts = [
|
|
|
10092
11159
|
id: input.id ?? input.ontologyId,
|
|
10093
11160
|
name: input.name,
|
|
10094
11161
|
description: input.description,
|
|
10095
|
-
parentOntologyId: input.parentOntologyId,
|
|
10096
11162
|
status: input.status,
|
|
10097
11163
|
actorId: input.actorId
|
|
10098
11164
|
})
|
|
10099
|
-
}
|
|
11165
|
+
},
|
|
11166
|
+
args: updateOntologyArgs
|
|
10100
11167
|
}),
|
|
10101
11168
|
surfaceContract({
|
|
10102
11169
|
name: "archive_ontology",
|
|
@@ -10179,7 +11246,8 @@ var ontologiesContracts = [
|
|
|
10179
11246
|
functionName: "publishOntologyVersion",
|
|
10180
11247
|
kind: "mutation",
|
|
10181
11248
|
inputProjection: ontologyVersionIdInput
|
|
10182
|
-
}
|
|
11249
|
+
},
|
|
11250
|
+
args: ontologyVersionLifecycleArgs
|
|
10183
11251
|
}),
|
|
10184
11252
|
surfaceContract({
|
|
10185
11253
|
name: "deprecate_ontology_version",
|
|
@@ -10195,7 +11263,8 @@ var ontologiesContracts = [
|
|
|
10195
11263
|
functionName: "deprecateOntologyVersion",
|
|
10196
11264
|
kind: "mutation",
|
|
10197
11265
|
inputProjection: ontologyVersionIdInput
|
|
10198
|
-
}
|
|
11266
|
+
},
|
|
11267
|
+
args: ontologyVersionLifecycleArgs
|
|
10199
11268
|
}),
|
|
10200
11269
|
surfaceContract({
|
|
10201
11270
|
name: "resolve_effective_ontology",
|
|
@@ -10214,8 +11283,76 @@ var ontologiesContracts = [
|
|
|
10214
11283
|
}
|
|
10215
11284
|
})
|
|
10216
11285
|
];
|
|
10217
|
-
|
|
10218
|
-
|
|
11286
|
+
var autoFixPolicyInputSchema = z.object({
|
|
11287
|
+
enabled: z.boolean().optional().describe("Whether automatic remediation is enabled."),
|
|
11288
|
+
mode: z.string().optional().describe("Automation mode for worktree auto-fixes."),
|
|
11289
|
+
maxAttempts: z.number().optional().describe("Maximum number of auto-fix attempts."),
|
|
11290
|
+
reviewer: z.string().optional().describe("Reviewer responsible for auto-fix oversight."),
|
|
11291
|
+
maxActionsPerRun: z.number().optional().describe("Maximum number of auto-fix actions per run."),
|
|
11292
|
+
permittedMutationTiers: z.array(z.enum(["read_only", "low_risk_write", "high_risk_write"])).optional().describe("Mutation tiers the auto-fix worker may execute."),
|
|
11293
|
+
requireAuditTrail: z.boolean().optional().describe("Whether auto-fix actions must write an audit trail."),
|
|
11294
|
+
escalationGate: z.string().optional().describe("Gate to trigger when auto-fix policy requires escalation.")
|
|
11295
|
+
}).passthrough().describe("Policy for permitted automatic remediation inside the worktree.");
|
|
11296
|
+
var worktreeKeyQuestionInputSchema = z.object({
|
|
11297
|
+
question: z.string().describe("Question the worktree must resolve."),
|
|
11298
|
+
status: z.enum(["open", "answered", "forked"]).optional().describe("Current disposition of the key question."),
|
|
11299
|
+
answer: z.string().optional().describe("Captured answer when the key question is resolved."),
|
|
11300
|
+
answerConfidence: z.enum(["high", "medium", "low"]).optional().describe("Confidence in the captured answer."),
|
|
11301
|
+
linkedQuestionId: z.string().optional().describe("Canonical question node linked to this key question.")
|
|
11302
|
+
}).passthrough().describe("Question contract embedded in the worktree plan.");
|
|
11303
|
+
var worktreeEvidenceSignalInputSchema = z.object({
|
|
11304
|
+
signal: z.string().describe("Evidence signal the worktree should collect."),
|
|
11305
|
+
collected: z.boolean().optional().describe("Whether the signal has already been collected."),
|
|
11306
|
+
progress: z.string().optional().describe("Collection progress note for the signal."),
|
|
11307
|
+
notes: z.string().optional().describe("Additional evidence collection notes.")
|
|
11308
|
+
}).passthrough().describe("Evidence signal embedded in the worktree plan.");
|
|
11309
|
+
var worktreeDecisionGateInputSchema = z.object({
|
|
11310
|
+
goCriteria: z.array(z.string()).describe("Criteria that must hold for the worktree to proceed."),
|
|
11311
|
+
noGoSignals: z.array(z.string()).describe("Signals that stop or redirect the worktree."),
|
|
11312
|
+
verdict: z.enum(["go", "no_go", "pivot", "pending"]).optional().describe("Current decision verdict for the worktree gate."),
|
|
11313
|
+
verdictRationale: z.string().optional().describe("Rationale supporting the current gate verdict."),
|
|
11314
|
+
decidedAt: z.number().optional().describe("Timestamp when the gate verdict was decided."),
|
|
11315
|
+
decidedBy: z.string().optional().describe("Actor that decided the gate verdict.")
|
|
11316
|
+
}).passthrough().describe("Decision gate contract for worktree activation or exit.");
|
|
11317
|
+
var addWorktreeArgs = z.object({
|
|
11318
|
+
title: z.string().optional().describe("Human-readable worktree name or objective."),
|
|
11319
|
+
name: z.string().optional().describe("Storage-name alias for callers that already use backend naming."),
|
|
11320
|
+
topicId: z.string().describe("Primary topic scope for the worktree."),
|
|
11321
|
+
projectId: z.string().optional().describe("Legacy topicId alias."),
|
|
11322
|
+
branchId: z.string().optional().describe("Legacy branch identifier for compatibility with workflow callers."),
|
|
11323
|
+
objective: z.string().optional().describe("Reasoning objective this worktree is intended to resolve."),
|
|
11324
|
+
hypothesis: z.string().optional().describe("Testable claim this worktree investigates."),
|
|
11325
|
+
rationale: z.string().optional().describe("Why this worktree exists and why it belongs in the campaign."),
|
|
11326
|
+
worktreeType: z.string().optional().describe("Schema-enum worktree type used for kernel lifecycle behavior."),
|
|
11327
|
+
gate: z.string().optional().describe("Exit gate for this worktree."),
|
|
11328
|
+
startDate: z.number().optional().describe("Planned start timestamp in milliseconds since epoch."),
|
|
11329
|
+
endDate: z.number().optional().describe("Planned end timestamp in milliseconds since epoch."),
|
|
11330
|
+
durationWeeks: z.number().optional().describe("Planned duration in weeks."),
|
|
11331
|
+
confidenceImpact: z.enum(["high", "medium", "low"]).optional().describe("Expected confidence impact if this worktree succeeds."),
|
|
11332
|
+
beliefFocus: z.string().optional().describe("Natural-language focus spanning the target belief neighborhood."),
|
|
11333
|
+
beliefIds: z.array(z.string()).optional().describe("Legacy alias for targetBeliefIds."),
|
|
11334
|
+
beliefs: z.array(z.string()).optional().describe("Legacy alias for targetBeliefIds."),
|
|
11335
|
+
targetBeliefIds: z.array(z.string()).optional().describe("Belief node IDs this worktree is expected to test or update."),
|
|
11336
|
+
targetQuestionIds: z.array(z.string()).optional().describe("Question node IDs this worktree is expected to answer."),
|
|
11337
|
+
keyQuestions: z.array(worktreeKeyQuestionInputSchema).optional().describe("Inline key questions captured as part of the worktree plan."),
|
|
11338
|
+
evidenceSignals: z.array(worktreeEvidenceSignalInputSchema).optional().describe("Evidence signals the worktree needs to collect or validate."),
|
|
11339
|
+
decisionGate: worktreeDecisionGateInputSchema.optional(),
|
|
11340
|
+
goCriteria: z.array(z.string()).optional().describe("Shorthand go criteria used to build decisionGate."),
|
|
11341
|
+
noGoSignals: z.array(z.string()).optional().describe("Shorthand no-go signals used to build decisionGate."),
|
|
11342
|
+
proofArtifacts: z.array(z.unknown()).optional().describe("Expected proof artifacts required to close the worktree."),
|
|
11343
|
+
autoShape: z.boolean().optional().describe("Whether to invoke inquiry auto-shaping during creation."),
|
|
11344
|
+
autoFixPolicy: autoFixPolicyInputSchema.optional(),
|
|
11345
|
+
domainPackId: z.string().optional().describe("Domain pack whose shaping hooks should influence the worktree."),
|
|
11346
|
+
campaign: z.number().optional().describe("Top-level pipeline campaign number."),
|
|
11347
|
+
lane: z.string().optional().describe("Campaign lane for the worktree."),
|
|
11348
|
+
laneOrderInCampaign: z.number().optional().describe("Ordering for this lane within its campaign."),
|
|
11349
|
+
orderInLane: z.number().optional().describe("Position of this worktree inside its lane."),
|
|
11350
|
+
dependsOn: z.array(z.string()).optional().describe("Worktree IDs that must complete before this worktree."),
|
|
11351
|
+
blocks: z.array(z.string()).optional().describe("Worktree IDs blocked by this worktree."),
|
|
11352
|
+
staffingHint: z.string().optional().describe("Suggested staffing or agent allocation note."),
|
|
11353
|
+
lensId: z.string().optional().describe("Lens that scopes this worktree when applicable."),
|
|
11354
|
+
lastReconciledAt: z.number().optional().describe("Timestamp when worktree metadata was last reconciled.")
|
|
11355
|
+
});
|
|
10219
11356
|
var worktreeIdInput = (input) => compactRecord4({
|
|
10220
11357
|
worktreeId: input.worktreeId ?? input.id
|
|
10221
11358
|
});
|
|
@@ -10248,6 +11385,50 @@ var worktreeMetadataInput = (input) => compactRecord4({
|
|
|
10248
11385
|
autoFixPolicy: input.autoFixPolicy,
|
|
10249
11386
|
lastReconciledAt: input.lastReconciledAt
|
|
10250
11387
|
});
|
|
11388
|
+
var worktreeMetadataArgs = z.object({
|
|
11389
|
+
worktreeId: z.string().describe("The worktree to update."),
|
|
11390
|
+
id: z.string().optional().describe("Worktree ID alias."),
|
|
11391
|
+
topicId: z.string().optional().describe("Primary topic scope."),
|
|
11392
|
+
additionalTopicIds: z.array(z.string()).optional().describe("Additional topic scopes associated with this worktree."),
|
|
11393
|
+
status: z.string().optional().describe("Worktree lifecycle status."),
|
|
11394
|
+
campaign: z.number().optional().describe("Top-level pipeline campaign."),
|
|
11395
|
+
lane: z.string().optional().describe("Campaign lane."),
|
|
11396
|
+
laneOrderInCampaign: z.number().optional().describe("Ordering for this lane within its campaign."),
|
|
11397
|
+
orderInLane: z.number().optional().describe("Position of this worktree inside its lane."),
|
|
11398
|
+
gate: z.string().optional().describe("Exit gate for this worktree."),
|
|
11399
|
+
hypothesis: z.string().optional().describe("Testable claim this worktree investigates."),
|
|
11400
|
+
objective: z.string().optional().describe("Reasoning objective for the worktree."),
|
|
11401
|
+
rationale: z.string().optional().describe("Why this worktree is sequenced here."),
|
|
11402
|
+
proofArtifacts: z.array(z.unknown()).optional().describe("Proof artifacts required to close the worktree."),
|
|
11403
|
+
staffingHint: z.string().optional().describe("Suggested staffing or agent allocation note."),
|
|
11404
|
+
blocks: z.array(z.string()).optional().describe("Worktree IDs blocked by this worktree."),
|
|
11405
|
+
dependsOn: z.array(z.string()).optional().describe("Worktree IDs this worktree depends on."),
|
|
11406
|
+
lensId: z.string().optional().describe("Lens that scopes this worktree."),
|
|
11407
|
+
autoFixPolicy: autoFixPolicyInputSchema.optional(),
|
|
11408
|
+
lastReconciledAt: z.number().optional().describe("Timestamp of the last deterministic reconciliation pass.")
|
|
11409
|
+
});
|
|
11410
|
+
var pushArgs = worktreeMetadataArgs.extend({
|
|
11411
|
+
targetContext: z.string().describe("Where to push merged findings."),
|
|
11412
|
+
beliefIds: z.array(z.string()).optional().describe("Optional subset of beliefs to push.")
|
|
11413
|
+
});
|
|
11414
|
+
var openPullRequestArgs = worktreeMetadataArgs.extend({
|
|
11415
|
+
reviewers: z.array(z.string()).optional().describe("User IDs of requested reviewers."),
|
|
11416
|
+
summary: z.string().describe("Summary of findings and why they are ready for review.")
|
|
11417
|
+
});
|
|
11418
|
+
var mergeKeyFindingsInput = (input) => {
|
|
11419
|
+
if (Array.isArray(input.keyFindings)) {
|
|
11420
|
+
return input.keyFindings;
|
|
11421
|
+
}
|
|
11422
|
+
if (Array.isArray(input.outcomes)) {
|
|
11423
|
+
const findings = input.outcomes.filter(
|
|
11424
|
+
(outcome) => typeof outcome === "string" && outcome.trim().length > 0
|
|
11425
|
+
);
|
|
11426
|
+
if (findings.length > 0) {
|
|
11427
|
+
return findings;
|
|
11428
|
+
}
|
|
11429
|
+
}
|
|
11430
|
+
return [input.summary ?? "Merged worktree"];
|
|
11431
|
+
};
|
|
10251
11432
|
var listAllWorktreesInput = (input) => compactRecord4({
|
|
10252
11433
|
status: input.status,
|
|
10253
11434
|
lane: input.lane,
|
|
@@ -10255,6 +11436,16 @@ var listAllWorktreesInput = (input) => compactRecord4({
|
|
|
10255
11436
|
limit: input.limit
|
|
10256
11437
|
});
|
|
10257
11438
|
var worktreesContracts = [
|
|
11439
|
+
surfaceContract({
|
|
11440
|
+
name: "begin_build_session",
|
|
11441
|
+
kind: "mutation",
|
|
11442
|
+
domain: "worktrees",
|
|
11443
|
+
surfaceClass: "platform_internal",
|
|
11444
|
+
path: "/mcp/build-session/begin",
|
|
11445
|
+
sdkNamespace: "worktrees",
|
|
11446
|
+
sdkMethod: "beginBuildSession",
|
|
11447
|
+
summary: "Begin a coding build session for a worktree."
|
|
11448
|
+
}),
|
|
10258
11449
|
surfaceContract({
|
|
10259
11450
|
name: "add_worktree",
|
|
10260
11451
|
kind: "mutation",
|
|
@@ -10271,13 +11462,12 @@ var worktreesContracts = [
|
|
|
10271
11462
|
inputProjection: (input, context) => withCreatedBy(
|
|
10272
11463
|
compactRecord4({
|
|
10273
11464
|
name: input.name ?? input.title,
|
|
10274
|
-
topicId: input.topicId,
|
|
11465
|
+
topicId: input.topicId ?? input.projectId,
|
|
10275
11466
|
worktreeType: input.worktreeType,
|
|
10276
11467
|
objective: input.objective,
|
|
10277
11468
|
gate: input.gate,
|
|
10278
11469
|
hypothesis: input.hypothesis,
|
|
10279
11470
|
rationale: input.rationale,
|
|
10280
|
-
signal: input.signal,
|
|
10281
11471
|
startDate: input.startDate,
|
|
10282
11472
|
endDate: input.endDate,
|
|
10283
11473
|
durationWeeks: input.durationWeeks,
|
|
@@ -10303,12 +11493,12 @@ var worktreesContracts = [
|
|
|
10303
11493
|
staffingHint: input.staffingHint,
|
|
10304
11494
|
domainPackId: input.domainPackId,
|
|
10305
11495
|
lensId: input.lensId,
|
|
10306
|
-
linkedQuestionId: input.linkedQuestionId,
|
|
10307
11496
|
lastReconciledAt: input.lastReconciledAt
|
|
10308
11497
|
}),
|
|
10309
11498
|
context
|
|
10310
11499
|
)
|
|
10311
|
-
}
|
|
11500
|
+
},
|
|
11501
|
+
args: addWorktreeArgs
|
|
10312
11502
|
}),
|
|
10313
11503
|
surfaceContract({
|
|
10314
11504
|
name: "activate_worktree",
|
|
@@ -10420,7 +11610,8 @@ var worktreesContracts = [
|
|
|
10420
11610
|
functionName: "updateMetadata",
|
|
10421
11611
|
kind: "mutation",
|
|
10422
11612
|
inputProjection: worktreeMetadataInput
|
|
10423
|
-
}
|
|
11613
|
+
},
|
|
11614
|
+
args: worktreeMetadataArgs
|
|
10424
11615
|
}),
|
|
10425
11616
|
surfaceContract({
|
|
10426
11617
|
name: "merge",
|
|
@@ -10438,9 +11629,7 @@ var worktreesContracts = [
|
|
|
10438
11629
|
inputProjection: (input, context) => withUserId(
|
|
10439
11630
|
{
|
|
10440
11631
|
...worktreeIdInput(input),
|
|
10441
|
-
keyFindings: input
|
|
10442
|
-
input.summary ?? "Merged worktree"
|
|
10443
|
-
],
|
|
11632
|
+
keyFindings: mergeKeyFindingsInput(input),
|
|
10444
11633
|
decisionsReached: input.decisionsReached ?? [],
|
|
10445
11634
|
nextSteps: input.nextSteps ?? []
|
|
10446
11635
|
},
|
|
@@ -10462,7 +11651,8 @@ var worktreesContracts = [
|
|
|
10462
11651
|
functionName: "updateMetadata",
|
|
10463
11652
|
kind: "mutation",
|
|
10464
11653
|
inputProjection: worktreeMetadataInput
|
|
10465
|
-
}
|
|
11654
|
+
},
|
|
11655
|
+
args: pushArgs
|
|
10466
11656
|
}),
|
|
10467
11657
|
surfaceContract({
|
|
10468
11658
|
name: "open_pull_request",
|
|
@@ -10478,7 +11668,8 @@ var worktreesContracts = [
|
|
|
10478
11668
|
functionName: "updateMetadata",
|
|
10479
11669
|
kind: "mutation",
|
|
10480
11670
|
inputProjection: worktreeMetadataInput
|
|
10481
|
-
}
|
|
11671
|
+
},
|
|
11672
|
+
args: openPullRequestArgs
|
|
10482
11673
|
})
|
|
10483
11674
|
];
|
|
10484
11675
|
|
|
@@ -10582,6 +11773,15 @@ var createEdgeArgs = z.object({
|
|
|
10582
11773
|
topicId: z.string().optional(),
|
|
10583
11774
|
trustedBypassAccessCheck: z.boolean().optional()
|
|
10584
11775
|
});
|
|
11776
|
+
var queryLineageArgs = z.object({
|
|
11777
|
+
nodeId: z.string().describe("Starting node to trace from."),
|
|
11778
|
+
startNode: z.string().optional().describe("Starting node alias accepted by traversal callers."),
|
|
11779
|
+
depth: z.number().optional().describe("Traversal depth alias."),
|
|
11780
|
+
maxDepth: z.number().optional().describe("Maximum traversal depth."),
|
|
11781
|
+
mode: z.string().optional().describe("Traversal mode."),
|
|
11782
|
+
minLayer: z.string().optional().describe("Minimum epistemic layer."),
|
|
11783
|
+
maxLayer: z.string().optional().describe("Maximum epistemic layer.")
|
|
11784
|
+
});
|
|
10585
11785
|
function graphRefNodeId(ref) {
|
|
10586
11786
|
if (ref.kind === "epistemic_node") {
|
|
10587
11787
|
return ref.nodeId;
|
|
@@ -10652,11 +11852,84 @@ var edgesContracts = [
|
|
|
10652
11852
|
minLayer: input.minLayer,
|
|
10653
11853
|
maxLayer: input.maxLayer
|
|
10654
11854
|
})
|
|
10655
|
-
}
|
|
11855
|
+
},
|
|
11856
|
+
args: queryLineageArgs
|
|
10656
11857
|
})
|
|
10657
11858
|
];
|
|
10658
|
-
|
|
10659
|
-
|
|
11859
|
+
var graphIntelligenceQueryModes = [
|
|
11860
|
+
"core",
|
|
11861
|
+
"bias",
|
|
11862
|
+
"stress",
|
|
11863
|
+
"operational",
|
|
11864
|
+
"alpha",
|
|
11865
|
+
"semantic",
|
|
11866
|
+
"evidence"
|
|
11867
|
+
];
|
|
11868
|
+
var traversalLayerSchema = z.enum([
|
|
11869
|
+
"L4",
|
|
11870
|
+
"L3",
|
|
11871
|
+
"L2",
|
|
11872
|
+
"L1",
|
|
11873
|
+
"ontological",
|
|
11874
|
+
"organizational"
|
|
11875
|
+
]);
|
|
11876
|
+
var traversalModeSchema = z.enum(["low", "medium", "high", "extra_high"]);
|
|
11877
|
+
var lineageAliasArgs = z.object({
|
|
11878
|
+
nodeId: z.string().optional().describe("Starting node to traverse from."),
|
|
11879
|
+
startNode: z.string().optional().describe("Starting node alias for traversal callers."),
|
|
11880
|
+
entityId: z.string().optional().describe("Entity identifier alias for impact tracing."),
|
|
11881
|
+
depth: z.number().optional().describe("Traversal depth alias."),
|
|
11882
|
+
maxDepth: z.number().optional().describe("Maximum traversal depth."),
|
|
11883
|
+
mode: traversalModeSchema.optional().describe("Traversal mode."),
|
|
11884
|
+
minLayer: traversalLayerSchema.optional().describe("Minimum epistemic layer to include."),
|
|
11885
|
+
maxLayer: traversalLayerSchema.optional().describe("Maximum epistemic layer to include.")
|
|
11886
|
+
});
|
|
11887
|
+
var lineageArgs = lineageAliasArgs.extend({
|
|
11888
|
+
nodeId: z.string().describe("Starting node to traverse from.")
|
|
11889
|
+
});
|
|
11890
|
+
var traverseGraphArgs = lineageAliasArgs.extend({
|
|
11891
|
+
startNode: z.string().describe("Node to start traversal from."),
|
|
11892
|
+
direction: z.enum(["up", "down", "both"]).optional().describe("Traversal direction.")
|
|
11893
|
+
});
|
|
11894
|
+
var graphNeighborhoodArgs = z.object({
|
|
11895
|
+
globalId: z.string().optional().describe("Single root global ID."),
|
|
11896
|
+
globalIds: z.array(z.string()).optional().describe("Root global IDs for the neighborhood."),
|
|
11897
|
+
maxDepth: z.number().optional().describe("Maximum traversal depth."),
|
|
11898
|
+
topicId: z.string().optional().describe("Topic scope for edge lookup."),
|
|
11899
|
+
limit: z.number().optional().describe("Maximum edges to return.")
|
|
11900
|
+
});
|
|
11901
|
+
var graphIntelligenceModeSchema = z.enum([
|
|
11902
|
+
graphIntelligenceQueryModes[0],
|
|
11903
|
+
...graphIntelligenceQueryModes.slice(1)
|
|
11904
|
+
]);
|
|
11905
|
+
var graphIntelligenceCatalogArgs = z.object({
|
|
11906
|
+
categoryId: z.string().optional().describe("Optional query category filter."),
|
|
11907
|
+
mode: graphIntelligenceModeSchema.optional().describe("Optional Graph Intelligence query mode filter.")
|
|
11908
|
+
});
|
|
11909
|
+
var graphIntelligenceRunArgs = z.object({
|
|
11910
|
+
topicId: z.string().describe("Topic to analyze."),
|
|
11911
|
+
queryId: z.string().optional().describe("Catalog query ID to run, such as pre-mortem."),
|
|
11912
|
+
prompt: z.string().optional().describe("Custom prompt when queryId is omitted or overridden."),
|
|
11913
|
+
input: z.string().optional().describe("Optional entity, theme, belief, company, or search text."),
|
|
11914
|
+
mode: graphIntelligenceModeSchema.optional().describe("Optional query mode override for custom prompts."),
|
|
11915
|
+
limit: z.number().optional().describe("Maximum graph context rows to return.")
|
|
11916
|
+
});
|
|
11917
|
+
var flagContradictionArgs = z.object({
|
|
11918
|
+
beliefA: z.string().describe("First belief in tension."),
|
|
11919
|
+
beliefB: z.string().describe("Second belief in tension."),
|
|
11920
|
+
topicId: z.string().optional().describe("Topic scope for the contradiction."),
|
|
11921
|
+
description: z.string().optional().describe("Human-readable contradiction."),
|
|
11922
|
+
severity: z.enum(["critical", "high", "medium", "low"]).optional().describe("Contradiction severity."),
|
|
11923
|
+
defeatType: z.string().optional().describe("Defeat type annotation."),
|
|
11924
|
+
supportingInsightIds: z.array(z.string()).optional().describe("Evidence supporting the primary belief."),
|
|
11925
|
+
contradictingInsightIds: z.array(z.string()).optional().describe("Evidence or beliefs contradicting the primary belief.")
|
|
11926
|
+
});
|
|
11927
|
+
var discoverEntityConnectionsArgs = lineageAliasArgs.extend({
|
|
11928
|
+
nodeId: z.string().describe("Epistemic node ID to find entity connections for."),
|
|
11929
|
+
topicId: z.string().optional().describe("Topic scope override."),
|
|
11930
|
+
minScore: z.number().optional().describe("Minimum match score."),
|
|
11931
|
+
limit: z.number().optional().describe("Maximum candidates to return.")
|
|
11932
|
+
});
|
|
10660
11933
|
var contradictionSeverity = (value) => {
|
|
10661
11934
|
switch (value) {
|
|
10662
11935
|
case "critical":
|
|
@@ -10711,7 +11984,8 @@ var graphContracts = [
|
|
|
10711
11984
|
functionName: "getLineage",
|
|
10712
11985
|
kind: "query",
|
|
10713
11986
|
inputProjection: lineageInput
|
|
10714
|
-
}
|
|
11987
|
+
},
|
|
11988
|
+
args: traverseGraphArgs
|
|
10715
11989
|
}),
|
|
10716
11990
|
surfaceContract({
|
|
10717
11991
|
name: "get_graph_neighborhood",
|
|
@@ -10727,7 +12001,8 @@ var graphContracts = [
|
|
|
10727
12001
|
functionName: "getByTopic",
|
|
10728
12002
|
kind: "query",
|
|
10729
12003
|
inputProjection: topicEdgesInput
|
|
10730
|
-
}
|
|
12004
|
+
},
|
|
12005
|
+
args: graphNeighborhoodArgs
|
|
10731
12006
|
}),
|
|
10732
12007
|
surfaceContract({
|
|
10733
12008
|
name: "get_graph_structure_analysis",
|
|
@@ -10744,6 +12019,38 @@ var graphContracts = [
|
|
|
10744
12019
|
kind: "query"
|
|
10745
12020
|
}
|
|
10746
12021
|
}),
|
|
12022
|
+
surfaceContract({
|
|
12023
|
+
name: "list_graph_intelligence_queries",
|
|
12024
|
+
kind: "query",
|
|
12025
|
+
domain: "graph",
|
|
12026
|
+
surfaceClass: "platform_public",
|
|
12027
|
+
path: "/graph-intelligence/queries",
|
|
12028
|
+
sdkNamespace: "graphAnalysis",
|
|
12029
|
+
sdkMethod: "listGraphIntelligenceQueries",
|
|
12030
|
+
summary: "List Graph Intelligence query catalog entries.",
|
|
12031
|
+
convex: {
|
|
12032
|
+
module: "contextCompiler",
|
|
12033
|
+
functionName: "listGraphIntelligenceQueries",
|
|
12034
|
+
kind: "query"
|
|
12035
|
+
},
|
|
12036
|
+
args: graphIntelligenceCatalogArgs
|
|
12037
|
+
}),
|
|
12038
|
+
surfaceContract({
|
|
12039
|
+
name: "run_graph_intelligence_query",
|
|
12040
|
+
kind: "query",
|
|
12041
|
+
domain: "graph",
|
|
12042
|
+
surfaceClass: "platform_public",
|
|
12043
|
+
path: "/graph-intelligence/run",
|
|
12044
|
+
sdkNamespace: "graphAnalysis",
|
|
12045
|
+
sdkMethod: "runGraphIntelligenceQuery",
|
|
12046
|
+
summary: "Run a Graph Intelligence query against a topic graph.",
|
|
12047
|
+
convex: {
|
|
12048
|
+
module: "contextCompiler",
|
|
12049
|
+
functionName: "runGraphIntelligenceQuery",
|
|
12050
|
+
kind: "query"
|
|
12051
|
+
},
|
|
12052
|
+
args: graphIntelligenceRunArgs
|
|
12053
|
+
}),
|
|
10747
12054
|
surfaceContract({
|
|
10748
12055
|
name: "find_contradictions",
|
|
10749
12056
|
kind: "query",
|
|
@@ -10776,7 +12083,8 @@ var graphContracts = [
|
|
|
10776
12083
|
functionName: "create",
|
|
10777
12084
|
kind: "mutation",
|
|
10778
12085
|
inputProjection: flagContradictionInput
|
|
10779
|
-
}
|
|
12086
|
+
},
|
|
12087
|
+
args: flagContradictionArgs
|
|
10780
12088
|
}),
|
|
10781
12089
|
surfaceContract({
|
|
10782
12090
|
name: "detect_confirmation_bias",
|
|
@@ -10867,7 +12175,8 @@ var graphContracts = [
|
|
|
10867
12175
|
functionName: "getLineage",
|
|
10868
12176
|
kind: "query",
|
|
10869
12177
|
inputProjection: lineageInput
|
|
10870
|
-
}
|
|
12178
|
+
},
|
|
12179
|
+
args: discoverEntityConnectionsArgs
|
|
10871
12180
|
}),
|
|
10872
12181
|
surfaceContract({
|
|
10873
12182
|
name: "trigger_belief_review",
|
|
@@ -10898,7 +12207,8 @@ var graphContracts = [
|
|
|
10898
12207
|
functionName: "getLineage",
|
|
10899
12208
|
kind: "query",
|
|
10900
12209
|
inputProjection: lineageInput
|
|
10901
|
-
}
|
|
12210
|
+
},
|
|
12211
|
+
args: lineageArgs
|
|
10902
12212
|
})
|
|
10903
12213
|
];
|
|
10904
12214
|
|
|
@@ -10950,8 +12260,16 @@ var contractsContracts = [
|
|
|
10950
12260
|
}
|
|
10951
12261
|
})
|
|
10952
12262
|
];
|
|
10953
|
-
|
|
10954
|
-
|
|
12263
|
+
var auditTrailArgs = z.object({
|
|
12264
|
+
nodeId: z.string().describe("The node to audit."),
|
|
12265
|
+
id: z.string().optional().describe("Node ID alias."),
|
|
12266
|
+
limit: z.number().optional().describe("Maximum entries to return."),
|
|
12267
|
+
depth: z.number().optional().describe("Traversal depth alias."),
|
|
12268
|
+
maxDepth: z.number().optional().describe("Maximum lineage depth."),
|
|
12269
|
+
mode: z.string().optional().describe("Traversal mode."),
|
|
12270
|
+
minLayer: z.string().optional().describe("Minimum epistemic layer."),
|
|
12271
|
+
maxLayer: z.string().optional().describe("Maximum epistemic layer.")
|
|
12272
|
+
});
|
|
10955
12273
|
var judgmentsContracts = [
|
|
10956
12274
|
surfaceContract({
|
|
10957
12275
|
name: "record_judgment",
|
|
@@ -11006,7 +12324,8 @@ var judgmentsContracts = [
|
|
|
11006
12324
|
minLayer: input.minLayer,
|
|
11007
12325
|
maxLayer: input.maxLayer
|
|
11008
12326
|
})
|
|
11009
|
-
}
|
|
12327
|
+
},
|
|
12328
|
+
args: auditTrailArgs
|
|
11010
12329
|
})
|
|
11011
12330
|
];
|
|
11012
12331
|
|
|
@@ -11174,8 +12493,13 @@ var coordinationContracts = [
|
|
|
11174
12493
|
}
|
|
11175
12494
|
})
|
|
11176
12495
|
];
|
|
11177
|
-
|
|
11178
|
-
|
|
12496
|
+
var pipelineSnapshotArgs = z.object({
|
|
12497
|
+
topicId: z.string().describe("Topic scope ID."),
|
|
12498
|
+
status: z.string().optional().describe("Worktree status filter."),
|
|
12499
|
+
lane: z.string().optional().describe("Campaign lane filter."),
|
|
12500
|
+
campaign: z.number().optional().describe("Campaign number filter."),
|
|
12501
|
+
limit: z.number().optional().describe("Maximum worktrees to inspect.")
|
|
12502
|
+
});
|
|
11179
12503
|
var pipelineContracts = [
|
|
11180
12504
|
surfaceContract({
|
|
11181
12505
|
name: "pipeline_snapshot",
|
|
@@ -11196,7 +12520,8 @@ var pipelineContracts = [
|
|
|
11196
12520
|
campaign: input.campaign,
|
|
11197
12521
|
limit: input.limit
|
|
11198
12522
|
})
|
|
11199
|
-
}
|
|
12523
|
+
},
|
|
12524
|
+
args: pipelineSnapshotArgs
|
|
11200
12525
|
}),
|
|
11201
12526
|
surfaceContract({
|
|
11202
12527
|
name: "seed_belief_lattice",
|
|
@@ -11248,7 +12573,31 @@ var recordScopeLearningArgs = z.object({
|
|
|
11248
12573
|
rationale: z.string().optional().describe("Why this learning should enter the reasoning graph"),
|
|
11249
12574
|
createQuestionText: z.string().optional().describe("Optional follow-up question text"),
|
|
11250
12575
|
createBeliefText: z.string().optional().describe("Optional new belief text"),
|
|
11251
|
-
beliefType: z.string().optional().describe("Optional belief type for createBeliefText")
|
|
12576
|
+
beliefType: z.string().optional().describe("Optional belief type for createBeliefText"),
|
|
12577
|
+
text: z.string().optional().describe("Canonical learning text alias."),
|
|
12578
|
+
content: z.string().optional().describe("Canonical learning content alias."),
|
|
12579
|
+
kind: z.string().optional().describe("Evidence kind to store."),
|
|
12580
|
+
sourceType: z.string().optional().describe("Evidence source type."),
|
|
12581
|
+
externalSourceType: z.string().optional().describe("External source type alias."),
|
|
12582
|
+
metadata: z.record(z.unknown()).optional().describe("Learning metadata.")
|
|
12583
|
+
});
|
|
12584
|
+
var codeContextArgs = z.object({
|
|
12585
|
+
topicId: z.string().optional().describe("Topic scope."),
|
|
12586
|
+
filePath: z.string().optional().describe("File path anchor."),
|
|
12587
|
+
includeFailures: z.boolean().optional().describe("Whether to include failed attempts."),
|
|
12588
|
+
limit: z.number().optional().describe("Maximum records to return."),
|
|
12589
|
+
status: z.string().optional().describe("Evidence status filter.")
|
|
12590
|
+
});
|
|
12591
|
+
var recordAttemptArgs = z.object({
|
|
12592
|
+
topicId: z.string().optional().describe("Topic scope."),
|
|
12593
|
+
description: z.string().describe("Attempt description."),
|
|
12594
|
+
errorMessage: z.string().optional().describe("Failure or error message."),
|
|
12595
|
+
filePaths: z.array(z.string()).optional().describe("Files involved in the attempt."),
|
|
12596
|
+
filePath: z.string().optional().describe("Single file path alias."),
|
|
12597
|
+
linkedBeliefId: z.string().optional().describe("Linked belief ID."),
|
|
12598
|
+
metadata: z.record(z.unknown()).optional().describe("Attempt metadata."),
|
|
12599
|
+
rationale: z.string().optional().describe("Why this attempt should be recorded."),
|
|
12600
|
+
title: z.string().optional().describe("Attempt evidence title.")
|
|
11252
12601
|
});
|
|
11253
12602
|
var learningInput = (input, context) => {
|
|
11254
12603
|
const sourceKind = input.sourceKind ?? input.externalSourceType;
|
|
@@ -11365,7 +12714,8 @@ var codingContracts = [
|
|
|
11365
12714
|
status: input.status,
|
|
11366
12715
|
userId: input.userId
|
|
11367
12716
|
})
|
|
11368
|
-
}
|
|
12717
|
+
},
|
|
12718
|
+
args: codeContextArgs
|
|
11369
12719
|
}),
|
|
11370
12720
|
surfaceContract({
|
|
11371
12721
|
name: "get_change_history",
|
|
@@ -11402,7 +12752,8 @@ var codingContracts = [
|
|
|
11402
12752
|
functionName: "create",
|
|
11403
12753
|
kind: "mutation",
|
|
11404
12754
|
inputProjection: attemptInput
|
|
11405
|
-
}
|
|
12755
|
+
},
|
|
12756
|
+
args: recordAttemptArgs
|
|
11406
12757
|
}),
|
|
11407
12758
|
surfaceContract({
|
|
11408
12759
|
name: "get_failure_log",
|
|
@@ -11477,6 +12828,604 @@ new Map(
|
|
|
11477
12828
|
ALL_FUNCTION_CONTRACTS.map((contract) => [contract.name, contract])
|
|
11478
12829
|
);
|
|
11479
12830
|
|
|
12831
|
+
// ../contracts/src/tenant-bootstrap-seed.contract.ts
|
|
12832
|
+
function isCopyableSeedRequirement(entry) {
|
|
12833
|
+
return (entry.copyMode === "template_global" || entry.copyMode === "template_tenant_rewrite" || entry.copyMode === "template_reference_remap") && Boolean(entry.scope) && Array.isArray(entry.uniqueKey) && entry.uniqueKey.length > 0;
|
|
12834
|
+
}
|
|
12835
|
+
var TENANT_BOOTSTRAP_TABLE_REQUIREMENTS = [
|
|
12836
|
+
{
|
|
12837
|
+
component: "kernel",
|
|
12838
|
+
table: "agentMessages",
|
|
12839
|
+
prepopulation: "runtime_data",
|
|
12840
|
+
copyMode: "none",
|
|
12841
|
+
description: "Agent coordination messages are session data, not template data."
|
|
12842
|
+
},
|
|
12843
|
+
{
|
|
12844
|
+
component: "kernel",
|
|
12845
|
+
table: "agentSessions",
|
|
12846
|
+
prepopulation: "runtime_data",
|
|
12847
|
+
copyMode: "none",
|
|
12848
|
+
description: "Agent coordination sessions are created by active clients."
|
|
12849
|
+
},
|
|
12850
|
+
{
|
|
12851
|
+
component: "kernel",
|
|
12852
|
+
table: "autofixJobs",
|
|
12853
|
+
prepopulation: "runtime_queue",
|
|
12854
|
+
copyMode: "none",
|
|
12855
|
+
description: "Autofix work items are runtime queue rows."
|
|
12856
|
+
},
|
|
12857
|
+
{
|
|
12858
|
+
component: "kernel",
|
|
12859
|
+
table: "backgroundJobRuns",
|
|
12860
|
+
prepopulation: "runtime_log",
|
|
12861
|
+
copyMode: "none",
|
|
12862
|
+
description: "Background job executions are runtime logs."
|
|
12863
|
+
},
|
|
12864
|
+
{
|
|
12865
|
+
component: "kernel",
|
|
12866
|
+
table: "backgroundJobSettings",
|
|
12867
|
+
prepopulation: "required_template",
|
|
12868
|
+
copyMode: "template_global",
|
|
12869
|
+
scope: "global",
|
|
12870
|
+
uniqueKey: ["jobKey"],
|
|
12871
|
+
description: "Default job enablement settings must come from the K template."
|
|
12872
|
+
},
|
|
12873
|
+
{
|
|
12874
|
+
component: "kernel",
|
|
12875
|
+
table: "beliefConfidence",
|
|
12876
|
+
prepopulation: "runtime_data",
|
|
12877
|
+
copyMode: "none",
|
|
12878
|
+
description: "Belief confidence rows are created with tenant graph facts."
|
|
12879
|
+
},
|
|
12880
|
+
{
|
|
12881
|
+
component: "kernel",
|
|
12882
|
+
table: "beliefEvidenceLinks",
|
|
12883
|
+
prepopulation: "runtime_data",
|
|
12884
|
+
copyMode: "none",
|
|
12885
|
+
description: "Belief-to-evidence links are tenant graph data."
|
|
12886
|
+
},
|
|
12887
|
+
{
|
|
12888
|
+
component: "kernel",
|
|
12889
|
+
table: "beliefHistory",
|
|
12890
|
+
prepopulation: "runtime_data",
|
|
12891
|
+
copyMode: "none",
|
|
12892
|
+
description: "Belief history is append-only tenant graph data."
|
|
12893
|
+
},
|
|
12894
|
+
{
|
|
12895
|
+
component: "kernel",
|
|
12896
|
+
table: "beliefScenarios",
|
|
12897
|
+
prepopulation: "runtime_data",
|
|
12898
|
+
copyMode: "none",
|
|
12899
|
+
description: "Scenario rows are tenant-authored reasoning data."
|
|
12900
|
+
},
|
|
12901
|
+
{
|
|
12902
|
+
component: "kernel",
|
|
12903
|
+
table: "beliefVotes",
|
|
12904
|
+
prepopulation: "runtime_data",
|
|
12905
|
+
copyMode: "none",
|
|
12906
|
+
description: "Decision belief votes are tenant-authored data."
|
|
12907
|
+
},
|
|
12908
|
+
{
|
|
12909
|
+
component: "kernel",
|
|
12910
|
+
table: "calibrationScores",
|
|
12911
|
+
prepopulation: "runtime_derived",
|
|
12912
|
+
copyMode: "none",
|
|
12913
|
+
description: "Calibration scores are computed from tenant outcomes."
|
|
12914
|
+
},
|
|
12915
|
+
{
|
|
12916
|
+
component: "kernel",
|
|
12917
|
+
table: "contractEvaluations",
|
|
12918
|
+
prepopulation: "runtime_log",
|
|
12919
|
+
copyMode: "none",
|
|
12920
|
+
description: "Contract evaluation rows are runtime computation logs."
|
|
12921
|
+
},
|
|
12922
|
+
{
|
|
12923
|
+
component: "kernel",
|
|
12924
|
+
table: "contradictions",
|
|
12925
|
+
prepopulation: "runtime_data",
|
|
12926
|
+
copyMode: "none",
|
|
12927
|
+
description: "Contradictions are tenant graph facts."
|
|
12928
|
+
},
|
|
12929
|
+
{
|
|
12930
|
+
component: "kernel",
|
|
12931
|
+
table: "crossProjectConnections",
|
|
12932
|
+
prepopulation: "runtime_data",
|
|
12933
|
+
copyMode: "none",
|
|
12934
|
+
description: "Cross-topic connections are tenant graph facts."
|
|
12935
|
+
},
|
|
12936
|
+
{
|
|
12937
|
+
component: "kernel",
|
|
12938
|
+
table: "decisionComputedSummaries",
|
|
12939
|
+
prepopulation: "runtime_derived",
|
|
12940
|
+
copyMode: "none",
|
|
12941
|
+
description: "Decision summaries are derived tenant outputs."
|
|
12942
|
+
},
|
|
12943
|
+
{
|
|
12944
|
+
component: "kernel",
|
|
12945
|
+
table: "decisionEvents",
|
|
12946
|
+
prepopulation: "runtime_data",
|
|
12947
|
+
copyMode: "none",
|
|
12948
|
+
description: "Decision events are lifecycle data."
|
|
12949
|
+
},
|
|
12950
|
+
{
|
|
12951
|
+
component: "kernel",
|
|
12952
|
+
table: "decisionParticipants",
|
|
12953
|
+
prepopulation: "runtime_data",
|
|
12954
|
+
copyMode: "none",
|
|
12955
|
+
description: "Decision participants are tenant-selected actors."
|
|
12956
|
+
},
|
|
12957
|
+
{
|
|
12958
|
+
component: "kernel",
|
|
12959
|
+
table: "decisionRiskLedger",
|
|
12960
|
+
prepopulation: "runtime_data",
|
|
12961
|
+
copyMode: "none",
|
|
12962
|
+
description: "Decision risk rows are tenant decision data."
|
|
12963
|
+
},
|
|
12964
|
+
{
|
|
12965
|
+
component: "kernel",
|
|
12966
|
+
table: "decisionSnapshots",
|
|
12967
|
+
prepopulation: "runtime_derived",
|
|
12968
|
+
copyMode: "none",
|
|
12969
|
+
description: "Decision snapshots are derived from tenant state."
|
|
12970
|
+
},
|
|
12971
|
+
{
|
|
12972
|
+
component: "kernel",
|
|
12973
|
+
table: "deliberationContributions",
|
|
12974
|
+
prepopulation: "runtime_data",
|
|
12975
|
+
copyMode: "none",
|
|
12976
|
+
description: "Deliberation contributions are tenant-authored data."
|
|
12977
|
+
},
|
|
12978
|
+
{
|
|
12979
|
+
component: "kernel",
|
|
12980
|
+
table: "deliberationSessions",
|
|
12981
|
+
prepopulation: "runtime_data",
|
|
12982
|
+
copyMode: "none",
|
|
12983
|
+
description: "Deliberation sessions are created by tenant workflows."
|
|
12984
|
+
},
|
|
12985
|
+
{
|
|
12986
|
+
component: "kernel",
|
|
12987
|
+
table: "epistemicAudit",
|
|
12988
|
+
prepopulation: "runtime_log",
|
|
12989
|
+
copyMode: "none",
|
|
12990
|
+
description: "Epistemic audit rows are append-only runtime audit data."
|
|
12991
|
+
},
|
|
12992
|
+
{
|
|
12993
|
+
component: "kernel",
|
|
12994
|
+
table: "epistemicContracts",
|
|
12995
|
+
prepopulation: "runtime_data",
|
|
12996
|
+
copyMode: "none",
|
|
12997
|
+
description: "Epistemic contracts are tenant-authored governance data."
|
|
12998
|
+
},
|
|
12999
|
+
{
|
|
13000
|
+
component: "kernel",
|
|
13001
|
+
table: "epistemicEdges",
|
|
13002
|
+
prepopulation: "runtime_data",
|
|
13003
|
+
copyMode: "none",
|
|
13004
|
+
description: "Edges are tenant reasoning graph data."
|
|
13005
|
+
},
|
|
13006
|
+
{
|
|
13007
|
+
component: "kernel",
|
|
13008
|
+
table: "epistemicNodeEmbeddings",
|
|
13009
|
+
prepopulation: "runtime_derived",
|
|
13010
|
+
copyMode: "none",
|
|
13011
|
+
description: "Embeddings are derived from tenant graph nodes."
|
|
13012
|
+
},
|
|
13013
|
+
{
|
|
13014
|
+
component: "kernel",
|
|
13015
|
+
table: "epistemicNodes",
|
|
13016
|
+
prepopulation: "runtime_data",
|
|
13017
|
+
copyMode: "none",
|
|
13018
|
+
description: "Nodes are tenant reasoning graph data."
|
|
13019
|
+
},
|
|
13020
|
+
{
|
|
13021
|
+
component: "kernel",
|
|
13022
|
+
table: "graphAnalysisCache",
|
|
13023
|
+
prepopulation: "runtime_derived",
|
|
13024
|
+
copyMode: "none",
|
|
13025
|
+
description: "Graph analysis cache rows are derived from tenant graph state."
|
|
13026
|
+
},
|
|
13027
|
+
{
|
|
13028
|
+
component: "kernel",
|
|
13029
|
+
table: "graphAnalysisResults",
|
|
13030
|
+
prepopulation: "runtime_derived",
|
|
13031
|
+
copyMode: "none",
|
|
13032
|
+
description: "Graph analysis result rows are derived tenant outputs."
|
|
13033
|
+
},
|
|
13034
|
+
{
|
|
13035
|
+
component: "kernel",
|
|
13036
|
+
table: "graphSuggestions",
|
|
13037
|
+
prepopulation: "runtime_derived",
|
|
13038
|
+
copyMode: "none",
|
|
13039
|
+
description: "Graph suggestions are derived recommendations."
|
|
13040
|
+
},
|
|
13041
|
+
{
|
|
13042
|
+
component: "kernel",
|
|
13043
|
+
table: "harnessReplays",
|
|
13044
|
+
prepopulation: "runtime_log",
|
|
13045
|
+
copyMode: "none",
|
|
13046
|
+
description: "Harness replay rows are runtime verification logs."
|
|
13047
|
+
},
|
|
13048
|
+
{
|
|
13049
|
+
component: "kernel",
|
|
13050
|
+
table: "harnessRuns",
|
|
13051
|
+
prepopulation: "runtime_log",
|
|
13052
|
+
copyMode: "none",
|
|
13053
|
+
description: "Harness run rows are runtime verification logs."
|
|
13054
|
+
},
|
|
13055
|
+
{
|
|
13056
|
+
component: "kernel",
|
|
13057
|
+
table: "idempotencyTokens",
|
|
13058
|
+
prepopulation: "runtime_log",
|
|
13059
|
+
copyMode: "none",
|
|
13060
|
+
description: "Idempotency tokens are request-scoped runtime guards."
|
|
13061
|
+
},
|
|
13062
|
+
{
|
|
13063
|
+
component: "kernel",
|
|
13064
|
+
table: "lenses",
|
|
13065
|
+
prepopulation: "optional_template",
|
|
13066
|
+
copyMode: "none",
|
|
13067
|
+
description: "Reusable lens templates may live in K templates, but workspace-specific copies are not required for core SDK boot."
|
|
13068
|
+
},
|
|
13069
|
+
{
|
|
13070
|
+
component: "kernel",
|
|
13071
|
+
table: "lensTopicBindings",
|
|
13072
|
+
prepopulation: "runtime_data",
|
|
13073
|
+
copyMode: "none",
|
|
13074
|
+
description: "Lens bindings attach runtime topics to runtime/workspace lenses."
|
|
13075
|
+
},
|
|
13076
|
+
{
|
|
13077
|
+
component: "kernel",
|
|
13078
|
+
table: "neo4jSyncQueue",
|
|
13079
|
+
prepopulation: "runtime_queue",
|
|
13080
|
+
copyMode: "none",
|
|
13081
|
+
description: "Neo4j sync queue rows are runtime work items."
|
|
13082
|
+
},
|
|
13083
|
+
{
|
|
13084
|
+
component: "kernel",
|
|
13085
|
+
table: "ontologyDefinitions",
|
|
13086
|
+
prepopulation: "required_template",
|
|
13087
|
+
copyMode: "template_global",
|
|
13088
|
+
scope: "global",
|
|
13089
|
+
uniqueKey: ["ontologyKey"],
|
|
13090
|
+
description: "Platform ontology definitions power taxonomy reads and effective ontology resolution."
|
|
13091
|
+
},
|
|
13092
|
+
{
|
|
13093
|
+
component: "kernel",
|
|
13094
|
+
table: "ontologyVersions",
|
|
13095
|
+
prepopulation: "required_template",
|
|
13096
|
+
copyMode: "template_reference_remap",
|
|
13097
|
+
scope: "global",
|
|
13098
|
+
uniqueKey: ["ontologyKey", "version"],
|
|
13099
|
+
dependsOn: ["ontologyDefinitions"],
|
|
13100
|
+
description: "Ontology versions must be copied with ontologyDefinition ID remapping."
|
|
13101
|
+
},
|
|
13102
|
+
{
|
|
13103
|
+
component: "kernel",
|
|
13104
|
+
table: "platformAgentRunPolicyDecisions",
|
|
13105
|
+
prepopulation: "runtime_log",
|
|
13106
|
+
copyMode: "none",
|
|
13107
|
+
description: "Agent-run policy decisions are audit logs."
|
|
13108
|
+
},
|
|
13109
|
+
{
|
|
13110
|
+
component: "kernel",
|
|
13111
|
+
table: "platformAgentRunPromptResolutions",
|
|
13112
|
+
prepopulation: "runtime_log",
|
|
13113
|
+
copyMode: "none",
|
|
13114
|
+
description: "Agent-run prompt resolution rows are runtime logs."
|
|
13115
|
+
},
|
|
13116
|
+
{
|
|
13117
|
+
component: "kernel",
|
|
13118
|
+
table: "platformAgentRuns",
|
|
13119
|
+
prepopulation: "runtime_log",
|
|
13120
|
+
copyMode: "none",
|
|
13121
|
+
description: "Agent runs are runtime execution records."
|
|
13122
|
+
},
|
|
13123
|
+
{
|
|
13124
|
+
component: "kernel",
|
|
13125
|
+
table: "platformAgentRunToolCalls",
|
|
13126
|
+
prepopulation: "runtime_log",
|
|
13127
|
+
copyMode: "none",
|
|
13128
|
+
description: "Agent-run tool calls are runtime execution records."
|
|
13129
|
+
},
|
|
13130
|
+
{
|
|
13131
|
+
component: "kernel",
|
|
13132
|
+
table: "platformHarnessShadowAudit",
|
|
13133
|
+
prepopulation: "runtime_log",
|
|
13134
|
+
copyMode: "none",
|
|
13135
|
+
description: "Harness shadow audit rows are runtime audit records."
|
|
13136
|
+
},
|
|
13137
|
+
{
|
|
13138
|
+
component: "kernel",
|
|
13139
|
+
table: "publicationRules",
|
|
13140
|
+
prepopulation: "required_template",
|
|
13141
|
+
copyMode: "template_tenant_rewrite",
|
|
13142
|
+
scope: "tenant",
|
|
13143
|
+
uniqueKey: ["tenantId", "workspaceId", "name"],
|
|
13144
|
+
description: "Default publication policy rules are rewritten into each tenant."
|
|
13145
|
+
},
|
|
13146
|
+
{
|
|
13147
|
+
component: "kernel",
|
|
13148
|
+
table: "questionEvidenceLinks",
|
|
13149
|
+
prepopulation: "runtime_data",
|
|
13150
|
+
copyMode: "none",
|
|
13151
|
+
description: "Question-to-evidence links are tenant graph data."
|
|
13152
|
+
},
|
|
13153
|
+
{
|
|
13154
|
+
component: "kernel",
|
|
13155
|
+
table: "researchJobs",
|
|
13156
|
+
prepopulation: "runtime_queue",
|
|
13157
|
+
copyMode: "none",
|
|
13158
|
+
description: "Research job rows are runtime queue items."
|
|
13159
|
+
},
|
|
13160
|
+
{
|
|
13161
|
+
component: "kernel",
|
|
13162
|
+
table: "schemaEnumConfig",
|
|
13163
|
+
prepopulation: "required_template",
|
|
13164
|
+
copyMode: "template_global",
|
|
13165
|
+
scope: "global",
|
|
13166
|
+
uniqueKey: ["category", "value"],
|
|
13167
|
+
description: "Runtime-extensible enum defaults required by SDK graph APIs."
|
|
13168
|
+
},
|
|
13169
|
+
{
|
|
13170
|
+
component: "kernel",
|
|
13171
|
+
table: "stakeholderGroups",
|
|
13172
|
+
prepopulation: "runtime_data",
|
|
13173
|
+
copyMode: "none",
|
|
13174
|
+
description: "Stakeholder groups are tenant decision data."
|
|
13175
|
+
},
|
|
13176
|
+
{
|
|
13177
|
+
component: "kernel",
|
|
13178
|
+
table: "systemLogs",
|
|
13179
|
+
prepopulation: "runtime_log",
|
|
13180
|
+
copyMode: "none",
|
|
13181
|
+
description: "System logs are runtime telemetry."
|
|
13182
|
+
},
|
|
13183
|
+
{
|
|
13184
|
+
component: "kernel",
|
|
13185
|
+
table: "tasks",
|
|
13186
|
+
prepopulation: "runtime_data",
|
|
13187
|
+
copyMode: "none",
|
|
13188
|
+
description: "Tasks are tenant-authored work items."
|
|
13189
|
+
},
|
|
13190
|
+
{
|
|
13191
|
+
component: "kernel",
|
|
13192
|
+
table: "topics",
|
|
13193
|
+
prepopulation: "runtime_bootstrap",
|
|
13194
|
+
copyMode: "none",
|
|
13195
|
+
description: "Default topics are created by tenant provisioning, not copied from templates."
|
|
13196
|
+
},
|
|
13197
|
+
{
|
|
13198
|
+
component: "kernel",
|
|
13199
|
+
table: "workflowDefinitions",
|
|
13200
|
+
prepopulation: "optional_template",
|
|
13201
|
+
copyMode: "none",
|
|
13202
|
+
description: "Table-driven workflow definitions can be template data after the workflow engine leaves legacy mode."
|
|
13203
|
+
},
|
|
13204
|
+
{
|
|
13205
|
+
component: "kernel",
|
|
13206
|
+
table: "workflowPullRequests",
|
|
13207
|
+
prepopulation: "runtime_data",
|
|
13208
|
+
copyMode: "none",
|
|
13209
|
+
description: "Workflow pull requests are tenant workflow data."
|
|
13210
|
+
},
|
|
13211
|
+
{
|
|
13212
|
+
component: "kernel",
|
|
13213
|
+
table: "workflowStages",
|
|
13214
|
+
prepopulation: "optional_template",
|
|
13215
|
+
copyMode: "none",
|
|
13216
|
+
dependsOn: ["workflowDefinitions"],
|
|
13217
|
+
description: "Workflow stages can be template data after workflowDefinitions are enabled for bootstrap copying."
|
|
13218
|
+
},
|
|
13219
|
+
{
|
|
13220
|
+
component: "kernel",
|
|
13221
|
+
table: "worktreeBeliefCluster",
|
|
13222
|
+
prepopulation: "runtime_data",
|
|
13223
|
+
copyMode: "none",
|
|
13224
|
+
description: "Worktree cluster rows link runtime worktrees to runtime beliefs."
|
|
13225
|
+
},
|
|
13226
|
+
{
|
|
13227
|
+
component: "kernel",
|
|
13228
|
+
table: "worktrees",
|
|
13229
|
+
prepopulation: "runtime_data",
|
|
13230
|
+
copyMode: "none",
|
|
13231
|
+
description: "Worktrees are tenant/runtime planning data."
|
|
13232
|
+
},
|
|
13233
|
+
{
|
|
13234
|
+
component: "identity",
|
|
13235
|
+
table: "agents",
|
|
13236
|
+
prepopulation: "runtime_bootstrap",
|
|
13237
|
+
copyMode: "none",
|
|
13238
|
+
description: "Service agents are provisioned per tenant or service, not copied."
|
|
13239
|
+
},
|
|
13240
|
+
{
|
|
13241
|
+
component: "identity",
|
|
13242
|
+
table: "mcpWritePolicy",
|
|
13243
|
+
prepopulation: "required_template",
|
|
13244
|
+
copyMode: "template_global",
|
|
13245
|
+
scope: "global",
|
|
13246
|
+
uniqueKey: ["topicId", "role", "toolCategory"],
|
|
13247
|
+
description: "Global write policy defaults govern service and interactive MCP writes."
|
|
13248
|
+
},
|
|
13249
|
+
{
|
|
13250
|
+
component: "identity",
|
|
13251
|
+
table: "modelCallLogs",
|
|
13252
|
+
prepopulation: "runtime_log",
|
|
13253
|
+
copyMode: "none",
|
|
13254
|
+
description: "Model call logs are runtime telemetry."
|
|
13255
|
+
},
|
|
13256
|
+
{
|
|
13257
|
+
component: "identity",
|
|
13258
|
+
table: "modelFunctionSlots",
|
|
13259
|
+
prepopulation: "required_template",
|
|
13260
|
+
copyMode: "template_global",
|
|
13261
|
+
scope: "global",
|
|
13262
|
+
uniqueKey: ["slot"],
|
|
13263
|
+
description: "Function-to-model slots are required by model runtime resolution."
|
|
13264
|
+
},
|
|
13265
|
+
{
|
|
13266
|
+
component: "identity",
|
|
13267
|
+
table: "modelRegistry",
|
|
13268
|
+
prepopulation: "required_template",
|
|
13269
|
+
copyMode: "template_global",
|
|
13270
|
+
scope: "global",
|
|
13271
|
+
uniqueKey: ["key"],
|
|
13272
|
+
description: "Model catalog defaults are required by model runtime clients."
|
|
13273
|
+
},
|
|
13274
|
+
{
|
|
13275
|
+
component: "identity",
|
|
13276
|
+
table: "modelSlotConfigs",
|
|
13277
|
+
prepopulation: "required_template",
|
|
13278
|
+
copyMode: "template_global",
|
|
13279
|
+
scope: "global",
|
|
13280
|
+
uniqueKey: ["slot"],
|
|
13281
|
+
description: "Slot-level defaults are required before tenant overrides exist."
|
|
13282
|
+
},
|
|
13283
|
+
{
|
|
13284
|
+
component: "identity",
|
|
13285
|
+
table: "platformAudienceGrants",
|
|
13286
|
+
prepopulation: "runtime_data",
|
|
13287
|
+
copyMode: "none",
|
|
13288
|
+
description: "Audience grants are principal/group-specific access rows."
|
|
13289
|
+
},
|
|
13290
|
+
{
|
|
13291
|
+
component: "identity",
|
|
13292
|
+
table: "platformAudiences",
|
|
13293
|
+
prepopulation: "required_template",
|
|
13294
|
+
copyMode: "template_tenant_rewrite",
|
|
13295
|
+
scope: "tenant",
|
|
13296
|
+
uniqueKey: ["tenantId", "workspaceId", "audienceKey"],
|
|
13297
|
+
description: "Default tenant audience taxonomy rows are rewritten into each tenant."
|
|
13298
|
+
},
|
|
13299
|
+
{
|
|
13300
|
+
component: "identity",
|
|
13301
|
+
table: "platformPolicyDecisionLogs",
|
|
13302
|
+
prepopulation: "runtime_log",
|
|
13303
|
+
copyMode: "none",
|
|
13304
|
+
description: "Policy decisions are runtime audit logs."
|
|
13305
|
+
},
|
|
13306
|
+
{
|
|
13307
|
+
component: "identity",
|
|
13308
|
+
table: "projectGrants",
|
|
13309
|
+
prepopulation: "runtime_data",
|
|
13310
|
+
copyMode: "none",
|
|
13311
|
+
description: "Project/topic grants are principal or group-specific access rows."
|
|
13312
|
+
},
|
|
13313
|
+
{
|
|
13314
|
+
component: "identity",
|
|
13315
|
+
table: "reasoningPermissions",
|
|
13316
|
+
prepopulation: "runtime_data",
|
|
13317
|
+
copyMode: "none",
|
|
13318
|
+
description: "Reasoning permissions are principal-specific policy rows."
|
|
13319
|
+
},
|
|
13320
|
+
{
|
|
13321
|
+
component: "identity",
|
|
13322
|
+
table: "tenantApiKeys",
|
|
13323
|
+
prepopulation: "runtime_secret",
|
|
13324
|
+
copyMode: "none",
|
|
13325
|
+
description: "API keys are tenant credentials and must never be copied."
|
|
13326
|
+
},
|
|
13327
|
+
{
|
|
13328
|
+
component: "identity",
|
|
13329
|
+
table: "tenantConfig",
|
|
13330
|
+
prepopulation: "required_template",
|
|
13331
|
+
copyMode: "template_tenant_rewrite",
|
|
13332
|
+
scope: "tenant",
|
|
13333
|
+
uniqueKey: ["tenantId"],
|
|
13334
|
+
description: "Tenant-local config defaults are rewritten during bootstrap."
|
|
13335
|
+
},
|
|
13336
|
+
{
|
|
13337
|
+
component: "identity",
|
|
13338
|
+
table: "tenantIntegrations",
|
|
13339
|
+
prepopulation: "required_template",
|
|
13340
|
+
copyMode: "template_tenant_rewrite",
|
|
13341
|
+
scope: "tenant",
|
|
13342
|
+
uniqueKey: ["tenantId", "integrationKey"],
|
|
13343
|
+
description: "Non-secret integration descriptors are rewritten into each tenant."
|
|
13344
|
+
},
|
|
13345
|
+
{
|
|
13346
|
+
component: "identity",
|
|
13347
|
+
table: "tenantModelSlotBindings",
|
|
13348
|
+
prepopulation: "runtime_secret",
|
|
13349
|
+
copyMode: "none",
|
|
13350
|
+
description: "Tenant model slot bindings reference provider secrets and are runtime-only."
|
|
13351
|
+
},
|
|
13352
|
+
{
|
|
13353
|
+
component: "identity",
|
|
13354
|
+
table: "tenantPolicies",
|
|
13355
|
+
prepopulation: "required_template",
|
|
13356
|
+
copyMode: "template_tenant_rewrite",
|
|
13357
|
+
scope: "tenant",
|
|
13358
|
+
uniqueKey: ["tenantId", "workspaceId", "roleName"],
|
|
13359
|
+
description: "Default tenant policy roles are rewritten during bootstrap."
|
|
13360
|
+
},
|
|
13361
|
+
{
|
|
13362
|
+
component: "identity",
|
|
13363
|
+
table: "tenantProviderSecrets",
|
|
13364
|
+
prepopulation: "runtime_secret",
|
|
13365
|
+
copyMode: "none",
|
|
13366
|
+
description: "Provider secrets are credentials and must never be copied."
|
|
13367
|
+
},
|
|
13368
|
+
{
|
|
13369
|
+
component: "identity",
|
|
13370
|
+
table: "tenantProxyGatewayUsage",
|
|
13371
|
+
prepopulation: "runtime_log",
|
|
13372
|
+
copyMode: "none",
|
|
13373
|
+
description: "Proxy gateway usage rows are runtime telemetry."
|
|
13374
|
+
},
|
|
13375
|
+
{
|
|
13376
|
+
component: "identity",
|
|
13377
|
+
table: "tenantProxyTokenMints",
|
|
13378
|
+
prepopulation: "runtime_secret",
|
|
13379
|
+
copyMode: "none",
|
|
13380
|
+
description: "Proxy token mints are ephemeral secret-bearing runtime rows."
|
|
13381
|
+
},
|
|
13382
|
+
{
|
|
13383
|
+
component: "identity",
|
|
13384
|
+
table: "tenantSandboxAuditEvents",
|
|
13385
|
+
prepopulation: "runtime_log",
|
|
13386
|
+
copyMode: "none",
|
|
13387
|
+
description: "Sandbox audit rows are runtime security logs."
|
|
13388
|
+
},
|
|
13389
|
+
{
|
|
13390
|
+
component: "identity",
|
|
13391
|
+
table: "tenantSecrets",
|
|
13392
|
+
prepopulation: "runtime_secret",
|
|
13393
|
+
copyMode: "none",
|
|
13394
|
+
description: "Tenant secrets are credentials and must never be copied."
|
|
13395
|
+
},
|
|
13396
|
+
{
|
|
13397
|
+
component: "identity",
|
|
13398
|
+
table: "toolAcls",
|
|
13399
|
+
prepopulation: "required_template",
|
|
13400
|
+
copyMode: "template_global",
|
|
13401
|
+
scope: "global",
|
|
13402
|
+
uniqueKey: ["role", "toolName"],
|
|
13403
|
+
description: "Default role-to-tool grants are required for SDK/MCP tool access."
|
|
13404
|
+
},
|
|
13405
|
+
{
|
|
13406
|
+
component: "identity",
|
|
13407
|
+
table: "toolRegistry",
|
|
13408
|
+
prepopulation: "required_template",
|
|
13409
|
+
copyMode: "template_global",
|
|
13410
|
+
scope: "global",
|
|
13411
|
+
uniqueKey: ["toolName"],
|
|
13412
|
+
description: "Core tool catalog rows are required before pack or tenant tools exist."
|
|
13413
|
+
},
|
|
13414
|
+
{
|
|
13415
|
+
component: "identity",
|
|
13416
|
+
table: "users",
|
|
13417
|
+
prepopulation: "runtime_bootstrap",
|
|
13418
|
+
copyMode: "none",
|
|
13419
|
+
description: "Users are created from Clerk/MC principal resolution, not copied."
|
|
13420
|
+
}
|
|
13421
|
+
];
|
|
13422
|
+
TENANT_BOOTSTRAP_TABLE_REQUIREMENTS.filter(
|
|
13423
|
+
isCopyableSeedRequirement
|
|
13424
|
+
);
|
|
13425
|
+
TENANT_BOOTSTRAP_TABLE_REQUIREMENTS.filter(
|
|
13426
|
+
(entry) => !isCopyableSeedRequirement(entry)
|
|
13427
|
+
).map((entry) => entry.table);
|
|
13428
|
+
|
|
11480
13429
|
export { DOMAIN_EVENT_TYPES, DOMAIN_EVENT_VERSION, EVENT_RETENTION_DEFAULT_DAYS, WEBHOOK_MAX_ATTEMPTS, WEBHOOK_RETRY_DELAYS_MS };
|
|
11481
13430
|
//# sourceMappingURL=types.js.map
|
|
11482
13431
|
//# sourceMappingURL=types.js.map
|