Skip to content

Commit 1fa3337

Browse files
Jammy2211claude
authored andcommitted
ci: add a PR test workflow, and the sizing skill wrapper it needs to be green
PyAutoBrain PRs carried zero check runs: docs.yml is path-filtered to docs/**, nightly-release.yml is a cron scheduler, so ~190 tests ran in no CI at all and a PR's only gate was whatever the authoring session ran locally. Add tests.yml, modelled on PyAutoHeart's heart-tests.yml (push to main + pull_request, cancel-in-progress off main only, python 3.12/3.13, pytest only — no agent runs, no network). It checks out PyAutoMind alongside PyAutoBrain because a lone-repo checkout cannot even COLLECT the suite: _sizing.py reads PyAutoMind/repos.yaml at import time and is strict, so test_policy_seams and test_sizing_paths error out first. Both repos are public, so the default GITHUB_TOKEN suffices. Ship the missing skills/sizing/ wrapper in the same PR: sizing is listed as a directly-runnable faculty in `pyauto-brain help` and has its own sizing.sh, but never got the SKILL.md its four sibling faculties carry (wired into help by #141), leaving test_skill_install red on main. Merging the workflow without it would ship a knowingly-failing gate. Verified in the two-repo layout the workflow builds: 193 passed. Closes #194 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent a1e7098 commit 1fa3337

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Brain Tests
2+
3+
# Brain's own unit suite — the reasoning layer's self-test. Until this existed,
4+
# PyAutoBrain PRs carried ZERO check runs (`docs.yml` is path-filtered to
5+
# `docs/**`, `nightly-release.yml` is a cron release scheduler), so ~190 tests
6+
# covering the conductors, faculties, worktree helpers, skill install and policy
7+
# seams ran in no CI at all and a Brain PR's only gate was whatever the
8+
# authoring session happened to run locally.
9+
#
10+
# Deliberately ONLY pytest. It must not run `pyauto-brain <agent>` against live
11+
# repos or reach the network — those need the full workspace and belong to the
12+
# scheduled health/nightly drivers, not a PR gate. The suite is stdlib + PyYAML
13+
# only, so it stays fast (~30s) and flake-free.
14+
#
15+
# TWO repos are checked out on purpose. PyAutoBrain alone cannot even COLLECT
16+
# the suite: `agents/faculties/sizing/_sizing.py` reads the body map
17+
# (`BRAIN_HOME.parent / "PyAutoMind" / "repos.yaml"`) at import time and is
18+
# deliberately strict, so `test_policy_seams.py` and `test_sizing_paths.py`
19+
# error out before a single test runs. Checking PyAutoMind out as a sibling
20+
# reproduces the workspace layout the code assumes. Both repos are public, so
21+
# the default GITHUB_TOKEN suffices — no PAT. No other sibling repo is needed
22+
# (verified by running the suite against exactly this two-repo layout).
23+
24+
# One run per commit: PR events carry the CI; pushes only build main.
25+
# Superseded runs are cancelled on PR refs only — a cancelled main run would
26+
# read as red CI (cancelled is in Heart's FAILURE_CONCLUSIONS).
27+
on:
28+
push:
29+
branches: [main]
30+
pull_request:
31+
32+
concurrency:
33+
group: brain-tests-${{ github.ref }}
34+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
35+
36+
jobs:
37+
pytest:
38+
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
python-version: ["3.12", "3.13"]
43+
steps:
44+
- name: Checkout PyAutoBrain
45+
uses: actions/checkout@v4
46+
with:
47+
path: PyAutoBrain
48+
# The body map `_sizing.py` imports. Pinned to main: this gate tests
49+
# Brain against the CURRENT organism identity, the same pairing a local
50+
# workspace has.
51+
- name: Checkout PyAutoMind (the body map — required to import)
52+
uses: actions/checkout@v4
53+
with:
54+
repository: PyAutoLabs/PyAutoMind
55+
path: PyAutoMind
56+
- name: Set up Python ${{ matrix.python-version }}
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: ${{ matrix.python-version }}
60+
- name: Install (pytest + PyYAML — the whole dependency set)
61+
run: pip install pytest PyYAML
62+
- name: Run tests
63+
working-directory: PyAutoBrain
64+
run: pytest tests/ -q

skills/sizing/SKILL.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: sizing
3+
description: Estimate how hard a PyAutoMind prompt is through the read-only PyAutoBrain Sizing Faculty — the single difficulty heuristic the intake and feature conductors both consult. Use to size or re-size a task without dispatching work.
4+
---
5+
6+
# Sizing
7+
8+
Read [`../../agents/faculties/sizing/AGENTS.md`](../../agents/faculties/sizing/AGENTS.md)
9+
completely, then run `bin/pyauto-brain sizing` in the documented mode. Return
10+
the `SizingSurface` as an estimate; deciding to phase or split a task belongs to
11+
the conductor that consulted it.

skills/sizing/agents/openai.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Sizing Faculty"
3+
short_description: "Estimate how hard a PyAutoMind task is"
4+
default_prompt: "Use $sizing to estimate the difficulty of a PyAutoMind prompt."

0 commit comments

Comments
 (0)