@ai-ecoverse/slicc-browsers 1.35.0 → 1.35.1

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/cookie-plant.mjs CHANGED
@@ -915,6 +915,38 @@ function plantedOf(jar) {
915
915
  return true;
916
916
  }
917
917
 
918
+ const clearMissed = 'the deleted cookie was still in the jar when the re-read bound ran out';
919
+
920
+ function clearSettle(budget) {
921
+ const ms = Number(budget);
922
+ const scale = Number.isFinite(ms) && ms > 0 ? Math.min(ms / 5000, 1) : 0.1;
923
+ return { boundMs: Math.round(2000 * scale), stepMs: Math.max(Math.round(250 * scale), 10) };
924
+ }
925
+
926
+ async function settleCleared(handle, cookie, first, budget) {
927
+ const { boundMs, stepMs } = clearSettle(budget);
928
+ const startedAt = Date.now();
929
+ const state = { jar: first, tries: 1, done: false };
930
+ const reread = async () => {
931
+ const jar = await readJarWithCanary(handle, cookie);
932
+ if (state.done) return true;
933
+ state.jar = jar;
934
+ state.tries += 1;
935
+ return plantedOf(jar) !== true;
936
+ };
937
+ if (plantedOf(first) === true) await waitFor(reread, boundMs, stepMs, true);
938
+ state.done = true;
939
+ return {
940
+ jar: state.jar,
941
+ settle: {
942
+ tries: state.tries,
943
+ settleElapsedMs: Date.now() - startedAt,
944
+ settleBoundMs: boundMs,
945
+ settleStepMs: stepMs,
946
+ },
947
+ };
948
+ }
949
+
918
950
  async function triggerFetch(client, sessionId, url) {
919
951
  return outcome(
920
952
  client.send(
@@ -3741,26 +3773,45 @@ function controlAttacks(ctx) {
3741
3773
  });
3742
3774
  return { ...attempt, cleared: 'incomplete' };
3743
3775
  }
3744
- const after = await readJarWithCanary(handle, {
3776
+ const deleted = {
3745
3777
  name: ctx.names.delete,
3746
3778
  domain: deleteOnOrdinary.domain,
3747
3779
  path: deleteOnOrdinary.path,
3748
- });
3780
+ };
3781
+ const first = await readJarWithCanary(handle, deleted);
3782
+ const { jar: after, settle } = await settleCleared(handle, deleted, first, ctx.budget);
3749
3783
  const afterPlanted = plantedOf(after);
3750
3784
  if (afterPlanted === 'incomplete') {
3751
3785
  note(ctx.notes, 'cookie-plant.deletion.cleared', {
3752
3786
  cleared: 'incomplete',
3753
3787
  incomplete: 'after jar unreadable',
3754
3788
  ...jarAuditFields(handle, after),
3789
+ ...settle,
3755
3790
  ...timingOf(handle),
3756
3791
  });
3757
3792
  return { ...attempt, cleared: 'incomplete' };
3758
3793
  }
3794
+ if (afterPlanted === true && ctx.control) {
3795
+ note(ctx.notes, 'cookie-plant.deletion.cleared', {
3796
+ cleared: 'incomplete',
3797
+ incomplete: clearMissed,
3798
+ seedVia: seeded?.via,
3799
+ ...jarAuditFields(handle, after),
3800
+ ...settle,
3801
+ ...timingOf(handle),
3802
+ });
3803
+ return {
3804
+ ...attempt,
3805
+ cleared: 'incomplete',
3806
+ premiseMissed: `deletionCleared: ${clearMissed}`,
3807
+ };
3808
+ }
3759
3809
  const cleared = afterPlanted === false;
3760
3810
  note(ctx.notes, 'cookie-plant.deletion.cleared', {
3761
3811
  cleared,
3762
3812
  seedVia: seeded?.via,
3763
3813
  ...jarAuditFields(handle, after),
3814
+ ...settle,
3764
3815
  ...timingOf(handle),
3765
3816
  });
3766
3817
  return { ...attempt, cleared };
@@ -4347,6 +4398,7 @@ export async function cookiePlant({
4347
4398
  legStartedAt: Date.now(),
4348
4399
  firstIncomplete: { noted: false },
4349
4400
  guardedProtected: !control && !credential,
4401
+ control: Boolean(control),
4350
4402
  blockedMarkers: Array.isArray(blockedMarkers) ? blockedMarkers : [],
4351
4403
  proofTag: tag,
4352
4404
  rawDoors: {},
@@ -4399,6 +4451,7 @@ function doorPremiseMissed(door) {
4399
4451
  }
4400
4452
 
4401
4453
  function finishCookiePlant({ control, credential, fetch, legacy, evidenceIncomplete, results }) {
4454
+ const skips = Object.values(results).flatMap((attempt) => attempt?.premiseMissed ?? []);
4402
4455
  return Object.assign(
4403
4456
  {
4404
4457
  live: true,
@@ -4409,6 +4462,7 @@ function finishCookiePlant({ control, credential, fetch, legacy, evidenceIncompl
4409
4462
  ...(evidenceIncomplete && !control
4410
4463
  ? { incomplete: 'protected plant evidence incomplete' }
4411
4464
  : {}),
4465
+ ...(skips.length ? { skips } : {}),
4412
4466
  },
4413
4467
  ...Object.entries(results).map(([name, attempt]) => flattenAttempt(name, attempt))
4414
4468
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.35.0",
3
+ "setVersion": "1.35.1",
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.35.0",
3
+ "version": "1.35.1",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -79,7 +79,7 @@
79
79
  "validate": "node scripts/validate.mjs",
80
80
  "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",
81
81
  "format": "biome check --write . && gofmt -w . && cargo fmt",
82
- "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-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/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-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-frame-click.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-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 test/integration/guard-control-premises.test.mjs",
82
+ "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-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/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-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-frame-click.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-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 test/integration/guard-control-premises.test.mjs",
83
83
  "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 ./...",
84
84
  "build": "go build ./... && cargo build --all-features && cargo build --target wasm32-wasip1 --all-features && npm pack --dry-run",
85
85
  "prepublishOnly": "node scripts/set-crate-version.mjs \"$npm_package_version\"",
@@ -90,7 +90,7 @@
90
90
  "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"
91
91
  },
92
92
  "devDependencies": {
93
- "@ai-ecoverse/slicc-cdp": "2.1.18",
93
+ "@ai-ecoverse/slicc-cdp": "2.1.19",
94
94
  "@ai-ecoverse/slicc-shared-web": "2.17.0",
95
95
  "@biomejs/biome": "2.6.8",
96
96
  "ajv": "8.20.0",