Skip to content

Separate the parsing domain model from JSON output metadata #13

Description

@coderabbitai

Summary

Separate the pure parsing domain model from JSON serialisation and parser/tool identity metadata.

Rationale

The current src/domain types derive serde::Serialize and use JSON-specific serde renames. ParseReport also embeds parser identity. These format and vendor details couple the domain model to one output adapter.

Affected areas

  • src/domain/
  • src/application.rs
  • JSON output code in src/adapters/
  • Report-schema and consumer compatibility tests

Required changes

  • Remove JSON/Serde annotations from pure domain facts.
  • Move JSON field names and serialisation behaviour into adapter-owned DTOs.
  • Move parser and tool identity metadata out of ParseReport and into the output DTO or output adapter.
  • Map domain facts to the versioned JSON DTO before serialisation.
  • Preserve the existing schema-v1 JSON contract unless an explicit schema migration is introduced.
  • Update documentation and tests for the new boundary.

Acceptance criteria

  • Domain types do not import or derive serde serialisation traits.
  • Domain types do not contain JSON-specific rename attributes.
  • Parser and tool identity metadata is owned by the output boundary, not by pure domain facts.
  • The JSON adapter maps domain facts to a versioned DTO.
  • Schema validation, consumer-shaped deserialisation, and existing report behaviour remain covered by tests.
  • Documentation describes the revised domain and adapter ownership.

Backlinks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions