Skip to content

feat(smoke_timings): ingest per-script smoke timings onto the ⏱ board - #203

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 #202. Phase 1 of the ci-timing-fast-tests epic (PyAutoMind draft/feature/pyautoheart/ci_timing_fast_tests_epic.md); Plane B of docs/pyautoheart/test_performance_board_assessment.md.

Summary

Every smoke-gate run across the workspace / _test / HowTo repos has uploaded a smoke-timings-<py> artifact (smoke_timings/1: one row per executed script with the runner's own measured seconds, the cap in force and the exit code) since PyAutoHands#265 / PyAutoHeart#167 — and nothing read it. This adds the ingester as a fifth cloud-safe check in the daily heart-health.yml run, in the ci_timing shape (shell leg → per-repo sidecar → aggregate rollup → board section + board.json block):

  • heart/checks/smoke_timings.{sh,py} — per smoke-gated repo (groups workspaces, workspaces_test, howto), list artifacts via the Actions API, select the newest non-expired smoke-timings-<py> per python leg, download + unzip, parse the dataset. Rows keep provenance (run id / URL / branch / leg). TIMEOUT rows are hard events with a /bug kill timer … prompt; a script that slowed against the previous observation is an advisory warn row with a /bug slow script … prompt. null seconds (skipped / never ran) are never counted as a 0 s run. A failed listing or download is recorded as an honest error per repo/leg — never a quiet-looking empty result.
  • Previous observation is self-carried, exactly like ci_timing's history: the aggregate step re-reads the published board.json's new performance.scripts.rows and compares each (repo, python, entry) against its last row only when the run id differs — a re-render of the same day never compares a run against itself. Durable committed history is phase 2 of the epic and is deliberately out of scope here.
  • Declared thresholds (config/repos.yaml thresholds.smoke_timings): warn iff ≥ 2.0× the previous observation AND ≥ 5 s slower. Own numbers because ci_timing's 1.5×/120 s is sized for multi-minute gates; 2.0× is the profiling conductor's ratio and 5 s sits above the ~5–7 s import-floor jitter. Advisory — the readiness verdict and badge.json are untouched.
  • Board: a "Smoke scripts" section after CI wall-clock (FAIL on timeouts, WARN on slowdowns/errors; summary + per-repo top-N slowest with coverage counts beside every total), and an additive performance.scripts block emitted only when the slice was observed, so older snapshots render a byte-identical block. The Brain board ignores the new key; a headline row for it is a follow-up.
  • Workflow: actions: read permission (artifact endpoints need it even for own artifacts) and GH_TOKEN: ${{ secrets.HEART_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}.

Known risk — needs a human eye after the first scheduled run

The artifact /zip endpoint may refuse the repo-scoped GITHUB_TOKEN for other repos' artifacts (actions/download-artifact documents cross-repo downloads as needing actions: read on that repo). If the 05:00 UTC run shows the ten workspace repos as N unavailable on the Smoke scripts row, the remedy is a fine-grained PAT (Actions: read on the PyAutoLabs workspace repos) stored as the HEART_TIMINGS_TOKEN secret — no code change. Heart's own artifacts ingest either way.

API Changes

No public API change. New check module heart.checks.smoke_timings; new snapshot key smoke_timings in heart.state.aggregate(); new optional performance.scripts key in board.json (schema v2 stays v2, purely additive).

Test Plan

  • python3 -m pytest -q -n auto — 684 → 735 passed (34 new in tests/test_smoke_timings.py, 13 in tests/test_dashboard.py, 4 in tests/test_heart_health_wiring.py, 2 shell tests in tests/test_smoke_timings_script.py driving ingest_one_repo with stub gh/unzip: one leg 403s, the sibling leg survives)
  • bash -n heart/checks/smoke_timings.sh; yaml.safe_load on heart-health.yml and repos.yaml
  • Tenant firewall: no real repo/workflow names in new files (RepoA, OwnerX, ci.invalid); repos_sync.py --check tenant gate OK
  • First scheduled heart-health.yml run: the Smoke scripts row appears on https://pyautolabs.github.io/PyAutoHeart/ and board.json carries performance.scripts; check the unavailable count for the cross-repo 403 above

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba


Generated by Claude Code

…#202)

The daily heart-health run now fetches each smoke-gate repo's newest
smoke-timings-<py> artifact via the Actions API, parses the smoke_timings/1
dataset, and renders per-script rows next to the workflow-level gates:
slowest scripts per repo, TIMEOUT rows as hard events with a /bug prompt,
run-to-run slowdowns as advisory warn rows (2.0x AND >=5s, declared in
config/repos.yaml). The previous observation is self-carried through the
published board.json's performance.scripts block, keyed by run id so a
re-render never compares a run against itself; durable history is phase 2
of the ci-timing-fast-tests epic. Readiness verdict and badge untouched.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
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: smoke-timings ingester — per-script CI timing rows on the ⏱ board

2 participants