Repository navigation
Description
Overview
Follow-ups from the independent review of PyAutoHeart#339 (unit-test trend charts). Sub-second series are drawn flat at the bottom of the chart, the epoch filter and the plotted day read different fields, a chart label's date range counts days the axis does not, and the per-day point picks the last of several noisy runs. This fixes those and pins the gate charts with a golden-HTML test so the unit-trend fixes cannot move them.
Plan
- Make unit-trend charts fill their height for sub-second series (PyAutoNerves import charts), leaving gate charts unchanged.
- Apply the epoch boundary to the same day the point is plotted on (
at, falling back todate). - Make the unit-trend label's date range match the plotted axis (measured points only).
- Replace "last main run of the day wins" with the median of the day's main runs for wall-clock and import seconds, preferring cache-
hitruns when a day mixes cache states; the test count stays the day's last run. - Add a golden-HTML test that pins a gate chart byte-for-byte, plus tests for each fix.
- Item 6 (confirm the charts on the live board after the next daily heart-health run) is post-merge and stays with the human / close-out.
Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary
Detailed implementation plan
Work Classification: Library (PyAutoHeart only)
Worktree root: ~/Code/PyAutoLabs-wt/unit-trend-followups/
Affected Repositories
- PyAutoHeart (primary)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./organs/PyAutoHeart | main | clean |
Suggested branch: feature/unit-trend-followups
Implementation Steps
heart/timing_display.py::plot— add a keywordmin_span=1(today'smax(high-low, 1)floor).unit_trendpassesmin_span=0, so the y-scale ishigh-low(a flat series still has a span floor so nothing divides by zero).chart(gates) keeps the default, so gate charts are byte-identical.heart/timings.py::unit_history— compute the run day first (at[:10], fallbackdate) and apply the epoch asday >= since, instead of_within_epoch(record)readingdate.heart/timing_display.py::unit_trend— label's range from the first/last measured point (the axis withgaps=False).heart/timings.py::unit_history— collect every main run per (python, day);wall_sandimport_sare the median over the day's runs whoseunit_cache_stateishitwhen any is, else over all runs;testsis the last run's count. Docstring updated.- Tests in
tests/test_unit_trends.py: golden HTML of a gate chart (chart) pinned to today's output; a sub-second import series spans the full 15–75 y range; a record whoseatanddatestraddle the epoch boundary is kept/dropped byat; a label with leading None days names the first measured day; the per-day median and the hit preference. Rename the "last run of each day" test.
Key Files
heart/timing_display.py—plot,unit_trendheart/timings.py—unit_historytests/test_unit_trends.py
Original Prompt
Click to expand starting prompt
Heart unit-test trends: follow-ups from PyAutoHeart#338
Type: feature
Target: PyAutoHeart
Repos:
- PyAutoHeart
Difficulty: small
Autonomy: supervised
Priority: low
Status: draft
Filed: 2026-11-12
Epic: autonomous-orchestrators
Consequence: glance
Witness: a golden-HTML test pins the gate chart; a sub-second import series fills the chart height; the epoch filter and the plotted x agree
Review-minutes: 5
Unattended: ready
Lane: any
Source: independent review of PyAutoHeart#339 (2026-11-12).
heart/timing_display.py:162:max(high-low, 1)flattens sub-second series (PyAutoNerves import charts use 10–14% of the height).heart/timings.py:931vs:934: the epoch filter readsdatebut the point is plotted onat.timing_display.py:224: the label's date range counts None points, the axis does not.- "Last run of the day wins" picks between noisy runs (PyAutoArray 10-26: 100 s and 296 s); consider a median and a cache-state filter.
- Pin "gate charts unchanged" with a golden-HTML test.
- After the next daily heart-health run, confirm the charts on the live board.
Activity
Jammy2211 commentedon Nov 14, 2026
Library PR created: #347 (glance; shift 2026-11-14-pm).
Gate: tests 1459 passed · smoke n/a (Heart organ, no downstream script surface) · independent Opus review CLEAN · independent Sonnet adversary CLEAN (Witness holds) · Heart dev-ship GREEN.
Workspace impact: (iii) none. Heart organ only, no public API. The session ended at PR-open; the watcher's close-out runs the witness and merges, or refuses.
Remaining after merge: item 6, which is to look at the unit-trend charts on the live board after the next daily heart-health run.