UnoCode: a VS Code-class editor on an OS with no processes, and the assistant it grew
On the morning of August 20, at 04:45, the OS got a code editor. Not a text editor with syntax colouring; those it already had. A workbench in the shape of Visual Studio Code, with an extension host that runs real extensions, on a machine that has no processes to run them in. Thirty-one hours later the editor had left the OS repository for a public one of its own and grown a network stack, a language-server client and an AI assistant. This is what that editor is, why it moved out, and what building the assistant found underneath it.
What it is, and what it refuses to pretend
6e5fe618, August 20, 04:45: "unocode: a VS Code-class editor for pc64, with a real extension host." The message is long; this is the design decision:
WHAT MAKES IT A CLONE RATHER THAN A LOOKALIKE: the on-disk formats are VS Code's, key for key. A colour theme, a keybindings file, a snippet file and an extension manifest written for VS Code load here unmodified. That was the design constraint - an editor nobody can write an extension for is a text editor with ambitions
Extensions run as CommonJS modules on unojs, the OS's own JavaScript engine, against a subset of the vscode API. On an operating system with cooperative scheduling and no process boundary, a runaway extension is a dead desktop, so the host is "FUEL-BOUNDED": every entry from C into JS gets a fuel slice, resumes a bounded number of times, then stops and disables the extension. The contract, pc64/unocode/UNOCODE.md, calls that "the whole safety story."
Two things in that commit matter for everything after it. First, what it does not do: a section headed "WHAT IS NOT HERE, and is said so rather than stubbed" lists hover and definition providers, extension diagnostics, webviews, word wrap. The terminal "is a small shell of UnoCode's own, because pc64 has no shell process to host and no process model to host one in; help lists exactly what exists and an unknown word is an error, never a silent no-op that reads like a shell that ran something." Hold onto that sentence.
Second, what verification caught. A twelve-scene harness boots the real image under QEMU and drives the editor, "leaving a screenshot per step." The scene that types into a document "earned its place": "a cursor-adjustment boundary that never advanced the caret on a plain insertion made every typed line come out BACKWARDS, and every other check in the gate passed while it did, because nothing else typed into a document." Seventy-one host checks green, and the editor typed backwards. The build commit (f7a7f70e) records a smaller cousin: copying the sample extensions to a FAT volume "shipped a lower-case themes/ once and the theme silently did not load."
That is the editor in v3.34.0: workbench, command palette, themes, an integrated terminal, an extension host. It is pc64-only, not one of the 11 cross-port reference apps; it is one of the 23 pc64 applications exercised on metal in the conformance run.
Seven hours later, the same C on a desktop
At 11:45 the same morning, in a different repository, 0a24bab: "phase 0: the unmodified UnoCode core boots on a desktop host," an SDL2 shell around an editor core taken "from the pinned upstream submodule untouched." That repository is hmofet/unocode-desktop, public, MPL-2.0, the same licence as the OS: "about 23,000 lines of C, with no browser engine and no JavaScript runtime underneath it," per its README, with roughly 1,500 lines of host around it. The benchmark commit (6a50bac) ends:
The loss is recorded too: idle with a file open, clean VS Code uses ~0% CPU and UnoCode ~1.2%, because the host's event loop wakes every 15 ms regardless. That is a fixable inefficiency in the shim, not an architectural cost, but a benchmark that lists only its wins is an advertisement.
The wins, from BENCHMARK.md, against VS Code 1.126.0 on the same machine and folder: 276 ms to a usable window against 1,126 ms for a clean-profile VS Code; 39.6 MB private bytes against 895.6; one process against eight; 6.5 MB on disk against 886.
The release falls here, and the editor leaves home
v3.34.0 was tagged at 05:26 on August 21. Everything from here on landed after it, and shipped in v3.35.0 on October 9.
9d5deabe, 11:52: "unocode: it is upstream now, and this tree vendors it." The canonical source moved to the desktop repository's core/, and the OS's copy became "a generated drop with a do-not-edit banner on every file, exactly as pc64/apps/DUUM.PY already is, and for the same reason: the thing has more targets outside this OS than inside it." The desktop still submodules the OS for the toolkit, the JS engine and the framebuffer; the OS vendors the editor back; in the desktop side's words (6769aa8), "Nothing is canonical in both places." And the foot-gun that had already fired that morning: the desktop's build "compiles the editor and its foundations, never the kernel, so a core change can gate green there and not compile here - it did, on a one-line export, which 029a4f17 fixed." So a sync into the OS is gated by the OS's own gate. That lesson recurs in the next essay.
One afternoon: the assistant
Between 12:46 and 17:19 on August 21, seven numbered tasks (UCD-45 to UCD-51 in the desktop repo's ROADMAP.md) took the editor from no networking at all to an assistant extension.
The OS already had a model client. Studio, the in-OS IDE, has shipped an AI pane since 60ba401f (July 20), built from kernel exports. It is the client whose one-character mistake is the centre of essay 06. Lifting its transport into the editor exposed two defects, fixed the same day in ee8ba5ee, "studio: send the whole conversation, to a model that still exists": "IT HAD NO MEMORY. build_request() put ONE user message in the body while the pane drew, bounded and scrolled a whole transcript above it. So 'make that blue' arrived at the model with no idea what 'that' was, and the pane looked like the thing that was broken." The second was a default model string two generations stale.
The seam (083c7f9) is a socket seam, not a request seam, because the browser's HTTP client in the same tree "hard-codes a form-encoded POST with no way to add a header, so the one other thing in the OS that needed an API key in a header had to go around it and write its own transport." It uses the kernel's non-blocking TLS handles rather than the blocking calls Studio used, "which is exactly why its assistant freezes the desk while it thinks"; the OS had never exported those handles to modules, and d9e03433 did.
The HTTP client (725b482) streams, and its test rule is the thing to copy: "AN SSE EVENT ARRIVES IN PIECES... A decoder that assumed one read is one event passes every loopback test ever written and then drops events over a real network, intermittently, on somebody else's machine - so the test feeds it ONE BYTE AT A TIME." The live proof is an unauthenticated POST to the real API that "earns a 401 and a JSON error body... and needs no secret to run."
Secret storage (bf91fa0, vendored as ceb53e32) applies the refusal rule to security. The desktop answers with DPAPI, the Keychain or a 0600 file. The OS answers with a plain file on FAT, "and the UI says so when a key is saved. FAT has no owners and no permissions, so anything cleverer would be theatre."
Then the assistant (c1b52d1, vendored in ac97bee4): "UCD-51: the Assistant - an extension that writes software, pen withheld." "EVERY WRITE IS A DIFF FIRST," and a rejection is fed back to the model as a tool result. The run tool closes the loop essay 06 opened. There, the assistant's one-character mistake produced a blank window because the OS discarded the traceback on its way to nowhere. Here, run "resolves '' on a clean launch or the shell's reason - on pc64 the Python error text, which is exactly what the fix-and-run-again loop reads." The error the OS used to eat is now what the model iterates on. And on the desktop, which had no process model that afternoon, the tool is not refused; it is absent: "Run is capability-gated, not attempted... so the run tool is ABSENT from the prompt on a platform that would only refuse it." The OS hook (f581a56d) is titled "the run capability, asked not attempted."
Where it went wrong: the engine under the extension
The assistant was the first extension to use the OS's JavaScript engine in anger, and it found two bugs there, both the agent's own from earlier in the project. 29f1e721, 17:19: "unojs: honour fromIndex, and stop the for head eating its first token."
String.indexOf and Array.indexOf DROPPED the fromIndex argument, so every scanner written as
i = s.indexOf(x, i) + 1found the same first hit for ever - an infinite loop that grinds its whole fuel budget before the first frame paints, which presents as a black screen, three abstraction layers from its cause.
The fuel bound held; the machine went black instead of hanging, which is what a safety net looks like from inside. The second bug is the one that keeps me honest about what "tests pass" means:
for (var i = 0; ...)lost itsvarand "worked" by assigning a GLOBAL instead of declaring a local - correct output, wrong scope, the kind of pass that is worse than a failure. Every loop in the test suite was writtenfor (var ...)at global scope, which is why neither showed.
An engine that had run the browser and the sample extensions for weeks, silently turning every loop variable into a global, under a test suite whose every loop happened to be global. The new test "fails against the old parser with the right output."
And the honest limit, from the chat-view commit (9e75dcb): "A streamed 200 needs a real key and is the one path not driven live." Everything up to the server's refusal is driven by the gate; the write-run-fix-run session on the device needs a real key in the store. The repo says so, and so do I. (Since then it has been driven live with a real key, on camera: the UnoCode scene in the v3.35.0 demo film is a real answer, not a script.)
That night: someone else's compiler
b98ac1c, 23:22: "UCD-22: a language server client - transport, lifecycle and document sync." The opening is the argument: what the editor "still fakes about a language" is faked "because writing a C parser, then a Python one, then a TypeScript one, is not a task with an end. This is the standing answer: someone else's compiler front end, already correct, speaking JSON-RPC down a pipe."
Under "FOUR BUGS THE LIVE RUN FOUND AND READING WOULD NOT HAVE": "A dead child killed the editor. Writing to a pipe whose reader has exited raises SIGPIPE, and its default disposition is to terminate - so a crashed language server took the whole editor with it, exiting 141 with not one line of output." Verified against real clangd and pyright. On the OS, the vendored client (70438771) does what the first commit's terminal did: "Nothing here starts a server. uc_proc_available() answers 0 on pc64, so the client never spawns anything and every entry point returns immediately." The next morning the grammar engine was found to be loading Microsoft's TypeScript grammar as 36.7% of itself, and that story belongs to the next essay.
One paragraph on the office suite
The same day the editor landed, the office suite got OOXML, and it shipped in v3.34.0. docs/OFFICE97-PLAN.md had ruled .docx, .xlsx and .pptx out of scope because they "need a deflate compressor." 4b02e035 (August 20, 13:09) opens: "They do not. OOXML requires a zip CONTAINER, not a compressed one, so the writers emit stored entries and only the decompressor is needed." The writers are judged with LibreOffice as an oracle, and the trap worth carrying is that the parts are UTF-8 and the models CP-1252, "Caught by dumping the same spreadsheet from its .xls and .xlsx twins and diffing: 'café' against 'café'." The suite commit (fe639826) sniffs the container rather than trusting the extension; essay 06 records all three formats opening on metal.
The lesson
The editor's first commit stubbed nothing it lacked, and said so. The terminal's unknown word is an error. The secret store warns when it is a plain file. The language-server client on the device answers "no processes" and returns. The assistant's toolbox is built from those answers, so the model is never offered a tool that would only refuse. Make a system state what it cannot do in the same place it does what it can, and build the next layer on those answers rather than on hope. Every bug in this essay that hurt was a silent pass: a pane that sent one line of a conversation, an indexOf that ignored an argument, a for loop that "worked" by leaking globals. The next essay is about what that costs when the silence is inside a grammar engine: harnesses that execute the built binary and diff what it renders, because an agent's claim that something works is not evidence.
Sources: https://github.com/hmofet/unodos, commits 6e5fe618, f7a7f70e, 4b02e035, fe639826 (August 20), 82a7fe90, 9d5deabe, 029a4f17, d9e03433, ee8ba5ee, ceb53e32, 29f1e721, ac97bee4, f581a56d, 70438771 (August 21), 60ba401f (July 20); pc64/unocode/UNOCODE.md at v3.34.0, pc64/UNOCODE-UPSTREAM.md, docs/OFFICE97-PLAN.md, unodoc/UNODOC.md. https://github.com/hmofet/unocode-desktop, commits 0a24bab, 6a50bac (August 20), 6769aa8, 083c7f9, 725b482, bf91fa0, 9e75dcb, c1b52d1, b98ac1c (August 21), 9ce89a6 (August 22); README.md, BENCHMARK.md, ROADMAP.md. Articles 06 and 08 of this series.