Skip to content

Commit cb2938d

Browse files
committed
ci: add Heart's own pytest workflow; reframe the test-footprint rule
Heart had no PR-triggered CI: lib-tests.yml is reusable and tests the five libraries, not Heart itself, so a logic bug in the release gate (readiness.compute, ci_status.rollup, …) could land unnoticed. Add a minimal `Heart Tests` workflow that runs ONLY `pytest tests/` on push/PR (3.12 + 3.13) — the gate's self-test. It deliberately does not run any health check; those need live checkouts/network and remain the scheduled health agent's job. Also reframe hard-rule #4: the real invariant is a lightweight test footprint (stdlib + PyYAML, no scientific/ML stack), a property of Heart's own suite — not a "No JAX" claim, which wrongly implied something about the projects Heart watches. Heart may monitor JAX or non-JAX repos; that's their concern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVXPU6hFTr6Ww6xhLyXcUY
1 parent 56d1410 commit cb2938d

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

.github/workflows/heart-tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Heart Tests
2+
3+
# Heart's own unit suite — the gate's self-test. This answers "is Heart's
4+
# measuring logic (readiness.compute, ci_status.rollup, the classifiers …)
5+
# correct?", which nothing else runs automatically: the health agent runs
6+
# Heart's checks *against other repos*, never Heart's own tests.
7+
#
8+
# Deliberately ONLY pytest. It must not run `pyauto-heart tick`/`readiness` or
9+
# any health check — those need live repo checkouts + network and are the
10+
# scheduled health agent's job, not a PR gate. The suite is stdlib + PyYAML
11+
# only, so it stays fast and flake-free.
12+
13+
on: [push, pull_request]
14+
15+
jobs:
16+
pytest:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.12", "3.13"]
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
cache: pip
29+
- name: Install (PyYAML core + pytest dev extra)
30+
run: pip install -e ".[dev]"
31+
- name: Run tests
32+
run: pytest tests/ -q

CLAUDE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ the `Brain → Heart → Hands` call chain, and `README.md` for user-facing docs
3434
3. **Polling must be cheap**. A full `tick` should complete in <30s
3535
total. If a check would take longer, run it less often (move to a
3636
v2 daily cron, not the watch loop).
37-
4. **No JAX in tests** — library convention. Heart tests run with
38-
stdlib + PyYAML only.
37+
4. **Lightweight test footprint**. Heart's own test suite runs on the
38+
standard library plus PyYAML only — no scientific/ML stack (numba,
39+
matplotlib, JAX, the PyAuto libraries). This keeps the suite fast and
40+
flake-free so it runs anywhere (CI, mobile, sandbox). It is a property of
41+
*Heart's* tests, not a claim about the projects Heart watches — Heart may
42+
perfectly well monitor non-JAX (or JAX-heavy) repos; that's their concern,
43+
not the suite's.
3944
5. **State writes are atomic**. Use `heart.state.atomic_write_json` or
4045
the bash equivalent (`heart_write_json` in `_common.sh`). Concurrent
4146
ticks must not corrupt `state.json`.

0 commit comments

Comments
 (0)