@ai-ecoverse/slicc-bios 2.4.4 → 2.5.1

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 +3 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -182,9 +182,10 @@ The kernel runs with users on (slicc-kernel ≥ 1.81.0): files have owners and m
182
182
  - **A remembered mount** (`slicc-os.mounts`) at, under or above a protected path is dropped at boot under `'enforce'`, with a notice, *A remembered folder wasn’t mounted*.
183
183
  - **Sudo approvals through the agent** (slicc-agent ≥ 7.17.0, slicc-kernel ≥ 1.174.0, spectrum ≥ 1.112.0): bios only routes. While the agent runs, the kernel's `approve` hook hands each request to the agent's `owner.approve(req, { signal, where })` unchanged, the kernel's facts included: `always` (`false` when the line can't be recorded as a rule), `stdin` (`tty`, `none`, `pipe` or `file`) and `rootOnly` (for the directory and each path on the line, whether only root can change it). bios returns the agent's answer as it is. It becomes a `sudo` item in the agent's approvals, which every owner device answers with the same powers: this tab, other tabs, and linked followers with or without Control. The judge is slicc-agent's: it gives each request a level and a reason, and offers *Always allow* only to a person, at level 1, when its model says a later run of the same line can do no more. Enforcement and rule recording are the kernel's: it writes an *Always* as the exact line with `Stdin none`, and runs an *Always* for a line it can't record once. bios checks no command text. A request from a follower's shell names that device (`where`, "on <device>"), and each linked device's agent port is opened with `owner.port({ device })`, so the item records which device answered. The tab hands its own approvals port to `createAgentModel(connection, { approvals })`, so `model.approvals` lists both sets. When the agent can't take a request (it rejects with `EAGAIN`: released, restarting or an older worker), isn't running, or was started from a release older than 7.17.0 (one without the judge, which can still run until it restarts after an update), bios's own dialog below asks instead.
184
184
  - **Sudo approvals in bios's dialog:** without the agent there is no judge, so the kernel's `approve` hook feeds `model.approvals`, spectrum's sudo dialog, with *Allow once* and *Deny* only and no verdict. It shows the resolved path and arguments, shell-quoted, the directory, the requester mapped from the tag and the target. Every tab shows the request (`BroadcastChannel('slicc-approvals')`), and the first decision wins; the other tabs see *Answered in another tab*. The item has `always: false`, and an `always` decision for it, from any tab, is refused with *Always isn't offered for this request.* and the request stays open, so no `NOPASSWD` line is written from bios's dialog.
185
- - **Approvals panel and Run now** (spectrum ≥ 2.14.1, slicc-kernel ≥ 1.181.0, protocol 1.16; notices need slicc-agent ≥ 7.34.0): bios's ApprovalsPort keeps `history()` (pending and settled records, newest first) and emits `history` when any record changes, so spectrum offers the Approvals panel (`data-surface="approvals"`, right, closed by default). A timed-out sudo stays `unanswered` with `reason: 'timeout'`. **Run now** (`run(id)`) is only for those records: bios calls the kernel's `sudoRun` with the original request so the kernel re-checks policy, command hash and cwd at run time; bios never runs the command itself. `stopRun(id)` signals the run's process group while it is `running`. After a run actually starts, bios sends start and end facts through the owner-device control method `connectAgent().approvalRunNotice(notice)` (feature-detected; older agents log one warning and keep a debug buffer). The agent renders the `sudo-run` lick (`bios:<id>:start` / `:end`); a kernel refusal that runs nothing sends no notice.
185
+ - **Approvals panel and Run now** (spectrum ≥ 2.14.1, slicc-kernel ≥ 1.181.0, protocol 1.16; notices need slicc-agent ≥ 7.34.0): bios's ApprovalsPort keeps `history()` (pending and settled records, newest first) and emits `history` when any record changes, so spectrum offers the Approvals panel (`data-surface="approvals"`, right, closed by default). A timed-out sudo stays `unanswered` with `reason: 'timeout'`. **Run now** (`run(id)`) is only for those records: bios calls the kernel's `sudoRun` with the original request so the kernel re-checks policy, command hash and cwd at run time; bios never runs the command itself. `stopRun(id)` signals the run's process group while it is `running`, and its survivors after that (below). After a run actually starts, bios sends start and end facts through the owner-device control method `connectAgent().approvalRunNotice(notice)` (feature-detected; older agents log one warning and keep a debug buffer). The agent renders the `sudo-run` lick (`bios:<id>:start` / `:end`); a kernel refusal that runs nothing sends no notice.
186
186
  - **Who records:** ownership follows who held the ask. While the agent is up and `owner.approve` resolves (no `EAGAIN`), the item lives in the agent's approvals (`apr-…`); bios's `history()` has no row and stores no replay. bios records only asks its own dialog answered or that timed out there (agent down, released, restarting, an `EAGAIN` fallback, or no judge). History ids are `bios:<kernel id>`, so they stay disjoint from the agent's `apr-…` when the spectrum adapter merges both ports and routes `run`/`stopRun` by id. The notice `id` is that same `bios:<kernel id>`; the agent appends `:start` / `:end` when it renders the `sudo-run` lick, never using an `apr-…` id for a bios-held run.
187
187
  - **`runnable`:** `true` only for an unanswered (timed-out) agent sudo that has no run yet, on a kernel that supports `sudoRun` (protocol ≥ 1.16), and when the stored replay still has what `sudoRun` needs (`rootOnly`, absolute `path`/`cwd`, no `validate`, stdin not `pipe`/`file`, within the late-run age). Otherwise `{ reason }` (for example "Run it again in the terminal.", "Needs slicc-kernel protocol 1.16 or later.", "Its input is gone, so it must be asked again."). Spectrum trusts `runnable`: the panel enables Run now only for `true`.
188
+ - **Survivors** (spectrum ≥ 2.15.0): when a run's leader exits, is stopped or fails, bios looks up the processes still carrying its `sudo-run:<id>` tag as the target user, through a kernel client's `ps()`, leader excluded. If any are left, they're the run's `survivors` (pids), and the end notice carries them. The panel then shows *Still running: pid …* with **Stop**. bios checks the list once a second and drops `survivors` once those processes are gone. `stopRun` on a `done`, `stopped` or `failed` run with survivors sends `SIGTERM` to exactly the listed pids that still carry the tag, as the target user, never pid 1 or lower. The kernel has no kill by tag, so right before each kill bios reads the process list again. It skips a pid that no longer carries the tag as that user, or whose start time or process group changed, as when the process exited and another took its pid. A failed kill is reported only while one of them is still there.
188
189
  - **Another tab takes over:** the owner's `history` broadcast carries the replay it stored for each record, and every other tab keeps it, dropping a replay whose command, directory, target or user differs from its record's. So when the owner tab closes, a timed-out row stays runnable in the tab that takes over. The kernel runs in the owner tab, so that tab starts a new one. Each record the closed tab had `starting` or `running` is looked up by its `sudo-run:<id>` tag, through a kernel client's `ps()` on that kernel, among the target user's processes, once a second until the process list answers. A run that's found is re-attached: `stopRun` signals its process group, and the row ends (`done`, its exit status unknown) when its leader exits. One that's gone ends at once: `done` with its exit status unknown and an end notice, or `failed` (*The tab that started it closed before it ran.*) if it hadn't started. Until the new kernel's process list answers, `stopRun` refuses with *The kernel's process list isn't available, so it can't be stopped.*
189
190
  - **Sudo timestamps** (slicc-kernel ≥ 1.177.0): as in sudo(8), a person's approval lets the same place run `sudo` again without asking for a few minutes. Seven keeps the kernel's defaults, 5 minutes (`timestamp_timeout`) per terminal (`timestamp_type=tty`), so several `sudo` lines typed in one terminal share the window, and seeds no `Defaults` line; an admin can write one in `/etc/sudoers.d` as root. An agent's bash call has no terminal, so it falls back to `ppid` and each call asks again. Only a person's approval opens the window:
190
191
  - **Through the agent** (slicc-agent ≥ 7.27.0), a person's *Allow once* or *Always allow* answers `{ answer, timestamp: true }` and the judge's approval a plain `once`; bios passes the kernel's request, `timestamp` and `validate` included, and the agent's answer through unchanged.
@@ -906,7 +907,7 @@ No test calls a real model. Every test serves an empty `packages/agent/` project
906
907
  [`.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`:
907
908
 
908
909
  - **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`.
909
- - **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. Each path's guard gets the route bios's browser hook gives it: none (`devtools`) over the DevTools port, the linked browser's own route for the link, and `{ kind: 'extension', version }` with the per-browser tab records and the extension's `frames()` for the extension. The run fails before any row if `Browser.getVersion` through the guard doesn't answer `slicc.route` equal to the path, and prints that answer as `GUARD-ROUTE`, and next to it `GUARD-FRAMES hook <path> {route, frames, version}`: the route, whether the guard got a `frames()` hook, and the extension version the page states. The fake extension states the version the real-extension tests run (`CURRENT_EXTENSION` in `test/integration/real-extension.mjs`, 7.12.2), which also puts the Debugger route (7.12.0 and later) under test, and answers `frames()` with the contract of ai-ecoverse/slicc-extension's `extension/cdp.js` (`frames()` and `frameReply()`, unchanged from v7.12.0 to v7.14.3): a version 2 reply with each frame's `kind`, and, only when every frame is ordinary, `rootFrameId`, the frame ids, the local frames and the cross-process owners (`frameId`, `backendNodeId`); an unsettled or failed list, an error frame included, is refused with `slicc: refused: unsettled frame list`. `test/integration/fake-extension-frames.mjs` builds it from a separate browser-level connection, the way the extension's service worker reads outside the page's CDP stream. One difference: the real extension is called with a numeric tab id (`extension.frames(Number(targetId))` in `cdp.js`), while the fake's targets are Chrome target ids, so the harness passes the target id as it is. The frames-less limit row runs a fake at `MIN_EXTENSION_VERSION` (7.10.0) without `frames()`. The slicc CLI tests use `node_modules/.bin/slicc` (or `SLICC_CLI`).
910
+ - **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. Each path's guard gets the route bios's browser hook gives it: none (`devtools`) over the DevTools port, the linked browser's own route for the link, and `{ kind: 'extension', version }` with the per-browser tab records and the extension's `frames()` for the extension. The run fails before any row if `Browser.getVersion` through the guard doesn't answer `slicc.route` equal to the path, and prints that answer as `GUARD-ROUTE`, and next to it `GUARD-FRAMES hook <path> {route, frames, version}`: the route, whether the guard got a `frames()` hook, and the extension version the page states. Every other test that builds a guard over an extension or linked transport passes the route the browser hook would, through `guardRoute` in `test/integration/guard-route.mjs` in Node or the page's own extension or linked browser route in the page, and `guard-route.test.mjs` fails when one doesn't. The fake extension states the version the real-extension tests run (`CURRENT_EXTENSION` in `test/integration/real-extension.mjs`, 7.12.2), which also puts the Debugger route (7.12.0 and later) under test, and answers `frames()` with the contract of ai-ecoverse/slicc-extension's `extension/cdp.js` (`frames()` and `frameReply()`, unchanged from v7.12.0 to v7.14.3): a version 2 reply with each frame's `kind`, and, only when every frame is ordinary, `rootFrameId`, the frame ids, the local frames and the cross-process owners (`frameId`, `backendNodeId`); an unsettled or failed list, an error frame included, is refused with `slicc: refused: unsettled frame list`. `test/integration/fake-extension-frames.mjs` builds it from a separate browser-level connection, the way the extension's service worker reads outside the page's CDP stream. One difference: the real extension is called with a numeric tab id (`extension.frames(Number(targetId))` in `cdp.js`), while the fake's targets are Chrome target ids, so the harness passes the target id as it is. The frames-less limit row runs a fake at `MIN_EXTENSION_VERSION` (7.10.0) without `frames()`. The slicc CLI tests use `node_modules/.bin/slicc` (or `SLICC_CLI`).
910
911
  - **`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)).
911
912
 
912
913
  Require `ci / integration` and `ci / review`. There is no retry: a flaky test fails the run. The separate `vault drift` workflow is not required.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "2.4.4",
3
+ "version": "2.5.1",
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",
@@ -51,11 +51,11 @@
51
51
  "devDependencies": {
52
52
  "@ai-ecoverse/slicc": "1.69.4",
53
53
  "@ai-ecoverse/slicc-browsers": "1.27.3",
54
- "@ai-ecoverse/slicc-cdp": "2.1.0",
54
+ "@ai-ecoverse/slicc-cdp": "2.1.4",
55
55
  "@ai-ecoverse/slicc-kernel": "1.191.2",
56
56
  "@ai-ecoverse/slicc-shared-web": "2.16.1",
57
57
  "@ai-ecoverse/slicc-spectrum": "2.19.4",
58
- "@ai-ecoverse/slicc-vault": "1.29.1",
58
+ "@ai-ecoverse/slicc-vault": "1.30.0",
59
59
  "@biomejs/biome": "2.6.7",
60
60
  "aws4fetch": "1.0.20",
61
61
  "es-module-lexer": "3.0.4",