All notable changes to Mnemosyne are documented in this file.
The project follows Semantic Versioning (MAJOR.MINOR.PATCH).
While in the 0.x series, APIs may evolve as the architecture matures.
TimeAwareHeap (priority queue with history)
- Immutable min-heap with version IDs, checkpoints, undo/redo, and diffing
- Operations:
push— Insert element at a version (O(log n))pop— Remove smallest element, returns (value, new_version_id)peek— View smallest elementcheckpoint/jump_to_checkpoint— Named savepointsundo/redo— Navigate version historydiff— Added/removed elements between versions
examples/example_timeaware_heap.py— Versioned heap usage with checkpoints
- 9 new tests covering versioning, checkpoints, undo/redo, diffs, and errors
- Total test suite: 126 comprehensive tests
- Version updated: 0.6.0 → 0.7.0
__init__.pyexports expanded to includeTimeAwareHeap
PersistentHeap (priority queue)
- Immutable min-heap with tuple-backed storage and structural sharing
- Operations:
push— Insert element (O(log n))pop— Remove smallest element, returns (value, new_heap)peek— View smallest elementfrom_iterable— Build heap from any iterable
- Maintains immutability and leaves prior heaps untouched
examples/example_heap.py— Demonstrates push, pop, peek, and structural sharing
- 9 new tests covering heap creation, ordering, pop sequencing, and immutability
- Total test suite: 117 comprehensive tests
- Version updated: 0.5.0 → 0.6.0
__init__.pyexports expanded to includePersistentHeap
PersistentDoublyLinkedList
- Bidirectional linked list enabling efficient front/back operations
- Operations:
append— Add element at end (O(1))prepend— Add element at start (O(1))pop_front— Remove from start (O(1))pop_back— Remove from end (O(1))peek_front/peek_back— View without removingreverse— Create reversed copy (O(n))
- Full version preservation and structural sharing
PersistentSet
- Hash-based immutable set with set algebra
- Operations:
add,remove,contains— Core membershipunion— Combine both setsintersection— Common elements onlydifference— Elements in first set only
- 16-bucket hash table with collision chaining via linked lists
- Full version preservation
PersistentCounter
- Immutable frequency counter (multiset)
- Operations:
increment(item, amount)— Increase frequencydecrement(item, amount)— Decrease frequency (validates count >= amount)get_count(item)— Query frequencytotal()— Sum of all countsmost_common(n)/least_common(n)— Frequency analysisadd(other)/subtract(other)— Arithmetic with operators
- Full version preservation
- Input validation on all operations
examples/example_doublylinkedlist.py— Bidirectional list operationsexamples/example_set.py— Set algebra and membership testingexamples/example_counter.py— Frequency counting and analysis
- 42 new tests across 3 test classes
- Total test suite: 108 comprehensive tests
- 100% pass rate
- Version updated: 0.4.0 → 0.5.0
__init__.pyexports expanded from 7 to 10 data structures
-
Fully persistent double-ended queue
-
Implemented using two persistent stacks (front/back model)
-
Structural sharing across all versions
-
Operations:
push_frontpush_backpop_frontpop_back
-
All operations return new version IDs
-
Complete historical version preservation
-
diff(v1, v2)for PersistentDeque -
Structured semantic diff output
- Added elements
- Removed elements
-
Enables debugging, auditing, and state inspection
-
Foundation for future structural and positional diffing
-
examples/example_deque_diff.pydemonstrating:- Version creation
- State transitions
- Cross-version comparison
- Double-ended immutable structure
- Built from two persistent stacks
- Amortized efficient operations
- Version-aware design compatible with Mnemosyne philosophy
- Modernized README formatting
- Emoji-based section headers
- Design Overview section
- Project Status and roadmap
- Clear emphasis on structural sharing
-
Immutable stack with structural sharing
-
Operations:
pushpoppeekis_empty
-
All operations return new stack instances
-
Immutable queue via two-stack implementation
-
Amortized O(1) enqueue/dequeue
-
Automatic rebalancing
-
Operations:
enqueuedequeuepeekis_empty
examples/example_queue.py
-
Refactored
stack.py:- Coexistence of
PersistentStackandTimeAwareStack
- Coexistence of
-
Improved internal structural sharing
-
Cleaner separation of responsibilities between stack variants
-
Versioned immutable stack
-
Time-travel capabilities:
pushpoppeek
-
Historical inspection via
show_version -
Named checkpoints:
checkpointjump_to_checkpoint
-
Undo/redo support
-
Version comparison utilities
-
Stack visualization
- Immutable
Nodeclass (linked-list backbone) - Structural sharing foundation
- MIT License
- Comprehensive README
examples/example.pydemonstrating time-aware operations
- Correctness over performance
- Clarity over abstraction
- Explicit versioning as a first-class concept
- Shared base abstractions for persistent structures
- Unified version graph model
- Branching timelines for TimeAwareStack
- Persistent Binary Search Tree
- Persistent AVL Tree
- Persistent graph structures
- Positional and structural diffing
- Enhanced version graph visualization
- Expanded test coverage
- Benchmarks
- API refinement based on real usage