Skip to content

ci: add a PR test workflow (and the sizing skill wrapper that blocks it) #194

Closed

Description

@Jammy2211

Overview

PyAutoBrain has no PR test workflow. .github/workflows/ holds only
docs.yml (path-filtered to docs/** + .readthedocs.yaml, so it never fires
for agents/, bin/ or tests/) and nightly-release.yml (a cron release
scheduler). A Brain PR's head sha returns total_count: 0 check runs — #193
merged that way earlier today. So the ~193 tests in tests/ execute in no CI
anywhere
, and a Brain PR's only gate is whatever the authoring session
happens to run locally.

Turning CI on requires fixing the suite first: test_skill_install.py:: test_every_public_agent_has_a_skill_wrapper is already red on main (the
sizing faculty has no skills/sizing/SKILL.md) — which is exactly what no CI
looks like. Both parts land in one PR, because merging a workflow that is known
to fail would be shipping a red gate.

Plan

  • Add the missing sizing skill wrapper, mirroring the sibling faculty
    wrappers — sizing is listed under "Faculties (read-only … also runnable
    directly)" in pyauto-brain help and ships its own sizing.sh, so the
    wrapper is the missing piece; delisting it from help would be the wrong fix.
  • Add a tests.yml modelled on PyAutoHeart/.github/workflows/heart-tests.yml,
    which is the house pattern for an organ's own unit suite.
  • Check out PyAutoBrain and PyAutoMind side by side — measured, not assumed:
    a lone-repo checkout cannot even collect the suite.
  • Keep the workflow to pytest only (no pyauto-brain agent runs, no network),
    the same discipline heart-tests.yml states for itself.
Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary, only)

Branch Survey

Repository Current Branch Dirty?
./PyAutoBrain main clean

No worktree claim on PyAutoBrain.

Suggested branch: feature/pyautobrain-pr-test-ci
Worktree root: ~/Code/PyAutoLabs-wt/pyautobrain-pr-test-ci/

Measured findings (2026-08-04, before writing anything)

Cloned PyAutoBrain alone into a scratch dir and ran the suite with a clean
env — it does not fail, it does not even collect:

ERROR collecting tests/test_policy_seams.py
ERROR collecting tests/test_sizing_paths.py
E   FileNotFoundError: .../ci-probe/PyAutoMind/repos.yaml
agents/faculties/sizing/_sizing.py:105: LIBRARY_REPOS, WORKSPACE_REPOS, ORGANISM_REPOS = _target_sets()

_sizing.py reads the body map at import time and is deliberately strict
(BODY_MAP_PATH = BRAIN_HOME.parent / "PyAutoMind" / "repos.yaml"). Adding
PyAutoMind alongside:

192 passed, 1 failed in 29.02s
FAILED tests/test_skill_install.py::test_every_public_agent_has_a_skill_wrapper — assert ['sizing'] == []

So: two repos are required, no others; the suite needs only pytest + PyYAML;
it takes ~30s; and the single failure is the sizing wrapper. Both repos are
public, so the default GITHUB_TOKEN can check out the sibling.

Implementation Steps

  1. skills/sizing/SKILL.md — frontmatter (name, description) plus the
    3-line body the other faculty wrappers use: read
    ../../agents/faculties/sizing/AGENTS.md, then run
    bin/pyauto-brain sizing. Must stay under the 200-line primary-file budget
    (bin/check_skill_line_counts.sh) and its markdown links must resolve
    (test_local_skill_links_resolve).
  2. skills/sizing/agents/openai.yaml — the Codex descriptor every sibling
    faculty carries (display_name / short_description / default_prompt).
  3. .github/workflows/tests.yml:
    • on: push to main + pull_request; concurrency group keyed on the ref
      with cancel-in-progress only off main (a cancelled main run reads as
      red CI in Heart's FAILURE_CONCLUSIONS).
    • matrix python 3.12, 3.13 (matches heart-tests.yml).
    • actions/checkout@v4 twice, with path: PyAutoBrain and
      repository: PyAutoLabs/PyAutoMind + path: PyAutoMind, so
      BRAIN_HOME.parent/PyAutoMind resolves.
    • pip install pytest PyYAML; run pytest tests/ -q with
      working-directory: PyAutoBrain.

Verification

  • Re-run the isolated two-repo probe after the wrapper lands: expect
    193 passed, 0 failed.
  • bash bin/check_skill_line_counts.sh — the new SKILL.md within budget.
  • bash bin/install.sh into a tmp HOME still passes
    test_installer_keeps_commands_and_installs_both_skill_homes.
  • The PR itself is the real proof: it must show a non-zero, green check
    count — the first Brain PR ever to have one.

Key Files

  • PyAutoBrain/.github/workflows/tests.yml — new.
  • PyAutoBrain/skills/sizing/SKILL.md, skills/sizing/agents/openai.yaml — new.
  • PyAutoHeart/.github/workflows/heart-tests.yml — read-only, the model.
  • PyAutoBrain/tests/test_skill_install.py — the test this makes green
    (unchanged).

Sizing note

Brain scored this large (9) / split-into-phases. Not taken, same as #192: the
score is prose-driven, repos_affected is one repo, and the change is a
workflow file plus a 3-line skill wrapper.

Original Prompt

Click to expand starting prompt

Filed from the #193 ship (PyAutoMind/draft/maintenance/pyautobrain/no_pr_test_ci.md).
Follow-up items 1 and 2 surfaced there: PyAutoBrain has no PR test CI, and the
sizing SKILL.md failure blocks it from ever being green.

Activity

  1. Jammy2211 commented on Aug 4, 2026

    @Jammy2211
    ContributorAuthor

    PR created

    PR: #195 (branch feature/pyautobrain-pr-test-ci, 3 files)

    Both parts in one PR, since merging the workflow alone would ship a knowingly-red gate:

    1. .github/workflows/tests.yml — modelled on PyAutoHeart/heart-tests.yml; pytest only, python 3.12/3.13, two-repo checkout (PyAutoBrain + PyAutoMind) because a lone checkout cannot even collect the suite.
    2. skills/sizing/SKILL.md + agents/openai.yaml — the wrapper sizing never got when docs: 7th organ + slim AGENTS.md + wire sizing faculty (#84) #141 wired it into pyauto-brain help, which is what kept test_skill_install red on main.

    Verified in the exact two-repo layout the workflow builds (scratch copy of the branch, fresh PyAutoMind clone, clean env + isolated HOME): 193 passed. Same layout on main: 192 passed / 1 failed — so the wrapper is what closes it. check_skill_line_counts.sh → all 45 skills within budget.

    The PR itself is the acceptance test: it should be the first PyAutoBrain PR with a non-zero, green check count. If no checks appear, the workflow is wrong and it must not merge.

  2. Jammy2211 commented on Aug 4, 2026

    @Jammy2211
    ContributorAuthor

    Follow-up shipped in #196 (a2264fe): the nightly's exit-code/conclusion contract and the stop-summary None/count bug — both surfaced by the triage in PyAutoMind/draft/triage/nightly_release_blocked_eight_nights.md.

    0/2/3 now leave the nightly run green (a blocked night is the gate working — with a named Blocked at a gate step, a ::warning:: and a job summary), and only a driver error turns it red. overnight_status.sh reads that step so a blocked night shows as ⏸, not a plain green — otherwise the fix would have swapped a false alarm for a silent one.

    The page detail now reads 1 failed: autolens database/start_here.py; verify_install FAILED instead of …, None verify_install, verified against the real stage_report.json from the 2026-08-04 failure.

    #196 was also the first PR gated by the CI this issue added — both matrix legs green.

    Still open: the releases themselves are blocked (Class A rotating script failures, Class B gate-vs-release disagreement). Items 1-2 made the signal legible; they unblocked nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions