From a915e4236c2963fd03421c2c57d4b0765c5e3033 Mon Sep 17 00:00:00 2001 From: Tiel Coder Date: Wed, 18 Nov 2026 04:14:10 +0000 Subject: [PATCH] docs: mark C2 done and document the pi-web kill trap Records the corrected app start procedure so a future session does not kill its own host process when the app looks stuck. --- .agent/HANDOFF-C2.md | 120 +++++++++++++++---------------------------- .agent/PROGRESS.md | 40 ++++++++++++++- 2 files changed, 81 insertions(+), 79 deletions(-) diff --git a/.agent/HANDOFF-C2.md b/.agent/HANDOFF-C2.md index b5f2270..6852c1f 100644 --- a/.agent/HANDOFF-C2.md +++ b/.agent/HANDOFF-C2.md @@ -1,95 +1,59 @@ # SESSION HANDOFF — C2 (Volunteer `/profile/skills` sliders) -**Author:** Tiel-Coder (Ornith variant) · **Date:** 2026-11-18 -**For:** the next session. Read this first. +**Date:** 2026-11-18 · **Status:** C2 DONE and committed. --- -## TL;DR — where things stand +## TL;DR -- **C1 is committed** (`1b34421`) — Skills composer. Done. -- **C2 is WRITTEN but NOT committed.** All code + migration + build are done and - green. Only pending: commit the C2 files, run the runtime smoke test, update - `.agent/PROGRESS.md`. -- **App is DOWN on :3000** right now — stale `next-server` processes are holding - the port but not listening. Kill them and restart via `/tmp/start_app.sh`. -- **DB migration `0005` (user_skills) IS applied** to Postgres on :5433. +- **C1 committed** (`1b34421`) — Skills composer. +- **C2 committed** — `user_skills` table, slider API, validation; 55 unit tests + green, 18-check runtime smoke green, migration `0005` applied to :5433. +- **App runs on :3000.** Next unit: **C3 — admin skills matrix + verify modal.** -## What C2 delivered (all written, typecheck/lint/test green) +## ⚠️ Do not blanket-kill `next-server` -1. `src/db/schema.ts` — new `user_skills` table (11 cols: id, user_id, skill_id, - self_comfort, self_rated_at, verified_level, verified_by, verified_at, - mentor_opt_in, last_served_on, notes). Unique index on (user_id, skill_id). - Added to the `schema` export. Excluded from `relations` (FK cols on a unique - key trip Drizzle 0.45.4 `one()` typing — same as skills/position_skills). -2. `drizzle/0005_keen_lenny_balinger.sql` — migration (APPLIED to :5433). -3. `src/db/userSkills.ts` — data layer: `setSelfComfort(userId, skillId, value)` - (upsert, updates ONLY self_comfort/self_rated_at, NEVER verified_level) and - `getUserSkills(userId)` (join to skills for display). -4. `src/domain/userSkills.ts` — pure `validateSelfComfort(value)` (0–100 int, or - null). No DB imports. -5. `src/domain/userSkills.test.ts` — 5 tests named after behaviors. -6. `src/app/api/dev/user-skills/route.ts` — `GET ?userId=` (list records), - `POST { userId, skillId, selfComfort }` (set slider). dbError maps 23505→409 - (dup), 23503→400 (dangling FK). +Previous sessions chased a "stuck build" by running +`pkill -9 -f next-server`. That process is **pi-web, the agent's own UI host** +(`node …/pi-web`, cwd `…/node_modules/@agegr/pi-web`, Next v16.3.8, port 30141). +Killing it ends the session, and its supervisor respawns it with a new PID — which +looks like "next-server keeps coming back". The project is Next 15.5.29; its app +is identified by **port 3000**, not by process name. -## C2 core rule (the whole point) - -**Two numbers, one truth.** `self_comfort` is the volunteer's signal; -`verified_level` is the gate. Setting a slider MUST NOT move `verified_level` -(or verified_by/verified_at — those are C3's `skill_assessments`). C2 E2E -criterion: *move slider → save → reload shows value; verified level unchanged.* - -## Environment (do not forget) - -- **App:** `http://localhost:3000` · start: `setsid /tmp/start_app.sh >/tmp/app.log 2>&1 `). - -## CURRENT BLOCKER — app not running - -`next-server` processes are stuck (port 3000 not listening, health 000). Kill -them (they respawn oddly; use sudo if plain kill fails): +To free a port, resolve the PID through the port and only kill that: ``` -echo "Linux1981" | sudo -S pkill -9 -f next-server -sleep 2 -setsid /tmp/start_app.sh >/tmp/app.log 2>&1