Skip to content

fix(seed): use DEFAULT_USER_UNIQUE_IDS.PRIMARY_HUMAN ('owner') instead of hardcoded 'joel' — chat-probe root cause - #1014

Merged
joelteply merged 1 commit into
canaryfrom
fix/seed-in-process-owner-uniqueid
May 3, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/seed-in-process-owner-uniqueid

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Root cause of carl-install-smoke chat-probe "Room not found: general"

seed-in-process.ts:341 hardcoded findOrCreateUser('joel', 'Developer', 'human'). SessionDaemonServer.findSeededHumanOwner() returns the FIRST type='human' row. When the seed wrote rooms with owner_id pointing at the 'joel' user but the session-daemon picked the canonical 'owner' user (from DEFAULT_USER_UNIQUE_IDS.PRIMARY_HUMAN), DataList rooms returned 0 because owner_id didn't match session-user.id.

Postgres state on the running stack confirms the divergence:

  • 18 users including BOTH 'owner' (id 0653f2b3-...) AND 'joel' (id ac689024-...) — two human users from two seed paths
  • All 8 rooms have owner_id = ac689024-... (the 'joel' user)
  • jtag CLI's findSeededHumanOwner() returns the 'owner' user
  • data/list --collection=rooms returns 0 items
  • chat/send fails: Room not found: general

Fix

seed-in-process.ts imports DEFAULT_USER_UNIQUE_IDS and uses PRIMARY_HUMAN for the human owner uniqueId — same constant scripts/seed-continuum.ts has been using correctly all along (line 182, 386). Single source of truth.

scripts/seed-continuum.ts:197-200 already had a comment acknowledging this divergence: "find them even when the DB has uniqueId='joel' but we look for 'owner'." That was a workaround; this PR is the fix at the source.

Diff

1 import, 1 hardcoded literal → constant + comment block explaining the failure mode (so the next debugger doesn't have to re-derive it).

Validation path

After merge + carl-install-smoke runs the seed, the rooms get owner_id matching findSeededHumanOwner()'s returned user → DataList rooms returns 8 → chat/send --room=general resolves → chat-probe passes.

Pairs with #1013's post-write verify: that PR surfaces the divergence loudly; THIS PR removes the divergence so the verify (and chat-probe) succeed.

🤖 Drafted with Claude Opus 4.7 (1M context)

…d of hardcoded 'joel' — chat-probe root cause

The Carl-OOTB chat-probe failure ("Room not found: general") traces to
a single-source-of-truth violation: seed-in-process.ts hardcoded
'joel' as the human owner uniqueId; SessionDaemonServer.findSeeded-
HumanOwner returns whichever type=human row appears first; rooms get
created with owner_id pointing at the seed's 'joel' user, but jtag CLI
sessions authenticate as the canonical 'owner' user; DataList rooms
returns 0 because owner_id doesn't match session-user.id.

scripts/seed-continuum.ts has been using DEFAULT_USER_UNIQUE_IDS.
PRIMARY_HUMAN correctly the whole time — even has an explicit comment
acknowledging the divergence (line 197-200): "find them even when the
DB has uniqueId='joel' but we look for 'owner'." That's a workaround,
not a fix; this PR is the fix at the source.

Single-source-of-truth: both seeders + session-daemon now agree the
canonical primary human uniqueId is whatever PRIMARY_HUMAN is. Change
the constant in DefaultEntities.ts → all paths follow.

Net diff: 1 import + 1 hardcoded literal → constant + comment block
explaining the failure mode (so the next debugger doesn't have to
re-derive it). 18-line addition mostly comments.

Verified locally: postgres on existing stack has BOTH 'owner' (id
0653f2b3) and 'joel' (id ac689024); rooms.owner_id all point at
'joel'; jtag's SessionDaemon picks 'owner'; data/list users returns
1 row (the 'owner' user). Post-fix, the seeder will create the owner
as 'owner' from the start, rooms own to 'owner', everything matches.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 4501108 into canary May 3, 2026
3 checks passed
@joelteply
joelteply deleted the fix/seed-in-process-owner-uniqueid branch May 3, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant