Public: anyone can read this; the crew can change it.
Spike: a tiny Linux computer inside the forge process with unkernel (github.c… #17126
Check · Review · Land · Live done — Landed and live in production.
Spike report only, no code ships: docs/SPIKE-UNKERNEL.md holds the numbers, the licence reading and a recommendation. The git/bun install/test run in Alpine could not be done here. I changed no package.json and no forge.json egress.
-
Reviews
ApprovedA docs-only spike report: docs/SPIKE-UNKERNEL.md, its row in DOC_LINES, its mention in REFERENCE.md, and a test that fails if the row is removed. It adds no dependency, no egress, no runtime code and no README text. The report states what could not be measured (the Alpine path, because GitHub was unreachable) and does not overclaim. It gives a clear recommendation: do not ship, and run one small follow-up. The licence section is honest that it is an engineering reading and not legal advice. The doc page answers 200 on the preview.
Two things I would do next:
- Run the follow-up the report names: Alpine with git clone, bun install and bun test timed against native, and one process per guest to see whether memory is released. Mirror the 4 MB image into a blob the forge controls if GitHub stays unreachable. File it as its own issue.
- Before anything is built on the host-command pattern, write its allowlist rules (subcommands and paths) as a short design, since the report itself says the host function is the policy point.
-
Checks
shipped production is serving it deploy c1c75da
-
History
- Test that the unkernel spike page is listed under internals (#16837) 7766988
- List the unkernel spike in the docs index and REFERENCE (#16837) 30b3c33
- Direction: measure unkernel under Bun as a sandbox and per-person computer, report numbers and licence (#16837) e88fbef
- A DXF drawing can be moved, scaled or have a layer removed, previewed, then saved as one commit, from the page and from MCP (#17077) 63ed874
- Sentinel: memory-growth was degraded 31 minutes today: The forge's own memory is 5754 MiB, over twice its first-hour 2064 MiB and past the 2176 MiB more its database caches m… (#17108) e5218fb
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:10bdvndtlg is past its budget: trevato/forge: "each page stays inside its first-view budget" failed on 3 pulls in the last hour — the lane's red, not … (#17106) 18b6c25
- A sleeping forge wakes when its app's own timer falls due (#17105) 39a436d
- Gate's comment rewrap reflows // comments inside JS template strings, which can break page scripts (#17102) 30ecfb4
- An outside runner picks up a new forge build between jobs, never mid-job (#17099) 492abf7
- Registry: per-app ownership records for installed items (#17055) 6517425
- /explore evaluates rate, sum by and topk over the metric series and draws the result as a chart above a table (#17063) 5152c61
- A handed-over runner job is judged by its own lease, so a slow boot or the orphan lapse no longer loses it (#17096) d5ab98b
- The production-size budgets count a pass over the runs as the pages make one: rows read into objects (#17100) 4388979
- Security against 24/7 agent swarms: OSV dependency scans with auto-fix pulls, secret scanning at push, code scanning in review, an exposure map with rate limits, a scheduled red team (#16997) e1014df
- The shared tier is sold beside the dedicated one, with a density number a test measured (#17008) 7cc450a
- The cockpit: board and map as one screen, driven by four keys, readable from a TV, with nothing that needs you that a rule could answer (#16844) 2b7a2cb
- Merge scanTomlValue and scanYamlValue into one value scanner (#17091) dcc6797
- Merge scanJsxTag and scanHtmlAttributes into one tag-attribute scanner (#17088) 821c831
- Repo header: descriptions clamp to 2 lines with expand (apps API separates description from brief), and a clear crew status line: "paused at its ceiling" with a Raise button (#16936) 81d5354
- A push that adds a secret-shaped line is flagged before it lands (#17066) 068c207
2 earlier comments
Spike report only, no code ships: docs/SPIKE-UNKERNEL.md holds the numbers, the licence reading and a recommendation. The git/bun install/test run in Alpine could not be done here. I changed no package.json and no forge.json egress. Nothing in the forge calls out to unkernel yet. I ran bun scripts/gate.ts and --fix, and the gate printed nothing. I did not run tsc or bun test, because the commit is docs only.
What I could not measure. The sandbox cannot reach github.com, and the Alpine image downloads from a GitHub release. So item 2 (git clone, bun install, a test run in Alpine) was not run. I measured the package's bundled busybox base instead.
Numbers (Bun 1.4.4, one loaded shared host, single runs):
- Boot under Bun. It boots. Node 20 fails the JSPI check, and Bun 1.4.4 passes it.
createKerneltakes 171 ms, and the firstexecreturns about 0.6 s after boot.- A cold guest in a worker reaches its first
execin 0.62–0.68 s. - Each extra guest in a worker adds about 70–80 MiB RSS at 64 MiB of guest RAM; the first adds about 150.
- RSS did not fall within 3 s of poweroff, so memory release is not shown.
- CPU against native, busybox workloads. The guest is 20–70× slower on CPU-bound work: shell loop 24×, sha256 20×, sort 70×, gzip 48×. Process creation was not slower here (guest 3.4 s against 6.2 s native for 2,000 spawns), but process creation in this sandbox is slow. Expect clone, install and test to be 1–2 orders of magnitude slower. That path is unverified.
- Disk in SQLite. A 90-line
BlockDeviceoverbun:sqlite(4 KiB blocks) works.- A 20 MB file written in one process was read back after
poweroffin a new one. - An empty 4 GiB ext4 volume is 2.2 MB on disk, seeded in 145 ms; with the 20 MB file it was 25.5 MB.
- An Alpine root was not measured.
- A 20 MB file written in one process was read back after
- Host command.
forgeruns on the host with the bearer token, and the API returned the right JSON to the guest. The token was not found in the guest'senv,/proc/*/environ, or command lines and files. The host function is the policy point, so it must allowlist what the guest may ask for. - Web terminal.
vm.spawnpty to a Bun websocket worked, with a 35 ms round trip, including a host-command call.
Licence. The kernel is GPL-2.0, and the npm package is MIT AND GPL-2.0-only. Loaded as a separate unkernel.wasm and called only through the MIT SDK, it stays arm's length from forge source. A hosted forge is not distribution. A sold forge that includes the wasm is distribution, so it needs the GPL text and the corresponding source (the pinned release and its patches) or a written offer. It also needs the THIRD-PARTY.md notices, and the wasm must not be embedded in a closed single binary. This is an engineering reading, not legal advice, so have a lawyer confirm before a sold forge ships it.
Decisions and recommendation:
- (a) Do not replace bwrap/Landlock for agent steps. Isolation is strong, but compute is too slow and the clone/install/test path is unproven. It may suit short shell-bound steps.
- (b) Per-person computers that sleep and wake in under a second look feasible. State is one SQLite file and the cold wake was under 0.7 s. Memory release after stop and the real Alpine size are still open.
- (c) Adopt the host-command pattern for keeping secrets out of the sandbox, whatever happens with (a).
- Follow-up. Repeat items 2 and 3 with Alpine on a host that can reach GitHub (or a mirrored 4 MB image), with clone, install and test timed against native, plus one process per guest to measure memory release. Until that path is under about 5× native, do not ship.
To try it. Read docs/SPIKE-UNKERNEL.md. To reproduce, run bun add unkernel in an empty directory and use the snippets the doc describes.
🤖 Generated with Claude Code
This pull adds docs/SPIKE-UNKERNEL.md, the report from a spike that ran unkernel under Bun as a sandbox and a per-person computer. It reports numbers and licence. Nothing ships, and no dependency was added.
The first push failed two docs tests because the new document wasn't listed anywhere. I fixed that by adding it to docs/REFERENCE.md, under "Where the rest is", next to the other spikes. I also added a DOC_LINES entry in src/view/doc_sections.ts, which puts it in the Internals section of /docs. The two failing tests (test/docs-link.test.ts and test/readme-front-door.test.ts) now pass, and tsc is clean. I didn't run the rest of the suite, so the forge's full check on this push is the first full run since those two went red.
The DOC_LINES sentence and heading I wrote for the new document are my own wording. Change them if you'd rather describe the spike differently.
To try it, read docs/SPIKE-UNKERNEL.md, or open /docs and find the entry under Internals.
This pull adds a spike write-up, docs/SPIKE-UNKERNEL.md, measuring unkernel under Bun as a sandbox and a per-person computer, and lists it in the docs index and docs/REFERENCE.md. The previous check failed because the new index line had no test. This push adds the test and a Try: line in the commit message.
- Test:
test/docs-index.test.tsnow checks thatSPIKE-UNKERNEL.mdappears under Internals with its own one-line description. It fails if theDOC_LINESrow insrc/view/doc_sections.tsis removed. - How to try it: open
/docson the preview and look for "Spike: unkernel under Bun" under Internals. - Checks:
test/docs-index.test.tspasses (5 tests),tsc --noEmitis clean, and the gate's two failures are gone. The gate still prints a note about a comment over 100 columns insrc/view/doc_sections.ts. It says nothing needs doing and the nightly rewrap handles it on main. - Branch: the branch is behind
main, so a diff againstmainshows many files that this pull did not touch. - Not done: I did not rebase.
Spike report only, no code ships:
docs/SPIKE-UNKERNEL.mdholds the numbers, the licence reading and a recommendation. The git/bun install/test run in Alpine could not be done here. I changed nopackage.jsonand noforge.jsonegress. Nothing in the forge calls out to unkernel yet. I ranbun scripts/gate.tsand--fix, and the gate printed nothing. I did not runtscorbun test, because the commit is docs only.What I could not measure. The sandbox cannot reach
github.com, and the Alpine image downloads from a GitHub release. So item 2 (git clone,bun install, a test run in Alpine) was not run. I measured the package's bundled busybox base instead.Numbers (Bun 1.4.4, one loaded shared host, single runs):
createKerneltakes 171 ms, and the firstexecreturns about 0.6 s after boot.execin 0.62–0.68 s.BlockDeviceoverbun:sqlite(4 KiB blocks) works.poweroffin a new one.forgeruns on the host with the bearer token, and the API returned the right JSON to the guest. The token was not found in the guest'senv,/proc/*/environ, or command lines and files. The host function is the policy point, so it must allowlist what the guest may ask for.vm.spawnpty to a Bun websocket worked, with a 35 ms round trip, including a host-command call.Licence. The kernel is GPL-2.0, and the npm package is MIT AND GPL-2.0-only. Loaded as a separate
unkernel.wasmand called only through the MIT SDK, it stays arm's length from forge source. A hosted forge is not distribution. A sold forge that includes the wasm is distribution, so it needs the GPL text and the corresponding source (the pinned release and its patches) or a written offer. It also needs theTHIRD-PARTY.mdnotices, and the wasm must not be embedded in a closed single binary. This is an engineering reading, not legal advice, so have a lawyer confirm before a sold forge ships it.Decisions and recommendation:
To try it. Read
docs/SPIKE-UNKERNEL.md. To reproduce, runbun add unkernelin an empty directory and use the snippets the doc describes.🤖 Generated with Claude Code
Closes #16837