piroboros 0.3.2 → 0.3.4
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/CHANGELOG.md +28 -0
- package/README.md +2 -0
- package/dist/conclave/agents.js +0 -2
- package/dist/conclave/pipeline.js +14 -11
- package/dist/guard.js +1 -1
- package/dist/models.js +7 -3
- package/dist/ws/apply.js +23 -7
- package/dist/ws/confine.js +50 -24
- package/dist/ws/docker.js +14 -20
- package/dist/ws/git.js +95 -22
- package/dist/ws/workspace.js +237 -97
- package/dist/ws/wsl.js +13 -25
- package/docs/conclave.md +3 -3
- package/docs/tools.md +6 -6
- package/package.json +1 -1
- package/skills/conclave/SKILL.md +1 -1
package/docs/conclave.md
CHANGED
|
@@ -24,11 +24,11 @@ While a pipeline exists, the chat shows a Conclave pane. Each member is `waiting
|
|
|
24
24
|
|
|
25
25
|
Vesperia works in a Workspace by default: a private copy of your project's git-visible files, made when `/conclave approve` starts her. Your project folder is not touched while she runs. When her run ends with the verdict `done`, piroboros merges her changes back, line by line, and `/conclave undo` restores the files from a snapshot taken before the merge.
|
|
26
26
|
|
|
27
|
-
- What is copied: the files git shows for the project (tracked files, and untracked files that are not ignored), and a
|
|
27
|
+
- What is copied: the files git shows for the project (tracked files, and untracked files that are not ignored), and, for a project with git, a repository of its own that piroboros makes at open: one commit of the copied files on the branch name your repository is on, with your remotes' addresses, a push address that fails, and none of your history, branches, stashes, index or objects. A credential once committed and deleted since is not in it, and `git log` there shows that one commit. The commit is built with `git fast-import` and `git read-tree`, which run no clean filter, line-ending conversion or hook, so no filter from your global or system git config runs on your machine, and each file's blob holds the bytes as copied. With `core.autocrlf` and `* text=auto` the Workspace's `git status` is clean. A file with an explicit `text` or `eol` attribute whose line endings differ from it, or a file a clean filter changes, can show as modified in `git status` there before Vesperia touches it; merges read no git, so they are not affected. Files with secret-like names (`auth.json`, `.npmrc`, `.env.*`, `*.sqlite`, `token*`, keys and similar) and paths under a `guard.deny` folder are left out and listed in the start notice. Git-ignored folders such as `dist/` are not copied. `node_modules` is an empty folder in the Workspace, wherever it occurs; she installs into it when she needs it, and nothing under it is merged back. A project without git is copied by a walk with the same exceptions.
|
|
28
28
|
- Her `git push` is disabled in the Workspace and her commits stay there. Nothing she writes into the Workspace's `.git/config` or `.gitattributes` is run by piroboros.
|
|
29
|
-
- A merge writes nothing to your folder when a path conflicts (you changed the same place), and lists the paths and the kinds. A run that ends with another verdict, a cancel, a moved HEAD, 20 or more deletions, a live file over 64 MiB or a failed pre-flight check leaves the Workspace in place as a hold. `/conclave merge` shows every reason and asks once, `/conclave discard` drops the Workspace, `/conclave retry` continues a pipeline that a restart limit parked, and `/conclave status` shows the Workspace and its state.
|
|
29
|
+
- A merge writes nothing to your folder when a path conflicts (you changed the same place), and lists the paths and the kinds. A run that ends with another verdict, a cancel, a moved HEAD, 20 or more deletions, a live file over 64 MiB, a folder in the Workspace that cannot be read (fix its permissions, then `/conclave merge`) or a failed pre-flight check leaves the Workspace in place as a hold. `/conclave merge` shows every reason and asks once, `/conclave discard` drops the Workspace, `/conclave retry` continues a pipeline that a restart limit parked, and `/conclave status` shows the Workspace and its state.
|
|
30
30
|
- Resolving conflicts. For a text file both of you changed, the Workspace copy gets `<<<<<<< workspace N`, `=======` and `>>>>>>> live N` marker lines, and the report gives the line of each block. Remove the blocks (or copy the live file over the Workspace file) and run `/conclave merge` again; the path stays conflicted while any `<<<<<<< workspace N` or `>>>>>>> live N` line is left; the merge then applies your resolution against the live text it was made from. If you change the live file again in between, that path conflicts again and the markers are rewritten from Vesperia's stored version, so edits to the old markers are lost. A binary file or a deletion conflict is resolved by making the Workspace file equal to the live one. `/conclave merge` with conflicts left asks whether to replace your version of those paths with hers (her deletions delete); yes writes her stored version, not the marker text, and `/conclave undo` restores yours. A path that conflicts because a file and a folder meet, or because the names differ only in case, is not offered that choice; make the Workspace path equal the live one, or discard. A marker block with another number in a tracked file is ordinary text.
|
|
31
|
-
- Approving the same plan again after a conflict or a hold continues in the same Workspace. Files you changed in your folder that she never touched are copied into it first, so her next merge builds on your current files.
|
|
31
|
+
- Approving the same plan again after a conflict or a hold continues in the same Workspace. Files you changed in your folder that she never touched are copied into it first, so her next merge builds on your current files. A path she replaced with a link, or whose folder she replaced with a link, is skipped with a notice. A Workspace made by 0.3.2 or earlier loses its git history on this reopen, or when its run is resumed after a retry or a restart (its files stay). A Docker container of such a Workspace that mounted your objects is replaced by a new one before the run's first command.
|
|
32
32
|
- A `.lww` file in the project root (gitignore-style patterns, `%include` for more files) names paths where the side modified later wins instead of conflicting: the Workspace file's modification time against the live file's, the Workspace on a tie. A path she deleted counts as modified when the deletion was seen, and a path deleted live loses. The report names the rule and the side kept.
|
|
33
33
|
- The merge is not atomic across files. It stores every live path it will change before it writes, replaces each file only after checking its bytes, rolls back when a step fails, and rolls back or finishes at the next start after a crash. A live file over 64 MiB is never merged: copy it yourself before `/conclave merge`, which removes the Workspace afterwards.
|
|
34
34
|
- On Linux with bubblewrap installed, on Windows with bubblewrap in WSL 2, or with a Docker image set in `workspace.docker.image`, her commands run confined: see [Shell confinement](tools.md#shell-confinement). Everywhere else, and when the self-test fails, shell commands are not confined: they run in the Workspace folder but can still read and write any path your account can, including your live project. The start notice and `/conclave status` say which applies. The Workspace keeps her away from your files by where she works, not by a sandbox.
|
package/docs/tools.md
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
With Workspaces on (the default), Vesperia's `bash` commands run inside bubblewrap on Linux when `bwrap` is on PATH and a self-test passes at the moment the Workspace opens. The choice is kept for that Workspace and made again when it is reopened. On Ubuntu install the `bubblewrap` package. Ubuntu 23.10 and later restrict unprivileged user namespaces by default; when that blocks bubblewrap the self-test fails and the start notice names the reason. On Windows the commands run inside bubblewrap in WSL (see below). When `workspace.docker.image` is set, Docker is tried first on every system (see [Docker](#docker)). macOS has no bubblewrap, so its commands run in Docker or are not confined, and the notice and `/conclave status` say which.
|
|
15
15
|
|
|
16
|
-
- What a command sees: the
|
|
17
|
-
- What it cannot do: write outside the Workspace (the write fails, or lands in `/tmp` or the empty home folder and disappears when the command ends) or read your credentials
|
|
16
|
+
- What a command sees: the system folders that exist (`/usr`, `/etc`, `/bin`, `/sbin`, `/lib`, `/lib32`, `/lib64`, `/libx32` and `/nix`) and the folders named on PATH outside them (`~/bin`, `~/.local/bin`, a Node version folder, `/opt/node/bin`), all read-only, so installed tools keep working; the Workspace read-write; and empty `/tmp`, `/var/tmp` and home folders. Nothing else of the machine is there: `/opt`, `/srv`, `/var`, `/mnt`, `/media`, other drives and any folder outside the list do not exist inside. `PIROBOROS_HOME`, `~/.pi`, `~/.ssh`, `~/.claude`, every `guard.deny` folder and your live project are empty even where they sit under a visible folder, and a PATH folder inside one of them is not put back. Nothing of your live repository is shared: a Workspace with git holds its own repository (see [Workspaces](conclave.md)), so git works in it without the live `.git` being visible.
|
|
17
|
+
- What it cannot do: write outside the Workspace (the write fails, or lands in `/tmp` or the empty home folder and disappears when the command ends) or read your credentials or your live project, wherever the project is. Because `/tmp` and the home folder are fresh for every command, `git commit` there uses only the `user.name` and `user.email` kept from the live repository's local config.
|
|
18
18
|
- Network: `workspace.network` (default `true`) lets installs work. With it on, a command can reach your network and send any file it can see. Set it to `false` to cut the network.
|
|
19
19
|
- A command is passed to `bash -c` as one argument, so it can be at most 131,071 bytes and cannot hold a NUL byte; a longer one is refused with a message that suggests a script file in the Workspace. A command that runs past the timeout is killed with everything it started.
|
|
20
20
|
- If a command cannot start, it fails with an error and is never run again without confinement. If bubblewrap was not usable when the Workspace opened, the start notice, her brief and `/conclave status` say the shell is not confined. `workspace.confine: "none"` turns confinement off on purpose.
|
|
@@ -23,17 +23,17 @@ With Workspaces on (the default), Vesperia's `bash` commands run inside bubblewr
|
|
|
23
23
|
|
|
24
24
|
Every sandbox, native or in WSL, also loads a small seccomp filter (written in `src/ws/confine.ts`, no library). It does three things: `socket` and `socketpair` calls for the AF_VSOCK family fail with EAFNOSUPPORT, the three `io_uring` calls fail with EPERM, and a process using a CPU architecture other than x86_64 or aarch64, or the 32-bit x32 system calls, is killed. Everything else is allowed. AF_VSOCK is not scoped to the sandbox's network namespace, and in WSL the Windows host answers on it (one of its ports serves your drives), so closing it matters more than the network setting. The self-test checks that a vsock socket cannot be created; a filter that does not load or a failing self-test gives no sandbox, with the warning, never an unfiltered one.
|
|
25
25
|
|
|
26
|
-
Residuals: with the network on, a command can still reach TCP ports on the Windows host and on your network, and can send any file it can see. 32-bit programs (x86 or ARM) and x32 programs do not run in the sandbox. The filter is not a general system call policy.
|
|
26
|
+
Residuals: with the network on, a command can still reach TCP ports on the Windows host and on your network, and can send any file it can see. The sandbox shares the network namespace then, and with it the abstract Unix sockets. On a Linux desktop the X server usually listens on one, so a command could connect to your display; set `workspace.network` to `false` there. 32-bit programs (x86 or ARM) and x32 programs do not run in the sandbox. The filter is not a general system call policy.
|
|
27
27
|
|
|
28
28
|
### Windows: bubblewrap in WSL
|
|
29
29
|
|
|
30
30
|
Install WSL 2 with a distribution whose default user is not root (Ubuntu 24.04 is the tested one), then in that distribution install `bubblewrap`, and Node 26.5 or later if your project needs `npm`. Do not use the `docker-desktop` distribution; it cannot run commands. Set `workspace.wsl.distro` to pick a distribution other than the default; the distribution and user are fixed when a Workspace opens and kept while they still resolve.
|
|
31
31
|
|
|
32
32
|
- Commands run as that user through `wsl.exe` with an argument list, never a shell string, with a minimal environment (PATH, HOME, USER, LANG and a few terminal settings) built inside WSL: nothing from your Windows environment reaches them.
|
|
33
|
-
- The Workspace stays on your Windows drive and the sandbox sees it through `/mnt/<drive>`.
|
|
33
|
+
- The Workspace stays on your Windows drive and the sandbox sees it through `/mnt/<drive>`. Nothing else Windows-backed is visible: your profile, `System32`, `PIROBOROS_HOME` and every `guard.deny` folder. A Windows program inside the Workspace does not run, and the WSL interop socket is masked.
|
|
34
34
|
- `node_modules` lives in a folder in the distribution's own filesystem (under `~/.local/state/piroboros-ws`), so `npm ci` is fast; it is empty on the Windows side and is removed with the Workspace. Files a command writes there are not merged.
|
|
35
35
|
- The Workspace folder is on drvfs, which is slow for many small files: expect the first `git status` in a project of 5,000 tracked files to take most of a minute and later ones a couple of seconds. The start notice gives an estimate above 1,000 files. A path inside the Workspace that the sandbox shows as `/mnt/c/...` is the Linux view of a Windows path; the file tools want the Windows form.
|
|
36
|
-
- `workspace.network: true` gives the commands the WSL VM's network, which includes the Windows host. Set
|
|
36
|
+
- `workspace.network: true` gives the commands the WSL VM's network, which includes the Windows host, and the abstract Unix sockets of the VM. In Ubuntu 24.04 those are systemd's system buses (`bus-system`, `resolve`, `timedate`, `timesync` and `logind` were seen), which an ordinary shell in the distribution reaches too. Set `workspace.network` to `false` to cut both.
|
|
37
37
|
- A project on a network share (UNC path) is not confined, with the reason in the notice.
|
|
38
38
|
|
|
39
39
|
### Docker
|
|
@@ -41,7 +41,7 @@ Install WSL 2 with a distribution whose default user is not root (Ubuntu 24.04 i
|
|
|
41
41
|
Set `workspace.docker.image` to an image you have already pulled, for example `node:26.12.1-trixie@sha256:<digest>`. piroboros never pulls an image; a missing one refuses with the `docker pull` line to run. With the image set and `workspace.confine` at `auto`, Docker is tried first and bubblewrap second; `workspace.confine: "docker"` refuses the run when Docker cannot be used and never falls back.
|
|
42
42
|
|
|
43
43
|
- One container per Workspace, started when the Workspace opens or reopens and removed at merge, discard, hold and recovery. It runs with all capabilities dropped, `no-new-privileges`, at most 1,024 processes, and a stored 64-character container id that every command uses. Containers carry a label with a hash of your `PIROBOROS_HOME`; the startup sweep removes the ones of that hash that no open Workspace names, and never touches another home's.
|
|
44
|
-
- What a command sees: the image, and the Workspace at `/work`. Nothing else of your machine is mounted: not your home, `PIROBOROS_HOME` or your credentials.
|
|
44
|
+
- What a command sees: the image, and the Workspace at `/work`. Nothing else of your machine is mounted: not your home, `PIROBOROS_HOME` or your credentials. `HOME` is `/tmp` inside. On Linux the command runs as your user id; on Windows as the distribution's user. Writes outside `/work` land in the container and are lost when it is removed. `node_modules` is an empty folder in the Workspace (on Windows, a folder in the distribution's own filesystem), never merged.
|
|
45
45
|
- The Engine's built-in seccomp profile is kept, which refuses AF_VSOCK sockets and `io_uring`. An Engine without seccomp is refused. When the container starts, a self-test checks that a vsock socket cannot be created and that `io_uring_setup` fails (it needs `perl` in the image; without it the check is skipped with a notice). A failed check refuses Docker with the reason.
|
|
46
46
|
- piroboros runs the `docker` CLI with an empty client config of its own (so a context or credential helper in `~/.docker` never runs). Only environment variable names are passed to `docker exec`; their values are read from the CLI's own environment, never from the argument list. A command can be at most 131,071 bytes and cannot hold a NUL byte, as with bubblewrap.
|
|
47
47
|
- A command that runs past the timeout restarts the container, which ends everything it started; `/work` survives. When a command exits nonzero, piroboros asks the Engine whether the container is still running. If it is not, or the Engine does not answer, the command fails with `confinement backend unavailable`, no later command runs, nothing runs unconfined, and the run ends held with that reason. A reopen starts a new container.
|
package/package.json
CHANGED
package/skills/conclave/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Shared rules for every member of the Conclave, a sequential team of
|
|
|
5
5
|
|
|
6
6
|
# The Conclave
|
|
7
7
|
|
|
8
|
-
The Conclave is a team of eight agents that work on one task, one after another. Each agent answers one question and hands its findings to the next. You are one of them.
|
|
8
|
+
The Conclave is a team of eight agents that work on one task, one after another. Each agent answers one question and hands its findings to the next. You are one of them. The role text at the end of your brief says which one.
|
|
9
9
|
|
|
10
10
|
## The pipeline
|
|
11
11
|
|