Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions agents/conductors/release/nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
# step 4 validate validate.sh Phases A→C — the emitted dispatch
# plans are EXECUTED here with `gh` (in CI, unlike
# the MCP-only cloud sessions the plans were written
# for, gh is available to bash)
# step 5 gate vitals faculty → `pyauto-heart readiness
# for, gh is available to bash); 4c ingests, runs
# Heart's rehearsal-ancestry check, then aggregates
# step 5 gate vitals faculty → `pyauto-heart readiness
# --profile release-ci` — GREEN only; STALE/YELLOW/
# RED stop and page; there is NO force input
# step 6 live release dispatch Build's release.yml (rehearsal=false,
Expand Down Expand Up @@ -413,6 +414,14 @@ bash "$HEART_DIR/heart/checks/open_prs.sh" || echo "nightly: open_prs check fail
page "could not ingest the validation artifacts into Heart"
exit 1
}
# M2.4 (PyAutoHands#337): a library main that moved FORWARD from the rehearsed
# commit keeps the rehearsal fresh, but only when this check proves the
# ancestry (it reads the ingested validation_report + ci_status, writes the
# rehearsal_ancestry sidecar that aggregate folds in). Without it every merge
# during the validation window read as "ancestry unproven" → STALE (#721).
# A failure is non-fatal: the moved repos stay unproven, i.e. STALE.
PYTHONPATH="$HEART_DIR" python3 -m heart.checks.rehearsal_ancestry \
|| echo "nightly: rehearsal_ancestry check failed (moved repos read as unproven)" >&2
PYTHONPATH="$HEART_DIR" python3 -c "from heart import state; state.aggregate()" || {
page "could not aggregate the Heart snapshot"
exit 1
Expand Down
14 changes: 14 additions & 0 deletions tests/test_release_rehearsed_shas.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ def test_nightly_uses_the_record_not_main_heads():
assert '{"rehearsal": "false", "minor_version": "1"}' not in NIGHTLY


def test_nightly_proves_rehearsal_ancestry_before_aggregate():
# PyAutoBrain#721: without the ancestry sidecar, Heart reads any main that
# moved during the validation window as "ancestry unproven" → STALE.
# The check needs the ingested validation_report, and aggregate must fold
# its sidecar in, so the order is ingest → ancestry → aggregate.
ingest = NIGHTLY.index('"$heart" validate --ingest "$ART_DIR"')
ancestry = NIGHTLY.index("python3 -m heart.checks.rehearsal_ancestry")
aggregate = NIGHTLY.index("state.aggregate()")
assert ingest < ancestry < aggregate
# Non-fatal, like ci_status: a failure leaves the repos unproven (STALE).
line = NIGHTLY[ancestry:NIGHTLY.index("\n", NIGHTLY.index("\n", ancestry) + 1)]
assert "|| echo" in line


# --- rehearse.sh ingest: the record is the commit_shas authority -----------------------

def _fake_heart(tmp_path, log):
Expand Down
Loading