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 @@ -184,3 +184,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 -->
14 changes: 13 additions & 1 deletion scripts/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
import yaml

NERVES_HOME = Path(__file__).resolve().parents[1]
CHECKIN_PROMPT = 'Review configuration work across the Nerves board in this chat. Read PyAutoNerves/AGENTS.md and inspect the relevant source repositories, YAML parse errors, option documentation, override relationships and scan coverage. Give a concise priority order and propose one bounded next step. Apply my direction while preserving the overall review. Treat possibly-unused keys as static scan hints, not permission to remove them. Route edits through the development workflow and preserve downstream API validation and human gates.'

BOARD_KEY = "nerves" # this board's entry in the Brain's palette table
SCHEMA_VERSION = 1
STATE_ITEMS_MAX = 20
Expand Down Expand Up @@ -1394,8 +1396,18 @@ def _render_html_index(snap: dict) -> str:
]:
if present:
navigation.append({"href": "#" + target, "label": label, "count": count})
work_links = []
if repo_url(snap):
work_links.append({"label": "Nerves repository", "href": repo_url(snap)})
for source in snap.get("sources") or []:
work_slug = source.get("github") or ""
if re.fullmatch(r"[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+", work_slug):
work_links.append({"label": source["repo"] + " repository",
"href": "https://github.com/" + work_slug})
panel = t_.orchestration_panel("nerves", "", "", CHECKIN_PROMPT,
organ="nerves", work_links=work_links)
body = f"""{t_.hero(BOARD_KEY, "Board", lede, navigation=navigation)}
{t_.prompt_heading("nerves")}
{panel}
<p class="verdict {tone}"><b class="{tone}">{st.upper()}</b>
<span class="muted">{_esc(_summary(snap))}</span></p>
<p class="muted"><a href="dashboard.md">markdown version</a> ·
Expand Down
16 changes: 16 additions & 0 deletions test_autonerves/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def make_tree(tmp_path):


FAKE_THEME = types.SimpleNamespace(
orchestration_panel=lambda key, title, description, prompt, **kwargs: "<section data-orchestration-panel>" + prompt + "</section>",
prompt_heading=lambda key: '<h2 class="prompt-heading">Check your <strong>Nerves</strong> for config drift</h2>',
css=lambda key: "body{}",
hero=lambda key, kind, lede="", *, navigation=(): f"<header class='hero'>{kind} {lede}</header>",
Expand Down Expand Up @@ -624,3 +625,18 @@ def test_unused_keys_are_one_info_item_per_library_never_yellow(usnap):
overrides=[dict(o, workspace_only=[])
for o in usnap["overrides"]])
assert board.to_state(clean)["status"] == "green"


def test_panel_routes_all_sources_and_keeps_scan_caution(snap, monkeypatch):
captured = {}
def panel(key, title, description, prompt, **kwargs):
captured.update(kwargs, prompt=prompt)
return "<section data-orchestration-panel></section>"
monkeypatch.setattr(FAKE_THEME, "orchestration_panel", panel)
rendered = board.render(snap, "html-index")
assert rendered.index("data-orchestration-panel") < rendered.index("id='search'")
assert captured["organ"] == "nerves"
assert {link["href"] for link in captured["work_links"]} == {
"https://github.com/SomeOrg/PyAutoNerves", "https://github.com/SomeOrg/LibLow",
"https://github.com/SomeOrg/LibHigh", "https://github.com/SomeOrg/ws_demo"}
assert "not permission to remove" in captured["prompt"]
Loading