builtbykev
35da190f2c
Retention hotfix: drop published_side, derive the schema contract, break the silence
...
`createCollector.onPublished` set `published_side` beside `published`.
`published_side` is not a model_snapshots column. supabase-js declares the
UNION of row keys in the `columns=` parameter, so one invalid key made
PostgREST reject the ENTIRE batch with a 400 — every sport, every cycle.
Retention is best-effort, so nothing surfaced. Confirmed in edge logs.
The field was redundant as well as invalid: `side` is already on the row.
Deleted rather than added to the schema — a column would preserve an
accidental artifact.
Three things missed it, and each is now closed:
1. WRONG SHAPE INSPECTED. The manual check sampled the collector after
onGraded only and never called onPublished, so the offending key was
not yet on the row. It read a pre-publication shape and reported the
final outbound shape as clean. The new test captures the array actually
handed to .upsert(), after the full production call order.
2. NO CONTRACT. Every retention test injects a permissive fake client that
accepts any column set, so 381 suites proved the logic and never once
compared a row against the database. The contract is now DERIVED — the
migration chain applied to a disposable postgres, read out of
information_schema (scripts/generate-schema-contract.js). A
hand-maintained list would be a second opinion about the schema, and a
second opinion is what let this through. scripts/verify-schema-contract.js
checks the contract still describes a live database.
3. SILENT FAILURE. A failed batch reached one console.log. It now emits a
high-severity structured event carrying sport, snapshot id, stage,
error, code_sha and timestamp. Best-effort semantics are unchanged —
the product continues and says so — but the failure is observable.
`skipped` (no database configured) is not a failure and does not alert.
Teeth, each with the injection verified present before the run:
- published_side back into the final payload -> 4 tests fail; restored
byte-identically (sha 6a0ced7c52134135 both sides)
- settled_at (a REAL contract column) -> accepted, so the guard
discriminates by contract membership, not by novelty
- alert block deleted -> 3 tests fail; restored byte-identically
Model and product behaviour untouched: analyzeViaEngine1,
probabilityEstimator, gradeSlateService, lineageCanaryConfig all unchanged.
Lineage stays OFF. Net source change is one behavioural line plus the alert.
382 suites / 5,094 tests pass. web tsc exit 0 (zero web paths touched).
Measurement blackout recorded, NOT backfilled: last good retention write
2026-08-27T19:08:32Z; ceaa896 started 21:16:41Z; the 22:00 UTC cycle ran
(ledger wrote 22:05:02) and persisted zero snapshot rows.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01CQJeAG8vcDoL5zkiaJyVb8
2026-08-27 18:53:37 -04:00
..
2026-06-08 18:35:13 -04:00
2026-06-11 03:48:07 -04:00
2026-03-21 14:21:34 -04:00
2026-06-10 13:24:11 -04:00
2026-08-07 14:07:02 -04:00
2026-07-10 21:34:26 -04:00
2026-06-10 19:41:37 -04:00
2026-07-20 22:38:32 -04:00
2026-07-16 17:01:48 -04:00
2026-07-20 22:38:32 -04:00
2026-07-12 23:41:13 -04:00
2026-07-20 11:31:48 -04:00
2026-07-20 01:10:23 -04:00
2026-07-19 22:27:58 -04:00
2026-08-14 16:53:37 -04:00
2026-08-07 15:00:24 -04:00
2026-07-13 03:48:58 -04:00
2026-08-02 19:04:08 -04:00
2026-07-27 00:45:01 -04:00
2026-07-29 04:09:34 -04:00
2026-07-11 14:28:18 -04:00
2026-07-11 14:28:18 -04:00
2026-07-27 00:45:01 -04:00
2026-07-18 13:55:39 -04:00
2026-07-12 13:42:18 -04:00
2026-08-07 03:28:33 -04:00
2026-08-07 02:25:45 -04:00
2026-08-06 18:31:19 -04:00
2026-08-06 23:01:57 -04:00
2026-08-11 22:49:56 -04:00
2026-03-21 14:21:34 -04:00
2026-06-08 18:35:13 -04:00
2026-08-14 16:53:37 -04:00
2026-08-27 16:29:38 -04:00
2026-07-21 00:30:16 -04:00
2026-07-21 21:38:51 -04:00
2026-08-07 03:28:33 -04:00
2026-07-20 12:27:47 -04:00
2026-08-12 00:34:04 -04:00
2026-07-20 13:37:52 -04:00
2026-07-20 13:58:47 -04:00
2026-08-02 21:49:30 -04:00
2026-06-08 18:35:13 -04:00
2026-07-31 00:57:57 -04:00
2026-07-13 16:58:22 -04:00
2026-07-13 16:58:22 -04:00
2026-07-13 16:58:22 -04:00
2026-07-18 01:52:37 -04:00
2026-08-02 03:29:23 -04:00
2026-07-20 03:50:07 -04:00
2026-07-19 18:54:51 -04:00
2026-08-01 00:50:54 -04:00
2026-07-22 21:05:16 -04:00
2026-07-22 22:42:55 -04:00
2026-08-07 16:34:57 -04:00
2026-06-13 21:30:57 -04:00
2026-06-13 21:30:57 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-08-03 02:34:02 -04:00
2026-03-21 12:45:15 -04:00
2026-07-31 06:04:19 -04:00
2026-07-31 06:18:12 -04:00
2026-08-12 00:14:12 -04:00
2026-06-18 20:15:38 -04:00
2026-06-18 20:15:38 -04:00
2026-07-18 01:42:16 -04:00
2026-07-19 02:43:30 -04:00
2026-07-20 13:17:34 -04:00
2026-07-12 19:25:32 -04:00
2026-07-13 00:07:06 -04:00
2026-07-31 00:57:57 -04:00
2026-07-27 06:04:00 -04:00
2026-08-01 01:55:43 -04:00
2026-08-01 01:55:43 -04:00
2026-07-31 00:39:13 -04:00
2026-07-10 20:17:49 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-07-20 17:05:04 -04:00
2026-07-13 11:44:15 -04:00
2026-07-21 21:38:51 -04:00
2026-07-13 18:44:57 -04:00
2026-07-13 18:12:31 -04:00
2026-07-14 00:21:59 -04:00
2026-07-13 13:18:59 -04:00
2026-07-13 18:12:31 -04:00
2026-08-27 16:50:50 -04:00
2026-07-11 00:47:01 -04:00
2026-08-11 22:49:56 -04:00
2026-08-05 19:58:37 -04:00
2026-06-08 18:35:13 -04:00
2026-07-13 18:44:57 -04:00
2026-08-01 02:40:46 -04:00
2026-06-10 19:41:37 -04:00
2026-06-10 14:50:13 -04:00
2026-06-08 18:35:13 -04:00
2026-07-31 07:53:44 -04:00
2026-07-16 11:26:00 -04:00
2026-07-13 23:27:19 -04:00
2026-07-13 23:33:26 -04:00
2026-07-20 03:25:01 -04:00
2026-06-10 19:41:37 -04:00
2026-06-10 03:37:07 -04:00
2026-08-06 01:03:10 -04:00
2026-08-01 01:55:43 -04:00
2026-07-22 21:05:16 -04:00
2026-07-13 14:36:28 -04:00
2026-06-15 18:21:32 -04:00
2026-06-08 18:35:13 -04:00
2026-07-13 13:18:59 -04:00
2026-06-08 18:35:13 -04:00
2026-07-29 04:43:21 -04:00
2026-08-11 22:49:56 -04:00
2026-08-07 02:53:48 -04:00
2026-06-08 18:35:13 -04:00
2026-06-12 11:16:58 -04:00
2026-07-17 03:15:50 -04:00
2026-06-10 22:24:40 -04:00
2026-06-08 18:35:13 -04:00
2026-08-01 01:24:55 -04:00
2026-06-10 20:45:05 -04:00
2026-07-11 20:08:24 -04:00
2026-03-21 11:41:18 -04:00
2026-06-18 20:15:38 -04:00
2026-07-11 20:08:24 -04:00
2026-07-17 16:08:18 -04:00
2026-08-02 21:49:30 -04:00
2026-03-21 14:21:34 -04:00
2026-06-08 18:35:13 -04:00
2026-06-13 12:37:08 -04:00
2026-08-04 16:07:13 -04:00
2026-07-12 00:45:29 -04:00
2026-07-12 00:45:29 -04:00
2026-07-29 02:47:47 -04:00
2026-08-12 01:18:10 -04:00
2026-08-06 23:20:05 -04:00
2026-07-13 14:59:44 -04:00
2026-08-02 01:11:05 -04:00
2026-08-11 22:49:56 -04:00
2026-07-11 14:31:35 -04:00
2026-03-21 14:21:34 -04:00
2026-06-08 18:35:13 -04:00
2026-06-11 16:21:18 -04:00
2026-07-17 03:06:12 -04:00
2026-06-19 01:45:36 -04:00
2026-06-18 23:56:26 -04:00
2026-07-13 03:48:58 -04:00
2026-07-11 00:59:17 -04:00
2026-08-07 20:31:55 -04:00
2026-06-19 15:45:07 -04:00
2026-06-19 10:20:55 -04:00
2026-06-19 02:42:13 -04:00
2026-06-18 15:38:06 -04:00
2026-08-02 21:49:30 -04:00
2026-07-11 14:29:22 -04:00
2026-07-13 23:33:26 -04:00
2026-07-13 23:27:19 -04:00
2026-06-15 18:21:32 -04:00
2026-06-10 03:37:07 -04:00
2026-03-22 05:11:42 -04:00
2026-06-08 18:35:13 -04:00
2026-08-01 00:50:54 -04:00
2026-07-13 23:33:26 -04:00
2026-06-08 18:35:13 -04:00
2026-06-12 02:41:51 -04:00
2026-06-14 22:29:01 -04:00
2026-06-12 02:41:51 -04:00
2026-08-07 21:24:36 -04:00
2026-06-19 10:20:55 -04:00
2026-06-08 18:35:13 -04:00
2026-07-20 12:27:47 -04:00
2026-08-01 04:05:43 -04:00
2026-07-11 14:34:45 -04:00
2026-07-20 11:31:48 -04:00
2026-07-10 17:00:29 -04:00
2026-07-13 14:59:44 -04:00
2026-06-11 16:21:18 -04:00
2026-07-21 01:20:29 -04:00
2026-07-21 01:06:17 -04:00
2026-07-21 01:06:17 -04:00
2026-08-05 19:30:17 -04:00
2026-06-12 02:06:22 -04:00
2026-06-19 15:45:07 -04:00
2026-03-21 12:45:15 -04:00
2026-07-13 14:36:28 -04:00
2026-06-19 11:25:14 -04:00
2026-06-10 09:28:30 -04:00
2026-06-13 12:37:08 -04:00
2026-07-11 14:28:18 -04:00
2026-07-11 14:28:18 -04:00
2026-06-08 18:35:13 -04:00
2026-03-22 05:11:42 -04:00
2026-08-06 02:17:00 -04:00
2026-03-22 05:11:42 -04:00
2026-07-10 17:00:29 -04:00
2026-07-10 22:24:47 -04:00
2026-07-13 16:02:16 -04:00
2026-08-03 18:43:32 -04:00
2026-07-21 23:08:11 -04:00
2026-08-04 20:30:57 -04:00
2026-07-21 01:57:33 -04:00
2026-07-17 01:07:28 -04:00
2026-06-18 20:15:38 -04:00
2026-07-20 22:38:32 -04:00
2026-07-20 22:38:32 -04:00
2026-06-19 01:45:36 -04:00
2026-06-18 23:56:26 -04:00
2026-06-18 20:15:38 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-08-06 01:58:38 -04:00
2026-07-22 21:52:41 -04:00
2026-07-27 06:04:00 -04:00
2026-06-08 18:35:13 -04:00
2026-06-18 23:56:26 -04:00
2026-06-19 02:42:13 -04:00
2026-08-02 19:04:08 -04:00
2026-07-23 03:59:36 -04:00
2026-07-28 18:59:12 -04:00
2026-07-11 14:24:41 -04:00
2026-06-14 22:29:01 -04:00
2026-07-31 23:37:23 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 19:38:37 -04:00
2026-07-15 18:07:14 -04:00
2026-06-12 11:16:58 -04:00
2026-08-27 16:29:38 -04:00
2026-07-20 17:05:04 -04:00
2026-06-13 10:57:49 -04:00
2026-07-15 18:07:14 -04:00
2026-08-01 01:55:43 -04:00
2026-08-07 14:07:02 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 03:12:20 -04:00
2026-08-04 15:13:39 -04:00
2026-08-11 22:49:56 -04:00
2026-08-11 22:49:56 -04:00
2026-08-27 16:29:38 -04:00
2026-08-07 03:40:20 -04:00
2026-06-10 01:22:55 -04:00
2026-08-01 02:06:25 -04:00
2026-08-07 22:17:59 -04:00
2026-08-07 22:17:59 -04:00
2026-06-11 21:22:59 -04:00
2026-08-27 18:53:37 -04:00
2026-07-20 02:00:40 -04:00
2026-06-08 18:35:13 -04:00
2026-06-12 17:58:55 -04:00
2026-07-16 21:27:47 -04:00
2026-08-27 17:16:05 -04:00
2026-08-11 22:49:56 -04:00
2026-07-13 16:02:16 -04:00
2026-07-12 19:25:32 -04:00
2026-07-11 14:24:41 -04:00
2026-03-21 10:58:58 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 20:08:24 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 20:45:05 -04:00
2026-08-07 04:53:02 -04:00
2026-08-07 22:17:59 -04:00
2026-06-18 15:38:06 -04:00
2026-06-18 20:15:38 -04:00
2026-07-19 00:19:23 -04:00
2026-07-31 07:29:24 -04:00
2026-07-20 05:41:41 -04:00
2026-08-11 22:49:56 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-03-21 11:41:18 -04:00
2026-06-08 18:35:13 -04:00
2026-08-04 15:13:39 -04:00
2026-07-11 14:28:18 -04:00
2026-07-10 22:24:47 -04:00
2026-06-18 20:15:38 -04:00
2026-08-01 23:34:16 -04:00
2026-07-11 19:32:17 -04:00
2026-07-20 19:52:00 -04:00
2026-07-17 15:26:49 -04:00
2026-06-19 13:55:39 -04:00
2026-07-17 15:26:49 -04:00
2026-08-11 22:49:56 -04:00
2026-06-10 14:50:13 -04:00
2026-06-10 20:45:05 -04:00
2026-06-10 14:50:13 -04:00
2026-06-16 14:37:07 -04:00
2026-06-10 14:50:13 -04:00
2026-06-11 18:15:25 -04:00
2026-06-19 14:25:05 -04:00
2026-07-15 18:07:14 -04:00
2026-07-13 16:58:22 -04:00
2026-06-08 18:35:13 -04:00
2026-08-04 19:53:07 -04:00
2026-06-12 15:45:19 -04:00
2026-07-17 01:42:03 -04:00
2026-08-03 16:27:11 -04:00
2026-06-12 11:16:58 -04:00
2026-06-08 18:35:13 -04:00
2026-06-18 11:12:24 -04:00
2026-07-11 00:39:18 -04:00
2026-06-12 11:16:58 -04:00
2026-07-31 18:42:44 -04:00
2026-08-02 18:19:17 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 14:34:45 -04:00
2026-08-02 14:17:51 -04:00
2026-07-31 00:19:13 -04:00
2026-06-11 10:06:49 -04:00
2026-06-12 11:16:58 -04:00
2026-06-10 19:41:37 -04:00
2026-06-11 16:21:18 -04:00
2026-07-13 00:31:35 -04:00
2026-06-19 15:45:07 -04:00
2026-06-08 18:35:13 -04:00
2026-07-19 20:31:15 -04:00
2026-08-03 22:20:30 -04:00
2026-07-17 15:26:49 -04:00
2026-06-18 21:34:29 -04:00
2026-06-10 13:24:11 -04:00
2026-07-13 13:58:01 -04:00
2026-07-11 14:24:41 -04:00
2026-07-29 22:05:30 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 14:50:13 -04:00
2026-03-21 12:45:15 -04:00
2026-08-07 14:07:02 -04:00
2026-07-17 15:26:49 -04:00
2026-07-10 20:17:49 -04:00
2026-07-29 04:09:34 -04:00
2026-07-16 16:19:30 -04:00
2026-07-27 06:04:00 -04:00
2026-07-31 05:31:56 -04:00
2026-07-31 05:31:56 -04:00
2026-07-10 20:17:49 -04:00
2026-07-31 04:51:42 -04:00
2026-07-31 05:31:56 -04:00
2026-07-21 01:43:13 -04:00
2026-06-11 16:21:18 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-08-11 22:49:56 -04:00
2026-08-14 16:53:37 -04:00
2026-06-10 14:50:13 -04:00