Skip to content

fix: keep the legacy interpolator load backward compatible until the next major release (spec 005 S3) - #400

Merged
lachlangrose merged 3 commits into
masterfrom
fix/005-s3-legacy-load-backward-compatible
Nov 5, 2026
Merged

lachlangrose merged 3 commits into
masterfrom
fix/005-s3-legacy-load-backward-compatible

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Summary

PR #397 (stage S3 of spec 005) merged before these three commits were pushed. This pull request adds them. It makes the legacy-load change of #397 backward compatible on the 1.x line (decision C-018).

  • Before (in master now): a legacy interpolator file with no format_version and no caller choice raises InterpolatorFormatError. This is a break of the 1.x public behaviour.
  • After: with no choice, the loader loads the identity frame, as older releases did, and emits one FutureWarning. The warning names local_origin and local_rotation, declare_identity=True, and the next major release.
  • Unchanged: a partial transform, a conflict, a malformed payload and an unsupported version still raise InterpolatorFormatError.
  • Warning target: the warning points at the first frame outside the package, so from_dict, from_json, from_yaml and the factory all show the user's call. It is emitted last, so a failed load gives no warning.
  • Removal note: _STRICT_LEGACY in _frame_persistence.py is the one switch. The comment says "REMOVE AT THE NEXT MAJOR RELEASE (spec 005, C-018)". At the major release, delete the fallback, warn_legacy_identity and _external_stacklevel.
  • Docs: ROADMAP.md records the decision. COMPAT.md moves the legacy-load row to the deprecation table (earliest removal: the next major release). verification.md and run-state.json record the gates.

The P2 fit accuracy found in S3 is tracked in #399.

Test plan

  • ruff check LoopStructural packages: pass (on the original branch; the code tree is identical)
  • pytest packages/loop_common/tests packages/loop_interpolation/tests: 912 passed, 47 skipped, 2 xfailed
  • pytest (root): 1994 passed, 5 skipped
  • 7 new cells in test_frame_persistence.py (184 in total): warn and load identity, strict switch raises, warning points at the caller (dict, json, yaml, factory), no warning when the load fails.

These three commits were cherry-picked onto master with no conflict. The tree matches the tested branch, but I did not re-run the suites after the cherry-pick.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XADRvJ98bJ8Ey8Rw98F3j1

lachlangrose and others added 3 commits November 5, 2026 15:46
…he next major release

A legacy interpolator payload with no choice of the caller loads with the
identity frame, as older releases did, and emits one FutureWarning. A
module switch, _STRICT_LEGACY, carries a note to remove the fallback at the
next major release, when the loader raises an error. A partial transform, a
conflict, a malformed payload and an unsupported version still raise.

Update the ROADMAP.md decision, the COMPAT.md rows and verification.md, and
correct the P2 fit figures (issue #399).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XADRvJ98bJ8Ey8Rw98F3j1
…arn only after a successful load

The FutureWarning for a legacy payload with no choice used a fixed
stacklevel. It pointed at a library file for from_json and from_yaml, and
one frame too high for a direct factory call. It also came before a later
failure of the same call.

Add warn_legacy_identity, which computes the stacklevel to the first frame
outside the package, and call it as the last step of a successful load.
Add tests for the four entry points and for a failed load.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XADRvJ98bJ8Ey8Rw98F3j1
@lachlangrose
lachlangrose merged commit f0aa71f into master Nov 5, 2026
47 checks passed
@lachlangrose
lachlangrose deleted the fix/005-s3-legacy-load-backward-compatible branch November 5, 2026 05:26
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