@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
@@ -1051,7 +1051,7 @@ var FIND_SEMANTIC_ORPHANS = {
1051
1051
  // src/tool-contracts.lifecycle.ts
1052
1052
  var CREATE_BELIEF = {
1053
1053
  name: "create_belief",
1054
- 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.",
1054
+ 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.",
1055
1055
  parameters: {
1056
1056
  canonicalText: {
1057
1057
  type: "string",
@@ -1137,7 +1137,7 @@ var REFINE_BELIEF = {
1137
1137
  };
1138
1138
  var MODULATE_CONFIDENCE = {
1139
1139
  name: "modulate_confidence",
1140
- 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.",
1140
+ 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.",
1141
1141
  parameters: {
1142
1142
  nodeId: { type: "string", description: "The belief to score" },
1143
1143
  belief: {
@@ -2704,6 +2704,60 @@ var REMOVE_LENS_FROM_TOPIC = {
2704
2704
  tier: "workhorse"
2705
2705
  };
2706
2706
 
2707
+ // src/tool-contracts.context-orientation.ts
2708
+ var LUCERN_ORIENT = {
2709
+ name: "lucern_orient",
2710
+ 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.",
2711
+ parameters: {
2712
+ audience: {
2713
+ type: "string",
2714
+ description: "Audience for the primer: agent, human, operator, or developer.",
2715
+ enum: ["agent", "human", "operator", "developer"]
2716
+ },
2717
+ depth: {
2718
+ type: "string",
2719
+ description: "Orientation depth: quick, standard, or deep.",
2720
+ enum: ["quick", "standard", "deep"]
2721
+ },
2722
+ situation: {
2723
+ type: "string",
2724
+ description: "Optional task or query context used to tailor suggested next calls."
2725
+ },
2726
+ includeExamples: {
2727
+ type: "boolean",
2728
+ description: "Whether to include concrete tool-call examples."
2729
+ },
2730
+ includeToolMap: {
2731
+ type: "boolean",
2732
+ description: "Whether to include situation-to-tool routing guidance."
2733
+ },
2734
+ includeFuture: {
2735
+ type: "boolean",
2736
+ description: "Whether to include future exemplar, gauntlet, and training-data capabilities."
2737
+ }
2738
+ },
2739
+ required: [],
2740
+ response: {
2741
+ description: "Canonical operator primer for Lucern's git-shaped reasoning substrate.",
2742
+ fields: {
2743
+ schemaVersion: "string - lucern_orientation.v1",
2744
+ canonicalMentalModel: "object - concise model of Lucern as git-shaped reasoning state",
2745
+ workflow: "array - recommended branch -> investigate -> prove gate -> merge workflow",
2746
+ grammarMap: "array - primitive-to-git-analogy map for topics, campaigns, worktrees, beliefs, questions, evidence, edges, contradictions, and gates",
2747
+ firstMoves: "array - recommended first tools for a cold-start agent",
2748
+ receiptRules: "array - how to interpret candidateCounts, broadening, coverageWarning, narrativeCoverage, synthesisLints, and noDefaultGlobalScan",
2749
+ safetyRules: "array - mutation and completion rules that preserve reasoning lineage",
2750
+ toolMap: "array | undefined - situation-to-tool routing map when requested",
2751
+ examples: "array | undefined - concrete tool-call examples when requested",
2752
+ futureCapabilities: "array | undefined - exemplar, gauntlet, trace-corpus, and native-model-training capabilities when requested",
2753
+ suggestedNextCalls: "array - safe next tool calls for the current situation"
2754
+ }
2755
+ },
2756
+ ownerModule: "reasoning-kernel",
2757
+ ontologyPrimitive: "graph",
2758
+ tier: "showcase"
2759
+ };
2760
+
2707
2761
  // src/tool-contracts.intelligence-evidence.ts
2708
2762
  var DETECT_CONFIRMATION_BIAS = {
2709
2763
  name: "detect_confirmation_bias",
@@ -2858,7 +2912,7 @@ var SEARCH_EVIDENCE = {
2858
2912
  };
2859
2913
  var CREATE_EVIDENCE = {
2860
2914
  name: "create_evidence",
2861
- 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.",
2915
+ 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.",
2862
2916
  parameters: {
2863
2917
  topicId: { type: "string", description: "Topic scope" },
2864
2918
  text: { type: "string", description: "Canonical evidence text" },
@@ -2869,7 +2923,20 @@ var CREATE_EVIDENCE = {
2869
2923
  },
2870
2924
  weight: {
2871
2925
  type: "number",
2872
- description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
2926
+ description: "Optional support weight: -1.0 (contradicts) to +1.0 (supports). If omitted, evidenceRelation + confidence determine the weight."
2927
+ },
2928
+ evidenceRelation: {
2929
+ type: "string",
2930
+ enum: ["supports", "contradicts"],
2931
+ description: "Canonical relation to targetId/linkedBeliefNodeId. Prefer this over relying on signed weight inference."
2932
+ },
2933
+ confidence: {
2934
+ type: "number",
2935
+ description: "Confidence in the evidence relation, 0.0 to 1.0"
2936
+ },
2937
+ beliefRelations: {
2938
+ type: "array",
2939
+ 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."
2873
2940
  },
2874
2941
  metadata: {
2875
2942
  type: "object",
@@ -2979,7 +3046,7 @@ var LINK_EVIDENCE = {
2979
3046
  };
2980
3047
  var LINK_EVIDENCE_TO_BELIEF = {
2981
3048
  name: "link_evidence_to_belief",
2982
- 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).",
3049
+ 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.",
2983
3050
  parameters: {
2984
3051
  evidenceId: { type: "string", description: "The evidence node ID" },
2985
3052
  beliefId: { type: "string", description: "The belief node ID" },
@@ -2987,9 +3054,18 @@ var LINK_EVIDENCE_TO_BELIEF = {
2987
3054
  type: "number",
2988
3055
  description: "Support weight: -1.0 (contradicts) to +1.0 (supports)"
2989
3056
  },
3057
+ evidenceRelation: {
3058
+ type: "string",
3059
+ enum: ["supports", "contradicts"],
3060
+ description: "Canonical semantic relation. If omitted, the sign of weight is used."
3061
+ },
3062
+ confidence: {
3063
+ type: "number",
3064
+ description: "Confidence in this evidence-to-belief relation, 0.0 to 1.0"
3065
+ },
2990
3066
  rationale: { type: "string", description: "Why this evidence is relevant" }
2991
3067
  },
2992
- required: ["evidenceId", "beliefId", "weight"],
3068
+ required: ["evidenceId", "beliefId"],
2993
3069
  response: {
2994
3070
  description: "The created edge linking evidence to belief",
2995
3071
  fields: {
@@ -3754,10 +3830,34 @@ var COMPILE_CONTEXT = {
3754
3830
  type: "string",
3755
3831
  description: "Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs."
3756
3832
  },
3833
+ campaign: {
3834
+ type: "number",
3835
+ 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."
3836
+ },
3837
+ lane: {
3838
+ type: "string",
3839
+ description: "Optional lane dimension seed. When supplied without topicId, the compiler reads all matching worktrees and their carrier topics."
3840
+ },
3841
+ status: {
3842
+ type: "string",
3843
+ description: "Optional state/status dimension seed for worktrees and graph rows."
3844
+ },
3845
+ principalId: {
3846
+ type: "string",
3847
+ description: "Optional principal seed for work authored, touched, or owned by a human, agent, group, or service principal."
3848
+ },
3849
+ workspaceId: {
3850
+ type: "string",
3851
+ description: "Optional workspace seed used by hosted MCP and SDK clients when compiling tenant-scoped context."
3852
+ },
3757
3853
  budget: {
3758
3854
  type: "number",
3759
3855
  description: "Token budget for prompt injection planning"
3760
3856
  },
3857
+ tokenBudget: {
3858
+ type: "number",
3859
+ description: "Compatibility alias for budget. External MCP clients may send tokenBudget when requesting prompt injection planning."
3860
+ },
3761
3861
  ranking: {
3762
3862
  type: "string",
3763
3863
  description: "Ranking profile for context ordering",
@@ -3793,7 +3893,9 @@ var COMPILE_CONTEXT = {
3793
3893
  recentEvidence: "array \u2014 recent evidence ranked for this query",
3794
3894
  contradictions: "array \u2014 unresolved contradiction records",
3795
3895
  relatedEntities: "array | undefined \u2014 ranked ontological entities in scope",
3796
- contextNarrative: "array \u2014 guidance for prompt assembly",
3896
+ contextNarrative: "array \u2014 ordered synthesis blocks with kind/text, starting with executive_summary and canonical narrative blocks before raw objects",
3897
+ retrievalReceipt: "object \u2014 candidateCounts, coverageWarning, narrativeCoverage, synthesisLints, and suggestedNextActions",
3898
+ narrativeCoverage: "object \u2014 recordsSynthesized, recordsNamed, recordsOmitted, and blocksEmitted for the narrative",
3797
3899
  injectionPolicy: "object \u2014 token-budgeted section selections",
3798
3900
  diagnostics: "object \u2014 scoring and utilization telemetry"
3799
3901
  }
@@ -5664,6 +5766,7 @@ var MCP_TOOL_CONTRACTS = {
5664
5766
  update_worktree_metadata: UPDATE_WORKTREE_METADATA,
5665
5767
  identity_whoami: IDENTITY_WHOAMI,
5666
5768
  resolve_interactive_principal: RESOLVE_INTERACTIVE_PRINCIPAL,
5769
+ lucern_orient: LUCERN_ORIENT,
5667
5770
  compile_context: COMPILE_CONTEXT,
5668
5771
  record_scope_learning: RECORD_SCOPE_LEARNING,
5669
5772
  pipeline_snapshot: PIPELINE_SNAPSHOT,