@lucern/contracts 0.1.2-alpha.4 → 0.3.0-alpha.0
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.
- package/dist/defineFunction-DO97DKs4.d.ts +14 -0
- package/dist/defineTable-CBQ03FXl.d.ts +36 -0
- package/dist/dsl-BgpoVOVQ.d.ts +110 -0
- package/dist/dsl.d.ts +5 -0
- package/dist/dsl.js +675 -0
- package/dist/dsl.js.map +1 -0
- package/dist/function-registry/beliefs.d.ts +519 -0
- package/dist/function-registry/beliefs.js +4326 -0
- package/dist/function-registry/beliefs.js.map +1 -0
- package/dist/function-registry/coding.d.ts +347 -0
- package/dist/function-registry/coding.js +4268 -0
- package/dist/function-registry/coding.js.map +1 -0
- package/dist/function-registry/context.d.ts +218 -0
- package/dist/function-registry/context.js +4175 -0
- package/dist/function-registry/context.js.map +1 -0
- package/dist/function-registry/contracts.d.ts +218 -0
- package/dist/function-registry/contracts.js +4143 -0
- package/dist/function-registry/contracts.js.map +1 -0
- package/dist/function-registry/coordination.d.ts +476 -0
- package/dist/function-registry/coordination.js +4254 -0
- package/dist/function-registry/coordination.js.map +1 -0
- package/dist/function-registry/edges.d.ts +175 -0
- package/dist/function-registry/edges.js +4150 -0
- package/dist/function-registry/edges.js.map +1 -0
- package/dist/function-registry/evidence.d.ts +433 -0
- package/dist/function-registry/evidence.js +4302 -0
- package/dist/function-registry/evidence.js.map +1 -0
- package/dist/function-registry/graph.d.ts +648 -0
- package/dist/function-registry/graph.js +4329 -0
- package/dist/function-registry/graph.js.map +1 -0
- package/dist/function-registry/helpers.d.ts +86 -0
- package/dist/function-registry/helpers.js +4131 -0
- package/dist/function-registry/helpers.js.map +1 -0
- package/dist/function-registry/identity.d.ts +218 -0
- package/dist/function-registry/identity.js +4154 -0
- package/dist/function-registry/identity.js.map +1 -0
- package/dist/function-registry/index.d.ts +32 -0
- package/dist/function-registry/index.js +4235 -0
- package/dist/function-registry/index.js.map +1 -0
- package/dist/function-registry/judgments.d.ts +175 -0
- package/dist/function-registry/judgments.js +4157 -0
- package/dist/function-registry/judgments.js.map +1 -0
- package/dist/function-registry/legacy.d.ts +132 -0
- package/dist/function-registry/legacy.js +4118 -0
- package/dist/function-registry/legacy.js.map +1 -0
- package/dist/function-registry/lenses.d.ts +261 -0
- package/dist/function-registry/lenses.js +4160 -0
- package/dist/function-registry/lenses.js.map +1 -0
- package/dist/function-registry/manifest.d.ts +36 -0
- package/dist/function-registry/manifest.js +366 -0
- package/dist/function-registry/manifest.js.map +1 -0
- package/dist/function-registry/ontologies.d.ts +562 -0
- package/dist/function-registry/ontologies.js +4292 -0
- package/dist/function-registry/ontologies.js.map +1 -0
- package/dist/function-registry/pipeline.d.ts +218 -0
- package/dist/function-registry/pipeline.js +4143 -0
- package/dist/function-registry/pipeline.js.map +1 -0
- package/dist/function-registry/questions.d.ts +605 -0
- package/dist/function-registry/questions.js +4329 -0
- package/dist/function-registry/questions.js.map +1 -0
- package/dist/function-registry/tasks.d.ts +261 -0
- package/dist/function-registry/tasks.js +4166 -0
- package/dist/function-registry/tasks.js.map +1 -0
- package/dist/function-registry/topics.d.ts +304 -0
- package/dist/function-registry/topics.js +4193 -0
- package/dist/function-registry/topics.js.map +1 -0
- package/dist/function-registry/types.d.ts +84 -0
- package/dist/function-registry/types.js +3 -0
- package/dist/function-registry/types.js.map +1 -0
- package/dist/function-registry/worktrees.d.ts +476 -0
- package/dist/function-registry/worktrees.js +4277 -0
- package/dist/function-registry/worktrees.js.map +1 -0
- package/dist/generated/convexSchemas.d.ts +20 -0
- package/dist/generated/convexSchemas.js +160 -0
- package/dist/generated/convexSchemas.js.map +1 -0
- package/dist/generated/schema-manifest.json +5179 -0
- package/dist/generated/tableOwnership.d.ts +127 -0
- package/dist/generated/tableOwnership.js +276 -0
- package/dist/generated/tableOwnership.js.map +1 -0
- package/dist/generated/tier-expectations.json +360 -0
- package/dist/idOf-DR8tkhQS.d.ts +10 -0
- package/dist/index-DoDXl8KS.d.ts +19 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.js +5739 -315
- package/dist/index.js.map +1 -1
- package/dist/schema-helpers/enumValidation.d.ts +17 -0
- package/dist/schema-helpers/enumValidation.js +143 -0
- package/dist/schema-helpers/enumValidation.js.map +1 -0
- package/dist/schema-helpers/spine/nodes/decision.d.ts +19 -0
- package/dist/schema-helpers/spine/nodes/decision.js +81 -0
- package/dist/schema-helpers/spine/nodes/decision.js.map +1 -0
- package/dist/schema-helpers/spine/tables/epistemicNodes.d.ts +9 -0
- package/dist/schema-helpers/spine/tables/epistemicNodes.js +62 -0
- package/dist/schema-helpers/spine/tables/epistemicNodes.js.map +1 -0
- package/dist/schema-helpers/topicIds.d.ts +17 -0
- package/dist/schema-helpers/topicIds.js +21 -0
- package/dist/schema-helpers/topicIds.js.map +1 -0
- package/dist/schema-helpers/topicLegacyScope.d.ts +19 -0
- package/dist/schema-helpers/topicLegacyScope.js +44 -0
- package/dist/schema-helpers/topicLegacyScope.js.map +1 -0
- package/dist/schema-helpers/validators.d.ts +8 -0
- package/dist/schema-helpers/validators.js +18 -0
- package/dist/schema-helpers/validators.js.map +1 -0
- package/dist/schemas/enums.d.ts +12 -0
- package/dist/schemas/enums.js +11 -0
- package/dist/schemas/enums.js.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.js +4240 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/manifest.d.ts +24521 -0
- package/dist/schemas/manifest.js +4242 -0
- package/dist/schemas/manifest.js.map +1 -0
- package/dist/schemas/tables/identity/agent.d.ts +21 -0
- package/dist/schemas/tables/identity/agent.js +41 -0
- package/dist/schemas/tables/identity/agent.js.map +1 -0
- package/dist/schemas/tables/identity/epistemic.d.ts +18 -0
- package/dist/schemas/tables/identity/epistemic.js +38 -0
- package/dist/schemas/tables/identity/epistemic.js.map +1 -0
- package/dist/schemas/tables/identity/model.d.ts +62 -0
- package/dist/schemas/tables/identity/model.js +110 -0
- package/dist/schemas/tables/identity/model.js.map +1 -0
- package/dist/schemas/tables/identity/platform.d.ts +392 -0
- package/dist/schemas/tables/identity/platform.js +475 -0
- package/dist/schemas/tables/identity/platform.js.map +1 -0
- package/dist/schemas/tables/identity/project.d.ts +22 -0
- package/dist/schemas/tables/identity/project.js +48 -0
- package/dist/schemas/tables/identity/project.js.map +1 -0
- package/dist/schemas/tables/identity/user.d.ts +26 -0
- package/dist/schemas/tables/identity/user.js +47 -0
- package/dist/schemas/tables/identity/user.js.map +1 -0
- package/dist/schemas/tables/kernel/config.d.ts +20 -0
- package/dist/schemas/tables/kernel/config.js +39 -0
- package/dist/schemas/tables/kernel/config.js.map +1 -0
- package/dist/schemas/tables/kernel/coordination.d.ts +30 -0
- package/dist/schemas/tables/kernel/coordination.js +57 -0
- package/dist/schemas/tables/kernel/coordination.js.map +1 -0
- package/dist/schemas/tables/kernel/decision.d.ts +246 -0
- package/dist/schemas/tables/kernel/decision.js +371 -0
- package/dist/schemas/tables/kernel/decision.js.map +1 -0
- package/dist/schemas/tables/kernel/embedding.d.ts +18 -0
- package/dist/schemas/tables/kernel/embedding.js +48 -0
- package/dist/schemas/tables/kernel/embedding.js.map +1 -0
- package/dist/schemas/tables/kernel/epistemic.d.ts +315 -0
- package/dist/schemas/tables/kernel/epistemic.js +327 -0
- package/dist/schemas/tables/kernel/epistemic.js.map +1 -0
- package/dist/schemas/tables/kernel/idempotency.d.ts +13 -0
- package/dist/schemas/tables/kernel/idempotency.js +31 -0
- package/dist/schemas/tables/kernel/idempotency.js.map +1 -0
- package/dist/schemas/tables/kernel/infra.d.ts +171 -0
- package/dist/schemas/tables/kernel/infra.js +160 -0
- package/dist/schemas/tables/kernel/infra.js.map +1 -0
- package/dist/schemas/tables/kernel/intelligence.d.ts +293 -0
- package/dist/schemas/tables/kernel/intelligence.js +207 -0
- package/dist/schemas/tables/kernel/intelligence.js.map +1 -0
- package/dist/schemas/tables/kernel/lens.d.ts +192 -0
- package/dist/schemas/tables/kernel/lens.js +122 -0
- package/dist/schemas/tables/kernel/lens.js.map +1 -0
- package/dist/schemas/tables/kernel/ontology.d.ts +89 -0
- package/dist/schemas/tables/kernel/ontology.js +91 -0
- package/dist/schemas/tables/kernel/ontology.js.map +1 -0
- package/dist/schemas/tables/kernel/platform.d.ts +353 -0
- package/dist/schemas/tables/kernel/platform.js +349 -0
- package/dist/schemas/tables/kernel/platform.js.map +1 -0
- package/dist/schemas/tables/kernel/spine.d.ts +206 -0
- package/dist/schemas/tables/kernel/spine.js +243 -0
- package/dist/schemas/tables/kernel/spine.js.map +1 -0
- package/dist/schemas/tables/kernel/task.d.ts +614 -0
- package/dist/schemas/tables/kernel/task.js +189 -0
- package/dist/schemas/tables/kernel/task.js.map +1 -0
- package/dist/schemas/tables/kernel/topic.d.ts +25 -0
- package/dist/schemas/tables/kernel/topic.js +62 -0
- package/dist/schemas/tables/kernel/topic.js.map +1 -0
- package/dist/schemas/tables/kernel/workflow.d.ts +45 -0
- package/dist/schemas/tables/kernel/workflow.js +94 -0
- package/dist/schemas/tables/kernel/workflow.js.map +1 -0
- package/dist/schemas/tables/kernel/worktree.d.ts +823 -0
- package/dist/schemas/tables/kernel/worktree.js +328 -0
- package/dist/schemas/tables/kernel/worktree.js.map +1 -0
- package/dist/schemas/tables/mc/identity.d.ts +134 -0
- package/dist/schemas/tables/mc/identity.js +221 -0
- package/dist/schemas/tables/mc/identity.js.map +1 -0
- package/dist/schemas/tables/mc/methodology.d.ts +46 -0
- package/dist/schemas/tables/mc/methodology.js +69 -0
- package/dist/schemas/tables/mc/methodology.js.map +1 -0
- package/dist/schemas/tables/mc/pack.d.ts +540 -0
- package/dist/schemas/tables/mc/pack.js +294 -0
- package/dist/schemas/tables/mc/pack.js.map +1 -0
- package/dist/schemas/tables/mc/policy.d.ts +57 -0
- package/dist/schemas/tables/mc/policy.js +121 -0
- package/dist/schemas/tables/mc/policy.js.map +1 -0
- package/dist/schemas/tables/mc/registry.d.ts +155 -0
- package/dist/schemas/tables/mc/registry.js +164 -0
- package/dist/schemas/tables/mc/registry.js.map +1 -0
- package/dist/schemas/tables/mc/runtime.d.ts +119 -0
- package/dist/schemas/tables/mc/runtime.js +199 -0
- package/dist/schemas/tables/mc/runtime.js.map +1 -0
- package/dist/schemas/tables/mc/tenant.d.ts +106 -0
- package/dist/schemas/tables/mc/tenant.js +114 -0
- package/dist/schemas/tables/mc/tenant.js.map +1 -0
- package/dist/schemas/tables/mc/workspace.d.ts +28 -0
- package/dist/schemas/tables/mc/workspace.js +52 -0
- package/dist/schemas/tables/mc/workspace.js.map +1 -0
- package/dist/{sdk-tools.contract-BnV0hKLp.d.ts → sdk-tools.contract-C2kQN_Xk.d.ts} +3 -7
- package/dist/sdk-tools.contract.d.ts +2 -2
- package/dist/sdk-tools.contract.js +664 -175
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/tool-contracts-WCnuE9DW.d.ts +288 -0
- package/dist/tool-contracts.d.ts +1 -0
- package/dist/{mcp-tools.contract.js → tool-contracts.js} +666 -116
- package/dist/tool-contracts.js.map +1 -0
- package/package.json +119 -2
- package/dist/mcp-tools.contract-D8kXcP6d.d.ts +0 -254
- package/dist/mcp-tools.contract.d.ts +0 -1
- package/dist/mcp-tools.contract.js.map +0 -1
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { T as TableContract } from '../../../defineTable-CBQ03FXl.js';
|
|
3
|
+
import { C as ConvexIdSchema } from '../../../idOf-DR8tkhQS.js';
|
|
4
|
+
|
|
5
|
+
declare const beliefConfidence: TableContract<{
|
|
6
|
+
beliefId: z.ZodString;
|
|
7
|
+
belief: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
disbelief: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
uncertainty: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
baseRate: z.ZodNumber;
|
|
11
|
+
slOperator: z.ZodOptional<z.ZodString>;
|
|
12
|
+
confidence: z.ZodNumber;
|
|
13
|
+
confidenceLevel: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
|
|
14
|
+
valence: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
certainty: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
assessedAt: z.ZodNumber;
|
|
17
|
+
assessedBy: z.ZodString;
|
|
18
|
+
trigger: z.ZodEnum<["initial", "evidence_added", "evidence_removed", "contradiction_detected", "contradiction_resolved", "manual", "decay", "propagation", "agent_assessment", "worktree_outcome", "worktree_completed", "fusion", "discount", "deduction", "backfill_synthetic"]>;
|
|
19
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
20
|
+
triggeringEvidenceId: z.ZodOptional<z.ZodString>;
|
|
21
|
+
triggeringEvidenceIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
22
|
+
triggeringContradictionId: z.ZodOptional<ConvexIdSchema<"contradictions">>;
|
|
23
|
+
triggeringWorktreeId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
triggeringAgentId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
isAgentAssessment: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
}>;
|
|
27
|
+
declare const beliefEvidenceLinks: TableContract<{
|
|
28
|
+
beliefId: z.ZodString;
|
|
29
|
+
insightId: z.ZodString;
|
|
30
|
+
relation: z.ZodEnum<["supports", "contradicts"]>;
|
|
31
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
33
|
+
status: z.ZodOptional<z.ZodEnum<["suggested", "approved", "dismissed"]>>;
|
|
34
|
+
createdBy: z.ZodString;
|
|
35
|
+
createdAt: z.ZodNumber;
|
|
36
|
+
}>;
|
|
37
|
+
declare const beliefHistory: TableContract<{
|
|
38
|
+
beliefId: z.ZodString;
|
|
39
|
+
timestamp: z.ZodNumber;
|
|
40
|
+
previousStatus: z.ZodOptional<z.ZodString>;
|
|
41
|
+
newStatus: z.ZodString;
|
|
42
|
+
justification: z.ZodOptional<z.ZodString>;
|
|
43
|
+
triggeredByEvidenceIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
44
|
+
triggeredByUserId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}>;
|
|
46
|
+
declare const beliefScenarios: TableContract<{
|
|
47
|
+
topicId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
testedBeliefId: z.ZodString;
|
|
49
|
+
scenarioType: z.ZodEnum<["falsification", "strengthening", "alternative", "collapse", "critical_path"]>;
|
|
50
|
+
assumedState: z.ZodEnum<["false", "true", "weakened", "strengthened"]>;
|
|
51
|
+
title: z.ZodString;
|
|
52
|
+
description: z.ZodString;
|
|
53
|
+
cascadeEffects: z.ZodArray<z.ZodObject<{
|
|
54
|
+
beliefId: z.ZodString;
|
|
55
|
+
beliefText: z.ZodString;
|
|
56
|
+
currentConfidence: z.ZodString;
|
|
57
|
+
projectedConfidence: z.ZodString;
|
|
58
|
+
reason: z.ZodString;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
beliefId: string;
|
|
61
|
+
beliefText: string;
|
|
62
|
+
currentConfidence: string;
|
|
63
|
+
projectedConfidence: string;
|
|
64
|
+
reason: string;
|
|
65
|
+
}, {
|
|
66
|
+
beliefId: string;
|
|
67
|
+
beliefText: string;
|
|
68
|
+
currentConfidence: string;
|
|
69
|
+
projectedConfidence: string;
|
|
70
|
+
reason: string;
|
|
71
|
+
}>, "many">;
|
|
72
|
+
thesisImpact: z.ZodEnum<["thesis_fails", "thesis_weakens", "pillar_fails", "localized", "minimal"]>;
|
|
73
|
+
pillarImpacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
pillar: z.ZodString;
|
|
75
|
+
impactLevel: z.ZodString;
|
|
76
|
+
reason: z.ZodString;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
reason: string;
|
|
79
|
+
pillar: string;
|
|
80
|
+
impactLevel: string;
|
|
81
|
+
}, {
|
|
82
|
+
reason: string;
|
|
83
|
+
pillar: string;
|
|
84
|
+
impactLevel: string;
|
|
85
|
+
}>, "many">>;
|
|
86
|
+
keyInsights: z.ZodArray<z.ZodString, "many">;
|
|
87
|
+
recommendedActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
|
+
action: z.ZodString;
|
|
89
|
+
priority: z.ZodString;
|
|
90
|
+
rationale: z.ZodString;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
action: string;
|
|
93
|
+
rationale: string;
|
|
94
|
+
priority: string;
|
|
95
|
+
}, {
|
|
96
|
+
action: string;
|
|
97
|
+
rationale: string;
|
|
98
|
+
priority: string;
|
|
99
|
+
}>, "many">>;
|
|
100
|
+
sourceWorktreeId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
sourceChatId: z.ZodOptional<ConvexIdSchema<"chats">>;
|
|
102
|
+
sourceMessageId: z.ZodOptional<ConvexIdSchema<"messages">>;
|
|
103
|
+
createdAt: z.ZodNumber;
|
|
104
|
+
createdBy: z.ZodString;
|
|
105
|
+
}>;
|
|
106
|
+
declare const contractEvaluations: TableContract<{
|
|
107
|
+
contractId: z.ZodString;
|
|
108
|
+
beliefNodeId: z.ZodString;
|
|
109
|
+
result: z.ZodEnum<["confirmed", "disconfirmed", "partial", "expired", "error", "inconclusive"]>;
|
|
110
|
+
evaluatedAt: z.ZodNumber;
|
|
111
|
+
evaluator: z.ZodString;
|
|
112
|
+
trigger: z.ZodString;
|
|
113
|
+
resultData: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny, "many">]>>;
|
|
114
|
+
modulationApplied: z.ZodBoolean;
|
|
115
|
+
confidenceDelta: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
confidenceBefore: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
confidenceAfter: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
beliefConfidenceId: z.ZodOptional<ConvexIdSchema<"beliefConfidence">>;
|
|
119
|
+
modulationRationale: z.ZodOptional<z.ZodString>;
|
|
120
|
+
topicId: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}>;
|
|
122
|
+
declare const contradictions: TableContract<{
|
|
123
|
+
topicId: z.ZodOptional<z.ZodString>;
|
|
124
|
+
beliefId: z.ZodString;
|
|
125
|
+
supportingInsightIds: z.ZodArray<z.ZodString, "many">;
|
|
126
|
+
contradictingInsightIds: z.ZodArray<z.ZodString, "many">;
|
|
127
|
+
resolutionStatus: z.ZodEnum<["unresolved", "investigating", "accepted_as_permanent", "resolved_by_fork", "resolved_by_evidence", "resolved_by_reinterpretation", "superseded"]>;
|
|
128
|
+
status: z.ZodOptional<z.ZodEnum<["unresolved", "investigating", "resolved_support", "resolved_contra", "belief_forked"]>>;
|
|
129
|
+
blocksDecisionFinalization: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
blockingReason: z.ZodOptional<z.ZodString>;
|
|
131
|
+
severity: z.ZodEnum<["critical", "significant", "minor"]>;
|
|
132
|
+
aiAnalysis: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
summary: z.ZodString;
|
|
134
|
+
likelyExplanation: z.ZodString;
|
|
135
|
+
suggestedResolution: z.ZodString;
|
|
136
|
+
confidenceInAnalysis: z.ZodNumber;
|
|
137
|
+
analyzedAt: z.ZodNumber;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
summary: string;
|
|
140
|
+
likelyExplanation: string;
|
|
141
|
+
suggestedResolution: string;
|
|
142
|
+
confidenceInAnalysis: number;
|
|
143
|
+
analyzedAt: number;
|
|
144
|
+
}, {
|
|
145
|
+
summary: string;
|
|
146
|
+
likelyExplanation: string;
|
|
147
|
+
suggestedResolution: string;
|
|
148
|
+
confidenceInAnalysis: number;
|
|
149
|
+
analyzedAt: number;
|
|
150
|
+
}>>;
|
|
151
|
+
resolutionWorktreeId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
resolution: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
verdict: z.ZodString;
|
|
154
|
+
reasoning: z.ZodString;
|
|
155
|
+
beliefUpdate: z.ZodString;
|
|
156
|
+
resolvedBy: z.ZodString;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
verdict: string;
|
|
159
|
+
reasoning: string;
|
|
160
|
+
beliefUpdate: string;
|
|
161
|
+
resolvedBy: string;
|
|
162
|
+
}, {
|
|
163
|
+
verdict: string;
|
|
164
|
+
reasoning: string;
|
|
165
|
+
beliefUpdate: string;
|
|
166
|
+
resolvedBy: string;
|
|
167
|
+
}>>;
|
|
168
|
+
resultingBeliefIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
169
|
+
detectionMethod: z.ZodOptional<z.ZodEnum<["semantic", "keyword", "manual", "agent"]>>;
|
|
170
|
+
similarityScore: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
detectedAt: z.ZodNumber;
|
|
172
|
+
resolvedAt: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
lastReviewedAt: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
createdBy: z.ZodString;
|
|
175
|
+
}>;
|
|
176
|
+
declare const epistemicAudit: TableContract<{
|
|
177
|
+
entityType: z.ZodEnum<["belief", "evidence", "question", "answer", "contradiction", "decision", "proposal", "edge", "node", "entity", "source", "belief_conditional", "belief_scenario", "ontologyDefinition", "ontologyVersion"]>;
|
|
178
|
+
entityId: z.ZodString;
|
|
179
|
+
changeType: z.ZodEnum<["created", "status_changed", "confidence_changed", "criticality_changed", "formulation_modified", "forked", "superseded", "archived", "resolved", "severity_changed", "edge_added", "edge_removed", "annotated", "blocked", "unblocked", "decision_finalized", "proposal_accepted", "proposal_rejected", "pillar_changed", "updated", "deleted", "entity_merged", "entity_attributes_updated", "entity_archived", "published", "deprecated", "source_created", "source_metadata_updated"]>;
|
|
180
|
+
changedAt: z.ZodNumber;
|
|
181
|
+
changedBy: z.ZodString;
|
|
182
|
+
isAgent: z.ZodBoolean;
|
|
183
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
184
|
+
previousState: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodNull]>>;
|
|
185
|
+
newState: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodNull]>>;
|
|
186
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
187
|
+
triggeringAction: z.ZodOptional<z.ZodString>;
|
|
188
|
+
topicId: z.ZodOptional<z.ZodString>;
|
|
189
|
+
proposalId: z.ZodOptional<z.ZodString>;
|
|
190
|
+
mcpSessionId: z.ZodOptional<z.ZodString>;
|
|
191
|
+
mcpToolName: z.ZodOptional<z.ZodString>;
|
|
192
|
+
sourceCommit: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}>;
|
|
194
|
+
declare const epistemicContracts: TableContract<{
|
|
195
|
+
beliefNodeId: z.ZodString;
|
|
196
|
+
contractId: z.ZodString;
|
|
197
|
+
title: z.ZodString;
|
|
198
|
+
description: z.ZodOptional<z.ZodString>;
|
|
199
|
+
conditionType: z.ZodEnum<["assertion", "temporal", "evidential", "threshold", "composite"]>;
|
|
200
|
+
direction: z.ZodEnum<["confirms", "falsifies"]>;
|
|
201
|
+
condition: z.ZodObject<{
|
|
202
|
+
expression: z.ZodString;
|
|
203
|
+
evaluator: z.ZodString;
|
|
204
|
+
evaluatorConfig: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny, "many">]>>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
evaluator: string;
|
|
207
|
+
expression: string;
|
|
208
|
+
evaluatorConfig?: string | number | boolean | any[] | Record<string, any> | null | undefined;
|
|
209
|
+
}, {
|
|
210
|
+
evaluator: string;
|
|
211
|
+
expression: string;
|
|
212
|
+
evaluatorConfig?: string | number | boolean | any[] | Record<string, any> | null | undefined;
|
|
213
|
+
}>;
|
|
214
|
+
deadline: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
compositeOf: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
216
|
+
compositeOperator: z.ZodOptional<z.ZodEnum<["all", "any", "majority"]>>;
|
|
217
|
+
modulation: z.ZodObject<{
|
|
218
|
+
onConfirmed: z.ZodObject<{
|
|
219
|
+
delta: z.ZodNumber;
|
|
220
|
+
ceiling: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
delta: number;
|
|
223
|
+
ceiling?: number | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
delta: number;
|
|
226
|
+
ceiling?: number | undefined;
|
|
227
|
+
}>;
|
|
228
|
+
onDisconfirmed: z.ZodObject<{
|
|
229
|
+
delta: z.ZodNumber;
|
|
230
|
+
floor: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
delta: number;
|
|
233
|
+
floor?: number | undefined;
|
|
234
|
+
}, {
|
|
235
|
+
delta: number;
|
|
236
|
+
floor?: number | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
onExpired: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
delta: z.ZodNumber;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
delta: number;
|
|
242
|
+
}, {
|
|
243
|
+
delta: number;
|
|
244
|
+
}>>;
|
|
245
|
+
onPartial: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
threshold: z.ZodNumber;
|
|
247
|
+
delta: z.ZodNumber;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
delta: number;
|
|
250
|
+
threshold: number;
|
|
251
|
+
}, {
|
|
252
|
+
delta: number;
|
|
253
|
+
threshold: number;
|
|
254
|
+
}>>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
onConfirmed: {
|
|
257
|
+
delta: number;
|
|
258
|
+
ceiling?: number | undefined;
|
|
259
|
+
};
|
|
260
|
+
onDisconfirmed: {
|
|
261
|
+
delta: number;
|
|
262
|
+
floor?: number | undefined;
|
|
263
|
+
};
|
|
264
|
+
onExpired?: {
|
|
265
|
+
delta: number;
|
|
266
|
+
} | undefined;
|
|
267
|
+
onPartial?: {
|
|
268
|
+
delta: number;
|
|
269
|
+
threshold: number;
|
|
270
|
+
} | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
onConfirmed: {
|
|
273
|
+
delta: number;
|
|
274
|
+
ceiling?: number | undefined;
|
|
275
|
+
};
|
|
276
|
+
onDisconfirmed: {
|
|
277
|
+
delta: number;
|
|
278
|
+
floor?: number | undefined;
|
|
279
|
+
};
|
|
280
|
+
onExpired?: {
|
|
281
|
+
delta: number;
|
|
282
|
+
} | undefined;
|
|
283
|
+
onPartial?: {
|
|
284
|
+
delta: number;
|
|
285
|
+
threshold: number;
|
|
286
|
+
} | undefined;
|
|
287
|
+
}>;
|
|
288
|
+
evaluationSchedule: z.ZodEnum<["on_demand", "on_evidence", "periodic", "event_driven"]>;
|
|
289
|
+
periodicIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
status: z.ZodEnum<["active", "satisfied", "violated", "expired", "suspended", "archived"]>;
|
|
291
|
+
lineageSource: z.ZodEnum<["declared", "inherited"]>;
|
|
292
|
+
inheritedFromContractId: z.ZodOptional<z.ZodString>;
|
|
293
|
+
inheritedFromBeliefNodeId: z.ZodOptional<z.ZodString>;
|
|
294
|
+
inheritedAt: z.ZodOptional<z.ZodNumber>;
|
|
295
|
+
lastEvaluatedAt: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
evaluationCount: z.ZodOptional<z.ZodNumber>;
|
|
297
|
+
topicId: z.ZodOptional<z.ZodString>;
|
|
298
|
+
createdAt: z.ZodNumber;
|
|
299
|
+
createdBy: z.ZodString;
|
|
300
|
+
updatedAt: z.ZodNumber;
|
|
301
|
+
}>;
|
|
302
|
+
declare const questionEvidenceLinks: TableContract<{
|
|
303
|
+
questionId: z.ZodString;
|
|
304
|
+
insightId: z.ZodString;
|
|
305
|
+
helpsAnswer: z.ZodBoolean;
|
|
306
|
+
relevance: z.ZodOptional<z.ZodNumber>;
|
|
307
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
308
|
+
impactScore: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
impact: z.ZodOptional<z.ZodEnum<["supports", "contradicts", "neutral"]>>;
|
|
310
|
+
status: z.ZodOptional<z.ZodEnum<["suggested", "approved", "dismissed"]>>;
|
|
311
|
+
createdBy: z.ZodString;
|
|
312
|
+
createdAt: z.ZodNumber;
|
|
313
|
+
}>;
|
|
314
|
+
|
|
315
|
+
export { beliefConfidence, beliefEvidenceLinks, beliefHistory, beliefScenarios, contractEvaluations, contradictions, epistemicAudit, epistemicContracts, questionEvidenceLinks };
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/schemas/tables/kernel/epistemic.ts
|
|
4
|
+
|
|
5
|
+
// src/dsl/defineTable.ts
|
|
6
|
+
function defineTable(spec) {
|
|
7
|
+
return spec;
|
|
8
|
+
}
|
|
9
|
+
var CONVEX_ID_TABLE = /* @__PURE__ */ Symbol.for("lucern.contracts.convexIdTable");
|
|
10
|
+
function idOf(table) {
|
|
11
|
+
const schema = z.string().brand();
|
|
12
|
+
Object.defineProperty(schema, CONVEX_ID_TABLE, {
|
|
13
|
+
configurable: false,
|
|
14
|
+
enumerable: false,
|
|
15
|
+
value: table,
|
|
16
|
+
writable: false
|
|
17
|
+
});
|
|
18
|
+
return schema;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/schemas/tables/kernel/epistemic.ts
|
|
22
|
+
var beliefConfidence = defineTable({
|
|
23
|
+
name: "beliefConfidence",
|
|
24
|
+
component: "kernel",
|
|
25
|
+
category: "epistemic",
|
|
26
|
+
shape: z.object({
|
|
27
|
+
"beliefId": z.string(),
|
|
28
|
+
"belief": z.number().optional(),
|
|
29
|
+
"disbelief": z.number().optional(),
|
|
30
|
+
"uncertainty": z.number().optional(),
|
|
31
|
+
"baseRate": z.number(),
|
|
32
|
+
"slOperator": z.string().optional(),
|
|
33
|
+
"confidence": z.number(),
|
|
34
|
+
"confidenceLevel": z.enum(["high", "medium", "low"]).optional(),
|
|
35
|
+
"valence": z.number().optional(),
|
|
36
|
+
"certainty": z.number().optional(),
|
|
37
|
+
"assessedAt": z.number(),
|
|
38
|
+
"assessedBy": z.string(),
|
|
39
|
+
"trigger": z.enum(["initial", "evidence_added", "evidence_removed", "contradiction_detected", "contradiction_resolved", "manual", "decay", "propagation", "agent_assessment", "worktree_outcome", "worktree_completed", "fusion", "discount", "deduction", "backfill_synthetic"]),
|
|
40
|
+
"rationale": z.string().optional(),
|
|
41
|
+
"triggeringEvidenceId": z.string().optional(),
|
|
42
|
+
"triggeringEvidenceIds": z.array(z.string()).optional(),
|
|
43
|
+
"triggeringContradictionId": idOf("contradictions").optional(),
|
|
44
|
+
"triggeringWorktreeId": z.string().optional(),
|
|
45
|
+
"triggeringAgentId": z.string().optional(),
|
|
46
|
+
"isAgentAssessment": z.boolean().optional()
|
|
47
|
+
}),
|
|
48
|
+
indices: [
|
|
49
|
+
{ kind: "index", name: "by_beliefId", columns: ["beliefId"] },
|
|
50
|
+
{ kind: "index", name: "by_beliefId_time", columns: ["beliefId", "assessedAt"] },
|
|
51
|
+
{ kind: "index", name: "by_trigger", columns: ["trigger"] }
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
var beliefEvidenceLinks = defineTable({
|
|
55
|
+
name: "beliefEvidenceLinks",
|
|
56
|
+
component: "kernel",
|
|
57
|
+
category: "epistemic",
|
|
58
|
+
shape: z.object({
|
|
59
|
+
"beliefId": z.string(),
|
|
60
|
+
"insightId": z.string(),
|
|
61
|
+
"relation": z.enum(["supports", "contradicts"]),
|
|
62
|
+
"confidence": z.number().optional(),
|
|
63
|
+
"rationale": z.string().optional(),
|
|
64
|
+
"status": z.enum(["suggested", "approved", "dismissed"]).optional(),
|
|
65
|
+
"createdBy": z.string(),
|
|
66
|
+
"createdAt": z.number()
|
|
67
|
+
}),
|
|
68
|
+
indices: [
|
|
69
|
+
{ kind: "index", name: "by_beliefId", columns: ["beliefId"] },
|
|
70
|
+
{ kind: "index", name: "by_insightId", columns: ["insightId"] },
|
|
71
|
+
{ kind: "index", name: "by_relation", columns: ["beliefId", "relation"] },
|
|
72
|
+
{ kind: "index", name: "by_status", columns: ["status"] }
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
var beliefHistory = defineTable({
|
|
76
|
+
name: "beliefHistory",
|
|
77
|
+
component: "kernel",
|
|
78
|
+
category: "epistemic",
|
|
79
|
+
shape: z.object({
|
|
80
|
+
"beliefId": z.string(),
|
|
81
|
+
"timestamp": z.number(),
|
|
82
|
+
"previousStatus": z.string().optional(),
|
|
83
|
+
"newStatus": z.string(),
|
|
84
|
+
"justification": z.string().optional(),
|
|
85
|
+
"triggeredByEvidenceIds": z.array(z.string()).optional(),
|
|
86
|
+
"triggeredByUserId": z.string().optional()
|
|
87
|
+
}),
|
|
88
|
+
indices: [
|
|
89
|
+
{ kind: "index", name: "by_beliefId", columns: ["beliefId"] }
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
var beliefScenarios = defineTable({
|
|
93
|
+
name: "beliefScenarios",
|
|
94
|
+
component: "kernel",
|
|
95
|
+
category: "epistemic",
|
|
96
|
+
shape: z.object({
|
|
97
|
+
"topicId": z.string().optional(),
|
|
98
|
+
"testedBeliefId": z.string(),
|
|
99
|
+
"scenarioType": z.enum(["falsification", "strengthening", "alternative", "collapse", "critical_path"]),
|
|
100
|
+
"assumedState": z.enum(["false", "true", "weakened", "strengthened"]),
|
|
101
|
+
"title": z.string(),
|
|
102
|
+
"description": z.string(),
|
|
103
|
+
"cascadeEffects": z.array(z.object({
|
|
104
|
+
"beliefId": z.string(),
|
|
105
|
+
"beliefText": z.string(),
|
|
106
|
+
"currentConfidence": z.string(),
|
|
107
|
+
"projectedConfidence": z.string(),
|
|
108
|
+
"reason": z.string()
|
|
109
|
+
})),
|
|
110
|
+
"thesisImpact": z.enum(["thesis_fails", "thesis_weakens", "pillar_fails", "localized", "minimal"]),
|
|
111
|
+
"pillarImpacts": z.array(z.object({
|
|
112
|
+
"pillar": z.string(),
|
|
113
|
+
"impactLevel": z.string(),
|
|
114
|
+
"reason": z.string()
|
|
115
|
+
})).optional(),
|
|
116
|
+
"keyInsights": z.array(z.string()),
|
|
117
|
+
"recommendedActions": z.array(z.object({
|
|
118
|
+
"action": z.string(),
|
|
119
|
+
"priority": z.string(),
|
|
120
|
+
"rationale": z.string()
|
|
121
|
+
})).optional(),
|
|
122
|
+
"sourceWorktreeId": z.string().optional(),
|
|
123
|
+
"sourceChatId": idOf("chats").optional(),
|
|
124
|
+
"sourceMessageId": idOf("messages").optional(),
|
|
125
|
+
"createdAt": z.number(),
|
|
126
|
+
"createdBy": z.string()
|
|
127
|
+
}),
|
|
128
|
+
indices: [
|
|
129
|
+
{ kind: "index", name: "by_topicId", columns: ["topicId"] },
|
|
130
|
+
{ kind: "index", name: "by_topic_scenarioType", columns: ["topicId", "scenarioType"] },
|
|
131
|
+
{ kind: "index", name: "by_topic_thesisImpact", columns: ["topicId", "thesisImpact"] },
|
|
132
|
+
{ kind: "index", name: "by_testedBelief", columns: ["testedBeliefId"] },
|
|
133
|
+
{ kind: "index", name: "by_sourceWorktreeId", columns: ["sourceWorktreeId"] }
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
var contractEvaluations = defineTable({
|
|
137
|
+
name: "contractEvaluations",
|
|
138
|
+
component: "kernel",
|
|
139
|
+
category: "epistemic",
|
|
140
|
+
shape: z.object({
|
|
141
|
+
"contractId": z.string(),
|
|
142
|
+
"beliefNodeId": z.string(),
|
|
143
|
+
"result": z.enum(["confirmed", "disconfirmed", "partial", "expired", "error", "inconclusive"]),
|
|
144
|
+
"evaluatedAt": z.number(),
|
|
145
|
+
"evaluator": z.string(),
|
|
146
|
+
"trigger": z.string(),
|
|
147
|
+
"resultData": z.union([z.string(), z.number(), z.boolean(), z.null(), z.record(z.any()), z.array(z.any())]).optional(),
|
|
148
|
+
"modulationApplied": z.boolean(),
|
|
149
|
+
"confidenceDelta": z.number().optional(),
|
|
150
|
+
"confidenceBefore": z.number().optional(),
|
|
151
|
+
"confidenceAfter": z.number().optional(),
|
|
152
|
+
"beliefConfidenceId": idOf("beliefConfidence").optional(),
|
|
153
|
+
"modulationRationale": z.string().optional(),
|
|
154
|
+
"topicId": z.string().optional()
|
|
155
|
+
}),
|
|
156
|
+
indices: [
|
|
157
|
+
{ kind: "index", name: "by_contract", columns: ["contractId"] },
|
|
158
|
+
{ kind: "index", name: "by_contract_time", columns: ["contractId", "evaluatedAt"] },
|
|
159
|
+
{ kind: "index", name: "by_belief", columns: ["beliefNodeId"] },
|
|
160
|
+
{ kind: "index", name: "by_result", columns: ["result"] },
|
|
161
|
+
{ kind: "index", name: "by_time", columns: ["evaluatedAt"] },
|
|
162
|
+
{ kind: "index", name: "by_topic_time", columns: ["topicId", "evaluatedAt"] }
|
|
163
|
+
]
|
|
164
|
+
});
|
|
165
|
+
var contradictions = defineTable({
|
|
166
|
+
name: "contradictions",
|
|
167
|
+
component: "kernel",
|
|
168
|
+
category: "epistemic",
|
|
169
|
+
shape: z.object({
|
|
170
|
+
"topicId": z.string().optional(),
|
|
171
|
+
"beliefId": z.string(),
|
|
172
|
+
"supportingInsightIds": z.array(z.string()),
|
|
173
|
+
"contradictingInsightIds": z.array(z.string()),
|
|
174
|
+
"resolutionStatus": z.enum(["unresolved", "investigating", "accepted_as_permanent", "resolved_by_fork", "resolved_by_evidence", "resolved_by_reinterpretation", "superseded"]),
|
|
175
|
+
"status": z.enum(["unresolved", "investigating", "resolved_support", "resolved_contra", "belief_forked"]).optional(),
|
|
176
|
+
"blocksDecisionFinalization": z.boolean().optional(),
|
|
177
|
+
"blockingReason": z.string().optional(),
|
|
178
|
+
"severity": z.enum(["critical", "significant", "minor"]),
|
|
179
|
+
"aiAnalysis": z.object({
|
|
180
|
+
"summary": z.string(),
|
|
181
|
+
"likelyExplanation": z.string(),
|
|
182
|
+
"suggestedResolution": z.string(),
|
|
183
|
+
"confidenceInAnalysis": z.number(),
|
|
184
|
+
"analyzedAt": z.number()
|
|
185
|
+
}).optional(),
|
|
186
|
+
"resolutionWorktreeId": z.string().optional(),
|
|
187
|
+
"resolution": z.object({
|
|
188
|
+
"verdict": z.string(),
|
|
189
|
+
"reasoning": z.string(),
|
|
190
|
+
"beliefUpdate": z.string(),
|
|
191
|
+
"resolvedBy": z.string()
|
|
192
|
+
}).optional(),
|
|
193
|
+
"resultingBeliefIds": z.array(z.string()).optional(),
|
|
194
|
+
"detectionMethod": z.enum(["semantic", "keyword", "manual", "agent"]).optional(),
|
|
195
|
+
"similarityScore": z.number().optional(),
|
|
196
|
+
"detectedAt": z.number(),
|
|
197
|
+
"resolvedAt": z.number().optional(),
|
|
198
|
+
"lastReviewedAt": z.number().optional(),
|
|
199
|
+
"createdBy": z.string()
|
|
200
|
+
}),
|
|
201
|
+
indices: [
|
|
202
|
+
{ kind: "index", name: "by_topicId", columns: ["topicId"] },
|
|
203
|
+
{ kind: "index", name: "by_topic_resolutionStatus", columns: ["topicId", "resolutionStatus"] },
|
|
204
|
+
{ kind: "index", name: "by_topic_status", columns: ["topicId", "status"] },
|
|
205
|
+
{ kind: "index", name: "by_topic_severity", columns: ["topicId", "severity"] },
|
|
206
|
+
{ kind: "index", name: "by_topic_blocking", columns: ["topicId", "blocksDecisionFinalization"] },
|
|
207
|
+
{ kind: "index", name: "by_beliefId", columns: ["beliefId"] }
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
var epistemicAudit = defineTable({
|
|
211
|
+
name: "epistemicAudit",
|
|
212
|
+
component: "kernel",
|
|
213
|
+
category: "epistemic",
|
|
214
|
+
shape: z.object({
|
|
215
|
+
"entityType": z.enum(["belief", "evidence", "question", "answer", "contradiction", "decision", "proposal", "edge", "node", "entity", "source", "belief_conditional", "belief_scenario", "ontologyDefinition", "ontologyVersion"]),
|
|
216
|
+
"entityId": z.string(),
|
|
217
|
+
"changeType": z.enum(["created", "status_changed", "confidence_changed", "criticality_changed", "formulation_modified", "forked", "superseded", "archived", "resolved", "severity_changed", "edge_added", "edge_removed", "annotated", "blocked", "unblocked", "decision_finalized", "proposal_accepted", "proposal_rejected", "pillar_changed", "updated", "deleted", "entity_merged", "entity_attributes_updated", "entity_archived", "published", "deprecated", "source_created", "source_metadata_updated"]),
|
|
218
|
+
"changedAt": z.number(),
|
|
219
|
+
"changedBy": z.string(),
|
|
220
|
+
"isAgent": z.boolean(),
|
|
221
|
+
"agentType": z.string().optional(),
|
|
222
|
+
"previousState": z.union([z.record(z.any()), z.null()]).optional(),
|
|
223
|
+
"newState": z.union([z.record(z.any()), z.null()]).optional(),
|
|
224
|
+
"rationale": z.string().optional(),
|
|
225
|
+
"triggeringAction": z.string().optional(),
|
|
226
|
+
"topicId": z.string().optional(),
|
|
227
|
+
"proposalId": z.string().optional(),
|
|
228
|
+
"mcpSessionId": z.string().optional(),
|
|
229
|
+
"mcpToolName": z.string().optional(),
|
|
230
|
+
"sourceCommit": z.string().optional()
|
|
231
|
+
}),
|
|
232
|
+
indices: [
|
|
233
|
+
{ kind: "index", name: "by_entityId", columns: ["entityId"] },
|
|
234
|
+
{ kind: "index", name: "by_entityType", columns: ["entityType"] },
|
|
235
|
+
{ kind: "index", name: "by_entityType_id", columns: ["entityType", "entityId"] },
|
|
236
|
+
{ kind: "index", name: "by_changedAt", columns: ["changedAt"] },
|
|
237
|
+
{ kind: "index", name: "by_changedBy", columns: ["changedBy"] },
|
|
238
|
+
{ kind: "index", name: "by_topicId", columns: ["topicId"] },
|
|
239
|
+
{ kind: "index", name: "by_changeType", columns: ["changeType"] },
|
|
240
|
+
{ kind: "index", name: "by_mcpSessionId", columns: ["mcpSessionId"] }
|
|
241
|
+
]
|
|
242
|
+
});
|
|
243
|
+
var epistemicContracts = defineTable({
|
|
244
|
+
name: "epistemicContracts",
|
|
245
|
+
component: "kernel",
|
|
246
|
+
category: "epistemic",
|
|
247
|
+
shape: z.object({
|
|
248
|
+
"beliefNodeId": z.string(),
|
|
249
|
+
"contractId": z.string(),
|
|
250
|
+
"title": z.string(),
|
|
251
|
+
"description": z.string().optional(),
|
|
252
|
+
"conditionType": z.enum(["assertion", "temporal", "evidential", "threshold", "composite"]),
|
|
253
|
+
"direction": z.enum(["confirms", "falsifies"]),
|
|
254
|
+
"condition": z.object({
|
|
255
|
+
"expression": z.string(),
|
|
256
|
+
"evaluator": z.string(),
|
|
257
|
+
"evaluatorConfig": z.union([z.string(), z.number(), z.boolean(), z.null(), z.record(z.any()), z.array(z.any())]).optional()
|
|
258
|
+
}),
|
|
259
|
+
"deadline": z.number().optional(),
|
|
260
|
+
"compositeOf": z.array(z.string()).optional(),
|
|
261
|
+
"compositeOperator": z.enum(["all", "any", "majority"]).optional(),
|
|
262
|
+
"modulation": z.object({
|
|
263
|
+
"onConfirmed": z.object({
|
|
264
|
+
"delta": z.number(),
|
|
265
|
+
"ceiling": z.number().optional()
|
|
266
|
+
}),
|
|
267
|
+
"onDisconfirmed": z.object({
|
|
268
|
+
"delta": z.number(),
|
|
269
|
+
"floor": z.number().optional()
|
|
270
|
+
}),
|
|
271
|
+
"onExpired": z.object({
|
|
272
|
+
"delta": z.number()
|
|
273
|
+
}).optional(),
|
|
274
|
+
"onPartial": z.object({
|
|
275
|
+
"threshold": z.number(),
|
|
276
|
+
"delta": z.number()
|
|
277
|
+
}).optional()
|
|
278
|
+
}),
|
|
279
|
+
"evaluationSchedule": z.enum(["on_demand", "on_evidence", "periodic", "event_driven"]),
|
|
280
|
+
"periodicIntervalMs": z.number().optional(),
|
|
281
|
+
"status": z.enum(["active", "satisfied", "violated", "expired", "suspended", "archived"]),
|
|
282
|
+
"lineageSource": z.enum(["declared", "inherited"]),
|
|
283
|
+
"inheritedFromContractId": z.string().optional(),
|
|
284
|
+
"inheritedFromBeliefNodeId": z.string().optional(),
|
|
285
|
+
"inheritedAt": z.number().optional(),
|
|
286
|
+
"lastEvaluatedAt": z.number().optional(),
|
|
287
|
+
"evaluationCount": z.number().optional(),
|
|
288
|
+
"topicId": z.string().optional(),
|
|
289
|
+
"createdAt": z.number(),
|
|
290
|
+
"createdBy": z.string(),
|
|
291
|
+
"updatedAt": z.number()
|
|
292
|
+
}),
|
|
293
|
+
indices: [
|
|
294
|
+
{ kind: "index", name: "by_contractId", columns: ["contractId"] },
|
|
295
|
+
{ kind: "index", name: "by_belief", columns: ["beliefNodeId"] },
|
|
296
|
+
{ kind: "index", name: "by_status", columns: ["status"] },
|
|
297
|
+
{ kind: "index", name: "by_evaluator", columns: ["condition.evaluator"] },
|
|
298
|
+
{ kind: "index", name: "by_topic", columns: ["topicId"] },
|
|
299
|
+
{ kind: "index", name: "by_schedule", columns: ["evaluationSchedule"] }
|
|
300
|
+
]
|
|
301
|
+
});
|
|
302
|
+
var questionEvidenceLinks = defineTable({
|
|
303
|
+
name: "questionEvidenceLinks",
|
|
304
|
+
component: "kernel",
|
|
305
|
+
category: "epistemic",
|
|
306
|
+
shape: z.object({
|
|
307
|
+
"questionId": z.string(),
|
|
308
|
+
"insightId": z.string(),
|
|
309
|
+
"helpsAnswer": z.boolean(),
|
|
310
|
+
"relevance": z.number().optional(),
|
|
311
|
+
"rationale": z.string().optional(),
|
|
312
|
+
"impactScore": z.number().optional(),
|
|
313
|
+
"impact": z.enum(["supports", "contradicts", "neutral"]).optional(),
|
|
314
|
+
"status": z.enum(["suggested", "approved", "dismissed"]).optional(),
|
|
315
|
+
"createdBy": z.string(),
|
|
316
|
+
"createdAt": z.number()
|
|
317
|
+
}),
|
|
318
|
+
indices: [
|
|
319
|
+
{ kind: "index", name: "by_questionId", columns: ["questionId"] },
|
|
320
|
+
{ kind: "index", name: "by_insightId", columns: ["insightId"] },
|
|
321
|
+
{ kind: "index", name: "by_status", columns: ["status"] }
|
|
322
|
+
]
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
export { beliefConfidence, beliefEvidenceLinks, beliefHistory, beliefScenarios, contractEvaluations, contradictions, epistemicAudit, epistemicContracts, questionEvidenceLinks };
|
|
326
|
+
//# sourceMappingURL=epistemic.js.map
|
|
327
|
+
//# sourceMappingURL=epistemic.js.map
|