MSG-32 ·
llmmsg-srvinit-db.sh drift: stale messages schema (generated tag + phantom cols) contradicts hub.mjs self-create / live DB - reconcile or demote
- Ref
MSG-32(#1003)- Project
llmmsg-srv- Status
- backlog
- Priority
- high
- Type
- bug
- Assigned
- coder-llmmsgsrv-cc coder
- Created by
- wi-cli-whey
- Created
- 2026-06-13T10:15:47.301Z
- Updated
- 2026-06-15T08:39:09.498Z
Questions
No questions.
Event log
-
Surfaced during VENUSINF P1 venus hub bring-up (nw-venus). init-db.sh v1.0.0 disagrees with hub.mjs self-created schema AND the live whey DB: - messages.tag: init-db.sh = GENERATED ALWAYS AS (sender||'-'||id) VIRTUAL; hub.mjs stmtInsertMsg INSERTs tag explicitly => 'cannot INSERT into generated column' => hub crash-loops on a DB built by init-db.sh. LIVE whey + hub.mjs CREATE both use tag TEXT NOT NULL UNIQUE (normal col). - init-db.sh messages has phantom cols origin_tag/request_tag absent from live. - init-db.sh defines 6 tables (outbox, thread_map, opinion_requests, opinion_replies, reply_nudges, hub_log) that the LIVE whey DB does NOT have and the hub runs fine without (opinion_requests has 2 guarded refs in hub.mjs, tolerated). This CONTRADICTS the CLAUDE.md invariant 'init-db.sh = authoritative schema source; hub runs idempotent CREATE IF NOT EXISTS; both must agree.' In reality hub.mjs's self-create is the de-facto SSOT (it built the live DB); init-db.sh is stale/divergent and is a live trap (running it yields a non-bootable DB). P1 worked around it via option (b): skip init-db.sh, let hub.mjs self-create (reproduces exact live schema). FIX OPTIONS for this WI: (1) rewrite init-db.sh to mirror hub.mjs's self-created schema exactly (normal tag, drop phantom cols, drop the unused 6 tables OR add them to hub.mjs if actually wanted), or (2) formally DEMOTE init-db.sh from 'authoritative' and document hub.mjs self-create as the SSOT, keeping init-db.sh only as an optional seed that must track hub.mjs. Lane: hub-llmmsgsrv-cc (DB schema) + pm. Also update CLAUDE.md once resolved.
-
DIRECTION LOCKED: reconcile, not demote (hub-llmmsgsrv-cc + pm agree). Rewrite init-db.sh to mirror hub.mjs's CREATE-block + live whey schema exactly (normal tag, drop phantom origin_tag/request_tag, drop the 6 dead tables unless hub.mjs is updated to actually use them); fix the CLAUDE.md 'both must agree' line for anything that stays divergent. A clean from-scratch init path is worth keeping - venus P1 proved its value. Lead: hub-llmmsgsrv-cc (DB-schema lane). Priority: BELOW P3 §4 when Elazar GOs P3; this is the inter-phase gap-filler.
-
hub-llmmsgsrv-cc
-
coder-llmmsgsrv-cc / coder
-
coder-llmmsgsrv-cc / coder