Diagnose missing userScopeUuid in rpe-context-assembler (degraded render)
MariaDB access. Familiarity with telegram_bot.users schema.
No RELATIONSHIP_BLOCK_NO_SCOPE_UUID warnings. Relationship block renders with full user context.
1. Confirm the signal: search ops_issues for "RELATIONSHIP_BLOCK_NO_SCOPE_UUID" or check Docker logs for the same string.
2. Identify the affected user. The error context includes username and chat_id.
3. Check whether the user has a scope_uuid in telegram_bot.users:
SELECT username, scope_uuid FROM telegram_bot.users WHERE username = '<username>';
Expected: non-null UUID.
4. If NULL: the user predates scope_uuid assignment. Run the scope_uuid backfill migration (check docs/context/schemas/ for the relevant migration).
5. Check loadUserScopeData() in rpe-context-assembler/index.js — verify it reads from the correct table and returns the scope_uuid field.
6. If loadUserScopeData returns null for a user who has a scope_uuid in DB, the query or column name has drifted. Compare the query with the current schema in docs/context/schemas/telegram_bot.users.sql.
7. After fixing: clear the Redis relationship block cache for the affected channel:
rdcli -h 192.168.1.151 -p 6379 DEL relationship_block:2:<chat_id>
8. Rebuild rpe-context-assembler if code was changed:
node ssh-exec.js --compose section5 rebuild rpe-context-assembler
9. Validate: send a message as the affected user. Confirm no RELATIONSHIP_BLOCK_NO_SCOPE_UUID warning in ops_issues.