- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Open
Description
Overview
Currently, the SCLS format has version information in the header record (Hdr), but there's no deserialization implementation yet. We need to plan how to make deserialization dependent on the file serialization version to ensure the system can handle multiple format versions gracefully.
Current State
- Version type exists (
Cardano.SCLS.Internal.Version) with onlyV1currently defined - The 
Hdrrecord contains aversionfield that's written at the beginning of each file - Serialization always uses 
V1(seemkHdrinHdr.hs:69-76) - No deserialization implementation exists yet
 
Relevant Code
scls-format/src/Cardano/SCLS/Internal/Version.hs- Version type definitionscls-format/src/Cardano/SCLS/Internal/Record/Hdr.hs- Header record with version fieldscls-format/src/Cardano/SCLS/Internal/Serializer/Dump.hs:107- TODO comment about parametrizing builder machine
Planning Tasks
This issue tracks the planning phase for version-dependent deserialization. The plan should address:
- 
Architecture Design
- How should version-specific deserialization be structured? (type classes, ADTs, functions?)
 - Should we use a versioned reader monad or dispatch on version at the top level?
 - How to handle backwards compatibility when adding new versions?
 
 - 
API Surface
- What's the user-facing API for deserialization?
 - How should errors be reported when encountering unsupported versions?
 - Should we support reading multiple versions transparently?
 
 - 
Builder Machine Parametrization
- The TODO at 
Dump.hs:107suggests parametrizing the builder machine - How does this relate to version-dependent deserialization?
 - Should accumulator operations be customizable per version?
 
 - The TODO at 
 - 
Testing Strategy
- How to test deserialization across versions?
 - Should we maintain reference files for each version?
 - How to ensure version migration correctness?
 
 - 
Migration Path
- How to handle format evolution (adding/removing fields)?
 - Should we support writing old versions or only the latest?
 - How to handle deprecated versions?
 
 
Acceptance Criteria
- Document architectural approach for version-dependent deserialization
 - Define API for version-aware reading
 - Outline testing strategy
 - Identify necessary changes to existing serialization code
 - Create follow-up implementation issues with concrete tasks
 
References
- Related to builder machine parametrization TODO in 
Dump.hs:107 
Metadata
Metadata
Assignees
Labels
No labels