Skip to content

fix: respect disabled test mode in output paths - #1368

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/database-latent-wheel-load
Jul 14, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/database-latent-wheel-load

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Use PyAutoConf's canonical numeric test-mode state when selecting AutoFit's output namespace. This prevents the release profile's PYAUTO_TEST_MODE=0 from writing real-search results under output/test_mode/, where database scripts cannot find them, while preserving isolation for active test-mode levels.

Addresses #1367.

Corrective Heart RED authorization

  • Exact Heart RED reason: release validation FAILED (stage integrate)
  • Human authorization: fix: load database latent variables in wheel environments #1367 (comment)
  • Corrective issue: PyAutoFit#1367
  • Authorized scope: this existing two-file producer fix and regression tests, delivered as one pending-release PR
  • Review verdict: CLEAN — one causal commit, no mixed or unrelated scope
  • Sibling RED reasons: none; existing YELLOW and STALE findings remain and are not claimed fixed

Causal mapping

The release integration profile sets PYAUTO_TEST_MODE=0. AutoFit used raw environment-string truthiness, so the non-empty string "0" incorrectly enabled the test_mode path segment. Fits were written below output/test_mode/database/..., while the database scrapers read output/database/...; the aggregator therefore contained zero searches and raised AssertionError. This change delegates path selection to PyAutoConf's numeric is_test_mode() API, so level 0 uses the normal output root and active levels remain isolated.

The reported Failed to load latent variables warning is incidental: the failing run did not reach latent-variable scraping. SQLAlchemy 2.0.51, dill 0.4.1, and NumPy 2.4.6 do not flip the result.

API Changes

Changed behavior only: DirectoryPaths.output_path now treats PYAUTO_TEST_MODE=0 as disabled, consistently with the rest of the test-mode API. Active levels continue to use output/test_mode/. No symbols or signatures changed.

Test Plan

  • Focused path tests — 14 passed
  • python -m pytest test_autofit/ -x — 1475 passed, 1 skipped
  • Exact Python 3.12 branch-source + release-wheel dependency stack (SQLAlchemy 2.0.51, dill 0.4.1, numpy 2.4.6) — all 6 database scripts passed with PYAUTO_TEST_MODE=0
  • Dependency controls — SQLAlchemy 2.0.32, NumPy 2.2.6, and dill 0.4.0 each retained the pre-fix assertion; none is causal
  • git diff --check

Post-merge validation

Merge remains a separate human decision. After merge, build fresh wheels, rerun release integration validation, and obtain a new Heart verdict before any release decision.

Full API Changes (for automation & release notes)

Removed

  • None.

Added

  • None.

Renamed

  • None.

Changed Signature

  • None.

Changed Behaviour

  • autofit.non_linear.paths.directory.DirectoryPaths.output_path — PYAUTO_TEST_MODE=0 now writes to the normal output root; values greater than zero continue to write under output/test_mode/.

Migration

  • None required. Release-profile callers already set the documented value PYAUTO_TEST_MODE=0.

Generated by the PyAutoLabs agent workflow.

@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 14, 2026
@Jammy2211
Jammy2211 merged commit 4724e20 into main Jul 14, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/database-latent-wheel-load branch August 25, 2026 18:13
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
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