@ai-ecoverse/slicc-browsers 1.47.0 → 1.48.0

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.
Binary file
package/engine.mjs CHANGED
@@ -29,6 +29,8 @@ function valid(op, result) {
29
29
  typeof result.digest === 'string' &&
30
30
  /^[0-9a-f]{16}$/.test(result.digest)
31
31
  );
32
+ case 'refusal':
33
+ return typeof result === 'string' && result.startsWith('slicc: refused: ');
32
34
  case 'har':
33
35
  return result === 'include' || result === 'exclude';
34
36
  case 'storageKey':
@@ -53,8 +55,29 @@ function exchange(wasm, method, input) {
53
55
  return answer.ok;
54
56
  }
55
57
 
58
+ function encode(value) {
59
+ return encoder.encode(
60
+ JSON.stringify(value, (_, v) => (typeof v === 'string' ? v.toWellFormed() : v))
61
+ );
62
+ }
63
+
64
+ function preserveTargetComparison(request) {
65
+ if (
66
+ request?.op !== 'target' ||
67
+ typeof request.url !== 'string' ||
68
+ typeof request.unreachableURL !== 'string'
69
+ )
70
+ return request;
71
+ if (
72
+ request.url !== request.unreachableURL &&
73
+ request.url.toWellFormed() === request.unreachableURL.toWellFormed()
74
+ )
75
+ return { ...request, unreachableURL: undefined };
76
+ return request;
77
+ }
78
+
56
79
  function binding(module, config) {
57
- const input = encoder.encode(JSON.stringify(config));
80
+ const input = encode(config);
58
81
  function create() {
59
82
  const wasm = new WebAssembly.Instance(module).exports;
60
83
  if (wasm.engine_abi() !== 1) throw new Error('unsupported engine ABI');
@@ -66,7 +89,11 @@ function binding(module, config) {
66
89
  function call(request) {
67
90
  try {
68
91
  instance ??= create();
69
- const result = exchange(instance, 'engine_call', encoder.encode(JSON.stringify(request)));
92
+ const wire =
93
+ request.op === 'batch' && Array.isArray(request.calls)
94
+ ? { ...request, calls: request.calls.map(preserveTargetComparison) }
95
+ : preserveTargetComparison(request);
96
+ const result = exchange(instance, 'engine_call', encode(wire));
70
97
  const ok =
71
98
  request.op === 'batch'
72
99
  ? Array.isArray(result) &&
@@ -92,6 +119,9 @@ function binding(module, config) {
92
119
  storageKey: (key) => call({ op: 'storageKey', key }),
93
120
  extensionFrame: (url) => call({ op: 'extensionFrame', url }),
94
121
  har: (url) => call({ op: 'har', url }),
122
+ zoneHost: (host) => call({ op: 'zoneHost', host }),
123
+ inheriting: (url) => call({ op: 'inheriting', url }),
124
+ refusal: (key) => call({ op: 'refusal', key }),
95
125
  info: () => call({ op: 'info' }),
96
126
  batch: (calls) => call({ op: 'batch', calls }),
97
127
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.47.0",
3
+ "setVersion": "1.48.0",
4
4
  "sources": [
5
5
  {
6
6
  "repo": "ai-ecoverse/slicc-cli",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.47.0",
3
+ "version": "1.48.0",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -84,7 +84,7 @@
84
84
  "corpus": "node scripts/corpus.mjs",
85
85
  "engine": "PATH=\"$HOME/.cargo/bin:$PATH\" node scripts/engine.mjs",
86
86
  "validate": "node scripts/validate.mjs",
87
- "lint": "export PATH=\"$HOME/.cargo/bin:$PATH\" && if [ \"$(uname -s)\" = Darwin ]; then echo 'Skipping byte comparison on macOS; Linux CI owns the wasm bytes.'; else git ls-files --error-unmatch engine/engine.wasm engine/engine-wasm.mjs > /dev/null && npm run engine && git diff --exit-code -- engine/engine.wasm engine/engine-wasm.mjs; fi && slicc-lint && test -z \"$(gofmt -l .)\" && go mod tidy -diff && go vet ./... && GOOS=darwin go vet ./... && GOOS=windows go vet ./... && golangci-lint run && cargo fmt --all --check && cargo clippy --workspace --locked --all-features --all-targets -- -D warnings && cargo check --target wasm32-wasip1 --no-default-features --locked && cargo check --target wasm32-wasip1 --features serde --locked && cargo check --target wasm32-wasip1 --all-features --locked",
87
+ "lint": "export PATH=\"$HOME/.cargo/bin:$PATH\" && if [ \"$(uname -s)\" = Darwin ]; then echo 'Skipping byte comparison on macOS; Linux CI owns the wasm bytes.'; else git ls-files --error-unmatch engine/engine.wasm engine/engine-wasm.mjs > /dev/null && npm run engine && git diff --exit-code -- engine/engine.wasm engine/engine-wasm.mjs protected.mjs; fi && node scripts/protected-bundle.mjs --check && slicc-lint && test -z \"$(gofmt -l .)\" && go mod tidy -diff && go vet ./... && GOOS=darwin go vet ./... && GOOS=windows go vet ./... && golangci-lint run && cargo fmt --all --check && cargo clippy --workspace --locked --all-features --all-targets -- -D warnings && cargo check --target wasm32-wasip1 --no-default-features --locked && cargo check --target wasm32-wasip1 --features serde --locked && cargo check --target wasm32-wasip1 --all-features --locked",
88
88
  "format": "biome check --write . && gofmt -w . && cargo fmt --all",
89
89
  "test": "export PATH=\"$HOME/.cargo/bin:$PATH\" && node --test --test-concurrency=1 test/integration/debugger-stage1-packaging.test.mjs test/integration/debugger-raw-control.test.mjs test/integration/debugger-cleanup.test.mjs test/integration/debugger-stage1-install-vectors.test.mjs test/integration/protected-premise.test.mjs test/integration/protected-zones.test.mjs test/integration/debugger-stage1-vectors.test.mjs test/integration/self-contained.test.mjs test/integration/seven-corpus.test.mjs test/integration/browser-runner.test.mjs test/integration/fixture-client.test.mjs test/integration/guard-redirect-carrier.test.mjs test/integration/guard-redirect-session-end.test.mjs test/integration/guard-redirect-history.test.mjs test/integration/guard-redirect-iframe.test.mjs test/integration/guard-redirect-through.test.mjs test/integration/guard-incomplete.test.mjs test/integration/guard-unparseable-wipe.test.mjs test/integration/guard-browser-ui.test.mjs test/integration/guard-snapshot-settle.test.mjs test/integration/guard-stall.test.mjs test/integration/guard-forged.test.mjs test/integration/guard-trusted-emulation.test.mjs test/integration/guard-exit-steps.test.mjs test/integration/guard-exit-refusal.test.mjs test/integration/guard-frame-read.test.mjs test/integration/guard-bfcache.test.mjs test/integration/guard-bfcache-marker.test.mjs test/integration/guard-bfcache-history.test.mjs test/integration/guard-bfcache-review.test.mjs test/integration/guard-bfcache-quarantine.test.mjs test/integration/guard-error-page-navigation.test.mjs test/integration/guard-error-page-events.test.mjs test/integration/guard-error-page-reload.test.mjs test/integration/guard-close-protected.test.mjs test/integration/guard-close-protected-shapes.test.mjs test/integration/guard-close-protected-shapes-chrome.test.mjs test/integration/guard-ordinary-idp-cookies.test.mjs test/integration/guard-protected-parent-iframes.test.mjs test/integration/guard-protected-parent-iframes-chrome.test.mjs test/integration/guard-error-frame-class.test.mjs test/integration/guard-sign-in-hold.test.mjs test/integration/guard-cookie-plant-chrome.test.mjs test/integration/guard-cookie-plant.test.mjs test/integration/guard-protected-parent-page.test.mjs test/integration/guard-protected-parent-page-chrome.test.mjs test/integration/guard-world-paint.test.mjs test/integration/gates.test.mjs test/integration/validate.test.mjs test/integration/validate-guard-stock-setup.test.mjs test/integration/validate-guard-explicit.test.mjs test/integration/go.test.mjs test/integration/cargo.test.mjs test/integration/engine.test.mjs test/integration/workflows.test.mjs test/integration/guard-refusable-nav.test.mjs test/integration/guard-protected-worker.test.mjs test/integration/guard-protected-worker-chrome-narrow.test.mjs test/integration/guard-protected-worker-chrome-hide.test.mjs test/integration/guard-protected-worker-chrome-hide-cut.test.mjs test/integration/guard-protected-worker-chrome-admit.test.mjs test/integration/guard-protected-worker-chrome-late.test.mjs test/integration/guard-protected-worker-chrome-rewrite.test.mjs test/integration/guard-protected-worker-chrome-rewrite-late.test.mjs test/integration/guard-sweep-union.test.mjs test/integration/guard-explicit-attach-chrome.test.mjs && node --test --test-concurrency=2 test/integration/guard-lifecycle.test.mjs test/integration/chromium-launch.test.mjs test/integration/guard-fit.test.mjs test/integration/guard-chain.test.mjs test/integration/guard-validation.test.mjs test/integration/guard-liveness.test.mjs test/integration/guard-observations.test.mjs test/integration/guard-child-latency.test.mjs test/integration/guard-child-latency-stress.test.mjs test/integration/guard-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.test.mjs test/integration/guard-cookie-plant-raw-leg.test.mjs test/integration/guard-cookie-plant-deletion.test.mjs test/integration/guard-cookie-plant-attach.test.mjs test/integration/guard-cookie-plant-attach-retry.test.mjs test/integration/guard-cookie-plant-open-commit.test.mjs test/integration/guard-cookie-plant-legacy-setup.test.mjs test/integration/guard-legs.test.mjs test/integration/guard-fetch-enable.test.mjs test/integration/guard-diagnostics.test.mjs test/integration/guard-chrome.test.mjs test/integration/guard-worlds.test.mjs test/integration/guard-world-discovery.test.mjs test/integration/guard-world-guesses.test.mjs test/integration/guard-unparseable.test.mjs test/integration/guard-redirect-secret.test.mjs test/integration/guard-error-page.test.mjs test/integration/guard-error-page-enable.test.mjs test/integration/guard-discovery.test.mjs test/integration/guard-bfcache-chrome.test.mjs test/integration/guard-bfcache-ownership-probe.test.mjs test/integration/guard-browser-page.test.mjs test/integration/guard-scales.test.mjs test/integration/guard-shared-log.test.mjs test/integration/guard-pre-beacon.test.mjs test/integration/guard-world-pause.test.mjs test/integration/guard-reveal-overlap.test.mjs test/integration/guard-extension-frame-cast.test.mjs test/integration/guard-extension-frame-mouse.test.mjs test/integration/guard-extension-frame-click.test.mjs test/integration/guard-extension-frame-key.test.mjs test/integration/guard-extension-frame-attach.test.mjs test/integration/guard-extension-frames.test.mjs test/integration/guard-stock-setup.test.mjs test/integration/guard-explicit-attach.test.mjs test/integration/guard-explicit-order.test.mjs test/integration/guard-stock-attack.test.mjs test/integration/guard-parallel.test.mjs test/integration/guard-client-exit.test.mjs test/integration/guard-runner-record.test.mjs test/integration/guard-runner.test.mjs test/integration/guard-error-legs.test.mjs test/integration/guard-sweep-ordinary.test.mjs test/integration/guard-sweep-seven.test.mjs test/integration/guard-sweep-vault.test.mjs test/integration/guard-sweep-vault-x.test.mjs test/integration/guard-sweep-preview.test.mjs test/integration/guard-sweep-idp.test.mjs test/integration/guard-sweep-others.test.mjs test/integration/guard-browser-storage.test.mjs test/integration/guard-control-premises.test.mjs test/integration/guard-control-probe-failure.test.mjs test/integration/guard-kept-origins.test.mjs",
90
90
  "test:unit": "mkdir -p coverage/unit && node --experimental-test-coverage --test --test-concurrency=1 --test-reporter=lcov --test-reporter-destination=coverage/unit/lcov.info test/unit/*.test.mjs && go test -race -cover ./...",
@@ -97,12 +97,13 @@
97
97
  "test:unit:guard": "mkdir -p coverage/unit && node --experimental-vm-modules --no-warnings --experimental-test-coverage --test --test-concurrency=1 --test-coverage-include=guard-runner.mjs --test-coverage-include=guard-driver.mjs --test-coverage-include=extension-frame.mjs --test-coverage-include=fixture-server.mjs --test-coverage-include=fixture-client.mjs --test-coverage-include=observer-target.mjs --test-coverage-include=frame-read.mjs --test-coverage-include=bfcache-restore.mjs --test-coverage-include=protected-error-page.mjs --test-coverage-include=protected-parent-iframes.mjs --test-coverage-include=unparseable-url.mjs --test-coverage-include=scripts/browser-runner.mjs --test-coverage-include=scripts/validate.mjs --test-reporter=lcov --test-reporter-destination=coverage/unit/guard.lcov test/unit/guard-*.test.mjs && slicc-diff-cover coverage/unit/guard.lcov"
98
98
  },
99
99
  "devDependencies": {
100
- "@ai-ecoverse/slicc-cdp": "2.7.0",
100
+ "@ai-ecoverse/slicc-cdp": "2.8.0",
101
101
  "@ai-ecoverse/slicc-shared-web": "3.1.0",
102
102
  "@biomejs/biome": "2.6.8",
103
103
  "ajv": "8.20.0",
104
104
  "ajv-formats": "3.0.1",
105
105
  "binaryen": "132.0.0",
106
+ "esbuild": "0.28.2",
106
107
  "lefthook": "2.2.2",
107
108
  "semantic-release": "26.0.1"
108
109
  }
package/protected.json CHANGED
@@ -5,6 +5,18 @@
5
5
  "unparseableRefusal": "slicc: refused: slicc can't parse this URL, so it could be a protected page",
6
6
  "origins": ["http://127.0.0.1:5710", "https://seven.example.test"],
7
7
  "urls": [
8
+ {
9
+ "url": "https://xn--a.%73liccy.ai/",
10
+ "protected": true,
11
+ "readOnly": true,
12
+ "note": "A rejected A-label still protects an authority with an encoded zone suffix."
13
+ },
14
+ {
15
+ "url": "https://xn--a.sliccy%2eai/",
16
+ "protected": true,
17
+ "readOnly": true,
18
+ "note": "A rejected A-label still protects an authority with an encoded zone suffix."
19
+ },
8
20
  { "url": "http://sliccy.ai/cdp-premise", "protected": false },
9
21
  { "url": "https://sliccy.ai/cdp-premise", "protected": false },
10
22
  { "url": "http://www.sliccy.ai/cdp-premise", "protected": true },
@@ -19,23 +31,68 @@
19
31
  { "url": "https://main--seven.sliccy.ai/cdp-premise", "protected": true },
20
32
  {
21
33
  "url": "http://exa mple.sliccy.ai/",
34
+ "readOnly": true,
22
35
  "protected": true
23
36
  },
24
37
  {
25
38
  "url": "http://exa%20mple.sliccy.ai/",
39
+ "readOnly": true,
26
40
  "protected": true
27
41
  },
28
42
  {
29
43
  "url": "http://‍.sliccy.ai/",
44
+ "readOnly": true,
30
45
  "protected": true
31
46
  },
32
47
  {
33
48
  "url": "http://xn--1ug.sliccy.ai/",
34
- "protected": true
49
+ "readOnly": true,
50
+ "protected": true,
51
+ "note": "Invalid A-label; the engine treats this URL as unparseable."
35
52
  },
36
53
  {
37
54
  "url": "http://xn--a.sliccy.ai/",
38
- "protected": true
55
+ "readOnly": true,
56
+ "protected": true,
57
+ "note": "Invalid A-label; the engine treats this URL as unparseable."
58
+ },
59
+ {
60
+ "url": "https://aࡳ.sliccy.ai/",
61
+ "protected": true,
62
+ "readOnly": true,
63
+ "note": "The raw host stays protected if IDNA tables reject a newer Unicode label."
64
+ },
65
+ {
66
+ "url": "https://xn--a-lld.sliccy.ai/",
67
+ "protected": true,
68
+ "readOnly": true,
69
+ "note": "The raw host stays protected if IDNA tables reject a newer Unicode label."
70
+ },
71
+ {
72
+ "url": "https://xn--a-7w4i.sliccy.ai/",
73
+ "protected": true,
74
+ "readOnly": true,
75
+ "note": "The raw host stays protected if IDNA tables reject a newer Unicode label."
76
+ },
77
+ {
78
+ "url": "https://xn--a.example.com/",
79
+ "protected": true,
80
+ "note": "Node accepts this host; the engine treats this URL as unparseable."
81
+ },
82
+ {
83
+ "url": "https://xn--1ug.example/",
84
+ "protected": true,
85
+ "note": "Node accepts this host; the engine treats this URL as unparseable."
86
+ },
87
+ {
88
+ "url": "view-source:ftp://xn--.example/",
89
+ "protected": true,
90
+ "note": "The wrapped URL has an empty A-label payload."
91
+ },
92
+ {
93
+ "url": "filesystem:https://xn--sliccy-9ra.example/temporary/x",
94
+ "protected": true,
95
+ "note": "The wrapped URL has an invalid A-label."
39
96
  },
40
97
  {
41
98
  "url": "http://[::1",
@@ -1408,6 +1465,26 @@
1408
1465
  "protected": false
1409
1466
  }
1410
1467
  ],
1468
+ "zoneHosts": [
1469
+ { "host": "www.sliccy.ai", "protected": true },
1470
+ { "host": "PREVIEW.SLICCY.AI.", "protected": true },
1471
+ { "host": "vault-x.sliccy.ai", "protected": true },
1472
+ { "host": "get.sliccy.ai", "protected": false },
1473
+ { "host": "sliccy.ai", "protected": false },
1474
+ { "host": "a.b.sliccy.ai", "protected": false },
1475
+ { "host": "x.sliccy.ai..", "protected": false },
1476
+ { "host": ".sliccy.ai", "protected": true }
1477
+ ],
1478
+ "inheritingUrls": [
1479
+ { "url": "", "inheriting": true },
1480
+ { "url": "ABOUT:blank#doc", "inheriting": true },
1481
+ { "url": "about:srcdoc?x", "inheriting": true },
1482
+ { "url": "about://", "inheriting": false },
1483
+ { "url": "null", "inheriting": false },
1484
+ { "url": "broken", "inheriting": false },
1485
+ { "url": "https://example.test/", "inheriting": false },
1486
+ { "url": "blob:about:blank", "inheriting": false }
1487
+ ],
1411
1488
  "cookieDomains": [
1412
1489
  {
1413
1490
  "domain": "sliccy.ai",
@@ -1511,6 +1588,48 @@
1511
1588
  { "domain": ".ai", "protected": true }
1512
1589
  ],
1513
1590
  "storageKeys": [
1591
+ {
1592
+ "key": "https://xn--a.%73liccy.ai/",
1593
+ "protected": true
1594
+ },
1595
+ {
1596
+ "key": "https://xn--a.sliccy%2eai/",
1597
+ "protected": true
1598
+ },
1599
+ {
1600
+ "key": "http://xn--a.sliccy.ai/",
1601
+ "protected": true
1602
+ },
1603
+ {
1604
+ "key": "https://ordinary.example/^0https://xn--a-lld.sliccy.ai",
1605
+ "protected": true
1606
+ },
1607
+ {
1608
+ "key": "blob:https://aࡳ.sliccy.ai/x",
1609
+ "protected": true
1610
+ },
1611
+ {
1612
+ "key": "view-source:filesystem:https://first@user@bad host.SLICCY.AI.:99999/path",
1613
+ "protected": true
1614
+ },
1615
+ {
1616
+ "key": "https://sliccy.ai@unrelated.invalid:99999/",
1617
+ "protected": false
1618
+ },
1619
+ {
1620
+ "key": "https://bad host.sliccy.ai.example:99999/",
1621
+ "protected": false
1622
+ },
1623
+ {
1624
+ "key": "https://seven.example.test:99999\\path",
1625
+ "protected": true
1626
+ },
1627
+
1628
+ {
1629
+ "key": "https://ordinary.example/^0file://xn--a.example.com/x",
1630
+ "protected": false,
1631
+ "note": "Read-only matching ignores an unparseable top-level site."
1632
+ },
1514
1633
  {
1515
1634
  "key": "http://[::1",
1516
1635
  "protected": false
@@ -1525,7 +1644,8 @@
1525
1644
  },
1526
1645
  {
1527
1646
  "key": "view-source:view-source:view-source:view-source:view-source:view-source:view-source:view-source:view-source:https://seven.sliccy.ai/",
1528
- "protected": false
1647
+ "protected": true,
1648
+ "note": "The wrapped authority matches a protected host even beyond the parser unwrap limit."
1529
1649
  },
1530
1650
  {
1531
1651
  "key": "https://example.com/^0http://[::1",