@ai-ecoverse/slicc-browsers 1.29.0 → 1.30.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/README.md CHANGED
@@ -243,6 +243,7 @@ You supply:
243
243
  | `siteIsolationOff`, `inboundDelay`, `forwardAudit` | no site isolation; hold inbound; audit forwarded commands |
244
244
  | `secureOrigin` | HTTPS origins (service workers) |
245
245
  | `stockSetup`, `syntheticAutoAttach` | admit stock clients' setup calls; synthesize auto-attach |
246
+ | `explicitAttach` | attach only explicitly (no init-script check on a popup's first document) |
246
247
  | `closeProtected` | close a protected tab, except live vault/seven-UI disguises |
247
248
  | `signInHold` | hold seven's sign-in popups and hide callback-only authorize tabs (incl. callback-origin) without over-blocking ordinary ones |
248
249
  | `jsonList` | expose `/json/list` (`client.jsonList` / `devtoolsHttp`); missing → not-supported, or incomplete if declared |
package/cookie-plant.mjs CHANGED
@@ -450,7 +450,7 @@ async function continueItselfEvidence({ fixtureLog, url, since, tag, proofTag, c
450
450
  const planted = plantedOf(
451
451
  jar?.error?.message?.includes('timeout') ? { incomplete: 'cookie jar unreadable' } : jar
452
452
  );
453
- return { fixtureHits: hits, planted };
453
+ return { fixtureHits: hits, planted, jar };
454
454
  }
455
455
 
456
456
  async function pollHandleEvidence({
@@ -506,6 +506,7 @@ async function waitPauseOrBlocked({
506
506
  let probedRefusal = false;
507
507
  let fixtureHits = null;
508
508
  let planted = null;
509
+ let jar = null;
509
510
  const quietMs = Math.min(150, Math.max(50, Math.floor(pauseMs / 16)));
510
511
  const since = triggerSentAt ?? Date.now();
511
512
  const triggerDone = Promise.resolve(triggerPromise).then(
@@ -527,6 +528,7 @@ async function waitPauseOrBlocked({
527
528
  early,
528
529
  fixtureHits,
529
530
  planted,
531
+ jar,
530
532
  });
531
533
  const finish = async (paused, early, opts = {}) => {
532
534
  href = (await readTabHref({ reader, pageTarget })) ?? href;
@@ -568,6 +570,7 @@ async function waitPauseOrBlocked({
568
570
  if (polled.bios) {
569
571
  fixtureHits = polled.bios.fixtureHits;
570
572
  planted = polled.bios.planted;
573
+ jar = polled.bios.jar ?? null;
571
574
  return finish(null, true, { skipRefusalProbe: true, skipQuiet: true });
572
575
  }
573
576
  if (polled.postTriggerRefusal) {
@@ -616,6 +619,7 @@ async function evidenceAfterTrigger({
616
619
  page: { href: cached.href, ready: true },
617
620
  fixtureHits: cached.fixtureHits,
618
621
  planted: cached.planted,
622
+ jar: cached.jar ?? null,
619
623
  afterTriggerAt: cached.afterTriggerAt,
620
624
  };
621
625
  }
@@ -631,8 +635,9 @@ async function evidenceAfterTrigger({
631
635
  href: page.href ?? hrefHint ?? null,
632
636
  fixtureHits,
633
637
  planted,
638
+ jar,
634
639
  };
635
- return { page, fixtureHits, planted, afterTriggerAt };
640
+ return { page, fixtureHits, planted, jar, afterTriggerAt };
636
641
  }
637
642
 
638
643
  function storageContextParams(browserContextId) {
@@ -808,13 +813,47 @@ async function readJar(handle, { name, domain, value, path }, { urlHints = [] }
808
813
  return { via: view.via, missing: true, cookies: view.cookies };
809
814
  }
810
815
 
816
+ function jarAuditFields(handle, jar) {
817
+ if (!jar) return { jarRead: false };
818
+ const canaryName = handle?.canary?.name ?? jar.canaryName ?? null;
819
+ const browserContextId =
820
+ handle && Object.prototype.hasOwnProperty.call(handle, 'browserContextId')
821
+ ? (handle.browserContextId ?? null)
822
+ : (jar.browserContextId ?? null);
823
+ const canaryVisible =
824
+ jar.canaryOk === true
825
+ ? true
826
+ : jar.canaryMissing === true || jar.canaryVisible === false
827
+ ? false
828
+ : Boolean(jar.canaryVisible);
829
+ return {
830
+ jarRead: true,
831
+ canaryName,
832
+ canaryVisible,
833
+ via: jar.via ?? null,
834
+ browserContextId,
835
+ };
836
+ }
837
+
838
+ function evidenceFormOf({ answered, refused, planted }) {
839
+ if (answered !== true) return null;
840
+ if (refused === true && planted === false) return 'commandRefused';
841
+ if (refused === false && planted === true) return 'allowedPlant';
842
+ if (refused === false && planted === false) return 'answeredNotPlanted';
843
+ return null;
844
+ }
845
+
811
846
  async function readJarWithCanary(handle, cookie) {
812
847
  requireAttemptHandle(handle, 'readJarWithCanary');
813
848
  const canary = handle.canary;
814
849
  if (!canary) throw new Error('cookie-plant.readJarWithCanary: handle.canary required');
815
850
  const urlHints = jarUrlHints(cookie, canary);
816
851
  const jar = await readJar(handle, cookie, { urlHints });
817
- if (jar?.incomplete) return jar;
852
+ const audit = {
853
+ canaryName: canary.name,
854
+ browserContextId: handle.browserContextId ?? null,
855
+ };
856
+ if (jar?.incomplete) return { ...jar, ...audit, canaryVisible: false };
818
857
  const canaryHit = (jar.cookies ?? []).some((entry) =>
819
858
  jarCookieMatch(entry, {
820
859
  name: canary.name,
@@ -824,8 +863,14 @@ async function readJarWithCanary(handle, cookie) {
824
863
  })
825
864
  );
826
865
  if (!canaryHit)
827
- return { incomplete: 'jar view canary absent', via: jar?.via, canaryMissing: true };
828
- return { ...jar, canaryOk: true };
866
+ return {
867
+ incomplete: 'jar view canary absent',
868
+ via: jar?.via,
869
+ canaryMissing: true,
870
+ canaryVisible: false,
871
+ ...audit,
872
+ };
873
+ return { ...jar, canaryOk: true, canaryVisible: true, ...audit };
829
874
  }
830
875
 
831
876
  function plantedOf(jar) {
@@ -1195,7 +1240,11 @@ async function finishPlant({ out, cookie, notes, label, handle }) {
1195
1240
  requireAttemptHandle(handle, 'finishPlant');
1196
1241
  const unknown = jarContextIncomplete(handle);
1197
1242
  if (unknown) {
1198
- note(notes, `cookie-plant.${label}`, { ...unknown, ...timingOf(handle) });
1243
+ note(notes, `cookie-plant.${label}`, {
1244
+ ...unknown,
1245
+ jarRead: false,
1246
+ ...timingOf(handle),
1247
+ });
1199
1248
  return attemptRecord(out, 'incomplete');
1200
1249
  }
1201
1250
  const jar = await capped(readJarWithCanary(handle, cookie), 1500, 'readJar');
@@ -1206,10 +1255,18 @@ async function finishPlant({ out, cookie, notes, label, handle }) {
1206
1255
  answered: answered(out),
1207
1256
  refused: refused(out),
1208
1257
  planted,
1209
- via: jar?.via,
1210
1258
  jarIncomplete: jar?.incomplete,
1259
+ ...jarAuditFields(handle, jar),
1211
1260
  ...timingOf(handle),
1212
1261
  };
1262
+ if (handle.credential) {
1263
+ const form = evidenceFormOf({
1264
+ answered: evidence.answered,
1265
+ refused: evidence.refused,
1266
+ planted,
1267
+ });
1268
+ if (form) evidence.evidenceForm = form;
1269
+ }
1213
1270
  note(notes, `cookie-plant.${label}`, evidence);
1214
1271
  return attemptRecord(out, planted);
1215
1272
  }
@@ -1387,6 +1444,7 @@ function scoreProtectedPlant({
1387
1444
  rawDoor = null,
1388
1445
  plantSurfaceRefused = false,
1389
1446
  readerBlocked = false,
1447
+ jar = null,
1390
1448
  }) {
1391
1449
  const signals = protectedPlantSignals({
1392
1450
  pauseCount,
@@ -1437,6 +1495,7 @@ function scoreProtectedPlant({
1437
1495
  rawIncomplete: Boolean(rawDoor.incomplete),
1438
1496
  }
1439
1497
  : {}),
1498
+ ...jarAuditFields(handle, jar),
1440
1499
  ...timingOf(handle),
1441
1500
  };
1442
1501
  const early = scoreRawOrDoorBranch({
@@ -1774,6 +1833,7 @@ async function scoreDoorAbsentPause({
1774
1833
  fetchEnableOk,
1775
1834
  doorAbsent: true,
1776
1835
  rawDoor,
1836
+ jar,
1777
1837
  })
1778
1838
  );
1779
1839
  }
@@ -1828,6 +1888,7 @@ async function scorePausedGuardedPlant(args) {
1828
1888
  fetchEnableOk,
1829
1889
  doorAbsent,
1830
1890
  rawDoor,
1891
+ jar,
1831
1892
  })
1832
1893
  );
1833
1894
  }
@@ -1876,6 +1937,7 @@ async function scorePausedGuardedPlant(args) {
1876
1937
  fetchEnableOk,
1877
1938
  doorAbsent,
1878
1939
  rawDoor,
1940
+ jar,
1879
1941
  })
1880
1942
  );
1881
1943
  }
@@ -1908,6 +1970,7 @@ async function scorePausedGuardedPlant(args) {
1908
1970
  fetchEnableOk,
1909
1971
  doorAbsent,
1910
1972
  rawDoor,
1973
+ jar: evidence.jar ?? jar,
1911
1974
  })
1912
1975
  );
1913
1976
  }
@@ -1947,6 +2010,7 @@ async function scoreUnpausedGuardedPlant(args) {
1947
2010
  page: { href: waited.href ?? null, ready: true },
1948
2011
  fixtureHits: waited.fixtureHits,
1949
2012
  planted: waited.planted,
2013
+ jar: waited.jar ?? null,
1950
2014
  afterTriggerAt: Date.now(),
1951
2015
  }
1952
2016
  : await evidenceAfterTrigger({
@@ -1988,6 +2052,7 @@ async function scoreUnpausedGuardedPlant(args) {
1988
2052
  doorAbsent,
1989
2053
  rawDoor,
1990
2054
  readerBlocked,
2055
+ jar: evidence.jar ?? null,
1991
2056
  })
1992
2057
  );
1993
2058
  }
@@ -2033,6 +2098,7 @@ async function runGuardedProtectedPlantBody({
2033
2098
  doorAbsent,
2034
2099
  rawDoor,
2035
2100
  plantSurfaceRefused: true,
2101
+ jar,
2036
2102
  });
2037
2103
  }
2038
2104
  if (!handle.pageSession) {
@@ -2404,9 +2470,8 @@ async function proveDoor({
2404
2470
  note(notes, 'cookie-plant.door', {
2405
2471
  answered: answered(out),
2406
2472
  planted,
2407
- via: jar?.via,
2408
2473
  domain,
2409
- browserContextId,
2474
+ ...jarAuditFields(jarHandle, jar),
2410
2475
  });
2411
2476
  await capped(clearCookie(jarHandle, cookie), 800, 'door-clear');
2412
2477
  if (!answered(out))
@@ -2597,6 +2662,7 @@ async function withFreshAttemptTab(ctx, run) {
2597
2662
  browserContextId: tabContextId,
2598
2663
  browserContexts: Boolean(ctx.browserContexts),
2599
2664
  canary,
2665
+ credential: Boolean(ctx.credential),
2600
2666
  transport: enabled.transport,
2601
2667
  fetchEnable: enabled.fetchEnable ?? null,
2602
2668
  internalSessions,
@@ -3018,7 +3084,7 @@ async function observeRawPlantSend({
3018
3084
  timedOut,
3019
3085
  doorPresent: false,
3020
3086
  incomplete: jar?.canaryMissing ? 'jar view canary absent' : 'cookie jar unreadable',
3021
- browserContextId,
3087
+ ...jarAuditFields(jarHandle, jar),
3022
3088
  },
3023
3089
  'raw leg incomplete',
3024
3090
  handle,
@@ -3036,16 +3102,17 @@ async function observeRawPlantSend({
3036
3102
  doorPresent,
3037
3103
  browserContextId,
3038
3104
  };
3105
+ const audited = { ...raw, ...jarAuditFields(jarHandle, jar) };
3039
3106
  noteRawDoor(
3040
3107
  notes,
3041
3108
  label,
3042
- { ...raw, via: jar?.via },
3109
+ audited,
3043
3110
  doorPresent ? 'raw leg planted: plant path' : 'door not present on this browser',
3044
3111
  handle,
3045
3112
  pathStartedAt
3046
3113
  );
3047
3114
  await capped(clearCookie(jarHandle, cookie), 800, 'raw-clear');
3048
- return raw;
3115
+ return audited;
3049
3116
  }
3050
3117
 
3051
3118
  async function measureRawDoor(ctx, spec) {
@@ -3575,6 +3642,12 @@ function controlAttacks(ctx) {
3575
3642
  return incompleteDeletion(
3576
3643
  seeded?.incomplete ? 'seed jar unreadable' : 'seed missing exact name+domain+path'
3577
3644
  );
3645
+ const seedJar = await capped(readJarWithCanary(handle, deleteOnOrdinary), 1500, 'readJar');
3646
+ note(ctx.notes, 'cookie-plant.deletion.seed', {
3647
+ seeded: true,
3648
+ ...jarAuditFields(handle, seedJar),
3649
+ ...timingOf(handle),
3650
+ });
3578
3651
  const attempt = await allowedHeaderAttempt({
3579
3652
  ...diag(handle),
3580
3653
  url: ordinaryUrl,
@@ -3588,6 +3661,7 @@ function controlAttacks(ctx) {
3588
3661
  note(ctx.notes, 'cookie-plant.deletion.cleared', {
3589
3662
  cleared: 'incomplete',
3590
3663
  incomplete: 'delete attempt incomplete',
3664
+ jarRead: false,
3591
3665
  browserContextId,
3592
3666
  ...timingOf(handle),
3593
3667
  });
@@ -3603,7 +3677,7 @@ function controlAttacks(ctx) {
3603
3677
  note(ctx.notes, 'cookie-plant.deletion.cleared', {
3604
3678
  cleared: 'incomplete',
3605
3679
  incomplete: 'after jar unreadable',
3606
- browserContextId,
3680
+ ...jarAuditFields(handle, after),
3607
3681
  ...timingOf(handle),
3608
3682
  });
3609
3683
  return { ...attempt, cleared: 'incomplete' };
@@ -3611,9 +3685,8 @@ function controlAttacks(ctx) {
3611
3685
  const cleared = afterPlanted === false;
3612
3686
  note(ctx.notes, 'cookie-plant.deletion.cleared', {
3613
3687
  cleared,
3614
- via: after?.via,
3615
- browserContextId,
3616
3688
  seedVia: seeded?.via,
3689
+ ...jarAuditFields(handle, after),
3617
3690
  ...timingOf(handle),
3618
3691
  });
3619
3692
  return { ...attempt, cleared };
@@ -3999,6 +4072,11 @@ async function proveDoorOnOwnTab({
3999
4072
  answered: raw.answered,
4000
4073
  planted: raw.planted,
4001
4074
  domain,
4075
+ jarRead: raw.jarRead ?? false,
4076
+ canaryName: raw.canaryName ?? null,
4077
+ canaryVisible: raw.canaryVisible,
4078
+ via: raw.via ?? null,
4079
+ browserContextId: raw.browserContextId ?? null,
4002
4080
  });
4003
4081
  return { live: true };
4004
4082
  }
@@ -4260,6 +4338,8 @@ export { cookieNames };
4260
4338
  export const cookiePlantHandleApi = {
4261
4339
  requireAttemptHandle,
4262
4340
  jarContextIncomplete,
4341
+ jarAuditFields,
4342
+ evidenceFormOf,
4263
4343
  plantCanary,
4264
4344
  clearCookie,
4265
4345
  readJar,
package/guard-driver.mjs CHANGED
@@ -378,6 +378,8 @@ function declaredCapabilities(value) {
378
378
  return [];
379
379
  }
380
380
 
381
+ const autoAttachCaps = ['autoAttach', 'stockSetup', 'syntheticAutoAttach'];
382
+
381
383
  function skipWhy(vector, row, known, guard, declared) {
382
384
  const { reason } = row;
383
385
  if (typeof reason !== 'string' || reason === '') return 'skip without a reason';
@@ -389,8 +391,10 @@ function skipWhy(vector, row, known, guard, declared) {
389
391
  : `skip with a reason the runner never gives: ${reason}`;
390
392
  if (reason.startsWith('not-supported:')) {
391
393
  const cap = reason.slice('not-supported:'.length);
392
- if (cap === 'extensionFrame' && declared.includes(cap))
394
+ if (['extensionFrame', 'explicitAttach'].includes(cap) && declared.includes(cap))
393
395
  return `skip with not-supported:${cap} while the run declared ${cap}`;
396
+ if (autoAttachCaps.includes(cap) && (vector?.requires ?? []).includes('explicitAttach'))
397
+ return `skip with not-supported:${cap} on an explicitAttach row`;
394
398
  if (known.has(cap)) return null;
395
399
  }
396
400
  return `skip with a reason the runner never gives: ${reason}`;