Skip to content

Commit d533fa0

Browse files
committed
brain: All doors carries every door — agents AND workflow skills
The roster already read every agent live from the dispatcher registry (all 13 conductors + 5 faculties); it now also lists the non-agent doors — compositions, dev-flow entries, ship/cleanup workflows — from their own single source, skills/*/SKILL.md (first sentence of the frontmatter description; dir name is the /verb chip). board (this page) and wake_up (superseded by it) stay off on purpose. 421 tests pass. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 183eb6f commit d533fa0

2 files changed

Lines changed: 37 additions & 5 deletions

File tree

board/_board.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,10 @@ def sparkline(history):
428428

429429

430430
def collect_doors():
431-
"""The conductor/faculty roster, read from the dispatcher registry itself
432-
(bin/pyauto-brain is the single source; never a second copy here)."""
431+
"""EVERY door, from the two single sources: the dispatcher registry
432+
(conductors + faculties — all the agents) and skills/*/SKILL.md (the
433+
non-agent doors: compositions, dev-flow entries, ship/cleanup workflows).
434+
Never a second hand-written roster."""
433435
script = (
434436
f'source "{BRAIN_HOME}/bin/pyauto-brain"; '
435437
'for v in "${CONDUCTOR_ORDER[@]}"; do printf "conductor\\t%s\\t%s\\n" "$v" "${AGENT_DESC[$v]}"; done; '
@@ -445,6 +447,20 @@ def collect_doors():
445447
parts = line.split("\t", 2)
446448
if len(parts) == 3:
447449
doors.append({"tier": parts[0], "verb": parts[1], "desc": parts[2]})
450+
agent_verbs = {d["verb"] for d in doors}
451+
# board (this page) and wake_up (superseded BY this page) stay off the
452+
# roster on purpose.
453+
skip = agent_verbs | {"board", "wake_up"}
454+
for skill in sorted((BRAIN_HOME / "skills").glob("*/SKILL.md")):
455+
verb = skill.parent.name
456+
if verb in skip:
457+
continue
458+
m = re.search(r"^description:\s*(.+)$", skill.read_text(encoding="utf-8"),
459+
re.M)
460+
desc = m.group(1).strip() if m else ""
461+
# First sentence only — the SKILL.md carries the full contract.
462+
desc = re.split(r"(?<=[.!?]) ", desc, maxsplit=1)[0][:140]
463+
doors.append({"tier": "skill", "verb": verb, "desc": desc})
448464
return doors
449465

450466

@@ -996,12 +1012,21 @@ def community_row(e, note_html):
9961012
doors = data["doors"]
9971013
if doors:
9981014
H.append("<h2>🚪 All doors</h2>")
999-
H.append("<details><summary>every conductor and faculty</summary>")
1015+
H.append("<details><summary>every agent and workflow door</summary>")
10001016
for d in doors:
1017+
if d["tier"] == "skill":
1018+
continue
10011019
tier = '<span class="muted"> (faculty)</span>' \
10021020
if d["tier"] == "faculty" else ""
10031021
H.append(_row(f'<b>/{esc(d["verb"])}</b>{tier}{esc(d["desc"])}',
10041022
f"/{d['verb']}"))
1023+
skills = [d for d in doors if d["tier"] == "skill"]
1024+
if skills:
1025+
H.append('<p class="muted">Workflow doors — compositions and '
1026+
'dev-flow entries, no agent of their own:</p>')
1027+
for d in skills:
1028+
H.append(_row(f'<b>/{esc(d["verb"])}</b> — {esc(d["desc"])}',
1029+
f"/{d['verb']}"))
10051030
H.append("</details>")
10061031

10071032
if data["degraded"]:

tests/test_board.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,17 @@ def test_json_surface_is_complete_and_derives_org(tmp_path):
245245
assert s["open_issues"] == 42
246246
# Community section reuses the Ears' scan surface wholesale.
247247
assert s["community"]["counts"]["awaiting_response"] == 0
248-
# The doors roster comes from the dispatcher registry, both tiers.
248+
# The doors roster covers every agent (dispatcher registry, both tiers)
249+
# AND every workflow door (skills/ minus the agents).
249250
verbs = {d["verb"] for d in s["doors"]}
250251
assert {"intake", "health", "vitals"} <= verbs
251-
assert "board" not in verbs # surfaces are not agents
252+
skill_verbs = {d["verb"] for d in s["doors"] if d["tier"] == "skill"}
253+
assert {"route", "prm", "start_dev", "issue_cleanup"} <= skill_verbs
254+
for d in s["doors"]:
255+
if d["tier"] == "skill":
256+
assert d["desc"], d["verb"] # frontmatter description parsed
257+
assert "board" not in verbs # the page never lists itself
258+
assert "wake_up" not in verbs # superseded BY this page
252259
# Sibling boards resolved against the pages base.
253260
assert s["boards"]["heart"].endswith("/PyAutoHeart/")
254261

0 commit comments

Comments
 (0)