Skip to content

feat: version-aware .tla loading with migrations#550

Merged
azfoo merged 4 commits into
devfrom
claude/brave-vaughan-5b4f3a
Jul 24, 2026
Merged

feat: version-aware .tla loading with migrations#550
azfoo merged 4 commits into
devfrom
claude/brave-vaughan-5b4f3a

Conversation

@FelipeDefensor

@FelipeDefensor FelipeDefensor commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds version handling when opening .tla files. Until now open_tla stored the
file version but never read it: opening a file written by a newer TiLiA silently
partial-loaded and could drop unknown data on save, and older-format upgrades were
done with ad-hoc shims scattered inside deserialize_timelines.

This PR:

  • Warns + asks confirmation before opening a file from a newer TiLiA version
    (open_tlaGet.FROM_USER_YES_OR_NO). Declining aborts the load.
  • Adds tilia/file/migration.py: an ordered list of small, composable
    dict -> dict migrations applied to the raw file data on load.
  • Moves the inline display_position -> ordinal shim out of
    deserialize_timelines into the registry (target 0.1.1), giving version
    upgrades a single source of truth.
  • Registers the upcoming v0.7 timeline-kind rename
    (MARKER_TIMELINE -> Marker) as a dormant migration (target 0.7.0)

Follow-up

When syncing onto the v0.7.0 branch, delete the inline _get_timeline_class_string
shim there — the dormant 0.7.0 migration replaces it.

@FelipeDefensor FelipeDefensor added this to the 0.6.4 milestone Jun 22, 2026
@FelipeDefensor
FelipeDefensor requested a review from azfoo June 22, 2026 15:14
@azfoo

azfoo commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

is this meant to merge into dev instead of main?

@FelipeDefensor

Copy link
Copy Markdown
Collaborator Author

is this meant to merge into dev instead of main?

Yes. I wonder if we are doing the main vs. dev thing in a unconventional way, Claude always seems to get it wrong.

@FelipeDefensor
FelipeDefensor changed the base branch from main to dev June 24, 2026 09:06
@azfoo

azfoo commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

is this meant to merge into dev instead of main?

Yes. I wonder if we are doing the main vs. dev thing in a unconventional way, Claude always seems to get it wrong.

I suppose there is also main vs stable...

Comment thread tilia/file/migration.py
Comment thread tilia/file/file_manager.py
Comment thread tilia/file/migration.py
Comment thread tilia/file/file_manager.py
Comment thread tests/file/test_migration.py Outdated
@azfoo
azfoo force-pushed the claude/brave-vaughan-5b4f3a branch from 100f8e0 to bcab2d0 Compare July 23, 2026 10:15
FelipeDefensor and others added 4 commits July 23, 2026 14:26
- open_tla now warns and asks for confirmation before opening a file
  written by a newer TiLiA version, since data that version understands
  may be silently dropped on save.
- Add tilia/file/migration.py: an ordered list of dict->dict migrations
  applied to the raw file data on load. A migration runs only when
  file_version < target <= app_version, so a migration written for an
  unreleased version stays dormant until that version ships.
- Move the inline display_position->ordinal shim out of
  deserialize_timelines into the registry (target 0.1.1) and relocate
  its test, giving version upgrades a single source of truth.
- Register the upcoming 0.7 timeline-kind rename (MARKER_TIMELINE ->
  Marker) as a dormant migration (target 0.7.0).
Adds the possibility of ignoring tl types not known to the current version.
Older versions can now open newer files (or files with beta tl types). These unknown tls are either ignored or discarded. If ignored, the ids are kept but the ordinals of the entire file shuffled to move the unknown ones to the bottom of the tl stack.
@azfoo
azfoo force-pushed the claude/brave-vaughan-5b4f3a branch from bcab2d0 to 3623dd5 Compare July 23, 2026 12:27
@azfoo
azfoo merged commit fa26a97 into dev Jul 24, 2026
11 checks passed
@azfoo
azfoo deleted the claude/brave-vaughan-5b4f3a branch July 24, 2026 08:16
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.

2 participants