Skip to content

maintenance: shed the review-slot and gate apparatus - #10

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/cortex-checkin-p1-shed-review-slot
Sep 4, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/cortex-checkin-p1-shed-review-slot

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Phase 1 of the cortex-checkin epic (ledger PyAutoMind/draft/maintenance/pyautocortex/cortex_checkin_epic.md), closing PyAutoCortex#9. Deletion only, plus the one decoupling the phase-2 door needs. Every historical record stays readable.

The 2026-09-03 assessment found the core right-sized and the review-slot apparatus unused: 0 slots opened by the conductor, 0 rulings from a packet, 0 partial reviews, review-minutes-actual never filled — all 22 rulings were reached in a live session. Gate grading saw 2 gated refs and flipped 0. rule --also was never used. Lane: read local-dev on 32 of 32 phases. The restricted-YAML parser's own PyYAML-parity test proved it redundant.

What went

  • Gate grading. .github/workflows/gates_grade.yml (the daily cron), GATE_JQ / _http_gate / fetch_gate_states / grade_gate and the --grade/--write half of gates_report, the Gates-cleared: / Gate-override: header keys and the three check invariants over them, and move --override. Kept: the plain Gates: header, the gated state, GATE_REF_RE / gate_url, and the read-only gates listing — which now also prints the URL each ref resolves to, because a human opening them is the whole mechanism. gated → ready is now cortex.py move <phase> ready, no flag.
  • rule --also — flag, fan-out, tests, docs.
  • Lane: — the schema, the check invariant, the new template, and one mechanical sweep over the 32 phase files and the fixtures. The fact it recorded (every phase runs on the laptop) now lives once, in AGENTS.md.
  • The restricted-YAML parser. parse_projects is yaml.safe_load plus the same field validation (required/optional field sets, status/partition enums, path shape, sync_verbs bare words). PyYAML is declared in cortex_check.yml — moved before the check step, not only before the tests — and in a new README requirements line.
  • The batch record + packet schema. batches/packets/ (TEMPLATE, AGENTS, three HTML pages), batch_problems / _review_section_problems / _record_members / _record_values and their grammars, the REFERENCE.md schema section, and the slot/shift/review-minute/partial-review vocabulary in batches/AGENTS.md and batches/reviews/AGENTS.md.

What stayed, deliberately

batches/2026-*.md and batches/reviews/*.md are kept as read-only history — 13 rulings cite the human's verbatim words in them. Both AGENTS.md files now say exactly that, and scripts/ledger_merge.py puts batches/ in APPEND_ONLY_DIRS beside rulings/: history, never modified, only added. (That is the answer to the prompt's "state which".) A ruling's Batch: is now optional-historical — where present it must still resolve to a batches/<slot>.md; nothing writes a new one.

projects.yaml and rulings/ are untouched — no projects.yaml change was needed for the PyYAML swap.

API Changes

scripts/cortex.py is a repo-local script, not a published API, but its CLI surface changed:

  • gates loses --grade and --write; it is read-only and offline.
  • rule loses --also.
  • move loses --override; gated → ready needs no flag, and ready → gated is now a hand edit rather than a refusal pointing at the retired grader.
  • parse_projects(text) keeps its (rows, problems) signature; _strip_comment/_scalar are gone. cortex.py now needs PyYAML — its one dependency.
  • Deleted module-level names other tools might import: GATE_JQ, _http_gate, fetch_gate_states, grade_gate, batch_problems, _record_members, _record_values, MEMBER_RE, SLOT_RE, REVIEW_PART_RE, LANE, HEALTHS, GATES_SETTLED_STATES, GRADED_STATES. The PyAutoBrain side of this epic (PyAutoBrain PR, same branch) is the only consumer and is updated with it.

Verification

  • python3 scripts/cortex.py check → OK.
  • pytest -q → 115 passed (134 before; the 19 fewer are the tests of the deleted things).
  • The dashboard is regenerated from inside this checkout against this branch's Brain worktree; dashboard --check is current. It loses the batch status box and the two blurbs that named the retired grader.
  • Schema decision 58 appended to docs/schema_decisions.md with the measurements above.

Left alone

rulings/AGENTS.md still documents rule --also in one sentence. rulings/ is append-only and was declared out of bounds for this phase; it is a one-line doc fix for whoever next touches that file.

Merge order: PyAutoBrain#348 first, then this one. They are one change on one branch name, and the dependency runs that way: dashboard_refresh.yml here renders through PyAutoBrain main, so until #348 lands, this PR's refresh check runs the old conductor against the new script and fails on the MEMBER_RE this PR deletes. The other direction is safe — the new conductor works against either script. check (cortex.py check + pytest) is green on the branch's own tree.

🤖 Generated with Claude Code

https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6

Jammy2211 and others added 2 commits September 3, 2026 19:37
Gate grading, the batch record and packet schema, `rule --also`, the `Lane:`
header and the hand-rolled restricted-YAML parser are deleted. Phase 1 of the
`cortex-checkin` epic; deletion only, and every historical record stays
readable.

Measured, not preferred: gate grading saw 2 gated refs and flipped 0 in its
lifetime while schema decision 54 already routes sequencing through prose
`Ready when:` lines; the review-slot apparatus opened 0 conductor slots,
produced 0 rulings from a packet and 0 partial reviews, and never filled
`review-minutes-actual`; `rule --also` was never used; `Lane:` read
`local-dev` on 32 of 32 phases; and the restricted parser's own PyYAML-parity
test proved it redundant.

Kept: the plain `Gates:` header, the `gated` state and the read-only `gates`
listing (which now prints each ref's URL) — a gated phase is moved on by a
human typing `move <phase> ready`. `batches/` and `batches/reviews/` stay as
read-only history, cited by 13 rulings, and join `rulings/` in
`ledger_merge.py`'s append-only set: never modified, only added. A ruling's
`Batch:` becomes optional-historical.

`projects.yaml` is read with `yaml.safe_load` and the field validation is
unchanged; PyYAML is declared in `cortex_check.yml` (before the check step,
not only before the tests) and in the README.

check OK; pytest 115 passed (134 before); dashboard regenerated.
Schema decision 58 records the measurements.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6
`cortex.py` reads `projects.yaml` with PyYAML now, and two more workflows run
it: `dashboard_refresh.yml` (through the Brain conductor, which imports the
script at runtime) and `ledger_merge.yml`'s trial-merge `check`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6
@Jammy2211

Copy link
Copy Markdown
Contributor Author

Expected red until the Brain PR merges. The refresh check runs dashboard --check through PyAutoBrain's cortex conductor, checked out at main — that copy still calls mod.MEMBER_RE, which this PR deletes. The workflow's own comment names this case ("a Brain/Cortex version skew"). PyAutoBrain#348 is the other half of this change on the same branch name; merge it first and re-run refresh here.

The check job (cortex.py check + pytest) is green on the branch's own tree.

Follow-up commit beec64c declares pyyaml in dashboard_refresh.yml and ledger_merge.yml too — both run cortex.py, which now reads projects.yaml with PyYAML.

Conflicts were confined to the two generated pages (dashboard.md,
dashboard.html), which main's self-heal commit re-rendered on 2026-09-04.
Resolved by regenerating both with the phase-1 renderer (PyAutoBrain main at
fc1cb32, which now carries this branch's conductor via PyAutoBrain#348)
rather than hand-resolving them.

phases/euclid/dr1_prelim_10_lens_science_run.md auto-merged: main's gate flip
(State: ready) is kept; the `Gates-cleared:` key main's grading cron wrote is
dropped, because this branch retires that header key along with gate grading
itself (schema decision 58). `cortex.py check` is OK and `dashboard --check`
reports the pages current.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5Gw7BLNRB7crfHib9FwZY
@Jammy2211
Jammy2211 merged commit 6cd6220 into main Sep 4, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/cortex-checkin-p1-shed-review-slot branch September 4, 2026 14:19
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