@lucern/contracts 0.3.0-alpha.0 → 0.3.0-alpha.1

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 (117) hide show
  1. package/dist/dsl.js +3 -0
  2. package/dist/dsl.js.map +1 -1
  3. package/dist/function-registry/beliefs.d.ts +11 -51
  4. package/dist/function-registry/beliefs.js +445 -94
  5. package/dist/function-registry/beliefs.js.map +1 -1
  6. package/dist/function-registry/coding.d.ts +7 -31
  7. package/dist/function-registry/coding.js +264 -81
  8. package/dist/function-registry/coding.js.map +1 -1
  9. package/dist/function-registry/context.d.ts +4 -16
  10. package/dist/function-registry/context.js +223 -62
  11. package/dist/function-registry/context.js.map +1 -1
  12. package/dist/function-registry/contracts.d.ts +4 -16
  13. package/dist/function-registry/contracts.js +195 -54
  14. package/dist/function-registry/contracts.js.map +1 -1
  15. package/dist/function-registry/coordination.d.ts +10 -46
  16. package/dist/function-registry/coordination.js +208 -57
  17. package/dist/function-registry/coordination.js.map +1 -1
  18. package/dist/function-registry/edges.d.ts +10 -18
  19. package/dist/function-registry/edges.js +343 -68
  20. package/dist/function-registry/edges.js.map +1 -1
  21. package/dist/function-registry/evidence.d.ts +17 -49
  22. package/dist/function-registry/evidence.js +395 -99
  23. package/dist/function-registry/evidence.js.map +1 -1
  24. package/dist/function-registry/graph.d.ts +14 -66
  25. package/dist/function-registry/graph.js +225 -65
  26. package/dist/function-registry/graph.js.map +1 -1
  27. package/dist/function-registry/helpers.d.ts +6 -8
  28. package/dist/function-registry/helpers.js +204 -55
  29. package/dist/function-registry/helpers.js.map +1 -1
  30. package/dist/function-registry/identity.d.ts +4 -16
  31. package/dist/function-registry/identity.js +195 -54
  32. package/dist/function-registry/identity.js.map +1 -1
  33. package/dist/function-registry/index.d.ts +2 -2
  34. package/dist/function-registry/index.js +204 -55
  35. package/dist/function-registry/index.js.map +1 -1
  36. package/dist/function-registry/judgments.d.ts +5 -13
  37. package/dist/function-registry/judgments.js +214 -63
  38. package/dist/function-registry/judgments.js.map +1 -1
  39. package/dist/function-registry/legacy.d.ts +2 -6
  40. package/dist/function-registry/legacy.js +195 -54
  41. package/dist/function-registry/legacy.js.map +1 -1
  42. package/dist/function-registry/lenses.d.ts +5 -21
  43. package/dist/function-registry/lenses.js +241 -58
  44. package/dist/function-registry/lenses.js.map +1 -1
  45. package/dist/function-registry/manifest.d.ts +3 -3
  46. package/dist/function-registry/manifest.js +1 -0
  47. package/dist/function-registry/manifest.js.map +1 -1
  48. package/dist/function-registry/ontologies.d.ts +12 -56
  49. package/dist/function-registry/ontologies.js +227 -77
  50. package/dist/function-registry/ontologies.js.map +1 -1
  51. package/dist/function-registry/pipeline.d.ts +4 -16
  52. package/dist/function-registry/pipeline.js +207 -55
  53. package/dist/function-registry/pipeline.js.map +1 -1
  54. package/dist/function-registry/questions.d.ts +13 -61
  55. package/dist/function-registry/questions.js +281 -82
  56. package/dist/function-registry/questions.js.map +1 -1
  57. package/dist/function-registry/tasks.d.ts +5 -21
  58. package/dist/function-registry/tasks.js +265 -58
  59. package/dist/function-registry/tasks.js.map +1 -1
  60. package/dist/function-registry/topics.d.ts +6 -26
  61. package/dist/function-registry/topics.js +214 -57
  62. package/dist/function-registry/topics.js.map +1 -1
  63. package/dist/function-registry/types.d.ts +2 -2
  64. package/dist/function-registry/worktrees.d.ts +49 -46
  65. package/dist/function-registry/worktrees.js +326 -81
  66. package/dist/function-registry/worktrees.js.map +1 -1
  67. package/dist/generated/convexSchemas.js +4 -3
  68. package/dist/generated/convexSchemas.js.map +1 -1
  69. package/dist/generated/schema-manifest.json +55 -3
  70. package/dist/generated/tableOwnership.d.ts +2 -1
  71. package/dist/generated/tableOwnership.js +2 -0
  72. package/dist/generated/tableOwnership.js.map +1 -1
  73. package/dist/generated/tier-expectations.json +6 -3
  74. package/dist/index-CV-0_VWJ.d.ts +25 -0
  75. package/dist/index.d.ts +414 -4
  76. package/dist/index.js +665 -62
  77. package/dist/index.js.map +1 -1
  78. package/dist/schema-helpers/validators.d.ts +1 -1
  79. package/dist/schema-helpers/validators.js +1 -1
  80. package/dist/schema-helpers/validators.js.map +1 -1
  81. package/dist/schemas/component-table-manifest.d.ts +74 -0
  82. package/dist/schemas/component-table-manifest.js +26 -0
  83. package/dist/schemas/component-table-manifest.js.map +1 -0
  84. package/dist/schemas/index.d.ts +2 -0
  85. package/dist/schemas/index.js +68 -10
  86. package/dist/schemas/index.js.map +1 -1
  87. package/dist/schemas/manifest.d.ts +110 -45
  88. package/dist/schemas/manifest.js +36 -9
  89. package/dist/schemas/manifest.js.map +1 -1
  90. package/dist/schemas/sl-opinion.d.ts +31 -0
  91. package/dist/schemas/sl-opinion.js +19 -0
  92. package/dist/schemas/sl-opinion.js.map +1 -0
  93. package/dist/schemas/tables/kernel/epistemic.d.ts +6 -4
  94. package/dist/schemas/tables/kernel/epistemic.js +6 -4
  95. package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
  96. package/dist/schemas/tables/kernel/infra.d.ts +13 -1
  97. package/dist/schemas/tables/kernel/infra.js +23 -1
  98. package/dist/schemas/tables/kernel/infra.js.map +1 -1
  99. package/dist/schemas/tables/kernel/worktree.d.ts +4 -4
  100. package/dist/schemas/tables/kernel/worktree.js +6 -4
  101. package/dist/schemas/tables/kernel/worktree.js.map +1 -1
  102. package/dist/schemas/tables/mc/runtime.d.ts +1 -1
  103. package/dist/schemas/tables/mc/runtime.js +1 -1
  104. package/dist/schemas/tables/mc/runtime.js.map +1 -1
  105. package/dist/sdk-methods.contract.d.ts +5 -2
  106. package/dist/{sdk-tools.contract-C2kQN_Xk.d.ts → sdk-tools.contract-S4ia0TTo.d.ts} +1 -1
  107. package/dist/sdk-tools.contract.d.ts +2 -2
  108. package/dist/sdk-tools.contract.js +154 -51
  109. package/dist/sdk-tools.contract.js.map +1 -1
  110. package/dist/{tool-contracts-WCnuE9DW.d.ts → tool-contracts-C92-9ueT.d.ts} +5 -3
  111. package/dist/tool-contracts.d.ts +1 -1
  112. package/dist/tool-contracts.js +155 -52
  113. package/dist/tool-contracts.js.map +1 -1
  114. package/dist/workflow-runtime.contract.js +1 -1
  115. package/dist/workflow-runtime.contract.js.map +1 -1
  116. package/package.json +19 -1
  117. package/dist/index-DoDXl8KS.d.ts +0 -19
package/dist/index.d.ts CHANGED
@@ -6,19 +6,429 @@ export { BELIEF_TYPE_BONUS, BeliefLatticeSeed, CONTEXT_PACK_SCHEMA_VERSION, CONT
6
6
  export { CreateDomainEventInput, DOMAIN_EVENT_TYPES, DOMAIN_EVENT_VERSION, DomainActorType, DomainEvent, DomainEventData, DomainEventType, DomainResourceType, EVENT_RETENTION_DEFAULT_DAYS, EventCursor, EventListQuery, EventListResult, ReplayEventsInput, ReplayEventsResult, WEBHOOK_MAX_ATTEMPTS, WEBHOOK_RETRY_DELAYS_MS, WebhookCreateInput, WebhookDeliveriesResult, WebhookDeliveryAttemptRecord, WebhookDeliveryRecord, WebhookDeliveryStatus, WebhookHealthResult, WebhookRecord, WebhookSecretMode, WebhookTestResult, WebhookUpdateInput, buildDomainEvent, compareEventCursor, createEventId, decodeEventCursor, emitDomainEvent, encodeEventCursor, inferActorType, isAfterCursor, normalizeRetentionDays, sortEventsByCursor } from './events.contract.js';
7
7
  export { DecodedPrefixedId, decodePrefixedId, encodePrefixedId, hasPrefixedIdPrefix } from './ids.contract.js';
8
8
  export { d as contractDsl } from './dsl-BgpoVOVQ.js';
9
- export { i as schemaContracts } from './index-DoDXl8KS.js';
9
+ export { i as schemaContracts } from './index-CV-0_VWJ.js';
10
+ export { ComponentTableManifest, ComponentTableManifestSchema } from './schemas/component-table-manifest.js';
11
+ export { SLOpinionInput, SLOpinionInputSchema } from './schemas/sl-opinion.js';
12
+ import * as zod from 'zod';
13
+ import { z } from 'zod';
10
14
  export * from './function-registry/index.js';
11
- export { t as mcpToolsContract } from './tool-contracts-WCnuE9DW.js';
15
+ export { t as mcpToolsContract } from './tool-contracts-C92-9ueT.js';
12
16
  export { EntityConnectionMatch, EntityMatchCandidate, EntityTypeMatch, OntologyEntityType, rankEntityConnections, rankEntityTypeMatches, scoreEntityConnection, scoreEntityTypeMatch } from './v1/ontologies/v1.js';
13
17
  export { LucernPrompt, LucernPromptModelHint, isLucernPrompt } from './prompt.contract.js';
14
18
  export { AddEvidenceInput, AddWorktreeInput, BeliefResult, BisectConfidenceInput, BisectResult, BranchResult, CompileContextInput, CompiledContextResult, ConfidenceResult, ContradictionResult, CreateBeliefInput, CreateBranchInput, CreateEdgeInput, EdgeResult, EvidenceResult, FlagContradictionInput, ForkBeliefInput, ForkResult, JudgmentResult, LineageResult, LucernClient, LucernClientConfig, LucernGraphMethods, LucernWorkflowMethods, MergeInput, MergeResult, ModulateConfidenceInput, OpenPullRequestInput, PullRequestResult, PushInput, PushResult, QueryLineageInput, RecordJudgmentInput, RefineBeliefInput, SearchBeliefsInput, WorktreeResult } from './sdk-methods.contract.js';
15
- export { s as sdkToolsContract } from './sdk-tools.contract-C2kQN_Xk.js';
19
+ export { s as sdkToolsContract } from './sdk-tools.contract-S4ia0TTo.js';
16
20
  export { LexicalRerankOptions, LexicalSignal, LexicalStrategy, PreparedLexicalQuery, bigramTokenize, jaccardSimilarity, prepareLexicalQuery, rankWindowScore, rerankLexicalWindow, scoreLexicalSignal, scoreLexicalSignals, stemToken, tokenOverlapScore, tokenizeSearchText, wordOverlapScore, wordTokenize } from './text-matching.contract.js';
17
21
  export { ROOT_TOPIC_ID, TopicDoc, collectTopicNeighborhood } from './v1/topics/v1.js';
18
22
  export { CANONICAL_WORKFLOW_DEFINITIONS, DEFAULT_TIER_APPROVAL_MODE, DEFAULT_WORKFLOW_AUTO_FIX_POLICY, EngineeringBriefOutput, InboxSummaryOutput, MORNING_BRIEF_WORKFLOW_ID, NIGHTLY_RECONCILIATION_WORKFLOW_ID, PipelineBriefOutput, ResearchMemoOutput, StrategyArtifactOutput, StructuredPayloadOutput, WORKFLOW_ACTION_KINDS, WORKFLOW_APPROVAL_MODES, WORKFLOW_AUTO_FIX_MODES, WORKFLOW_HOOK_EVENTS, WORKFLOW_INTEGRITY_CHECKS, WORKFLOW_MUTATION_TIERS, WORKFLOW_OUTPUT_KINDS, WORKFLOW_PROOF_ARTIFACT_KINDS, WORKFLOW_RUNTIME_SCHEMA_VERSION, WORKFLOW_RUN_STATUSES, WORKFLOW_STAFFING_HINTS, WORKFLOW_TRIGGER_KINDS, WorkflowActionContract, WorkflowActionKind, WorkflowApprovalMode, WorkflowApprovalPolicy, WorkflowAutoFixMode, WorkflowAutoFixPolicy, WorkflowDefinitionV1, WorkflowHookContract, WorkflowHookEvent, WorkflowIntegrityCheckId, WorkflowMutationTier, WorkflowOutputBase, WorkflowOutputContract, WorkflowOutputKind, WorkflowProofArtifact, WorkflowProofArtifactKind, WorkflowRunReceiptV1, WorkflowRunStatus, WorkflowStaffingHint, WorkflowTriggerContract, WorkflowTriggerKind } from './workflow-runtime.contract.js';
19
23
  import './defineFunction-DO97DKs4.js';
20
- import 'zod';
21
24
  import './defineTable-CBQ03FXl.js';
22
25
  import './idOf-DR8tkhQS.js';
23
26
  import './schemas/enums.js';
24
27
  import './schemas/manifest.js';
28
+
29
+ declare const EpistemicNodeTypeSchema: z.ZodEnum<["belief", "evidence", "question", "answer", "topic", "edge", "ontology", "lens", "contradiction"]>;
30
+ type EpistemicNodeType = z.infer<typeof EpistemicNodeTypeSchema>;
31
+ type GraphRef = {
32
+ kind: "epistemic_node";
33
+ nodeId: string;
34
+ nodeType: EpistemicNodeType;
35
+ } | {
36
+ kind: "external_belief";
37
+ ref: {
38
+ tenantId: string;
39
+ beliefId: string;
40
+ };
41
+ };
42
+ declare const GraphRefSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
43
+ kind: z.ZodLiteral<"epistemic_node">;
44
+ nodeId: z.ZodString;
45
+ nodeType: z.ZodEnum<["belief", "evidence", "question", "answer", "topic", "edge", "ontology", "lens", "contradiction"]>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ nodeType: "belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens";
48
+ nodeId: string;
49
+ kind: "epistemic_node";
50
+ }, {
51
+ nodeType: "belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens";
52
+ nodeId: string;
53
+ kind: "epistemic_node";
54
+ }>, z.ZodObject<{
55
+ kind: z.ZodLiteral<"external_belief">;
56
+ ref: z.ZodObject<{
57
+ tenantId: z.ZodString;
58
+ beliefId: z.ZodString;
59
+ }, "strip", z.ZodTypeAny, {
60
+ tenantId: string;
61
+ beliefId: string;
62
+ }, {
63
+ tenantId: string;
64
+ beliefId: string;
65
+ }>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ kind: "external_belief";
68
+ ref: {
69
+ tenantId: string;
70
+ beliefId: string;
71
+ };
72
+ }, {
73
+ kind: "external_belief";
74
+ ref: {
75
+ tenantId: string;
76
+ beliefId: string;
77
+ };
78
+ }>]>;
79
+
80
+ declare const EdgePolicyEntrySchema: z.ZodObject<{
81
+ edgeType: z.ZodString;
82
+ fromKinds: z.ZodArray<z.ZodEnum<["epistemic_node", "external_belief"]>, "many">;
83
+ fromNodeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["belief", "evidence", "question", "answer", "topic", "edge", "ontology", "lens", "contradiction"]>, "many">>;
84
+ toKinds: z.ZodArray<z.ZodEnum<["epistemic_node", "external_belief"]>, "many">;
85
+ toNodeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["belief", "evidence", "question", "answer", "topic", "edge", "ontology", "lens", "contradiction"]>, "many">>;
86
+ description: z.ZodString;
87
+ }, "strip", z.ZodTypeAny, {
88
+ description: string;
89
+ edgeType: string;
90
+ fromKinds: ("epistemic_node" | "external_belief")[];
91
+ toKinds: ("epistemic_node" | "external_belief")[];
92
+ fromNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
93
+ toNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
94
+ }, {
95
+ description: string;
96
+ edgeType: string;
97
+ fromKinds: ("epistemic_node" | "external_belief")[];
98
+ toKinds: ("epistemic_node" | "external_belief")[];
99
+ fromNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
100
+ toNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
101
+ }>;
102
+ declare const EdgePolicyManifestSchema: z.ZodObject<{
103
+ manifestVersion: z.ZodLiteral<"1.0.0">;
104
+ policies: z.ZodArray<z.ZodObject<{
105
+ edgeType: z.ZodString;
106
+ fromKinds: z.ZodArray<z.ZodEnum<["epistemic_node", "external_belief"]>, "many">;
107
+ fromNodeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["belief", "evidence", "question", "answer", "topic", "edge", "ontology", "lens", "contradiction"]>, "many">>;
108
+ toKinds: z.ZodArray<z.ZodEnum<["epistemic_node", "external_belief"]>, "many">;
109
+ toNodeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["belief", "evidence", "question", "answer", "topic", "edge", "ontology", "lens", "contradiction"]>, "many">>;
110
+ description: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ description: string;
113
+ edgeType: string;
114
+ fromKinds: ("epistemic_node" | "external_belief")[];
115
+ toKinds: ("epistemic_node" | "external_belief")[];
116
+ fromNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
117
+ toNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
118
+ }, {
119
+ description: string;
120
+ edgeType: string;
121
+ fromKinds: ("epistemic_node" | "external_belief")[];
122
+ toKinds: ("epistemic_node" | "external_belief")[];
123
+ fromNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
124
+ toNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
125
+ }>, "many">;
126
+ }, "strip", z.ZodTypeAny, {
127
+ manifestVersion: "1.0.0";
128
+ policies: {
129
+ description: string;
130
+ edgeType: string;
131
+ fromKinds: ("epistemic_node" | "external_belief")[];
132
+ toKinds: ("epistemic_node" | "external_belief")[];
133
+ fromNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
134
+ toNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
135
+ }[];
136
+ }, {
137
+ manifestVersion: "1.0.0";
138
+ policies: {
139
+ description: string;
140
+ edgeType: string;
141
+ fromKinds: ("epistemic_node" | "external_belief")[];
142
+ toKinds: ("epistemic_node" | "external_belief")[];
143
+ fromNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
144
+ toNodeTypes?: ("belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "answer" | "lens")[] | undefined;
145
+ }[];
146
+ }>;
147
+ type EdgePolicyEntry = z.infer<typeof EdgePolicyEntrySchema>;
148
+ type EdgePolicyManifest = z.infer<typeof EdgePolicyManifestSchema>;
149
+ type EdgePolicyViolation = {
150
+ code: "POLICY_VIOLATION";
151
+ edgeType: string;
152
+ from: GraphRef;
153
+ to: GraphRef;
154
+ };
155
+ declare function findEdgePolicy(manifest: EdgePolicyManifest, edgeType: string): EdgePolicyEntry | undefined;
156
+ declare function assertEdgePolicyAllowed(manifest: EdgePolicyManifest, edgeType: string, from: GraphRef, to: GraphRef): void;
157
+
158
+ declare const edgePolicyManifest: {
159
+ manifestVersion: "1.0.0";
160
+ policies: ({
161
+ edgeType: string;
162
+ fromKinds: "epistemic_node"[];
163
+ fromNodeTypes: "evidence"[];
164
+ toKinds: "epistemic_node"[];
165
+ toNodeTypes: "evidence"[];
166
+ description: string;
167
+ } | {
168
+ edgeType: string;
169
+ fromKinds: "epistemic_node"[];
170
+ fromNodeTypes: "evidence"[];
171
+ toKinds: "epistemic_node"[];
172
+ toNodeTypes: "belief"[];
173
+ description: string;
174
+ } | {
175
+ edgeType: string;
176
+ fromKinds: "epistemic_node"[];
177
+ fromNodeTypes: "evidence"[];
178
+ toKinds: "epistemic_node"[];
179
+ toNodeTypes: "question"[];
180
+ description: string;
181
+ })[];
182
+ };
183
+
184
+ interface ProjectionDef<TInput, TConvexArgs> {
185
+ contractName: string;
186
+ inputSchema: z.ZodSchema<TInput>;
187
+ project: (input: TInput) => TConvexArgs;
188
+ convexArgsValidator: unknown;
189
+ }
190
+ declare function defineProjection<I, C>(def: ProjectionDef<I, C>): ProjectionDef<I, C>;
191
+
192
+ declare const createEvidenceProjection: ProjectionDef<z.objectInputType<{
193
+ projectId: z.ZodOptional<z.ZodString>;
194
+ topicId: z.ZodOptional<z.ZodString>;
195
+ text: z.ZodOptional<z.ZodString>;
196
+ canonicalText: z.ZodOptional<z.ZodString>;
197
+ title: z.ZodOptional<z.ZodString>;
198
+ content: z.ZodOptional<z.ZodString>;
199
+ contentType: z.ZodOptional<z.ZodString>;
200
+ kind: z.ZodOptional<z.ZodString>;
201
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
202
+ source: z.ZodOptional<z.ZodString>;
203
+ sourceUrl: z.ZodOptional<z.ZodString>;
204
+ sourceType: z.ZodOptional<z.ZodString>;
205
+ externalSourceType: z.ZodOptional<z.ZodString>;
206
+ sourceQuestionId: z.ZodOptional<z.ZodString>;
207
+ methodology: z.ZodOptional<z.ZodString>;
208
+ informationAsymmetry: z.ZodOptional<z.ZodString>;
209
+ sourceDescription: z.ZodOptional<z.ZodString>;
210
+ targetId: z.ZodOptional<z.ZodString>;
211
+ targetNodeId: z.ZodOptional<z.ZodString>;
212
+ linkedBeliefNodeId: z.ZodOptional<z.ZodString>;
213
+ evidenceRelation: z.ZodOptional<z.ZodEnum<["supports", "contradicts", "neutral"]>>;
214
+ confidence: z.ZodOptional<z.ZodNumber>;
215
+ weight: z.ZodOptional<z.ZodNumber>;
216
+ reasoning: z.ZodOptional<z.ZodString>;
217
+ rationale: z.ZodString;
218
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
219
+ trustedBypassAccessCheck: z.ZodOptional<z.ZodBoolean>;
220
+ }, z.ZodTypeAny, "passthrough">, Record<string, unknown>>;
221
+
222
+ declare const listBeliefsProjection: ProjectionDef<{
223
+ topicId: string;
224
+ status?: "active" | "archived" | "unscored" | "scored" | "superseded" | undefined;
225
+ worktreeId?: string | undefined;
226
+ limit?: number | undefined;
227
+ minConfidence?: number | undefined;
228
+ includeEdgeAssociated?: boolean | undefined;
229
+ }, Record<string, unknown>>;
230
+
231
+ declare const listTasksProjection: ProjectionDef<{
232
+ topicId: string;
233
+ status?: "blocked" | "in_progress" | "todo" | "done" | undefined;
234
+ worktreeId?: string | undefined;
235
+ limit?: number | undefined;
236
+ linkedWorktreeId?: string | undefined;
237
+ }, Record<string, unknown>>;
238
+
239
+ declare const modulateConfidenceProjection: ProjectionDef<{
240
+ trigger: "evidence_added" | "evidence_removed" | "contradiction_detected" | "contradiction_resolved" | "agent_assessment" | "worktree_outcome" | "worktree_completed" | "fusion" | "discount" | "deduction" | "backfill_synthetic" | "answer_recorded";
241
+ rationale: string;
242
+ belief?: number | undefined;
243
+ worktreeId?: string | undefined;
244
+ disbelief?: number | undefined;
245
+ uncertainty?: number | undefined;
246
+ baseRate?: number | undefined;
247
+ triggeringEvidenceId?: string | undefined;
248
+ triggeringQuestionId?: string | undefined;
249
+ triggeringAnswerId?: string | undefined;
250
+ triggeringContradictionId?: string | undefined;
251
+ triggeringWorktreeId?: string | undefined;
252
+ beliefNodeId?: string | undefined;
253
+ nodeId?: string | undefined;
254
+ trustedBypassAccessCheck?: boolean | undefined;
255
+ opinion?: {
256
+ belief: number;
257
+ disbelief: number;
258
+ uncertainty: number;
259
+ baseRate: number;
260
+ } | undefined;
261
+ provenance?: {
262
+ evidence?: string | undefined;
263
+ question?: string | undefined;
264
+ contradiction?: string | undefined;
265
+ worktree?: string | undefined;
266
+ answer?: string | undefined;
267
+ } | undefined;
268
+ }, {
269
+ nodeId: string;
270
+ worktreeId: string | undefined;
271
+ belief: number;
272
+ disbelief: number;
273
+ uncertainty: number;
274
+ baseRate: number;
275
+ trigger: "evidence_added" | "evidence_removed" | "contradiction_detected" | "contradiction_resolved" | "agent_assessment" | "worktree_outcome" | "worktree_completed" | "fusion" | "discount" | "deduction" | "backfill_synthetic";
276
+ triggeringEvidenceId: string | undefined;
277
+ triggeringQuestionId: string | undefined;
278
+ triggeringAnswerId: string | undefined;
279
+ triggeringContradictionId: string | undefined;
280
+ triggeringWorktreeId: string | undefined;
281
+ rationale: string;
282
+ trustedBypassAccessCheck: boolean;
283
+ }>;
284
+
285
+ declare const projections: {
286
+ readonly create_evidence: ProjectionDef<zod.objectInputType<{
287
+ projectId: zod.ZodOptional<zod.ZodString>;
288
+ topicId: zod.ZodOptional<zod.ZodString>;
289
+ text: zod.ZodOptional<zod.ZodString>;
290
+ canonicalText: zod.ZodOptional<zod.ZodString>;
291
+ title: zod.ZodOptional<zod.ZodString>;
292
+ content: zod.ZodOptional<zod.ZodString>;
293
+ contentType: zod.ZodOptional<zod.ZodString>;
294
+ kind: zod.ZodOptional<zod.ZodString>;
295
+ tags: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
296
+ source: zod.ZodOptional<zod.ZodString>;
297
+ sourceUrl: zod.ZodOptional<zod.ZodString>;
298
+ sourceType: zod.ZodOptional<zod.ZodString>;
299
+ externalSourceType: zod.ZodOptional<zod.ZodString>;
300
+ sourceQuestionId: zod.ZodOptional<zod.ZodString>;
301
+ methodology: zod.ZodOptional<zod.ZodString>;
302
+ informationAsymmetry: zod.ZodOptional<zod.ZodString>;
303
+ sourceDescription: zod.ZodOptional<zod.ZodString>;
304
+ targetId: zod.ZodOptional<zod.ZodString>;
305
+ targetNodeId: zod.ZodOptional<zod.ZodString>;
306
+ linkedBeliefNodeId: zod.ZodOptional<zod.ZodString>;
307
+ evidenceRelation: zod.ZodOptional<zod.ZodEnum<["supports", "contradicts", "neutral"]>>;
308
+ confidence: zod.ZodOptional<zod.ZodNumber>;
309
+ weight: zod.ZodOptional<zod.ZodNumber>;
310
+ reasoning: zod.ZodOptional<zod.ZodString>;
311
+ rationale: zod.ZodString;
312
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
313
+ trustedBypassAccessCheck: zod.ZodOptional<zod.ZodBoolean>;
314
+ }, zod.ZodTypeAny, "passthrough">, Record<string, unknown>>;
315
+ readonly list_beliefs: ProjectionDef<{
316
+ topicId: string;
317
+ status?: "active" | "archived" | "unscored" | "scored" | "superseded" | undefined;
318
+ worktreeId?: string | undefined;
319
+ limit?: number | undefined;
320
+ minConfidence?: number | undefined;
321
+ includeEdgeAssociated?: boolean | undefined;
322
+ }, Record<string, unknown>>;
323
+ readonly list_tasks: ProjectionDef<{
324
+ topicId: string;
325
+ status?: "blocked" | "in_progress" | "todo" | "done" | undefined;
326
+ worktreeId?: string | undefined;
327
+ limit?: number | undefined;
328
+ linkedWorktreeId?: string | undefined;
329
+ }, Record<string, unknown>>;
330
+ readonly modulate_confidence: ProjectionDef<{
331
+ trigger: "evidence_added" | "evidence_removed" | "contradiction_detected" | "contradiction_resolved" | "agent_assessment" | "worktree_outcome" | "worktree_completed" | "fusion" | "discount" | "deduction" | "backfill_synthetic" | "answer_recorded";
332
+ rationale: string;
333
+ belief?: number | undefined;
334
+ worktreeId?: string | undefined;
335
+ disbelief?: number | undefined;
336
+ uncertainty?: number | undefined;
337
+ baseRate?: number | undefined;
338
+ triggeringEvidenceId?: string | undefined;
339
+ triggeringQuestionId?: string | undefined;
340
+ triggeringAnswerId?: string | undefined;
341
+ triggeringContradictionId?: string | undefined;
342
+ triggeringWorktreeId?: string | undefined;
343
+ beliefNodeId?: string | undefined;
344
+ nodeId?: string | undefined;
345
+ trustedBypassAccessCheck?: boolean | undefined;
346
+ opinion?: {
347
+ belief: number;
348
+ disbelief: number;
349
+ uncertainty: number;
350
+ baseRate: number;
351
+ } | undefined;
352
+ provenance?: {
353
+ evidence?: string | undefined;
354
+ question?: string | undefined;
355
+ contradiction?: string | undefined;
356
+ worktree?: string | undefined;
357
+ answer?: string | undefined;
358
+ } | undefined;
359
+ }, {
360
+ nodeId: string;
361
+ worktreeId: string | undefined;
362
+ belief: number;
363
+ disbelief: number;
364
+ uncertainty: number;
365
+ baseRate: number;
366
+ trigger: "evidence_added" | "evidence_removed" | "contradiction_detected" | "contradiction_resolved" | "agent_assessment" | "worktree_outcome" | "worktree_completed" | "fusion" | "discount" | "deduction" | "backfill_synthetic";
367
+ triggeringEvidenceId: string | undefined;
368
+ triggeringQuestionId: string | undefined;
369
+ triggeringAnswerId: string | undefined;
370
+ triggeringContradictionId: string | undefined;
371
+ triggeringWorktreeId: string | undefined;
372
+ rationale: string;
373
+ trustedBypassAccessCheck: boolean;
374
+ }>;
375
+ };
376
+ type ProjectionRegistry = typeof projections;
377
+
378
+ type InvariantId = string;
379
+ type CheckerKind = "ast" | "manifest" | "runtime";
380
+ type InvariantSeverity = "block_publish" | "block_pr" | "warn";
381
+ interface CheckContext {
382
+ repoRoot: string;
383
+ projections: ProjectionRegistry;
384
+ }
385
+ interface InvariantResult {
386
+ status: "passed" | "failed" | "skipped";
387
+ evidenceRefs: string[];
388
+ reason?: string;
389
+ }
390
+ interface InvariantRule {
391
+ invariant: InvariantId;
392
+ description: string;
393
+ checker: CheckerKind;
394
+ severity: InvariantSeverity;
395
+ evaluate: (ctx: CheckContext) => Promise<InvariantResult>;
396
+ }
397
+ declare const InvariantManifestSchema: z.ZodObject<{
398
+ manifestVersion: z.ZodLiteral<"1.0.0">;
399
+ rules: z.ZodArray<z.ZodObject<{
400
+ invariant: z.ZodString;
401
+ description: z.ZodString;
402
+ checker: z.ZodEnum<["ast", "manifest", "runtime"]>;
403
+ severity: z.ZodEnum<["block_publish", "block_pr", "warn"]>;
404
+ }, "strip", z.ZodTypeAny, {
405
+ invariant: string;
406
+ description: string;
407
+ severity: "warn" | "block_publish" | "block_pr";
408
+ checker: "runtime" | "ast" | "manifest";
409
+ }, {
410
+ invariant: string;
411
+ description: string;
412
+ severity: "warn" | "block_publish" | "block_pr";
413
+ checker: "runtime" | "ast" | "manifest";
414
+ }>, "many">;
415
+ }, "strip", z.ZodTypeAny, {
416
+ rules: {
417
+ invariant: string;
418
+ description: string;
419
+ severity: "warn" | "block_publish" | "block_pr";
420
+ checker: "runtime" | "ast" | "manifest";
421
+ }[];
422
+ manifestVersion: "1.0.0";
423
+ }, {
424
+ rules: {
425
+ invariant: string;
426
+ description: string;
427
+ severity: "warn" | "block_publish" | "block_pr";
428
+ checker: "runtime" | "ast" | "manifest";
429
+ }[];
430
+ manifestVersion: "1.0.0";
431
+ }>;
432
+ type InvariantManifest = z.infer<typeof InvariantManifestSchema>;
433
+
434
+ export { type CheckContext, type CheckerKind, type EdgePolicyEntry, EdgePolicyEntrySchema, type EdgePolicyManifest, EdgePolicyManifestSchema, type EdgePolicyViolation, type EpistemicNodeType, EpistemicNodeTypeSchema, type GraphRef, GraphRefSchema, type InvariantId, type InvariantManifest, InvariantManifestSchema, type InvariantResult, type InvariantRule, type InvariantSeverity, type ProjectionDef, type ProjectionRegistry, assertEdgePolicyAllowed, createEvidenceProjection, defineProjection, edgePolicyManifest, findEdgePolicy, listBeliefsProjection, listTasksProjection, modulateConfidenceProjection, projections };