Skip to content

cortex: pass each project's declared output roots to its own pull - #373

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/cortex-pull-declared-output-roots
Sep 9, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/cortex-pull-declared-output-roots

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

The bug

Each science project's hpc/sync hard-codes PULL_DIRS, and both pull and
pull-full iterate that same array — so a run written to a custom
PYAUTO_OUTPUT_DIR is never fetched. On 2026-09-09, 173 MB of
euclid_dr1_prelim ordered-MGE results sat unpulled on RAL and the Cortex
check-in reported those tasks as FAILED.

The fix

Cortex now derives the output* roots a project's tasks declare in their
## Where to look bullets — reusing _path_tokens() from #371 — and passes
them to that project's own hpc/sync pull via the PYAUTO_PULL_DIRS
environment variable. This extends the override convention
hpc/sync.conf.example already documents for HPC_HOST / HPC_BASE /
PROJECT_NAME. Each science script appends the roots to its own PULL_DIRS
(companion PRs: euclid_strong_lens_modeling_pipeline, subhalo_validation,
slope_hierarchy_scale). An unset variable reproduces today's pull exactly, and
pull-full inherits the change for free because it iterates the same array.

Why only output*

A pull rsyncs remote → local. Real tasks name results/, wiki/… and
scripts/… in the same ## Where to look bullets as their output roots —
passing those through would overwrite local source with the cluster's copy.
declared_output_roots() only ever matches output*-shaped path heads, and
test_only_output_shaped_roots_are_ever_offered_to_a_pull asserts exactly
that guard against a bullet block naming all four kinds of path in one place.

Evidence

  • Full PyAutoBrain/tests/ suite: 943 passed, 1 failed in 3:22. The one
    failure (test_a_fixture_tree_finds_the_schema_its_checkout_ships) is a
    known pre-existing worktree/symlink trap that passes in the canonical
    checkout and in CI — not touched by this change.
  • Four new tests added and passing:
    test_only_output_shaped_roots_are_ever_offered_to_a_pull,
    test_the_roots_of_a_projects_tasks_are_pooled_and_deduped,
    test_a_project_declaring_no_extra_root_pulls_exactly_as_before,
    test_the_declared_roots_reach_the_pull_as_an_environment_assignment.
  • bash -n passes on all three edited hpc/sync scripts.
  • Behavioural harness on all three scripts: unset PYAUTO_PULL_DIRS
    reproduces today's list exactly; extra roots append; an already-present
    root is not duplicated.
  • Live dry-run witness against RAL (euclid_dr1_prelim): without the seam the
    pull enumerated output/, output_sed/ (absent) and inspect/ (absent),
    and never mentioned output_ordered_witness/. With
    PYAUTO_PULL_DIRS=output_ordered_witness it listed output_ordered_witness/
    and did not report it missing. A direct rsync --dry-run --stats shows that
    root holds 115 files (90 regular, 25 dirs), 173,465,562 bytes on RAL.

Heart readiness is RED on five organism-scope reasons unrelated to this
change; the human has acknowledged them in-session for this task (recorded in
PyAutoMind/active.md). Nothing in this PR is in the release chain.

Closes #372.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FKSwTBuNwcJc2FPNpSCrkp

Each science project's hpc/sync hard-codes PULL_DIRS, so a run written to a
custom PYAUTO_OUTPUT_DIR is never fetched by `pull` or `pull-full`. On
2026-09-09, 173MB of euclid_dr1_prelim ordered-MGE results sat unpulled on RAL
and the check-in reported those tasks as FAILED.

Cortex now derives the output* roots a project's tasks declare in their
"## Where to look" bullets (reusing _path_tokens() from #371) and passes them
via the PYAUTO_PULL_DIRS environment variable, extending the override
convention hpc/sync.conf.example already documents for HPC_HOST/HPC_BASE/
PROJECT_NAME. Only output*-shaped roots are ever offered — a pull rsyncs
remote -> local, so passing results/, wiki/ or scripts/ would overwrite local
source with the cluster's copy.

Refs #372.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKSwTBuNwcJc2FPNpSCrkp
@Jammy2211
Jammy2211 merged commit 11aa3f8 into main Sep 9, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/cortex-pull-declared-output-roots branch September 9, 2026 18:30
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.

fix: custom PYAUTO_OUTPUT_DIR roots are never pulled from the HPC

1 participant