@ai-ecoverse/slicc-browsers 1.28.2 → 1.28.4

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/guard-runner.mjs CHANGED
@@ -52,6 +52,7 @@ export { leftoverPersistentWorker, releasePersistentWorkerSessions, workerTypeFo
52
52
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
53
53
  const namedResultMs = 10000;
54
54
  const observeMs = 5000;
55
+ const premises = { chainStarted: 'first hop not observed' };
55
56
 
56
57
  function autoAttachSession(events, start, targetId) {
57
58
  return events
@@ -2130,6 +2131,8 @@ class Execution {
2130
2131
  async observeAll(unseen) {
2131
2132
  const observed = { ...this.refused };
2132
2133
  const incomplete = [];
2134
+ let measured = 0;
2135
+ let excused = 0;
2133
2136
  for (const [name, observation] of Object.entries(this.vector.observe ?? {})) {
2134
2137
  if (gatedOut(observation, this.options.capabilities)) {
2135
2138
  observed[name] = 'not-supported';
@@ -2140,7 +2143,11 @@ class Execution {
2140
2143
  observed[name] = 'incomplete';
2141
2144
  continue;
2142
2145
  }
2143
- if (dependencies.some((dep) => this.refused[dep] === true)) continue;
2146
+ if (dependencies.some((dep) => this.refused[dep] === true)) {
2147
+ excused++;
2148
+ continue;
2149
+ }
2150
+ measured++;
2144
2151
  observed[name] = await this.observe(name, observation.check);
2145
2152
  if (observed[name] === 'unwatched') {
2146
2153
  observed[name] = 'incomplete';
@@ -2155,9 +2162,27 @@ class Execution {
2155
2162
  observed[`${name}.either`] = holds;
2156
2163
  if (holds === 'incomplete') incomplete.push(name);
2157
2164
  }
2165
+ this.premises(observed);
2166
+ if (this.side === 'control' && excused && !measured) this.incomplete.push('measured nothing');
2158
2167
  return { observed, incomplete };
2159
2168
  }
2160
2169
 
2170
+ premises(observed) {
2171
+ const want = this.side === 'control' ? this.vector.control.expected : this.vector.expected;
2172
+ const observe = this.vector.observe ?? {};
2173
+ const missing = Object.keys(premises).filter(
2174
+ (name) =>
2175
+ Object.hasOwn(observe, name) &&
2176
+ !(observe[name].dependsOn ?? []).length &&
2177
+ want?.[name] === true &&
2178
+ observed[name] === false
2179
+ );
2180
+ if (!missing.length) return;
2181
+ for (const name of missing) this.incomplete.push(`${name}: ${premises[name]}`);
2182
+ for (const name of Object.keys(observe))
2183
+ if (want?.[name] === true && observed[name] === false) observed[name] = 'incomplete';
2184
+ }
2185
+
2161
2186
  async either(check, value, name, unseen) {
2162
2187
  const holds = () => this.check(check);
2163
2188
  if (await holds()) return true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.28.2",
3
+ "setVersion": "1.28.4",
4
4
  "sources": [
5
5
  {
6
6
  "repo": "ai-ecoverse/slicc-cli",
@@ -12412,9 +12412,18 @@
12412
12412
  "observer": "client"
12413
12413
  }
12414
12414
  },
12415
+ "chainStarted": {
12416
+ "means": "the stand-in served {ordinary}/hop?code=301",
12417
+ "dependsOn": [],
12418
+ "check": {
12419
+ "served": "/hop",
12420
+ "origin": "{ordinary}",
12421
+ "observer": "fixture"
12422
+ }
12423
+ },
12415
12424
  "protectedHop": {
12416
12425
  "means": "the stand-in served {target}/hop?code=302",
12417
- "dependsOn": ["refused.3", "refused.4"],
12426
+ "dependsOn": [],
12418
12427
  "check": {
12419
12428
  "served": "/hop",
12420
12429
  "origin": "{target}",
@@ -12423,7 +12432,7 @@
12423
12432
  },
12424
12433
  "landed": {
12425
12434
  "means": "the stand-in served {cross}/doc?n={tag}-after",
12426
- "dependsOn": ["refused.3", "refused.4"],
12435
+ "dependsOn": [],
12427
12436
  "check": {
12428
12437
  "served": "{cross}/doc?n={tag}-after",
12429
12438
  "observer": "fixture"
@@ -12591,6 +12600,7 @@
12591
12600
  "via": "guard",
12592
12601
  "expected": {
12593
12602
  "allowedBeacon": true,
12603
+ "chainStarted": true,
12594
12604
  "protectedHop": true,
12595
12605
  "landed": true,
12596
12606
  "afterBeacon": true,
@@ -12599,6 +12609,7 @@
12599
12609
  },
12600
12610
  "expected": {
12601
12611
  "allowedBeacon": true,
12612
+ "chainStarted": true,
12602
12613
  "protectedHop": false,
12603
12614
  "landed": false,
12604
12615
  "afterBeacon": false,
@@ -12868,9 +12879,18 @@
12868
12879
  "observer": "client"
12869
12880
  }
12870
12881
  },
12882
+ "chainStarted": {
12883
+ "means": "the stand-in served {ordinary}/hop?code=301",
12884
+ "dependsOn": [],
12885
+ "check": {
12886
+ "served": "/hop",
12887
+ "origin": "{ordinary}",
12888
+ "observer": "fixture"
12889
+ }
12890
+ },
12871
12891
  "protectedHop": {
12872
12892
  "means": "the stand-in served {target}/hop?code=307",
12873
- "dependsOn": ["refused.3", "refused.4"],
12893
+ "dependsOn": [],
12874
12894
  "check": {
12875
12895
  "served": "/hop",
12876
12896
  "origin": "{target}",
@@ -12879,7 +12899,7 @@
12879
12899
  },
12880
12900
  "landed": {
12881
12901
  "means": "the stand-in served {cross}/doc?n={tag}-after",
12882
- "dependsOn": ["refused.3", "refused.4"],
12902
+ "dependsOn": [],
12883
12903
  "check": {
12884
12904
  "served": "{cross}/doc?n={tag}-after",
12885
12905
  "observer": "fixture"
@@ -13047,6 +13067,7 @@
13047
13067
  "via": "guard",
13048
13068
  "expected": {
13049
13069
  "allowedBeacon": true,
13070
+ "chainStarted": true,
13050
13071
  "protectedHop": true,
13051
13072
  "landed": true,
13052
13073
  "afterBeacon": true,
@@ -13055,6 +13076,7 @@
13055
13076
  },
13056
13077
  "expected": {
13057
13078
  "allowedBeacon": true,
13079
+ "chainStarted": true,
13058
13080
  "protectedHop": false,
13059
13081
  "landed": false,
13060
13082
  "afterBeacon": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.28.2",
3
+ "version": "1.28.4",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -78,7 +78,7 @@
78
78
  "validate": "node scripts/validate.mjs",
79
79
  "lint": "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 --check && cargo clippy --all-features --all-targets -- -D warnings && cargo check --target wasm32-wasip1 --no-default-features && cargo check --target wasm32-wasip1 --features serde && cargo check --target wasm32-wasip1 --all-features",
80
80
  "format": "biome check --write . && gofmt -w . && cargo fmt",
81
- "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/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-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-credential-export.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-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/go.test.mjs test/integration/cargo.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 && 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-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.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-discovery.test.mjs test/integration/guard-bfcache-chrome.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-frames.test.mjs test/integration/guard-stock-setup.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.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-apex.test.mjs test/integration/guard-sweep-idp.test.mjs test/integration/guard-sweep-others.test.mjs",
81
+ "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/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-credential-export.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-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/go.test.mjs test/integration/cargo.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 && 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-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.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-discovery.test.mjs test/integration/guard-bfcache-chrome.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-frames.test.mjs test/integration/guard-stock-setup.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.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-apex.test.mjs test/integration/guard-sweep-idp.test.mjs test/integration/guard-sweep-others.test.mjs",
82
82
  "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 ./...",
83
83
  "build": "go build ./... && cargo build --all-features && cargo build --target wasm32-wasip1 --all-features && npm pack --dry-run",
84
84
  "prepublishOnly": "node scripts/set-crate-version.mjs \"$npm_package_version\"",
@@ -89,8 +89,8 @@
89
89
  "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"
90
90
  },
91
91
  "devDependencies": {
92
- "@ai-ecoverse/slicc-cdp": "2.1.0",
93
- "@ai-ecoverse/slicc-shared-web": "2.16.0",
92
+ "@ai-ecoverse/slicc-cdp": "2.1.4",
93
+ "@ai-ecoverse/slicc-shared-web": "2.16.1",
94
94
  "@biomejs/biome": "2.6.7",
95
95
  "ajv": "8.20.0",
96
96
  "ajv-formats": "3.0.1",
package/sign-in-hold.mjs CHANGED
@@ -516,6 +516,44 @@ function matchPopup(info, known, openerId, heldUrl, control) {
516
516
  return url === heldUrl || url.startsWith('about:blank#') || url.includes('/held');
517
517
  }
518
518
 
519
+ function exactPopups(infos, known, openerId, markerUrl) {
520
+ return infos.filter(
521
+ (info) =>
522
+ info.type === 'page' &&
523
+ !known.has(info.targetId) &&
524
+ info.url === markerUrl &&
525
+ info.openerId === openerId
526
+ );
527
+ }
528
+
529
+ async function askedPopup(reader, { known, openerId, markerUrl, budget, notes }) {
530
+ let matched = 0;
531
+ let failed = null;
532
+ const popup = await until(async () => {
533
+ const listed = await outcome(reader.send('Target.getTargets', {}));
534
+ if (!listed.ok) {
535
+ failed = String(listed.error?.message ?? listed.error);
536
+ return null;
537
+ }
538
+ failed = null;
539
+ const found = exactPopups(listed.result?.targetInfos ?? [], known, openerId, markerUrl);
540
+ matched = found.length;
541
+ return matched === 1 ? found[0] : null;
542
+ }, budget);
543
+ note(notes, 'sign-in-hold.ask-cleanup', {
544
+ markerUrl,
545
+ openerId,
546
+ matched,
547
+ failed,
548
+ targetId: popup?.targetId ?? null,
549
+ });
550
+ if (popup) return { popup };
551
+ const why = failed
552
+ ? `Target.getTargets failed: ${failed}`
553
+ : `${matched} page targets at ${markerUrl} opened by ${openerId}`;
554
+ return { reason: `popup not identified exactly (${why}), nothing closed` };
555
+ }
556
+
519
557
  async function moveHeldPopup(reader, raw, heldUrl, budget, internalSessions) {
520
558
  if (raw.url === heldUrl) return raw;
521
559
  const attached = await outcome(
@@ -591,23 +629,20 @@ async function heldPopup({
591
629
  notes,
592
630
  });
593
631
  if (askedHold.incomplete) {
594
- const popup = await until(
595
- async () => {
596
- const listed = await outcome(reader.send('Target.getTargets', {}));
597
- if (!listed.ok) return null;
598
- return (
599
- (listed.result?.targetInfos ?? []).find((info) =>
600
- matchPopup(info, known, openerId, heldUrl, control)
601
- ) ?? null
602
- );
603
- },
604
- Math.min(budget, 1000)
605
- );
632
+ const found = await askedPopup(reader, {
633
+ known,
634
+ openerId,
635
+ markerUrl: `about:blank#${MARK_PREFIX}${marker}`,
636
+ budget: Math.min(budget, 1000),
637
+ notes,
638
+ });
639
+ if (!found.popup)
640
+ return { live: false, incomplete: `${askedHold.incomplete}; ${found.reason}` };
606
641
  return {
607
642
  live: false,
608
643
  incomplete: askedHold.incomplete,
609
644
  openerId,
610
- ...(popup?.targetId ? { targetId: popup.targetId } : {}),
645
+ targetId: found.popup.targetId,
611
646
  };
612
647
  }
613
648
  holdAnswer = askedHold.answer;