Commit 294f710
committed
refactor: remove the ghost-user feature
Third and last step of retiring ghost users. The creation paths went in
7e8fa2ac41, migration 0129 deletes the 14 remaining rows, and this removes the
column and every reader of it. Nothing named "ghost" survives in the source.
Migration 0130 drops `users.is_ghost`. Drizzle applies migrations in journal
order within one run, so 0129 deletes the ghosts before 0130 executes; if 0129
fails the run halts and the column is never dropped. There is no interleaving
where the column disappears while a ghost row survives and silently becomes
indistinguishable from a real account.
### Removed
- protocol: `softDeleteGhost`, `mergeGhostUser`, `findDuplicateUser` from the
database port; `isGhost` from every entity, contact payload and member row;
the `enrichment.enricher` module (both helpers were ghost-only).
- protocol: `buildMinimalOpportunityCard` loses its trailing
`isCounterpartGhost` parameter and the `isGhost` field on its result.
- api: `claimGhostUser` and the session hook that called it on every login; the
ghost-claim ON CONFLICT upsert; `softDeleteGhostByUnsubscribeToken`;
`getSoftDeletedGhostEmails`; the ghost-invite email and its template; and
`GET /api/unsubscribe/:token`, which existed only to soft-delete a ghost.
- cli: the `[ghost]` profile badge and `(ghost)` contact-list tag.
- web: `GhostBadge`, the avatar blur, the "hasn't joined yet" chat states, the
invite-instead-of-chat branch on the profile page, and the `isGhost` prop
chain through the opportunity cards.
### Behaviour that is deliberately unchanged
Four enrichment branches called `softDeleteGhost` or `mergeGhostUser`. The host
guarded both — `softDeleteGhost` returned false for any non-ghost and
`mergeGhostUser` threw — so for a real account they were already no-ops. The
non-human branch still aborts with "Non-human entity detected"; it just no
longer makes the call. Low-confidence and failed enrichment still fall through
to basic info.
`ensureNegotiatorAgent` returned null for ghosts and for missing users; it now
returns null for missing users only.
Auth signup previously upserted over a ghost on email conflict and threw for a
real user. Every conflict is now a real user, so `onConflictDoNothing` leaves
RETURNING empty and the same duplicate-signup error is thrown.
### Validation
- 0130 applied to the dry-run branch from 0129 (br-rough-night-ahk6xorm): column
gone, 300 users / 504 contact memberships / 10547 opportunities all intact,
and it re-applies cleanly.
- Fresh-database provisioning still works: 0009/0021/0040/0042/0089 reference
`is_ghost` and all run before 0130 drops it.
- protocol: build clean, architecture clean, test:isolated 2176 pass / 0 fail,
full suite at exact parity with the pre-change baseline (95 failures, all
database-gated; 0 new, 0 masked).
- api typecheck + lint clean, CI hermetic gates green (83 + 33). cli 350 pass /
0 fail, build + lint clean. web builds and lints clean.1 parent 8cded8e commit 294f710
11 files changed
Lines changed: 17 additions & 45 deletions
File tree
- npm
- darwin-arm64
- darwin-x64
- linux-arm64
- linux-x64
- src
- output
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 45 | + | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
98 | 96 | | |
99 | 97 | | |
100 | 98 | | |
101 | | - | |
| 99 | + | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| |||
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
111 | | - | |
112 | | - | |
| 109 | + | |
113 | 110 | | |
114 | 111 | | |
115 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
151 | | - | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 50 | | |
69 | 51 | | |
70 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| |||
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
141 | | - | |
| 139 | + | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
| |||
177 | 175 | | |
178 | 176 | | |
179 | 177 | | |
180 | | - | |
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
185 | 182 | | |
186 | 183 | | |
187 | | - | |
| 184 | + | |
188 | 185 | | |
189 | 186 | | |
190 | 187 | | |
| |||
193 | 190 | | |
194 | 191 | | |
195 | 192 | | |
196 | | - | |
197 | 193 | | |
198 | 194 | | |
199 | 195 | | |
| |||
208 | 204 | | |
209 | 205 | | |
210 | 206 | | |
211 | | - | |
212 | 207 | | |
213 | 208 | | |
214 | 209 | | |
| |||
0 commit comments