diff --git a/health_agent/capabilities.md b/health_agent/capabilities.md index ad8cb34c..89fbe228 100644 --- a/health_agent/capabilities.md +++ b/health_agent/capabilities.md @@ -37,7 +37,7 @@ Audited at commit `a2543d0` (Rename PyAutoPulse to PyAutoHeart). - **script_timing** (`checks/script_timing.py`) — per-script duration vs rolling baseline (`>1.5x` slow, `>3x` regression). YELLOW. - **test_run** (`checks/test_run.py`) — reads PyAutoHands's - `test_results/latest/report.json` (the workspace-validation verdict). YELLOW + `run_logs/latest/report.json` (the workspace-validation verdict). YELLOW when not passing / stale / unknown (workspace debt is advisory, never a hard block). - **version_skew** (`checks/version_skew.py`) — each workspace's pinned version diff --git a/health_agent/capabilities.yaml b/health_agent/capabilities.yaml index ea4a1701..b54bca7a 100644 --- a/health_agent/capabilities.yaml +++ b/health_agent/capabilities.yaml @@ -71,7 +71,7 @@ continuous_checks: - id: test_run impl: heart/checks/test_run.py measures: "latest PyAutoHands report.json verdict (ready / counts / stale parked)" - consumes: "PyAutoHands test_results/latest/report.json (Build executor primitive)" + consumes: "PyAutoHands run_logs/latest/report.json (Build executor primitive)" gate_role: "YELLOW if workspace validation not passing / stale / unknown (standing debt, advisory)" - id: version_skew impl: heart/checks/version_skew.py diff --git a/heart/checks/script_timing.py b/heart/checks/script_timing.py index 7fa07aa1..cc35682f 100644 --- a/heart/checks/script_timing.py +++ b/heart/checks/script_timing.py @@ -2,7 +2,7 @@ rolling per-script duration baselines, classify regressions. Inputs: -- PyAutoHands/test_results/latest/ (symlink to most recent run dir) +- PyAutoHands/run_logs/latest/ (symlink to most recent run dir) - Per-script JSON: ____script.json containing `results` list with `file`, `duration_seconds`, `status`. @@ -40,7 +40,7 @@ HEART_HOME = Path(__file__).resolve().parents[2] CONFIG_PATH = HEART_HOME / "config" / "repos.yaml" PYAUTO_ROOT = Path(__file__).resolve().parents[3] if Path(__file__).resolve().parents[3].name == "PyAutoLabs" else Path.home() / "Code" / "PyAutoLabs" -TEST_RESULTS_LATEST = PYAUTO_ROOT / "PyAutoHands" / "test_results" / "latest" +TEST_RESULTS_LATEST = PYAUTO_ROOT / "PyAutoHands" / "run_logs" / "latest" def load_thresholds() -> tuple[float, float, int]: diff --git a/heart/checks/test_run.py b/heart/checks/test_run.py index 64c02869..086d749b 100644 --- a/heart/checks/test_run.py +++ b/heart/checks/test_run.py @@ -1,7 +1,7 @@ """heart/checks/test_run.py — surface the latest PyAutoHands test-run verdict. PyAutoHands's release pipeline writes an aggregated ``report.json`` into each -run directory (reachable via the ``test_results/latest`` symlink). It carries +run directory (reachable via the ``run_logs/latest`` symlink). It carries the single most important release signal — a top-level ``ready`` boolean — plus per-status counts, per-project breakdown, and the ``slow_skips`` / ``needs_fix_skips`` lists (each entry already carrying an ``is_stale`` flag @@ -32,7 +32,7 @@ HEART_HOME = Path(__file__).resolve().parents[2] _p3 = Path(__file__).resolve().parents[3] PYAUTO_ROOT = _p3 if _p3.name == "PyAutoLabs" else Path.home() / "Code" / "PyAutoLabs" -TEST_RESULTS_LATEST = PYAUTO_ROOT / "PyAutoHands" / "test_results" / "latest" +TEST_RESULTS_LATEST = PYAUTO_ROOT / "PyAutoHands" / "run_logs" / "latest" HEART_STATE_DIR = Path( os.environ.get("HEART_STATE_DIR") or Path.home() / ".pyauto-heart" @@ -266,7 +266,7 @@ def main(argv: list[str]) -> int: from heart.heart_color import c_ok, c_warn, c_fail, c_info, c_meta, glyph_ok, glyph_warn, glyph_fail if not summary: - print(f"{c_meta('·')} {c_info('test_run')} {c_meta('(no test_results yet)')}") + print(f"{c_meta('·')} {c_info('test_run')} {c_meta('(no run_logs yet)')}") return 0 ready = summary.get("ready") diff --git a/heart/tick.sh b/heart/tick.sh index 972b2273..d995e2d7 100755 --- a/heart/tick.sh +++ b/heart/tick.sh @@ -20,11 +20,11 @@ bash "$HEART_HOME/heart/checks/ci_status.sh" || heart_log WARN "$(c_warn ' bash "$HEART_HOME/heart/checks/open_prs.sh" || heart_log WARN "$(c_warn 'open_prs failed')" bash "$HEART_HOME/heart/checks/worktree_drift.sh" || heart_log WARN "$(c_warn 'worktree_drift failed')" -# Python: script timing regressions. Needs a local PyAutoHands test_results/latest. -if [[ -d "$PYAUTO_ROOT/PyAutoHands/test_results/latest" ]]; then +# Python: script timing regressions. Needs a local PyAutoHands run_logs/latest. +if [[ -d "$PYAUTO_ROOT/PyAutoHands/run_logs/latest" ]]; then PYTHONPATH="$HEART_HOME" python3 -m heart.checks.script_timing || heart_log WARN "$(c_warn 'script_timing failed')" else - heart_log INFO "$(c_meta 'script_timing: skipped (no PyAutoHands/test_results/latest)')" + heart_log INFO "$(c_meta 'script_timing: skipped (no PyAutoHands/run_logs/latest)')" fi # Python: profiling pinned-value drift. Reads autolens_profiling result JSONs. diff --git a/scripts/health_release.sh b/scripts/health_release.sh index bc743056..76a8bca1 100755 --- a/scripts/health_release.sh +++ b/scripts/health_release.sh @@ -3,7 +3,7 @@ # # Defines `_health_release` (run via `health release`) that reads the latest # PyAutoHands full release-prep run (the one symlinked from -# PyAutoHands/test_results/latest/) and prints a dashboard: +# PyAutoHands/run_logs/latest/) and prints a dashboard: # # - Run timestamp + path + ready/not-ready verdict + total duration # - Per-workspace pass / fail / skipped / timeout / duration table @@ -19,7 +19,7 @@ # # Override the run path (e.g. to inspect a specific historical run) by passing # it as the first argument: -# health release ~/Code/PyAutoLabs/PyAutoHands/test_results/runs/2026-04-29T14-48-47Z +# health release ~/Code/PyAutoLabs/PyAutoHands/run_logs/runs/smoke/2026/04/2026-04-29T14-48-47Z # # Sibling helpers: health-report / health-json / health-triage open the last # run's report.md / report.json / triage.md. @@ -28,7 +28,7 @@ # layer over the same run artefacts). This function prints straight to stdout, # no Claude needed. -PYAUTO_STATUS_FULL_DEFAULT="${PYAUTO_STATUS_FULL_DEFAULT:-$HOME/Code/PyAutoLabs/PyAutoHands/test_results/latest}" +PYAUTO_STATUS_FULL_DEFAULT="${PYAUTO_STATUS_FULL_DEFAULT:-$HOME/Code/PyAutoLabs/PyAutoHands/run_logs/latest}" _health_release() { local run_dir="${1:-$PYAUTO_STATUS_FULL_DEFAULT}" diff --git a/scripts/health_sync.sh b/scripts/health_sync.sh index 0c74c31c..dba284be 100644 --- a/scripts/health_sync.sh +++ b/scripts/health_sync.sh @@ -40,10 +40,10 @@ # ~/.cache/pyauto/smoke/*.json (written by the # /smoke-test skill). Green when failed=0, red # otherwise. Suppressed when no JSONs exist. -# - "Last autohands run:" — aggregate from -# ~/Code/PyAutoLabs/PyAutoHands/test_results/*.json -# (committed by the autohands release pipeline). -# Suppressed when no JSONs exist. +# - "Last autohands run:" — the aggregated verdict from +# ~/Code/PyAutoLabs/PyAutoHands/run_logs/latest/report.json +# (written by the autohands mega-run). +# Suppressed when the run log is absent. # - "Hygiene:" — nudge when the last /repo_cleanup audit stamp # (~/.cache/pyauto/repo_cleanup_last_audit.json) # is missing or older than PYAUTO_CLEANUP_NUDGE_DAYS @@ -365,32 +365,28 @@ for f in sorted(glob.glob(os.path.expanduser("~/.cache/pyauto/smoke/*.json"))): ' 2>/dev/null) fi - # Last autohands run. Reads aggregate from PyAutoHands/test_results/*.json - # (committed by the autohands release pipeline). Counts only — failure - # detail lives in the per-job JSON / the GitHub Actions run. - local pab_dir="$HOME/Code/PyAutoLabs/PyAutoHands/test_results" - if [[ -d "$pab_dir" ]] && compgen -G "$pab_dir/*.json" > /dev/null; then + # Last autohands run. Reads the aggregated report.json from the newest run, + # reachable via PyAutoHands/run_logs/latest (written by the autohands + # mega-run). Counts only — failure detail lives in the per-shard JSON / the + # GitHub Actions run. + local pab_report="$HOME/Code/PyAutoLabs/PyAutoHands/run_logs/latest/report.json" + if [[ -f "$pab_report" ]]; then local pab_summary pab_summary=$(python3 -c ' -import json, os, glob -total_p = total_f = total_s = num = 0 -projects = set() -latest = "" -for f in sorted(glob.glob(os.path.expanduser("~/Code/PyAutoLabs/PyAutoHands/test_results/*.json"))): - try: - d = json.load(open(f)) - s = d.get("summary", {}) - total_p += s.get("passed", 0) - total_f += s.get("failed", 0) - total_s += s.get("skipped", 0) - num += 1 - projects.add(d.get("project", "?")) - ct = d.get("completed_at", "") - if ct > latest: - latest = ct - except Exception: - pass -print(f"{latest[:10]}|{num}|{len(projects)}|{total_p}|{total_f}|{total_s}") +import json, os +p = os.path.expanduser("~/Code/PyAutoLabs/PyAutoHands/run_logs/latest/report.json") +try: + d = json.load(open(p)) + s = d.get("summary", {}) or {} + n_proj = len(d.get("per_project", {}) or {}) + njobs = len(d.get("runs", []) or []) + label = str(d.get("run_label", ""))[:10] + passed = s.get("passed", 0) + failed = s.get("failed", 0) + skipped = s.get("skipped", 0) + print("|".join(str(x) for x in [label, njobs, n_proj, passed, failed, skipped])) +except Exception: + pass ' 2>/dev/null) if [[ -n "$pab_summary" ]]; then local pab_date njobs nproj pab_p pab_f pab_s sha diff --git a/skills/pyauto-status-full/reference.md b/skills/pyauto-status-full/reference.md index 3f762a3e..83302f99 100644 --- a/skills/pyauto-status-full/reference.md +++ b/skills/pyauto-status-full/reference.md @@ -26,10 +26,10 @@ This is the deeper sibling of `$health status` (the active-work dashboard): ### 1. Locate the latest run -PyAutoHands stores every full run under `~/Code/PyAutoLabs/PyAutoHands/test_results/runs//` and updates a `latest` symlink on success. +PyAutoHands stores every full run under `~/Code/PyAutoLabs/PyAutoHands/run_logs/runs/////` and updates a `latest` symlink on success. ```bash -LATEST=~/Code/PyAutoLabs/PyAutoHands/test_results/latest +LATEST=~/Code/PyAutoLabs/PyAutoHands/run_logs/latest ``` If the symlink does not exist, no full run has completed yet. Print: @@ -119,6 +119,6 @@ This skill renders **local artefacts** produced by an autohands full run. It is therefore meaningful only in a `local-dev` environment where those artefacts exist (see PyAutoBrain `skills/WORKFLOW.md` for the environment model). In a `web-github` / `analysis-only` / `ci-only` session there is no local run to -render — if `~/Code/PyAutoLabs/PyAutoHands/test_results/latest` does not exist, +render — if `~/Code/PyAutoLabs/PyAutoHands/run_logs/latest` does not exist, print the "no run on disk" message from step 1 and exit. (For the live release-readiness verdict from anywhere, use `pyauto-heart readiness` instead.)