fix(demo): anchor seeded dates to the real reset moment

Booking/inspection/maintenance/outbox dates were authored as absolute
timestamps around a fixed 2026-08-01 anchor and never re-anchored at
seed/reset time, so demo scenarios (e.g. BK-DEMO-RETURN) silently drifted
into the past. Every reset now shifts seeded dates by (today - authored
anchor); dashboard's "today" filter uses real wall-clock time instead of
the now-removed frozen demo_today setting. Adds seed-validation tests
proving scenarios S1/S2/S4/S5 are present and internally consistent after
every reset.
This commit is contained in:
NuklearRabbit
2026-08-03 13:08:02 +02:00
parent 7c94eb9e87
commit 8989ffb23c
9 changed files with 218 additions and 15 deletions
+14
View File
@@ -42,6 +42,19 @@ One seeded outbox/workflow record is failed with a safe simulated connection err
Question: “What must I do when a vehicle returns with damage?” Expected: answer cites damage handling and return inspection procedures.
## Date anchoring
The committed CSVs store absolute ISO timestamps authored around a fixed anchor date
(`SEED_AUTHORED_ANCHOR = 2026-08-01` in `backend/app/seed_loader.py`, matching the
`--anchor` used to generate them). Every seed/reset shifts every seeded booking,
inspection, maintenance and outbox timestamp by `today SEED_AUTHORED_ANCHOR`, so
"today"/"near-future"/"currently overlapping" scenarios stay true to the real moment the
environment was (re)seeded instead of decaying as real time passes between resets. Public
refs and entity relationships are untouched by the shift — only datetime columns move.
`load_seed()` returns the resolved `anchor_date`/`seeded_at`, and records a
`demo_data_seeded` audit event carrying both the resolved anchor and the original
authoring anchor, so the shift applied on any given reset stays traceable.
## Demo reset
Reset must:
@@ -49,6 +62,7 @@ Reset must:
- require Operations Manager;
- rebuild the deterministic dataset;
- re-establish scenario references;
- re-anchor scenario dates to the real reset moment (see above);
- clear non-seed audit/workflow state;
- complete safely and visibly;
- be covered by a test.