Skip to content

Finish the exposure PSF run-dir rename (exp_psf fails on develop) - #888

Open
cailmdaley wants to merge 1 commit into
developfrom
fix/exp-psf-run-name
Open

Finish the exposure PSF run-dir rename (exp_psf fails on develop)#888
cailmdaley wants to merge 1 commit into
developfrom
fix/exp-psf-run-name

Conversation

@cailmdaley

Copy link
Copy Markdown
Contributor

Hotfix for develop: every exp_psf job fails on the committed exposure chain.

98bc0857 renamed the exposure PSF run dir run_sp_exp_SxSePsfPirun_sp_exp_SxSePsf and updated the one INPUT_DIR that existed then; the mask_query merge (94c7a863) then brought setools' INPUT_DIR across from the healsparse branch still spelling the old name. First seen on the smk-g7 campaign (the first workflow run since #847 merged — smk-g6 predates it): ERROR: Invalid INPUT_DIR (…/run_sp_exp_SxSePsfPi/mask_query_runner/output), and on retry Directory …/run_sp_exp_SxSePsf already exists, because completeness.STAGE_DIR["exp_psf"] — which unit_pre's rm -rf uses to reset a retried unit — carried the stale name too.

Fixes the four consumers (config_exp_psfex.ini setools INPUT_DIR, completeness.STAGE_DIR, two docstrings) and adds tests/unit/test_workflow_run_names.py, which asserts a run dir is named once per config and every chained INPUT_DIR, both PSF configs, and completeness.STAGE_DIR agree — it fails on the pre-fix tree naming both production errors. Note completeness.py is hashed into every rule's params, so this invalidates in-flight campaigns' rerun state (cheap: prepare uses RETRIEVE=symlink).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QbnPCyzuDNTgkg715pHhar

98bc085 renamed the exposure PSF stage's run dir from run_sp_exp_SxSePsfPi to
run_sp_exp_SxSePsf, so that config_exp_psfex.ini and config_exp_mccd.ini write
one path and nothing downstream of exp_psf has to branch on `psf:`. It updated
the one INPUT_DIR that existed at the time and left every other copy of the
name behind. The mask_query merge then reintroduced a stale one: the chain grew
a module between sextractor and setools, and setools' INPUT_DIR came across
from the healsparse branch still spelling the old name.

smk-g7 lost all 127 exposures to it, in two different voices:

  ERROR: Invalid INPUT_DIR (.../run_sp_exp_SxSePsfPi/mask_query_runner/output)

on the first attempt -- mask_query had in fact run and written all 40
sexcat_ext files, into run_sp_exp_SxSePsf, where setools was not looking -- and
then, on every retry:

  ERROR: Directory .../run_sp_exp_SxSePsf already exists.

which is the SAME bug wearing the STAGE_DIR hat. unit_pre clears the stage's
run dir before each attempt precisely so a retry starts clean, and it takes the
directory's name from completeness.STAGE_DIR. That entry was stale too, so the
rm -rf had been clearing a directory nobody writes and the real one accumulated
until ShapePipe refused it.

So the retry cleanup needed no new mechanism; it needed the name it already
had. Fixing STAGE_DIR fixes both the clearing and the counting.

tests/unit/test_workflow_run_names.py holds the invariant that made this
possible to get wrong: a run directory is named once in a config and then
referred to by things that must find it, and nothing checked that they agreed.
It asserts the agreement statically, and fails on the pre-fix tree with both of
the errors above named in its messages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbnPCyzuDNTgkg715pHhar
(cherry picked from commit e9e8564d7aa9b9034c49406bd96852df7ba44525)
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