Skip to content

feat(conductors): Mind + Cortex dashboards emit the state.json cockpit feed (#418) - #420

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/mind-cortex-state-feed
Sep 26, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/mind-cortex-state-feed

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Organ cockpit (PyAutoBrain#418, PR C of 3 — merge last, after PyAutoMind and PyAutoCortex): the intake and cortex conductors render the state.json v1 cockpit feed beside the Mind and Cortex dashboards they already write, using board/_state.build_state. dashboard --apply writes it, dashboard --check covers it (with updated normalised out, like the generation stamp), cortex checkin carries it. Never re-derives: items reuse the rows' own copy payloads.

Also fixes a real regression found on the way: _mind_home expected github: on the line after PyAutoMind: in repos.yaml, but since the grouped-checkouts layout (Mind 69174a65, 2026-09-19) path: comes first, so the Mind home resolved to "" and the live dashboard silently lost its Pages pointer and absolute links. The regex now scans the whole indented entry. Expect the Mind self-heal after this merge to commit a large dashboard.html link diff along with state.json.

API Changes

  • agents/conductors/intake/_intake.py: render_state(c) (+ _state_status, _state_items, _start_here_picks, _now_iso clock seam, _state_body/_page_body); pages gains state.json; --json includes state. Status: red on registry drift or any in-flight row awaiting-input/blocked; yellow on awaiting-merge/library-shipped rows, human-review rows, pending-release rows or picks; grey on an empty Mind; else green. Headline N picks · M in flight.
  • agents/conductors/cortex/_cortex.py: render_state(c) (+ checkin_stale — Python port of the page's 180-min JS rule, _problem_ledger, _state_items, _now, state_body/page_body); render_pages adds state.json. Status: red on problems; yellow on running runs or a stale check-in; grey with no ledgers; else green. Headline A active · R running.
  • _mind_home regex fix (above).
    See full details below.

Test Plan

  • pytest tests/test_intake_dashboard.py tests/test_cortex_conductor.py tests/test_state_feed.py -q — 196 passed (5 + 6 new, 2 new fixtures)
  • Full suite 1037 passed; 1 env-only failure (test_hygiene_map_and_heart_board_find_grouped_checkouts) with activate.sh's PYAUTO_MIND exported, passes unset — pre-existing
  • Against the worktree Mind: --apply dashboard → "Wrote: dashboard.md + dashboard.html + state.json (237 prompts)"; --check → current; validator state: ok (yellow — 24 picks · 7 in flight, 20 items)
  • Against the worktree Cortex: --apply → 12 ledgers, 7 running; --check → current; validator state: ok (yellow — 7 active · 7 running, 8 items)
  • Tenant firewall OK
  • After merge: Mind + Cortex dashboard_refresh.yml commit state.json and dispatch Pages; both pages_dashboard.yml green with state: ok; both published feeds validate
Full API Changes (for automation & release notes)

Added

  • intake: render_state, _state_status, _state_items, _start_here_picks, _now_iso, _state_body, _page_body; state.json in pages (check/apply/json)
  • cortex: render_state, checkin_stale, _problem_ledger, _state_items, _now, state_body, page_body; state.json in render_pages
  • tests/fixtures/state/{mind,cortex}.json; docs lines in both conductors' AGENTS.md and board/AGENTS.md

Changed

  • _mind_home: scans the whole PyAutoMind: entry for github:

Removed

  • none

Migration

  • none — additive; dashboard.md/html rendering unchanged apart from the restored absolute links

Heart RED override (development only)

Heart readiness is RED (snapshot 2026-09-26T11:27:07+00:00). Verbatim reason string:

  • release validation FAILED (stage integrate)

Pre-existing release-integrate failure, unrelated to this diff. Branch gates passed as listed above.

Human authorization (live, this session, 2026-09-26, for PyAutoBrain#418): "override and continue" — development shipping + merge on green checks (Mind → Cortex → Brain); no release

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

PR C of PyAutoBrain#418. The intake and cortex conductors render a third
page from their one census: state.json, the organ-cockpit v1 feed, built
through board/_state.build_state so it cannot break the contract.

- intake: render_state — red when an in-flight task is awaiting-input or
  blocked (or prompts have lifecycle drift), yellow on awaiting-merge /
  library-shipped rows, human review, pending release or picks, green
  otherwise, grey for an empty Mind. Headline is the Start-here count
  line. Items reuse the page's payloads (/start_dev <path>,
  _review_payload, REFRESH_PAYLOAD), capped at 20. `--apply dashboard`
  writes it; `--check` compares it with `updated` normalised out.
- intake: _mind_home now finds `github:` anywhere in the PyAutoMind
  repos.yaml entry — since the grouped-checkouts layout put `path:` first
  it returned '' and the pages silently lost their Pages link.
- cortex: render_state — red on check problems (linked to the ledger's
  issue), yellow while a run is running or the check-in is stale (the page
  script's freshness rule, ported to checkin_stale), green otherwise, grey
  with no ledgers. render_pages adds it, so `dashboard --apply/--check`
  and `checkin` all carry it; state_body normalises `updated`.
- tests + tests/fixtures/state/{mind,cortex}.json; docs lines in both
  conductors' AGENTS.md and board/AGENTS.md.

Refs PyAutoBrain#418

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit c303990 into main Sep 26, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/mind-cortex-state-feed branch September 26, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant