No description
  • Go 71.4%
  • TypeScript 27.5%
  • CSS 0.5%
  • PLpgSQL 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
JD Crawford bcee2208a1
feat(ui): refine session fold rendering and live step visibility
- Introduce `ledgerLines` to split work items into summary and body based
  on fold state, ensuring the live reasoning step remains visible below
  open folds.
- Update `RunFold` and `MessageRow` to use memoized pause states,
  preventing folds from closing when the user has opened them for
  pending questions or approvals.
- Refactor `session.ts` to fix suggestion prompt construction in review
  mode and improve code formatting.
- Update `STYLE.md` to document the new ledger behavior for live steps.
2026-11-22 16:16:51 -05:00
cmd chore: add Docker Compose setup and refine build tooling 2026-11-21 03:24:47 -05:00
docs refactor(auto): introduce static shell classifier and refine approval logic 2026-11-22 16:16:05 -05:00
internal refactor(auto): introduce static shell classifier and refine approval logic 2026-11-22 16:16:05 -05:00
pkg refactor: consolidate input handling and standardize form components 2026-11-13 01:08:33 -05:00
web feat(ui): refine session fold rendering and live step visibility 2026-11-22 16:16:51 -05:00
.air.toml Migrate SPA from Vue to Solid 2 (#6) 2026-11-21 20:29:58 -05:00
.dockerignore chore: add Docker Compose setup and refine build tooling 2026-11-21 03:24:47 -05:00
.gitignore refactor(agents): extract mode prompts to markdown and refactor login routing 2026-11-03 23:13:29 -05:00
AGENTS.md Migrate SPA from Vue to Solid 2 (#6) 2026-11-21 20:29:58 -05:00
compose.yaml chore: add Docker Compose setup and refine build tooling 2026-11-21 03:24:47 -05:00
Dockerfile chore: add Docker Compose setup and refine build tooling 2026-11-21 03:24:47 -05:00
example.branch.config.yaml fix(branch): secure branch config and refactor sandbox configuration 2026-10-30 21:15:52 -04:00
example.config.yaml refactor(db): port persistence and test infrastructure to PostgreSQL 2026-11-21 02:40:04 -05:00
go.mod refactor(db): port persistence and test infrastructure to PostgreSQL 2026-11-21 02:40:04 -05:00
go.sum refactor(db): port persistence and test infrastructure to PostgreSQL 2026-11-21 02:40:04 -05:00
LICENSE Initial commit 2026-09-25 22:04:16 -04:00
mise.toml Migrate SPA from Vue to Solid 2 (#6) 2026-11-21 20:29:58 -05:00
README.md chore: add Docker Compose setup and refine build tooling 2026-11-21 03:24:47 -05:00

ersa-agent

PostgreSQL / ParadeDB

Ersa stores all state in PostgreSQL. The Compose service uses paradedb/paradedb:0.26.7-pg18; no ParadeDB-specific search features are used.

Start ParadeDB with Docker Compose:

docker compose up -d --wait paradedb

The database listens on 127.0.0.1:5432 with user ersa, password ersa, and database ersa. Its connection URL is:

postgresql://ersa:ersa@localhost:5432/ersa?sslmode=disable

To override these defaults, set PARADEDB_USER, PARADEDB_PASSWORD, PARADEDB_DB, or PARADEDB_PORT in .env before starting the service.

The ersa password is for local development. Before exposing the database beyond localhost or storing real data, set PARADEDB_PASSWORD in .env to a strong value.

Set the server config's db.url to the application connection URL:

db:
  url: postgresql://ersa:ersa@127.0.0.1:5432/ersa?sslmode=disable

For a remote PostgreSQL or ParadeDB server, require certificate and hostname verification with sslmode=verify-full; the server rejects other SSL modes for remote hosts. Supply the CA and credentials through protected libpq settings or files rather than committing them:

postgresql://ersa@db.example.com/ersa?sslmode=verify-full

The server takes session-level advisory locks, so connect directly or through a session-mode pooler. Transaction-mode poolers such as PgBouncer are not supported.

Open a SQL shell with:

docker compose exec paradedb sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB"'

From a host with PostgreSQL client tools, store the password in an 0600 ~/.pgpass or another protected PGPASSFILE, then use a password-free application URL. The scratch seed tools use the same variable:

export ERSA_DATABASE_URL='postgresql://ersa@127.0.0.1:5432/ersa?sslmode=disable'
psql "$ERSA_DATABASE_URL"

Avoid putting production credentials directly in shell history; use a protected environment, .pgpass, or the platform's secret store.

Stop the service with docker compose down. Data persists in the paradedb_data Docker volume across restarts.

Ersa server in Compose

Create the host-owned output directory, then start the services:

mkdir -p out
docker compose up -d --wait

This builds the server from the server target of the Dockerfile and starts it on http://localhost:8080, next to ParadeDB. It connects to the database over the postgres_socket volume rather than TCP, so its db.url keeps a socket host instead of the published port.

The config lives at out/compose.config.yaml. The first start generates it with fresh keys and db.url from ERSA_DATABASE_URL; later starts reuse it. If you publish a different port with ERSA_PORT, set domain in that file to match. The service runs as UID and GID 1000 by default; set ERSA_UID and ERSA_GID in .env to your id -u and id -g values if they differ. Database credentials are passed through PGUSER, PGPASSWORD, and PGDATABASE, so URL-reserved characters in the ParadeDB settings do not need percent-encoding.

Tests

Go integration tests and the web smoke test require ERSA_TEST_DATABASE_URL. It must be a postgres:// or postgresql:// URL for an administrative connection whose user can create and drop test databases. Point it at a maintenance database, not the application database:

export ERSA_TEST_DATABASE_URL='postgresql://ersa@127.0.0.1:5432/postgres?sslmode=disable'
mise run test-web

Each test gets a unique database. The smoke test installs db.url for one ersa_smoke_<uuid> database in out/test/config.yaml, verifies that its derived connection selects that database, then drops it after the server stops, including on failures and signals. It requires psql. Inline connection passwords are removed from psql arguments and supplied through protected 0600 libpq files, which ordinary teardown removes. With --keep-server, it retains both the server and database and prints the database name and an exact teardown command using a password-free admin URL and the same protected credentials.

Cutover from Turso/SQLite

The PostgreSQL/ParadeDB deployment starts with a clean slate. There is no Turso/SQLite importer: existing sessions, users, provider settings, and other application data are not copied automatically. Keep the previous deployment and its database files intact, configure a new empty ParadeDB database through db.url, and complete first-run setup again.

Roll back to the previous deployment and its preserved Turso/SQLite files only before the new ParadeDB instance accepts application writes. New ParadeDB writes do not exist in the old files, so a later rollback is not data-preserving.

Backups

See docs/BACKUP.md for encrypted, off-host scheduled pg_dump backups and restore rehearsals, including credential custody, retention, and recovery objectives.