Skip to content

feat(timings): permanent CI timing record committed daily - #205

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/ci-test-timing-epic-ke2lul
Sep 5, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
claude/ci-test-timing-epic-ke2lul

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #204. Phase 2 of the ci-timing-fast-tests epic (PyAutoMind draft/feature/pyautoheart/ci_timing_fast_tests_epic.md); Plane C ("durable baselines") of docs/pyautoheart/test_performance_board_assessment.md.

Summary

Until now the ⏱ surface's only history was the self-carried window: both timing checks re-read the previously published Pages board.json, capped at 30 gate entries and one previous per-script observation, and nothing was ever committed. A publish gap lost it. This adds the permanent record under timings/ and makes it the first source of truth:

  • timings/gates.jsonl — one line per UTC date with every tracked gate's p50_s / pr_median_s / max_s / queue_median_s / runs (the figures ci_timing already measures). Keyed by date: a re-run of the daily job appends nothing.
  • timings/scripts/<repo>.jsonl — one line per (python leg, run id) with provenance (run_url, head_branch, head_sha, env_profile) and entries: {path: [seconds, status, cap_s]} for every timed script. Keyed by (python, run_id): a quiet week whose newest artifact is the same run appends nothing — the script_timing "one value repeated seven times" defect (phase 0 of the board arc) cannot recur here. This is why phase 1 stamped run_id on every row.
  • heart/timings.py — the append-only writer (never truncates; compact sorted-key single lines, so a daily diff is the added lines only), the readers that feed the checks (gates_history in the exact shape history_baseline / _gate_spark consume; previous_script_rows in the shape classify_drift expects), a census, and a CLI (append, show).
  • Checks read the record first. ci_timing.aggregate(record_history=…) and smoke_timings.aggregate(record_prev_rows=…) prefer the committed record; the previously published board is the fallback (first run, fresh clone). board.json's performance shape is unchanged, so the Brain board and the next render's fallback read exactly what they always read.
  • Workflow — a new step after the checks appends today's observations (safe before the render: ci_timing excludes today's date from its baseline, smoke_timings compares by run id), and the README-commit step now commits timings/ beside the README block: one [skip ci] commit a day, git status --porcelain so a repo's first (untracked) line is seen. This job is the record's single writer; a dev-box tick never appends.
  • Board — one record: … detail line under each timing row from the census (state.aggregate() gains timings_record); absent census → byte-identical render.
  • timings/README.md — schema, the two dedupe keys and why, the append-only rule, growth shape (gates ~1 line/day; scripts ≤ 2 lines/day/repo), and the reservation of timings/epochs.jsonl for phase 4's labeled LEGACY epoch boundary (not created here).

gates.jsonl and scripts/ are deliberately not committed empty; the first scheduled run creates them.

API Changes

No public API change. New module heart.timings; ci_timing.aggregate and smoke_timings.aggregate gain an optional keyword argument each; both --aggregate CLIs gain --record-dir; smoke_timings.json's repos[] items gain head_sha / env_profile (additive); new snapshot key timings_record.

Test Plan

  • python3 -m pytest -q -n auto — 735 → 767 passed (new tests/test_timings.py; appended cases in test_ci_timing.py, test_smoke_timings.py, test_dashboard.py, test_heart_health_wiring.py); existing tests unmodified
  • Append-only pinned: existing bytes are a prefix of the file after every append; a second append over identical rollups appends nothing (2 skipped (already recorded))
  • bash -n both shell legs; yaml.safe_load on the workflow; tenant firewall check OK (fake names only in new files)
  • First scheduled heart-health.yml run on main: the daily commit carries timings/gates.jsonl and timings/scripts/<repo>.jsonl beside the README block, and the two record: lines appear on the board

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba


Generated by Claude Code

heart-health.yml now appends the day's observations to an append-only
record in the repo — timings/gates.jsonl (one line per date, the per-gate
medians ci_timing measured) and timings/scripts/<repo>.jsonl (one line per
python leg x run id, the per-script seconds smoke_timings ingested) — and
commits it beside the README block, one commit a day. Both checks read
their baselines from the record first and from the previously published
board.json only as a fallback, so a Pages publish gap no longer loses
history. Dedupe is on identity (date; python leg + run id), never on the
day, so a quiet week cannot write seven copies of one run. Readiness
verdict, badge and the board.json performance shape are untouched.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
@Jammy2211
Jammy2211 merged commit 7b4e109 into main Sep 5, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the claude/ci-test-timing-epic-ke2lul branch September 5, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: permanent CI timing history committed to PyAutoHeart (timings/ record)

2 participants