Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/heart-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ on:
push:
branches: [main]
pull_request:
# A manual door. Measured 2026-09-05 (PyAutoHeart#209): a PR opened while
# main's tip was the daily `[skip ci]` record commit got NO pull_request run
# at all, and without this trigger nothing could run the suite on that head
# short of pushing to it. Dispatch it on the branch; the check runs land on
# the head sha like any other run.
workflow_dispatch:

concurrency:
group: heart-tests-${{ github.ref }}
Expand Down
8 changes: 7 additions & 1 deletion heart/checks/ci_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,17 @@ def main(argv: list[str] | None = None) -> int:
today = ns.today or datetime.datetime.now(datetime.timezone.utc).date().isoformat()
thr = load_thresholds()
record_dir = Path(ns.record_dir) if ns.record_dir else _timings.TIMINGS_DIR
# compare within the current epoch only — a boundary in
# timings/epochs.jsonl is where the world changed (a rebuild, a runner
# change), and a baseline from before it is not a baseline.
epochs = _timings.read_epochs(record_dir / "epochs.jsonl")
since = ((_timings.current_epoch(epochs) or {}).get("date") or "")
rollup = aggregate(
read_sidecars(per_repo), read_prev_board(ns.prev_board), today, ts,
thr,
record_history=_timings.gates_history(
record_dir / "gates.jsonl", int(thr.get("history_cap", 30))
record_dir / "gates.jsonl", int(thr.get("history_cap", 30)),
since=since,
),
)
_write(Path(ns.out), rollup)
Expand Down
9 changes: 8 additions & 1 deletion heart/checks/smoke_timings.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,17 @@ def main(argv: list[str] | None = None) -> int:

per_repo = Path(ns.per_repo_dir) if ns.per_repo_dir else _state.HEART_PER_REPO_DIR
record_dir = Path(ns.record_dir) if ns.record_dir else _timings.TIMINGS_DIR
# compare within the current epoch only — a boundary in
# timings/epochs.jsonl is where the world changed (a rebuild, a runner
# change), and a baseline from before it is not a baseline.
epochs = _timings.read_epochs(record_dir / "epochs.jsonl")
since = ((_timings.current_epoch(epochs) or {}).get("date") or "")
rollup = aggregate(
read_sidecars(per_repo), read_prev_board(ns.prev_board), ts,
load_thresholds(),
record_prev_rows=_timings.previous_script_rows(record_dir / "scripts"),
record_prev_rows=_timings.previous_script_rows(
record_dir / "scripts", since=since
),
)
_write(Path(ns.out), rollup)
print(summary_line(rollup))
Expand Down
10 changes: 8 additions & 2 deletions heart/checks/unit_timings.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,11 +943,17 @@ def main(argv: list[str] | None = None) -> int:
per_repo = Path(ns.per_repo_dir) if ns.per_repo_dir else _state.HEART_PER_REPO_DIR
record_dir = Path(ns.record_dir) if ns.record_dir else _timings.TIMINGS_DIR
unit_dir = record_dir / "unit"
# compare within the current epoch only — a boundary in
# timings/epochs.jsonl is where the world changed (a rebuild, a runner
# change), and a baseline from before it is not a baseline.
epochs = _timings.read_epochs(record_dir / "epochs.jsonl")
since = ((_timings.current_epoch(epochs) or {}).get("date") or "")
rollup = aggregate(
read_sidecars(per_repo), ts, thresholds,
record_prev_rows=_timings.previous_unit_rows(unit_dir),
record_prev_rows=_timings.previous_unit_rows(unit_dir, since=since),
record_import_history=_timings.import_history(
unit_dir, int(thresholds.get("import_window", 7) or 7)
unit_dir, int(thresholds.get("import_window", 7) or 7),
since=since,
),
)
_write(Path(ns.out), rollup)
Expand Down
23 changes: 21 additions & 2 deletions heart/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,15 +986,25 @@ def _record_lines(record: Any) -> tuple[str, str]:
Empty strings when the census is absent — a snapshot taken before the
record existed must render byte-identically to how it always did, so the
caller appends nothing rather than a line saying "0 days".

When the census carries an epoch, both lines say which one: the readers
compare inside it and nothing before it is visible to them, so the history
a row claims to stand on is the history *since that boundary*. A census
without one adds no suffix, and renders exactly as it always did.
"""
if not isinstance(record, dict) or not record:
return "", ""
days = _as_int(record.get("gates_days"))
obs = _as_int(record.get("scripts_observations"))
repos = _as_int(record.get("repos"))
epoch = record.get("epoch")
suffix = ""
if isinstance(epoch, dict) and epoch.get("label") and epoch.get("date"):
suffix = f" · epoch {epoch['label']} since {epoch['date']}"
return (
f"record: timings/gates.jsonl — {days} days",
f"record: timings/scripts/ — {obs} observations across {repos} repos",
f"record: timings/gates.jsonl — {days} days{suffix}",
f"record: timings/scripts/ — {obs} observations across {repos} repos"
f"{suffix}",
)


Expand Down Expand Up @@ -1257,6 +1267,15 @@ def _performance_sections(snapshot: dict, sections: list[Section]) -> dict | Non
if isinstance(r, dict)],
"errors": list(ut.get("errors") or []),
}
epoch = record.get("epoch")
if isinstance(epoch, dict) and epoch.get("label") and epoch.get("date"):
# Additive, and emitted ONLY when there is a boundary in force (#208):
# the Brain board reads this block verbatim, so a census without an
# epoch must leave it byte-identical to what it always was. It says
# which epoch every `prev_*` figure above was drawn from — a reader
# comparing two boards across a boundary needs to know the baseline
# changed underneath them.
block["epoch"] = {"label": str(epoch["label"]), "date": str(epoch["date"])}
return block


Expand Down
Loading
Loading