@lucern/sdk 0.3.0-alpha.0 → 0.3.0-alpha.10

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 (221) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/README.md +84 -25
  3. package/dist/adminClient.d.ts +10 -8
  4. package/dist/adminClient.js +242 -39
  5. package/dist/adminClient.js.map +1 -1
  6. package/dist/answersClient.d.ts +2 -0
  7. package/dist/answersClient.js +221 -11
  8. package/dist/answersClient.js.map +1 -1
  9. package/dist/audience/index.d.ts +2 -1
  10. package/dist/audience/index.js +1 -3
  11. package/dist/audience/index.js.map +1 -1
  12. package/dist/audiencesClient.d.ts +18 -16
  13. package/dist/audiencesClient.js +297 -90
  14. package/dist/audiencesClient.js.map +1 -1
  15. package/dist/auditClient.d.ts +2 -0
  16. package/dist/auditClient.js +227 -15
  17. package/dist/auditClient.js.map +1 -1
  18. package/dist/authContext.d.ts +56 -0
  19. package/dist/authContext.js +170 -0
  20. package/dist/authContext.js.map +1 -0
  21. package/dist/authDeviceClient.d.ts +49 -0
  22. package/dist/authDeviceClient.js +121 -0
  23. package/dist/authDeviceClient.js.map +1 -0
  24. package/dist/beliefs/index.d.ts +31 -11
  25. package/dist/beliefs/index.js +3347 -1109
  26. package/dist/beliefs/index.js.map +1 -1
  27. package/dist/beliefsClient.d.ts +18 -31
  28. package/dist/beliefsClient.js +264 -97
  29. package/dist/beliefsClient.js.map +1 -1
  30. package/dist/boundaryClientSurface.d.ts +20 -0
  31. package/dist/boundaryClientSurface.js +73 -0
  32. package/dist/boundaryClientSurface.js.map +1 -0
  33. package/dist/client.d.ts +2969 -27
  34. package/dist/client.js +3347 -1109
  35. package/dist/client.js.map +1 -1
  36. package/dist/clientHelpers.d.ts +48 -0
  37. package/dist/clientHelpers.js +137 -0
  38. package/dist/clientHelpers.js.map +1 -0
  39. package/dist/contextClient.d.ts +6 -3
  40. package/dist/contextClient.js +252 -30
  41. package/dist/contextClient.js.map +1 -1
  42. package/dist/contextFacade.js +25 -16
  43. package/dist/contextFacade.js.map +1 -1
  44. package/dist/contextPackCompiler.js +19 -30
  45. package/dist/contextPackCompiler.js.map +1 -1
  46. package/dist/contextPackPolicy.js +7 -17
  47. package/dist/contextPackPolicy.js.map +1 -1
  48. package/dist/contextTypes.d.ts +2 -0
  49. package/dist/contracts/api-enums.contract.d.ts +1 -1
  50. package/dist/contracts/api-enums.contract.js.map +1 -1
  51. package/dist/contracts/index.d.ts +1 -0
  52. package/dist/contracts/index.js +109 -5
  53. package/dist/contracts/index.js.map +1 -1
  54. package/dist/contracts/lens-filter.contract.js +4 -3
  55. package/dist/contracts/lens-filter.contract.js.map +1 -1
  56. package/dist/contracts/lens-workflow.contract.js +4 -3
  57. package/dist/contracts/lens-workflow.contract.js.map +1 -1
  58. package/dist/contracts/lensFilter.js +4 -3
  59. package/dist/contracts/lensFilter.js.map +1 -1
  60. package/dist/contracts/lensWorkflow.js +4 -3
  61. package/dist/contracts/lensWorkflow.js.map +1 -1
  62. package/dist/contracts/mcpTools.d.ts +46 -1
  63. package/dist/contracts/mcpTools.js +102 -0
  64. package/dist/contracts/mcpTools.js.map +1 -1
  65. package/dist/contracts/workflow-runtime.contract.js +1 -1
  66. package/dist/contracts/workflow-runtime.contract.js.map +1 -1
  67. package/dist/contracts/workflowRuntime.js +1 -1
  68. package/dist/contracts/workflowRuntime.js.map +1 -1
  69. package/dist/contradictions/index.d.ts +24 -4
  70. package/dist/contradictions/index.js +3347 -1109
  71. package/dist/contradictions/index.js.map +1 -1
  72. package/dist/coreClient.d.ts +11 -1
  73. package/dist/coreClient.js +222 -14
  74. package/dist/coreClient.js.map +1 -1
  75. package/dist/decisions/index.d.ts +34 -14
  76. package/dist/decisions/index.js +3347 -1109
  77. package/dist/decisions/index.js.map +1 -1
  78. package/dist/decisionsClient.d.ts +6 -12
  79. package/dist/decisionsClient.js +235 -37
  80. package/dist/decisionsClient.js.map +1 -1
  81. package/dist/edges/index.d.ts +47 -87
  82. package/dist/edges/index.js +3347 -1109
  83. package/dist/edges/index.js.map +1 -1
  84. package/dist/embeddingsClient.d.ts +106 -0
  85. package/dist/embeddingsClient.js +731 -0
  86. package/dist/embeddingsClient.js.map +1 -0
  87. package/dist/eventingClient.d.ts +96 -0
  88. package/dist/eventingClient.js +728 -0
  89. package/dist/eventingClient.js.map +1 -0
  90. package/dist/events.js +6 -3
  91. package/dist/events.js.map +1 -1
  92. package/dist/eventsCore.d.ts +3 -1
  93. package/dist/eventsCore.js +222 -14
  94. package/dist/eventsCore.js.map +1 -1
  95. package/dist/evidence/index.d.ts +25 -4
  96. package/dist/evidence/index.js +3347 -1109
  97. package/dist/evidence/index.js.map +1 -1
  98. package/dist/evidenceClient.d.ts +2 -0
  99. package/dist/evidenceClient.js +222 -14
  100. package/dist/evidenceClient.js.map +1 -1
  101. package/dist/facade/context.d.ts +2 -1
  102. package/dist/facade/context.js +25 -16
  103. package/dist/facade/context.js.map +1 -1
  104. package/dist/functionSurface.d.ts +143 -0
  105. package/dist/functionSurface.js +1204 -0
  106. package/dist/functionSurface.js.map +1 -0
  107. package/dist/functionSurfaceClient.d.ts +8 -0
  108. package/dist/functionSurfaceClient.js +1204 -0
  109. package/dist/functionSurfaceClient.js.map +1 -0
  110. package/dist/gatewayFacades.d.ts +81 -52
  111. package/dist/gatewayFacades.js +483 -169
  112. package/dist/gatewayFacades.js.map +1 -1
  113. package/dist/graphAnalysisClient.d.ts +192 -0
  114. package/dist/graphAnalysisClient.js +799 -0
  115. package/dist/graphAnalysisClient.js.map +1 -0
  116. package/dist/graphClient.d.ts +7 -13
  117. package/dist/graphClient.js +244 -45
  118. package/dist/graphClient.js.map +1 -1
  119. package/dist/graphIntel.d.ts +3 -0
  120. package/dist/graphIntel.js +3 -0
  121. package/dist/graphIntel.js.map +1 -0
  122. package/dist/graphIntelligence.d.ts +2 -0
  123. package/dist/graphIntelligence.js +47 -0
  124. package/dist/graphIntelligence.js.map +1 -0
  125. package/dist/graphRecommendationsClient.d.ts +56 -0
  126. package/dist/graphRecommendationsClient.js +664 -0
  127. package/dist/graphRecommendationsClient.js.map +1 -0
  128. package/dist/graphStateClassifierClient.d.ts +73 -0
  129. package/dist/graphStateClassifierClient.js +716 -0
  130. package/dist/graphStateClassifierClient.js.map +1 -0
  131. package/dist/harnessClient.d.ts +15 -24
  132. package/dist/harnessClient.js +235 -42
  133. package/dist/harnessClient.js.map +1 -1
  134. package/dist/identityClient.d.ts +97 -11
  135. package/dist/identityClient.js +409 -33
  136. package/dist/identityClient.js.map +1 -1
  137. package/dist/index.d.ts +29 -6
  138. package/dist/index.js +3936 -1155
  139. package/dist/index.js.map +1 -1
  140. package/dist/infisicalRuntime.d.ts +42 -0
  141. package/dist/infisicalRuntime.js +314 -0
  142. package/dist/infisicalRuntime.js.map +1 -0
  143. package/dist/jobsClient.d.ts +98 -0
  144. package/dist/jobsClient.js +726 -0
  145. package/dist/jobsClient.js.map +1 -0
  146. package/dist/learningClient.d.ts +8 -6
  147. package/dist/learningClient.js +252 -44
  148. package/dist/learningClient.js.map +1 -1
  149. package/dist/lenses/index.d.ts +82 -42
  150. package/dist/lenses/index.js +3347 -1109
  151. package/dist/lenses/index.js.map +1 -1
  152. package/dist/mcpClient.d.ts +28 -0
  153. package/dist/mcpClient.js +668 -0
  154. package/dist/mcpClient.js.map +1 -0
  155. package/dist/modelRuntimeClient.d.ts +72 -0
  156. package/dist/modelRuntimeClient.js +704 -0
  157. package/dist/modelRuntimeClient.js.map +1 -0
  158. package/dist/nodes/index.d.ts +63 -21
  159. package/dist/nodes/index.js +3347 -1109
  160. package/dist/nodes/index.js.map +1 -1
  161. package/dist/ontologies/index.d.ts +53 -32
  162. package/dist/ontologies/index.js +3347 -1109
  163. package/dist/ontologies/index.js.map +1 -1
  164. package/dist/ontologyClient.d.ts +19 -25
  165. package/dist/ontologyClient.js +258 -40
  166. package/dist/ontologyClient.js.map +1 -1
  167. package/dist/ontologyLinksClient.d.ts +71 -0
  168. package/dist/ontologyLinksClient.js +697 -0
  169. package/dist/ontologyLinksClient.js.map +1 -0
  170. package/dist/opinion.d.ts +2 -2
  171. package/dist/opinion.js +4 -4
  172. package/dist/opinion.js.map +1 -1
  173. package/dist/orgGraphSearchClient.d.ts +85 -0
  174. package/dist/orgGraphSearchClient.js +672 -0
  175. package/dist/orgGraphSearchClient.js.map +1 -0
  176. package/dist/packsClient.d.ts +11 -23
  177. package/dist/packsClient.js +234 -46
  178. package/dist/packsClient.js.map +1 -1
  179. package/dist/policyClient.d.ts +13 -10
  180. package/dist/policyClient.js +243 -25
  181. package/dist/policyClient.js.map +1 -1
  182. package/dist/questions/index.d.ts +24 -4
  183. package/dist/questions/index.js +3347 -1109
  184. package/dist/questions/index.js.map +1 -1
  185. package/dist/realtime/index.d.ts +1 -1
  186. package/dist/reportsClient.d.ts +9 -7
  187. package/dist/reportsClient.js +281 -53
  188. package/dist/reportsClient.js.map +1 -1
  189. package/dist/schemaClient.d.ts +5 -3
  190. package/dist/schemaClient.js +235 -29
  191. package/dist/schemaClient.js.map +1 -1
  192. package/dist/sdkSurface.d.ts +8 -3
  193. package/dist/sdkSurface.js +10 -6
  194. package/dist/sdkSurface.js.map +1 -1
  195. package/dist/sourcesClient.d.ts +2 -0
  196. package/dist/sourcesClient.js +222 -14
  197. package/dist/sourcesClient.js.map +1 -1
  198. package/dist/telemetryClient.d.ts +94 -0
  199. package/dist/telemetryClient.js +741 -0
  200. package/dist/telemetryClient.js.map +1 -0
  201. package/dist/toolRegistryClient.d.ts +115 -0
  202. package/dist/toolRegistryClient.js +767 -0
  203. package/dist/toolRegistryClient.js.map +1 -0
  204. package/dist/topics/index.d.ts +35 -9
  205. package/dist/topics/index.js +3349 -1109
  206. package/dist/topics/index.js.map +1 -1
  207. package/dist/topicsClient.d.ts +4 -0
  208. package/dist/topicsClient.js +237 -24
  209. package/dist/topicsClient.js.map +1 -1
  210. package/dist/types.d.ts +12 -7
  211. package/dist/version.d.ts +1 -1
  212. package/dist/version.js +1 -1
  213. package/dist/version.js.map +1 -1
  214. package/dist/workflowClient.d.ts +76 -45
  215. package/dist/workflowClient.js +262 -65
  216. package/dist/workflowClient.js.map +1 -1
  217. package/dist/worktrees/index.d.ts +78 -39
  218. package/dist/worktrees/index.js +3347 -1109
  219. package/dist/worktrees/index.js.map +1 -1
  220. package/package.json +13 -3
  221. package/dist/client-DAuKnDlx.d.ts +0 -2547
package/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@ All notable changes to `@lucern/sdk` will be documented in this file.
5
5
  ## [Unreleased]
6
6
  - No unreleased changes yet.
7
7
 
8
+ ## [0.3.0-alpha.7] - 2026-05-03
9
+ - Rebuild the coherent Lucern package line after Campaign 1 SDK hardening fixes.
10
+
8
11
  ## [0.2.0-alpha.5] - 2026-04-18
9
12
  - Refresh publish from current stackos source under EK-16 T4.
10
13
  - Version-numbering note: 0.2.0-alpha.2 through 0.2.0-alpha.5 were published from earlier stackos source on 2026-04-12 by pete_c. This release (alpha.5) is the first to ship the current April 18 source — 56 commits of accumulated changes from the code-separation track.
package/README.md CHANGED
@@ -10,6 +10,31 @@ Lucern gives your agents a reasoning graph that accumulates understanding across
10
10
  npm install @lucern/sdk
11
11
  ```
12
12
 
13
+ ## Install Model
14
+
15
+ `@lucern/sdk` is the primary TypeScript app dependency. Installing it also
16
+ installs its internal runtime dependencies, including Lucern contracts and
17
+ reasoning-kernel helpers, but a tenant should still list any `@lucern/*`
18
+ package that its own code or scripts import or execute.
19
+
20
+ Common direct installs:
21
+
22
+ | Need | Install |
23
+ | --- | --- |
24
+ | Programmatic Lucern API calls | `@lucern/sdk` |
25
+ | Tool access checks | `@lucern/access-control` |
26
+ | React hooks/components | `@lucern/react @lucern/sdk` |
27
+ | Convex component binding | `@lucern/identity @lucern/reasoning-kernel` |
28
+ | Bootstrap, auth, doctor, and operator commands | `@lucern/cli` |
29
+ | Agent-facing MCP server/runtime | `@lucern/mcp` |
30
+ | Full design-partner/package-suite pin | all packages from `TENANT_CLIENT_INSTALLABLE_PACKAGES` in `@lucern/contracts` |
31
+
32
+ The difference matters: `@lucern/cli` is a direct install because it provides
33
+ the `lucern` binary, but tenant app source should not import it. The Convex
34
+ component packages are direct installs for `convex.config.ts`, while application
35
+ code should stay on `@lucern/sdk`, `@lucern/react`, `@lucern/mcp`,
36
+ `@lucern/access-control`, `@lucern/contracts`, and `@lucern/types`.
37
+
13
38
  ## Canonical Interface
14
39
 
15
40
  `@lucern/sdk` is the canonical public interface for Lucern.
@@ -27,6 +52,7 @@ IA-7 closes the remaining SDK surface gaps needed for SDK-first clients:
27
52
  ```typescript
28
53
  import {
29
54
  createLucernClient,
55
+ opinionFromDogmatic,
30
56
  type PlatformBeliefRecord,
31
57
  type SdkPrincipalContext,
32
58
  type WorkflowWorktreeRecord,
@@ -87,45 +113,54 @@ const topicId = securityTopic.data.topicId;
87
113
  // A fact — verified and anchored
88
114
  const sqlFact = await lucern.beliefs.create({
89
115
  topicId,
90
- baseRate: 0.5,
91
116
  canonicalText: "Parameterized queries prevent SQL injection in all major database drivers",
92
117
  beliefType: "fact",
93
118
  });
119
+ const sqlFactEvidence = await lucern.evidence.create({
120
+ topicId,
121
+ text: "OWASP SQL Injection Prevention guidance identifies parameterized queries as the primary defense.",
122
+ sourceUrl: "https://owasp.org/www-community/attacks/SQL_Injection",
123
+ targetId: sqlFact.data.nodeId,
124
+ weight: 1,
125
+ });
94
126
  await lucern.beliefs.modulateConfidence(sqlFact.data.nodeId, {
95
- confidence: 0.95,
127
+ opinion: opinionFromDogmatic(0.95, 0.5),
96
128
  trigger: "evidence_added",
129
+ triggeringEvidenceId: sqlFactEvidence.data.nodeId,
97
130
  rationale: "OWASP verified, industry standard for 20+ years",
98
131
  });
99
132
 
100
133
  // A belief — confident from observation
101
134
  const patternBelief = await lucern.beliefs.create({
102
135
  topicId,
103
- baseRate: 0.5,
104
136
  canonicalText: "Most security vulnerabilities in our codebase come from unvalidated user input at API boundaries, not from cryptographic weaknesses",
105
137
  });
138
+ const patternEvidence = await lucern.evidence.create({
139
+ topicId,
140
+ text: "Last 6 months of security audits found 14 input validation issues and 1 cryptographic issue.",
141
+ sourceUrl: "audit://security/findings-last-6-months",
142
+ targetId: patternBelief.data.nodeId,
143
+ weight: 0.82,
144
+ });
106
145
  await lucern.beliefs.modulateConfidence(patternBelief.data.nodeId, {
107
- confidence: 0.82,
146
+ opinion: opinionFromDogmatic(0.82, 0.5),
108
147
  trigger: "evidence_added",
148
+ triggeringEvidenceId: patternEvidence.data.nodeId,
109
149
  rationale: "Last 6 months of security audits: 14 input validation issues, 1 crypto issue",
110
150
  });
111
151
 
112
152
  // A hypothesis — under active testing
113
153
  const hypothesis = await lucern.beliefs.create({
114
154
  topicId,
115
- baseRate: 0.5,
116
155
  canonicalText: "Automated static analysis catches fewer than 30% of the input validation vulnerabilities that human reviewers find",
117
156
  beliefType: "hypothesis",
118
157
  });
119
- await lucern.beliefs.modulateConfidence(hypothesis.data.nodeId, {
120
- confidence: 0.6,
121
- trigger: "manual",
122
- rationale: "Anecdotal — need to run a proper comparison study",
123
- });
158
+ // This remains at the default vacuous prior until evidence or an answered
159
+ // question records what the comparison study found.
124
160
 
125
161
  // An assumption — untested but used as a basis for decisions
126
162
  const assumption = await lucern.beliefs.create({
127
163
  topicId,
128
- baseRate: 0.5,
129
164
  canonicalText: "Our CI pipeline runs all static analysis rules on every PR",
130
165
  beliefType: "assumption",
131
166
  });
@@ -202,7 +237,7 @@ Your agent processes the results and commits evidence to the graph.
202
237
 
203
238
  ```typescript
204
239
  // Static analysis results
205
- await lucern.evidence.create({
240
+ const staticEvidence = await lucern.evidence.create({
206
241
  topicId,
207
242
  text: "Semgrep + CodeQL found 23 issues across 50 PRs. 18 were true positives. Categories: 12 input validation, 4 auth bypass patterns, 2 information disclosure.",
208
243
  sourceUrl: "ci://semgrep-run/batch-50pr-comparison",
@@ -211,7 +246,7 @@ await lucern.evidence.create({
211
246
  });
212
247
 
213
248
  // Human review results
214
- await lucern.evidence.create({
249
+ const humanEvidence = await lucern.evidence.create({
215
250
  topicId,
216
251
  text: "Two senior engineers found 41 issues across the same 50 PRs (34 unique after dedup). Categories: 22 input validation, 7 business logic flaws, 3 auth, 2 race conditions.",
217
252
  sourceUrl: "review://manual-audit/batch-50pr",
@@ -227,7 +262,7 @@ const comparisonQuestion = await lucern.questions.create({
227
262
  linkedBeliefId: hypothesis.data.nodeId,
228
263
  });
229
264
 
230
- await lucern.questions.answer(comparisonQuestion.data.questionId, {
265
+ const comparisonAnswer = await lucern.questions.answer(comparisonQuestion.data.questionId, {
231
266
  text: "Static analysis caught 18 of 34 unique issues (53%). However, it missed all 7 business logic flaws and both race conditions — categories where it found 0%.",
232
267
  confidence: "strong",
233
268
  evidenceIds: [staticEvidence.data.nodeId, humanEvidence.data.nodeId],
@@ -241,8 +276,9 @@ The original hypothesis said "less than 30%." The data shows 53% — but the sto
241
276
  ```typescript
242
277
  // Drop confidence on the original (it was too pessimistic about overall catch rate)
243
278
  await lucern.beliefs.modulateConfidence(hypothesis.data.nodeId, {
244
- confidence: 0.2,
279
+ opinion: opinionFromDogmatic(0.2, 0.5),
245
280
  trigger: "evidence_added",
281
+ triggeringEvidenceId: humanEvidence.data.nodeId,
246
282
  rationale: "Static analysis catches 53% overall, not <30%. But the category breakdown reveals something more important.",
247
283
  });
248
284
 
@@ -253,22 +289,24 @@ const evolved = await lucern.beliefs.fork(hypothesis.data.nodeId, {
253
289
  });
254
290
 
255
291
  await lucern.beliefs.modulateConfidence(evolved.data.nodeId, {
256
- confidence: 0.88,
292
+ opinion: opinionFromDogmatic(0.88, 0.5),
257
293
  trigger: "evidence_added",
294
+ triggeringEvidenceId: humanEvidence.data.nodeId,
295
+ triggeringAnswerId: comparisonAnswer.data.answerId,
258
296
  rationale: "Direct comparison data: 0/7 business logic flaws caught, 0/2 race conditions caught, while input validation catch rate was 12/22 (55%)",
259
297
  });
260
298
 
261
299
  // This creates a new actionable belief
262
300
  const actionable = await lucern.beliefs.create({
263
301
  topicId,
264
- baseRate: 0.5,
265
302
  canonicalText: "Human code review should focus on business logic and concurrency — the categories where static analysis provides zero coverage",
266
303
  beliefType: "belief",
267
304
  });
268
305
 
269
306
  await lucern.beliefs.modulateConfidence(actionable.data.nodeId, {
270
- confidence: 0.85,
307
+ opinion: opinionFromDogmatic(0.85, 0.5),
271
308
  trigger: "worktree_outcome",
309
+ triggeringWorktreeId: investigation.data.worktreeId,
272
310
  rationale: "Direct implication of the comparison study findings",
273
311
  });
274
312
 
@@ -288,7 +326,7 @@ await lucern.graph.createEdge({
288
326
  Before your agent starts its next session, it reads the graph:
289
327
 
290
328
  ```typescript
291
- const context = await lucern.context.compile(topicId, {
329
+ const context = await lucern.context.compile({
292
330
  query: "code review strategy and static analysis coverage",
293
331
  ranking: "weighted_v1",
294
332
  tokenBudget: 2000,
@@ -350,6 +388,28 @@ lucern.identity // API keys and sessions
350
388
 
351
389
  The graph doesn't just store knowledge — it analyzes itself.
352
390
 
391
+ ### Query Suite
392
+
393
+ ```typescript
394
+ // Discover the prompt-backed Graph Intelligence recipes tenants can expose in
395
+ // their own UI or model workflows.
396
+ const catalog = await lucern.graphAnalysis.listGraphIntelligenceQueries();
397
+
398
+ // Run a named recipe. Lucern returns the resolved prompt, deterministic graph
399
+ // analysis bundle, sampled graph context, and public tool plan for LLM synthesis.
400
+ const preMortem = await lucern.graphAnalysis.runGraphIntelligenceQuery({
401
+ topicId,
402
+ queryId: "pre-mortem",
403
+ limit: 25,
404
+ });
405
+
406
+ await modelMachine.run({
407
+ prompt: preMortem.data.prompt,
408
+ context: preMortem.data.analysis,
409
+ tools: preMortem.data.toolPlan,
410
+ });
411
+ ```
412
+
353
413
  ### Structural Analysis
354
414
 
355
415
  ```typescript
@@ -432,7 +492,7 @@ traversal.data.nodes.forEach(node => {
432
492
  ### Inject Reasoning Context Into Any LLM Call
433
493
 
434
494
  ```typescript
435
- const context = await lucern.context.compile(topicId, {
495
+ const context = await lucern.context.compile({
436
496
  query: "security review priorities",
437
497
  ranking: "weighted_v1",
438
498
  tokenBudget: 3000,
@@ -543,7 +603,7 @@ architectural decisions, check the reasoning graph:
543
603
 
544
604
  - Read current beliefs: `lucern.beliefs.list({ topicId: "..." })`
545
605
  - Check for contradictions: `lucern.contradictions.list({ topicId: "..." })`
546
- - Compile context before analysis: `lucern.context.compile(topicId, { query: "..." })`
606
+ - Compile context before analysis: `lucern.context.compile({ query: "..." })`
547
607
 
548
608
  After making decisions, write them back:
549
609
  - Create beliefs for architectural decisions
@@ -574,7 +634,7 @@ contradictions, or knowledge state.
574
634
  Compile the current context to understand what the graph knows:
575
635
 
576
636
  \`\`\`typescript
577
- const context = await lucern.context.compile(topicId, {
637
+ const context = await lucern.context.compile({
578
638
  query: "<what you're working on>",
579
639
  tokenBudget: 2000,
580
640
  });
@@ -591,7 +651,6 @@ Record what you learned:
591
651
  // Create a belief for decisions made
592
652
  await lucern.beliefs.create({
593
653
  topicId,
594
- baseRate: 0.5,
595
654
  canonicalText: "<what you now believe to be true>",
596
655
  });
597
656
 
@@ -706,8 +765,8 @@ history.data.forEach(entry => {
706
765
  });
707
766
 
708
767
  // Example output:
709
- // 2026-04-10T14:00:00Z null -> 0.60 [manual] Anecdotal observation
710
- // 2026-04-11T09:30:00Z 0.60 -> 0.75 [evidence_added] Semgrep data supports
768
+ // 2026-04-10T14:00:00Z null -> 0.50 [initial] Vacuous neutral prior
769
+ // 2026-04-11T09:30:00Z 0.50 -> 0.75 [evidence_added] Semgrep data supports
711
770
  // 2026-04-11T16:00:00Z 0.75 -> 0.20 [evidence_added] Comparison study contradicted
712
771
  ```
713
772
 
@@ -2,6 +2,8 @@ import { GatewayClientConfig, PlatformGatewaySuccess, GatewayScope } from './cor
2
2
  export { LucernApiError } from './coreClient.js';
3
3
  import { ListResult, JsonObject } from './types.js';
4
4
  import { ControlObjectOwnershipContract } from './controlObjectOwnership.js';
5
+ import './authContext.js';
6
+ import './contracts/auth-session.contract.js';
5
7
  import './contracts/workflow-runtime.contract.js';
6
8
  import './contracts/lens-workflow.contract.js';
7
9
  import './contracts/lens-filter.contract.js';
@@ -151,11 +153,11 @@ declare function createAdminClient(config?: AdminClientConfig): {
151
153
  /**
152
154
  * Get the control-object ownership contract.
153
155
  */
154
- getControlObjectOwnership(): Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
156
+ getControlObjectOwnership: () => Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
155
157
  /**
156
158
  * @deprecated Use getControlObjectOwnership.
157
159
  */
158
- getControlObjectOwnershipContract(): Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
160
+ getControlObjectOwnershipContract: () => Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
159
161
  /**
160
162
  * List workspaces for the current admin scope.
161
163
  */
@@ -188,33 +190,33 @@ declare function createAdminClient(config?: AdminClientConfig): {
188
190
  /**
189
191
  * Create a membership.
190
192
  */
191
- createMembership(input: GatewayScope & {
193
+ createMembership: (input: GatewayScope & {
192
194
  membershipId?: string;
193
195
  principalId: string;
194
196
  role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
195
197
  status?: "active" | "invited" | "revoked" | "expired";
196
198
  source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
197
- }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
199
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
198
200
  /**
199
201
  * Update a membership.
200
202
  */
201
- updateMembership(input: GatewayScope & {
203
+ updateMembership: (input: GatewayScope & {
202
204
  membershipId?: string;
203
205
  principalId: string;
204
206
  role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
205
207
  status?: "active" | "invited" | "revoked" | "expired";
206
208
  source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
207
- }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
209
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
208
210
  /**
209
211
  * @deprecated Use createMembership or updateMembership.
210
212
  */
211
- upsertMembership(input: GatewayScope & {
213
+ upsertMembership: (input: GatewayScope & {
212
214
  membershipId?: string;
213
215
  principalId: string;
214
216
  role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
215
217
  status?: "active" | "invited" | "revoked" | "expired";
216
218
  source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
217
- }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
219
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
218
220
  /**
219
221
  * List tenant API keys in the current admin scope.
220
222
  */