@shapeshift-labs/frontier-lang-compiler 0.2.98 → 0.2.100
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/declarations/semantic-edit-bundle.d.ts +90 -0
- package/dist/declarations/semantic-edit-script.d.ts +34 -37
- package/dist/declarations/semantic-lineage.d.ts +63 -34
- package/dist/declarations/semantic-patch-bundle-index.d.ts +3 -0
- package/dist/declarations/semantic-patch-bundle.d.ts +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/index-impl/declarationRecord.js +2 -2
- package/dist/internal/index-impl/inferSemanticLineageEvents.js +8 -0
- package/dist/internal/index-impl/projectSemanticEditScriptToSource.js +56 -64
- package/dist/internal/index-impl/replaySemanticEditProjection.js +54 -22
- package/dist/internal/index-impl/semanticEditBundleAdmission.js +220 -0
- package/dist/internal/index-impl/semanticEditBundleIndex.js +16 -10
- package/dist/internal/index-impl/semanticEditSourceRanges.js +204 -0
- package/dist/internal/index-impl/semanticHistoryLineageResolution.js +35 -1
- package/dist/internal/index-impl/semanticIndexFromNativeDeclarations.js +2 -2
- package/dist/internal/index-impl/semanticLineageInferenceMatching.js +150 -13
- package/dist/internal/index-impl/semanticLineageResolutionRecords.js +28 -1
- package/dist/internal/index-impl/semanticPatchBundleAdmission.js +130 -11
- package/dist/internal/index-impl/semanticPatchBundleLineageLinks.js +199 -0
- package/dist/internal/index-impl/semanticPatchBundleOverlaps.js +6 -2
- package/dist/internal/index-impl/semanticPatchBundleRecords.js +65 -126
- package/dist/internal/index-impl/semanticPatchBundleSourceRecords.js +127 -0
- package/dist/internal/index-impl/sourceTextForSpan.js +4 -9
- package/dist/lightweight-dependency-relations.js +113 -7
- package/dist/native-import-utils.js +15 -1
- package/dist/native-region-scanner-js-helpers.js +61 -17
- package/dist/native-region-scanner-js.js +12 -4
- package/dist/semantic-import-regions.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { EvidenceRecord, SemanticMergeReadiness } from '@shapeshift-labs/frontier-lang-kernel';
|
|
2
|
+
import type { SemanticEditProjection, SemanticEditReplay, SemanticEditScript } from './semantic-edit-script.js';
|
|
3
|
+
|
|
4
|
+
export type SemanticEditBundleAdmissionStatus =
|
|
5
|
+
| 'none'
|
|
6
|
+
| 'ready'
|
|
7
|
+
| 'already-applied'
|
|
8
|
+
| 'needs-review'
|
|
9
|
+
| 'stale'
|
|
10
|
+
| 'conflict'
|
|
11
|
+
| 'blocked'
|
|
12
|
+
| string;
|
|
13
|
+
|
|
14
|
+
export interface SemanticEditBundleAdmissionSummary {
|
|
15
|
+
readonly scripts: number;
|
|
16
|
+
readonly projections: number;
|
|
17
|
+
readonly replays: number;
|
|
18
|
+
readonly files: number;
|
|
19
|
+
readonly portableScripts: number;
|
|
20
|
+
readonly portableProjections: number;
|
|
21
|
+
readonly acceptedClean: number;
|
|
22
|
+
readonly alreadyApplied: number;
|
|
23
|
+
readonly conflicts: number;
|
|
24
|
+
readonly stale: number;
|
|
25
|
+
readonly blocked: number;
|
|
26
|
+
readonly needsReview: number;
|
|
27
|
+
readonly projected: number;
|
|
28
|
+
readonly projectionBlocked: number;
|
|
29
|
+
readonly scriptStatuses: readonly string[];
|
|
30
|
+
readonly projectionStatuses: readonly string[];
|
|
31
|
+
readonly replayStatuses: readonly string[];
|
|
32
|
+
readonly replayActions: readonly string[];
|
|
33
|
+
readonly sourcePaths: readonly string[];
|
|
34
|
+
readonly scriptIds: readonly string[];
|
|
35
|
+
readonly projectionIds: readonly string[];
|
|
36
|
+
readonly replayIds: readonly string[];
|
|
37
|
+
readonly evidenceIds: readonly string[];
|
|
38
|
+
readonly passedTestEvidence: number;
|
|
39
|
+
readonly failedTestEvidence: number;
|
|
40
|
+
readonly conflictEvidence: number;
|
|
41
|
+
readonly staleEvidence: number;
|
|
42
|
+
readonly reasonCodes: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SemanticEditBundleAdmission {
|
|
46
|
+
readonly status: SemanticEditBundleAdmissionStatus;
|
|
47
|
+
readonly action: 'none' | 'admit' | 'skip' | 'review' | 'rerun-semantic-import' | 'block' | string;
|
|
48
|
+
readonly readiness: SemanticMergeReadiness | string;
|
|
49
|
+
readonly reviewRequired: boolean;
|
|
50
|
+
readonly autoApplyCandidate: boolean;
|
|
51
|
+
readonly autoMergeClaim: false;
|
|
52
|
+
readonly semanticEquivalenceClaim: false;
|
|
53
|
+
readonly reasonCodes: readonly string[];
|
|
54
|
+
readonly sourcePaths: readonly string[];
|
|
55
|
+
readonly scriptIds: readonly string[];
|
|
56
|
+
readonly projectionIds: readonly string[];
|
|
57
|
+
readonly replayIds: readonly string[];
|
|
58
|
+
readonly summary: SemanticEditBundleAdmissionSummary;
|
|
59
|
+
readonly metadata?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface CreateSemanticEditBundleAdmissionInput {
|
|
63
|
+
readonly status?: SemanticEditBundleAdmissionStatus;
|
|
64
|
+
readonly action?: string;
|
|
65
|
+
readonly readiness?: SemanticMergeReadiness | string;
|
|
66
|
+
readonly reviewRequired?: boolean;
|
|
67
|
+
readonly autoApplyCandidate?: boolean;
|
|
68
|
+
readonly reasonCodes?: readonly string[] | string;
|
|
69
|
+
readonly semanticEditScript?: SemanticEditScript;
|
|
70
|
+
readonly semanticEditScripts?: readonly SemanticEditScript[] | SemanticEditScript;
|
|
71
|
+
readonly scripts?: readonly SemanticEditScript[] | SemanticEditScript;
|
|
72
|
+
readonly semanticEditProjection?: SemanticEditProjection;
|
|
73
|
+
readonly semanticEditProjections?: readonly SemanticEditProjection[] | SemanticEditProjection;
|
|
74
|
+
readonly projections?: readonly SemanticEditProjection[] | SemanticEditProjection;
|
|
75
|
+
readonly semanticEditReplay?: SemanticEditReplay;
|
|
76
|
+
readonly semanticEditReplays?: readonly SemanticEditReplay[] | SemanticEditReplay;
|
|
77
|
+
readonly replays?: readonly SemanticEditReplay[] | SemanticEditReplay;
|
|
78
|
+
readonly evidence?: readonly EvidenceRecord[] | EvidenceRecord;
|
|
79
|
+
readonly testEvidence?: readonly EvidenceRecord[] | EvidenceRecord;
|
|
80
|
+
readonly testResults?: readonly EvidenceRecord[] | EvidenceRecord;
|
|
81
|
+
readonly gateEvidence?: readonly EvidenceRecord[] | EvidenceRecord;
|
|
82
|
+
readonly proofEvidence?: readonly EvidenceRecord[] | EvidenceRecord;
|
|
83
|
+
readonly metadata?: Record<string, unknown>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export declare const SemanticEditBundleAdmissionStatuses: readonly SemanticEditBundleAdmissionStatus[];
|
|
87
|
+
export declare function createSemanticEditBundleAdmission(
|
|
88
|
+
input?: CreateSemanticEditBundleAdmissionInput,
|
|
89
|
+
options?: Partial<CreateSemanticEditBundleAdmissionInput>
|
|
90
|
+
): SemanticEditBundleAdmission;
|
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
EvidenceRecord,
|
|
3
|
-
FrontierSourceLanguage,
|
|
4
|
-
SemanticMergeReadiness,
|
|
5
|
-
SourceSpan
|
|
6
|
-
} from '@shapeshift-labs/frontier-lang-kernel';
|
|
1
|
+
import type { EvidenceRecord, FrontierSourceLanguage, SemanticMergeReadiness, SourceSpan } from '@shapeshift-labs/frontier-lang-kernel';
|
|
7
2
|
import type { ImportNativeSourceOptions, NativeSourceImportResult } from './import-adapter-core.js';
|
|
8
3
|
|
|
9
|
-
export type SemanticEditScriptOperationStatus =
|
|
10
|
-
|
|
11
|
-
| 'portable'
|
|
12
|
-
| 'already-applied'
|
|
13
|
-
| 'covered'
|
|
14
|
-
| 'needs-port'
|
|
15
|
-
| 'conflict'
|
|
16
|
-
| 'stale'
|
|
17
|
-
| 'blocked';
|
|
18
|
-
|
|
19
|
-
export type SemanticEditScriptAdmissionStatus =
|
|
20
|
-
| 'auto-merge-candidate'
|
|
21
|
-
| 'needs-port'
|
|
22
|
-
| 'conflict'
|
|
23
|
-
| 'stale'
|
|
24
|
-
| 'blocked'
|
|
25
|
-
| 'evidence-only';
|
|
4
|
+
export type SemanticEditScriptOperationStatus = 'candidate' | 'portable' | 'already-applied' | 'covered' | 'needs-port' | 'conflict' | 'stale' | 'blocked';
|
|
5
|
+
export type SemanticEditScriptAdmissionStatus = 'auto-merge-candidate' | 'needs-port' | 'conflict' | 'stale' | 'blocked' | 'evidence-only';
|
|
26
6
|
|
|
27
7
|
export interface SemanticEditScriptOperation {
|
|
28
8
|
readonly id: string;
|
|
@@ -130,7 +110,7 @@ export interface SemanticEditProjectionEdit {
|
|
|
130
110
|
readonly operationId?: string;
|
|
131
111
|
readonly status: 'applied' | 'already-applied';
|
|
132
112
|
readonly kind?: string;
|
|
133
|
-
readonly editKind?: 'replace' | 'insert' | string;
|
|
113
|
+
readonly editKind?: 'replace' | 'insert' | 'delete' | string;
|
|
134
114
|
readonly changeKind?: string;
|
|
135
115
|
readonly anchorKey?: string;
|
|
136
116
|
readonly conflictKey?: string;
|
|
@@ -192,14 +172,7 @@ export interface SemanticEditProjection {
|
|
|
192
172
|
readonly metadata?: Record<string, unknown>;
|
|
193
173
|
}
|
|
194
174
|
|
|
195
|
-
export type SemanticEditReplayStatus =
|
|
196
|
-
| 'accepted-clean'
|
|
197
|
-
| 'already-applied'
|
|
198
|
-
| 'conflict'
|
|
199
|
-
| 'stale'
|
|
200
|
-
| 'blocked'
|
|
201
|
-
| 'needs-port'
|
|
202
|
-
| 'evidence-only';
|
|
175
|
+
export type SemanticEditReplayStatus = 'accepted-clean' | 'already-applied' | 'conflict' | 'stale' | 'blocked' | 'needs-port' | 'evidence-only';
|
|
203
176
|
|
|
204
177
|
export interface SemanticEditReplayEdit {
|
|
205
178
|
readonly operationId?: string;
|
|
@@ -207,7 +180,7 @@ export interface SemanticEditReplayEdit {
|
|
|
207
180
|
readonly semanticIdentityHash?: string;
|
|
208
181
|
readonly sourceIdentityHash?: string;
|
|
209
182
|
readonly editContentHash?: string;
|
|
210
|
-
readonly editKind?: 'replace' | 'insert' | string;
|
|
183
|
+
readonly editKind?: 'replace' | 'insert' | 'delete' | string;
|
|
211
184
|
readonly sourcePath?: string;
|
|
212
185
|
readonly symbolName?: string;
|
|
213
186
|
readonly symbolKind?: string;
|
|
@@ -269,9 +242,12 @@ export interface ProjectSemanticEditScriptToSourceOptions {
|
|
|
269
242
|
|
|
270
243
|
export interface ReplaySemanticEditProjectionOptions {
|
|
271
244
|
readonly id?: string;
|
|
272
|
-
readonly projection
|
|
273
|
-
readonly
|
|
245
|
+
readonly projection?: SemanticEditProjection;
|
|
246
|
+
readonly semanticEditProjection?: SemanticEditProjection;
|
|
247
|
+
readonly currentSourceText?: string;
|
|
248
|
+
readonly headSourceText?: string;
|
|
274
249
|
readonly currentSourcePath?: string;
|
|
250
|
+
readonly headSourcePath?: string;
|
|
275
251
|
readonly currentSourceHash?: string;
|
|
276
252
|
readonly language?: FrontierSourceLanguage | string;
|
|
277
253
|
readonly parser?: string;
|
|
@@ -294,17 +270,38 @@ export interface CreateSemanticEditScriptOptions {
|
|
|
294
270
|
readonly workerSourceText?: string;
|
|
295
271
|
readonly afterSourceText?: string;
|
|
296
272
|
readonly headSourceText?: string;
|
|
273
|
+
readonly baseSourcePath?: string;
|
|
274
|
+
readonly beforeSourcePath?: string;
|
|
275
|
+
readonly workerSourcePath?: string;
|
|
276
|
+
readonly afterSourcePath?: string;
|
|
297
277
|
readonly headSourcePath?: string;
|
|
298
278
|
readonly currentSourceText?: string;
|
|
279
|
+
readonly currentSourcePath?: string;
|
|
299
280
|
readonly baseSourceHash?: string;
|
|
281
|
+
readonly beforeSourceHash?: string;
|
|
300
282
|
readonly workerSourceHash?: string;
|
|
283
|
+
readonly afterSourceHash?: string;
|
|
301
284
|
readonly headSourceHash?: string;
|
|
302
|
-
readonly
|
|
285
|
+
readonly currentSourceHash?: string;
|
|
286
|
+
readonly baseMetadata?: Record<string, unknown>;
|
|
287
|
+
readonly beforeMetadata?: Record<string, unknown>;
|
|
288
|
+
readonly workerMetadata?: Record<string, unknown>;
|
|
289
|
+
readonly afterMetadata?: Record<string, unknown>;
|
|
290
|
+
readonly headMetadata?: Record<string, unknown>;
|
|
291
|
+
readonly currentMetadata?: Record<string, unknown>;
|
|
292
|
+
readonly workerChangeSetId?: string;
|
|
293
|
+
readonly headChangeSetId?: string;
|
|
294
|
+
readonly lineageInferenceId?: string;
|
|
295
|
+
readonly generatedAt?: number | string;
|
|
303
296
|
readonly evidenceId?: string;
|
|
304
297
|
readonly metadata?: Record<string, unknown>;
|
|
305
298
|
}
|
|
306
299
|
|
|
300
|
+
export interface CreateSemanticEditScriptRuntimeOptions {
|
|
301
|
+
readonly metadata?: Record<string, unknown>;
|
|
302
|
+
}
|
|
303
|
+
|
|
307
304
|
export declare const SemanticEditScriptAdmissionStatuses: readonly SemanticEditScriptAdmissionStatus[];
|
|
308
|
-
export declare function createSemanticEditScript(input?: CreateSemanticEditScriptOptions): SemanticEditScript;
|
|
305
|
+
export declare function createSemanticEditScript(input?: CreateSemanticEditScriptOptions, options?: CreateSemanticEditScriptRuntimeOptions): SemanticEditScript;
|
|
309
306
|
export declare function projectSemanticEditScriptToSource(input: ProjectSemanticEditScriptToSourceOptions): SemanticEditProjection;
|
|
310
307
|
export declare function replaySemanticEditProjection(input: ReplaySemanticEditProjectionOptions): SemanticEditReplay;
|
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
import type { FrontierSourceLanguage, SourceSpan } from '@shapeshift-labs/frontier-lang-kernel';
|
|
2
|
-
import type { EvidenceRecord, SemanticMergeReadiness } from '@shapeshift-labs/frontier-lang-kernel';
|
|
1
|
+
import type { EvidenceRecord, FrontierSourceLanguage, SemanticMergeReadiness, SourceSpan } from '@shapeshift-labs/frontier-lang-kernel';
|
|
3
2
|
import type { ImportNativeSourceOptions, NativeSourceImportResult } from './import-adapter-core.js';
|
|
4
3
|
|
|
5
4
|
export type SemanticLineageEventKind = 'unchanged' | 'moved' | 'renamed' | 'split' | 'merged' | 'deleted' | 'recreated' | 'unknown' | string;
|
|
6
5
|
export type SemanticLineageResolutionStatus = 'unchanged' | 'resolved' | 'ambiguous' | 'deleted' | 'recreated' | 'cycle' | 'max-depth' | 'not-found' | string;
|
|
7
6
|
|
|
8
7
|
export interface SemanticAnchor {
|
|
9
|
-
readonly id?: string;
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly language?: FrontierSourceLanguage | string;
|
|
13
|
-
readonly sourcePath?: string;
|
|
14
|
-
readonly sourceHash?: string;
|
|
15
|
-
readonly symbolId?: string;
|
|
16
|
-
readonly symbolName?: string;
|
|
8
|
+
readonly id?: string; readonly key?: string; readonly kind?: string;
|
|
9
|
+
readonly language?: FrontierSourceLanguage | string; readonly sourcePath?: string; readonly sourceHash?: string;
|
|
10
|
+
readonly symbolId?: string; readonly symbolName?: string;
|
|
17
11
|
readonly semanticPath?: readonly string[];
|
|
18
|
-
readonly signatureHash?: string;
|
|
19
|
-
readonly bodyHash?: string;
|
|
12
|
+
readonly signatureHash?: string; readonly bodyHash?: string;
|
|
20
13
|
readonly sourceSpan?: SourceSpan;
|
|
14
|
+
readonly lineageEventIds?: readonly string[]; readonly terminalLineageEventIds?: readonly string[];
|
|
15
|
+
readonly lineageSourcePaths?: readonly string[]; readonly evidenceIds?: readonly string[];
|
|
16
|
+
readonly proofIds?: readonly string[]; readonly crdtOperationIds?: readonly string[]; readonly crdtHeads?: readonly string[];
|
|
17
|
+
readonly lineageEventKinds?: readonly SemanticLineageEventKind[]; readonly lineageReasonCodes?: readonly string[];
|
|
21
18
|
readonly metadata?: Record<string, unknown>;
|
|
22
19
|
}
|
|
23
20
|
|
|
21
|
+
export interface CreateSemanticAnchorInput extends SemanticAnchor {
|
|
22
|
+
readonly ownershipKey?: string;
|
|
23
|
+
readonly conflictKey?: string;
|
|
24
|
+
readonly semanticKey?: string;
|
|
25
|
+
readonly anchorKind?: string;
|
|
26
|
+
readonly regionKind?: string;
|
|
27
|
+
readonly symbolKind?: string;
|
|
28
|
+
readonly pathSegments?: readonly string[];
|
|
29
|
+
readonly name?: string;
|
|
30
|
+
readonly hash?: string;
|
|
31
|
+
readonly span?: SourceSpan;
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
export interface SemanticLineageCrdtClock {
|
|
25
35
|
readonly operationId?: string;
|
|
26
36
|
readonly actor?: string;
|
|
@@ -31,6 +41,19 @@ export interface SemanticLineageCrdtClock {
|
|
|
31
41
|
readonly versionFrame?: Record<string, unknown>;
|
|
32
42
|
}
|
|
33
43
|
|
|
44
|
+
export interface SemanticLineageCrdtClockInput {
|
|
45
|
+
readonly operationId?: string;
|
|
46
|
+
readonly id?: string;
|
|
47
|
+
readonly actor?: string;
|
|
48
|
+
readonly actorId?: string;
|
|
49
|
+
readonly seq?: number;
|
|
50
|
+
readonly deps?: readonly string[] | string;
|
|
51
|
+
readonly heads?: readonly string[] | string;
|
|
52
|
+
readonly stateVector?: Record<string, number>;
|
|
53
|
+
readonly versionFrame?: Record<string, unknown>;
|
|
54
|
+
readonly frame?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
|
|
34
57
|
export interface SemanticLineageEvidence {
|
|
35
58
|
readonly pathMatch?: boolean;
|
|
36
59
|
readonly signatureHashMatch?: boolean;
|
|
@@ -41,6 +64,10 @@ export interface SemanticLineageEvidence {
|
|
|
41
64
|
readonly command?: string;
|
|
42
65
|
}
|
|
43
66
|
|
|
67
|
+
export interface SemanticLineageEvidenceInput extends SemanticLineageEvidence {
|
|
68
|
+
readonly id?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
44
71
|
export interface SemanticLineageActor {
|
|
45
72
|
readonly id?: string;
|
|
46
73
|
readonly role?: string;
|
|
@@ -50,6 +77,10 @@ export interface SemanticLineageActor {
|
|
|
50
77
|
readonly metadata?: Record<string, unknown>;
|
|
51
78
|
}
|
|
52
79
|
|
|
80
|
+
export interface SemanticLineageActorInput extends SemanticLineageActor {
|
|
81
|
+
readonly actorId?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
53
84
|
export interface SemanticLineageEvent {
|
|
54
85
|
readonly kind: 'frontier.lang.semanticLineageEvent';
|
|
55
86
|
readonly version: 1;
|
|
@@ -71,32 +102,27 @@ export interface SemanticLineageEvent {
|
|
|
71
102
|
}
|
|
72
103
|
|
|
73
104
|
export interface CreateSemanticLineageEventInput {
|
|
74
|
-
readonly id?: string;
|
|
75
|
-
readonly
|
|
76
|
-
readonly
|
|
77
|
-
readonly
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
83
|
-
readonly
|
|
84
|
-
readonly
|
|
85
|
-
readonly
|
|
86
|
-
readonly
|
|
87
|
-
readonly actor?: SemanticLineageActor | string;
|
|
88
|
-
readonly actorId?: string;
|
|
89
|
-
readonly actorRole?: string;
|
|
90
|
-
readonly crdt?: SemanticLineageCrdtClock;
|
|
91
|
-
readonly clock?: SemanticLineageCrdtClock;
|
|
92
|
-
readonly operation?: SemanticLineageCrdtClock;
|
|
105
|
+
readonly id?: string; readonly hash?: string; readonly createdAt?: number | string;
|
|
106
|
+
readonly eventKind?: SemanticLineageEventKind; readonly event?: SemanticLineageEventKind; readonly kind?: SemanticLineageEventKind;
|
|
107
|
+
readonly from?: CreateSemanticAnchorInput | string;
|
|
108
|
+
readonly fromAnchor?: CreateSemanticAnchorInput | string;
|
|
109
|
+
readonly before?: CreateSemanticAnchorInput | string;
|
|
110
|
+
readonly to?: readonly (CreateSemanticAnchorInput | string)[] | CreateSemanticAnchorInput | string;
|
|
111
|
+
readonly toAnchors?: readonly (CreateSemanticAnchorInput | string)[] | CreateSemanticAnchorInput | string;
|
|
112
|
+
readonly after?: readonly (CreateSemanticAnchorInput | string)[] | CreateSemanticAnchorInput | string;
|
|
113
|
+
readonly confidence?: number; readonly actor?: SemanticLineageActorInput | string;
|
|
114
|
+
readonly actorId?: string; readonly actorRole?: string;
|
|
115
|
+
readonly crdt?: SemanticLineageCrdtClockInput;
|
|
116
|
+
readonly clock?: SemanticLineageCrdtClockInput;
|
|
117
|
+
readonly operation?: SemanticLineageCrdtClockInput;
|
|
93
118
|
readonly operationId?: string;
|
|
94
119
|
readonly seq?: number;
|
|
95
120
|
readonly deps?: readonly string[] | string;
|
|
96
121
|
readonly heads?: readonly string[] | string;
|
|
97
122
|
readonly stateVector?: Record<string, number>;
|
|
98
123
|
readonly versionFrame?: Record<string, unknown>;
|
|
99
|
-
readonly
|
|
124
|
+
readonly frame?: Record<string, unknown>;
|
|
125
|
+
readonly evidence?: SemanticLineageEvidenceInput | readonly SemanticLineageEvidenceInput[];
|
|
100
126
|
readonly pathMatch?: boolean;
|
|
101
127
|
readonly signatureHashMatch?: boolean;
|
|
102
128
|
readonly bodyHashMatch?: boolean;
|
|
@@ -161,6 +187,7 @@ export interface SemanticLineageResolution {
|
|
|
161
187
|
readonly currentAnchors: readonly SemanticAnchor[];
|
|
162
188
|
readonly traversedEventIds: readonly string[];
|
|
163
189
|
readonly terminalEventIds: readonly string[];
|
|
190
|
+
readonly sourcePaths: readonly string[];
|
|
164
191
|
readonly status: SemanticLineageResolutionStatus;
|
|
165
192
|
readonly confidence?: number;
|
|
166
193
|
readonly conflictKeys: readonly string[];
|
|
@@ -236,6 +263,8 @@ export interface SemanticLineageInferenceResult {
|
|
|
236
263
|
readonly inferredEvents: number;
|
|
237
264
|
readonly moved: number;
|
|
238
265
|
readonly renamed: number;
|
|
266
|
+
readonly split: number;
|
|
267
|
+
readonly recreated: number;
|
|
239
268
|
readonly deleted: number;
|
|
240
269
|
readonly ambiguous: number;
|
|
241
270
|
readonly unmatchedAdded: number;
|
|
@@ -280,8 +309,8 @@ export interface InferSemanticLineageEventsOptions {
|
|
|
280
309
|
|
|
281
310
|
export declare const SemanticLineageEventKinds: readonly SemanticLineageEventKind[];
|
|
282
311
|
export declare const SemanticLineageResolutionStatuses: readonly SemanticLineageResolutionStatus[];
|
|
283
|
-
export declare function createSemanticAnchor(input?:
|
|
284
|
-
export declare function createSemanticLineageEvent(input?: CreateSemanticLineageEventInput, options?: { readonly id?: string; readonly createdAt?: number | string; readonly actor?:
|
|
312
|
+
export declare function createSemanticAnchor(input?: CreateSemanticAnchorInput | string, defaults?: Partial<SemanticAnchor>): SemanticAnchor | undefined;
|
|
313
|
+
export declare function createSemanticLineageEvent(input?: CreateSemanticLineageEventInput, options?: { readonly id?: string; readonly createdAt?: number | string; readonly actor?: SemanticLineageActorInput | string; readonly actorId?: string; readonly actorRole?: string }): SemanticLineageEvent;
|
|
285
314
|
export declare function createSemanticLineageMap(events?: readonly (SemanticLineageEvent | CreateSemanticLineageEventInput)[], options?: { readonly id?: string; readonly generatedAt?: number | string }): SemanticLineageMap;
|
|
286
315
|
export declare function inferSemanticLineageEvents(input?: InferSemanticLineageEventsOptions, options?: { readonly metadata?: Record<string, unknown>; readonly deletedConfidence?: number }): SemanticLineageInferenceResult;
|
|
287
316
|
export declare function querySemanticLineageEvents(events: SemanticLineageEvent | readonly SemanticLineageEvent[], query?: SemanticLineageQuery): readonly SemanticLineageEvent[];
|
|
@@ -18,6 +18,9 @@ export interface SemanticPatchBundleRecordIndex {
|
|
|
18
18
|
readonly semanticEditReplayIds: readonly string[];
|
|
19
19
|
readonly semanticEditReplayStatuses: readonly string[];
|
|
20
20
|
readonly semanticEditReplayActions: readonly string[];
|
|
21
|
+
readonly semanticEditAdmissionStatuses: readonly string[];
|
|
22
|
+
readonly semanticEditAdmissionActions: readonly string[];
|
|
23
|
+
readonly semanticEditAdmissionReadinesses: readonly string[];
|
|
21
24
|
readonly semanticEditReplayCurrentHashes: readonly string[];
|
|
22
25
|
readonly semanticEditReplayOutputHashes: readonly string[];
|
|
23
26
|
readonly semanticEditKeys: readonly string[];
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
SourceSpan
|
|
8
8
|
} from '@shapeshift-labs/frontier-lang-kernel';
|
|
9
9
|
import type { NativeSourceChangeKind, NativeSourceChangeSet } from './native-diff.js';
|
|
10
|
+
import type { SemanticEditBundleAdmission } from './semantic-edit-bundle.js';
|
|
10
11
|
import type { SemanticEditProjection, SemanticEditReplay, SemanticEditScript } from './semantic-edit-script.js';
|
|
11
12
|
import type { SemanticPatchBundleRecordIndex } from './semantic-patch-bundle-index.js';
|
|
12
13
|
import type { SemanticTransformIdentityRecord } from './semantic-transform-identity.js';
|
|
@@ -88,6 +89,8 @@ export interface SemanticPatchBundleAdmission {
|
|
|
88
89
|
readonly autoMergeClaim: false;
|
|
89
90
|
readonly autoApplyCandidate?: boolean;
|
|
90
91
|
readonly transformAdmission?: SemanticPatchBundleTransformAdmission;
|
|
92
|
+
readonly semanticEditAdmission?: SemanticEditBundleAdmission;
|
|
93
|
+
readonly evidenceAdmission?: SemanticPatchBundleEvidenceAdmission;
|
|
91
94
|
readonly reasonCodes?: readonly string[];
|
|
92
95
|
readonly conflictKeys?: readonly string[];
|
|
93
96
|
readonly admittedAt?: number | string;
|
|
@@ -96,6 +99,18 @@ export interface SemanticPatchBundleAdmission {
|
|
|
96
99
|
readonly metadata?: Record<string, unknown>;
|
|
97
100
|
}
|
|
98
101
|
|
|
102
|
+
export interface SemanticPatchBundleEvidenceAdmission {
|
|
103
|
+
readonly status: 'none' | 'ready' | 'needs-review' | 'stale' | 'blocked' | string;
|
|
104
|
+
readonly action: 'none' | 'admit' | 'review' | 'rerun-semantic-import' | 'block' | string;
|
|
105
|
+
readonly readiness: SemanticMergeReadiness | string;
|
|
106
|
+
readonly reasonCodes?: readonly string[];
|
|
107
|
+
readonly evidenceIds?: readonly string[];
|
|
108
|
+
readonly passed?: number;
|
|
109
|
+
readonly failed?: number;
|
|
110
|
+
readonly conflict?: number;
|
|
111
|
+
readonly stale?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
99
114
|
export interface SemanticPatchBundleTransformAdmission {
|
|
100
115
|
readonly status: 'none' | 'ready' | 'needs-review' | 'blocked' | string;
|
|
101
116
|
readonly action: 'none' | 'admit' | 'review' | 'block' | string;
|
|
@@ -150,6 +165,7 @@ export interface SemanticPatchBundleRecord {
|
|
|
150
165
|
readonly semanticEditReplays: number;
|
|
151
166
|
readonly semanticEditProjectionEdits: number;
|
|
152
167
|
readonly semanticEditReplayEdits: number;
|
|
168
|
+
readonly semanticEditBundleStatus?: string;
|
|
153
169
|
readonly semanticTransformIdentities: number;
|
|
154
170
|
readonly reviewRequired: boolean;
|
|
155
171
|
readonly autoMergeClaim: false;
|
|
@@ -185,6 +201,7 @@ export interface CreateSemanticPatchBundleRecordOptions {
|
|
|
185
201
|
readonly semanticEditProjections?: readonly SemanticEditProjection[] | SemanticEditProjection;
|
|
186
202
|
readonly semanticEditReplay?: SemanticEditReplay;
|
|
187
203
|
readonly semanticEditReplays?: readonly SemanticEditReplay[] | SemanticEditReplay;
|
|
204
|
+
readonly semanticEditAdmission?: Partial<SemanticEditBundleAdmission>;
|
|
188
205
|
readonly semanticTransformIdentity?: SemanticTransformIdentityRecord | Record<string, unknown>;
|
|
189
206
|
readonly semanticTransformIdentities?: readonly (SemanticTransformIdentityRecord | Record<string, unknown>)[];
|
|
190
207
|
readonly targetPortability?: BidirectionalTargetPortabilityRecord | Record<string, unknown>;
|
|
@@ -242,6 +259,12 @@ export interface SemanticPatchBundleRecordQuery {
|
|
|
242
259
|
readonly semanticEditReplayStatuses?: readonly string[];
|
|
243
260
|
readonly semanticEditReplayAction?: string | readonly string[];
|
|
244
261
|
readonly semanticEditReplayActions?: readonly string[];
|
|
262
|
+
readonly semanticEditAdmissionStatus?: string | readonly string[];
|
|
263
|
+
readonly semanticEditAdmissionStatuses?: readonly string[];
|
|
264
|
+
readonly semanticEditAdmissionAction?: string | readonly string[];
|
|
265
|
+
readonly semanticEditAdmissionActions?: readonly string[];
|
|
266
|
+
readonly semanticEditAdmissionReadiness?: string | readonly string[];
|
|
267
|
+
readonly semanticEditAdmissionReadinesses?: readonly string[];
|
|
245
268
|
readonly semanticEditReplayCurrentHash?: string | readonly string[];
|
|
246
269
|
readonly semanticEditReplayCurrentHashes?: readonly string[];
|
|
247
270
|
readonly semanticEditReplayOutputHash?: string | readonly string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './declarations/semantic-merge-conflicts.js';
|
|
|
19
19
|
export * from './declarations/semantic-edit-script.js';
|
|
20
20
|
export * from './declarations/semantic-lineage.js';
|
|
21
21
|
export * from './declarations/semantic-history.js';
|
|
22
|
+
export * from './declarations/semantic-edit-bundle.js';
|
|
22
23
|
export * from './declarations/semantic-patch-bundle-index.js';
|
|
23
24
|
export * from './declarations/semantic-patch-bundle.js';
|
|
24
25
|
export * from './declarations/semantic-patch-bundle-overlaps.js';
|
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ export { projectNativeImportToSource } from './internal/index-impl/projectNative
|
|
|
67
67
|
export { queryNativeParserFeatureMatrix } from './internal/index-impl/queryNativeParserFeatureMatrix.js';
|
|
68
68
|
export { queryProjectionReadinessMatrix } from './internal/index-impl/queryProjectionReadinessMatrix.js';
|
|
69
69
|
export { createSemanticPatchBundleRecord, querySemanticPatchBundleRecords, SemanticPatchBundleAdmissionStatuses } from './internal/index-impl/semanticPatchBundleRecords.js';
|
|
70
|
+
export { createSemanticEditBundleAdmission, SemanticEditBundleAdmissionStatuses } from './internal/index-impl/semanticEditBundleAdmission.js';
|
|
70
71
|
export { compareSemanticPatchBundleRecords, querySemanticPatchBundleOverlaps, SemanticPatchBundleOverlapKinds, SemanticPatchBundleOverlapStatuses } from './internal/index-impl/semanticPatchBundleOverlaps.js';
|
|
71
72
|
export { createSemanticTransformIdentityRecord, deriveSemanticTransformIdentityRecords, semanticTransformIdentityFields } from './internal/index-impl/semanticTransformIdentityRecords.js';
|
|
72
73
|
export { createSemanticMergeCandidateAdmissionRecord, decorateSemanticMergeCandidateForAdmission, querySemanticMergeCandidateAdmissionOverlaps, SemanticMergeCandidateProjectionRisks, semanticMergeCandidateReadinessSortKey, sortSemanticMergeCandidateAdmissionRecords } from './internal/index-impl/semanticMergeCandidateRecords.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{idFragment}from'../../native-import-utils.js';
|
|
1
|
+
import{idFragment,caseSensitiveIdFragment}from'../../native-import-utils.js';
|
|
2
2
|
import{nativeNodeId}from'./nativeNodeId.js';
|
|
3
3
|
export function declarationRecord(input, nativeNodeId, name, symbolKind, role = 'definition') {
|
|
4
4
|
return {
|
|
5
5
|
name: String(name),
|
|
6
6
|
symbolKind,
|
|
7
7
|
role,
|
|
8
|
-
symbolId: `symbol:${input.language}:${role === 'import' ? 'import:' : ''}${
|
|
8
|
+
symbolId: `symbol:${input.language}:${role === 'import' ? 'import:' : ''}${caseSensitiveIdFragment(name)}`,
|
|
9
9
|
nativeNodeId
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -74,6 +74,8 @@ export function inferSemanticLineageEvents(input = {}, options = {}) {
|
|
|
74
74
|
inferredEvents: events.length,
|
|
75
75
|
moved: events.filter((event) => event.eventKind === 'moved').length,
|
|
76
76
|
renamed: events.filter((event) => event.eventKind === 'renamed').length,
|
|
77
|
+
split: events.filter((event) => event.eventKind === 'split').length,
|
|
78
|
+
recreated: events.filter((event) => event.eventKind === 'recreated').length,
|
|
77
79
|
deleted: deleted.length,
|
|
78
80
|
ambiguous: candidates.ambiguous.length,
|
|
79
81
|
unmatchedAdded: candidates.unmatchedAfter.length,
|
|
@@ -169,6 +171,10 @@ function lineageInferenceEvidence(input) {
|
|
|
169
171
|
language: input.language,
|
|
170
172
|
unchangedAnchors: input.exact.matched.length,
|
|
171
173
|
inferredEvents: input.events.length,
|
|
174
|
+
moved: input.events.filter((event) => event.eventKind === 'moved').length,
|
|
175
|
+
renamed: input.events.filter((event) => event.eventKind === 'renamed').length,
|
|
176
|
+
split: input.events.filter((event) => event.eventKind === 'split').length,
|
|
177
|
+
recreated: input.events.filter((event) => event.eventKind === 'recreated').length,
|
|
172
178
|
deleted: input.deleted.length,
|
|
173
179
|
ambiguous: input.candidates.ambiguous.length,
|
|
174
180
|
unmatchedAdded: input.candidates.unmatchedAfter.length,
|
|
@@ -188,6 +194,8 @@ function inferenceReadiness(input, options) {
|
|
|
188
194
|
function inferenceReasons(input) {
|
|
189
195
|
return uniqueStrings([
|
|
190
196
|
input.events.length ? 'semantic-lineage-inferred' : undefined,
|
|
197
|
+
input.events.some((event) => event.eventKind === 'split') ? 'split-anchor-lineage-inferred' : undefined,
|
|
198
|
+
input.events.some((event) => event.eventKind === 'recreated') ? 'recreated-anchor-lineage-inferred' : undefined,
|
|
191
199
|
input.deleted.length ? 'deleted-anchor-lineage-inferred' : undefined,
|
|
192
200
|
input.added.length ? 'unmatched-added-anchor-review' : undefined,
|
|
193
201
|
input.ambiguous.length ? 'ambiguous-lineage-candidates' : undefined,
|