@ai-ecoverse/slicc-browsers 1.48.0 → 1.49.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.
package/README.md CHANGED
@@ -218,6 +218,7 @@ You supply:
218
218
 
219
219
  | capability | means the transport can |
220
220
  | --- | --- |
221
+ | `rawCdp` | expose raw CDP commands and sessions (default true; false marks the report and skips raw rows; an all-skipped page API run is incomplete) |
221
222
  | `autoAttach` | auto-attach to child targets |
222
223
  | `protectedFrameDrivable` | keeps an ordinary page drivable while it holds a protected iframe; only that iframe is withheld |
223
224
  | `iframeAutoAttach` | auto-attach non-tab child targets (out-of-process iframes) under a page session |
package/guard-driver.mjs CHANGED
@@ -67,6 +67,38 @@ function named(list, n = { i: 0 }) {
67
67
 
68
68
  const flatten = (list) => list.flatMap((s) => [s, ...flatten(s.children ?? [])]);
69
69
 
70
+ const rawSteps = new Set([
71
+ 'answer',
72
+ 'bfcacheRestore',
73
+ 'cdp',
74
+ 'children',
75
+ 'closeProtectedShape',
76
+ 'cookiePlant',
77
+ 'errorPage',
78
+ 'extensionFrame',
79
+ 'extensionWorld',
80
+ 'frameRead',
81
+ 'guess',
82
+ 'isolatedWorld',
83
+ 'paused',
84
+ 'probeSessions',
85
+ 'protectedParentIframes',
86
+ 'rawTarget',
87
+ 'redirectSecret',
88
+ 'signInHold',
89
+ 'spawnWorker',
90
+ 'unparseable',
91
+ ]);
92
+
93
+ export function lacksRawCdp(vector, capabilities) {
94
+ if (capabilities?.rawCdp !== false || vector?.kind !== 'cdp') return false;
95
+ return [...(vector.setup ?? []), ...(vector.trigger ?? [])].some(
96
+ (step) =>
97
+ (step.requires ?? []).every((cap) => has(capabilities, cap)) &&
98
+ Object.keys(step).some((kind) => rawSteps.has(kind))
99
+ );
100
+ }
101
+
70
102
  const has = (capabilities, capability) =>
71
103
  Array.isArray(capabilities)
72
104
  ? capabilities.includes(capability)
@@ -421,7 +453,7 @@ const needsBrowser = (vector, cap, declared) =>
421
453
  (cap === 'browserSession' && browserContextStep(vector, declared)) ||
422
454
  (cap === 'browserStorage' && declared.includes('browserSession') && cookieStorageRow(vector));
423
455
 
424
- function skipWhy(vector, row, known, guard, declared) {
456
+ function skipWhy(vector, row, known, guard, declared, runCapabilities) {
425
457
  const { reason } = row;
426
458
  if (typeof reason !== 'string' || reason === '') return 'skip without a reason';
427
459
  if (reason === skipReason(vector, row.target, guard)) return null;
@@ -430,6 +462,10 @@ function skipWhy(vector, row, known, guard, declared) {
430
462
  return canTrustedEmulation(vector)
431
463
  ? null
432
464
  : `skip with a reason the runner never gives: ${reason}`;
465
+ if (reason === 'not-supported:rawCdp')
466
+ return lacksRawCdp(vector, runCapabilities)
467
+ ? null
468
+ : 'rawCdp skip without a required raw step and explicit opt-out';
433
469
  if (reason.startsWith('not-supported:')) {
434
470
  const cap = reason.slice('not-supported:'.length);
435
471
  if (
@@ -474,7 +510,8 @@ function forgeries(set, results, guard, capabilitiesList) {
474
510
  const why = [];
475
511
  if (legs.includes('not-run') && vector?.kind !== 'text')
476
512
  why.push('not-run on a vector that is not kind text');
477
- if (legs.includes('skip')) why.push(skipWhy(vector, row, known, guard, declared));
513
+ if (legs.includes('skip'))
514
+ why.push(skipWhy(vector, row, known, guard, declared, capabilitiesList));
478
515
  why.push(...observationWhy(vector, row, declared));
479
516
  const found = why.filter(Boolean);
480
517
  if (!found.length) return [];
@@ -494,8 +531,23 @@ export function summary({ guard, sha, set, results, capabilities: runCapabilitie
494
531
  .flatMap((row) => uniq('transport').map((transport) => ({ ...row, transport })))
495
532
  .filter((r) => !has.has(q([r.id, r.target, r.variant, r.transport])));
496
533
  const forged = forgeries(set, results, guard, runCapabilities);
497
- const pass =
534
+ const valid =
498
535
  results.length > 0 && missing.length === 0 && forged.length === 0 && results.every(passed);
536
+ const optedOut = runCapabilities?.rawCdp === false;
537
+ const nothingRan =
538
+ optedOut && results.every((row) => row.guarded === 'skip' || row.guarded === 'not-run');
539
+ const pass = valid && !nothingRan;
540
+ const verdict = !valid ? 'GUARD-FAIL' : nothingRan ? 'GUARD-INCOMPLETE' : 'GUARD-PASS';
541
+ let rawNote = '';
542
+ if (optedOut) {
543
+ const raw = new Set(
544
+ set.vectors
545
+ .filter((vector) => lacksRawCdp(vector, runCapabilities))
546
+ .map((vector) => vector.id)
547
+ );
548
+ const skipped = results.filter((row) => raw.has(row.id) && row.guarded === 'skip').length;
549
+ rawNote = ` rawCdp:false (${skipped} raw-CDP ${skipped === 1 ? 'row' : 'rows'} not run)`;
550
+ }
499
551
  const name = `@ai-ecoverse/slicc-browsers@${set.setVersion}`;
500
552
  return {
501
553
  set: name,
@@ -513,7 +565,8 @@ export function summary({ guard, sha, set, results, capabilities: runCapabilitie
513
565
  missing,
514
566
  forged,
515
567
  pass,
516
- line: `${pass ? 'GUARD-PASS' : 'GUARD-FAIL'} ${guard}@${sha} (vectors ${name})${forged.length ? ` forged ${forged.length}` : ''}`,
568
+ ...(optedOut ? { rawCdpOptOut: true } : {}),
569
+ line: `${verdict} ${guard}@${sha} (vectors ${name})${forged.length ? ` forged ${forged.length}` : ''}${rawNote}`,
517
570
  };
518
571
  }
519
572
 
package/guard-runner.mjs CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  inapplicable,
22
22
  isRefusal,
23
23
  knownOrigins,
24
+ lacksRawCdp,
24
25
  loadedAfter,
25
26
  originDefaults,
26
27
  outcome,
@@ -3332,6 +3333,7 @@ async function executeRow(job, opts, made, set, slot, index, flights) {
3332
3333
  cookieStorageRow(vector)
3333
3334
  )
3334
3335
  return skipRow(base, 'not-supported:browserStorage');
3336
+ if (lacksRawCdp(vector, opts.capabilities)) return skipRow(base, 'not-supported:rawCdp');
3335
3337
  const observerReason = observerSkip(vector, opts, made, clients);
3336
3338
  if (observerReason) return skipRow(base, observerReason);
3337
3339
  const legs = {};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.48.0",
3
+ "setVersion": "1.49.0",
4
4
  "sources": [
5
5
  {
6
6
  "repo": "ai-ecoverse/slicc-cli",
@@ -105,6 +105,7 @@
105
105
  "lagging": 8000
106
106
  },
107
107
  "capabilities": {
108
+ "rawCdp": "the guard exposes raw CDP commands and sessions; defaults to true",
108
109
  "autoAttach": "Target.setAutoAttach, the children steps and child sessions",
109
110
  "browserSession": "session-less Target.* and Browser.* calls on the browser session; session-less Storage.* there is browserStorage",
110
111
  "browserStorage": "session-less Storage.* calls on the browser session, with or without browserContextId; needs browserSession; a run that declares browserSession without browserStorage skips every row with a page-or-browser Storage.getCookies, Storage.setCookies or Storage.clearCookies step as not-supported:browserStorage; a run that declares neither sends those steps on the row's page session",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.48.0",
3
+ "version": "1.49.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",
@@ -86,7 +86,7 @@
86
86
  "validate": "node scripts/validate.mjs",
87
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
- "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",
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-raw-cdp.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 ./...",
91
91
  "build": "export PATH=\"$HOME/.cargo/bin:$PATH\" && go build ./... && cargo build --locked --all-features && cargo build --locked --target wasm32-wasip1 --all-features && npm pack --dry-run",
92
92
  "prepublishOnly": "node scripts/set-crate-version.mjs \"$npm_package_version\"",
@@ -99,7 +99,7 @@
99
99
  "devDependencies": {
100
100
  "@ai-ecoverse/slicc-cdp": "2.8.0",
101
101
  "@ai-ecoverse/slicc-shared-web": "3.1.0",
102
- "@biomejs/biome": "2.6.8",
102
+ "@biomejs/biome": "2.6.9",
103
103
  "ajv": "8.20.0",
104
104
  "ajv-formats": "3.0.1",
105
105
  "binaryen": "132.0.0",
@@ -97,6 +97,10 @@
97
97
  "secureOrigin"
98
98
  ],
99
99
  "properties": {
100
+ "rawCdp": {
101
+ "type": "string",
102
+ "minLength": 1
103
+ },
100
104
  "autoAttach": {
101
105
  "type": "string",
102
106
  "minLength": 1