From f36372a98e8437af67d4d8404926c5f86039e9da Mon Sep 17 00:00:00 2001 From: Test Date: Fri, 1 May 2026 18:36:42 -0500 Subject: [PATCH] fix(start,#980-bug3): don't lie about seed success after seed failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M1 Carl-validator pass (issue #980, Bug 3) caught a silent-success-is- failure violation in `parallel-start.sh` Phase 5.5: [Seed] ⏳ Waiting for JTAG system to be ready... [Seed] TS server ready but Rust worker not responding... (× 15+) [Seed] ❌ JTAG system did not become ready after 480 seconds [Seed] ❌ SEEDING FAILED: ❌ JTAG system not ready - commands not registered yet ✅ Seed complete ← LIES 🎉 System is UP! Total startup time: 549s ← ALSO LIES Carl saw the success banner, opened the UI, typed "hello", got nothing back — because no personas existed. The script announced success after explicit failure. Root cause: the pipe `npm run data:seed | sed` discards the seed script's exit code (sed always succeeds → pipeline returns 0). Same shape Joel's been correcting elsewhere. Already a fix pattern in this file — TS build at line 278 uses `${PIPESTATUS[0]}`. Fix: capture `${PIPESTATUS[0]}` post-pipe; on non-zero, print the actual failure with diagnostic log paths, set SEED_OK=false. The final "System is UP" banner now branches on SEED_OK and prints "⚠️ DEGRADED mode" when seed failed, telling the truth. System still starts (intentional — partial usability + retry possible via re-running `npm run data:seed`). The change is purely about not lying when the seed failed. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/scripts/parallel-start.sh | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/scripts/parallel-start.sh b/src/scripts/parallel-start.sh index 14cf8f25e..21da9e57d 100755 --- a/src/scripts/parallel-start.sh +++ b/src/scripts/parallel-start.sh @@ -447,8 +447,30 @@ fi # Critical: Browser must connect AFTER seeding so findSeededHumanOwner() finds Joel. # Without this, browser connects → anonymous user created → wrong userId in session. echo -e "\n${YELLOW}Phase 5.5: Ensuring database is seeded...${NC}" +# Capture data:seed's exit code via PIPESTATUS — without this the pipe +# to sed always succeeds and we'd print "✅ Seed complete" even after +# seed failed (#980 Bug 3, observed live on M1 Carl pass: seed timed +# out at 480s, then this script printed "✅ Seed complete" + "🎉 System +# is UP!" anyway, then chat went silent because no personas existed). +# Same PIPESTATUS pattern as the TS build subshell at ~line 278. npm run data:seed 2>&1 | sed 's/^/ [Seed] /' -echo -e " ${GREEN}✅ Seed complete${NC}" +SEED_RC=${PIPESTATUS[0]} +SEED_OK=true +if [ "$SEED_RC" -ne 0 ]; then + SEED_OK=false + echo -e " ${RED}❌ Seeding failed (exit $SEED_RC) — first chat will likely have no AI responder.${NC}" + echo -e " ${YELLOW} Common cause: continuum-core didn't register commands within the seed${NC}" + echo -e " ${YELLOW} wait window (480s). Check orchestrator + core logs for SIGABRT / crash:${NC}" + echo -e " ${YELLOW} tail -100 \$HOME/.continuum/jtag/logs/system/orchestrator.log${NC}" + echo -e " ${YELLOW} tail -100 \$HOME/.continuum/jtag/logs/system/continuum-core.log${NC}" + echo -e " ${YELLOW} System will still start, but chat won't have personas. Re-seed after fixing:${NC}" + echo -e " ${YELLOW} npm run data:seed${NC}" + # Don't exit here — system may still be partially usable + user can + # re-seed once they've fixed the underlying core failure. But the + # final "System is UP" banner below tells the truth (degraded vs ok). +else + echo -e " ${GREEN}✅ Seed complete${NC}" +fi # Phase 6: Browser launch is handled by SystemOrchestrator.detectAndManageBrowser() # The orchestrator runs as a daemon and manages browser lifecycle — open, detect, reconnect. @@ -470,7 +492,13 @@ fi END_TIME=$(date +%s) TOTAL_ELAPSED=$((END_TIME - START_TIME)) -if [ "$HOT_RESTART" = true ] && [ "$BROWSER_CONNECTED" = true ]; then +# Banner reflects the truth: if seed failed, system is DEGRADED (no +# personas, chat silent). Per Joel's silent-success-is-failure rule +# we don't print 🎉 over a known-broken state. #980 Bug 3. +if [ "$SEED_OK" != true ]; then + echo -e "\n${RED}⚠️ System started in DEGRADED mode (${TOTAL_ELAPSED}s) — seed failed, chat will not have personas.${NC}" + echo -e "${YELLOW} See seeding error above + log paths for diagnosis.${NC}" +elif [ "$HOT_RESTART" = true ] && [ "$BROWSER_CONNECTED" = true ]; then echo -e "\n${GREEN}🎉 Hot restart complete! (${TOTAL_ELAPSED}s) — browser refreshed${NC}" elif [ "$HOT_RESTART" = true ]; then echo -e "\n${GREEN}🎉 Hot restart complete! (${TOTAL_ELAPSED}s)${NC}"