Repository navigation
fix: preserve explicitly fixed models across JSON round trips - #1708
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Explicit all-fixed and parameterless Models were serialized as instances, so reloading a model changed its structure and model figure. Serialize explicit Models as models, while preserving the established instance round-trip behavior of Model.from_instance using private provenance that is excluded from identifiers and serialized arguments.
Closes #1704.
API Changes
Explicit fixed Models retain Model identity after JSON reload. Existing instance JSON and Models produced by Model.from_instance retain their previous behavior. No model/search identifier algorithm or output-folder naming changes. See full details below.
Test Plan
Full API Changes (for automation & release notes)
Changed Behaviour
ModelObject.dict: explicit Model objects emit type=model even with zero priors.AbstractPriorModel.from_instance: retains private conversion provenance so zero-prior converted instances still emit type=instance. This private flag is excluded from identifier hashes and JSON arguments.Migration
No signature changes, output-ID changes or renaming of existing output folders. Legacy type=instance JSON continues loading unchanged. The lens cookbook's release-dependent reload warning should be removed once this fix is released; it is not changed prematurely.
Witness detail
The prompt requested literal GraphSpec dict equality. GraphSpec includes process-local obj_id/prior_id counters, which JSON already does not preserve, even for free models. The regression compares every semantic graph field excluding only those counters, and separately asserts exact persistent model/search/output IDs. No identifier algorithm was changed to make the test pass.
Workflow
Human
/prmrequired; no merge authorized. Heart readiness STALE: local CI collector unavailable, missing test-run report, install verification and release validation. No release readiness or independent-review claim.Generated by the PyAutoLabs agent workflow.