@shapeshift-labs/frontier-lang-compiler 0.2.167 → 0.2.169

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.
@@ -75,7 +75,7 @@ function hasRuntimeBoundaryConflict(file) {
75
75
  return (file?.result?.conflicts ?? file?.conflicts ?? []).some((conflict) => HtmlRuntimeBoundaryReasonCodes.has(conflict?.details?.reasonCode));
76
76
  }
77
77
  function hasHtmlRuntimeBoundaryProof(file) {
78
- return [...(file?.result?.runtimeBoundaryProofs ?? []), ...(file?.result?.admission?.htmlRuntimeBoundaryProofs ?? file?.admission?.htmlRuntimeBoundaryProofs ?? [])].some((proof) => proof?.status === 'passed' && HtmlRuntimeBoundaryReasonCodes.has(proof.reasonCode));
78
+ return [...(file?.result?.runtimeBoundaryProofs ?? []), ...(file?.result?.htmlRuntimeProofs ?? []), ...(file?.result?.admission?.htmlRuntimeBoundaryProofs ?? file?.admission?.htmlRuntimeBoundaryProofs ?? []), ...(file?.result?.admission?.htmlBrowserRuntimeProofs ?? file?.admission?.htmlBrowserRuntimeProofs ?? [])].some((proof) => proof?.status === 'passed' && HtmlRuntimeBoundaryReasonCodes.has(proof.reasonCode));
79
79
  }
80
80
  function hasFrameworkBoundaryConflict(file) {
81
81
  return (file?.result?.conflicts ?? file?.conflicts ?? []).some((conflict) => HtmlFrameworkBoundaryReasonCodes.has(conflict?.details?.reasonCode));
@@ -14,9 +14,11 @@ function maybeMergeHtmlCssProjectFile(options) {
14
14
  if (!merge) return undefined;
15
15
  const resultId = `${projectId}_${safeId(file.sourcePath)}`;
16
16
  const mergeOptions = htmlCssMergeOptionsForProjectFile(input, file.sourcePath, language);
17
- const result = merge({ ...sourceInput, ...mergeOptions, ...context, id: resultId, baseSourceText: base, workerSourceText: worker, headSourceText: head });
17
+ const runtimeBoundaryProofs = language === 'html' ? htmlRuntimeBoundaryProofCandidates(input, file.sourcePath, mergeOptions) : [];
18
+ const runtimeBoundaryMergeOptions = runtimeBoundaryProofs.length ? { htmlRuntimeBoundaryProofs: runtimeBoundaryProofs, htmlSourceBoundRuntimeBoundaryProofs: runtimeBoundaryProofs } : {};
19
+ const result = merge({ ...sourceInput, ...mergeOptions, ...context, ...runtimeBoundaryMergeOptions, id: resultId, baseSourceText: base, workerSourceText: worker, headSourceText: head });
18
20
  const admittedResult = language === 'html' && result.status === 'merged'
19
- ? blockHtmlProofGapChanges({ result, id: resultId, sourcePath: file.sourcePath, base, worker, head, runtimeBoundaryProofs: htmlRuntimeBoundaryProofCandidates(input, file.sourcePath, mergeOptions) }) ?? result
21
+ ? blockHtmlProofGapChanges({ result, id: resultId, sourcePath: file.sourcePath, base, worker, head, runtimeBoundaryProofs }) ?? result
20
22
  : result;
21
23
  return admittedResult.status === 'merged' ? mergedHtmlCssFile(file, context, admittedResult, language) : blockedHtmlCssFile(file, context, admittedResult);
22
24
  }
@@ -259,12 +261,14 @@ function htmlProofGapConflict(id, sourcePath, reasonCode, details = {}, code = '
259
261
  function htmlProofGapSummary(reasonCode) {
260
262
  if (reasonCode === 'html-duplicate-explicit-identity') return 'Duplicate explicit HTML identity keys make structural target admission ambiguous.';
261
263
  if (reasonCode === 'event-handler-runtime-boundary') return 'HTML event handler attributes execute in the browser runtime and require source-bound host evidence.';
264
+ if (reasonCode === 'inline-style-runtime-boundary') return 'HTML inline style attributes affect browser cascade and rendering and require source-bound host evidence.';
262
265
  return 'HTML proof gap requires source-bound evidence before structural merge admission.';
263
266
  }
264
267
 
265
268
  function htmlProofGapNextProof(reasonCode) {
266
269
  if (reasonCode === 'html-duplicate-explicit-identity') return 'Rename duplicate explicit HTML identity keys or supply parser-backed identity evidence with unique explicitIdentityKeys on every side.';
267
270
  if (reasonCode === 'event-handler-runtime-boundary') return 'Attach htmlRuntimeBoundaryProofsByPath[sourcePath] with kind html-source-bound-runtime-boundary-proof, status passed, sourcePath, reasonCode, side, boundary, boundaryAttributes, and exact base/worker/head/output source text or hashes.';
271
+ if (reasonCode === 'inline-style-runtime-boundary') return 'Attach htmlRuntimeBoundaryProofsByPath[sourcePath] with kind html-source-bound-runtime-boundary-proof, status passed, sourcePath, reasonCode, side, boundary "html-inline-style-attribute", boundaryAttributes ["style"], and exact base/worker/head/output source text or hashes.';
268
272
  return 'Attach source-bound HTML parser, identity, and runtime-boundary evidence for the changed file before structural admission.';
269
273
  }
270
274
 
@@ -291,9 +295,23 @@ function mergedHtmlCssFile(file, context, result, language) {
291
295
  }
292
296
 
293
297
  function blockedHtmlCssFile(file, context, result) {
294
- return compactRecord({
295
- kind: 'frontier.lang.jsTsProjectSafeMergeFile', version: 1, sourcePath: file.sourcePath, language: context.language, status: 'blocked', operation: 'blocked-merge',
296
- result, conflicts: result.conflicts ?? [], admission: result.admission, summary: result.summary, conflictKeys: [`source#${file.sourcePath}`]
298
+ const conflicts = normalizeHtmlCssConflicts(result.conflicts ?? [], context.language);
299
+ const admission = blockedHtmlCssAdmission(result.admission, context.language);
300
+ const normalizedResult = compactRecord({ ...result, conflicts, admission });
301
+ return compactRecord({ kind: 'frontier.lang.jsTsProjectSafeMergeFile', version: 1, sourcePath: file.sourcePath, language: context.language, status: 'blocked', operation: 'blocked-merge', result: normalizedResult, conflicts, admission, summary: result.summary, conflictKeys: [`source#${file.sourcePath}`] });
302
+ }
303
+
304
+ function blockedHtmlCssAdmission(admission = {}, language) {
305
+ return compactRecord({ ...admission, browserRuntimeEquivalenceClaim: language === 'html' ? false : admission.browserRuntimeEquivalenceClaim, browserCascadeEquivalenceClaim: language === 'css' ? false : admission.browserCascadeEquivalenceClaim, browserRenderEquivalenceClaim: language === 'css' ? false : admission.browserRenderEquivalenceClaim });
306
+ }
307
+
308
+ function normalizeHtmlCssConflicts(conflicts, language) {
309
+ if (language !== 'html') return conflicts;
310
+ return conflicts.map((conflict) => {
311
+ const reasonCode = conflict.details?.reasonCode;
312
+ if (conflict.code !== 'html-proof-gap-blocked' || !reasonCode) return conflict;
313
+ const proofGap = { ...(conflict.details?.proofGap ?? {}), summary: conflict.details?.proofGap?.summary ?? htmlProofGapSummary(reasonCode), nextProof: conflict.details?.proofGap?.nextProof ?? htmlProofGapNextProof(reasonCode) };
314
+ return { ...conflict, details: { ...(conflict.details ?? {}), proofGap } };
297
315
  });
298
316
  }
299
317
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshift-labs/frontier-lang-compiler",
3
- "version": "0.2.167",
3
+ "version": "0.2.169",
4
4
  "description": "Compiler facade for Frontier Lang source documents and language projection adapters.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -64,7 +64,7 @@
64
64
  "@shapeshift-labs/frontier-lang-c": "0.2.9",
65
65
  "@shapeshift-labs/frontier-lang-checker": "0.3.8",
66
66
  "@shapeshift-labs/frontier-lang-css": "^0.1.11",
67
- "@shapeshift-labs/frontier-lang-html": "^0.1.6",
67
+ "@shapeshift-labs/frontier-lang-html": "^0.1.9",
68
68
  "@shapeshift-labs/frontier-lang-javascript": "0.2.9",
69
69
  "@shapeshift-labs/frontier-lang-kernel": "0.3.12",
70
70
  "@shapeshift-labs/frontier-lang-parser": "0.3.8",