@lucern/contracts 0.3.0-alpha.3 → 0.3.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/component-host-boundary.contract.d.ts +41 -0
  2. package/dist/component-host-boundary.contract.js +54 -0
  3. package/dist/component-host-boundary.contract.js.map +1 -0
  4. package/dist/edge-policy-manifest-DpmTtjmm.d.ts +132 -0
  5. package/dist/function-registry/beliefs.d.ts +41 -41
  6. package/dist/function-registry/beliefs.js +274 -8
  7. package/dist/function-registry/beliefs.js.map +1 -1
  8. package/dist/function-registry/coding.js +259 -8
  9. package/dist/function-registry/coding.js.map +1 -1
  10. package/dist/function-registry/context.d.ts +13 -13
  11. package/dist/function-registry/context.js +259 -9
  12. package/dist/function-registry/context.js.map +1 -1
  13. package/dist/function-registry/contracts.js +230 -5
  14. package/dist/function-registry/contracts.js.map +1 -1
  15. package/dist/function-registry/coordination.js +230 -5
  16. package/dist/function-registry/coordination.js.map +1 -1
  17. package/dist/function-registry/edges.js +241 -6
  18. package/dist/function-registry/edges.js.map +1 -1
  19. package/dist/function-registry/evidence.d.ts +33 -33
  20. package/dist/function-registry/evidence.js +274 -9
  21. package/dist/function-registry/evidence.js.map +1 -1
  22. package/dist/function-registry/graph.d.ts +131 -53
  23. package/dist/function-registry/graph.js +346 -12
  24. package/dist/function-registry/graph.js.map +1 -1
  25. package/dist/function-registry/helpers.d.ts +1 -1
  26. package/dist/function-registry/helpers.js +230 -5
  27. package/dist/function-registry/helpers.js.map +1 -1
  28. package/dist/function-registry/identity.js +230 -5
  29. package/dist/function-registry/identity.js.map +1 -1
  30. package/dist/function-registry/index.d.ts +1 -1
  31. package/dist/function-registry/index.js +230 -5
  32. package/dist/function-registry/index.js.map +1 -1
  33. package/dist/function-registry/judgments.d.ts +9 -9
  34. package/dist/function-registry/judgments.js +242 -8
  35. package/dist/function-registry/judgments.js.map +1 -1
  36. package/dist/function-registry/legacy.js +230 -5
  37. package/dist/function-registry/legacy.js.map +1 -1
  38. package/dist/function-registry/lenses.d.ts +17 -17
  39. package/dist/function-registry/lenses.js +253 -8
  40. package/dist/function-registry/lenses.js.map +1 -1
  41. package/dist/function-registry/manifest.d.ts +5 -5
  42. package/dist/function-registry/manifest.js +3 -1
  43. package/dist/function-registry/manifest.js.map +1 -1
  44. package/dist/function-registry/ontologies.d.ts +45 -45
  45. package/dist/function-registry/ontologies.js +248 -11
  46. package/dist/function-registry/ontologies.js.map +1 -1
  47. package/dist/function-registry/pipeline.d.ts +13 -13
  48. package/dist/function-registry/pipeline.js +239 -8
  49. package/dist/function-registry/pipeline.js.map +1 -1
  50. package/dist/function-registry/questions.d.ts +49 -49
  51. package/dist/function-registry/questions.js +327 -13
  52. package/dist/function-registry/questions.js.map +1 -1
  53. package/dist/function-registry/tasks.js +230 -5
  54. package/dist/function-registry/tasks.js.map +1 -1
  55. package/dist/function-registry/topics.d.ts +21 -21
  56. package/dist/function-registry/topics.js +244 -8
  57. package/dist/function-registry/topics.js.map +1 -1
  58. package/dist/function-registry/types.d.ts +1 -1
  59. package/dist/function-registry/worktrees.d.ts +80 -41
  60. package/dist/function-registry/worktrees.js +364 -17
  61. package/dist/function-registry/worktrees.js.map +1 -1
  62. package/dist/function-registry-input-audit.d.ts +13 -0
  63. package/dist/function-registry-input-audit.js +164 -0
  64. package/dist/function-registry-input-audit.js.map +1 -0
  65. package/dist/gateway.contract.d.ts +1 -0
  66. package/dist/gateway.contract.js.map +1 -1
  67. package/dist/generated/convexSchemas.js +2 -2
  68. package/dist/generated/convexSchemas.js.map +1 -1
  69. package/dist/graph-intelligence.contract.d.ts +506 -0
  70. package/dist/graph-intelligence.contract.js +595 -0
  71. package/dist/graph-intelligence.contract.js.map +1 -0
  72. package/dist/graph-types/index.d.ts +5 -1
  73. package/dist/graph-types/index.js +15 -4
  74. package/dist/graph-types/index.js.map +1 -1
  75. package/dist/{index-CV-0_VWJ.d.ts → index-O09U2xHk.d.ts} +5 -2
  76. package/dist/index.d.ts +21 -667
  77. package/dist/index.js +2139 -52
  78. package/dist/index.js.map +1 -1
  79. package/dist/infisical-runtime.contract.d.ts +174 -0
  80. package/dist/infisical-runtime.contract.js +312 -0
  81. package/dist/infisical-runtime.contract.js.map +1 -0
  82. package/dist/manifests/edge-policy-manifest.d.ts +2 -0
  83. package/dist/manifests/edge-policy-manifest.data.d.ts +27 -0
  84. package/dist/manifests/edge-policy-manifest.data.js +34 -0
  85. package/dist/manifests/edge-policy-manifest.data.js.map +1 -0
  86. package/dist/manifests/edge-policy-manifest.js +65 -0
  87. package/dist/manifests/edge-policy-manifest.js.map +1 -0
  88. package/dist/manifests/infisical-runtime-manifest.d.ts +151 -0
  89. package/dist/manifests/infisical-runtime-manifest.js +311 -0
  90. package/dist/manifests/infisical-runtime-manifest.js.map +1 -0
  91. package/dist/manifests/invariant-manifest.d.ts +65 -0
  92. package/dist/manifests/invariant-manifest.js +18 -0
  93. package/dist/manifests/invariant-manifest.js.map +1 -0
  94. package/dist/manifests/invariants/ast-utils.d.ts +14 -0
  95. package/dist/manifests/invariants/ast-utils.js +54 -0
  96. package/dist/manifests/invariants/ast-utils.js.map +1 -0
  97. package/dist/manifests/invariants/index.d.ts +15 -0
  98. package/dist/manifests/invariants/index.js +183 -0
  99. package/dist/manifests/invariants/index.js.map +1 -0
  100. package/dist/manifests/invariants/inv-1-beliefs-append-only.d.ts +12 -0
  101. package/dist/manifests/invariants/inv-1-beliefs-append-only.js +94 -0
  102. package/dist/manifests/invariants/inv-1-beliefs-append-only.js.map +1 -0
  103. package/dist/manifests/invariants/inv-14-no-silent-transitions.d.ts +12 -0
  104. package/dist/manifests/invariants/inv-14-no-silent-transitions.js +99 -0
  105. package/dist/manifests/invariants/inv-14-no-silent-transitions.js.map +1 -0
  106. package/dist/manifests/invariants/manifest-1-projections-declare-audit.d.ts +12 -0
  107. package/dist/manifests/invariants/manifest-1-projections-declare-audit.js +42 -0
  108. package/dist/manifests/invariants/manifest-1-projections-declare-audit.js.map +1 -0
  109. package/dist/manifests/tenant-client-manifest.d.ts +303 -0
  110. package/dist/manifests/tenant-client-manifest.js +409 -0
  111. package/dist/manifests/tenant-client-manifest.js.map +1 -0
  112. package/dist/projections/check-convex-args-shape.d.ts +3 -0
  113. package/dist/projections/check-convex-args-shape.js +396 -0
  114. package/dist/projections/check-convex-args-shape.js.map +1 -0
  115. package/dist/projections/create-evidence.projection.d.ts +176 -0
  116. package/dist/projections/create-evidence.projection.js +128 -0
  117. package/dist/projections/create-evidence.projection.js.map +1 -0
  118. package/dist/projections/index.d.ts +102 -0
  119. package/dist/projections/index.js +345 -0
  120. package/dist/projections/index.js.map +1 -0
  121. package/dist/projections/list-beliefs.projection.d.ts +36 -0
  122. package/dist/projections/list-beliefs.projection.js +54 -0
  123. package/dist/projections/list-beliefs.projection.js.map +1 -0
  124. package/dist/projections/list-tasks.projection.d.ts +32 -0
  125. package/dist/projections/list-tasks.projection.js +52 -0
  126. package/dist/projections/list-tasks.projection.js.map +1 -0
  127. package/dist/projections/modulate-confidence.projection.d.ts +219 -0
  128. package/dist/projections/modulate-confidence.projection.js +148 -0
  129. package/dist/projections/modulate-confidence.projection.js.map +1 -0
  130. package/dist/projections/projection-dsl.d.ts +11 -0
  131. package/dist/projections/projection-dsl.js +8 -0
  132. package/dist/projections/projection-dsl.js.map +1 -0
  133. package/dist/schemas/enums.d.ts +5 -2
  134. package/dist/schemas/enums.js +5 -2
  135. package/dist/schemas/enums.js.map +1 -1
  136. package/dist/schemas/index.d.ts +1 -1
  137. package/dist/schemas/index.js +9 -4
  138. package/dist/schemas/index.js.map +1 -1
  139. package/dist/schemas/manifest.d.ts +940 -910
  140. package/dist/schemas/manifest.js +8 -3
  141. package/dist/schemas/manifest.js.map +1 -1
  142. package/dist/schemas/sl-opinion.d.ts +4 -4
  143. package/dist/schemas/tables/identity/platform.d.ts +10 -10
  144. package/dist/schemas/tables/kernel/epistemic.d.ts +6 -6
  145. package/dist/schemas/tables/kernel/infra.d.ts +4 -4
  146. package/dist/schemas/tables/kernel/intelligence.d.ts +10 -10
  147. package/dist/schemas/tables/kernel/lens.d.ts +4 -4
  148. package/dist/schemas/tables/kernel/platform.d.ts +12 -12
  149. package/dist/schemas/tables/kernel/spine.d.ts +3 -3
  150. package/dist/schemas/tables/kernel/spine.js +5 -2
  151. package/dist/schemas/tables/kernel/spine.js.map +1 -1
  152. package/dist/schemas/tables/kernel/task.d.ts +42 -42
  153. package/dist/schemas/tables/kernel/topic.js +4 -1
  154. package/dist/schemas/tables/kernel/topic.js.map +1 -1
  155. package/dist/schemas/tables/kernel/worktree.d.ts +62 -62
  156. package/dist/schemas/tables/mc/identity.d.ts +2 -2
  157. package/dist/schemas/tables/mc/pack.d.ts +20 -20
  158. package/dist/schemas/tables/mc/registry.d.ts +4 -4
  159. package/dist/schemas/tables/mc/workspace.d.ts +9 -3
  160. package/dist/schemas/tables/mc/workspace.js +3 -1
  161. package/dist/schemas/tables/mc/workspace.js.map +1 -1
  162. package/dist/sdk-methods.contract.d.ts +1 -1
  163. package/dist/{sdk-tools.contract-S4ia0TTo.d.ts → sdk-tools.contract-Ng8ULxjr.d.ts} +1 -1
  164. package/dist/sdk-tools.contract.d.ts +2 -2
  165. package/dist/sdk-tools.contract.js +227 -4
  166. package/dist/sdk-tools.contract.js.map +1 -1
  167. package/dist/tenant-bootstrap-seed.contract.d.ts +1101 -0
  168. package/dist/tenant-bootstrap-seed.contract.js +653 -0
  169. package/dist/tenant-bootstrap-seed.contract.js.map +1 -0
  170. package/dist/tenant-bootstrap-seed.defaults.d.ts +16 -0
  171. package/dist/tenant-bootstrap-seed.defaults.js +303 -0
  172. package/dist/tenant-bootstrap-seed.defaults.js.map +1 -0
  173. package/dist/tenant-client.contract.d.ts +69 -5
  174. package/dist/tenant-client.contract.js +65 -4
  175. package/dist/tenant-client.contract.js.map +1 -1
  176. package/dist/{tool-contracts-C92-9ueT.d.ts → tool-contracts-CYXVPN4K.d.ts} +8 -2
  177. package/dist/tool-contracts.d.ts +1 -1
  178. package/dist/tool-contracts.js +228 -5
  179. package/dist/tool-contracts.js.map +1 -1
  180. package/package.json +9 -1
@@ -422,6 +422,14 @@ var ADD_WORKTREE = {
422
422
  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.",
423
423
  parameters: {
424
424
  title: { type: "string", description: "Worktree name/objective" },
425
+ name: {
426
+ type: "string",
427
+ description: "Optional storage-name alias for callers that already use backend naming"
428
+ },
429
+ projectId: {
430
+ type: "string",
431
+ description: "Legacy topicId alias"
432
+ },
425
433
  topicId: { type: "string", description: "Optional topic scope hint" },
426
434
  branchId: {
427
435
  type: "string",
@@ -435,14 +443,87 @@ var ADD_WORKTREE = {
435
443
  type: "string",
436
444
  description: "The testable claim this worktree investigates"
437
445
  },
446
+ rationale: {
447
+ type: "string",
448
+ description: "Why this worktree exists and why it belongs in the campaign"
449
+ },
450
+ worktreeType: {
451
+ type: "string",
452
+ description: "Schema-enum worktree type used by the kernel lifecycle and retrieval layers"
453
+ },
454
+ gate: {
455
+ type: "string",
456
+ description: "Exit gate name for this worktree"
457
+ },
458
+ startDate: {
459
+ type: "number",
460
+ description: "Planned start timestamp in milliseconds since epoch"
461
+ },
462
+ endDate: {
463
+ type: "number",
464
+ description: "Planned end timestamp in milliseconds since epoch"
465
+ },
466
+ durationWeeks: {
467
+ type: "number",
468
+ description: "Planned duration in weeks"
469
+ },
470
+ confidenceImpact: {
471
+ type: "string",
472
+ description: "Expected confidence impact if the worktree succeeds",
473
+ enum: ["high", "medium", "low"]
474
+ },
475
+ beliefFocus: {
476
+ type: "string",
477
+ description: "Natural-language focus spanning the target belief neighborhood"
478
+ },
438
479
  beliefIds: {
439
480
  type: "array",
440
- description: "Beliefs to test in this worktree"
481
+ description: "Legacy alias for targetBeliefIds"
482
+ },
483
+ beliefs: {
484
+ type: "array",
485
+ description: "Legacy alias for targetBeliefIds"
486
+ },
487
+ targetBeliefIds: {
488
+ type: "array",
489
+ description: "Belief node IDs this worktree is expected to test or update"
490
+ },
491
+ targetQuestionIds: {
492
+ type: "array",
493
+ description: "Question node IDs this worktree is expected to answer"
494
+ },
495
+ keyQuestions: {
496
+ type: "array",
497
+ description: "Inline key question objects with question, optional status, answer, answerConfidence, and linkedQuestionId"
498
+ },
499
+ evidenceSignals: {
500
+ type: "array",
501
+ description: "Evidence signal objects with signal, optional collected state, progress, and notes"
502
+ },
503
+ decisionGate: {
504
+ type: "object",
505
+ description: "Decision gate object with goCriteria, noGoSignals, optional verdict, rationale, decidedAt, and decidedBy"
506
+ },
507
+ goCriteria: {
508
+ type: "array",
509
+ description: "Shorthand go criteria used to build decisionGate"
510
+ },
511
+ noGoSignals: {
512
+ type: "array",
513
+ description: "Shorthand no-go signals used to build decisionGate"
514
+ },
515
+ proofArtifacts: {
516
+ type: "array",
517
+ description: "Expected proof artifacts required to close the worktree"
441
518
  },
442
519
  autoShape: {
443
520
  type: "boolean",
444
521
  description: "Whether to invoke inquiry auto-shaping during worktree creation"
445
522
  },
523
+ autoFixPolicy: {
524
+ type: "object",
525
+ description: "Policy for permitted automatic remediation inside the worktree"
526
+ },
446
527
  domainPackId: {
447
528
  type: "string",
448
529
  description: "Optional domain pack whose shaping hooks should influence generated questions and tasks"
@@ -471,9 +552,17 @@ var ADD_WORKTREE = {
471
552
  type: "array",
472
553
  description: "Worktree IDs blocked by this worktree"
473
554
  },
474
- gate: {
555
+ staffingHint: {
475
556
  type: "string",
476
- description: "Exit gate name for this worktree"
557
+ description: "Suggested staffing or agent allocation note"
558
+ },
559
+ lensId: {
560
+ type: "string",
561
+ description: "Lens that scopes this worktree when applicable"
562
+ },
563
+ lastReconciledAt: {
564
+ type: "number",
565
+ description: "Timestamp when worktree metadata was last reconciled"
477
566
  }
478
567
  },
479
568
  required: ["title", "topicId"],
@@ -503,7 +592,7 @@ var MERGE = {
503
592
  worktreeId: { type: "string", description: "The worktree to merge" },
504
593
  outcomes: {
505
594
  type: "array",
506
- description: "Scoring outcomes for each belief: { beliefId, confidence, rationale }"
595
+ description: "Merge outcomes as key-finding strings, or scoring outcomes for beliefs: { beliefId, confidence, rationale }"
507
596
  },
508
597
  summary: { type: "string", description: "Overall findings summary" }
509
598
  },
@@ -1057,6 +1146,74 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
1057
1146
  ontologyPrimitive: "graph",
1058
1147
  tier: "showcase"
1059
1148
  };
1149
+ var LIST_GRAPH_INTELLIGENCE_QUERIES = {
1150
+ name: "list_graph_intelligence_queries",
1151
+ 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.",
1152
+ parameters: {
1153
+ categoryId: {
1154
+ type: "string",
1155
+ description: "Optional category filter, such as problems or strategic"
1156
+ },
1157
+ mode: {
1158
+ type: "string",
1159
+ description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
1160
+ }
1161
+ },
1162
+ required: [],
1163
+ response: {
1164
+ description: "Graph Intelligence query catalog and mode-to-tool mapping",
1165
+ fields: {
1166
+ categories: "array \u2014 query categories",
1167
+ queries: "array \u2014 query definitions with prompt templates and tools",
1168
+ quickQueries: "array \u2014 recommended one-click query presets",
1169
+ publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
1170
+ }
1171
+ },
1172
+ ownerModule: "graph-intelligence",
1173
+ ontologyPrimitive: "graph",
1174
+ tier: "showcase"
1175
+ };
1176
+ var RUN_GRAPH_INTELLIGENCE_QUERY = {
1177
+ name: "run_graph_intelligence_query",
1178
+ 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.",
1179
+ parameters: {
1180
+ topicId: { type: "string", description: "Topic to analyze" },
1181
+ queryId: {
1182
+ type: "string",
1183
+ description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
1184
+ },
1185
+ prompt: {
1186
+ type: "string",
1187
+ description: "Optional custom prompt for custom analysis runs"
1188
+ },
1189
+ input: {
1190
+ type: "string",
1191
+ description: "Optional entity, theme, belief, company, or search text for input-driven queries"
1192
+ },
1193
+ mode: {
1194
+ type: "string",
1195
+ description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
1196
+ },
1197
+ limit: {
1198
+ type: "number",
1199
+ description: "Maximum graph context rows to return"
1200
+ }
1201
+ },
1202
+ required: ["topicId"],
1203
+ response: {
1204
+ description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
1205
+ fields: {
1206
+ query: "object \u2014 selected query definition",
1207
+ prompt: "string \u2014 resolved prompt template",
1208
+ toolPlan: "array \u2014 public tools and args the model can call next",
1209
+ analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
1210
+ context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
1211
+ }
1212
+ },
1213
+ ownerModule: "graph-intelligence",
1214
+ ontologyPrimitive: "graph",
1215
+ tier: "showcase"
1216
+ };
1060
1217
  var GET_FALSIFICATION_QUESTIONS = {
1061
1218
  name: "get_falsification_questions",
1062
1219
  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.",
@@ -3522,6 +3679,69 @@ var GENERATE_SESSION_HANDOFF = {
3522
3679
  tier: "showcase",
3523
3680
  internal: true
3524
3681
  };
3682
+ var BEGIN_BUILD_SESSION = {
3683
+ name: "begin_build_session",
3684
+ 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.",
3685
+ parameters: {
3686
+ worktreeId: {
3687
+ type: "string",
3688
+ description: "The Lucern worktree ID to bootstrap."
3689
+ },
3690
+ branch: {
3691
+ type: "string",
3692
+ description: "Optional git branch name. Auto-generated from the worktree name when omitted."
3693
+ },
3694
+ branchBase: {
3695
+ type: "string",
3696
+ description: 'Base branch for the feature branch. Default: "staging".'
3697
+ },
3698
+ prBase: {
3699
+ type: "string",
3700
+ description: 'Target branch for the PR. Default: "staging".'
3701
+ },
3702
+ sessionMode: {
3703
+ type: "string",
3704
+ description: 'Session mode: "async" for Codex/headless or "interactive" for live sessions.',
3705
+ enum: ["async", "interactive"]
3706
+ },
3707
+ activateIfPlanning: {
3708
+ type: "boolean",
3709
+ description: "When true, automatically activate a planning worktree during bootstrap."
3710
+ }
3711
+ },
3712
+ required: ["worktreeId"],
3713
+ response: {
3714
+ description: "A compact build-session packet with worktree metadata, graph anchors, questions, dependencies, and git defaults.",
3715
+ fields: {
3716
+ topicId: "string \u2014 canonical topic scope",
3717
+ topicName: "string \u2014 human-readable topic name",
3718
+ worktreeId: "string \u2014 worktree ID",
3719
+ worktreeName: "string \u2014 human-readable worktree name",
3720
+ branch: "string \u2014 git branch name",
3721
+ branchBase: "string \u2014 base branch",
3722
+ prBase: "string \u2014 PR target branch",
3723
+ campaign: "number | null \u2014 top-level pipeline campaign",
3724
+ lane: "string \u2014 campaign lane",
3725
+ gate: "string \u2014 exit gate",
3726
+ hypothesis: "string \u2014 worktree hypothesis",
3727
+ focus: "string \u2014 session focus",
3728
+ status: "string \u2014 worktree status after optional activation",
3729
+ sessionMode: "string \u2014 async | interactive",
3730
+ targetBeliefIds: "array \u2014 scoped belief IDs",
3731
+ targetQuestionIds: "array \u2014 scoped question IDs",
3732
+ topBeliefs: "array \u2014 highest-confidence scoped beliefs",
3733
+ openQuestions: "array \u2014 open scoped questions",
3734
+ resolvedDecisions: "array \u2014 answered questions summarized for the session",
3735
+ dependencies: "array \u2014 upstream worktrees",
3736
+ unblocks: "array \u2014 downstream worktrees",
3737
+ mergeOrderNotes: "string \u2014 merge ordering advisory"
3738
+ }
3739
+ },
3740
+ ownerModule: "bootstrap",
3741
+ ontologyPrimitive: "worktree",
3742
+ tier: "showcase",
3743
+ internal: true
3744
+ };
3525
3745
  var MCP_TOOL_CONTRACTS = {
3526
3746
  // Belief lifecycle (commit, amend, fork, archive)
3527
3747
  create_belief: CREATE_BELIEF,
@@ -3569,6 +3789,8 @@ var MCP_TOOL_CONTRACTS = {
3569
3789
  // Graph intelligence (showcase)
3570
3790
  detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
3571
3791
  get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
3792
+ list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
3793
+ run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
3572
3794
  get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
3573
3795
  // Evidence operations (workhorse)
3574
3796
  search_evidence: SEARCH_EVIDENCE,
@@ -3615,6 +3837,7 @@ var MCP_TOOL_CONTRACTS = {
3615
3837
  get_agent_inbox: GET_AGENT_INBOX,
3616
3838
  claim_files: CLAIM_FILES,
3617
3839
  generate_session_handoff: GENERATE_SESSION_HANDOFF,
3840
+ begin_build_session: BEGIN_BUILD_SESSION,
3618
3841
  // Policy / ACL (workhorse)
3619
3842
  check_permission: CHECK_PERMISSION,
3620
3843
  filter_by_permission: FILTER_BY_PERMISSION,
@@ -3750,6 +3973,8 @@ var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
3750
3973
  "traverse_graph",
3751
3974
  "get_graph_neighborhood",
3752
3975
  "get_graph_structure_analysis",
3976
+ "list_graph_intelligence_queries",
3977
+ "run_graph_intelligence_query",
3753
3978
  "find_contradictions",
3754
3979
  "flag_contradiction",
3755
3980
  "detect_confirmation_bias",
@@ -3828,6 +4053,7 @@ var PLATFORM_INTERNAL_OPERATION_NAMES = [
3828
4053
  "get_change_history",
3829
4054
  "get_failure_log",
3830
4055
  "record_attempt",
4056
+ "begin_build_session",
3831
4057
  "push",
3832
4058
  "open_pull_request",
3833
4059
  "record_judgment",
@@ -3882,7 +4108,6 @@ var SDK_ONLY_OPERATION_NAMES = [
3882
4108
  "find_semantic_orphans"
3883
4109
  ];
3884
4110
  var MCP_ONLY_INTERNAL_OPERATION_NAMES = [
3885
- "begin_build_session",
3886
4111
  "evaluate_engineering_contract",
3887
4112
  "evaluate_research_contract"
3888
4113
  ];
@@ -4249,8 +4474,76 @@ function surfaceContract(args) {
4249
4474
  }
4250
4475
  });
4251
4476
  }
4252
-
4253
- // src/function-registry/worktrees.ts
4477
+ var autoFixPolicyInputSchema = z.object({
4478
+ enabled: z.boolean().optional().describe("Whether automatic remediation is enabled."),
4479
+ mode: z.string().optional().describe("Automation mode for worktree auto-fixes."),
4480
+ maxAttempts: z.number().optional().describe("Maximum number of auto-fix attempts."),
4481
+ reviewer: z.string().optional().describe("Reviewer responsible for auto-fix oversight."),
4482
+ maxActionsPerRun: z.number().optional().describe("Maximum number of auto-fix actions per run."),
4483
+ permittedMutationTiers: z.array(z.enum(["read_only", "low_risk_write", "high_risk_write"])).optional().describe("Mutation tiers the auto-fix worker may execute."),
4484
+ requireAuditTrail: z.boolean().optional().describe("Whether auto-fix actions must write an audit trail."),
4485
+ escalationGate: z.string().optional().describe("Gate to trigger when auto-fix policy requires escalation.")
4486
+ }).passthrough().describe("Policy for permitted automatic remediation inside the worktree.");
4487
+ var worktreeKeyQuestionInputSchema = z.object({
4488
+ question: z.string().describe("Question the worktree must resolve."),
4489
+ status: z.enum(["open", "answered", "forked"]).optional().describe("Current disposition of the key question."),
4490
+ answer: z.string().optional().describe("Captured answer when the key question is resolved."),
4491
+ answerConfidence: z.enum(["high", "medium", "low"]).optional().describe("Confidence in the captured answer."),
4492
+ linkedQuestionId: z.string().optional().describe("Canonical question node linked to this key question.")
4493
+ }).passthrough().describe("Question contract embedded in the worktree plan.");
4494
+ var worktreeEvidenceSignalInputSchema = z.object({
4495
+ signal: z.string().describe("Evidence signal the worktree should collect."),
4496
+ collected: z.boolean().optional().describe("Whether the signal has already been collected."),
4497
+ progress: z.string().optional().describe("Collection progress note for the signal."),
4498
+ notes: z.string().optional().describe("Additional evidence collection notes.")
4499
+ }).passthrough().describe("Evidence signal embedded in the worktree plan.");
4500
+ var worktreeDecisionGateInputSchema = z.object({
4501
+ goCriteria: z.array(z.string()).describe("Criteria that must hold for the worktree to proceed."),
4502
+ noGoSignals: z.array(z.string()).describe("Signals that stop or redirect the worktree."),
4503
+ verdict: z.enum(["go", "no_go", "pivot", "pending"]).optional().describe("Current decision verdict for the worktree gate."),
4504
+ verdictRationale: z.string().optional().describe("Rationale supporting the current gate verdict."),
4505
+ decidedAt: z.number().optional().describe("Timestamp when the gate verdict was decided."),
4506
+ decidedBy: z.string().optional().describe("Actor that decided the gate verdict.")
4507
+ }).passthrough().describe("Decision gate contract for worktree activation or exit.");
4508
+ var addWorktreeArgs = z.object({
4509
+ title: z.string().optional().describe("Human-readable worktree name or objective."),
4510
+ name: z.string().optional().describe("Storage-name alias for callers that already use backend naming."),
4511
+ topicId: z.string().describe("Primary topic scope for the worktree."),
4512
+ projectId: z.string().optional().describe("Legacy topicId alias."),
4513
+ branchId: z.string().optional().describe("Legacy branch identifier for compatibility with workflow callers."),
4514
+ objective: z.string().optional().describe("Reasoning objective this worktree is intended to resolve."),
4515
+ hypothesis: z.string().optional().describe("Testable claim this worktree investigates."),
4516
+ rationale: z.string().optional().describe("Why this worktree exists and why it belongs in the campaign."),
4517
+ worktreeType: z.string().optional().describe("Schema-enum worktree type used for kernel lifecycle behavior."),
4518
+ gate: z.string().optional().describe("Exit gate for this worktree."),
4519
+ startDate: z.number().optional().describe("Planned start timestamp in milliseconds since epoch."),
4520
+ endDate: z.number().optional().describe("Planned end timestamp in milliseconds since epoch."),
4521
+ durationWeeks: z.number().optional().describe("Planned duration in weeks."),
4522
+ confidenceImpact: z.enum(["high", "medium", "low"]).optional().describe("Expected confidence impact if this worktree succeeds."),
4523
+ beliefFocus: z.string().optional().describe("Natural-language focus spanning the target belief neighborhood."),
4524
+ beliefIds: z.array(z.string()).optional().describe("Legacy alias for targetBeliefIds."),
4525
+ beliefs: z.array(z.string()).optional().describe("Legacy alias for targetBeliefIds."),
4526
+ targetBeliefIds: z.array(z.string()).optional().describe("Belief node IDs this worktree is expected to test or update."),
4527
+ targetQuestionIds: z.array(z.string()).optional().describe("Question node IDs this worktree is expected to answer."),
4528
+ keyQuestions: z.array(worktreeKeyQuestionInputSchema).optional().describe("Inline key questions captured as part of the worktree plan."),
4529
+ evidenceSignals: z.array(worktreeEvidenceSignalInputSchema).optional().describe("Evidence signals the worktree needs to collect or validate."),
4530
+ decisionGate: worktreeDecisionGateInputSchema.optional(),
4531
+ goCriteria: z.array(z.string()).optional().describe("Shorthand go criteria used to build decisionGate."),
4532
+ noGoSignals: z.array(z.string()).optional().describe("Shorthand no-go signals used to build decisionGate."),
4533
+ proofArtifacts: z.array(z.unknown()).optional().describe("Expected proof artifacts required to close the worktree."),
4534
+ autoShape: z.boolean().optional().describe("Whether to invoke inquiry auto-shaping during creation."),
4535
+ autoFixPolicy: autoFixPolicyInputSchema.optional(),
4536
+ domainPackId: z.string().optional().describe("Domain pack whose shaping hooks should influence the worktree."),
4537
+ campaign: z.number().optional().describe("Top-level pipeline campaign number."),
4538
+ lane: z.string().optional().describe("Campaign lane for the worktree."),
4539
+ laneOrderInCampaign: z.number().optional().describe("Ordering for this lane within its campaign."),
4540
+ orderInLane: z.number().optional().describe("Position of this worktree inside its lane."),
4541
+ dependsOn: z.array(z.string()).optional().describe("Worktree IDs that must complete before this worktree."),
4542
+ blocks: z.array(z.string()).optional().describe("Worktree IDs blocked by this worktree."),
4543
+ staffingHint: z.string().optional().describe("Suggested staffing or agent allocation note."),
4544
+ lensId: z.string().optional().describe("Lens that scopes this worktree when applicable."),
4545
+ lastReconciledAt: z.number().optional().describe("Timestamp when worktree metadata was last reconciled.")
4546
+ });
4254
4547
  var worktreeIdInput = (input) => compactRecord({
4255
4548
  worktreeId: input.worktreeId ?? input.id
4256
4549
  });
@@ -4283,6 +4576,50 @@ var worktreeMetadataInput = (input) => compactRecord({
4283
4576
  autoFixPolicy: input.autoFixPolicy,
4284
4577
  lastReconciledAt: input.lastReconciledAt
4285
4578
  });
4579
+ var worktreeMetadataArgs = z.object({
4580
+ worktreeId: z.string().describe("The worktree to update."),
4581
+ id: z.string().optional().describe("Worktree ID alias."),
4582
+ topicId: z.string().optional().describe("Primary topic scope."),
4583
+ additionalTopicIds: z.array(z.string()).optional().describe("Additional topic scopes associated with this worktree."),
4584
+ status: z.string().optional().describe("Worktree lifecycle status."),
4585
+ campaign: z.number().optional().describe("Top-level pipeline campaign."),
4586
+ lane: z.string().optional().describe("Campaign lane."),
4587
+ laneOrderInCampaign: z.number().optional().describe("Ordering for this lane within its campaign."),
4588
+ orderInLane: z.number().optional().describe("Position of this worktree inside its lane."),
4589
+ gate: z.string().optional().describe("Exit gate for this worktree."),
4590
+ hypothesis: z.string().optional().describe("Testable claim this worktree investigates."),
4591
+ objective: z.string().optional().describe("Reasoning objective for the worktree."),
4592
+ rationale: z.string().optional().describe("Why this worktree is sequenced here."),
4593
+ proofArtifacts: z.array(z.unknown()).optional().describe("Proof artifacts required to close the worktree."),
4594
+ staffingHint: z.string().optional().describe("Suggested staffing or agent allocation note."),
4595
+ blocks: z.array(z.string()).optional().describe("Worktree IDs blocked by this worktree."),
4596
+ dependsOn: z.array(z.string()).optional().describe("Worktree IDs this worktree depends on."),
4597
+ lensId: z.string().optional().describe("Lens that scopes this worktree."),
4598
+ autoFixPolicy: autoFixPolicyInputSchema.optional(),
4599
+ lastReconciledAt: z.number().optional().describe("Timestamp of the last deterministic reconciliation pass.")
4600
+ });
4601
+ var pushArgs = worktreeMetadataArgs.extend({
4602
+ targetContext: z.string().describe("Where to push merged findings."),
4603
+ beliefIds: z.array(z.string()).optional().describe("Optional subset of beliefs to push.")
4604
+ });
4605
+ var openPullRequestArgs = worktreeMetadataArgs.extend({
4606
+ reviewers: z.array(z.string()).optional().describe("User IDs of requested reviewers."),
4607
+ summary: z.string().describe("Summary of findings and why they are ready for review.")
4608
+ });
4609
+ var mergeKeyFindingsInput = (input) => {
4610
+ if (Array.isArray(input.keyFindings)) {
4611
+ return input.keyFindings;
4612
+ }
4613
+ if (Array.isArray(input.outcomes)) {
4614
+ const findings = input.outcomes.filter(
4615
+ (outcome) => typeof outcome === "string" && outcome.trim().length > 0
4616
+ );
4617
+ if (findings.length > 0) {
4618
+ return findings;
4619
+ }
4620
+ }
4621
+ return [input.summary ?? "Merged worktree"];
4622
+ };
4286
4623
  var listAllWorktreesInput = (input) => compactRecord({
4287
4624
  status: input.status,
4288
4625
  lane: input.lane,
@@ -4290,6 +4627,16 @@ var listAllWorktreesInput = (input) => compactRecord({
4290
4627
  limit: input.limit
4291
4628
  });
4292
4629
  var worktreesContracts = [
4630
+ surfaceContract({
4631
+ name: "begin_build_session",
4632
+ kind: "mutation",
4633
+ domain: "worktrees",
4634
+ surfaceClass: "platform_internal",
4635
+ path: "/mcp/build-session/begin",
4636
+ sdkNamespace: "worktrees",
4637
+ sdkMethod: "beginBuildSession",
4638
+ summary: "Begin a coding build session for a worktree."
4639
+ }),
4293
4640
  surfaceContract({
4294
4641
  name: "add_worktree",
4295
4642
  kind: "mutation",
@@ -4306,13 +4653,12 @@ var worktreesContracts = [
4306
4653
  inputProjection: (input, context) => withCreatedBy(
4307
4654
  compactRecord({
4308
4655
  name: input.name ?? input.title,
4309
- topicId: input.topicId,
4656
+ topicId: input.topicId ?? input.projectId,
4310
4657
  worktreeType: input.worktreeType,
4311
4658
  objective: input.objective,
4312
4659
  gate: input.gate,
4313
4660
  hypothesis: input.hypothesis,
4314
4661
  rationale: input.rationale,
4315
- signal: input.signal,
4316
4662
  startDate: input.startDate,
4317
4663
  endDate: input.endDate,
4318
4664
  durationWeeks: input.durationWeeks,
@@ -4338,12 +4684,12 @@ var worktreesContracts = [
4338
4684
  staffingHint: input.staffingHint,
4339
4685
  domainPackId: input.domainPackId,
4340
4686
  lensId: input.lensId,
4341
- linkedQuestionId: input.linkedQuestionId,
4342
4687
  lastReconciledAt: input.lastReconciledAt
4343
4688
  }),
4344
4689
  context
4345
4690
  )
4346
- }
4691
+ },
4692
+ args: addWorktreeArgs
4347
4693
  }),
4348
4694
  surfaceContract({
4349
4695
  name: "activate_worktree",
@@ -4455,7 +4801,8 @@ var worktreesContracts = [
4455
4801
  functionName: "updateMetadata",
4456
4802
  kind: "mutation",
4457
4803
  inputProjection: worktreeMetadataInput
4458
- }
4804
+ },
4805
+ args: worktreeMetadataArgs
4459
4806
  }),
4460
4807
  surfaceContract({
4461
4808
  name: "merge",
@@ -4473,9 +4820,7 @@ var worktreesContracts = [
4473
4820
  inputProjection: (input, context) => withUserId(
4474
4821
  {
4475
4822
  ...worktreeIdInput(input),
4476
- keyFindings: input.keyFindings ?? [
4477
- input.summary ?? "Merged worktree"
4478
- ],
4823
+ keyFindings: mergeKeyFindingsInput(input),
4479
4824
  decisionsReached: input.decisionsReached ?? [],
4480
4825
  nextSteps: input.nextSteps ?? []
4481
4826
  },
@@ -4497,7 +4842,8 @@ var worktreesContracts = [
4497
4842
  functionName: "updateMetadata",
4498
4843
  kind: "mutation",
4499
4844
  inputProjection: worktreeMetadataInput
4500
- }
4845
+ },
4846
+ args: pushArgs
4501
4847
  }),
4502
4848
  surfaceContract({
4503
4849
  name: "open_pull_request",
@@ -4513,7 +4859,8 @@ var worktreesContracts = [
4513
4859
  functionName: "updateMetadata",
4514
4860
  kind: "mutation",
4515
4861
  inputProjection: worktreeMetadataInput
4516
- }
4862
+ },
4863
+ args: openPullRequestArgs
4517
4864
  })
4518
4865
  ];
4519
4866