@shapeshift-labs/frontier-lang-parser 0.3.29 → 0.3.31
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 +24 -4
- package/dist/application-surface.js +7 -2
- package/dist/index.js +5 -2
- package/dist/metadata.js +16 -24
- package/dist/runtime-capability-records.js +153 -0
- package/dist/runtime-capability.js +271 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -347,10 +347,10 @@ plugin WeatherWidget @id("plugin_weather_widget") {
|
|
|
347
347
|
The parser stores these blocks in `metadata.applicationSurfaces` and mirrors
|
|
348
348
|
them under `metadata.universalAst.applicationSurfaces`. They are composition
|
|
349
349
|
contracts, not compatibility proof: `runtimeEquivalenceClaim`,
|
|
350
|
-
`
|
|
351
|
-
`pluginCompatibilityClaim`, and
|
|
352
|
-
higher layer supplies source-bound
|
|
353
|
-
evidence.
|
|
350
|
+
`autoMergeClaim`, `semanticEquivalenceClaim`, `abiCompatibilityClaim`,
|
|
351
|
+
`projectionEquivalenceClaim`, `pluginCompatibilityClaim`, and
|
|
352
|
+
`sandboxSafetyClaim` remain false until a higher layer supplies source-bound
|
|
353
|
+
runtime, ABI, projection, sandbox, and admission evidence.
|
|
354
354
|
|
|
355
355
|
## Authored target projection syntax
|
|
356
356
|
|
|
@@ -475,6 +475,26 @@ conversion TodoJavascriptToRust @id("conversion_todo_js_rust") {
|
|
|
475
475
|
|
|
476
476
|
`constraint` rows accept every universal conversion constraint family used by route admission, including hyphenated spellings such as `module-constraint`, `scope-binding`, `memory-model`, `effect-constraint`, `control-flow`, `borrow-scope`, `borrow-checker`, `host-environment`, `callable-boundary`, `adt-pattern`, `data-layout`, `numeric-semantics`, `text-semantics`, `collection-semantics`, `serialization-semantics`, `dependency-semantics`, `object-model`, and `protocol`. The parser preserves family-specific fields such as module specifiers, package conditions, binding/reference ids, memory ordering, locks, capabilities, host permissions, callable signatures, pattern exhaustiveness, ABI/layout hints, numeric/text/collection behavior, wire formats, dependency lockfile evidence, and effect adapters as authored evidence inputs. Record-level targets use explicit labels such as `effectTarget` so `role target` rows cannot be mistaken for an authored target field. These rows do not prove translation equivalence; they make the required proof surface explicit for downstream gates and admission records.
|
|
477
477
|
|
|
478
|
+
## Authored runtime capability syntax
|
|
479
|
+
|
|
480
|
+
`.frontier` files can describe runtime host profiles and proof evidence directly with `runtimeCapabilities`, `runtimeCapabilityMatrix`, or `runtimeHosts` blocks. These blocks are the file-authored shape of the runtime capability matrix input used by conversion planning: they name source hosts, target hosts, host capability support, adapter requirements, and runtime proof signals without claiming that the runtime behavior is equivalent.
|
|
481
|
+
|
|
482
|
+
```frontier
|
|
483
|
+
runtimeCapabilities WebToRust @id("runtime_caps_web_rust") {
|
|
484
|
+
sourceHost web @id("runtime_host_js_web") language javascript runtime web host browser target javascript alias js|jsx evidence evidence_runtime_fetch
|
|
485
|
+
targetHost rust @id("runtime_host_rust_cli") language rust runtime cli host native-cli target rust alias rs evidence evidence_runtime_fetch
|
|
486
|
+
hostBinding webFetchBinding @id("runtime_binding_web_fetch") host runtime_host_js_web capability fetch kind native-api apiName fetch globalName window.fetch evidence evidence_runtime_fetch
|
|
487
|
+
hostBinding rustFetchBinding @id("runtime_binding_rust_fetch") host runtime_host_rust_cli capability fetch kind package package reqwest symbol Client evidence evidence_runtime_fetch
|
|
488
|
+
hostCapability webFetch @id("runtime_cap_web_fetch") host runtime_host_js_web capability fetch support native binding runtime_binding_web_fetch evidence evidence_runtime_fetch
|
|
489
|
+
hostCapability rustFetch @id("runtime_cap_rust_fetch") host runtime_host_rust_cli capability fetch support adapter binding runtime_binding_rust_fetch evidence evidence_runtime_fetch
|
|
490
|
+
requirement fetchAdapter @id("runtime_requirement_fetch_adapter") sourceHost runtime_host_js_web targetHost runtime_host_rust_cli capability fetch hostCapability runtime_cap_rust_fetch binding runtime_binding_rust_fetch requiredSignals source-hash|target-hash|runtime-command|probe-id|telemetry-hash|network-trace-hash proofEvidence evidence_runtime_fetch evidence evidence_runtime_fetch missingEvidence target-adapter-fixture proofGap rust-fetch-adapter-boundary readiness needs-review reason "Fetch adapter needs replay proof."
|
|
491
|
+
evidence fetchProbe @id("evidence_runtime_fetch") kind runtime-adapter-proof status passed capability fetch sourceHost runtime_host_js_web targetHost runtime_host_rust_cli runtimeProofSignals source-hash|target-hash|runtime-command|probe-id|telemetry-hash|network-trace-hash command "npm run probe:fetch" probeId fetch-probe telemetryHash hash_telemetry networkTraceHash hash_network
|
|
492
|
+
gap domProbe @id("runtime_gap_dom_probe") code runtime-dom-proof status missing summary "DOM proof is not provided."
|
|
493
|
+
}
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
The parser projects these rows into `metadata.runtimeCapabilities` and `metadata.runtimeCapabilityMatrix` as `frontier.lang.authoredRuntimeCapabilityMatrixInput`. `sourceHost` and `targetHost` rows become host profiles and selectors, `hostCapability` rows attach support facts to a host, `hostBinding` rows preserve concrete native/package/API binding evidence, `requirement` rows become fail-closed runtime proof obligations, and `evidence` rows carry source-bound proof signals such as commands, probe ids, telemetry hashes, network traces, layout snapshots, bitmap hashes, sandbox policies, and adapter binding hashes. The compiler can use this authored input when building a `universalRuntimeCapabilityMatrix`, but the authored file still keeps `runtimeEquivalenceClaim`, `semanticEquivalenceClaim`, `renderEquivalenceClaim`, and `autoMergeClaim` false.
|
|
497
|
+
|
|
478
498
|
## Authored dialect registry syntax
|
|
479
499
|
|
|
480
500
|
`.frontier` files can carry reusable dialect registries with `dialectRegistry` or `universalDialectRegistry` blocks. These blocks describe language-specific constructs that should stay visible during translation instead of being silently collapsed into generic stubs.
|
|
@@ -57,6 +57,11 @@ export function parseApplicationSurfaceBlock(block) {
|
|
|
57
57
|
|
|
58
58
|
export function mergeApplicationSurfaceBlocks(blocks) {
|
|
59
59
|
const records = blocks.flatMap((block) => block.records ?? []);
|
|
60
|
+
const evidenceIds = [
|
|
61
|
+
...blocks.flatMap((block) => ids(block.evidence)),
|
|
62
|
+
...records.flatMap((record) => record.evidenceIds ?? []),
|
|
63
|
+
...records.flatMap((record) => record.proofEvidenceIds ?? [])
|
|
64
|
+
];
|
|
60
65
|
return {
|
|
61
66
|
id: blocks.length === 1 ? blocks[0].id : 'applicationSurfaces:source',
|
|
62
67
|
surfaces: blocks,
|
|
@@ -69,7 +74,7 @@ export function mergeApplicationSurfaceBlocks(blocks) {
|
|
|
69
74
|
eventIds: idsByRecordKind(records, 'event'),
|
|
70
75
|
assetIds: idsByRecordKind(records, 'asset'),
|
|
71
76
|
gateIds: idsByRecordKind(records, 'gate'),
|
|
72
|
-
evidenceIds:
|
|
77
|
+
evidenceIds: [...new Set(evidenceIds.filter(Boolean))],
|
|
73
78
|
proofGapCodes: [...new Set(blocks.flatMap((block) => (block.proofGaps ?? []).map((gap) => gap.code).filter(Boolean)))],
|
|
74
79
|
summary: {
|
|
75
80
|
surfaceCount: blocks.length,
|
|
@@ -100,7 +105,7 @@ function applicationRecord(kind, name, text, context) {
|
|
|
100
105
|
surfaceName: context.surfaceName,
|
|
101
106
|
role: context.role,
|
|
102
107
|
identityKey: readInlineWord('identity', text) ?? readInlineWord('identityKey', text) ?? `${kind}:${context.role}:${recordName}`,
|
|
103
|
-
sourcePath: readInlineWord('sourcePath', text) ??
|
|
108
|
+
sourcePath: readInlineWord('sourcePath', text) ?? context.sourcePath,
|
|
104
109
|
sourceHash: readInlineWord('sourceHash', text) ?? context.sourceHash,
|
|
105
110
|
sourceSpan: parseSpan(readInlineWord('sourceSpan', text)),
|
|
106
111
|
evidenceIds: readInlineList(text, 'evidence', 'evidenceIds'),
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { parsePackageManifestBlock } from './package-manifest.js';
|
|
|
12
12
|
import { parseParadigmBlock } from './paradigm.js';
|
|
13
13
|
import { parseProofBlock } from './proof.js';
|
|
14
14
|
import { parseResourceGraphBlock } from './resource-graph.js';
|
|
15
|
+
import { parseRuntimeCapabilityBlock } from './runtime-capability.js';
|
|
15
16
|
import { parseNativeSourceBlock } from './source-evidence.js';
|
|
16
17
|
import { parseTargetProjectionMetadata } from './target-projection.js';
|
|
17
18
|
import { parseViewBlock } from './view.js';
|
|
@@ -31,6 +32,7 @@ export function parseFrontierSource(source, options = {}) {
|
|
|
31
32
|
const packageManifestBlocks = [];
|
|
32
33
|
const canvasSurfaceBlocks = [];
|
|
33
34
|
const applicationSurfaceBlocks = [];
|
|
35
|
+
const runtimeCapabilityBlocks = [];
|
|
34
36
|
const documentId = options.id ?? readId(source) ?? 'mod_frontier';
|
|
35
37
|
const documentName = options.name ?? readName(source) ?? 'FrontierModule';
|
|
36
38
|
for (const block of readBlocks(source)) {
|
|
@@ -62,8 +64,9 @@ export function parseFrontierSource(source, options = {}) {
|
|
|
62
64
|
if (block.kind === 'packageManifest' || block.kind === 'packageGraph' || block.kind === 'packageSurface') packageManifestBlocks.push(parsePackageManifestBlock(block));
|
|
63
65
|
if (block.kind === 'canvasSurface' || block.kind === 'canvasGraph') canvasSurfaceBlocks.push(parseCanvasSurfaceBlock(block));
|
|
64
66
|
if (block.kind === 'applicationSurface' || block.kind === 'appHost' || block.kind === 'plugin' || block.kind === 'pluginSurface' || block.kind === 'pluginContract') applicationSurfaceBlocks.push(parseApplicationSurfaceBlock(block));
|
|
67
|
+
if (block.kind === 'runtimeCapabilities' || block.kind === 'runtimeCapabilityMatrix' || block.kind === 'runtimeHosts') runtimeCapabilityBlocks.push(parseRuntimeCapabilityBlock(block));
|
|
65
68
|
}
|
|
66
|
-
const metadata = createParsedMetadata({ proofBlocks, paradigmBlocks, operationBlocks, conversionBlocks, constraintSpaceBlocks, decisionGraphBlocks, dialectRegistryBlocks, interlinguaBlocks, resourceGraphBlocks, nativeSourceBlocks, packageManifestBlocks, canvasSurfaceBlocks, applicationSurfaceBlocks });
|
|
69
|
+
const metadata = createParsedMetadata({ proofBlocks, paradigmBlocks, operationBlocks, conversionBlocks, constraintSpaceBlocks, decisionGraphBlocks, dialectRegistryBlocks, interlinguaBlocks, resourceGraphBlocks, nativeSourceBlocks, packageManifestBlocks, canvasSurfaceBlocks, applicationSurfaceBlocks, runtimeCapabilityBlocks });
|
|
67
70
|
return createDocument({ id: documentId, name: documentName, nodes, ...(metadata ? { metadata } : {}) });
|
|
68
71
|
}
|
|
69
72
|
|
|
@@ -73,7 +76,7 @@ function readName(source) { return /module\s+([A-Za-z_$][\w$]*)/.exec(source)?.[
|
|
|
73
76
|
function readId(source) { return /module\s+[A-Za-z_$][\w$]*\s+@id\(\s*["']([^"']+)["']\s*\)/.exec(source)?.[1]; }
|
|
74
77
|
function readBlocks(source) {
|
|
75
78
|
const blocks = [];
|
|
76
|
-
const header = /\b(entity|state|action|view|migration|capability|effect|type|extern|lattice|nativeSource|target|proof|paradigm|paradigmSemantics|operations|semanticOperations|conversion|universalConversionPlan|constraintSpace|possibilitySpace|decisionGraph|admissionGraph|dialectRegistry|universalDialectRegistry|interlingua|universalInterlingua|resourceGraph|semanticResourceGraph|packageManifest|packageGraph|packageSurface|canvasSurface|canvasGraph|applicationSurface|appHost|plugin|pluginSurface|pluginContract)\s+([^{}]+)\{/g;
|
|
79
|
+
const header = /\b(entity|state|action|view|migration|capability|effect|type|extern|lattice|nativeSource|target|proof|paradigm|paradigmSemantics|operations|semanticOperations|conversion|universalConversionPlan|constraintSpace|possibilitySpace|decisionGraph|admissionGraph|dialectRegistry|universalDialectRegistry|interlingua|universalInterlingua|resourceGraph|semanticResourceGraph|packageManifest|packageGraph|packageSurface|canvasSurface|canvasGraph|applicationSurface|appHost|plugin|pluginSurface|pluginContract|runtimeCapabilities|runtimeCapabilityMatrix|runtimeHosts)\s+([^{}]+)\{/g;
|
|
77
80
|
let match;
|
|
78
81
|
while ((match = header.exec(source))) {
|
|
79
82
|
let depth = 1; let index = header.lastIndex;
|
package/dist/metadata.js
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
import { mergeDialectRegistryBlocks } from './dialect-registry.js';
|
|
2
2
|
import { mergeApplicationSurfaceBlocks } from './application-surface.js';
|
|
3
|
+
import { mergeRuntimeCapabilityBlocks } from './runtime-capability.js';
|
|
3
4
|
|
|
4
5
|
const PROOF_GROUPS = ['contracts', 'refinements', 'invariants', 'termination', 'temporal', 'obligations', 'artifacts', 'assumptions'];
|
|
5
6
|
const PARADIGM_GROUPS = [
|
|
6
|
-
'bindingScopes',
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'typeConstraints',
|
|
10
|
-
'evaluationModels',
|
|
11
|
-
'memoryLocations',
|
|
12
|
-
'effectRegions',
|
|
13
|
-
'controlRegions',
|
|
14
|
-
'logicPrograms',
|
|
15
|
-
'actorSystems',
|
|
16
|
-
'stackEffects',
|
|
17
|
-
'arrayShapes',
|
|
18
|
-
'numericKernels',
|
|
19
|
-
'dataflowNetworks',
|
|
20
|
-
'clockModels',
|
|
21
|
-
'objectModels',
|
|
22
|
-
'macroExpansions',
|
|
23
|
-
'reflectionBoundaries',
|
|
24
|
-
'loweringRecords'
|
|
7
|
+
'bindingScopes', 'bindings', 'patterns', 'typeConstraints', 'evaluationModels', 'memoryLocations', 'effectRegions',
|
|
8
|
+
'controlRegions', 'logicPrograms', 'actorSystems', 'stackEffects', 'arrayShapes', 'numericKernels', 'dataflowNetworks',
|
|
9
|
+
'clockModels', 'objectModels', 'macroExpansions', 'reflectionBoundaries', 'loweringRecords'
|
|
25
10
|
];
|
|
26
11
|
|
|
27
|
-
export function createParsedMetadata({ proofBlocks = [], paradigmBlocks = [], operationBlocks = [], conversionBlocks = [], constraintSpaceBlocks = [], decisionGraphBlocks = [], dialectRegistryBlocks = [], interlinguaBlocks = [], resourceGraphBlocks = [], nativeSourceBlocks = [], packageManifestBlocks = [], canvasSurfaceBlocks = [], applicationSurfaceBlocks = [] } = {}) {
|
|
12
|
+
export function createParsedMetadata({ proofBlocks = [], paradigmBlocks = [], operationBlocks = [], conversionBlocks = [], constraintSpaceBlocks = [], decisionGraphBlocks = [], dialectRegistryBlocks = [], interlinguaBlocks = [], resourceGraphBlocks = [], nativeSourceBlocks = [], packageManifestBlocks = [], canvasSurfaceBlocks = [], applicationSurfaceBlocks = [], runtimeCapabilityBlocks = [] } = {}) {
|
|
28
13
|
const metadata = {};
|
|
29
14
|
if (proofBlocks.length) metadata.proof = mergeProofBlocks(proofBlocks);
|
|
30
15
|
if (paradigmBlocks.length) metadata.paradigmSemantics = mergeParadigmBlocks(paradigmBlocks);
|
|
@@ -38,8 +23,12 @@ export function createParsedMetadata({ proofBlocks = [], paradigmBlocks = [], op
|
|
|
38
23
|
if (packageManifestBlocks.length) metadata.packageManifests = mergePackageManifestBlocks(packageManifestBlocks);
|
|
39
24
|
if (canvasSurfaceBlocks.length) metadata.canvasSurfaces = mergeCanvasSurfaceBlocks(canvasSurfaceBlocks);
|
|
40
25
|
if (applicationSurfaceBlocks.length) metadata.applicationSurfaces = mergeApplicationSurfaceBlocks(applicationSurfaceBlocks);
|
|
41
|
-
if (
|
|
42
|
-
metadata.
|
|
26
|
+
if (runtimeCapabilityBlocks.length) {
|
|
27
|
+
metadata.runtimeCapabilities = mergeRuntimeCapabilityBlocks(runtimeCapabilityBlocks);
|
|
28
|
+
metadata.runtimeCapabilityMatrix = metadata.runtimeCapabilities;
|
|
29
|
+
}
|
|
30
|
+
if (nativeSourceBlocks.some((block) => block.sourceMaps.length || block.mergeCandidates.length || block.evidence.length) || packageManifestBlocks.length || canvasSurfaceBlocks.length || applicationSurfaceBlocks.length || runtimeCapabilityBlocks.length) {
|
|
31
|
+
metadata.universalAst = mergeUniversalAstBlocks(nativeSourceBlocks, packageManifestBlocks, canvasSurfaceBlocks, applicationSurfaceBlocks, runtimeCapabilityBlocks);
|
|
43
32
|
}
|
|
44
33
|
return Object.keys(metadata).length ? metadata : undefined;
|
|
45
34
|
}
|
|
@@ -110,7 +99,7 @@ function mergeConstraintSpaceBlocks(blocks) {
|
|
|
110
99
|
};
|
|
111
100
|
}
|
|
112
101
|
|
|
113
|
-
function mergeUniversalAstBlocks(blocks, packageManifestBlocks = [], canvasSurfaceBlocks = [], applicationSurfaceBlocks = []) {
|
|
102
|
+
function mergeUniversalAstBlocks(blocks, packageManifestBlocks = [], canvasSurfaceBlocks = [], applicationSurfaceBlocks = [], runtimeCapabilityBlocks = []) {
|
|
114
103
|
return {
|
|
115
104
|
id: blocks.length === 1 ? `universalAst:${blocks[0].node.id}` : 'universalAst:source',
|
|
116
105
|
nativeSourceIds: blocks.map((block) => block.node.id),
|
|
@@ -121,14 +110,17 @@ function mergeUniversalAstBlocks(blocks, packageManifestBlocks = [], canvasSurfa
|
|
|
121
110
|
packageManifests: packageManifestBlocks,
|
|
122
111
|
canvasSurfaces: canvasSurfaceBlocks,
|
|
123
112
|
applicationSurfaces: applicationSurfaceBlocks,
|
|
113
|
+
runtimeCapabilities: runtimeCapabilityBlocks,
|
|
124
114
|
packageManifestIds: ids(packageManifestBlocks),
|
|
125
115
|
canvasSurfaceIds: ids(canvasSurfaceBlocks),
|
|
126
116
|
applicationSurfaceIds: ids(applicationSurfaceBlocks),
|
|
117
|
+
runtimeCapabilityIds: ids(runtimeCapabilityBlocks),
|
|
127
118
|
metadata: {
|
|
128
119
|
authoredNativeSourceIds: blocks.map((block) => block.node.id),
|
|
129
120
|
authoredPackageManifestIds: ids(packageManifestBlocks),
|
|
130
121
|
authoredCanvasSurfaceIds: ids(canvasSurfaceBlocks),
|
|
131
|
-
authoredApplicationSurfaceIds: ids(applicationSurfaceBlocks)
|
|
122
|
+
authoredApplicationSurfaceIds: ids(applicationSurfaceBlocks),
|
|
123
|
+
authoredRuntimeCapabilityIds: ids(runtimeCapabilityBlocks)
|
|
132
124
|
}
|
|
133
125
|
};
|
|
134
126
|
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export function summarizeRuntimeCapabilities(matrix) {
|
|
2
|
+
return {
|
|
3
|
+
blockCount: matrix.blocks?.length ?? 1,
|
|
4
|
+
hostProfileCount: matrix.hostProfiles.length,
|
|
5
|
+
sourceHostCount: matrix.sourceHosts.length,
|
|
6
|
+
targetHostCount: matrix.targetHosts.length,
|
|
7
|
+
hostCapabilityCount: matrix.hostCapabilities?.length ?? 0,
|
|
8
|
+
hostBindingCount: matrix.hostBindings?.length ?? 0,
|
|
9
|
+
capabilityCount: matrix.hostProfiles.reduce((total, profile) => total + Object.keys(profile.capabilities ?? {}).length, 0),
|
|
10
|
+
runtimeRequirementCount: matrix.runtimeRequirements.length,
|
|
11
|
+
evidenceCount: matrix.evidence.length,
|
|
12
|
+
proofGapCount: matrix.proofGaps.length
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function runtimeFalseClaims() {
|
|
17
|
+
return {
|
|
18
|
+
autoMergeClaim: false,
|
|
19
|
+
semanticEquivalenceClaim: false,
|
|
20
|
+
runtimeEquivalenceClaim: false,
|
|
21
|
+
renderEquivalenceClaim: false,
|
|
22
|
+
projectionEquivalenceClaim: false,
|
|
23
|
+
hostCapabilityEquivalenceClaim: false
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function runtimeEvidence(name, text) {
|
|
28
|
+
return cleanRecord({
|
|
29
|
+
id: idFrom(text, `runtime_evidence_${safeId(name)}`),
|
|
30
|
+
name,
|
|
31
|
+
kind: readInlineWord('kind', text) ?? 'runtime-adapter-proof',
|
|
32
|
+
status: readInlineWord('status', text) ?? 'unknown',
|
|
33
|
+
capability: readInlineWord('capability', text) ?? readInlineWord('runtimeCapability', text) ?? readInlineWord('runtimeProofCapability', text),
|
|
34
|
+
runtimeCapability: readInlineWord('runtimeCapability', text),
|
|
35
|
+
runtimeProofCapability: readInlineWord('runtimeProofCapability', text),
|
|
36
|
+
sourceHost: readInlineWord('sourceHost', text) ?? readInlineWord('sourceHostId', text),
|
|
37
|
+
targetHost: readInlineWord('targetHost', text) ?? readInlineWord('targetHostId', text),
|
|
38
|
+
adapterRequirementId: readInlineWord('adapterRequirement', text) ?? readInlineWord('adapterRequirementId', text),
|
|
39
|
+
runtimeAdapterRequirementId: readInlineWord('runtimeAdapterRequirement', text) ?? readInlineWord('runtimeAdapterRequirementId', text),
|
|
40
|
+
runtimeProofSignals: readInlineList(text, 'runtimeProofSignal', 'runtimeProofSignals', 'proofSignal', 'proofSignals', 'signal', 'signals'),
|
|
41
|
+
sourceHash: readInlineWord('sourceHash', text),
|
|
42
|
+
targetHash: readInlineWord('targetHash', text),
|
|
43
|
+
outputHash: readInlineWord('outputHash', text),
|
|
44
|
+
command: readInlineQuoted('command', text) ?? readInlineWord('command', text),
|
|
45
|
+
runtimeCommand: readInlineQuoted('runtimeCommand', text) ?? readInlineWord('runtimeCommand', text),
|
|
46
|
+
probeId: readInlineWord('probeId', text) ?? readInlineWord('probe', text),
|
|
47
|
+
telemetryHash: readInlineWord('telemetryHash', text),
|
|
48
|
+
eventTraceHash: readInlineWord('eventTraceHash', text),
|
|
49
|
+
networkTraceHash: readInlineWord('networkTraceHash', text),
|
|
50
|
+
storageSnapshotHash: readInlineWord('storageSnapshotHash', text),
|
|
51
|
+
filesystemTraceHash: readInlineWord('filesystemTraceHash', text),
|
|
52
|
+
processTraceHash: readInlineWord('processTraceHash', text),
|
|
53
|
+
environmentSnapshotHash: readInlineWord('environmentSnapshotHash', text),
|
|
54
|
+
shellPolicyHash: readInlineWord('shellPolicyHash', text) ?? readInlineWord('shellPolicy', text),
|
|
55
|
+
secretScopePolicyHash: readInlineWord('secretScopePolicyHash', text) ?? readInlineWord('secretScopePolicy', text),
|
|
56
|
+
domSnapshotHash: readInlineWord('domSnapshotHash', text),
|
|
57
|
+
computedStyleHash: readInlineWord('computedStyleHash', text),
|
|
58
|
+
layoutSnapshotHash: readInlineWord('layoutSnapshotHash', text),
|
|
59
|
+
accessibilitySnapshotHash: readInlineWord('accessibilitySnapshotHash', text),
|
|
60
|
+
focusTraceHash: readInlineWord('focusTraceHash', text),
|
|
61
|
+
bitmapHash: readInlineWord('bitmapHash', text),
|
|
62
|
+
drawCommandTraceHash: readInlineWord('drawCommandTraceHash', text),
|
|
63
|
+
gpuCommandTraceHash: readInlineWord('gpuCommandTraceHash', text),
|
|
64
|
+
wasmModuleHash: readInlineWord('wasmModuleHash', text),
|
|
65
|
+
sandboxPolicyHash: readInlineWord('sandboxPolicyHash', text),
|
|
66
|
+
workerMessageTraceHash: readInlineWord('workerMessageTraceHash', text),
|
|
67
|
+
deterministicInputHash: readInlineWord('deterministicInputHash', text),
|
|
68
|
+
adapterBindingHash: readInlineWord('adapterBindingHash', text),
|
|
69
|
+
path: readInlineWord('path', text),
|
|
70
|
+
summary: readInlineQuoted('summary', text),
|
|
71
|
+
claims: runtimeFalseClaims()
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function runtimeProofGap(name, text) {
|
|
76
|
+
const code = readInlineWord('code', text) ?? name;
|
|
77
|
+
return cleanRecord({
|
|
78
|
+
id: idFrom(text, `runtime_gap_${safeId(code)}`),
|
|
79
|
+
code,
|
|
80
|
+
status: readInlineWord('status', text) ?? 'not-claimed',
|
|
81
|
+
summary: readInlineQuoted('summary', text) ?? readInlineQuoted('message', text),
|
|
82
|
+
failClosed: true,
|
|
83
|
+
...runtimeFalseClaims()
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function isPropertyLine(line) {
|
|
88
|
+
return /^(generatedAt|version|claim|claims)\s+/.test(line);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function idFrom(text, fallback) {
|
|
92
|
+
return /@id\(\s*["']([^"']+)["']\s*\)/.exec(text)?.[1] ?? fallback;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function nameFrom(header) {
|
|
96
|
+
return /^([A-Za-z_$][\w$-]*)/.exec(header)?.[1] ?? 'RuntimeCapabilities';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function readInlineWord(label, text) {
|
|
100
|
+
return new RegExp('(?:^|\\s)' + label + '\\s+([^\\s,]+)').exec(text)?.[1]?.trim();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function readInlineQuoted(label, text) {
|
|
104
|
+
return new RegExp("(?:^|\\s)" + label + "\\s+[\"']([^\"']+)[\"']").exec(text)?.[1]?.trim();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function readInlineFlag(label, text) {
|
|
108
|
+
return new RegExp('(?:^|\\s)' + label + '(?:\\s|$)').test(text) || undefined;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function readInlineList(text, ...labels) {
|
|
112
|
+
for (const label of labels) {
|
|
113
|
+
const value = new RegExp('(?:^|\\s)' + label + '\\s+([^\\s]+)').exec(text)?.[1]?.trim();
|
|
114
|
+
if (value) return value.split(/[|,]/).map((item) => item.trim()).filter(Boolean);
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function ids(records = []) {
|
|
120
|
+
return records.map((record) => record?.id).filter(Boolean);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function hostIds(records = []) {
|
|
124
|
+
return records.map((record) => typeof record === 'string' ? record : record?.id).filter(Boolean);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function uniqueRecords(records = []) {
|
|
128
|
+
const seen = new Set();
|
|
129
|
+
return records.filter((record) => {
|
|
130
|
+
const key = record?.id ?? JSON.stringify(record);
|
|
131
|
+
if (seen.has(key)) return false;
|
|
132
|
+
seen.add(key);
|
|
133
|
+
return true;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function uniqueHostSelectors(records = []) {
|
|
138
|
+
const seen = new Set();
|
|
139
|
+
return records.filter((record) => {
|
|
140
|
+
const key = typeof record === 'string' ? record : record?.id ?? JSON.stringify(record);
|
|
141
|
+
if (seen.has(key)) return false;
|
|
142
|
+
seen.add(key);
|
|
143
|
+
return true;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function cleanRecord(record) {
|
|
148
|
+
return Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined && (!Array.isArray(value) || value.length > 0) && (!value || typeof value !== 'object' || Object.keys(value).length > 0)));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function safeId(value) {
|
|
152
|
+
return String(value ?? 'unknown').replace(/[^A-Za-z0-9_$-]+/g, '_');
|
|
153
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { hashSemanticValue } from '@shapeshift-labs/frontier-lang-kernel';
|
|
2
|
+
import {
|
|
3
|
+
cleanRecord,
|
|
4
|
+
hostIds,
|
|
5
|
+
idFrom,
|
|
6
|
+
ids,
|
|
7
|
+
isPropertyLine,
|
|
8
|
+
nameFrom,
|
|
9
|
+
readInlineFlag,
|
|
10
|
+
readInlineList,
|
|
11
|
+
readInlineQuoted,
|
|
12
|
+
readInlineWord,
|
|
13
|
+
runtimeEvidence,
|
|
14
|
+
runtimeFalseClaims,
|
|
15
|
+
runtimeProofGap,
|
|
16
|
+
safeId,
|
|
17
|
+
summarizeRuntimeCapabilities,
|
|
18
|
+
uniqueHostSelectors,
|
|
19
|
+
uniqueRecords
|
|
20
|
+
} from './runtime-capability-records.js';
|
|
21
|
+
|
|
22
|
+
export function parseRuntimeCapabilityBlock(block) {
|
|
23
|
+
const name = nameFrom(block.header);
|
|
24
|
+
const matrix = {
|
|
25
|
+
kind: 'frontier.lang.authoredRuntimeCapabilityMatrixInput',
|
|
26
|
+
version: 1,
|
|
27
|
+
id: idFrom(block.header, `runtime_capabilities_${safeId(name)}`),
|
|
28
|
+
name,
|
|
29
|
+
hostProfiles: [],
|
|
30
|
+
sourceHosts: [],
|
|
31
|
+
targetHosts: [],
|
|
32
|
+
hostCapabilities: [],
|
|
33
|
+
hostBindings: [],
|
|
34
|
+
runtimeRequirements: [],
|
|
35
|
+
evidence: [],
|
|
36
|
+
proofGaps: [],
|
|
37
|
+
claims: runtimeFalseClaims(),
|
|
38
|
+
metadata: { authoredName: name, authoredBlockKind: block.kind }
|
|
39
|
+
};
|
|
40
|
+
const hostMap = new Map();
|
|
41
|
+
|
|
42
|
+
for (const rawLine of block.body.split('\n')) {
|
|
43
|
+
const line = rawLine.trim();
|
|
44
|
+
if (!line || line.startsWith('#') || isPropertyLine(line)) continue;
|
|
45
|
+
const match = /^(host|runtimeHost|hostProfile|sourceHost|targetHost|capability|hostCapability|hostBinding|binding|requirement|runtimeRequirement|requiredRuntime|evidence|proofEvidence|gap|proofGap)\s+([A-Za-z_$@/.:*-][\w$./@:*+-]*)(.*)$/.exec(line);
|
|
46
|
+
if (!match) continue;
|
|
47
|
+
const [, rowKind, rowName, rest] = match;
|
|
48
|
+
if (rowKind === 'gap' || rowKind === 'proofGap') {
|
|
49
|
+
matrix.proofGaps.push(runtimeProofGap(rowName, rest));
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (rowKind === 'evidence' || rowKind === 'proofEvidence') {
|
|
53
|
+
matrix.evidence.push(runtimeEvidence(rowName, rest));
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (rowKind === 'requirement' || rowKind === 'runtimeRequirement' || rowKind === 'requiredRuntime') {
|
|
57
|
+
matrix.runtimeRequirements.push(runtimeRequirement(rowName, rest));
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (rowKind === 'capability' || rowKind === 'hostCapability') {
|
|
61
|
+
attachCapability(hostMap, matrix, rowName, rest);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (rowKind === 'hostBinding' || rowKind === 'binding') {
|
|
65
|
+
matrix.hostBindings.push(runtimeHostBinding(rowName, rest));
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const profile = runtimeHostProfile(rowKind, rowName, rest);
|
|
69
|
+
upsertHost(hostMap, matrix, profile, rowKind);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
matrix.hostProfiles = [...hostMap.values()];
|
|
73
|
+
matrix.hostCapabilities = uniqueRecords(matrix.hostCapabilities);
|
|
74
|
+
matrix.hostBindings = uniqueRecords(matrix.hostBindings);
|
|
75
|
+
matrix.hostProfileIds = ids(matrix.hostProfiles);
|
|
76
|
+
matrix.sourceHostIds = hostIds(matrix.sourceHosts);
|
|
77
|
+
matrix.targetHostIds = hostIds(matrix.targetHosts);
|
|
78
|
+
matrix.hostCapabilityIds = ids(matrix.hostCapabilities);
|
|
79
|
+
matrix.hostBindingIds = ids(matrix.hostBindings);
|
|
80
|
+
matrix.runtimeRequirementIds = ids(matrix.runtimeRequirements);
|
|
81
|
+
matrix.evidenceIds = ids(matrix.evidence);
|
|
82
|
+
matrix.proofGapCodes = [...new Set(matrix.proofGaps.map((gap) => gap.code).filter(Boolean))];
|
|
83
|
+
matrix.summary = summarizeRuntimeCapabilities(matrix);
|
|
84
|
+
matrix.inputHash = hashSemanticValue({
|
|
85
|
+
kind: 'frontier.lang.runtimeCapabilities.authoredInput.v1',
|
|
86
|
+
hostProfiles: matrix.hostProfiles.map((profile) => ({
|
|
87
|
+
id: profile.id,
|
|
88
|
+
language: profile.language,
|
|
89
|
+
runtime: profile.runtime,
|
|
90
|
+
target: profile.target,
|
|
91
|
+
capabilities: Object.keys(profile.capabilities ?? {}).sort()
|
|
92
|
+
})),
|
|
93
|
+
hostCapabilities: matrix.hostCapabilityIds,
|
|
94
|
+
hostBindings: matrix.hostBindingIds,
|
|
95
|
+
sourceHosts: matrix.sourceHostIds,
|
|
96
|
+
targetHosts: matrix.targetHostIds,
|
|
97
|
+
runtimeRequirements: matrix.runtimeRequirements.map((requirement) => ({
|
|
98
|
+
id: requirement.id,
|
|
99
|
+
capability: requirement.capability,
|
|
100
|
+
sourceHost: requirement.sourceHost,
|
|
101
|
+
targetHost: requirement.targetHost,
|
|
102
|
+
requiredSignals: requirement.requiredSignals
|
|
103
|
+
})),
|
|
104
|
+
proofGaps: matrix.proofGapCodes
|
|
105
|
+
});
|
|
106
|
+
return matrix;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function mergeRuntimeCapabilityBlocks(blocks) {
|
|
110
|
+
const hostProfiles = uniqueRecords(blocks.flatMap((block) => block.hostProfiles ?? []));
|
|
111
|
+
const sourceHosts = uniqueHostSelectors(blocks.flatMap((block) => block.sourceHosts ?? []));
|
|
112
|
+
const targetHosts = uniqueHostSelectors(blocks.flatMap((block) => block.targetHosts ?? []));
|
|
113
|
+
const hostCapabilities = uniqueRecords(blocks.flatMap((block) => block.hostCapabilities ?? []));
|
|
114
|
+
const hostBindings = uniqueRecords(blocks.flatMap((block) => block.hostBindings ?? []));
|
|
115
|
+
const runtimeRequirements = uniqueRecords(blocks.flatMap((block) => block.runtimeRequirements ?? []));
|
|
116
|
+
const evidence = uniqueRecords(blocks.flatMap((block) => block.evidence ?? []));
|
|
117
|
+
const proofGaps = uniqueRecords(blocks.flatMap((block) => block.proofGaps ?? []));
|
|
118
|
+
return {
|
|
119
|
+
kind: 'frontier.lang.authoredRuntimeCapabilityMatrixInput',
|
|
120
|
+
version: 1,
|
|
121
|
+
id: blocks.length === 1 ? blocks[0].id : 'runtimeCapabilities:source',
|
|
122
|
+
blocks,
|
|
123
|
+
blockIds: ids(blocks),
|
|
124
|
+
hostProfiles,
|
|
125
|
+
sourceHosts,
|
|
126
|
+
targetHosts,
|
|
127
|
+
hostCapabilities,
|
|
128
|
+
hostBindings,
|
|
129
|
+
runtimeRequirements,
|
|
130
|
+
evidence,
|
|
131
|
+
proofGaps,
|
|
132
|
+
hostProfileIds: ids(hostProfiles),
|
|
133
|
+
sourceHostIds: hostIds(sourceHosts),
|
|
134
|
+
targetHostIds: hostIds(targetHosts),
|
|
135
|
+
hostCapabilityIds: ids(hostCapabilities),
|
|
136
|
+
hostBindingIds: ids(hostBindings),
|
|
137
|
+
runtimeRequirementIds: ids(runtimeRequirements),
|
|
138
|
+
evidenceIds: ids(evidence),
|
|
139
|
+
proofGapCodes: [...new Set(proofGaps.map((gap) => gap.code).filter(Boolean))],
|
|
140
|
+
summary: summarizeRuntimeCapabilities({ hostProfiles, sourceHosts, targetHosts, hostCapabilities, hostBindings, runtimeRequirements, evidence, proofGaps }),
|
|
141
|
+
claims: runtimeFalseClaims(),
|
|
142
|
+
metadata: { authoredRuntimeCapabilityBlockIds: ids(blocks) }
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function runtimeHostProfile(rowKind, name, text) {
|
|
147
|
+
const id = idFrom(text, name);
|
|
148
|
+
const [languageFromId, runtimeFromId] = String(id).includes(':') ? String(id).split(':') : [];
|
|
149
|
+
return cleanRecord({
|
|
150
|
+
kind: 'frontier.lang.runtimeHostProfile',
|
|
151
|
+
id,
|
|
152
|
+
name: readInlineWord('name', text) ?? name,
|
|
153
|
+
language: readInlineWord('language', text) ?? languageFromId,
|
|
154
|
+
aliases: readInlineList(text, 'alias', 'aliases'),
|
|
155
|
+
runtime: readInlineWord('runtime', text) ?? runtimeFromId,
|
|
156
|
+
host: readInlineWord('host', text),
|
|
157
|
+
target: readInlineWord('target', text),
|
|
158
|
+
capabilities: {},
|
|
159
|
+
notes: readInlineList(text, 'note', 'notes'),
|
|
160
|
+
role: rowKind === 'sourceHost' ? 'source' : rowKind === 'targetHost' ? 'target' : readInlineWord('role', text),
|
|
161
|
+
sourcePath: readInlineWord('sourcePath', text) ?? readInlineWord('path', text),
|
|
162
|
+
sourceHash: readInlineWord('sourceHash', text),
|
|
163
|
+
evidenceIds: readInlineList(text, 'evidence', 'evidenceIds'),
|
|
164
|
+
claims: runtimeFalseClaims()
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function upsertHost(hostMap, matrix, profile, rowKind) {
|
|
169
|
+
const existing = hostMap.get(profile.id) ?? { capabilities: {} };
|
|
170
|
+
const merged = cleanRecord({
|
|
171
|
+
...existing,
|
|
172
|
+
...profile,
|
|
173
|
+
capabilities: { ...(existing.capabilities ?? {}), ...(profile.capabilities ?? {}) }
|
|
174
|
+
});
|
|
175
|
+
hostMap.set(merged.id, merged);
|
|
176
|
+
if (rowKind === 'sourceHost' || merged.role === 'source') matrix.sourceHosts.push(merged.id);
|
|
177
|
+
if (rowKind === 'targetHost' || merged.role === 'target') matrix.targetHosts.push(merged.id);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function attachCapability(hostMap, matrix, name, text) {
|
|
181
|
+
const hostId = readInlineWord('host', text) ?? readInlineWord('hostId', text) ?? readInlineWord('sourceHost', text) ?? readInlineWord('targetHost', text);
|
|
182
|
+
if (!hostId) return;
|
|
183
|
+
const profile = hostMap.get(hostId) ?? runtimeHostProfile('host', hostId, '');
|
|
184
|
+
const capability = readInlineWord('capability', text) ?? readInlineWord('kind', text) ?? name;
|
|
185
|
+
const bindingId = readInlineWord('bindingId', text) ?? readInlineWord('binding', text);
|
|
186
|
+
const capabilityRecord = cleanRecord({
|
|
187
|
+
kind: 'frontier.lang.runtimeCapability.hostCapability',
|
|
188
|
+
id: idFrom(text, `runtime_capability_${safeId(hostId)}_${safeId(capability)}`),
|
|
189
|
+
name,
|
|
190
|
+
hostId,
|
|
191
|
+
host: hostId,
|
|
192
|
+
capability,
|
|
193
|
+
support: readInlineWord('support', text) ?? 'native',
|
|
194
|
+
permission: readInlineWord('permission', text),
|
|
195
|
+
bindingId,
|
|
196
|
+
binding: bindingId,
|
|
197
|
+
requiredSignals: readInlineList(text, 'requiredSignal', 'requiredSignals', 'signal', 'signals'),
|
|
198
|
+
proofEvidenceIds: readInlineList(text, 'proofEvidence', 'proofEvidenceIds'),
|
|
199
|
+
evidenceIds: readInlineList(text, 'evidence', 'evidenceIds'),
|
|
200
|
+
missingEvidence: readInlineList(text, 'missingEvidence', 'missingEvidences'),
|
|
201
|
+
proofGaps: readInlineList(text, 'proofGap', 'proofGaps'),
|
|
202
|
+
sourcePath: readInlineWord('sourcePath', text) ?? readInlineWord('path', text),
|
|
203
|
+
sourceHash: readInlineWord('sourceHash', text),
|
|
204
|
+
failClosed: true,
|
|
205
|
+
claims: runtimeFalseClaims()
|
|
206
|
+
});
|
|
207
|
+
const normalized = cleanRecord({
|
|
208
|
+
kind: capability,
|
|
209
|
+
support: capabilityRecord.support,
|
|
210
|
+
binding: capabilityRecord.binding ?? `${hostId}.${capability}`,
|
|
211
|
+
notes: readInlineList(text, 'note', 'notes'),
|
|
212
|
+
evidenceIds: capabilityRecord.evidenceIds,
|
|
213
|
+
sourcePath: capabilityRecord.sourcePath,
|
|
214
|
+
sourceHash: capabilityRecord.sourceHash
|
|
215
|
+
});
|
|
216
|
+
profile.capabilities = { ...(profile.capabilities ?? {}), [capability]: normalized };
|
|
217
|
+
hostMap.set(hostId, profile);
|
|
218
|
+
matrix.hostCapabilities.push(capabilityRecord);
|
|
219
|
+
if (readInlineFlag('source', text) || readInlineWord('role', text) === 'source') matrix.sourceHosts.push(hostId);
|
|
220
|
+
if (readInlineFlag('target', text) || readInlineWord('role', text) === 'target') matrix.targetHosts.push(hostId);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function runtimeHostBinding(name, text) {
|
|
224
|
+
return cleanRecord({
|
|
225
|
+
kind: 'frontier.lang.runtimeCapability.hostBinding',
|
|
226
|
+
id: idFrom(text, `runtime_binding_${safeId(name)}`),
|
|
227
|
+
name,
|
|
228
|
+
hostId: readInlineWord('host', text) ?? readInlineWord('hostId', text) ?? readInlineWord('sourceHost', text) ?? readInlineWord('targetHost', text),
|
|
229
|
+
capability: readInlineWord('capability', text) ?? readInlineWord('kind', text),
|
|
230
|
+
bindingKind: readInlineWord('bindingKind', text) ?? readInlineWord('kind', text),
|
|
231
|
+
packageName: readInlineWord('package', text) ?? readInlineWord('packageName', text),
|
|
232
|
+
importPath: readInlineWord('import', text) ?? readInlineWord('importPath', text),
|
|
233
|
+
symbol: readInlineWord('symbol', text),
|
|
234
|
+
apiName: readInlineWord('apiName', text),
|
|
235
|
+
globalName: readInlineWord('globalName', text),
|
|
236
|
+
command: readInlineQuoted('command', text) ?? readInlineWord('command', text),
|
|
237
|
+
evidenceIds: readInlineList(text, 'evidence', 'evidenceIds'),
|
|
238
|
+
proofEvidenceIds: readInlineList(text, 'proofEvidence', 'proofEvidenceIds'),
|
|
239
|
+
missingEvidence: readInlineList(text, 'missingEvidence', 'missingEvidences'),
|
|
240
|
+
proofGaps: readInlineList(text, 'proofGap', 'proofGaps'),
|
|
241
|
+
failClosed: true,
|
|
242
|
+
claims: runtimeFalseClaims()
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function runtimeRequirement(name, text) {
|
|
247
|
+
return cleanRecord({
|
|
248
|
+
id: idFrom(text, `runtime_requirement_${safeId(name)}`),
|
|
249
|
+
name,
|
|
250
|
+
capability: readInlineWord('capability', text) ?? readInlineWord('kind', text) ?? name,
|
|
251
|
+
capabilities: readInlineList(text, 'capability', 'capabilities'),
|
|
252
|
+
sourceLanguage: readInlineWord('sourceLanguage', text) ?? readInlineWord('language', text),
|
|
253
|
+
target: readInlineWord('target', text) ?? readInlineWord('targetLanguage', text),
|
|
254
|
+
sourceRuntime: readInlineWord('sourceRuntime', text) ?? readInlineWord('runtime', text),
|
|
255
|
+
targetRuntime: readInlineWord('targetRuntime', text),
|
|
256
|
+
sourceHost: readInlineWord('sourceHost', text) ?? readInlineWord('sourceHostId', text),
|
|
257
|
+
targetHost: readInlineWord('targetHost', text) ?? readInlineWord('targetHostId', text),
|
|
258
|
+
reason: readInlineQuoted('reason', text) ?? readInlineWord('reason', text),
|
|
259
|
+
requiredSignals: readInlineList(text, 'requiredSignal', 'requiredSignals', 'signal', 'signals', 'proofSignal', 'proofSignals'),
|
|
260
|
+
proofEvidenceIds: readInlineList(text, 'proofEvidence', 'proofEvidenceIds'),
|
|
261
|
+
evidenceIds: readInlineList(text, 'evidence', 'evidenceIds'),
|
|
262
|
+
hostCapabilityIds: readInlineList(text, 'hostCapability', 'hostCapabilityIds'),
|
|
263
|
+
bindingIds: readInlineList(text, 'binding', 'bindingIds', 'hostBinding', 'hostBindingIds'),
|
|
264
|
+
missingEvidence: readInlineList(text, 'missingEvidence', 'missingEvidences'),
|
|
265
|
+
proofGaps: readInlineList(text, 'proofGap', 'proofGaps'),
|
|
266
|
+
status: readInlineWord('status', text),
|
|
267
|
+
readiness: readInlineWord('readiness', text),
|
|
268
|
+
failClosed: true,
|
|
269
|
+
claims: runtimeFalseClaims()
|
|
270
|
+
});
|
|
271
|
+
}
|