@lucern/contracts 1.0.50 → 1.0.52

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 (66) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/function-registry/beliefs.d.ts +77 -0
  3. package/dist/function-registry/beliefs.js +7 -2
  4. package/dist/function-registry/coding.d.ts +183 -0
  5. package/dist/function-registry/coding.js +60 -33
  6. package/dist/function-registry/context.d.ts +9 -0
  7. package/dist/function-registry/context.js +1 -0
  8. package/dist/function-registry/contracts.d.ts +16 -12
  9. package/dist/function-registry/contracts.js +5 -2
  10. package/dist/function-registry/coordination.d.ts +9 -0
  11. package/dist/function-registry/coordination.js +1 -0
  12. package/dist/function-registry/edges.d.ts +140 -0
  13. package/dist/function-registry/edges.js +6 -2
  14. package/dist/function-registry/embeddings.d.ts +4 -0
  15. package/dist/function-registry/embeddings.js +1 -0
  16. package/dist/function-registry/evidence.d.ts +251 -0
  17. package/dist/function-registry/evidence.js +94 -5
  18. package/dist/function-registry/graph.d.ts +15 -0
  19. package/dist/function-registry/graph.js +1 -0
  20. package/dist/function-registry/helpers.d.ts +2 -0
  21. package/dist/function-registry/helpers.js +1 -0
  22. package/dist/function-registry/hybrid.d.ts +6 -0
  23. package/dist/function-registry/hybrid.js +1 -0
  24. package/dist/function-registry/identity.d.ts +4 -0
  25. package/dist/function-registry/identity.js +1 -0
  26. package/dist/function-registry/index.js +1 -0
  27. package/dist/function-registry/judgments.d.ts +2 -0
  28. package/dist/function-registry/judgments.js +1 -0
  29. package/dist/function-registry/legacy.d.ts +1 -0
  30. package/dist/function-registry/legacy.js +1 -0
  31. package/dist/function-registry/lenses.d.ts +4 -0
  32. package/dist/function-registry/lenses.js +1 -0
  33. package/dist/function-registry/nodes.d.ts +106 -0
  34. package/dist/function-registry/nodes.js +9 -4
  35. package/dist/function-registry/ontologies.d.ts +11 -0
  36. package/dist/function-registry/ontologies.js +8 -2
  37. package/dist/function-registry/pipeline.d.ts +3 -0
  38. package/dist/function-registry/pipeline.js +1 -0
  39. package/dist/function-registry/policy.d.ts +1 -0
  40. package/dist/function-registry/policy.js +1 -0
  41. package/dist/function-registry/questions.d.ts +104 -0
  42. package/dist/function-registry/questions.js +10 -5
  43. package/dist/function-registry/tasks.d.ts +86 -0
  44. package/dist/function-registry/tasks.js +2 -1
  45. package/dist/function-registry/topics.d.ts +7 -0
  46. package/dist/function-registry/topics.js +7 -2
  47. package/dist/function-registry/types.d.ts +46 -0
  48. package/dist/function-registry/worktrees.d.ts +440 -0
  49. package/dist/function-registry/worktrees.js +9 -3
  50. package/dist/generated/convexSchemas.d.ts +10 -10
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.js +5 -0
  53. package/dist/infisical-runtime.base.js +5 -0
  54. package/dist/infisical-runtime.contract.js +5 -0
  55. package/dist/infisical-runtime.tenant-secrets.js +5 -0
  56. package/dist/manifests/infisical-runtime-manifest.js +5 -0
  57. package/dist/manifests/tenant-client-manifest.d.ts +5 -1
  58. package/dist/manifests/tenant-client-manifest.js +5 -0
  59. package/dist/operator-receipt.contract.d.ts +32 -0
  60. package/dist/operator-receipt.contract.js +1 -0
  61. package/dist/projections/create-evidence.projection.d.ts +12 -12
  62. package/dist/projections/index.d.ts +2 -2
  63. package/dist/proof-attestation.json +1 -1
  64. package/dist/tenant-client.contract.d.ts +5 -1
  65. package/dist/tenant-client.contract.js +5 -0
  66. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -165,3 +165,9 @@ All notable changes to `@lucern/contracts` are tracked in this repository.
165
165
 
166
166
  ## [1.0.50] - 2026-06-28
167
167
  - Release notes pending.
168
+
169
+ ## [1.0.51] - 2026-06-29
170
+ - Release notes pending.
171
+
172
+ ## [1.0.52] - 2026-06-30
173
+ - Release notes pending.
@@ -1,10 +1,78 @@
1
1
  import { z } from "zod";
2
+ export declare const createBeliefArgs: z.ZodObject<{
3
+ canonicalText: z.ZodString;
4
+ topicGlobalId: z.ZodEffects<z.ZodString, string, string>;
5
+ baseRate: z.ZodOptional<z.ZodNumber>;
6
+ beliefStatus: z.ZodOptional<z.ZodEnum<["assumption", "hypothesis", "active", "superseded", "resolved_true", "resolved_false"]>>;
7
+ epistemicStatus: z.ZodOptional<z.ZodEnum<["assumption", "hypothesis", "active", "superseded", "resolved_true", "resolved_false"]>>;
8
+ beliefType: z.ZodOptional<z.ZodString>;
9
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10
+ rationale: z.ZodOptional<z.ZodString>;
11
+ pillar: z.ZodOptional<z.ZodString>;
12
+ worktreeId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
13
+ sourceBeliefIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
14
+ sourceType: z.ZodOptional<z.ZodEnum<["human", "ai_extracted", "ai_generated"]>>;
15
+ reversibility: z.ZodOptional<z.ZodEnum<["irreversible", "hard_to_reverse", "reversible", "trivial"]>>;
16
+ predictionMeta: z.ZodOptional<z.ZodObject<{
17
+ isPrediction: z.ZodBoolean;
18
+ registeredAt: z.ZodNumber;
19
+ expectedBy: z.ZodOptional<z.ZodNumber>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ isPrediction: boolean;
22
+ registeredAt: number;
23
+ expectedBy?: number | undefined;
24
+ }, {
25
+ isPrediction: boolean;
26
+ registeredAt: number;
27
+ expectedBy?: number | undefined;
28
+ }>>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ canonicalText: string;
31
+ topicGlobalId: string;
32
+ metadata?: Record<string, unknown> | undefined;
33
+ sourceType?: "human" | "ai_extracted" | "ai_generated" | undefined;
34
+ worktreeId?: string | undefined;
35
+ epistemicStatus?: "active" | "hypothesis" | "superseded" | "assumption" | "resolved_true" | "resolved_false" | undefined;
36
+ rationale?: string | undefined;
37
+ baseRate?: number | undefined;
38
+ beliefType?: string | undefined;
39
+ beliefStatus?: "active" | "hypothesis" | "superseded" | "assumption" | "resolved_true" | "resolved_false" | undefined;
40
+ pillar?: string | undefined;
41
+ sourceBeliefIds?: string[] | undefined;
42
+ reversibility?: "irreversible" | "hard_to_reverse" | "reversible" | "trivial" | undefined;
43
+ predictionMeta?: {
44
+ isPrediction: boolean;
45
+ registeredAt: number;
46
+ expectedBy?: number | undefined;
47
+ } | undefined;
48
+ }, {
49
+ canonicalText: string;
50
+ topicGlobalId: string;
51
+ metadata?: Record<string, unknown> | undefined;
52
+ sourceType?: "human" | "ai_extracted" | "ai_generated" | undefined;
53
+ worktreeId?: string | undefined;
54
+ epistemicStatus?: "active" | "hypothesis" | "superseded" | "assumption" | "resolved_true" | "resolved_false" | undefined;
55
+ rationale?: string | undefined;
56
+ baseRate?: number | undefined;
57
+ beliefType?: string | undefined;
58
+ beliefStatus?: "active" | "hypothesis" | "superseded" | "assumption" | "resolved_true" | "resolved_false" | undefined;
59
+ pillar?: string | undefined;
60
+ sourceBeliefIds?: string[] | undefined;
61
+ reversibility?: "irreversible" | "hard_to_reverse" | "reversible" | "trivial" | undefined;
62
+ predictionMeta?: {
63
+ isPrediction: boolean;
64
+ registeredAt: number;
65
+ expectedBy?: number | undefined;
66
+ } | undefined;
67
+ }>;
68
+ export type CreateBeliefArgs = z.infer<typeof createBeliefArgs>;
2
69
  export declare const beliefsContracts: readonly [{
3
70
  name: string;
4
71
  kind: import("./types.js").FunctionKind;
5
72
  idempotent: import("./types.js").FunctionIdempotency;
6
73
  effects: readonly import("../dsl.js").FunctionEffect[];
7
74
  invariants: readonly string[] | undefined;
75
+ boundary: import("./types.js").BoundarySpec | undefined;
8
76
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
9
77
  domain: string;
10
78
  surfaceClass: import("./types.js").SurfaceClass;
@@ -50,6 +118,7 @@ export declare const beliefsContracts: readonly [{
50
118
  idempotent: import("./types.js").FunctionIdempotency;
51
119
  effects: readonly import("../dsl.js").FunctionEffect[];
52
120
  invariants: readonly string[] | undefined;
121
+ boundary: import("./types.js").BoundarySpec | undefined;
53
122
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
54
123
  domain: string;
55
124
  surfaceClass: import("./types.js").SurfaceClass;
@@ -95,6 +164,7 @@ export declare const beliefsContracts: readonly [{
95
164
  idempotent: import("./types.js").FunctionIdempotency;
96
165
  effects: readonly import("../dsl.js").FunctionEffect[];
97
166
  invariants: readonly string[] | undefined;
167
+ boundary: import("./types.js").BoundarySpec | undefined;
98
168
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
99
169
  domain: string;
100
170
  surfaceClass: import("./types.js").SurfaceClass;
@@ -140,6 +210,7 @@ export declare const beliefsContracts: readonly [{
140
210
  idempotent: import("./types.js").FunctionIdempotency;
141
211
  effects: readonly import("../dsl.js").FunctionEffect[];
142
212
  invariants: readonly string[] | undefined;
213
+ boundary: import("./types.js").BoundarySpec | undefined;
143
214
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
144
215
  domain: string;
145
216
  surfaceClass: import("./types.js").SurfaceClass;
@@ -185,6 +256,7 @@ export declare const beliefsContracts: readonly [{
185
256
  idempotent: import("./types.js").FunctionIdempotency;
186
257
  effects: readonly import("../dsl.js").FunctionEffect[];
187
258
  invariants: readonly string[] | undefined;
259
+ boundary: import("./types.js").BoundarySpec | undefined;
188
260
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
189
261
  domain: string;
190
262
  surfaceClass: import("./types.js").SurfaceClass;
@@ -230,6 +302,7 @@ export declare const beliefsContracts: readonly [{
230
302
  idempotent: import("./types.js").FunctionIdempotency;
231
303
  effects: readonly import("../dsl.js").FunctionEffect[];
232
304
  invariants: readonly string[] | undefined;
305
+ boundary: import("./types.js").BoundarySpec | undefined;
233
306
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
234
307
  domain: string;
235
308
  surfaceClass: import("./types.js").SurfaceClass;
@@ -275,6 +348,7 @@ export declare const beliefsContracts: readonly [{
275
348
  idempotent: import("./types.js").FunctionIdempotency;
276
349
  effects: readonly import("../dsl.js").FunctionEffect[];
277
350
  invariants: readonly string[] | undefined;
351
+ boundary: import("./types.js").BoundarySpec | undefined;
278
352
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
279
353
  domain: string;
280
354
  surfaceClass: import("./types.js").SurfaceClass;
@@ -320,6 +394,7 @@ export declare const beliefsContracts: readonly [{
320
394
  idempotent: import("./types.js").FunctionIdempotency;
321
395
  effects: readonly import("../dsl.js").FunctionEffect[];
322
396
  invariants: readonly string[] | undefined;
397
+ boundary: import("./types.js").BoundarySpec | undefined;
323
398
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
324
399
  domain: string;
325
400
  surfaceClass: import("./types.js").SurfaceClass;
@@ -365,6 +440,7 @@ export declare const beliefsContracts: readonly [{
365
440
  idempotent: import("./types.js").FunctionIdempotency;
366
441
  effects: readonly import("../dsl.js").FunctionEffect[];
367
442
  invariants: readonly string[] | undefined;
443
+ boundary: import("./types.js").BoundarySpec | undefined;
368
444
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
369
445
  domain: string;
370
446
  surfaceClass: import("./types.js").SurfaceClass;
@@ -410,6 +486,7 @@ export declare const beliefsContracts: readonly [{
410
486
  idempotent: import("./types.js").FunctionIdempotency;
411
487
  effects: readonly import("../dsl.js").FunctionEffect[];
412
488
  invariants: readonly string[] | undefined;
489
+ boundary: import("./types.js").BoundarySpec | undefined;
413
490
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
414
491
  domain: string;
415
492
  surfaceClass: import("./types.js").SurfaceClass;
@@ -6338,6 +6338,7 @@ function surfaceContract(args) {
6338
6338
  idempotent: args.idempotent ?? args.kind !== "query",
6339
6339
  effects: resolvedEffects,
6340
6340
  invariants: args.invariants,
6341
+ boundary: args.boundary,
6341
6342
  surfaceIntent: manifestEntry.surfaceIntent,
6342
6343
  domain: args.domain,
6343
6344
  surfaceClass: manifestEntry.surfaceClass,
@@ -6530,7 +6531,11 @@ var beliefsContracts = [
6530
6531
  inputProjection: createBeliefInput
6531
6532
  },
6532
6533
  args: createBeliefArgs,
6533
- input: createBeliefArgs
6534
+ input: createBeliefArgs,
6535
+ boundary: {
6536
+ scope: [{ rule: "topic-required" }],
6537
+ admission: ["source-span", "uuidv7-endpoints"]
6538
+ }
6534
6539
  }),
6535
6540
  surfaceContract({
6536
6541
  name: "get_belief",
@@ -6695,4 +6700,4 @@ var beliefsContracts = [
6695
6700
  })
6696
6701
  ];
6697
6702
 
6698
- export { beliefsContracts };
6703
+ export { beliefsContracts, createBeliefArgs };
@@ -1,10 +1,188 @@
1
1
  import { z } from "zod";
2
+ export declare const recordScopeLearningArgs: z.ZodObject<{
3
+ topicId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
4
+ summary: z.ZodString;
5
+ title: z.ZodOptional<z.ZodString>;
6
+ body: z.ZodOptional<z.ZodString>;
7
+ contentType: z.ZodOptional<z.ZodString>;
8
+ sourceKind: z.ZodOptional<z.ZodEnum<["commit", "merge", "doc", "issue", "manual"]>>;
9
+ sourceRef: z.ZodOptional<z.ZodString>;
10
+ sourceUrl: z.ZodOptional<z.ZodString>;
11
+ touchedPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
+ linkedBeliefNodeId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
14
+ beliefId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
15
+ evidenceRelation: z.ZodOptional<z.ZodEnum<["supports", "contradicts"]>>;
16
+ weight: z.ZodOptional<z.ZodNumber>;
17
+ signedImpact: z.ZodOptional<z.ZodNumber>;
18
+ linkedBeliefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
19
+ beliefId: z.ZodEffects<z.ZodString, string, string>;
20
+ weight: z.ZodNumber;
21
+ relation: z.ZodOptional<z.ZodEnum<["supports", "contradicts"]>>;
22
+ rationale: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ beliefId: string;
25
+ weight: number;
26
+ rationale?: string | undefined;
27
+ relation?: "supports" | "contradicts" | undefined;
28
+ }, {
29
+ beliefId: string;
30
+ weight: number;
31
+ rationale?: string | undefined;
32
+ relation?: "supports" | "contradicts" | undefined;
33
+ }>, "many">>;
34
+ confidence: z.ZodOptional<z.ZodNumber>;
35
+ rationale: z.ZodOptional<z.ZodString>;
36
+ createQuestionText: z.ZodOptional<z.ZodString>;
37
+ createBeliefText: z.ZodOptional<z.ZodString>;
38
+ beliefType: z.ZodOptional<z.ZodString>;
39
+ text: z.ZodOptional<z.ZodString>;
40
+ content: z.ZodOptional<z.ZodString>;
41
+ kind: z.ZodOptional<z.ZodString>;
42
+ sourceType: z.ZodOptional<z.ZodString>;
43
+ externalSourceType: z.ZodOptional<z.ZodString>;
44
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ summary: string;
47
+ content?: string | undefined;
48
+ body?: string | undefined;
49
+ title?: string | undefined;
50
+ metadata?: Record<string, unknown> | undefined;
51
+ text?: string | undefined;
52
+ sourceType?: string | undefined;
53
+ signedImpact?: number | undefined;
54
+ topicId?: string | undefined;
55
+ beliefId?: string | undefined;
56
+ sourceRef?: string | undefined;
57
+ evidenceRelation?: "supports" | "contradicts" | undefined;
58
+ confidence?: number | undefined;
59
+ sourceUrl?: string | undefined;
60
+ weight?: number | undefined;
61
+ rationale?: string | undefined;
62
+ kind?: string | undefined;
63
+ contentType?: string | undefined;
64
+ sourceKind?: "manual" | "merge" | "commit" | "doc" | "issue" | undefined;
65
+ externalSourceType?: string | undefined;
66
+ tags?: string[] | undefined;
67
+ touchedPaths?: string[] | undefined;
68
+ beliefType?: string | undefined;
69
+ linkedBeliefNodeId?: string | undefined;
70
+ createQuestionText?: string | undefined;
71
+ createBeliefText?: string | undefined;
72
+ linkedBeliefs?: {
73
+ beliefId: string;
74
+ weight: number;
75
+ rationale?: string | undefined;
76
+ relation?: "supports" | "contradicts" | undefined;
77
+ }[] | undefined;
78
+ }, {
79
+ summary: string;
80
+ content?: string | undefined;
81
+ body?: string | undefined;
82
+ title?: string | undefined;
83
+ metadata?: Record<string, unknown> | undefined;
84
+ text?: string | undefined;
85
+ sourceType?: string | undefined;
86
+ signedImpact?: number | undefined;
87
+ topicId?: string | undefined;
88
+ beliefId?: string | undefined;
89
+ sourceRef?: string | undefined;
90
+ evidenceRelation?: "supports" | "contradicts" | undefined;
91
+ confidence?: number | undefined;
92
+ sourceUrl?: string | undefined;
93
+ weight?: number | undefined;
94
+ rationale?: string | undefined;
95
+ kind?: string | undefined;
96
+ contentType?: string | undefined;
97
+ sourceKind?: "manual" | "merge" | "commit" | "doc" | "issue" | undefined;
98
+ externalSourceType?: string | undefined;
99
+ tags?: string[] | undefined;
100
+ touchedPaths?: string[] | undefined;
101
+ beliefType?: string | undefined;
102
+ linkedBeliefNodeId?: string | undefined;
103
+ createQuestionText?: string | undefined;
104
+ createBeliefText?: string | undefined;
105
+ linkedBeliefs?: {
106
+ beliefId: string;
107
+ weight: number;
108
+ rationale?: string | undefined;
109
+ relation?: "supports" | "contradicts" | undefined;
110
+ }[] | undefined;
111
+ }>;
112
+ export type RecordScopeLearningArgs = z.infer<typeof recordScopeLearningArgs>;
113
+ export declare const recordScopeLearningReturns: z.ZodObject<{
114
+ nodeId: z.ZodEffects<z.ZodString, string, string>;
115
+ evidenceNodeId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
116
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
117
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
118
+ nodeId: z.ZodEffects<z.ZodString, string, string>;
119
+ evidenceNodeId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
120
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
121
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
122
+ nodeId: z.ZodEffects<z.ZodString, string, string>;
123
+ evidenceNodeId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
124
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
125
+ }, z.ZodTypeAny, "passthrough">>;
126
+ export type RecordScopeLearningReturns = z.infer<typeof recordScopeLearningReturns>;
127
+ export declare const codeContextArgs: z.ZodObject<{
128
+ topicId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
129
+ filePath: z.ZodOptional<z.ZodString>;
130
+ includeFailures: z.ZodOptional<z.ZodBoolean>;
131
+ limit: z.ZodOptional<z.ZodNumber>;
132
+ status: z.ZodOptional<z.ZodString>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ status?: string | undefined;
135
+ topicId?: string | undefined;
136
+ limit?: number | undefined;
137
+ filePath?: string | undefined;
138
+ includeFailures?: boolean | undefined;
139
+ }, {
140
+ status?: string | undefined;
141
+ topicId?: string | undefined;
142
+ limit?: number | undefined;
143
+ filePath?: string | undefined;
144
+ includeFailures?: boolean | undefined;
145
+ }>;
146
+ export type CodeContextArgs = z.infer<typeof codeContextArgs>;
147
+ export declare const recordAttemptArgs: z.ZodObject<{
148
+ topicId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
149
+ description: z.ZodString;
150
+ errorMessage: z.ZodOptional<z.ZodString>;
151
+ filePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
152
+ filePath: z.ZodOptional<z.ZodString>;
153
+ linkedBeliefId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
154
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
155
+ rationale: z.ZodOptional<z.ZodString>;
156
+ title: z.ZodOptional<z.ZodString>;
157
+ }, "strip", z.ZodTypeAny, {
158
+ description: string;
159
+ title?: string | undefined;
160
+ metadata?: Record<string, unknown> | undefined;
161
+ topicId?: string | undefined;
162
+ rationale?: string | undefined;
163
+ linkedBeliefId?: string | undefined;
164
+ filePath?: string | undefined;
165
+ filePaths?: string[] | undefined;
166
+ errorMessage?: string | undefined;
167
+ }, {
168
+ description: string;
169
+ title?: string | undefined;
170
+ metadata?: Record<string, unknown> | undefined;
171
+ topicId?: string | undefined;
172
+ rationale?: string | undefined;
173
+ linkedBeliefId?: string | undefined;
174
+ filePath?: string | undefined;
175
+ filePaths?: string[] | undefined;
176
+ errorMessage?: string | undefined;
177
+ }>;
178
+ export type RecordAttemptArgs = z.infer<typeof recordAttemptArgs>;
2
179
  export declare const codingContracts: readonly [{
3
180
  name: string;
4
181
  kind: import("./types.js").FunctionKind;
5
182
  idempotent: import("./types.js").FunctionIdempotency;
6
183
  effects: readonly import("../dsl.js").FunctionEffect[];
7
184
  invariants: readonly string[] | undefined;
185
+ boundary: import("./types.js").BoundarySpec | undefined;
8
186
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
9
187
  domain: string;
10
188
  surfaceClass: import("./types.js").SurfaceClass;
@@ -50,6 +228,7 @@ export declare const codingContracts: readonly [{
50
228
  idempotent: import("./types.js").FunctionIdempotency;
51
229
  effects: readonly import("../dsl.js").FunctionEffect[];
52
230
  invariants: readonly string[] | undefined;
231
+ boundary: import("./types.js").BoundarySpec | undefined;
53
232
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
54
233
  domain: string;
55
234
  surfaceClass: import("./types.js").SurfaceClass;
@@ -95,6 +274,7 @@ export declare const codingContracts: readonly [{
95
274
  idempotent: import("./types.js").FunctionIdempotency;
96
275
  effects: readonly import("../dsl.js").FunctionEffect[];
97
276
  invariants: readonly string[] | undefined;
277
+ boundary: import("./types.js").BoundarySpec | undefined;
98
278
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
99
279
  domain: string;
100
280
  surfaceClass: import("./types.js").SurfaceClass;
@@ -140,6 +320,7 @@ export declare const codingContracts: readonly [{
140
320
  idempotent: import("./types.js").FunctionIdempotency;
141
321
  effects: readonly import("../dsl.js").FunctionEffect[];
142
322
  invariants: readonly string[] | undefined;
323
+ boundary: import("./types.js").BoundarySpec | undefined;
143
324
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
144
325
  domain: string;
145
326
  surfaceClass: import("./types.js").SurfaceClass;
@@ -185,6 +366,7 @@ export declare const codingContracts: readonly [{
185
366
  idempotent: import("./types.js").FunctionIdempotency;
186
367
  effects: readonly import("../dsl.js").FunctionEffect[];
187
368
  invariants: readonly string[] | undefined;
369
+ boundary: import("./types.js").BoundarySpec | undefined;
188
370
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
189
371
  domain: string;
190
372
  surfaceClass: import("./types.js").SurfaceClass;
@@ -230,6 +412,7 @@ export declare const codingContracts: readonly [{
230
412
  idempotent: import("./types.js").FunctionIdempotency;
231
413
  effects: readonly import("../dsl.js").FunctionEffect[];
232
414
  invariants: readonly string[] | undefined;
415
+ boundary: import("./types.js").BoundarySpec | undefined;
233
416
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
234
417
  domain: string;
235
418
  surfaceClass: import("./types.js").SurfaceClass;
@@ -6156,6 +6156,7 @@ function surfaceContract(args) {
6156
6156
  idempotent: args.idempotent ?? args.kind !== "query",
6157
6157
  effects: resolvedEffects,
6158
6158
  invariants: args.invariants,
6159
+ boundary: args.boundary,
6159
6160
  surfaceIntent: manifestEntry.surfaceIntent,
6160
6161
  domain: args.domain,
6161
6162
  surfaceClass: manifestEntry.surfaceClass,
@@ -6314,6 +6315,11 @@ var recordScopeLearningArgs = z.object({
6314
6315
  externalSourceType: z.string().optional().describe("External source type alias."),
6315
6316
  metadata: z.record(z.unknown()).optional().describe("Learning metadata.")
6316
6317
  });
6318
+ var recordScopeLearningReturns = z.object({
6319
+ nodeId: uuidV7StringSchema.describe("Canonical evidence node ID."),
6320
+ evidenceNodeId: uuidV7StringSchema.optional().describe("Evidence node ID alias."),
6321
+ id: uuidV7StringSchema.optional().describe("Canonical ID alias.")
6322
+ }).passthrough();
6317
6323
  var codeContextArgs = z.object({
6318
6324
  topicId: uuidV7StringSchema.optional().describe("Topic scope."),
6319
6325
  filePath: z.string().optional().describe("File path anchor."),
@@ -6338,48 +6344,65 @@ function finiteNumber(value) {
6338
6344
  function relationFromWeight(weight) {
6339
6345
  return weight < 0 ? "contradicts" : "supports";
6340
6346
  }
6347
+ function signedWeightFrom(input) {
6348
+ const explicitWeight = finiteNumber(input.weight);
6349
+ if (explicitWeight !== void 0) {
6350
+ return explicitWeight;
6351
+ }
6352
+ const confidenceMagnitude = finiteNumber(input.confidence);
6353
+ if (confidenceMagnitude === void 0) {
6354
+ return;
6355
+ }
6356
+ const magnitude = Math.max(0, Math.min(1, confidenceMagnitude));
6357
+ return input.relation === "contradicts" || input.relation === "contradicting" ? -magnitude : magnitude;
6358
+ }
6359
+ function normalizedRelation(relation, signedWeight) {
6360
+ return relation === "supports" || relation === "contradicts" ? relation : relationFromWeight(signedWeight);
6361
+ }
6362
+ function pushSignedBeliefRelation(relations, seen, input) {
6363
+ if (typeof input.beliefNodeId !== "string" || input.beliefNodeId.length === 0) {
6364
+ return;
6365
+ }
6366
+ const signedWeight = signedWeightFrom(input);
6367
+ if (signedWeight === void 0 || signedWeight === 0) {
6368
+ return;
6369
+ }
6370
+ if (seen.has(input.beliefNodeId)) {
6371
+ return;
6372
+ }
6373
+ seen.add(input.beliefNodeId);
6374
+ relations.push({
6375
+ beliefNodeId: input.beliefNodeId,
6376
+ relation: normalizedRelation(input.relation, signedWeight),
6377
+ weight: signedWeight,
6378
+ ...typeof input.rationale === "string" && input.rationale.length > 0 ? { rationale: input.rationale } : {}
6379
+ });
6380
+ }
6341
6381
  function buildSignedBeliefRelations(input) {
6342
6382
  const relations = [];
6343
6383
  const seen = /* @__PURE__ */ new Set();
6344
- const push = (beliefNodeId, weight, relation, rationale) => {
6345
- if (typeof beliefNodeId !== "string" || beliefNodeId.length === 0) {
6346
- return;
6347
- }
6348
- const signedWeight = finiteNumber(weight);
6349
- if (signedWeight === void 0 || signedWeight === 0) {
6350
- return;
6351
- }
6352
- if (seen.has(beliefNodeId)) {
6353
- return;
6354
- }
6355
- seen.add(beliefNodeId);
6356
- const resolvedRelation = relation === "supports" || relation === "contradicts" ? relation : relationFromWeight(signedWeight);
6357
- relations.push({
6358
- beliefNodeId,
6359
- relation: resolvedRelation,
6360
- weight: signedWeight,
6361
- ...typeof rationale === "string" && rationale.length > 0 ? { rationale } : {}
6362
- });
6363
- };
6384
+ const push = (relationInput) => pushSignedBeliefRelation(relations, seen, relationInput);
6364
6385
  if (Array.isArray(input.linkedBeliefs)) {
6365
6386
  for (const entry of input.linkedBeliefs) {
6366
6387
  if (entry && typeof entry === "object" && !Array.isArray(entry)) {
6367
6388
  const row = entry;
6368
- push(
6369
- row.beliefId ?? row.beliefNodeId ?? row.linkedBeliefNodeId,
6370
- row.weight ?? row.signedImpact,
6371
- row.relation ?? row.evidenceRelation,
6372
- row.rationale
6373
- );
6389
+ push({
6390
+ beliefNodeId: row.beliefId ?? row.beliefNodeId ?? row.linkedBeliefNodeId,
6391
+ confidence: row.confidence ?? input.confidence,
6392
+ rationale: row.rationale,
6393
+ relation: row.relation ?? row.evidenceRelation,
6394
+ weight: row.weight ?? row.signedImpact
6395
+ });
6374
6396
  }
6375
6397
  }
6376
6398
  }
6377
- push(
6378
- input.linkedBeliefNodeId ?? input.beliefId,
6379
- input.weight ?? input.signedImpact,
6380
- input.evidenceRelation,
6381
- input.rationale
6382
- );
6399
+ push({
6400
+ beliefNodeId: input.linkedBeliefNodeId ?? input.beliefId,
6401
+ confidence: input.confidence,
6402
+ rationale: input.rationale,
6403
+ relation: input.evidenceRelation,
6404
+ weight: input.weight ?? input.signedImpact
6405
+ });
6383
6406
  return relations;
6384
6407
  }
6385
6408
  var learningInput = (input, context) => {
@@ -6462,6 +6485,10 @@ var codingContracts = [
6462
6485
  functionName: "create",
6463
6486
  kind: "mutation",
6464
6487
  inputProjection: learningInput
6488
+ },
6489
+ returns: recordScopeLearningReturns,
6490
+ boundary: {
6491
+ scope: [{ rule: "topic-required" }]
6465
6492
  }
6466
6493
  }),
6467
6494
  surfaceContract({
@@ -6571,4 +6598,4 @@ var codingContracts = [
6571
6598
  })
6572
6599
  ];
6573
6600
 
6574
- export { codingContracts };
6601
+ export { codeContextArgs, codingContracts, recordAttemptArgs, recordScopeLearningArgs, recordScopeLearningReturns };
@@ -5,6 +5,7 @@ export declare const contextContracts: readonly [{
5
5
  idempotent: import("./types.js").FunctionIdempotency;
6
6
  effects: readonly import("../dsl.js").FunctionEffect[];
7
7
  invariants: readonly string[] | undefined;
8
+ boundary: import("./types.js").BoundarySpec | undefined;
8
9
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
9
10
  domain: string;
10
11
  surfaceClass: import("./types.js").SurfaceClass;
@@ -50,6 +51,7 @@ export declare const contextContracts: readonly [{
50
51
  idempotent: import("./types.js").FunctionIdempotency;
51
52
  effects: readonly import("../dsl.js").FunctionEffect[];
52
53
  invariants: readonly string[] | undefined;
54
+ boundary: import("./types.js").BoundarySpec | undefined;
53
55
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
54
56
  domain: string;
55
57
  surfaceClass: import("./types.js").SurfaceClass;
@@ -95,6 +97,7 @@ export declare const contextContracts: readonly [{
95
97
  idempotent: import("./types.js").FunctionIdempotency;
96
98
  effects: readonly import("../dsl.js").FunctionEffect[];
97
99
  invariants: readonly string[] | undefined;
100
+ boundary: import("./types.js").BoundarySpec | undefined;
98
101
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
99
102
  domain: string;
100
103
  surfaceClass: import("./types.js").SurfaceClass;
@@ -140,6 +143,7 @@ export declare const contextContracts: readonly [{
140
143
  idempotent: import("./types.js").FunctionIdempotency;
141
144
  effects: readonly import("../dsl.js").FunctionEffect[];
142
145
  invariants: readonly string[] | undefined;
146
+ boundary: import("./types.js").BoundarySpec | undefined;
143
147
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
144
148
  domain: string;
145
149
  surfaceClass: import("./types.js").SurfaceClass;
@@ -185,6 +189,7 @@ export declare const contextContracts: readonly [{
185
189
  idempotent: import("./types.js").FunctionIdempotency;
186
190
  effects: readonly import("../dsl.js").FunctionEffect[];
187
191
  invariants: readonly string[] | undefined;
192
+ boundary: import("./types.js").BoundarySpec | undefined;
188
193
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
189
194
  domain: string;
190
195
  surfaceClass: import("./types.js").SurfaceClass;
@@ -230,6 +235,7 @@ export declare const contextContracts: readonly [{
230
235
  idempotent: import("./types.js").FunctionIdempotency;
231
236
  effects: readonly import("../dsl.js").FunctionEffect[];
232
237
  invariants: readonly string[] | undefined;
238
+ boundary: import("./types.js").BoundarySpec | undefined;
233
239
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
234
240
  domain: string;
235
241
  surfaceClass: import("./types.js").SurfaceClass;
@@ -275,6 +281,7 @@ export declare const contextContracts: readonly [{
275
281
  idempotent: import("./types.js").FunctionIdempotency;
276
282
  effects: readonly import("../dsl.js").FunctionEffect[];
277
283
  invariants: readonly string[] | undefined;
284
+ boundary: import("./types.js").BoundarySpec | undefined;
278
285
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
279
286
  domain: string;
280
287
  surfaceClass: import("./types.js").SurfaceClass;
@@ -320,6 +327,7 @@ export declare const contextContracts: readonly [{
320
327
  idempotent: import("./types.js").FunctionIdempotency;
321
328
  effects: readonly import("../dsl.js").FunctionEffect[];
322
329
  invariants: readonly string[] | undefined;
330
+ boundary: import("./types.js").BoundarySpec | undefined;
323
331
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
324
332
  domain: string;
325
333
  surfaceClass: import("./types.js").SurfaceClass;
@@ -365,6 +373,7 @@ export declare const contextContracts: readonly [{
365
373
  idempotent: import("./types.js").FunctionIdempotency;
366
374
  effects: readonly import("../dsl.js").FunctionEffect[];
367
375
  invariants: readonly string[] | undefined;
376
+ boundary: import("./types.js").BoundarySpec | undefined;
368
377
  surfaceIntent: import("./types.js").FunctionSurfaceIntent;
369
378
  domain: string;
370
379
  surfaceClass: import("./types.js").SurfaceClass;
@@ -6156,6 +6156,7 @@ function surfaceContract(args) {
6156
6156
  idempotent: args.idempotent ?? args.kind !== "query",
6157
6157
  effects: resolvedEffects,
6158
6158
  invariants: args.invariants,
6159
+ boundary: args.boundary,
6159
6160
  surfaceIntent: manifestEntry.surfaceIntent,
6160
6161
  domain: args.domain,
6161
6162
  surfaceClass: manifestEntry.surfaceClass,