@ai-ecoverse/slicc-bios 1.68.0 → 1.69.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.
Files changed (2) hide show
  1. package/README.md +13 -2
  2. package/package.json +3 -1
package/README.md CHANGED
@@ -500,11 +500,22 @@ A browser extension's frame inside an ordinary page, such as a password manager'
500
500
  - **Hidden targets:** `Target.getTargets` and the target events leave protected targets out.
501
501
  - **Refused commands** answer an error: any command whose `targetId` or `frameId` is a protected target (the guard asks for the target's current URL first) (`Target.attachToTarget`, `activateTarget`, `closeTarget`, `getTargetInfo`, `Browser.getWindowForTarget` and the rest, with or without a session); any command whose `url`, origin (`origin`, `securityOrigin`, `ownerOrigin`, `topLevelSite`, `scopeURL` and the like), `storageKey`, `cacheId` or cookie `domain` is protected, at any depth of its parameters, which covers navigation, `IndexedDB.*`, `CacheStorage.*`, `DOMStorage.*`, `Storage.*`, `ServiceWorker.*` and cookie writes; `Network.clearBrowserCookies`, `Storage.clearCookies`, `ServiceWorker.stopAllWorkers`, `BackgroundService.clearEvents`, `Storage.getPrivateVerificationTokens` and `Tracing.start`, which reach every origin; `Network.loadNetworkResource`, which follows redirects the guard can't see; `IO.read` and `IO.close` on a stream the guard didn't hand out in an answer; a `ServiceWorker` command for a registration or version the guard hasn't shown; `Target.detachFromTarget` of a session the connection didn't attach; and every `Fetch.*` command without a tab session, so nothing can pause the whole browser. Free-form values such as `expression` or `headers` aren't searched.
502
502
  - **Filtered answers and events:** cookie lists leave out cookies whose domain is protected and partitioned cookies under a protected site. `Storage`, `DOMStorage`, `IndexedDB`, `CacheStorage` and `BackgroundService` events that name a protected origin are dropped, and so are service worker registrations and versions on one.
503
- - **Checked on attach:** a new session is handed to the program only after the guard has checked its target and read the session's frame tree, and none of them is protected. An auto-attached page or frame without a URL yet is held, with its events dropped and its commands refused, until it has one, and cut if it has none after 10 s.
503
+ - **Checked on attach:** a new session is handed to the program only after the guard has checked its target and read the session's frame tree, and none of them is protected. An auto-attached page or frame without a URL yet is held, with its events dropped and its commands refused, until it has one, and cut if it has none after 10 s. A target that attaches paused (`waitForDebuggerOnStart`) is resumed as soon as the guard's `Fetch` arm on its own session for that target is accepted (at most 1 s), before the rest of the guard's setup, because `Page.enable` and the frame-tree read can't finish on a paused page; it stays held the same way until the guard has placed it, and a program's own `Runtime.runIfWaitingForDebugger` doesn't wait for that setup. If the guard's `Fetch.enable` is refused, the target is cut instead of resumed. A target that is already protected or held when it attaches is resumed only as the guard cuts it, and if the read that confirms it doesn't settle within 1 s, the guard cuts it then. A paused tab with no page under it after 10 s is resumed, since the program has no session on any page in it. A tab that attaches paused is resumed once the page under it is armed the same way: until the tab runs, that page can't answer the guard's frame-tree read, and the program waits for the guard before it resumes the tab.
504
504
  - **Cut sessions:** a session whose target becomes protected (`Target.targetInfoChanged`), whose page or any frame in it is about to navigate or navigates to a protected URL (`frameRequestedNavigation`, `frameScheduledNavigation`, `frameStartedNavigating`, `frameNavigated`, `navigatedWithinDocument`, or a `Document` request), or whose context runs on a protected origin is detached at once, without the event, and its target counts as protected from then on. Any other page event that names a protected URL or origin is dropped. Its later events and the answers to its pending commands are dropped, and its commands are refused. The guard watches each session's `Page` events itself, and passes them on only when the program asked for them.
505
505
  - **Requests from protected documents:** a request whose URL, document, frame, initiator, `Referer` or `Origin` is protected never reaches the program. The guard continues its `Fetch` pause itself, drops its `Network` events, and refuses its bodies (`Network.getResponseBody`, `getRequestPostData`, `Fetch.getResponseBody` and the like). Bodies, `replayXHR` and `Fetch` replies for a request the guard hasn't seen are refused too. Extra-info events that come before their request wait up to 2 s for it, then are dropped.
506
506
  - **Shared checks:** commands on one session are checked in order, and a command can use the opener and surface check another command started after it arrived, provided no browser event arrived and no command other than a plain read (`DOM.describeNode`, `Runtime.getProperties`, `Page.getFrameTree`, `Target.getTargetInfo` and the like) was forwarded since that check started, and the check started at most 100 ms ago. A program that sends its reads together, such as a snapshot describing its refs, pays for about one check, not one per command. A failed check is never shared.
507
507
  - **Flat sessions only:** `Target.attachToTarget` and `Target.setAutoAttach` need `flatten: true`. `Target.sendMessageToTarget`, `Target.attachToBrowserTarget` and `Target.exposeDevToolsProtocol` are refused, so no command can be tunnelled past the guard.
508
+ - **Stock clients' setup (group 1):** stock Playwright (`chromium.connectOverCDP`) and Puppeteer (`puppeteer.connect`) open, drive and read ordinary pages through the guard, as the shared vectors' `stockSetup` rows require. On a page session the guard admits:
509
+ - `Page.addScriptToEvaluateOnNewDocument` whose `source` holds no code: it matches `^(?:[ \t\n]|//[^\n\r\u2028\u2029]*)*$` as a whole, with or without `worldName` and `runImmediately` (Playwright sends `''`, Puppeteer `//# sourceURL=pptr:internal`). `Page.removeScriptToEvaluateOnNewDocument` is admitted for an identifier that session got from it.
510
+ - `Page.createIsolatedWorld` on a frame the guard places as ordinary, always forwarded without `grantUniveralAccess` and `contentSecurityPolicy`, whatever the client asks. A frame that shows Chrome's error page for a refused document, or the guard's own blank, gets the "out of reach" refusal and no context.
511
+ - Exactly `Emulation.setFocusEmulationEnabled`, `setEmulatedMedia`, `setDeviceMetricsOverride` and `setTouchEmulationEnabled`.
512
+ - `Runtime.addBinding` scoped to an isolated world: a non-empty `executionContextName` (not a browser extension's world), or the `executionContextId` of an isolated world on an ordinary origin. `Runtime.bindingCalled` reaches the client only from such a world.
513
+ - `Target.setAutoAttach` whose `filter` would admit tabs (Puppeteer's catch-all filters, `[{}]`) is forwarded with its filter narrowed to tab targets on the browser session (Chrome refuses a filter that allows both tabs and pages there) and to page targets on any other session, so a Puppeteer client gets its tab and page attachments and no frames or workers under them. For a kernel program, worker auto-attach is otherwise as before this change: a filter without tabs, slicc-cdp's dedicated-worker HAR capture (`[{type: "worker"}]`), shared and service worker filters and an omitted filter (Playwright's) are forwarded as sent, and the workers they attach are checked and shown as before. A remote device (a connection that comes in over the remote CDP stream, `caller.kind === 'device'`) gets no worker session on any route until #1515: over the DevTools port and the link, a filter that admits only worker types is refused (`NO_WORKERS`), an omitted filter goes out with the worker types excluded in front of Chrome's default, a filter that admits a worker type together with any other type is narrowed like a tab-admitting one, any worker attachment that reaches it anyway is cut (resumed, then detached) and never shown, `Target.attachToTarget` of a worker is refused, and workers are left out of its `Target.getTargets` and `Target.getTargetInfo` answers and its discovery events. So for a remote device Playwright's `page.workers()` is empty and Puppeteer gets no workers. On the extension route a worker-only filter reaches the extension unchanged and keeps its `NO_AUTO_ATTACH`, and so does a browser-wide call that admits neither tabs nor pages. A worker of a page that turns held or protected after it was shown to a kernel program is the same gap as before this change, tracked in #1516. Through the guard, Puppeteer reads same-site iframes only, on every route: the guard narrows the auto-attach rather than hiding cross-site frames one by one. A page the guard opens for `Target.createTarget` starts in the background unless the call asks otherwise, so seven stays in front, and the guard turns on focus emulation for it on its own session before the program sees it, so the page counts as focused and visible and renders; a program can still send its own `Emulation.setFocusEmulationEnabled`, one of the admitted display calls. Any other call, such as one asking for iframes only, is forwarded as it came. A `tab` target is judged by the page under it. It is cut if its own URL is protected, if that page is held (a sign-in), has a protected opener or a protected URL, and whenever that page's session is cut later. On the extension route the guard knows the page from the synthetic tab's id; over the DevTools port it learns it when the page attaches under the tab. Before every command on a tab session the guard reads the page under it again, and cuts the tab and refuses if that page is now held or protected, or the read doesn't answer. A tab's URL and title reach the program only in the answer to its own `Target.getTargetInfo` after such a fresh read showed an ordinary page; everywhere else (its attachment, `Target.getTargets`, discovery events) the tab's target info has no URL, title or opener. Until that page is placed as ordinary, a command that names the tab, such as `Target.closeTarget` or `Target.activateTarget`, is refused. A tab session takes only `Target.setAutoAttach`, `Runtime.runIfWaitingForDebugger` and `Target.getTargetInfo` about itself (another `targetId` is refused), and since it reads no page content it needs no content proof, so a new tab that has no URL yet still resumes. A tab with no URL yet doesn't count as protected for that alone; the pages under it are judged by their own URLs and are checked, held and cut like every other page.
514
+ - **Still refused, with the texts above:** init scripts with code (`addInitScript`, `evaluateOnNewDocument`), `Page.addScriptToEvaluateOnLoad`, `Page.setBypassCSP`, an unscoped or main-world `Runtime.addBinding` (`exposeFunction`), every other `Emulation.set*` (user agent, locale, time zone, geolocation and the rest) and the `Network` overrides, including the `Network.setCacheDisabled` that request interception (`route`, `setRequestInterception`) sends.
515
+ - **Attachments before answers:** while a program has browser-wide page auto-attach on, `Target.createTarget` answers only after the new page's attachment has been shown or cut (at most 10 s), the order Chrome keeps and Playwright relies on.
516
+ - **Admitted settings and the window before the arm:** the guard resumes a paused target only once its `Fetch` arm is in place, and from then on the target never commits a protected document (its `Document` request fails, and the session is cut first), so an admitted world or display override at most reaches Chrome's error page. A refused `Fetch.enable` cuts the target. Two windows are left. If the arm is still unanswered after 1 s, an ordinary target is resumed anyway, so it can't hang, and is unarmed until the arm lands. A program can also resume a paused tab itself before the page under it is armed. What covers both: the program's session stays hidden until the guard has placed the target, and a protected commit marks the target's proof uncertain, which refuses its pending reads, and cuts the session, so it is never shown. A vector row that times `Fetch.enable` against the resume comes before group 2.
517
+ - **Auto-attach through slicc-extension:** the extension refuses `Target.setAutoAttach` and has no tab targets, so the hook emulates browser-wide auto-attach on that route. It looks for new tabs by polling `Target.getTargets` every 200 ms, and at once after `Target.createTarget`, attaches each itself and hands the attachment to the guard like a native one. A page whose attach failed, and a synthetic tab the guard cut, are tried again only when the page's URL changes. A held sign-in page, a page its sign-in opened, and a page still on the sign-in marker URL are never attached through the extension at all, so the emulation never puts the extension's debugger on a sign-in in flight. A filter that asks for tabs gets a synthetic `tab` target whose session takes the same three methods and attaches the page under it; it also takes a `Target.detachFromTarget` of that page, which is how the guard's cut of the page reaches it. Every attachment says `waitingForDebugger: false`, because `chrome.debugger` can't pause a new tab; the guard holds the page until it has placed it, as for any page. The extension still refuses every page-session `Target.setAutoAttach`, and the hook passes that refusal on unchanged, so the guard's own placement and any other caller see it as before. On this route only, the guard answers `{}` to a program's page-session call that has no filter or a filter it narrowed (what Playwright and Puppeteer send), and that call attaches nothing. Every other shape, such as an iframes-only filter, keeps the refusal. So on this route cross-site iframes (OOPIFs) and workers aren't attached, and a flow that reads into a cross-site iframe can fail. The emulation doesn't use discovery: `Target.setDiscoverTargets` goes to the extension as the program sent it, and discovery events pass through as the extension sends them.
518
+ - **Linked browsers:** a linked computer's own `slicc` guards its browser too, and refuses the setup calls above until its own group 1 ships, so stock clients don't yet work on the link route, and the shared vectors' `stockSetup` rows aren't declared there.
508
519
 
509
520
  - **Known limit:** extensions that refuse `Target.setAutoAttach` leave an ordinary page with a cross-site iframe locked for paint, DOM, CSS, accessibility and input. The guard fails closed when it cannot place the child.
510
521
 
@@ -778,7 +789,7 @@ No test calls a real model. Every test serves an empty `packages/agent/` project
778
789
  [`.github/workflows/ci.yml`](.github/workflows/ci.yml) is one caller of [slicc-shared-web's pipeline](https://github.com/ai-ecoverse/slicc-shared-web#pipeline), pinned to the release `@ai-ecoverse/slicc-shared-web` has in `devDependencies` (Renovate moves both in one PR). It runs on pull requests, the merge queue and pushes to `main`:
779
790
 
780
791
  - **Pull requests:** after lint, the pipeline's `deploy` job publishes a `bb/**` branch's preview (see [Hosting](#hosting)); the tests and reviewers get its URL as `STAGING_URL`.
781
- - **Pull requests and the merge queue:** lint, then every `test/integration/*.test.mjs` split by the last runs' JUnit timings over 12 pool shards (`ci / integration`), then on a pull request the Claude and Codex reviews (`ci / review`) with this repository's `review-prompt`. The shared guard vectors run as one file per path (extension, link), target group (`seven`, `vault`, `vault-x`, `apex` and the rest, `test/integration/guard-groups.mjs`) and detach variant (`lagging` or the others), 20 files of 2 to about 12 minutes, so the split can balance them. The slicc CLI tests use `node_modules/.bin/slicc` (or `SLICC_CLI`).
792
+ - **Pull requests and the merge queue:** lint, then every `test/integration/*.test.mjs` split by the last runs' JUnit timings over 12 pool shards (`ci / integration`), then on a pull request the Claude and Codex reviews (`ci / review`) with this repository's `review-prompt`. The shared guard vectors run as one file per path (devtools, extension, link), target group (`seven`, `vault`, `vault-x`, `apex` and the rest, `test/integration/guard-groups.mjs`) and detach variant (`lagging` or the others), 30 files of 2 to about 12 minutes, so the split can balance them. The slicc CLI tests use `node_modules/.bin/slicc` (or `SLICC_CLI`).
782
793
  - **`main`:** semantic-release publishes the npm package (see [The npm package](#the-npm-package)). When it releases, the pipeline's `after-release` publishes that version to seven, in the `production` environment (see [Hosting](#hosting)).
783
794
 
784
795
  Require `ci / integration` and `ci / review`. There is no retry: a flaky test fails the run.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "1.68.0",
3
+ "version": "1.69.0",
4
4
  "description": "Slim loader that boots SLICC into OPFS and serves the UI from there",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -63,6 +63,8 @@
63
63
  "lefthook": "2.2.2",
64
64
  "modern-tar": "0.8.6",
65
65
  "monocart-coverage-reports": "3.2.0",
66
+ "playwright-core": "1.65.0",
67
+ "puppeteer-core": "25.16.0",
66
68
  "semantic-release": "25.0.9",
67
69
  "ws": "8.22.1"
68
70
  }