@lucern/sdk 0.2.0-alpha.7 → 0.2.0-alpha.9
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/adminClient.d.ts +409 -0
- package/dist/adminClient.js +755 -0
- package/dist/adminClient.js.map +1 -0
- package/dist/answersClient.d.ts +23 -0
- package/dist/answersClient.js +333 -0
- package/dist/answersClient.js.map +1 -0
- package/dist/audiencesClient.d.ts +99 -0
- package/dist/audiencesClient.js +472 -0
- package/dist/audiencesClient.js.map +1 -0
- package/dist/auditClient.d.ts +29 -0
- package/dist/auditClient.js +386 -0
- package/dist/auditClient.js.map +1 -0
- package/dist/beliefsClient.d.ts +162 -0
- package/dist/beliefsClient.js +477 -0
- package/dist/beliefsClient.js.map +1 -0
- package/dist/client.d.ts +2378 -0
- package/dist/client.js +6134 -0
- package/dist/client.js.map +1 -0
- package/dist/contextClient.d.ts +27 -0
- package/dist/contextClient.js +396 -0
- package/dist/contextClient.js.map +1 -0
- package/dist/contextFacade.d.ts +2 -0
- package/dist/contextFacade.js +73 -0
- package/dist/contextFacade.js.map +1 -0
- package/dist/contextPackCompiler.d.ts +102 -0
- package/dist/contextPackCompiler.js +1091 -0
- package/dist/contextPackCompiler.js.map +1 -0
- package/dist/contextPackPolicy.d.ts +84 -0
- package/dist/contextPackPolicy.js +347 -0
- package/dist/contextPackPolicy.js.map +1 -0
- package/dist/contextPackSchema.d.ts +7 -0
- package/{src/contextPackSchema.ts → dist/contextPackSchema.js} +22 -70
- package/dist/contextPackSchema.js.map +1 -0
- package/dist/contextTypes.d.ts +135 -0
- package/dist/contextTypes.js +3 -0
- package/dist/contextTypes.js.map +1 -0
- package/dist/contracts/api-enums.contract.d.ts +81 -0
- package/dist/contracts/api-enums.contract.js +92 -0
- package/dist/contracts/api-enums.contract.js.map +1 -0
- package/dist/contracts/auth-session.contract.d.ts +55 -0
- package/dist/contracts/auth-session.contract.js +48 -0
- package/dist/contracts/auth-session.contract.js.map +1 -0
- package/dist/contracts/context-pack.contract.d.ts +492 -0
- package/dist/contracts/context-pack.contract.js +98 -0
- package/dist/contracts/context-pack.contract.js.map +1 -0
- package/dist/contracts/contextPack.d.ts +1 -0
- package/dist/contracts/contextPack.js +98 -0
- package/dist/contracts/contextPack.js.map +1 -0
- package/dist/contracts/index.d.ts +9 -0
- package/dist/contracts/index.js +4892 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/lens-filter.contract.d.ts +72 -0
- package/dist/contracts/lens-filter.contract.js +71 -0
- package/dist/contracts/lens-filter.contract.js.map +1 -0
- package/dist/contracts/lens-workflow.contract.d.ts +87 -0
- package/dist/contracts/lens-workflow.contract.js +123 -0
- package/dist/contracts/lens-workflow.contract.js.map +1 -0
- package/dist/contracts/lensFilter.d.ts +1 -0
- package/dist/contracts/lensFilter.js +71 -0
- package/dist/contracts/lensFilter.js.map +1 -0
- package/dist/contracts/lensWorkflow.d.ts +2 -0
- package/dist/contracts/lensWorkflow.js +123 -0
- package/dist/contracts/lensWorkflow.js.map +1 -0
- package/dist/contracts/mcp-tools.contract.d.ts +1 -0
- package/dist/contracts/mcp-tools.contract.js +2986 -0
- package/dist/contracts/mcp-tools.contract.js.map +1 -0
- package/dist/contracts/mcpTools.d.ts +1 -0
- package/dist/contracts/mcpTools.js +2986 -0
- package/dist/contracts/mcpTools.js.map +1 -0
- package/dist/contracts/prompt.contract.d.ts +26 -0
- package/dist/contracts/prompt.contract.js +12 -0
- package/dist/contracts/prompt.contract.js.map +1 -0
- package/dist/contracts/prompt.d.ts +1 -0
- package/dist/contracts/prompt.js +12 -0
- package/dist/contracts/prompt.js.map +1 -0
- package/dist/contracts/sdk-tools.contract.d.ts +2 -0
- package/dist/contracts/sdk-tools.contract.js +4134 -0
- package/dist/contracts/sdk-tools.contract.js.map +1 -0
- package/dist/contracts/sdkTools.d.ts +2 -0
- package/dist/contracts/sdkTools.js +4134 -0
- package/dist/contracts/sdkTools.js.map +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +163 -0
- package/dist/contracts/workflow-runtime.contract.js +245 -0
- package/dist/contracts/workflow-runtime.contract.js.map +1 -0
- package/dist/contracts/workflowRuntime.d.ts +1 -0
- package/dist/contracts/workflowRuntime.js +245 -0
- package/dist/contracts/workflowRuntime.js.map +1 -0
- package/dist/controlObjectOwnership.d.ts +310 -0
- package/{src/controlObjectOwnership.ts → dist/controlObjectOwnership.js} +53 -124
- package/dist/controlObjectOwnership.js.map +1 -0
- package/dist/coreClient.d.ts +144 -0
- package/dist/coreClient.js +339 -0
- package/dist/coreClient.js.map +1 -0
- package/dist/customTools.d.ts +88 -0
- package/dist/customTools.js +248 -0
- package/dist/customTools.js.map +1 -0
- package/dist/decisionsClient.d.ts +111 -0
- package/dist/decisionsClient.js +522 -0
- package/dist/decisionsClient.js.map +1 -0
- package/dist/domainContext.d.ts +1 -0
- package/dist/domainContext.js +3 -0
- package/dist/domainContext.js.map +1 -0
- package/dist/events.d.ts +178 -0
- package/dist/events.js +249 -0
- package/dist/events.js.map +1 -0
- package/dist/eventsCore.d.ts +49 -0
- package/dist/eventsCore.js +429 -0
- package/dist/eventsCore.js.map +1 -0
- package/dist/facade/context.d.ts +18 -0
- package/dist/facade/context.js +73 -0
- package/dist/facade/context.js.map +1 -0
- package/dist/gatewayFacades.d.ts +591 -0
- package/dist/gatewayFacades.js +1953 -0
- package/dist/gatewayFacades.js.map +1 -0
- package/dist/graphClient.d.ts +271 -0
- package/dist/graphClient.js +698 -0
- package/dist/graphClient.js.map +1 -0
- package/dist/harnessClient.d.ts +314 -0
- package/dist/harnessClient.js +607 -0
- package/dist/harnessClient.js.map +1 -0
- package/dist/identityClient.d.ts +140 -0
- package/dist/identityClient.js +497 -0
- package/dist/identityClient.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +11381 -0
- package/dist/index.js.map +1 -0
- package/dist/learningClient.d.ts +46 -0
- package/dist/learningClient.js +409 -0
- package/dist/learningClient.js.map +1 -0
- package/dist/mcpParityClient.d.ts +74 -0
- package/dist/mcpParityClient.js +516 -0
- package/dist/mcpParityClient.js.map +1 -0
- package/dist/mcpParitySurface.d.ts +12 -0
- package/{src/mcpParitySurface.ts → dist/mcpParitySurface.js} +9 -14
- package/dist/mcpParitySurface.js.map +1 -0
- package/dist/mcpTools-DPZxowDX.d.ts +254 -0
- package/dist/ontologyClient.d.ts +137 -0
- package/dist/ontologyClient.js +513 -0
- package/dist/ontologyClient.js.map +1 -0
- package/dist/packRuntime.d.ts +2 -0
- package/dist/packRuntime.js +3 -0
- package/dist/packRuntime.js.map +1 -0
- package/dist/packsClient.d.ts +131 -0
- package/dist/packsClient.js +525 -0
- package/dist/packsClient.js.map +1 -0
- package/dist/policyClient.d.ts +299 -0
- package/dist/policyClient.js +625 -0
- package/dist/policyClient.js.map +1 -0
- package/dist/realtime/index.d.ts +29 -0
- package/dist/realtime/index.js +23 -0
- package/dist/realtime/index.js.map +1 -0
- package/{src/realtime/refs.ts → dist/realtime/refs.d.ts} +5 -5
- package/dist/realtime/refs.js +9 -0
- package/dist/realtime/refs.js.map +1 -0
- package/dist/reportsClient.d.ts +41 -0
- package/dist/reportsClient.js +418 -0
- package/dist/reportsClient.js.map +1 -0
- package/dist/schemaClient.d.ts +64 -0
- package/dist/schemaClient.js +434 -0
- package/dist/schemaClient.js.map +1 -0
- package/dist/sdkSurface.d.ts +61 -0
- package/dist/sdkSurface.js +112 -0
- package/dist/sdkSurface.js.map +1 -0
- package/dist/sdkTools-CwXJDACb.d.ts +150 -0
- package/dist/topicsClient.d.ts +84 -0
- package/dist/topicsClient.js +492 -0
- package/dist/topicsClient.js.map +1 -0
- package/dist/types.d.ts +696 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/dist/workflowClient.d.ts +316 -0
- package/dist/workflowClient.js +830 -0
- package/dist/workflowClient.js.map +1 -0
- package/package.json +39 -7
- package/.turbo/turbo-build.log +0 -7
- package/.turbo/turbo-typecheck.log +0 -4
- package/examples/README.md +0 -69
- package/examples/contradiction.ts +0 -94
- package/examples/investigation-context.ts +0 -118
- package/examples/questions-and-tasks.ts +0 -55
- package/examples/quickstart.ts +0 -97
- package/examples/shared.ts +0 -318
- package/examples/strict-public-types.ts +0 -143
- package/examples/worktree-lifecycle.ts +0 -79
- package/src/README.md +0 -6
- package/src/adminClient.ts +0 -789
- package/src/answersClient.ts +0 -29
- package/src/audiencesClient.ts +0 -209
- package/src/auditClient.ts +0 -50
- package/src/beliefsClient.ts +0 -319
- package/src/client.ts +0 -2647
- package/src/contextClient.ts +0 -130
- package/src/contextFacade.ts +0 -15
- package/src/contextPackCompiler.ts +0 -828
- package/src/contextTypes.ts +0 -153
- package/src/contracts/api-enums.contract.ts +0 -202
- package/src/contracts/auth-session.contract.ts +0 -109
- package/src/contracts/context-pack.contract.ts +0 -700
- package/src/contracts/contextPack.ts +0 -1
- package/src/contracts/index.ts +0 -10
- package/src/contracts/lens-filter.contract.ts +0 -183
- package/src/contracts/lens-workflow.contract.ts +0 -162
- package/src/contracts/lensFilter.ts +0 -1
- package/src/contracts/lensWorkflow.ts +0 -1
- package/src/contracts/mcp-tools.contract.ts +0 -3636
- package/src/contracts/mcpTools.ts +0 -1
- package/src/contracts/prompt.contract.ts +0 -50
- package/src/contracts/prompt.ts +0 -1
- package/src/contracts/sdk-tools.contract.ts +0 -1457
- package/src/contracts/sdkTools.ts +0 -1
- package/src/contracts/workflow-runtime.contract.ts +0 -440
- package/src/contracts/workflowRuntime.ts +0 -1
- package/src/coreClient.ts +0 -570
- package/src/customTools.ts +0 -398
- package/src/decisionsClient.ts +0 -286
- package/src/domainContext.ts +0 -15
- package/src/events.ts +0 -531
- package/src/eventsCore.ts +0 -168
- package/src/facade/beliefs.ts +0 -83
- package/src/facade/context.ts +0 -110
- package/src/facade/contradictions.ts +0 -29
- package/src/facade/edges.ts +0 -30
- package/src/facade/events.ts +0 -23
- package/src/facade/evidence.ts +0 -41
- package/src/facade/graph.ts +0 -38
- package/src/facade/identity.ts +0 -16
- package/src/facade/ontologies.ts +0 -34
- package/src/facade/questions.ts +0 -59
- package/src/facade/search.ts +0 -16
- package/src/facade/tasks.ts +0 -37
- package/src/facade/topics.ts +0 -42
- package/src/facade/webhooks.ts +0 -58
- package/src/facade/worktrees.ts +0 -51
- package/src/gatewayFacades.ts +0 -1666
- package/src/graphClient.ts +0 -529
- package/src/harnessClient.ts +0 -585
- package/src/identityClient.ts +0 -278
- package/src/index.ts +0 -49
- package/src/learningClient.ts +0 -95
- package/src/mcpParityClient.ts +0 -240
- package/src/ontologyClient.ts +0 -275
- package/src/packRuntime.ts +0 -3
- package/src/packsClient.ts +0 -260
- package/src/policyClient.ts +0 -572
- package/src/promptCatalog.ts +0 -1
- package/src/realtime/index.ts +0 -51
- package/src/reportsClient.ts +0 -99
- package/src/schemaClient.ts +0 -129
- package/src/sdkSurface.ts +0 -190
- package/src/topicsClient.ts +0 -243
- package/src/types.ts +0 -807
- package/src/version.ts +0 -2
- package/src/workflowClient.ts +0 -826
- package/tsconfig.json +0 -9
package/src/contextTypes.ts
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
export type ContextRankingProfile =
|
|
2
|
-
| "baseline_v1"
|
|
3
|
-
| "hybrid_v1"
|
|
4
|
-
| "weighted_v1";
|
|
5
|
-
|
|
6
|
-
export type ContextCompilationMode = "standard" | "delta";
|
|
7
|
-
|
|
8
|
-
export type ContextPackSectionKey =
|
|
9
|
-
| "invariants"
|
|
10
|
-
| "activeBeliefs"
|
|
11
|
-
| "openQuestions"
|
|
12
|
-
| "recentEvidence"
|
|
13
|
-
| "contradictions";
|
|
14
|
-
|
|
15
|
-
export type RankingWeightVector = {
|
|
16
|
-
query: number;
|
|
17
|
-
recency: number;
|
|
18
|
-
confidence?: number;
|
|
19
|
-
beliefType?: number;
|
|
20
|
-
priority?: number;
|
|
21
|
-
severity?: number;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type PackWeightOverride = {
|
|
25
|
-
section: ContextPackSectionKey;
|
|
26
|
-
weights: Partial<RankingWeightVector>;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type CompileContextInput = {
|
|
30
|
-
query?: string;
|
|
31
|
-
budget?: number;
|
|
32
|
-
ranking?: ContextRankingProfile;
|
|
33
|
-
limit?: number;
|
|
34
|
-
maxDepth?: number;
|
|
35
|
-
includeEntities?: boolean;
|
|
36
|
-
mode?: ContextCompilationMode;
|
|
37
|
-
includeFailures?: boolean;
|
|
38
|
-
worktreeId?: string;
|
|
39
|
-
sessionId?: string;
|
|
40
|
-
packWeightOverrides?: PackWeightOverride[];
|
|
41
|
-
tokenBudget?: number;
|
|
42
|
-
rankingProfile?: ContextRankingProfile;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type PublicContextBelief = {
|
|
46
|
-
beliefId: string;
|
|
47
|
-
text: string;
|
|
48
|
-
confidence: number | null;
|
|
49
|
-
beliefType?: string | null;
|
|
50
|
-
status?: string;
|
|
51
|
-
updatedAt?: number | null;
|
|
52
|
-
score: number;
|
|
53
|
-
justification?: string;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type PublicContextQuestion = {
|
|
57
|
-
questionId: string;
|
|
58
|
-
text: string;
|
|
59
|
-
status: string;
|
|
60
|
-
priority: string;
|
|
61
|
-
updatedAt?: number | null;
|
|
62
|
-
score: number;
|
|
63
|
-
justification?: string;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export type PublicContextEvidence = {
|
|
67
|
-
evidenceId: string;
|
|
68
|
-
text: string;
|
|
69
|
-
sourceUrl?: string | null;
|
|
70
|
-
kind: string;
|
|
71
|
-
createdAt?: number | null;
|
|
72
|
-
score: number;
|
|
73
|
-
justification?: string;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export type PublicContextContradiction = {
|
|
77
|
-
contradictionId: string;
|
|
78
|
-
severity: string;
|
|
79
|
-
status: string;
|
|
80
|
-
description: string;
|
|
81
|
-
score: number;
|
|
82
|
-
justification?: string;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export type PublicContextEntity = {
|
|
86
|
-
entityId: string;
|
|
87
|
-
entityType: string;
|
|
88
|
-
title: string;
|
|
89
|
-
text?: string;
|
|
90
|
-
connectedBeliefCount: number;
|
|
91
|
-
connectedEvidenceCount: number;
|
|
92
|
-
score: number;
|
|
93
|
-
metadata?: Record<string, unknown>;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export type PublicContextInjectionPolicy = {
|
|
97
|
-
tokenBudget: number;
|
|
98
|
-
estimatedTokens: number;
|
|
99
|
-
sectionBudgets: Record<string, number>;
|
|
100
|
-
sectionUsage: Record<string, number>;
|
|
101
|
-
selected: Record<string, string[]>;
|
|
102
|
-
excludedItems?: Array<{
|
|
103
|
-
id: string;
|
|
104
|
-
section: string;
|
|
105
|
-
reason: "budget_exceeded" | "anti_repetition" | "below_threshold";
|
|
106
|
-
score: number;
|
|
107
|
-
}>;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export type PublicCompiledContext = {
|
|
111
|
-
schemaVersion: string;
|
|
112
|
-
topicId: string;
|
|
113
|
-
topicName: string;
|
|
114
|
-
scopedTopicIds: string[];
|
|
115
|
-
generatedAt: number;
|
|
116
|
-
ranking: ContextRankingProfile;
|
|
117
|
-
summary: Record<string, unknown>;
|
|
118
|
-
invariants: PublicContextBelief[];
|
|
119
|
-
activeBeliefs: PublicContextBelief[];
|
|
120
|
-
openQuestions: PublicContextQuestion[];
|
|
121
|
-
recentEvidence: PublicContextEvidence[];
|
|
122
|
-
contradictions: PublicContextContradiction[];
|
|
123
|
-
relatedEntities?: PublicContextEntity[];
|
|
124
|
-
contextNarrative: string[];
|
|
125
|
-
injectionPolicy: PublicContextInjectionPolicy;
|
|
126
|
-
diagnostics: Record<string, unknown>;
|
|
127
|
-
compilationMode?: string;
|
|
128
|
-
failureContext?: {
|
|
129
|
-
failures: Array<{
|
|
130
|
-
attemptId: string;
|
|
131
|
-
approach: string;
|
|
132
|
-
outcome: string;
|
|
133
|
-
recordedAt: number;
|
|
134
|
-
score: number;
|
|
135
|
-
}>;
|
|
136
|
-
suppressedIds: string[];
|
|
137
|
-
};
|
|
138
|
-
deltaReport?: {
|
|
139
|
-
changedItems: Array<{
|
|
140
|
-
id: string;
|
|
141
|
-
section: string;
|
|
142
|
-
changeType: string;
|
|
143
|
-
summary: string;
|
|
144
|
-
}>;
|
|
145
|
-
verificationObligations: Array<{
|
|
146
|
-
description: string;
|
|
147
|
-
source: string;
|
|
148
|
-
severity: "critical" | "high" | "medium" | "low";
|
|
149
|
-
}>;
|
|
150
|
-
referencePoint: string;
|
|
151
|
-
};
|
|
152
|
-
appliedWeightOverrides?: unknown[];
|
|
153
|
-
};
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Enum Contract Definitions
|
|
3
|
-
*
|
|
4
|
-
* Canonical enum values for all API-facing enumerations.
|
|
5
|
-
* These MUST match the kernel schema validators exactly.
|
|
6
|
-
*
|
|
7
|
-
* Source of truth: lucern/packages/reasoning-kernel/src/adapters/schema/spine/
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// BELIEF STATUS
|
|
12
|
-
// =============================================================================
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Belief epistemic lifecycle — tracks maturity from raw claim to verified fact.
|
|
16
|
-
*
|
|
17
|
-
* - assumption: Untested raw claim, lowest epistemic standing
|
|
18
|
-
* - hypothesis: Under active investigation, being tested against evidence
|
|
19
|
-
* - belief: Validated through investigation, carries confidence score
|
|
20
|
-
* - fact: Resolved outcome anchored by strong evidence
|
|
21
|
-
*/
|
|
22
|
-
export const BELIEF_STATUSES = [
|
|
23
|
-
"assumption",
|
|
24
|
-
"hypothesis",
|
|
25
|
-
"belief",
|
|
26
|
-
"fact",
|
|
27
|
-
] as const;
|
|
28
|
-
export type BeliefStatus = (typeof BELIEF_STATUSES)[number];
|
|
29
|
-
|
|
30
|
-
// =============================================================================
|
|
31
|
-
// FORK REASONS
|
|
32
|
-
// =============================================================================
|
|
33
|
-
|
|
34
|
-
/** Why a scored belief was branched into a new version */
|
|
35
|
-
export const FORK_REASONS = [
|
|
36
|
-
"refinement",
|
|
37
|
-
"contradiction_response",
|
|
38
|
-
"scope_change",
|
|
39
|
-
"confidence_collapse",
|
|
40
|
-
"manual",
|
|
41
|
-
] as const;
|
|
42
|
-
export type ForkReason = (typeof FORK_REASONS)[number];
|
|
43
|
-
|
|
44
|
-
// =============================================================================
|
|
45
|
-
// CONFIDENCE TRIGGERS
|
|
46
|
-
// =============================================================================
|
|
47
|
-
|
|
48
|
-
/** What caused a confidence change — every modulation must declare its trigger */
|
|
49
|
-
export const CONFIDENCE_TRIGGERS = [
|
|
50
|
-
"evidence_added",
|
|
51
|
-
"contradiction_detected",
|
|
52
|
-
"merge_outcome",
|
|
53
|
-
"worktree_outcome",
|
|
54
|
-
"manual",
|
|
55
|
-
"decay",
|
|
56
|
-
] as const;
|
|
57
|
-
export type ConfidenceTrigger = (typeof CONFIDENCE_TRIGGERS)[number];
|
|
58
|
-
|
|
59
|
-
// =============================================================================
|
|
60
|
-
// EDGE TYPES — The 6 canonical epistemic edge types
|
|
61
|
-
// =============================================================================
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Core epistemic edge types — the grammar of reasoning relationships.
|
|
65
|
-
*
|
|
66
|
-
* - supports: Evidence or belief reinforces another belief (weight = strength)
|
|
67
|
-
* - informs: Evidence bears on a belief (directional, weighted)
|
|
68
|
-
* - depends_on: Belief B requires belief A to hold
|
|
69
|
-
* - derived_from: Belief was derived from another (lineage)
|
|
70
|
-
* - contains: Structural containment (topic contains beliefs)
|
|
71
|
-
* - tests: Question tests a belief (falsification link)
|
|
72
|
-
*/
|
|
73
|
-
export const EPISTEMIC_EDGE_TYPES = [
|
|
74
|
-
"supports",
|
|
75
|
-
"informs",
|
|
76
|
-
"depends_on",
|
|
77
|
-
"derived_from",
|
|
78
|
-
"contains",
|
|
79
|
-
"tests",
|
|
80
|
-
] as const;
|
|
81
|
-
export type EpistemicEdgeType = (typeof EPISTEMIC_EDGE_TYPES)[number];
|
|
82
|
-
|
|
83
|
-
/** Structural and lifecycle edges — required for graph integrity */
|
|
84
|
-
export const STRUCTURAL_EDGE_TYPES = [
|
|
85
|
-
"supersedes",
|
|
86
|
-
"responds_to",
|
|
87
|
-
"belongs_to",
|
|
88
|
-
"relates_to_thesis",
|
|
89
|
-
] as const;
|
|
90
|
-
export type StructuralEdgeType = (typeof STRUCTURAL_EDGE_TYPES)[number];
|
|
91
|
-
|
|
92
|
-
/** All valid edge types (epistemic + structural) */
|
|
93
|
-
export const EDGE_TYPES = [
|
|
94
|
-
...EPISTEMIC_EDGE_TYPES,
|
|
95
|
-
...STRUCTURAL_EDGE_TYPES,
|
|
96
|
-
] as const;
|
|
97
|
-
export type EdgeType = EpistemicEdgeType | StructuralEdgeType;
|
|
98
|
-
|
|
99
|
-
// =============================================================================
|
|
100
|
-
// REASONING METHODS
|
|
101
|
-
// =============================================================================
|
|
102
|
-
|
|
103
|
-
/** How an edge relationship was determined */
|
|
104
|
-
export const REASONING_METHODS = [
|
|
105
|
-
"deductive",
|
|
106
|
-
"inductive",
|
|
107
|
-
"abductive",
|
|
108
|
-
"analogical",
|
|
109
|
-
"empirical",
|
|
110
|
-
] as const;
|
|
111
|
-
export type ReasoningMethod = (typeof REASONING_METHODS)[number];
|
|
112
|
-
|
|
113
|
-
// =============================================================================
|
|
114
|
-
// CONTRADICTION ENUMS
|
|
115
|
-
// =============================================================================
|
|
116
|
-
|
|
117
|
-
/** Defeat types (Pollock taxonomy) — how a contradiction operates */
|
|
118
|
-
export const DEFEAT_TYPES = [
|
|
119
|
-
"rebuts",
|
|
120
|
-
"undercuts",
|
|
121
|
-
"undermines",
|
|
122
|
-
] as const;
|
|
123
|
-
export type DefeatType = (typeof DEFEAT_TYPES)[number];
|
|
124
|
-
|
|
125
|
-
/** Contradiction severity */
|
|
126
|
-
export const CONTRADICTION_SEVERITIES = [
|
|
127
|
-
"low",
|
|
128
|
-
"medium",
|
|
129
|
-
"high",
|
|
130
|
-
"critical",
|
|
131
|
-
] as const;
|
|
132
|
-
export type ContradictionSeverity = (typeof CONTRADICTION_SEVERITIES)[number];
|
|
133
|
-
|
|
134
|
-
/** Contradiction resolution status */
|
|
135
|
-
export const CONTRADICTION_STATUSES = [
|
|
136
|
-
"unresolved",
|
|
137
|
-
"resolved",
|
|
138
|
-
"accepted",
|
|
139
|
-
] as const;
|
|
140
|
-
export type ContradictionStatus = (typeof CONTRADICTION_STATUSES)[number];
|
|
141
|
-
|
|
142
|
-
// =============================================================================
|
|
143
|
-
// WORKTREE ENUMS
|
|
144
|
-
// =============================================================================
|
|
145
|
-
|
|
146
|
-
/** How a worktree investigation concluded */
|
|
147
|
-
export const MERGE_OUTCOMES = [
|
|
148
|
-
"validated",
|
|
149
|
-
"invalidated",
|
|
150
|
-
"forked",
|
|
151
|
-
"inconclusive",
|
|
152
|
-
] as const;
|
|
153
|
-
export type MergeOutcome = (typeof MERGE_OUTCOMES)[number];
|
|
154
|
-
|
|
155
|
-
/** Investigation phases within a worktree */
|
|
156
|
-
export const WORKTREE_PHASES = [
|
|
157
|
-
"hypothesis",
|
|
158
|
-
"investigation",
|
|
159
|
-
"evaluation",
|
|
160
|
-
"resolution",
|
|
161
|
-
] as const;
|
|
162
|
-
export type WorktreePhase = (typeof WORKTREE_PHASES)[number];
|
|
163
|
-
|
|
164
|
-
// =============================================================================
|
|
165
|
-
// EPISTEMIC LAYERS
|
|
166
|
-
// =============================================================================
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* The knowledge hierarchy — each layer builds on the one below it.
|
|
170
|
-
*
|
|
171
|
-
* - L1: Sources — raw inputs (documents, APIs, observations)
|
|
172
|
-
* - L2: Evidence — interpreted facts with context and weight
|
|
173
|
-
* - L3: Beliefs — structural claims that carry confidence
|
|
174
|
-
* - L4: Judgments — irreversible commitments based on the epistemic state
|
|
175
|
-
*/
|
|
176
|
-
export const EPISTEMIC_LAYERS = [
|
|
177
|
-
"L1",
|
|
178
|
-
"L2",
|
|
179
|
-
"L3",
|
|
180
|
-
"L4",
|
|
181
|
-
] as const;
|
|
182
|
-
export type EpistemicLayer = (typeof EPISTEMIC_LAYERS)[number];
|
|
183
|
-
|
|
184
|
-
// =============================================================================
|
|
185
|
-
// JUDGMENT TYPES
|
|
186
|
-
// =============================================================================
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Classification of L4 judgments — irreversible determinations.
|
|
190
|
-
*
|
|
191
|
-
* Judgments are evaluated against the knowledge horizon that existed
|
|
192
|
-
* when they were made. They cannot be retroactively invalidated —
|
|
193
|
-
* only new judgments can supersede old ones.
|
|
194
|
-
*/
|
|
195
|
-
export const JUDGMENT_TYPES = [
|
|
196
|
-
"thesis",
|
|
197
|
-
"thesis_maturity",
|
|
198
|
-
"contradiction_ruling",
|
|
199
|
-
"scope_determination",
|
|
200
|
-
"confidence_ruling",
|
|
201
|
-
] as const;
|
|
202
|
-
export type JudgmentType = (typeof JUDGMENT_TYPES)[number];
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session + Delegation Contract
|
|
3
|
-
*
|
|
4
|
-
* Canonical session lifecycle vocabulary shared by platform gateway auth,
|
|
5
|
-
* hosted MCP auth, Master Control persistence, and SDK session tokens.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const SESSION_AUTH_MODES = [
|
|
9
|
-
"interactive_user",
|
|
10
|
-
"service_principal",
|
|
11
|
-
"tenant_api_key",
|
|
12
|
-
"session_token",
|
|
13
|
-
] as const;
|
|
14
|
-
export type SessionAuthMode = (typeof SESSION_AUTH_MODES)[number];
|
|
15
|
-
|
|
16
|
-
export const SESSION_PRINCIPAL_TYPES = ["human", "service", "agent"] as const;
|
|
17
|
-
export type SessionPrincipalType = (typeof SESSION_PRINCIPAL_TYPES)[number];
|
|
18
|
-
|
|
19
|
-
export const SESSION_LIFECYCLE_STATUSES = [
|
|
20
|
-
"active",
|
|
21
|
-
"expired",
|
|
22
|
-
"revoked",
|
|
23
|
-
] as const;
|
|
24
|
-
export type SessionLifecycleStatus =
|
|
25
|
-
(typeof SESSION_LIFECYCLE_STATUSES)[number];
|
|
26
|
-
|
|
27
|
-
export type SessionDelegationHop = {
|
|
28
|
-
principalId: string;
|
|
29
|
-
principalType: SessionPrincipalType;
|
|
30
|
-
authMode?: SessionAuthMode;
|
|
31
|
-
sessionId?: string;
|
|
32
|
-
delegatedAt?: number;
|
|
33
|
-
reason?: string;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type SessionAuditOutcome =
|
|
37
|
-
| "accepted"
|
|
38
|
-
| "rejected"
|
|
39
|
-
| "revoked"
|
|
40
|
-
| "expired";
|
|
41
|
-
|
|
42
|
-
export type SessionAuditEnvelope = {
|
|
43
|
-
sessionId: string;
|
|
44
|
-
authMode: SessionAuthMode;
|
|
45
|
-
principalId: string;
|
|
46
|
-
principalType: SessionPrincipalType;
|
|
47
|
-
tenantId: string;
|
|
48
|
-
workspaceId?: string;
|
|
49
|
-
apiKeyId?: string;
|
|
50
|
-
scopes: readonly string[];
|
|
51
|
-
roles?: readonly string[];
|
|
52
|
-
delegationChain?: readonly SessionDelegationHop[];
|
|
53
|
-
sourceSessionId?: string;
|
|
54
|
-
expiresAt?: number;
|
|
55
|
-
request?: {
|
|
56
|
-
endpoint?: string;
|
|
57
|
-
method?: string;
|
|
58
|
-
correlationId?: string;
|
|
59
|
-
};
|
|
60
|
-
result?: {
|
|
61
|
-
outcome: SessionAuditOutcome;
|
|
62
|
-
reason?: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export function inferSessionPrincipalType(
|
|
67
|
-
principalId: string
|
|
68
|
-
): SessionPrincipalType {
|
|
69
|
-
if (principalId.startsWith("user:")) {
|
|
70
|
-
return "human";
|
|
71
|
-
}
|
|
72
|
-
if (principalId.startsWith("agent:")) {
|
|
73
|
-
return "agent";
|
|
74
|
-
}
|
|
75
|
-
return "service";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function normalizeDelegationChain(args: {
|
|
79
|
-
delegationChain?: readonly SessionDelegationHop[];
|
|
80
|
-
delegatedBy?: string;
|
|
81
|
-
delegatedByType?: SessionPrincipalType;
|
|
82
|
-
delegatedAt?: number;
|
|
83
|
-
reason?: string;
|
|
84
|
-
}): SessionDelegationHop[] | undefined {
|
|
85
|
-
if (args.delegationChain && args.delegationChain.length > 0) {
|
|
86
|
-
return [...args.delegationChain];
|
|
87
|
-
}
|
|
88
|
-
if (!args.delegatedBy) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
return [
|
|
92
|
-
{
|
|
93
|
-
principalId: args.delegatedBy,
|
|
94
|
-
principalType:
|
|
95
|
-
args.delegatedByType ?? inferSessionPrincipalType(args.delegatedBy),
|
|
96
|
-
delegatedAt: args.delegatedAt,
|
|
97
|
-
reason: args.reason,
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function lastDelegator(
|
|
103
|
-
delegationChain?: readonly SessionDelegationHop[]
|
|
104
|
-
): string | undefined {
|
|
105
|
-
if (!delegationChain || delegationChain.length === 0) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
return delegationChain[delegationChain.length - 1]?.principalId;
|
|
109
|
-
}
|