@lucern/contracts 1.0.11 → 1.0.13

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 (123) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/function-registry/beliefs.d.ts +1 -1
  3. package/dist/function-registry/beliefs.js +126 -10
  4. package/dist/function-registry/beliefs.js.map +1 -1
  5. package/dist/function-registry/coding.d.ts +1 -1
  6. package/dist/function-registry/coding.js +124 -8
  7. package/dist/function-registry/coding.js.map +1 -1
  8. package/dist/function-registry/context.d.ts +44 -4
  9. package/dist/function-registry/context.js +146 -8
  10. package/dist/function-registry/context.js.map +1 -1
  11. package/dist/function-registry/contracts.d.ts +1 -1
  12. package/dist/function-registry/contracts.js +124 -8
  13. package/dist/function-registry/contracts.js.map +1 -1
  14. package/dist/function-registry/coordination.d.ts +1 -1
  15. package/dist/function-registry/coordination.js +124 -8
  16. package/dist/function-registry/coordination.js.map +1 -1
  17. package/dist/function-registry/edges.d.ts +1 -1
  18. package/dist/function-registry/edges.js +124 -8
  19. package/dist/function-registry/edges.js.map +1 -1
  20. package/dist/function-registry/evidence.d.ts +1 -1
  21. package/dist/function-registry/evidence.js +309 -40
  22. package/dist/function-registry/evidence.js.map +1 -1
  23. package/dist/function-registry/graph.d.ts +1 -1
  24. package/dist/function-registry/graph.js +126 -12
  25. package/dist/function-registry/graph.js.map +1 -1
  26. package/dist/function-registry/helpers.js +124 -8
  27. package/dist/function-registry/helpers.js.map +1 -1
  28. package/dist/function-registry/identity.d.ts +1 -1
  29. package/dist/function-registry/identity.js +124 -8
  30. package/dist/function-registry/identity.js.map +1 -1
  31. package/dist/function-registry/index.js +124 -8
  32. package/dist/function-registry/index.js.map +1 -1
  33. package/dist/function-registry/judgments.d.ts +1 -1
  34. package/dist/function-registry/judgments.js +124 -8
  35. package/dist/function-registry/judgments.js.map +1 -1
  36. package/dist/function-registry/legacy.d.ts +1 -1
  37. package/dist/function-registry/legacy.js +124 -8
  38. package/dist/function-registry/legacy.js.map +1 -1
  39. package/dist/function-registry/lenses.d.ts +1 -1
  40. package/dist/function-registry/lenses.js +124 -8
  41. package/dist/function-registry/lenses.js.map +1 -1
  42. package/dist/function-registry/manifest.d.ts +10 -4
  43. package/dist/function-registry/manifest.js +14 -1
  44. package/dist/function-registry/manifest.js.map +1 -1
  45. package/dist/function-registry/nodes.d.ts +1 -1
  46. package/dist/function-registry/nodes.js +124 -8
  47. package/dist/function-registry/nodes.js.map +1 -1
  48. package/dist/function-registry/ontologies.d.ts +1 -1
  49. package/dist/function-registry/ontologies.js +124 -8
  50. package/dist/function-registry/ontologies.js.map +1 -1
  51. package/dist/function-registry/pipeline.d.ts +1 -1
  52. package/dist/function-registry/pipeline.js +124 -8
  53. package/dist/function-registry/pipeline.js.map +1 -1
  54. package/dist/function-registry/questions.d.ts +1 -1
  55. package/dist/function-registry/questions.js +124 -8
  56. package/dist/function-registry/questions.js.map +1 -1
  57. package/dist/function-registry/tasks.d.ts +1 -1
  58. package/dist/function-registry/tasks.js +124 -8
  59. package/dist/function-registry/tasks.js.map +1 -1
  60. package/dist/function-registry/topics.d.ts +1 -1
  61. package/dist/function-registry/topics.js +126 -12
  62. package/dist/function-registry/topics.js.map +1 -1
  63. package/dist/function-registry/types.d.ts +1 -1
  64. package/dist/function-registry/worktrees.d.ts +1 -1
  65. package/dist/function-registry/worktrees.js +124 -8
  66. package/dist/function-registry/worktrees.js.map +1 -1
  67. package/dist/generated/infisicalRuntimeEnv.js +536 -1
  68. package/dist/generated/infisicalRuntimeEnv.js.map +1 -1
  69. package/dist/index.d.ts +2 -1
  70. package/dist/index.js +941 -14
  71. package/dist/index.js.map +1 -1
  72. package/dist/infisical-runtime.base.d.ts +42 -1
  73. package/dist/infisical-runtime.base.js +50 -1
  74. package/dist/infisical-runtime.base.js.map +1 -1
  75. package/dist/infisical-runtime.contract.d.ts +102 -0
  76. package/dist/infisical-runtime.contract.js +170 -1
  77. package/dist/infisical-runtime.contract.js.map +1 -1
  78. package/dist/infisical-runtime.platform-secrets.d.ts +102 -0
  79. package/dist/infisical-runtime.platform-secrets.js +120 -0
  80. package/dist/infisical-runtime.platform-secrets.js.map +1 -1
  81. package/dist/infisical-runtime.tenant-secrets.js.map +1 -1
  82. package/dist/manifests/infisical-runtime-manifest.d.ts +144 -1
  83. package/dist/manifests/infisical-runtime-manifest.js +170 -1
  84. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  85. package/dist/manifests/invariants/index.js +24 -5
  86. package/dist/manifests/invariants/index.js.map +1 -1
  87. package/dist/manifests/invariants/inv-1-beliefs-append-only.js +24 -5
  88. package/dist/manifests/invariants/inv-1-beliefs-append-only.js.map +1 -1
  89. package/dist/projections/check-convex-args-shape.js +138 -5
  90. package/dist/projections/check-convex-args-shape.js.map +1 -1
  91. package/dist/projections/create-evidence.projection.d.ts +168 -0
  92. package/dist/projections/create-evidence.projection.js +138 -5
  93. package/dist/projections/create-evidence.projection.js.map +1 -1
  94. package/dist/projections/index.d.ts +28 -0
  95. package/dist/projections/index.js +138 -5
  96. package/dist/projections/index.js.map +1 -1
  97. package/dist/proof-attestation.json +1 -1
  98. package/dist/schemas/manifest.d.ts +20 -20
  99. package/dist/schemas/tables/kernel/platform.d.ts +4 -4
  100. package/dist/sdk-methods.contract.d.ts +3 -2
  101. package/dist/sdk-tools.contract.js +110 -7
  102. package/dist/sdk-tools.contract.js.map +1 -1
  103. package/dist/sdk-tools.contract.registry.js +110 -7
  104. package/dist/sdk-tools.contract.registry.js.map +1 -1
  105. package/dist/sdk-tools.contract.values.js +110 -7
  106. package/dist/sdk-tools.contract.values.js.map +1 -1
  107. package/dist/tool-contracts.context-orientation.d.ts +5 -0
  108. package/dist/tool-contracts.context-orientation.js +57 -0
  109. package/dist/tool-contracts.context-orientation.js.map +1 -0
  110. package/dist/tool-contracts.d.ts +1 -0
  111. package/dist/tool-contracts.intelligence-evidence.js +26 -4
  112. package/dist/tool-contracts.intelligence-evidence.js.map +1 -1
  113. package/dist/tool-contracts.js +111 -8
  114. package/dist/tool-contracts.js.map +1 -1
  115. package/dist/tool-contracts.lifecycle.js +2 -2
  116. package/dist/tool-contracts.lifecycle.js.map +1 -1
  117. package/dist/tool-contracts.questions-listing.js +27 -1
  118. package/dist/tool-contracts.questions-listing.js.map +1 -1
  119. package/dist/{tool-contracts.values-DjctSW7S.d.ts → tool-contracts.values-BhxfrXS5.d.ts} +3 -1
  120. package/dist/tool-contracts.values.d.ts +1 -0
  121. package/dist/tool-contracts.values.js +111 -8
  122. package/dist/tool-contracts.values.js.map +1 -1
  123. package/package.json +1 -1
@@ -43,7 +43,7 @@ export { legacyContracts } from './legacy.js';
43
43
  // src/tool-contracts.lifecycle.ts
44
44
  var CREATE_BELIEF = {
45
45
  name: "create_belief",
46
- description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; use modulate_confidence to record the first evidential update.",
46
+ description: "Commit a new belief (knowledge unit) to the reasoning graph. Like `git commit` \u2014 creates an atomic, traceable knowledge object with a prior. Creation stores the vacuous opinion `(0, 0, 1, a)`; attach supporting or contradicting evidence with create_evidence or link_evidence_to_belief to record evidential updates.",
47
47
  parameters: {
48
48
  canonicalText: {
49
49
  type: "string",
@@ -129,7 +129,7 @@ var REFINE_BELIEF = {
129
129
  };
130
130
  var MODULATE_CONFIDENCE = {
131
131
  name: "modulate_confidence",
132
- description: "Record a confidence change for a belief. Like `git commit` to the credence log \u2014 an atomic, append-only write. Each modulation is a new entry in the history, not an overwrite. Scoring happens via merge; this tool records the individual data points. Pass the full subjective-logic tuple (`belief`, `disbelief`, `uncertainty`, `baseRate`) directly. If a caller only has a scalar probability, use `@lucern/sdk` helpers `opinionFromBaseRate`, `opinionFromDogmatic`, or `opinionFromProjected` to name the intended interpretation before calling this tool. Every modulation must cite a truth-bearing artifact: triggeringEvidenceId, triggeringQuestionId, triggeringAnswerId, triggeringContradictionId, or triggeringWorktreeId. Triggers: evidence_added, evidence_removed, contradiction_detected, contradiction_resolved, agent_assessment, worktree_outcome, worktree_completed, fusion, discount, deduction.",
132
+ description: "Internal-only subjective-logic ledger append. Like `git commit` to the credence log for the scoring engine \u2014 never an operator-facing way to assert confidence. Agents, SDK callers, CLI users, and MCP clients must instead create or link evidence with `evidenceRelation: supports|contradicts`; the kernel derives the next opinion from that evidence. This compatibility primitive is reserved for governed system scoring paths that already hold a full subjective-logic tuple and truth-bearing provenance.",
133
133
  parameters: {
134
134
  nodeId: { type: "string", description: "The belief to score" },
135
135
  belief: {
@@ -1696,6 +1696,60 @@ var REMOVE_LENS_FROM_TOPIC = {
1696
1696
  tier: "workhorse"
1697
1697
  };
1698
1698
 
1699
+ // src/tool-contracts.context-orientation.ts
1700
+ var LUCERN_ORIENT = {
1701
+ name: "lucern_orient",
1702
+ description: "Load the Lucern reasoning grammar before operating. Like `git help` plus a repository CONTRIBUTING guide for reasoning state - teaches the git-shaped model of topics, campaigns, lanes, worktrees, beliefs, questions, evidence, receipts, gates, and merges.",
1703
+ parameters: {
1704
+ audience: {
1705
+ type: "string",
1706
+ description: "Audience for the primer: agent, human, operator, or developer.",
1707
+ enum: ["agent", "human", "operator", "developer"]
1708
+ },
1709
+ depth: {
1710
+ type: "string",
1711
+ description: "Orientation depth: quick, standard, or deep.",
1712
+ enum: ["quick", "standard", "deep"]
1713
+ },
1714
+ situation: {
1715
+ type: "string",
1716
+ description: "Optional task or query context used to tailor suggested next calls."
1717
+ },
1718
+ includeExamples: {
1719
+ type: "boolean",
1720
+ description: "Whether to include concrete tool-call examples."
1721
+ },
1722
+ includeToolMap: {
1723
+ type: "boolean",
1724
+ description: "Whether to include situation-to-tool routing guidance."
1725
+ },
1726
+ includeFuture: {
1727
+ type: "boolean",
1728
+ description: "Whether to include future exemplar, gauntlet, and training-data capabilities."
1729
+ }
1730
+ },
1731
+ required: [],
1732
+ response: {
1733
+ description: "Canonical operator primer for Lucern's git-shaped reasoning substrate.",
1734
+ fields: {
1735
+ schemaVersion: "string - lucern_orientation.v1",
1736
+ canonicalMentalModel: "object - concise model of Lucern as git-shaped reasoning state",
1737
+ workflow: "array - recommended branch -> investigate -> prove gate -> merge workflow",
1738
+ grammarMap: "array - primitive-to-git-analogy map for topics, campaigns, worktrees, beliefs, questions, evidence, edges, contradictions, and gates",
1739
+ firstMoves: "array - recommended first tools for a cold-start agent",
1740
+ receiptRules: "array - how to interpret candidateCounts, broadening, coverageWarning, narrativeCoverage, synthesisLints, and noDefaultGlobalScan",
1741
+ safetyRules: "array - mutation and completion rules that preserve reasoning lineage",
1742
+ toolMap: "array | undefined - situation-to-tool routing map when requested",
1743
+ examples: "array | undefined - concrete tool-call examples when requested",
1744
+ futureCapabilities: "array | undefined - exemplar, gauntlet, trace-corpus, and native-model-training capabilities when requested",
1745
+ suggestedNextCalls: "array - safe next tool calls for the current situation"
1746
+ }
1747
+ },
1748
+ ownerModule: "reasoning-kernel",
1749
+ ontologyPrimitive: "graph",
1750
+ tier: "showcase"
1751
+ };
1752
+
1699
1753
  // src/tool-contracts.intelligence-evidence.ts
1700
1754
  var DETECT_CONFIRMATION_BIAS = {
1701
1755
  name: "detect_confirmation_bias",
@@ -1850,7 +1904,7 @@ var SEARCH_EVIDENCE = {
1850
1904
  };
1851
1905
  var CREATE_EVIDENCE = {
1852
1906
  name: "create_evidence",
1853
- description: "Commit evidence to the reasoning graph. Like `git commit` \u2014 creates a traceable evidence record with canonical public IDs. Optionally links the evidence to a belief or question in the same operation.",
1907
+ description: "Commit evidence to the reasoning graph. Like `git commit` \u2014 creates a traceable evidence record with canonical public IDs. Optionally links the evidence to a belief or question in the same operation. When evidence bears on beliefs, state whether it supports or contradicts; SL confidence is derived from these evidence relations.",
1854
1908
  parameters: {
1855
1909
  topicId: { type: "string", description: "Topic scope" },
1856
1910
  text: { type: "string", description: "Canonical evidence text" },
@@ -1861,7 +1915,20 @@ var CREATE_EVIDENCE = {
1861
1915
  },
1862
1916
  weight: {
1863
1917
  type: "number",
1864
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
1918
+ description: "Optional support weight: -1.0 (contradicts) to +1.0 (supports). If omitted, evidenceRelation + confidence determine the weight."
1919
+ },
1920
+ evidenceRelation: {
1921
+ type: "string",
1922
+ enum: ["supports", "contradicts"],
1923
+ description: "Canonical relation to targetId/linkedBeliefNodeId. Prefer this over relying on signed weight inference."
1924
+ },
1925
+ confidence: {
1926
+ type: "number",
1927
+ description: "Confidence in the evidence relation, 0.0 to 1.0"
1928
+ },
1929
+ beliefRelations: {
1930
+ type: "array",
1931
+ description: "Optional additional belief relations: [{ beliefId|beliefNodeId|targetId, evidenceRelation|relation, confidence?, weight?, rationale? }]. Use one evidence node with multiple relations when the same fact supports or contradicts several beliefs."
1865
1932
  },
1866
1933
  metadata: {
1867
1934
  type: "object",
@@ -1971,7 +2038,7 @@ var LINK_EVIDENCE = {
1971
2038
  };
1972
2039
  var LINK_EVIDENCE_TO_BELIEF = {
1973
2040
  name: "link_evidence_to_belief",
1974
- description: "Link evidence to a belief with a support weight. Like `git add` \u2014 stages evidence in support of (or against) a belief. The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports).",
2041
+ description: "Link evidence to a belief with a support weight. Like `git add` \u2014 stages evidence in support of (or against) a belief. The weight ranges from -1.0 (strongly contradicts) to +1.0 (strongly supports). This relation appends to the SL confidence ledger; do not hand-write confidence separately.",
1975
2042
  parameters: {
1976
2043
  evidenceId: { type: "string", description: "The evidence node ID" },
1977
2044
  beliefId: { type: "string", description: "The belief node ID" },
@@ -1979,9 +2046,18 @@ var LINK_EVIDENCE_TO_BELIEF = {
1979
2046
  type: "number",
1980
2047
  description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
1981
2048
  },
2049
+ evidenceRelation: {
2050
+ type: "string",
2051
+ enum: ["supports", "contradicts"],
2052
+ description: "Canonical semantic relation. If omitted, the sign of weight is used."
2053
+ },
2054
+ confidence: {
2055
+ type: "number",
2056
+ description: "Confidence in this evidence-to-belief relation, 0.0 to 1.0"
2057
+ },
1982
2058
  rationale: { type: "string", description: "Why this evidence is relevant" }
1983
2059
  },
1984
- required: ["evidenceId", "beliefId", "weight"],
2060
+ required: ["evidenceId", "beliefId"],
1985
2061
  response: {
1986
2062
  description: "The created edge linking evidence to belief",
1987
2063
  fields: {
@@ -2746,10 +2822,34 @@ var COMPILE_CONTEXT = {
2746
2822
  type: "string",
2747
2823
  description: "Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs."
2748
2824
  },
2825
+ campaign: {
2826
+ type: "number",
2827
+ description: "Optional campaign dimension seed. When supplied without topicId, the compiler fans out across all carrier topics for that campaign instead of resolving a single topic."
2828
+ },
2829
+ lane: {
2830
+ type: "string",
2831
+ description: "Optional lane dimension seed. When supplied without topicId, the compiler reads all matching worktrees and their carrier topics."
2832
+ },
2833
+ status: {
2834
+ type: "string",
2835
+ description: "Optional state/status dimension seed for worktrees and graph rows."
2836
+ },
2837
+ principalId: {
2838
+ type: "string",
2839
+ description: "Optional principal seed for work authored, touched, or owned by a human, agent, group, or service principal."
2840
+ },
2841
+ workspaceId: {
2842
+ type: "string",
2843
+ description: "Optional workspace seed used by hosted MCP and SDK clients when compiling tenant-scoped context."
2844
+ },
2749
2845
  budget: {
2750
2846
  type: "number",
2751
2847
  description: "Token budget for prompt injection planning"
2752
2848
  },
2849
+ tokenBudget: {
2850
+ type: "number",
2851
+ description: "Compatibility alias for budget. External MCP clients may send tokenBudget when requesting prompt injection planning."
2852
+ },
2753
2853
  ranking: {
2754
2854
  type: "string",
2755
2855
  description: "Ranking profile for context ordering",
@@ -2785,7 +2885,9 @@ var COMPILE_CONTEXT = {
2785
2885
  recentEvidence: "array \u2014 recent evidence ranked for this query",
2786
2886
  contradictions: "array \u2014 unresolved contradiction records",
2787
2887
  relatedEntities: "array | undefined \u2014 ranked ontological entities in scope",
2788
- contextNarrative: "array \u2014 guidance for prompt assembly",
2888
+ contextNarrative: "array \u2014 ordered synthesis blocks with kind/text, starting with executive_summary and canonical narrative blocks before raw objects",
2889
+ retrievalReceipt: "object \u2014 candidateCounts, coverageWarning, narrativeCoverage, synthesisLints, and suggestedNextActions",
2890
+ narrativeCoverage: "object \u2014 recordsSynthesized, recordsNamed, recordsOmitted, and blocksEmitted for the narrative",
2789
2891
  injectionPolicy: "object \u2014 token-budgeted section selections",
2790
2892
  diagnostics: "object \u2014 scoring and utilization telemetry"
2791
2893
  }
@@ -4656,6 +4758,7 @@ var MCP_TOOL_CONTRACTS = {
4656
4758
  update_worktree_metadata: UPDATE_WORKTREE_METADATA,
4657
4759
  identity_whoami: IDENTITY_WHOAMI,
4658
4760
  resolve_interactive_principal: RESOLVE_INTERACTIVE_PRINCIPAL,
4761
+ lucern_orient: LUCERN_ORIENT,
4659
4762
  compile_context: COMPILE_CONTEXT,
4660
4763
  record_scope_learning: RECORD_SCOPE_LEARNING,
4661
4764
  pipeline_snapshot: PIPELINE_SNAPSHOT,
@@ -4732,6 +4835,12 @@ var internalSystem = {
4732
4835
  mcp: "internal",
4733
4836
  cli: "internal"
4734
4837
  };
4838
+ var internalSdkRestOnly = {
4839
+ sdk: "internal",
4840
+ rest: "internal",
4841
+ mcp: "none",
4842
+ cli: "none"
4843
+ };
4735
4844
  var publicWithInternalMcp = {
4736
4845
  sdk: "public",
4737
4846
  rest: "public",
@@ -4771,6 +4880,7 @@ function entries(names, surfaceClass, surfaceIntent, surfaces, rationale) {
4771
4880
  );
4772
4881
  }
4773
4882
  var MCP_CORE_OPERATION_NAMES = [
4883
+ "lucern_orient",
4774
4884
  "compile_context",
4775
4885
  "identity_whoami",
4776
4886
  "resolve_interactive_principal",
@@ -4780,7 +4890,6 @@ var MCP_CORE_OPERATION_NAMES = [
4780
4890
  "get_belief",
4781
4891
  "list_beliefs",
4782
4892
  "refine_belief",
4783
- "modulate_confidence",
4784
4893
  "fork_belief",
4785
4894
  "archive_belief",
4786
4895
  "search_beliefs",
@@ -5069,6 +5178,13 @@ var LUCERN_OPERATION_MANIFEST = {
5069
5178
  internalSystem,
5070
5179
  "Lucern system/background operation. Available to platform code paths, hidden from public MCP discovery."
5071
5180
  ),
5181
+ modulate_confidence: {
5182
+ name: "modulate_confidence",
5183
+ surfaceClass: "platform_internal",
5184
+ surfaceIntent: "system",
5185
+ surfaces: internalSdkRestOnly,
5186
+ rationale: "Internal SL ledger append primitive. Public callers attach evidence or contradiction relations; confidence is derived algorithmically."
5187
+ },
5072
5188
  ...entries(
5073
5189
  LEGACY_COMPAT_OPERATION_NAMES,
5074
5190
  "legacy_compat",