The engine stands alone
What started it
On 2026-11-30 the owner asked for the whole repository to be created locally and joined to GitHub later, and let the session go on at its own pace.
The owner had decided the same day that the engine of Second Brain GD would get a repository of its own, open source and self-hostable, extracted and not rewritten. This loop is that extraction.
What changed
- An inventory first. The source was read without being written, file by file: keep, split, or
leave in the desktop app. It is
docs/extraction-inventory.md, committed with the mission before any code. - Copy, then split, then rename, one commit each, so that each step can be compared with the source. 51 Python files and the twenty migrations came over unchanged; the installer, the voice, the agent room, the browser extension, the chat and the background jobs stayed behind. The package is 9,860 lines.
- The hard cut was the assistant's core file: the archivist borrowed its journal, its undo and its model call from a file that was mostly the chat. It was cut by whole functions; the engine half stayed.
- A start command,
archivist, configured by environment variables, which accepts a loopback address only and stops with one line naming the variable when a value is missing. - The same data. The twenty migrations are byte for byte the source's, and a test holds their checksums: a Brain made by the desktop app has the schema this engine expects.
Tests
| Tests | Count | Why |
|---|---|---|
| In the source | 356 | |
| Not copied | 135 | seventeen files that test what stayed in the desktop app |
| Left after the split | 45 | the chat, its tools, the PDF export, the installer |
| Carried over | 176 | four of them adapted: their subject stayed, their vehicle was the chat |
| New | 33 | MCP over HTTP, configuration, checksums, installed package, imports |
| Run | 209 | 208 passed, 1 skipped (Tesseract is not installed), 0 failed |
$ uv run python -m unittest discover -s tests/python -t . -v Ran 209 tests in 48.693s OK (skipped=1) $ uv run ruff check archivist tests All checks passed!
The suite was run again by the piloting session after the build, with the same result, on Python 3.12.3. Python 3.13 was not run.
Real use
The engine was started from a fresh clone with the README's commands and called with curl; the full transcript
is docs/first-run-transcript.md. The piloting session then ran its own check in a temporary data
folder:
started pid=… ; rss=VmRSS: 50124 kB
health: {"status":"ok","database":"ok","version":"0.1.0", …}
no token on management: 401
client id=c7be4c4c67a token length=49
tools/list: 200 · 13 tools for a client of level propose_items
wrong token: 401 {"error": "unknown or revoked token: connect this tool again from the app"}
propose_item: 200 {"proposal": "p8a6f43766a", "status": "pending",
"receipt": "waiting for the user's approval in the app (proposal p8a6f43766a); check later with my_proposals"}
stopped; server.json left behind: no
started pid=… ; rss=VmRSS: 49396 kB
after restart, my_proposals: 200 · the same proposal, still pending
revoke: 200
revoked token: 401
About 50 MB of resident memory at rest on a new Brain. That says what the engine takes when idle, not under load or with a large Brain.
Found on the way
- Fixed: a stop by SIGTERM skipped the cleanup and left the service recorded as running.
- Fixed: the copy of a client's token written for the stdio relay could be read by other accounts of the machine. It is now private to the user, and a test checks it.
- Kept and listed: an item proposed without a model key is never filed later on its own;
GET /healthwrites to the database; messages still speak of « the app »; the archivist's prompt and receipts are in French.
What is left
- Python 3.13, the CI workflow, a call to a real model, a real Brain made by the desktop app, a real MCP client: none of them was run.
- The engine is local only. Hardening it for a network is a loop of its own, and its list is at the end of the inventory.
- The repository has no remote: nothing is pushed.
- Until the desktop app runs this engine, two copies of it exist.
Report: loops/001-report.json. Mission: loops/001-mission.md.