@ai-ecoverse/slicc-browsers 1.14.7 → 1.14.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
@@ -312,7 +312,7 @@ It exports:
312
312
  - `knownOrigins` and `originDefaults`: the origin names a runner can miss, and the origins `plain`, `cross`, `log` and `own` fall back to when unset;
313
313
  - `parseURL(value, base?)`: a `URL`, or `null` for anything `new URL` rejects or a non-string; every parse of a fixture log entry or a Chrome-reported URL in the runner and the fixture goes through it (`protected.mjs` keeps its own copy, since it imports nothing), so an unparseable entry never throws;
314
314
  - `owned(entries, tag)`: the fixture log entries whose raw URL contains `tag`, the row's attribution through its `n=`, `tag=` or `to=` query;
315
- - `summary({ guard, sha, set, results })`: `set` is the parsed `guard-vectors.json`. It returns `{ set, schemaVersion, guard, sha, variants, targets, transports, results, skipped, notRun, missing, forged, pass, line }`. `missing` lists each `{ id, target, variant, transport }` without a row, for every vector whose `scope` is `any` or the guard, every target it lists, every variant in `variants` or `results`, and every transport in `results`; `pass` needs it empty, where `line` is `GUARD-PASS <guard>@<sha> (vectors @ai-ecoverse/slicc-browsers@X.Y.Z)` or `GUARD-FAIL …`. `forged` lists each `{ id, target, variant, transport, why }` that is `not-run` on a vector that isn't `kind: "text"`, or `skip` without a reason the runner gives (`not-applicable`, `not-applicable:no-<origin>-origin` for an origin in `knownOrigins` that the row's target or vector names, directly or through `originDefaults`, the vector's own `skip.reason` on its target, or `not-supported:<capability>` for a capability the set requires, `browserSession` or `unguarded-observer`); `pass` needs it empty too, and `line` then ends in `forged <n>`.
315
+ - `summary({ guard, sha, set, results })`: `set` is the parsed `guard-vectors.json`. It returns `{ set, schemaVersion, guard, sha, variants, targets, transports, results, skipped, notRun, missing, forged, pass, line }`. `missing` lists each `{ id, target, variant, transport }` without a row, for every vector whose `scope` is `any` or the guard, every target it lists, every variant in `variants` or `results`, and every transport in `results`; `pass` needs it empty, where `line` is `GUARD-PASS <guard>@<sha> (vectors @ai-ecoverse/slicc-browsers@X.Y.Z)` or `GUARD-FAIL …`. `forged` lists each `{ id, target, variant, transport, why }` that is `not-run` on a vector that isn't `kind: "text"`, or `skip` without a reason the runner gives (`not-applicable`, `not-applicable:no-<origin>-origin` for an origin in `knownOrigins` that the row's target, `plain`, the control's origin, the steps or a check names, directly or through `originDefaults`, where only the first branch of an `any` counts, the vector's own `skip.reason` on its target, or `not-supported:<capability>` for a capability the set requires, `browserSession` or `unguarded-observer`); `pass` needs it empty too, and `line` then ends in `forged <n>`.
316
316
 
317
317
  **`npm run validate`** checks that:
318
318
  - the file matches the schema, and ids are unique;
package/guard-driver.mjs CHANGED
@@ -305,14 +305,35 @@ const capabilities = (value) =>
305
305
  )
306
306
  : [];
307
307
 
308
+ const originNames = (value) =>
309
+ [...q(value ?? null).matchAll(/\{([A-Za-z][A-Za-z-]*)\}/g)]
310
+ .map((match) => (match[1] === 'beacon' || match[1] === 'probe' ? 'log' : match[1]))
311
+ .flatMap((name) => [name, originDefaults[name]]);
312
+
313
+ const checkOrigins = (check) => {
314
+ if (!check || typeof check !== 'object') return [];
315
+ if (check.any) return checkOrigins(check.any[0]);
316
+ if (check.all || check.not) return (check.all ?? [check.not]).flatMap(checkOrigins);
317
+ return originNames(check);
318
+ };
319
+
308
320
  function originReason(vector, row, reason) {
309
321
  const origin = /^not-applicable:no-(.+)-origin$/.exec(reason)?.[1];
310
322
  if (!knownOrigins.includes(origin)) return false;
323
+ const fixed = [
324
+ row.target,
325
+ '{plain}',
326
+ vector?.control?.origin,
327
+ vector?.setup,
328
+ vector?.trigger,
329
+ ].map((value) => (typeof value === 'string' && !value.startsWith('{') ? `{${value}}` : value));
311
330
  return [
312
- ...q([`{${row.target}}`, '{plain}', vector ?? null]).matchAll(/\{([A-Za-z][A-Za-z-]*)\}/g),
313
- ]
314
- .map((match) => (match[1] === 'beacon' || match[1] === 'probe' ? 'log' : match[1]))
315
- .some((name) => name === origin || originDefaults[name] === origin);
331
+ ...originNames(fixed),
332
+ ...checkOrigins(vector?.liveCheck),
333
+ ...Object.values(vector?.observe ?? {}).flatMap((observation) =>
334
+ checkOrigins(observation?.check)
335
+ ),
336
+ ].includes(origin);
316
337
  }
317
338
 
318
339
  function skipWhy(vector, row, known) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.14.7",
3
+ "setVersion": "1.14.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.14.7",
3
+ "version": "1.14.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",