@ai-ecoverse/slicc-browsers 1.7.8 → 1.7.10

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
@@ -171,7 +171,7 @@ Any `cdp`, `page` or `children` step can take `requires`, the capabilities it ne
171
171
  `hops` routes `url` through `/hop` on each `origin`, with its `code`.
172
172
  - `{ "answer": { "url", "stage"?, "cdp"?, "params"?, "hold"? } }`: answer each paused request or auth challenge for `url` with that call; `hold` leaves it paused. Every other paused request continues unchanged.
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
- - `{ "settle": { "beacon"?, "served"?, "title"?, "ms"?, "variant"?, "session"? } }`: wait for a beacon from `beacon`, for the fixture to log a request for the URL `served`, 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.
174
+ - `{ "settle": { "beacon"?, "served"?, "title"?, "ms"?, "variant"?, "session"?, "dependsOn"?, "or"? } }`: wait for a beacon from `beacon`, for the fixture to log a request for the URL `served`, for the page `title`, or for the session to detach. When a refusal in `dependsOn` was recorded, the beacon can't come: a settle with `or` (a check) then waits until `or` holds, and one without it is skipped. Without such a refusal, `or` plays no part. Each beacon settle after an init script depends on that script's registration, and its `or` is what the row reads: the hops and the destination for the redirect chains, or the served page otherwise. 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
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.
177
177
  - `{ "guess": { "between", "cdp", "params" }, "as" }`: the call for each request id between the ids paused for the two URLs.
@@ -513,6 +513,7 @@ for case in corpus().cases {
513
513
  Go 1.26, Rust stable with `wasm32-wasip1`, Node ≥ 24.
514
514
  - `npm run corpus` regenerates `corpus.json` from `corpus/`; the pre-commit hook and CI fail when it's stale.
515
515
  - `npm run validate` checks `catalog.json`, `corpus.json`, `protected.json` and `guard-vectors.json` against the schemas, runs the protected-origin vectors through `protected.mjs`, and checks what a schema can't say: unique ids, bundle ids and names, known Windows roots, rising tiers, compiling patterns, known tokens, tier order, `sevenOpen`, `tabs` (which holds no entry of `sevenTabs`), `six` and `auto` in each `expected.json`, and no port from 9222 to 9229.
516
+ - Every gate prints one verdict line when it passes: `validate: PASS …`, `corpus: PASS <n> cases` (`node scripts/corpus.mjs --check`), `major-guard: PASS v<version> fits <module>`, and `guard-sweep: PASS 5 targets` (`npm run test:guard-sweep`). CI runs each through `scripts/gate.mjs --expect <regex> -- <command>`, which fails when the command exits non-zero or prints no matching line, so a silent or early exit never reads as a pass. `gate.mjs --expect <regex> --in <file>` checks a log instead; the release job uses it on semantic-release's log for the major-guard line. `npm run test:gates` tests the gates, including runs through a symlinked checkout and a symlinked script.
516
517
  - `npm run lint`: the slicc lint tools (Biome, no comments, no unit tests in git, `AGENTS.md`), `gofmt`, `go mod tidy -diff`, `go vet`, golangci-lint, `cargo fmt --check` and clippy.
517
518
  - `npm test`: `validate`, the Go tests in `test/integration/`, and `cargo test --all-features`.
518
519
  - `npm run build`: the Go module, the crate (also for `wasm32-wasip1`), and `npm pack --dry-run`.
package/guard-runner.mjs CHANGED
@@ -635,14 +635,15 @@ class Execution {
635
635
  `settle:skipped-refused ${settle.beacon ? `beacon ${settle.beacon}` : settle.served ? `request ${settle.served}` : settle.title ? `title ${settle.title}` : 'load'}`
636
636
  );
637
637
  };
638
- if (refused()) return skipped();
638
+ const alt = settle.or;
639
+ if (refused() && !alt) return skipped();
639
640
  if (settle.variant) await sleep(this.delay);
640
641
  if (settle.title && !this.reader) {
641
642
  await sleep(settle.ms ?? 1500);
642
643
  return;
643
644
  }
644
645
  const met = await this.poll(async () => {
645
- if (refused()) return true;
646
+ if (refused()) return !alt || (await this.check(alt));
646
647
  if (settle.served) return this.requestCheck({ served: settle.served, tagged: false });
647
648
  if (settle.beacon)
648
649
  return (
@@ -661,7 +662,7 @@ class Execution {
661
662
  .some((e) => e.method === 'Page.loadEventFired' && e.sessionId === event.sessionId)
662
663
  );
663
664
  }, settle.ms ?? 1500);
664
- if (refused()) return skipped();
665
+ if (refused() && !alt) return skipped();
665
666
  if (settle.required && !met)
666
667
  this.errors.push(
667
668
  `settle: no ${settle.beacon ? `beacon from ${settle.beacon}` : settle.served ? `request for ${settle.served}` : settle.title ? `title ${settle.title}` : 'load'} within ${settle.ms ?? 1500}ms`
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.7.8",
3
+ "setVersion": "1.7.10",
4
4
  "sources": [
5
5
  {
6
6
  "repo": "ai-ecoverse/slicc-cli",
@@ -138,7 +138,12 @@
138
138
  },
139
139
  {
140
140
  "settle": {
141
- "beacon": "{target}"
141
+ "beacon": "{target}",
142
+ "dependsOn": ["refused.3"],
143
+ "or": {
144
+ "served": "{target}/doc?n={tag}",
145
+ "observer": "fixture"
146
+ }
142
147
  }
143
148
  }
144
149
  ],
@@ -362,7 +367,36 @@
362
367
  },
363
368
  {
364
369
  "settle": {
365
- "beacon": "{target}"
370
+ "beacon": "{target}",
371
+ "dependsOn": ["refused.3"],
372
+ "ms": 5000,
373
+ "or": {
374
+ "all": [
375
+ {
376
+ "hops": [
377
+ {
378
+ "origin": "{ordinary}",
379
+ "code": 301
380
+ },
381
+ {
382
+ "origin": "{cross}",
383
+ "code": 302
384
+ },
385
+ {
386
+ "origin": "{ordinary}",
387
+ "code": 303
388
+ }
389
+ ],
390
+ "to": "{target}/doc?n={tag}",
391
+ "observer": "fixture"
392
+ },
393
+ {
394
+ "served": "{target}/doc?n={tag}",
395
+ "observer": "fixture"
396
+ }
397
+ ],
398
+ "observer": "client"
399
+ }
366
400
  }
367
401
  }
368
402
  ],
@@ -981,7 +1015,36 @@
981
1015
  },
982
1016
  {
983
1017
  "settle": {
984
- "beacon": "{target}"
1018
+ "beacon": "{target}",
1019
+ "dependsOn": ["refused.3"],
1020
+ "ms": 5000,
1021
+ "or": {
1022
+ "all": [
1023
+ {
1024
+ "hops": [
1025
+ {
1026
+ "origin": "{ordinary}",
1027
+ "code": 307
1028
+ },
1029
+ {
1030
+ "origin": "{cross}",
1031
+ "code": 308
1032
+ },
1033
+ {
1034
+ "origin": "{ordinary}",
1035
+ "code": 302
1036
+ }
1037
+ ],
1038
+ "to": "{target}/doc?n={tag}",
1039
+ "observer": "fixture"
1040
+ },
1041
+ {
1042
+ "served": "{target}/doc?n={tag}",
1043
+ "observer": "fixture"
1044
+ }
1045
+ ],
1046
+ "observer": "client"
1047
+ }
985
1048
  }
986
1049
  }
987
1050
  ],
@@ -1600,7 +1663,36 @@
1600
1663
  },
1601
1664
  {
1602
1665
  "settle": {
1603
- "beacon": "{target}"
1666
+ "beacon": "{target}",
1667
+ "dependsOn": ["refused.3"],
1668
+ "ms": 5000,
1669
+ "or": {
1670
+ "all": [
1671
+ {
1672
+ "hops": [
1673
+ {
1674
+ "origin": "{cross}",
1675
+ "code": 303
1676
+ },
1677
+ {
1678
+ "origin": "{ordinary}",
1679
+ "code": 301
1680
+ },
1681
+ {
1682
+ "origin": "{cross}",
1683
+ "code": 308
1684
+ }
1685
+ ],
1686
+ "to": "{target}/doc?n={tag}",
1687
+ "observer": "fixture"
1688
+ },
1689
+ {
1690
+ "served": "{target}/doc?n={tag}",
1691
+ "observer": "fixture"
1692
+ }
1693
+ ],
1694
+ "observer": "client"
1695
+ }
1604
1696
  }
1605
1697
  }
1606
1698
  ],
@@ -2215,7 +2307,32 @@
2215
2307
  },
2216
2308
  {
2217
2309
  "settle": {
2218
- "beacon": "{target}"
2310
+ "beacon": "{target}",
2311
+ "dependsOn": ["refused.3"],
2312
+ "ms": 5000,
2313
+ "or": {
2314
+ "all": [
2315
+ {
2316
+ "hops": [
2317
+ {
2318
+ "origin": "{ordinary}",
2319
+ "code": 307
2320
+ },
2321
+ {
2322
+ "origin": "{cross}",
2323
+ "code": 308
2324
+ }
2325
+ ],
2326
+ "to": "{target}/doc?n={tag}",
2327
+ "observer": "fixture"
2328
+ },
2329
+ {
2330
+ "served": "{target}/doc?n={tag}",
2331
+ "observer": "fixture"
2332
+ }
2333
+ ],
2334
+ "observer": "client"
2335
+ }
2219
2336
  }
2220
2337
  }
2221
2338
  ],
@@ -2662,7 +2779,32 @@
2662
2779
  },
2663
2780
  {
2664
2781
  "settle": {
2665
- "beacon": "{target}"
2782
+ "beacon": "{target}",
2783
+ "dependsOn": ["refused.3"],
2784
+ "ms": 5000,
2785
+ "or": {
2786
+ "all": [
2787
+ {
2788
+ "hops": [
2789
+ {
2790
+ "origin": "{cross}",
2791
+ "code": 308
2792
+ },
2793
+ {
2794
+ "origin": "{ordinary}",
2795
+ "code": 307
2796
+ }
2797
+ ],
2798
+ "to": "{target}/doc?n={tag}",
2799
+ "observer": "fixture"
2800
+ },
2801
+ {
2802
+ "served": "{target}/doc?n={tag}",
2803
+ "observer": "fixture"
2804
+ }
2805
+ ],
2806
+ "observer": "client"
2807
+ }
2666
2808
  }
2667
2809
  }
2668
2810
  ],
@@ -3109,7 +3251,12 @@
3109
3251
  },
3110
3252
  {
3111
3253
  "settle": {
3112
- "beacon": "{cross}"
3254
+ "beacon": "{cross}",
3255
+ "dependsOn": ["refused.3"],
3256
+ "or": {
3257
+ "served": "{cross}/doc?n={tag}-after",
3258
+ "observer": "fixture"
3259
+ }
3113
3260
  }
3114
3261
  }
3115
3262
  ],
@@ -3560,7 +3707,12 @@
3560
3707
  },
3561
3708
  {
3562
3709
  "settle": {
3563
- "beacon": "{cross}"
3710
+ "beacon": "{cross}",
3711
+ "dependsOn": ["refused.3"],
3712
+ "or": {
3713
+ "served": "{cross}/doc?n={tag}-after",
3714
+ "observer": "fixture"
3715
+ }
3564
3716
  }
3565
3717
  }
3566
3718
  ],
@@ -4034,7 +4186,12 @@
4034
4186
  {
4035
4187
  "settle": {
4036
4188
  "beacon": "{target}",
4037
- "session": "child"
4189
+ "session": "child",
4190
+ "dependsOn": ["refused.2", "refused.5"],
4191
+ "or": {
4192
+ "served": "{target}/doc?n={tag}",
4193
+ "observer": "fixture"
4194
+ }
4038
4195
  }
4039
4196
  },
4040
4197
  {
@@ -4282,7 +4439,12 @@
4282
4439
  {
4283
4440
  "settle": {
4284
4441
  "beacon": "{target}",
4285
- "ms": 5000
4442
+ "ms": 5000,
4443
+ "dependsOn": ["refused.2", "refused.5"],
4444
+ "or": {
4445
+ "served": "{target}/doc?n={tag}",
4446
+ "observer": "fixture"
4447
+ }
4286
4448
  }
4287
4449
  },
4288
4450
  {
@@ -4528,7 +4690,12 @@
4528
4690
  {
4529
4691
  "settle": {
4530
4692
  "beacon": "{target}",
4531
- "ms": 5000
4693
+ "ms": 5000,
4694
+ "dependsOn": ["refused.2", "refused.5"],
4695
+ "or": {
4696
+ "served": "{target}/doc?n={tag}",
4697
+ "observer": "fixture"
4698
+ }
4532
4699
  }
4533
4700
  },
4534
4701
  {
@@ -5204,7 +5371,12 @@
5204
5371
  {
5205
5372
  "settle": {
5206
5373
  "beacon": "{target}",
5207
- "ms": 4000
5374
+ "ms": 4000,
5375
+ "dependsOn": ["refused.3", "refused.7", "refused.8"],
5376
+ "or": {
5377
+ "served": "{target}/doc?n={tag}",
5378
+ "observer": "fixture"
5379
+ }
5208
5380
  }
5209
5381
  },
5210
5382
  {
@@ -5446,7 +5618,12 @@
5446
5618
  {
5447
5619
  "settle": {
5448
5620
  "beacon": "{target}",
5449
- "ms": 4000
5621
+ "ms": 4000,
5622
+ "dependsOn": ["refused.3", "refused.7", "refused.8"],
5623
+ "or": {
5624
+ "served": "{target}/doc?n={tag}",
5625
+ "observer": "fixture"
5626
+ }
5450
5627
  }
5451
5628
  },
5452
5629
  {
@@ -5685,7 +5862,12 @@
5685
5862
  {
5686
5863
  "settle": {
5687
5864
  "beacon": "{target}",
5688
- "ms": 4000
5865
+ "ms": 4000,
5866
+ "dependsOn": ["refused.3"],
5867
+ "or": {
5868
+ "served": "{target}/doc?n={tag}",
5869
+ "observer": "fixture"
5870
+ }
5689
5871
  }
5690
5872
  },
5691
5873
  {
@@ -5930,7 +6112,12 @@
5930
6112
  {
5931
6113
  "settle": {
5932
6114
  "beacon": "{target}",
5933
- "ms": 4000
6115
+ "ms": 4000,
6116
+ "dependsOn": ["refused.3"],
6117
+ "or": {
6118
+ "served": "{target}/doc?n={tag}",
6119
+ "observer": "fixture"
6120
+ }
5934
6121
  }
5935
6122
  },
5936
6123
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.7.8",
3
+ "version": "1.7.10",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -67,11 +67,12 @@
67
67
  "test:guard": "npm run test:guard-integration && npm run test:guard-sweep",
68
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 test/integration/guard-legs.test.mjs test/integration/guard-diagnostics.test.mjs",
69
69
  "test:guard-sweep": "node scripts/test-guards.mjs",
70
+ "test:gates": "node --test test/integration/gates.test.mjs",
70
71
  "test:guard-target": "node --test test/integration/guard-runner.test.mjs",
71
72
  "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
73
  },
73
74
  "devDependencies": {
74
- "@ai-ecoverse/slicc-shared-web": "1.23.1",
75
+ "@ai-ecoverse/slicc-shared-web": "1.23.2",
75
76
  "@biomejs/biome": "2.5.15",
76
77
  "ajv": "8.20.0",
77
78
  "ajv-formats": "3.0.1",
@@ -585,6 +585,9 @@
585
585
  "served": {
586
586
  "type": "string"
587
587
  },
588
+ "or": {
589
+ "$ref": "#/$defs/check"
590
+ },
588
591
  "title": {
589
592
  "type": "string"
590
593
  },