@lucern/sdk 0.2.0-alpha.9 → 0.3.0-alpha.0

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 (101) hide show
  1. package/README.md +6 -0
  2. package/dist/adminClient.d.ts +15 -9
  3. package/dist/adminClient.js.map +1 -1
  4. package/dist/audience/index.d.ts +38 -0
  5. package/dist/audience/index.js +110 -0
  6. package/dist/audience/index.js.map +1 -0
  7. package/dist/beliefs/index.d.ts +463 -0
  8. package/dist/beliefs/index.js +6694 -0
  9. package/dist/beliefs/index.js.map +1 -0
  10. package/dist/beliefs/lifecycle.d.ts +24 -0
  11. package/dist/beliefs/lifecycle.js +98 -0
  12. package/dist/beliefs/lifecycle.js.map +1 -0
  13. package/dist/beliefsClient.d.ts +91 -12
  14. package/dist/beliefsClient.js +176 -7
  15. package/dist/beliefsClient.js.map +1 -1
  16. package/dist/client-DAuKnDlx.d.ts +2547 -0
  17. package/dist/client.d.ts +31 -2377
  18. package/dist/client.js +783 -245
  19. package/dist/client.js.map +1 -1
  20. package/dist/contracts/api-enums.contract.d.ts +1 -1
  21. package/dist/contracts/api-enums.contract.js +8 -2
  22. package/dist/contracts/api-enums.contract.js.map +1 -1
  23. package/dist/contracts/index.d.ts +4 -2
  24. package/dist/contracts/index.js +118 -4282
  25. package/dist/contracts/index.js.map +1 -1
  26. package/dist/contracts/mcpTools.d.ts +2 -1
  27. package/dist/contracts/mcpTools.js +22 -2981
  28. package/dist/contracts/mcpTools.js.map +1 -1
  29. package/dist/contracts/sdk-tools.contract.d.ts +1 -2
  30. package/dist/contracts/sdk-tools.contract.js +1 -4132
  31. package/dist/contracts/sdk-tools.contract.js.map +1 -1
  32. package/dist/contracts/sdkTools.d.ts +1 -2
  33. package/dist/contracts/sdkTools.js +20 -4127
  34. package/dist/contracts/sdkTools.js.map +1 -1
  35. package/dist/contracts/tool-contracts.d.ts +1 -0
  36. package/dist/contracts/tool-contracts.js +3 -0
  37. package/dist/contracts/tool-contracts.js.map +1 -0
  38. package/dist/contradictions/index.d.ts +156 -0
  39. package/dist/contradictions/index.js +6688 -0
  40. package/dist/contradictions/index.js.map +1 -0
  41. package/dist/customTools.d.ts +1 -1
  42. package/dist/decisions/index.d.ts +66 -0
  43. package/dist/decisions/index.js +6690 -0
  44. package/dist/decisions/index.js.map +1 -0
  45. package/dist/edges/index.d.ts +202 -0
  46. package/dist/edges/index.js +6689 -0
  47. package/dist/edges/index.js.map +1 -0
  48. package/dist/events.js +7 -5
  49. package/dist/events.js.map +1 -1
  50. package/dist/evidence/index.d.ts +293 -0
  51. package/dist/evidence/index.js +6689 -0
  52. package/dist/evidence/index.js.map +1 -0
  53. package/dist/evidenceClient.d.ts +119 -0
  54. package/dist/evidenceClient.js +350 -0
  55. package/dist/evidenceClient.js.map +1 -0
  56. package/dist/gatewayFacades.d.ts +8 -10
  57. package/dist/gatewayFacades.js +54 -1
  58. package/dist/gatewayFacades.js.map +1 -1
  59. package/dist/identityClient.d.ts +3 -3
  60. package/dist/identityClient.js.map +1 -1
  61. package/dist/index.d.ts +7 -6
  62. package/dist/index.js +1092 -3294
  63. package/dist/index.js.map +1 -1
  64. package/dist/lenses/index.d.ts +192 -0
  65. package/dist/lenses/index.js +6688 -0
  66. package/dist/lenses/index.js.map +1 -0
  67. package/dist/nodes/index.d.ts +61 -0
  68. package/dist/nodes/index.js +6690 -0
  69. package/dist/nodes/index.js.map +1 -0
  70. package/dist/ontologies/index.d.ts +179 -0
  71. package/dist/ontologies/index.js +6691 -0
  72. package/dist/ontologies/index.js.map +1 -0
  73. package/dist/opinion.d.ts +11 -0
  74. package/dist/opinion.js +35 -0
  75. package/dist/opinion.js.map +1 -0
  76. package/dist/questions/index.d.ts +295 -0
  77. package/dist/questions/index.js +6691 -0
  78. package/dist/questions/index.js.map +1 -0
  79. package/dist/sdk-tools.contract-B4c1Zr1o.d.ts +22 -0
  80. package/dist/sourcesClient.d.ts +24 -0
  81. package/dist/{mcpParityClient.js → sourcesClient.js} +15 -192
  82. package/dist/sourcesClient.js.map +1 -0
  83. package/dist/tool-contracts-BUiL9P6z.d.ts +22 -0
  84. package/dist/topics/index.d.ts +66 -0
  85. package/dist/topics/index.js +6689 -0
  86. package/dist/topics/index.js.map +1 -0
  87. package/dist/types.d.ts +20 -1
  88. package/dist/worktrees/index.d.ts +208 -0
  89. package/dist/worktrees/index.js +6691 -0
  90. package/dist/worktrees/index.js.map +1 -0
  91. package/package.json +55 -3
  92. package/dist/contracts/mcp-tools.contract.d.ts +0 -1
  93. package/dist/contracts/mcp-tools.contract.js +0 -2986
  94. package/dist/contracts/mcp-tools.contract.js.map +0 -1
  95. package/dist/mcpParityClient.d.ts +0 -74
  96. package/dist/mcpParityClient.js.map +0 -1
  97. package/dist/mcpParitySurface.d.ts +0 -12
  98. package/dist/mcpParitySurface.js +0 -65
  99. package/dist/mcpParitySurface.js.map +0 -1
  100. package/dist/mcpTools-DPZxowDX.d.ts +0 -254
  101. package/dist/sdkTools-CwXJDACb.d.ts +0 -150
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contracts/api-enums.contract.ts","../../src/contracts/auth-session.contract.ts","../../src/contracts/context-pack.contract.ts","../../src/contracts/lens-filter.contract.ts","../../src/contracts/lens-workflow.contract.ts","../../src/contracts/mcp-tools.contract.ts","../../src/contracts/prompt.contract.ts","../../src/contracts/sdk-tools.contract.ts","../../src/contracts/workflow-runtime.contract.ts"],"names":["LIST_TASKS","UPDATE_TASK"],"mappings":";;;;;;;AAqBO,IAAM,eAAA,GAAkB;AAAA,EAC7B,YAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAQO,IAAM,YAAA,GAAe;AAAA,EAC1B,YAAA;AAAA,EACA,wBAAA;AAAA,EACA,cAAA;AAAA,EACA,qBAAA;AAAA,EACA;AACF;AAQO,IAAM,mBAAA,GAAsB;AAAA,EACjC,gBAAA;AAAA,EACA,wBAAA;AAAA,EACA,eAAA;AAAA,EACA,kBAA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,YAAA,EAAc,WAAA;AAAA,QACd,QAAA,EAAU,CAAC,oBAAoB,CAAA;AAAA,QAC/B,UAAA,EAAY,IAAA;AAAA,QACZ,QAAA,EAAU,EAAE,IAAA,EAAM,MAAA;AAAO,OAC3B;AAAA,MACA;AAAA,QACE,QAAA,EAAU,uBAAA;AAAA,QACV,IAAA,EAAM,eAAA;AAAA,QACN,KAAA,EAAO,uBAAA;AAAA,QACP,WAAA,EACE,+EAAA;AAAA,QACF,YAAA,EAAc,gBAAA;AAAA,QACd,QAAA,EAAU,CAAC,mBAAA,EAAqB,eAAe,CAAA;AAAA,QAC/C,QAAA,EAAU,EAAE,IAAA,EAAM,YAAA;AAAa;AACjC,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL;AAAA,QACE,MAAA,EAAQ,kBAAA;AAAA,QACR,KAAA,EAAO,eAAA;AAAA,QACP,WAAA,EAAa,+BAAA;AAAA,QACb,SAAA,EAAW,CAAC,sBAAA,EAAwB,uBAAuB;AAAA,OAC7D;AAAA,MACA;AAAA,QACE,MAAA,EAAQ,2BAAA;AAAA,QACR,KAAA,EAAO,oBAAA;AAAA,QACP,WAAA,EACE,gFAAA;AAAA,QACF,SAAA,EAAW,CAAC,sBAAsB;AAAA;AACpC,KACF;AAAA,IACA,OAAA,EAAS,CAAC,mBAAA,EAAqB,eAAA,EAAiB,oBAAoB,CAAA;AAAA,IACpE,eAAA,EAAiB,CAAC,gBAAgB;AAAA;AAEtC","file":"index.js","sourcesContent":["/**\n * API Enum Contract Definitions\n *\n * Canonical enum values for all API-facing enumerations.\n * These MUST match the kernel schema validators exactly.\n *\n * Source of truth: lucern/packages/reasoning-kernel/src/adapters/schema/spine/\n */\n\n// =============================================================================\n// BELIEF STATUS\n// =============================================================================\n\n/**\n * Belief epistemic lifecycle — tracks maturity from raw claim to verified fact.\n *\n * - assumption: Untested raw claim, lowest epistemic standing\n * - hypothesis: Under active investigation, being tested against evidence\n * - belief: Validated through investigation, carries confidence score\n * - fact: Resolved outcome anchored by strong evidence\n */\nexport const BELIEF_STATUSES = [\n \"assumption\",\n \"hypothesis\",\n \"belief\",\n \"fact\",\n] as const;\nexport type BeliefStatus = (typeof BELIEF_STATUSES)[number];\n\n// =============================================================================\n// FORK REASONS\n// =============================================================================\n\n/** Why a scored belief was branched into a new version */\nexport const FORK_REASONS = [\n \"refinement\",\n \"contradiction_response\",\n \"scope_change\",\n \"confidence_collapse\",\n \"manual\",\n] as const;\nexport type ForkReason = (typeof FORK_REASONS)[number];\n\n// =============================================================================\n// CONFIDENCE TRIGGERS\n// =============================================================================\n\n/** What caused a confidence change — every modulation must declare its trigger */\nexport const CONFIDENCE_TRIGGERS = [\n \"evidence_added\",\n \"contradiction_detected\",\n \"merge_outcome\",\n \"worktree_outcome\",\n \"manual\",\n \"decay\",\n] as const;\nexport type ConfidenceTrigger = (typeof CONFIDENCE_TRIGGERS)[number];\n\n// =============================================================================\n// EDGE TYPES — The 6 canonical epistemic edge types\n// =============================================================================\n\n/**\n * Core epistemic edge types — the grammar of reasoning relationships.\n *\n * - supports: Evidence or belief reinforces another belief (weight = strength)\n * - informs: Evidence bears on a belief (directional, weighted)\n * - depends_on: Belief B requires belief A to hold\n * - derived_from: Belief was derived from another (lineage)\n * - contains: Structural containment (topic contains beliefs)\n * - tests: Question tests a belief (falsification link)\n */\nexport const EPISTEMIC_EDGE_TYPES = [\n \"supports\",\n \"informs\",\n \"depends_on\",\n \"derived_from\",\n \"contains\",\n \"tests\",\n] as const;\nexport type EpistemicEdgeType = (typeof EPISTEMIC_EDGE_TYPES)[number];\n\n/** Structural and lifecycle edges — required for graph integrity */\nexport const STRUCTURAL_EDGE_TYPES = [\n \"supersedes\",\n \"responds_to\",\n \"belongs_to\",\n \"relates_to_thesis\",\n] as const;\nexport type StructuralEdgeType = (typeof STRUCTURAL_EDGE_TYPES)[number];\n\n/** All valid edge types (epistemic + structural) */\nexport const EDGE_TYPES = [\n ...EPISTEMIC_EDGE_TYPES,\n ...STRUCTURAL_EDGE_TYPES,\n] as const;\nexport type EdgeType = EpistemicEdgeType | StructuralEdgeType;\n\n// =============================================================================\n// REASONING METHODS\n// =============================================================================\n\n/** How an edge relationship was determined */\nexport const REASONING_METHODS = [\n \"deductive\",\n \"inductive\",\n \"abductive\",\n \"analogical\",\n \"empirical\",\n] as const;\nexport type ReasoningMethod = (typeof REASONING_METHODS)[number];\n\n// =============================================================================\n// CONTRADICTION ENUMS\n// =============================================================================\n\n/** Defeat types (Pollock taxonomy) — how a contradiction operates */\nexport const DEFEAT_TYPES = [\n \"rebuts\",\n \"undercuts\",\n \"undermines\",\n] as const;\nexport type DefeatType = (typeof DEFEAT_TYPES)[number];\n\n/** Contradiction severity */\nexport const CONTRADICTION_SEVERITIES = [\n \"low\",\n \"medium\",\n \"high\",\n \"critical\",\n] as const;\nexport type ContradictionSeverity = (typeof CONTRADICTION_SEVERITIES)[number];\n\n/** Contradiction resolution status */\nexport const CONTRADICTION_STATUSES = [\n \"unresolved\",\n \"resolved\",\n \"accepted\",\n] as const;\nexport type ContradictionStatus = (typeof CONTRADICTION_STATUSES)[number];\n\n// =============================================================================\n// WORKTREE ENUMS\n// =============================================================================\n\n/** How a worktree investigation concluded */\nexport const MERGE_OUTCOMES = [\n \"validated\",\n \"invalidated\",\n \"forked\",\n \"inconclusive\",\n] as const;\nexport type MergeOutcome = (typeof MERGE_OUTCOMES)[number];\n\n/** Investigation phases within a worktree */\nexport const WORKTREE_PHASES = [\n \"hypothesis\",\n \"investigation\",\n \"evaluation\",\n \"resolution\",\n] as const;\nexport type WorktreePhase = (typeof WORKTREE_PHASES)[number];\n\n// =============================================================================\n// EPISTEMIC LAYERS\n// =============================================================================\n\n/**\n * The knowledge hierarchy — each layer builds on the one below it.\n *\n * - L1: Sources — raw inputs (documents, APIs, observations)\n * - L2: Evidence — interpreted facts with context and weight\n * - L3: Beliefs — structural claims that carry confidence\n * - L4: Judgments — irreversible commitments based on the epistemic state\n */\nexport const EPISTEMIC_LAYERS = [\n \"L1\",\n \"L2\",\n \"L3\",\n \"L4\",\n] as const;\nexport type EpistemicLayer = (typeof EPISTEMIC_LAYERS)[number];\n\n// =============================================================================\n// JUDGMENT TYPES\n// =============================================================================\n\n/**\n * Classification of L4 judgments — irreversible determinations.\n *\n * Judgments are evaluated against the knowledge horizon that existed\n * when they were made. They cannot be retroactively invalidated —\n * only new judgments can supersede old ones.\n */\nexport const JUDGMENT_TYPES = [\n \"thesis\",\n \"thesis_maturity\",\n \"contradiction_ruling\",\n \"scope_determination\",\n \"confidence_ruling\",\n] as const;\nexport type JudgmentType = (typeof JUDGMENT_TYPES)[number];\n","/**\n * Session + Delegation Contract\n *\n * Canonical session lifecycle vocabulary shared by platform gateway auth,\n * hosted MCP auth, Master Control persistence, and SDK session tokens.\n */\n\nexport const SESSION_AUTH_MODES = [\n \"interactive_user\",\n \"service_principal\",\n \"tenant_api_key\",\n \"session_token\",\n] as const;\nexport type SessionAuthMode = (typeof SESSION_AUTH_MODES)[number];\n\nexport const SESSION_PRINCIPAL_TYPES = [\"human\", \"service\", \"agent\"] as const;\nexport type SessionPrincipalType = (typeof SESSION_PRINCIPAL_TYPES)[number];\n\nexport const SESSION_LIFECYCLE_STATUSES = [\n \"active\",\n \"expired\",\n \"revoked\",\n] as const;\nexport type SessionLifecycleStatus =\n (typeof SESSION_LIFECYCLE_STATUSES)[number];\n\nexport type SessionDelegationHop = {\n principalId: string;\n principalType: SessionPrincipalType;\n authMode?: SessionAuthMode;\n sessionId?: string;\n delegatedAt?: number;\n reason?: string;\n};\n\nexport type SessionAuditOutcome =\n | \"accepted\"\n | \"rejected\"\n | \"revoked\"\n | \"expired\";\n\nexport type SessionAuditEnvelope = {\n sessionId: string;\n authMode: SessionAuthMode;\n principalId: string;\n principalType: SessionPrincipalType;\n tenantId: string;\n workspaceId?: string;\n apiKeyId?: string;\n scopes: readonly string[];\n roles?: readonly string[];\n delegationChain?: readonly SessionDelegationHop[];\n sourceSessionId?: string;\n expiresAt?: number;\n request?: {\n endpoint?: string;\n method?: string;\n correlationId?: string;\n };\n result?: {\n outcome: SessionAuditOutcome;\n reason?: string;\n };\n};\n\nexport function inferSessionPrincipalType(\n principalId: string\n): SessionPrincipalType {\n if (principalId.startsWith(\"user:\")) {\n return \"human\";\n }\n if (principalId.startsWith(\"agent:\")) {\n return \"agent\";\n }\n return \"service\";\n}\n\nexport function normalizeDelegationChain(args: {\n delegationChain?: readonly SessionDelegationHop[];\n delegatedBy?: string;\n delegatedByType?: SessionPrincipalType;\n delegatedAt?: number;\n reason?: string;\n}): SessionDelegationHop[] | undefined {\n if (args.delegationChain && args.delegationChain.length > 0) {\n return [...args.delegationChain];\n }\n if (!args.delegatedBy) {\n return;\n }\n return [\n {\n principalId: args.delegatedBy,\n principalType:\n args.delegatedByType ?? inferSessionPrincipalType(args.delegatedBy),\n delegatedAt: args.delegatedAt,\n reason: args.reason,\n },\n ];\n}\n\nexport function lastDelegator(\n delegationChain?: readonly SessionDelegationHop[]\n): string | undefined {\n if (!delegationChain || delegationChain.length === 0) {\n return;\n }\n return delegationChain[delegationChain.length - 1]?.principalId;\n}\n","/**\n * Context-Pack Contract v1\n *\n * Canonical TypeScript types and constants for the context-pack output schema.\n * This is the external contract consumed by:\n * - MCP tool `compile_context` (canonical compiler read)\n * - SDK/HTTP consumers that read compiled context packs programmatically\n * - Benchmark harnesses (context-pack-ab)\n *\n * BREAKING CHANGE RULES:\n * - Adding optional fields to ContextPackV1 is NON-breaking\n * - Removing fields or changing types is BREAKING (bump CONTEXT_PACK_SCHEMA_VERSION)\n * - Changing section budget ratios or ranking weights is NON-breaking (tuning)\n * - Changing the version string is BREAKING (consumers check it)\n */\n\n// =============================================================================\n// SCHEMA VERSION\n// =============================================================================\n\n/** Canonical version string. Consumers MUST check this field for compatibility. */\nexport const CONTEXT_PACK_SCHEMA_VERSION = \"1.0.0\" as const;\n\n// =============================================================================\n// RANKING PROFILES\n// =============================================================================\n\n/**\n * Available ranking profiles for context-pack assembly.\n *\n * - `baseline_v1`: Simple token-hit counting. Items with zero query hits are excluded.\n * - `weighted_v1`: Multi-signal scoring combining query relevance, recency, confidence,\n * belief type, priority, and severity with section-specific weight vectors.\n */\nexport type ContextRankingProfile = \"baseline_v1\" | \"weighted_v1\";\n\nexport const CONTEXT_RANKING_PROFILES: readonly ContextRankingProfile[] = [\n \"baseline_v1\",\n \"weighted_v1\",\n] as const;\n\nexport const DEFAULT_RANKING_PROFILE: ContextRankingProfile = \"weighted_v1\";\n\n// =============================================================================\n// COMPILATION MODE (RS-2)\n// =============================================================================\n\n/**\n * Context compilation mode.\n *\n * - `standard`: Default — ranked beliefs, questions, evidence, contradictions.\n * - `delta`: Diff-aware — adds failure context, verification obligations,\n * and worktree ledger analysis to the standard context pack.\n */\nexport type ContextCompilationMode = \"standard\" | \"delta\";\n\nexport const DEFAULT_COMPILATION_MODE: ContextCompilationMode = \"standard\";\n\n// =============================================================================\n// SECTION KEYS\n// =============================================================================\n\n/**\n * The five canonical sections of a context pack.\n * Order matters: invariants are injected first, contradictions last.\n */\nexport type ContextPackSectionKey =\n | \"invariants\"\n | \"activeBeliefs\"\n | \"openQuestions\"\n | \"recentEvidence\"\n | \"contradictions\";\n\nexport const CONTEXT_PACK_SECTION_KEYS: readonly ContextPackSectionKey[] = [\n \"invariants\",\n \"activeBeliefs\",\n \"openQuestions\",\n \"recentEvidence\",\n \"contradictions\",\n] as const;\n\n// =============================================================================\n// SECTION BUDGET RATIOS\n// =============================================================================\n\n/**\n * Token budget allocation ratios per section.\n * These sum to 1.0 and determine how the total tokenBudget is divided.\n *\n * Rationale:\n * - invariants (0.28): Highest-priority constraints, injected first\n * - activeBeliefs (0.30): Largest section, carries domain knowledge\n * - openQuestions (0.17): Unresolved work items guide agent behavior\n * - recentEvidence (0.17): Implementation context for grounding\n * - contradictions (0.08): Tension signals, smallest section\n */\nexport const SECTION_BUDGET_RATIOS: Readonly<\n Record<ContextPackSectionKey, number>\n> = {\n invariants: 0.28,\n activeBeliefs: 0.3,\n openQuestions: 0.17,\n recentEvidence: 0.17,\n contradictions: 0.08,\n} as const;\n\n// =============================================================================\n// TOKEN BUDGET CONSTRAINTS\n// =============================================================================\n\n/** Minimum allowed token budget. Below this, context packs lose utility. */\nexport const MIN_TOKEN_BUDGET = 400;\n\n/** Maximum allowed token budget. Above this, context packs bloat prompts. */\nexport const MAX_TOKEN_BUDGET = 8000;\n\n/** Default token budget when caller does not specify. */\nexport const DEFAULT_TOKEN_BUDGET = 1800;\n\n/** Default max items per section. */\nexport const DEFAULT_SECTION_LIMIT = 8;\n\n/** Hard ceiling on items per section. */\nexport const MAX_SECTION_LIMIT = 25;\n\n/** Minimum contradiction section budget floor (tokens). */\nexport const MIN_CONTRADICTION_BUDGET = 40;\n\n// =============================================================================\n// RANKING WEIGHT VECTORS\n// =============================================================================\n\n/**\n * Weight vectors for the weighted_v1 ranking profile.\n * Each section has a different signal mix:\n *\n * - query: How many query tokens appear in the candidate text\n * - recency: Exponential decay from updatedAt (half-life = 30 days)\n * - confidence: Belief confidence score [0,1]\n * - beliefType: Bonus for invariant > tenet > principle > other\n * - priority: Question priority (critical > high > medium > low)\n * - severity: Contradiction severity (critical > high > medium > low)\n */\nexport type RankingWeightVector = {\n query: number;\n recency: number;\n confidence?: number;\n beliefType?: number;\n priority?: number;\n severity?: number;\n};\n\nexport const RANKING_WEIGHTS: Readonly<\n Record<ContextPackSectionKey, RankingWeightVector>\n> = {\n invariants: {\n query: 0.35,\n recency: 0.1,\n confidence: 0.4,\n beliefType: 0.15,\n },\n activeBeliefs: {\n query: 0.5,\n recency: 0.2,\n confidence: 0.2,\n beliefType: 0.1,\n },\n openQuestions: {\n query: 0.55,\n recency: 0.2,\n priority: 0.25,\n },\n recentEvidence: {\n query: 0.6,\n recency: 0.4,\n },\n contradictions: {\n query: 0.4,\n recency: 0.2,\n severity: 0.4,\n },\n} as const;\n\n/** Recency decay half-life in days. After 30 days, recency score = 0.5. */\nexport const RECENCY_HALF_LIFE_DAYS = 30;\n\n/**\n * Ranking weight vector for the relatedEntities section.\n * Entities are ranked by query relevance and connectivity (bridge edge count).\n * Separate from RANKING_WEIGHTS because entities are not part of the\n * token-budgeted injection plan.\n */\nexport const ENTITY_RANKING_WEIGHTS = {\n query: 0.4,\n connectivity: 0.6,\n} as const;\n\n/** Default max entities to include in the context pack. */\nexport const DEFAULT_ENTITY_LIMIT = 10;\n\n/** Hard ceiling on entities per context pack. */\nexport const MAX_ENTITY_LIMIT = 50;\n\n// =============================================================================\n// BELIEF TYPE BONUS MAP\n// =============================================================================\n\n/**\n * Bonus multiplier for belief types in ranking.\n * Invariants get 1.0, unknown types get 0.4.\n */\nexport const BELIEF_TYPE_BONUS: Readonly<Record<string, number>> = {\n invariant: 1.0,\n tenet: 0.8,\n principle: 0.6,\n} as const;\n\nexport const DEFAULT_BELIEF_TYPE_BONUS = 0.4;\n\n// =============================================================================\n// PRIORITY / SEVERITY SCORE MAPS\n// =============================================================================\n\nexport const PRIORITY_SCORES: Readonly<Record<string, number>> = {\n critical: 1.0,\n high: 0.85,\n medium: 0.55,\n low: 0.35,\n} as const;\n\nexport const DEFAULT_PRIORITY_SCORE = 0.5;\n\nexport const SEVERITY_SCORES: Readonly<Record<string, number>> = {\n critical: 1.0,\n high: 0.85,\n medium: 0.6,\n low: 0.35,\n} as const;\n\nexport const DEFAULT_SEVERITY_SCORE = 0.5;\n\n// =============================================================================\n// SECTION ITEM TYPES\n// =============================================================================\n\n/** A ranked belief in the invariants or activeBeliefs section. */\nexport type ContextPackBelief = {\n nodeId: string;\n canonicalText: string;\n confidence: number | null;\n beliefType: string | null;\n score: number;\n /** Present in activeBeliefs, absent in invariants */\n status?: string;\n updatedAt?: number | null;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/** A ranked question in the openQuestions section. */\nexport type ContextPackQuestion = {\n questionId: string;\n text: string;\n status: string;\n priority: string;\n updatedAt?: number | null;\n score: number;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/** A ranked evidence item in the recentEvidence section. */\nexport type ContextPackEvidence = {\n nodeId: string;\n canonicalText: string;\n sourceUrl: string | null;\n kind: string;\n createdAt: number | null;\n score: number;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/** A ranked contradiction in the contradictions section. */\nexport type ContextPackContradiction = {\n contradictionId: string;\n severity: string;\n status: string;\n description: string;\n score: number;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/**\n * An entity from the ontological layer surfaced in the context pack.\n * Entities are domain objects (companies, people, functions, etc.) connected\n * to beliefs via bridge edges. They provide the \"reality anchor\" that makes\n * the reasoning graph domain-aware.\n */\nexport type ContextPackEntity = {\n /** Convex document ID of the entity node. */\n nodeId: string;\n /** Entity type (e.g., \"company\", \"person\", \"function\"). */\n entityType: string;\n /** Human-readable title/name of the entity. */\n title: string;\n /** Number of beliefs connected to this entity via bridge edges. */\n connectedBeliefCount: number;\n /** Number of evidence items referencing this entity. */\n connectedEvidenceCount: number;\n /** Relevance score from ranking algorithm. */\n score: number;\n /** Entity metadata (structured per ontology schema). */\n metadata?: Record<string, unknown>;\n};\n\n/**\n * A lattice seed entry representing a belief that was auto-generated\n * to cover an ontology entity type within a topic scope.\n */\nexport type BeliefLatticeSeed = {\n /** The belief node ID that was created or already existed. */\n beliefNodeId: string;\n /** The entity type this seed belief covers. */\n entityType: string;\n /** Whether this seed was newly created or already existed. */\n created: boolean;\n /** The canonical text of the seed belief. */\n canonicalText: string;\n};\n\n// =============================================================================\n// SUMMARY\n// =============================================================================\n\n/** Counts and scoped health signals for the context pack. */\nexport type ContextPackSummary = {\n totalBeliefs: number;\n invariants: number;\n openQuestions: number;\n evidenceItems: number;\n contradictions: number;\n /** Number of ontological entities in scope (optional, present when entity graph is active). */\n relatedEntities?: number;\n scopedTopics: number;\n descendantDepth: number;\n query: string | null;\n};\n\n// =============================================================================\n// FAILURE CONTEXT (RS-2)\n// =============================================================================\n\n/** A failed approach surfaced from the failure log for anti-repetition. */\nexport type ContextPackFailure = {\n /** Lucern attempt/evidence node ID. */\n attemptId: string;\n /** What was tried. */\n approach: string;\n /** Why it failed. */\n outcome: string;\n /** When the attempt was recorded (ms since epoch). */\n recordedAt: number;\n /** Relevance score from ranking algorithm. */\n score: number;\n};\n\n/** Failure context section appended to context packs in delta mode. */\nexport type ContextPackFailureContext = {\n /** Ranked failed approaches relevant to the current query. */\n failures: ContextPackFailure[];\n /** IDs of items suppressed from other sections due to anti-repetition. */\n suppressedIds: string[];\n};\n\n// =============================================================================\n// DELTA REPORT (RS-2)\n// =============================================================================\n\n/** A verification obligation surfaced by delta compilation. */\nexport type VerificationObligation = {\n /** What must be verified. */\n description: string;\n /** Source of the obligation (e.g., \"belief:xyz confidence drop\"). */\n source: string;\n /** Severity: how important it is to verify. */\n severity: \"critical\" | \"high\" | \"medium\" | \"low\";\n};\n\n/** Delta report appended to context packs when mode = \"delta\". */\nexport type ContextPackDeltaReport = {\n /** Items that changed since the reference point (new, updated, removed). */\n changedItems: Array<{\n id: string;\n section: ContextPackSectionKey;\n changeType: \"added\" | \"updated\" | \"removed\" | \"confidence_changed\";\n summary: string;\n }>;\n /** Obligations the consuming session must verify. */\n verificationObligations: VerificationObligation[];\n /** Reference point for the delta (worktree ID, timestamp, or commit SHA). */\n referencePoint: string;\n};\n\n// =============================================================================\n// PACK WEIGHT OVERRIDES (RS-2)\n// =============================================================================\n\n/**\n * Per-section weight overrides that domain packs can apply.\n * Overrides merge with RANKING_WEIGHTS — only specified fields replace defaults.\n */\nexport type PackWeightOverride = {\n /** Which section to override weights for. */\n section: ContextPackSectionKey;\n /** Partial weight vector — only specified fields replace defaults. */\n weights: Partial<RankingWeightVector>;\n};\n\n// =============================================================================\n// INJECTION POLICY\n// =============================================================================\n\n/** Token-budgeted section selections for prompt injection. */\nexport type ContextPackInjectionPolicy = {\n /** Total token budget for the entire context pack. */\n tokenBudget: number;\n /** Estimated tokens consumed across all sections. */\n estimatedTokens: number;\n /** Per-section token budgets derived from SECTION_BUDGET_RATIOS. */\n sectionBudgets: Record<ContextPackSectionKey, number>;\n /** Actual token usage per section after greedy fill. */\n sectionUsage: Record<ContextPackSectionKey, number>;\n /** Node/question IDs selected for injection, per section. */\n selected: Record<ContextPackSectionKey, string[]>;\n /** Items that were scored but excluded from injection, with reason (RS-2). */\n excludedItems?: Array<{\n id: string;\n section: ContextPackSectionKey;\n reason: \"budget_exceeded\" | \"anti_repetition\" | \"below_threshold\";\n score: number;\n }>;\n};\n\n// =============================================================================\n// DIAGNOSTICS\n// =============================================================================\n\n/** Telemetry for context pack assembly. */\nexport type ContextPackDiagnostics = {\n /** Total candidates scored across all sections. */\n itemsScored: number;\n /** Ratio of estimatedTokens / tokenBudget. Range [0, 1+]. */\n tokenBudgetUtilization: number;\n};\n\n// =============================================================================\n// PUBLIC COMPILED CONTEXT TYPES\n// =============================================================================\n\n/**\n * Public context surface returned by the SDK-facing context client.\n *\n * This preserves the existing external shape while the canonical compiler\n * contract evolves in parallel as ContextPackV1.\n */\nexport type PublicContextBelief = {\n beliefId: string;\n text: string;\n confidence: number | null;\n beliefType?: string | null;\n status?: string;\n updatedAt?: number | null;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextQuestion = {\n questionId: string;\n text: string;\n status: string;\n priority: string;\n updatedAt?: number | null;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextEvidence = {\n evidenceId: string;\n text: string;\n sourceUrl?: string | null;\n kind: string;\n createdAt?: number | null;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextContradiction = {\n contradictionId: string;\n severity: string;\n status: string;\n description: string;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextEntity = {\n entityId: string;\n entityType: string;\n title: string;\n text?: string;\n connectedBeliefCount: number;\n connectedEvidenceCount: number;\n score: number;\n metadata?: Record<string, unknown>;\n};\n\nexport type PublicContextInjectionPolicy = {\n tokenBudget: number;\n estimatedTokens: number;\n sectionBudgets: Record<string, number>;\n sectionUsage: Record<string, number>;\n selected: Record<string, string[]>;\n excludedItems?: Array<{\n id: string;\n section: string;\n reason: \"budget_exceeded\" | \"anti_repetition\" | \"below_threshold\";\n score: number;\n }>;\n};\n\nexport type PublicCompiledContext = {\n schemaVersion: string;\n topicId: string;\n topicName: string;\n scopedTopicIds: string[];\n generatedAt: number;\n ranking: ContextRankingProfile;\n summary: Record<string, unknown>;\n invariants: PublicContextBelief[];\n activeBeliefs: PublicContextBelief[];\n openQuestions: PublicContextQuestion[];\n recentEvidence: PublicContextEvidence[];\n contradictions: PublicContextContradiction[];\n relatedEntities?: PublicContextEntity[];\n contextNarrative: string[];\n injectionPolicy: PublicContextInjectionPolicy;\n diagnostics: Record<string, unknown>;\n compilationMode?: string;\n failureContext?: {\n failures: Array<{\n attemptId: string;\n approach: string;\n outcome: string;\n recordedAt: number;\n score: number;\n }>;\n suppressedIds: string[];\n };\n deltaReport?: {\n changedItems: Array<{\n id: string;\n section: string;\n changeType: string;\n summary: string;\n }>;\n verificationObligations: Array<{\n description: string;\n source: string;\n severity: \"critical\" | \"high\" | \"medium\" | \"low\";\n }>;\n referencePoint: string;\n };\n appliedWeightOverrides?: unknown[];\n};\n\n// =============================================================================\n// CONTEXT PACK V1 (TOP-LEVEL OUTPUT)\n// =============================================================================\n\n/**\n * The canonical output schema for context compilation responses.\n *\n * This is the contract that consumers depend on. All fields are required\n * in the output. Adding optional fields is non-breaking; removing or\n * changing types is breaking (requires version bump).\n */\nexport type ContextPackV1 = {\n /** Schema version for compatibility checking. */\n schemaVersion: typeof CONTEXT_PACK_SCHEMA_VERSION;\n /** Resolved topic ID after scope resolution. */\n topicId: string;\n /** Human-readable topic name. */\n topicName: string;\n /** All topic IDs included in the neighborhood expansion. */\n scopedTopicIds: string[];\n /** Deterministic freshness watermark for this pack (ms since epoch). */\n generatedAt: number;\n /** Which ranking profile was used. */\n rankingProfile: ContextRankingProfile;\n /** Aggregate counts and health signals. */\n summary: ContextPackSummary;\n /** High-confidence invariant beliefs (beliefType = \"invariant\"). */\n invariants: ContextPackBelief[];\n /** Active beliefs ranked by query relevance. */\n activeBeliefs: ContextPackBelief[];\n /** Open questions ranked by relevance and priority. */\n openQuestions: ContextPackQuestion[];\n /** Recent evidence ranked by relevance and recency. */\n recentEvidence: ContextPackEvidence[];\n /** Active contradictions ranked by severity. */\n contradictions: ContextPackContradiction[];\n /**\n * Ontological entities connected to beliefs in scope, ranked by connectivity.\n * Optional — present when entity graph substrate is active for this topic.\n * NON-BREAKING addition per contract rules.\n */\n relatedEntities?: ContextPackEntity[];\n /** Concise instructions for agent context injection. */\n contextNarrative: string[];\n /** Token-budgeted injection selections. */\n injectionPolicy: ContextPackInjectionPolicy;\n /** Assembly telemetry. */\n diagnostics: ContextPackDiagnostics;\n /** Compilation mode used to generate this pack (RS-2). Default: \"standard\". */\n compilationMode?: ContextCompilationMode;\n /** Failure context for anti-repetition (RS-2). Present when failures are relevant. */\n failureContext?: ContextPackFailureContext;\n /** Delta report (RS-2). Present only when compilationMode = \"delta\". */\n deltaReport?: ContextPackDeltaReport;\n /** Pack weight overrides applied during ranking (RS-2). */\n appliedWeightOverrides?: PackWeightOverride[];\n};\n\n// =============================================================================\n// CONTEXT PACK REQUEST V1 (INPUT)\n// =============================================================================\n\n/**\n * The canonical input schema for `compile_context`.\n * `topicId` is the only scope identifier.\n */\nexport type ContextPackRequestV1 = {\n /** Topic scope ID (required). */\n topicId: string;\n /** Focus query for relevance ranking. */\n query?: string;\n /** Max items per section. Default: DEFAULT_SECTION_LIMIT. */\n limit?: number;\n /** Ranking profile. Default: DEFAULT_RANKING_PROFILE. */\n rankingProfile?: ContextRankingProfile;\n /** Total token budget. Default: DEFAULT_TOKEN_BUDGET. */\n tokenBudget?: number;\n /** Descendant topic depth for neighborhood expansion. */\n maxDepth?: number;\n /** Include ontological entities connected to beliefs in scope. Default: true. */\n includeEntities?: boolean;\n /** Compilation mode (RS-2). Default: \"standard\". */\n mode?: ContextCompilationMode;\n /** Include failure log context for anti-repetition (RS-2). Default: false. */\n includeFailures?: boolean;\n /** Active worktree ID for delta mode reference point (RS-2). */\n worktreeId?: string;\n /** Session ID for anti-repetition dedup (RS-2). */\n sessionId?: string;\n /** Pack weight overrides from domain pack binding (RS-2). */\n packWeightOverrides?: PackWeightOverride[];\n};\n\n// =============================================================================\n// RESOLVED QUESTION STATUSES\n// =============================================================================\n\n/**\n * Question statuses that are considered \"resolved\" (not open).\n * Used to filter which questions appear in the openQuestions section.\n */\nexport const RESOLVED_QUESTION_STATUSES: readonly string[] = [\n \"answered\",\n \"archived\",\n \"closed\",\n \"resolved\",\n \"resolved_support\",\n \"resolved_contra\",\n \"belief_forked\",\n] as const;\n\n// =============================================================================\n// TOKEN ESTIMATION\n// =============================================================================\n\n/**\n * Tokens-per-word multiplier for rough token estimation.\n * Conservative estimate: ~1.35 tokens per whitespace-delimited word.\n */\nexport const TOKENS_PER_WORD = 1.35;\n\n/** Minimum token estimate for any non-empty string. */\nexport const MIN_TOKEN_ESTIMATE = 8;\n","/**\n * Lens Filter Criteria Contract\n *\n * Version-discriminated filter DSL for lenses. Each filter criteria document\n * carries a `version` and `kind` discriminator so future shapes can coexist\n * without schema migrations. The Convex `filterCriteria` field remains v.any()\n * — all type enforcement happens here at the TypeScript contract layer.\n *\n * Forward-compatibility guarantees:\n * - `version` field: new versions add fields, never remove or rename existing ones\n * - `kind` field: new filter kinds (temporal, confidence-range) can be added\n * without touching taxonomy code paths\n * - `entityTypeFilters` array items are open to extension in future versions\n * - Resolution logic switches on `version` + `kind` to select the right resolver\n *\n * @module lucern/contracts/src/lens-filter\n */\n\n// ---------------------------------------------------------------------------\n// V1: Taxonomy Filter — entity type + subtype matching\n// ---------------------------------------------------------------------------\n\n/**\n * A single entity type filter entry. Matches nodes whose `nodeType` equals\n * `entityTypeValue`, optionally further narrowed by subtype membership.\n *\n * V2 will add `propertyMatchers` here for arbitrary JSON Schema facet queries.\n */\nexport type EntityTypeFilterV1 = {\n /** References ontologyVersion.entityTypes[].value, e.g. \"company\" */\n entityTypeValue: string;\n\n /** Optional subtype narrowing. If omitted or empty, all subtypes match. */\n subtypeValues?: string[];\n};\n\n/**\n * Optional scope to restrict which ontology the filter resolves against.\n * If omitted, resolution uses whatever ontology is active in the workspace.\n */\nexport type OntologyScope = {\n /** Restrict to a specific ontology by key, e.g. \"vc-investment\" */\n ontologyKey?: string;\n};\n\n/**\n * Taxonomy filter criteria v1: entity type + subtype matching over ontology.\n */\nexport type TaxonomyFilterCriteriaV1 = {\n version: 1;\n kind: \"taxonomy\";\n entityTypeFilters: EntityTypeFilterV1[];\n ontologyScope?: OntologyScope;\n};\n\n// ---------------------------------------------------------------------------\n// Union: All filter criteria versions and kinds\n// ---------------------------------------------------------------------------\n\n/**\n * Discriminated union of all supported filter criteria.\n * Resolution logic switches on `version` + `kind`.\n *\n * To add a new filter kind:\n * 1. Define a new type (e.g., TemporalFilterCriteriaV1)\n * 2. Add it to this union\n * 3. Add a resolver in taxonomy-filter.ts\n * 4. No schema migration needed — filterCriteria is v.any()\n */\nexport type LensFilterCriteria = TaxonomyFilterCriteriaV1;\n// Future: | TemporalFilterCriteriaV1 | ConfidenceRangeFilterCriteriaV1 | ...\n\n// ---------------------------------------------------------------------------\n// Type guards\n// ---------------------------------------------------------------------------\n\nexport function isLensFilterCriteria(\n value: unknown\n): value is LensFilterCriteria {\n if (!value || typeof value !== \"object\") return false;\n const obj = value as Record<string, unknown>;\n return typeof obj.version === \"number\" && typeof obj.kind === \"string\";\n}\n\nexport function isTaxonomyFilterCriteriaV1(\n value: unknown\n): value is TaxonomyFilterCriteriaV1 {\n if (!isLensFilterCriteria(value)) return false;\n return value.version === 1 && value.kind === \"taxonomy\";\n}\n\n// ---------------------------------------------------------------------------\n// Validation\n// ---------------------------------------------------------------------------\n\nexport type FilterValidationResult =\n | { valid: true }\n | { valid: false; errors: string[] };\n\n/**\n * Validate a filter criteria document at the contract layer.\n * This runs before persisting to Convex.\n */\nexport function validateFilterCriteria(\n value: unknown\n): FilterValidationResult {\n if (value === undefined || value === null) {\n return { valid: true }; // filterCriteria is optional\n }\n\n if (!isLensFilterCriteria(value)) {\n return {\n valid: false,\n errors: [\n 'filterCriteria must have numeric \"version\" and string \"kind\" fields',\n ],\n };\n }\n\n if (isTaxonomyFilterCriteriaV1(value)) {\n return validateTaxonomyFilterV1(value);\n }\n\n // Cast to access properties — TypeScript narrows to `never` when all union\n // members are exhausted, but at runtime unknown version/kind combos are possible.\n const raw = value as { version: number; kind: string };\n return {\n valid: false,\n errors: [\n `Unsupported filter criteria: version=${raw.version}, kind=${raw.kind}`,\n ],\n };\n}\n\nfunction validateTaxonomyFilterV1(\n criteria: TaxonomyFilterCriteriaV1\n): FilterValidationResult {\n const errors: string[] = [];\n\n if (!Array.isArray(criteria.entityTypeFilters)) {\n errors.push(\"entityTypeFilters must be an array\");\n return { valid: false, errors };\n }\n\n if (criteria.entityTypeFilters.length === 0) {\n errors.push(\"entityTypeFilters must contain at least one entry\");\n return { valid: false, errors };\n }\n\n for (let i = 0; i < criteria.entityTypeFilters.length; i++) {\n const filter = criteria.entityTypeFilters[i];\n if (!filter || typeof filter.entityTypeValue !== \"string\") {\n errors.push(\n `entityTypeFilters[${i}].entityTypeValue must be a non-empty string`\n );\n continue;\n }\n if (filter.entityTypeValue.trim().length === 0) {\n errors.push(\n `entityTypeFilters[${i}].entityTypeValue must be a non-empty string`\n );\n }\n if (\n filter.subtypeValues !== undefined &&\n !Array.isArray(filter.subtypeValues)\n ) {\n errors.push(`entityTypeFilters[${i}].subtypeValues must be an array`);\n }\n }\n\n if (criteria.ontologyScope !== undefined) {\n if (\n typeof criteria.ontologyScope !== \"object\" ||\n criteria.ontologyScope === null\n ) {\n errors.push(\"ontologyScope must be an object\");\n }\n }\n\n return errors.length === 0\n ? { valid: true }\n : { valid: false, errors };\n}\n","/**\n * Canonical lens workflow contract shared across schema, SDK, and MCP surfaces.\n */\n\n// Re-export filter criteria types for consumers who import from lens-workflow\nexport type {\n LensFilterCriteria,\n TaxonomyFilterCriteriaV1,\n EntityTypeFilterV1,\n OntologyScope,\n FilterValidationResult,\n} from \"./lens-filter.contract\";\nexport {\n validateFilterCriteria,\n isLensFilterCriteria,\n isTaxonomyFilterCriteriaV1,\n} from \"./lens-filter.contract\";\n\nexport const LENS_PERSPECTIVE_TYPES = [\n \"investigation\",\n \"monitoring\",\n \"analysis\",\n \"comparison\",\n \"taxonomy\",\n] as const;\n\nexport type LensPerspectiveType = (typeof LENS_PERSPECTIVE_TYPES)[number];\n\nexport const LENS_STATUSES = [\"draft\", \"active\", \"archived\"] as const;\n\nexport type LensStatus = (typeof LENS_STATUSES)[number];\n\nexport const LENS_TASK_TEMPLATE_PRIORITIES = [\n \"critical\",\n \"high\",\n \"medium\",\n \"low\",\n] as const;\n\nexport type LensTaskTemplatePriority =\n (typeof LENS_TASK_TEMPLATE_PRIORITIES)[number];\n\nexport type LensLooseMetadata = Record<string, unknown>;\n\nexport type LensPromptTemplateReference = {\n key: string;\n promptRef: string;\n phase?: string;\n role?: string;\n version?: string;\n required?: boolean;\n metadata?: LensLooseMetadata;\n};\n\nexport type LensWorkflowStepTemplate = {\n key: string;\n title: string;\n description?: string;\n promptTemplateKey?: string;\n taskTemplateKeys?: string[];\n metadata?: LensLooseMetadata;\n};\n\nexport type LensWorkflowTemplate = {\n key: string;\n name: string;\n description?: string;\n steps: LensWorkflowStepTemplate[];\n metadata?: LensLooseMetadata;\n};\n\nexport type LensTaskTemplate = {\n key: string;\n title: string;\n description?: string;\n priority?: LensTaskTemplatePriority;\n phase?: string;\n metadata?: LensLooseMetadata;\n};\n\nexport type LensQuestionTemplate = {\n key: string;\n text: string;\n priority?: LensTaskTemplatePriority;\n linkedBeliefKey?: string;\n metadata?: LensLooseMetadata;\n};\n\nexport type LensBranchMigrationSuggestion = {\n recommendedTool: \"create_lens\";\n perspectiveType: LensPerspectiveType;\n message: string;\n suggestedPayload: {\n name: string;\n description?: string;\n topicId?: string;\n workspaceId?: string;\n perspectiveType: LensPerspectiveType;\n };\n};\n\nexport const BRANCH_DEPRECATION_MESSAGE =\n \"Branches are deprecated for operational framing. Create a workspace-scoped lens instead.\";\n\nexport type DeprecatedBranchMetadata = {\n deprecated: true;\n deprecationMessage: string;\n lensSuggestion: LensBranchMigrationSuggestion;\n};\n\nexport function inferLensPerspectiveTypeFromBranchSchema(\n schema?: string | null\n): LensPerspectiveType {\n const normalized = schema?.trim().toLowerCase();\n if (normalized === \"phase\") {\n return \"monitoring\";\n }\n if (normalized === \"axis\" || normalized === \"dimension\") {\n return \"comparison\";\n }\n if (normalized === \"track\") {\n return \"investigation\";\n }\n return \"analysis\";\n}\n\nexport function migrateBranchToLens(args: {\n name: string;\n description?: string;\n topicId?: string;\n workspaceId?: string;\n schema?: string | null;\n}): LensBranchMigrationSuggestion {\n const perspectiveType = inferLensPerspectiveTypeFromBranchSchema(args.schema);\n return {\n recommendedTool: \"create_lens\",\n perspectiveType,\n message:\n \"Branches are deprecated for operational framing. Create a workspace-scoped lens with the suggested payload instead.\",\n suggestedPayload: {\n name: args.name,\n description: args.description,\n topicId: args.topicId,\n workspaceId: args.workspaceId,\n perspectiveType,\n },\n };\n}\n\nexport function buildDeprecatedBranchMetadata(args: {\n name: string;\n description?: string;\n topicId?: string;\n workspaceId?: string;\n schema?: string | null;\n}): DeprecatedBranchMetadata {\n return {\n deprecated: true,\n deprecationMessage: BRANCH_DEPRECATION_MESSAGE,\n lensSuggestion: migrateBranchToLens(args),\n };\n}\n","/**\n * MCP Tool Contract Definitions\n *\n * Machine-readable source of truth for all Lucern MCP tool names,\n * descriptions, parameters, and response schemas.\n *\n * CONTRACT SURFACE: These definitions are the external API for AI agents.\n * Renaming a tool or changing its description is a BREAKING CHANGE.\n *\n * Git-native naming rules (enforced by lint):\n * 1. Workflow tools use git verbs directly (add_worktree, merge, push, open_pull_request)\n * 2. Knowledge tools use epistemic verbs (create_belief, fork_belief, modulate_confidence)\n * 3. First sentence of description includes the git analog verb\n * 4. Description includes \"Like `git X`\" parenthetical\n * 5. Parameter names use domain terms (canonicalText, nodeId, confidence)\n */\n\nimport { LENS_PERSPECTIVE_TYPES } from \"./lens-workflow.contract\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport type McpToolContract = {\n /** Stable tool name — breaking change to rename */\n name: string;\n /** Git-semantic description — breaking change to remove git references */\n description: string;\n /** Parameter schema (JSON Schema subset) */\n parameters: Record<string, McpParameterDef>;\n /** Required parameter names */\n required: string[];\n /** Response shape description */\n response: McpResponseDef;\n /** Which Lucern module owns the implementation */\n ownerModule: string;\n /** Ontology primitive this tool operates on */\n ontologyPrimitive:\n | \"belief\"\n | \"evidence\"\n | \"source\"\n | \"question\"\n | \"judgment\"\n | \"worktree\"\n | \"branch\"\n | \"lens\"\n | \"edge\"\n | \"graph\"\n | \"task\"\n | \"policy\"\n | \"ontology\"\n | \"identity\";\n /** MCP surface tier — showcase (front page, every demo) or workhorse (complete CRUD, discovered when building) */\n tier: \"showcase\" | \"workhorse\";\n /** Hide this tool from public discovery surfaces. */\n internal?: boolean;\n /** Deprecation notice shown in contract-driven docs and discovery. */\n deprecated?: string;\n};\n\nexport type McpParameterDef = {\n type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n description: string;\n required?: boolean;\n enum?: string[];\n};\n\nexport type McpResponseDef = {\n description: string;\n fields: Record<string, string>;\n};\n\n// =============================================================================\n// BELIEF LIFECYCLE TOOLS\n// =============================================================================\n\nexport const CREATE_BELIEF: McpToolContract = {\n name: \"create_belief\",\n description:\n \"Commit a new belief (knowledge unit) to the reasoning graph. \" +\n \"Like `git commit` — creates an atomic, traceable knowledge object. \" +\n \"The belief starts as unscored (draft). Score it with modulate_confidence to freeze the formulation.\",\n parameters: {\n canonicalText: {\n type: \"string\",\n description: \"The belief statement — what the agent holds to be true\",\n },\n topicId: { type: \"string\", description: \"Topic scope for the belief\" },\n beliefType: {\n type: \"string\",\n description:\n \"Belief type (e.g., hypothesis, belief, principle, invariant, tenet, forecast). Validated against schemaEnumConfig.\",\n },\n metadata: {\n type: \"object\",\n description:\n \"Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'] } for coding intelligence)\",\n },\n },\n required: [\"canonicalText\", \"topicId\"],\n response: {\n description: \"The created canonical belief record\",\n fields: {\n id: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n beliefId: \"string — canonical belief ID\",\n text: \"string — canonical belief formulation\",\n topicId: \"string\",\n status: \"string — active | superseded | archived\",\n scoringState: \"string — unscored | scored\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const GET_BELIEF: McpToolContract = {\n name: \"get_belief\",\n description:\n \"Read one belief by ID. \" +\n \"Like `git show` — resolves the canonical belief payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical belief ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical belief record\",\n fields: {\n id: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n beliefId: \"string — canonical belief ID\",\n text: \"string — canonical belief formulation\",\n topicId: \"string\",\n status: \"string — active | superseded | archived\",\n scoringState: \"string — unscored | scored\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const REFINE_BELIEF: McpToolContract = {\n name: \"refine_belief\",\n description:\n \"Amend a draft belief in-place within an active worktree. \" +\n \"Like `git commit --amend` — rewrites the last commit on a feature branch. \" +\n \"Only valid before merge to main. Fails if the belief is already scored.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to refine\" },\n canonicalText: { type: \"string\", description: \"Updated belief statement\" },\n rationale: { type: \"string\", description: \"Why the refinement was made\" },\n },\n required: [\"nodeId\", \"canonicalText\"],\n response: {\n description: \"The updated belief node\",\n fields: {\n nodeId: \"string\",\n canonicalText: \"string — updated text\",\n updatedAt: \"number — timestamp\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const MODULATE_CONFIDENCE: McpToolContract = {\n name: \"modulate_confidence\",\n description:\n \"Record a confidence change for a belief. \" +\n \"Like `git commit` to the credence log — an atomic, append-only write. \" +\n \"Each modulation is a new entry in the history, not an overwrite. \" +\n \"Scoring happens via merge; this tool records the individual data points. \" +\n \"Triggers: evidence_added, contradiction_detected, merge_outcome, manual, decay.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to score\" },\n confidence: { type: \"number\", description: \"Confidence level in [0, 1]\" },\n trigger: {\n type: \"string\",\n description: \"What caused this confidence change\",\n enum: [\n \"evidence_added\",\n \"contradiction_detected\",\n \"merge_outcome\",\n \"manual\",\n \"decay\",\n ],\n },\n rationale: {\n type: \"string\",\n description: \"Human-readable explanation of why confidence changed\",\n },\n },\n required: [\"nodeId\", \"confidence\", \"trigger\", \"rationale\"],\n response: {\n description: \"Confidence modulation result\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n newConfidence: \"number\",\n previousConfidence: \"number\",\n trigger: \"string\",\n requestId: \"string — request identifier for the scheduled cascade\",\n propagationSummary:\n \"object — bounded inline cascade summary with totalCandidateTargets, inlineTargets, and remainingTargetCount\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const FORK_BELIEF: McpToolContract = {\n name: \"fork_belief\",\n description:\n \"Branch off a scored belief to create a new version with a different formulation. \" +\n \"Like `git fork` — the parent remains immutable with full history. \" +\n \"The new belief gets a `supersedes` edge to the parent. \" +\n \"Fork reasons: refinement, contradiction_response, scope_change, confidence_collapse, manual.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The scored belief to fork from\" },\n newFormulation: {\n type: \"string\",\n description: \"The evolved belief statement\",\n },\n forkReason: {\n type: \"string\",\n description: \"Why this fork was created\",\n enum: [\n \"refinement\",\n \"contradiction_response\",\n \"scope_change\",\n \"confidence_collapse\",\n \"manual\",\n ],\n },\n },\n required: [\"nodeId\", \"newFormulation\", \"forkReason\"],\n response: {\n description: \"The forked canonical belief record\",\n fields: {\n id: \"string — canonical child belief ID\",\n nodeId: \"string — canonical child belief ID\",\n beliefId: \"string — canonical child belief ID\",\n parentBeliefId: \"string — canonical parent belief ID\",\n forkReason: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const ARCHIVE_BELIEF: McpToolContract = {\n name: \"archive_belief\",\n description:\n \"Soft-delete a belief by setting its status to archived. \" +\n \"Like `git rm` — removed from the working tree but preserved in history. \" +\n \"Beliefs are never truly deleted. Archived beliefs retain full lineage and confidence history.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to archive\" },\n rationale: {\n type: \"string\",\n description: \"Why this belief is being archived\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Archived canonical belief record\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n nodeId: \"string — canonical belief ID\",\n previousStatus: \"string | undefined\",\n newStatus: \"string — 'archived'\",\n status: \"string — 'archived'\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const CREATE_EPISTEMIC_CONTRACT: McpToolContract = {\n name: \"create_epistemic_contract\",\n description:\n \"Bind a machine-evaluable epistemic contract to a belief. \" +\n \"Like `git add` for falsification rules — records the verification condition, modulation policy, \" +\n \"and evaluation schedule that keep a belief accountable to reality.\",\n parameters: {\n beliefNodeId: {\n type: \"string\",\n description: \"The belief node to bind this contract to\",\n },\n title: {\n type: \"string\",\n description: \"Contract title\",\n },\n description: {\n type: \"string\",\n description: \"Optional contract description\",\n },\n conditionType: {\n type: \"string\",\n description: \"What kind of contract condition to evaluate\",\n enum: [\"assertion\", \"temporal\", \"evidential\", \"threshold\", \"composite\"],\n },\n direction: {\n type: \"string\",\n description: \"Whether satisfying the condition confirms or falsifies\",\n enum: [\"confirms\", \"falsifies\"],\n },\n condition: {\n type: \"object\",\n description:\n \"Condition payload: { expression, evaluator, evaluatorConfig? }\",\n },\n deadline: {\n type: \"number\",\n description: \"Optional Unix timestamp deadline for temporal contracts\",\n },\n compositeOf: {\n type: \"array\",\n description: \"Optional array of sub-contract IDs for composite contracts\",\n },\n compositeOperator: {\n type: \"string\",\n description: \"How composite sub-contracts should be combined\",\n enum: [\"all\", \"any\", \"majority\"],\n },\n modulation: {\n type: \"object\",\n description:\n \"Asymmetric modulation rules for confirmed, disconfirmed, expired, and partial outcomes\",\n },\n evaluationSchedule: {\n type: \"string\",\n description: \"When this contract should be evaluated\",\n enum: [\"on_demand\", \"on_evidence\", \"periodic\", \"event_driven\"],\n },\n periodicIntervalMs: {\n type: \"number\",\n description: \"Optional interval in milliseconds for periodic contracts\",\n },\n },\n required: [\n \"beliefNodeId\",\n \"title\",\n \"conditionType\",\n \"direction\",\n \"condition\",\n \"modulation\",\n \"evaluationSchedule\",\n ],\n response: {\n description: \"The created epistemic contract binding\",\n fields: {\n id: \"string — storage record ID\",\n contractId: \"string — contract identifier\",\n beliefId: \"string — canonical belief ID\",\n status: \"string — initial contract status\",\n title: \"string — contract title\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// EVIDENCE TOOLS\n// =============================================================================\n\nexport const ADD_EVIDENCE: McpToolContract = {\n name: \"add_evidence\",\n description:\n \"Commit evidence to the reasoning graph and attach it to a belief. \" +\n \"Like `git add && git commit` — an atomic write that creates a traceable evidence object. \" +\n \"Weight ranges from -1.0 (contradicts) to +1.0 (strongly supports). \" +\n \"Evidence is always context-bound: tied to its source, the time it was captured, and the belief it informs.\",\n parameters: {\n canonicalText: { type: \"string\", description: \"The evidence statement\" },\n topicId: { type: \"string\", description: \"Topic scope\" },\n sourceUrl: { type: \"string\", description: \"URL of the source material\" },\n targetNodeId: {\n type: \"string\",\n description: \"The belief this evidence bears on\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n reasoning: {\n type: \"string\",\n description: \"Why this evidence is relevant to the target belief\",\n },\n title: {\n type: \"string\",\n description: \"Optional short title for the evidence node\",\n },\n content: {\n type: \"string\",\n description:\n \"Optional long-form content (separate from canonicalText summary)\",\n },\n contentType: {\n type: \"string\",\n description:\n \"Content MIME type or format hint (e.g., 'text/markdown', 'code')\",\n },\n metadata: {\n type: \"object\",\n description:\n \"Optional extra metadata merged into the node (e.g., { codeAnchors: ['path/to/file.ts'], failedApproach: true } for coding intelligence)\",\n },\n },\n required: [\"canonicalText\", \"topicId\", \"targetNodeId\"],\n response: {\n description: \"The created evidence node and its edge\",\n fields: {\n nodeId: \"string — evidence node ID\",\n edgeId: \"string — edge to target belief\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// CONTRADICTION TOOLS\n// =============================================================================\n\nexport const FLAG_CONTRADICTION: McpToolContract = {\n name: \"flag_contradiction\",\n description:\n \"Flag a contradiction between two beliefs. Contradictions are first-class objects \" +\n \"with their own lifecycle — they may remain permanently unresolved. \" +\n \"Like a merge conflict that is allowed to persist. \" +\n \"Contradictions can trigger structural changes: forking, confidence collapse, or decision blocking. \" +\n \"Resolution is NEVER automatic — always surfaces for human review.\",\n parameters: {\n beliefA: {\n type: \"string\",\n description: \"First belief in the contradiction\",\n },\n beliefB: {\n type: \"string\",\n description: \"Second belief in the contradiction\",\n },\n description: { type: \"string\", description: \"What the tension is about\" },\n severity: {\n type: \"string\",\n description: \"How serious the contradiction is\",\n enum: [\"low\", \"medium\", \"high\", \"critical\"],\n },\n topicId: { type: \"string\", description: \"Topic scope\" },\n defeatType: {\n type: \"string\",\n description:\n \"Pollock defeat classification: rebuts (direct contradiction), undercuts (attacks the inferential link), undermines (attacks a premise)\",\n enum: [\"rebuts\", \"undercuts\", \"undermines\"],\n },\n },\n required: [\"beliefA\", \"beliefB\", \"description\", \"topicId\"],\n response: {\n description: \"The created contradiction object\",\n fields: {\n contradictionId: \"string\",\n status: \"string — 'unresolved'\",\n beliefA: \"string\",\n beliefB: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// WORKTREE TOOLS (git worktree add, git merge)\n// =============================================================================\n\nexport const ADD_WORKTREE: McpToolContract = {\n name: \"add_worktree\",\n description:\n \"Check out a branch into an active worktree for investigation. \" +\n \"Like `git worktree add <branch>` — creates independent working state on a thematic branch. \" +\n \"Beliefs committed within the worktree can be freely amended (draft code on a feature branch). \" +\n \"When investigation is complete, `merge` integrates findings into main.\",\n parameters: {\n title: { type: \"string\", description: \"Worktree name/objective\" },\n topicId: { type: \"string\", description: \"Topic scope\" },\n branchId: {\n type: \"string\",\n description: \"The branch this worktree investigates\",\n },\n objective: {\n type: \"string\",\n description:\n \"Plain-text reasoning objective to auto-shape into a hypothesis, questions, tasks, and dependencies\",\n },\n hypothesis: {\n type: \"string\",\n description: \"The testable claim this worktree investigates\",\n },\n beliefIds: {\n type: \"array\",\n description: \"Beliefs to test in this worktree\",\n },\n autoShape: {\n type: \"boolean\",\n description:\n \"Whether to invoke inquiry auto-shaping during worktree creation\",\n },\n domainPackId: {\n type: \"string\",\n description:\n \"Optional domain pack whose shaping hooks should influence generated questions and tasks\",\n },\n executionOrder: {\n type: \"number\",\n description: \"Global execution order for this worktree\",\n },\n dependsOn: {\n type: \"array\",\n description: \"Worktree IDs that must complete before this one can activate\",\n },\n blocks: {\n type: \"array\",\n description: \"Worktree IDs blocked by this worktree\",\n },\n gate: {\n type: \"string\",\n description: \"Exit gate name for this worktree\",\n },\n },\n required: [\"title\", \"topicId\"],\n response: {\n description: \"The created worktree\",\n fields: {\n worktreeId: \"string\",\n branchId: \"string | null\",\n status: \"string — usually 'planning' or 'active'\",\n title: \"string\",\n hypothesis: \"string | null\",\n questionCount: \"number\",\n taskCount: \"number\",\n autoShapeApplied: \"boolean\",\n frameworkSuggestions: \"array\",\n dependencySuggestions: \"array\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n};\n\nexport const MERGE: McpToolContract = {\n name: \"merge\",\n description:\n \"Merge a worktree's findings into the stable knowledge base (main). \" +\n \"Like `git merge` to main — formulations freeze, confidence is recorded, findings are integrated. \" +\n \"Each belief gets a confidence score and rationale. After merge, beliefs can only evolve via fork. \" +\n \"Low-confidence beliefs may need forking.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to merge\" },\n outcomes: {\n type: \"array\",\n description:\n \"Scoring outcomes for each belief: { beliefId, confidence, rationale }\",\n },\n summary: { type: \"string\", description: \"Overall findings summary\" },\n },\n required: [\"worktreeId\", \"outcomes\"],\n response: {\n description: \"Merge result\",\n fields: {\n worktreeId: \"string\",\n status: \"string — 'merged'\",\n beliefsScored: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// LINEAGE AND AUDIT TOOLS\n// =============================================================================\n\nexport const QUERY_LINEAGE: McpToolContract = {\n name: \"query_lineage\",\n description:\n \"Trace a belief's full ancestry — every fork, score, and confidence modulation. \" +\n \"Like `git log --graph`. \" +\n \"Returns the complete evolution chain showing how understanding developed over time. \" +\n \"Lineage is permanent and can never be erased (Invariant #3).\",\n parameters: {\n nodeId: { type: \"string\", description: \"Starting node to trace from\" },\n depth: {\n type: \"number\",\n description: \"How many generations to traverse (default: 5)\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Canonical lineage result\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n lineage: \"array — ancestry entries with beliefId, nodeId, formulation, forkReason, and createdAt\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const GET_CONFIDENCE_HISTORY: McpToolContract = {\n name: \"get_confidence_history\",\n description:\n \"Get the full confidence history for a belief. \" +\n \"Each entry records the confidence level, trigger, rationale, and actor. \" +\n \"Like `git log` for a single metric — append-only, never overwritten.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to get history for\" },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Confidence history entries\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n entries: \"array — { confidence, trigger, rationale, timestamp, userId }\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const GET_AUDIT_TRAIL: McpToolContract = {\n name: \"get_audit_trail\",\n description:\n \"Get the full audit trail for a node — every mutation, who made it, when, and why. \" +\n \"Like `git blame` for knowledge. \" +\n \"All state transitions are explicit, attributable, and permanently queryable. \" +\n \"No silent changes are possible (Invariant #14).\",\n parameters: {\n nodeId: { type: \"string\", description: \"The node to audit\" },\n limit: {\n type: \"number\",\n description: \"Maximum entries to return (default: 50)\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Audit trail entries\",\n fields: {\n entries: \"array — { action, actor, timestamp, before, after, rationale }\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// GRAPH QUERY TOOLS\n// =============================================================================\n\nexport const TRAVERSE_GRAPH: McpToolContract = {\n name: \"traverse_graph\",\n description:\n \"Walk the reasoning graph from a starting node. \" +\n \"Like `git log --graph` — traverses connected lineage across nodes and edges. \" +\n \"Traversal follows epistemic layers: L4 (judgments) → L3 (beliefs, questions) → L2 (evidence) → L1 (sources). \" +\n \"Never skips layers. \" +\n \"Use direction 'up' to trace what a piece of evidence supports, 'down' to trace what supports a judgment.\",\n parameters: {\n startNode: { type: \"string\", description: \"Node to start traversal from\" },\n direction: {\n type: \"string\",\n description: \"Traversal direction\",\n enum: [\"up\", \"down\", \"both\"],\n },\n maxDepth: {\n type: \"number\",\n description: \"Maximum traversal depth (default: 3)\",\n },\n },\n required: [\"startNode\"],\n response: {\n description: \"Subgraph of traversed nodes and edges\",\n fields: {\n nodes: \"array — traversed nodes\",\n edges: \"array — traversed edges\",\n depth: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const GET_GRAPH_NEIGHBORHOOD: McpToolContract = {\n name: \"get_graph_neighborhood\",\n description:\n \"Retrieve the local neighborhood around one or more graph nodes. \" +\n \"Like `git log --graph --boundary` for a focused reasoning window. \" +\n \"Returns the canonical neighborhood payload shared by HTTP and SDK graph surfaces.\",\n parameters: {\n globalId: {\n type: \"string\",\n description: \"Single root node global identifier.\",\n },\n globalIds: {\n type: \"array\",\n description: \"Optional list of root node global identifiers.\",\n },\n maxDepth: {\n type: \"number\",\n description: \"Maximum traversal depth (default: 2).\",\n },\n },\n required: [],\n response: {\n description: \"Canonical graph neighborhood payload\",\n fields: {\n nodes: \"array — graph nodes in the returned neighborhood\",\n edges: \"array — graph edges in the returned neighborhood\",\n depth: \"number — deepest traversed node depth\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const TRACE_ENTITY_IMPACT: McpToolContract = {\n name: \"trace_entity_impact\",\n description:\n \"Returns code-grounded beliefs, contracts, migration states, and failed attempts \" +\n \"anchored to a specific file or function path. \" +\n \"Like `git log -- <path>` — filters the knowledge graph to nodes anchored to a file path \" +\n \"via metadata.codeAnchors. Results are separated by coding belief type: decisions, contracts, \" +\n \"migrations, patterns, deprecations, and failures.\",\n parameters: {\n nodeId: {\n type: \"string\",\n description: \"Entity node ID to trace impact from\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description:\n \"Entity impact trace: direct beliefs, evidence, and indirect belief reach\",\n fields: {\n entityNodeId: \"string — the traced entity\",\n entityType: \"string — nodeType of the entity\",\n directBeliefConnections:\n \"array — beliefs directly connected via bridge edges\",\n evidenceConnections: \"array — evidence referencing this entity\",\n indirectBeliefConnections: \"array — beliefs reached through evidence\",\n totalBeliefReach: \"number — total unique beliefs impacted\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const SEARCH_BELIEFS: McpToolContract = {\n name: \"search_beliefs\",\n description:\n \"Search for beliefs in the reasoning graph. \" +\n \"Like `git grep` — finds relevant beliefs across the full history and active state. \" +\n \"Supports semantic search, filtering by status (unscored, scored, archived), \" +\n \"confidence thresholds, and topic scope. \" +\n \"Returns beliefs with their current confidence, lineage depth, and contradiction count.\",\n parameters: {\n query: { type: \"string\", description: \"Semantic search query\" },\n status: {\n type: \"string\",\n description: \"Filter by belief status\",\n enum: [\"unscored\", \"scored\", \"archived\"],\n },\n minConfidence: {\n type: \"number\",\n description: \"Minimum confidence threshold (0-1)\",\n },\n topicId: { type: \"string\", description: \"Filter by topic\" },\n limit: { type: \"number\", description: \"Maximum results (default: 10)\" },\n },\n required: [\"query\"],\n response: {\n description: \"Matching beliefs with metadata\",\n fields: {\n results:\n \"array — { nodeId, canonicalText, confidence, status, contradictionCount }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const SEARCH_RESOURCES: McpToolContract = {\n name: \"search_resources\",\n description:\n \"Search beliefs, evidence, and questions in one cross-resource call. \" +\n \"Like `git grep` across the reasoning stack — returns one ranked payload with grouped hits by resource type.\",\n parameters: {\n q: { type: \"string\", description: \"Search query\" },\n topicId: { type: \"string\", description: \"Topic scope\" },\n types: {\n type: \"array\",\n description: \"Optional resource filters: belief, evidence, question\",\n },\n status: {\n type: \"string\",\n description: \"Optional belief/question status filter\",\n },\n minConfidence: {\n type: \"number\",\n description: \"Optional minimum belief confidence threshold\",\n },\n limit: { type: \"number\", description: \"Maximum results (default: 25)\" },\n cursor: { type: \"string\", description: \"Optional pagination cursor\" },\n },\n required: [\"q\", \"topicId\"],\n response: {\n description: \"Canonical cross-resource search payload\",\n fields: {\n q: \"string — echoed query text\",\n topicId: \"string — canonical topic scope\",\n types: \"array — the resource types included in the search\",\n results: \"array — ranked mixed resource hits\",\n beliefs: \"array — grouped belief hits\",\n evidence: \"array — grouped evidence hits\",\n questions: \"array — grouped question hits\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const FIND_CONTRADICTIONS: McpToolContract = {\n name: \"find_contradictions\",\n description:\n \"Find contradictions in the reasoning graph — beliefs that are in tension with each other. \" +\n \"Like a merge conflict in `git` — surfaces incompatible states that require explicit resolution. \" +\n \"Contradictions are first-class objects that may remain permanently unresolved. \" +\n \"They can block judgments, trigger forks, or collapse confidence. \" +\n \"Filter by project, status (unresolved, resolved, accepted), and severity.\",\n parameters: {\n topicId: { type: \"string\", description: \"Filter by topic\" },\n nodeId: {\n type: \"string\",\n description: \"Find contradictions involving a specific belief\",\n },\n status: {\n type: \"string\",\n description: \"Filter by status\",\n enum: [\"unresolved\", \"resolved\", \"accepted\"],\n },\n },\n required: [],\n response: {\n description: \"Contradiction objects\",\n fields: {\n contradictions:\n \"array — { beliefA, beliefB, description, severity, status, defeatType }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// EDGE TOOLS\n// =============================================================================\n\nexport const CREATE_EDGE: McpToolContract = {\n name: \"create_edge\",\n description:\n \"Commit a typed relationship between two nodes in the reasoning graph. \" +\n \"Like `git commit` — an atomic write that declares a dependency between nodes. \" +\n \"The engine enforces layer transition rules — for example, L1 → L3 direct edges are forbidden (must go through L2).\",\n parameters: {\n sourceId: {\n type: \"string\",\n description: \"Source node of the relationship\",\n },\n targetId: {\n type: \"string\",\n description: \"Target node of the relationship\",\n },\n edgeType: {\n type: \"string\",\n description:\n \"Relationship type (informs, tests, depends_on, supersedes, etc.)\",\n },\n weight: {\n type: \"number\",\n description:\n \"Edge weight: -1.0 to +1.0 for informs edges, 0-1 for structural\",\n },\n reasoning: { type: \"string\", description: \"Why this relationship exists\" },\n reasoningMethod: {\n type: \"string\",\n description: \"How this was determined\",\n enum: [\"deductive\", \"inductive\", \"abductive\", \"analogical\", \"empirical\"],\n },\n },\n required: [\"sourceId\", \"targetId\", \"edgeType\"],\n response: {\n description: \"The created edge\",\n fields: {\n globalId: \"string — edge identifier\",\n edgeType: \"string\",\n fromLayer: \"string\",\n toLayer: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// JUDGMENT TOOLS (Phase 1: new vocabulary, aliased to decision implementation)\n// =============================================================================\n\nexport const RECORD_JUDGMENT: McpToolContract = {\n name: \"record_judgment\",\n description:\n \"Record a judgment — an irreversible commitment based on the current epistemic state. \" +\n \"Like a `git tag` marking a release. \" +\n \"A judgment synthesizes beliefs, evidence, and uncertainties into a determination. \" +\n \"Once issued, a judgment is evaluated against the epistemic state that existed when it was made \" +\n \"(knowledge horizon evaluation, Invariant #10).\",\n parameters: {\n title: { type: \"string\", description: \"Short judgment statement\" },\n rationale: {\n type: \"string\",\n description: \"Full reasoning behind the judgment\",\n },\n topicId: { type: \"string\", description: \"Topic scope\" },\n beliefIds: {\n type: \"array\",\n description: \"Beliefs that warrant this judgment\",\n },\n confidence: {\n type: \"number\",\n description: \"Confidence in the judgment (0-1)\",\n },\n },\n required: [\"title\", \"rationale\", \"topicId\"],\n response: {\n description: \"The recorded judgment\",\n fields: {\n judgmentId: \"string\",\n title: \"string\",\n status: \"string — 'issued'\",\n },\n },\n ownerModule: \"decision-state\",\n ontologyPrimitive: \"judgment\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// LENS TOOLS (workspace-scoped operational frames)\n// =============================================================================\n\nexport const CREATE_LENS: McpToolContract = {\n name: \"create_lens\",\n description:\n \"Create a reusable lens that overlays a workspace topic with a specific analytical perspective. \" +\n \"Like `git branch <name>` for operational scaffolding — a lens persists across worktrees and carries prompts, workflows, and task templates. \" +\n \"Multiple topics in the same workspace can reuse the same lens.\",\n parameters: {\n name: {\n type: \"string\",\n description: \"Lens name (e.g., 'market dynamics', 'team quality')\",\n },\n workspaceId: {\n type: \"string\",\n description:\n \"Workspace scope for the lens. Required unless topicId resolves to a workspace-scoped topic.\",\n },\n topicId: {\n type: \"string\",\n description:\n \"Optional originating topic scope. Lenses remain reusable across topics even when this is set.\",\n },\n description: {\n type: \"string\",\n description: \"What this lens is designed to investigate or monitor\",\n },\n perspectiveType: {\n type: \"string\",\n description:\n \"Perspective type for the lens. Validated against schemaEnumConfig category 'lens_perspective_type'.\",\n enum: [...LENS_PERSPECTIVE_TYPES],\n },\n promptTemplates: {\n type: \"array\",\n description: \"Langfuse prompt references used when operating through this lens\",\n },\n workflowTemplates: {\n type: \"array\",\n description: \"Guided workflow templates for lens-driven investigations\",\n },\n taskTemplates: {\n type: \"array\",\n description: \"Default task templates instantiated when the lens is applied\",\n },\n filterCriteria: {\n type: \"object\",\n description: \"Belief/evidence filtering rules applied by the lens\",\n },\n },\n required: [\"name\", \"perspectiveType\"],\n response: {\n description: \"The created lens\",\n fields: {\n lensId: \"string\",\n name: \"string\",\n workspaceId: \"string\",\n status: \"string — 'active'\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"lens\",\n tier: \"showcase\",\n};\n\nexport const LIST_LENSES: McpToolContract = {\n name: \"list_lenses\",\n description:\n \"List reusable lenses for a workspace, optionally scored by whether they are active on a topic. \" +\n \"Like `git branch --list` — shows the available named frames you can activate. \" +\n \"When topicId is provided, the response can indicate which lenses are already applied there.\",\n parameters: {\n workspaceId: {\n type: \"string\",\n description: \"Workspace scope to list lenses from\",\n },\n topicId: {\n type: \"string\",\n description:\n \"Optional topic scope used to derive workspace and annotate applied lenses\",\n },\n status: {\n type: \"string\",\n description: \"Filter by lens lifecycle status\",\n enum: [\"draft\", \"active\", \"archived\"],\n },\n perspectiveType: {\n type: \"string\",\n description: \"Filter by perspective type\",\n enum: [...LENS_PERSPECTIVE_TYPES],\n },\n },\n required: [],\n response: {\n description: \"Available lenses\",\n fields: {\n lenses:\n \"array — each item includes lensId, name, workspaceId, perspectiveType, status, and optional isAppliedToTopic\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"lens\",\n tier: \"workhorse\",\n};\n\nexport const APPLY_LENS_TO_TOPIC: McpToolContract = {\n name: \"apply_lens_to_topic\",\n description:\n \"Apply a lens to a topic so it becomes an active perspective overlay. \" +\n \"Like `git checkout <branch>` for a reusable frame — the topic keeps its knowledge, but the active lens shapes guidance and retrieval. \" +\n \"Multiple active lenses can coexist on the same topic.\",\n parameters: {\n lensId: { type: \"string\", description: \"Lens to activate on the topic\" },\n topicId: { type: \"string\", description: \"Topic that should receive the lens\" },\n },\n required: [\"lensId\", \"topicId\"],\n response: {\n description: \"Lens activation result\",\n fields: {\n bindingId: \"string\",\n lensId: \"string\",\n topicId: \"string\",\n status: \"string — 'active'\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"lens\",\n tier: \"workhorse\",\n};\n\nexport const REMOVE_LENS_FROM_TOPIC: McpToolContract = {\n name: \"remove_lens_from_topic\",\n description:\n \"Remove an active lens overlay from a topic. \" +\n \"Like `git switch` away from a frame — the topic remains, but the lens stops shaping the investigation context. \" +\n \"Historical binding state is preserved for auditability.\",\n parameters: {\n lensId: { type: \"string\", description: \"Lens to remove from the topic\" },\n topicId: { type: \"string\", description: \"Topic that currently has the lens applied\" },\n },\n required: [\"lensId\", \"topicId\"],\n response: {\n description: \"Lens removal result\",\n fields: {\n bindingId: \"string\",\n lensId: \"string\",\n topicId: \"string\",\n status: \"string — 'removed'\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"lens\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// PUSH TOOLS (git push)\n// =============================================================================\n\nexport const PUSH: McpToolContract = {\n name: \"push\",\n description:\n \"Push scored beliefs from a merged worktree to other contexts. \" +\n \"Like `git push` — makes local findings available on the remote. \" +\n \"Only merged beliefs can be pushed. \" +\n \"Publication makes findings visible to other projects, teams, or external consumers.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The merged worktree whose findings to push\",\n },\n targetContext: {\n type: \"string\",\n description: \"Where to push (e.g., 'portfolio', 'ic_review', 'external')\",\n },\n beliefIds: {\n type: \"array\",\n description: \"Optional subset of beliefs to push (default: all scored)\",\n },\n },\n required: [\"worktreeId\", \"targetContext\"],\n response: {\n description: \"Push result\",\n fields: {\n pushedCount: \"number\",\n targetContext: \"string\",\n pushedAt: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// PULL REQUEST TOOLS (git pull request)\n// =============================================================================\n\nexport const OPEN_PULL_REQUEST: McpToolContract = {\n name: \"open_pull_request\",\n description:\n \"Open a pull request for peer review before merging a worktree. \" +\n \"Like opening a `git pull request` — the worktree's findings are ready but await approval before merge. \" +\n \"Reviewers can approve, request changes, or block the merge. \" +\n \"This is the gate between draft work and scored knowledge.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The worktree to submit for review\",\n },\n reviewers: {\n type: \"array\",\n description: \"User IDs of requested reviewers\",\n },\n summary: {\n type: \"string\",\n description: \"Summary of findings and why they're ready for merge\",\n },\n },\n required: [\"worktreeId\", \"summary\"],\n response: {\n description: \"The pull request\",\n fields: {\n pullRequestId: \"string\",\n worktreeId: \"string\",\n status: \"string — 'pending_review'\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// FORENSIC TOOLS (git bisect)\n// =============================================================================\n\nexport const BISECT_CONFIDENCE: McpToolContract = {\n name: \"bisect_confidence\",\n description:\n \"Find when a belief's confidence diverged from reality. \" +\n \"Like `git bisect` — binary search through the credence history to find the inflection point. \" +\n \"Given a belief that is now known to be wrong (or right), traces back through \" +\n \"confidence modulations to identify which evidence or event caused the divergence.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to bisect\" },\n expectedDirection: {\n type: \"string\",\n description: \"Was confidence too high or too low?\",\n enum: [\"overconfident\", \"underconfident\"],\n },\n timeRange: {\n type: \"object\",\n description:\n \"Optional time range to search within: { start: number, end: number }\",\n },\n },\n required: [\"nodeId\", \"expectedDirection\"],\n response: {\n description: \"The inflection point in confidence history\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n expectedDirection: \"string — overconfident | underconfident\",\n inflectionEntry:\n \"object — the confidence modulation where divergence began\",\n triggerEvent: \"string | null — what caused the divergence\",\n confidenceBefore: \"number | null\",\n confidenceAfter: \"number | null\",\n totalEntries: \"number\",\n inflectionIndex: \"number | null\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// GRAPH INTELLIGENCE TOOLS\n// =============================================================================\n\nexport const DETECT_CONFIRMATION_BIAS: McpToolContract = {\n name: \"detect_confirmation_bias\",\n description:\n \"Detect confirmation bias in the evidence graph. \" +\n \"Like `git diff --stat` for reasoning — analyzes the ratio of supporting vs challenging evidence \" +\n \"per belief and flags beliefs where the evidence is suspiciously one-sided. \" +\n \"Returns risk classification (critical/high/moderate/healthy).\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n threshold: {\n type: \"number\",\n description: \"Bias threshold (0-1, default 0.7)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Beliefs with bias scores, risk levels, and evidence counts\",\n fields: {\n beliefs:\n \"array — { nodeId, biasScore, riskLevel, supportingCount, challengingCount }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const GET_GRAPH_STRUCTURE_ANALYSIS: McpToolContract = {\n name: \"get_graph_structure_analysis\",\n description:\n \"Run comprehensive structural analysis on the knowledge graph. \" +\n \"Like `git fsck` combined with PageRank — runs 14 algorithmic detectors including \" +\n \"PageRank centrality, Louvain community detection, Tarjan SCC, Fiedler vector spectral analysis, \" +\n \"Bayesian surprise, and overconfidence detection.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Structural analysis with detector results and recommendations\",\n fields: {\n topicId: \"string — canonical topic scope\",\n metric: \"string — analysis metric identifier\",\n payload: \"object — detector results, recommendations, graph metrics\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const GET_FALSIFICATION_QUESTIONS: McpToolContract = {\n name: \"get_falsification_questions\",\n description:\n \"Generate Popperian falsification questions for beliefs. \" +\n \"Like `git test` — identifies the questions most likely to disprove current beliefs. \" +\n \"Karl Popper as a tool: surfaces what would need to be true to invalidate each belief.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic to analyze\" },\n beliefIds: { type: \"array\", description: \"Specific beliefs to target\" },\n },\n required: [\"topicId\"],\n response: {\n description:\n \"Questions with falsification potential scores and target beliefs\",\n fields: {\n questions:\n \"array — { questionText, falsificationPotential, targetBeliefId, targetBeliefText }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"question\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// SOURCES & RESEARCH TOOLS\n// =============================================================================\n\nexport const SEARCH_SOURCES: McpToolContract = {\n name: \"search_sources\",\n description:\n \"Search and ingest external sources into the knowledge graph. \" +\n \"Like `git fetch` — pulls information from external sources (web, documents, APIs) \" +\n \"and stages it for evidence creation. Does not commit — you decide what becomes evidence.\",\n parameters: {\n query: { type: \"string\", description: \"Search query\" },\n sources: {\n type: \"array\",\n description: \"Source types to search: web, news, academic\",\n },\n },\n required: [\"query\"],\n response: {\n description:\n \"Results with source metadata, relevance scores, and suggested evidence\",\n fields: {\n results:\n \"array — { title, url, snippet, relevanceScore, suggestedEvidence }\",\n },\n },\n ownerModule: \"research-engine\",\n ontologyPrimitive: \"source\",\n tier: \"showcase\",\n};\n\nexport const EXECUTE_DEEP_RESEARCH: McpToolContract = {\n name: \"execute_deep_research\",\n description:\n \"Execute multi-source deep research on a topic. \" +\n \"Like `git submodule update --recursive` — launches a comprehensive research agent that searches \" +\n \"multiple sources, synthesizes findings, and produces a structured report. \" +\n \"Auto-links results to relevant questions and beliefs.\",\n parameters: {\n query: { type: \"string\", description: \"Research question or topic\" },\n topicId: { type: \"string\", description: \"Topic scope\" },\n depth: {\n type: \"string\",\n description: \"Research depth: quick, standard, deep\",\n enum: [\"quick\", \"standard\", \"deep\"],\n },\n },\n required: [\"query\", \"topicId\"],\n response: {\n description:\n \"Report with findings, sources, auto-linked evidence and questions\",\n fields: {\n report:\n \"object — { summary, findings, sources, linkedEvidence, linkedQuestions }\",\n },\n },\n ownerModule: \"research-engine\",\n ontologyPrimitive: \"source\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// EVIDENCE OPERATION TOOLS\n// =============================================================================\n\nexport const SEARCH_EVIDENCE: McpToolContract = {\n name: \"search_evidence\",\n description:\n \"Search for evidence across the reasoning graph. \" +\n \"Like `git grep` — returns the evidence records that best match a textual query. \" +\n \"Results share the same canonical semantics as the HTTP and SDK evidence search surface.\",\n parameters: {\n q: { type: \"string\", description: \"Search text\" },\n topicId: { type: \"string\", description: \"Topic scope filter\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to scope the search\",\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [\"q\"],\n response: {\n description: \"Canonical evidence search results page\",\n fields: {\n results:\n \"array — { evidenceId, nodeId, globalId?, text, source?, kind?, relevanceScore }\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const CREATE_EVIDENCE: McpToolContract = {\n name: \"create_evidence\",\n description:\n \"Commit evidence to the reasoning graph. \" +\n \"Like `git commit` — creates a traceable evidence record with canonical public IDs. \" +\n \"Optionally links the evidence to a belief or question in the same operation.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n text: { type: \"string\", description: \"Canonical evidence text\" },\n source: { type: \"string\", description: \"Source URL or source label\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to link immediately\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n metadata: {\n type: \"object\",\n description: \"Optional metadata merged into the canonical evidence node\",\n },\n title: { type: \"string\", description: \"Optional short title\" },\n content: { type: \"string\", description: \"Optional long-form content\" },\n contentType: {\n type: \"string\",\n description: \"Optional content format or MIME hint\",\n },\n kind: { type: \"string\", description: \"Optional evidence kind\" },\n },\n required: [\"topicId\", \"text\"],\n response: {\n description: \"The created canonical evidence record\",\n fields: {\n id: \"string — canonical evidence ID\",\n nodeId: \"string — canonical evidence ID\",\n evidenceId: \"string — canonical evidence ID\",\n text: \"string\",\n topicId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const GET_EVIDENCE: McpToolContract = {\n name: \"get_evidence\",\n description:\n \"Read one evidence record by ID. \" +\n \"Like `git show` — resolves the canonical evidence payload for a single identifier.\",\n parameters: {\n id: { type: \"string\", description: \"Canonical evidence ID\" },\n },\n required: [\"id\"],\n response: {\n description: \"The canonical evidence record\",\n fields: {\n id: \"string — canonical evidence ID\",\n nodeId: \"string — canonical evidence ID\",\n evidenceId: \"string — canonical evidence ID\",\n text: \"string\",\n topicId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const LIST_EVIDENCE: McpToolContract = {\n name: \"list_evidence\",\n description:\n \"List evidence records within a topic or linked to a target. \" +\n \"Like `git log -- path` — returns the canonical evidence page for a topic, belief, or question scope.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope filter\" },\n targetId: {\n type: \"string\",\n description: \"Optional belief or question identifier to scope by linkage\",\n },\n limit: { type: \"number\", description: \"Max results\" },\n cursor: { type: \"string\", description: \"Pagination cursor\" },\n },\n required: [],\n response: {\n description: \"Canonical evidence page\",\n fields: {\n evidence: \"array — canonical evidence records\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"evidence\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE: McpToolContract = {\n name: \"link_evidence\",\n description:\n \"Link evidence to a belief or question. \" +\n \"Like `git notes add` — attaches a supporting or contradicting edge without rewriting the evidence itself.\",\n parameters: {\n evidenceId: { type: \"string\", description: \"Canonical evidence ID\" },\n targetId: {\n type: \"string\",\n description: \"Canonical belief or question ID\",\n },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n rationale: { type: \"string\", description: \"Why this link exists\" },\n },\n required: [\"evidenceId\", \"targetId\"],\n response: {\n description: \"The created canonical evidence edge summary\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n targetId: \"string\",\n targetType: \"string — belief | question\",\n weight: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\nexport const LINK_EVIDENCE_TO_BELIEF: McpToolContract = {\n name: \"link_evidence_to_belief\",\n description:\n \"Link evidence to a belief with a support weight. \" +\n \"Like `git add` — stages evidence in support of (or against) a belief. \" +\n \"The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports).\",\n parameters: {\n evidenceId: { type: \"string\", description: \"The evidence node ID\" },\n beliefId: { type: \"string\", description: \"The belief node ID\" },\n weight: {\n type: \"number\",\n description: \"Support weight: -1.0 (contradicts) to +1.0 (supports)\",\n },\n rationale: { type: \"string\", description: \"Why this evidence is relevant\" },\n },\n required: [\"evidenceId\", \"beliefId\", \"weight\"],\n response: {\n description: \"The created edge linking evidence to belief\",\n fields: {\n edgeId: \"string\",\n evidenceId: \"string\",\n beliefId: \"string\",\n weight: \"number\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// QUESTION OPERATION TOOLS\n// =============================================================================\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: \"Topic scope\" },\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\", \"topicId\"],\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 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\", \"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 },\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 their phase, 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 },\n required: [\"topicId\"],\n response: {\n description:\n \"Worktrees with phase, status, belief count, and creation time\",\n fields: {\n worktrees:\n \"array — { worktreeId, title, phase, 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 \"track, trackPosition, executionBand, dependencies, and status. \" +\n \"Supports filtering by status, track, and executionBand. \" +\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 track: {\n type: \"string\",\n description:\n \"Filter by track name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity')\",\n },\n executionBand: {\n type: \"number\",\n description:\n \"Filter by execution band number (e.g., 1, 2, 3). Returns only worktrees in that parallel execution group.\",\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, track, trackPosition, executionBand, executionOrder, dependsOn, blocks, gate, createdAt }\",\n total: \"number — total count after filtering\",\n tracks: \"object — { trackName: count } summary of worktrees per track\",\n bands:\n \"object — { bandNumber: count } summary of worktrees per execution band\",\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 — execution order, 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 executionOrder: {\n type: \"number\",\n description: \"Global execution order (1 = first, higher = later)\",\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 track: {\n type: \"string\",\n description:\n \"Parallel workstream name (e.g., 'ontology', 'tc-scope', 'control-plane', 'dev-portal', 'mcp-sdk-parity', 'execution-program'). Groups worktrees into named lanes for pipeline visualization and PM analysis.\",\n },\n trackPosition: {\n type: \"number\",\n description:\n \"Position within the track (1-indexed). E.g., TC-A=1, TC-B=2, TC-C=3 within the 'tc-scope' track.\",\n },\n executionBand: {\n type: \"number\",\n description:\n \"Parallel execution band number. All worktrees in the same band can run simultaneously. Band 2 = OE-B + TC-A, Band 3 = TC-B + 11D-R + S2-13A, etc.\",\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: \"string — canonical federated principal identifier\",\n principalType: \"string — human, service, or agent\",\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 COMPILE_CONTEXT: McpToolContract = {\n name: \"compile_context\",\n description:\n \"Compile a focused reasoning context for a topic. \" +\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: \"Topic scope ID to compile\",\n },\n query: {\n type: \"string\",\n description: \"Optional focus query used to rank context items\",\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: [\"topicId\"],\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\nexport const CHECK_PERMISSION: McpToolContract = {\n name: \"check_permission\",\n description:\n \"Check whether a principal can read or mutate a topic scope. \" +\n \"Like `git check-ref-format` for ACLs — validates whether the requested operation is allowed before execution.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope to evaluate\" },\n permission: {\n type: \"string\",\n description: \"Permission to evaluate\",\n enum: [\"read\", \"write\"],\n },\n principal: {\n type: \"string\",\n description:\n \"Optional principal override (defaults to current principal)\",\n },\n beliefClusterId: {\n type: \"string\",\n description: \"Optional neighborhood scope within a topic\",\n },\n },\n required: [\"topicId\", \"permission\"],\n response: {\n description: \"Permission evaluation result\",\n fields: {\n allowed: \"boolean\",\n decision: \"string — allow | deny\",\n reasonCode: \"string\",\n principalId: \"string\",\n topicId: \"string\",\n permission: \"string — read | write\",\n },\n },\n ownerModule: \"access-control\",\n ontologyPrimitive: \"policy\",\n tier: \"workhorse\",\n};\n\nexport const FILTER_BY_PERMISSION: McpToolContract = {\n name: \"filter_by_permission\",\n description:\n \"Filter a topic set down to ACL-authorized topics. \" +\n \"Like `git rev-list --ancestry-path` for policy boundaries — keeps only topics permitted for the requested action.\",\n parameters: {\n topicIds: { type: \"array\", description: \"Topic IDs to evaluate\" },\n permission: {\n type: \"string\",\n description: \"Permission filter\",\n enum: [\"read\", \"write\"],\n },\n principal: {\n type: \"string\",\n description: \"Optional principal override (tenant admin only)\",\n },\n },\n required: [\"topicIds\", \"permission\"],\n response: {\n description: \"Allowed/denied split for the requested topic set\",\n fields: {\n permission: \"string — read | write\",\n allowedTopicIds: \"array — topic IDs allowed by policy\",\n deniedTopics: \"array — { topicId, reasonCode }\",\n count: \"number\",\n },\n },\n ownerModule: \"access-control\",\n ontologyPrimitive: \"policy\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// OBSERVATION TOOLS\n// =============================================================================\n\nexport const INGEST_OBSERVATION: McpToolContract = {\n name: \"ingest_observation\",\n description:\n \"Record an observational delta for a topic context stream. \" +\n \"Like `git notes add` — attaches structured observation metadata without mutating graph state directly. \" +\n \"Used by watcher/cowork agents to stage candidate updates before explicit write confirmation.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Topic scope for the observation\",\n },\n observationType: {\n type: \"string\",\n description: \"Observation class\",\n enum: [\n \"claim\",\n \"evidence\",\n \"question\",\n \"contradiction\",\n \"judgment\",\n \"note\",\n ],\n },\n summary: {\n type: \"string\",\n description: \"Human-readable observation summary\",\n },\n source: {\n type: \"string\",\n description: \"Optional source (message ID, tool name, URL, etc.)\",\n },\n confidence: { type: \"number\", description: \"Optional confidence in [0,1]\" },\n tags: { type: \"array\", description: \"Optional observation tags\" },\n metadata: {\n type: \"object\",\n description: \"Optional structured metadata payload\",\n },\n },\n required: [\"topicId\", \"observationType\", \"summary\"],\n response: {\n description: \"Recorded observation entry\",\n fields: {\n observationId: \"string\",\n topicId: \"string\",\n observationType: \"string\",\n createdAt: \"number\",\n contextResourceUri: \"string\",\n },\n },\n ownerModule: \"agent-harness\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const GET_OBSERVATION_CONTEXT: McpToolContract = {\n name: \"get_observation_context\",\n description:\n \"Retrieve observer-ready context for a topic, including recent deltas and semantic matches. \" +\n \"Like `git log --grep` — shows recent context and filtered matches across observation history. \" +\n \"This powers prompt context injection without mutating graph state.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n query: {\n type: \"string\",\n description: \"Optional semantic query over observation history\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum entries in each returned collection\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Observation context payload\",\n fields: {\n topicId: \"string\",\n totalObservations: \"number\",\n latest: \"array\",\n semanticMatches: \"array\",\n byType: \"object\",\n generatedAt: \"number\",\n },\n },\n ownerModule: \"agent-harness\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// TASK LIFECYCLE TOOLS\n// =============================================================================\n\nexport const CREATE_TASK: McpToolContract = {\n name: \"create_task\",\n description:\n \"Create an execution task tied to the reasoning state. \" +\n \"Like `git task` — tracks concrete work items (calls to make, data to gather, analyses to run) \" +\n \"linked to questions, beliefs, or worktrees.\",\n parameters: {\n title: { type: \"string\", description: \"Task description\" },\n topicId: { type: \"string\", description: \"Topic scope\" },\n taskType: {\n type: \"string\",\n description: \"Type: research, interview, analysis, data_collection\",\n enum: [\"research\", \"interview\", \"analysis\", \"data_collection\"],\n },\n linkedQuestionId: {\n type: \"string\",\n description: \"Question this task addresses\",\n },\n linkedWorktreeId: { type: \"string\", description: \"Worktree scope\" },\n },\n required: [\"title\", \"topicId\"],\n response: {\n description: \"The created task\",\n fields: {\n taskId: \"string\",\n status: \"string — 'pending'\",\n createdAt: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"workhorse\",\n};\n\nexport const COMPLETE_TASK: McpToolContract = {\n name: \"complete_task\",\n description:\n \"Mark a task as complete with an output summary. \" +\n \"Like `git tag` for work items — records the discrete completion event and captures what was learned. \" +\n \"Completed tasks feed back into the evidence graph.\",\n parameters: {\n taskId: { type: \"string\", description: \"The task to complete\" },\n outputSummary: {\n type: \"string\",\n description: \"What was accomplished or learned\",\n },\n evidenceCreated: {\n type: \"boolean\",\n description: \"Whether new evidence was created from this task\",\n },\n },\n required: [\"taskId\", \"outputSummary\"],\n response: {\n description: \"The completed task\",\n fields: {\n taskId: \"string\",\n completedAt: \"number\",\n outputSummary: \"string\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_TASK: McpToolContract = {\n name: \"update_task\",\n description:\n \"Update a task's fields — relink to a different worktree, belief, or question, change title/priority/status. \" +\n \"Like `git task edit` — mutates an existing task in place instead of requiring recreate-plus-supersede.\",\n parameters: {\n taskId: { type: \"string\", description: \"The task to update\" },\n linkedWorktreeId: {\n type: \"string\",\n description: \"Reassign this task to a different worktree\",\n },\n linkedBeliefId: {\n type: \"string\",\n description: \"Link or relink this task to a belief node\",\n },\n linkedQuestionId: {\n type: \"string\",\n description: \"Link or relink this task to a question node\",\n },\n title: { type: \"string\", description: \"Updated task title\" },\n description: {\n type: \"string\",\n description: \"Updated task description\",\n },\n priority: {\n type: \"string\",\n description: \"Updated priority\",\n enum: [\"critical\", \"high\", \"medium\", \"low\"],\n },\n status: {\n type: \"string\",\n description: \"Updated status\",\n enum: [\"todo\", \"in_progress\", \"blocked\", \"done\"],\n },\n },\n required: [\"taskId\"],\n response: {\n description: \"The updated task\",\n fields: {\n taskId: \"string\",\n updatedAt: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"workhorse\",\n};\n\nexport const LIST_TASKS: McpToolContract = {\n name: \"list_tasks\",\n description:\n \"List tasks for a topic or worktree. \" +\n \"Like `git task list` — returns tasks with status, priority, and linked nodes. \" +\n \"Filter by worktree to see tasks for a specific investigation, or by status to find incomplete work.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n linkedWorktreeId: {\n type: \"string\",\n description: \"Filter to tasks linked to this worktree\",\n },\n status: {\n type: \"string\",\n description: \"Filter by status: todo, in_progress, blocked, done\",\n enum: [\"todo\", \"in_progress\", \"blocked\", \"done\"],\n },\n limit: { type: \"number\", description: \"Maximum results (default: 100)\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"List of tasks with metadata\",\n fields: { tasks: \"array of task objects\", count: \"number\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// TOPIC TOOLS (git init, git remote)\n// =============================================================================\n\nexport const CREATE_TOPIC: McpToolContract = {\n name: \"create_topic\",\n description:\n \"Create a new topic container for scoping knowledge. \" +\n \"Like `git init` — initializes a new repository for a knowledge domain. \" +\n \"Topics are hierarchical: a deal topic can nest under a theme topic. \" +\n \"Types: domain, theme, deal, strategy, constitution, project, portfolio.\",\n parameters: {\n name: { type: \"string\", description: \"Topic name\" },\n type: {\n type: \"string\",\n description:\n \"Topic type. Validated against schemaEnumConfig category 'topic_type'.\",\n },\n description: { type: \"string\", description: \"What this topic covers\" },\n parentTopicId: {\n type: \"string\",\n description: \"Optional parent topic for nesting\",\n },\n createdBy: { type: \"string\", description: \"Who created this topic\" },\n },\n required: [\"name\", \"type\"],\n response: {\n description: \"The created topic\",\n fields: {\n id: \"string — topic ID\",\n globalId: \"string — globally unique ID\",\n depth: \"number — nesting depth\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const LIST_TOPICS: McpToolContract = {\n name: \"list_topics\",\n description:\n \"List topics, optionally filtered by type or parent. \" +\n \"Like `git remote -v` — shows all knowledge containers with their types and hierarchy.\",\n parameters: {\n type: {\n type: \"string\",\n description: \"Filter by topic type (e.g., 'theme', 'deal')\",\n },\n parentTopicId: {\n type: \"string\",\n description: \"Filter to children of this parent\",\n },\n status: {\n type: \"string\",\n description: \"Filter by status\",\n enum: [\"active\", \"archived\", \"watching\"],\n },\n },\n required: [],\n response: {\n description: \"List of topics with metadata\",\n fields: {\n topics: \"array — { id, name, type, depth, status, parentTopicId }\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const GET_TOPIC: McpToolContract = {\n name: \"get_topic\",\n description:\n \"Get one topic by ID. \" +\n \"Like `git remote show origin` — inspects a single knowledge container in detail.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Canonical topic ID to retrieve\",\n },\n id: {\n type: \"string\",\n description: \"Legacy alias for topicId\",\n },\n },\n required: [],\n response: {\n description: \"Single topic record\",\n fields: {\n topic:\n \"object — { id, globalId, name, type, depth, status, parentTopicId, description }\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const UPDATE_TOPIC: McpToolContract = {\n name: \"update_topic\",\n description:\n \"Update an existing topic's metadata. \" +\n \"Like `git remote set-url` — changes the canonical configuration for a knowledge container without recreating it.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Canonical topic ID to update\",\n },\n id: {\n type: \"string\",\n description: \"Legacy alias for topicId\",\n },\n name: { type: \"string\", description: \"Updated topic name\" },\n description: { type: \"string\", description: \"Updated topic description\" },\n type: {\n type: \"string\",\n description:\n \"Updated topic type. Validated against schemaEnumConfig category 'topic_type'.\",\n },\n ontologyId: {\n type: \"string\",\n description: \"Updated ontology binding\",\n },\n clearOntologyId: {\n type: \"boolean\",\n description: \"Clear the current ontology binding\",\n },\n status: {\n type: \"string\",\n description: \"Updated topic status\",\n enum: [\"active\", \"archived\", \"watching\"],\n },\n visibility: {\n type: \"string\",\n description: \"Updated topic visibility\",\n enum: [\"private\", \"team\", \"firm\", \"external\", \"public\"],\n },\n },\n required: [],\n response: {\n description: \"The updated topic\",\n fields: {\n id: \"string — topic ID\",\n globalId: \"string — globally unique ID\",\n status: \"string — topic lifecycle status\",\n visibility: \"string — topic visibility\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const GET_TOPIC_TREE: McpToolContract = {\n name: \"get_topic_tree\",\n description:\n \"Get the full topic hierarchy from a root. \" +\n \"Like `git log --graph --all` — shows the complete tree of nested topics.\",\n parameters: {\n rootId: { type: \"string\", description: \"Root topic to start from\" },\n maxDepth: {\n type: \"number\",\n description: \"Maximum depth to traverse (default: 5)\",\n },\n },\n required: [\"rootId\"],\n response: {\n description: \"Tree of topics with nesting\",\n fields: { tree: \"array — topics in BFS order with depth and path\" },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// CODING INTELLIGENCE TOOLS (code-grounded knowledge)\n// =============================================================================\n\nexport const GET_CODE_CONTEXT: McpToolContract = {\n name: \"get_code_context\",\n description:\n \"Returns code-grounded beliefs, contracts, migration states, and failed attempts anchored to a specific file or function path. \" +\n \"Like `git log -- <path>` — filters the knowledge graph to nodes anchored to a file path via metadata.codeAnchors. \" +\n \"Results are separated by coding belief type: decisions, contracts, migrations, patterns, deprecations, and failures.\",\n parameters: {\n filePath: {\n type: \"string\",\n description:\n \"File path to search for (partial matches supported, e.g. 'epistemicBeliefs.ts' or 'convex/epistemicBeliefs.ts')\",\n },\n topicId: {\n type: \"string\",\n description: \"Topic scope (optional, uses default if not provided)\",\n },\n includeFailures: {\n type: \"boolean\",\n description: \"Whether to include failed attempt evidence (default: true)\",\n },\n },\n required: [\"filePath\"],\n response: {\n description: \"Code-anchored beliefs and evidence grouped by type\",\n fields: {\n filePath: \"string — queried path\",\n decisions: \"array — implementation_decision beliefs\",\n contracts: \"array — interface_contract beliefs\",\n migrations: \"array — migration_state beliefs\",\n patterns: \"array — code_pattern beliefs\",\n deprecations: \"array — deprecation_notice beliefs\",\n failures: \"array — failed attempt evidence\",\n totalMatched: \"number\",\n },\n },\n ownerModule: \"coding-intelligence\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\nexport const GET_CHANGE_HISTORY: McpToolContract = {\n name: \"get_change_history\",\n description:\n \"Returns recent changes and decisions for a file path — the 'why' behind recent code changes. \" +\n \"Like `git log --follow <path>` — shows the evolution of understanding anchored to a specific file. \" +\n \"Searches beliefs and evidence updated recently, sorted by most recent first.\",\n parameters: {\n filePath: { type: \"string\", description: \"File path to get history for\" },\n topicId: { type: \"string\", description: \"Topic scope (optional)\" },\n limit: { type: \"number\", description: \"Max results (default: 10)\" },\n },\n required: [\"filePath\"],\n response: {\n description: \"Recent code-anchored changes sorted by recency\",\n fields: {\n filePath: \"string — queried path\",\n changes:\n \"array — nodes with coding view (nodeId, beliefType, canonicalText, codeAnchors, timestamps)\",\n totalFound: \"number\",\n showing: \"number\",\n },\n },\n ownerModule: \"coding-intelligence\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const RECORD_ATTEMPT: McpToolContract = {\n name: \"record_attempt\",\n description:\n \"Log a failed approach as evidence linked to a belief. \" +\n \"Like `git stash` for failed experiments — preserves what was tried so the same mistake isn't repeated. \" +\n \"Creates evidence with metadata.failedApproach=true and metadata.codeAnchors. \" +\n \"The key anti-repetition mechanism: future agents check the failure log before trying new approaches.\",\n parameters: {\n description: {\n type: \"string\",\n description: \"What was attempted and why it failed\",\n },\n filePaths: {\n type: \"array\",\n description: \"File paths involved in the attempt\",\n },\n errorMessage: {\n type: \"string\",\n description: \"Error message or failure reason\",\n },\n linkedBeliefId: {\n type: \"string\",\n description:\n \"Belief this attempt was targeting (creates -0.5 weight edge)\",\n },\n topicId: { type: \"string\", description: \"Topic scope (optional)\" },\n },\n required: [\"description\"],\n response: {\n description: \"The recorded failed attempt evidence node\",\n fields: {\n nodeId: \"string — evidence node ID\",\n edgeId: \"string | null — edge to linked belief\",\n recorded: \"boolean — true\",\n filePaths: \"array — anchored file paths\",\n },\n },\n ownerModule: \"coding-intelligence\",\n ontologyPrimitive: \"evidence\",\n tier: \"showcase\",\n};\n\nexport const GET_FAILURE_LOG: McpToolContract = {\n name: \"get_failure_log\",\n description:\n \"Search past failed attempts matching a task description. \" +\n \"Like `git log --grep='FAILED'` — finds evidence of what was tried before and didn't work. \" +\n \"Before trying a new approach, check this log to avoid repeating the same mistake. \" +\n \"Filters to evidence with metadata.failedApproach=true, sorted by recency.\",\n parameters: {\n query: {\n type: \"string\",\n description: \"Description of the task or approach to search for\",\n },\n filePath: {\n type: \"string\",\n description: \"Optional file path to narrow results\",\n },\n topicId: { type: \"string\", description: \"Topic scope (optional)\" },\n limit: { type: \"number\", description: \"Max results (default: 5)\" },\n },\n required: [\"query\"],\n response: {\n description: \"Failed attempts matching the query\",\n fields: {\n query: \"string — search query\",\n failures: \"array — failed attempt evidence with coding view\",\n totalFound: \"number\",\n showing: \"number\",\n },\n },\n ownerModule: \"coding-intelligence\",\n ontologyPrimitive: \"evidence\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// GRAPH SELF-INTELLIGENCE TOOLS\n// =============================================================================\n\nexport const GET_TOPIC_COVERAGE: McpToolContract = {\n name: \"get_topic_coverage\",\n description:\n \"Returns per-topic belief/question/evidence counts across the topic tree. \" +\n \"Like `git diff --stat` for the knowledge graph — shows coverage density \" +\n \"and empty spots across the topic hierarchy. Use to identify which topics \" +\n \"need more beliefs, which lack questions, and overall graph health.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Topic scope ID (optional, uses default if not provided)\",\n },\n includeDescendants: {\n type: \"boolean\",\n description:\n \"Whether to include descendant topics in the coverage report (default: true)\",\n },\n maxDepth: {\n type: \"number\",\n description:\n \"Maximum descendant topic depth for neighborhood expansion. \" +\n \"Defaults to 4 for root/theme scopes, 2 for deeper scopes.\",\n },\n },\n required: [],\n response: {\n description: \"Per-topic coverage metrics and aggregate summary\",\n fields: {\n topics:\n \"array — per-topic { topicId, name, type, depth, beliefs, questions, evidence, coverage }\",\n summary:\n \"object — { totalTopics, coveredTopics, emptyTopics, coveragePercent, totalBeliefs, totalQuestions, totalEvidence }\",\n scopeTopicId: \"string — the root topic used for scoping\",\n },\n },\n ownerModule: \"coverage-intelligence\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\nexport const GET_GRAPH_GAPS: McpToolContract = {\n name: \"get_graph_gaps\",\n description:\n \"Identify structural gaps in the knowledge graph — empty topics, beliefs \" +\n \"without questions, beliefs without evidence, and orphan edges. \" +\n \"Like `git fsck` for reasoning coverage — surfaces holes that weaken \" +\n \"the epistemic foundation. Returns prioritized gap list.\",\n parameters: {\n topicId: {\n type: \"string\",\n description: \"Topic scope ID (optional, uses default if not provided)\",\n },\n maxDepth: {\n type: \"number\",\n description:\n \"Maximum descendant topic depth for neighborhood expansion (default: 4)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Prioritized list of graph gaps by category\",\n fields: {\n emptyTopics:\n \"array — topics with zero beliefs { topicId, name, type, depth }\",\n beliefsWithoutQuestions:\n \"array — beliefs that have no testing questions { nodeId, canonicalText, topicId }\",\n beliefsWithoutEvidence:\n \"array — beliefs that have no supporting evidence { nodeId, canonicalText, topicId }\",\n summary:\n \"object — { totalGaps, emptyTopicCount, untestedBeliefCount, unsupportedBeliefCount }\",\n scopeTopicId: \"string — the root topic used for scoping\",\n },\n },\n ownerModule: \"coverage-intelligence\",\n ontologyPrimitive: \"graph\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// SESSION INITIALIZATION\n// =============================================================================\n\n// =============================================================================\n// WRITE POLICY (S2-13K Graph Compounding)\n// =============================================================================\n\nexport const MANAGE_WRITE_POLICY: McpToolContract = {\n name: \"manage_write_policy\",\n description:\n \"Manage write policies for MCP mutation tools. \" +\n \"Like `git config` for write permissions — sets per-topic or global \" +\n \"policies that control which roles can mutate the graph.\",\n parameters: {\n action: {\n type: \"string\",\n description:\n \"Action to perform: 'get' (read policies) or 'set' (upsert a policy)\",\n enum: [\"get\", \"set\"],\n },\n topicId: {\n type: \"string\",\n description: \"Topic scope for the policy. Omit for global policies.\",\n },\n role: {\n type: \"string\",\n description:\n \"Role to set policy for (required for 'set'). E.g. 'agent:internal', 'user:analyst'.\",\n },\n permission: {\n type: \"string\",\n description: \"Permission level (required for 'set').\",\n enum: [\"allow\", \"deny\", \"read_only\"],\n },\n maxWritesPerSession: {\n type: \"number\",\n description: \"Optional per-session write limit for this role+scope.\",\n },\n rationale: {\n type: \"string\",\n description: \"Why this policy is being set (audit trail).\",\n },\n },\n required: [\"action\"],\n response: {\n description: \"Policy operation result\",\n fields: {\n action: \"string — get | set\",\n topicId: \"string|null — topic scope or null for global\",\n policies: \"array — (for get) list of matching policies\",\n role: \"string — (for set) role that was updated\",\n permission: \"string — (for set) new permission level\",\n maxWritesPerSession: \"number|null — (for set) session write cap\",\n },\n },\n ownerModule: \"access-control\",\n ontologyPrimitive: \"policy\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// ONTOLOGY TOOLS (ontology lifecycle, version management)\n// =============================================================================\n\nexport const LIST_ONTOLOGIES: McpToolContract = {\n name: \"list_ontologies\",\n description:\n \"List ontology definitions with optional filters. \" +\n \"Like `git remote -v` for ontologies — shows all registered ontology definitions \" +\n \"with their tier, status, and tenant scope.\",\n parameters: {\n tenantId: {\n type: \"string\",\n description: \"Filter by tenant ID. Omit for platform-level ontologies.\",\n },\n tier: {\n type: \"string\",\n description: \"Filter by tier\",\n enum: [\"platform\", \"pack\", \"tenant\"],\n },\n status: {\n type: \"string\",\n description: \"Filter by status\",\n enum: [\"draft\", \"active\", \"deprecated\", \"archived\"],\n },\n },\n required: [],\n response: {\n description: \"Array of ontology definitions\",\n fields: {\n ontologies:\n \"array — ontology definitions with id, ontologyKey, name, tier, status\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"showcase\",\n};\n\nexport const GET_ONTOLOGY: McpToolContract = {\n name: \"get_ontology\",\n description:\n \"Get a single ontology definition by ID or ontologyKey. \" +\n \"Like `git show` for an ontology — returns the definition metadata plus the latest \" +\n \"published version with entity types and edge types.\",\n parameters: {\n id: {\n type: \"string\",\n description: \"Ontology definition ID (Convex document ID)\",\n },\n ontologyKey: {\n type: \"string\",\n description:\n \"Ontology key (e.g., 'investment-ontology'). Alternative to id.\",\n },\n tenantId: {\n type: \"string\",\n description: \"Tenant scope for key lookup. Omit for platform-level.\",\n },\n },\n required: [],\n response: {\n description: \"Ontology definition with latest published version\",\n fields: {\n id: \"string — definition ID\",\n ontologyKey: \"string — unique key\",\n name: \"string — display name\",\n publishedVersion:\n \"object|null — latest published version with entityTypes and edgeTypes\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"showcase\",\n};\n\nexport const APPLY_ONTOLOGY: McpToolContract = {\n name: \"apply_ontology\",\n description:\n \"Bind an ontology definition directly to a topic. \" +\n \"Like `git checkout` for a domain vocabulary — applies an ontology to a topic so the topic \" +\n \"and its descendants inherit the configured entity and edge schema.\",\n parameters: {\n ontologyId: {\n type: \"string\",\n description: \"Canonical ontology identifier to bind\",\n },\n topicId: {\n type: \"string\",\n description: \"Canonical topic identifier to receive the binding\",\n },\n },\n required: [\"ontologyId\", \"topicId\"],\n response: {\n description: \"Ontology binding summary\",\n fields: {\n applied: \"boolean — true when the binding was written\",\n source: \"string — always 'direct' for an explicit bind\",\n ontologyId: \"string — canonical ontology ID\",\n ontologyKey: \"string — ontology key\",\n topicId: \"string — canonical topic ID\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"ontology\",\n tier: \"showcase\",\n};\n\nexport const MATCH_ENTITY_TYPE: McpToolContract = {\n name: \"match_entity_type\",\n description:\n \"Classify free text against the effective ontology vocabulary. \" +\n \"Like `git grep` for ontology types — ranks the most likely entity types for the supplied text \" +\n \"using the topic-bound or explicitly selected ontology.\",\n parameters: {\n text: {\n type: \"string\",\n description: \"Free text to classify against ontology entity types\",\n },\n topicId: {\n type: \"string\",\n description:\n \"Canonical topic ID used to resolve the effective ontology when ontologyId is omitted\",\n },\n ontologyId: {\n type: \"string\",\n description:\n \"Optional ontology definition ID to match against instead of the topic-bound ontology\",\n },\n minScore: {\n type: \"number\",\n description: \"Optional lower similarity bound for returned matches\",\n },\n limit: {\n type: \"number\",\n description: \"Optional maximum number of ranked matches to return\",\n },\n },\n required: [\"text\"],\n response: {\n description: \"Ranked ontology entity type matches\",\n fields: {\n matches:\n \"array — ranked entity type matches with score, entityType, label, and optional description\",\n ontologyId: \"string|null — ontology used for matching\",\n topicId: \"string|null — topic scope used for ontology resolution\",\n },\n },\n ownerModule: \"schema-management\",\n ontologyPrimitive: \"ontology\",\n tier: \"showcase\",\n};\n\nexport const CREATE_ONTOLOGY: McpToolContract = {\n name: \"create_ontology\",\n description:\n \"Create a new ontology definition. \" +\n \"Like `git init` for a domain vocabulary — creates a named, versioned container for \" +\n \"entity types and edge types. Starts in 'draft' status.\",\n parameters: {\n ontologyKey: {\n type: \"string\",\n description:\n \"Unique key (lowercase, hyphens, e.g., 'investment-ontology')\",\n },\n name: { type: \"string\", description: \"Human-readable name\" },\n description: { type: \"string\", description: \"What this ontology covers\" },\n tenantId: {\n type: \"string\",\n description: \"Tenant scope. Omit for platform-level.\",\n },\n tier: {\n type: \"string\",\n description: \"Ontology tier\",\n enum: [\"platform\", \"pack\", \"tenant\"],\n },\n parentOntologyId: {\n type: \"string\",\n description: \"Parent ontology ID for layered composition\",\n },\n },\n required: [\"ontologyKey\", \"name\", \"tier\"],\n response: {\n description: \"Created ontology definition\",\n fields: {\n id: \"string — new definition ID\",\n ontologyKey: \"string — normalized key\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"showcase\",\n};\n\nexport const UPDATE_ONTOLOGY: McpToolContract = {\n name: \"update_ontology\",\n description:\n \"Update an ontology definition's metadata (name, description, status). \" +\n \"Like `git config` for an ontology — updates mutable fields on the definition. \" +\n \"Only allowed while the ontology is in draft or active status.\",\n parameters: {\n id: { type: \"string\", description: \"Ontology definition ID\" },\n name: { type: \"string\", description: \"New display name\" },\n description: { type: \"string\", description: \"New description\" },\n status: {\n type: \"string\",\n description: \"New status\",\n enum: [\"draft\", \"active\", \"deprecated\"],\n },\n },\n required: [\"id\"],\n response: {\n description: \"Update confirmation\",\n fields: { success: \"boolean\" },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\nexport const ARCHIVE_ONTOLOGY: McpToolContract = {\n name: \"archive_ontology\",\n description:\n \"Archive an ontology definition. \" +\n \"Like `git rm` for an ontology — soft-deletes the definition. \" +\n \"Archived ontologies are preserved in history but no longer active.\",\n parameters: {\n id: { type: \"string\", description: \"Ontology definition ID to archive\" },\n },\n required: [\"id\"],\n response: {\n description: \"Archive confirmation\",\n fields: { success: \"boolean\" },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\nexport const CREATE_ONTOLOGY_VERSION: McpToolContract = {\n name: \"create_ontology_version\",\n description:\n \"Create a new version snapshot for an ontology definition. \" +\n \"Like `git commit` for ontology content — captures entity types and edge types \" +\n \"in a versioned snapshot. Starts in 'draft' status. Publish to freeze.\",\n parameters: {\n ontologyId: {\n type: \"string\",\n description: \"Parent ontology definition ID\",\n },\n version: {\n type: \"string\",\n description: \"Semantic version string (X.Y.Z format)\",\n },\n entityTypes: {\n type: \"array\",\n description:\n \"Array of entity type definitions: [{ value, label, description?, schema?, subtypes? }]\",\n },\n edgeTypes: {\n type: \"array\",\n description:\n \"Array of edge type definitions: [{ value, label, description?, sourceTypes?, targetTypes?, constraintSeverity? }]\",\n },\n releaseNotes: {\n type: \"string\",\n description: \"Optional release notes for this version\",\n },\n },\n required: [\"ontologyId\", \"version\", \"entityTypes\", \"edgeTypes\"],\n response: {\n description: \"Created version\",\n fields: {\n id: \"string — new version ID\",\n version: \"string — version string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"showcase\",\n};\n\nexport const PUBLISH_ONTOLOGY_VERSION: McpToolContract = {\n name: \"publish_ontology_version\",\n description:\n \"Publish a draft ontology version — freezes it permanently. \" +\n \"Like `git tag` for an ontology release — the version becomes immutable after publish. \" +\n \"If the parent definition is still in 'draft', promotes it to 'active'.\",\n parameters: {\n id: { type: \"string\", description: \"Ontology version ID to publish\" },\n },\n required: [\"id\"],\n response: {\n description: \"Publish confirmation\",\n fields: {\n success: \"boolean\",\n publishedAt: \"number — timestamp\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"showcase\",\n};\n\nexport const DEPRECATE_ONTOLOGY_VERSION: McpToolContract = {\n name: \"deprecate_ontology_version\",\n description:\n \"Deprecate a published ontology version. \" +\n \"Like `git tag -d` for an ontology release — marks the version as deprecated. \" +\n \"Only published versions can be deprecated.\",\n parameters: {\n id: { type: \"string\", description: \"Ontology version ID to deprecate\" },\n },\n required: [\"id\"],\n response: {\n description: \"Deprecation confirmation\",\n fields: { success: \"boolean\" },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\nexport const RESOLVE_EFFECTIVE_ONTOLOGY: McpToolContract = {\n name: \"resolve_effective_ontology\",\n description:\n \"Resolve the effective ontology by composing the parent chain. \" +\n \"Like `git merge --squash` for ontology layers — walks parentOntologyId chain \" +\n \"(max depth 3) and merges entity/edge types additively from root (platform) to leaf (tenant).\",\n parameters: {\n ontologyId: {\n type: \"string\",\n description: \"Ontology definition ID to resolve from\",\n },\n },\n required: [\"ontologyId\"],\n response: {\n description: \"Merged ontology with composed entity and edge types\",\n fields: {\n entityTypes: \"array — merged entity types from all layers\",\n edgeTypes: \"array — merged edge types from all layers\",\n layers: \"array — ontology keys in composition order\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"ontology\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// TOOL REGISTRY\n// =============================================================================\n\n/** All MCP tool contracts, indexed by name */\nexport const MCP_TOOL_CONTRACTS: Record<string, McpToolContract> = {\n // Belief lifecycle (commit, amend, fork, archive)\n create_belief: CREATE_BELIEF,\n get_belief: GET_BELIEF,\n refine_belief: REFINE_BELIEF,\n modulate_confidence: MODULATE_CONFIDENCE,\n fork_belief: FORK_BELIEF,\n archive_belief: ARCHIVE_BELIEF,\n create_epistemic_contract: CREATE_EPISTEMIC_CONTRACT,\n // Evidence (commit)\n create_evidence: CREATE_EVIDENCE,\n get_evidence: GET_EVIDENCE,\n list_evidence: LIST_EVIDENCE,\n link_evidence: LINK_EVIDENCE,\n add_evidence: ADD_EVIDENCE,\n // Contradictions (merge conflict)\n flag_contradiction: FLAG_CONTRADICTION,\n // Lens lifecycle (workspace-scoped operational frames)\n create_lens: CREATE_LENS,\n list_lenses: LIST_LENSES,\n apply_lens_to_topic: APPLY_LENS_TO_TOPIC,\n remove_lens_from_topic: REMOVE_LENS_FROM_TOPIC,\n // Worktree lifecycle (git worktree add → merge → push → pull request)\n add_worktree: ADD_WORKTREE,\n merge: MERGE,\n push: PUSH,\n open_pull_request: OPEN_PULL_REQUEST,\n // Lineage and audit (log, blame)\n query_lineage: QUERY_LINEAGE,\n get_confidence_history: GET_CONFIDENCE_HISTORY,\n get_audit_trail: GET_AUDIT_TRAIL,\n // Graph queries (traverse, search, bisect, entity impact)\n traverse_graph: TRAVERSE_GRAPH,\n get_graph_neighborhood: GET_GRAPH_NEIGHBORHOOD,\n trace_entity_impact: TRACE_ENTITY_IMPACT,\n search_beliefs: SEARCH_BELIEFS,\n search_resources: SEARCH_RESOURCES,\n find_contradictions: FIND_CONTRADICTIONS,\n bisect_confidence: BISECT_CONFIDENCE,\n // Edges (commit)\n create_edge: CREATE_EDGE,\n // Judgments (tag)\n record_judgment: RECORD_JUDGMENT,\n // Graph intelligence (showcase)\n detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,\n get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,\n get_falsification_questions: GET_FALSIFICATION_QUESTIONS,\n // Sources & research (showcase)\n search_sources: SEARCH_SOURCES,\n execute_deep_research: EXECUTE_DEEP_RESEARCH,\n // Evidence operations (workhorse)\n search_evidence: SEARCH_EVIDENCE,\n link_evidence_to_belief: LINK_EVIDENCE_TO_BELIEF,\n // Answer lifecycle (L2 question responses)\n create_answer: CREATE_ANSWER,\n get_answer: GET_ANSWER,\n // Question operations (workhorse)\n create_question: CREATE_QUESTION,\n get_question: GET_QUESTION,\n refine_question: REFINE_QUESTION,\n list_questions: LIST_QUESTIONS,\n answer_question: ANSWER_QUESTION,\n update_question_status: UPDATE_QUESTION_STATUS,\n archive_question: ARCHIVE_QUESTION,\n link_evidence_to_question: LINK_EVIDENCE_TO_QUESTION,\n get_high_priority_questions: GET_HIGH_PRIORITY_QUESTIONS,\n find_missing_questions: FIND_MISSING_QUESTIONS,\n // Listing & query (workhorse)\n list_beliefs: LIST_BELIEFS,\n list_worktrees: LIST_WORKTREES,\n list_all_worktrees: LIST_ALL_WORKTREES,\n activate_worktree: ACTIVATE_WORKTREE,\n update_worktree_targets: UPDATE_WORKTREE_TARGETS,\n update_worktree_metadata: UPDATE_WORKTREE_METADATA,\n identity_whoami: IDENTITY_WHOAMI,\n compile_context: COMPILE_CONTEXT,\n // Policy / ACL (workhorse)\n check_permission: CHECK_PERMISSION,\n filter_by_permission: FILTER_BY_PERMISSION,\n // Write policy (S2-13K Graph Compounding)\n manage_write_policy: MANAGE_WRITE_POLICY,\n // Observation context (workhorse)\n ingest_observation: INGEST_OBSERVATION,\n get_observation_context: GET_OBSERVATION_CONTEXT,\n // Task lifecycle (workhorse)\n create_task: CREATE_TASK,\n complete_task: COMPLETE_TASK,\n update_task: UPDATE_TASK,\n list_tasks: LIST_TASKS,\n // Topic lifecycle (init, remote)\n create_topic: CREATE_TOPIC,\n list_topics: LIST_TOPICS,\n get_topic: GET_TOPIC,\n update_topic: UPDATE_TOPIC,\n get_topic_tree: GET_TOPIC_TREE,\n // Coding intelligence (code-grounded knowledge)\n get_code_context: GET_CODE_CONTEXT,\n get_change_history: GET_CHANGE_HISTORY,\n record_attempt: RECORD_ATTEMPT,\n get_failure_log: GET_FAILURE_LOG,\n // Graph self-intelligence (coverage, gaps)\n get_topic_coverage: GET_TOPIC_COVERAGE,\n get_graph_gaps: GET_GRAPH_GAPS,\n // Ontology lifecycle (definition CRUD, version management)\n list_ontologies: LIST_ONTOLOGIES,\n get_ontology: GET_ONTOLOGY,\n apply_ontology: APPLY_ONTOLOGY,\n match_entity_type: MATCH_ENTITY_TYPE,\n create_ontology: CREATE_ONTOLOGY,\n update_ontology: UPDATE_ONTOLOGY,\n archive_ontology: ARCHIVE_ONTOLOGY,\n create_ontology_version: CREATE_ONTOLOGY_VERSION,\n publish_ontology_version: PUBLISH_ONTOLOGY_VERSION,\n deprecate_ontology_version: DEPRECATE_ONTOLOGY_VERSION,\n resolve_effective_ontology: RESOLVE_EFFECTIVE_ONTOLOGY,\n};\n\n/** Tool names that MUST include git-semantic language in descriptions */\nexport const GIT_SEMANTIC_REQUIRED_TOOLS = Object.keys(MCP_TOOL_CONTRACTS);\n\n/**\n * Lint validation: every tool description must contain \"Like `git\" or \"Like a `git\"\n * or reference a git operation in the first sentence.\n */\nexport function validateGitSemantics(tool: McpToolContract): {\n valid: boolean;\n reason?: string;\n} {\n const desc = tool.description;\n const hasGitReference =\n /Like (`git |a `git |a merge conflict|opening a `git)/.test(desc);\n if (!hasGitReference) {\n return {\n valid: false,\n reason: `Tool \"${tool.name}\" description missing git-semantic reference`,\n };\n }\n return { valid: true };\n}\n","/**\n * Prompt contract for portable, provider-agnostic prompt artifacts.\n */\n\nexport type LucernPromptModelHint = \"fast\" | \"balanced\" | \"strong\";\n\nexport type LucernPrompt = {\n /** Stable prompt identifier, e.g. \"lucern/classify-evidence\" */\n slug: string;\n /** Semver-ish prompt version, e.g. \"1.0.0\" */\n version: string;\n /** Prompt template text (supports {{variable}} interpolation) */\n template: string;\n /** Variables expected by the template */\n variables: string[];\n /** Model family hint for runtime model routing */\n modelHint: LucernPromptModelHint;\n /** Metadata used for ownership and discovery */\n metadata: {\n author: string;\n createdAt: string;\n description: string;\n tags: string[];\n };\n};\n\nexport function isLucernPrompt(value: unknown): value is LucernPrompt {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n const prompt = value as Partial<LucernPrompt>;\n\n return (\n typeof prompt.slug === \"string\" &&\n typeof prompt.version === \"string\" &&\n typeof prompt.template === \"string\" &&\n Array.isArray(prompt.variables) &&\n prompt.variables.every((entry) => typeof entry === \"string\") &&\n (prompt.modelHint === \"fast\" ||\n prompt.modelHint === \"balanced\" ||\n prompt.modelHint === \"strong\") &&\n !!prompt.metadata &&\n typeof prompt.metadata === \"object\" &&\n typeof prompt.metadata.author === \"string\" &&\n typeof prompt.metadata.createdAt === \"string\" &&\n typeof prompt.metadata.description === \"string\" &&\n Array.isArray(prompt.metadata.tags) &&\n prompt.metadata.tags.every((entry) => typeof entry === \"string\")\n );\n}\n","/**\n * SDK-Only Tool Contract Definitions\n *\n * Tools available in @lucern/sdk but NOT in the MCP gateway.\n * The SDK unfolds deeper capabilities after the MCP gateway shows developers what's possible.\n *\n * Total SDK surface = MCP tools (44) + SDK-only tools (44) = 88 tools\n *\n * These tools are organized into capability tiers:\n * - Advanced workflow & phase management (12 tools)\n * - Deeper graph navigation (6 tools)\n * - Conviction & analytics (7 tools)\n * - Extended question & evidence analytics (1 tool; core lifecycle promoted to MCP)\n * - Task lifecycle (5 tools)\n * - Domain analytics (8 tools)\n * - Bias detection suite (5 tools)\n *\n * CONTRACT SURFACE: These definitions are the external API for SDK consumers.\n * Renaming a tool or changing its description is a BREAKING CHANGE.\n *\n * Git-native naming rules (same as MCP, enforced by lint):\n * 1. Workflow tools use git verbs directly\n * 2. Knowledge tools use epistemic verbs\n * 3. First sentence of description includes the git analog verb\n * 4. Description includes \"Like `git X`\" parenthetical\n * 5. Parameter names use domain terms (canonicalText, nodeId, confidence)\n */\n\nimport type { McpToolContract } from \"./mcp-tools.contract\";\nimport { MCP_TOOL_CONTRACTS } from \"./mcp-tools.contract\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/** SDK-only tool contract — same shape as MCP but with sdk-only tier marker */\nexport interface SdkToolContract extends Omit<McpToolContract, \"tier\"> {\n tier: \"sdk-only\";\n}\n\n// =============================================================================\n// 3.1 ADVANCED WORKFLOW & PHASE MANAGEMENT (12 tools)\n// =============================================================================\n\nexport const START_WORKTREE: SdkToolContract = {\n name: \"start_worktree\",\n description:\n \"Transition a draft worktree to active. \" +\n \"Like `git checkout -b` — the branch becomes your working context. \" +\n \"A worktree must be started before beliefs can be committed to it.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The draft worktree to activate\",\n },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"The activated worktree\",\n fields: {\n worktreeId: \"string\",\n status: \"string — 'active'\",\n startedAt: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const UPDATE_WORKTREE_PHASE: SdkToolContract = {\n name: \"update_worktree_phase\",\n description:\n \"Set a worktree's phase explicitly. \" +\n \"Like `git config` for workflow state — manually sets the current investigation phase. \" +\n \"Phases: hypothesis_formation, evidence_collection, evidence_review, synthesis, scoring.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to update\" },\n phase: {\n type: \"string\",\n description: \"Target phase\",\n enum: [\n \"hypothesis_formation\",\n \"evidence_collection\",\n \"evidence_review\",\n \"synthesis\",\n \"scoring\",\n ],\n },\n reason: { type: \"string\", description: \"Why the phase is being set\" },\n },\n required: [\"worktreeId\", \"phase\"],\n response: {\n description: \"Updated worktree phase\",\n fields: {\n worktreeId: \"string\",\n previousPhase: \"string\",\n newPhase: \"string\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const ADVANCE_WORKTREE_PHASE: SdkToolContract = {\n name: \"advance_worktree_phase\",\n description:\n \"Auto-advance a worktree to the next phase after requirements pass. \" +\n \"Like `git hooks` post-commit — automatic progression when phase gates are satisfied. \" +\n \"Validates that all phase requirements are met before advancing.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to advance\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Phase advancement result\",\n fields: {\n worktreeId: \"string\",\n previousPhase: \"string\",\n newPhase: \"string\",\n requirementsMet: \"boolean\",\n failedRequirements:\n \"array | null — requirements that blocked advancement\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const ADD_NOTE_TO_WORKTREE: SdkToolContract = {\n name: \"add_note_to_worktree\",\n description:\n \"Attach contextual metadata to a worktree. \" +\n \"Like `git notes` — annotations that don't change the commit itself. \" +\n \"Notes persist across phase transitions and appear in the audit trail.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to annotate\" },\n content: { type: \"string\", description: \"Note content\" },\n noteType: {\n type: \"string\",\n description: \"Note category\",\n enum: [\"observation\", \"decision\", \"risk\", \"context\"],\n },\n },\n required: [\"worktreeId\", \"content\"],\n response: {\n description: \"The created note\",\n fields: { noteId: \"string\", worktreeId: \"string\", createdAt: \"number\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const LINK_DOCUMENT_TO_WORKTREE: SdkToolContract = {\n name: \"link_document_to_worktree\",\n description:\n \"Attach a source document to a worktree. \" +\n \"Like `git submodule add` — external references tracked within the worktree context. \" +\n \"Documents become available as evidence sources for the investigation.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to link to\" },\n documentUrl: {\n type: \"string\",\n description: \"URL or ID of the source document\",\n },\n title: { type: \"string\", description: \"Document title for display\" },\n documentType: {\n type: \"string\",\n description: \"Document category\",\n enum: [\"report\", \"transcript\", \"filing\", \"article\", \"dataset\"],\n },\n },\n required: [\"worktreeId\", \"documentUrl\", \"title\"],\n response: {\n description: \"The document link\",\n fields: { linkId: \"string\", worktreeId: \"string\", documentUrl: \"string\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const LINK_EVIDENCE_TO_WORKTREE: SdkToolContract = {\n name: \"link_evidence_to_worktree\",\n description:\n \"Stage evidence in a worktree for later processing. \" +\n \"Like `git stash` — evidence waiting to be committed into the belief graph. \" +\n \"Staged evidence is visible in the worktree but not yet linked to beliefs.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to stage in\" },\n evidenceId: { type: \"string\", description: \"The evidence node to stage\" },\n rationale: {\n type: \"string\",\n description: \"Why this evidence is relevant to the worktree\",\n },\n },\n required: [\"worktreeId\", \"evidenceId\"],\n response: {\n description: \"The staged evidence link\",\n fields: { linkId: \"string\", worktreeId: \"string\", evidenceId: \"string\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const LINK_QUESTION_TO_WORKTREE: SdkToolContract = {\n name: \"link_question_to_worktree\",\n description:\n \"Attach a question to a worktree for tracking. \" +\n \"Like `git issue link` — associates an open question with an active investigation. \" +\n \"Questions linked to a worktree guide evidence collection within that scope.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to link to\" },\n questionId: { type: \"string\", description: \"The question to attach\" },\n },\n required: [\"worktreeId\", \"questionId\"],\n response: {\n description: \"The question-worktree link\",\n fields: { linkId: \"string\", worktreeId: \"string\", questionId: \"string\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const LINK_BELIEF_TO_WORKTREE: SdkToolContract = {\n name: \"link_belief_to_worktree\",\n description:\n \"Attach beliefs to a worktree for investigation. \" +\n \"Like `git cherry-pick` — selecting specific beliefs to investigate in this branch. \" +\n \"Linked beliefs become the target of evidence collection and scoring.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to link to\" },\n beliefId: { type: \"string\", description: \"The belief to attach\" },\n role: {\n type: \"string\",\n description: \"Role of the belief in this worktree\",\n enum: [\"primary\", \"supporting\", \"challenging\"],\n },\n },\n required: [\"worktreeId\", \"beliefId\"],\n response: {\n description: \"The belief-worktree link\",\n fields: {\n linkId: \"string\",\n worktreeId: \"string\",\n beliefId: \"string\",\n role: \"string\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const CREATE_SYNTHESIZED_BELIEF: SdkToolContract = {\n name: \"create_synthesized_belief\",\n description:\n \"Consolidate draft artifacts into a synthesized belief. \" +\n \"Like `git squash` — combining multiple commits into a single coherent unit. \" +\n \"Takes multiple draft beliefs, evidence, and notes and produces one synthesized belief.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The worktree context for synthesis\",\n },\n sourceBeliefIds: {\n type: \"array\",\n description: \"Draft beliefs to consolidate\",\n },\n canonicalText: {\n type: \"string\",\n description: \"The synthesized belief statement\",\n },\n synthesisRationale: {\n type: \"string\",\n description: \"How the synthesis was derived\",\n },\n },\n required: [\"worktreeId\", \"sourceBeliefIds\", \"canonicalText\"],\n response: {\n description: \"The synthesized belief\",\n fields: {\n nodeId: \"string\",\n sourceCount: \"number\",\n synthesisRationale: \"string\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const COMPLETE_HYPOTHESIS_FORMATION: SdkToolContract = {\n name: \"complete_hypothesis_formation\",\n description:\n \"Phase gate for hypothesis formation completion. \" +\n \"Like `git tag` marking a milestone — certifies that the hypothesis formation phase is done. \" +\n \"Validates that the worktree has a testable hypothesis and linked beliefs.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The worktree completing hypothesis formation\",\n },\n summary: { type: \"string\", description: \"Summary of hypotheses formed\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Phase gate result\",\n fields: {\n worktreeId: \"string\",\n passed: \"boolean\",\n newPhase: \"string\",\n failedChecks: \"array | null\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const COMPLETE_EVIDENCE_REVIEW: SdkToolContract = {\n name: \"complete_evidence_review\",\n description:\n \"Phase gate for evidence review completion. \" +\n \"Like `git tag` marking evidence collection complete — certifies that sufficient evidence \" +\n \"has been gathered and reviewed for the worktree to proceed to synthesis.\",\n parameters: {\n worktreeId: {\n type: \"string\",\n description: \"The worktree completing evidence review\",\n },\n summary: { type: \"string\", description: \"Summary of evidence reviewed\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Phase gate result\",\n fields: {\n worktreeId: \"string\",\n passed: \"boolean\",\n newPhase: \"string\",\n evidenceCount: \"number\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"worktree\",\n tier: \"sdk-only\",\n};\n\nexport const REFINE_WORKTREE_BELIEF: SdkToolContract = {\n name: \"refine_worktree_belief\",\n description:\n \"Amend a belief within a worktree context. \" +\n \"Like `git commit --amend` on a feature branch — rewrites draft belief text \" +\n \"while maintaining worktree context and linked evidence.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree context\" },\n beliefId: { type: \"string\", description: \"The belief to refine\" },\n canonicalText: { type: \"string\", description: \"Updated belief statement\" },\n rationale: { type: \"string\", description: \"Why the refinement was made\" },\n },\n required: [\"worktreeId\", \"beliefId\", \"canonicalText\"],\n response: {\n description: \"The refined belief within worktree context\",\n fields: { beliefId: \"string\", worktreeId: \"string\", updatedAt: \"number\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\n// =============================================================================\n// 3.2 DEEPER GRAPH NAVIGATION (6 tools)\n// =============================================================================\n\nexport const TRACE_PROVENANCE: SdkToolContract = {\n name: \"trace_provenance\",\n description:\n \"Fast lineage trace for any node type in the reasoning graph. \" +\n \"Like `git log --follow` — tracks renames, forks, and full ancestry chain. \" +\n \"Works on beliefs, evidence, questions, and judgments alike.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The node to trace provenance for\" },\n depth: {\n type: \"number\",\n description: \"Maximum ancestry depth (default: 10)\",\n },\n includeEdgeTypes: {\n type: \"array\",\n description: \"Filter to specific edge types\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Provenance chain with typed ancestry\",\n fields: {\n chain: \"array — ancestry nodes\",\n edges: \"array — connecting edges\",\n totalDepth: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"sdk-only\",\n};\n\nexport const GET_BELIEF_RELATIONSHIPS: SdkToolContract = {\n name: \"get_belief_relationships\",\n description:\n \"Get structured cluster-edge map for a belief, grouped by relationship type. \" +\n \"Like `git show --stat` — a relationship summary showing all connections. \" +\n \"Returns evidence, questions, contradictions, forks, and dependent judgments.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to analyze\" },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Relationships grouped by type\",\n fields: {\n evidence: \"array — linked evidence nodes\",\n questions: \"array — testing questions\",\n contradictions: \"array — flagged contradictions\",\n forks: \"array — child forks\",\n judgments: \"array — dependent judgments\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const GET_BELIEF_SUPPORT_CHAIN: SdkToolContract = {\n name: \"get_belief_support_chain\",\n description:\n \"Full Neo4j traversal: Belief <- Question <- Evidence support chain. \" +\n \"Like `git log --graph --all` — the richest evidence retrieval path. \" +\n \"Returns the complete support structure showing how evidence flows through questions to beliefs.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to trace support for\" },\n includeWeights: {\n type: \"boolean\",\n description: \"Include edge weights in response\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Full support chain from evidence through questions to belief\",\n fields: {\n belief: \"object — the target belief\",\n questions: \"array — testing questions with their evidence\",\n totalEvidenceCount: \"number\",\n netSupportWeight: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const EXPLORE_CONNECTIONS: SdkToolContract = {\n name: \"explore_connections\",\n description:\n \"Multi-hop neighbor exploration via Neo4j graph traversal. \" +\n \"Like `git log --all --oneline` — broad discovery of connected nodes. \" +\n \"Explores outward from a starting node across multiple hops, returning the discovered subgraph.\",\n parameters: {\n nodeId: { type: \"string\", description: \"Starting node for exploration\" },\n hops: {\n type: \"number\",\n description: \"Number of hops to explore (default: 2, max: 5)\",\n },\n nodeTypes: { type: \"array\", description: \"Filter to specific node types\" },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Discovered subgraph with nodes and edges\",\n fields: {\n nodes: \"array — discovered nodes\",\n edges: \"array — connecting edges\",\n hopsTraversed: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"sdk-only\",\n};\n\nexport const GET_DEEP_LINEAGE: SdkToolContract = {\n name: \"get_deep_lineage\",\n description:\n \"10-level Neo4j ancestry traversal for deep history. \" +\n \"Like `git log -10 --graph` — traces deep fork chains, supersedes edges, and confidence evolution. \" +\n \"Returns the full ancestor tree with fork reasons and scoring history at each level.\",\n parameters: {\n nodeId: {\n type: \"string\",\n description: \"The node to trace deep lineage for\",\n },\n maxDepth: {\n type: \"number\",\n description: \"Maximum depth (default: 10, max: 20)\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Deep lineage tree with fork reasons and scoring history\",\n fields: {\n tree: \"object — nested ancestry tree\",\n totalDepth: \"number\",\n forkCount: \"number\",\n oldestAncestor: \"object — the root ancestor\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"sdk-only\",\n};\n\nexport const GRAPH_AWARE_SEARCH: SdkToolContract = {\n name: \"graph_aware_search\",\n description:\n \"Vector search enhanced with graph context expansion. \" +\n \"Like `git grep` combined with graph neighborhood — finds semantically similar nodes \" +\n \"then expands results by following graph edges to include structurally related context.\",\n parameters: {\n query: { type: \"string\", description: \"Semantic search query\" },\n topicId: { type: \"string\", description: \"Topic scope\" },\n expansionHops: {\n type: \"number\",\n description: \"Graph expansion depth after vector search (default: 1)\",\n },\n limit: { type: \"number\", description: \"Maximum results (default: 10)\" },\n },\n required: [\"query\", \"topicId\"],\n response: {\n description: \"Search results with graph-expanded context\",\n fields: {\n results: \"array — { nodeId, canonicalText, score, graphContext }\",\n expandedNodes: \"number — additional nodes from graph expansion\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"sdk-only\",\n};\n\n// =============================================================================\n// 3.3 CONVICTION & ANALYTICS (7 tools)\n// =============================================================================\n\nexport const GET_COLLECTION_CONVICTION: SdkToolContract = {\n name: \"get_collection_conviction\",\n description:\n \"Aggregate conviction score across a set of beliefs. \" +\n \"Like `git shortlog` — summary statistics for a belief collection. \" +\n \"Computes weighted average, min, max, and distribution of confidence across the set.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n beliefIds: {\n type: \"array\",\n description:\n \"Specific beliefs to aggregate (default: all project beliefs)\",\n },\n groupBy: {\n type: \"string\",\n description: \"Grouping dimension\",\n enum: [\"domain\", \"branch\", \"worktree\", \"none\"],\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Aggregate conviction metrics\",\n fields: {\n averageConfidence: \"number\",\n minConfidence: \"number\",\n maxConfidence: \"number\",\n distribution: \"object — confidence histogram\",\n beliefCount: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const GET_CONVICTION_TREND: SdkToolContract = {\n name: \"get_conviction_trend\",\n description:\n \"Time-series conviction analysis with pillar-level breakdown. \" +\n \"Like `git log --graph --stat` over time — tracks how conviction evolves across scoring events. \" +\n \"Returns data points suitable for charting conviction trajectory.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n timeRange: {\n type: \"object\",\n description: \"Time range: { start: number, end: number }\",\n },\n granularity: {\n type: \"string\",\n description: \"Time bucket size\",\n enum: [\"day\", \"week\", \"month\"],\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Time-series conviction data\",\n fields: {\n dataPoints:\n \"array — { timestamp, averageConfidence, beliefCount, scoringEvents }\",\n pillarBreakdown: \"object — per-domain conviction trends\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const ANALYZE_BELIEF_CRITICALITY: SdkToolContract = {\n name: \"analyze_belief_criticality\",\n description:\n \"Criticality scoring for belief validation prioritization. \" +\n \"Like `git bisect` for importance — identifies which beliefs are most critical \" +\n \"to validate based on dependent judgments, downstream beliefs, and graph centrality.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n limit: {\n type: \"number\",\n description: \"Maximum beliefs to score (default: 20)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Beliefs ranked by criticality score\",\n fields: {\n beliefs:\n \"array — { nodeId, canonicalText, criticalityScore, dependentCount, centralityScore }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const ANALYZE_BELIEF_CLUSTER_CANDIDATES: SdkToolContract = {\n name: \"analyze_belief_cluster_candidates\",\n description:\n \"Cross-project deduplication and similarity discovery. \" +\n \"Like `git cherry` — finding equivalent commits across branches. \" +\n \"Identifies beliefs that are semantically similar across projects or domains for potential merging.\",\n parameters: {\n topicId: { type: \"string\", description: \"Primary topic to analyze\" },\n crossProjectIds: {\n type: \"array\",\n description: \"Other projects to compare against\",\n },\n similarityThreshold: {\n type: \"number\",\n description: \"Minimum similarity score (0-1, default: 0.8)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Cluster candidates with similarity scores\",\n fields: {\n clusters:\n \"array — { beliefs: array, similarityScore: number, suggestedAction: string }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const CREATE_BELIEF_CONDITIONAL: SdkToolContract = {\n name: \"create_belief_conditional\",\n description:\n \"Create prerequisite or falsifier dependency edges between beliefs. \" +\n \"Like `git config` for conditional logic — declares that one belief depends on or is falsified by another. \" +\n \"These edges drive automated confidence cascading when conditions change.\",\n parameters: {\n sourceBeliefId: { type: \"string\", description: \"The dependent belief\" },\n targetBeliefId: {\n type: \"string\",\n description: \"The prerequisite or falsifier belief\",\n },\n conditionType: {\n type: \"string\",\n description: \"Dependency type\",\n enum: [\"prerequisite\", \"falsifier\", \"strengthener\"],\n },\n rationale: { type: \"string\", description: \"Why this dependency exists\" },\n },\n required: [\"sourceBeliefId\", \"targetBeliefId\", \"conditionType\"],\n response: {\n description: \"The conditional edge\",\n fields: {\n edgeId: \"string\",\n conditionType: \"string\",\n sourceBeliefId: \"string\",\n targetBeliefId: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"sdk-only\",\n};\n\nexport const GET_NECESSARY_EVIDENCE: SdkToolContract = {\n name: \"get_necessary_evidence\",\n description:\n \"Identify evidence requirements for merge readiness. \" +\n \"Like `git status` before merge — shows what evidence is missing, what questions are unanswered, \" +\n \"and what gaps need filling before a worktree can be confidently merged.\",\n parameters: {\n worktreeId: { type: \"string\", description: \"The worktree to evaluate\" },\n },\n required: [\"worktreeId\"],\n response: {\n description: \"Evidence requirements and gaps\",\n fields: {\n missingEvidence: \"array — beliefs without supporting evidence\",\n unansweredQuestions: \"array — open questions\",\n weakSupport: \"array — beliefs with insufficient evidence weight\",\n mergeReadiness: \"number — 0-1 readiness score\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"evidence\",\n tier: \"sdk-only\",\n};\n\nexport const ANALYZE_REASONING_DEPTH: SdkToolContract = {\n name: \"analyze_reasoning_depth\",\n description:\n \"Per-belief evidence grounding depth analysis. \" +\n \"Like `git log --graph` depth analysis — measures how deeply each belief is grounded \" +\n \"in evidence layers, from L1 sources through L2 evidence to L3 beliefs.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n beliefIds: {\n type: \"array\",\n description: \"Specific beliefs to analyze (default: all)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Reasoning depth metrics per belief\",\n fields: {\n beliefs:\n \"array — { nodeId, depth, evidenceCount, sourceCount, groundingScore }\",\n averageDepth: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\n// =============================================================================\n// 3.4 EXTENDED QUESTION & EVIDENCE ANALYTICS (1 SDK-only tool; core lifecycle moved to MCP)\n// =============================================================================\n\nexport const GET_EVIDENCE_BY_METHODOLOGY: SdkToolContract = {\n name: \"get_evidence_by_methodology\",\n description:\n \"Evidence grouped by collection methodology. \" +\n \"Like `git log --format` with custom grouping — organizes evidence by how it was gathered: \" +\n \"primary research, secondary analysis, expert interview, quantitative data, etc.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n methodology: {\n type: \"string\",\n description: \"Filter to specific methodology\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Evidence organized by methodology\",\n fields: {\n groups: \"object — { methodology: array of evidence nodes }\",\n totalCount: \"number\",\n methodologyCoverage: \"object — percentage breakdown\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"sdk-only\",\n};\n\n// =============================================================================\n// 3.5 TASK LIFECYCLE (5 tools)\n// =============================================================================\n\nexport const CREATE_EVIDENCE_TASK: SdkToolContract = {\n name: \"create_evidence_task\",\n description:\n \"Create an evidence-focused work item with structured collection template. \" +\n \"Like `git task` with evidence template — tracks concrete evidence-gathering actions \" +\n \"with methodology, source requirements, and target beliefs pre-configured.\",\n parameters: {\n title: { type: \"string\", description: \"Task description\" },\n topicId: { type: \"string\", description: \"Topic scope\" },\n methodology: {\n type: \"string\",\n description: \"Evidence collection method\",\n enum: [\n \"interview\",\n \"survey\",\n \"data_analysis\",\n \"document_review\",\n \"field_research\",\n ],\n },\n targetBeliefId: {\n type: \"string\",\n description: \"Belief this evidence task aims to test\",\n },\n targetQuestionId: {\n type: \"string\",\n description: \"Question this task addresses\",\n },\n },\n required: [\"title\", \"topicId\", \"methodology\"],\n response: {\n description: \"The created evidence task\",\n fields: {\n taskId: \"string\",\n methodology: \"string\",\n status: \"string — 'pending'\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"sdk-only\",\n};\n\nexport const LIST_TASKS: SdkToolContract = {\n name: \"list_tasks\",\n description:\n \"List tasks with filters for status, type, and assignment. \" +\n \"Like `git task list` — returns work items with their current state, \" +\n \"linked questions, and completion status.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n status: {\n type: \"string\",\n description: \"Filter by status\",\n enum: [\"pending\", \"in_progress\", \"completed\", \"cancelled\"],\n },\n taskType: {\n type: \"string\",\n description: \"Filter by type\",\n enum: [\"research\", \"interview\", \"analysis\", \"data_collection\"],\n },\n worktreeId: { type: \"string\", description: \"Filter to worktree scope\" },\n },\n required: [\"topicId\"],\n response: {\n description: \"Task list with metadata\",\n fields: {\n tasks:\n \"array — { taskId, title, status, taskType, linkedQuestionId, createdAt }\",\n },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"sdk-only\",\n};\n\nexport const UPDATE_TASK: SdkToolContract = {\n name: \"update_task\",\n description:\n \"Amend a task's details, status, or linked entities. \" +\n \"Like `git task update` — updates task metadata, status transitions, reassignment, or relinks to a different worktree/belief/question. \" +\n \"All changes are logged in the audit trail.\",\n parameters: {\n taskId: { type: \"string\", description: \"The task to update\" },\n linkedWorktreeId: {\n type: \"string\",\n description: \"Reassign this task to a different worktree\",\n },\n linkedBeliefId: {\n type: \"string\",\n description: \"Link or relink this task to a belief node\",\n },\n linkedQuestionId: {\n type: \"string\",\n description: \"Link or relink this task to a question node\",\n },\n title: { type: \"string\", description: \"Updated title\" },\n description: {\n type: \"string\",\n description: \"Updated task description\",\n },\n priority: {\n type: \"string\",\n description: \"Updated priority\",\n enum: [\"critical\", \"high\", \"medium\", \"low\"],\n },\n status: {\n type: \"string\",\n description: \"New status\",\n enum: [\"pending\", \"in_progress\", \"completed\", \"cancelled\"],\n },\n notes: { type: \"string\", description: \"Additional notes\" },\n },\n required: [\"taskId\"],\n response: {\n description: \"The updated task\",\n fields: { taskId: \"string\", status: \"string\", updatedAt: \"number\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"sdk-only\",\n};\n\nexport const GET_TASK_COUNTS: SdkToolContract = {\n name: \"get_task_counts\",\n description:\n \"Dashboard aggregate counts for task status distribution. \" +\n \"Like `git shortlog -s` for tasks — returns counts grouped by status, type, and assignment. \" +\n \"Useful for progress dashboards and workload balancing.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n groupBy: {\n type: \"string\",\n description: \"Grouping dimension\",\n enum: [\"status\", \"type\", \"worktree\", \"assignee\"],\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Task count aggregates\",\n fields: { counts: \"object — { group: number }\", total: \"number\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"sdk-only\",\n};\n\nexport const ADD_RESEARCH_ACTION: SdkToolContract = {\n name: \"add_research_action\",\n description:\n \"Append a concrete next action to a task. \" +\n \"Like `git notes append` for tasks — adds specific follow-up actions \" +\n \"without modifying the original task description.\",\n parameters: {\n taskId: { type: \"string\", description: \"The task to add an action to\" },\n action: { type: \"string\", description: \"The concrete next step\" },\n priority: {\n type: \"string\",\n description: \"Action priority\",\n enum: [\"critical\", \"high\", \"medium\", \"low\"],\n },\n },\n required: [\"taskId\", \"action\"],\n response: {\n description: \"The appended action\",\n fields: { actionId: \"string\", taskId: \"string\", createdAt: \"number\" },\n },\n ownerModule: \"workflow-engine\",\n ontologyPrimitive: \"task\",\n tier: \"sdk-only\",\n};\n\n// =============================================================================\n// 3.6 DOMAIN ANALYTICS (8 tools)\n// =============================================================================\n\nexport const GET_PREDICTIONS: SdkToolContract = {\n name: \"get_predictions\",\n description:\n \"Calibration tracking for prediction-bearing beliefs. \" +\n \"Like `git tag --verify` for prediction accuracy — tracks beliefs with testable predictions, \" +\n \"their stated confidence, and actual outcomes for calibration scoring.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n status: {\n type: \"string\",\n description: \"Prediction status filter\",\n enum: [\"pending\", \"verified\", \"falsified\", \"expired\"],\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Predictions with calibration data\",\n fields: {\n predictions:\n \"array — { beliefId, prediction, statedConfidence, outcome, calibrationDelta }\",\n overallCalibration: \"number — Brier score or equivalent\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const GET_SURPRISE_DETECTION: SdkToolContract = {\n name: \"get_surprise_detection\",\n description:\n \"Analysis of ignored vs integrated surprise findings. \" +\n \"Like `git diff --stat` for unexpected findings — identifies evidence that significantly \" +\n \"deviated from prior beliefs and tracks whether it was integrated or dismissed.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n surpriseThreshold: {\n type: \"number\",\n description: \"Minimum surprise score to include (0-1, default: 0.5)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Surprise analysis\",\n fields: {\n surprises:\n \"array — { evidenceId, surpriseScore, integrated, affectedBeliefs }\",\n ignoredCount: \"number\",\n integratedCount: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"sdk-only\",\n};\n\nexport const GET_CHALLENGED_BELIEFS: SdkToolContract = {\n name: \"get_challenged_beliefs\",\n description:\n \"Find beliefs downstream of contradiction detection. \" +\n \"Like `git log --grep=conflict` — identifies beliefs that have been challenged by contradictions, \" +\n \"negative evidence, or confidence collapses.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n minChallengeCount: {\n type: \"number\",\n description: \"Minimum number of challenges (default: 1)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Challenged beliefs with challenge details\",\n fields: {\n beliefs:\n \"array — { nodeId, canonicalText, challengeCount, contradictions, negativeEvidence }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const GET_CAUSAL_CHAINS: SdkToolContract = {\n name: \"get_causal_chains\",\n description:\n \"Trace cause/effect lineage through the reasoning graph. \" +\n \"Like `git log --ancestry-path` — follows causal edges to build chains of reasoning \" +\n \"from root causes to downstream effects.\",\n parameters: {\n nodeId: {\n type: \"string\",\n description: \"Starting node for causal traversal\",\n },\n direction: {\n type: \"string\",\n description: \"Trace direction\",\n enum: [\"causes\", \"effects\", \"both\"],\n },\n maxDepth: {\n type: \"number\",\n description: \"Maximum chain depth (default: 5)\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Causal chains with strength annotations\",\n fields: {\n chains: \"array — { path: array, strength: number, chainType: string }\",\n totalChains: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"sdk-only\",\n};\n\nexport const GET_NON_CONSENSUS_BELIEFS: SdkToolContract = {\n name: \"get_non_consensus_beliefs\",\n description:\n \"Detect contrarian positions in the belief graph. \" +\n \"Like `git log --no-merges` — standalone positions that diverge from the majority view. \" +\n \"Identifies beliefs with low consensus among evidence sources or team members.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n consensusThreshold: {\n type: \"number\",\n description: \"Below this threshold marks non-consensus (default: 0.5)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Non-consensus beliefs with dissent analysis\",\n fields: {\n beliefs:\n \"array — { nodeId, canonicalText, consensusScore, dissentingSources, supportingSources }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const GET_BELIEFS_BY_EPISTEMIC_STATUS: SdkToolContract = {\n name: \"get_beliefs_by_epistemic_status\",\n description:\n \"Filter beliefs by epistemic taxonomy labels. \" +\n \"Like `git log --grep` with epistemic labels — filters beliefs by their epistemic classification: \" +\n \"hypothesis, established, speculative, contested, retracted.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n epistemicStatus: {\n type: \"string\",\n description: \"Epistemic classification\",\n enum: [\n \"hypothesis\",\n \"established\",\n \"speculative\",\n \"contested\",\n \"retracted\",\n ],\n },\n },\n required: [\"topicId\", \"epistemicStatus\"],\n response: {\n description: \"Beliefs matching the epistemic status\",\n fields: {\n beliefs:\n \"array — { nodeId, canonicalText, confidence, epistemicStatus, lastModulated }\",\n count: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const GET_PRIVILEGED_EVIDENCE: SdkToolContract = {\n name: \"get_privileged_evidence\",\n description:\n \"Retrieve high-value evidence with access characteristics. \" +\n \"Like `git log --author` filtering for key sources — identifies evidence from privileged access: \" +\n \"primary interviews, proprietary data, non-public filings, expert networks.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n accessType: {\n type: \"string\",\n description: \"Filter by access type\",\n enum: [\n \"primary_interview\",\n \"proprietary_data\",\n \"non_public\",\n \"expert_network\",\n \"field_research\",\n ],\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Privileged evidence items\",\n fields: {\n evidence:\n \"array — { nodeId, canonicalText, accessType, sourceDescription, linkedBeliefs }\",\n totalCount: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"sdk-only\",\n};\n\nexport const GET_PRIVILEGED_SIGNALS: SdkToolContract = {\n name: \"get_privileged_signals\",\n description:\n \"Aggregate high-signal patterns across evidence. \" +\n \"Like `git shortlog --summary` for signal strength — identifies recurring patterns \" +\n \"across privileged evidence sources that may indicate strong conviction drivers.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n minSignalStrength: {\n type: \"number\",\n description: \"Minimum signal score (0-1, default: 0.7)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Aggregated signal patterns\",\n fields: {\n signals:\n \"array — { pattern, signalStrength, evidenceCount, sources, affectedBeliefs }\",\n totalSignals: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"sdk-only\",\n};\n\n// =============================================================================\n// 3.7 BIAS DETECTION SUITE (5 tools)\n// detect_confirmation_bias is in the MCP surface\n// =============================================================================\n\nexport const DETECT_ANCHORING_BIAS: SdkToolContract = {\n name: \"detect_anchoring_bias\",\n description:\n \"Detect old unchallenged beliefs that may anchor reasoning. \" +\n \"Like `git log --before` — finding stale commits that haven't been reviewed. \" +\n \"Flags beliefs that were established early and have not received new evidence or challenge.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n staleThresholdDays: {\n type: \"number\",\n description:\n \"Days without new evidence to flag as anchored (default: 30)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Potentially anchored beliefs\",\n fields: {\n beliefs:\n \"array — { nodeId, canonicalText, daysSinceLastEvidence, originalConfidence, currentConfidence }\",\n riskLevel: \"string — overall anchoring risk\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const DETECT_SOURCE_CONCENTRATION: SdkToolContract = {\n name: \"detect_source_concentration\",\n description:\n \"Detect single-source evidence risk across beliefs. \" +\n \"Like `git shortlog` showing only one contributor — identifies beliefs \" +\n \"where all supporting evidence comes from a single source or methodology.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n concentrationThreshold: {\n type: \"number\",\n description: \"Max acceptable single-source ratio (0-1, default: 0.8)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Source concentration analysis\",\n fields: {\n beliefs:\n \"array — { nodeId, canonicalText, dominantSource, concentrationRatio, uniqueSourceCount }\",\n highRiskCount: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"evidence\",\n tier: \"sdk-only\",\n};\n\nexport const FIND_SOFT_CONTRADICTIONS: SdkToolContract = {\n name: \"find_soft_contradictions\",\n description:\n \"Detect semantic and embedding-level contradictions not flagged by explicit contradiction objects. \" +\n \"Like `git diff --word-diff` for subtle conflicts — finds beliefs that are semantically \" +\n \"in tension even though no formal contradiction has been flagged.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n similarityThreshold: {\n type: \"number\",\n description:\n \"Semantic similarity for contradiction detection (0-1, default: 0.7)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Soft contradiction pairs\",\n fields: {\n pairs: \"array — { beliefA, beliefB, tensionScore, tensionDescription }\",\n totalPairs: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"sdk-only\",\n};\n\nexport const FIND_SEMANTIC_BRIDGES: SdkToolContract = {\n name: \"find_semantic_bridges\",\n description:\n \"Find semantically similar but graph-distant nodes. \" +\n \"Like `git cherry` — finding equivalent commits across branches that aren't connected. \" +\n \"Identifies nodes that share semantic meaning but have no graph edges between them.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n minSemanticSimilarity: {\n type: \"number\",\n description: \"Minimum embedding similarity (0-1, default: 0.75)\",\n },\n minGraphDistance: {\n type: \"number\",\n description: \"Minimum graph hops to qualify as distant (default: 3)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Potential bridge pairs\",\n fields: {\n bridges:\n \"array — { nodeA, nodeB, semanticSimilarity, graphDistance, suggestedEdgeType }\",\n totalBridges: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"sdk-only\",\n};\n\nexport const FIND_SEMANTIC_ORPHANS: SdkToolContract = {\n name: \"find_semantic_orphans\",\n description:\n \"Find structurally connected but semantically distant nodes. \" +\n \"Like `git fsck --lost-found` — nodes that are technically connected in the graph \" +\n \"but semantically don't belong, possibly indicating miscategorization or stale edges.\",\n parameters: {\n topicId: { type: \"string\", description: \"Topic scope\" },\n maxSemanticSimilarity: {\n type: \"number\",\n description:\n \"Maximum similarity to qualify as orphan (0-1, default: 0.3)\",\n },\n },\n required: [\"topicId\"],\n response: {\n description: \"Semantic orphan nodes\",\n fields: {\n orphans:\n \"array — { nodeId, connectedTo, semanticSimilarity, edgeType, suggestedAction }\",\n totalOrphans: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"sdk-only\",\n};\n\n// =============================================================================\n// SDK-ONLY TOOL REGISTRY\n// =============================================================================\n\n/** All SDK-only tool contracts, indexed by name */\nexport const SDK_ONLY_TOOL_CONTRACTS: Record<string, SdkToolContract> = {\n // 3.1 Advanced workflow & phase management\n start_worktree: START_WORKTREE,\n update_worktree_phase: UPDATE_WORKTREE_PHASE,\n advance_worktree_phase: ADVANCE_WORKTREE_PHASE,\n add_note_to_worktree: ADD_NOTE_TO_WORKTREE,\n link_document_to_worktree: LINK_DOCUMENT_TO_WORKTREE,\n link_evidence_to_worktree: LINK_EVIDENCE_TO_WORKTREE,\n link_question_to_worktree: LINK_QUESTION_TO_WORKTREE,\n link_belief_to_worktree: LINK_BELIEF_TO_WORKTREE,\n create_synthesized_belief: CREATE_SYNTHESIZED_BELIEF,\n complete_hypothesis_formation: COMPLETE_HYPOTHESIS_FORMATION,\n complete_evidence_review: COMPLETE_EVIDENCE_REVIEW,\n refine_worktree_belief: REFINE_WORKTREE_BELIEF,\n\n // 3.2 Deeper graph navigation\n trace_provenance: TRACE_PROVENANCE,\n get_belief_relationships: GET_BELIEF_RELATIONSHIPS,\n get_belief_support_chain: GET_BELIEF_SUPPORT_CHAIN,\n explore_connections: EXPLORE_CONNECTIONS,\n get_deep_lineage: GET_DEEP_LINEAGE,\n graph_aware_search: GRAPH_AWARE_SEARCH,\n\n // 3.3 Conviction & analytics\n get_collection_conviction: GET_COLLECTION_CONVICTION,\n get_conviction_trend: GET_CONVICTION_TREND,\n analyze_belief_criticality: ANALYZE_BELIEF_CRITICALITY,\n analyze_belief_cluster_candidates: ANALYZE_BELIEF_CLUSTER_CANDIDATES,\n create_belief_conditional: CREATE_BELIEF_CONDITIONAL,\n get_necessary_evidence: GET_NECESSARY_EVIDENCE,\n analyze_reasoning_depth: ANALYZE_REASONING_DEPTH,\n\n // 3.4 Extended question & evidence analytics\n get_evidence_by_methodology: GET_EVIDENCE_BY_METHODOLOGY,\n\n // 3.5 Task lifecycle (list_tasks + update_task are MCP tools, not SDK-only)\n create_evidence_task: CREATE_EVIDENCE_TASK,\n get_task_counts: GET_TASK_COUNTS,\n add_research_action: ADD_RESEARCH_ACTION,\n\n // 3.6 Domain analytics\n get_predictions: GET_PREDICTIONS,\n get_surprise_detection: GET_SURPRISE_DETECTION,\n get_challenged_beliefs: GET_CHALLENGED_BELIEFS,\n get_causal_chains: GET_CAUSAL_CHAINS,\n get_non_consensus_beliefs: GET_NON_CONSENSUS_BELIEFS,\n get_beliefs_by_epistemic_status: GET_BELIEFS_BY_EPISTEMIC_STATUS,\n get_privileged_evidence: GET_PRIVILEGED_EVIDENCE,\n get_privileged_signals: GET_PRIVILEGED_SIGNALS,\n\n // 3.7 Bias detection suite (detect_confirmation_bias is in MCP)\n detect_anchoring_bias: DETECT_ANCHORING_BIAS,\n detect_source_concentration: DETECT_SOURCE_CONCENTRATION,\n find_soft_contradictions: FIND_SOFT_CONTRADICTIONS,\n find_semantic_bridges: FIND_SEMANTIC_BRIDGES,\n find_semantic_orphans: FIND_SEMANTIC_ORPHANS,\n};\n\n// =============================================================================\n// MERGED SDK SURFACE\n// =============================================================================\n\n/** Complete SDK surface: MCP gateway tools + SDK-only advanced tools */\nexport const ALL_SDK_TOOL_CONTRACTS: Record<\n string,\n McpToolContract | SdkToolContract\n> = {\n ...MCP_TOOL_CONTRACTS,\n ...SDK_ONLY_TOOL_CONTRACTS,\n};\n\n/** All SDK-only tool names */\nexport const SDK_ONLY_TOOL_NAMES = Object.keys(SDK_ONLY_TOOL_CONTRACTS);\n\n/** All tool names across the complete SDK surface */\nexport const ALL_SDK_TOOL_NAMES = Object.keys(ALL_SDK_TOOL_CONTRACTS);\n\n/**\n * Lint validation: every SDK tool description must contain \"Like `git\" reference.\n * Reuses the same git-semantic validation rule as MCP tools.\n */\nexport function validateSdkGitSemantics(tool: SdkToolContract): {\n valid: boolean;\n reason?: string;\n} {\n const desc = tool.description;\n const hasGitReference =\n /Like (`git |a `git |a merge conflict|opening a `git)/.test(desc);\n if (!hasGitReference) {\n return {\n valid: false,\n reason: `SDK tool \"${tool.name}\" description missing git-semantic reference`,\n };\n }\n return { valid: true };\n}\n","/**\n * Workflow Runtime Contract v1\n *\n * Canonical TypeScript contract for Lucern's graph-local workflow runtime.\n * WF-1 defines the typed substrate for:\n * - workflow definitions and run receipts\n * - action mutation tiering and approval expectations\n * - hooks over worktree/question/evidence/inbox events\n * - output unions for domain-specific artifacts\n * - deterministic integrity checks and operational metadata\n *\n * BREAKING CHANGE RULES:\n * - Adding optional fields is NON-breaking\n * - Removing fields or renaming enum values is BREAKING\n * - Reclassifying a mutation tier is BREAKING\n * - Changing canonical workflow IDs is BREAKING\n */\n\nexport const WORKFLOW_RUNTIME_SCHEMA_VERSION = \"1.0.0\" as const;\n\nexport const WORKFLOW_MUTATION_TIERS = [\n \"read_only\",\n \"low_risk_write\",\n \"high_risk_write\",\n] as const;\nexport type WorkflowMutationTier = (typeof WORKFLOW_MUTATION_TIERS)[number];\n\nexport const WORKFLOW_APPROVAL_MODES = [\n \"none\",\n \"audit_only\",\n \"human_required\",\n \"auto_approve\",\n] as const;\nexport type WorkflowApprovalMode = (typeof WORKFLOW_APPROVAL_MODES)[number];\n\nexport const DEFAULT_TIER_APPROVAL_MODE: Readonly<\n Record<WorkflowMutationTier, WorkflowApprovalMode>\n> = {\n read_only: \"none\",\n low_risk_write: \"audit_only\",\n high_risk_write: \"human_required\",\n} as const;\n\nexport const WORKFLOW_ACTION_KINDS = [\n \"context_pack\",\n \"integrity_check\",\n \"lucern_tool\",\n \"report_compile\",\n \"brief_publish\",\n \"notification\",\n \"custom\",\n] as const;\nexport type WorkflowActionKind = (typeof WORKFLOW_ACTION_KINDS)[number];\n\nexport const WORKFLOW_HOOK_EVENTS = [\n \"schedule.tick\",\n \"worktree.activated\",\n \"worktree.completed\",\n \"question.created\",\n \"question.answered\",\n \"evidence.appended\",\n \"inbox.item_created\",\n] as const;\nexport type WorkflowHookEvent = (typeof WORKFLOW_HOOK_EVENTS)[number];\n\nexport const WORKFLOW_OUTPUT_KINDS = [\n \"engineering_brief\",\n \"research_memo\",\n \"strategy_artifact\",\n \"inbox_summary\",\n \"pipeline_brief\",\n \"structured_payload\",\n] as const;\nexport type WorkflowOutputKind = (typeof WORKFLOW_OUTPUT_KINDS)[number];\n\nexport const WORKFLOW_RUN_STATUSES = [\n \"queued\",\n \"running\",\n \"awaiting_approval\",\n \"completed\",\n \"failed\",\n \"cancelled\",\n] as const;\nexport type WorkflowRunStatus = (typeof WORKFLOW_RUN_STATUSES)[number];\n\nexport const WORKFLOW_TRIGGER_KINDS = [\n \"manual\",\n \"schedule\",\n \"hook\",\n] as const;\nexport type WorkflowTriggerKind = (typeof WORKFLOW_TRIGGER_KINDS)[number];\n\nexport const WORKFLOW_PROOF_ARTIFACT_KINDS = [\n \"report\",\n \"brief\",\n \"artifact\",\n \"dashboard\",\n \"test_evidence\",\n] as const;\nexport type WorkflowProofArtifactKind =\n (typeof WORKFLOW_PROOF_ARTIFACT_KINDS)[number];\n\nexport const WORKFLOW_STAFFING_HINTS = [\n \"solo\",\n \"backend+tests\",\n \"fullstack\",\n \"mcp+tests\",\n] as const;\nexport type WorkflowStaffingHint = (typeof WORKFLOW_STAFFING_HINTS)[number];\n\nexport const WORKFLOW_AUTO_FIX_MODES = [\n \"disabled\",\n \"dry_run\",\n \"safe\",\n \"aggressive\",\n] as const;\nexport type WorkflowAutoFixMode = (typeof WORKFLOW_AUTO_FIX_MODES)[number];\n\nexport const WORKFLOW_INTEGRITY_CHECKS = [\n \"null_dependency_refs\",\n \"superseded_blockers\",\n \"band_order_inconsistency\",\n \"sparse_shaping\",\n \"failed_completed_gate\",\n] as const;\nexport type WorkflowIntegrityCheckId =\n (typeof WORKFLOW_INTEGRITY_CHECKS)[number];\n\nexport type WorkflowProofArtifact = {\n kind: WorkflowProofArtifactKind;\n label: string;\n required?: boolean;\n sourceRef?: string;\n};\n\nexport type WorkflowAutoFixPolicy = {\n mode: WorkflowAutoFixMode;\n maxActionsPerRun?: number;\n permittedMutationTiers?: WorkflowMutationTier[];\n requireAuditTrail?: boolean;\n escalationGate?: string;\n};\n\nexport const DEFAULT_WORKFLOW_AUTO_FIX_POLICY: WorkflowAutoFixPolicy = {\n mode: \"disabled\",\n permittedMutationTiers: [\"read_only\"],\n requireAuditTrail: true,\n};\n\nexport type WorkflowApprovalPolicy = {\n mode: WorkflowApprovalMode;\n approvalGate?: string;\n autoApprovePolicyKey?: string;\n rationaleRequired?: boolean;\n};\n\nexport type WorkflowOutputBase = {\n outputId: string;\n kind: WorkflowOutputKind;\n title: string;\n summary: string;\n generatedAt?: number;\n};\n\nexport type EngineeringBriefOutput = WorkflowOutputBase & {\n kind: \"engineering_brief\";\n sections: Array<{\n heading: string;\n body: string;\n }>;\n touchedPaths?: string[];\n};\n\nexport type ResearchMemoOutput = WorkflowOutputBase & {\n kind: \"research_memo\";\n claims: string[];\n evidenceRefs?: string[];\n};\n\nexport type StrategyArtifactOutput = WorkflowOutputBase & {\n kind: \"strategy_artifact\";\n recommendations: string[];\n decisionWindow?: string;\n};\n\nexport type InboxSummaryOutput = WorkflowOutputBase & {\n kind: \"inbox_summary\";\n channel: \"developer_portal\" | \"chat\" | \"ops\";\n inboxTitle: string;\n inboxBody: string;\n};\n\nexport type PipelineBriefOutput = WorkflowOutputBase & {\n kind: \"pipeline_brief\";\n hingeWorktreeId?: string;\n groupedBlockers: Array<{\n blocker: string;\n blockedWorktreeIds: string[];\n }>;\n};\n\nexport type StructuredPayloadOutput = WorkflowOutputBase & {\n kind: \"structured_payload\";\n payload: Record<string, unknown>;\n};\n\nexport type WorkflowOutputContract =\n | EngineeringBriefOutput\n | ResearchMemoOutput\n | StrategyArtifactOutput\n | InboxSummaryOutput\n | PipelineBriefOutput\n | StructuredPayloadOutput;\n\nexport type WorkflowActionContract = {\n actionId: string;\n kind: WorkflowActionKind;\n title: string;\n description: string;\n mutationTier: WorkflowMutationTier;\n toolName?: string;\n produces?: WorkflowOutputKind[];\n idempotent?: boolean;\n approval: WorkflowApprovalPolicy;\n};\n\nexport type WorkflowHookContract = {\n hookId: string;\n event: WorkflowHookEvent;\n description: string;\n condition?: string;\n actionIds: string[];\n};\n\nexport type WorkflowTriggerContract =\n | {\n kind: \"manual\";\n description?: string;\n }\n | {\n kind: \"schedule\";\n cadence: \"hourly\" | \"daily\" | \"weekly\";\n timezone?: string;\n }\n | {\n kind: \"hook\";\n event: WorkflowHookEvent;\n };\n\nexport type WorkflowDefinitionV1 = {\n workflowId: string;\n version: typeof WORKFLOW_RUNTIME_SCHEMA_VERSION;\n title: string;\n description: string;\n trigger: WorkflowTriggerContract;\n staffingHint?: WorkflowStaffingHint;\n proofArtifacts?: WorkflowProofArtifact[];\n autoFixPolicy?: WorkflowAutoFixPolicy;\n actions: readonly WorkflowActionContract[];\n hooks?: readonly WorkflowHookContract[];\n outputs: readonly WorkflowOutputKind[];\n integrityChecks?: readonly WorkflowIntegrityCheckId[];\n};\n\nexport type WorkflowRunReceiptV1 = {\n runId: string;\n workflowId: string;\n status: WorkflowRunStatus;\n triggeredBy: WorkflowTriggerKind;\n startedAt: number;\n completedAt?: number;\n outputKinds: WorkflowOutputKind[];\n approvalsRequired?: number;\n};\n\nexport const NIGHTLY_RECONCILIATION_WORKFLOW_ID =\n \"workflow.pipeline_reconciliation.v1\" as const;\n\nexport const MORNING_BRIEF_WORKFLOW_ID =\n \"workflow.morning_brief.v1\" as const;\n\nexport const CANONICAL_WORKFLOW_DEFINITIONS: readonly WorkflowDefinitionV1[] = [\n {\n workflowId: NIGHTLY_RECONCILIATION_WORKFLOW_ID,\n version: WORKFLOW_RUNTIME_SCHEMA_VERSION,\n title: \"Nightly Pipeline Reconciliation\",\n description:\n \"Runs deterministic integrity checks, compiles pipeline state, and emits an operator-facing reconciliation brief.\",\n trigger: {\n kind: \"schedule\",\n cadence: \"daily\",\n timezone: \"America/New_York\",\n },\n staffingHint: \"backend+tests\",\n proofArtifacts: [\n {\n kind: \"report\",\n label: \"Pipeline reconciliation report\",\n required: true,\n },\n {\n kind: \"test_evidence\",\n label: \"Integrity check receipt\",\n required: true,\n },\n ],\n autoFixPolicy: {\n mode: \"safe\",\n maxActionsPerRun: 5,\n permittedMutationTiers: [\"read_only\", \"low_risk_write\"],\n requireAuditTrail: true,\n escalationGate: \"gate:workflow-runtime-contract-live\",\n },\n actions: [\n {\n actionId: \"compile_context_pack\",\n kind: \"context_pack\",\n title: \"Compile pipeline context\",\n description: \"Build the ranked context needed for deterministic checks.\",\n mutationTier: \"read_only\",\n produces: [\"structured_payload\"],\n idempotent: true,\n approval: { mode: \"none\" },\n },\n {\n actionId: \"run_integrity_checks\",\n kind: \"integrity_check\",\n title: \"Run integrity checks\",\n description:\n \"Evaluate dependency references, blockers, execution bands, shaping coverage, and completed gates.\",\n mutationTier: \"read_only\",\n produces: [\"structured_payload\"],\n idempotent: true,\n approval: { mode: \"none\" },\n },\n {\n actionId: \"record_followup_questions\",\n kind: \"lucern_tool\",\n title: \"Record follow-up questions\",\n description:\n \"Create or reopen operator-facing questions for integrity failures that require human review.\",\n mutationTier: \"low_risk_write\",\n toolName: \"create_question\",\n produces: [\"pipeline_brief\"],\n approval: { mode: \"audit_only\", rationaleRequired: true },\n },\n {\n actionId: \"publish_reconciliation_brief\",\n kind: \"brief_publish\",\n title: \"Publish reconciliation brief\",\n description:\n \"Emit an inbox-routed brief summarizing the nightly pipeline state and grouped blockers.\",\n mutationTier: \"low_risk_write\",\n produces: [\"pipeline_brief\", \"inbox_summary\"],\n approval: { mode: \"audit_only\" },\n },\n ],\n hooks: [\n {\n hookId: \"nightly-schedule\",\n event: \"schedule.tick\",\n description: \"Run once per nightly cadence.\",\n actionIds: [\n \"compile_context_pack\",\n \"run_integrity_checks\",\n \"record_followup_questions\",\n \"publish_reconciliation_brief\",\n ],\n },\n ],\n outputs: [\"pipeline_brief\", \"inbox_summary\", \"structured_payload\"],\n integrityChecks: WORKFLOW_INTEGRITY_CHECKS,\n },\n {\n workflowId: MORNING_BRIEF_WORKFLOW_ID,\n version: WORKFLOW_RUNTIME_SCHEMA_VERSION,\n title: \"Morning Brief\",\n description:\n \"Compiles a developer-facing morning brief from graph state, overnight workflow outputs, and inbox routing preferences.\",\n trigger: {\n kind: \"schedule\",\n cadence: \"daily\",\n timezone: \"America/New_York\",\n },\n staffingHint: \"solo\",\n proofArtifacts: [\n {\n kind: \"brief\",\n label: \"Morning brief\",\n required: true,\n },\n ],\n autoFixPolicy: {\n mode: \"dry_run\",\n maxActionsPerRun: 1,\n permittedMutationTiers: [\"read_only\", \"low_risk_write\"],\n requireAuditTrail: true,\n },\n actions: [\n {\n actionId: \"compile_brief_inputs\",\n kind: \"context_pack\",\n title: \"Compile brief inputs\",\n description:\n \"Read graph state, worktree state, and overnight workflow receipts.\",\n mutationTier: \"read_only\",\n produces: [\"structured_payload\"],\n idempotent: true,\n approval: { mode: \"none\" },\n },\n {\n actionId: \"publish_morning_brief\",\n kind: \"brief_publish\",\n title: \"Publish morning brief\",\n description:\n \"Publish a typed inbox summary with prioritized worktree and question context.\",\n mutationTier: \"low_risk_write\",\n produces: [\"engineering_brief\", \"inbox_summary\"],\n approval: { mode: \"audit_only\" },\n },\n ],\n hooks: [\n {\n hookId: \"morning-schedule\",\n event: \"schedule.tick\",\n description: \"Run once per morning cadence.\",\n actionIds: [\"compile_brief_inputs\", \"publish_morning_brief\"],\n },\n {\n hookId: \"worktree-complete-refresh\",\n event: \"worktree.completed\",\n description:\n \"Refresh the queued morning brief inputs when worktree outcomes land overnight.\",\n actionIds: [\"compile_brief_inputs\"],\n },\n ],\n outputs: [\"engineering_brief\", \"inbox_summary\", \"structured_payload\"],\n integrityChecks: [\"sparse_shaping\"],\n },\n] as const;\n"]}
1
+ {"version":3,"sources":["../../src/contracts/index.ts","../../src/contracts/api-enums.contract.ts","../../src/contracts/auth-session.contract.ts","../../src/contracts/context-pack.contract.ts","../../src/contracts/lens-filter.contract.ts","../../src/contracts/lens-workflow.contract.ts","../../src/contracts/mcpTools.ts","../../src/contracts/tool-contracts.ts","../../src/contracts/prompt.contract.ts","../../src/contracts/sdk-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AAA,MACtD,iBAAA,EAAmB;AAAA,KACrB;AAAA,IACA,OAAA,EAAS;AAAA,MACP;AAAA,QACE,QAAA,EAAU,sBAAA;AAAA,QACV,IAAA,EAAM,cAAA;AAAA,QACN,KAAA,EAAO,sBAAA;AAAA,QACP,WAAA,EACE,oEAAA;AAAA,QACF,YAAA,EAAc,WAAA;AAAA,QACd,QAAA,EAAU,CAAC,oBAAoB,CAAA;AAAA,QAC/B,UAAA,EAAY,IAAA;AAAA,QACZ,QAAA,EAAU,EAAE,IAAA,EAAM,MAAA;AAAO,OAC3B;AAAA,MACA;AAAA,QACE,QAAA,EAAU,uBAAA;AAAA,QACV,IAAA,EAAM,eAAA;AAAA,QACN,KAAA,EAAO,uBAAA;AAAA,QACP,WAAA,EACE,+EAAA;AAAA,QACF,YAAA,EAAc,gBAAA;AAAA,QACd,QAAA,EAAU,CAAC,mBAAA,EAAqB,eAAe,CAAA;AAAA,QAC/C,QAAA,EAAU,EAAE,IAAA,EAAM,YAAA;AAAa;AACjC,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL;AAAA,QACE,MAAA,EAAQ,kBAAA;AAAA,QACR,KAAA,EAAO,eAAA;AAAA,QACP,WAAA,EAAa,+BAAA;AAAA,QACb,SAAA,EAAW,CAAC,sBAAA,EAAwB,uBAAuB;AAAA,OAC7D;AAAA,MACA;AAAA,QACE,MAAA,EAAQ,2BAAA;AAAA,QACR,KAAA,EAAO,oBAAA;AAAA,QACP,WAAA,EACE,gFAAA;AAAA,QACF,SAAA,EAAW,CAAC,sBAAsB;AAAA;AACpC,KACF;AAAA,IACA,OAAA,EAAS,CAAC,mBAAA,EAAqB,eAAA,EAAiB,oBAAoB,CAAA;AAAA,IACpE,eAAA,EAAiB,CAAC,gBAAgB;AAAA;AAEtC","file":"index.js","sourcesContent":["export * from \"./api-enums.contract\";\nexport * from \"./auth-session.contract\";\nexport * from \"./contextPack\";\nexport * from \"./lensFilter\";\nexport * from \"./lensWorkflow\";\nexport * from \"./mcpTools\";\nexport * as mcpToolsContract from \"./tool-contracts\";\nexport * from \"./prompt\";\nexport * as sdkToolsContract from \"./sdk-tools.contract\";\nexport * from \"./workflowRuntime\";\n","/**\n * API Enum Contract Definitions\n *\n * Canonical enum values for all API-facing enumerations.\n * These MUST match the kernel schema validators exactly.\n *\n * Source of truth: lucern/packages/reasoning-kernel/src/adapters/schema/spine/\n */\n\n// =============================================================================\n// BELIEF STATUS\n// =============================================================================\n\n/**\n * Belief epistemic lifecycle — tracks maturity from raw claim to verified fact.\n *\n * - assumption: Untested raw claim, lowest epistemic standing\n * - hypothesis: Under active investigation, being tested against evidence\n * - belief: Validated through investigation, carries confidence score\n * - fact: Resolved outcome anchored by strong evidence\n */\nexport const BELIEF_STATUSES = [\n \"assumption\",\n \"hypothesis\",\n \"belief\",\n \"fact\",\n] as const;\nexport type BeliefStatus = (typeof BELIEF_STATUSES)[number];\n\n// =============================================================================\n// FORK REASONS\n// =============================================================================\n\n/** Why a scored belief was branched into a new version */\nexport const FORK_REASONS = [\n \"refinement\",\n \"contradiction_response\",\n \"scope_change\",\n \"confidence_collapse\",\n \"manual\",\n] as const;\nexport type ForkReason = (typeof FORK_REASONS)[number];\n\n// =============================================================================\n// CONFIDENCE TRIGGERS\n// =============================================================================\n\n/** What caused a confidence change — every modulation must declare its trigger */\nexport const CONFIDENCE_TRIGGERS = [\n \"evidence_added\",\n \"evidence_removed\",\n \"contradiction_detected\",\n \"contradiction_resolved\",\n \"agent_assessment\",\n \"worktree_outcome\",\n \"worktree_completed\",\n \"manual\",\n \"decay\",\n \"fusion\",\n \"discount\",\n \"deduction\",\n] as const;\nexport type ConfidenceTrigger = (typeof CONFIDENCE_TRIGGERS)[number];\n\n// =============================================================================\n// EDGE TYPES — The 6 canonical epistemic edge types\n// =============================================================================\n\n/**\n * Core epistemic edge types — the grammar of reasoning relationships.\n *\n * - supports: Evidence or belief reinforces another belief (weight = strength)\n * - informs: Evidence bears on a belief (directional, weighted)\n * - depends_on: Belief B requires belief A to hold\n * - derived_from: Belief was derived from another (lineage)\n * - contains: Structural containment (topic contains beliefs)\n * - tests: Question tests a belief (falsification link)\n */\nexport const EPISTEMIC_EDGE_TYPES = [\n \"supports\",\n \"informs\",\n \"depends_on\",\n \"derived_from\",\n \"contains\",\n \"tests\",\n] as const;\nexport type EpistemicEdgeType = (typeof EPISTEMIC_EDGE_TYPES)[number];\n\n/** Structural and lifecycle edges — required for graph integrity */\nexport const STRUCTURAL_EDGE_TYPES = [\n \"supersedes\",\n \"responds_to\",\n \"belongs_to\",\n \"relates_to_thesis\",\n] as const;\nexport type StructuralEdgeType = (typeof STRUCTURAL_EDGE_TYPES)[number];\n\n/** All valid edge types (epistemic + structural) */\nexport const EDGE_TYPES = [\n ...EPISTEMIC_EDGE_TYPES,\n ...STRUCTURAL_EDGE_TYPES,\n] as const;\nexport type EdgeType = EpistemicEdgeType | StructuralEdgeType;\n\n// =============================================================================\n// REASONING METHODS\n// =============================================================================\n\n/** How an edge relationship was determined */\nexport const REASONING_METHODS = [\n \"deductive\",\n \"inductive\",\n \"abductive\",\n \"analogical\",\n \"empirical\",\n] as const;\nexport type ReasoningMethod = (typeof REASONING_METHODS)[number];\n\n// =============================================================================\n// CONTRADICTION ENUMS\n// =============================================================================\n\n/** Defeat types (Pollock taxonomy) — how a contradiction operates */\nexport const DEFEAT_TYPES = [\n \"rebuts\",\n \"undercuts\",\n \"undermines\",\n] as const;\nexport type DefeatType = (typeof DEFEAT_TYPES)[number];\n\n/** Contradiction severity */\nexport const CONTRADICTION_SEVERITIES = [\n \"low\",\n \"medium\",\n \"high\",\n \"critical\",\n] as const;\nexport type ContradictionSeverity = (typeof CONTRADICTION_SEVERITIES)[number];\n\n/** Contradiction resolution status */\nexport const CONTRADICTION_STATUSES = [\n \"unresolved\",\n \"resolved\",\n \"accepted\",\n] as const;\nexport type ContradictionStatus = (typeof CONTRADICTION_STATUSES)[number];\n\n// =============================================================================\n// WORKTREE ENUMS\n// =============================================================================\n\n/** How a worktree investigation concluded */\nexport const MERGE_OUTCOMES = [\n \"validated\",\n \"invalidated\",\n \"forked\",\n \"inconclusive\",\n] as const;\nexport type MergeOutcome = (typeof MERGE_OUTCOMES)[number];\n\n/** Investigation phases within a worktree */\nexport const WORKTREE_PHASES = [\n \"hypothesis\",\n \"investigation\",\n \"evaluation\",\n \"resolution\",\n] as const;\nexport type WorktreePhase = (typeof WORKTREE_PHASES)[number];\n\n// =============================================================================\n// EPISTEMIC LAYERS\n// =============================================================================\n\n/**\n * The knowledge hierarchy — each layer builds on the one below it.\n *\n * - L1: Sources — raw inputs (documents, APIs, observations)\n * - L2: Evidence — interpreted facts with context and weight\n * - L3: Beliefs — structural claims that carry confidence\n * - L4: Judgments — irreversible commitments based on the epistemic state\n */\nexport const EPISTEMIC_LAYERS = [\n \"L1\",\n \"L2\",\n \"L3\",\n \"L4\",\n] as const;\nexport type EpistemicLayer = (typeof EPISTEMIC_LAYERS)[number];\n\n// =============================================================================\n// JUDGMENT TYPES\n// =============================================================================\n\n/**\n * Classification of L4 judgments — irreversible determinations.\n *\n * Judgments are evaluated against the knowledge horizon that existed\n * when they were made. They cannot be retroactively invalidated —\n * only new judgments can supersede old ones.\n */\nexport const JUDGMENT_TYPES = [\n \"thesis\",\n \"thesis_maturity\",\n \"contradiction_ruling\",\n \"scope_determination\",\n \"confidence_ruling\",\n] as const;\nexport type JudgmentType = (typeof JUDGMENT_TYPES)[number];\n","/**\n * Session + Delegation Contract\n *\n * Canonical session lifecycle vocabulary shared by platform gateway auth,\n * hosted MCP auth, Master Control persistence, and SDK session tokens.\n */\n\nexport const SESSION_AUTH_MODES = [\n \"interactive_user\",\n \"service_principal\",\n \"tenant_api_key\",\n \"session_token\",\n] as const;\nexport type SessionAuthMode = (typeof SESSION_AUTH_MODES)[number];\n\nexport const SESSION_PRINCIPAL_TYPES = [\"human\", \"service\", \"agent\"] as const;\nexport type SessionPrincipalType = (typeof SESSION_PRINCIPAL_TYPES)[number];\n\nexport const SESSION_LIFECYCLE_STATUSES = [\n \"active\",\n \"expired\",\n \"revoked\",\n] as const;\nexport type SessionLifecycleStatus =\n (typeof SESSION_LIFECYCLE_STATUSES)[number];\n\nexport type SessionDelegationHop = {\n principalId: string;\n principalType: SessionPrincipalType;\n authMode?: SessionAuthMode;\n sessionId?: string;\n delegatedAt?: number;\n reason?: string;\n};\n\nexport type SessionAuditOutcome =\n | \"accepted\"\n | \"rejected\"\n | \"revoked\"\n | \"expired\";\n\nexport type SessionAuditEnvelope = {\n sessionId: string;\n authMode: SessionAuthMode;\n principalId: string;\n principalType: SessionPrincipalType;\n tenantId: string;\n workspaceId?: string;\n apiKeyId?: string;\n scopes: readonly string[];\n roles?: readonly string[];\n delegationChain?: readonly SessionDelegationHop[];\n sourceSessionId?: string;\n expiresAt?: number;\n request?: {\n endpoint?: string;\n method?: string;\n correlationId?: string;\n };\n result?: {\n outcome: SessionAuditOutcome;\n reason?: string;\n };\n};\n\nexport function inferSessionPrincipalType(\n principalId: string\n): SessionPrincipalType {\n if (principalId.startsWith(\"user:\")) {\n return \"human\";\n }\n if (principalId.startsWith(\"agent:\")) {\n return \"agent\";\n }\n return \"service\";\n}\n\nexport function normalizeDelegationChain(args: {\n delegationChain?: readonly SessionDelegationHop[];\n delegatedBy?: string;\n delegatedByType?: SessionPrincipalType;\n delegatedAt?: number;\n reason?: string;\n}): SessionDelegationHop[] | undefined {\n if (args.delegationChain && args.delegationChain.length > 0) {\n return [...args.delegationChain];\n }\n if (!args.delegatedBy) {\n return;\n }\n return [\n {\n principalId: args.delegatedBy,\n principalType:\n args.delegatedByType ?? inferSessionPrincipalType(args.delegatedBy),\n delegatedAt: args.delegatedAt,\n reason: args.reason,\n },\n ];\n}\n\nexport function lastDelegator(\n delegationChain?: readonly SessionDelegationHop[]\n): string | undefined {\n if (!delegationChain || delegationChain.length === 0) {\n return;\n }\n return delegationChain[delegationChain.length - 1]?.principalId;\n}\n","/**\n * Context-Pack Contract v1\n *\n * Canonical TypeScript types and constants for the context-pack output schema.\n * This is the external contract consumed by:\n * - MCP tool `compile_context` (canonical compiler read)\n * - SDK/HTTP consumers that read compiled context packs programmatically\n * - Benchmark harnesses (context-pack-ab)\n *\n * BREAKING CHANGE RULES:\n * - Adding optional fields to ContextPackV1 is NON-breaking\n * - Removing fields or changing types is BREAKING (bump CONTEXT_PACK_SCHEMA_VERSION)\n * - Changing section budget ratios or ranking weights is NON-breaking (tuning)\n * - Changing the version string is BREAKING (consumers check it)\n */\n\n// =============================================================================\n// SCHEMA VERSION\n// =============================================================================\n\n/** Canonical version string. Consumers MUST check this field for compatibility. */\nexport const CONTEXT_PACK_SCHEMA_VERSION = \"1.0.0\" as const;\n\n// =============================================================================\n// RANKING PROFILES\n// =============================================================================\n\n/**\n * Available ranking profiles for context-pack assembly.\n *\n * - `baseline_v1`: Simple token-hit counting. Items with zero query hits are excluded.\n * - `weighted_v1`: Multi-signal scoring combining query relevance, recency, confidence,\n * belief type, priority, and severity with section-specific weight vectors.\n */\nexport type ContextRankingProfile = \"baseline_v1\" | \"weighted_v1\";\n\nexport const CONTEXT_RANKING_PROFILES: readonly ContextRankingProfile[] = [\n \"baseline_v1\",\n \"weighted_v1\",\n] as const;\n\nexport const DEFAULT_RANKING_PROFILE: ContextRankingProfile = \"weighted_v1\";\n\n// =============================================================================\n// COMPILATION MODE (RS-2)\n// =============================================================================\n\n/**\n * Context compilation mode.\n *\n * - `standard`: Default — ranked beliefs, questions, evidence, contradictions.\n * - `delta`: Diff-aware — adds failure context, verification obligations,\n * and worktree ledger analysis to the standard context pack.\n */\nexport type ContextCompilationMode = \"standard\" | \"delta\";\n\nexport const DEFAULT_COMPILATION_MODE: ContextCompilationMode = \"standard\";\n\n// =============================================================================\n// SECTION KEYS\n// =============================================================================\n\n/**\n * The five canonical sections of a context pack.\n * Order matters: invariants are injected first, contradictions last.\n */\nexport type ContextPackSectionKey =\n | \"invariants\"\n | \"activeBeliefs\"\n | \"openQuestions\"\n | \"recentEvidence\"\n | \"contradictions\";\n\nexport const CONTEXT_PACK_SECTION_KEYS: readonly ContextPackSectionKey[] = [\n \"invariants\",\n \"activeBeliefs\",\n \"openQuestions\",\n \"recentEvidence\",\n \"contradictions\",\n] as const;\n\n// =============================================================================\n// SECTION BUDGET RATIOS\n// =============================================================================\n\n/**\n * Token budget allocation ratios per section.\n * These sum to 1.0 and determine how the total tokenBudget is divided.\n *\n * Rationale:\n * - invariants (0.28): Highest-priority constraints, injected first\n * - activeBeliefs (0.30): Largest section, carries domain knowledge\n * - openQuestions (0.17): Unresolved work items guide agent behavior\n * - recentEvidence (0.17): Implementation context for grounding\n * - contradictions (0.08): Tension signals, smallest section\n */\nexport const SECTION_BUDGET_RATIOS: Readonly<\n Record<ContextPackSectionKey, number>\n> = {\n invariants: 0.28,\n activeBeliefs: 0.3,\n openQuestions: 0.17,\n recentEvidence: 0.17,\n contradictions: 0.08,\n} as const;\n\n// =============================================================================\n// TOKEN BUDGET CONSTRAINTS\n// =============================================================================\n\n/** Minimum allowed token budget. Below this, context packs lose utility. */\nexport const MIN_TOKEN_BUDGET = 400;\n\n/** Maximum allowed token budget. Above this, context packs bloat prompts. */\nexport const MAX_TOKEN_BUDGET = 8000;\n\n/** Default token budget when caller does not specify. */\nexport const DEFAULT_TOKEN_BUDGET = 1800;\n\n/** Default max items per section. */\nexport const DEFAULT_SECTION_LIMIT = 8;\n\n/** Hard ceiling on items per section. */\nexport const MAX_SECTION_LIMIT = 25;\n\n/** Minimum contradiction section budget floor (tokens). */\nexport const MIN_CONTRADICTION_BUDGET = 40;\n\n// =============================================================================\n// RANKING WEIGHT VECTORS\n// =============================================================================\n\n/**\n * Weight vectors for the weighted_v1 ranking profile.\n * Each section has a different signal mix:\n *\n * - query: How many query tokens appear in the candidate text\n * - recency: Exponential decay from updatedAt (half-life = 30 days)\n * - confidence: Belief confidence score [0,1]\n * - beliefType: Bonus for invariant > tenet > principle > other\n * - priority: Question priority (critical > high > medium > low)\n * - severity: Contradiction severity (critical > high > medium > low)\n */\nexport type RankingWeightVector = {\n query: number;\n recency: number;\n confidence?: number;\n beliefType?: number;\n priority?: number;\n severity?: number;\n};\n\nexport const RANKING_WEIGHTS: Readonly<\n Record<ContextPackSectionKey, RankingWeightVector>\n> = {\n invariants: {\n query: 0.35,\n recency: 0.1,\n confidence: 0.4,\n beliefType: 0.15,\n },\n activeBeliefs: {\n query: 0.5,\n recency: 0.2,\n confidence: 0.2,\n beliefType: 0.1,\n },\n openQuestions: {\n query: 0.55,\n recency: 0.2,\n priority: 0.25,\n },\n recentEvidence: {\n query: 0.6,\n recency: 0.4,\n },\n contradictions: {\n query: 0.4,\n recency: 0.2,\n severity: 0.4,\n },\n} as const;\n\n/** Recency decay half-life in days. After 30 days, recency score = 0.5. */\nexport const RECENCY_HALF_LIFE_DAYS = 30;\n\n/**\n * Ranking weight vector for the relatedEntities section.\n * Entities are ranked by query relevance and connectivity (bridge edge count).\n * Separate from RANKING_WEIGHTS because entities are not part of the\n * token-budgeted injection plan.\n */\nexport const ENTITY_RANKING_WEIGHTS = {\n query: 0.4,\n connectivity: 0.6,\n} as const;\n\n/** Default max entities to include in the context pack. */\nexport const DEFAULT_ENTITY_LIMIT = 10;\n\n/** Hard ceiling on entities per context pack. */\nexport const MAX_ENTITY_LIMIT = 50;\n\n// =============================================================================\n// BELIEF TYPE BONUS MAP\n// =============================================================================\n\n/**\n * Bonus multiplier for belief types in ranking.\n * Invariants get 1.0, unknown types get 0.4.\n */\nexport const BELIEF_TYPE_BONUS: Readonly<Record<string, number>> = {\n invariant: 1.0,\n tenet: 0.8,\n principle: 0.6,\n} as const;\n\nexport const DEFAULT_BELIEF_TYPE_BONUS = 0.4;\n\n// =============================================================================\n// PRIORITY / SEVERITY SCORE MAPS\n// =============================================================================\n\nexport const PRIORITY_SCORES: Readonly<Record<string, number>> = {\n critical: 1.0,\n high: 0.85,\n medium: 0.55,\n low: 0.35,\n} as const;\n\nexport const DEFAULT_PRIORITY_SCORE = 0.5;\n\nexport const SEVERITY_SCORES: Readonly<Record<string, number>> = {\n critical: 1.0,\n high: 0.85,\n medium: 0.6,\n low: 0.35,\n} as const;\n\nexport const DEFAULT_SEVERITY_SCORE = 0.5;\n\n// =============================================================================\n// SECTION ITEM TYPES\n// =============================================================================\n\n/** A ranked belief in the invariants or activeBeliefs section. */\nexport type ContextPackBelief = {\n nodeId: string;\n canonicalText: string;\n confidence: number | null;\n beliefType: string | null;\n score: number;\n /** Present in activeBeliefs, absent in invariants */\n status?: string;\n updatedAt?: number | null;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/** A ranked question in the openQuestions section. */\nexport type ContextPackQuestion = {\n questionId: string;\n text: string;\n status: string;\n priority: string;\n updatedAt?: number | null;\n score: number;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/** A ranked evidence item in the recentEvidence section. */\nexport type ContextPackEvidence = {\n nodeId: string;\n canonicalText: string;\n sourceUrl: string | null;\n kind: string;\n createdAt: number | null;\n score: number;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/** A ranked contradiction in the contradictions section. */\nexport type ContextPackContradiction = {\n contradictionId: string;\n severity: string;\n status: string;\n description: string;\n score: number;\n /** Human-readable explanation of why this item was ranked here (RS-2). */\n justification?: string;\n};\n\n/**\n * An entity from the ontological layer surfaced in the context pack.\n * Entities are domain objects (companies, people, functions, etc.) connected\n * to beliefs via bridge edges. They provide the \"reality anchor\" that makes\n * the reasoning graph domain-aware.\n */\nexport type ContextPackEntity = {\n /** Convex document ID of the entity node. */\n nodeId: string;\n /** Entity type (e.g., \"company\", \"person\", \"function\"). */\n entityType: string;\n /** Human-readable title/name of the entity. */\n title: string;\n /** Number of beliefs connected to this entity via bridge edges. */\n connectedBeliefCount: number;\n /** Number of evidence items referencing this entity. */\n connectedEvidenceCount: number;\n /** Relevance score from ranking algorithm. */\n score: number;\n /** Entity metadata (structured per ontology schema). */\n metadata?: Record<string, unknown>;\n};\n\n/**\n * A lattice seed entry representing a belief that was auto-generated\n * to cover an ontology entity type within a topic scope.\n */\nexport type BeliefLatticeSeed = {\n /** The belief node ID that was created or already existed. */\n beliefNodeId: string;\n /** The entity type this seed belief covers. */\n entityType: string;\n /** Whether this seed was newly created or already existed. */\n created: boolean;\n /** The canonical text of the seed belief. */\n canonicalText: string;\n};\n\n// =============================================================================\n// SUMMARY\n// =============================================================================\n\n/** Counts and scoped health signals for the context pack. */\nexport type ContextPackSummary = {\n totalBeliefs: number;\n invariants: number;\n openQuestions: number;\n evidenceItems: number;\n contradictions: number;\n /** Number of ontological entities in scope (optional, present when entity graph is active). */\n relatedEntities?: number;\n scopedTopics: number;\n descendantDepth: number;\n query: string | null;\n};\n\n// =============================================================================\n// FAILURE CONTEXT (RS-2)\n// =============================================================================\n\n/** A failed approach surfaced from the failure log for anti-repetition. */\nexport type ContextPackFailure = {\n /** Lucern attempt/evidence node ID. */\n attemptId: string;\n /** What was tried. */\n approach: string;\n /** Why it failed. */\n outcome: string;\n /** When the attempt was recorded (ms since epoch). */\n recordedAt: number;\n /** Relevance score from ranking algorithm. */\n score: number;\n};\n\n/** Failure context section appended to context packs in delta mode. */\nexport type ContextPackFailureContext = {\n /** Ranked failed approaches relevant to the current query. */\n failures: ContextPackFailure[];\n /** IDs of items suppressed from other sections due to anti-repetition. */\n suppressedIds: string[];\n};\n\n// =============================================================================\n// DELTA REPORT (RS-2)\n// =============================================================================\n\n/** A verification obligation surfaced by delta compilation. */\nexport type VerificationObligation = {\n /** What must be verified. */\n description: string;\n /** Source of the obligation (e.g., \"belief:xyz confidence drop\"). */\n source: string;\n /** Severity: how important it is to verify. */\n severity: \"critical\" | \"high\" | \"medium\" | \"low\";\n};\n\n/** Delta report appended to context packs when mode = \"delta\". */\nexport type ContextPackDeltaReport = {\n /** Items that changed since the reference point (new, updated, removed). */\n changedItems: Array<{\n id: string;\n section: ContextPackSectionKey;\n changeType: \"added\" | \"updated\" | \"removed\" | \"confidence_changed\";\n summary: string;\n }>;\n /** Obligations the consuming session must verify. */\n verificationObligations: VerificationObligation[];\n /** Reference point for the delta (worktree ID, timestamp, or commit SHA). */\n referencePoint: string;\n};\n\n// =============================================================================\n// PACK WEIGHT OVERRIDES (RS-2)\n// =============================================================================\n\n/**\n * Per-section weight overrides that domain packs can apply.\n * Overrides merge with RANKING_WEIGHTS — only specified fields replace defaults.\n */\nexport type PackWeightOverride = {\n /** Which section to override weights for. */\n section: ContextPackSectionKey;\n /** Partial weight vector — only specified fields replace defaults. */\n weights: Partial<RankingWeightVector>;\n};\n\n// =============================================================================\n// INJECTION POLICY\n// =============================================================================\n\n/** Token-budgeted section selections for prompt injection. */\nexport type ContextPackInjectionPolicy = {\n /** Total token budget for the entire context pack. */\n tokenBudget: number;\n /** Estimated tokens consumed across all sections. */\n estimatedTokens: number;\n /** Per-section token budgets derived from SECTION_BUDGET_RATIOS. */\n sectionBudgets: Record<ContextPackSectionKey, number>;\n /** Actual token usage per section after greedy fill. */\n sectionUsage: Record<ContextPackSectionKey, number>;\n /** Node/question IDs selected for injection, per section. */\n selected: Record<ContextPackSectionKey, string[]>;\n /** Items that were scored but excluded from injection, with reason (RS-2). */\n excludedItems?: Array<{\n id: string;\n section: ContextPackSectionKey;\n reason: \"budget_exceeded\" | \"anti_repetition\" | \"below_threshold\";\n score: number;\n }>;\n};\n\n// =============================================================================\n// DIAGNOSTICS\n// =============================================================================\n\n/** Telemetry for context pack assembly. */\nexport type ContextPackDiagnostics = {\n /** Total candidates scored across all sections. */\n itemsScored: number;\n /** Ratio of estimatedTokens / tokenBudget. Range [0, 1+]. */\n tokenBudgetUtilization: number;\n};\n\n// =============================================================================\n// PUBLIC COMPILED CONTEXT TYPES\n// =============================================================================\n\n/**\n * Public context surface returned by the SDK-facing context client.\n *\n * This preserves the existing external shape while the canonical compiler\n * contract evolves in parallel as ContextPackV1.\n */\nexport type PublicContextBelief = {\n beliefId: string;\n text: string;\n confidence: number | null;\n beliefType?: string | null;\n status?: string;\n updatedAt?: number | null;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextQuestion = {\n questionId: string;\n text: string;\n status: string;\n priority: string;\n updatedAt?: number | null;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextEvidence = {\n evidenceId: string;\n text: string;\n sourceUrl?: string | null;\n kind: string;\n createdAt?: number | null;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextContradiction = {\n contradictionId: string;\n severity: string;\n status: string;\n description: string;\n score: number;\n justification?: string;\n};\n\nexport type PublicContextEntity = {\n entityId: string;\n entityType: string;\n title: string;\n text?: string;\n connectedBeliefCount: number;\n connectedEvidenceCount: number;\n score: number;\n metadata?: Record<string, unknown>;\n};\n\nexport type PublicContextInjectionPolicy = {\n tokenBudget: number;\n estimatedTokens: number;\n sectionBudgets: Record<string, number>;\n sectionUsage: Record<string, number>;\n selected: Record<string, string[]>;\n excludedItems?: Array<{\n id: string;\n section: string;\n reason: \"budget_exceeded\" | \"anti_repetition\" | \"below_threshold\";\n score: number;\n }>;\n};\n\nexport type PublicCompiledContext = {\n schemaVersion: string;\n topicId: string;\n topicName: string;\n scopedTopicIds: string[];\n generatedAt: number;\n ranking: ContextRankingProfile;\n summary: Record<string, unknown>;\n invariants: PublicContextBelief[];\n activeBeliefs: PublicContextBelief[];\n openQuestions: PublicContextQuestion[];\n recentEvidence: PublicContextEvidence[];\n contradictions: PublicContextContradiction[];\n relatedEntities?: PublicContextEntity[];\n contextNarrative: string[];\n injectionPolicy: PublicContextInjectionPolicy;\n diagnostics: Record<string, unknown>;\n compilationMode?: string;\n failureContext?: {\n failures: Array<{\n attemptId: string;\n approach: string;\n outcome: string;\n recordedAt: number;\n score: number;\n }>;\n suppressedIds: string[];\n };\n deltaReport?: {\n changedItems: Array<{\n id: string;\n section: string;\n changeType: string;\n summary: string;\n }>;\n verificationObligations: Array<{\n description: string;\n source: string;\n severity: \"critical\" | \"high\" | \"medium\" | \"low\";\n }>;\n referencePoint: string;\n };\n appliedWeightOverrides?: unknown[];\n};\n\n// =============================================================================\n// CONTEXT PACK V1 (TOP-LEVEL OUTPUT)\n// =============================================================================\n\n/**\n * The canonical output schema for context compilation responses.\n *\n * This is the contract that consumers depend on. All fields are required\n * in the output. Adding optional fields is non-breaking; removing or\n * changing types is breaking (requires version bump).\n */\nexport type ContextPackV1 = {\n /** Schema version for compatibility checking. */\n schemaVersion: typeof CONTEXT_PACK_SCHEMA_VERSION;\n /** Resolved topic ID after scope resolution. */\n topicId: string;\n /** Human-readable topic name. */\n topicName: string;\n /** All topic IDs included in the neighborhood expansion. */\n scopedTopicIds: string[];\n /** Deterministic freshness watermark for this pack (ms since epoch). */\n generatedAt: number;\n /** Which ranking profile was used. */\n rankingProfile: ContextRankingProfile;\n /** Aggregate counts and health signals. */\n summary: ContextPackSummary;\n /** High-confidence invariant beliefs (beliefType = \"invariant\"). */\n invariants: ContextPackBelief[];\n /** Active beliefs ranked by query relevance. */\n activeBeliefs: ContextPackBelief[];\n /** Open questions ranked by relevance and priority. */\n openQuestions: ContextPackQuestion[];\n /** Recent evidence ranked by relevance and recency. */\n recentEvidence: ContextPackEvidence[];\n /** Active contradictions ranked by severity. */\n contradictions: ContextPackContradiction[];\n /**\n * Ontological entities connected to beliefs in scope, ranked by connectivity.\n * Optional — present when entity graph substrate is active for this topic.\n * NON-BREAKING addition per contract rules.\n */\n relatedEntities?: ContextPackEntity[];\n /** Concise instructions for agent context injection. */\n contextNarrative: string[];\n /** Token-budgeted injection selections. */\n injectionPolicy: ContextPackInjectionPolicy;\n /** Assembly telemetry. */\n diagnostics: ContextPackDiagnostics;\n /** Compilation mode used to generate this pack (RS-2). Default: \"standard\". */\n compilationMode?: ContextCompilationMode;\n /** Failure context for anti-repetition (RS-2). Present when failures are relevant. */\n failureContext?: ContextPackFailureContext;\n /** Delta report (RS-2). Present only when compilationMode = \"delta\". */\n deltaReport?: ContextPackDeltaReport;\n /** Pack weight overrides applied during ranking (RS-2). */\n appliedWeightOverrides?: PackWeightOverride[];\n};\n\n// =============================================================================\n// CONTEXT PACK REQUEST V1 (INPUT)\n// =============================================================================\n\n/**\n * The canonical input schema for `compile_context`.\n * `topicId` is the only scope identifier.\n */\nexport type ContextPackRequestV1 = {\n /** Topic scope ID (required). */\n topicId: string;\n /** Focus query for relevance ranking. */\n query?: string;\n /** Max items per section. Default: DEFAULT_SECTION_LIMIT. */\n limit?: number;\n /** Ranking profile. Default: DEFAULT_RANKING_PROFILE. */\n rankingProfile?: ContextRankingProfile;\n /** Total token budget. Default: DEFAULT_TOKEN_BUDGET. */\n tokenBudget?: number;\n /** Descendant topic depth for neighborhood expansion. */\n maxDepth?: number;\n /** Include ontological entities connected to beliefs in scope. Default: true. */\n includeEntities?: boolean;\n /** Compilation mode (RS-2). Default: \"standard\". */\n mode?: ContextCompilationMode;\n /** Include failure log context for anti-repetition (RS-2). Default: false. */\n includeFailures?: boolean;\n /** Active worktree ID for delta mode reference point (RS-2). */\n worktreeId?: string;\n /** Session ID for anti-repetition dedup (RS-2). */\n sessionId?: string;\n /** Pack weight overrides from domain pack binding (RS-2). */\n packWeightOverrides?: PackWeightOverride[];\n};\n\n// =============================================================================\n// RESOLVED QUESTION STATUSES\n// =============================================================================\n\n/**\n * Question statuses that are considered \"resolved\" (not open).\n * Used to filter which questions appear in the openQuestions section.\n */\nexport const RESOLVED_QUESTION_STATUSES: readonly string[] = [\n \"answered\",\n \"archived\",\n \"closed\",\n \"resolved\",\n \"resolved_support\",\n \"resolved_contra\",\n \"belief_forked\",\n] as const;\n\n// =============================================================================\n// TOKEN ESTIMATION\n// =============================================================================\n\n/**\n * Tokens-per-word multiplier for rough token estimation.\n * Conservative estimate: ~1.35 tokens per whitespace-delimited word.\n */\nexport const TOKENS_PER_WORD = 1.35;\n\n/** Minimum token estimate for any non-empty string. */\nexport const MIN_TOKEN_ESTIMATE = 8;\n","/**\n * Lens Filter Criteria Contract\n *\n * Version-discriminated filter DSL for lenses. Each filter criteria document\n * carries a `version` and `kind` discriminator so future shapes can coexist\n * without schema migrations. The Convex `filterCriteria` field remains v.any()\n * — all type enforcement happens here at the TypeScript contract layer.\n *\n * Forward-compatibility guarantees:\n * - `version` field: new versions add fields, never remove or rename existing ones\n * - `kind` field: new filter kinds (temporal, confidence-range) can be added\n * without touching taxonomy code paths\n * - `entityTypeFilters` array items are open to extension in future versions\n * - Resolution logic switches on `version` + `kind` to select the right resolver\n *\n * @module lucern/contracts/src/lens-filter\n */\n\n// ---------------------------------------------------------------------------\n// V1: Taxonomy Filter — entity type + subtype matching\n// ---------------------------------------------------------------------------\n\n/**\n * A single entity type filter entry. Matches nodes whose `nodeType` equals\n * `entityTypeValue`, optionally further narrowed by subtype membership.\n *\n * V2 will add `propertyMatchers` here for arbitrary JSON Schema facet queries.\n */\nexport type EntityTypeFilterV1 = {\n /** References ontologyVersion.entityTypes[].value, e.g. \"company\" */\n entityTypeValue: string;\n\n /** Optional subtype narrowing. If omitted or empty, all subtypes match. */\n subtypeValues?: string[];\n};\n\n/**\n * Optional scope to restrict which ontology the filter resolves against.\n * If omitted, resolution uses whatever ontology is active in the workspace.\n */\nexport type OntologyScope = {\n /** Restrict to a specific ontology by key, e.g. \"vc-investment\" */\n ontologyKey?: string;\n};\n\n/**\n * Taxonomy filter criteria v1: entity type + subtype matching over ontology.\n */\nexport type TaxonomyFilterCriteriaV1 = {\n version: 1;\n kind: \"taxonomy\";\n entityTypeFilters: EntityTypeFilterV1[];\n ontologyScope?: OntologyScope;\n};\n\n// ---------------------------------------------------------------------------\n// Union: All filter criteria versions and kinds\n// ---------------------------------------------------------------------------\n\n/**\n * Discriminated union of all supported filter criteria.\n * Resolution logic switches on `version` + `kind`.\n *\n * To add a new filter kind:\n * 1. Define a new type (e.g., TemporalFilterCriteriaV1)\n * 2. Add it to this union\n * 3. Add a resolver in taxonomy-filter.ts\n * 4. No schema migration needed — filterCriteria is v.any()\n */\nexport type LensFilterCriteria = TaxonomyFilterCriteriaV1;\n// Future: | TemporalFilterCriteriaV1 | ConfidenceRangeFilterCriteriaV1 | ...\n\n// ---------------------------------------------------------------------------\n// Type guards\n// ---------------------------------------------------------------------------\n\nexport function isLensFilterCriteria(\n value: unknown\n): value is LensFilterCriteria {\n if (!value || typeof value !== \"object\") return false;\n const obj = value as Record<string, unknown>;\n return typeof obj.version === \"number\" && typeof obj.kind === \"string\";\n}\n\nexport function isTaxonomyFilterCriteriaV1(\n value: unknown\n): value is TaxonomyFilterCriteriaV1 {\n if (!isLensFilterCriteria(value)) return false;\n return value.version === 1 && value.kind === \"taxonomy\";\n}\n\n// ---------------------------------------------------------------------------\n// Validation\n// ---------------------------------------------------------------------------\n\nexport type FilterValidationResult =\n | { valid: true }\n | { valid: false; errors: string[] };\n\n/**\n * Validate a filter criteria document at the contract layer.\n * This runs before persisting to Convex.\n */\nexport function validateFilterCriteria(\n value: unknown\n): FilterValidationResult {\n if (value === undefined || value === null) {\n return { valid: true }; // filterCriteria is optional\n }\n\n if (!isLensFilterCriteria(value)) {\n return {\n valid: false,\n errors: [\n 'filterCriteria must have numeric \"version\" and string \"kind\" fields',\n ],\n };\n }\n\n if (isTaxonomyFilterCriteriaV1(value)) {\n return validateTaxonomyFilterV1(value);\n }\n\n // Cast to access properties — TypeScript narrows to `never` when all union\n // members are exhausted, but at runtime unknown version/kind combos are possible.\n const raw = value as { version: number; kind: string };\n return {\n valid: false,\n errors: [\n `Unsupported filter criteria: version=${raw.version}, kind=${raw.kind}`,\n ],\n };\n}\n\nfunction validateTaxonomyFilterV1(\n criteria: TaxonomyFilterCriteriaV1\n): FilterValidationResult {\n const errors: string[] = [];\n\n if (!Array.isArray(criteria.entityTypeFilters)) {\n errors.push(\"entityTypeFilters must be an array\");\n return { valid: false, errors };\n }\n\n if (criteria.entityTypeFilters.length === 0) {\n errors.push(\"entityTypeFilters must contain at least one entry\");\n return { valid: false, errors };\n }\n\n for (let i = 0; i < criteria.entityTypeFilters.length; i++) {\n const filter = criteria.entityTypeFilters[i];\n if (!filter || typeof filter.entityTypeValue !== \"string\") {\n errors.push(\n `entityTypeFilters[${i}].entityTypeValue must be a non-empty string`\n );\n continue;\n }\n if (filter.entityTypeValue.trim().length === 0) {\n errors.push(\n `entityTypeFilters[${i}].entityTypeValue must be a non-empty string`\n );\n }\n if (\n filter.subtypeValues !== undefined &&\n !Array.isArray(filter.subtypeValues)\n ) {\n errors.push(`entityTypeFilters[${i}].subtypeValues must be an array`);\n }\n }\n\n if (criteria.ontologyScope !== undefined) {\n if (\n typeof criteria.ontologyScope !== \"object\" ||\n criteria.ontologyScope === null\n ) {\n errors.push(\"ontologyScope must be an object\");\n }\n }\n\n return errors.length === 0\n ? { valid: true }\n : { valid: false, errors };\n}\n","/**\n * Canonical lens workflow contract shared across schema, SDK, and MCP surfaces.\n */\n\n// Re-export filter criteria types for consumers who import from lens-workflow\nexport type {\n LensFilterCriteria,\n TaxonomyFilterCriteriaV1,\n EntityTypeFilterV1,\n OntologyScope,\n FilterValidationResult,\n} from \"./lens-filter.contract\";\nexport {\n validateFilterCriteria,\n isLensFilterCriteria,\n isTaxonomyFilterCriteriaV1,\n} from \"./lens-filter.contract\";\n\nexport const LENS_PERSPECTIVE_TYPES = [\n \"investigation\",\n \"monitoring\",\n \"analysis\",\n \"comparison\",\n \"taxonomy\",\n] as const;\n\nexport type LensPerspectiveType = (typeof LENS_PERSPECTIVE_TYPES)[number];\n\nexport const LENS_STATUSES = [\"draft\", \"active\", \"archived\"] as const;\n\nexport type LensStatus = (typeof LENS_STATUSES)[number];\n\nexport const LENS_TASK_TEMPLATE_PRIORITIES = [\n \"critical\",\n \"high\",\n \"medium\",\n \"low\",\n] as const;\n\nexport type LensTaskTemplatePriority =\n (typeof LENS_TASK_TEMPLATE_PRIORITIES)[number];\n\nexport type LensLooseMetadata = Record<string, unknown>;\n\nexport type LensPromptTemplateReference = {\n key: string;\n promptRef: string;\n phase?: string;\n role?: string;\n version?: string;\n required?: boolean;\n metadata?: LensLooseMetadata;\n};\n\nexport type LensWorkflowStepTemplate = {\n key: string;\n title: string;\n description?: string;\n promptTemplateKey?: string;\n taskTemplateKeys?: string[];\n metadata?: LensLooseMetadata;\n};\n\nexport type LensWorkflowTemplate = {\n key: string;\n name: string;\n description?: string;\n steps: LensWorkflowStepTemplate[];\n metadata?: LensLooseMetadata;\n};\n\nexport type LensTaskTemplate = {\n key: string;\n title: string;\n description?: string;\n priority?: LensTaskTemplatePriority;\n phase?: string;\n metadata?: LensLooseMetadata;\n};\n\nexport type LensQuestionTemplate = {\n key: string;\n text: string;\n priority?: LensTaskTemplatePriority;\n linkedBeliefKey?: string;\n metadata?: LensLooseMetadata;\n};\n\nexport type LensBranchMigrationSuggestion = {\n recommendedTool: \"create_lens\";\n perspectiveType: LensPerspectiveType;\n message: string;\n suggestedPayload: {\n name: string;\n description?: string;\n topicId?: string;\n workspaceId?: string;\n perspectiveType: LensPerspectiveType;\n };\n};\n\nexport const BRANCH_DEPRECATION_MESSAGE =\n \"Branches are deprecated for operational framing. Create a workspace-scoped lens instead.\";\n\nexport type DeprecatedBranchMetadata = {\n deprecated: true;\n deprecationMessage: string;\n lensSuggestion: LensBranchMigrationSuggestion;\n};\n\nexport function inferLensPerspectiveTypeFromBranchSchema(\n schema?: string | null\n): LensPerspectiveType {\n const normalized = schema?.trim().toLowerCase();\n if (normalized === \"phase\") {\n return \"monitoring\";\n }\n if (normalized === \"axis\" || normalized === \"dimension\") {\n return \"comparison\";\n }\n if (normalized === \"track\") {\n return \"investigation\";\n }\n return \"analysis\";\n}\n\nexport function migrateBranchToLens(args: {\n name: string;\n description?: string;\n topicId?: string;\n workspaceId?: string;\n schema?: string | null;\n}): LensBranchMigrationSuggestion {\n const perspectiveType = inferLensPerspectiveTypeFromBranchSchema(args.schema);\n return {\n recommendedTool: \"create_lens\",\n perspectiveType,\n message:\n \"Branches are deprecated for operational framing. Create a workspace-scoped lens with the suggested payload instead.\",\n suggestedPayload: {\n name: args.name,\n description: args.description,\n topicId: args.topicId,\n workspaceId: args.workspaceId,\n perspectiveType,\n },\n };\n}\n\nexport function buildDeprecatedBranchMetadata(args: {\n name: string;\n description?: string;\n topicId?: string;\n workspaceId?: string;\n schema?: string | null;\n}): DeprecatedBranchMetadata {\n return {\n deprecated: true,\n deprecationMessage: BRANCH_DEPRECATION_MESSAGE,\n lensSuggestion: migrateBranchToLens(args),\n };\n}\n","export * from \"./tool-contracts\";\n","export * from \"@lucern/contracts/tool-contracts\";\n\n","/**\n * Prompt contract for portable, provider-agnostic prompt artifacts.\n */\n\nexport type LucernPromptModelHint = \"fast\" | \"balanced\" | \"strong\";\n\nexport type LucernPrompt = {\n /** Stable prompt identifier, e.g. \"lucern/classify-evidence\" */\n slug: string;\n /** Semver-ish prompt version, e.g. \"1.0.0\" */\n version: string;\n /** Prompt template text (supports {{variable}} interpolation) */\n template: string;\n /** Variables expected by the template */\n variables: string[];\n /** Model family hint for runtime model routing */\n modelHint: LucernPromptModelHint;\n /** Metadata used for ownership and discovery */\n metadata: {\n author: string;\n createdAt: string;\n description: string;\n tags: string[];\n };\n};\n\nexport function isLucernPrompt(value: unknown): value is LucernPrompt {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n const prompt = value as Partial<LucernPrompt>;\n\n return (\n typeof prompt.slug === \"string\" &&\n typeof prompt.version === \"string\" &&\n typeof prompt.template === \"string\" &&\n Array.isArray(prompt.variables) &&\n prompt.variables.every((entry) => typeof entry === \"string\") &&\n (prompt.modelHint === \"fast\" ||\n prompt.modelHint === \"balanced\" ||\n prompt.modelHint === \"strong\") &&\n !!prompt.metadata &&\n typeof prompt.metadata === \"object\" &&\n typeof prompt.metadata.author === \"string\" &&\n typeof prompt.metadata.createdAt === \"string\" &&\n typeof prompt.metadata.description === \"string\" &&\n Array.isArray(prompt.metadata.tags) &&\n prompt.metadata.tags.every((entry) => typeof entry === \"string\")\n );\n}\n","export * from \"@lucern/contracts/sdk-tools.contract\";\n","/**\n * Workflow Runtime Contract v1\n *\n * Canonical TypeScript contract for Lucern's graph-local workflow runtime.\n * WF-1 defines the typed substrate for:\n * - workflow definitions and run receipts\n * - action mutation tiering and approval expectations\n * - hooks over worktree/question/evidence/inbox events\n * - output unions for domain-specific artifacts\n * - deterministic integrity checks and operational metadata\n *\n * BREAKING CHANGE RULES:\n * - Adding optional fields is NON-breaking\n * - Removing fields or renaming enum values is BREAKING\n * - Reclassifying a mutation tier is BREAKING\n * - Changing canonical workflow IDs is BREAKING\n */\n\nexport const WORKFLOW_RUNTIME_SCHEMA_VERSION = \"1.0.0\" as const;\n\nexport const WORKFLOW_MUTATION_TIERS = [\n \"read_only\",\n \"low_risk_write\",\n \"high_risk_write\",\n] as const;\nexport type WorkflowMutationTier = (typeof WORKFLOW_MUTATION_TIERS)[number];\n\nexport const WORKFLOW_APPROVAL_MODES = [\n \"none\",\n \"audit_only\",\n \"human_required\",\n \"auto_approve\",\n] as const;\nexport type WorkflowApprovalMode = (typeof WORKFLOW_APPROVAL_MODES)[number];\n\nexport const DEFAULT_TIER_APPROVAL_MODE: Readonly<\n Record<WorkflowMutationTier, WorkflowApprovalMode>\n> = {\n read_only: \"none\",\n low_risk_write: \"audit_only\",\n high_risk_write: \"human_required\",\n} as const;\n\nexport const WORKFLOW_ACTION_KINDS = [\n \"context_pack\",\n \"integrity_check\",\n \"lucern_tool\",\n \"report_compile\",\n \"brief_publish\",\n \"notification\",\n \"custom\",\n] as const;\nexport type WorkflowActionKind = (typeof WORKFLOW_ACTION_KINDS)[number];\n\nexport const WORKFLOW_HOOK_EVENTS = [\n \"schedule.tick\",\n \"worktree.activated\",\n \"worktree.completed\",\n \"question.created\",\n \"question.answered\",\n \"evidence.appended\",\n \"inbox.item_created\",\n] as const;\nexport type WorkflowHookEvent = (typeof WORKFLOW_HOOK_EVENTS)[number];\n\nexport const WORKFLOW_OUTPUT_KINDS = [\n \"engineering_brief\",\n \"research_memo\",\n \"strategy_artifact\",\n \"inbox_summary\",\n \"pipeline_brief\",\n \"structured_payload\",\n] as const;\nexport type WorkflowOutputKind = (typeof WORKFLOW_OUTPUT_KINDS)[number];\n\nexport const WORKFLOW_RUN_STATUSES = [\n \"queued\",\n \"running\",\n \"awaiting_approval\",\n \"completed\",\n \"failed\",\n \"cancelled\",\n] as const;\nexport type WorkflowRunStatus = (typeof WORKFLOW_RUN_STATUSES)[number];\n\nexport const WORKFLOW_TRIGGER_KINDS = [\n \"manual\",\n \"schedule\",\n \"hook\",\n] as const;\nexport type WorkflowTriggerKind = (typeof WORKFLOW_TRIGGER_KINDS)[number];\n\nexport const WORKFLOW_PROOF_ARTIFACT_KINDS = [\n \"report\",\n \"brief\",\n \"artifact\",\n \"dashboard\",\n \"test_evidence\",\n] as const;\nexport type WorkflowProofArtifactKind =\n (typeof WORKFLOW_PROOF_ARTIFACT_KINDS)[number];\n\nexport const WORKFLOW_STAFFING_HINTS = [\n \"solo\",\n \"backend+tests\",\n \"fullstack\",\n \"mcp+tests\",\n] as const;\nexport type WorkflowStaffingHint = (typeof WORKFLOW_STAFFING_HINTS)[number];\n\nexport const WORKFLOW_AUTO_FIX_MODES = [\n \"disabled\",\n \"dry_run\",\n \"safe\",\n \"aggressive\",\n] as const;\nexport type WorkflowAutoFixMode = (typeof WORKFLOW_AUTO_FIX_MODES)[number];\n\nexport const WORKFLOW_INTEGRITY_CHECKS = [\n \"null_dependency_refs\",\n \"superseded_blockers\",\n \"band_order_inconsistency\",\n \"sparse_shaping\",\n \"failed_completed_gate\",\n] as const;\nexport type WorkflowIntegrityCheckId =\n (typeof WORKFLOW_INTEGRITY_CHECKS)[number];\n\nexport type WorkflowProofArtifact = {\n kind: WorkflowProofArtifactKind;\n label: string;\n required?: boolean;\n sourceRef?: string;\n};\n\nexport type WorkflowAutoFixPolicy = {\n mode: WorkflowAutoFixMode;\n maxActionsPerRun?: number;\n permittedMutationTiers?: WorkflowMutationTier[];\n requireAuditTrail?: boolean;\n escalationGate?: string;\n};\n\nexport const DEFAULT_WORKFLOW_AUTO_FIX_POLICY: WorkflowAutoFixPolicy = {\n mode: \"disabled\",\n permittedMutationTiers: [\"read_only\"],\n requireAuditTrail: true,\n};\n\nexport type WorkflowApprovalPolicy = {\n mode: WorkflowApprovalMode;\n approvalGate?: string;\n autoApprovePolicyKey?: string;\n rationaleRequired?: boolean;\n};\n\nexport type WorkflowOutputBase = {\n outputId: string;\n kind: WorkflowOutputKind;\n title: string;\n summary: string;\n generatedAt?: number;\n};\n\nexport type EngineeringBriefOutput = WorkflowOutputBase & {\n kind: \"engineering_brief\";\n sections: Array<{\n heading: string;\n body: string;\n }>;\n touchedPaths?: string[];\n};\n\nexport type ResearchMemoOutput = WorkflowOutputBase & {\n kind: \"research_memo\";\n claims: string[];\n evidenceRefs?: string[];\n};\n\nexport type StrategyArtifactOutput = WorkflowOutputBase & {\n kind: \"strategy_artifact\";\n recommendations: string[];\n decisionWindow?: string;\n};\n\nexport type InboxSummaryOutput = WorkflowOutputBase & {\n kind: \"inbox_summary\";\n channel: \"developer_portal\" | \"chat\" | \"ops\";\n inboxTitle: string;\n inboxBody: string;\n};\n\nexport type PipelineBriefOutput = WorkflowOutputBase & {\n kind: \"pipeline_brief\";\n hingeWorktreeId?: string;\n groupedBlockers: Array<{\n blocker: string;\n blockedWorktreeIds: string[];\n }>;\n};\n\nexport type StructuredPayloadOutput = WorkflowOutputBase & {\n kind: \"structured_payload\";\n payload: Record<string, unknown>;\n};\n\nexport type WorkflowOutputContract =\n | EngineeringBriefOutput\n | ResearchMemoOutput\n | StrategyArtifactOutput\n | InboxSummaryOutput\n | PipelineBriefOutput\n | StructuredPayloadOutput;\n\nexport type WorkflowActionContract = {\n actionId: string;\n kind: WorkflowActionKind;\n title: string;\n description: string;\n mutationTier: WorkflowMutationTier;\n toolName?: string;\n produces?: WorkflowOutputKind[];\n idempotent?: boolean;\n approval: WorkflowApprovalPolicy;\n};\n\nexport type WorkflowHookContract = {\n hookId: string;\n event: WorkflowHookEvent;\n description: string;\n condition?: string;\n actionIds: string[];\n};\n\nexport type WorkflowTriggerContract =\n | {\n kind: \"manual\";\n description?: string;\n }\n | {\n kind: \"schedule\";\n cadence: \"hourly\" | \"daily\" | \"weekly\";\n timezone?: string;\n }\n | {\n kind: \"hook\";\n event: WorkflowHookEvent;\n };\n\nexport type WorkflowDefinitionV1 = {\n workflowId: string;\n version: typeof WORKFLOW_RUNTIME_SCHEMA_VERSION;\n title: string;\n description: string;\n trigger: WorkflowTriggerContract;\n staffingHint?: WorkflowStaffingHint;\n proofArtifacts?: WorkflowProofArtifact[];\n autoFixPolicy?: WorkflowAutoFixPolicy;\n actions: readonly WorkflowActionContract[];\n hooks?: readonly WorkflowHookContract[];\n outputs: readonly WorkflowOutputKind[];\n integrityChecks?: readonly WorkflowIntegrityCheckId[];\n};\n\nexport type WorkflowRunReceiptV1 = {\n runId: string;\n workflowId: string;\n status: WorkflowRunStatus;\n triggeredBy: WorkflowTriggerKind;\n startedAt: number;\n completedAt?: number;\n outputKinds: WorkflowOutputKind[];\n approvalsRequired?: number;\n};\n\nexport const NIGHTLY_RECONCILIATION_WORKFLOW_ID =\n \"workflow.pipeline_reconciliation.v1\" as const;\n\nexport const MORNING_BRIEF_WORKFLOW_ID =\n \"workflow.morning_brief.v1\" as const;\n\nexport const CANONICAL_WORKFLOW_DEFINITIONS: readonly WorkflowDefinitionV1[] = [\n {\n workflowId: NIGHTLY_RECONCILIATION_WORKFLOW_ID,\n version: WORKFLOW_RUNTIME_SCHEMA_VERSION,\n title: \"Nightly Pipeline Reconciliation\",\n description:\n \"Runs deterministic integrity checks, compiles pipeline state, and emits an operator-facing reconciliation brief.\",\n trigger: {\n kind: \"schedule\",\n cadence: \"daily\",\n timezone: \"America/New_York\",\n },\n staffingHint: \"backend+tests\",\n proofArtifacts: [\n {\n kind: \"report\",\n label: \"Pipeline reconciliation report\",\n required: true,\n },\n {\n kind: \"test_evidence\",\n label: \"Integrity check receipt\",\n required: true,\n },\n ],\n autoFixPolicy: {\n mode: \"safe\",\n maxActionsPerRun: 5,\n permittedMutationTiers: [\"read_only\", \"low_risk_write\"],\n requireAuditTrail: true,\n escalationGate: \"gate:workflow-runtime-contract-live\",\n },\n actions: [\n {\n actionId: \"compile_context_pack\",\n kind: \"context_pack\",\n title: \"Compile pipeline context\",\n description: \"Build the ranked context needed for deterministic checks.\",\n mutationTier: \"read_only\",\n produces: [\"structured_payload\"],\n idempotent: true,\n approval: { mode: \"none\" },\n },\n {\n actionId: \"run_integrity_checks\",\n kind: \"integrity_check\",\n title: \"Run integrity checks\",\n description:\n \"Evaluate dependency references, blockers, execution bands, shaping coverage, and completed gates.\",\n mutationTier: \"read_only\",\n produces: [\"structured_payload\"],\n idempotent: true,\n approval: { mode: \"none\" },\n },\n {\n actionId: \"record_followup_questions\",\n kind: \"lucern_tool\",\n title: \"Record follow-up questions\",\n description:\n \"Create or reopen operator-facing questions for integrity failures that require human review.\",\n mutationTier: \"low_risk_write\",\n toolName: \"create_question\",\n produces: [\"pipeline_brief\"],\n approval: { mode: \"audit_only\", rationaleRequired: true },\n },\n {\n actionId: \"publish_reconciliation_brief\",\n kind: \"brief_publish\",\n title: \"Publish reconciliation brief\",\n description:\n \"Emit an inbox-routed brief summarizing the nightly pipeline state and grouped blockers.\",\n mutationTier: \"low_risk_write\",\n produces: [\"pipeline_brief\", \"inbox_summary\"],\n approval: { mode: \"audit_only\" },\n },\n ],\n hooks: [\n {\n hookId: \"nightly-schedule\",\n event: \"schedule.tick\",\n description: \"Run once per nightly cadence.\",\n actionIds: [\n \"compile_context_pack\",\n \"run_integrity_checks\",\n \"record_followup_questions\",\n \"publish_reconciliation_brief\",\n ],\n },\n ],\n outputs: [\"pipeline_brief\", \"inbox_summary\", \"structured_payload\"],\n integrityChecks: WORKFLOW_INTEGRITY_CHECKS,\n },\n {\n workflowId: MORNING_BRIEF_WORKFLOW_ID,\n version: WORKFLOW_RUNTIME_SCHEMA_VERSION,\n title: \"Morning Brief\",\n description:\n \"Compiles a developer-facing morning brief from graph state, overnight workflow outputs, and inbox routing preferences.\",\n trigger: {\n kind: \"schedule\",\n cadence: \"daily\",\n timezone: \"America/New_York\",\n },\n staffingHint: \"solo\",\n proofArtifacts: [\n {\n kind: \"brief\",\n label: \"Morning brief\",\n required: true,\n },\n ],\n autoFixPolicy: {\n mode: \"dry_run\",\n maxActionsPerRun: 1,\n permittedMutationTiers: [\"read_only\", \"low_risk_write\"],\n requireAuditTrail: true,\n },\n actions: [\n {\n actionId: \"compile_brief_inputs\",\n kind: \"context_pack\",\n title: \"Compile brief inputs\",\n description:\n \"Read graph state, worktree state, and overnight workflow receipts.\",\n mutationTier: \"read_only\",\n produces: [\"structured_payload\"],\n idempotent: true,\n approval: { mode: \"none\" },\n },\n {\n actionId: \"publish_morning_brief\",\n kind: \"brief_publish\",\n title: \"Publish morning brief\",\n description:\n \"Publish a typed inbox summary with prioritized worktree and question context.\",\n mutationTier: \"low_risk_write\",\n produces: [\"engineering_brief\", \"inbox_summary\"],\n approval: { mode: \"audit_only\" },\n },\n ],\n hooks: [\n {\n hookId: \"morning-schedule\",\n event: \"schedule.tick\",\n description: \"Run once per morning cadence.\",\n actionIds: [\"compile_brief_inputs\", \"publish_morning_brief\"],\n },\n {\n hookId: \"worktree-complete-refresh\",\n event: \"worktree.completed\",\n description:\n \"Refresh the queued morning brief inputs when worktree outcomes land overnight.\",\n actionIds: [\"compile_brief_inputs\"],\n },\n ],\n outputs: [\"engineering_brief\", \"inbox_summary\", \"structured_payload\"],\n integrityChecks: [\"sparse_shaping\"],\n },\n] as const;\n"]}