Context
The Ditto worktree container's fire-and-review agent board is backed by pgrust (v0.2, AGPL-3.0) — an experimental Postgres rewrite in Rust that is wire-compatible with Postgres 18.3 and passes the full 46k regression suite, but is explicitly not production-ready. That's acceptable there because board data is recoverable state (rebuildable from .pid/.out files and PR state). The seam is a tb-ticket CLI speaking the Postgres wire protocol via psql, so the backend swaps to real Postgres with env vars (TB_PG*).
Setup learnings worth keeping (currently encoded in the container's board.just):
- The published
linux-aarch64 binary targets Debian/Ubuntu; on a Nix-based container it needs patchelf --set-interpreter/--set-rpath to nix's glibc + libstdc++.
- Postgres tooling refuses root; in the root-only dev container the server runs as
nobody via setpriv --reuid=65534 (user namespaces are seccomp-blocked; plain setuid is not).
- pgrust ships no
initdb/psql — client tools come from nix shell nixpkgs#postgresql_18, with PGRUST_PGSHAREDIR/PGRUST_TZDIR pointed at nix store paths.
Exploration goals
- pgrust natively: kick the tires beyond the board — perf claims (vectorized/JIT executor, ClickBench), behavior under the kind of concurrent small writes the board does, failure modes. Decide whether it stays the board backend or gets swapped for boring Postgres/SQLite.
- pgrust-wasm: the repo ships its browser build in-tree (
wasm/build.sh, WASI target via pgrust-wasi.js, REPL page, pack-vfs.mjs VFS packer). Build it with a nix-provided Rust + wasm32-wasi toolchain and understand the pipeline.
- Snapshot-shipping board UI (maybe): a browser-resident pgrust is a separate engine with its own VFS — it cannot connect to the native server's socket or data dir. The only coherent web-UI design is: dump the tickets table at render time, load the dump into wasm-pgrust in the page, query interactively. For a ~12-row board this fails the needs-vs-wants test (the static
board.html render is the right shape), so this track is play/evaluation of pgrust-wasm itself, not a board requirement.
- Harden the dev image (related): bake a
pgrust user + postgresql client tools into the Dockerfile so the setpriv dance and nix-summoning disappear.
References
Context
The Ditto worktree container's fire-and-review agent board is backed by pgrust (v0.2, AGPL-3.0) — an experimental Postgres rewrite in Rust that is wire-compatible with Postgres 18.3 and passes the full 46k regression suite, but is explicitly not production-ready. That's acceptable there because board data is recoverable state (rebuildable from
.pid/.outfiles and PR state). The seam is atb-ticketCLI speaking the Postgres wire protocol viapsql, so the backend swaps to real Postgres with env vars (TB_PG*).Setup learnings worth keeping (currently encoded in the container's
board.just):linux-aarch64binary targets Debian/Ubuntu; on a Nix-based container it needspatchelf --set-interpreter/--set-rpathto nix's glibc + libstdc++.nobodyviasetpriv --reuid=65534(user namespaces are seccomp-blocked; plain setuid is not).initdb/psql— client tools come fromnix shell nixpkgs#postgresql_18, withPGRUST_PGSHAREDIR/PGRUST_TZDIRpointed at nix store paths.Exploration goals
wasm/build.sh, WASI target viapgrust-wasi.js, REPL page,pack-vfs.mjsVFS packer). Build it with a nix-provided Rust + wasm32-wasi toolchain and understand the pipeline.board.htmlrender is the right shape), so this track is play/evaluation of pgrust-wasm itself, not a board requirement.pgrustuser + postgresql client tools into the Dockerfile so the setpriv dance and nix-summoning disappear.References
wasm/dir for the browser buildjustfile/recipes/board.just,bin/tb-ticketin the Ditto worktree container