Skip to content

feat: Heart freeze flag — make the library-main validation window visible to /prm and batch #196

Closed

Description

@Jammy2211

Overview

Phase 5 (last) of the mind-post-cortex epic — assessment gap 6. A library merge
landing mid-validation restales Heart and costs ~75 minutes, but nothing tells a
/prm run or a batch member "library mains are frozen for the next N minutes".
This adds a Heart-owned freeze flag with its own CLI verb, and three read-only
Brain surfaces that show it — one of which (/prm) actually stops on it, for
library repos only.

Prompt: PyAutoMind/active/mind_post_cortex_p5_heart_freeze_flag.md.
Epic ledger: PyAutoMind/draft/maintenance/pyautomind/mind_post_cortex_epic.md.

Decision taken by the architect (reverse before merge if disagreed)

The prompt names one human-required decision: may /prm override an active
freeze with an explicit --thaw?
Adopted per the prompt's own recommendation:
yes, with the override logged. /prm --thaw "<why>" merges a library PR
through an active freeze and appends one row to PyAutoMind/autonomy_log.md
under a new Freeze overrides section (no new log file):

| date | task / PR | freeze reason | until | thawed by | why |

This was decided by the architect on the prompt's recommendation, not by a
human. Reverse it before merge if you disagree — the change is confined to the
--thaw bullets in skills/prm/prm.md and the section in autonomy_log.md.

Plan

  • Heart owns the flag. A new pyauto-heart freeze verb writes/reads/clears
    $HEART_STATE_DIR/freeze.json (~/.pyauto-heart/freeze.json) carrying
    {reason, set_at, until, set_by}. Expiry is by until: an expired flag reads
    as clear and --show says so, so a forgotten set is visible rather than
    permanent.
  • Real call sites, not just a verb. pyauto-heart validate --ingest clears
    the freeze when it persists a validation report (that ingest is the end of
    the window). review_release gains the check-and-clear step; the Hands
    pre_build skill gains the set-at-dispatch / clear-at-review step; the
    nightly release run is documented rather than edited (it is CI YAML).
  • Brain reads it, three surfaces. The vitals faculty prints
    FROZEN: <reason> until <ts> as a warning line; /prm gains a merge-gate leg
    that stops on a library-repo PR while the freeze is active (--thaw
    overrides, logged); batch collect's summary and report carry one line, and
    the status-box renderer gains the same line as a caller-supplied fact.
  • Heart's verdict is deliberately unchanged. The freeze does not enter
    readiness's colour or reason lists — that would make every ship and release
    gate block on it, contradicting the prompt's "advice-with-teeth for /prm
    only". It is a separate, live read.
  • Three PRs: PyAutoHeart (flag + CLI + call sites + tests), PyAutoBrain (the
    three read surfaces + tests), PyAutoHands (one pre_build call-site step).
Detailed implementation plan

Work Classification

Library / Workspace / Both → neither: three organ repos (Heart, Brain,
Hands). Shipped through start_library / ship_library as the organ-repo path.

Affected Repositories

  • PyAutoHeart (primary) — the flag, the verb, its call sites
  • PyAutoBrain — vitals, /prm, batch (read-only consumers)
  • PyAutoHands — one step in skills/pre_build/pre_build.md
  • PyAutoMind — ledger only (active.md, autonomy_log.md section); auto-merges

Branch Survey

Repository Current Branch Dirty?
./PyAutoHeart main clean
./PyAutoBrain main clean
./PyAutoHands main clean
./PyAutoMind main dirty (another session's staged ledger move — untouched)

Suggested branch: feature/mind-post-cortex-p5-heart-freeze
Worktree root: ~/Code/PyAutoLabs-wt/mind-post-cortex-p5-heart-freeze/

worktree_check_conflict exits 1: sibling phases p2/p3/p4 of this same epic
claim PyAutoBrain and PyAutoHeart. Known parallel claim, disjoint files —
recorded as a parallel-claim: line on the active.md row, verified by
git merge-tree against each sibling branch before ship.

Implementation Steps

PyAutoHeart

  1. heart/freeze.py (new) — read(now), set_freeze(reason, until, set_by),
    clear(), render_line(), main(argv). State file
    $HEART_STATE_DIR/freeze.json, written with state.atomic_write_json.
    --until accepts an ISO-8601 timestamp or a <N>m / <N>h duration.
    --show exits 3 while a freeze is active and 0 when clear or expired, so a
    shell gate needs no JSON parse; --json for programmatic readers.
  2. bin/pyauto-heart — freeze verb: SUBCOMMAND_ORDER, SHORT_DESC,
    help_freeze, cmd_freeze (delegates to python3 -m heart.freeze).
  3. heart/validate.py — clear the freeze when --ingest persists a report.
  4. skills/review_release/review_release.md — the freeze check/clear step.
  5. REFERENCE.md — CLI row, the state-file entry, and one "Release freeze
    window" section: schema, expiry, every call site, and who reads it.
  6. tests/test_freeze.py (new) + one tests/test_validate.py case.

PyAutoBrain

  1. agents/faculties/vitals/AGENTS.md + vitals.sh — read
    pyauto-heart freeze --show --json and print FROZEN: <reason> until <ts>
    as a warning; state explicitly that the verdict colour is unchanged.
  2. skills/prm/prm.md (+ reference.md) — the freeze gate leg in section 4,
    the --thaw flag in Usage, the guard bullet in section 6, and the
    autonomy_log.md row format.
  3. agents/conductors/batch/_status.py — freeze_line() (the one wording) and
    an optional caller-supplied freeze fact rendered in both renderers.
    _intake.py deliberately does not supply it: the dashboard is a
    committed artifact and CI regenerates it with no Heart state, so a live
    freeze would read as dashboard drift.
  4. agents/conductors/batch/_batch.py — heart_freeze() reader (honours
    expiry) + one line in collect_report() and emit_collect().
  5. tests/test_batch_status.py / tests/test_batch_collect.py additions.

PyAutoHands

  1. skills/pre_build/pre_build.md — set the freeze before the dispatch step,
    and say who clears it (review_release, or the ingest, or expiry).

Key Files

  • PyAutoHeart/heart/freeze.py — the flag (new)
  • PyAutoHeart/bin/pyauto-heart — the freeze verb
  • PyAutoHeart/heart/validate.py — auto-clear at ingest
  • PyAutoBrain/agents/conductors/batch/_status.py / _batch.py — the box + collect lines
  • PyAutoBrain/skills/prm/prm.md — the gate leg and --thaw
  • PyAutoBrain/agents/faculties/vitals/{AGENTS.md,vitals.sh} — the warning line
  • PyAutoHands/skills/pre_build/pre_build.md — the set call site

Original Prompt

Click to expand starting prompt

Heart freeze flag: make the library-main validation window visible to /prm and batch members

Type: feature
Target: pyautoheart
Repos:

  • PyAutoHeart
  • PyAutoBrain
    Themes:
  • mind-workflow
    Difficulty: medium
    Autonomy: supervised
    Priority: normal
    Status: draft
    Consequence: judge
    Witness: pyauto-heart freeze --set "release validation" --until <ts> writes state/freeze.json; pyauto-brain vitals prints the freeze with its reason and expiry; /prm on a library PR while the freeze is active stops with the freeze message instead of merging (workspace/organ PRs unaffected); batch collect/status box show the freeze line; the flag clears itself past --until and on --clear; Heart and Brain tests cover set/clear/expiry
    Review-minutes: 20
    Unattended: ready
    Epic: mind-post-cortex
    Phase: 5
    Filed: 2026-09-03

Phase 5 of mind-post-cortex — assessment gap 6. Two PRs: Heart (the flag
and its CLI) and Brain (vitals faculty, /prm gate leg, batch status line).

Why

A library merge landing mid-validation restales Heart and costs ~75 minutes
(memory: feedback_library_merge_mid_validation_restales_heart, 2026-08-29).
heart-ack: is recorded per task and per shift, but nothing tells a member or
a /prm run "library mains are frozen for the next N minutes".

Design

  • Heart owns the flag: state/freeze.json {reason, set_at, until, set_by}
    written by a new freeze verb on the Heart CLI (--set, --until,
    --clear, --show). The release/validation drivers (review_release,
    pre_build, the nightly release run) set it at validation start and clear
    it at the end; document the exact call sites and add them.
  • Brain reads it: the vitals faculty prints it as a YELLOW reason
    (FROZEN: <reason> until <ts>); /prm adds it as a gate leg before merge
    for PRs whose repo is in LIBRARY_REPOS (organ and workspace repos are not
    gated); the batch status box and batch collect summary carry one line.
    The flag is advice-with-teeth for /prm only — no other skill blocks on it.
  • Expiry is by until; a stale flag past expiry reads as clear, and --show
    says "expired" so a forgotten set is visible.

Human-required decision to surface in the plan: whether /prm may override
with an explicit --thaw (recommended: yes, logged to autonomy_log.md).

Activity

  1. Jammy2211 commented on Sep 3, 2026

    @Jammy2211
    ContributorAuthor

    Shipped to PR-open — three PRs, merge stays human

    Repo PR Base What
    PyAutoHeart #197 main heart/freeze.py + the freeze verb, validate --ingest clears, review_release checks, REFERENCE.md
    PyAutoBrain #347 main vitals line, /prm merge-gate leg + --thaw, batch collect/status-box line
    PyAutoHands #275 main pre_build step 1b — the set call site

    Branch feature/mind-post-cortex-p5-heart-freeze in all three; worktree ~/Code/PyAutoLabs-wt/mind-post-cortex-p5-heart-freeze.

    Merge order: PyAutoHeart#197 first (it ships the verb the other two document), then the other two in either order.

    The CLI, as built

    pyauto-heart freeze [--show] [--json]                     # default action
    pyauto-heart freeze --set "<reason>" --until <90m|2h|1d|ISO-8601> [--set-by WHO]
    pyauto-heart freeze --clear
    

    $HEART_STATE_DIR/freeze.json → {reason, set_at, until, set_by}. --until mandatory; expired reads as clear everywhere while --show says expired; a read exits 3 while active, 0 otherwise (--set always 0, for set -e drivers).

    Spelling note: the prompt wrote state/freeze.json. That is Heart's state directory (~/.pyauto-heart/), not the repo's state/ folder — writing into the checkout would break the observer rule and dirty the repo. Same file, resolved the only way that is consistent with the rest of Heart.

    Two judgement calls to know about

    1. Heart's readiness verdict is untouched. Folding the freeze into the colour or the reason lists would make every ship and release gate block on it, contradicting the prompt's "advice-with-teeth for /prm only". It is a separate, live read.
    2. The dashboard does not carry the line. _status.py renders it only when a caller supplies it, and the Mind dashboard renderer deliberately does not: that page is a committed artifact regenerated in CI, where the dev box's Heart state does not exist, so a live freeze would read as dashboard drift on the next --check. batch collect (terminal, on the box that holds the state) does supply it.

    The --thaw decision — taken by the architect, reversible

    Answered per the prompt's own recommendation: yes, /prm --thaw "<why>" overrides, logged — one row appended to PyAutoMind/autonomy_log.md under a ## Freeze overrides heading created on first use (no new log file):

    | date | task / PR | freeze reason | until | thawed by | why |
    

    Decided by the architect on the prompt's recommendation, not by a human — reverse before merge if you disagree. It is confined to the --thaw bullets in skills/prm/prm.md (§4 item 1, the Usage line, the §6 guard) and the mirror in skills/prm/reference.md. The section is not pre-created in autonomy_log.md on purpose: a Mind ledger push auto-merges to main and would land the decision ahead of its review.

    Tests

    • PyAutoHeart pytest -q: 679 passed (19 new test_freeze.py, 3 new in test_validate.py).
    • PyAutoBrain pytest -q: 872 passed, 1 failed — the pre-existing worktree-only test_cortex_conductor::test_a_fixture_tree_finds_the_schema_its_checkout_ships. 12 new in test_batch_freeze.py.
    • PyAutoHands: docs only.

    git merge-tree against the p3 and p4 sibling branches: 0 conflicts in Brain (against both) and in Heart (against p3).

    Heart at ship

    RED, unacked, unrelated: PyAutoLens: CI failure, release validation FAILED (stage integrate), PyAutoArray: open PR 11d old. No library source and no release surface in this diff. Merge needs the human's own call.

    This is the last phase of the mind-post-cortex epic.

  2. Jammy2211 commented on Sep 3, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    Phase 5 (last) of the mind-post-cortex epic. All three PRs merged 2026-09-03 after
    origin/main was merged into each branch and CI re-judged on the new heads (every run,
    every leg green).

    PR merge commit
    #197 4b873047
    PyAutoLabs/PyAutoBrain#347 67971f21
    PyAutoLabs/PyAutoHands#275 128d9a1d

    Merged in that order — Brain reads the freeze verb Heart ships.

    What landed

    • PyAutoHeart — heart/freeze.py (new): ~/.pyauto-heart/freeze.json carrying
      {reason, set_at, until, set_by}, expiry by until so a forgotten set reads as
      clear and --show says "expired". New pyauto-heart freeze verb
      (--set/--until/--clear/--show). validate --ingest clears the freeze when it
      persists a report. review_release gained the check-and-clear step. Tests:
      tests/test_freeze.py + tests/test_validate.py additions.
    • PyAutoBrain — three read surfaces: the vitals faculty prints
      FROZEN: <reason> until <ts>, /prm gained a merge-gate leg that stops on a
      library-repo PR while the freeze is active (--thaw "<why>" overrides, logged to
      autonomy_log.md → Freeze overrides), and batch collect / the status-box
      renderer carry the same line. tests/test_batch_freeze.py.
    • PyAutoHands — pre_build sets the freeze at dispatch and clears it at review.

    Heart's readiness verdict is deliberately unchanged: the freeze is a separate live
    read, advice-with-teeth for /prm only.

    Decision confirmed at merge. The architect's --thaw answer (yes, with the
    override logged) was not reversed before merge.

    Heart at merge. The task's heart-note recorded three unacked RED reasons
    (PyAutoLens CI failure, release validation FAILED at stage integrate, PyAutoArray open
    PR 11d old). None touches this diff — one new Heart module and CLI verb, one
    ingest-side clear, skill/doc files and their tests; no library source, no release
    surface. The merge was the human's own /prm call.

    Record: PyAutoMind/complete/2026/09/mind-post-cortex-p5-heart-freeze.md.
    With this phase the mind-post-cortex epic is COMPLETE (all five phases shipped) and
    its ledger is archived to PyAutoMind/complete/archive/epics/mind_post_cortex_epic.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions