Elie Habib
20ad5f5be0
chore(tests): add chokepoint-baselines fixture + parity guard (§L #8 ) ( #3379 )
...
* chore(tests): add chokepoint-baselines fixture + parity guard (§L #8 )
Closes gap #8 from docs/internal/energy-atlas-registry-expansion.md §L —
the last missing V5-7 golden fixture.
Adds `tests/fixtures/chokepoint-baselines-sample.json` as a snapshot of
the expected buildPayload output shape (7 EIA chokepoints, top-level
source/referenceYear/chokepoints). Extends the existing
`tests/chokepoint-baselines-seed.test.mjs` with a 3-test fixture-parity
describe block that catches any silent drift in:
- Top-level key set (source, referenceYear, chokepoints array length)
- Position-by-position chokepoint entries (id, relayId, mbd)
- updatedAt ISO-parseability (format only — value is volatile)
Doesn't snapshot updatedAt byte-for-byte because it's a per-run
timestamp; parity is scoped to the schema-stable fields downstream
consumers depend on (CountryDeepDivePanel transit-chokepoint scoring,
shock RPC CHOKEPOINT_EXPOSURE lookup, chokepoint-flows calibration).
If a future change adds/removes an entry or renames a field, this
suite fails until the fixture is updated alongside — making schema
drift a deliberate reviewed action rather than a silent shift.
Test plan:
- [x] `npx tsx --test tests/chokepoint-baselines-seed.test.mjs` — 17/17 pass
- [x] `npm run typecheck` — clean
- [x] `npm run test:data` — 6697/6697 pass (+3 new fixture-parity cases)
* fix(tests): validate fixture against buildPayload + assert all fields (review P2)
Codex P2: the parity check validated entries against the CHOKEPOINTS
constant, not buildPayload().chokepoints — so it guarded the source
array rather than the seeded wire contract the fixture claims to
snapshot. If buildPayload ever transforms entries (coerce, reorder,
normalize), the check would miss it.
Also P2: the fixture contained richer fields (name, lat, lon) but the
old assert only checked id/relayId/mbd — most of the fixture realism
was unused and produced false confidence.
Fix:
- Parity loop now iterates payload.chokepoints (seeded output, not
the raw source array) and asserts id, relayId, name, mbd, lat, lon
per entry.
- Added an entry-key-set assertion that catches added/removed fields
between seed and fixture — forces deliberate evolution rather than
silent drift.
18 tests pass (was 17), typecheck clean.
2026-04-24 19:09:36 +04:00
..
2026-04-24 19:09:36 +04:00
2026-04-22 16:44:12 +04:00
2026-04-23 22:21:25 +04:00
2026-04-03 10:27:37 +04:00
2026-03-21 17:15:29 +04:00
2026-04-22 21:37:25 +04:00
2026-04-24 18:13:22 +04:00
2026-04-04 12:35:23 +04:00
2026-03-30 08:10:37 +04:00
2026-03-29 16:59:24 +04:00
2026-04-13 21:57:11 +04:00
2026-04-13 20:35:16 +04:00
2026-04-13 15:05:44 +04:00
2026-04-23 07:34:07 +04:00
2026-04-19 15:18:12 +04:00
2026-04-18 12:30:08 +04:00
2026-04-23 11:25:05 +04:00
2026-04-21 08:58:02 +04:00
2026-04-23 11:50:19 +04:00
2026-04-19 14:15:59 +04:00
2026-04-18 21:49:17 +04:00
2026-04-24 16:25:14 +04:00
2026-04-21 22:25:54 +04:00
2026-04-24 16:25:14 +04:00
2026-04-21 13:46:21 +04:00
2026-04-18 23:32:48 +04:00
2026-04-19 14:15:59 +04:00
2026-04-19 14:15:59 +04:00
2026-04-19 14:15:59 +04:00
2026-04-18 20:27:08 +04:00
2026-04-22 08:21:01 +04:00
2026-04-16 07:58:18 +04:00
2026-04-04 18:24:15 +04:00
2026-04-22 16:08:43 +04:00
2026-04-22 16:08:43 +04:00
2026-04-22 15:07:22 +04:00
2026-04-22 15:07:22 +04:00
2026-04-22 15:42:35 +04:00
2026-04-22 23:37:46 +04:00
2026-04-22 15:47:57 +04:00
2026-04-24 19:09:36 +04:00
2026-04-12 21:34:38 +04:00
2026-04-07 22:51:16 +04:00
2026-03-14 23:27:27 +04:00
2026-03-14 17:14:46 +04:00
2026-03-27 12:21:23 +04:00
2026-03-26 10:13:10 +04:00
2026-04-05 09:22:07 +04:00
2026-04-04 08:11:49 +04:00
2026-04-04 08:11:49 +04:00
2026-04-13 19:44:25 +04:00
2026-03-04 20:42:51 +04:00
2026-04-22 09:55:59 +03:00
2026-04-22 09:55:59 +03:00
2026-03-15 02:40:33 +04:00
2026-03-14 21:29:21 +04:00
2026-04-12 20:29:50 +04:00
2026-03-15 15:42:27 +04:00
2026-04-13 08:04:50 +04:00
2026-04-10 17:35:21 +04:00
2026-04-04 15:38:02 +04:00
2026-04-15 09:16:27 +04:00
2026-03-07 18:23:32 +04:00
2026-04-13 19:44:25 +04:00
2026-04-01 23:27:54 +04:00
2026-03-23 23:23:06 +04:00
2026-03-08 22:54:40 +04:00
2026-03-08 09:33:49 +04:00
2026-03-18 10:42:49 +04:00
2026-04-23 22:21:25 +04:00
2026-04-11 09:39:27 +04:00
2026-03-18 10:19:17 +04:00
2026-04-21 22:36:30 +04:00
2026-04-17 17:43:21 +04:00
2026-04-20 10:19:03 +04:00
2026-04-16 17:28:16 +04:00
2026-02-26 10:07:59 +04:00
2026-04-05 12:52:20 +04:00
2026-04-22 09:55:59 +03:00
2026-04-07 22:24:17 +04:00
2026-04-22 15:59:03 +04:00
2026-04-22 09:55:59 +03:00
2026-04-24 19:08:07 +04:00
2026-04-09 13:06:08 +04:00
2026-04-05 13:26:19 +04:00
2026-04-14 09:05:50 +04:00
2026-04-12 22:41:44 +04:00
2026-04-09 22:16:24 +04:00
2026-03-21 16:24:17 +04:00
2026-04-18 15:19:12 +04:00
2026-04-24 07:53:51 +04:00
2026-04-24 07:53:51 +04:00
2026-03-13 12:32:53 +04:00
2026-04-13 13:00:14 +04:00
2026-03-19 12:11:57 +04:00
2026-03-24 18:52:02 +04:00
2026-03-15 15:57:22 +04:00
2026-04-23 20:38:11 +04:00
2026-03-19 03:45:32 +04:00
2026-04-23 07:34:07 +04:00
2026-04-23 07:34:07 +04:00
2026-04-05 12:32:13 +04:00
2026-04-08 20:05:13 +04:00
2026-04-16 10:41:15 +04:00
2026-02-28 10:58:53 +04:00
2026-04-22 22:58:31 +04:00
2026-04-12 07:58:01 +04:00
2026-04-22 22:58:31 +04:00
2026-03-15 15:42:27 +04:00
2026-03-19 10:35:00 +04:00
2026-04-14 08:19:47 +04:00
2026-04-14 08:19:47 +04:00
2026-04-12 22:53:32 +04:00
2026-04-12 19:41:27 +04:00
2026-03-28 23:07:18 +04:00
2026-04-13 22:03:27 +04:00
2026-02-17 19:22:55 +04:00
2026-04-24 16:25:14 +04:00
2026-03-03 15:13:29 +04:00
2026-04-14 08:28:57 +04:00
2026-04-09 13:06:08 +04:00
2026-04-13 12:51:35 +04:00
2026-04-13 21:53:21 +04:00
2026-04-11 16:44:25 +04:00
2026-03-04 20:42:51 +04:00
2026-03-31 12:21:11 +04:00
2026-04-09 13:06:08 +04:00
2026-04-09 13:06:08 +04:00
2026-02-25 10:53:22 +04:00
2026-03-13 08:50:10 +04:00
2026-03-21 16:47:42 +04:00
2026-03-19 17:00:45 +04:00
2026-04-24 19:01:47 +04:00
2026-03-14 18:11:11 +04:00
2026-02-15 19:22:40 +04:00
2026-04-24 19:09:21 +04:00
2026-03-05 09:28:07 +04:00
2026-04-11 17:54:26 +04:00
2026-03-28 21:17:41 +04:00
2026-03-13 00:21:08 +04:00
2026-04-23 16:24:03 +03:00
2026-03-31 12:21:11 +04:00
2026-03-20 17:23:51 +04:00
2026-03-20 17:23:51 +04:00
2026-04-23 19:42:13 +04:00
2026-03-12 08:01:32 +04:00
2026-04-21 19:41:58 +04:00
2026-03-01 10:07:38 +04:00
2026-03-17 01:41:54 +04:00
2026-03-16 08:40:14 +04:00
2026-02-18 23:31:44 +04:00
2026-02-18 23:31:44 +04:00
2026-04-22 09:55:59 +03:00
2026-04-13 08:35:38 +04:00
2026-03-20 16:08:48 +04:00
2026-04-24 16:25:14 +04:00
2026-04-24 16:25:14 +04:00
2026-04-24 16:25:14 +04:00
2026-04-20 08:40:29 +04:00
2026-04-12 14:04:31 +04:00
2026-04-16 09:24:12 +04:00
2026-03-01 15:59:53 +04:00
2026-03-01 15:59:53 +04:00
2026-02-28 18:02:23 +04:00
2026-04-09 13:06:08 +04:00
2026-04-12 00:18:04 +04:00
2026-04-23 07:34:07 +04:00
2026-04-23 07:34:07 +04:00
2026-04-23 07:34:07 +04:00
2026-04-23 07:34:07 +04:00
2026-04-07 22:56:08 +04:00
2026-04-13 14:13:18 +04:00
2026-04-22 22:37:08 +04:00
2026-04-09 13:06:08 +04:00
2026-03-12 14:02:58 +04:00
2026-03-27 10:43:32 +04:00
2026-04-04 11:48:12 +04:00
2026-04-22 16:21:40 +04:00
2026-04-06 12:28:21 +04:00
2026-04-17 17:43:21 +04:00
2026-04-14 13:14:53 +04:00
2026-04-24 18:00:41 +03:00
2026-04-24 18:14:04 +04:00
2026-04-22 15:26:09 +04:00
2026-04-12 11:06:51 +04:00
2026-04-12 00:23:20 +04:00
2026-04-12 01:03:28 +04:00
2026-04-11 23:39:20 +04:00
2026-04-12 07:58:01 +04:00
2026-04-12 09:56:35 +04:00
2026-04-11 20:28:55 +04:00
2026-04-04 23:19:33 +04:00
2026-04-04 23:19:33 +04:00
2026-03-19 09:09:48 +04:00
2026-04-13 21:53:21 +04:00
2026-04-23 08:51:27 +04:00
2026-04-22 16:44:12 +04:00
2026-04-24 18:14:04 +04:00
2026-04-22 16:44:12 +04:00
2026-04-23 09:01:30 +04:00
2026-04-24 18:13:22 +04:00
2026-04-05 17:46:22 +04:00
2026-04-22 23:57:28 +04:00
2026-04-23 09:01:30 +04:00
2026-04-23 09:01:30 +04:00
2026-04-23 09:01:30 +04:00
2026-04-24 18:14:29 +04:00
2026-04-24 09:37:18 +04:00
2026-04-24 18:25:50 +04:00
2026-04-11 20:04:26 +04:00
2026-04-24 18:14:04 +04:00
2026-04-22 17:10:38 +04:00
2026-04-23 09:01:30 +04:00
2026-04-12 10:24:19 +04:00
2026-04-09 22:06:54 +04:00
2026-04-09 22:06:54 +04:00
2026-04-12 10:24:19 +04:00
2026-04-04 19:27:37 +04:00
2026-04-23 09:01:30 +04:00
2026-04-24 18:14:04 +04:00
2026-04-24 18:14:04 +04:00
2026-04-22 06:52:07 +04:00
2026-04-21 22:37:27 +04:00
2026-04-22 06:52:07 +04:00
2026-04-24 18:14:04 +04:00
2026-04-23 10:25:18 +04:00
2026-04-23 10:25:18 +04:00
2026-04-23 09:01:30 +04:00
2026-04-23 09:01:30 +04:00
2026-04-24 18:30:59 +04:00
2026-04-23 10:25:18 +04:00
2026-04-24 18:14:04 +04:00
2026-04-12 10:22:21 +04:00
2026-04-12 10:10:10 +04:00
2026-04-13 13:00:58 +04:00
2026-04-04 16:24:28 +04:00
2026-04-23 09:01:30 +04:00
2026-04-08 20:05:13 +04:00
2026-04-11 09:11:07 +04:00
2026-04-12 09:57:09 +04:00
2026-04-12 08:16:02 +04:00
2026-04-12 08:25:38 +04:00
2026-04-12 08:25:38 +04:00
2026-03-19 11:05:41 +04:00
2026-03-15 16:54:42 +04:00
2026-02-15 19:22:40 +04:00
2026-03-21 20:26:02 +04:00
2026-03-21 20:26:02 +04:00
2026-04-22 09:55:59 +03:00
2026-04-11 20:19:01 +04:00
2026-04-11 06:58:43 +04:00
2026-04-16 20:02:31 +04:00
2026-04-11 17:05:39 +04:00
2026-04-24 18:14:04 +04:00
2026-04-12 09:53:21 +04:00
2026-04-14 12:29:17 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-14 22:11:56 +04:00
2026-04-18 14:40:00 +04:00
2026-04-14 09:02:21 +04:00
2026-04-14 22:11:56 +04:00
2026-04-14 22:11:56 +04:00
2026-04-14 12:36:07 +04:00
2026-04-13 21:57:11 +04:00
2026-04-14 08:19:47 +04:00
2026-04-24 07:21:13 +04:00
2026-03-21 12:43:56 +04:00
2026-04-12 10:10:10 +04:00
2026-04-12 11:39:48 +04:00
2026-04-24 18:13:41 +04:00
2026-04-12 10:10:10 +04:00
2026-04-23 21:35:25 +04:00
2026-04-14 09:02:21 +04:00
2026-04-15 09:16:27 +04:00
2026-04-14 13:28:00 +04:00
2026-03-16 08:48:00 +04:00
2026-04-22 23:37:46 +04:00
2026-04-22 09:55:59 +03:00
2026-03-17 12:17:25 +04:00
2026-03-21 16:37:43 +04:00
2026-04-24 18:00:41 +03:00
2026-04-23 07:34:07 +04:00
2026-03-28 19:52:59 +04:00
2026-04-22 17:11:18 +04:00
2026-03-19 12:11:57 +04:00
2026-04-09 22:16:24 +04:00
2026-04-23 16:24:03 +03:00
2026-04-11 14:26:36 +04:00
2026-04-23 16:24:03 +03:00
2026-04-15 14:00:57 +04:00
2026-03-17 19:25:08 +04:00
2026-04-23 07:34:07 +04:00
2026-04-23 07:34:07 +04:00
2026-04-23 07:34:07 +04:00
2026-04-24 16:25:14 +04:00
2026-03-31 12:21:11 +04:00
2026-04-24 16:25:14 +04:00
2026-04-11 08:39:13 +04:00
2026-03-14 21:29:21 +04:00
2026-04-18 23:14:00 +04:00
2026-04-12 08:36:42 +04:00
2026-04-09 21:41:26 +04:00
2026-04-22 09:55:59 +03:00
2026-04-18 22:54:58 +04:00
2026-04-23 07:58:40 +04:00
2026-03-19 11:08:04 +04:00
2026-03-17 14:24:26 +04:00
2026-03-17 14:24:26 +04:00
2026-04-11 08:21:08 +04:00
2026-04-18 23:14:00 +04:00
2026-04-04 23:18:53 +04:00
2026-04-22 09:55:59 +03:00
2026-04-15 09:16:27 +04:00
2026-04-01 10:15:26 +04:00
2026-03-02 14:47:14 +04:00
2026-04-11 17:10:06 +04:00
2026-03-08 14:14:16 +04:00
2026-04-24 08:21:07 +04:00
2026-03-27 11:49:01 +04:00
2026-03-27 16:52:56 +04:00
2026-04-11 07:07:11 +04:00
2026-04-16 09:25:06 +04:00