@lucern/contracts 1.0.2 → 1.0.4

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 (107) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/context-pack.contract.d.ts +10 -0
  3. package/dist/context-pack.contract.js.map +1 -1
  4. package/dist/dsl.d.ts +1 -0
  5. package/dist/dsl.js +10 -3
  6. package/dist/dsl.js.map +1 -1
  7. package/dist/dsl.values.js +10 -3
  8. package/dist/dsl.values.js.map +1 -1
  9. package/dist/function-registry/beliefs.js +302 -0
  10. package/dist/function-registry/beliefs.js.map +1 -1
  11. package/dist/function-registry/coding.js +302 -0
  12. package/dist/function-registry/coding.js.map +1 -1
  13. package/dist/function-registry/context.js +302 -0
  14. package/dist/function-registry/context.js.map +1 -1
  15. package/dist/function-registry/contracts.js +302 -0
  16. package/dist/function-registry/contracts.js.map +1 -1
  17. package/dist/function-registry/coordination.js +302 -0
  18. package/dist/function-registry/coordination.js.map +1 -1
  19. package/dist/function-registry/edges.js +302 -0
  20. package/dist/function-registry/edges.js.map +1 -1
  21. package/dist/function-registry/evidence.js +302 -0
  22. package/dist/function-registry/evidence.js.map +1 -1
  23. package/dist/function-registry/graph.js +302 -0
  24. package/dist/function-registry/graph.js.map +1 -1
  25. package/dist/function-registry/helpers.js +302 -0
  26. package/dist/function-registry/helpers.js.map +1 -1
  27. package/dist/function-registry/identity.js +302 -0
  28. package/dist/function-registry/identity.js.map +1 -1
  29. package/dist/function-registry/index.d.ts +410 -6
  30. package/dist/function-registry/index.js +508 -2
  31. package/dist/function-registry/index.js.map +1 -1
  32. package/dist/function-registry/judgments.js +302 -0
  33. package/dist/function-registry/judgments.js.map +1 -1
  34. package/dist/function-registry/legacy.js +302 -0
  35. package/dist/function-registry/legacy.js.map +1 -1
  36. package/dist/function-registry/lenses.js +302 -0
  37. package/dist/function-registry/lenses.js.map +1 -1
  38. package/dist/function-registry/manifest.d.ts +2 -2
  39. package/dist/function-registry/manifest.js +10 -0
  40. package/dist/function-registry/manifest.js.map +1 -1
  41. package/dist/function-registry/nodes.js +302 -0
  42. package/dist/function-registry/nodes.js.map +1 -1
  43. package/dist/function-registry/ontologies.js +302 -0
  44. package/dist/function-registry/ontologies.js.map +1 -1
  45. package/dist/function-registry/pipeline.js +302 -0
  46. package/dist/function-registry/pipeline.js.map +1 -1
  47. package/dist/function-registry/questions.js +302 -0
  48. package/dist/function-registry/questions.js.map +1 -1
  49. package/dist/function-registry/tasks.js +302 -0
  50. package/dist/function-registry/tasks.js.map +1 -1
  51. package/dist/function-registry/topics.js +302 -0
  52. package/dist/function-registry/topics.js.map +1 -1
  53. package/dist/function-registry/worktrees.js +302 -0
  54. package/dist/function-registry/worktrees.js.map +1 -1
  55. package/dist/generated/convexSchemas.js +1 -1
  56. package/dist/generated/convexSchemas.js.map +1 -1
  57. package/dist/generated/infisicalRuntimeEnv.js +9 -9
  58. package/dist/generated/infisicalRuntimeEnv.js.map +1 -1
  59. package/dist/generated/schema-manifest.json +10 -1
  60. package/dist/index.d.ts +3 -1
  61. package/dist/index.js +343 -17
  62. package/dist/index.js.map +1 -1
  63. package/dist/infisical-runtime.contract.d.ts +3 -3
  64. package/dist/infisical-runtime.contract.js +3 -3
  65. package/dist/infisical-runtime.contract.js.map +1 -1
  66. package/dist/infisical-runtime.platform-secrets.d.ts +3 -3
  67. package/dist/infisical-runtime.platform-secrets.js +3 -3
  68. package/dist/infisical-runtime.platform-secrets.js.map +1 -1
  69. package/dist/manifests/edge-policy-manifest.d.ts +1 -1
  70. package/dist/manifests/infisical-runtime-manifest.d.ts +3 -3
  71. package/dist/manifests/infisical-runtime-manifest.js +3 -3
  72. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  73. package/dist/proof-attestation.json +1 -1
  74. package/dist/schemas/index.js +29 -2
  75. package/dist/schemas/index.js.map +1 -1
  76. package/dist/schemas/manifest.d.ts +60 -25
  77. package/dist/schemas/manifest.js +29 -2
  78. package/dist/schemas/manifest.js.map +1 -1
  79. package/dist/schemas/tables/kernel/embedding.d.ts +8 -1
  80. package/dist/schemas/tables/kernel/embedding.js +29 -2
  81. package/dist/schemas/tables/kernel/embedding.js.map +1 -1
  82. package/dist/schemas/tables/kernel/intelligence.d.ts +4 -4
  83. package/dist/schemas.values.js +29 -2
  84. package/dist/schemas.values.js.map +1 -1
  85. package/dist/sdk-methods.contract.d.ts +5 -0
  86. package/dist/sdk-tools.contract.js +292 -0
  87. package/dist/sdk-tools.contract.js.map +1 -1
  88. package/dist/sdk-tools.contract.registry.js +292 -0
  89. package/dist/sdk-tools.contract.registry.js.map +1 -1
  90. package/dist/sdk-tools.contract.values.js +292 -0
  91. package/dist/sdk-tools.contract.values.js.map +1 -1
  92. package/dist/tool-contracts.d.ts +2 -0
  93. package/dist/tool-contracts.embeddings.d.ts +8 -0
  94. package/dist/tool-contracts.embeddings.js +120 -0
  95. package/dist/tool-contracts.embeddings.js.map +1 -0
  96. package/dist/tool-contracts.hybrid-discovery.d.ts +10 -0
  97. package/dist/tool-contracts.hybrid-discovery.js +148 -0
  98. package/dist/tool-contracts.hybrid-discovery.js.map +1 -0
  99. package/dist/tool-contracts.js +293 -1
  100. package/dist/tool-contracts.js.map +1 -1
  101. package/dist/tool-contracts.questions-listing.js +20 -0
  102. package/dist/tool-contracts.questions-listing.js.map +1 -1
  103. package/dist/tool-contracts.values.d.ts +2 -0
  104. package/dist/tool-contracts.values.js +292 -0
  105. package/dist/tool-contracts.values.js.map +1 -1
  106. package/package.json +10 -2
  107. package/dist/{edge-policy-manifest-4KOSP4nk.d.ts → edge-policy-manifest-CT8Y4IeW.d.ts} +2 -2
@@ -728,6 +728,26 @@ var COMPILE_CONTEXT = {
728
728
  type: "string",
729
729
  description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
730
730
  },
731
+ topicHint: {
732
+ type: "string",
733
+ description: "Optional natural-language topic hint used by the resolver when topicId is omitted or stale."
734
+ },
735
+ tags: {
736
+ type: "array",
737
+ description: "Optional resolver tags. Useful for narrowing topic inference without knowing the exact topic id."
738
+ },
739
+ touchedPaths: {
740
+ type: "array",
741
+ description: "Optional file or documentation paths used as resolver signals."
742
+ },
743
+ sourceRef: {
744
+ type: "string",
745
+ description: "Optional source reference used as a resolver signal, such as a worktree id, PR, or feature slug."
746
+ },
747
+ sourceKind: {
748
+ type: "string",
749
+ description: "Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs."
750
+ },
731
751
  budget: {
732
752
  type: "number",
733
753
  description: "Token budget for prompt injection planning"
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tool-contracts.questions-listing.ts"],"names":[],"mappings":";AAEO,IAAM,eAAA,GAAmC;AAAA,EAC9C,IAAA,EAAM,iBAAA;AAAA,EACN,WAAA,EACE,sNAAA;AAAA,EAGF,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,mBAAA,EAAoB;AAAA,IACzD,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA,EAA4B;AAAA,IACpE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa,qCAAA;AAAA,MACb,IAAA,EAAM,CAAC,QAAA,EAAU,MAAA,EAAQ,UAAU,KAAK;AAAA,KAC1C;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,QAAA,EAAU,CAAC,MAAM,CAAA;AAAA,EACjB,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,uCAAA;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,EAAA,EAAI,qCAAA;AAAA,MACJ,MAAA,EAAQ,qCAAA;AAAA,MACR,UAAA,EAAY,qCAAA;AAAA,MACZ,IAAA,E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,iEAAA;AAAA,MAChB,WAAA,EACE,mFAAA;AAAA,MACF,OAAA,EAAS,yCAAA;AAAA,MACT,OAAA,EAAS,gDAAA;AAAA,MACT,UAAA,EAAY,gDAAA;AAAA,MACZ,aAAA,EAAe,0CAAA;AAAA,MACf,aAAA,EAAe,yDAAA;AAAA,MACf,cAAA,EAAgB,oDAAA;AAAA,MAChB,cAAA,EAAgB,+CAAA;AAAA,MAChB,eAAA,EAAiB,+DAAA;AAAA,MACjB,gBAAA,EAAkB,2CAAA;AAAA,MAClB,eAAA,EAAiB,iDAAA;AAAA,MACjB,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,OAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.questions-listing.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const CREATE_QUESTION: McpToolContract = {\n name: \"create_question\",\n description:\n \"Commit an investigation question to the reasoning graph. \" +\n \"Like `git issue` — creates a traceable question that drives research and evidence collection. \" +\n \"Questions test beliefs and guide worktree investigation.\",\n parameters: {\n text: { type: \"string\", description: \"The question text\" },\n topicId: { type: \"string\", description: \"Optional topic scope hint\" },\n priority: {\n type: \"string\",\n description: \"Priority: urgent, high, medium, low\",\n enum: [\"urgent\", \"high\", \"medium\", \"low\"],\n },\n linkedBeliefId: {\n type: \"string\",\n description: \"Belief this question tests\",\n },\n metadata: {\n type: \"object\",\n description: \"Optional metadata merged into the question record\",\n },\n },\n required: [\"text\"],\n response: {\n description: \"The created canonical question record\",\n fields: {\n id: \"string — canonical question ID\",\n nodeId: \"string — canonical question ID\",\n questionId: \"string — canonical question ID\",\n text: \"string\",\n status: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const GET_QUESTION: McpToolContract = {\n name: \"get_question\",\n description:\n \"Read one question by ID. \" +\n \"Like `git show` — resolves the canonical question payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical question ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical question record\",\n fields: {\n id: \"string — canonical question ID\",\n nodeId: \"string — canonical question ID\",\n questionId: \"string — canonical question ID\",\n text: \"string\",\n status: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const REFINE_QUESTION: McpToolContract = {\n name: \"refine_question\",\n description:\n \"Refine a question's framing or scope. \" +\n \"Like `git commit --amend` for questions — updates the question text \" +\n \"while preserving its identity and linked evidence.\",\n parameters: {\n id: { type: \"string\", description: \"The question to refine\" },\n text: { type: \"string\", description: \"Updated question text\" },\n rationale: {\n type: \"string\",\n description: \"Why the question is being refined\",\n },\n },\n required: [\"id\", \"text\"],\n response: {\n description: \"The refined question\",\n fields: {\n id: \"string\",\n questionId: \"string\",\n updatedText: \"string\",\n previousText: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const LIST_QUESTIONS: McpToolContract = {\n name: \"list_questions\",\n description:\n \"List questions scoped to a topic or worktree. \" +\n \"Like `git issue list` — returns questions with their status, priority, and linked belief context. \" +\n \"Supports filtering by status and priority.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n worktreeId: { type: \"string\", description: \"Filter to worktree scope\" },\n status: {\n type: \"string\",\n description: \"Filter by canonical question status\",\n enum: [\"open\", \"researching\", \"answered\", \"parked\", \"closed\"],\n },\n priority: {\n type: \"string\",\n description: \"Filter by canonical question priority\",\n enum: [\"urgent\", \"high\", \"medium\", \"low\"],\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"Canonical question page\",\n fields: {\n questions: \"array — canonical question records\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const ANSWER_QUESTION: McpToolContract = {\n name: \"answer_question\",\n description:\n \"Answer a question with optional evidence links. \" +\n \"Like `git commit` on the question thread — records the answer and closes the loop with a canonical answered state.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical question ID\" },\n topicId: { type: \"string\", description: \"Topic scope for the answer\" },\n text: { type: \"string\", description: \"Answer text\" },\n confidence: {\n type: \"string\",\n description: \"Optional answer confidence\",\n enum: [\"weak\", \"medium\", \"strong\"],\n },\n evidenceIds: {\n type: \"array\",\n description: \"Optional canonical evidence IDs supporting the answer\",\n },\n rationale: { type: \"string\", description: \"Why this answer is credible\" },\n },\n required: [\"id\", \"topicId\", \"text\"],\n response: {\n description: \"Answer result\",\n fields: {\n questionId: \"string\",\n answerId: \"string\",\n status: \"string — answered\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_QUESTION_STATUS: McpToolContract = {\n name: \"update_question_status\",\n description:\n \"Transition a question's status through its lifecycle. \" +\n \"Like `git issue update` — moves a question through the canonical reasoning lifecycle. \" +\n \"Status transitions preserve history and keep linked evidence intact.\",\n parameters: {\n id: { type: \"string\", description: \"The question to update\" },\n status: {\n type: \"string\",\n description: \"New status\",\n enum: [\"open\", \"researching\", \"answered\", \"parked\", \"closed\"],\n },\n rationale: { type: \"string\", description: \"Why the status is changing\" },\n },\n required: [\"id\", \"status\"],\n response: {\n description: \"Updated question status\",\n fields: {\n id: \"string\",\n questionId: \"string\",\n previousStatus: \"string\",\n newStatus: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const ARCHIVE_QUESTION: McpToolContract = {\n name: \"archive_question\",\n description:\n \"Archive a question no longer relevant to current investigation scope. \" +\n \"Like `git issue close` — removes it from active work while preserving audit history. \" +\n \"Archived questions keep their existing links to beliefs and evidence.\",\n parameters: {\n questionId: { type: \"string\", description: \"The question to archive\" },\n reason: {\n type: \"string\",\n description: \"Why the question is being archived\",\n },\n },\n required: [\"questionId\"],\n response: {\n description: \"Archive confirmation\",\n fields: {\n questionId: \"string\",\n status: \"string — 'archived'\",\n archivedAt: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE_TO_QUESTION: McpToolContract = {\n name: \"link_evidence_to_question\",\n description:\n \"Link evidence to the question it helps answer. \" +\n \"Like `git notes add` — attaches supporting detail to an active question. \" +\n \"Question-level links improve answer quality and traceability to beliefs.\",\n parameters: {\n evidenceId: { type: \"string\", description: \"The evidence to link\" },\n questionId: {\n type: \"string\",\n description: \"The question this evidence addresses\",\n },\n relevance: { type: \"number\", description: \"Relevance score in [0,1]\" },\n rationale: {\n type: \"string\",\n description: \"How this evidence bears on the question\",\n },\n },\n required: [\"evidenceId\", \"questionId\"],\n response: {\n description: \"The created edge\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n questionId: \"string\",\n relevance: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// ANSWER LIFECYCLE TOOLS\n// =============================================================================\n\nexport const CREATE_ANSWER: McpToolContract = {\n name: \"create_answer\",\n description:\n \"Create an answer node responding to a question. \" +\n \"Like `git commit` for resolved questions — creates an immutable answer snapshot at L2. \" +\n \"New answers supersede old ones, preserving full version history. \" +\n \"Answers link to supporting evidence via based_on edges.\",\n parameters: {\n questionNodeId: {\n type: \"string\",\n description: \"The question node ID this answers\",\n },\n answerText: {\n type: \"string\",\n description: \"The answer content — the actual response to the question\",\n },\n topicId: {\n type: \"string\",\n description: \"Topic scope (optional if question already has topicId)\",\n },\n confidence: {\n type: \"string\",\n description:\n \"Answer confidence: definitive, strong, moderate, weak, speculative\",\n },\n evidenceNodeIds: {\n type: \"array\",\n description: \"Supporting evidence node IDs to link via based_on edges\",\n },\n answerSource: {\n type: \"string\",\n description:\n \"How the answer was produced: human, ai_generated, deep_research, synthesis\",\n },\n },\n required: [\"questionNodeId\", \"answerText\"],\n response: {\n description: \"The created answer node with version metadata\",\n fields: {\n nodeId: \"string — unique node identifier\",\n globalId: \"string — globally unique ID\",\n versionNumber: \"number — version of this answer (auto-incremented)\",\n questionNodeId: \"string — the question this answers\",\n confidence: \"string — answer confidence level\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"showcase\",\n};\n\nexport const GET_ANSWER: McpToolContract = {\n name: \"get_answer\",\n description:\n \"Get the latest answer for a question. \" +\n \"Like `git show HEAD` for a question's resolution — returns the active answer snapshot. \" +\n \"Returns null if the question is unanswered.\",\n parameters: {\n questionNodeId: {\n type: \"string\",\n description: \"The question node ID to get the answer for\",\n },\n },\n required: [\"questionNodeId\"],\n response: {\n description: \"The active answer node or null\",\n fields: {\n nodeId: \"string | null\",\n globalId: \"string | null\",\n answerText: \"string | null\",\n versionNumber: \"number\",\n isLatest: \"boolean\",\n evidenceCount: \"number\",\n confidence: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const GET_HIGH_PRIORITY_QUESTIONS: McpToolContract = {\n name: \"get_high_priority_questions\",\n description:\n \"Rank open questions by urgency and expected decision impact. \" +\n \"Like `git issue list --sort=priority` — brings the highest-leverage open questions to the top. \" +\n \"Ranking accounts for linked belief criticality and evidence gaps.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n limit: { type: \"number\", description: \"Maximum results (default: 20)\" },\n includeAnswered: {\n type: \"boolean\",\n description: \"Include answered questions (default: false)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Priority-ranked questions\",\n fields: {\n questions:\n \"array — { questionId, text, priority, urgencyScore, linkedBeliefCount, evidenceGapCount }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const FIND_MISSING_QUESTIONS: McpToolContract = {\n name: \"find_missing_questions\",\n description:\n \"Identify beliefs missing testing questions. \" +\n \"Like `git diff --check` — surfaces reasoning coverage gaps before merge. \" +\n \"Returns candidate beliefs that need explicit question coverage.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n minConfidence: {\n type: \"number\",\n description: \"Only check beliefs above this confidence (default: 0)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Beliefs missing testing questions\",\n fields: {\n gaps: \"array — { beliefId, canonicalText, confidence, suggestedQuestions }\",\n totalGaps: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// LISTING & QUERY TOOLS\n// =============================================================================\n\nexport const LIST_BELIEFS: McpToolContract = {\n name: \"list_beliefs\",\n description:\n \"List beliefs scoped to a topic or worktree. \" +\n \"Like `git log --oneline` — returns beliefs with their confidence, status, and scoring state. \" +\n \"Supports filtering by status and confidence threshold.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n worktreeId: { type: \"string\", description: \"Filter to worktree scope\" },\n status: {\n type: \"string\",\n description: \"Filter: unscored, scored, archived\",\n enum: [\"unscored\", \"scored\", \"archived\"],\n },\n minConfidence: {\n type: \"number\",\n description: \"Minimum confidence threshold\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum results\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Canonical belief page\",\n fields: {\n beliefs: \"array — canonical belief records\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const LIST_WORKTREES: McpToolContract = {\n name: \"list_worktrees\",\n description:\n \"List all worktrees for a topic. \" +\n \"Like `git worktree list` — shows active and completed investigation branches \" +\n \"with lifecycle phase, pipeline campaign/lane, status, and belief counts.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n status: {\n type: \"string\",\n description: \"Filter: active, merged, abandoned\",\n enum: [\"active\", \"merged\", \"abandoned\"],\n },\n groupBy: {\n type: \"string\",\n description: \"Optional grouping mode for the response.\",\n enum: [\"campaign\", \"lane\", \"flat\"],\n },\n lane: {\n type: \"string\",\n description: \"Filter by GitButler-aligned lane name.\",\n },\n campaign: {\n type: \"number\",\n description: \"Filter by top-level pipeline campaign number.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum results to return.\",\n },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Worktrees with lifecycle phase, campaign, lane, status, belief count, and creation time\",\n fields: {\n worktrees:\n \"array — { worktreeId, title, phase, campaign, lane, laneOrderInCampaign, orderInLane, status, beliefCount, createdAt }\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const LIST_ALL_WORKTREES: McpToolContract = {\n name: \"list_all_worktrees\",\n description:\n \"List ALL worktrees across ALL topics in one query. No topic scope required. \" +\n \"Like `git worktree list --all` — returns the complete pipeline inventory with \" +\n \"campaign, lane, lane order, dependencies, and status. \" +\n \"Supports filtering by status, lane, and campaign. \" +\n \"This is the PM's primary pipeline query — one call, full picture.\",\n parameters: {\n status: {\n type: \"string\",\n description:\n \"Filter by status: planning, active, completed, abandoned, superseded, long_term, idea, paused, suggested, dismissed\",\n enum: [\n \"planning\",\n \"active\",\n \"completed\",\n \"abandoned\",\n \"superseded\",\n \"long_term\",\n \"idea\",\n \"paused\",\n \"suggested\",\n \"dismissed\",\n ],\n },\n lane: {\n type: \"string\",\n description:\n \"Filter by lane name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity')\",\n },\n campaign: {\n type: \"number\",\n description:\n \"Filter by campaign number (e.g., 1, 2, 3). Returns only worktrees in that campaign.\",\n },\n groupBy: {\n type: \"string\",\n description: \"Optional grouping mode for the response.\",\n enum: [\"campaign\", \"lane\", \"flat\"],\n },\n limit: {\n type: \"number\",\n description: \"Maximum results to return (default: 500, max: 1000)\",\n },\n },\n required: [],\n response: {\n description: \"All worktrees across all topics with full pipeline metadata\",\n fields: {\n worktrees:\n \"array — { worktreeId, title, topicId, topicName, phase, status, hypothesis, campaign, lane, laneOrderInCampaign, orderInLane, dependsOn, blocks, gate, createdAt }\",\n total: \"number — total count after filtering\",\n lanes: \"object — { laneName: count } summary of worktrees per lane\",\n campaigns:\n \"object — { campaignNumber: count } summary of worktrees per campaign\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n};\n\nexport const GET_WORKTREE: McpToolContract = {\n name: \"get_worktree\",\n description:\n \"Get one worktree by ID. \" +\n \"Like `git worktree list --porcelain <worktree>` — inspects one investigation branch without scanning the full pipeline inventory.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"Canonical worktree ID to retrieve\" },\n id: { type: \"string\", description: \"Legacy alias for worktreeId\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Single worktree record with pipeline metadata\",\n fields: {\n worktree:\n \"object — { worktreeId, title, topicId, status, hypothesis, campaign, lane, laneOrderInCampaign, orderInLane, dependsOn, blocks, gate }\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const LIST_CAMPAIGNS: McpToolContract = {\n name: \"list_campaigns\",\n description:\n \"List compact pipeline campaigns with their nested lanes. \" +\n \"Use this to see the top-level campaign > lane > worktree shape without pulling the full worktree inventory.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Optional topic scope.\",\n },\n status: {\n type: \"string\",\n description:\n \"Optional worktree status filter before grouping campaigns and lanes.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum worktrees to scan before grouping.\",\n },\n },\n required: [],\n response: {\n description: \"Pipeline campaigns with nested lane summaries.\",\n fields: {\n campaigns:\n \"array — { campaign, lanes: [{ lane, laneOrderInCampaign, worktreeCount, activeCount, readyCount, blockedCount, completedCount, nextWorktree }] }\",\n totalWorktrees: \"number — total worktrees scanned after filtering\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n};\n\nexport const ACTIVATE_WORKTREE: McpToolContract = {\n name: \"activate_worktree\",\n description:\n \"Activate a worktree to begin investigation. \" +\n \"Like `git checkout <branch>` — transitions a worktree from planning to active status. \" +\n \"Sets the initial phase and enables belief/question editing within the worktree scope.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to activate\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Activation result with initial phase\",\n fields: {\n worktreeId: \"string\",\n status: \"string — 'active'\",\n phase: \"string\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_WORKTREE_TARGETS: McpToolContract = {\n name: \"update_worktree_targets\",\n description:\n \"Update the target beliefs and questions tracked by a worktree. \" +\n \"Like `git add/rm <files>` — stages or unstages beliefs/questions for investigation \" +\n \"within the worktree scope. Supports adding and removing targets atomically.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to update\" },\n addBeliefIds: {\n type: \"array\",\n description: \"Belief node IDs to add to the worktree\",\n },\n addQuestionIds: {\n type: \"array\",\n description: \"Question node IDs to add to the worktree\",\n },\n removeBeliefIds: {\n type: \"array\",\n description: \"Belief node IDs to remove from the worktree\",\n },\n removeQuestionIds: {\n type: \"array\",\n description: \"Question node IDs to remove from the worktree\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Updated target counts\",\n fields: {\n worktreeId: \"string\",\n beliefCount: \"number\",\n questionCount: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_WORKTREE_METADATA: McpToolContract = {\n name: \"update_worktree_metadata\",\n description:\n \"Update worktree sequencing metadata — campaign, lane, dependencies, blocking relations, and gates. \" +\n \"Like `git config` for a worktree — sets the scheduling and dependency metadata that determines \" +\n \"when this worktree can activate relative to others. Use to backfill or correct sequencing data.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to update\" },\n hypothesis: {\n type: \"string\",\n description: \"Testable claim this worktree investigates\",\n },\n campaign: {\n type: \"number\",\n description: \"Top-level pipeline campaign number.\",\n },\n lane: {\n type: \"string\",\n description:\n \"GitButler-aligned workstream lane name inside the campaign.\",\n },\n laneOrderInCampaign: {\n type: \"number\",\n description: \"Ordering for this lane within the campaign.\",\n },\n orderInLane: {\n type: \"number\",\n description: \"Position of this worktree inside its lane.\",\n },\n dependsOn: {\n type: \"array\",\n description:\n \"Worktree IDs that must complete before this one can activate\",\n },\n blocks: {\n type: \"array\",\n description: \"Worktree IDs that are blocked until this one completes\",\n },\n gate: {\n type: \"string\",\n description: \"Exit gate name (e.g., 'gate:ontology-schema-hardened')\",\n },\n rationale: {\n type: \"string\",\n description: \"Why this worktree is sequenced here\",\n },\n objective: {\n type: \"string\",\n description: \"What we're trying to learn/prove\",\n },\n proofArtifacts: {\n type: \"array\",\n description:\n \"Typed proof artifacts that define what evidence or deliverables this worktree must emit before it can claim success.\",\n },\n staffingHint: {\n type: \"string\",\n description:\n \"Advisory staffing shape for the worktree (for example `backend+tests` or `fullstack`).\",\n },\n lastReconciledAt: {\n type: \"number\",\n description:\n \"Timestamp of the last deterministic workflow reconciliation pass against this worktree.\",\n },\n autoFixPolicy: {\n type: \"object\",\n description:\n \"Calibrated auto-fix policy controlling dry-run vs safe execution, per-run action caps, and permitted mutation tiers.\",\n },\n status: {\n type: \"string\",\n description:\n \"Override the worktree status. Use for lifecycle transitions like marking a worktree superseded, long-term, or as a raw idea.\",\n enum: [\n \"suggested\",\n \"planning\",\n \"active\",\n \"paused\",\n \"completed\",\n \"dismissed\",\n \"abandoned\",\n \"superseded\",\n \"long_term\",\n \"idea\",\n ],\n },\n topicId: {\n type: \"string\",\n description:\n \"Reassign this worktree's primary topic. Validates the target topic exists before updating.\",\n },\n additionalTopicIds: {\n type: \"array\",\n description:\n \"Set additional topic associations for cross-topic worktrees. Each topic ID is validated before updating. \" +\n \"Use when a worktree spans multiple knowledge domains.\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Update confirmation\",\n fields: { worktreeId: \"string\", success: \"boolean\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const IDENTITY_WHOAMI: McpToolContract = {\n name: \"identity_whoami\",\n description:\n \"Read the authenticated identity summary for the current session. \" +\n \"Like `git config --get user.name` — shows who the current MCP session is acting as.\",\n parameters: {},\n required: [],\n response: {\n description: \"Canonical identity summary for the current session\",\n fields: {\n principalId:\n \"string — canonical principal identifier; for humans this is the Clerk user_... ID\",\n principalType: \"string — human, service, agent, group, or external_viewer\",\n tenantId: \"string | undefined — resolved tenant scope\",\n workspaceId: \"string | undefined — resolved workspace scope\",\n scopes: \"string[] | undefined — granted scopes for this session\",\n roles: \"string[] | undefined — canonical roles for this session\",\n },\n },\n ownerModule: \"identity-core\",\n ontologyPrimitive: \"identity\",\n tier: \"workhorse\",\n};\n\nexport const RESOLVE_INTERACTIVE_PRINCIPAL: McpToolContract = {\n name: \"resolve_interactive_principal\",\n description:\n \"Read the Permit-backed Lucern principal context for an authenticated Clerk user. \" +\n \"Like `git config --get user.email` plus the repository ACL — resolves the Clerk subject into tenant/workspace authorization context.\",\n parameters: {\n clerkId: {\n type: \"string\",\n description: \"Authenticated Clerk subject (`sub`). Clerk proves identity only; it is not the authorization record.\",\n },\n tenantId: {\n type: \"string\",\n description: \"Optional tenant scope. Omit only when the Clerk alias is globally unambiguous.\",\n },\n workspaceId: {\n type: \"string\",\n description: \"Optional workspace scope. Required when the principal has access to multiple workspaces and no default can be inferred.\",\n },\n providerProjectId: {\n type: \"string\",\n description: \"Optional Clerk project or provider instance id for tenants with multiple identity providers.\",\n },\n },\n required: [\"clerkId\"],\n response: {\n description: \"Permit-backed Lucern principal context for tenant SDK bootstrap\",\n fields: {\n principalId:\n \"string — canonical Clerk user_... ID for human sessions\",\n principalType: \"string — human, service, agent, group, or external_viewer\",\n clerkId: \"string — authenticated Clerk subject alias\",\n tenantId: \"string — resolved tenant scope\",\n workspaceId: \"string | null — resolved workspace scope\",\n roles: \"string[] — effective Permit roles\",\n scopes: \"string[] — effective scopes derived from Permit/control-plane projection\",\n groupIds: \"string[] — active Permit group memberships\",\n principalStatus: \"string — active, invited, suspended, disabled, revoked, or missing\",\n tenantStatus: \"string — projected tenant resource status\",\n workspaceStatus: \"string — projected workspace resource status\",\n permit: \"object — Permit subject, tenant, and optional workspace tuple\",\n },\n },\n ownerModule: \"control-plane\",\n ontologyPrimitive: \"identity\",\n tier: \"workhorse\",\n};\n\nexport const COMPILE_CONTEXT: McpToolContract = {\n name: \"compile_context\",\n description:\n \"Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. \" +\n \"Like `git log --graph --decorate` for the reasoning substrate — returns the canonical Pillar 3 context pack through the public API shape.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Optional topic scope ID. Omit to resolve the topic from query.\",\n },\n query: {\n type: \"string\",\n description:\n \"Focus query used to resolve the topic and rank context items. Required when topicId is omitted.\",\n },\n budget: {\n type: \"number\",\n description: \"Token budget for prompt injection planning\",\n },\n ranking: {\n type: \"string\",\n description: \"Ranking profile for context ordering\",\n enum: [\"baseline_v1\", \"weighted_v1\"],\n },\n limit: {\n type: \"number\",\n description: \"Optional per-section item limit\",\n },\n maxDepth: {\n type: \"number\",\n description: \"Optional descendant topic depth for neighborhood expansion\",\n },\n includeEntities: {\n type: \"boolean\",\n description: \"Include related ontological entities in the compiled result\",\n },\n },\n required: [],\n response: {\n description: \"Compiled context pack for the requested topic\",\n fields: {\n schemaVersion: \"string\",\n topicId: \"string\",\n topicName: \"string\",\n scopedTopicIds: \"array — topic IDs included in the compilation neighborhood\",\n generatedAt:\n \"number — deterministic graph-backed reference timestamp for this compilation\",\n ranking: \"string — baseline_v1 | weighted_v1\",\n summary: \"object — counts and scoped health signals\",\n invariants: \"array — high-confidence invariant beliefs\",\n activeBeliefs: \"array — current high-signal beliefs\",\n openQuestions: \"array — unresolved questions ranked for this query\",\n recentEvidence: \"array — recent evidence ranked for this query\",\n contradictions: \"array — unresolved contradiction records\",\n relatedEntities: \"array | undefined — ranked ontological entities in scope\",\n contextNarrative: \"array — guidance for prompt assembly\",\n injectionPolicy: \"object — token-budgeted section selections\",\n diagnostics: \"object — scoring and utilization telemetry\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// POLICY / ACL TOOLS\n// =============================================================================\n"]}
1
+ {"version":3,"sources":["../src/tool-contracts.questions-listing.ts"],"names":[],"mappings":";AAEO,IAAM,eAAA,GAAmC;AAAA,EAC9C,IAAA,EAAM,iBAAA;AAAA,EACN,WAAA,EACE,sNAAA;AAAA,EAGF,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,mBAAA,EAAoB;AAAA,IACzD,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA,EAA4B;AAAA,IACpE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa,qCAAA;AAAA,MACb,IAAA,EAAM,CAAC,QAAA,EAAU,MAAA,EAAQ,UAAU,KAAK;AAAA,KAC1C;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,QAAA,EAAU,CAAC,MAAM,CAAA;AAAA,EACjB,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,uCAAA;AAAA,IACb,MAAA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WAAA,EAAa,sCAAA;AAAA,MACb,IAAA,EAAM,CAAC,aAAA,EAAe,aAAa;AAAA,KACrC;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACf;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,UAAU,EAAC;AAAA,EACX,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,+CAAA;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,aAAA,EAAe,QAAA;AAAA,MACf,OAAA,EAAS,QAAA;AAAA,MACT,SAAA,EAAW,QAAA;AAAA,MACX,cAAA,EAAgB,iEAAA;AAAA,MAChB,WAAA,EACE,mFAAA;AAAA,MACF,OAAA,EAAS,yCAAA;AAAA,MACT,OAAA,EAAS,gDAAA;AAAA,MACT,UAAA,EAAY,gDAAA;AAAA,MACZ,aAAA,EAAe,0CAAA;AAAA,MACf,aAAA,EAAe,yDAAA;AAAA,MACf,cAAA,EAAgB,oDAAA;AAAA,MAChB,cAAA,EAAgB,+CAAA;AAAA,MAChB,eAAA,EAAiB,+DAAA;AAAA,MACjB,gBAAA,EAAkB,2CAAA;AAAA,MAClB,eAAA,EAAiB,iDAAA;AAAA,MACjB,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,OAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.questions-listing.js","sourcesContent":["import type { McpToolContract } from \"./tool-contracts.types\";\n\nexport const CREATE_QUESTION: McpToolContract = {\n name: \"create_question\",\n description:\n \"Commit an investigation question to the reasoning graph. \" +\n \"Like `git issue` — creates a traceable question that drives research and evidence collection. \" +\n \"Questions test beliefs and guide worktree investigation.\",\n parameters: {\n text: { type: \"string\", description: \"The question text\" },\n topicId: { type: \"string\", description: \"Optional topic scope hint\" },\n priority: {\n type: \"string\",\n description: \"Priority: urgent, high, medium, low\",\n enum: [\"urgent\", \"high\", \"medium\", \"low\"],\n },\n linkedBeliefId: {\n type: \"string\",\n description: \"Belief this question tests\",\n },\n metadata: {\n type: \"object\",\n description: \"Optional metadata merged into the question record\",\n },\n },\n required: [\"text\"],\n response: {\n description: \"The created canonical question record\",\n fields: {\n id: \"string — canonical question ID\",\n nodeId: \"string — canonical question ID\",\n questionId: \"string — canonical question ID\",\n text: \"string\",\n status: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const GET_QUESTION: McpToolContract = {\n name: \"get_question\",\n description:\n \"Read one question by ID. \" +\n \"Like `git show` — resolves the canonical question payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical question ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical question record\",\n fields: {\n id: \"string — canonical question ID\",\n nodeId: \"string — canonical question ID\",\n questionId: \"string — canonical question ID\",\n text: \"string\",\n status: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const REFINE_QUESTION: McpToolContract = {\n name: \"refine_question\",\n description:\n \"Refine a question's framing or scope. \" +\n \"Like `git commit --amend` for questions — updates the question text \" +\n \"while preserving its identity and linked evidence.\",\n parameters: {\n id: { type: \"string\", description: \"The question to refine\" },\n text: { type: \"string\", description: \"Updated question text\" },\n rationale: {\n type: \"string\",\n description: \"Why the question is being refined\",\n },\n },\n required: [\"id\", \"text\"],\n response: {\n description: \"The refined question\",\n fields: {\n id: \"string\",\n questionId: \"string\",\n updatedText: \"string\",\n previousText: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const LIST_QUESTIONS: McpToolContract = {\n name: \"list_questions\",\n description:\n \"List questions scoped to a topic or worktree. \" +\n \"Like `git issue list` — returns questions with their status, priority, and linked belief context. \" +\n \"Supports filtering by status and priority.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n worktreeId: { type: \"string\", description: \"Filter to worktree scope\" },\n status: {\n type: \"string\",\n description: \"Filter by canonical question status\",\n enum: [\"open\", \"researching\", \"answered\", \"parked\", \"closed\"],\n },\n priority: {\n type: \"string\",\n description: \"Filter by canonical question priority\",\n enum: [\"urgent\", \"high\", \"medium\", \"low\"],\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"Canonical question page\",\n fields: {\n questions: \"array — canonical question records\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const ANSWER_QUESTION: McpToolContract = {\n name: \"answer_question\",\n description:\n \"Answer a question with optional evidence links. \" +\n \"Like `git commit` on the question thread — records the answer and closes the loop with a canonical answered state.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical question ID\" },\n topicId: { type: \"string\", description: \"Topic scope for the answer\" },\n text: { type: \"string\", description: \"Answer text\" },\n confidence: {\n type: \"string\",\n description: \"Optional answer confidence\",\n enum: [\"weak\", \"medium\", \"strong\"],\n },\n evidenceIds: {\n type: \"array\",\n description: \"Optional canonical evidence IDs supporting the answer\",\n },\n rationale: { type: \"string\", description: \"Why this answer is credible\" },\n },\n required: [\"id\", \"topicId\", \"text\"],\n response: {\n description: \"Answer result\",\n fields: {\n questionId: \"string\",\n answerId: \"string\",\n status: \"string — answered\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_QUESTION_STATUS: McpToolContract = {\n name: \"update_question_status\",\n description:\n \"Transition a question's status through its lifecycle. \" +\n \"Like `git issue update` — moves a question through the canonical reasoning lifecycle. \" +\n \"Status transitions preserve history and keep linked evidence intact.\",\n parameters: {\n id: { type: \"string\", description: \"The question to update\" },\n status: {\n type: \"string\",\n description: \"New status\",\n enum: [\"open\", \"researching\", \"answered\", \"parked\", \"closed\"],\n },\n rationale: { type: \"string\", description: \"Why the status is changing\" },\n },\n required: [\"id\", \"status\"],\n response: {\n description: \"Updated question status\",\n fields: {\n id: \"string\",\n questionId: \"string\",\n previousStatus: \"string\",\n newStatus: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const ARCHIVE_QUESTION: McpToolContract = {\n name: \"archive_question\",\n description:\n \"Archive a question no longer relevant to current investigation scope. \" +\n \"Like `git issue close` — removes it from active work while preserving audit history. \" +\n \"Archived questions keep their existing links to beliefs and evidence.\",\n parameters: {\n questionId: { type: \"string\", description: \"The question to archive\" },\n reason: {\n type: \"string\",\n description: \"Why the question is being archived\",\n },\n },\n required: [\"questionId\"],\n response: {\n description: \"Archive confirmation\",\n fields: {\n questionId: \"string\",\n status: \"string — 'archived'\",\n archivedAt: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE_TO_QUESTION: McpToolContract = {\n name: \"link_evidence_to_question\",\n description:\n \"Link evidence to the question it helps answer. \" +\n \"Like `git notes add` — attaches supporting detail to an active question. \" +\n \"Question-level links improve answer quality and traceability to beliefs.\",\n parameters: {\n evidenceId: { type: \"string\", description: \"The evidence to link\" },\n questionId: {\n type: \"string\",\n description: \"The question this evidence addresses\",\n },\n relevance: { type: \"number\", description: \"Relevance score in [0,1]\" },\n rationale: {\n type: \"string\",\n description: \"How this evidence bears on the question\",\n },\n },\n required: [\"evidenceId\", \"questionId\"],\n response: {\n description: \"The created edge\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n questionId: \"string\",\n relevance: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// ANSWER LIFECYCLE TOOLS\n// =============================================================================\n\nexport const CREATE_ANSWER: McpToolContract = {\n name: \"create_answer\",\n description:\n \"Create an answer node responding to a question. \" +\n \"Like `git commit` for resolved questions — creates an immutable answer snapshot at L2. \" +\n \"New answers supersede old ones, preserving full version history. \" +\n \"Answers link to supporting evidence via based_on edges.\",\n parameters: {\n questionNodeId: {\n type: \"string\",\n description: \"The question node ID this answers\",\n },\n answerText: {\n type: \"string\",\n description: \"The answer content — the actual response to the question\",\n },\n topicId: {\n type: \"string\",\n description: \"Topic scope (optional if question already has topicId)\",\n },\n confidence: {\n type: \"string\",\n description:\n \"Answer confidence: definitive, strong, moderate, weak, speculative\",\n },\n evidenceNodeIds: {\n type: \"array\",\n description: \"Supporting evidence node IDs to link via based_on edges\",\n },\n answerSource: {\n type: \"string\",\n description:\n \"How the answer was produced: human, ai_generated, deep_research, synthesis\",\n },\n },\n required: [\"questionNodeId\", \"answerText\"],\n response: {\n description: \"The created answer node with version metadata\",\n fields: {\n nodeId: \"string — unique node identifier\",\n globalId: \"string — globally unique ID\",\n versionNumber: \"number — version of this answer (auto-incremented)\",\n questionNodeId: \"string — the question this answers\",\n confidence: \"string — answer confidence level\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"showcase\",\n};\n\nexport const GET_ANSWER: McpToolContract = {\n name: \"get_answer\",\n description:\n \"Get the latest answer for a question. \" +\n \"Like `git show HEAD` for a question's resolution — returns the active answer snapshot. \" +\n \"Returns null if the question is unanswered.\",\n parameters: {\n questionNodeId: {\n type: \"string\",\n description: \"The question node ID to get the answer for\",\n },\n },\n required: [\"questionNodeId\"],\n response: {\n description: \"The active answer node or null\",\n fields: {\n nodeId: \"string | null\",\n globalId: \"string | null\",\n answerText: \"string | null\",\n versionNumber: \"number\",\n isLatest: \"boolean\",\n evidenceCount: \"number\",\n confidence: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const GET_HIGH_PRIORITY_QUESTIONS: McpToolContract = {\n name: \"get_high_priority_questions\",\n description:\n \"Rank open questions by urgency and expected decision impact. \" +\n \"Like `git issue list --sort=priority` — brings the highest-leverage open questions to the top. \" +\n \"Ranking accounts for linked belief criticality and evidence gaps.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n limit: { type: \"number\", description: \"Maximum results (default: 20)\" },\n includeAnswered: {\n type: \"boolean\",\n description: \"Include answered questions (default: false)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Priority-ranked questions\",\n fields: {\n questions:\n \"array — { questionId, text, priority, urgencyScore, linkedBeliefCount, evidenceGapCount }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\nexport const FIND_MISSING_QUESTIONS: McpToolContract = {\n name: \"find_missing_questions\",\n description:\n \"Identify beliefs missing testing questions. \" +\n \"Like `git diff --check` — surfaces reasoning coverage gaps before merge. \" +\n \"Returns candidate beliefs that need explicit question coverage.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n minConfidence: {\n type: \"number\",\n description: \"Only check beliefs above this confidence (default: 0)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Beliefs missing testing questions\",\n fields: {\n gaps: \"array — { beliefId, canonicalText, confidence, suggestedQuestions }\",\n totalGaps: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"question\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// LISTING & QUERY TOOLS\n// =============================================================================\n\nexport const LIST_BELIEFS: McpToolContract = {\n name: \"list_beliefs\",\n description:\n \"List beliefs scoped to a topic or worktree. \" +\n \"Like `git log --oneline` — returns beliefs with their confidence, status, and scoring state. \" +\n \"Supports filtering by status and confidence threshold.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n worktreeId: { type: \"string\", description: \"Filter to worktree scope\" },\n status: {\n type: \"string\",\n description: \"Filter: unscored, scored, archived\",\n enum: [\"unscored\", \"scored\", \"archived\"],\n },\n minConfidence: {\n type: \"number\",\n description: \"Minimum confidence threshold\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum results\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Canonical belief page\",\n fields: {\n beliefs: \"array — canonical belief records\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const LIST_WORKTREES: McpToolContract = {\n name: \"list_worktrees\",\n description:\n \"List all worktrees for a topic. \" +\n \"Like `git worktree list` — shows active and completed investigation branches \" +\n \"with lifecycle phase, pipeline campaign/lane, status, and belief counts.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n status: {\n type: \"string\",\n description: \"Filter: active, merged, abandoned\",\n enum: [\"active\", \"merged\", \"abandoned\"],\n },\n groupBy: {\n type: \"string\",\n description: \"Optional grouping mode for the response.\",\n enum: [\"campaign\", \"lane\", \"flat\"],\n },\n lane: {\n type: \"string\",\n description: \"Filter by GitButler-aligned lane name.\",\n },\n campaign: {\n type: \"number\",\n description: \"Filter by top-level pipeline campaign number.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum results to return.\",\n },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Worktrees with lifecycle phase, campaign, lane, status, belief count, and creation time\",\n fields: {\n worktrees:\n \"array — { worktreeId, title, phase, campaign, lane, laneOrderInCampaign, orderInLane, status, beliefCount, createdAt }\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const LIST_ALL_WORKTREES: McpToolContract = {\n name: \"list_all_worktrees\",\n description:\n \"List ALL worktrees across ALL topics in one query. No topic scope required. \" +\n \"Like `git worktree list --all` — returns the complete pipeline inventory with \" +\n \"campaign, lane, lane order, dependencies, and status. \" +\n \"Supports filtering by status, lane, and campaign. \" +\n \"This is the PM's primary pipeline query — one call, full picture.\",\n parameters: {\n status: {\n type: \"string\",\n description:\n \"Filter by status: planning, active, completed, abandoned, superseded, long_term, idea, paused, suggested, dismissed\",\n enum: [\n \"planning\",\n \"active\",\n \"completed\",\n \"abandoned\",\n \"superseded\",\n \"long_term\",\n \"idea\",\n \"paused\",\n \"suggested\",\n \"dismissed\",\n ],\n },\n lane: {\n type: \"string\",\n description:\n \"Filter by lane name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity')\",\n },\n campaign: {\n type: \"number\",\n description:\n \"Filter by campaign number (e.g., 1, 2, 3). Returns only worktrees in that campaign.\",\n },\n groupBy: {\n type: \"string\",\n description: \"Optional grouping mode for the response.\",\n enum: [\"campaign\", \"lane\", \"flat\"],\n },\n limit: {\n type: \"number\",\n description: \"Maximum results to return (default: 500, max: 1000)\",\n },\n },\n required: [],\n response: {\n description: \"All worktrees across all topics with full pipeline metadata\",\n fields: {\n worktrees:\n \"array — { worktreeId, title, topicId, topicName, phase, status, hypothesis, campaign, lane, laneOrderInCampaign, orderInLane, dependsOn, blocks, gate, createdAt }\",\n total: \"number — total count after filtering\",\n lanes: \"object — { laneName: count } summary of worktrees per lane\",\n campaigns:\n \"object — { campaignNumber: count } summary of worktrees per campaign\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n};\n\nexport const GET_WORKTREE: McpToolContract = {\n name: \"get_worktree\",\n description:\n \"Get one worktree by ID. \" +\n \"Like `git worktree list --porcelain <worktree>` — inspects one investigation branch without scanning the full pipeline inventory.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"Canonical worktree ID to retrieve\" },\n id: { type: \"string\", description: \"Legacy alias for worktreeId\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Single worktree record with pipeline metadata\",\n fields: {\n worktree:\n \"object — { worktreeId, title, topicId, status, hypothesis, campaign, lane, laneOrderInCampaign, orderInLane, dependsOn, blocks, gate }\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const LIST_CAMPAIGNS: McpToolContract = {\n name: \"list_campaigns\",\n description:\n \"List compact pipeline campaigns with their nested lanes. \" +\n \"Use this to see the top-level campaign > lane > worktree shape without pulling the full worktree inventory.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Optional topic scope.\",\n },\n status: {\n type: \"string\",\n description:\n \"Optional worktree status filter before grouping campaigns and lanes.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum worktrees to scan before grouping.\",\n },\n },\n required: [],\n response: {\n description: \"Pipeline campaigns with nested lane summaries.\",\n fields: {\n campaigns:\n \"array — { campaign, lanes: [{ lane, laneOrderInCampaign, worktreeCount, activeCount, readyCount, blockedCount, completedCount, nextWorktree }] }\",\n totalWorktrees: \"number — total worktrees scanned after filtering\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n};\n\nexport const ACTIVATE_WORKTREE: McpToolContract = {\n name: \"activate_worktree\",\n description:\n \"Activate a worktree to begin investigation. \" +\n \"Like `git checkout <branch>` — transitions a worktree from planning to active status. \" +\n \"Sets the initial phase and enables belief/question editing within the worktree scope.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to activate\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Activation result with initial phase\",\n fields: {\n worktreeId: \"string\",\n status: \"string — 'active'\",\n phase: \"string\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_WORKTREE_TARGETS: McpToolContract = {\n name: \"update_worktree_targets\",\n description:\n \"Update the target beliefs and questions tracked by a worktree. \" +\n \"Like `git add/rm <files>` — stages or unstages beliefs/questions for investigation \" +\n \"within the worktree scope. Supports adding and removing targets atomically.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to update\" },\n addBeliefIds: {\n type: \"array\",\n description: \"Belief node IDs to add to the worktree\",\n },\n addQuestionIds: {\n type: \"array\",\n description: \"Question node IDs to add to the worktree\",\n },\n removeBeliefIds: {\n type: \"array\",\n description: \"Belief node IDs to remove from the worktree\",\n },\n removeQuestionIds: {\n type: \"array\",\n description: \"Question node IDs to remove from the worktree\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Updated target counts\",\n fields: {\n worktreeId: \"string\",\n beliefCount: \"number\",\n questionCount: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_WORKTREE_METADATA: McpToolContract = {\n name: \"update_worktree_metadata\",\n description:\n \"Update worktree sequencing metadata — campaign, lane, dependencies, blocking relations, and gates. \" +\n \"Like `git config` for a worktree — sets the scheduling and dependency metadata that determines \" +\n \"when this worktree can activate relative to others. Use to backfill or correct sequencing data.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to update\" },\n hypothesis: {\n type: \"string\",\n description: \"Testable claim this worktree investigates\",\n },\n campaign: {\n type: \"number\",\n description: \"Top-level pipeline campaign number.\",\n },\n lane: {\n type: \"string\",\n description:\n \"GitButler-aligned workstream lane name inside the campaign.\",\n },\n laneOrderInCampaign: {\n type: \"number\",\n description: \"Ordering for this lane within the campaign.\",\n },\n orderInLane: {\n type: \"number\",\n description: \"Position of this worktree inside its lane.\",\n },\n dependsOn: {\n type: \"array\",\n description:\n \"Worktree IDs that must complete before this one can activate\",\n },\n blocks: {\n type: \"array\",\n description: \"Worktree IDs that are blocked until this one completes\",\n },\n gate: {\n type: \"string\",\n description: \"Exit gate name (e.g., 'gate:ontology-schema-hardened')\",\n },\n rationale: {\n type: \"string\",\n description: \"Why this worktree is sequenced here\",\n },\n objective: {\n type: \"string\",\n description: \"What we're trying to learn/prove\",\n },\n proofArtifacts: {\n type: \"array\",\n description:\n \"Typed proof artifacts that define what evidence or deliverables this worktree must emit before it can claim success.\",\n },\n staffingHint: {\n type: \"string\",\n description:\n \"Advisory staffing shape for the worktree (for example `backend+tests` or `fullstack`).\",\n },\n lastReconciledAt: {\n type: \"number\",\n description:\n \"Timestamp of the last deterministic workflow reconciliation pass against this worktree.\",\n },\n autoFixPolicy: {\n type: \"object\",\n description:\n \"Calibrated auto-fix policy controlling dry-run vs safe execution, per-run action caps, and permitted mutation tiers.\",\n },\n status: {\n type: \"string\",\n description:\n \"Override the worktree status. Use for lifecycle transitions like marking a worktree superseded, long-term, or as a raw idea.\",\n enum: [\n \"suggested\",\n \"planning\",\n \"active\",\n \"paused\",\n \"completed\",\n \"dismissed\",\n \"abandoned\",\n \"superseded\",\n \"long_term\",\n \"idea\",\n ],\n },\n topicId: {\n type: \"string\",\n description:\n \"Reassign this worktree's primary topic. Validates the target topic exists before updating.\",\n },\n additionalTopicIds: {\n type: \"array\",\n description:\n \"Set additional topic associations for cross-topic worktrees. Each topic ID is validated before updating. \" +\n \"Use when a worktree spans multiple knowledge domains.\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Update confirmation\",\n fields: { worktreeId: \"string\", success: \"boolean\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\nexport const IDENTITY_WHOAMI: McpToolContract = {\n name: \"identity_whoami\",\n description:\n \"Read the authenticated identity summary for the current session. \" +\n \"Like `git config --get user.name` — shows who the current MCP session is acting as.\",\n parameters: {},\n required: [],\n response: {\n description: \"Canonical identity summary for the current session\",\n fields: {\n principalId:\n \"string — canonical principal identifier; for humans this is the Clerk user_... ID\",\n principalType: \"string — human, service, agent, group, or external_viewer\",\n tenantId: \"string | undefined — resolved tenant scope\",\n workspaceId: \"string | undefined — resolved workspace scope\",\n scopes: \"string[] | undefined — granted scopes for this session\",\n roles: \"string[] | undefined — canonical roles for this session\",\n },\n },\n ownerModule: \"identity-core\",\n ontologyPrimitive: \"identity\",\n tier: \"workhorse\",\n};\n\nexport const RESOLVE_INTERACTIVE_PRINCIPAL: McpToolContract = {\n name: \"resolve_interactive_principal\",\n description:\n \"Read the Permit-backed Lucern principal context for an authenticated Clerk user. \" +\n \"Like `git config --get user.email` plus the repository ACL — resolves the Clerk subject into tenant/workspace authorization context.\",\n parameters: {\n clerkId: {\n type: \"string\",\n description: \"Authenticated Clerk subject (`sub`). Clerk proves identity only; it is not the authorization record.\",\n },\n tenantId: {\n type: \"string\",\n description: \"Optional tenant scope. Omit only when the Clerk alias is globally unambiguous.\",\n },\n workspaceId: {\n type: \"string\",\n description: \"Optional workspace scope. Required when the principal has access to multiple workspaces and no default can be inferred.\",\n },\n providerProjectId: {\n type: \"string\",\n description: \"Optional Clerk project or provider instance id for tenants with multiple identity providers.\",\n },\n },\n required: [\"clerkId\"],\n response: {\n description: \"Permit-backed Lucern principal context for tenant SDK bootstrap\",\n fields: {\n principalId:\n \"string — canonical Clerk user_... ID for human sessions\",\n principalType: \"string — human, service, agent, group, or external_viewer\",\n clerkId: \"string — authenticated Clerk subject alias\",\n tenantId: \"string — resolved tenant scope\",\n workspaceId: \"string | null — resolved workspace scope\",\n roles: \"string[] — effective Permit roles\",\n scopes: \"string[] — effective scopes derived from Permit/control-plane projection\",\n groupIds: \"string[] — active Permit group memberships\",\n principalStatus: \"string — active, invited, suspended, disabled, revoked, or missing\",\n tenantStatus: \"string — projected tenant resource status\",\n workspaceStatus: \"string — projected workspace resource status\",\n permit: \"object — Permit subject, tenant, and optional workspace tuple\",\n },\n },\n ownerModule: \"control-plane\",\n ontologyPrimitive: \"identity\",\n tier: \"workhorse\",\n};\n\nexport const COMPILE_CONTEXT: McpToolContract = {\n name: \"compile_context\",\n description:\n \"Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. \" +\n \"Like `git log --graph --decorate` for the reasoning substrate — returns the canonical Pillar 3 context pack through the public API shape.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Optional topic scope ID. Omit to resolve the topic from query.\",\n },\n query: {\n type: \"string\",\n description:\n \"Focus query used to resolve the topic and rank context items. Required when topicId is omitted.\",\n },\n topicHint: {\n type: \"string\",\n description:\n \"Optional natural-language topic hint used by the resolver when topicId is omitted or stale.\",\n },\n tags: {\n type: \"array\",\n description:\n \"Optional resolver tags. Useful for narrowing topic inference without knowing the exact topic id.\",\n },\n touchedPaths: {\n type: \"array\",\n description:\n \"Optional file or documentation paths used as resolver signals.\",\n },\n sourceRef: {\n type: \"string\",\n description:\n \"Optional source reference used as a resolver signal, such as a worktree id, PR, or feature slug.\",\n },\n sourceKind: {\n type: \"string\",\n description:\n \"Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs.\",\n },\n budget: {\n type: \"number\",\n description: \"Token budget for prompt injection planning\",\n },\n ranking: {\n type: \"string\",\n description: \"Ranking profile for context ordering\",\n enum: [\"baseline_v1\", \"weighted_v1\"],\n },\n limit: {\n type: \"number\",\n description: \"Optional per-section item limit\",\n },\n maxDepth: {\n type: \"number\",\n description: \"Optional descendant topic depth for neighborhood expansion\",\n },\n includeEntities: {\n type: \"boolean\",\n description: \"Include related ontological entities in the compiled result\",\n },\n },\n required: [],\n response: {\n description: \"Compiled context pack for the requested topic\",\n fields: {\n schemaVersion: \"string\",\n topicId: \"string\",\n topicName: \"string\",\n scopedTopicIds: \"array — topic IDs included in the compilation neighborhood\",\n generatedAt:\n \"number — deterministic graph-backed reference timestamp for this compilation\",\n ranking: \"string — baseline_v1 | weighted_v1\",\n summary: \"object — counts and scoped health signals\",\n invariants: \"array — high-confidence invariant beliefs\",\n activeBeliefs: \"array — current high-signal beliefs\",\n openQuestions: \"array — unresolved questions ranked for this query\",\n recentEvidence: \"array — recent evidence ranked for this query\",\n contradictions: \"array — unresolved contradiction records\",\n relatedEntities: \"array | undefined — ranked ontological entities in scope\",\n contextNarrative: \"array — guidance for prompt assembly\",\n injectionPolicy: \"object — token-budgeted section selections\",\n diagnostics: \"object — scoring and utilization telemetry\",\n },\n },\n ownerModule: \"reasoning-kernel\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// POLICY / ACL TOOLS\n// =============================================================================\n"]}
@@ -9,3 +9,5 @@ export { ACTIVATE_WORKTREE, ANSWER_QUESTION, ARCHIVE_QUESTION, COMPILE_CONTEXT,
9
9
  export { GIT_SEMANTIC_REQUIRED_TOOLS, MCP_TOOL_CONTRACTS, validateGitSemantics } from './tool-contracts.js';
10
10
  export { ADD_WORKTREE, MERGE, OPEN_PULL_REQUEST, PUSH } from './tool-contracts.worktrees.js';
11
11
  import './tool-contracts.types.js';
12
+ import './tool-contracts.embeddings.js';
13
+ import './tool-contracts.hybrid-discovery.js';
@@ -3900,6 +3900,26 @@ var COMPILE_CONTEXT = {
3900
3900
  type: "string",
3901
3901
  description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
3902
3902
  },
3903
+ topicHint: {
3904
+ type: "string",
3905
+ description: "Optional natural-language topic hint used by the resolver when topicId is omitted or stale."
3906
+ },
3907
+ tags: {
3908
+ type: "array",
3909
+ description: "Optional resolver tags. Useful for narrowing topic inference without knowing the exact topic id."
3910
+ },
3911
+ touchedPaths: {
3912
+ type: "array",
3913
+ description: "Optional file or documentation paths used as resolver signals."
3914
+ },
3915
+ sourceRef: {
3916
+ type: "string",
3917
+ description: "Optional source reference used as a resolver signal, such as a worktree id, PR, or feature slug."
3918
+ },
3919
+ sourceKind: {
3920
+ type: "string",
3921
+ description: "Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs."
3922
+ },
3903
3923
  budget: {
3904
3924
  type: "number",
3905
3925
  description: "Token budget for prompt injection planning"
@@ -4226,6 +4246,268 @@ var OPEN_PULL_REQUEST = {
4226
4246
  tier: "showcase"
4227
4247
  };
4228
4248
 
4249
+ // src/tool-contracts.embeddings.ts
4250
+ var sharedEmbeddingParameters = {
4251
+ topicId: {
4252
+ type: "string",
4253
+ description: "Topic whose epistemic node embedding index should be queried."
4254
+ },
4255
+ workspaceId: {
4256
+ type: "string",
4257
+ description: "Workspace scope for the embedding operation."
4258
+ },
4259
+ nodeType: {
4260
+ type: "string",
4261
+ description: "Optional epistemic node type filter."
4262
+ },
4263
+ embeddingModel: {
4264
+ type: "string",
4265
+ description: "Optional embedding model filter."
4266
+ },
4267
+ limit: {
4268
+ type: "number",
4269
+ description: "Maximum rows to return."
4270
+ }
4271
+ };
4272
+ var LIST_MISSING_EMBEDDINGS = {
4273
+ name: "list_missing_embeddings",
4274
+ description: "List epistemic nodes missing fresh Convex embeddings. Like `git status` for the semantic index \u2014 shows which graph nodes still need indexing before retrieval can be trusted.",
4275
+ parameters: sharedEmbeddingParameters,
4276
+ required: ["topicId", "workspaceId"],
4277
+ response: {
4278
+ description: "Missing or stale embedding candidates",
4279
+ fields: {
4280
+ nodes: "array \u2014 node candidates missing fresh embeddings",
4281
+ total: "number \u2014 candidate count",
4282
+ nextCursor: "string | null"
4283
+ }
4284
+ },
4285
+ ownerModule: "reasoning-kernel",
4286
+ ontologyPrimitive: "graph",
4287
+ tier: "workhorse"
4288
+ };
4289
+ var SEARCH_EMBEDDINGS = {
4290
+ name: "search_embeddings",
4291
+ description: "Search topic-scoped epistemic nodes through the Convex vector index. Like `git grep` with semantic distance \u2014 finds matching beliefs, questions, evidence, and other nodes even when wording differs.",
4292
+ parameters: {
4293
+ ...sharedEmbeddingParameters,
4294
+ queryText: {
4295
+ type: "string",
4296
+ description: "Natural-language query to embed and search with."
4297
+ },
4298
+ queryVector: {
4299
+ type: "array",
4300
+ description: "Optional precomputed query vector."
4301
+ },
4302
+ minScore: {
4303
+ type: "number",
4304
+ description: "Optional minimum cosine-similarity score."
4305
+ }
4306
+ },
4307
+ required: ["topicId", "workspaceId"],
4308
+ response: {
4309
+ description: "Vector search matches",
4310
+ fields: {
4311
+ results: "array \u2014 semantic matches with nodeId, nodeType, score, text, and provenance",
4312
+ total: "number \u2014 match count",
4313
+ nextCursor: "string | null"
4314
+ }
4315
+ },
4316
+ ownerModule: "reasoning-kernel",
4317
+ ontologyPrimitive: "graph",
4318
+ tier: "showcase"
4319
+ };
4320
+ var GET_EMBEDDINGS_BY_NODE_IDS = {
4321
+ name: "get_embeddings_by_node_ids",
4322
+ description: "Fetch embedding records for explicit epistemic node IDs. Like `git show` for semantic-index rows \u2014 inspects exactly which vectors exist for named graph nodes.",
4323
+ parameters: {
4324
+ ...sharedEmbeddingParameters,
4325
+ nodeIds: {
4326
+ type: "array",
4327
+ description: "Epistemic node IDs to inspect."
4328
+ }
4329
+ },
4330
+ required: ["topicId", "workspaceId", "nodeIds"],
4331
+ response: {
4332
+ description: "Embedding records for explicit node IDs",
4333
+ fields: {
4334
+ embeddings: "array \u2014 embedding metadata records",
4335
+ total: "number \u2014 embedding count",
4336
+ nextCursor: "string | null"
4337
+ }
4338
+ },
4339
+ ownerModule: "reasoning-kernel",
4340
+ ontologyPrimitive: "graph",
4341
+ tier: "workhorse"
4342
+ };
4343
+ var QUEUE_EMBEDDING_BACKFILL = {
4344
+ name: "queue_embedding_backfill",
4345
+ description: "Queue background embedding generation for explicit epistemic nodes. Like `git add` for semantic-index work \u2014 stages graph nodes for the kernel backfill scheduler.",
4346
+ parameters: {
4347
+ ...sharedEmbeddingParameters,
4348
+ nodeIds: {
4349
+ type: "array",
4350
+ description: "Epistemic node IDs to queue for embedding generation."
4351
+ }
4352
+ },
4353
+ required: ["topicId", "workspaceId", "nodeIds"],
4354
+ response: {
4355
+ description: "Backfill queue receipt",
4356
+ fields: {
4357
+ queued: "number \u2014 queued node count",
4358
+ nodeIds: "array \u2014 node IDs queued for embedding generation"
4359
+ }
4360
+ },
4361
+ ownerModule: "reasoning-kernel",
4362
+ ontologyPrimitive: "graph",
4363
+ tier: "workhorse"
4364
+ };
4365
+
4366
+ // src/tool-contracts.hybrid-discovery.ts
4367
+ var hybridParameters = {
4368
+ query: {
4369
+ type: "string",
4370
+ description: "Natural-language query text to resolve against the typed reasoning graph."
4371
+ },
4372
+ queryText: {
4373
+ type: "string",
4374
+ description: "Explicit query text alias for clients that separate command words from search text."
4375
+ },
4376
+ text: {
4377
+ type: "string",
4378
+ description: "Raw pasted text to use as a semantic retrieval seed."
4379
+ },
4380
+ topicId: {
4381
+ type: "string",
4382
+ description: "Optional topic scope. When omitted, semantic topic candidates are resolved first."
4383
+ },
4384
+ workspaceId: {
4385
+ type: "string",
4386
+ description: "Optional workspace scope used by semantic topic candidates and vector search."
4387
+ },
4388
+ nodeId: {
4389
+ type: "string",
4390
+ description: "Optional source node used for related-node or impact analysis."
4391
+ },
4392
+ include: {
4393
+ type: "array",
4394
+ description: "Result families to include, such as topics, nodes, worktrees, tasks, evidence, and edges."
4395
+ },
4396
+ via: {
4397
+ type: "array",
4398
+ description: "Retrieval methods to use: bm25, embeddings, edges, topic-tree, state, graph-algorithms."
4399
+ },
4400
+ depth: {
4401
+ type: "number",
4402
+ description: "Graph expansion depth. Defaults to 1 and is capped by the server."
4403
+ },
4404
+ limit: {
4405
+ type: "number",
4406
+ description: "Maximum rows per result family."
4407
+ },
4408
+ minScore: {
4409
+ type: "number",
4410
+ description: "Minimum semantic or fused score for candidate rows."
4411
+ },
4412
+ campaign: {
4413
+ type: "number",
4414
+ description: "Optional worktree campaign filter."
4415
+ },
4416
+ lane: {
4417
+ type: "string",
4418
+ description: "Optional worktree lane filter."
4419
+ },
4420
+ status: {
4421
+ type: "string",
4422
+ description: "Optional node, task, or worktree state/status filter."
4423
+ },
4424
+ nodeTypes: {
4425
+ type: "array",
4426
+ description: "Optional epistemic node types to include."
4427
+ },
4428
+ changedPaths: {
4429
+ type: "array",
4430
+ description: "Changed file paths used as impact-analysis query signals."
4431
+ },
4432
+ metadata: {
4433
+ type: "object",
4434
+ description: "Optional planner metadata for receipts and caller provenance."
4435
+ }
4436
+ };
4437
+ var hybridResponse = {
4438
+ description: "Hybrid semantic graph planner response with ranked result families and retrieval receipt.",
4439
+ fields: {
4440
+ results: "array \u2014 ranked mixed graph results with score, kind, source, and ranking signals",
4441
+ topics: "array \u2014 candidate or traversed topics",
4442
+ nodes: "array \u2014 matching epistemic nodes",
4443
+ worktrees: "array \u2014 matching worktrees",
4444
+ tasks: "array \u2014 matching tasks",
4445
+ evidence: "array \u2014 matching evidence",
4446
+ edges: "array \u2014 graph neighborhood edges",
4447
+ receipt: "object \u2014 planner steps, candidate counts, ranking weights, source/cache posture"
4448
+ }
4449
+ };
4450
+ var HYBRID_DISCOVER = {
4451
+ name: "hybrid_discover",
4452
+ description: "Discover typed reasoning graph context with BM25, embeddings, topic tree traversal, and graph neighborhoods. Like `git grep` plus `git log --graph` for Lucern's typed reasoning graph \u2014 finds the relevant branches of thought and explains why.",
4453
+ parameters: hybridParameters,
4454
+ required: [],
4455
+ response: hybridResponse,
4456
+ ownerModule: "graph-intelligence",
4457
+ ontologyPrimitive: "graph",
4458
+ tier: "showcase"
4459
+ };
4460
+ var RESOLVE_TOPIC_SEMANTIC = {
4461
+ name: "resolve_topic_semantic",
4462
+ description: "Resolve an ambiguous topic using BM25, vector candidates, and topic-tree context. Like `git remote show` for a reasoning topic \u2014 finds the canonical branch and nearby branches before reading deeper.",
4463
+ parameters: hybridParameters,
4464
+ required: [],
4465
+ response: hybridResponse,
4466
+ ownerModule: "graph-intelligence",
4467
+ ontologyPrimitive: "graph",
4468
+ tier: "showcase"
4469
+ };
4470
+ var EXPAND_GRAPH_NEIGHBORHOOD = {
4471
+ name: "expand_graph_neighborhood",
4472
+ description: "Expand a typed graph neighborhood around a query, topic, or node. Like `git log --graph --decorate` for reasoning state \u2014 follows typed edges and surfaces the surrounding context.",
4473
+ parameters: hybridParameters,
4474
+ required: [],
4475
+ response: hybridResponse,
4476
+ ownerModule: "graph-intelligence",
4477
+ ontologyPrimitive: "graph",
4478
+ tier: "showcase"
4479
+ };
4480
+ var FIND_RELATED_NODES = {
4481
+ name: "find_related_nodes",
4482
+ description: "Find semantically and structurally related nodes across the reasoning graph. Like `git blame` across branches \u2014 starts from a node or text and finds nearby responsibility, evidence, and related claims.",
4483
+ parameters: hybridParameters,
4484
+ required: [],
4485
+ response: hybridResponse,
4486
+ ownerModule: "graph-intelligence",
4487
+ ontologyPrimitive: "graph",
4488
+ tier: "showcase"
4489
+ };
4490
+ var ANALYZE_GRAPH_IMPACT = {
4491
+ name: "analyze_graph_impact",
4492
+ description: "Analyze which graph objects are affected by files, PR text, incidents, or campaign objectives. Like `git diff --name-only` plus semantic blame \u2014 maps a change signal onto topics, beliefs, tasks, and unresolved questions.",
4493
+ parameters: hybridParameters,
4494
+ required: [],
4495
+ response: hybridResponse,
4496
+ ownerModule: "graph-intelligence",
4497
+ ontologyPrimitive: "graph",
4498
+ tier: "showcase"
4499
+ };
4500
+ var DETECT_GRAPH_DRIFT = {
4501
+ name: "detect_graph_drift",
4502
+ description: "Detect duplicate, stale, orphaned, or weakly linked reasoning graph surface. Like `git fsck` for the reasoning graph \u2014 finds semantic duplicates, stale docs/code references, and missing links.",
4503
+ parameters: hybridParameters,
4504
+ required: [],
4505
+ response: hybridResponse,
4506
+ ownerModule: "graph-intelligence",
4507
+ ontologyPrimitive: "graph",
4508
+ tier: "showcase"
4509
+ };
4510
+
4229
4511
  // src/tool-contracts.ts
4230
4512
  var MCP_TOOL_CONTRACTS = {
4231
4513
  // Belief lifecycle (commit, amend, fork, archive)
@@ -4267,6 +4549,16 @@ var MCP_TOOL_CONTRACTS = {
4267
4549
  search_beliefs: SEARCH_BELIEFS,
4268
4550
  find_contradictions: FIND_CONTRADICTIONS,
4269
4551
  bisect_confidence: BISECT_CONFIDENCE,
4552
+ list_missing_embeddings: LIST_MISSING_EMBEDDINGS,
4553
+ search_embeddings: SEARCH_EMBEDDINGS,
4554
+ get_embeddings_by_node_ids: GET_EMBEDDINGS_BY_NODE_IDS,
4555
+ queue_embedding_backfill: QUEUE_EMBEDDING_BACKFILL,
4556
+ hybrid_discover: HYBRID_DISCOVER,
4557
+ resolve_topic_semantic: RESOLVE_TOPIC_SEMANTIC,
4558
+ expand_graph_neighborhood: EXPAND_GRAPH_NEIGHBORHOOD,
4559
+ find_related_nodes: FIND_RELATED_NODES,
4560
+ analyze_graph_impact: ANALYZE_GRAPH_IMPACT,
4561
+ detect_graph_drift: DETECT_GRAPH_DRIFT,
4270
4562
  // Edges (commit)
4271
4563
  create_edge: CREATE_EDGE,
4272
4564
  update_edge: UPDATE_EDGE,