@shapeshift-labs/frontier-lang-compiler 0.2.65 → 0.2.67
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/README.md +37 -8
- package/bench/smoke.mjs +15 -1
- package/bench/universal-fixture-suite.mjs +183 -0
- package/dist/declarations/import-adapter-core.d.ts +3 -0
- package/dist/declarations/native-project-admission.d.ts +133 -0
- package/dist/declarations/roundtrip-audit.d.ts +177 -0
- package/dist/declarations/roundtrip.d.ts +2 -53
- package/dist/declarations/semantic-history-records.d.ts +277 -0
- package/dist/declarations/semantic-history.d.ts +45 -92
- package/dist/declarations/semantic-merge-candidates.d.ts +200 -0
- package/dist/declarations/semantic-merge-conflicts.d.ts +12 -0
- package/dist/declarations/semantic-sidecar.d.ts +8 -3
- package/dist/declarations/semantic-slice-admission.d.ts +111 -0
- package/dist/declarations/semantic-slice.d.ts +36 -1
- package/dist/declarations/universal-conversion-plan.d.ts +59 -0
- package/dist/declarations/universal-runtime-capabilities.d.ts +171 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/internal/index-impl/attachExternalOwnership.js +18 -10
- package/dist/internal/index-impl/createNativeRoundtripEvidence.js +54 -49
- package/dist/internal/index-impl/createSemanticImportSidecar.js +6 -0
- package/dist/internal/index-impl/createSemanticSlice.js +4 -3
- package/dist/internal/index-impl/createSemanticSliceAdmissionRecord.js +10 -1
- package/dist/internal/index-impl/diffNativeSourceImports.js +3 -2
- package/dist/internal/index-impl/expandSemanticSliceSelection.js +0 -1
- package/dist/internal/index-impl/externalSemanticBase.js +1 -0
- package/dist/internal/index-impl/importExternalSemanticIndex.js +4 -0
- package/dist/internal/index-impl/nativeRoundtripAudit.js +217 -0
- package/dist/internal/index-impl/projectImportAdmissionImportEvidence.js +160 -0
- package/dist/internal/index-impl/projectImportAdmissionLanguageSummaries.js +247 -0
- package/dist/internal/index-impl/projectImportAdmissionRanks.js +52 -0
- package/dist/internal/index-impl/projectImportAdmissionSummaries.js +77 -117
- package/dist/internal/index-impl/projectImportAdmissionTasks.js +239 -0
- package/dist/internal/index-impl/semanticHistoryRecordNormalizers.js +151 -0
- package/dist/internal/index-impl/semanticHistoryRecordOverlaps.js +113 -0
- package/dist/internal/index-impl/semanticHistoryRecords.js +210 -149
- package/dist/internal/index-impl/semanticMergeCandidateRecordInternals.js +314 -0
- package/dist/internal/index-impl/semanticMergeCandidateRecords.js +241 -0
- package/dist/internal/index-impl/semanticSliceAdmissionSurface.js +142 -0
- package/dist/internal/index-impl/semanticSliceExpectationAssertions.js +100 -0
- package/dist/internal/index-impl/semanticSliceExpectationRecords.js +75 -0
- package/dist/internal/index-impl/semanticSliceExpectedAssertions.js +5 -2
- package/dist/internal/index-impl/testSemanticSlice.js +4 -1
- package/dist/internal/index-impl/withExternalEmptyLoss.js +1 -0
- package/dist/language-adapter-package-contracts.js +12 -57
- package/dist/language-adapter-package-rows.js +116 -0
- package/dist/lightweight-dependency-language.js +8 -0
- package/dist/native-region-scanner-core.js +42 -10
- package/dist/native-region-scanner-js-helpers.js +2 -0
- package/dist/native-region-scanner-js-imports.js +111 -0
- package/dist/native-region-scanner-js.js +111 -28
- package/dist/universal-conversion-plan-summary.js +42 -0
- package/dist/universal-conversion-plan.js +46 -40
- package/dist/universal-runtime-capabilities.js +92 -0
- package/dist/universal-runtime-host-selectors.js +192 -0
- package/dist/universal-runtime-profiles.js +109 -0
- package/dist/universal-runtime-route-records.js +162 -0
- package/examples/js-frontier-rust-workbench-adapters.mjs +89 -0
- package/examples/js-frontier-rust-workbench-bounds.mjs +4 -3
- package/examples/js-frontier-rust-workbench-client.mjs +135 -59
- package/examples/js-frontier-rust-workbench-convert.mjs +161 -0
- package/examples/js-frontier-rust-workbench-html.mjs +20 -13
- package/examples/js-frontier-rust-workbench-route-styles.mjs +126 -0
- package/examples/js-frontier-rust-workbench-route.mjs +190 -0
- package/examples/js-frontier-rust-workbench-styles.mjs +12 -54
- package/examples/js-frontier-rust-workbench.mjs +54 -214
- package/package.json +1 -1
|
@@ -105,59 +105,8 @@ export interface NativeImportRoundtripReadinessClassification {
|
|
|
105
105
|
|
|
106
106
|
export type NativeRoundtripEvidenceStatus = NativeImportRoundtripReadinessStatus | 'target-adapter';
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
export type NativeRoundtripAuditDisposition =
|
|
111
|
-
| 'reversible'
|
|
112
|
-
| 'preserved-source'
|
|
113
|
-
| 'stub-only'
|
|
114
|
-
| 'adapter-projected'
|
|
115
|
-
| 'review-required';
|
|
116
|
-
|
|
117
|
-
export type NativeRoundtripAuditClaim =
|
|
118
|
-
| 'source-text-reversible'
|
|
119
|
-
| 'source-preserved'
|
|
120
|
-
| 'declaration-stubs-only'
|
|
121
|
-
| 'host-adapter-projected'
|
|
122
|
-
| 'review-required';
|
|
123
|
-
|
|
124
|
-
export interface NativeRoundtripSourceMapEvidence {
|
|
125
|
-
readonly total: number;
|
|
126
|
-
readonly ids: readonly string[];
|
|
127
|
-
readonly mappings: number;
|
|
128
|
-
readonly precision: NativeRoundtripSourceMapPrecision;
|
|
129
|
-
readonly byPrecision: Readonly<Record<string, number>>;
|
|
130
|
-
readonly byOrigin: Readonly<Record<string, number>>;
|
|
131
|
-
readonly withSourceSpan: number;
|
|
132
|
-
readonly withGeneratedSpan: number;
|
|
133
|
-
readonly withSemanticSymbol: number;
|
|
134
|
-
readonly targetPaths: readonly string[];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export interface NativeRoundtripAuditSignal {
|
|
138
|
-
readonly schema: 'frontier.lang.nativeRoundtripAuditSignal';
|
|
139
|
-
readonly version: 1;
|
|
140
|
-
readonly disposition: NativeRoundtripAuditDisposition;
|
|
141
|
-
readonly claim: NativeRoundtripAuditClaim;
|
|
142
|
-
readonly sourceLanguage?: FrontierSourceLanguage | string;
|
|
143
|
-
readonly target?: CompileTarget | string;
|
|
144
|
-
readonly sameLanguage: boolean;
|
|
145
|
-
readonly outputMode?: NativeSourceCompileOutputMode;
|
|
146
|
-
readonly projectionMode?: NativeSourceProjectionMode;
|
|
147
|
-
readonly sourceHashVerified: boolean;
|
|
148
|
-
readonly outputSourceMapPrecision: NativeRoundtripSourceMapPrecision;
|
|
149
|
-
readonly universalSourceMapPrecision: NativeRoundtripSourceMapPrecision;
|
|
150
|
-
readonly targetProjectionAdapterId?: string;
|
|
151
|
-
readonly targetCoverageLossClass?: ProjectionTargetLossClass | string;
|
|
152
|
-
readonly reviewRequired: boolean;
|
|
153
|
-
readonly semanticMergeReadiness: SemanticMergeReadiness;
|
|
154
|
-
readonly semanticEquivalenceClaim: false;
|
|
155
|
-
readonly autoMergeClaim: false;
|
|
156
|
-
readonly blockingLossCount: number;
|
|
157
|
-
readonly reviewLossCount: number;
|
|
158
|
-
readonly reasonCodes: readonly string[];
|
|
159
|
-
}
|
|
160
|
-
|
|
108
|
+
import type { NativeRoundtripSourceMapPrecision, NativeRoundtripAuditDisposition, NativeRoundtripAuditClaim, NativeRoundtripSourceMapEvidence, NativeRoundtripRoutePathSignal, NativeRoundtripRoutePathsAudit, NativeRoundtripSourcePreservationAudit, NativeRoundtripGeneratedStubsAudit, NativeRoundtripAdapterProjectionAudit, NativeRoundtripRouteSourceMapsAudit, NativeRoundtripHashChecksAudit, NativeRoundtripCommentsTriviaAudit, NativeRoundtripTargetCoverageAudit, NativeRoundtripSemanticEquivalenceAudit, NativeRoundtripAuditSignal } from './roundtrip-audit.js';
|
|
109
|
+
export type { NativeRoundtripSourceMapPrecision, NativeRoundtripAuditDisposition, NativeRoundtripAuditClaim, NativeRoundtripSourceMapEvidence, NativeRoundtripRoutePathSignal, NativeRoundtripRoutePathsAudit, NativeRoundtripSourcePreservationAudit, NativeRoundtripGeneratedStubsAudit, NativeRoundtripAdapterProjectionAudit, NativeRoundtripRouteSourceMapsAudit, NativeRoundtripHashChecksAudit, NativeRoundtripCommentsTriviaAudit, NativeRoundtripTargetCoverageAudit, NativeRoundtripSemanticEquivalenceAudit, NativeRoundtripAuditSignal } from './roundtrip-audit.js';
|
|
161
110
|
export interface NativeRoundtripEvidenceMetadata {
|
|
162
111
|
readonly status: NativeRoundtripEvidenceStatus;
|
|
163
112
|
readonly semanticMergeReadiness: SemanticMergeReadiness;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
EvidenceRecord,
|
|
3
|
+
FrontierSourceLanguage,
|
|
4
|
+
SemanticMergeReadiness,
|
|
5
|
+
SourceSpan
|
|
6
|
+
} from '@shapeshift-labs/frontier-lang-kernel';
|
|
7
|
+
|
|
8
|
+
export type SemanticHistoryAdmissionStatus = 'proposed' | 'queued' | 'admitted' | 'needs-review' | 'blocked' | 'rejected' | string;
|
|
9
|
+
export type SemanticHistoryReviewerStatus = 'unreviewed' | 'approved' | 'changes-requested' | 'reviewed' | 'rejected' | string;
|
|
10
|
+
export type SemanticHistoryReplayLinkKind = 'patch' | 'slice' | 'sidecar' | 'run' | 'proof' | 'source' | 'command' | 'url' | 'replay' | string;
|
|
11
|
+
export type SemanticHistoryOverlapKind = 'ownership' | 'conflict-key' | 'source' | 'source-path' | 'import' | 'semantic-candidate' | 'semantic-claim' | 'claim-hash' | 'evidence' | 'proof' | 'replay' | 'patch' | 'merge-decision' | 'actor' | 'record-source' | 'base-hash' | 'target-hash';
|
|
12
|
+
export type SemanticHistoryConflictReason = 'ownership-overlap' | 'semantic-conflict-key-overlap' | 'base-hash-mismatch' | 'target-hash-mismatch' | 'admission-blocked' | 'reviewer-rejected' | 'source-path-overlap' | string;
|
|
13
|
+
export type SemanticHistoryClaimKind = 'fact' | 'theory' | 'invariant' | 'semantic-claim' | string;
|
|
14
|
+
export type SemanticHistoryClaimStatus = 'accepted' | 'rejected' | 'proposed' | 'superseded' | string;
|
|
15
|
+
export type SemanticHistoryProofAttemptStatus = 'passed' | 'failed' | 'unknown' | 'blocked' | string;
|
|
16
|
+
export type SemanticHistoryMergeDecisionStatus = 'accepted' | 'rejected' | 'admitted' | 'blocked' | 'needs-review' | string;
|
|
17
|
+
|
|
18
|
+
export interface SemanticHistoryActorRef {
|
|
19
|
+
readonly id?: string;
|
|
20
|
+
readonly kind?: string;
|
|
21
|
+
readonly role?: string;
|
|
22
|
+
readonly displayName?: string;
|
|
23
|
+
readonly runId?: string;
|
|
24
|
+
readonly lane?: string;
|
|
25
|
+
readonly taskId?: string;
|
|
26
|
+
readonly metadata?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SemanticHistoryRecordSourceRef {
|
|
30
|
+
readonly id?: string;
|
|
31
|
+
readonly sourceId?: string;
|
|
32
|
+
readonly sourceKind?: string;
|
|
33
|
+
readonly sourcePath?: string;
|
|
34
|
+
readonly sourceHash?: string;
|
|
35
|
+
readonly href?: string;
|
|
36
|
+
readonly importId?: string;
|
|
37
|
+
readonly runId?: string;
|
|
38
|
+
readonly jobId?: string;
|
|
39
|
+
readonly lane?: string;
|
|
40
|
+
readonly taskId?: string;
|
|
41
|
+
readonly metadata?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface SemanticHistorySourceRef {
|
|
45
|
+
readonly id?: string;
|
|
46
|
+
readonly importId?: string;
|
|
47
|
+
readonly language?: FrontierSourceLanguage | string;
|
|
48
|
+
readonly sourcePath?: string;
|
|
49
|
+
readonly sourceHash?: string;
|
|
50
|
+
readonly baseHash?: string;
|
|
51
|
+
readonly targetHash?: string;
|
|
52
|
+
readonly metadata?: Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface SemanticHistoryOwnershipRegionRef {
|
|
56
|
+
readonly id?: string;
|
|
57
|
+
readonly key: string;
|
|
58
|
+
readonly regionKind?: string;
|
|
59
|
+
readonly granularity?: string;
|
|
60
|
+
readonly language?: FrontierSourceLanguage | string;
|
|
61
|
+
readonly sourcePath?: string;
|
|
62
|
+
readonly sourceHash?: string;
|
|
63
|
+
readonly symbolId?: string;
|
|
64
|
+
readonly symbolName?: string;
|
|
65
|
+
readonly sourceSpan?: SourceSpan;
|
|
66
|
+
readonly metadata?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface SemanticHistoryCandidateRef {
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly importResultId?: string;
|
|
72
|
+
readonly patchId?: string;
|
|
73
|
+
readonly sourcePath?: string;
|
|
74
|
+
readonly baseHash?: string;
|
|
75
|
+
readonly targetHash?: string;
|
|
76
|
+
readonly readiness?: SemanticMergeReadiness | string;
|
|
77
|
+
readonly conflictKeys: readonly string[];
|
|
78
|
+
readonly ownershipKeys: readonly string[];
|
|
79
|
+
readonly evidenceIds: readonly string[];
|
|
80
|
+
readonly proofIds: readonly string[];
|
|
81
|
+
readonly replayIds: readonly string[];
|
|
82
|
+
readonly metadata?: Record<string, unknown>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface SemanticHistoryClaimRecord {
|
|
86
|
+
readonly kind: 'frontier.lang.semanticHistoryClaim';
|
|
87
|
+
readonly version: 1;
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly hash: string;
|
|
90
|
+
readonly claimKind?: SemanticHistoryClaimKind;
|
|
91
|
+
readonly status?: SemanticHistoryClaimStatus;
|
|
92
|
+
readonly subject?: string;
|
|
93
|
+
readonly predicate?: string;
|
|
94
|
+
readonly object?: unknown;
|
|
95
|
+
readonly text?: string;
|
|
96
|
+
readonly language?: FrontierSourceLanguage | string;
|
|
97
|
+
readonly sourcePath?: string;
|
|
98
|
+
readonly sourceHash?: string;
|
|
99
|
+
readonly baseHash?: string;
|
|
100
|
+
readonly targetHash?: string;
|
|
101
|
+
readonly conflictKeys?: readonly string[];
|
|
102
|
+
readonly evidenceIds?: readonly string[];
|
|
103
|
+
readonly proofIds?: readonly string[];
|
|
104
|
+
readonly replayIds?: readonly string[];
|
|
105
|
+
readonly actor?: SemanticHistoryActorRef;
|
|
106
|
+
readonly recordSource?: SemanticHistoryRecordSourceRef;
|
|
107
|
+
readonly metadata?: Record<string, unknown>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface SemanticHistoryImportedParserEvidenceRecord {
|
|
111
|
+
readonly kind: 'frontier.lang.semanticHistoryImportedParserEvidence';
|
|
112
|
+
readonly version: 1;
|
|
113
|
+
readonly id: string;
|
|
114
|
+
readonly hash: string;
|
|
115
|
+
readonly evidenceId?: string;
|
|
116
|
+
readonly importId?: string;
|
|
117
|
+
readonly parserId?: string;
|
|
118
|
+
readonly parserKind?: string;
|
|
119
|
+
readonly language?: FrontierSourceLanguage | string;
|
|
120
|
+
readonly sourcePath?: string;
|
|
121
|
+
readonly sourceHash?: string;
|
|
122
|
+
readonly astHash?: string;
|
|
123
|
+
readonly semanticIndexHash?: string;
|
|
124
|
+
readonly status?: EvidenceRecord['status'] | string;
|
|
125
|
+
readonly evidenceIds?: readonly string[];
|
|
126
|
+
readonly replayIds?: readonly string[];
|
|
127
|
+
readonly actor?: SemanticHistoryActorRef;
|
|
128
|
+
readonly recordSource?: SemanticHistoryRecordSourceRef;
|
|
129
|
+
readonly metadata?: Record<string, unknown>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface SemanticHistoryProofAttemptRecord {
|
|
133
|
+
readonly kind: 'frontier.lang.semanticHistoryProofAttempt';
|
|
134
|
+
readonly version: 1;
|
|
135
|
+
readonly id: string;
|
|
136
|
+
readonly hash: string;
|
|
137
|
+
readonly proofId?: string;
|
|
138
|
+
readonly proofKind?: string;
|
|
139
|
+
readonly status?: SemanticHistoryProofAttemptStatus;
|
|
140
|
+
readonly proverId?: string;
|
|
141
|
+
readonly claimIds?: readonly string[];
|
|
142
|
+
readonly evidenceIds?: readonly string[];
|
|
143
|
+
readonly proofIds?: readonly string[];
|
|
144
|
+
readonly replayIds?: readonly string[];
|
|
145
|
+
readonly command?: string;
|
|
146
|
+
readonly resultHash?: string;
|
|
147
|
+
readonly actor?: SemanticHistoryActorRef;
|
|
148
|
+
readonly recordSource?: SemanticHistoryRecordSourceRef;
|
|
149
|
+
readonly metadata?: Record<string, unknown>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface SemanticHistoryPatchAncestryRecord {
|
|
153
|
+
readonly kind: 'frontier.lang.semanticHistoryPatchAncestry';
|
|
154
|
+
readonly version: 1;
|
|
155
|
+
readonly id: string;
|
|
156
|
+
readonly hash: string;
|
|
157
|
+
readonly patchId?: string;
|
|
158
|
+
readonly parentPatchIds?: readonly string[];
|
|
159
|
+
readonly ancestorPatchIds?: readonly string[];
|
|
160
|
+
readonly baseHash?: string;
|
|
161
|
+
readonly targetHash?: string;
|
|
162
|
+
readonly parentHashes?: readonly string[];
|
|
163
|
+
readonly ancestorHashes?: readonly string[];
|
|
164
|
+
readonly conflictKeys?: readonly string[];
|
|
165
|
+
readonly actor?: SemanticHistoryActorRef;
|
|
166
|
+
readonly recordSource?: SemanticHistoryRecordSourceRef;
|
|
167
|
+
readonly metadata?: Record<string, unknown>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface SemanticHistoryMergeDecisionRecord {
|
|
171
|
+
readonly kind: 'frontier.lang.semanticHistoryMergeDecision';
|
|
172
|
+
readonly version: 1;
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly hash: string;
|
|
175
|
+
readonly decision?: SemanticHistoryMergeDecisionStatus;
|
|
176
|
+
readonly status?: SemanticHistoryMergeDecisionStatus;
|
|
177
|
+
readonly decidedAt?: number | string;
|
|
178
|
+
readonly claimIds?: readonly string[];
|
|
179
|
+
readonly acceptedClaimIds?: readonly string[];
|
|
180
|
+
readonly rejectedClaimIds?: readonly string[];
|
|
181
|
+
readonly patchIds?: readonly string[];
|
|
182
|
+
readonly conflictKeys?: readonly string[];
|
|
183
|
+
readonly evidenceIds?: readonly string[];
|
|
184
|
+
readonly proofIds?: readonly string[];
|
|
185
|
+
readonly reasonCodes?: readonly string[];
|
|
186
|
+
readonly actor?: SemanticHistoryActorRef;
|
|
187
|
+
readonly recordSource?: SemanticHistoryRecordSourceRef;
|
|
188
|
+
readonly metadata?: Record<string, unknown>;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export type SemanticHistoryClaimInput = string | (Partial<SemanticHistoryClaimRecord> & {
|
|
192
|
+
readonly relation?: string;
|
|
193
|
+
readonly value?: unknown;
|
|
194
|
+
readonly expected?: unknown;
|
|
195
|
+
readonly key?: string;
|
|
196
|
+
readonly conflictKey?: string;
|
|
197
|
+
readonly accepted?: boolean;
|
|
198
|
+
readonly rejected?: boolean;
|
|
199
|
+
readonly semanticNodeId?: string;
|
|
200
|
+
readonly symbolId?: string;
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
export type SemanticHistoryImportedParserEvidenceInput = string | EvidenceRecord | (Partial<SemanticHistoryImportedParserEvidenceRecord> & {
|
|
204
|
+
readonly parser?: string;
|
|
205
|
+
readonly adapterId?: string;
|
|
206
|
+
readonly nativeAstHash?: string;
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
export type SemanticHistoryProofAttemptInput = string | EvidenceRecord | (Partial<SemanticHistoryProofAttemptRecord> & {
|
|
210
|
+
readonly prover?: string;
|
|
211
|
+
readonly proofHash?: string;
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
export type SemanticHistoryPatchAncestryInput = string | (Partial<SemanticHistoryPatchAncestryRecord> & {
|
|
215
|
+
readonly parents?: readonly string[] | string;
|
|
216
|
+
readonly ancestors?: readonly string[] | string;
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export type SemanticHistoryMergeDecisionInput = string | Partial<SemanticHistoryMergeDecisionRecord>;
|
|
220
|
+
|
|
221
|
+
export interface SemanticHistoryReviewerState {
|
|
222
|
+
readonly status: SemanticHistoryReviewerStatus;
|
|
223
|
+
readonly reviewerId?: string;
|
|
224
|
+
readonly reviewedAt?: number | string;
|
|
225
|
+
readonly evidenceIds?: readonly string[];
|
|
226
|
+
readonly metadata?: Record<string, unknown>;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface SemanticHistoryAdmissionState {
|
|
230
|
+
readonly status: SemanticHistoryAdmissionStatus;
|
|
231
|
+
readonly readiness: SemanticMergeReadiness | string;
|
|
232
|
+
readonly admittedAt?: number | string;
|
|
233
|
+
readonly reviewerId?: string;
|
|
234
|
+
readonly reasonCodes?: readonly string[];
|
|
235
|
+
readonly evidenceIds?: readonly string[];
|
|
236
|
+
readonly metadata?: Record<string, unknown>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface SemanticHistoryReplayLink {
|
|
240
|
+
readonly id: string;
|
|
241
|
+
readonly kind: SemanticHistoryReplayLinkKind;
|
|
242
|
+
readonly href?: string;
|
|
243
|
+
readonly path?: string;
|
|
244
|
+
readonly command?: string;
|
|
245
|
+
readonly hash?: string;
|
|
246
|
+
readonly targetId?: string;
|
|
247
|
+
readonly metadata?: Record<string, unknown>;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface SemanticHistoryRecordIndex {
|
|
251
|
+
readonly baseHashes: readonly string[];
|
|
252
|
+
readonly targetHashes: readonly string[];
|
|
253
|
+
readonly sourceIds: readonly string[];
|
|
254
|
+
readonly importIds: readonly string[];
|
|
255
|
+
readonly sourcePaths: readonly string[];
|
|
256
|
+
readonly sourceHashes: readonly string[];
|
|
257
|
+
readonly actorIds: readonly string[];
|
|
258
|
+
readonly recordSourceIds: readonly string[];
|
|
259
|
+
readonly ownershipKeys: readonly string[];
|
|
260
|
+
readonly semanticCandidateIds: readonly string[];
|
|
261
|
+
readonly semanticClaimIds: readonly string[];
|
|
262
|
+
readonly semanticClaimHashes: readonly string[];
|
|
263
|
+
readonly acceptedFactIds: readonly string[];
|
|
264
|
+
readonly rejectedTheoryIds: readonly string[];
|
|
265
|
+
readonly conflictKeys: readonly string[];
|
|
266
|
+
readonly evidenceIds: readonly string[];
|
|
267
|
+
readonly importedParserEvidenceIds: readonly string[];
|
|
268
|
+
readonly importedParserEvidenceHashes: readonly string[];
|
|
269
|
+
readonly proofIds: readonly string[];
|
|
270
|
+
readonly proofAttemptIds: readonly string[];
|
|
271
|
+
readonly proofAttemptHashes: readonly string[];
|
|
272
|
+
readonly replayIds: readonly string[];
|
|
273
|
+
readonly patchIds: readonly string[];
|
|
274
|
+
readonly patchHashes: readonly string[];
|
|
275
|
+
readonly mergeDecisionIds: readonly string[];
|
|
276
|
+
readonly mergeDecisionHashes: readonly string[];
|
|
277
|
+
}
|
|
@@ -7,111 +7,32 @@ import type {
|
|
|
7
7
|
} from '@shapeshift-labs/frontier-lang-kernel';
|
|
8
8
|
import type { SemanticImportOwnershipRegion } from './semantic-sidecar.js';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
export type SemanticHistoryReviewerStatus
|
|
12
|
-
export type SemanticHistoryReplayLinkKind = 'patch' | 'slice' | 'sidecar' | 'run' | 'proof' | 'source' | 'command' | 'url' | 'replay' | string;
|
|
13
|
-
export type SemanticHistoryOverlapKind = 'ownership' | 'conflict-key' | 'source' | 'source-path' | 'import' | 'semantic-candidate' | 'evidence' | 'proof' | 'replay' | 'base-hash' | 'target-hash';
|
|
14
|
-
export type SemanticHistoryConflictReason = 'ownership-overlap' | 'semantic-conflict-key-overlap' | 'base-hash-mismatch' | 'target-hash-mismatch' | 'admission-blocked' | 'reviewer-rejected' | 'source-path-overlap' | string;
|
|
15
|
-
|
|
16
|
-
export interface SemanticHistorySourceRef {
|
|
17
|
-
readonly id?: string;
|
|
18
|
-
readonly importId?: string;
|
|
19
|
-
readonly language?: FrontierSourceLanguage | string;
|
|
20
|
-
readonly sourcePath?: string;
|
|
21
|
-
readonly sourceHash?: string;
|
|
22
|
-
readonly baseHash?: string;
|
|
23
|
-
readonly targetHash?: string;
|
|
24
|
-
readonly metadata?: Record<string, unknown>;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface SemanticHistoryOwnershipRegionRef {
|
|
28
|
-
readonly id?: string;
|
|
29
|
-
readonly key: string;
|
|
30
|
-
readonly regionKind?: string;
|
|
31
|
-
readonly granularity?: string;
|
|
32
|
-
readonly language?: FrontierSourceLanguage | string;
|
|
33
|
-
readonly sourcePath?: string;
|
|
34
|
-
readonly sourceHash?: string;
|
|
35
|
-
readonly symbolId?: string;
|
|
36
|
-
readonly symbolName?: string;
|
|
37
|
-
readonly sourceSpan?: SourceSpan;
|
|
38
|
-
readonly metadata?: Record<string, unknown>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface SemanticHistoryCandidateRef {
|
|
42
|
-
readonly id: string;
|
|
43
|
-
readonly importResultId?: string;
|
|
44
|
-
readonly patchId?: string;
|
|
45
|
-
readonly sourcePath?: string;
|
|
46
|
-
readonly baseHash?: string;
|
|
47
|
-
readonly targetHash?: string;
|
|
48
|
-
readonly readiness?: SemanticMergeReadiness | string;
|
|
49
|
-
readonly conflictKeys: readonly string[];
|
|
50
|
-
readonly ownershipKeys: readonly string[];
|
|
51
|
-
readonly evidenceIds: readonly string[];
|
|
52
|
-
readonly proofIds: readonly string[];
|
|
53
|
-
readonly replayIds: readonly string[];
|
|
54
|
-
readonly metadata?: Record<string, unknown>;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface SemanticHistoryReviewerState {
|
|
58
|
-
readonly status: SemanticHistoryReviewerStatus;
|
|
59
|
-
readonly reviewerId?: string;
|
|
60
|
-
readonly reviewedAt?: number | string;
|
|
61
|
-
readonly evidenceIds?: readonly string[];
|
|
62
|
-
readonly metadata?: Record<string, unknown>;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface SemanticHistoryAdmissionState {
|
|
66
|
-
readonly status: SemanticHistoryAdmissionStatus;
|
|
67
|
-
readonly readiness: SemanticMergeReadiness | string;
|
|
68
|
-
readonly admittedAt?: number | string;
|
|
69
|
-
readonly reviewerId?: string;
|
|
70
|
-
readonly reasonCodes?: readonly string[];
|
|
71
|
-
readonly evidenceIds?: readonly string[];
|
|
72
|
-
readonly metadata?: Record<string, unknown>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface SemanticHistoryReplayLink {
|
|
76
|
-
readonly id: string;
|
|
77
|
-
readonly kind: SemanticHistoryReplayLinkKind;
|
|
78
|
-
readonly href?: string;
|
|
79
|
-
readonly path?: string;
|
|
80
|
-
readonly command?: string;
|
|
81
|
-
readonly hash?: string;
|
|
82
|
-
readonly targetId?: string;
|
|
83
|
-
readonly metadata?: Record<string, unknown>;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface SemanticHistoryRecordIndex {
|
|
87
|
-
readonly baseHashes: readonly string[];
|
|
88
|
-
readonly targetHashes: readonly string[];
|
|
89
|
-
readonly sourceIds: readonly string[];
|
|
90
|
-
readonly importIds: readonly string[];
|
|
91
|
-
readonly sourcePaths: readonly string[];
|
|
92
|
-
readonly sourceHashes: readonly string[];
|
|
93
|
-
readonly ownershipKeys: readonly string[];
|
|
94
|
-
readonly semanticCandidateIds: readonly string[];
|
|
95
|
-
readonly conflictKeys: readonly string[];
|
|
96
|
-
readonly evidenceIds: readonly string[];
|
|
97
|
-
readonly proofIds: readonly string[];
|
|
98
|
-
readonly replayIds: readonly string[];
|
|
99
|
-
}
|
|
100
|
-
|
|
10
|
+
import type { SemanticHistoryAdmissionStatus, SemanticHistoryReviewerStatus, SemanticHistoryReplayLinkKind, SemanticHistoryOverlapKind, SemanticHistoryConflictReason, SemanticHistoryClaimKind, SemanticHistoryClaimStatus, SemanticHistoryProofAttemptStatus, SemanticHistoryMergeDecisionStatus, SemanticHistoryActorRef, SemanticHistoryRecordSourceRef, SemanticHistorySourceRef, SemanticHistoryOwnershipRegionRef, SemanticHistoryCandidateRef, SemanticHistoryClaimRecord, SemanticHistoryImportedParserEvidenceRecord, SemanticHistoryProofAttemptRecord, SemanticHistoryPatchAncestryRecord, SemanticHistoryMergeDecisionRecord, SemanticHistoryClaimInput, SemanticHistoryImportedParserEvidenceInput, SemanticHistoryProofAttemptInput, SemanticHistoryPatchAncestryInput, SemanticHistoryMergeDecisionInput, SemanticHistoryReviewerState, SemanticHistoryAdmissionState, SemanticHistoryReplayLink, SemanticHistoryRecordIndex } from './semantic-history-records.js';
|
|
11
|
+
export type { SemanticHistoryAdmissionStatus, SemanticHistoryReviewerStatus, SemanticHistoryReplayLinkKind, SemanticHistoryOverlapKind, SemanticHistoryConflictReason, SemanticHistoryClaimKind, SemanticHistoryClaimStatus, SemanticHistoryProofAttemptStatus, SemanticHistoryMergeDecisionStatus, SemanticHistoryActorRef, SemanticHistoryRecordSourceRef, SemanticHistorySourceRef, SemanticHistoryOwnershipRegionRef, SemanticHistoryCandidateRef, SemanticHistoryClaimRecord, SemanticHistoryImportedParserEvidenceRecord, SemanticHistoryProofAttemptRecord, SemanticHistoryPatchAncestryRecord, SemanticHistoryMergeDecisionRecord, SemanticHistoryClaimInput, SemanticHistoryImportedParserEvidenceInput, SemanticHistoryProofAttemptInput, SemanticHistoryPatchAncestryInput, SemanticHistoryMergeDecisionInput, SemanticHistoryReviewerState, SemanticHistoryAdmissionState, SemanticHistoryReplayLink, SemanticHistoryRecordIndex } from './semantic-history-records.js';
|
|
101
12
|
export interface SemanticHistoryRecord {
|
|
102
13
|
readonly kind: 'frontier.lang.semanticHistoryRecord';
|
|
103
14
|
readonly version: 1;
|
|
104
15
|
readonly id: string;
|
|
16
|
+
readonly stableId: string;
|
|
17
|
+
readonly hash: string;
|
|
105
18
|
readonly createdAt: number | string;
|
|
106
19
|
readonly baseHash?: string;
|
|
107
20
|
readonly targetHash?: string;
|
|
108
21
|
readonly language?: FrontierSourceLanguage | string;
|
|
109
22
|
readonly sourcePath?: string;
|
|
23
|
+
readonly actor?: SemanticHistoryActorRef;
|
|
24
|
+
readonly recordSource?: SemanticHistoryRecordSourceRef;
|
|
110
25
|
readonly sourceIds: readonly string[];
|
|
111
26
|
readonly importIds: readonly string[];
|
|
112
27
|
readonly sources: readonly SemanticHistorySourceRef[];
|
|
113
28
|
readonly ownershipRegions: readonly SemanticHistoryOwnershipRegionRef[];
|
|
114
29
|
readonly semanticCandidates: readonly SemanticHistoryCandidateRef[];
|
|
30
|
+
readonly acceptedFacts: readonly SemanticHistoryClaimRecord[];
|
|
31
|
+
readonly rejectedTheories: readonly SemanticHistoryClaimRecord[];
|
|
32
|
+
readonly importedParserEvidence: readonly SemanticHistoryImportedParserEvidenceRecord[];
|
|
33
|
+
readonly proofAttempts: readonly SemanticHistoryProofAttemptRecord[];
|
|
34
|
+
readonly patchAncestry: readonly SemanticHistoryPatchAncestryRecord[];
|
|
35
|
+
readonly mergeDecisions: readonly SemanticHistoryMergeDecisionRecord[];
|
|
115
36
|
readonly evidenceIds: readonly string[];
|
|
116
37
|
readonly proofIds: readonly string[];
|
|
117
38
|
readonly reviewer: SemanticHistoryReviewerState;
|
|
@@ -124,6 +45,18 @@ export interface SemanticHistoryRecord {
|
|
|
124
45
|
export interface CreateSemanticHistoryRecordInput {
|
|
125
46
|
readonly id?: string;
|
|
126
47
|
readonly createdAt?: number | string;
|
|
48
|
+
readonly actor?: SemanticHistoryActorRef | string;
|
|
49
|
+
readonly actorId?: string;
|
|
50
|
+
readonly actorKind?: string;
|
|
51
|
+
readonly actorRole?: string;
|
|
52
|
+
readonly recordSource?: SemanticHistoryRecordSourceRef | string;
|
|
53
|
+
readonly historySource?: SemanticHistoryRecordSourceRef | string;
|
|
54
|
+
readonly recordSourceId?: string;
|
|
55
|
+
readonly historySourceId?: string;
|
|
56
|
+
readonly runId?: string;
|
|
57
|
+
readonly jobId?: string;
|
|
58
|
+
readonly lane?: string;
|
|
59
|
+
readonly taskId?: string;
|
|
127
60
|
readonly baseHash?: string;
|
|
128
61
|
readonly targetHash?: string;
|
|
129
62
|
readonly beforeHash?: string;
|
|
@@ -140,6 +73,21 @@ export interface CreateSemanticHistoryRecordInput {
|
|
|
140
73
|
readonly sourceRefs?: readonly SemanticHistorySourceRef[] | SemanticHistorySourceRef;
|
|
141
74
|
readonly ownershipRegions?: readonly (SemanticHistoryOwnershipRegionRef | SemanticImportOwnershipRegion)[] | SemanticHistoryOwnershipRegionRef | SemanticImportOwnershipRegion;
|
|
142
75
|
readonly semanticCandidates?: readonly (Partial<SemanticHistoryCandidateRef> | SemanticMergeCandidateRecord)[] | Partial<SemanticHistoryCandidateRef> | SemanticMergeCandidateRecord;
|
|
76
|
+
readonly semanticClaims?: readonly SemanticHistoryClaimInput[] | SemanticHistoryClaimInput;
|
|
77
|
+
readonly claims?: readonly SemanticHistoryClaimInput[] | SemanticHistoryClaimInput;
|
|
78
|
+
readonly acceptedFacts?: readonly SemanticHistoryClaimInput[] | SemanticHistoryClaimInput;
|
|
79
|
+
readonly acceptedSemanticClaims?: readonly SemanticHistoryClaimInput[] | SemanticHistoryClaimInput;
|
|
80
|
+
readonly rejectedTheories?: readonly SemanticHistoryClaimInput[] | SemanticHistoryClaimInput;
|
|
81
|
+
readonly rejectedSemanticClaims?: readonly SemanticHistoryClaimInput[] | SemanticHistoryClaimInput;
|
|
82
|
+
readonly importedParserEvidence?: readonly SemanticHistoryImportedParserEvidenceInput[] | SemanticHistoryImportedParserEvidenceInput;
|
|
83
|
+
readonly parserEvidence?: readonly SemanticHistoryImportedParserEvidenceInput[] | SemanticHistoryImportedParserEvidenceInput;
|
|
84
|
+
readonly proofAttempts?: readonly SemanticHistoryProofAttemptInput[] | SemanticHistoryProofAttemptInput;
|
|
85
|
+
readonly proofs?: readonly SemanticHistoryProofAttemptInput[] | SemanticHistoryProofAttemptInput;
|
|
86
|
+
readonly patchAncestry?: readonly SemanticHistoryPatchAncestryInput[] | SemanticHistoryPatchAncestryInput;
|
|
87
|
+
readonly patchAncestors?: readonly SemanticHistoryPatchAncestryInput[] | SemanticHistoryPatchAncestryInput;
|
|
88
|
+
readonly ancestry?: readonly SemanticHistoryPatchAncestryInput[] | SemanticHistoryPatchAncestryInput;
|
|
89
|
+
readonly mergeDecisions?: readonly SemanticHistoryMergeDecisionInput[] | SemanticHistoryMergeDecisionInput;
|
|
90
|
+
readonly decisions?: readonly SemanticHistoryMergeDecisionInput[] | SemanticHistoryMergeDecisionInput;
|
|
143
91
|
readonly mergeCandidates?: readonly SemanticMergeCandidateRecord[] | SemanticMergeCandidateRecord;
|
|
144
92
|
readonly evidence?: readonly EvidenceRecord[];
|
|
145
93
|
readonly evidenceIds?: readonly string[] | string;
|
|
@@ -158,9 +106,14 @@ export interface CreateSemanticHistoryRecordInput {
|
|
|
158
106
|
|
|
159
107
|
export interface SemanticHistoryOverlapQueryOptions {
|
|
160
108
|
readonly includeSourcePaths?: boolean;
|
|
109
|
+
readonly includeClaims?: boolean;
|
|
161
110
|
readonly includeEvidence?: boolean;
|
|
162
111
|
readonly includeProofs?: boolean;
|
|
163
112
|
readonly includeReplay?: boolean;
|
|
113
|
+
readonly includePatches?: boolean;
|
|
114
|
+
readonly includeMergeDecisions?: boolean;
|
|
115
|
+
readonly includeActors?: boolean;
|
|
116
|
+
readonly includeRecordSources?: boolean;
|
|
164
117
|
readonly includeBaseHashes?: boolean;
|
|
165
118
|
readonly includeTargetHashes?: boolean;
|
|
166
119
|
readonly conflictOnSourcePath?: boolean;
|
|
@@ -182,7 +135,7 @@ export declare const SemanticHistoryAdmissionStatuses: readonly SemanticHistoryA
|
|
|
182
135
|
export declare const SemanticHistoryReviewerStatuses: readonly SemanticHistoryReviewerStatus[];
|
|
183
136
|
export declare const SemanticHistoryOverlapKinds: readonly SemanticHistoryOverlapKind[];
|
|
184
137
|
export declare const SemanticHistoryConflictReasons: readonly SemanticHistoryConflictReason[];
|
|
185
|
-
export declare function createSemanticHistoryRecord(input?: CreateSemanticHistoryRecordInput, options?: { readonly id?: string; readonly createdAt?: number | string }): SemanticHistoryRecord;
|
|
138
|
+
export declare function createSemanticHistoryRecord(input?: CreateSemanticHistoryRecordInput, options?: { readonly id?: string; readonly createdAt?: number | string; readonly actor?: SemanticHistoryActorRef | string; readonly actorId?: string; readonly actorKind?: string; readonly actorRole?: string; readonly recordSource?: SemanticHistoryRecordSourceRef | string; readonly historySource?: SemanticHistoryRecordSourceRef | string; readonly recordSourceId?: string; readonly historySourceId?: string; readonly runId?: string; readonly jobId?: string; readonly lane?: string; readonly taskId?: string }): SemanticHistoryRecord;
|
|
186
139
|
export declare function querySemanticHistoryRecordOverlaps(records: SemanticHistoryRecord | readonly SemanticHistoryRecord[], options?: SemanticHistoryOverlapQueryOptions): readonly SemanticHistoryOverlapRecord[];
|
|
187
140
|
export declare function semanticHistoryRecordsOverlap(left: SemanticHistoryRecord, right: SemanticHistoryRecord, options?: SemanticHistoryOverlapQueryOptions): boolean;
|
|
188
141
|
export declare function semanticHistoryRecordsConflict(left: SemanticHistoryRecord, right: SemanticHistoryRecord, options?: SemanticHistoryOverlapQueryOptions): boolean;
|