Skip to content

cortex: dashboard, pages and gate-grading workflows; ledger carve-out; first render (PyAutoMind#380) - #2

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/cortex-conductor
Sep 2, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/cortex-conductor

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Phase 2 of the cortex-birth epic (PyAutoLabs/PyAutoMind#380), Cortex side — the workflows that drive the registry now that the Brain conductor exists (merge after PyAutoBrain's cortex-conductor PR):

  • dashboard_refresh.yml — mirror of the Mind's (Brain checkout, exit-code contract, PR errors / push+cron+dispatch self-heal, both Pages redispatch sites), pages_dashboard.yml (index = dashboard.html, packets under /packets/), gates_grade.yml — the one scheduled job that mutates state: daily cortex.py gates --grade --write, commits flips, redispatches the check and the refresh, and reddens on an unreadable ref after committing what flipped. All main-writers share the cortex-main-writers concurrency group.
  • Ledger carve-out (phase-1 follow-up): AGENTS.md/TEMPLATE.md under ledger dirs are code (a doctrine edit needs a human); dashboard.md/dashboard.html are ledger (the self-heal commit auto-merges).
  • First rendered dashboard.md + dashboard.html (empty registry).
  • Docs: "Driving the Cortex" in AGENTS.md/REFERENCE.md, README board link, schema decisions 38–49 (normaliser, UNOBSERVABLE verdicts, the pull manifest .cortex/pull.json schema phase 3 writes, --pull doctrine, --apply/--write spelling, zip-over-dir, and more).

Scripts Changed

  • .github/workflows/{dashboard_refresh,pages_dashboard,gates_grade}.yml (new), cortex_check.yml, ledger_merge.yml
  • scripts/ledger_merge.py, tests/test_ledger_merge.py (+8)
  • dashboard.md, dashboard.html (new render)
  • AGENTS.md, REFERENCE.md, README.md, docs/schema_decisions.md

Test Plan

  • cortex.py check OK; pytest tests -q → 127 passed
  • dashboard --check clean against the merged Brain conductor
  • ledger_merge.py classify batches/AGENTS.md → code; dashboard.md → ledger
  • repos_sync.py --check 15 legs OK
  • cortex_check.yml + dashboard_refresh.yml green on this PR; first Pages deploy live after merge

Generated by the PyAutoLabs agent workflow.

…; first render (PyAutoMind#380)

Phase 2 of the cortex-birth epic, Cortex half: the Cortex gets a published
board, a nightly self-heal for it, and the one scheduled job allowed to move a
phase.

Workflows:

- dashboard_refresh.yml — renders `dashboard.md`/`dashboard.html` with the
  Brain's cortex conductor (two checkouts; runner python3, both sides stdlib).
  PR runs error on drift, push/cron/dispatch self-heal main in a 3-attempt
  fetch/reset/render/commit/push loop. The `check()` wrapper keeps the exit-code
  contract: 1 is drift and nothing else, anything higher is a renderer failure
  and is reported as one. Both dispatch sites for pages_dashboard.yml are kept —
  the fresh path as well as the heal path, because a GITHUB_TOKEN push fires no
  events and folding the two together is what stranded the Mind's published
  board on 2026-08-27.
- pages_dashboard.yml — publishes `dashboard.html` as the Pages index and
  `batches/packets/*.html` under `/packets/`; `enablement: true`, `group: pages`.
- gates_grade.yml — daily 06:47 UTC `cortex.py gates --grade --write`. The one
  scheduled mutator: `gated → ready` (and `ready → gated` on a reopen), phase
  headers only, explicit `git add phases`. An unreadable ref fails closed and
  reddens the job AFTER committing whatever flipped, then re-dispatches
  cortex_check.yml and dashboard_refresh.yml by name.
- cortex_check.yml — paths gain the two generated pages; its "no self-heal"
  sentence now points at dashboard_refresh.yml.
- All three main-writers (including ledger_merge.yml, whose group is renamed)
  share `concurrency: group: cortex-main-writers, cancel-in-progress: false`.

Ledger carve-out (scripts/ledger_merge.py + tests):

- `AGENTS.md` / `TEMPLATE.md` under a ledger dir are CODE — ledger by location,
  instructional by content; auto-merging a rewrite of `rulings/AGENTS.md` would
  let a branch edit the rule that governs its own merge.
- `dashboard.md` / `dashboard.html` are LEDGER — generated and self-healed, so
  the heal commit must land without a human.
- Tests: the five doctrine paths are code, every tracked ledger-dir path gets
  the right verdict, the dashboards are ledger, every workflow file (all five,
  named) is code, and the workflows are pinned to the spellings they invoke.

Docs: AGENTS.md and REFERENCE.md gain "Driving the Cortex" (conductor verbs, the
`--apply`/`--write` split, the `--check` exit-code contract, what each workflow
may write, the Pages URL); README links the board; schema_decisions.md 38–48.

First render committed: `dashboard --check` is clean on the empty tree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SESCzU1FcwktEAdTZfmf3j
@Jammy2211
Jammy2211 merged commit 7bb1703 into main Sep 2, 2026
2 checks passed
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