← Alter Wiki

The self-compiling wiki

How a stream of captures becomes a stable page: compression, a plain-Postgres queue, and user-edits-win.


The wiki is the part of Alter that does the remembering: the piece that once made “second brain” a fair description, and the reason I stopped leading with the phrase, since it names the machinery rather than the job. Captures don’t just pile up against a topic. Once three or more accumulate (or after 24 hours), a compilation worker compresses them into the page itself. The semantics are compress, not append: the page stays a readable summary rather than a growing log, and anything you wrote by hand is preserved untouched. After each compile, the page is re-indexed for hybrid semantic + keyword search, and it becomes one of the pages you reach by browsing Life.

The queue behind this is deliberately boring: plain Postgres, using FOR UPDATE SKIP LOCKED with a UNIQUE(entity_id) constraint so multiple pending compilations for the same page coalesce into one. There’s a five-level priority system for what triggered the work, windowing so a busy page doesn’t thrash, and a user-edit-wins rule: if you edit a page mid-compilation, the job aborts and re-enqueues rather than fighting you.

Reaching for Bull here would have been the default move, but each service carries a fifteen-dependency budget, and Postgres was already there. Vector re-indexing follows the same discipline: page writes never call the vector service directly. They go through an outbox, so indexing can lag but never block or lose writes.