diff --git a/AGENTS.md b/AGENTS.md index ab7216ab31..387da285e8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -168,3 +168,16 @@ body and hands them to the human (sessions cannot create Discussions). Only the development flow — Mind prompt → `/start_dev` → `/create_issue` → one issue per task → PR — opens issues here. Why: `PyAutoMind/policy/community_surface.md`. + + +## Shared standards + +Before changing a shared interface, consult the applicable +[organism standard](https://github.com/PyAutoLabs/PyAutoBrain/blob/main/docs/standards.md) +on demand, identify affected consumers, and validate their adoption. Change +generated guidance at its canonical source and regenerate. + +For board changes, follow the applicable sizing, navigation and orchestration +standards and reuse Brain’s shared components. Keep domain data, prompt meaning +and approval boundaries with the board’s owner. + diff --git a/scripts/board.py b/scripts/board.py index 89dd94811e..38f4c0e557 100644 --- a/scripts/board.py +++ b/scripts/board.py @@ -69,6 +69,8 @@ from urllib.parse import quote_plus GUT_HOME = Path(__file__).resolve().parents[1] +CHECKIN_PROMPT = 'Review the Gut retention and recovery board in this chat. Read PyAutoGut/AGENTS.md and reconcile archive refs with PyAutoMind/condemned.md, held entries, sweep-after dates and recovery evidence. Summarize drift, items needing a decision and the next bounded step, keeping unknowns explicit. Apply my direction while retaining the whole queue. Preserve recoverability and ask for explicit human authorization before any permanent void, ref deletion or destructive cleanup; copying this prompt grants none. Route implementation changes through the existing workflow.' + BOARD_KEY = "gut" # this board's entry in the Brain's palette table NS = "refs/heads/archive/condemned/" SCHEMA_VERSION = 1 @@ -681,6 +683,14 @@ def _boards_nav(snap: dict) -> str: def _render_html(snap: dict) -> str: t_ = theme() + work_links = [] + if repo_url(snap): + work_links.append({"label": "Gut repository", "href": repo_url(snap)}) + # The board's publishing workflow checks out this owner's Mind ledger. + work_links.append({"label": "Mind retention ledger", + "href": f"https://github.com/{snap['owner']}/PyAutoMind/blob/main/condemned.md"}) + panel = t_.orchestration_panel("gut", "", "", CHECKIN_PROMPT, + organ="gut", work_links=work_links) st = status(snap) tone = {"green": "ok", "yellow": "warn", "grey": "muted"}[st] navigation = [{"href": "#inventory", "label": "Inventory"}] @@ -722,7 +732,7 @@ def _render_html(snap: dict) -> str: {t_.hero(BOARD_KEY, "Dashboard", _LEDE, navigation=navigation)} -{t_.prompt_heading("gut")} +{panel}

{st.upper()} {_esc(_summary(snap))}

{snap.get('ref_count', 0)} refs on the remote · diff --git a/tests/fixtures/brain/board/_theme.py b/tests/fixtures/brain/board/_theme.py index cb85dd93b6..fa09572e47 100644 --- a/tests/fixtures/brain/board/_theme.py +++ b/tests/fixtures/brain/board/_theme.py @@ -27,3 +27,8 @@ def boards_footer(links, current): def prompt_heading(key): return '

Clear out your Gut

' + + +def orchestration_panel(key, title, description, prompt, **kwargs): + import html + return '
' + html.escape(prompt) + '
' diff --git a/tests/test_board.py b/tests/test_board.py index c758a6d25d..db40f354a0 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -343,3 +343,21 @@ def test_collect_reads_a_fixture_ledger_and_a_local_remote(tmp_path): # owner cannot be derived from a local path: said, not guessed assert any("owner" in e for e in snap["errors"]) assert board.to_state(snap)["pages_url"] == "./" + + +def test_general_checkin_preserves_destructive_approval(parser, monkeypatch): + captured = {} + def panel(key, title, description, prompt, **kwargs): + captured.update(kwargs, prompt=prompt) + return "
" + board._THEME_BRAIN[0] = FIXTURE_BRAIN + monkeypatch.setattr(board.theme(), "orchestration_panel", panel) + snap = _snap(parser) + rendered = board.render(snap, "html") + assert rendered.index("data-orchestration-panel") < rendered.index('id="inventory"') + assert "explicit human authorization" in captured["prompt"] + assert "copying this prompt grants none" in captured["prompt"] + assert {link["href"] for link in captured["work_links"]} == { + "https://github.com/SomeOrg/SomeGut", + "https://github.com/SomeOrg/PyAutoMind/blob/main/condemned.md"} + assert snap["void_all_due_url"] in rendered.replace("&", "&")