@ai-ecoverse/slicc-browsers 1.18.6 → 1.18.8

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
@@ -14,7 +14,7 @@ These programs can't share code, so they share data: one catalog, three sets of
14
14
  | [slicc-cli](https://github.com/ai-ecoverse/slicc-cli) (Go) | `slicc browsers`, `slicc launch`, and its CDP relay's guard |
15
15
  | [slicc-cdp](https://github.com/ai-ecoverse/slicc-cdp) (Rust, also `wasm32-wasip1`) | `playwright-cli list` and `open`, and its guard |
16
16
  | [slicc-agent](https://github.com/ai-ecoverse/slicc-agent) | refusing protected origins in its browser tools |
17
- | [slicc-bios](https://github.com/ai-ecoverse/slicc-bios), [slicc-extension](https://github.com/ai-ecoverse/slicc-extension) | their CDP guards, certified with the guard vectors |
17
+ | [slicc-bios](https://github.com/ai-ecoverse/slicc-bios), [slicc-extension](https://github.com/ai-ecoverse/slicc-extension) | their CDP guards, tested against the guard vectors |
18
18
 
19
19
  ## What's inside
20
20
 
@@ -238,22 +238,23 @@ To find out what a vector checks, read it in `guard-vectors.json`: each one list
238
238
 
239
239
  ## Development
240
240
 
241
- You need Go 1.26, Rust stable with the `wasm32-wasip1` target, and Node 24 or later.
241
+ You need Go 1.26, Rust stable with the `wasm32-wasip1` target, Node 24 or later, and Chrome or Chromium for the browser tests: they take `CHROME_PATH`, or the Chrome for Testing that `npx slicc-cdp install-browser` installs, and run it headless unless `CI` is set (`SLICC_HEADLESS=1` or `0` overrides).
242
242
 
243
243
  | command | what it does |
244
244
  | --- | --- |
245
245
  | `npm run corpus` | rebuilds `corpus.json` from `corpus/` |
246
246
  | `npm run validate` | checks every file against its schema and the rules a schema can't express, and runs `protected.json` through `protected.mjs` |
247
- | `npm run lint` | Biome, the slicc lint rules, `gofmt`, `go vet`, golangci-lint, `cargo fmt` and clippy |
248
- | `npm test` | validation, the Node, Go and Rust tests |
249
- | `npm run test:guard` | the reference runner against real Chromium with no guard, where every control must pass and every protection must fail |
247
+ | `npm run lint` | Biome, the slicc lint rules, `gofmt`, `go vet` for Linux, macOS and Windows, golangci-lint, `cargo fmt`, clippy and a `wasm32-wasip1` check of each feature |
248
+ | `npm test` | every file in `test/integration/`: validation, the Node, Go and Rust tests, and the reference runner against real Chromium with no guard, where every control must pass and every protection must fail |
250
249
  | `npm run build` | the Go module, the crate (also for `wasm32-wasip1`), and the npm package |
251
250
 
252
251
  A new discovery behaviour gets a corpus case, and a new guard behaviour gets a guard vector.
253
252
 
254
- ## Releases
253
+ ## CI and releases
255
254
 
256
- Every merge to `main` that warrants it is released by semantic-release, as one version for all three packages. The `vX.Y.Z` tag is the Go release; npm and crates.io are published with trusted publishing, and the GitHub release records the npm tarball's hash for certification. Pushed tags are never moved or deleted: a bad release is fixed by the next one.
255
+ CI is [slicc-shared-web's pipeline](https://github.com/ai-ecoverse/slicc-shared-web#pipeline), called from `.github/workflows/ci.yml`. A pull request gets lint, then `npm test` split over shards by timing, then a Claude and a Codex review; the merge queue runs lint and the tests again. Tests run on Linux only.
256
+
257
+ Every merge to `main` that warrants it is released by semantic-release in the same workflow, as one version for all three packages. The `vX.Y.Z` tag is the Go release, and npm gets the package with provenance through trusted publishing. Then `ci.yml` publishes the crate to crates.io, also with trusted publishing, and asks the Go module proxy and pkg.go.dev for the new tag. Pushed tags are never moved or deleted: a bad release is fixed by the next one.
257
258
 
258
259
  ## License
259
260
 
@@ -29,7 +29,7 @@ async function discover(reader, session, extensionId) {
29
29
  throw new Error(`extensionWorld: no content-script context for ${extensionId}`);
30
30
  }
31
31
 
32
- async function drivable(client, session, live) {
32
+ async function drivable({ client, session, live, reader, observer }) {
33
33
  const setup = await outcome(
34
34
  client.send(
35
35
  'Runtime.evaluate',
@@ -44,6 +44,7 @@ async function drivable(client, session, live) {
44
44
  const snapshot = await outcome(
45
45
  client.send('DOMSnapshot.captureSnapshot', { computedStyles: [] }, session)
46
46
  );
47
+ await outcome(reader.send('Page.bringToFront', {}, observer));
47
48
  const down = await outcome(
48
49
  client.send(
49
50
  'Input.dispatchMouseEvent',
@@ -395,7 +396,7 @@ export async function extensionWorld({
395
396
  controls,
396
397
  pauseMs,
397
398
  };
398
- if (mode === 'drivable') return await drivable(client, session, live);
399
+ if (mode === 'drivable') return await drivable(input);
399
400
  if (mode === 'debugger') return await debuggerWorld(input);
400
401
  return await selectWorld(input);
401
402
  } finally {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.18.6",
3
+ "setVersion": "1.18.8",
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.18.6",
3
+ "version": "1.18.8",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "fledgling": {
15
15
  "provider": "github",
16
- "workflow": "release.yml",
16
+ "workflow": "ci.yml",
17
17
  "repo": "ai-ecoverse/slicc-browsers",
18
18
  "publish": true
19
19
  },
@@ -66,29 +66,25 @@
66
66
  "prepare": "slicc-install-hooks",
67
67
  "corpus": "node scripts/corpus.mjs",
68
68
  "validate": "node scripts/validate.mjs",
69
- "lint": "slicc-lint && test -z \"$(gofmt -l .)\" && go mod tidy -diff && go vet ./... && golangci-lint run && cargo fmt --check && cargo clippy --all-features --all-targets -- -D warnings",
69
+ "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",
70
70
  "format": "biome check --write . && gofmt -w . && cargo fmt",
71
- "test": "npm run validate && node --test --test-concurrency=1 test/integration/self-contained.test.mjs test/integration/browser-runner.test.mjs test/integration/fixture-client.test.mjs test/integration/git-retry.test.mjs test/integration/release-line.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-stall.test.mjs test/integration/guard-forged.test.mjs test/integration/guard-exit-steps.test.mjs test/integration/guard-frame-read.test.mjs test/integration/guard-bfcache.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 && go test -race -count=1 ./test/integration/... && cargo test --all-features",
71
+ "test": "export PATH=\"$HOME/.cargo/bin:$PATH\" && node --test --test-concurrency=1 test/integration/self-contained.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-stall.test.mjs test/integration/guard-forged.test.mjs test/integration/guard-exit-steps.test.mjs test/integration/guard-frame-read.test.mjs test/integration/guard-bfcache.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/gates.test.mjs test/integration/validate.test.mjs test/integration/go.test.mjs test/integration/cargo.test.mjs test/integration/workflows.test.mjs test/integration/guard-sweep-union.test.mjs && node --test --test-concurrency=2 test/integration/guard-lifecycle.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-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-others.test.mjs",
72
72
  "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 ./...",
73
73
  "build": "go build ./... && cargo build --all-features && cargo build --target wasm32-wasip1 --all-features && npm pack --dry-run",
74
+ "prepublishOnly": "node scripts/set-crate-version.mjs \"$npm_package_version\"",
74
75
  "trust": "npx fledgling sync -y --skip-publish",
75
76
  "trust:dry": "npx fledgling sync --dry-run -y --skip-publish",
76
77
  "release": "semantic-release",
77
- "test:guard": "npm run test:guard-integration && npm run test:guard-sweep",
78
- "test:guard-integration": "node --test --test-concurrency=2 test/integration/guard-lifecycle.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-parallel.test.mjs test/integration/guard-client-exit.test.mjs test/integration/self-contained.test.mjs",
79
- "test:guard-sweep": "node scripts/test-guards.mjs",
80
- "test:gates": "node --test test/integration/gates.test.mjs",
81
- "test:guard-target": "node --test test/integration/guard-runner.test.mjs",
82
78
  "test:unit:redirect": "mkdir -p coverage/unit && node --experimental-test-coverage --test --test-concurrency=1 --test-coverage-include=redirect-secret.mjs --test-coverage-include=redirect-fragments.mjs --test-reporter=lcov --test-reporter-destination=coverage/unit/redirect.lcov test/unit/guard-redirect-*.test.mjs && slicc-diff-cover coverage/unit/redirect.lcov",
83
79
  "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=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=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"
84
80
  },
85
81
  "devDependencies": {
86
- "@ai-ecoverse/slicc-shared-web": "2.7.9",
82
+ "@ai-ecoverse/slicc-cdp": "1.31.2",
83
+ "@ai-ecoverse/slicc-shared-web": "2.8.4",
87
84
  "@biomejs/biome": "2.5.15",
88
85
  "ajv": "8.20.0",
89
86
  "ajv-formats": "3.0.1",
90
87
  "lefthook": "2.2.2",
91
- "playwright-core": "1.64.1",
92
88
  "semantic-release": "25.0.9"
93
89
  }
94
90
  }
@@ -232,6 +232,7 @@ export async function protectedErrorPage({
232
232
  observer
233
233
  );
234
234
  }
235
+ await outcome(reader.send('Page.bringToFront', {}, observer));
235
236
  const unsent = await scripted(client, session, ordinary, failedURL);
236
237
  if (unsent) return missing(unsent);
237
238
  let evidence;