Skip to content

[ENHANCEMENT] Decouple storage types from generated backend enums #2107

@jcscottiii

Description

@jcscottiii

I was looking into the differ logic and realized we're coupled to the generated openapi types for our long-term storage.

Right now, the state blobs rely directly on the generated enums. If we regenerate the backend client and any enum values change (or the order shifts), we risk corrupting existing data in storage. We need to cut that dependency so our storage format is stable.

I'm going to split this work into a few PRs:

  1. Define explicit storage types: Create dedicated structs for the serialized blobs (Snapshots and Diffs) that own their own enum definitions, completely separate from the generated backend code.

  2. Isolate in-memory types: Move the internal structs we use for diffing logic into a new package lib/workertypes/comparables (naming it comparables to avoid clashing with the standard library interface).

  3. Add adapters: Wire up converters to map between the Live API -> Internal Comparable -> Serialized Blob.

This ensures that even if the API schema changes or we regenerate the client, our stored history remains valid.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions