Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
<!-- repos_sync:filing:end -->

<!-- repos_sync:standards:begin -->
## 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.
<!-- repos_sync:standards:end -->
12 changes: 11 additions & 1 deletion scripts/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"}]
Expand Down Expand Up @@ -722,7 +732,7 @@ def _render_html(snap: dict) -> str:
</head>
<body>
{t_.hero(BOARD_KEY, "Dashboard", _LEDE, navigation=navigation)}
{t_.prompt_heading("gut")}
{panel}
<p class="verdict {tone}"><b class="{tone}">{st.upper()}</b>
<span class="muted">{_esc(_summary(snap))}</span></p>
<p class="muted">{snap.get('ref_count', 0)} refs on the remote ·
Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/brain/board/_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ def boards_footer(links, current):

def prompt_heading(key):
return '<h2 class="prompt-heading">Clear out your <strong>Gut</strong></h2>'


def orchestration_panel(key, title, description, prompt, **kwargs):
import html
return '<section data-orchestration-panel>' + html.escape(prompt) + '</section>'
18 changes: 18 additions & 0 deletions tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<section data-orchestration-panel></section>"
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("&amp;", "&")
Loading