Skip to content

feat: the release-validation freeze flag (pyauto-heart freeze) - #197

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/mind-post-cortex-p5-heart-freeze
Sep 3, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/mind-post-cortex-p5-heart-freeze

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes part of #196 — phase 5 (last) of the mind-post-cortex epic (assessment gap 6). Heart owns the flag. Companions: PyAutoLabs/PyAutoBrain#347 (the three read surfaces) and PyAutoLabs/PyAutoHands#275 (the pre_build call site).

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 already knows that window exists — it is the organ that ingests the evidence — but nothing said so to the surfaces that merge things. This is that sentence:

FROZEN: release validation until 2026-09-03T19:30:00+00:00

What changed

heart/freeze.py + a freeze verb (pyauto-heart freeze):

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

writing $HEART_STATE_DIR/freeze.json — {reason, set_at, until, set_by} — beside the other sidecars, atomically, Heart the only writer.

  • --until is mandatory. A freeze with no expiry never clears, so there is no way to take one out by accident. Past until the flag reads as clear for every consumer while --show reports expired, so a forgotten set stays visible instead of vanishing. An unreadable or expiry-less file also reads as clear: a freeze nobody can parse must not be able to block a merge.
  • Exit codes are the shell gate. A read exits 3 while active, 0 when clear or expired, 2 on usage error — one call, no JSON parse. --set always exits 0, so a driver under set -e does not abort on the freeze it just took out itself.

The call sites, added not just described:

Where What
validate --ingest clears it — the evidence landing is the end of the window. Never on --out (an inspection path), never on the read-only path.
skills/review_release reads it during triage and clears a freeze the ingest did not (a rehearsal that never ingested, a failed live run). Never while the run is still in progress.
PyAutoHands/skills/pre_build sets it before dispatching — the companion PR.
the nightly release run not wired, deliberately: it runs unattended in CI, where this dev-box state file does not exist. Documented in REFERENCE.md rather than edited blind.

REFERENCE.md gains the CLI row, the state-file entry and one "The release freeze window" section carrying the schema, the expiry rule, the call-site table and the readers.

The judgement call: readiness is untouched

The prompt says the flag is "advice-with-teeth for /prm only — no other skill blocks on it". Folding it into readiness's colour or reason lists would contradict that directly: every ship gate, every release gate and every conductor consults that verdict, so a freeze would block all of them. So heart/readiness.py is not touched and compute() stays a pure function of the snapshot. The flag is a separate, live read. Readiness answers is the organism healthy; the freeze answers is a validation window open right now.

Tests

python3 -m pytest -q → 679 passed (was 657). 19 new in tests/test_freeze.py (the four fields on disk, the three readings, expiry, a past --until refused, a reason required, the duration and ISO forms of --until, zoneless-is-UTC, all four exit codes, the --json Brain reads, --set+--clear refused, --set without --until refused and writing nothing) and 3 in tests/test_validate.py (ingest clears; --out does not; the read-only path does not).

Heart

pyauto-heart readiness is RED at PR-open: PyAutoLens: CI failure, release validation FAILED (stage integrate), PyAutoArray: open PR 11d old. None touches this diff — a new module, a CLI verb, one ingest-side clear and docs; no library source, no release surface. The RED is not acknowledged for this task (the acknowledgement given earlier today was scoped to other tasks), so merge needs the human's own call.

🤖 Generated with Claude Code

https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6

A release validation is a window in which the library `main` branches must not
move: a merge landing inside it invalidates the evidence and restales the
rehearsal (~75 minutes, measured 2026-08-29). Heart already knew the window
existed — it is the organ that ingests the evidence — but nothing said so to
the surfaces that merge things.

- `heart/freeze.py` + a `freeze` verb: `--set "<reason>" --until <90m|2h|ISO>`,
  `--clear`, `--show [--json]`, writing `$HEART_STATE_DIR/freeze.json` with
  `{reason, set_at, until, set_by}`. `--until` is mandatory, so a freeze with
  no expiry cannot be taken out by accident; past it the flag reads as clear
  for every consumer while `--show` reports "expired", so a forgotten set stays
  visible. An unreadable or expiry-less file also reads as clear: a freeze
  nobody can parse must not be able to block a merge.
- A read exits 3 while active and 0 otherwise, so `freeze --show` is a one-call
  shell gate; `--set` always exits 0 so a driver under `set -e` does not abort
  on the freeze it just took out.
- `validate --ingest` clears it: the evidence landing IS the end of the window.
  Never on `--out`, which is an inspection path, and never on the read-only
  path.
- `review_release` reads it while triaging and clears a freeze the ingest did
  not (a rehearsal that never ingested, a failed live run).

The readiness verdict is deliberately untouched. A freeze is not a health
problem, and folding it into the colour would make every ship and release gate
in the organism block on it; it is advice, with teeth in exactly one place
(`/prm`'s merge gate, library repos only — PyAutoBrain side, separate PR).

Refs #196.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6
@Jammy2211
Jammy2211 merged commit 4b87304 into main Sep 3, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/mind-post-cortex-p5-heart-freeze branch September 3, 2026 22:24
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