Skip to content

fix: preserve explicitly fixed models across JSON round trips - #1708

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/fixed-model-json
Oct 17, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/fixed-model-json

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

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

  • Final full serial suite: 3,704 passed, 120 skipped, 1 xfailed.
  • Affected model/graph/aggregator tests: 305 passed, including existing converted-instance/derived-attribute regressions.
  • New all-fixed + parameterless + free-component JSON regression preserves semantic GraphSpec fields and original/reloaded model hashes, search IDs and output-folder paths.
  • Pinned a fixed-model hash from unmodified main. Separate free/fixed/mixed baseline checks match all model hashes, search IDs and exact output paths; converted-instance JSON and hash also match baseline exactly.
  • Initial full run caught five converted-instance regressions; repaired before this PR. Final suite passes.
  • GitHub Python 3.12/3.13 checks pending.
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 /prm required; 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.

@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Oct 17, 2026 — with ChatGPT Codex Connector
@Jammy2211
Jammy2211 merged commit 48f1c31 into main Oct 17, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/fixed-model-json branch October 17, 2026 20:01
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 23, 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.

fix: preserve fixed model components in JSON round trips

1 participant