Repository navigation
feat(board): knowledge board emits the state.json cockpit feed #104
Description
Overview
Phase 1 of the organ cockpit (PyAutoBrain#416) defined the per-organ state.json v1 feed — contract board/state_schema.json, validator + CLI board/_state.py in PyAutoBrain — and made the Brain and Heart boards emit it. The cockpit page of a later phase reads only this feed, so every organ board must publish one. This member makes the Memory knowledge board emit it, mirroring PyAutoHeart#238. Bundle organ-cockpit-feeds (sibling member: PyAutoHands), epic organ-cockpit.
Plan
scripts/board.pygainsto_state(snapshot),fmt == "state"and a--stateflag beside--badge.knowledge_board.ymlrenders_site/state.jsonand validates it with the checked-out Brain validator (fails the job on drift).- Tests in
tests/test_board.pypin keys, enums, the Z timestamp, item links and the grey no-data path; no Brain import, no tenant literals.
Detailed implementation plan
Affected Repositories
- PyAutoMemory (primary)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./organs/PyAutoMemory | main (behind 2, ff) | clean — no other claim |
Suggested branch: feature/memory-state-feed
Worktree: ~/Code/PyAutoLabs-wt/organ-cockpit-feeds/ (shared with the Hands member)
Implementation Steps
scripts/board.py—to_state(snapshot) -> dict(stdlib): status grey when_totals(snapshot)["pages"] == 0; yellow if the inbox or interests digest is stale (_inbox_freshness(...)["stale"]) or any wiki carries stubs/todos; else green. Memory has no red condition (nothing can break) — the docstring says so. headline = the badge message (N pages · P% cited). updated = snapshotgeneratedas whole-second…Z, unparseable → now. pages_url =pages_url(snapshot). items = stale inbox/interests → yellow with the board URL; each wiki with stubs/todos → info with the existing_stub_prompt/_todo_promptpayload; inbox papers waiting → info with_queue_issue_url.fmt == "state"inrender;--statein the mutually-exclusive group with--badge..github/workflows/knowledge_board.yml— render step addspython scripts/board.py --state > _site/state.json; new step "Validate the cockpit feed against the Brain contract":python3 PyAutoBrain/board/_state.py _site/state.json(PyAutoBrain is already checked out at./PyAutoBrain). Header comment listsstate.jsonbesidebadge.json.tests/test_board.py— on the synthetic tree fixture: required keys, status enum,updatedends with Z and parses, stubs → info items with prompts, stale inbox → yellow, empty tree → grey,render(fmt="state")renders. Copy the 6-line required/enum check; do not import Brain. Tenant firewall with--root <worktree>must be OK.
Key Files
scripts/board.py— renderer (badge_endpoint,_totals,_inbox_freshness,_queue_issue_url,_stub_prompt,_todo_prompt,pages_url).github/workflows/knowledge_board.yml— render + validate stepstests/test_board.py
Verification
pytest tests/test_board.py -q;python scripts/board.py --state | python ../PyAutoBrain/board/_state.py -→state: ok- After merge:
knowledge_board.ymlrun green with the validate step loggingstate: ok;curl https://pyautolabs.github.io/PyAutoMemory/state.jsonvalidates.
Original Prompt
Click to expand starting prompt
Organ cockpit: PyAutoMemory knowledge board emits state.json
Type: feature
Target: PyAutoMemory
Repos:
- PyAutoMemory
Difficulty: small
Autonomy: safe
Priority: high
Status: formalised
Consequence: notify
Witness: knowledge_board.yml run on main green with the validate step logging 'state: ok'; curl https://pyautolabs.github.io/PyAutoMemory/state.json passes the validator CLI.
Review-minutes: 0
Unattended: ready
Epic: organ-cockpit
Phase 1 (issue 416 in the Brain, shipped 2026-09-26) defined the per-organ state.json v1 cockpit feed (contract board/state_schema.json, validator + CLI board/_state.py in the Brain checkout the board job already has at ./PyAutoBrain). This prompt makes the Memory knowledge board emit it, mirroring the Heart pattern.
- scripts/board.py in PyAutoMemory: a --state flag beside --badge rendering the v1 feed: status from the badge colour (red/orange/lightgrey/brightgreen -> red/yellow/grey/green), headline = the badge message, updated = the render timestamp as ISO-8601 Z, pages_url = https://pyautolabs.github.io/PyAutoMemory/, items = the actionable rows the board already renders (stale wiki pages, unprovenanced entries, reading-queue waits) with GitHub links.
- .github/workflows/knowledge_board.yml: python scripts/board.py --state > _site/state.json in the render step, then a validate step python3 PyAutoBrain/board/_state.py _site/state.json that fails the job on drift.
- Tests beside the existing board tests in PyAutoMemory: required keys, status enum, updated ends with Z; Memory tests must not import the Brain.
Witness: knowledge_board.yml run on main green with the validate step logging 'state: ok'; curl https://pyautolabs.github.io/PyAutoMemory/state.json passes the validator CLI.
🤖 Generated with Claude Code
Activity
Jammy2211 commentedon Sep 26, 2026
Library PR created — under Heart RED override
PR: #105 —
to_state+--stateon the board renderer, workflow emits_site/state.jsonand validates it withPyAutoBrain/board/_state.py. pytest 219 passed (9 new; one pre-existing PYAUTO_BRAIN env failure in test_theme_finds_grouped_brain_from_outer_workspace noted for follow-up). Brain validatorstate: ok; tenant firewall OK.Heart RED override (development only). Heart readiness RED (snapshot 2026-09-26T11:27:07+00:00); verbatim reason:
release validation FAILED (stage integrate)— pre-existing integrate failure, unrelated to the board code. Human authorization, live, 2026-09-26, this session: "ok io authorize you to continue" (development shipping + merge on green checks; no release).Merge pull request #105 from PyAutoLabs/feature/memory-state-feed
Jammy2211 commentedon Sep 26, 2026
Shipped
knowledge_board.ymlrun 36240211686 on main: green; validate step loggedstate: ok.python board/_state.py:yellow | arXiv inbox digest stale · 166 pages · 40% cited | 7 items— the yellow is real: arXiv inbox digest stale since 2026-09-23 and interests since 2026-09-16 (nightly filing may be broken; separate issue).