Skip to content

test: legacy baseline timing round — epoch boundary in the record + the pre-rebuild digest #208

Closed

Description

@Jammy2211

Overview

With phases 1–3 live (#203 per-script smoke timings, #205 the permanent timings/ record, #207 unit-test + import timings by ingestion), the board's first full timing round is the legacy reference: the epic's later phases (the _test physical+fast rebuilds, CI caches) will change script content, datasets, pinned likelihoods and compile behaviour, so this round is not the start of the long-term history — it is the pre-rebuild record the rebuilds are measured against. This task (a) gives the record the labeled epoch boundary the phase-2 README reserved (timings/epochs.jsonl), so post-rebuild drift never fires against pre-rebuild baselines, (b) verifies the first live round reports for every repo, and (c) writes the short digest of where the time currently goes — the input evidence for phases 5, 6, 8 and 9.

Phase 4 of the ci-timing-fast-tests epic (PyAutoMind/draft/feature/pyautoheart/ci_timing_fast_tests_epic.md). The first live heart-health.yml run after #207 was dispatched by hand on 2026-09-05 to seed the record without waiting for the 05:00 UTC cron.

Plan

  • timings/epochs.jsonl: append-only, one line per epoch boundary {"date", "label", "note"}; the record's readers compare only within the current epoch (records dated on or after the latest boundary), so a boundary appended when the rebuild lands ends the legacy epoch and every baseline starts fresh.
  • Commit the first line — label: legacy, dated at the record's first day — in this PR, with a heart.timings epoch verb for a human to append later boundaries (the workflow never writes this file).
  • Surface the epoch on the board (one detail line under each timing row; an additive performance.epoch key) so a reader can tell a step change in the world from a regression.
  • Verify the seeded round: every smoke-gated and library repo reports (or the exact unavailable reason is named — the cross-repo artifact 403 is the known one, remedied by the HEART_TIMINGS_TOKEN secret).
  • Write the legacy digest in PyAutoMind (docs/pyautoheart/legacy_timing_round_2026-09.md): slowest scripts per repo, slowest unit tests per library, import floors, and the compile- vs execution-dominated classes, from the ingested rows — linked from the epic ledger.
Detailed implementation plan

Affected Repositories

  • PyAutoHeart (primary: the epoch mechanism + the first epoch line)
  • PyAutoMind (the digest document + epic ledger — ledger-only, lands by itself)

Work Classification

Library (organ code) + a Mind document. No workspace change.

Branch Survey

Repository Current Branch Dirty?
./PyAutoHeart main @ cb1d500 (+ the day's record commit once the dispatched run lands) clean

Branch: claude/ci-test-timing-epic-ke2lul (designated for the epic; restarted from main; cloud session, no task worktree).

Implementation Steps (PyAutoHeart)

  1. heart/timings.py — epochs.
    • read_epochs(path=EPOCHS_FILE) -> list[dict] (read_jsonl, keep lines with a date and a label, sorted by date), current_epoch(epochs, today=None) -> dict | None (the latest boundary whose date ≤ today; None when the file is absent — no epoch is "everything is one epoch", i.e. today's behaviour).
    • append_epoch(path, date, label, note) -> bool — append-only; refuses (False) a duplicate (date, label); never rewrites.
    • Every reader gains since: str = "" (ISO date): gates_history drops lines with date < since; previous_script_rows, previous_unit_rows and import_history drop record lines with date < since before picking the latest per leg / the window. Records without a date are treated as older than any boundary (excluded when since is set).
    • census() gains epoch: {label, date} | null and epochs: int.
    • main: new verb epoch --label LABEL --note NOTE [--date YYYY-MM-DD] [--dir DIR] (prints the line it appended, or "already recorded"); show prints the epoch. The daily append never touches epochs.jsonl (assert in a test).
  2. Callers pass the current epoch. ci_timing.main --aggregate, smoke_timings.main --aggregate, unit_timings.main --aggregate compute since = (current_epoch(read_epochs(record_dir / "epochs.jsonl")) or {}).get("date", "") and pass it to the reader(s). Pure aggregate() functions unchanged.
  3. Board. _record_lines(record) (dashboard.py) adds · epoch <label> since <date> to both record lines when the census carries an epoch; _performance_sections emits an additive "epoch": {"label", "date"} key only when present. Older snapshots byte-identical (test).
  4. timings/epochs.jsonl — the first line, committed in this PR: {"date": "2026-09-05", "label": "legacy", "note": "pre-rebuild reference round of the ci-timing-fast-tests epic: phases 5-7 change _test script content, datasets, pinned likelihoods and CI caches; comparisons must not cross this boundary"}. Dated at the record's first day (the dispatched 2026-09-05 run). Write it with the new epoch verb, never by hand, so the line is byte-identical to what the verb produces.
  5. timings/README.md — replace the "Reserved" section with the live one: the schema, "readers compare within the current epoch", who appends (a human, via the verb, in a PR — a boundary is a judgement about the world), and the standing instruction that the phase that lands the rebuild appends the next boundary (e.g. label: fast-tests) in its own PR.
  6. Tests (fake names): tests/test_timings.py — epochs read/sort, current_epoch picks the latest ≤ today, append_epoch dedupes and never rewrites, every reader honours since (a pre-boundary line is invisible; an undated line is excluded when since is set, included otherwise), census keys, epoch verb via main, append leaves epochs.jsonl untouched; tests/test_dashboard.py — the epoch suffix and performance.epoch present only with the census; the three --aggregate mains pass since (a wiring-level test using a tmp record dir with one pre-boundary and one post-boundary line: only the post-boundary one is compared). Existing tests unmodified.
  7. Validate: full suite green (baseline 841), tenant firewall OK; commit + push; no PR opened by the subagent.

Verification + digest (judgment tier, after the dispatched run lands)

  • Confirm the daily commit on main carries timings/gates.jsonl, timings/scripts/*.jsonl and (once a library CI run has produced unit-timings-*) timings/unit/*.jsonl; read the published board.json for the unavailable counts on the Smoke scripts and Unit-test rows. If the workspace/library repos are all unavailable with a 403, the round cannot be completed until the HEART_TIMINGS_TOKEN secret exists — stop and say so.
  • Digest: PyAutoMind/docs/pyautoheart/legacy_timing_round_2026-09.md — per repo the slowest scripts with seconds and cap, the gate wall-clock medians, per library the slowest tests and suite wall-clock, the import seconds per package, and a classification of the slow class (compile-dominated ENV: jax full-dataset scripts vs execution-dominated vs import-floor) from the names and the numbers, with the caveat where the class is inferred. Linked from the epic ledger as the evidence for phases 5, 6, 8, 9.

Out of scope

  • Appending the second boundary (the rebuild's own PR does it).
  • Any change to script content, datasets or pins (phases 5–7).

Original Prompt

Click to expand starting prompt
# Legacy baseline timing round: snapshot pre-rebuild timings of every CI test surface

Type: test
Target: PyAutoHeart
Repos:
- PyAutoHeart
- workspaces
Difficulty: medium
Autonomy: safe
Priority: high
Status: formalised
Consequence: judge
Review-minutes: 20
Unattended: ready
Epic: ci-timing-fast-tests
Phase: 4

Legacy baseline timing round: snapshot the pre-rebuild timings of every CI test surface.

With phases 1-3 live, do the first full timing round across the workspace, _test workspace
and HowTo repos plus unit tests and import times: trigger/collect a complete pass, verify
every repo reports, and record the snapshot in the phase-2 durable history explicitly
LABELED AS THE LEGACY RECORD. The user's framing: the epic's later phases (the _test
physical+fast rebuild, CI caches) will change script content, datasets and pinned
likelihoods, so this round is a legacy reference — NOT the starting point of the long-term
tracking history, which begins after the rebuild lands. Mark it so in the stored record and
on the board (a labeled epoch boundary, so post-rebuild drift warnings do not fire against
pre-rebuild baselines).

Deliverables: the labeled snapshot committed to PyAutoHeart; a short written digest of
where the time currently goes (slowest scripts per repo, slowest unit tests, import
floors, compile-dominated vs execution-dominated classes) — this digest is the input
evidence for phases 5, 6, 8 and 9 of the epic.

Activity

  1. Jammy2211 commented on Sep 6, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    PyAutoHeart#209 → ad56720, merged 2026-09-06 (CI green on both matrix legs via the new manual door; suite 841 → 864).

    • The record was seeded by a hand-dispatched heart-health.yml run on 2026-09-05: 26 gates, 494 script rows across all 11 smoke-gated repos, 0 legs unavailable (the cross-repo artifact 403 risk from feat(smoke_timings): ingest per-script smoke timings onto the ⏱ board #203 did not materialise; no HEART_TIMINGS_TOKEN needed).
    • timings/epochs.jsonl is live with the first boundary legacy @ 2026-09-05; every record reader compares only within the current epoch; heart.timings epoch is the human door; the board shows the epoch on both timing rows and in performance.epoch.
    • timings/legacy_round_2026-09.md — the digest of where CI time went before the rebuild (the evidence for phases 5–9). Its unit/import section fills once a library CI run has produced the unit-timings artifact.
    • Two aggregate-mode tests made hermetic against the live record (one had gone red on main after the first [skip ci] record commit).
    • heart-tests.yml gained workflow_dispatch: this PR, opened while main's tip was the daily [skip ci] record commit, received no pull_request run even after a synchronize push; the dispatch trigger was the only way to run the suite on the head. Worth watching on future PRs opened right after a daily record commit.

    Phase 4 of the ci-timing-fast-tests epic. Next per the ledger's review order: phase 7 (CI caches), before the rebuild waves.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions