diff --git a/agents/conductors/cortex/_cortex.py b/agents/conductors/cortex/_cortex.py index ccc60c6c..dc63497b 100644 --- a/agents/conductors/cortex/_cortex.py +++ b/agents/conductors/cortex/_cortex.py @@ -618,9 +618,12 @@ def render_dashboard_html(c: dict) -> str: f"{c['generated']} — regenerate, do not hand-edit -->", f"", "", "", - hero(THEME_ORGAN, "Dashboard", _esc(INTRO)), - stats((n["running"], "Running"), (n["open"], "Open"), - (n["active"], "Projects")), + hero(THEME_ORGAN, "Dashboard", _esc(INTRO), navigation=[ + {"label": "Running", "href": "#summary", "count": n["running"]}, + {"label": "Open", "href": "#summary", "count": n["open"]}, + {"label": "Projects", "href": "#projects", "count": n["active"]}, + {"label": "Check in", "href": "#checkin-box"}, + ]), # One line, deliberately: the `--check` normaliser drops it whole so # a date change is not drift. f'

Last updated ' diff --git a/agents/conductors/intake/_intake.py b/agents/conductors/intake/_intake.py index ae891cde..96903bdc 100755 --- a/agents/conductors/intake/_intake.py +++ b/agents/conductors/intake/_intake.py @@ -2646,12 +2646,20 @@ def record_row(r): "start-dev skill prompt is on your clipboard — paste it " "into an AI assistant chat to route the assistant straight to that task. " 'Recent is the same work by date — what has ' - "been happening rather than what to do next."), - # The four numbers a human wants before reading a single row. - stats((c["issued_count"], "In flight"), - (len(c.get("human_review") or []), "Human review"), - (len(c["parked"]), "Parked"), - (len(c["planned"]), "Planned"), (c["total"], "Backlog")), + "been happening rather than what to do next.", navigation=[ + {"label": "Start here", "href": "#start-here"}, + {"label": "In flight", "href": "#in-flight", "count": c["issued_count"]}, + {"label": "Human review", "href": "#human-review", "count": len(c.get("human_review") or [])}, + {"label": "Parked", "href": "#parked", "count": len(c["parked"])}, + {"label": "Planned", "href": "#planned", "count": len(c["planned"])}, + {"label": "Backlog", "href": "#backlog", "count": c["total"]}, + ] + [{"label": label, "href": "#" + target} + for label, target, present in ( + ("Pending release", "pending-release", bool(c.get("pending_release"))), + ("Bundles", "bundles", bool(bundle_cards(c))), + ("Recent", "recent", bool(c.get("recent"))), + ("Epics", "epics", bool(c.get("epics") or _epic_members(c))), + ) if present]), ] H += [f'

Last updated {c["generated"]}. ' f'This page is {_md_inline(REFRESH_BLURB)}

', @@ -2668,7 +2676,7 @@ def record_row(r): H += [f"
  • {_attr(d)}
  • " for d in c["drift"]] H += [""] H.append(_status_box_html(c["batch"])) - H += ["

    Start here

    "] + H += ['

    Start here

    '] members = _epic_members(c) standalone = [r for r in records if not r.get("epic")] @@ -2690,7 +2698,11 @@ def h2(title, src): # registry file is the full record, the page is the view. a = (f' markdown ' "version") if blob else "" - return f"

    {title}{a}

    " + anchor = {"In flight": "in-flight", "Parked": "parked", + "Planned": "planned", "Backlog": "backlog", + "Bundles": "bundles", "Epics": "epics"}.get(title) + prefix = f'' if anchor else "" + return prefix + f"

    {title}{a}

    " H += [h2("In flight", "active.md"), '

    Issued — each has an open GitHub issue and ' diff --git a/board/AGENTS.md b/board/AGENTS.md index d36bb500..ae513686 100644 --- a/board/AGENTS.md +++ b/board/AGENTS.md @@ -82,6 +82,11 @@ repos' `pages_dashboard.yml`. ## Look (`_theme.py`) +Use the [shared section navigation](../docs/board-navigation.md) via +`hero(..., navigation=items)`: banner, linked cards, then freshness/context. +Owners supply safe destinations, labels and optional counts; no duplicate card +CSS or changes to data/action semantics. + The [responsive sizing standard](../docs/board-sizing.md) separates the outer board from its reading measure. The shared theme caps the border-box at `77.5rem` (1240px at the default root size), with `1rem` gutters below `46rem` diff --git a/board/_board.py b/board/_board.py index 8a5c9267..f3d1f3da 100755 --- a/board/_board.py +++ b/board/_board.py @@ -1542,7 +1542,21 @@ def render_html(data): "The organism's morning door — what ran overnight, who is " "waiting, and what needs you. Tap 📋 to put a command on your " "clipboard for an AI assistant chat; ⌨ rows are terminal " - "commands."), + "commands.", navigation=[ + {"label": label, "href": "#" + target, "count": count} + for (count, label), target in zip(section_counts(data), + ("overnight", "readiness", "community", "resume", "upkeep")) + ] + [{"label": "Morning sync", "href": "#morning"}, + {"label": "Versions", "href": "#versions"}] + + [{"label": label, "href": "#" + target} + for label, target, present in ( + ("Test performance", "performance", data.get("performance") is not None), + ("Hygiene", "hygiene", bool(data.get("hygiene"))), + ("Dev box", "devbox", bool(data.get("devbox"))), + ("Autonomous runs", "autonomy", bool(data.get("autonomy"))), + ("All doors", "doors", bool(data.get("doors"))), + ("Unavailable sources", "degraded", bool(data.get("degraded"))), + ) if present]), ] verdict_cls = "bad" if blocking else ("warn" if attention else "ok") spark = sparkline(data.get("history") or []) @@ -1558,7 +1572,6 @@ def render_html(data): # that can ask something of them, so the strip doubles as a contents # page. `–` where a source was unreachable: an absent count is never a # zero here, the same contract the rows keep. - H.append(stats(*section_counts(data))) # The sibling boards' header line: the markdown twin (written beside # index.html by --apply, so the relative href resolves on Pages) and the # way back to the repository front door on github.com. @@ -1567,13 +1580,13 @@ def render_html(data): "/blob/main/README.md") H.append('

    markdown ' f'version · GitHub Page

    ') - H.append("

    ⌨ Morning sync (local)

    ") + H.append("

    ⌨ Morning sync (local)

    ") H.append(_row( "Sync every repo to main + clean generated cruft — run in a terminal " "at the workspace root, not in an AI assistant chat.", MORNING_CMD, term=True)) - H.append("

    🌙 Overnight

    ") + H.append("

    🌙 Overnight

    ") for r in data["overnight"]: # The workflow is the row's subject; its repo and its conclusion are # facets, so they read as pills — the repo in the organ accent @@ -1607,7 +1620,7 @@ def render_html(data): else: H.append(_plain(text)) - H.append("

    ❤️ Readiness & release

    ") + H.append("

    ❤️ Readiness & release

    ") monitoring = data.get("heart_monitoring") if isinstance(monitoring, dict) and type(monitoring.get("score")) is int: H.append(_row( @@ -1656,7 +1669,7 @@ def render_html(data): # carry their own prompts, this end never re-derives one. perf = data.get("performance") if perf is not None: - H.append("

    ⏱ Test performance

    ") + H.append("

    ⏱ Test performance

    ") if perf.get("flagged"): for f in perf["flagged"]: link = (f' run ↗' @@ -1678,7 +1691,7 @@ def render_html(data): + pills(("nothing flagged", "g")))) v = data["versions"] - H.append("

    🏷️ Version consistency

    ") + H.append("

    🏷️ Version consistency

    ") if v["consensus"] and v["drift"] == 0: H.append(_plain( f'The coupled set agrees at {esc(v["consensus"])}' @@ -1698,7 +1711,7 @@ def render_html(data): H.append(f'

    Latest release tag {esc(v["reference"])} — ' "the frozen source stamp trailing it is expected.

    ") - H.append("

    💬 Community · Ears

    ") + H.append("

    💬 Community · Ears

    ") if data["boards"].get("ears"): H.append(_plain(f'Open Ears board ↗')) c = data["community"] @@ -1752,7 +1765,7 @@ def community_row(e, note, tone): else: H.append(_row("Scan unavailable — run the Ears directly.", "Use the community skill.")) - H.append("

    🔄 Resume

    ") + H.append("

    🔄 Resume

    ") counts = data["resume"]["counts"] mind_url = data["boards"].get("mind", "") if counts: @@ -1809,7 +1822,7 @@ def community_row(e, note, tone): elif pending is not None: H.append(_plain('no pending-release PRs open')) - H.append("

    🧹 Upkeep

    ") + H.append("

    🧹 Upkeep

    ") # Standing invitations rather than state, so the one pill each carries is # the door it routes to — what the 📋 puts on the clipboard, visible # without tapping it. @@ -1827,7 +1840,7 @@ def community_row(e, note, tone): hygiene = data.get("hygiene") if hygiene: - H.append(f'

    🧼 Hygiene (scanned this render — ' + H.append(f'

    🧼 Hygiene (scanned this render — ' f'{hygiene.get("repos_present")}/{hygiene.get("repos_declared")} ' "repos present)

    ") flagged = [r for r in hygiene["rows"] @@ -1844,7 +1857,7 @@ def community_row(e, note, tone): if devbox: stale = (' — STALE' if devbox.get("stale") else "") - H.append(f'

    🖥️ Dev box (observed ' + H.append(f'

    🖥️ Dev box (observed ' f'{age_label(devbox["age_h"])} ago via morning.sh{stale})

    ') if devbox.get("stale"): H.append(_row("Refresh the dev-box observation — run in a " @@ -1872,7 +1885,7 @@ def community_row(e, note, tone): H.append(_plain("worktree" + pills(*facets))) if data.get("autonomy"): - H.append('

    🤖 Autonomous runs (the calibration ' + H.append('

    🤖 Autonomous runs (the calibration ' "log's tail)

    ") for a in data["autonomy"]: H.append(_plain( @@ -1883,7 +1896,7 @@ def community_row(e, note, tone): doors = data["doors"] if doors: - H.append("

    🚪 All doors

    ") + H.append("

    🚪 All doors

    ") H.append("
    every agent and workflow door") for d in doors: if d["tier"] == "skill": @@ -1905,7 +1918,7 @@ def community_row(e, note, tone): H.append("
    ") if data["degraded"]: - H.append("

    Degraded

    ") + H.append("

    Degraded

    ") for d in data["degraded"]: H.append(_plain(f'{esc(d)}')) diff --git a/board/_theme.py b/board/_theme.py index bdb15c85..eba70ada 100644 --- a/board/_theme.py +++ b/board/_theme.py @@ -562,6 +562,17 @@ def mark(key): .hero .tag{margin:0;font-size:.63rem;font-weight:600; letter-spacing:.3em;text-transform:uppercase;color:var(--glow);opacity:.9} .lede{margin:0 0 .9rem} +/* Section links share a shape whether or not the owner has a useful count. */ +.board-nav{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%%,10rem),1fr)); + gap:.75rem;margin:1.5rem 0;min-width:0} +.board-nav-card{display:flex;flex-direction:column;justify-content:center;gap:.25rem; + min-width:0;min-height:5.5rem;padding:1rem;border:1px solid var(--line); + border-top:3px solid var(--accent);border-radius:12px;background:var(--btn); + color:var(--fg);text-decoration:none} +.board-nav-card:hover{background:var(--tint);text-decoration:none;border-color:var(--accent)} +.board-nav-card:focus-visible{outline:3px solid var(--accent);outline-offset:3px} +.board-nav-count{font-size:1.8rem;font-weight:700;line-height:1.15;color:var(--accent)} +.board-nav-label{font-weight:650}.board-nav-context{font-size:.8rem;color:var(--muted)} /* --- sections ---------------------------------------------------------- */ h2{font-size:1.1rem;margin:2.1rem 0 .3rem;padding:0 0 .35rem;font-weight:650; position:relative;color:var(--accent);border-bottom:2px solid var(--edge)} @@ -709,7 +720,36 @@ def css(key): # ------------------------------------------------------------- components --- -def hero(key, kind, lede_html=""): +def navigation_cards(items, label="Board sections"): + """Section links with owner-supplied labels, optional counts and context. + + Each item has ``href`` and ``label``; ``count=None`` omits the number, + while a textual count such as "Unknown" preserves missing evidence. + This presentation helper neither collects nor interprets board data. + """ + from urllib.parse import urlsplit + + cards = [] + for item in items: + href = str(item["href"]) + if (not href or href != href.strip() or any(ord(c) < 32 for c in href) + or "\\" in href or href.startswith("//") + or urlsplit(href).scheme.lower() not in ("", "http", "https")): + raise ValueError("Navigation destination must be an anchor or safe web link") + count = item.get("count") + value = (f'{_html.escape(str(count))}' + if count is not None else "") + context = item.get("context") + note = (f'{_html.escape(str(context))}' + if context else "") + cards.append(f'' + f'{value}' + f'{_html.escape(str(item["label"]))}{note}') + return (f'") if cards else "" + + +def hero(key, kind, lede_html="", *, navigation=()): """The masthead: the organ's logo re-drawn — mark, wordmark, rule, tagline. `kind` is what this page *is* under the wordmark ("Dashboard", "Board"), @@ -721,7 +761,8 @@ def hero(key, kind, lede_html=""): f'

    {WORD}{o["organ"]}' f'{kind}

    ' f'
    ' - f'

    {o["tagline"]}

    {lede}') + f'

    {o["tagline"]}

    ' + f'{navigation_cards(navigation)}{lede}') # Facet vocabulary → pill tone. Anything unlisted falls back to the neutral diff --git a/docs/board-navigation.md b/docs/board-navigation.md new file mode 100644 index 00000000..da8c4e8b --- /dev/null +++ b/docs/board-navigation.md @@ -0,0 +1,76 @@ +# Shared board navigation + +Every board uses the same top order: organ logo/banner, section navigation +cards, freshness/context, then its content. The cards are real links, not +JavaScript-only hidden tabs. Counts are optional; an unknown count is never +silently rendered as zero. Each owner supplies meaningful destinations and +keeps ownership of collection, health, freshness and action semantics. + +## Component contract + +`board/_theme.py::hero(key, kind, lede_html='', navigation=())` retains its +existing positional API. The optional keyword inserts +`navigation_cards(items, label='Board sections')` directly after the masthead +and before the description. Existing consumers without navigation are unchanged. + +Each item is a mapping with `href` and `label`, plus optional `count` and +`context`. Text is escaped. Destinations accept local anchors, relative links +and HTTP(S) URLs, and reject active schemes, protocol-relative paths, backslashes +and control characters. `count=None` omits the value; `0` remains visible; +`'Unknown'` is a valid owner-supplied state. The theme does not calculate counts. + +Cards share the organ's accent, a large target, visible keyboard focus and a +fluid grid. They use the [shared sizing standard](board-sizing.md). Do not +copy card CSS into another repository or use the accent to imply health. Keep +existing section anchors; only render links whose targets exist. Multiple +counts may link to one meaningful summary, as Ears' follow-through cards do. + +## Renderer ownership and rollout + +The authoritative membership is `config/policy.yaml` → `board.boards`. + +| Board | Source owner | Integration | +|---|---|---| +| Brain | Brain `board/_board.py` | Shared component; section-owned counts plus count-free navigation | +| Mind | Brain `agents/conductors/intake/_intake.py` | Shared component; active/review/planned/backlog counts and optional sections | +| Cortex | Brain `agents/conductors/cortex/_cortex.py` | Shared component; running/open/projects counts and check-in link | +| Ears | Ears `ears/board.py`, `ears/presentation.py` | Downstream reference migration; readable freshness below navigation | +| Memory | Memory `scripts/board.py` | Downstream shared-theme consumer | +| Heart | Heart `heart/dashboard.py` | Downstream shared-theme consumer; retain readiness semantics | +| Hands | Hands `autohands/board.py` | Downstream shared-theme consumer | +| Pulse | Pulse `pulse/board.py` | Downstream shared-theme consumer | +| Nerves | Nerves `scripts/board.py` | Downstream shared-theme consumer | +| Gut | Gut `scripts/board.py` | Downstream shared-theme consumer | +| Scientist | Scientist `scripts/organism_board.py` | Downstream shared-theme consumer | +| Eyes | Eyes `eyes/board.py` | Independent-renderer migration | +| Insight | Insight `insight/board.py`, `insight/theme.py` | Independent-renderer migration | + +Consumer PRs depend on the Brain component merge. Source adoption does not +mean a board is live: refresh workflows must regenerate HTML and publication +must complete. The Mind task records that board-by-board rollout. Existing +copy/orchestration panels are a separate task; retain their payloads here. + +Remove Ears' prominent "STALE — refresh required before judging the queue" +wording during its migration. Display a timestamp and a plain explanation below +navigation instead, while keeping the existing stale/unknown behavior and expiry +handler. Do not hide evidence age or change feeds to make the layout look fresh. + +## Validation + +Renderer checks cover safe links, escaped labels, optional/zero/unknown counts, +header ordering and live anchor destinations. Browser validation covers 390, +768, 820, 1024 and 1440px in light/dark, long labels, keyboard navigation and +count-free cards. Whole-page overflow and existing copy/disclosure behavior +remain part of each consumer's validation; a shared CSS change alone is not +proof of adoption. + +The core implementation passed 1186 Brain tests and a strict Sphinx build. +Thirty Chromium cases exercised the three owner renderers at five widths in +light/dark: cards immediately followed the banner, every target existed, every +card fit the viewport with a touch-sized target, keyboard activation navigated +to the section, and no whole-page overflow occurred. Screenshots below use +synthetic test data, not current operational state. + +![Brain desktop navigation](board-navigation/brain-desktop.png) + +![Cortex phone navigation](board-navigation/cortex-phone.png) diff --git a/docs/board-navigation/brain-desktop.png b/docs/board-navigation/brain-desktop.png new file mode 100644 index 00000000..3ef1468f Binary files /dev/null and b/docs/board-navigation/brain-desktop.png differ diff --git a/docs/board-navigation/cortex-phone.png b/docs/board-navigation/cortex-phone.png new file mode 100644 index 00000000..5e160637 Binary files /dev/null and b/docs/board-navigation/cortex-phone.png differ diff --git a/docs/index.md b/docs/index.md index c23d8fa2..12763235 100644 --- a/docs/index.md +++ b/docs/index.md @@ -74,6 +74,7 @@ satellites adoption/guide adoption/config_surfaces board-sizing +board-navigation example ``` diff --git a/tests/test_board.py b/tests/test_board.py index a55542cb..05a38a86 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -560,12 +560,16 @@ def test_the_header_strip_counts_every_section_that_can_ask_something(tmp_path): page = _run(["--html"], tmp_path, stub).stdout for label in ("Overnight red", "Blockers", "Awaiting", "In flight", "Open issues"): - assert f"{label}" in page + assert f'{label}' in page + assert '