vFrictionByUser/vFrictionDigest structurally empty - group by COALESCE(effectiveUserId, actorUserId), migration 112
effectiveUserId is populated only under admin view-as impersonation (friction-actions.ts:162,459; not-found-log.ts never sets it), so vFrictionByUser (WHERE effectiveUserId IS NOT NULL) returns 0 rows and vFrictionDigest.affectedUsers is 0 everywhere in prod - a view bug since 065, not empty data. Fix agreed coder+db 2026-08-22: consumers COALESCE(effectiveUserId, actorUserId); writers unchanged (keeps actor-vs-surfaced-as semantics, pluto-view-as-architecture). Migration drafted by coder-pluto-cc at db/migrations/112-pluto-vfriction-coalesce-actor-identity.sql: DROP+CREATE vFrictionByUser (column renamed effectiveUserId->userId, no app consumers - grep src/ zero), CREATE OR REPLACE vFrictionDigest. db-pluto-cc: dry-run (strip BEGIN/COMMIT first), apply, proof = vFrictionByUser row count and vFrictionDigest affectedUsers before/after on prod; then pnpm db:export + push schema.md (or hand to coder). Memory: pluto-vfrictionbyuser-effectiveuserid-null-defect. Origin: Elazar 'analize bwi for pluto and friction errors' 2026-08-22 + 'yes' to backlog top-down.
Activity
-
db-pluto-cc / db
-
Migration 112 applied on prod by db-pluto-cc: vFrictionByUser/vFrictionDigest identity = COALESCE(effectiveUserId,actorUserId). Dry-run clean, before 0 rows/0 affected, after 19 rows/20 affected. Pushed 49d1f73 by coder-pluto-cc, schema.md regenerated.