Skip to content

fix(release): nightly driver never runs Heart's rehearsal-ancestry check #721

Done

Description

@Jammy2211

Overview

The scheduled-nightly release driver (agents/conductors/release/nightly.sh) builds its Heart readiness snapshot without running heart.checks.rehearsal_ancestry. Whenever a library main moves during the ~1h validation window, Heart's release-ci gate cannot prove the rehearsed commits are ancestors of main and returns STALE ("source moved since rehearsal (…; ancestry unproven)"), so no release ships. This defeats M2.4 (PyAutoHands#337), under which a forward-moved main keeps the rehearsal fresh.

Evidence: nightly runs 45155720996 (11-23), 45390127904 (11-24), 45599731441 (11-25) all stopped STALE this way; NIGHTLY_LAST_WINDOW_END has been stuck at 2026-11-22T09:26:59Z. On 11-25, 13 library commits landed on main between 10:55 and 11:32 UTC, inside the validation window.

Plan

  • Run Heart's rehearsal-ancestry check in the nightly's step 4c, after the validation ingest and before the snapshot is aggregated.
  • A failed check is logged and the run continues (as with ci_status); readiness then reads the moved repos as unproven, i.e. STALE, so it can never be worse than today.
  • Add a regression test pinning the call and its order.
  • Tier + merge mode: effective level: supervised; merge mode: human /prm.
Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary)

Branch Survey

Repository Current Branch Dirty?
./organs/PyAutoBrain main clean

Other active PyAutoBrain claims (digest-review-table, parked-hold-grace, pyautodna-stack-management, readme-preservation) touch no file under agents/conductors/release/ or its tests.

Suggested branch: feature/nightly-rehearsal-ancestry

Implementation Steps

  1. agents/conductors/release/nightly.sh step 4c: after the "$heart" validate --ingest … block and before state.aggregate(), add
    PYTHONPATH="$HEART_DIR" python3 -m heart.checks.rehearsal_ancestry || echo "nightly: rehearsal_ancestry check failed (moved repos read as unproven)" >&2.
    The check reads validation_report.json (written by the ingest) and *.ci_status.json from $HEART_STATE_DIR, writes rehearsal_ancestry.json, which state.aggregate folds in. Its gh compare calls are bounded at 20s total; the token was refreshed just before ci_status. Update the step-4 header comment.
  2. tests/test_release_rehearsed_shas.py: static assertion (same style as test_nightly_uses_the_record_not_main_heads) that nightly.sh invokes heart.checks.rehearsal_ancestry after validate --ingest and before state.aggregate. Fails on current main.
  3. Verify: bash -n, Brain test suite, and a local run of the Heart check against a fixture HEART_STATE_DIR to confirm it writes the sidecar the aggregate reads.
  4. Ship via /ship_library; human merges with /prm. Real proof is the next scheduled nightly with mid-window merges reporting ahead_by instead of unproven.

Key Files

  • agents/conductors/release/nightly.sh — step 4c snapshot assembly
  • tests/test_release_rehearsed_shas.py — nightly caller-contract tests
  • (read-only) PyAutoHeart heart/checks/rehearsal_ancestry.py, heart/readiness.py ~L665-701, heart/tick.sh:59

Original Prompt

Click to expand starting prompt

Nightly release driver never runs Heart's rehearsal-ancestry check

Type: bug
Target: PyAutoBrain
Repos:

  • PyAutoBrain
    Difficulty: small
    Autonomy: supervised
    Consequence: judge
    Priority: high
    Status: draft
    Filed: 2026-11-25
    Lane: any

Bug fix in PyAutoBrain: the scheduled-nightly release driver
(agents/conductors/release/nightly.sh, step 4c "ingest + assemble the CI readiness
snapshot", lines ~403-420) never runs PyAutoHeart's heart.checks.rehearsal_ancestry
check before state.aggregate(). So whenever a library main moves during the ~1h
validation window, Heart's release-ci gate reports STALE "release validation stale:
source moved since rehearsal (...; ancestry unproven)" and the nightly stops, even though
M2.4 (PyAutoHands#337) says a forward-moved main stays fresh when ancestry is proven.

Evidence: nightly runs 45155720996 (11-23), 45390127904 (11-24), 45599731441 (11-25) on
PyAutoLabs/PyAutoBrain all stopped STALE this way; NIGHTLY_LAST_WINDOW_END stuck at
2026-11-22T09:26:59Z. heart/tick.sh:59 already runs
python3 -m heart.checks.rehearsal_ancestry.

Fix: run the ancestry check in step 4c after ci_status/ingest and before aggregate
(non-fatal on failure, like ci_status), plus a test. Human approved routing this through
start_dev on 2026-11-25.

Activity

  1. Jammy2211 commented on Nov 25, 2026

    @Jammy2211
    ContributorAuthor

    Library PR created: #722 (a586b11). Verified: bash -n; new ordering test passes on branch and fails on main; full Brain suite 2506 passed / 1 skipped; Heart ancestry module on a fixture state dir with the 2026-11-25 pattern proved PyAutoFit (ahead 3) and PyAutoLens (ahead 8) as ancestors. No workspace impact. Tier judge — awaiting human /prm.

  2. Jammy2211 commented on Nov 25, 2026

    @Jammy2211
    ContributorAuthor

    Shipped: #722 merged (8b7a3ce). The nightly driver now runs Heart's rehearsal-ancestry check in step 4c, after the ingest and before aggregate, so a library main that moved forward from the rehearsed commit reads as fresh instead of "ancestry unproven". First live proof: the next scheduled nightly with mid-window merges.

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