@ai-ecoverse/slicc-browsers 1.7.5 → 1.7.6
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 +1 -0
- package/guard-runner.mjs +25 -2
- package/guard-vectors.json +21 -6
- package/package.json +3 -3
- package/schema/guard-vectors.schema.json +24 -0
package/README.md
CHANGED
|
@@ -173,6 +173,7 @@ Any `cdp`, `page` or `children` step can take `requires`, the capabilities it ne
|
|
|
173
173
|
- `{ "children": steps, "where"? }`: run these steps on each target auto-attached from then on, then resume it. `where` scopes them to the row's own target: `{ "openerId": "page" }` (opened by the row's page) or `{ "urlPrefix": url }`; other attached targets are resumed and otherwise left alone.
|
|
174
174
|
- `{ "settle": { "beacon"?, "title"?, "ms"?, "variant"?, "session"? } }`: wait for a beacon from `beacon`, for the page `title`, or for the session to detach. It waits up to `ms` (10000 by default), then another 600 ms. `variant` waits the run's detach variant instead.
|
|
175
175
|
- `{ "wait": ms }`.
|
|
176
|
+
- `{ "paused": { "url", "ms" } }`: wait until the client has seen the pause that an `answer` rule for `url` matches (`Fetch.requestPaused` at the rule's stage, or `Fetch.authRequired` for a `Fetch.continueWithAuth` rule). It waits up to `ms`. On the control leg, a pause that never comes fails the row with `paused: no pause for <url> within <ms>ms`. On the guarded leg the guard may hide that pause, so the step waits the full `ms` and doesn't fail. The C5 guessed-id vectors and `C5.auth` use it before their second request, so the probe's interception id falls between the two ids the guess spans.
|
|
176
177
|
- `{ "guess": { "between", "cdp", "params" }, "as" }`: the call for each request id between the ids paused for the two URLs.
|
|
177
178
|
- `{ "text": … }`: a step in words.
|
|
178
179
|
|
package/guard-runner.mjs
CHANGED
|
@@ -471,14 +471,33 @@ class Execution {
|
|
|
471
471
|
this.pending.push(started);
|
|
472
472
|
}
|
|
473
473
|
|
|
474
|
-
|
|
474
|
+
rule(event) {
|
|
475
475
|
const p = event.params;
|
|
476
|
-
|
|
476
|
+
return this.answers.find(
|
|
477
477
|
(a) =>
|
|
478
478
|
a.url === p.request.url &&
|
|
479
479
|
(!a.stage || (a.stage === 'Response') === Boolean(p.responseStatusCode)) &&
|
|
480
480
|
(a.cdp === 'Fetch.continueWithAuth') === (event.method === 'Fetch.authRequired')
|
|
481
481
|
);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
async paused({ url, ms }) {
|
|
485
|
+
const seen = () =>
|
|
486
|
+
this.client.events
|
|
487
|
+
.slice(this.eventStart)
|
|
488
|
+
.some(
|
|
489
|
+
(event) =>
|
|
490
|
+
(event.method === 'Fetch.requestPaused' || event.method === 'Fetch.authRequired') &&
|
|
491
|
+
event.params?.request?.url === url &&
|
|
492
|
+
this.rule(event)?.url === url
|
|
493
|
+
);
|
|
494
|
+
if (!(await this.poll(seen, ms)) && this.side === 'control')
|
|
495
|
+
this.errors.push(`paused: no pause for ${url} within ${ms}ms`);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
async answer(event) {
|
|
499
|
+
const p = event.params;
|
|
500
|
+
const rule = this.rule(event);
|
|
482
501
|
if (rule?.hold) return;
|
|
483
502
|
const method =
|
|
484
503
|
rule?.cdp ??
|
|
@@ -570,6 +589,10 @@ class Execution {
|
|
|
570
589
|
await sleep(step.wait);
|
|
571
590
|
return;
|
|
572
591
|
}
|
|
592
|
+
if (step.paused) {
|
|
593
|
+
await this.paused(step.paused);
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
573
596
|
if (step.settle) {
|
|
574
597
|
await this.settle(step.settle);
|
|
575
598
|
return;
|
package/guard-vectors.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"setVersion": "1.7.
|
|
3
|
+
"setVersion": "1.7.6",
|
|
4
4
|
"sources": [
|
|
5
5
|
{
|
|
6
6
|
"repo": "ai-ecoverse/slicc-cli",
|
|
@@ -6811,7 +6811,10 @@
|
|
|
6811
6811
|
"background": true
|
|
6812
6812
|
},
|
|
6813
6813
|
{
|
|
6814
|
-
"
|
|
6814
|
+
"paused": {
|
|
6815
|
+
"url": "{target}/auth/{tag}?n={tag}",
|
|
6816
|
+
"ms": 5000
|
|
6817
|
+
}
|
|
6815
6818
|
},
|
|
6816
6819
|
{
|
|
6817
6820
|
"page": "fetch",
|
|
@@ -6949,7 +6952,10 @@
|
|
|
6949
6952
|
"as": "body"
|
|
6950
6953
|
},
|
|
6951
6954
|
{
|
|
6952
|
-
"
|
|
6955
|
+
"paused": {
|
|
6956
|
+
"url": "{target}/data?n={tag}",
|
|
6957
|
+
"ms": 5000
|
|
6958
|
+
}
|
|
6953
6959
|
},
|
|
6954
6960
|
{
|
|
6955
6961
|
"page": "fetch",
|
|
@@ -7120,7 +7126,10 @@
|
|
|
7120
7126
|
"as": "body"
|
|
7121
7127
|
},
|
|
7122
7128
|
{
|
|
7123
|
-
"
|
|
7129
|
+
"paused": {
|
|
7130
|
+
"url": "{target}/data?n={tag}",
|
|
7131
|
+
"ms": 5000
|
|
7132
|
+
}
|
|
7124
7133
|
},
|
|
7125
7134
|
{
|
|
7126
7135
|
"page": "fetch",
|
|
@@ -7280,7 +7289,10 @@
|
|
|
7280
7289
|
"status": true
|
|
7281
7290
|
},
|
|
7282
7291
|
{
|
|
7283
|
-
"
|
|
7292
|
+
"paused": {
|
|
7293
|
+
"url": "{target}/data?n={tag}",
|
|
7294
|
+
"ms": 5000
|
|
7295
|
+
}
|
|
7284
7296
|
},
|
|
7285
7297
|
{
|
|
7286
7298
|
"page": "fetch",
|
|
@@ -7465,7 +7477,10 @@
|
|
|
7465
7477
|
"status": true
|
|
7466
7478
|
},
|
|
7467
7479
|
{
|
|
7468
|
-
"
|
|
7480
|
+
"paused": {
|
|
7481
|
+
"url": "{target}/auth/{tag}?n={tag}",
|
|
7482
|
+
"ms": 5000
|
|
7483
|
+
}
|
|
7469
7484
|
},
|
|
7470
7485
|
{
|
|
7471
7486
|
"page": "fetch",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-browsers",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"trust:dry": "npx fledgling sync --dry-run -y --skip-publish",
|
|
66
66
|
"release": "semantic-release",
|
|
67
67
|
"test:guard": "npm run test:guard-integration && npm run test:guard-sweep",
|
|
68
|
-
"test:guard-integration": "node --test 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",
|
|
68
|
+
"test:guard-integration": "node --test 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",
|
|
69
69
|
"test:guard-sweep": "node scripts/test-guards.mjs",
|
|
70
70
|
"test:guard-target": "node --test test/integration/guard-runner.test.mjs",
|
|
71
71
|
"test:unit:guard": "node --experimental-test-coverage --test --test-coverage-include=guard-runner.mjs --test-coverage-include=fixture-server.mjs --test-coverage-lines=100 test/unit/guard-*.test.mjs"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@ai-ecoverse/slicc-shared-web": "1.
|
|
74
|
+
"@ai-ecoverse/slicc-shared-web": "1.23.0",
|
|
75
75
|
"@biomejs/biome": "2.5.15",
|
|
76
76
|
"ajv": "8.20.0",
|
|
77
77
|
"ajv-formats": "3.0.1",
|
|
@@ -616,6 +616,30 @@
|
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
},
|
|
619
|
+
{
|
|
620
|
+
"type": "object",
|
|
621
|
+
"additionalProperties": false,
|
|
622
|
+
"required": ["paused"],
|
|
623
|
+
"properties": {
|
|
624
|
+
"paused": {
|
|
625
|
+
"type": "object",
|
|
626
|
+
"additionalProperties": false,
|
|
627
|
+
"required": ["url", "ms"],
|
|
628
|
+
"properties": {
|
|
629
|
+
"url": {
|
|
630
|
+
"type": "string"
|
|
631
|
+
},
|
|
632
|
+
"ms": {
|
|
633
|
+
"type": "integer",
|
|
634
|
+
"minimum": 1
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"on": {
|
|
639
|
+
"$ref": "#/$defs/on"
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
},
|
|
619
643
|
{
|
|
620
644
|
"type": "object",
|
|
621
645
|
"additionalProperties": false,
|