Repository navigation
Description
Overview
A ledger auto-merge that adds or retires a project (e.g. 09a0de6, the sdssj0946_subhalo_v2 birth, 2026-11-26) leaves Cortex main red: ledger_merge.yml pushes with GITHUB_TOKEN and dispatches cortex_check.yml and pages_dashboard.yml, but never dashboard_refresh.yml, so dashboard.md stays stale until the 03:35 cron. While main is red, later ledger merges and PRs (e.g. #102) inherit the failure.
Plan
- After a merge,
ledger_merge.ymldispatches the dashboard refresh instead of the check. dashboard_refresh.ymldispatches the Cortex Check itself, so the check always sees a healed board.- A text test guards both hand-offs.
- Result: main is red for minutes after a birth, not until the nightly cron.
Effective level: human-required; merge mode: auto-merge on green if the Witness passes.
Detailed implementation plan
Affected Repositories
- PyAutoCortex (primary)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| organs/PyAutoCortex | main | clean |
Suggested branch: feature/cortex-ledger-merge-refresh
Implementation Steps
.github/workflows/ledger_merge.yml, step "Run the check on main and publish the board": dispatchdashboard_refresh.ymlon main instead ofcortex_check.yml; drop the now-redundantpages_dashboard.ymldispatch (the refresh publishes on both paths); update the comments and theactions: writenote. Both workflows share thecortex-main-writersconcurrency group, so the refresh runs after this run's push..github/workflows/dashboard_refresh.yml: after a successful heal push, also dispatchcortex_check.ymlon main (the heal push isGITHUB_TOKEN, so nothing checks it today). On the fresh path, dispatchcortex_check.ymlonly forworkflow_dispatch/scheduleevents, so a board-neutral ledger merge still gets its merge commit checked. PR runs still never dispatch.tests/test_ledger_merge.py: add a text assertion thatledger_merge.ymldispatchesdashboard_refresh.ymlanddashboard_refresh.ymldispatchescortex_check.yml.- Run the Cortex tests; after merge, show the Witness with run links from one birth (or audit-mode ledger_merge + manual refresh).
Key Files
.github/workflows/ledger_merge.yml— merge-and-dispatch step.github/workflows/dashboard_refresh.yml— heal and dispatchtests/test_ledger_merge.py— workflow text tests
Original Prompt
Click to expand starting prompt
Cortex ledger auto-merge leaves main red after a project birth — ledger_merge.yml never dispatches dashboard_refresh.yml
Type: bug
Target: pyautocortex
Repos:
- PyAutoCortex
Themes: - cortex
- ci
Difficulty: easy
Autonomy: safe-capped
Priority: high
Status: draft
Consequence: glance
Witness: After aclaude/birth-*ledger branch auto-merges vialedger_merge.yml,dashboard_refresh.ymlruns on main without a human dispatch, healsdashboard.md/dashboard.html/state.json, and the Cortex Check on the resulting main tip is green — shown by the run links of one real or test birth after the change.
Review-minutes: 2
Unattended: ready
Lane: any
Filed: 2026-11-26
Updated: 2026-11-26
Request (verbatim)
"Draft a start_dev prompt to make ledger_merge.yml trigger dashboard_refresh" — the permanent fix
for the Cortex main-red found in the 2026-11-26 orchestrator PR sweep.
Finding
2026-11-26 17:27, PyAutoCortex 09a0de6 ("cortex: auto-merge ledger branch
claude/birth-sdssj0946_subhalo_v2") added projects/sdssj0946_subhalo_v2.md and its
projects.yaml row, but did not re-render the board. Cortex Check on main then failed:
FAILED tests/test_cortex.py::test_the_committed_board_files_each_project_under_its_folders_kind
AssertionError: sdssj0946_subhalo_v2 is not in its active section
The same thing happened at 17:14 after the erc_angular_structure birth (23ec5b5); a later
push happened to heal it. While main is red, later ledger merges and PRs (e.g. Cortex#102) inherit
the failure.
Cause
ledger_merge.yml pushes the merge with GITHUB_TOKEN, which triggers no workflows. Its final
step ("Run the check on main and publish the board") explicitly dispatches cortex_check.yml and
pages_dashboard.yml — but not dashboard_refresh.yml. So a ledger merge that changes the board
(a birth, retirement or status move) leaves dashboard.md stale until the 03:35 cron or another
push. Manual heal used on 2026-11-26: gh workflow run dashboard_refresh.yml --ref main, then
gh workflow run cortex_check.yml --ref main (the heal push is also GITHUB_TOKEN, so it does
not trigger Cortex Check either).
Fix sketch
- In
ledger_merge.yml's final step, dispatchdashboard_refresh.ymlon main (it already
dispatches Pages after its own heal push). - Ordering:
cortex_check.ymldispatched at the same moment would check the stale tip and fail.
Either havedashboard_refresh.ymldispatchcortex_check.ymlafter its heal push (it has
actions: writesemantics to add if missing), or drop the direct check dispatch from
ledger_merge.ymland let the refresh own "check main after heal". Keep the no-op path: when
the board is already fresh, the refresh should still dispatch the check so the merge commit is
checked. - Confirm
dashboard_refresh.ymldeclaresworkflow_dispatch(it does, line ~48) and the
actions: writepermission it needs to dispatch.
Activity
Jammy2211 commentedon Nov 26, 2026
Shipped in #104 (merge
cca40ce).ledger_merge.ymlnow dispatchesdashboard_refresh.ymlafter a landed merge (falls back tocortex_check.ymlif that dispatch fails).dashboard_refresh.ymldispatchescortex_check.ymlafter a heal push, and on a fresh tip for dispatched/scheduled runs.Witness still to show: the next birth/retirement ledger merge (e.g. #102 after its board is regenerated) should leave main green with no manual dispatch — add the ledger_merge → dashboard_refresh → cortex_check run links here.
Jammy2211 commentedon Nov 26, 2026
Witness shown (2026-11-26), with no manual dispatch after the trigger push:
claude/run-adapt_snr_cap-416981(main merged in after adapt_snr_cap: partition gpu → both, so its RAL ledger branches can land #105) → ledger_merge 45876337369 auto-merged it asbb0bd41and left the board stale.4aa03d9.4aa03d9; Pages republished from4aa03d9.The fresh-tip path was shown earlier: refresh 45875106025 → check 45875130384 green.