Skip to content

feat: Stage 3 one retry (FAILED only, clean new output) + exact-path quarantine skips (Heart#344) - #340

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/m2-finish
Nov 13, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/m2-finish

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Stage 3 runner half of PyAutoLabs/PyAutoHeart#344, programme M2. Merge before the Heart PR.

  • A FAILED script is retried once; a TIMEOUT is not. Before the retry, only output paths the failed attempt created are deleted, so an earlier script's zip survives. A pass on retry is recorded as flaky.
  • Quarantine skips match the exact workspace-relative path, and each skip is recorded with its entry.

Test plan

  • Hands suite: 639 passed. 4 pre-existing environmental test_tombstone failures.

Gate

  • Heart, scoped dev-ship verdict: GREEN at 14:00Z for the touched repos PyAutoHeart, PyAutoHands and PyAutoBrain (pyauto-heart readiness --dev --repos …). No RED override was needed: this is the first ship through the M2.1 scoped gate.
  • Independent review (fresh Opus context): three rounds of FINDINGS, then CLEAN. The findings were:
    • a quarantine could turn RED into GREEN after its entry was removed;
    • flaky passes were hidden;
    • the retry could resume finished output;
    • quarantine paths were matched as unanchored substrings;
    • the output clean could delete an earlier script's output.
  • Human rulings, 2026-11-13: ship. A quarantine-only YELLOW may let the nightly ship, which is a follow-up build. Timeouts get no retry.

Tier: glance. Merge mode: auto-merge on green if the Witness passes, with a post-merge summary.

🤖 Generated with Claude Code

Jammy2211 and others added 3 commits November 13, 2026 12:43
Human ruling, M1 gate 2026-11-12. Both are opt-in flags of run_python.py
that only Heart's Stage 3 (workspace-validation.yml, mode=release) passes:

- --retry-failed: a FAILED script is re-run once. A pass on the retry is
  PASSED with `flaky`, `attempts: 2` and the first error kept — recorded,
  not hidden; a second failure stays FAILED. A TIMEOUT is not retried.
- --quarantine FILE: the ACTIVE entries Heart resolved for the workspace
  (heart.quarantine skip-list). A matching script is SKIPPED, recorded with
  its bug ref, never run. Expiry, bug-ref and the 3-entry cap are Heart's.
- aggregate_results carries `flaky` and `quarantined` lists into
  report.json and its markdown; `ready` is unchanged.
- The per-run JSON stays byte-compatible when neither is used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d the entry (PyAutoHeart#344 review)

- Quarantine entries match the exact workspace-relative path, never a
  substring (`scripts/imaging/fit.py` no longer skips
  `scripts/multi_imaging/fit.py`).
- Before the one retry, files the failed attempt wrote under `output/`
  (mtime at or after its start) are removed, so a script that failed after
  its search completed cannot resume from the finished output and pass.
  Earlier scripts' output is untouched.
- A quarantined skip records its entry (`quarantine_entry`: workspace,
  script, bug, expires) so Heart can judge what the rehearsal skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d (PyAutoHeart#344 review)

The mtime-based clean deleted any output file touched during the failed
attempt. A script resuming an earlier script's search restores that zip
with fresh mtimes and rewrites it, so the clean deleted the earlier
script's output and later scripts re-ran or failed: a false red.

Now the runner snapshots the paths under output/ before each attempt (only
when the retry is on), and before the retry deletes only paths that were
not in that snapshot. The attempt's own new search output still goes; the
earlier zip survives even though it was rewritten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 9f7c703 into main Nov 13, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/m2-finish branch November 13, 2026 14:04
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