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
37 changes: 35 additions & 2 deletions .github/workflows/workspace-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,26 @@ jobs:
python3 "$(pwd)/../PyAutoHands/autohands/run_python.py" \
"$SHARD_PROJECT" "$@" \
--report-dir test-results
- name: "Checkout PyAutoHeart (Stage 3 quarantine) [mode=release]"
if: needs.find_scripts.outputs.mode == 'release'
uses: actions/checkout@v4
with:
repository: PyAutoLabs/PyAutoHeart
path: PyAutoHeart
- name: "Resolve the Stage 3 quarantine for this workspace [mode=release]"
# PyAutoHeart#344 (human ruling 2026-11-12): Heart owns the quarantine
# (config/stage3_quarantine.yaml) and its rules — filed bug task, at most
# 7 days, at most 3 active. Only the ACTIVE entries for this workspace
# reach the runner; an expired or refused entry is not skipped, so its
# script runs again. Readiness shows YELLOW while any entry is active.
if: needs.find_scripts.outputs.mode == 'release'
env:
WS_REPO: ${{ steps.ws.outputs.repo }}
run: |
python3 -m pip install -q "PyYAML>=6.0"
PYTHONPATH="$GITHUB_WORKSPACE/PyAutoHeart" python3 -m heart.quarantine skip-list \
--workspace "$WS_REPO" --out "$GITHUB_WORKSPACE/stage3_quarantine.json"
cat "$GITHUB_WORKSPACE/stage3_quarantine.json"
- name: "Run Python scripts [mode=release, wheels, release profile, no source on PYTHONPATH]"
if: needs.find_scripts.outputs.mode == 'release'
env:
Expand Down Expand Up @@ -448,10 +468,23 @@ jobs:
else
set -- "scripts/$SHARD_DIRECTORY"
fi
python3 "$(pwd)/../PyAutoHands/autohands/run_python.py" \
# Stage 3's one retry and quarantine (PyAutoHeart#344): a FAILED
# script is re-run once and a pass on the retry is recorded as flaky;
# a quarantined script is skipped and recorded. Release mode only.
# Passed only to a PyAutoHands runner that has them (merge order):
# without them nothing is skipped or retried — the fail-closed side.
RUNNER="$(pwd)/../PyAutoHands/autohands/run_python.py"
stage3=()
if grep -q -- "--retry-failed" "$RUNNER"; then
stage3=(--retry-failed --quarantine "$GITHUB_WORKSPACE/stage3_quarantine.json")
else
echo "::warning::PyAutoHands runner has no Stage 3 retry/quarantine yet — neither applied"
fi
python3 "$RUNNER" \
"$SHARD_PROJECT" "$@" \
--report-dir test-results \
--env-config "$ENV_CONFIG"
--env-config "$ENV_CONFIG" \
"${stage3[@]}"
- name: Upload script results
# The name's leg suffix is the shard's directory, or `ordered` for an
# ordered entry (script_matrix.py --ordered), whose directory is "." —
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ yellow/red (`heart/readiness.py` docstring is the canonical definition).
Releases still require GREEN. A development ship asks the scoped gate,
`pyauto-heart readiness --dev --repos A,B --json`: only CI on `main` of the
touched repos and their dependants blocks, every other reason is shown, a
feed older than 6 h is STALE, and STALE never passes (PyAutoHeart#340). It
feed older than 6 h is STALE, and STALE never passes (PyAutoHeart#340); a
touched repo on `not_heart_gated:` is gate-deferred, its PR checks decide
(PyAutoHeart#343). It
judges the dev box's local `~/.pyauto-heart/state.json`; the event triggers
refresh the published cloud feed, not that file.

Expand Down
6 changes: 5 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ it: only CI on `main` of the touched repos and of their dependants (the
carried in `shown_reasons`. In-scope `main` CI is read for a repo of any
group (organs and developer workspaces included); a run with no conclusion
yet is STALE. A touched repo Heart does not poll is STALE ("not polled by
Heart"); a name `config/repos.yaml` never mentions is a usage error. Evidence
Heart") — unless it is on `config/repos.yaml`'s `not_heart_gated:` list
(PyAutoHeart#343, ruling 2026-11-13): then it is *gate-deferred*, listed in
`gate_deferred`, shown as "not Heart-gated: PR checks decide", and never STALE
or blocking; the merge paths require at least one completed PR check, all
green. A name `config/repos.yaml` never mentions is a usage error. Evidence
older than 6 h (`--max-feed-age-hours`, positive, at most 6), of unknown age,
or dated more than 5 min ahead, is STALE; each CI sidecar is aged by its own
`ts`, the snapshot by its aggregation `ts`. Only GREEN passes
Expand Down
30 changes: 30 additions & 0 deletions config/repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,36 @@ excluded:
- z_vault # archived material
- scripts # utility scripts (not a checkout)

# Not Heart-gated (human ruling, M2 gate 2026-11-13, PyAutoHeart#343). Repos
# Heart does not poll whose PR checks are the gate: a development ship touching
# one reads gate-deferred — not STALE, not blocking, shown as "not Heart-gated:
# PR checks decide" — and the merge paths (the /prm judgement and the batch
# watcher's close-out) require at least one completed check on the PR head,
# all of them green. A repo with no CI therefore stays a human merge. Every
# name here must also be in `excluded:` (a polled repo is judged by its main
# CI, never deferred). Categories ruled: profiling, inference, assistants,
# visualization, Scientist, Broca, Cortex — resolved to names from the body
# map (PyAutoMind/repos.yaml). Deliberately NOT here: pyautolabs.github.io
# (no CI), PyAutoDNA, PyAutoGut, PyAutoReduce, ECLIPSE_lens_catalogue,
# autoreduce_workspace — those still read STALE ("not polled by Heart").
not_heart_gated:
- autolens_profiling
- autofit_profiling
- autolens_inference
- autofit_inference
- autocti_assistant
- autofit_assistant
- autogalaxy_assistant
- autolens_assistant
- euclid_assistant
- autolens_visualization
- autogalaxy_visualization
- autofit_visualization
- autocti_visualization
- PyAutoScientist
- PyAutoBroca
- PyAutoCortex

# Regenerated artifacts that perpetually show as dirty in `git status`.
# A porcelain path matching any of these globs (or any untracked directory)
# is counted as "generated noise" — informational, NOT actionable — and is
Expand Down
28 changes: 28 additions & 0 deletions config/stage3_quarantine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Stage 3 script quarantine (PyAutoHeart#344; human ruling, M1 gate 2026-11-12).
#
# A failing release-validation (Stage 3) workspace script may be set aside so
# one script does not hold the release RED — under this doctrine, enforced by
# heart/quarantine.py (the one reader):
#
# - an entry needs a FILED bug task (`bug`), or it is refused;
# - it expires at most 7 days after `filed`; an EXPIRED entry fails the gate
# again (readiness RED) and Stage 3 runs the script again — remove the
# entry once the bug is fixed;
# - at most 3 entries are active at once; a fourth is refused;
# - while any entry is active, readiness is YELLOW with the list — never
# GREEN: the script is skipped, the release decision stays the human's;
# - workspace scripts only: never unit tests or install checks.
#
# Schema of one entry (all required unless marked optional):
#
# - workspace: autolens_workspace_test # a polled Stage 3 workspace (config/repos.yaml)
# script: scripts/interferometer/model_fit.py # .py path inside that workspace
# bug: PyAutoLens#123 # filed bug task: Repo#N, Owner/Repo#N or issue URL
# filed: 2026-11-13 # YYYY-MM-DD
# expires: 2026-11-20 # YYYY-MM-DD, after filed, at most filed + 7 days
# owner: someone # optional — who is fixing it
# reason: one line # optional
#
# Check the file: `python3 -m heart.quarantine check` (exit 1 on a refused entry).

entries: []
22 changes: 22 additions & 0 deletions docs/release_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,28 @@ dispatching the `release-integrate.yml` channel), an ingested
rehearsal-only report still (correctly) gates YELLOW: the source was built and
TestPyPI-installed, but not yet exercised at release fidelity. `mode: release`
is what supplies the `integrate` stage that flips this to GREEN-eligible.

## One retry and the expiring quarantine (PyAutoHeart#344)

Human ruling, M1 gate 2026-11-12. In Stage 3 (`mode: release` only):

- **One retry.** A script that FAILS is re-run once (`run_python.py
--retry-failed`). A pass on the retry is recorded as **flaky** — `flaky`,
`attempts: 2` and the first error in the per-run JSON, the `flaky` list of
`report.json`, the stage report and `validation_report.json`, and
`stage3_flaky` in the readiness verdict — never hidden. A second failure
stays FAILED (RED). A TIMEOUT is not retried: it already spent its cap.
- **Quarantine.** `config/stage3_quarantine.yaml` (schema in its header; one
reader, `heart/quarantine.py`). An entry names the workspace, the script, a
filed bug task, the filed date and an expiry at most 7 days later; at most 3
are active. Stage 3 resolves the ACTIVE entries per workspace
(`python -m heart.quarantine skip-list`) and the runner skips those scripts,
recorded as quarantined. Readiness is **YELLOW** while any entry is active,
with the list; an **expired** entry is RED and its script runs again; a
refused entry (no bug ref, over 7 days, a fourth active, not a workspace
script) is RED and not skipped. Quarantine never turns RED into GREEN, and
release approval is unchanged: the nightly still ships on GREEN only.

# Bounded investigation of a failed wheel run

`release-diagnostic.yml` investigates the saved `rectangular_rtu.py` timeout
Expand Down
5 changes: 5 additions & 0 deletions heart/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,11 @@ def render_readiness_block(verdict: dict[str, Any], *, quiet: bool = False) -> l
if shown < limit:
for s in stales[: limit - shown]:
lines.append(" " + c_info(f"? {s}"))
# Stage 3 passes that needed the one retry (PyAutoHeart#344): not a tier,
# but always on the board — recorded, never hidden.
if not quiet:
for f in verdict.get("flaky_reasons") or []:
lines.append(" " + c_meta(f"~ {f}"))
# A terminal reading STALE gets the door out of it, not just the diagnosis:
# `fix stale` prints each gap's command and the one plan that clears them
# all. Suppressed in quiet mode — that line is a shell prompt, not a board.
Expand Down
Loading
Loading