@shapeshift-labs/frontier-lang-compiler 0.2.138 → 0.2.139

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 CHANGED
@@ -200,6 +200,10 @@ interface, type, class, or object member additions. Existing class/object method
200
200
  or property body edits inside the declared member region are preserved for
201
201
  semantic replay while added members are neutralized; object member additions are
202
202
  re-emitted with safe commas when both sides add final properties.
203
+ If staged whole-declaration replay cannot verify because head changed a sibling
204
+ member inside the same declaration, `safeMergeJsTsSource` retries the direct
205
+ semantic edit projection and admits the merge only when replay still verifies
206
+ cleanly.
203
207
 
204
208
  Project-level JS/TS safe merges compose the same file-level gates across a
205
209
  base/worker/head file set. They preserve head-only files, admit worker-only
@@ -14,9 +14,17 @@ import { idFragment, uniqueStrings } from './native-import-utils.js';
14
14
  function semanticEditFallbackResult(input, topLevelResult) {
15
15
  if (!shouldTrySemanticEditFallback(topLevelResult)) return topLevelResult;
16
16
  const stagedFallback = createStagedTopLevelSemanticFallback(input, topLevelResult);
17
- const artifacts = createSemanticEditFallbackArtifacts(input, topLevelResult, stagedFallback);
17
+ let selectedFallback = stagedFallback;
18
+ let artifacts = createSemanticEditFallbackArtifacts(input, topLevelResult, stagedFallback);
19
+ if (stagedFallback && artifacts.status !== 'verified') {
20
+ const directArtifacts = createSemanticEditFallbackArtifacts(input, topLevelResult, undefined);
21
+ if (directArtifacts.status === 'verified') {
22
+ artifacts = directArtifacts;
23
+ selectedFallback = undefined;
24
+ }
25
+ }
18
26
  if (artifacts.status !== 'verified') return semanticEditFallbackBlockedResult(input, topLevelResult, artifacts);
19
- const resultBase = stagedFallback?.stagedTopLevelResult ?? topLevelResult;
27
+ const resultBase = selectedFallback?.stagedTopLevelResult ?? topLevelResult;
20
28
  const mergedSourceText = artifacts.projection.sourceText;
21
29
  const gates = semanticEditGates(artifacts);
22
30
  return {
@@ -38,7 +46,7 @@ function semanticEditFallbackResult(input, topLevelResult) {
38
46
  },
39
47
  summary: {
40
48
  ...resultBase.summary,
41
- changedExistingDeclarations: semanticFallbackChangedExistingDeclarations(topLevelResult, resultBase, stagedFallback),
49
+ changedExistingDeclarations: semanticFallbackChangedExistingDeclarations(topLevelResult, resultBase, selectedFallback),
42
50
  conflicts: 0,
43
51
  gatesPassed: gates.filter((gate) => gate.status === 'passed').length,
44
52
  semanticEditOperations: artifacts.script.summary.operations,
@@ -49,11 +57,11 @@ function semanticEditFallbackResult(input, topLevelResult) {
49
57
  metadata: {
50
58
  ...resultBase.metadata,
51
59
  composed: {
52
- phase: stagedFallback ? 'staged-top-level-semantic-edit-fallback' : 'semantic-edit-fallback',
53
- phases: stagedFallback ? ['top-level-neutralization', 'top-level-ledger', 'semantic-edit'] : ['top-level-ledger', 'semantic-edit'],
60
+ phase: selectedFallback ? 'staged-top-level-semantic-edit-fallback' : 'semantic-edit-fallback',
61
+ phases: selectedFallback ? ['top-level-neutralization', 'top-level-ledger', 'semantic-edit'] : ['top-level-ledger', 'semantic-edit'],
54
62
  originalReasonCodes: topLevelResult.admission?.reasonCodes ?? [],
55
- stagedTopLevelSummary: stagedFallback?.stagedTopLevelResult?.summary,
56
- neutralization: stagedFallback?.neutralization?.summary
63
+ stagedTopLevelSummary: selectedFallback?.stagedTopLevelResult?.summary,
64
+ neutralization: selectedFallback?.neutralization?.summary
57
65
  }
58
66
  },
59
67
  semanticArtifacts: artifacts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshift-labs/frontier-lang-compiler",
3
- "version": "0.2.138",
3
+ "version": "0.2.139",
4
4
  "description": "Compiler facade for Frontier Lang source documents and language projection adapters.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",