@lucern/contracts 0.3.0-alpha.0 → 0.3.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/component-boundary.contract.d.ts +14 -0
- package/dist/component-boundary.contract.js +155 -0
- package/dist/component-boundary.contract.js.map +1 -0
- package/dist/component-host-boundary.contract.d.ts +41 -0
- package/dist/component-host-boundary.contract.js +54 -0
- package/dist/component-host-boundary.contract.js.map +1 -0
- package/dist/context-pack.contract.d.ts +5 -3
- package/dist/context-pack.contract.js.map +1 -1
- package/dist/{dsl-BgpoVOVQ.d.ts → dsl-djCRfuWC.d.ts} +1 -1
- package/dist/dsl.d.ts +1 -1
- package/dist/dsl.js +4 -4
- package/dist/dsl.js.map +1 -1
- package/dist/edge-policy-manifest-Dw5IhT1L.d.ts +133 -0
- package/dist/function-registry/beliefs.d.ts +42 -82
- package/dist/function-registry/beliefs.js +1154 -125
- package/dist/function-registry/beliefs.js.map +1 -1
- package/dist/function-registry/coding.d.ts +7 -31
- package/dist/function-registry/coding.js +958 -112
- package/dist/function-registry/coding.js.map +1 -1
- package/dist/function-registry/context.d.ts +14 -26
- package/dist/function-registry/context.js +923 -97
- package/dist/function-registry/context.js.map +1 -1
- package/dist/function-registry/contracts.d.ts +4 -16
- package/dist/function-registry/contracts.js +860 -82
- package/dist/function-registry/contracts.js.map +1 -1
- package/dist/function-registry/coordination.d.ts +10 -46
- package/dist/function-registry/coordination.js +872 -84
- package/dist/function-registry/coordination.js.map +1 -1
- package/dist/function-registry/edges.d.ts +166 -18
- package/dist/function-registry/edges.js +1188 -97
- package/dist/function-registry/edges.js.map +1 -1
- package/dist/function-registry/evidence.d.ts +42 -74
- package/dist/function-registry/evidence.js +1106 -130
- package/dist/function-registry/evidence.js.map +1 -1
- package/dist/function-registry/graph.d.ts +132 -106
- package/dist/function-registry/graph.js +1006 -100
- package/dist/function-registry/graph.js.map +1 -1
- package/dist/function-registry/helpers.d.ts +8 -10
- package/dist/function-registry/helpers.js +869 -83
- package/dist/function-registry/helpers.js.map +1 -1
- package/dist/function-registry/identity.d.ts +4 -16
- package/dist/function-registry/identity.js +860 -82
- package/dist/function-registry/identity.js.map +1 -1
- package/dist/function-registry/index.d.ts +322 -8
- package/dist/function-registry/index.js +1249 -87
- package/dist/function-registry/index.js.map +1 -1
- package/dist/function-registry/judgments.d.ts +12 -20
- package/dist/function-registry/judgments.js +891 -94
- package/dist/function-registry/judgments.js.map +1 -1
- package/dist/function-registry/legacy.d.ts +2 -6
- package/dist/function-registry/legacy.js +860 -82
- package/dist/function-registry/legacy.js.map +1 -1
- package/dist/function-registry/lenses.d.ts +18 -34
- package/dist/function-registry/lenses.js +928 -88
- package/dist/function-registry/lenses.js.map +1 -1
- package/dist/function-registry/manifest.d.ts +7 -7
- package/dist/function-registry/manifest.js +19 -2
- package/dist/function-registry/manifest.js.map +1 -1
- package/dist/function-registry/ontologies.d.ts +46 -90
- package/dist/function-registry/ontologies.js +908 -109
- package/dist/function-registry/ontologies.js.map +1 -1
- package/dist/function-registry/pipeline.d.ts +14 -26
- package/dist/function-registry/pipeline.js +880 -85
- package/dist/function-registry/pipeline.js.map +1 -1
- package/dist/function-registry/questions.d.ts +50 -98
- package/dist/function-registry/questions.js +1043 -118
- package/dist/function-registry/questions.js.map +1 -1
- package/dist/function-registry/tasks.d.ts +18 -34
- package/dist/function-registry/tasks.js +973 -87
- package/dist/function-registry/tasks.js.map +1 -1
- package/dist/function-registry/topics.d.ts +100 -42
- package/dist/function-registry/topics.js +961 -89
- package/dist/function-registry/topics.js.map +1 -1
- package/dist/function-registry/types.d.ts +2 -2
- package/dist/function-registry/worktrees.d.ts +116 -74
- package/dist/function-registry/worktrees.js +1124 -115
- package/dist/function-registry/worktrees.js.map +1 -1
- package/dist/function-registry-input-audit.d.ts +13 -0
- package/dist/function-registry-input-audit.js +166 -0
- package/dist/function-registry-input-audit.js.map +1 -0
- package/dist/gateway.contract.d.ts +2 -0
- package/dist/gateway.contract.js.map +1 -1
- package/dist/generated/convexSchemas.js +8 -6
- package/dist/generated/convexSchemas.js.map +1 -1
- package/dist/generated/schema-manifest.json +103 -5
- package/dist/generated/tableOwnership.d.ts +4 -2
- package/dist/generated/tableOwnership.js +4 -0
- package/dist/generated/tableOwnership.js.map +1 -1
- package/dist/generated/tier-expectations.json +9 -4
- package/dist/graph-intelligence.contract.d.ts +506 -0
- package/dist/graph-intelligence.contract.js +595 -0
- package/dist/graph-intelligence.contract.js.map +1 -0
- package/dist/graph-types/index.d.ts +5 -1
- package/dist/graph-types/index.js +15 -4
- package/dist/graph-types/index.js.map +1 -1
- package/dist/index-O09U2xHk.d.ts +28 -0
- package/dist/index.d.ts +25 -4
- package/dist/index.js +3989 -236
- package/dist/index.js.map +1 -1
- package/dist/infisical-runtime.contract.d.ts +174 -0
- package/dist/infisical-runtime.contract.js +317 -0
- package/dist/infisical-runtime.contract.js.map +1 -0
- package/dist/lens-filter.contract.js +4 -3
- package/dist/lens-filter.contract.js.map +1 -1
- package/dist/lens-workflow.contract.js +4 -3
- package/dist/lens-workflow.contract.js.map +1 -1
- package/dist/manifests/edge-policy-manifest.d.ts +2 -0
- package/dist/manifests/edge-policy-manifest.data.d.ts +13 -0
- package/dist/manifests/edge-policy-manifest.data.js +26 -0
- package/dist/manifests/edge-policy-manifest.data.js.map +1 -0
- package/dist/manifests/edge-policy-manifest.js +92 -0
- package/dist/manifests/edge-policy-manifest.js.map +1 -0
- package/dist/manifests/infisical-runtime-manifest.d.ts +151 -0
- package/dist/manifests/infisical-runtime-manifest.js +316 -0
- package/dist/manifests/infisical-runtime-manifest.js.map +1 -0
- package/dist/manifests/invariant-manifest.d.ts +65 -0
- package/dist/manifests/invariant-manifest.js +18 -0
- package/dist/manifests/invariant-manifest.js.map +1 -0
- package/dist/manifests/invariants/ast-utils.d.ts +14 -0
- package/dist/manifests/invariants/ast-utils.js +54 -0
- package/dist/manifests/invariants/ast-utils.js.map +1 -0
- package/dist/manifests/invariants/index.d.ts +15 -0
- package/dist/manifests/invariants/index.js +183 -0
- package/dist/manifests/invariants/index.js.map +1 -0
- package/dist/manifests/invariants/inv-1-beliefs-append-only.d.ts +12 -0
- package/dist/manifests/invariants/inv-1-beliefs-append-only.js +94 -0
- package/dist/manifests/invariants/inv-1-beliefs-append-only.js.map +1 -0
- package/dist/manifests/invariants/inv-14-no-silent-transitions.d.ts +12 -0
- package/dist/manifests/invariants/inv-14-no-silent-transitions.js +99 -0
- package/dist/manifests/invariants/inv-14-no-silent-transitions.js.map +1 -0
- package/dist/manifests/invariants/manifest-1-projections-declare-audit.d.ts +12 -0
- package/dist/manifests/invariants/manifest-1-projections-declare-audit.js +42 -0
- package/dist/manifests/invariants/manifest-1-projections-declare-audit.js.map +1 -0
- package/dist/manifests/tenant-client-manifest.d.ts +322 -0
- package/dist/manifests/tenant-client-manifest.js +432 -0
- package/dist/manifests/tenant-client-manifest.js.map +1 -0
- package/dist/mcp-gateway-boundary.contract.d.ts +181 -0
- package/dist/mcp-gateway-boundary.contract.js +43 -0
- package/dist/mcp-gateway-boundary.contract.js.map +1 -0
- package/dist/projections/check-convex-args-shape.d.ts +3 -0
- package/dist/projections/check-convex-args-shape.js +399 -0
- package/dist/projections/check-convex-args-shape.js.map +1 -0
- package/dist/projections/create-evidence.projection.d.ts +176 -0
- package/dist/projections/create-evidence.projection.js +131 -0
- package/dist/projections/create-evidence.projection.js.map +1 -0
- package/dist/projections/index.d.ts +102 -0
- package/dist/projections/index.js +348 -0
- package/dist/projections/index.js.map +1 -0
- package/dist/projections/list-beliefs.projection.d.ts +36 -0
- package/dist/projections/list-beliefs.projection.js +54 -0
- package/dist/projections/list-beliefs.projection.js.map +1 -0
- package/dist/projections/list-tasks.projection.d.ts +32 -0
- package/dist/projections/list-tasks.projection.js +52 -0
- package/dist/projections/list-tasks.projection.js.map +1 -0
- package/dist/projections/modulate-confidence.projection.d.ts +219 -0
- package/dist/projections/modulate-confidence.projection.js +148 -0
- package/dist/projections/modulate-confidence.projection.js.map +1 -0
- package/dist/projections/projection-dsl.d.ts +11 -0
- package/dist/projections/projection-dsl.js +8 -0
- package/dist/projections/projection-dsl.js.map +1 -0
- package/dist/schema-helpers/enumValidation.js +2 -5
- package/dist/schema-helpers/enumValidation.js.map +1 -1
- package/dist/schema-helpers/spine/nodes/decision.js +2 -1
- package/dist/schema-helpers/spine/nodes/decision.js.map +1 -1
- package/dist/schema-helpers/spine/tables/epistemicNodes.js +27 -27
- package/dist/schema-helpers/spine/tables/epistemicNodes.js.map +1 -1
- package/dist/schema-helpers/validators.d.ts +1 -1
- package/dist/schema-helpers/validators.js +1 -1
- package/dist/schema-helpers/validators.js.map +1 -1
- package/dist/schemas/component-table-manifest.d.ts +74 -0
- package/dist/schemas/component-table-manifest.js +26 -0
- package/dist/schemas/component-table-manifest.js.map +1 -0
- package/dist/schemas/enums.d.ts +5 -2
- package/dist/schemas/enums.js +5 -2
- package/dist/schemas/enums.js.map +1 -1
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.js +112 -13
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/manifest.d.ts +1154 -949
- package/dist/schemas/manifest.js +80 -12
- package/dist/schemas/manifest.js.map +1 -1
- package/dist/schemas/sl-opinion.d.ts +31 -0
- package/dist/schemas/sl-opinion.js +19 -0
- package/dist/schemas/sl-opinion.js.map +1 -0
- package/dist/schemas/tables/identity/platform.d.ts +10 -10
- package/dist/schemas/tables/kernel/epistemic.d.ts +12 -10
- package/dist/schemas/tables/kernel/epistemic.js +6 -4
- package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
- package/dist/schemas/tables/kernel/infra.d.ts +17 -5
- package/dist/schemas/tables/kernel/infra.js +23 -1
- package/dist/schemas/tables/kernel/infra.js.map +1 -1
- package/dist/schemas/tables/kernel/intelligence.d.ts +10 -10
- package/dist/schemas/tables/kernel/lens.d.ts +4 -4
- package/dist/schemas/tables/kernel/platform.d.ts +12 -12
- package/dist/schemas/tables/kernel/spine.d.ts +3 -3
- package/dist/schemas/tables/kernel/spine.js +5 -2
- package/dist/schemas/tables/kernel/spine.js.map +1 -1
- package/dist/schemas/tables/kernel/task.d.ts +42 -42
- package/dist/schemas/tables/kernel/topic.js +5 -1
- package/dist/schemas/tables/kernel/topic.js.map +1 -1
- package/dist/schemas/tables/kernel/worktree.d.ts +62 -62
- package/dist/schemas/tables/kernel/worktree.js +6 -4
- package/dist/schemas/tables/kernel/worktree.js.map +1 -1
- package/dist/schemas/tables/mc/identity.d.ts +26 -3
- package/dist/schemas/tables/mc/identity.js +35 -1
- package/dist/schemas/tables/mc/identity.js.map +1 -1
- package/dist/schemas/tables/mc/pack.d.ts +20 -20
- package/dist/schemas/tables/mc/registry.d.ts +4 -4
- package/dist/schemas/tables/mc/runtime.d.ts +1 -1
- package/dist/schemas/tables/mc/runtime.js +1 -1
- package/dist/schemas/tables/mc/runtime.js.map +1 -1
- package/dist/schemas/tables/mc/workspace.d.ts +9 -3
- package/dist/schemas/tables/mc/workspace.js +3 -1
- package/dist/schemas/tables/mc/workspace.js.map +1 -1
- package/dist/sdk-methods.contract.d.ts +7 -4
- package/dist/{sdk-tools.contract-C2kQN_Xk.d.ts → sdk-tools.contract-BNklQDfB.d.ts} +2 -2
- package/dist/sdk-tools.contract.d.ts +2 -2
- package/dist/sdk-tools.contract.js +800 -74
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/tenant-bootstrap-seed.contract.d.ts +1101 -0
- package/dist/tenant-bootstrap-seed.contract.js +653 -0
- package/dist/tenant-bootstrap-seed.contract.js.map +1 -0
- package/dist/tenant-bootstrap-seed.defaults.d.ts +16 -0
- package/dist/tenant-bootstrap-seed.defaults.js +303 -0
- package/dist/tenant-bootstrap-seed.defaults.js.map +1 -0
- package/dist/tenant-client.contract.d.ts +349 -0
- package/dist/tenant-client.contract.js +488 -0
- package/dist/tenant-client.contract.js.map +1 -0
- package/dist/{tool-contracts-WCnuE9DW.d.ts → tool-contracts-BevD9Ho2.d.ts} +39 -3
- package/dist/tool-contracts.d.ts +1 -1
- package/dist/tool-contracts.js +801 -75
- package/dist/tool-contracts.js.map +1 -1
- package/dist/workflow-runtime.contract.js +1 -1
- package/dist/workflow-runtime.contract.js.map +1 -1
- package/package.json +27 -1
- package/dist/index-DoDXl8KS.d.ts +0 -19
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { v } from 'convex/values';
|
|
2
3
|
|
|
3
|
-
// src/function-registry/
|
|
4
|
+
// src/function-registry/beliefs.ts
|
|
4
5
|
|
|
5
6
|
// src/lens-workflow.contract.ts
|
|
6
7
|
var LENS_PERSPECTIVE_TYPES = [
|
|
@@ -14,7 +15,7 @@ var LENS_PERSPECTIVE_TYPES = [
|
|
|
14
15
|
// src/tool-contracts.ts
|
|
15
16
|
var CREATE_BELIEF = {
|
|
16
17
|
name: "create_belief",
|
|
17
|
-
description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a
|
|
18
|
+
description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; use modulate_confidence to record the first evidential update.",
|
|
18
19
|
parameters: {
|
|
19
20
|
canonicalText: {
|
|
20
21
|
type: "string",
|
|
@@ -26,7 +27,7 @@ var CREATE_BELIEF = {
|
|
|
26
27
|
},
|
|
27
28
|
baseRate: {
|
|
28
29
|
type: "number",
|
|
29
|
-
description: "
|
|
30
|
+
description: "Prior probability used to seed the vacuous opinion `(0, 0, 1, a)` at creation time. Defaults to 0.5 when omitted."
|
|
30
31
|
},
|
|
31
32
|
beliefType: {
|
|
32
33
|
type: "string",
|
|
@@ -37,7 +38,7 @@ var CREATE_BELIEF = {
|
|
|
37
38
|
description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)"
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
|
-
required: ["canonicalText"
|
|
41
|
+
required: ["canonicalText"],
|
|
41
42
|
response: {
|
|
42
43
|
description: "The created canonical belief record",
|
|
43
44
|
fields: {
|
|
@@ -100,7 +101,7 @@ var REFINE_BELIEF = {
|
|
|
100
101
|
};
|
|
101
102
|
var MODULATE_CONFIDENCE = {
|
|
102
103
|
name: "modulate_confidence",
|
|
103
|
-
description: "Record a confidence change for a belief. Like `git commit` to the credence log \u2014 an atomic, append-only write. Each modulation is a new entry in the history, not an overwrite. Scoring happens via merge; this tool records the individual data points. Pass the full subjective-logic tuple (`belief`, `disbelief`, `uncertainty`, `baseRate`) directly. If a caller only has a scalar probability, use `@lucern/sdk` helpers `opinionFromBaseRate`, `opinionFromDogmatic`, or `opinionFromProjected` to name the intended interpretation before calling this tool. Triggers: evidence_added, evidence_removed, contradiction_detected, contradiction_resolved, agent_assessment, worktree_outcome, worktree_completed, fusion, discount, deduction
|
|
104
|
+
description: "Record a confidence change for a belief. Like `git commit` to the credence log \u2014 an atomic, append-only write. Each modulation is a new entry in the history, not an overwrite. Scoring happens via merge; this tool records the individual data points. Pass the full subjective-logic tuple (`belief`, `disbelief`, `uncertainty`, `baseRate`) directly. If a caller only has a scalar probability, use `@lucern/sdk` helpers `opinionFromBaseRate`, `opinionFromDogmatic`, or `opinionFromProjected` to name the intended interpretation before calling this tool. Every modulation must cite a truth-bearing artifact: triggeringEvidenceId, triggeringQuestionId, triggeringAnswerId, triggeringContradictionId, or triggeringWorktreeId. Triggers: evidence_added, evidence_removed, contradiction_detected, contradiction_resolved, agent_assessment, worktree_outcome, worktree_completed, fusion, discount, deduction.",
|
|
104
105
|
parameters: {
|
|
105
106
|
nodeId: { type: "string", description: "The belief to score" },
|
|
106
107
|
belief: {
|
|
@@ -119,9 +120,9 @@ var MODULATE_CONFIDENCE = {
|
|
|
119
120
|
type: "number",
|
|
120
121
|
description: "Subjective-logic base rate `a` in [0, 1]. Required for tuple payloads."
|
|
121
122
|
},
|
|
122
|
-
|
|
123
|
-
type: "
|
|
124
|
-
description: "
|
|
123
|
+
worktreeId: {
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "Completed worktree that tested this belief when confidence policy requires merge-backed scoring."
|
|
125
126
|
},
|
|
126
127
|
trigger: {
|
|
127
128
|
type: "string",
|
|
@@ -136,17 +137,43 @@ var MODULATE_CONFIDENCE = {
|
|
|
136
137
|
"worktree_completed",
|
|
137
138
|
"fusion",
|
|
138
139
|
"discount",
|
|
139
|
-
"deduction"
|
|
140
|
-
"manual",
|
|
141
|
-
"decay"
|
|
140
|
+
"deduction"
|
|
142
141
|
]
|
|
143
142
|
},
|
|
143
|
+
triggeringEvidenceId: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "Evidence node that caused an evidence-triggered modulation"
|
|
146
|
+
},
|
|
147
|
+
triggeringQuestionId: {
|
|
148
|
+
type: "string",
|
|
149
|
+
description: "Answered question whose resolution supports this modulation"
|
|
150
|
+
},
|
|
151
|
+
triggeringAnswerId: {
|
|
152
|
+
type: "string",
|
|
153
|
+
description: "Answer node whose content supports this modulation"
|
|
154
|
+
},
|
|
155
|
+
triggeringContradictionId: {
|
|
156
|
+
type: "string",
|
|
157
|
+
description: "Contradiction record that caused a contradiction-triggered modulation"
|
|
158
|
+
},
|
|
159
|
+
triggeringWorktreeId: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "Completed worktree whose outcome caused a worktree-triggered modulation"
|
|
162
|
+
},
|
|
144
163
|
rationale: {
|
|
145
164
|
type: "string",
|
|
146
165
|
description: "Human-readable explanation of why confidence changed"
|
|
147
166
|
}
|
|
148
167
|
},
|
|
149
|
-
required: [
|
|
168
|
+
required: [
|
|
169
|
+
"nodeId",
|
|
170
|
+
"belief",
|
|
171
|
+
"disbelief",
|
|
172
|
+
"uncertainty",
|
|
173
|
+
"baseRate",
|
|
174
|
+
"trigger",
|
|
175
|
+
"rationale"
|
|
176
|
+
],
|
|
150
177
|
response: {
|
|
151
178
|
description: "Confidence modulation result",
|
|
152
179
|
fields: {
|
|
@@ -340,7 +367,7 @@ var ADD_EVIDENCE = {
|
|
|
340
367
|
description: "Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'], failedApproach: true } for coding intelligence)"
|
|
341
368
|
}
|
|
342
369
|
},
|
|
343
|
-
required: ["canonicalText", "targetNodeId"],
|
|
370
|
+
required: ["canonicalText", "targetNodeId", "reasoning"],
|
|
344
371
|
response: {
|
|
345
372
|
description: "The created evidence node and its edge",
|
|
346
373
|
fields: {
|
|
@@ -396,7 +423,22 @@ var ADD_WORKTREE = {
|
|
|
396
423
|
description: "Check out a branch into an active worktree for investigation. Like `git worktree add <branch>` \u2014 creates independent working state on a thematic branch. Beliefs committed within the worktree can be freely amended (draft code on a feature branch). When investigation is complete, `merge` integrates findings into main.",
|
|
397
424
|
parameters: {
|
|
398
425
|
title: { type: "string", description: "Worktree name/objective" },
|
|
399
|
-
|
|
426
|
+
name: {
|
|
427
|
+
type: "string",
|
|
428
|
+
description: "Optional storage-name alias for callers that already use backend naming"
|
|
429
|
+
},
|
|
430
|
+
projectId: {
|
|
431
|
+
type: "string",
|
|
432
|
+
description: "Legacy topicId alias or resolver hint"
|
|
433
|
+
},
|
|
434
|
+
topicId: {
|
|
435
|
+
type: "string",
|
|
436
|
+
description: "Optional topic scope hint for resolver validation"
|
|
437
|
+
},
|
|
438
|
+
topicHint: {
|
|
439
|
+
type: "string",
|
|
440
|
+
description: "Natural-language topic hint for automatic topic resolution"
|
|
441
|
+
},
|
|
400
442
|
branchId: {
|
|
401
443
|
type: "string",
|
|
402
444
|
description: "The branch this worktree investigates"
|
|
@@ -409,21 +451,122 @@ var ADD_WORKTREE = {
|
|
|
409
451
|
type: "string",
|
|
410
452
|
description: "The testable claim this worktree investigates"
|
|
411
453
|
},
|
|
454
|
+
rationale: {
|
|
455
|
+
type: "string",
|
|
456
|
+
description: "Why this worktree exists and why it belongs in the campaign"
|
|
457
|
+
},
|
|
458
|
+
worktreeType: {
|
|
459
|
+
type: "string",
|
|
460
|
+
description: "Schema-enum worktree type used by the kernel lifecycle and retrieval layers"
|
|
461
|
+
},
|
|
462
|
+
gate: {
|
|
463
|
+
type: "string",
|
|
464
|
+
description: "Exit gate name for this worktree"
|
|
465
|
+
},
|
|
466
|
+
startDate: {
|
|
467
|
+
type: "number",
|
|
468
|
+
description: "Planned start timestamp in milliseconds since epoch"
|
|
469
|
+
},
|
|
470
|
+
endDate: {
|
|
471
|
+
type: "number",
|
|
472
|
+
description: "Planned end timestamp in milliseconds since epoch"
|
|
473
|
+
},
|
|
474
|
+
durationWeeks: {
|
|
475
|
+
type: "number",
|
|
476
|
+
description: "Planned duration in weeks"
|
|
477
|
+
},
|
|
478
|
+
confidenceImpact: {
|
|
479
|
+
type: "string",
|
|
480
|
+
description: "Expected confidence impact if the worktree succeeds",
|
|
481
|
+
enum: ["high", "medium", "low"]
|
|
482
|
+
},
|
|
483
|
+
beliefFocus: {
|
|
484
|
+
type: "string",
|
|
485
|
+
description: "Natural-language focus spanning the target belief neighborhood"
|
|
486
|
+
},
|
|
412
487
|
beliefIds: {
|
|
413
488
|
type: "array",
|
|
414
|
-
description: "
|
|
489
|
+
description: "Legacy alias for targetBeliefIds"
|
|
490
|
+
},
|
|
491
|
+
beliefs: {
|
|
492
|
+
type: "array",
|
|
493
|
+
description: "Legacy alias for targetBeliefIds"
|
|
494
|
+
},
|
|
495
|
+
targetBeliefIds: {
|
|
496
|
+
type: "array",
|
|
497
|
+
description: "Belief node IDs this worktree is expected to test or update"
|
|
498
|
+
},
|
|
499
|
+
targetQuestionIds: {
|
|
500
|
+
type: "array",
|
|
501
|
+
description: "Question node IDs this worktree is expected to answer"
|
|
502
|
+
},
|
|
503
|
+
keyQuestions: {
|
|
504
|
+
type: "array",
|
|
505
|
+
description: "Inline key question objects with question, optional status, answer, answerConfidence, and linkedQuestionId"
|
|
506
|
+
},
|
|
507
|
+
evidenceSignals: {
|
|
508
|
+
type: "array",
|
|
509
|
+
description: "Evidence signal objects with signal, optional collected state, progress, and notes"
|
|
510
|
+
},
|
|
511
|
+
decisionGate: {
|
|
512
|
+
type: "object",
|
|
513
|
+
description: "Decision gate object with goCriteria, noGoSignals, optional verdict, rationale, decidedAt, and decidedBy"
|
|
514
|
+
},
|
|
515
|
+
goCriteria: {
|
|
516
|
+
type: "array",
|
|
517
|
+
description: "Shorthand go criteria used to build decisionGate"
|
|
518
|
+
},
|
|
519
|
+
noGoSignals: {
|
|
520
|
+
type: "array",
|
|
521
|
+
description: "Shorthand no-go signals used to build decisionGate"
|
|
522
|
+
},
|
|
523
|
+
proofArtifacts: {
|
|
524
|
+
type: "array",
|
|
525
|
+
description: "Expected proof artifacts required to close the worktree"
|
|
415
526
|
},
|
|
416
527
|
autoShape: {
|
|
417
528
|
type: "boolean",
|
|
418
529
|
description: "Whether to invoke inquiry auto-shaping during worktree creation"
|
|
419
530
|
},
|
|
531
|
+
autoFixPolicy: {
|
|
532
|
+
type: "object",
|
|
533
|
+
description: "Policy for permitted automatic remediation inside the worktree"
|
|
534
|
+
},
|
|
420
535
|
domainPackId: {
|
|
421
536
|
type: "string",
|
|
422
537
|
description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
|
|
423
538
|
},
|
|
424
|
-
|
|
539
|
+
tags: {
|
|
540
|
+
type: "array",
|
|
541
|
+
description: "Additional topic-resolution tags for the worktree"
|
|
542
|
+
},
|
|
543
|
+
touchedPaths: {
|
|
544
|
+
type: "array",
|
|
545
|
+
description: "File paths used as topic-resolution signals"
|
|
546
|
+
},
|
|
547
|
+
sourceRef: {
|
|
548
|
+
type: "string",
|
|
549
|
+
description: "Source reference used as a topic-resolution signal"
|
|
550
|
+
},
|
|
551
|
+
sourceKind: {
|
|
552
|
+
type: "string",
|
|
553
|
+
description: "Source kind used as a topic-resolution signal"
|
|
554
|
+
},
|
|
555
|
+
campaign: {
|
|
556
|
+
type: "number",
|
|
557
|
+
description: "Top-level pipeline campaign number. Campaigns define the outer execution slice."
|
|
558
|
+
},
|
|
559
|
+
lane: {
|
|
560
|
+
type: "string",
|
|
561
|
+
description: "GitButler-aligned workstream lane name inside the campaign."
|
|
562
|
+
},
|
|
563
|
+
laneOrderInCampaign: {
|
|
564
|
+
type: "number",
|
|
565
|
+
description: "Ordering for this lane within its campaign."
|
|
566
|
+
},
|
|
567
|
+
orderInLane: {
|
|
425
568
|
type: "number",
|
|
426
|
-
description: "
|
|
569
|
+
description: "Position of this worktree inside its lane."
|
|
427
570
|
},
|
|
428
571
|
dependsOn: {
|
|
429
572
|
type: "array",
|
|
@@ -433,12 +576,20 @@ var ADD_WORKTREE = {
|
|
|
433
576
|
type: "array",
|
|
434
577
|
description: "Worktree IDs blocked by this worktree"
|
|
435
578
|
},
|
|
436
|
-
|
|
579
|
+
staffingHint: {
|
|
437
580
|
type: "string",
|
|
438
|
-
description: "
|
|
581
|
+
description: "Suggested staffing or agent allocation note"
|
|
582
|
+
},
|
|
583
|
+
lensId: {
|
|
584
|
+
type: "string",
|
|
585
|
+
description: "Lens that scopes this worktree when applicable"
|
|
586
|
+
},
|
|
587
|
+
lastReconciledAt: {
|
|
588
|
+
type: "number",
|
|
589
|
+
description: "Timestamp when worktree metadata was last reconciled"
|
|
439
590
|
}
|
|
440
591
|
},
|
|
441
|
-
required: ["title"
|
|
592
|
+
required: ["title"],
|
|
442
593
|
response: {
|
|
443
594
|
description: "The created worktree",
|
|
444
595
|
fields: {
|
|
@@ -465,7 +616,7 @@ var MERGE = {
|
|
|
465
616
|
worktreeId: { type: "string", description: "The worktree to merge" },
|
|
466
617
|
outcomes: {
|
|
467
618
|
type: "array",
|
|
468
|
-
description: "
|
|
619
|
+
description: "Merge outcomes as key-finding strings, or scoring outcomes for beliefs: { beliefId, confidence, rationale }"
|
|
469
620
|
},
|
|
470
621
|
summary: { type: "string", description: "Overall findings summary" }
|
|
471
622
|
},
|
|
@@ -683,19 +834,23 @@ var FIND_CONTRADICTIONS = {
|
|
|
683
834
|
};
|
|
684
835
|
var CREATE_EDGE = {
|
|
685
836
|
name: "create_edge",
|
|
686
|
-
description: "Commit a typed relationship between two nodes in the reasoning graph. Like `git commit` \u2014 an atomic write that declares a dependency between nodes.
|
|
837
|
+
description: "Commit a typed relationship between two nodes in the reasoning graph. Like `git commit` \u2014 an atomic write that declares a dependency between nodes. Accepts any public epistemic edge type between public graph node refs so agents can author the full spine.",
|
|
687
838
|
parameters: {
|
|
688
|
-
|
|
689
|
-
type: "
|
|
690
|
-
description: "Source
|
|
839
|
+
from: {
|
|
840
|
+
type: "object",
|
|
841
|
+
description: "Source graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'topic' }"
|
|
691
842
|
},
|
|
692
|
-
|
|
693
|
-
type: "
|
|
694
|
-
description: "Target
|
|
843
|
+
to: {
|
|
844
|
+
type: "object",
|
|
845
|
+
description: "Target graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'belief' }"
|
|
695
846
|
},
|
|
696
847
|
edgeType: {
|
|
697
848
|
type: "string",
|
|
698
|
-
description: "Relationship type
|
|
849
|
+
description: "Relationship type from the public epistemic edge enum."
|
|
850
|
+
},
|
|
851
|
+
globalId: {
|
|
852
|
+
type: "string",
|
|
853
|
+
description: "Optional idempotent edge global ID."
|
|
699
854
|
},
|
|
700
855
|
weight: {
|
|
701
856
|
type: "number",
|
|
@@ -706,9 +861,13 @@ var CREATE_EDGE = {
|
|
|
706
861
|
type: "string",
|
|
707
862
|
description: "How this was determined",
|
|
708
863
|
enum: ["deductive", "inductive", "abductive", "analogical", "empirical"]
|
|
864
|
+
},
|
|
865
|
+
metadata: {
|
|
866
|
+
type: "object",
|
|
867
|
+
description: "Optional edge metadata."
|
|
709
868
|
}
|
|
710
869
|
},
|
|
711
|
-
required: ["
|
|
870
|
+
required: ["from", "to", "edgeType"],
|
|
712
871
|
response: {
|
|
713
872
|
description: "The created edge",
|
|
714
873
|
fields: {
|
|
@@ -722,6 +881,240 @@ var CREATE_EDGE = {
|
|
|
722
881
|
ontologyPrimitive: "edge",
|
|
723
882
|
tier: "showcase"
|
|
724
883
|
};
|
|
884
|
+
var UPDATE_EDGE = {
|
|
885
|
+
name: "update_edge",
|
|
886
|
+
description: "Amend metadata on an existing graph edge. Like `git commit --amend` \u2014 changes the edge annotation without recreating the relationship.",
|
|
887
|
+
parameters: {
|
|
888
|
+
edgeId: { type: "string", description: "Edge ID or global ID to update" },
|
|
889
|
+
weight: { type: "number", description: "Updated edge weight" },
|
|
890
|
+
confidence: { type: "number", description: "Updated confidence" },
|
|
891
|
+
context: { type: "string", description: "Updated human-readable context" },
|
|
892
|
+
derivationType: { type: "string", description: "Updated derivation type" },
|
|
893
|
+
metadata: { type: "object", description: "Updated metadata" }
|
|
894
|
+
},
|
|
895
|
+
required: ["edgeId"],
|
|
896
|
+
response: {
|
|
897
|
+
description: "Edge update result",
|
|
898
|
+
fields: { success: "boolean" }
|
|
899
|
+
},
|
|
900
|
+
ownerModule: "graph-primitives",
|
|
901
|
+
ontologyPrimitive: "edge",
|
|
902
|
+
tier: "workhorse"
|
|
903
|
+
};
|
|
904
|
+
var REMOVE_EDGE = {
|
|
905
|
+
name: "remove_edge",
|
|
906
|
+
description: "Remove one graph edge by ID. Like `git rm` \u2014 deletes a single explicit relationship from the spine.",
|
|
907
|
+
parameters: {
|
|
908
|
+
edgeId: { type: "string", description: "Edge ID or global ID to remove" }
|
|
909
|
+
},
|
|
910
|
+
required: ["edgeId"],
|
|
911
|
+
response: {
|
|
912
|
+
description: "Edge removal result",
|
|
913
|
+
fields: { success: "boolean" }
|
|
914
|
+
},
|
|
915
|
+
ownerModule: "graph-primitives",
|
|
916
|
+
ontologyPrimitive: "edge",
|
|
917
|
+
tier: "workhorse"
|
|
918
|
+
};
|
|
919
|
+
var REMOVE_EDGES_BETWEEN = {
|
|
920
|
+
name: "remove_edges_between",
|
|
921
|
+
description: "Remove graph edges between two nodes. Like `git rm <pathspec>` \u2014 deletes relationships matching a source, target, and optional type.",
|
|
922
|
+
parameters: {
|
|
923
|
+
fromNodeId: { type: "string", description: "Source node ID or global ID" },
|
|
924
|
+
toNodeId: { type: "string", description: "Target node ID or global ID" },
|
|
925
|
+
edgeType: { type: "string", description: "Optional edge type filter" }
|
|
926
|
+
},
|
|
927
|
+
required: ["fromNodeId", "toNodeId"],
|
|
928
|
+
response: {
|
|
929
|
+
description: "Matched edge removal result",
|
|
930
|
+
fields: { deleted: "number" }
|
|
931
|
+
},
|
|
932
|
+
ownerModule: "graph-primitives",
|
|
933
|
+
ontologyPrimitive: "edge",
|
|
934
|
+
tier: "workhorse"
|
|
935
|
+
};
|
|
936
|
+
var BATCH_CREATE_EDGES = {
|
|
937
|
+
name: "batch_create_edges",
|
|
938
|
+
description: "Commit multiple typed graph edges. Like `git commit` with many staged paths \u2014 writes a batch of explicit relationships atomically per edge.",
|
|
939
|
+
parameters: {
|
|
940
|
+
edges: {
|
|
941
|
+
type: "array",
|
|
942
|
+
description: "Edges to create, each with from, to, edgeType, and optional weight/confidence/context."
|
|
943
|
+
},
|
|
944
|
+
skipLayerValidation: {
|
|
945
|
+
type: "boolean",
|
|
946
|
+
description: "Skip kernel layer validation for trusted materialization flows."
|
|
947
|
+
}
|
|
948
|
+
},
|
|
949
|
+
required: ["edges"],
|
|
950
|
+
response: {
|
|
951
|
+
description: "Batch edge creation result",
|
|
952
|
+
fields: {
|
|
953
|
+
created: "number",
|
|
954
|
+
results: "array",
|
|
955
|
+
errors: "array"
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
ownerModule: "graph-primitives",
|
|
959
|
+
ontologyPrimitive: "edge",
|
|
960
|
+
tier: "workhorse"
|
|
961
|
+
};
|
|
962
|
+
var CREATE_EPISTEMIC_NODE = {
|
|
963
|
+
name: "create_epistemic_node",
|
|
964
|
+
description: "Commit a generic epistemic graph node. Like `git commit` \u2014 creates a canonical node in the public spine for topics, beliefs, evidence, questions, answers, sources, and entities.",
|
|
965
|
+
parameters: {
|
|
966
|
+
globalId: { type: "string", description: "Optional idempotent node global ID" },
|
|
967
|
+
nodeType: { type: "string", description: "Public epistemic node type" },
|
|
968
|
+
canonicalText: { type: "string", description: "Canonical node text" },
|
|
969
|
+
text: { type: "string", description: "Alias for canonicalText" },
|
|
970
|
+
contentHash: { type: "string", description: "Optional idempotency content hash" },
|
|
971
|
+
sourceType: { type: "string", description: "Source type for provenance" },
|
|
972
|
+
topicId: { type: "string", description: "Optional topic scope" },
|
|
973
|
+
content: { type: "string", description: "Extended content" },
|
|
974
|
+
title: { type: "string", description: "Display title" },
|
|
975
|
+
metadata: { type: "object", description: "Optional node metadata" }
|
|
976
|
+
},
|
|
977
|
+
required: ["nodeType"],
|
|
978
|
+
response: {
|
|
979
|
+
description: "Created node result",
|
|
980
|
+
fields: {
|
|
981
|
+
nodeId: "string",
|
|
982
|
+
nodeGlobalId: "string",
|
|
983
|
+
isDuplicate: "boolean"
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
ownerModule: "reasoning-kernel",
|
|
987
|
+
ontologyPrimitive: "graph",
|
|
988
|
+
tier: "showcase"
|
|
989
|
+
};
|
|
990
|
+
var GET_EPISTEMIC_NODE = {
|
|
991
|
+
name: "get_epistemic_node",
|
|
992
|
+
description: "Read one epistemic graph node. Like `git show` \u2014 resolves a canonical spine node by ID or global ID.",
|
|
993
|
+
parameters: {
|
|
994
|
+
nodeId: { type: "string", description: "Node ID or global ID" }
|
|
995
|
+
},
|
|
996
|
+
required: ["nodeId"],
|
|
997
|
+
response: {
|
|
998
|
+
description: "The resolved node",
|
|
999
|
+
fields: { node: "object" }
|
|
1000
|
+
},
|
|
1001
|
+
ownerModule: "reasoning-kernel",
|
|
1002
|
+
ontologyPrimitive: "graph",
|
|
1003
|
+
tier: "workhorse"
|
|
1004
|
+
};
|
|
1005
|
+
var LIST_EPISTEMIC_NODES = {
|
|
1006
|
+
name: "list_epistemic_nodes",
|
|
1007
|
+
description: "List epistemic graph nodes. Like `git ls-tree` \u2014 lists canonical spine nodes by topic, type, status, or search query.",
|
|
1008
|
+
parameters: {
|
|
1009
|
+
topicId: { type: "string", description: "Optional topic scope" },
|
|
1010
|
+
nodeType: { type: "string", description: "Optional node type filter" },
|
|
1011
|
+
status: { type: "string", description: "Optional lifecycle status" },
|
|
1012
|
+
searchQuery: { type: "string", description: "Optional text search query" },
|
|
1013
|
+
limit: { type: "number", description: "Maximum nodes to return" }
|
|
1014
|
+
},
|
|
1015
|
+
required: [],
|
|
1016
|
+
response: {
|
|
1017
|
+
description: "Matching nodes",
|
|
1018
|
+
fields: { nodes: "array" }
|
|
1019
|
+
},
|
|
1020
|
+
ownerModule: "reasoning-kernel",
|
|
1021
|
+
ontologyPrimitive: "graph",
|
|
1022
|
+
tier: "workhorse"
|
|
1023
|
+
};
|
|
1024
|
+
var UPDATE_EPISTEMIC_NODE = {
|
|
1025
|
+
name: "update_epistemic_node",
|
|
1026
|
+
description: "Amend an epistemic graph node. Like `git commit --amend` \u2014 updates mutable node metadata, text, status, or verification fields.",
|
|
1027
|
+
parameters: {
|
|
1028
|
+
nodeId: { type: "string", description: "Node ID or global ID" },
|
|
1029
|
+
canonicalText: { type: "string", description: "Updated canonical text" },
|
|
1030
|
+
text: { type: "string", description: "Alias for canonicalText" },
|
|
1031
|
+
contentHash: { type: "string", description: "Updated content hash" },
|
|
1032
|
+
content: { type: "string", description: "Updated content" },
|
|
1033
|
+
title: { type: "string", description: "Updated display title" },
|
|
1034
|
+
metadata: { type: "object", description: "Updated metadata" },
|
|
1035
|
+
confidence: { type: "number", description: "Updated confidence" },
|
|
1036
|
+
verificationStatus: { type: "string", description: "Updated verification status" },
|
|
1037
|
+
status: { type: "string", description: "Updated lifecycle status" }
|
|
1038
|
+
},
|
|
1039
|
+
required: ["nodeId"],
|
|
1040
|
+
response: {
|
|
1041
|
+
description: "Node update result",
|
|
1042
|
+
fields: { success: "boolean" }
|
|
1043
|
+
},
|
|
1044
|
+
ownerModule: "reasoning-kernel",
|
|
1045
|
+
ontologyPrimitive: "graph",
|
|
1046
|
+
tier: "workhorse"
|
|
1047
|
+
};
|
|
1048
|
+
var ARCHIVE_EPISTEMIC_NODE = {
|
|
1049
|
+
name: "archive_epistemic_node",
|
|
1050
|
+
description: "Archive an epistemic graph node. Like `git rm --cached` \u2014 removes a node from active traversal without hard-deleting it.",
|
|
1051
|
+
parameters: {
|
|
1052
|
+
nodeId: { type: "string", description: "Node ID or global ID" }
|
|
1053
|
+
},
|
|
1054
|
+
required: ["nodeId"],
|
|
1055
|
+
response: {
|
|
1056
|
+
description: "Archive result",
|
|
1057
|
+
fields: { success: "boolean", effectiveStatus: "string" }
|
|
1058
|
+
},
|
|
1059
|
+
ownerModule: "reasoning-kernel",
|
|
1060
|
+
ontologyPrimitive: "graph",
|
|
1061
|
+
tier: "workhorse"
|
|
1062
|
+
};
|
|
1063
|
+
var VERIFY_EPISTEMIC_NODE = {
|
|
1064
|
+
name: "verify_epistemic_node",
|
|
1065
|
+
description: "Record verification state on an epistemic graph node. Like `git tag` \u2014 marks the node with a reviewed verification state.",
|
|
1066
|
+
parameters: {
|
|
1067
|
+
nodeId: { type: "string", description: "Node ID or global ID" },
|
|
1068
|
+
verificationStatus: { type: "string", description: "Verification status" },
|
|
1069
|
+
confidence: { type: "number", description: "Optional confidence update" }
|
|
1070
|
+
},
|
|
1071
|
+
required: ["nodeId", "verificationStatus"],
|
|
1072
|
+
response: {
|
|
1073
|
+
description: "Verification result",
|
|
1074
|
+
fields: { success: "boolean" }
|
|
1075
|
+
},
|
|
1076
|
+
ownerModule: "reasoning-kernel",
|
|
1077
|
+
ontologyPrimitive: "graph",
|
|
1078
|
+
tier: "workhorse"
|
|
1079
|
+
};
|
|
1080
|
+
var SUPERSEDE_EPISTEMIC_NODE = {
|
|
1081
|
+
name: "supersede_epistemic_node",
|
|
1082
|
+
description: "Supersede an epistemic graph node with a new version. Like `git commit --amend` on an immutable history branch \u2014 creates the replacement and marks the old node superseded.",
|
|
1083
|
+
parameters: {
|
|
1084
|
+
oldNodeId: { type: "string", description: "Node ID or global ID to supersede" },
|
|
1085
|
+
newGlobalId: { type: "string", description: "Optional replacement global ID" },
|
|
1086
|
+
newCanonicalText: { type: "string", description: "Replacement canonical text" },
|
|
1087
|
+
text: { type: "string", description: "Alias for newCanonicalText" },
|
|
1088
|
+
newContentHash: { type: "string", description: "Optional replacement content hash" },
|
|
1089
|
+
reason: { type: "string", description: "Reason for superseding" }
|
|
1090
|
+
},
|
|
1091
|
+
required: ["oldNodeId"],
|
|
1092
|
+
response: {
|
|
1093
|
+
description: "Supersede result",
|
|
1094
|
+
fields: { oldNodeId: "string", newNodeId: "string" }
|
|
1095
|
+
},
|
|
1096
|
+
ownerModule: "reasoning-kernel",
|
|
1097
|
+
ontologyPrimitive: "graph",
|
|
1098
|
+
tier: "workhorse"
|
|
1099
|
+
};
|
|
1100
|
+
var BATCH_CREATE_EPISTEMIC_NODES = {
|
|
1101
|
+
name: "batch_create_epistemic_nodes",
|
|
1102
|
+
description: "Commit multiple epistemic graph nodes. Like `git commit` with many staged files \u2014 writes a batch of canonical spine nodes.",
|
|
1103
|
+
parameters: {
|
|
1104
|
+
nodes: {
|
|
1105
|
+
type: "array",
|
|
1106
|
+
description: "Nodes to create with nodeType, canonicalText/text, and optional metadata."
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1109
|
+
required: ["nodes"],
|
|
1110
|
+
response: {
|
|
1111
|
+
description: "Batch node creation result",
|
|
1112
|
+
fields: { created: "number", results: "array" }
|
|
1113
|
+
},
|
|
1114
|
+
ownerModule: "reasoning-kernel",
|
|
1115
|
+
ontologyPrimitive: "graph",
|
|
1116
|
+
tier: "workhorse"
|
|
1117
|
+
};
|
|
725
1118
|
var RECORD_JUDGMENT = {
|
|
726
1119
|
name: "record_judgment",
|
|
727
1120
|
description: "Record a judgment \u2014 an irreversible commitment based on the current epistemic state. Like a `git tag` marking a release. A judgment synthesizes beliefs, evidence, and uncertainties into a determination. Once issued, a judgment is evaluated against the epistemic state that existed when it was made (knowledge horizon evaluation, Invariant #10).",
|
|
@@ -1019,6 +1412,74 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
|
|
|
1019
1412
|
ontologyPrimitive: "graph",
|
|
1020
1413
|
tier: "showcase"
|
|
1021
1414
|
};
|
|
1415
|
+
var LIST_GRAPH_INTELLIGENCE_QUERIES = {
|
|
1416
|
+
name: "list_graph_intelligence_queries",
|
|
1417
|
+
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.",
|
|
1418
|
+
parameters: {
|
|
1419
|
+
categoryId: {
|
|
1420
|
+
type: "string",
|
|
1421
|
+
description: "Optional category filter, such as problems or strategic"
|
|
1422
|
+
},
|
|
1423
|
+
mode: {
|
|
1424
|
+
type: "string",
|
|
1425
|
+
description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
required: [],
|
|
1429
|
+
response: {
|
|
1430
|
+
description: "Graph Intelligence query catalog and mode-to-tool mapping",
|
|
1431
|
+
fields: {
|
|
1432
|
+
categories: "array \u2014 query categories",
|
|
1433
|
+
queries: "array \u2014 query definitions with prompt templates and tools",
|
|
1434
|
+
quickQueries: "array \u2014 recommended one-click query presets",
|
|
1435
|
+
publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
ownerModule: "graph-intelligence",
|
|
1439
|
+
ontologyPrimitive: "graph",
|
|
1440
|
+
tier: "showcase"
|
|
1441
|
+
};
|
|
1442
|
+
var RUN_GRAPH_INTELLIGENCE_QUERY = {
|
|
1443
|
+
name: "run_graph_intelligence_query",
|
|
1444
|
+
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.",
|
|
1445
|
+
parameters: {
|
|
1446
|
+
topicId: { type: "string", description: "Topic to analyze" },
|
|
1447
|
+
queryId: {
|
|
1448
|
+
type: "string",
|
|
1449
|
+
description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
|
|
1450
|
+
},
|
|
1451
|
+
prompt: {
|
|
1452
|
+
type: "string",
|
|
1453
|
+
description: "Optional custom prompt for custom analysis runs"
|
|
1454
|
+
},
|
|
1455
|
+
input: {
|
|
1456
|
+
type: "string",
|
|
1457
|
+
description: "Optional entity, theme, belief, company, or search text for input-driven queries"
|
|
1458
|
+
},
|
|
1459
|
+
mode: {
|
|
1460
|
+
type: "string",
|
|
1461
|
+
description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
1462
|
+
},
|
|
1463
|
+
limit: {
|
|
1464
|
+
type: "number",
|
|
1465
|
+
description: "Maximum graph context rows to return"
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
required: ["topicId"],
|
|
1469
|
+
response: {
|
|
1470
|
+
description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
|
|
1471
|
+
fields: {
|
|
1472
|
+
query: "object \u2014 selected query definition",
|
|
1473
|
+
prompt: "string \u2014 resolved prompt template",
|
|
1474
|
+
toolPlan: "array \u2014 public tools and args the model can call next",
|
|
1475
|
+
analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
|
|
1476
|
+
context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
ownerModule: "graph-intelligence",
|
|
1480
|
+
ontologyPrimitive: "graph",
|
|
1481
|
+
tier: "showcase"
|
|
1482
|
+
};
|
|
1022
1483
|
var GET_FALSIFICATION_QUESTIONS = {
|
|
1023
1484
|
name: "get_falsification_questions",
|
|
1024
1485
|
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.",
|
|
@@ -1081,6 +1542,10 @@ var CREATE_EVIDENCE = {
|
|
|
1081
1542
|
type: "object",
|
|
1082
1543
|
description: "Optional metadata merged into the canonical evidence node"
|
|
1083
1544
|
},
|
|
1545
|
+
rationale: {
|
|
1546
|
+
type: "string",
|
|
1547
|
+
description: "Why this evidence should enter the reasoning graph"
|
|
1548
|
+
},
|
|
1084
1549
|
title: { type: "string", description: "Optional short title" },
|
|
1085
1550
|
content: { type: "string", description: "Optional long-form content" },
|
|
1086
1551
|
contentType: {
|
|
@@ -1089,7 +1554,7 @@ var CREATE_EVIDENCE = {
|
|
|
1089
1554
|
},
|
|
1090
1555
|
kind: { type: "string", description: "Optional evidence kind" }
|
|
1091
1556
|
},
|
|
1092
|
-
required: ["text"],
|
|
1557
|
+
required: ["text", "rationale"],
|
|
1093
1558
|
response: {
|
|
1094
1559
|
description: "The created canonical evidence record",
|
|
1095
1560
|
fields: {
|
|
@@ -1137,7 +1602,7 @@ var LIST_EVIDENCE = {
|
|
|
1137
1602
|
limit: { type: "number", description: "Max results" },
|
|
1138
1603
|
cursor: { type: "string", description: "Pagination cursor" }
|
|
1139
1604
|
},
|
|
1140
|
-
required: [],
|
|
1605
|
+
required: ["topicId"],
|
|
1141
1606
|
response: {
|
|
1142
1607
|
description: "Canonical evidence page",
|
|
1143
1608
|
fields: {
|
|
@@ -1322,6 +1787,7 @@ var ANSWER_QUESTION = {
|
|
|
1322
1787
|
description: "Answer a question with optional evidence links. Like `git commit` on the question thread \u2014 records the answer and closes the loop with a canonical answered state.",
|
|
1323
1788
|
parameters: {
|
|
1324
1789
|
id: { type: "string", description: "Canonical question ID" },
|
|
1790
|
+
topicId: { type: "string", description: "Topic scope for the answer" },
|
|
1325
1791
|
text: { type: "string", description: "Answer text" },
|
|
1326
1792
|
confidence: {
|
|
1327
1793
|
type: "string",
|
|
@@ -1334,7 +1800,7 @@ var ANSWER_QUESTION = {
|
|
|
1334
1800
|
},
|
|
1335
1801
|
rationale: { type: "string", description: "Why this answer is credible" }
|
|
1336
1802
|
},
|
|
1337
|
-
required: ["id", "text"],
|
|
1803
|
+
required: ["id", "topicId", "text"],
|
|
1338
1804
|
response: {
|
|
1339
1805
|
description: "Answer result",
|
|
1340
1806
|
fields: {
|
|
@@ -1553,6 +2019,10 @@ var LIST_BELIEFS = {
|
|
|
1553
2019
|
minConfidence: {
|
|
1554
2020
|
type: "number",
|
|
1555
2021
|
description: "Minimum confidence threshold"
|
|
2022
|
+
},
|
|
2023
|
+
limit: {
|
|
2024
|
+
type: "number",
|
|
2025
|
+
description: "Maximum results"
|
|
1556
2026
|
}
|
|
1557
2027
|
},
|
|
1558
2028
|
required: ["topicId"],
|
|
@@ -1569,20 +2039,37 @@ var LIST_BELIEFS = {
|
|
|
1569
2039
|
};
|
|
1570
2040
|
var LIST_WORKTREES = {
|
|
1571
2041
|
name: "list_worktrees",
|
|
1572
|
-
description: "List all worktrees for a topic. Like `git worktree list` \u2014 shows active and completed investigation branches with
|
|
2042
|
+
description: "List all worktrees for a topic. Like `git worktree list` \u2014 shows active and completed investigation branches with lifecycle phase, pipeline campaign/lane, status, and belief counts.",
|
|
1573
2043
|
parameters: {
|
|
1574
2044
|
topicId: { type: "string", description: "Topic scope" },
|
|
1575
2045
|
status: {
|
|
1576
2046
|
type: "string",
|
|
1577
2047
|
description: "Filter: active, merged, abandoned",
|
|
1578
2048
|
enum: ["active", "merged", "abandoned"]
|
|
2049
|
+
},
|
|
2050
|
+
groupBy: {
|
|
2051
|
+
type: "string",
|
|
2052
|
+
description: "Optional grouping mode for the response.",
|
|
2053
|
+
enum: ["campaign", "lane", "flat"]
|
|
2054
|
+
},
|
|
2055
|
+
lane: {
|
|
2056
|
+
type: "string",
|
|
2057
|
+
description: "Filter by GitButler-aligned lane name."
|
|
2058
|
+
},
|
|
2059
|
+
campaign: {
|
|
2060
|
+
type: "number",
|
|
2061
|
+
description: "Filter by top-level pipeline campaign number."
|
|
2062
|
+
},
|
|
2063
|
+
limit: {
|
|
2064
|
+
type: "number",
|
|
2065
|
+
description: "Maximum results to return."
|
|
1579
2066
|
}
|
|
1580
2067
|
},
|
|
1581
2068
|
required: ["topicId"],
|
|
1582
2069
|
response: {
|
|
1583
|
-
description: "Worktrees with phase, status, belief count, and creation time",
|
|
2070
|
+
description: "Worktrees with lifecycle phase, campaign, lane, status, belief count, and creation time",
|
|
1584
2071
|
fields: {
|
|
1585
|
-
worktrees: "array \u2014 { worktreeId, title, phase, status, beliefCount, createdAt }"
|
|
2072
|
+
worktrees: "array \u2014 { worktreeId, title, phase, campaign, lane, laneOrderInCampaign, orderInLane, status, beliefCount, createdAt }"
|
|
1586
2073
|
}
|
|
1587
2074
|
},
|
|
1588
2075
|
ownerModule: "workflow-engine",
|
|
@@ -1591,7 +2078,7 @@ var LIST_WORKTREES = {
|
|
|
1591
2078
|
};
|
|
1592
2079
|
var LIST_ALL_WORKTREES = {
|
|
1593
2080
|
name: "list_all_worktrees",
|
|
1594
|
-
description: "List ALL worktrees across ALL topics in one query. No topic scope required. Like `git worktree list --all` \u2014 returns the complete pipeline inventory with
|
|
2081
|
+
description: "List ALL worktrees across ALL topics in one query. No topic scope required. Like `git worktree list --all` \u2014 returns the complete pipeline inventory with campaign, lane, lane order, dependencies, and status. Supports filtering by status, lane, and campaign. This is the PM's primary pipeline query \u2014 one call, full picture.",
|
|
1595
2082
|
parameters: {
|
|
1596
2083
|
status: {
|
|
1597
2084
|
type: "string",
|
|
@@ -1609,13 +2096,18 @@ var LIST_ALL_WORKTREES = {
|
|
|
1609
2096
|
"dismissed"
|
|
1610
2097
|
]
|
|
1611
2098
|
},
|
|
1612
|
-
|
|
2099
|
+
lane: {
|
|
1613
2100
|
type: "string",
|
|
1614
|
-
description: "Filter by
|
|
2101
|
+
description: "Filter by lane name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity')"
|
|
1615
2102
|
},
|
|
1616
|
-
|
|
2103
|
+
campaign: {
|
|
1617
2104
|
type: "number",
|
|
1618
|
-
description: "Filter by
|
|
2105
|
+
description: "Filter by campaign number (e.g., 1, 2, 3). Returns only worktrees in that campaign."
|
|
2106
|
+
},
|
|
2107
|
+
groupBy: {
|
|
2108
|
+
type: "string",
|
|
2109
|
+
description: "Optional grouping mode for the response.",
|
|
2110
|
+
enum: ["campaign", "lane", "flat"]
|
|
1619
2111
|
},
|
|
1620
2112
|
limit: {
|
|
1621
2113
|
type: "number",
|
|
@@ -1626,10 +2118,39 @@ var LIST_ALL_WORKTREES = {
|
|
|
1626
2118
|
response: {
|
|
1627
2119
|
description: "All worktrees across all topics with full pipeline metadata",
|
|
1628
2120
|
fields: {
|
|
1629
|
-
worktrees: "array \u2014 { worktreeId, title, topicId, topicName, phase, status, hypothesis,
|
|
2121
|
+
worktrees: "array \u2014 { worktreeId, title, topicId, topicName, phase, status, hypothesis, campaign, lane, laneOrderInCampaign, orderInLane, dependsOn, blocks, gate, createdAt }",
|
|
1630
2122
|
total: "number \u2014 total count after filtering",
|
|
1631
|
-
|
|
1632
|
-
|
|
2123
|
+
lanes: "object \u2014 { laneName: count } summary of worktrees per lane",
|
|
2124
|
+
campaigns: "object \u2014 { campaignNumber: count } summary of worktrees per campaign"
|
|
2125
|
+
}
|
|
2126
|
+
},
|
|
2127
|
+
ownerModule: "workflow-engine",
|
|
2128
|
+
ontologyPrimitive: "worktree",
|
|
2129
|
+
tier: "showcase"
|
|
2130
|
+
};
|
|
2131
|
+
var LIST_CAMPAIGNS = {
|
|
2132
|
+
name: "list_campaigns",
|
|
2133
|
+
description: "List compact pipeline campaigns with their nested lanes. Use this to see the top-level campaign > lane > worktree shape without pulling the full worktree inventory.",
|
|
2134
|
+
parameters: {
|
|
2135
|
+
topicId: {
|
|
2136
|
+
type: "string",
|
|
2137
|
+
description: "Optional topic scope."
|
|
2138
|
+
},
|
|
2139
|
+
status: {
|
|
2140
|
+
type: "string",
|
|
2141
|
+
description: "Optional worktree status filter before grouping campaigns and lanes."
|
|
2142
|
+
},
|
|
2143
|
+
limit: {
|
|
2144
|
+
type: "number",
|
|
2145
|
+
description: "Maximum worktrees to scan before grouping."
|
|
2146
|
+
}
|
|
2147
|
+
},
|
|
2148
|
+
required: [],
|
|
2149
|
+
response: {
|
|
2150
|
+
description: "Pipeline campaigns with nested lane summaries.",
|
|
2151
|
+
fields: {
|
|
2152
|
+
campaigns: "array \u2014 { campaign, lanes: [{ lane, laneOrderInCampaign, worktreeCount, activeCount, readyCount, blockedCount, completedCount, nextWorktree }] }",
|
|
2153
|
+
totalWorktrees: "number \u2014 total worktrees scanned after filtering"
|
|
1633
2154
|
}
|
|
1634
2155
|
},
|
|
1635
2156
|
ownerModule: "workflow-engine",
|
|
@@ -1692,16 +2213,28 @@ var UPDATE_WORKTREE_TARGETS = {
|
|
|
1692
2213
|
};
|
|
1693
2214
|
var UPDATE_WORKTREE_METADATA = {
|
|
1694
2215
|
name: "update_worktree_metadata",
|
|
1695
|
-
description: "Update worktree sequencing metadata \u2014
|
|
2216
|
+
description: "Update worktree sequencing metadata \u2014 campaign, lane, dependencies, blocking relations, and gates. Like `git config` for a worktree \u2014 sets the scheduling and dependency metadata that determines when this worktree can activate relative to others. Use to backfill or correct sequencing data.",
|
|
1696
2217
|
parameters: {
|
|
1697
2218
|
worktreeId: { type: "string", description: "The worktree to update" },
|
|
1698
2219
|
hypothesis: {
|
|
1699
2220
|
type: "string",
|
|
1700
2221
|
description: "Testable claim this worktree investigates"
|
|
1701
2222
|
},
|
|
1702
|
-
|
|
2223
|
+
campaign: {
|
|
2224
|
+
type: "number",
|
|
2225
|
+
description: "Top-level pipeline campaign number."
|
|
2226
|
+
},
|
|
2227
|
+
lane: {
|
|
2228
|
+
type: "string",
|
|
2229
|
+
description: "GitButler-aligned workstream lane name inside the campaign."
|
|
2230
|
+
},
|
|
2231
|
+
laneOrderInCampaign: {
|
|
1703
2232
|
type: "number",
|
|
1704
|
-
description: "
|
|
2233
|
+
description: "Ordering for this lane within the campaign."
|
|
2234
|
+
},
|
|
2235
|
+
orderInLane: {
|
|
2236
|
+
type: "number",
|
|
2237
|
+
description: "Position of this worktree inside its lane."
|
|
1705
2238
|
},
|
|
1706
2239
|
dependsOn: {
|
|
1707
2240
|
type: "array",
|
|
@@ -1739,18 +2272,6 @@ var UPDATE_WORKTREE_METADATA = {
|
|
|
1739
2272
|
type: "object",
|
|
1740
2273
|
description: "Calibrated auto-fix policy controlling dry-run vs safe execution, per-run action caps, and permitted mutation tiers."
|
|
1741
2274
|
},
|
|
1742
|
-
track: {
|
|
1743
|
-
type: "string",
|
|
1744
|
-
description: "Parallel workstream name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity', 'execution-program'). Groups worktrees into named lanes for pipeline visualization and PM analysis."
|
|
1745
|
-
},
|
|
1746
|
-
trackPosition: {
|
|
1747
|
-
type: "number",
|
|
1748
|
-
description: "Position within the track (1-indexed). E.g., TC-A=1, TC-B=2, TC-C=3 within the 'tc-scope' track."
|
|
1749
|
-
},
|
|
1750
|
-
executionBand: {
|
|
1751
|
-
type: "number",
|
|
1752
|
-
description: "Parallel execution band number. All worktrees in the same band can run simultaneously. Band 2 = OE-B + TC-A, Band 3 = TC-B + 11D-R + S2-13A, etc."
|
|
1753
|
-
},
|
|
1754
2275
|
status: {
|
|
1755
2276
|
type: "string",
|
|
1756
2277
|
description: "Override the worktree status. Use for lifecycle transitions like marking a worktree superseded, long-term, or as a raw idea.",
|
|
@@ -1807,15 +2328,15 @@ var IDENTITY_WHOAMI = {
|
|
|
1807
2328
|
};
|
|
1808
2329
|
var COMPILE_CONTEXT = {
|
|
1809
2330
|
name: "compile_context",
|
|
1810
|
-
description: "Compile a focused reasoning context
|
|
2331
|
+
description: "Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
|
|
1811
2332
|
parameters: {
|
|
1812
2333
|
topicId: {
|
|
1813
2334
|
type: "string",
|
|
1814
|
-
description: "
|
|
2335
|
+
description: "Optional topic scope ID. Omit to resolve the topic from query."
|
|
1815
2336
|
},
|
|
1816
2337
|
query: {
|
|
1817
2338
|
type: "string",
|
|
1818
|
-
description: "
|
|
2339
|
+
description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
|
|
1819
2340
|
},
|
|
1820
2341
|
budget: {
|
|
1821
2342
|
type: "number",
|
|
@@ -1839,7 +2360,7 @@ var COMPILE_CONTEXT = {
|
|
|
1839
2360
|
description: "Include related ontological entities in the compiled result"
|
|
1840
2361
|
}
|
|
1841
2362
|
},
|
|
1842
|
-
required: [
|
|
2363
|
+
required: [],
|
|
1843
2364
|
response: {
|
|
1844
2365
|
description: "Compiled context pack for the requested topic",
|
|
1845
2366
|
fields: {
|
|
@@ -2013,18 +2534,60 @@ var CREATE_TASK = {
|
|
|
2013
2534
|
name: "create_task",
|
|
2014
2535
|
description: "Create an execution task tied to the reasoning state. Like `git task` \u2014 tracks concrete work items (calls to make, data to gather, analyses to run) linked to questions, beliefs, or worktrees.",
|
|
2015
2536
|
parameters: {
|
|
2016
|
-
title: { type: "string", description: "Task
|
|
2537
|
+
title: { type: "string", description: "Task title" },
|
|
2017
2538
|
topicId: { type: "string", description: "Topic scope" },
|
|
2539
|
+
description: {
|
|
2540
|
+
type: "string",
|
|
2541
|
+
description: "Long-form task description"
|
|
2542
|
+
},
|
|
2018
2543
|
taskType: {
|
|
2019
2544
|
type: "string",
|
|
2020
|
-
description: "
|
|
2021
|
-
enum: [
|
|
2545
|
+
description: "Task taxonomy",
|
|
2546
|
+
enum: [
|
|
2547
|
+
"general",
|
|
2548
|
+
"find_evidence",
|
|
2549
|
+
"verify_claim",
|
|
2550
|
+
"research",
|
|
2551
|
+
"review",
|
|
2552
|
+
"interview",
|
|
2553
|
+
"analysis",
|
|
2554
|
+
"track_metrics"
|
|
2555
|
+
]
|
|
2556
|
+
},
|
|
2557
|
+
priority: {
|
|
2558
|
+
type: "string",
|
|
2559
|
+
description: "Priority",
|
|
2560
|
+
enum: ["urgent", "high", "medium", "low"]
|
|
2561
|
+
},
|
|
2562
|
+
status: {
|
|
2563
|
+
type: "string",
|
|
2564
|
+
description: "Initial status (defaults to todo)",
|
|
2565
|
+
enum: ["todo", "in_progress", "blocked", "done"]
|
|
2566
|
+
},
|
|
2567
|
+
linkedWorktreeId: {
|
|
2568
|
+
type: "string",
|
|
2569
|
+
description: "Worktree this task belongs to"
|
|
2570
|
+
},
|
|
2571
|
+
linkedBeliefId: {
|
|
2572
|
+
type: "string",
|
|
2573
|
+
description: "Belief this task supports"
|
|
2022
2574
|
},
|
|
2023
2575
|
linkedQuestionId: {
|
|
2024
2576
|
type: "string",
|
|
2025
2577
|
description: "Question this task addresses"
|
|
2026
2578
|
},
|
|
2027
|
-
|
|
2579
|
+
assigneeId: {
|
|
2580
|
+
type: "string",
|
|
2581
|
+
description: "Principal assigned to the task"
|
|
2582
|
+
},
|
|
2583
|
+
dueDate: {
|
|
2584
|
+
type: "number",
|
|
2585
|
+
description: "Due date as epoch milliseconds"
|
|
2586
|
+
},
|
|
2587
|
+
tags: {
|
|
2588
|
+
type: "array",
|
|
2589
|
+
description: "Free-form string tags"
|
|
2590
|
+
}
|
|
2028
2591
|
},
|
|
2029
2592
|
required: ["title"],
|
|
2030
2593
|
response: {
|
|
@@ -2120,6 +2683,10 @@ var LIST_TASKS = {
|
|
|
2120
2683
|
type: "string",
|
|
2121
2684
|
description: "Filter to tasks linked to this worktree"
|
|
2122
2685
|
},
|
|
2686
|
+
worktreeId: {
|
|
2687
|
+
type: "string",
|
|
2688
|
+
description: "Alias for linkedWorktreeId"
|
|
2689
|
+
},
|
|
2123
2690
|
status: {
|
|
2124
2691
|
type: "string",
|
|
2125
2692
|
description: "Filter by status: todo, in_progress, blocked, done",
|
|
@@ -2140,6 +2707,10 @@ var CREATE_TOPIC = {
|
|
|
2140
2707
|
name: "create_topic",
|
|
2141
2708
|
description: "Create a new topic container for scoping knowledge. Like `git init` \u2014 initializes a new repository for a knowledge domain. Topics are hierarchical: a deal topic can nest under a theme topic. Types: domain, theme, deal, strategy, constitution, project, portfolio.",
|
|
2142
2709
|
parameters: {
|
|
2710
|
+
globalId: {
|
|
2711
|
+
type: "string",
|
|
2712
|
+
description: "Optional idempotent topic global ID"
|
|
2713
|
+
},
|
|
2143
2714
|
name: { type: "string", description: "Topic name" },
|
|
2144
2715
|
type: {
|
|
2145
2716
|
type: "string",
|
|
@@ -2150,6 +2721,18 @@ var CREATE_TOPIC = {
|
|
|
2150
2721
|
type: "string",
|
|
2151
2722
|
description: "Optional parent topic for nesting"
|
|
2152
2723
|
},
|
|
2724
|
+
parentTopicGlobalId: {
|
|
2725
|
+
type: "string",
|
|
2726
|
+
description: "Optional parent topic global ID for nesting"
|
|
2727
|
+
},
|
|
2728
|
+
tenantId: { type: "string", description: "Optional tenant scope" },
|
|
2729
|
+
workspaceId: { type: "string", description: "Optional workspace scope" },
|
|
2730
|
+
visibility: {
|
|
2731
|
+
type: "string",
|
|
2732
|
+
description: "Topic visibility",
|
|
2733
|
+
enum: ["private", "team", "firm", "external", "public"]
|
|
2734
|
+
},
|
|
2735
|
+
metadata: { type: "object", description: "Optional topic metadata" },
|
|
2153
2736
|
createdBy: { type: "string", description: "Who created this topic" }
|
|
2154
2737
|
},
|
|
2155
2738
|
required: ["name", "type"],
|
|
@@ -2158,6 +2741,9 @@ var CREATE_TOPIC = {
|
|
|
2158
2741
|
fields: {
|
|
2159
2742
|
id: "string \u2014 topic ID",
|
|
2160
2743
|
globalId: "string \u2014 globally unique ID",
|
|
2744
|
+
topicGlobalId: "string \u2014 topic global ID",
|
|
2745
|
+
epistemicNodeId: "string \u2014 materialized topic node ID",
|
|
2746
|
+
epistemicNodeGlobalId: "string \u2014 materialized topic node global ID",
|
|
2161
2747
|
depth: "number \u2014 nesting depth"
|
|
2162
2748
|
}
|
|
2163
2749
|
},
|
|
@@ -2207,7 +2793,7 @@ var GET_TOPIC = {
|
|
|
2207
2793
|
description: "Legacy alias for topicId"
|
|
2208
2794
|
}
|
|
2209
2795
|
},
|
|
2210
|
-
required: [],
|
|
2796
|
+
required: ["topicId"],
|
|
2211
2797
|
response: {
|
|
2212
2798
|
description: "Single topic record",
|
|
2213
2799
|
fields: {
|
|
@@ -2288,6 +2874,65 @@ var GET_TOPIC_TREE = {
|
|
|
2288
2874
|
ontologyPrimitive: "graph",
|
|
2289
2875
|
tier: "workhorse"
|
|
2290
2876
|
};
|
|
2877
|
+
var MATERIALIZE_TOPIC_GRAPH = {
|
|
2878
|
+
name: "materialize_topic_graph",
|
|
2879
|
+
description: "Backfill the topic graph spine. Like `git fsck --connectivity-only` with repair enabled \u2014 creates missing topic nodes and parent-child edges idempotently.",
|
|
2880
|
+
parameters: {
|
|
2881
|
+
rootTopicId: {
|
|
2882
|
+
type: "string",
|
|
2883
|
+
description: "Optional root topic for a bounded materialization pass"
|
|
2884
|
+
},
|
|
2885
|
+
dryRun: {
|
|
2886
|
+
type: "boolean",
|
|
2887
|
+
description: "When true, report missing rows without writing them"
|
|
2888
|
+
}
|
|
2889
|
+
},
|
|
2890
|
+
required: [],
|
|
2891
|
+
response: {
|
|
2892
|
+
description: "Topic graph materialization counts",
|
|
2893
|
+
fields: {
|
|
2894
|
+
topicsSeen: "number",
|
|
2895
|
+
nodesCreated: "number",
|
|
2896
|
+
nodesExisting: "number",
|
|
2897
|
+
edgesCreated: "number",
|
|
2898
|
+
edgesExisting: "number",
|
|
2899
|
+
errors: "array"
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2902
|
+
ownerModule: "reasoning-kernel",
|
|
2903
|
+
ontologyPrimitive: "graph",
|
|
2904
|
+
tier: "workhorse"
|
|
2905
|
+
};
|
|
2906
|
+
var GET_TOPIC_GRAPH_SPINE = {
|
|
2907
|
+
name: "get_topic_graph_spine",
|
|
2908
|
+
description: "Verify the topic graph spine. Like `git fsck` \u2014 reads topics, materialized topic nodes, parent-child edges, and missing spine rows.",
|
|
2909
|
+
parameters: {
|
|
2910
|
+
rootTopicId: {
|
|
2911
|
+
type: "string",
|
|
2912
|
+
description: "Optional root topic for a bounded verifier pass"
|
|
2913
|
+
},
|
|
2914
|
+
includeTopicBeliefEdges: {
|
|
2915
|
+
type: "boolean",
|
|
2916
|
+
description: "Include topic -> belief edges in the verifier payload"
|
|
2917
|
+
}
|
|
2918
|
+
},
|
|
2919
|
+
required: [],
|
|
2920
|
+
response: {
|
|
2921
|
+
description: "Topic graph spine verification payload",
|
|
2922
|
+
fields: {
|
|
2923
|
+
ok: "boolean",
|
|
2924
|
+
counts: "object",
|
|
2925
|
+
topics: "array",
|
|
2926
|
+
topicNodes: "array",
|
|
2927
|
+
parentEdges: "array",
|
|
2928
|
+
missingTopicNodes: "array",
|
|
2929
|
+
missingParentEdges: "array"
|
|
2930
|
+
}
|
|
2931
|
+
},
|
|
2932
|
+
ownerModule: "reasoning-kernel",
|
|
2933
|
+
ontologyPrimitive: "graph",
|
|
2934
|
+
tier: "workhorse"
|
|
2935
|
+
};
|
|
2291
2936
|
var GET_CODE_CONTEXT = {
|
|
2292
2937
|
name: "get_code_context",
|
|
2293
2938
|
description: "Returns code-grounded beliefs, contracts, migration states, and failed attempts anchored to a specific file or function path. Like `git log -- <path>` \u2014 filters the knowledge graph to nodes anchored to a file path via metadata.codeAnchors. Results are separated by coding belief type: decisions, contracts, migrations, patterns, deprecations, and failures.",
|
|
@@ -2562,7 +3207,7 @@ var GET_ONTOLOGY = {
|
|
|
2562
3207
|
description: "Tenant scope for key lookup. Omit for platform-level."
|
|
2563
3208
|
}
|
|
2564
3209
|
},
|
|
2565
|
-
required: [],
|
|
3210
|
+
required: ["id"],
|
|
2566
3211
|
response: {
|
|
2567
3212
|
description: "Ontology definition with latest published version",
|
|
2568
3213
|
fields: {
|
|
@@ -2629,7 +3274,7 @@ var MATCH_ENTITY_TYPE = {
|
|
|
2629
3274
|
description: "Optional maximum number of ranked matches to return"
|
|
2630
3275
|
}
|
|
2631
3276
|
},
|
|
2632
|
-
required: ["text"],
|
|
3277
|
+
required: ["text", "ontologyId"],
|
|
2633
3278
|
response: {
|
|
2634
3279
|
description: "Ranked ontology entity type matches",
|
|
2635
3280
|
fields: {
|
|
@@ -2883,7 +3528,7 @@ var RECORD_SCOPE_LEARNING = {
|
|
|
2883
3528
|
};
|
|
2884
3529
|
var PIPELINE_SNAPSHOT = {
|
|
2885
3530
|
name: "pipeline_snapshot",
|
|
2886
|
-
description: "Summarize a topic's worktree pipeline in
|
|
3531
|
+
description: "Summarize a topic's worktree pipeline in campaign-and-lane form. Like `git status --short` for Lucern execution \u2014 returns the hinge worktree, next planned wave, blockers, critical path, superseded work, and graph hygiene debt.",
|
|
2887
3532
|
parameters: {
|
|
2888
3533
|
topicId: { type: "string", description: "Topic scope ID" }
|
|
2889
3534
|
},
|
|
@@ -2893,14 +3538,14 @@ var PIPELINE_SNAPSHOT = {
|
|
|
2893
3538
|
fields: {
|
|
2894
3539
|
topicId: "string",
|
|
2895
3540
|
topicName: "string",
|
|
2896
|
-
|
|
2897
|
-
|
|
3541
|
+
currentCampaign: "number | null",
|
|
3542
|
+
nextCampaign: "number | null",
|
|
2898
3543
|
activeWorktrees: "array \u2014 current hinge worktree(s)",
|
|
2899
|
-
nextWave: "array \u2014 worktrees in the next planned
|
|
3544
|
+
nextWave: "array \u2014 worktrees in the next planned campaign",
|
|
2900
3545
|
readyNow: "array \u2014 planning worktrees with dependencies completed",
|
|
2901
3546
|
blockedBy: "array \u2014 grouped blockers",
|
|
2902
3547
|
criticalPath: "array \u2014 ordered incomplete worktree chain",
|
|
2903
|
-
|
|
3548
|
+
campaigns: "array \u2014 incomplete worktrees grouped by campaign",
|
|
2904
3549
|
superseded: "array \u2014 worktrees marked superseded or not for activation",
|
|
2905
3550
|
graphHygiene: "object \u2014 untargeted and taskless worktree debt",
|
|
2906
3551
|
riskQuestions: "array \u2014 critical/high open questions",
|
|
@@ -3420,6 +4065,69 @@ var GENERATE_SESSION_HANDOFF = {
|
|
|
3420
4065
|
tier: "showcase",
|
|
3421
4066
|
internal: true
|
|
3422
4067
|
};
|
|
4068
|
+
var BEGIN_BUILD_SESSION = {
|
|
4069
|
+
name: "begin_build_session",
|
|
4070
|
+
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.",
|
|
4071
|
+
parameters: {
|
|
4072
|
+
worktreeId: {
|
|
4073
|
+
type: "string",
|
|
4074
|
+
description: "The Lucern worktree ID to bootstrap."
|
|
4075
|
+
},
|
|
4076
|
+
branch: {
|
|
4077
|
+
type: "string",
|
|
4078
|
+
description: "Optional git branch name. Auto-generated from the worktree name when omitted."
|
|
4079
|
+
},
|
|
4080
|
+
branchBase: {
|
|
4081
|
+
type: "string",
|
|
4082
|
+
description: 'Base branch for the feature branch. Default: "staging".'
|
|
4083
|
+
},
|
|
4084
|
+
prBase: {
|
|
4085
|
+
type: "string",
|
|
4086
|
+
description: 'Target branch for the PR. Default: "staging".'
|
|
4087
|
+
},
|
|
4088
|
+
sessionMode: {
|
|
4089
|
+
type: "string",
|
|
4090
|
+
description: 'Session mode: "async" for Codex/headless or "interactive" for live sessions.',
|
|
4091
|
+
enum: ["async", "interactive"]
|
|
4092
|
+
},
|
|
4093
|
+
activateIfPlanning: {
|
|
4094
|
+
type: "boolean",
|
|
4095
|
+
description: "When true, automatically activate a planning worktree during bootstrap."
|
|
4096
|
+
}
|
|
4097
|
+
},
|
|
4098
|
+
required: ["worktreeId"],
|
|
4099
|
+
response: {
|
|
4100
|
+
description: "A compact build-session packet with worktree metadata, graph anchors, questions, dependencies, and git defaults.",
|
|
4101
|
+
fields: {
|
|
4102
|
+
topicId: "string \u2014 canonical topic scope",
|
|
4103
|
+
topicName: "string \u2014 human-readable topic name",
|
|
4104
|
+
worktreeId: "string \u2014 worktree ID",
|
|
4105
|
+
worktreeName: "string \u2014 human-readable worktree name",
|
|
4106
|
+
branch: "string \u2014 git branch name",
|
|
4107
|
+
branchBase: "string \u2014 base branch",
|
|
4108
|
+
prBase: "string \u2014 PR target branch",
|
|
4109
|
+
campaign: "number | null \u2014 top-level pipeline campaign",
|
|
4110
|
+
lane: "string \u2014 campaign lane",
|
|
4111
|
+
gate: "string \u2014 exit gate",
|
|
4112
|
+
hypothesis: "string \u2014 worktree hypothesis",
|
|
4113
|
+
focus: "string \u2014 session focus",
|
|
4114
|
+
status: "string \u2014 worktree status after optional activation",
|
|
4115
|
+
sessionMode: "string \u2014 async | interactive",
|
|
4116
|
+
targetBeliefIds: "array \u2014 scoped belief IDs",
|
|
4117
|
+
targetQuestionIds: "array \u2014 scoped question IDs",
|
|
4118
|
+
topBeliefs: "array \u2014 highest-confidence scoped beliefs",
|
|
4119
|
+
openQuestions: "array \u2014 open scoped questions",
|
|
4120
|
+
resolvedDecisions: "array \u2014 answered questions summarized for the session",
|
|
4121
|
+
dependencies: "array \u2014 upstream worktrees",
|
|
4122
|
+
unblocks: "array \u2014 downstream worktrees",
|
|
4123
|
+
mergeOrderNotes: "string \u2014 merge ordering advisory"
|
|
4124
|
+
}
|
|
4125
|
+
},
|
|
4126
|
+
ownerModule: "bootstrap",
|
|
4127
|
+
ontologyPrimitive: "worktree",
|
|
4128
|
+
tier: "showcase",
|
|
4129
|
+
internal: true
|
|
4130
|
+
};
|
|
3423
4131
|
var MCP_TOOL_CONTRACTS = {
|
|
3424
4132
|
// Belief lifecycle (commit, amend, fork, archive)
|
|
3425
4133
|
create_belief: CREATE_BELIEF,
|
|
@@ -3462,11 +4170,26 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
3462
4170
|
bisect_confidence: BISECT_CONFIDENCE,
|
|
3463
4171
|
// Edges (commit)
|
|
3464
4172
|
create_edge: CREATE_EDGE,
|
|
4173
|
+
update_edge: UPDATE_EDGE,
|
|
4174
|
+
remove_edge: REMOVE_EDGE,
|
|
4175
|
+
remove_edges_between: REMOVE_EDGES_BETWEEN,
|
|
4176
|
+
batch_create_edges: BATCH_CREATE_EDGES,
|
|
4177
|
+
// Epistemic node spine (commit/amend/show)
|
|
4178
|
+
create_epistemic_node: CREATE_EPISTEMIC_NODE,
|
|
4179
|
+
get_epistemic_node: GET_EPISTEMIC_NODE,
|
|
4180
|
+
list_epistemic_nodes: LIST_EPISTEMIC_NODES,
|
|
4181
|
+
update_epistemic_node: UPDATE_EPISTEMIC_NODE,
|
|
4182
|
+
archive_epistemic_node: ARCHIVE_EPISTEMIC_NODE,
|
|
4183
|
+
verify_epistemic_node: VERIFY_EPISTEMIC_NODE,
|
|
4184
|
+
supersede_epistemic_node: SUPERSEDE_EPISTEMIC_NODE,
|
|
4185
|
+
batch_create_epistemic_nodes: BATCH_CREATE_EPISTEMIC_NODES,
|
|
3465
4186
|
// Judgments (tag)
|
|
3466
4187
|
record_judgment: RECORD_JUDGMENT,
|
|
3467
4188
|
// Graph intelligence (showcase)
|
|
3468
4189
|
detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
|
|
3469
4190
|
get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
|
|
4191
|
+
list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
|
|
4192
|
+
run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
|
|
3470
4193
|
get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
|
|
3471
4194
|
// Evidence operations (workhorse)
|
|
3472
4195
|
search_evidence: SEARCH_EVIDENCE,
|
|
@@ -3489,6 +4212,7 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
3489
4212
|
list_beliefs: LIST_BELIEFS,
|
|
3490
4213
|
list_worktrees: LIST_WORKTREES,
|
|
3491
4214
|
list_all_worktrees: LIST_ALL_WORKTREES,
|
|
4215
|
+
list_campaigns: LIST_CAMPAIGNS,
|
|
3492
4216
|
activate_worktree: ACTIVATE_WORKTREE,
|
|
3493
4217
|
update_worktree_targets: UPDATE_WORKTREE_TARGETS,
|
|
3494
4218
|
update_worktree_metadata: UPDATE_WORKTREE_METADATA,
|
|
@@ -3512,6 +4236,7 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
3512
4236
|
get_agent_inbox: GET_AGENT_INBOX,
|
|
3513
4237
|
claim_files: CLAIM_FILES,
|
|
3514
4238
|
generate_session_handoff: GENERATE_SESSION_HANDOFF,
|
|
4239
|
+
begin_build_session: BEGIN_BUILD_SESSION,
|
|
3515
4240
|
// Policy / ACL (workhorse)
|
|
3516
4241
|
check_permission: CHECK_PERMISSION,
|
|
3517
4242
|
filter_by_permission: FILTER_BY_PERMISSION,
|
|
@@ -3531,6 +4256,8 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
3531
4256
|
get_topic: GET_TOPIC,
|
|
3532
4257
|
update_topic: UPDATE_TOPIC,
|
|
3533
4258
|
get_topic_tree: GET_TOPIC_TREE,
|
|
4259
|
+
materialize_topic_graph: MATERIALIZE_TOPIC_GRAPH,
|
|
4260
|
+
get_topic_graph_spine: GET_TOPIC_GRAPH_SPINE,
|
|
3534
4261
|
// Coding intelligence (code-grounded knowledge)
|
|
3535
4262
|
get_code_context: GET_CODE_CONTEXT,
|
|
3536
4263
|
get_change_history: GET_CHANGE_HISTORY,
|
|
@@ -3635,18 +4362,34 @@ var MCP_CORE_OPERATION_NAMES = [
|
|
|
3635
4362
|
"find_missing_questions",
|
|
3636
4363
|
"get_high_priority_questions",
|
|
3637
4364
|
"get_falsification_questions",
|
|
4365
|
+
"create_epistemic_node",
|
|
4366
|
+
"get_epistemic_node",
|
|
4367
|
+
"list_epistemic_nodes",
|
|
4368
|
+
"update_epistemic_node",
|
|
4369
|
+
"archive_epistemic_node",
|
|
4370
|
+
"verify_epistemic_node",
|
|
4371
|
+
"supersede_epistemic_node",
|
|
4372
|
+
"batch_create_epistemic_nodes",
|
|
3638
4373
|
"create_topic",
|
|
3639
4374
|
"get_topic",
|
|
3640
4375
|
"list_topics",
|
|
3641
4376
|
"update_topic",
|
|
3642
|
-
"get_topic_tree"
|
|
4377
|
+
"get_topic_tree",
|
|
4378
|
+
"materialize_topic_graph",
|
|
4379
|
+
"get_topic_graph_spine"
|
|
3643
4380
|
];
|
|
3644
4381
|
var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
|
|
3645
4382
|
"create_edge",
|
|
4383
|
+
"update_edge",
|
|
4384
|
+
"remove_edge",
|
|
4385
|
+
"remove_edges_between",
|
|
4386
|
+
"batch_create_edges",
|
|
3646
4387
|
"query_lineage",
|
|
3647
4388
|
"traverse_graph",
|
|
3648
4389
|
"get_graph_neighborhood",
|
|
3649
4390
|
"get_graph_structure_analysis",
|
|
4391
|
+
"list_graph_intelligence_queries",
|
|
4392
|
+
"run_graph_intelligence_query",
|
|
3650
4393
|
"find_contradictions",
|
|
3651
4394
|
"flag_contradiction",
|
|
3652
4395
|
"detect_confirmation_bias",
|
|
@@ -3671,6 +4414,7 @@ var MCP_WORKFLOW_PLATFORM_OPERATION_NAMES = [
|
|
|
3671
4414
|
"activate_worktree",
|
|
3672
4415
|
"list_worktrees",
|
|
3673
4416
|
"list_all_worktrees",
|
|
4417
|
+
"list_campaigns",
|
|
3674
4418
|
"update_worktree_targets",
|
|
3675
4419
|
"update_worktree_metadata",
|
|
3676
4420
|
"create_task",
|
|
@@ -3724,6 +4468,7 @@ var PLATFORM_INTERNAL_OPERATION_NAMES = [
|
|
|
3724
4468
|
"get_change_history",
|
|
3725
4469
|
"get_failure_log",
|
|
3726
4470
|
"record_attempt",
|
|
4471
|
+
"begin_build_session",
|
|
3727
4472
|
"push",
|
|
3728
4473
|
"open_pull_request",
|
|
3729
4474
|
"record_judgment",
|
|
@@ -3778,7 +4523,6 @@ var SDK_ONLY_OPERATION_NAMES = [
|
|
|
3778
4523
|
"find_semantic_orphans"
|
|
3779
4524
|
];
|
|
3780
4525
|
var MCP_ONLY_INTERNAL_OPERATION_NAMES = [
|
|
3781
|
-
"begin_build_session",
|
|
3782
4526
|
"evaluate_engineering_contract",
|
|
3783
4527
|
"evaluate_research_contract"
|
|
3784
4528
|
];
|
|
@@ -3878,6 +4622,7 @@ var LUCERN_OPERATION_MANIFEST = {
|
|
|
3878
4622
|
|
|
3879
4623
|
// src/function-registry/helpers.ts
|
|
3880
4624
|
var jsonObjectSchema = z.record(z.unknown());
|
|
4625
|
+
var sdkSessionIdSchema = z.string().optional();
|
|
3881
4626
|
function mcpContractShape(contract) {
|
|
3882
4627
|
const required = new Set(contract.required);
|
|
3883
4628
|
return Object.fromEntries(
|
|
@@ -3912,10 +4657,40 @@ function argsSchemaFromMcpContract(contract) {
|
|
|
3912
4657
|
return z.object(mcpContractShape(contract));
|
|
3913
4658
|
}
|
|
3914
4659
|
function inputSchemaFromMcpContract(contract) {
|
|
3915
|
-
return argsSchemaFromMcpContract(contract)
|
|
4660
|
+
return withInternalSurfaceFields(argsSchemaFromMcpContract(contract));
|
|
4661
|
+
}
|
|
4662
|
+
function withInternalSurfaceFields(schema) {
|
|
4663
|
+
return schema.extend({ __sdkSessionId: sdkSessionIdSchema }).strict();
|
|
4664
|
+
}
|
|
4665
|
+
function normalizeInputSchema(schema) {
|
|
4666
|
+
if (schema instanceof z.ZodObject) {
|
|
4667
|
+
return withInternalSurfaceFields(schema);
|
|
4668
|
+
}
|
|
4669
|
+
return schema;
|
|
4670
|
+
}
|
|
4671
|
+
function unwrapObjectSchema(schema) {
|
|
4672
|
+
let current = schema;
|
|
4673
|
+
while (true) {
|
|
4674
|
+
switch (current._def.typeName) {
|
|
4675
|
+
case z.ZodFirstPartyTypeKind.ZodEffects:
|
|
4676
|
+
current = current._def.schema;
|
|
4677
|
+
continue;
|
|
4678
|
+
case z.ZodFirstPartyTypeKind.ZodBranded:
|
|
4679
|
+
current = current._def.type;
|
|
4680
|
+
continue;
|
|
4681
|
+
default:
|
|
4682
|
+
return current instanceof z.ZodObject ? current : void 0;
|
|
4683
|
+
}
|
|
4684
|
+
}
|
|
3916
4685
|
}
|
|
3917
4686
|
function getObjectShape(schema) {
|
|
3918
|
-
const
|
|
4687
|
+
const objectSchema = unwrapObjectSchema(schema);
|
|
4688
|
+
if (!objectSchema) {
|
|
4689
|
+
throw new Error(
|
|
4690
|
+
`Expected a Zod object schema, received ${schema._def.typeName}.`
|
|
4691
|
+
);
|
|
4692
|
+
}
|
|
4693
|
+
const shape = typeof objectSchema._def.shape === "function" ? objectSchema._def.shape() : objectSchema._def.shape;
|
|
3919
4694
|
return shape;
|
|
3920
4695
|
}
|
|
3921
4696
|
function unwrapMcpParameterSchema(schema) {
|
|
@@ -3936,6 +4711,9 @@ function unwrapMcpParameterSchema(schema) {
|
|
|
3936
4711
|
case z.ZodFirstPartyTypeKind.ZodBranded:
|
|
3937
4712
|
current = current._def.type;
|
|
3938
4713
|
continue;
|
|
4714
|
+
case z.ZodFirstPartyTypeKind.ZodEffects:
|
|
4715
|
+
current = current._def.schema;
|
|
4716
|
+
continue;
|
|
3939
4717
|
default:
|
|
3940
4718
|
return { schema: current, required, description: description ?? current.description };
|
|
3941
4719
|
}
|
|
@@ -3955,6 +4733,7 @@ function mcpParameterFromZod(fieldName, schema, contractName) {
|
|
|
3955
4733
|
return { parameter: { type: "array", description }, required };
|
|
3956
4734
|
case z.ZodFirstPartyTypeKind.ZodObject:
|
|
3957
4735
|
case z.ZodFirstPartyTypeKind.ZodRecord:
|
|
4736
|
+
case z.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
|
|
3958
4737
|
return { parameter: { type: "object", description }, required };
|
|
3959
4738
|
case z.ZodFirstPartyTypeKind.ZodEnum:
|
|
3960
4739
|
return {
|
|
@@ -3998,9 +4777,7 @@ function mcpContractFromArgsSchema(base, args, contractName) {
|
|
|
3998
4777
|
required: converted.filter(([, field]) => field.required).map(([fieldName]) => fieldName)
|
|
3999
4778
|
};
|
|
4000
4779
|
}
|
|
4001
|
-
|
|
4002
|
-
return contract;
|
|
4003
|
-
}
|
|
4780
|
+
var defineFunctionContract = (contract) => contract;
|
|
4004
4781
|
function authUserId(context) {
|
|
4005
4782
|
return context.userId ?? context.principalId ?? "lucern-agent";
|
|
4006
4783
|
}
|
|
@@ -4010,6 +4787,11 @@ function withUserId(input, context) {
|
|
|
4010
4787
|
userId: typeof input.userId === "string" ? input.userId : authUserId(context)
|
|
4011
4788
|
};
|
|
4012
4789
|
}
|
|
4790
|
+
function compactRecord(input) {
|
|
4791
|
+
return Object.fromEntries(
|
|
4792
|
+
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
4793
|
+
);
|
|
4794
|
+
}
|
|
4013
4795
|
function surfaceMcpContract(name) {
|
|
4014
4796
|
const contract = MCP_TOOL_CONTRACTS[name];
|
|
4015
4797
|
if (!contract) {
|
|
@@ -4054,7 +4836,9 @@ function surfaceContract(args) {
|
|
|
4054
4836
|
const canonicalArgs = args.args ?? argsSchemaFromMcpContract(baseMcp);
|
|
4055
4837
|
const mcp = args.args ? mcpContractFromArgsSchema(baseMcp, canonicalArgs, args.name) : baseMcp;
|
|
4056
4838
|
const canonicalReturns = args.returns ?? jsonObjectSchema;
|
|
4057
|
-
const input =
|
|
4839
|
+
const input = normalizeInputSchema(
|
|
4840
|
+
args.input ?? inputSchemaFromMcpContract(mcp)
|
|
4841
|
+
);
|
|
4058
4842
|
const output = args.output ?? canonicalReturns;
|
|
4059
4843
|
return defineFunctionContract({
|
|
4060
4844
|
name: args.name,
|
|
@@ -4098,43 +4882,281 @@ function surfaceContract(args) {
|
|
|
4098
4882
|
});
|
|
4099
4883
|
}
|
|
4100
4884
|
|
|
4885
|
+
// src/projections/projection-dsl.ts
|
|
4886
|
+
function defineProjection(def) {
|
|
4887
|
+
return def;
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4890
|
+
// src/projections/list-beliefs.projection.ts
|
|
4891
|
+
var beliefStatusSchema = z.enum(["active", "superseded", "archived", "unscored", "scored"]).optional().describe("Filter by belief lifecycle or scoring status");
|
|
4892
|
+
var listBeliefsInputSchema = z.object({
|
|
4893
|
+
topicId: z.string().describe("Topic scope"),
|
|
4894
|
+
worktreeId: z.string().optional().describe("Filter to worktree scope"),
|
|
4895
|
+
status: beliefStatusSchema,
|
|
4896
|
+
minConfidence: z.number().optional().describe("Minimum confidence threshold"),
|
|
4897
|
+
limit: z.number().optional().describe("Maximum results"),
|
|
4898
|
+
includeEdgeAssociated: z.boolean().optional().describe("Include beliefs associated to the topic through edges")
|
|
4899
|
+
});
|
|
4900
|
+
function kernelStatus(status) {
|
|
4901
|
+
return status === "active" || status === "superseded" || status === "archived" ? status : void 0;
|
|
4902
|
+
}
|
|
4903
|
+
function compactRecord2(input) {
|
|
4904
|
+
return Object.fromEntries(
|
|
4905
|
+
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
4906
|
+
);
|
|
4907
|
+
}
|
|
4908
|
+
var listBeliefsProjection = defineProjection({
|
|
4909
|
+
contractName: "list_beliefs",
|
|
4910
|
+
inputSchema: listBeliefsInputSchema,
|
|
4911
|
+
project: (input) => compactRecord2({
|
|
4912
|
+
topicId: input.topicId,
|
|
4913
|
+
status: kernelStatus(input.status),
|
|
4914
|
+
limit: input.limit,
|
|
4915
|
+
includeEdgeAssociated: input.includeEdgeAssociated
|
|
4916
|
+
}),
|
|
4917
|
+
convexArgsValidator: v.object({
|
|
4918
|
+
topicId: v.string(),
|
|
4919
|
+
status: v.optional(
|
|
4920
|
+
v.union(
|
|
4921
|
+
v.literal("active"),
|
|
4922
|
+
v.literal("superseded"),
|
|
4923
|
+
v.literal("archived")
|
|
4924
|
+
)
|
|
4925
|
+
),
|
|
4926
|
+
limit: v.optional(v.number()),
|
|
4927
|
+
includeEdgeAssociated: v.optional(v.boolean())
|
|
4928
|
+
})
|
|
4929
|
+
});
|
|
4930
|
+
var confidenceTriggerSchema = z.enum([
|
|
4931
|
+
"evidence_added",
|
|
4932
|
+
"evidence_removed",
|
|
4933
|
+
"contradiction_resolved",
|
|
4934
|
+
"agent_assessment",
|
|
4935
|
+
"worktree_outcome",
|
|
4936
|
+
"worktree_completed",
|
|
4937
|
+
"contradiction_detected",
|
|
4938
|
+
"answer_recorded",
|
|
4939
|
+
"fusion",
|
|
4940
|
+
"discount",
|
|
4941
|
+
"deduction",
|
|
4942
|
+
"backfill_synthetic"
|
|
4943
|
+
]);
|
|
4944
|
+
var provenanceSchema = z.object({
|
|
4945
|
+
evidence: z.string().optional(),
|
|
4946
|
+
question: z.string().optional(),
|
|
4947
|
+
answer: z.string().optional(),
|
|
4948
|
+
contradiction: z.string().optional(),
|
|
4949
|
+
worktree: z.string().optional()
|
|
4950
|
+
});
|
|
4951
|
+
var slOpinionProjectionSchema = z.object({
|
|
4952
|
+
belief: z.number(),
|
|
4953
|
+
disbelief: z.number(),
|
|
4954
|
+
uncertainty: z.number(),
|
|
4955
|
+
baseRate: z.number()
|
|
4956
|
+
});
|
|
4957
|
+
var modulateConfidenceInputObjectSchema = z.object({
|
|
4958
|
+
nodeId: z.string().optional(),
|
|
4959
|
+
beliefNodeId: z.string().optional(),
|
|
4960
|
+
worktreeId: z.string().optional(),
|
|
4961
|
+
opinion: slOpinionProjectionSchema.optional(),
|
|
4962
|
+
belief: z.number().optional(),
|
|
4963
|
+
disbelief: z.number().optional(),
|
|
4964
|
+
uncertainty: z.number().optional(),
|
|
4965
|
+
baseRate: z.number().optional(),
|
|
4966
|
+
trigger: confidenceTriggerSchema,
|
|
4967
|
+
provenance: provenanceSchema.optional(),
|
|
4968
|
+
triggeringEvidenceId: z.string().optional(),
|
|
4969
|
+
triggeringQuestionId: z.string().optional(),
|
|
4970
|
+
triggeringAnswerId: z.string().optional(),
|
|
4971
|
+
triggeringContradictionId: z.string().optional(),
|
|
4972
|
+
triggeringWorktreeId: z.string().optional(),
|
|
4973
|
+
rationale: z.string(),
|
|
4974
|
+
trustedBypassAccessCheck: z.boolean().optional()
|
|
4975
|
+
});
|
|
4976
|
+
var modulateConfidenceInputSchema = modulateConfidenceInputObjectSchema.superRefine((input, ctx) => {
|
|
4977
|
+
if (hasProvenance(input)) {
|
|
4978
|
+
return;
|
|
4979
|
+
}
|
|
4980
|
+
ctx.addIssue({
|
|
4981
|
+
code: z.ZodIssueCode.custom,
|
|
4982
|
+
message: "modulate_confidence requires evidence, question, answer, contradiction, or worktree provenance",
|
|
4983
|
+
path: ["provenance"]
|
|
4984
|
+
});
|
|
4985
|
+
});
|
|
4986
|
+
var modulateConfidenceProjection = defineProjection({
|
|
4987
|
+
contractName: "modulate_confidence",
|
|
4988
|
+
inputSchema: modulateConfidenceInputSchema,
|
|
4989
|
+
project: (input) => {
|
|
4990
|
+
const nodeId = input.beliefNodeId ?? input.nodeId;
|
|
4991
|
+
if (!nodeId) {
|
|
4992
|
+
throw new Error("modulate_confidence requires beliefNodeId or nodeId");
|
|
4993
|
+
}
|
|
4994
|
+
const opinion = input.opinion ?? {
|
|
4995
|
+
belief: requireNumber(input.belief, "belief"),
|
|
4996
|
+
disbelief: requireNumber(input.disbelief, "disbelief"),
|
|
4997
|
+
uncertainty: requireNumber(input.uncertainty, "uncertainty"),
|
|
4998
|
+
baseRate: requireNumber(input.baseRate, "baseRate")
|
|
4999
|
+
};
|
|
5000
|
+
assertProvenance(input);
|
|
5001
|
+
return {
|
|
5002
|
+
nodeId,
|
|
5003
|
+
worktreeId: input.worktreeId,
|
|
5004
|
+
belief: opinion.belief,
|
|
5005
|
+
disbelief: opinion.disbelief,
|
|
5006
|
+
uncertainty: opinion.uncertainty,
|
|
5007
|
+
baseRate: opinion.baseRate,
|
|
5008
|
+
trigger: input.trigger === "answer_recorded" ? "agent_assessment" : input.trigger,
|
|
5009
|
+
triggeringEvidenceId: input.provenance?.evidence ?? input.triggeringEvidenceId,
|
|
5010
|
+
triggeringQuestionId: input.provenance?.question ?? input.triggeringQuestionId,
|
|
5011
|
+
triggeringAnswerId: input.provenance?.answer ?? input.triggeringAnswerId,
|
|
5012
|
+
triggeringContradictionId: input.provenance?.contradiction ?? input.triggeringContradictionId,
|
|
5013
|
+
triggeringWorktreeId: input.provenance?.worktree ?? input.triggeringWorktreeId,
|
|
5014
|
+
rationale: input.rationale,
|
|
5015
|
+
trustedBypassAccessCheck: input.trustedBypassAccessCheck ?? true
|
|
5016
|
+
};
|
|
5017
|
+
},
|
|
5018
|
+
convexArgsValidator: v.object({
|
|
5019
|
+
nodeId: v.string(),
|
|
5020
|
+
worktreeId: v.optional(v.string()),
|
|
5021
|
+
belief: v.number(),
|
|
5022
|
+
disbelief: v.number(),
|
|
5023
|
+
uncertainty: v.number(),
|
|
5024
|
+
baseRate: v.number(),
|
|
5025
|
+
trigger: v.union(
|
|
5026
|
+
v.literal("evidence_added"),
|
|
5027
|
+
v.literal("evidence_removed"),
|
|
5028
|
+
v.literal("worktree_completed"),
|
|
5029
|
+
v.literal("contradiction_detected"),
|
|
5030
|
+
v.literal("contradiction_resolved"),
|
|
5031
|
+
v.literal("agent_assessment"),
|
|
5032
|
+
v.literal("worktree_outcome"),
|
|
5033
|
+
v.literal("fusion"),
|
|
5034
|
+
v.literal("discount"),
|
|
5035
|
+
v.literal("deduction"),
|
|
5036
|
+
v.literal("backfill_synthetic")
|
|
5037
|
+
),
|
|
5038
|
+
triggeringEvidenceId: v.optional(v.string()),
|
|
5039
|
+
triggeringQuestionId: v.optional(v.string()),
|
|
5040
|
+
triggeringAnswerId: v.optional(v.string()),
|
|
5041
|
+
triggeringContradictionId: v.optional(v.string()),
|
|
5042
|
+
triggeringWorktreeId: v.optional(v.string()),
|
|
5043
|
+
rationale: v.string(),
|
|
5044
|
+
trustedBypassAccessCheck: v.optional(v.boolean())
|
|
5045
|
+
})
|
|
5046
|
+
});
|
|
5047
|
+
function requireNumber(value, field) {
|
|
5048
|
+
if (value === void 0) {
|
|
5049
|
+
throw new Error(`modulate_confidence requires ${field}`);
|
|
5050
|
+
}
|
|
5051
|
+
return value;
|
|
5052
|
+
}
|
|
5053
|
+
function assertProvenance(input) {
|
|
5054
|
+
if (!hasProvenance(input)) {
|
|
5055
|
+
throw new Error(
|
|
5056
|
+
"modulate_confidence requires evidence, question, answer, contradiction, or worktree provenance"
|
|
5057
|
+
);
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
5060
|
+
function hasProvenance(input) {
|
|
5061
|
+
return input.trigger === "backfill_synthetic" || Boolean(input.provenance && Object.values(input.provenance).some(Boolean)) || Boolean(input.triggeringEvidenceId) || Boolean(input.triggeringQuestionId) || Boolean(input.triggeringAnswerId) || Boolean(input.triggeringContradictionId) || Boolean(input.triggeringWorktreeId);
|
|
5062
|
+
}
|
|
5063
|
+
|
|
4101
5064
|
// src/function-registry/beliefs.ts
|
|
4102
|
-
var
|
|
4103
|
-
|
|
5065
|
+
var jsonRecordSchema = z.record(z.unknown());
|
|
5066
|
+
var sourceTypeSchema = z.enum(["human", "ai_extracted", "ai_generated"]);
|
|
5067
|
+
var reversibilitySchema = z.enum([
|
|
5068
|
+
"irreversible",
|
|
5069
|
+
"hard_to_reverse",
|
|
5070
|
+
"reversible",
|
|
5071
|
+
"trivial"
|
|
5072
|
+
]);
|
|
5073
|
+
var predictionMetaSchema = z.object({
|
|
5074
|
+
isPrediction: z.boolean().describe("Whether this belief is a prediction."),
|
|
5075
|
+
registeredAt: z.number().describe("Timestamp when the prediction was registered."),
|
|
5076
|
+
expectedBy: z.number().optional().describe("Timestamp when the prediction should be evaluated.")
|
|
5077
|
+
});
|
|
5078
|
+
var createBeliefArgs = z.object({
|
|
5079
|
+
canonicalText: z.string().describe("The belief statement the agent holds to be true."),
|
|
5080
|
+
topicId: z.string().optional().describe("Topic scope hint for the belief."),
|
|
5081
|
+
baseRate: z.number().optional().describe("Prior base rate used to seed the vacuous opinion."),
|
|
5082
|
+
beliefType: z.string().optional().describe("Schema belief type."),
|
|
5083
|
+
metadata: jsonRecordSchema.optional().describe("Extra metadata merged into the belief node."),
|
|
5084
|
+
rationale: z.string().optional().describe("Why this belief should enter the reasoning graph."),
|
|
5085
|
+
pillar: z.string().optional().describe("Innovation pillar or product pillar associated with the belief."),
|
|
5086
|
+
worktreeId: z.string().optional().describe("Worktree responsible for creating or testing this belief."),
|
|
5087
|
+
sourceBeliefIds: z.array(z.string()).optional().describe("Source belief IDs this belief derives from."),
|
|
5088
|
+
sourceType: sourceTypeSchema.optional().describe("Actor/source class that produced the belief."),
|
|
5089
|
+
reversibility: reversibilitySchema.optional().describe("How reversible the belief's implied decision is."),
|
|
5090
|
+
predictionMeta: predictionMetaSchema.optional().describe("Prediction lifecycle metadata when this belief is a forecast.")
|
|
5091
|
+
});
|
|
5092
|
+
var forkBeliefArgs = z.object({
|
|
5093
|
+
nodeId: z.string().describe("The scored belief to fork from."),
|
|
5094
|
+
newFormulation: z.string().describe("The evolved belief statement."),
|
|
5095
|
+
forkReason: z.enum([
|
|
5096
|
+
"refinement",
|
|
5097
|
+
"contradiction_response",
|
|
5098
|
+
"scope_change",
|
|
5099
|
+
"confidence_collapse",
|
|
5100
|
+
"manual"
|
|
5101
|
+
]).describe("Why this fork was created."),
|
|
5102
|
+
rationale: z.string().optional().describe("Why the fork is warranted.")
|
|
5103
|
+
});
|
|
5104
|
+
var beliefLookupInput = (input) => compactRecord({
|
|
4104
5105
|
nodeId: input.nodeId ?? input.id ?? input.beliefId,
|
|
4105
|
-
beliefId: input.beliefId
|
|
5106
|
+
beliefId: input.beliefId
|
|
4106
5107
|
});
|
|
4107
|
-
var
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
);
|
|
5108
|
+
var beliefNodeInput = (input) => compactRecord({
|
|
5109
|
+
nodeId: input.nodeId ?? input.id ?? input.beliefId
|
|
5110
|
+
});
|
|
5111
|
+
var beliefTopicInput = (input) => {
|
|
5112
|
+
const parsed = listBeliefsProjection.inputSchema.safeParse(input);
|
|
5113
|
+
if (!parsed.success) {
|
|
5114
|
+
throw new Error(
|
|
5115
|
+
`list_beliefs projection input rejected: ${parsed.error.message}`
|
|
5116
|
+
);
|
|
5117
|
+
}
|
|
5118
|
+
return compactRecord(listBeliefsProjection.project(parsed.data));
|
|
5119
|
+
};
|
|
5120
|
+
var createBeliefInput = (input, context) => {
|
|
5121
|
+
return withUserId(
|
|
5122
|
+
compactRecord({
|
|
5123
|
+
projectId: input.projectId,
|
|
5124
|
+
topicId: input.topicId,
|
|
5125
|
+
formulation: input.formulation ?? input.canonicalText,
|
|
5126
|
+
beliefType: input.beliefType,
|
|
5127
|
+
rationale: input.rationale,
|
|
5128
|
+
pillar: input.pillar,
|
|
5129
|
+
worktreeId: input.worktreeId,
|
|
5130
|
+
sourceBeliefIds: input.sourceBeliefIds,
|
|
5131
|
+
sourceType: input.sourceType,
|
|
5132
|
+
reversibility: input.reversibility,
|
|
5133
|
+
predictionMeta: input.predictionMeta,
|
|
5134
|
+
baseRate: input.baseRate ?? 0.5,
|
|
5135
|
+
metadata: input.metadata,
|
|
5136
|
+
trustedBypassAccessCheck: input.trustedBypassAccessCheck ?? true
|
|
5137
|
+
}),
|
|
5138
|
+
context
|
|
5139
|
+
);
|
|
5140
|
+
};
|
|
4116
5141
|
var forkBeliefInput = (input, context) => withUserId(
|
|
4117
|
-
{
|
|
4118
|
-
...input,
|
|
5142
|
+
compactRecord({
|
|
4119
5143
|
parentNodeId: input.parentNodeId ?? input.nodeId ?? input.id,
|
|
5144
|
+
newFormulation: input.newFormulation,
|
|
5145
|
+
forkReason: input.forkReason,
|
|
5146
|
+
rationale: input.rationale,
|
|
4120
5147
|
trustedBypassAccessCheck: input.trustedBypassAccessCheck ?? true
|
|
4121
|
-
},
|
|
5148
|
+
}),
|
|
4122
5149
|
context
|
|
4123
5150
|
);
|
|
4124
5151
|
var confidenceInput = (input, context) => {
|
|
4125
|
-
const
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
5152
|
+
const parsed = modulateConfidenceProjection.inputSchema.safeParse(input);
|
|
5153
|
+
if (!parsed.success) {
|
|
5154
|
+
throw new Error(
|
|
5155
|
+
`modulate_confidence projection input rejected: ${parsed.error.message}`
|
|
5156
|
+
);
|
|
5157
|
+
}
|
|
4129
5158
|
return withUserId(
|
|
4130
|
-
|
|
4131
|
-
...input,
|
|
4132
|
-
belief,
|
|
4133
|
-
disbelief,
|
|
4134
|
-
uncertainty,
|
|
4135
|
-
baseRate: input.baseRate ?? 0.5,
|
|
4136
|
-
trustedBypassAccessCheck: input.trustedBypassAccessCheck ?? true
|
|
4137
|
-
},
|
|
5159
|
+
compactRecord(modulateConfidenceProjection.project(parsed.data)),
|
|
4138
5160
|
context
|
|
4139
5161
|
);
|
|
4140
5162
|
};
|
|
@@ -4153,7 +5175,8 @@ var beliefsContracts = [
|
|
|
4153
5175
|
functionName: "create",
|
|
4154
5176
|
kind: "mutation",
|
|
4155
5177
|
inputProjection: createBeliefInput
|
|
4156
|
-
}
|
|
5178
|
+
},
|
|
5179
|
+
args: createBeliefArgs
|
|
4157
5180
|
}),
|
|
4158
5181
|
surfaceContract({
|
|
4159
5182
|
name: "get_belief",
|
|
@@ -4169,7 +5192,7 @@ var beliefsContracts = [
|
|
|
4169
5192
|
module: "beliefs",
|
|
4170
5193
|
functionName: "getById",
|
|
4171
5194
|
kind: "query",
|
|
4172
|
-
inputProjection:
|
|
5195
|
+
inputProjection: beliefLookupInput
|
|
4173
5196
|
}
|
|
4174
5197
|
}),
|
|
4175
5198
|
surfaceContract({
|
|
@@ -4185,8 +5208,10 @@ var beliefsContracts = [
|
|
|
4185
5208
|
convex: {
|
|
4186
5209
|
module: "beliefs",
|
|
4187
5210
|
functionName: "getByTopic",
|
|
4188
|
-
kind: "query"
|
|
4189
|
-
|
|
5211
|
+
kind: "query",
|
|
5212
|
+
inputProjection: beliefTopicInput
|
|
5213
|
+
},
|
|
5214
|
+
args: listBeliefsInputSchema
|
|
4190
5215
|
}),
|
|
4191
5216
|
surfaceContract({
|
|
4192
5217
|
name: "refine_belief",
|
|
@@ -4204,7 +5229,7 @@ var beliefsContracts = [
|
|
|
4204
5229
|
kind: "mutation",
|
|
4205
5230
|
inputProjection: (input, context) => withUserId(
|
|
4206
5231
|
{
|
|
4207
|
-
...
|
|
5232
|
+
...beliefLookupInput(input),
|
|
4208
5233
|
trustedBypassAccessCheck: input.trustedBypassAccessCheck ?? true
|
|
4209
5234
|
},
|
|
4210
5235
|
context
|
|
@@ -4225,7 +5250,8 @@ var beliefsContracts = [
|
|
|
4225
5250
|
functionName: "modulateConfidence",
|
|
4226
5251
|
kind: "mutation",
|
|
4227
5252
|
inputProjection: confidenceInput
|
|
4228
|
-
}
|
|
5253
|
+
},
|
|
5254
|
+
args: modulateConfidenceInputSchema
|
|
4229
5255
|
}),
|
|
4230
5256
|
surfaceContract({
|
|
4231
5257
|
name: "fork_belief",
|
|
@@ -4241,7 +5267,8 @@ var beliefsContracts = [
|
|
|
4241
5267
|
functionName: "forkBelief",
|
|
4242
5268
|
kind: "mutation",
|
|
4243
5269
|
inputProjection: forkBeliefInput
|
|
4244
|
-
}
|
|
5270
|
+
},
|
|
5271
|
+
args: forkBeliefArgs
|
|
4245
5272
|
}),
|
|
4246
5273
|
surfaceContract({
|
|
4247
5274
|
name: "archive_belief",
|
|
@@ -4258,10 +5285,10 @@ var beliefsContracts = [
|
|
|
4258
5285
|
functionName: "archive",
|
|
4259
5286
|
kind: "mutation",
|
|
4260
5287
|
inputProjection: (input, context) => withUserId(
|
|
4261
|
-
{
|
|
4262
|
-
...
|
|
5288
|
+
compactRecord({
|
|
5289
|
+
...beliefNodeInput(input),
|
|
4263
5290
|
reason: input.reason ?? input.rationale
|
|
4264
|
-
},
|
|
5291
|
+
}),
|
|
4265
5292
|
context
|
|
4266
5293
|
)
|
|
4267
5294
|
}
|
|
@@ -4279,10 +5306,12 @@ var beliefsContracts = [
|
|
|
4279
5306
|
module: "nodes",
|
|
4280
5307
|
functionName: "search",
|
|
4281
5308
|
kind: "query",
|
|
4282
|
-
inputProjection: (input) => ({
|
|
4283
|
-
...input,
|
|
5309
|
+
inputProjection: (input) => compactRecord({
|
|
4284
5310
|
searchQuery: input.searchQuery ?? input.query,
|
|
4285
|
-
|
|
5311
|
+
projectId: input.projectId,
|
|
5312
|
+
topicId: input.topicId,
|
|
5313
|
+
nodeType: "belief",
|
|
5314
|
+
limit: input.limit
|
|
4286
5315
|
})
|
|
4287
5316
|
}
|
|
4288
5317
|
}),
|
|
@@ -4299,7 +5328,7 @@ var beliefsContracts = [
|
|
|
4299
5328
|
module: "beliefs",
|
|
4300
5329
|
functionName: "getConfidenceHistory",
|
|
4301
5330
|
kind: "query",
|
|
4302
|
-
inputProjection:
|
|
5331
|
+
inputProjection: beliefNodeInput
|
|
4303
5332
|
}
|
|
4304
5333
|
}),
|
|
4305
5334
|
surfaceContract({
|
|
@@ -4316,7 +5345,7 @@ var beliefsContracts = [
|
|
|
4316
5345
|
module: "beliefs",
|
|
4317
5346
|
functionName: "getConfidenceHistory",
|
|
4318
5347
|
kind: "query",
|
|
4319
|
-
inputProjection:
|
|
5348
|
+
inputProjection: beliefNodeInput
|
|
4320
5349
|
}
|
|
4321
5350
|
})
|
|
4322
5351
|
];
|