Skip to content

[SPoA/KISS] Separate persisted settings DTOs and legacy migration from runtime domain models #51

Description

@github-actions

Audit finding

src/SightAdapt/ApplicationProfile.cs currently combines:

  • the read-only settings contract;
  • mutable persisted settings;
  • application-assignment state;
  • visual-profile state;
  • application identity;
  • JSON serialization attributes;
  • legacy effect compatibility behavior.

The runtime ApplicationProfile model contains persistence-only members such as LegacyEffect, and its Effect compatibility property always exposes/forces invert semantics. Persistence schema concerns therefore leak into domain behavior and make the model harder to reason about.

This violates KISS, Single Point of Authority and clean separation of concerns.

Target state

Create explicit persisted DTOs owned by the settings/persistence boundary. Deserialize and migrate DTOs, then map them to clean runtime/domain models.

Legacy fields must be interpreted only by the migration layer. Domain models must not carry JSON annotations or legacy compatibility setters.

Acceptance criteria

  • Persisted DTOs and runtime models are separate types.
  • JSON attributes and legacy effect handling exist only in the persistence/migration boundary.
  • Runtime application assignments and visual profiles contain only current product concepts.
  • A single mapper owns conversion between persisted and runtime representations.
  • Existing schema-1 through schema-5 fixtures still load with equivalent behavior.
  • Saving writes only the current schema and no legacy fields.
  • Round-trip and failed-migration tests preserve current transaction guarantees.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions