Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/cortex_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ on:
push:
branches: [main]
paths:
- "tasks/**"
- "rulings/**"
- "batches/**"
- "projects/**"
- "archive/**"
- "projects.yaml"
- "checkin.yaml"
- "dashboard.md"
Expand All @@ -25,9 +24,8 @@ on:
- ".github/workflows/cortex_check.yml"
pull_request:
paths:
- "tasks/**"
- "rulings/**"
- "batches/**"
- "projects/**"
- "archive/**"
- "projects.yaml"
- "checkin.yaml"
- "dashboard.md"
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/dashboard_refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Dashboard Refresh

# Keeps the generated Cortex pages (`dashboard.md`, linked from the README, and
# `dashboard.html`, the Pages index) in step with the registry they describe.
# The pages are rendered by PyAutoBrain's cortex conductor from `tasks/`,
# `rulings/`, `batches/`, `projects.yaml` and `checkin.yaml`, so any push that
# files a task, moves it, records a run, lands a ruling or stamps a check-in
# makes them stale.
# The pages are rendered by PyAutoBrain's cortex conductor from `projects/`,
# `projects.yaml` and `checkin.yaml`, so any push that records a run, logs an
# entry, rewrites a `## Now` or stamps a check-in makes them stale.
#
# Same shape as the Mind's dashboard_refresh.yml, and for the same reason: on
# pull requests a stale page is an error the author fixes on the branch; on
Expand All @@ -30,18 +29,16 @@ on:
push:
branches: [main]
paths:
- "tasks/**"
- "rulings/**"
- "batches/**"
- "projects/**"
- "archive/**"
- "projects.yaml"
- "checkin.yaml"
- "dashboard.md"
- "dashboard.html"
pull_request:
paths:
- "tasks/**"
- "rulings/**"
- "batches/**"
- "projects/**"
- "archive/**"
- "projects.yaml"
- "checkin.yaml"
- "dashboard.md"
Expand Down Expand Up @@ -80,6 +77,19 @@ jobs:
with:
repository: PyAutoLabs/PyAutoBrain
path: PyAutoBrain
# A Cortex branch that changes the schema alongside its Brain conductor
# is rendered by the PyAutoBrain branch of the SAME NAME when one exists
# (the two land as a pair), and by Brain main otherwise.
- name: Prefer the same-named PyAutoBrain branch, if any
working-directory: PyAutoBrain
env:
BR: ${{ github.head_ref || github.ref_name }}
run: |
if [ "$BR" != "main" ] && git fetch --depth 1 origin "$BR" 2>/dev/null; then
git checkout -q FETCH_HEAD && echo "PyAutoBrain @ $BR"
else
echo "PyAutoBrain @ main"
fi
# No setup-python: the runner's python3 is the interpreter the laptop
# render is compared to. PyYAML is `cortex.py`'s one dependency (it reads
# `projects.yaml`), and the conductor imports that script at runtime.
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/ledger_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Cortex Ledger Merge
# Lands PyAutoCortex's own ledger work without anyone having to ask for it.
#
# THE PROBLEM. A branch-scoped session — the phone, claude.ai/code, any
# `claude/**` flow — pushes a task move, a ruling, a batch record to a feature
# `claude/**` flow — pushes a run recorded, an entry logged, a check-in to a feature
# branch and it stops there: nothing downstream looks at a `claude/**` push.
# The Mind learned this first (mind_ledger_merge.yml); the Cortex is born with
# the answer.
Expand All @@ -15,21 +15,20 @@ name: Cortex Ledger Merge
# pushed it ever comes back.
#
# WHAT IT WILL AND WILL NOT MERGE. Only a branch whose whole diff is *ledger*:
# `tasks/`, `rulings/`, `batches/`, `checkin.yaml`. The line is drawn by
# `projects/`, `checkin.yaml`, the two generated pages. The line is drawn by
# scripts/ledger_merge.py — a script, so it is testable and a session can
# predict the verdict — and it is DEFAULT DENY: anything under `scripts/`,
# `tests/`, `.github/`, `policy/`, `docs/`, `projects.yaml`, the prose pages,
# or any path nobody has classified, stops the merge and leaves the branch for
# a human. So does a MODIFIED or DELETED file under `rulings/` — the ledger of
# record is append-only, and the classifier reads `git diff --name-status` to
# hold that line. This workflow's own file is on the code side, which is the
# a human. So does ANY change under `archive/` — the frozen 2026-08/09 task,
# ruling and batch ledgers, which nothing writes any more. This workflow's own file is on the code side, which is the
# intended self-consistency: it cannot merge a change to itself.
#
# THE TRIAL-MERGE CHECK. `cortex.py check` is run on the branch tip (so audit
# mode reports something) and AGAIN on the merged tree, after `git merge
# --no-ff` and before `git push`. That second run is what catches the
# ruling-id race: two branches that both assign `R-<date>-03` each pass alone
# and fail merged. A failing check resets the trial merge and leaves the
# same-ledger race: two branches that each edit one project's ledger pass
# alone and can fail merged. A failing check resets the trial merge and leaves the
# branch for a human.

on:
Expand Down Expand Up @@ -148,14 +147,14 @@ jobs:
if [ "$RC" -ne 0 ]; then
echo "verdict=code" >> "$GITHUB_OUTPUT"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "**Left for a human** — this branch changes code, or edits a ruling, not just the ledger." >> "$GITHUB_STEP_SUMMARY"
echo "**Left for a human** — this branch changes code, or touches the archive, not just the ledger." >> "$GITHUB_STEP_SUMMARY"
else
echo "verdict=ledger" >> "$GITHUB_OUTPUT"
fi

# Structural drift on the branch tip BLOCKS. A task in a state its
# header contradicts, a dangling Supersedes:, a run line that does not
# parse — nothing heals that automatically, and merging it would put the
# Structural drift on the branch tip BLOCKS. A run line that does not
# parse, a log that is not newest-first, an active project with no
# ledger — nothing heals that automatically, and merging it would put the
# contradiction on main. Also the only check audit mode gets to report.
# `cortex.py` reads `projects.yaml` with PyYAML — its one dependency.
- name: dependencies
Expand Down Expand Up @@ -205,12 +204,12 @@ jobs:
exit 1
fi
# THE TRIAL-MERGE CHECK. The branch passed alone; does it pass
# merged? This is where two branches that both assigned the same
# ruling id, or both moved the same task, are caught.
# merged? This is where two branches that both wrote the same
# project's ledger are caught.
if ! python3 scripts/cortex.py check; then
git reset --hard origin/main
echo "::error::'$BRANCH' merges cleanly but 'cortex.py check' fails on the merged tree — left for a human"
echo "**Blocked** — \`$BRANCH\` fails \`cortex.py check\` once merged with main (a ruling-id or task-state race?); left for a human." >> "$GITHUB_STEP_SUMMARY"
echo "**Blocked** — \`$BRANCH\` fails \`cortex.py check\` once merged with main (two branches wrote the same ledger?); left for a human." >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
if [ -n "$PR" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages_dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name: Pages Dashboard
# `dashboard.md` (one census, two pages) and kept fresh by the same self-heal in
# `dashboard_refresh.yml`; this workflow only publishes it.
# Only the uploaded files reach Pages — nothing else in the repo, and in
# particular not `tasks/`, `rulings/` or `projects.yaml`, whose absolute laptop
# particular not `projects/` or `projects.yaml`, whose absolute laptop
# paths are not for a public site.

on:
Expand Down
Loading
Loading