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 @@ -97,3 +97,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 -->
18 changes: 17 additions & 1 deletion scripts/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,18 @@ def _repo_url(snapshot: dict) -> str:
return f"https://github.com/{owner}/{repo}" if owner and repo else ""


CHECKIN_PROMPT = (
"Review the Memory knowledge board in this chat. Read PyAutoMemory/AGENTS.md, "
"its index and relevant domain indexes; then inspect the reading queue, digest "
"freshness, unresolved canonical keys and stub work. Read at most two or three "
"relevant pages after each index. Summarize priorities and propose one bounded "
"next step, retaining missing evidence as unknown. Apply my direction while "
"keeping the queue in view. Follow existing catch-up selection approval and "
"development workflow for writes; do not bulk-ingest papers, commit source "
"PDFs or post issues automatically."
)


# The one-tap board family — the cross-board footer nav every board carries,
# each board skipping its own entry.
#
Expand Down Expand Up @@ -1587,6 +1599,10 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str,
repo_url = _repo_url(snapshot)
github_link = (f' · <a href="{repo_url}/blob/main/README.md">'
"GitHub Page</a>" if repo_url else "")
panel = t_.orchestration_panel(
"memory", "", "", CHECKIN_PROMPT,
work_links=([{"label": snapshot["repo"], "href": repo_url}] if repo_url else []),
organ="memory")
# One-tap mode needs the API's owner/repo and a place to turn it on; both
# drop out with the repo identity, like every other GitHub-facing chip.
owner, repo = snapshot.get("owner"), snapshot.get("repo")
Expand All @@ -1604,7 +1620,7 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str,
</head>
<body{body_attrs}>
{hero}
{t_.prompt_heading("memory")}
{panel}
<section id="catch-up">{_catch_up_html(snapshot)}</section>
<p class="muted mdsrc"><a href="dashboard.md">markdown version</a>{github_link}{onetap}</p>
<div id="toast"></div>
Expand Down
26 changes: 26 additions & 0 deletions tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,3 +1141,29 @@ def test_invalid_digest_is_escaped_and_never_given_to_browser_clock(tmp_path):
assert '<script>oops</script>' not in html
assert 'digest date is invalid or in the future' in html
assert "data-last-digest='<" not in html


def test_orchestration_preview_targets_memory_and_preserves_paper_actions(tmp_path):
import html as html_module

snap = {**_snap_with_remote(tmp_path), "owner": "SomeOrg", "repo": "MemoryWork"}
page = board.render(snap, "html")
preview = re.search(r'<textarea id="orchestration-memory-prompt"[^>]*>(.*?)</textarea>',
page, re.S).group(1)
assert html_module.unescape(preview) == (
board.CHECKIN_PROMPT + "\n\nWork on GitHub:\n"
"- MemoryWork: https://github.com/SomeOrg/MemoryWork")
assert page.index('class="hero"') < page.index('id="orchestration-memory"')
assert page.index('id="orchestration-memory"') < page.index('id="catch-up"')
assert board.theme().prompt_heading("memory", heading_id="orchestration-memory-heading") in page
assert 'data-repo="SomeOrg/MemoryWork"' in page
assert board._EXTRA_JS in page
assert "https://github.com/SomeOrg/MemoryWork/issues/new?" in page
assert 'data-orchestration-copy' in page


def test_orchestration_without_memory_remote_is_explicit(tmp_path):
snap = {**_snap_with_remote(tmp_path), "owner": None, "repo": None}
page = board.render(snap, "html")
assert "Work repository unavailable in this snapshot." in page
assert "https://github.com/None/None" not in page
Loading