Handoff: CreatorTrack Suite Build (2026-07-02)¶
URL: https://mkdocs.justinsforge.com/memory/handoffs/creatortrack-suite-build-handoff-2026-07-02/
Fable session (integrator) is stopping (usage credits off). This is the full state so an Opus session can resume the INTEGRATOR role. The build agents are separate; they may have finished or died mid-run. Your job: finish merging their branches, validate, deploy.
Where things stand¶
- App repo:
/home/justinwieb/forge-suite(Next 16, RLS Postgres on CT 109lifeos). main = :3060 dev (creatortrack-dev, dev.creatortrack.ai) / :3070 prod (creatortrack-prod, app.creatortrack.ai). - Prod IS LIVE on today's build (Tasks/Habits/Knowledge/Calendar/Meals/Fitness/Finances/Chat), but does NOT yet include the branches listed under "In flight". After the wave merges, rebuild prod once (see Deploy).
- DB was WIPED today (all 16 workspaces hard-deleted per Justin;
core.userskept, 4 users). Safety dump: CT109/var/lib/postgresql/lifeos-pre-wipe-20260702.dump. Justin will create a fresh "Justin's Workspace". - Latest main is typecheck-clean and dev is healthy (
curl :3060/-> 307).
In-flight build branches (8 agents were running)¶
Each lives at ~/forge-suite-wt/<branch> with DB ct_<branch> and a <APP>-SPEC.md + INTENT.md. To check if one finished: git -C ~/forge-suite-wt/<branch> log --oneline -5 and read its INTENT.md. If commits + INTENT.md exist and its own tsc was clean, it's ready to merge. If partial, a fresh agent can finish it against its SPEC file.
| branch | slot port | builds |
|---|---|---|
reminders-center |
3080 | MERGE FIRST (dependency). Bell Notifications/Reminders tabs + settings; app.reminders standalone recurring reminders via lib/notifications sweep; docs/API-REMINDERS.md contract |
crm-app |
3081 | Personal CRM (people/family/birthdays/addresses/timeline). Birthdays -> yearly reminders via a lib/crm-reminders.ts seam that calls /api/reminders if present, else no-ops. AFTER reminders-center merges, WIRE this seam (see Post-merge). |
journal-app |
3082 | Journal + Mood (Day One/Daylio): mood check-in, mood calendar, stats |
goals-app |
3083 | Goals/OKR (Strides): on-track status, check-ins, OKR rollups |
knowledge-highlights |
3084 | Knowledge read-it-later (URL save + reader) + Highlights surface |
template-workspace |
3085 | Name-triggered seeder: workspace named "Template Workspace" auto-seeds ~6mo of habits/tasks/notes/meals |
meals-r2 |
3079 | Meals MFP buildout: Day-view week strip + calorie/macro cards + 3-tab Nutrition breakdown (Calories pie / Nutrients table / Macros pie) at day + meal scope + extra nutrient props |
machine-auth |
3075 | Personal access tokens (core.api_tokens, Bearer ctk_...) for bots + owner-gate on Fitness/Finances/Calendar (non-owner 403 + empty state) + auto-seeded "Getting Started" page on workspace create. docs/API-BOTS.md contract. |
THE MERGE RITUAL (exactly what the integrator does per branch)¶
cd /home/justinwieb/forge-suite
git merge <branch> --no-edit
# Conflicts are almost always in these 4 files, all trivial UNIONS (keep BOTH sides' app entries):
# components/registry.tsx, lib/apps.ts, lib/mobile-tabs.ts, lib/system-apps.ts
# Resolve by keeping every app's import + registry entry + tab row + SystemAppKind.
git rm -f INTENT.md 2>/dev/null; git commit -m "chore: drop slot INTENT from main" # if INTENT.md landed
npx tsc --noEmit 2>&1 | grep -c "error TS" # expect 0 (a few pre-existing .png/LayoutProps typegen errors are OK ONLY if they predate; verify)
# validate on a FRESH clone first:
ssh finn "pct exec 109 -- su - postgres -c \"psql -c 'drop database if exists ct_migration_check' -c 'create database ct_migration_check template creatortrack_dev_base' -c 'alter database ct_migration_check owner to lifeos_admin'\""
cd /home/justinwieb/forge-suite && PGDATABASE=ct_migration_check WORKSPACE_MIGRATIONS_DIR=db/migrations python3 ~/forge/scripts/forge_workspace_migrate.py # must apply clean
ssh finn "pct exec 109 -- su - postgres -c \"psql -c 'drop database ct_migration_check'\""
# then apply to LIVE lifeos:
cd /home/justinwieb/forge-suite && WORKSPACE_MIGRATIONS_DIR=db/migrations python3 ~/forge/scripts/forge_workspace_migrate.py
sudo systemctl restart creatortrack-dev && sleep 14 && curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3060/
Merge order: reminders-center FIRST (CRM depends on it), then the rest in any order, machine-auth and template-workspace last (both touch the workspace-create path, so they may conflict with each other there: reconcile so BOTH the Getting-Started seed AND the Template-Workspace name-trigger run on create).
Post-merge wiring¶
- CRM birthday reminders: after both
crm-appandreminders-centerare on main, connectlib/crm-reminders.tsto the real/api/reminders(the agent left it as a documented seam). Verify saving a birthday creates a yearly reminder. - Bot API access (the capstone Justin wants): once
machine-authis merged, mint a token, then a forge-side round wires the Telegram inbox-capture + LifeOS coordinator bots todocs/API-BOTS.md(create tasks/projects/pages/habits+logs/knowledge notes as Justin), pointed at prod. Bots target the official "Justin's Workspace".
Deploy prod (after the whole wave is merged + validated on dev)¶
cd /home/justinwieb/forge-suite && npm run build # ~1-2 min
sudo systemctl restart creatortrack-prod && sleep 10
curl -s -o /dev/null -w "%{http_code}" https://app.creatortrack.ai/ # expect 307
GOTCHAS (all learned today, all load-bearing)¶
- Node 22 required: both
creatortrack-devandcreatortrack-prodsystemd units were bumped from Node 20 ->/home/justinwieb/.nvm/versions/node/v22.22.2/bin(fitness usednode:sqlite; now removed but keep 22). - Worktree dev servers MUST use
next dev --webpack(Turbopack panics on the symlinked node_modules). - pg client is a globalThis singleton in
lib/db.ts(survives HMR; a leak saturated CT109's 100 conns today). Clones carryidle_session_timeout=10min(baked intoforge_suite_agent_bootstrap.sh). - Base clone DB
creatortrack_dev_basewas rebuilt today from live lifeos (was drifting behind migrations).forge_suite_dev_base.sh --forcerebuilds it. - Migration validation clones create as
postgres; mustalter database ... owner to lifeos_adminbefore the migrator can bootstrap. - Workspace-create defaulting:
resolveWorkspaceIdnow skips archived/deleted workspaces; task creates use active-workspace-first (both fixed today after tasks were vanishing into a deleted workspace).
PARKED DECISION (needs Justin + its own session)¶
Finance -> Postgres consolidation is HALTED on purpose. Canonical lifeos finance.* is EMPTY (the "replica" only ever populated clone DBs). Finishing = net-new PG write layer across ~19 money scripts + repoint a receipt reconciler; ERPNext daily-post has a FINANCE_SOURCE=lifeos switch, do NOT touch it. Full plan + rollback: data/finance/PG-CUTOVER-PLAN.md. Fitness already fully cut over to Postgres (wellness.*, reference_wellness_pg_sync, 15-min timer live).
Slots to tear down when done¶
git -C ~/forge-suite worktree remove <path> --force + DROP DATABASE ct_<branch> (as lifeos_admin) for every ~/forge-suite-wt/* once its branch is merged and Justin's happy. Base creatortrack_dev_base persists.
[Claude Code]
INTERRUPTED STATE (credits off, ~22:10) - READ THIS FIRST ON RESUME¶
The 8-agent wave was cut off mid-build by credits-off. NONE of the wave is merge-ready. Uncommitted work was PRESERVED as a wip(...) commit on each branch (unverified, incomplete). A resume session finishes each branch against its own <APP>-SPEC.md (spawn a fresh agent per branch: "continue the WIP on this branch per its SPEC, verify, QA"), THEN merges per the ritual above.
WIP commits (build ON these, don't discard): - reminders-center 0b7eb85 (7 files) | crm-app 58ad739 (4) | goals-app fdbc20b (4) | knowledge-highlights ed228d7 (8) | meals-r2 0ae3d36 (data layer committed earlier + WIP) - journal-app: NOTHING produced (died before writing; restart from SPEC). - machine-auth: LEFT UNTOUCHED, 29 uncommitted files + dev server still live on :3075 (may still be running; if dead on resume, commit its worktree first, then finish/verify). Its work (tokens + owner-gate + getting-started) is the most complete and highest-value; prioritize.
main + dev(:3060) + prod(:3070) remain HEALTHY and unaffected. Merging nothing was the correct call: verify each branch before it touches main.
UPDATE (~22:20)¶
- template-workspace is COMPLETE + QA-verified (commit 2d796d3): finished cleanly after the WIP sweep; the seeder produced 807 habit logs / 53 tasks / 18 notes / 292 meals in QA, all via real app helpers, no migration. MERGEABLE as-is. Caveat: it edits
lib/workspace.ts createWorkspaceForUser(the name-trigger), same functionmachine-authedits for Getting-Started seeding, so reconcile those two so BOTH run on create. Seed takes ~18s inline; flagged to background later.
UPDATE (~22:25) - machine-auth COMPLETE¶
- machine-auth is COMPLETE + QA-verified (4 commits: c180c19 tokens, ee41712 owner-gate fitness/finance/calendar, 0196ea1 getting-started, 1183a5a API-BOTS.md; migration
20260702T200546_machine_auth_api_tokens...). Clean tree, committed by the agent itself (no WIP relabel needed). Highest priority + the bot-access capstone dependency. MERGEABLE. - Two branches are now merge-ready & verified: machine-auth + template-workspace. Both edit
lib/workspace.ts createWorkspaceForUser(machine-auth: Getting-Started ensure; template: name-trigger seed), so when merging both, reconcile that function to run BOTH. - The other five (reminders-center, crm-app, journal-app, goals-app, knowledge-highlights, meals-r2) remain WIP/incomplete per the Interrupted-State section: finish from their wip commits against their SPECs before merging.
- Orphaned :3075 dev server freed.
UPDATE (~22:30) - meals-r2 COMPLETE¶
- meals-r2 is COMPLETE + QA-verified (3 commits 1edbb6a/43be988/6e410ba, NO migration; extra nutrient props via idempotent ensureProp, goals in prefs). MFP week strip + calorie/macro cards + 3-tab Nutrition slide-over (day + meal scope), 21/21 smoke + 10 screenshots, reference numbers verbatim. MERGEABLE.
- THREE branches now merge-ready & verified: machine-auth, template-workspace, meals-r2. Only machine-auth carries a migration. meals-r2 touches components/apps/meals/* + lib/meals.ts + lib/system-apps.ts (ensureMealsApp) + app/api/apps/meals + mealsMath — low conflict risk vs the others.
- Correction to Interrupted-State: the agents were MORE alive than the dead dev servers implied; several committed their finished work after the 22:10 WIP sweep. Re-check EVERY branch's
git log main..HEAD+ tree-clean on resume before assuming WIP/incomplete. Still-outstanding (verify individually): reminders-center, crm-app, journal-app, goals-app, knowledge-highlights.
UPDATE (~22:35) - knowledge-highlights COMPLETE (4 ready)¶
- knowledge-highlights COMPLETE + QA-verified (final commit 12411de; NO migration; Read Later = 4th knowledge section node + doc-node articles, Highlights = read-time lens over the existing bg-color inline mark, no new table). MERGEABLE. NOTE: history carries my premature WIP commit ed228d7 BEFORE the agent's real commit 12411de; harmless (merge takes the final tree), squash if you care.
- FOUR branches now merge-ready & verified: machine-auth (has migration), template-workspace, meals-r2, knowledge-highlights (no migrations on the latter three).
- Some "complete" branches carry a stray
wip(...)commit mid-history from the 22:10 sweep — cosmetic only. On resume, trustgit log main..HEADtree-clean + a present feat/final commit as "done", regardless of a wip commit beneath it. - Still to verify individually: reminders-center, crm-app, journal-app, goals-app (may also have finished; check each).
UPDATE (~22:40) - reminders-center COMPLETE (5 ready)¶
- reminders-center COMPLETE + QA-verified (3 clean commits; migration
20260702T210000_reminders_center_standalone_reminders.sql=app.reminders; agent squashed my premature WIP into clean commits itself). Bell tabbed Notifications|Reminders|Settings, standalone recurring reminders fire+advance via lib/notifications sweep (yearly-advance DST-safe, idempotent).docs/API-REMINDERS.mdcontract live. MERGEABLE, and it's the CRM dependency. - FIVE branches merge-ready & verified: reminders-center (migration), machine-auth (migration), template-workspace, meals-r2, knowledge-highlights.
- MERGE ORDER when resuming: reminders-center FIRST (validate both migrations on a fresh clone together), then machine-auth, then the 3 no-migration ones; reconcile lib/workspace.ts (machine-auth getting-started + template name-trigger) and lib/notifications.ts (reminders sweep coexists w/ task+habit sweeps).
- Still outstanding: crm-app, journal-app, goals-app (verify each; if crm finished, wire lib/crm-reminders.ts to the now-real /api/reminders).
UPDATE (~22:45) - goals-app COMPLETE (6 ready)¶
- goals-app COMPLETE + QA-verified (NO migration; rides collection engine, ensureGoalsApp; goals.goals + goals.checkins; OKR = self-relation "Objective Link"). On-track pace-ratio math verified; caught+fixed a real "1 of 0" streak-card bug. MERGEABLE.
- SIX branches merge-ready & verified: reminders-center (mig), machine-auth (mig), template-workspace, meals-r2, knowledge-highlights, goals-app.
- Outstanding: crm-app, journal-app (verify each; wire lib/crm-reminders.ts to /api/reminders once crm is confirmed done).
UPDATE (~22:50) - crm + journal STILL RUNNING (6 done, 2 live)¶
- crm-app (:3081) and journal-app (:3082) dev servers are STILL LIVE = agents actively building (uncommitted work growing on top of the premature WIP commits). DO NOT touch these two worktrees; they'll commit their own finished work. Wait for their completion notifications.
- crm-app: once done, wire lib/crm-reminders.ts -> /api/reminders (reminders-center is ready).
- So the wave is nearly complete: 6 verified-ready + 2 finishing. Session (Opus-fallback) is HOLDING all merges + prod deploy per Justin's wind-down; everything durable on branches.
UPDATE (~22:55) - journal-app COMPLETE (7 ready, only crm left)¶
- journal-app COMPLETE + QA-verified (NO migration; entries = doc nodes under journal.entries + mood/activities on props; Today 5-face check-in / Calendar mood-tint / Stats). Math verified (avg mood 3.04, streak 3d, activity correlations). MERGEABLE.
- SEVEN branches merge-ready & verified: reminders-center(mig), machine-auth(mig), template-workspace, meals-r2, knowledge-highlights, goals-app, journal-app.
- ONLY crm-app outstanding (check if still live on :3081; wire lib/crm-reminders.ts -> /api/reminders when done).
UPDATE (~23:00) - crm-app COMPLETE == ALL 8 DONE¶
- crm-app COMPLETE + QA-verified (commit 8a29cdc; NO migration; crm.people collection, person=database_row w/ page+IconPicker avatar, Timeline=jsonb array prop [caught a stringify bug], People/Dates/Addresses surfaces). Reminders seam
lib/crm-reminders.tsWIRED-BUT-DORMANT: POSTs yearly reminder to /api/reminders, no-ops+logs until reminders-center is on the base. MERGEABLE. - ALL 8 BRANCHES COMPLETE + VERIFIED. Nothing lost to credits-off; every agent finished + committed. Merge-ready set:
- reminders-center (mig app.reminders) -- MERGE FIRST (crm dependency)
- machine-auth (mig core.api_tokens)
- template-workspace, 4. meals-r2, 5. knowledge-highlights, 6. goals-app, 7. journal-app, 8. crm-app (no migrations)
- RESUME PLAN (unchanged, now all inputs ready): a. Merge reminders-center + machine-auth; validate BOTH migrations together on a fresh creatortrack_dev_base clone, then apply to live lifeos. b. Merge the other 6 (order flexible). Reconcile the 4 registration files (registry.tsx/apps.ts/mobile-tabs.ts/system-apps.ts) as unions each time; reconcile lib/workspace.ts (machine-auth getting-started ensure + template name-trigger both run) and lib/notifications.ts (reminders sweep + task + habit sweeps coexist). c. Wire lib/crm-reminders.ts -> real /api/reminders; verify birthday save creates a yearly reminder. d. tsc clean, restart dev, review on dev.creatortrack.ai. e. Bot API capstone: mint a ctk_ token, wire capture + coordinator bots per docs/API-BOTS.md to the official "Justin's Workspace" on prod. f. Final prod build + restart.
- Held all merges + deploy this session per Justin's wind-down. main/dev/prod healthy on today's pre-wave build.
MERGE COMPLETE (~23:20) - ALL 8 ON MAIN + DEV¶
- ALL 8 branches merged to main, tsc clean. Conflicts were pure registration-file unions (registry/apps/mobile-tabs/system-apps) + lib/workspace.ts (reconciled: ensureGettingStarted returns the node id, fed to seedTemplateWorkspace; both run on create). A union-script brace slip left journal/crm blocks unclosed -> fixed (commit 312086c).
- Both migrations validated on a fresh clone then applied to LIVE lifeos: app.reminders + core.api_tokens confirmed present. dev restarted, healthy (routes 401 unauth = correct; the transient /api/notifications 500 was the pre-migration restart race, gone).
- CRM->reminders self-wired: lib/crm-reminders.ts POSTs /api/reminders (no longer 404s), so birthday saves create real yearly reminders. No code change needed.
- REMAINING: (1) prod deploy (npm run build + restart creatortrack-prod) -- NOT done, awaiting Justin (outward-facing). (2) Bot API capstone: mint a ctk_ token via /api/tokens, wire capture+coordinator bots per docs/API-BOTS.md to prod.