Commit graph

8 commits

Author SHA1 Message Date
8f14ce0573 chore: replace legacy klavdija refs with agent-agnostic names, fix checklist to use Bastille
Replaces hardcoded "klavdija" with ${AGENT_NAME} or generic phrasing across
docs, scripts, and identity files. Fixes fresh-install checklist: jls → bastille
list, parameterized log paths, Bastille-based service checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  605 passed (605)
2026-04-01 21:59:13 +00:00
f637389088 infra: agent-prefix controlplane jail, keep shared services un-prefixed
- setup-controlplane-jail.sh: JAIL=${AGENT_NAME}-controlplane (was hardcoded)
- setup-llamacpp-jail.sh: JAIL=llamacpp — shared service, no agent prefix
- destroy-jails.sh: reads AGENT_NAME from .env, targets prefixed jail names
- heartbeat.sh: checks prefixed name first, falls back to un-prefixed

Architecture decision: llamacpp/db/cms are shared services (one instance,
all agents). Only controlplane is per-agent. Heartbeat handles both naming
conventions during the live migration window.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-29 08:28:41 +00:00
05a79a0bd9 fix: thin jail home mount must target usr/home not home (symlink)
Bastille thin jails symlink /home -> usr/home. fstab entries pointing at
/root/home cause jail start failure: "mount.fstab: symbolic link".
Mount target must be the real path: ${JAIL_ROOT}/usr/home/<agent>.

Discovered during post-reboot controlplane jail startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-28 22:42:49 +00:00
b489e21c92 docs: add jail provisioning scripts from live migration learnings
Lessons captured from the 192.168.100.x → 10.0.1.x subnet migration:

- setup-db-jail.sh: add allow.sysvipc=1 (required for PostgreSQL shmget),
  set postgresql_data in rc.conf, note postgres uid=770 in pkgbase jails
- setup-controlplane-jail.sh: new — node24, nullfs /home/<agent> mount,
  npm-global auto-mounts via ZFS mountpoint (no fstab entry), rc.d service
- setup-llamacpp-jail.sh: new — llama-cpp pkg, ro models mount, creates
  llama_chat rc.d (not shipped with pkg, needed for second instance :8081)
- setup-cms-jail.sh: new — nginx + node24, Strapi deferred

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-28 22:27:41 +00:00
89537cbb76 fix: setup-db-jail.sh — pg17, add contrib for pgcrypto, fix pgvector pkg name
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-27 22:09:11 +00:00
e0623a31c5 refactor: make agent name agnostic across runtime and installer
hostd/types.ts: derive SOCKET_PATH and PID_FILE from AGENT_NAME env
hostd/daemon.ts: read socket group name from AGENT_NAME env
setup-db-jail.sh: read DB_JAIL_NAME and DB_JAIL_IP from .env with fallbacks,
  support JAIL_SUBNET_BASE alongside AGENT_SUBNET_BASE

Default throughout: 'clawdie' (unchanged behavior when AGENT_NAME unset).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-27 17:02:58 +00:00
2e2f0ca030 fix: broaden pg_hba rule to all users/databases from host subnet
Allows Strapi (and any future app) to connect to the same PostgreSQL
instance without needing additional pg_hba entries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-27 16:32:47 +00:00
39e92a65ae feat: add setup-db-jail.sh — one-shot ai_brain PostgreSQL jail setup
Creates the db jail via bastille, installs postgresql16 + pgvector,
configures listen/auth for the host subnet, creates the ai_brain DB
and user, applies all three schema migrations, and enables the jail
on boot. Reads all values from .env. Idempotent — safe to re-run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-27 16:29:51 +00:00