Repository navigation
Description
Summary
All five tests in tests/unit/test_ent96_timeline_split.py have been failing on dev since 2026-08-15, and no CI job reports it.
FAILED tests/unit/test_ent96_timeline_split.py::test_split_rows_fold_to_one_row_per_interval
FAILED tests/unit/test_ent96_timeline_split.py::test_two_raw_triggers_in_one_bucket_merge_into_that_bucket
FAILED tests/unit/test_ent96_timeline_split.py::test_failures_are_carried_per_label_not_only_in_the_column_total
FAILED tests/unit/test_ent96_timeline_split.py::test_the_breakdown_always_sums_to_its_own_column
FAILED tests/unit/test_ent96_timeline_split.py::test_an_unmapped_trigger_lands_in_Other_rather_than_vanishing
Reproduces on a clean origin/dev checkout: python -m pytest tests/unit/test_ent96_timeline_split.py
Root cause — a stale-fixture time bomb
The fixtures hardcode an absolute date and then ask for a relative 24-hour axis:
rows = [
_row("2026-08-14T09", "schedule", 10),
_row("2026-08-14T09", "mcp", 4),
_row("2026-08-14T10", "schedule", 2),
]
out = _shape_execution_timeline(rows, group_by="hour", hours=24, split="trigger")
assert by_bucket["2026-08-14T09"]["total"] == 14 # KeyErrorhours=24 gap-fills a continuous UTC axis over [now-24h, now]. The file landed on 2026-08-14 (#2184), so the fixture bucket sat inside the window that day and the tests passed. From 2026-08-15 onward 2026-08-14T09 is outside the axis, the gap-fill drops it, and every assertion keyed on that bucket raises KeyError.
Demonstrated directly — same rows, same function, only the window varies:
hours= 24 -> fixture bucket present: False
hours= 168 -> fixture bucket present: True
hours= 720 -> fixture bucket present: True
The product code is fine. Gap-filling a relative window is exactly what _shape_execution_timeline is specified to do (architecture.md: hour/day are gap-filled on a continuous UTC axis). Only the test is wrong.
Why CI never said anything
Two mechanisms combine so this is invisible rather than merely tolerated:
- On PRs, the unit suite runs with
|| trueandregression diffcompares base against head. Both sides fail identically, so it reports no regression — green. - On pushes to
dev, the diff job does not run at all (if: github.event_name != 'push'), so nothing evaluates the result.
The failure is therefore structurally unobservable: it will not surface on any PR, and it will not surface on any dev push. It was found by running the suite locally while validating an unrelated PR (#2232).
This is the more interesting half of the bug. A test that can rot into permanent red without a single red check is worth more than the five assertions it contains.
Fix
Make the fixture relative to the same clock the function uses — derive the bucket keys from utc_now_iso()-based arithmetic instead of literals, so a 24h-window test always places its rows inside a 24h window. (Widening to hours=168 would also go green, but it silently stops testing the 24h axis the ent#96 tile actually ships.)
Acceptance criteria
-
tests/unit/test_ent96_timeline_split.pypasses ondevand keeps passing on any future date (no absolute date literals in fixtures whose assertions depend on a relative window) - A test that would have caught the rot: the suite is exercised at a simulated later "now" (e.g. frozen clock a week on) and still passes
- Separately, decide whether a whole-suite red on
devshould be reportable at all — today neither the PR diff job nor the push run can see it. A cheap option is a scheduled or push-triggered absolute-failure-count check against a committed baseline, distinct from the base-vs-head diff.
Activity
fix(ci): make a wholly-red suite reportable, and detect calendar rot …
fix(ci): make a wholly-red suite reportable, and detect calendar rot …
fix(tests): let the Abilityai#2314 transition pins retire themselves …