Public: anyone can read this; the crew can change it.
forge.db and ssh/host_ed25519 leave the tree, and the tree refuses runtime state #671
Check · Review · Land · Live done — Landed and live in production.
The host private key is no longer tracked. The forge now refuses to boot with its state inside its own checkout, and the gate fails if a private key or a SQLite database is committed.
shipped production is serving it deploy 4183511
Sign in to join this conversation.
new above
offline
The host private key is no longer tracked. The forge now refuses to boot with its state inside its own checkout, and the gate fails if a private key or a SQLite database is committed.
ssh/host_ed25519andssh/host_ed25519.pubare deleted.forge.dbhad already been removed in #580..gitignorenow lists/forge.db*,/ssh/and/*.sock.src/kernel/data_home.ts, called fromsrc/main.tsbeforecreateApp): git finds the root of the checkout the forge runs from. IfFORGE_DATAis that root, or a path inside it thatgit check-ignoredoes not cover, the forge prints one line saying why and exits 1. A path that doesn't exist yet is checked with a trailing slash, sodata/in.gitignorecovers a data directory that hasn't been created. A forge running from outside any git checkout (an image, or acheckout-indexdeploy) is left alone. The defaultdata/still works, and so do production and preview, whose data directories are elsewhere.scripts/tree.ts, run bytest/tree.test.ts): it fails on any tracked file that starts with the SQLite header or contains a-----BEGIN … PRIVATE KEY-----block, unless that file is listed inFIXTURES. That list is empty for now. The forge's check directory has no.git, so there the rule walks the directory instead of runninggit ls-files, skippingnode_modules. The source and test files build the key header in pieces so they don't trip the rule themselves.test/data-home.test.tscovers the checkout itself, a path that resolves to it, an unignored path inside it, ignored paths that exist and that don't, a path outside it, and no checkout at all. It also bootssrc/main.tswithFORGE_DATAset to the checkout and expects exit 1 with one line on stderr. That boot test is skipped where there is no.git, becausemain.tswould really boot there.test/tree.test.tschecks the real tree and unit-tests the detector and the allow-list. Both files are added toGATE.I chose not to rewrite history: the key still exists in past commits. No live forge uses it, so removing it from the tree is enough.
To try it:
FORGE_DATA=. bun run src/main.tsprints the refusal and exits.git show HEAD~1:ssh/host_ed25519 > ssh/k && git add -f ssh/k && bun test test/tree.test.tsfails.bun x tsc --noEmitand the full gate (bun scripts/test-shards.ts --timeout 60000 --gate) pass: 914 tests, 0 failures. I had to run them outside my sandbox, which refuses the Unix sockets the tests listen on.🤖 Generated with Claude Code
Closes #622