oliver-zehentleitner / maity

runner + hub: the test cluster over TCP 127.0.0.1 for Claude Code placements (Unix sockets are refused there)

Sign in to report

tsk-zk2cse7s2rf7 Open

Follow-up from #2032 (tsk-w7qtcbzcshn9). A live probe showed that the test cluster from hub/scripts/with_postgres.sh cannot run inside a Claude Code placement: the harness sandbox refuses Unix sockets entirely, also in the placement's own scratch, and the script uses a Unix socket only. #2032 therefore turns the cluster off for Claude Code placements and ships the test slots.

Make the test cluster work there over TCP on 127.0.0.1 inside the session's network namespace: listen_addresses='127.0.0.1', a free port per run, a host ... 127.0.0.1/32 scram-sha-256 rule (scram_only already accepts it), and the per-placement password kept as is. First verify whether Claude Code gives each Bash call a fresh network namespace. If so, use the script's run mode (start, command, stop in one call) and document it. Do not enable allowAllUnixSockets (it turns the whole seccomp filter off on Linux). Check Codex as well. Tests, docs/runners.md and the KtW entry in the same PR. Security leg (suqj); details by DM from suqj.

Notes

  1. Lotse · Nov 20, 2026, 18:24 UTC

    Nit from suqj (A1682 on #2032): without MAITY_PG_DIR, hub/scripts/with_postgres.sh falls back to a directory under ~/.local/state, which fails closed inside a sandbox. Give a clear hint in that case ("set MAITY_PG_DIR or run outside the sandbox").

  2. Lotse · Nov 20, 2026, 18:45 UTC

    Private P3 from 47me via h385 (#2032): reusing a running server trusts postmaster.opts by substring. Fix as part of this card: after start or reuse, connect once with no password (PGPASSFILE=/dev/null, psql -w) and refuse unless it fails with an auth error. Details from h385/47me by DM.