@ai-ecoverse/slicc-browsers 1.33.0 → 1.34.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/guard-runner.mjs +55 -0
- package/guard-vectors.json +5 -7
- package/package.json +3 -3
package/guard-runner.mjs
CHANGED
|
@@ -58,6 +58,7 @@ const discoveryMethods = [
|
|
|
58
58
|
'Target.attachedToTarget',
|
|
59
59
|
];
|
|
60
60
|
const controlPremises = ['discovered', 'listed', 'attachSession', 'reachable'];
|
|
61
|
+
const unguardedPremises = ['workerAttached', 'workerReachable'];
|
|
61
62
|
const exclusive = ['stockSetup', 'syntheticAutoAttach'];
|
|
62
63
|
|
|
63
64
|
const escapes = /(?:%[0-9a-f]{2})+/gi;
|
|
@@ -278,6 +279,7 @@ export function pickRawTarget(infos, { type, openerId, urlPrefix, known = new Se
|
|
|
278
279
|
}
|
|
279
280
|
const namedResultMs = 10000;
|
|
280
281
|
const observeMs = 5000;
|
|
282
|
+
const reachRetryMs = 250;
|
|
281
283
|
const premises = { chainStarted: 'first hop not observed' };
|
|
282
284
|
|
|
283
285
|
function autoAttachSession(events, start, targetId) {
|
|
@@ -1734,8 +1736,41 @@ class Execution {
|
|
|
1734
1736
|
return reachable;
|
|
1735
1737
|
}
|
|
1736
1738
|
|
|
1739
|
+
async settleReach() {
|
|
1740
|
+
const step = expand(this.probeStep(), this.vars);
|
|
1741
|
+
const bound = this.bound(observeMs);
|
|
1742
|
+
const start = Date.now();
|
|
1743
|
+
let tries = this.calls.probe?.result ? 1 : 0;
|
|
1744
|
+
let reached = this.calls.probe?.result?.reachable === true;
|
|
1745
|
+
const retry = async () => {
|
|
1746
|
+
if (this.clients.flight?.abandoned) return true;
|
|
1747
|
+
tries++;
|
|
1748
|
+
const out = await probeWorkerSessions({
|
|
1749
|
+
client: this.client,
|
|
1750
|
+
sessions: this.probeSessionIds(step),
|
|
1751
|
+
path: expand(step.probeSessions.path, this.vars),
|
|
1752
|
+
tag: this.vars.tag,
|
|
1753
|
+
detached: (sessionId) => this.detached(sessionId),
|
|
1754
|
+
});
|
|
1755
|
+
if (out.reachable) reached = true;
|
|
1756
|
+
return reached;
|
|
1757
|
+
};
|
|
1758
|
+
if (!reached) await waitFor(retry, bound, this.bound(reachRetryMs), true);
|
|
1759
|
+
this.note(
|
|
1760
|
+
`workerReachable: control probe ${reached ? 'reached' : 'missed'}, ${tries} tries, ${Date.now() - start}ms (bound ${bound}ms)`
|
|
1761
|
+
);
|
|
1762
|
+
if (reached)
|
|
1763
|
+
this.calls.probe = {
|
|
1764
|
+
ok: true,
|
|
1765
|
+
result: { ...(this.calls.probe?.result ?? {}), reachable: true },
|
|
1766
|
+
};
|
|
1767
|
+
return reached;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1737
1770
|
async observeProbeReachable(want, check) {
|
|
1738
1771
|
if (want !== true && want !== false) return this.check(check);
|
|
1772
|
+
if (this.side === 'control' && want === true && this.unguardedPremise('workerReachable'))
|
|
1773
|
+
return this.settleReach();
|
|
1739
1774
|
let seen = await this.probeFreshSessions();
|
|
1740
1775
|
if (seen === 'incomplete') return this.side === 'control' ? false : 'incomplete';
|
|
1741
1776
|
if (seen === true) return true;
|
|
@@ -2659,6 +2694,7 @@ class Execution {
|
|
|
2659
2694
|
if (holds === 'incomplete') incomplete.push(name);
|
|
2660
2695
|
}
|
|
2661
2696
|
this.premises(observed);
|
|
2697
|
+
this.unguardedPremises(observed);
|
|
2662
2698
|
this.explicitPremises(observed);
|
|
2663
2699
|
if (this.side === 'control' && excused && !measured) this.incomplete.push('measured nothing');
|
|
2664
2700
|
return { observed, incomplete };
|
|
@@ -2680,6 +2716,23 @@ class Execution {
|
|
|
2680
2716
|
if (want?.[name] === true && observed[name] === false) observed[name] = 'incomplete';
|
|
2681
2717
|
}
|
|
2682
2718
|
|
|
2719
|
+
unguardedPremise(name) {
|
|
2720
|
+
return (
|
|
2721
|
+
this.vector.control.via === 'unguarded' &&
|
|
2722
|
+
this.vector.control.expected?.[name] === true &&
|
|
2723
|
+
this.vector.expected?.[name] === false
|
|
2724
|
+
);
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
unguardedPremises(observed) {
|
|
2728
|
+
if (this.side !== 'control') return;
|
|
2729
|
+
for (const name of unguardedPremises)
|
|
2730
|
+
if (this.unguardedPremise(name) && observed[name] === false) {
|
|
2731
|
+
observed[name] = 'incomplete';
|
|
2732
|
+
this.incomplete.push(`${name}: the unguarded control did not show it`);
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2683
2736
|
async explicitLost() {
|
|
2684
2737
|
if (!this.explicit || !this.vars.rawTarget) return false;
|
|
2685
2738
|
const targetId = this.vars.rawTarget;
|
|
@@ -3341,6 +3394,8 @@ function settleIncomplete(row, vector, base, legs) {
|
|
|
3341
3394
|
});
|
|
3342
3395
|
for (const side of ['control', 'guarded'])
|
|
3343
3396
|
if (legs[side].incomplete?.length && filled[side] === 'pass') row[side] = 'incomplete';
|
|
3397
|
+
if (legs.control.incomplete?.length && row.guarded === 'fail' && filled.guarded === 'pass')
|
|
3398
|
+
row.guarded = 'incomplete';
|
|
3344
3399
|
if (legs.guarded.live === 'incomplete' && filled.live === 'pass') row.live = 'incomplete';
|
|
3345
3400
|
row.why = [filled.why, `incomplete: ${incomplete.join('; ')}`].filter(Boolean).join('; ');
|
|
3346
3401
|
}
|
package/guard-vectors.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"setVersion": "1.
|
|
3
|
+
"setVersion": "1.34.0",
|
|
4
4
|
"sources": [
|
|
5
5
|
{
|
|
6
6
|
"repo": "ai-ecoverse/slicc-cli",
|
|
@@ -33060,7 +33060,7 @@
|
|
|
33060
33060
|
"expected": {
|
|
33061
33061
|
"admitted": true,
|
|
33062
33062
|
"workerExists": true,
|
|
33063
|
-
"workerAttached":
|
|
33063
|
+
"workerAttached": true,
|
|
33064
33064
|
"workerListed": true,
|
|
33065
33065
|
"attachSession": true,
|
|
33066
33066
|
"attachRefused": false,
|
|
@@ -33078,8 +33078,7 @@
|
|
|
33078
33078
|
"workerReachable": false
|
|
33079
33079
|
},
|
|
33080
33080
|
"designDependent": [
|
|
33081
|
-
"attachRefused"
|
|
33082
|
-
"workerAttached"
|
|
33081
|
+
"attachRefused"
|
|
33083
33082
|
]
|
|
33084
33083
|
},
|
|
33085
33084
|
{
|
|
@@ -34439,7 +34438,7 @@
|
|
|
34439
34438
|
"expected": {
|
|
34440
34439
|
"admitted": true,
|
|
34441
34440
|
"workerExists": true,
|
|
34442
|
-
"workerAttached":
|
|
34441
|
+
"workerAttached": true,
|
|
34443
34442
|
"workerListed": true,
|
|
34444
34443
|
"attachSession": true,
|
|
34445
34444
|
"attachRefused": false,
|
|
@@ -34457,8 +34456,7 @@
|
|
|
34457
34456
|
"workerReachable": false
|
|
34458
34457
|
},
|
|
34459
34458
|
"designDependent": [
|
|
34460
|
-
"attachRefused"
|
|
34461
|
-
"workerAttached"
|
|
34459
|
+
"attachRefused"
|
|
34462
34460
|
]
|
|
34463
34461
|
},
|
|
34464
34462
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-browsers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.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",
|
|
@@ -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",
|
|
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",
|
|
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.
|
|
93
|
+
"@ai-ecoverse/slicc-cdp": "2.1.18",
|
|
94
94
|
"@ai-ecoverse/slicc-shared-web": "2.17.0",
|
|
95
95
|
"@biomejs/biome": "2.6.8",
|
|
96
96
|
"ajv": "8.20.0",
|