Skip to content

fix: results index skips campaign task records; batch wait loop keeps the fit's exit status #1749

Closed

Description

@Jammy2211

Overview

These are two defects the independent review of autolens_assistant#174 (hpc-campaign p5a) traced back to PyAutoFit:

  • Phantom results: autofit.results index counts the stage task records under output/.campaign_tasks/ as results.
  • Clean finish recorded as a failure: the generated Slurm batch script records a clean finish after a pre-timeout checkpoint as exit 138.

Heart RED at the door (2026-10-31). Reasons:

  • release validation FAILED (stage integrate)
  • PyAutoHeart/workflows/Release Integrate: failure
  • Release readiness: release validation FAILED (stage integrate)
  • autogalaxy: red
  • Release validation: NOT release_ready — v2026.10.31.1.dev85201 profile=release
  • validation_report/stages/integrate: fail
  • autolens_profiling: red
  • Worktree drift: 0 orphan / 0 missing / 1 dirty

Human override for Heart RED (development only) extended live by the human on 2026-10-31 to this task ("yes extend the override, go ahead"). Merging needs green CI and a separate /prm; no release.

Plan

  • Skip the hidden .campaign_tasks directory when the results index walks an output tree.
  • Make the generated batch script keep only the fit's own exit status after a forwarded signal.
  • Add a test for each. The wait-loop test drives a real USR1 against a generated script.
  • Tier: judge. Merge mode: human /prm.
Detailed plan
  1. autofit/results/index.py: add .campaign_tasks to _SKIP_DIRS as a named constant, with a comment on where those records come from (the assistant template's stage entry; they are the campaign collector's, read by autofit.campaign.collector.scan_status, not results). Confirm the collector still reads them, since it scans status records separately. Test in test_autofit/results/test_index.py: a tree with a real result plus .campaign_tasks/demo/stage/0.status.json indexes one result.
  2. autofit/campaign/scheduler/slurm.py sbatch_script: replace the until wait loop with while true; do status=0; wait "$child" || status=$?; kill -0 "$child" 2>/dev/null || break; done. Test in test_autofit/campaign/test_slurm.py: write the generated script with a stand-in command that traps USR1, sleeps briefly and exits 0; run it with bash, send USR1 to it, and assert exit 0. Also assert exit 3 when the command exits 3. Skip the test if bash is missing.
  3. Run the full PyAutoFit suite. It must not run in parallel with another PyAutoFit suite, because test_aggregate_csv writes a fixed /tmp/summary.csv.

Branch: feature/campaign-task-records-wait-loop. Worktree root: ~/Code/PyAutoLabs-wt/campaign-task-records-wait-loop/.

Original prompt

Click to expand

See PyAutoMind active/campaign_task_records_and_wait_loop.md.

🤖 Generated with Claude Code

Activity

  1. Jammy2211 commented on Oct 31, 2026

    @Jammy2211
    CollaboratorAuthor

    Library PR created: #1750. Full suite green (4170 passed); independent review CLEAN. No workspace impact. Awaiting human /prm.

  2. Jammy2211 commented on Oct 31, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped

    Merged in #1750 (06a414851 + 2caeaab3e); pending release.

    • autofit.results index no longer walks into .campaign_tasks/.
    • The generated Slurm batch script keeps the fit's own exit status after a forwarded USR1 or TERM.
    • Full suite 4170 passed; independent review CLEAN; CI green on every leg.
    • Unblocks autolens_assistant#174 once released (its wiki-currency check audits released autofit.campaign).
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