From ad7ead12c339a6fe91a085e93278642ae8f8faaf Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 30 Sep 2026 10:10:55 +0100 Subject: [PATCH] test: derive the board footer family from the Brain, not a literal The footer-family test pinned the six-board family and went red once PyAutoBrain added the Eyes, Nerves and Gut boards (config/policy.yaml board: boards:). Derive the expectation from _theme.board_links, the same read the renderer makes, so the next organ birth cannot re-break it. Mirrors PyAutoHeart e365e47 and PyAutoHands 3a7a715. Refs PyAutoLabs/PyAutoMind#450 Co-Authored-By: Claude Opus 5.5 --- tests/test_board.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_board.py b/tests/test_board.py index 64ab5c1..b0997d0 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -278,9 +278,16 @@ def test_live_repo_statuses_are_schema_valid(): assert seen <= {"stub", "drafted", "reviewed"}, f"schema-invalid statuses: {seen}" -# The canonical board family, in the order `PyAutoBrain/config/policy.yaml` -# declares it. This board is `memory`, so its own chip never appears. -FAMILY_WITHOUT_MEMORY = ["brain", "mind", "cortex", "heart", "hands", "organism"] +def _family_without_memory() -> list[str]: + """The canonical board family, in the order `PyAutoBrain/config/policy.yaml` + `board: boards:` declares it, minus this board (`memory`). + + Derived from the Brain — the same `_theme.board_links` read the renderer + makes — never written out here. A literal in this file pinned the + six-board family and went red once the Eyes, the Nerves and the Gut got + boards (PyAutoMind#450); the next organ birth must not re-break it. + """ + return list(board.theme().board_links("", board.BOARD_KEY)) def _footer(tmp_path) -> str: @@ -302,7 +309,9 @@ def test_the_family_footer_carries_the_cortex_in_the_canonical_order(tmp_path): `config/policy.yaml` lights it in every footer at once. """ footer = _footer(tmp_path) - assert re.findall(r'data-organ="(\w+)"', footer) == FAMILY_WITHOUT_MEMORY + family = _family_without_memory() + assert "cortex" in family and board.BOARD_KEY not in family + assert re.findall(r'data-organ="(\w+)"', footer) == family assert "https://someorg.github.io/PyAutoCortex/" in footer