@lapxo/bound 0.2.2 → 0.2.3
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/TARGET.bound +27 -19
- package/dist/host/native/loader.js +1 -1
- package/dist/host/native/module-closure.d.ts +35 -0
- package/dist/host/native/module-closure.js +34 -3
- package/dist/host/native/module-delivery.d.ts +62 -0
- package/dist/host/native/module-delivery.js +151 -0
- package/dist/host/native/module-syntax.js +3 -1
- package/dist/host/order.js +2 -0
- package/docs/contracts/closure-delivery.md +23 -0
- package/docs/contracts/closure-delivery.publication.json +25 -0
- package/package.json +13 -2
- package/receipts.bound +9759 -9625
- package/samples/module-delivery/inputs/delivery.json +1 -0
- package/samples/no/module-delivery/delivery.json +1 -0
- package/vectors/native/module-delivery.vector.json +32 -0
|
@@ -7,7 +7,7 @@ const require = nodeModule.createRequire(import.meta.url);
|
|
|
7
7
|
const { parse } = require('acorn');
|
|
8
8
|
const stripTypeScriptTypes = nodeModule.stripTypeScriptTypes;
|
|
9
9
|
/** Syntax inventory is not an execution-closure certificate: unresolved expressions stay explicit. */
|
|
10
|
-
export function moduleImportSyntax(source, coordinate) {
|
|
10
|
+
export function moduleImportSyntax(source, coordinate, options) {
|
|
11
11
|
const code = extname(coordinate) === '.ts' ? stripTypeScriptTypes(source, { mode: 'transform' }) : source;
|
|
12
12
|
let tree;
|
|
13
13
|
try {
|
|
@@ -48,6 +48,8 @@ export function moduleImportSyntax(source, coordinate) {
|
|
|
48
48
|
if (n['type'] === 'CallExpression') {
|
|
49
49
|
const callee = n['callee'];
|
|
50
50
|
if (callee?.['type'] === 'Identifier' && callee['name'] === 'require') {
|
|
51
|
+
if (options?.esmOnly)
|
|
52
|
+
throw Error('REFUSE·module closure CommonJS load in ESM delivery ' + coordinate);
|
|
51
53
|
specifier = literal(n['arguments'][0]);
|
|
52
54
|
if (specifier === undefined)
|
|
53
55
|
unresolved.add('require expression at ' + String(n['start']));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Verified executable closure delivery
|
|
2
|
+
|
|
3
|
+
Needs are arbitrary declared names, not a kernel profile enumeration.
|
|
4
|
+
|
|
5
|
+
All requested entries share the existing moduleClosure traversal; no second walker, parser or algebra.
|
|
6
|
+
|
|
7
|
+
Host requires already authenticated snapshot identities; a bundle digest establishes content identity, not authority or correctness.
|
|
8
|
+
|
|
9
|
+
Delivery preserves each reached JS/JSON member and explicitly pinned notices byte for byte. Separate digests identify the closure manifest and the exact UTF-8 JSON container.
|
|
10
|
+
|
|
11
|
+
Canonical delivery sorts needs, reached modules, library bindings and notices; duplicate needs do not duplicate code; unsupported executable forms refuse by name.
|
|
12
|
+
|
|
13
|
+
Mandatory member, source byte and response byte budgets apply before delivery. Pre-aborted or observed cancellation refuses. Synchronous work is not a preemptible execution sandbox.
|
|
14
|
+
|
|
15
|
+
Portable ESM delivery refuses host builtins, runtime loader access, CommonJS loads, calculated/escaped loader expressions and unsupported URL spellings before entry execution.
|
|
16
|
+
|
|
17
|
+
Consumer verifies the expected container digest and repeats the same closure preflight over exactly the delivered members. Derived import maps are never trusted as authority.
|
|
18
|
+
|
|
19
|
+
The host must verify actual mounted bytes again before execution; the test host demonstrates this but is not a public browser host.
|
|
20
|
+
|
|
21
|
+
Existing native, program and worker custody remain unchanged. Acorn routes stay explicitly retained under A-F gate.
|
|
22
|
+
|
|
23
|
+
No external fetch or general demand resolver is introduced. Missing bytes remain outside completed delivery and must be resolved by the existing host contract.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "contract/published/closure-delivery",
|
|
3
|
+
"members": [
|
|
4
|
+
{
|
|
5
|
+
"role": "contract",
|
|
6
|
+
"path": "docs/contracts/closure-delivery.md",
|
|
7
|
+
"digest": "sha256:bdadeefcf8042749e642a453adc7d07944ceab3fbd62de46209ea3ed25d05c2e"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"role": "yes",
|
|
11
|
+
"path": "samples/module-delivery/inputs/delivery.json",
|
|
12
|
+
"digest": "sha256:a6df1d11537a0792c9772b1874c7e127e0fda22203f756d6f0eb104d072a9df1"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"role": "vector",
|
|
16
|
+
"path": "vectors/native/module-delivery.vector.json",
|
|
17
|
+
"digest": "sha256:3de9f160f89764e1153a2719ab04447142fe187bf476b3060d860e81e9c37c02"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"role": "no",
|
|
21
|
+
"path": "samples/no/module-delivery/delivery.json",
|
|
22
|
+
"digest": "sha256:f95b1c3129896baaecb4ae7860afc11dcaaef0a2e47221b73044bc5a4681181f"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lapxo/bound",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Read the bounds you already wrote, fold them, and name the contradictions.",
|
|
6
6
|
"main": "dist/cli/verb.js",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"./reference/native": {
|
|
29
29
|
"types": "./dist/host/reference-native-api.d.ts",
|
|
30
30
|
"default": "./dist/host/reference-native-api.js"
|
|
31
|
+
},
|
|
32
|
+
"./closure/native": {
|
|
33
|
+
"types": "./dist/host/native/module-delivery.d.ts",
|
|
34
|
+
"default": "./dist/host/native/module-delivery.js"
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
37
|
"scripts": {
|
|
@@ -163,7 +167,14 @@
|
|
|
163
167
|
"samples/readme/yes.json",
|
|
164
168
|
"samples/readme/no.json",
|
|
165
169
|
"vectors/native/readme.vector.json",
|
|
166
|
-
"samples/engine-place/inputs/closure.json"
|
|
170
|
+
"samples/engine-place/inputs/closure.json",
|
|
171
|
+
"dist/host/native/module-delivery.d.ts",
|
|
172
|
+
"dist/host/native/module-closure.d.ts",
|
|
173
|
+
"docs/contracts/closure-delivery.md",
|
|
174
|
+
"docs/contracts/closure-delivery.publication.json",
|
|
175
|
+
"samples/module-delivery/inputs/delivery.json",
|
|
176
|
+
"samples/no/module-delivery/delivery.json",
|
|
177
|
+
"vectors/native/module-delivery.vector.json"
|
|
167
178
|
],
|
|
168
179
|
"author": "Lapxo",
|
|
169
180
|
"license": "MIT",
|