Review pass on the mother MCP infra:
- Rename usb_nodes → hive_nodes: a node is any host that joined the hive
(live-usb/disk/vps/mother), not just a USB boot. Add a first-class
node_type column (live-usb|disk|vps|mother|unknown). The schema migrates an
existing osa DB in place (ALTER TABLE + ALTER SEQUENCE, guarded by
to_regclass) and ADD COLUMN IF NOT EXISTS for already-renamed tables — data
preserved, idempotent. FKs/trigger/indexes follow.
- node-register-mcp: accepts + validates node_type, UPSERTs into hive_nodes.
Add ON_ERROR_STOP=1 (psql otherwise exits 0 on SQL error → false success)
and fold stderr into the captured result so failures are reported.
- setup-mother.sh: apply schema BEFORE granting on its tables (fresh installs
had no tables when grants ran); pipe the schema via stdin so the postgres
user need not read the repo checkout; locate pg_hba via SHOW hba_file (was
hardcoded) and PREPEND the peer rule (pg_hba is first-match); grants target
hive_nodes/hive_nodes_id_seq.
- build-colibri.sh: fast-forward a checked-out branch to origin so it builds
current upstream code, not a stale local copy.
Validated: prettier + sh -n green. Schema migration/UPSERT to be exercised on
osa (no local postgres server here).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>