Overview
Every buildable workspace carries two env profiles under config/build/: env_vars.yaml (the smoke profile driving the per-PR CI gate) and env_vars_release.yaml (the release-fidelity profile). They are meant to be read side by side — the release file's whole job is to say "same knobs, different values". Today they cannot be, because the defaults: blocks list the same keys in different orders.
autolens_workspace is the clearest case: smoke runs TEST_MODE, SKIP_FIT_OUTPUT, SKIP_VISUALIZATION, SKIP_CHECKS, SMALL_DATASETS, DISABLE_JAX, FAST_PLOTS, while release runs TEST_MODE, SMALL_DATASETS, FAST_PLOTS, SKIP_FIT_OUTPUT, SKIP_VISUALIZATION, SKIP_CHECKS, DISABLE_JAX, SKIP_WORKSPACE_VERSION_CHECK. Working out which knob actually differs between profiles means scanning, not diffing.
This applies one canonical key order to every config/build/env_vars*.yaml in the workspace, so the two profiles line up row-for-row and a diff shows only genuine value/comment differences. It is provably a no-op: defaults is applied by iterating a plain dict (PyAutoHands/autobuild/env_config.py:68), so its order cannot affect the resolved environment. Only overrides: is order-sensitive, and overrides: is not touched.
Plan
- Adopt one canonical key order for the
defaults: block, shared by both profiles in every workspace.
- Reorder the five
env_vars_release.yaml files that actually deviate from it.
- Align the ragged trailing-comment column (column 40) in the remaining twelve config files so the pairs diff cleanly.
- Add no keys, remove no keys, change no values, keep each key's existing comment text, and leave every
overrides: block untouched.
- Verify by resolving both profiles for every script before and after and diffing the results — the diff must be empty in every repo.
Detailed implementation plan
Affected Repositories
- autolens_workspace (primary)
- autogalaxy_workspace
- autofit_workspace
- autolens_workspace_test
- autogalaxy_workspace_test
- autofit_workspace_test
- HowToLens
- HowToGalaxy
- HowToFit
- euclid_strong_lens_modeling_pipeline
- autocti_workspace_test
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./autolens_workspace |
main |
clean |
| ./autogalaxy_workspace |
main |
clean |
| ./autofit_workspace |
main |
clean |
| ./autolens_workspace_test |
main |
clean |
| ./autogalaxy_workspace_test |
main |
clean |
| ./autofit_workspace_test |
main |
clean |
| ./HowToLens |
main |
clean |
| ./HowToGalaxy |
main |
clean |
| ./HowToFit |
main |
clean |
| ./euclid_strong_lens_modeling_pipeline |
main |
1 modified (test_report.md, unrelated/unregistered) |
| ./autocti_workspace_test |
main |
clean |
No worktree claim in active.md covers any of these repos (worktree_list_claimed checked).
Suggested branch: feature/env-vars-profile-key-order
Canonical order
Union of every key currently in use, ordered smoke-first:
PYAUTO_TEST_MODE
PYAUTO_SKIP_FIT_OUTPUT
PYAUTO_SKIP_VISUALIZATION
PYAUTO_SKIP_CHECKS
PYAUTO_SMALL_DATASETS
PYAUTO_DISABLE_JAX
PYAUTO_FAST_PLOTS
PYAUTO_SKIP_WORKSPACE_VERSION_CHECK
JAX_ENABLE_X64
MPLBACKEND
NUMBA_CACHE_DIR
MPLCONFIGDIR
Per-file contract:
- list only the keys the file already has — no keys added or removed;
- no values changed; each key keeps its own existing comment text;
- present keys appear in the canonical relative order;
- trailing
# comment column aligned at column 40 within each defaults: block;
overrides: untouched (ordered list of pattern rules — order is load-bearing there).
Implementation Steps
- Snapshot: for each repo, resolve both profiles for every script from an empty base and dump to JSON, reusing
resolve_clean(script, cfg) in PyAutoHands/autobuild/validate_env_profiles.py.
- Reorder the
defaults: block of the five deviating release profiles:
autolens_workspace/config/build/env_vars_release.yaml
autogalaxy_workspace/config/build/env_vars_release.yaml
autofit_workspace/config/build/env_vars_release.yaml
autolens_workspace_test/config/build/env_vars_release.yaml (FAST_PLOTS/DISABLE_JAX swap)
autogalaxy_workspace_test/config/build/env_vars_release.yaml (same swap)
- Comment-column alignment only in the remaining twelve
config/build/env_vars*.yaml (the six smoke siblings, autofit_workspace_test/config/build/env_vars_release.yaml, and the standalone configs in HowToLens / HowToGalaxy / HowToFit / euclid_strong_lens_modeling_pipeline / autocti_workspace_test).
- Re-dump the resolved env and diff against the step-1 snapshot — must be empty per repo. A non-empty diff means a key was dropped, renamed, or a value changed; treat as a hard failure.
- Run
validate_env_profiles.py against each edited repo (exit-1 tier catches unparseable YAML, non-mapping profiles, malformed overrides).
- Sanity check the point of the exercise:
diff each repo's env_vars.yaml against its env_vars_release.yaml and confirm the surviving hunks are value/comment differences only, with keys lining up row-for-row.
- Pre-flight
git diff --stat in each worktree before committing — nothing but config/build/env_vars*.yaml may appear.
No script execution and no CI dispatch is needed to prove correctness; steps 1, 4 and 5 are decidable from config alone.
Key Files
<repo>/config/build/env_vars.yaml — the smoke profile (per-PR CI gate); 11 of these.
<repo>/config/build/env_vars_release.yaml — the release-fidelity profile; 6 of these.
PyAutoHands/autobuild/env_config.py:68 — applies defaults by dict iteration; the reason this reorder is a no-op.
PyAutoHands/autobuild/validate_env_profiles.py — resolve_clean() (empty-base resolution) + the exit-1 config-error tier; the verification harness. Not modified.
Notes on classification
The Brain Feature Agent returned too-large → split-into-4-phases, scored off the 11-repo count alone. Overridden by judgment: this is a comment-column tidy plus a key reorder in five files, with no API surface and a provable no-op guarantee. Single task, one small PR per repo.
Original Prompt
Click to expand starting prompt
Make env_vars and env_vars_release same order, e.g. the two configs are hard to compare side by isde cause the top entries are in different orders,
Formalised as PyAutoMind/draft/maintenance/workspaces/env_vars_profile_key_order.md.
Overview
Every buildable workspace carries two env profiles under
config/build/:env_vars.yaml(thesmokeprofile driving the per-PR CI gate) andenv_vars_release.yaml(the release-fidelity profile). They are meant to be read side by side — the release file's whole job is to say "same knobs, different values". Today they cannot be, because thedefaults:blocks list the same keys in different orders.autolens_workspaceis the clearest case: smoke runsTEST_MODE, SKIP_FIT_OUTPUT, SKIP_VISUALIZATION, SKIP_CHECKS, SMALL_DATASETS, DISABLE_JAX, FAST_PLOTS, while release runsTEST_MODE, SMALL_DATASETS, FAST_PLOTS, SKIP_FIT_OUTPUT, SKIP_VISUALIZATION, SKIP_CHECKS, DISABLE_JAX, SKIP_WORKSPACE_VERSION_CHECK. Working out which knob actually differs between profiles means scanning, not diffing.This applies one canonical key order to every
config/build/env_vars*.yamlin the workspace, so the two profiles line up row-for-row and a diff shows only genuine value/comment differences. It is provably a no-op:defaultsis applied by iterating a plain dict (PyAutoHands/autobuild/env_config.py:68), so its order cannot affect the resolved environment. Onlyoverrides:is order-sensitive, andoverrides:is not touched.Plan
defaults:block, shared by both profiles in every workspace.env_vars_release.yamlfiles that actually deviate from it.overrides:block untouched.Detailed implementation plan
Affected Repositories
Branch Survey
test_report.md, unrelated/unregistered)No worktree claim in
active.mdcovers any of these repos (worktree_list_claimedchecked).Suggested branch:
feature/env-vars-profile-key-orderCanonical order
Union of every key currently in use, ordered smoke-first:
Per-file contract:
#comment column aligned at column 40 within eachdefaults:block;overrides:untouched (ordered list of pattern rules — order is load-bearing there).Implementation Steps
resolve_clean(script, cfg)inPyAutoHands/autobuild/validate_env_profiles.py.defaults:block of the five deviating release profiles:autolens_workspace/config/build/env_vars_release.yamlautogalaxy_workspace/config/build/env_vars_release.yamlautofit_workspace/config/build/env_vars_release.yamlautolens_workspace_test/config/build/env_vars_release.yaml(FAST_PLOTS/DISABLE_JAXswap)autogalaxy_workspace_test/config/build/env_vars_release.yaml(same swap)config/build/env_vars*.yaml(the six smoke siblings,autofit_workspace_test/config/build/env_vars_release.yaml, and the standalone configs in HowToLens / HowToGalaxy / HowToFit / euclid_strong_lens_modeling_pipeline / autocti_workspace_test).validate_env_profiles.pyagainst each edited repo (exit-1 tier catches unparseable YAML, non-mapping profiles, malformed overrides).diffeach repo'senv_vars.yamlagainst itsenv_vars_release.yamland confirm the surviving hunks are value/comment differences only, with keys lining up row-for-row.git diff --statin each worktree before committing — nothing butconfig/build/env_vars*.yamlmay appear.No script execution and no CI dispatch is needed to prove correctness; steps 1, 4 and 5 are decidable from config alone.
Key Files
<repo>/config/build/env_vars.yaml— thesmokeprofile (per-PR CI gate); 11 of these.<repo>/config/build/env_vars_release.yaml— the release-fidelity profile; 6 of these.PyAutoHands/autobuild/env_config.py:68— appliesdefaultsby dict iteration; the reason this reorder is a no-op.PyAutoHands/autobuild/validate_env_profiles.py—resolve_clean()(empty-base resolution) + the exit-1 config-error tier; the verification harness. Not modified.Notes on classification
The Brain Feature Agent returned
too-large → split-into-4-phases, scored off the 11-repo count alone. Overridden by judgment: this is a comment-column tidy plus a key reorder in five files, with no API surface and a provable no-op guarantee. Single task, one small PR per repo.Original Prompt
Click to expand starting prompt
Formalised as
PyAutoMind/draft/maintenance/workspaces/env_vars_profile_key_order.md.