Skip to content

refactor: drop output metadata file; aggregator keys on files/search.json - #1585

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/aggregator-search-json-sentinel
Sep 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/aggregator-search-json-sentinel

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Every DirectoryPaths.save_all wrote a two-line metadata file (name=…, non_linear_search=…) into each search output folder, in append mode. Its only load-bearing consumer was Aggregator.from_directory, which used the file's presence as the sentinel that a walked directory is a search output. files/search.json is written unconditionally by the same save_all (including the skip-fit-output branch), so discovery now keys on that instead and the metadata file is no longer written. Legacy output folders and archived zips that still carry metadata continue to aggregate. Resume is keyed on .completed and is untouched, so in-flight runs are unaffected.

Closes #1582.

API Changes

  • Search output folders no longer contain a metadata file.
  • Aggregator.from_directory discovers a search output when <dir>/files/search.json exists (legacy metadata-only folders still discovered).
  • SearchOutput.non_linear_search is now a property read from files/search.json (class_path leaf, lower-cased), so agg.query(agg.non_linear_search == "emcee") keeps working with the same values; legacy folders fall back to the metadata line.
  • SearchOutput.text and SearchOutput.file_path removed; str()/repr() now report the output directory.
    See full details below.

Test Plan

  • pytest test_autofit/aggregator test_autofit/non_linear/paths — 95 passed
  • Full pytest test_autofit — 2477 passed, 2 skipped
  • End-to-end: real af.LBFGS fit writes no metadata; Aggregator.from_directory returns the identifier directory (not files/), extracts the search zip, and agg.query(agg.non_linear_search == "lbfgs") matches
  • New tests: files/search.json sentinel, files/ without search.json not discovered, legacy metadata folder still discovered, non_linear_search from search.json
  • Workspace follow-up (same task): autofit_workspace_test profiling/aggregator mocks and autolens_workspace_developer aggregator_profiling mocks stop appending metadata, harness keys on unique_tag
Full API Changes (for automation & release notes)

Removed

  • DirectoryPaths._save_metadata — the metadata output file is no longer written.
  • SearchOutput.file_path, SearchOutput.text — the parsed metadata contents; attributes previously spliced from that file into the instance (name, non_linear_search, and anything a user appended by hand) are no longer injected.

Added

  • SearchOutput.non_linear_search (property) — lower-cased search class name from files/search.json; None if neither search.json nor a legacy metadata line is present.
  • autofit.aggregator.aggregator._is_search_output(root, dirs, filenames) — the directory-walk sentinel (private).

Migration

  • Before: aggregator discovery required a metadata file; agg.non_linear_search == "emcee" read it.
  • After: discovery requires files/search.json (always written by save_all); agg.non_linear_search == "emcee" reads search.json. No user code change needed. Custom keys appended to metadata by hand-rolled scripts are no longer surfaced as attributes; use unique_tag (or a field in info.json) instead.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GkELVxsdpNKyegTu4bFJTR

…json

`DirectoryPaths.save_all` no longer writes the two-line `metadata` file into
each search output folder. `Aggregator.from_directory` discovers a search
output when `files/search.json` exists (written unconditionally by the same
`save_all`), keeping legacy `metadata`-only folders discoverable.
`SearchOutput.non_linear_search` becomes a property read from `search.json`
so existing filters keep their values; `.text` / `.file_path` are removed.
Resume keys on `.completed` and is unaffected.

Closes #1582

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GkELVxsdpNKyegTu4bFJTR
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autofit_workspace_test#101

@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_workspace_developer#133

@Jammy2211
Jammy2211 merged commit 1dc9250 into main Sep 8, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/aggregator-search-json-sentinel branch September 8, 2026 17:55
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 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.

refactor: drop output metadata file; aggregator keys on files/search.json

1 participant