Skip to content

fix: assertions enter the model identifier (#1581 follow-up) - #1586

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/order-lens-mge-bases-and-seed
Sep 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/order-lens-mge-bases-and-seed

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Identifier skips underscore-prefixed attributes, so a model's _assertions never entered the identifier: mge_model_from(order_bases=True) (PyAutoLabs/PyAutoGalaxy#611) and the unordered model hashed identically, and an ordered fit would load the completed unordered result from the same output directory instead of running. Found by an independent Codex review of #611 and verified empirically.

Assertions are now hashed (a marker, the assertion class and its operands in order) whenever a model carries any; models without assertions keep byte-identical identifiers, so nothing on disk is orphaned by this change.

API Changes

None — internal change to autofit.mapper.identifier.Identifier; identifiers change only for models that carry assertions (previously indistinguishable from their assertion-free twins).
See full details below.

Test Plan

  • Identifier of an assertion-free model unchanged against a captured main value
  • Adding an assertion changes the identifier; direction matters; deterministic across fresh models; Collections with an asserting child differ
  • pytest test_autofit -q green
Full API Changes (for automation & release notes)

Changed Behaviour

  • Identifier now includes a model's assertions in the hash when present.

Migration

  • None. Results of assertion-free models keep their directories. A model that carried assertions before this change gets a new identifier (its old directory was shared with the assertion-free twin).

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_015RALRY9yekWDTtbVfok64a

Identifier skipped underscore attributes, so _assertions never hashed and a
model with an ordering assertion targeted the same output directory as the
unordered one: search.fit loaded the completed unordered result instead of
running the ordered search. Assertions are now hashed (marker + class + operands)
when present; models without assertions keep byte-identical identifiers.

Found by an independent review of PyAutoGalaxy#611 (mge_model_from order_bases).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015RALRY9yekWDTtbVfok64a
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 8, 2026
@Jammy2211
Jammy2211 merged commit 84512bf into main Sep 8, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/order-lens-mge-bases-and-seed branch September 8, 2026 19:06
@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.

1 participant