Commit 847bb6a
Derived event rows are written via stable-key UPSERT, so when the
current derivation logic stops emitting a given row (e.g. a classifier
change like deriveCorrectionEdges no longer flagging Codex image-only
messages), the old row is never re-touched - it orphans with a stale
ts (the friction_event 1970-epoch residue). A full re-derive could
neither overwrite nor remove it.
On a FULL re-derive (no --since window) every friction/diagnostic row is
re-emitted from a complete scan, so cmdSignals now clears those two
standalone derived tables before re-inserting - orphans vanish. A bare
DELETE (no WHERE) sidesteps the DELETE-WHERE-on-indexed-field ghost-row
footgun (PR #141). A --since run keeps the UPSERT-only path: clearing
there would drop rows whose source falls outside the window. The gate is
the existing full-derive predicate (shouldDeriveAllTimeSkillPairs), the
same one that guards all-time skill-pair writes.
Scoped to the two tables named in the issue (friction_event,
diagnostic_event); other UPSERT-keyed derived edges can get the same
treatment as a follow-up.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6d53e32 commit 847bb6a
3 files changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
251 | 263 | | |
252 | 264 | | |
253 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
103 | 117 | | |
104 | 118 | | |
105 | 119 | | |
| |||
0 commit comments