Skip to content

data-model.md should be the ssot when it comes to the application data model (?) #306

@eumatheusgomes

Description

@eumatheusgomes

My expectation was that once data-model.md was written everything directly or indirectly derived from it would be in sync.

I did several tests using Github Copilot (with Claude Sonnet 4, GPT-5 and Gemini 2.5 Pro) and I always end up with API contracts, API test cases, db migrations and active record models using different field names, which causes Copilot to waste a lot of time debugging and rewriting code.

Example:

  • on data-model.md there's an entity with a field named max_daily_quantity
  • on api-spec.yaml the related entity response schema references the same field as max_daily_usage
  • the related API test case checks for a daily_quantity_limit in the JSON response
  • the related db migration creates a table with a daily_usage_limit column
  • the related active record model has a dailyLimitReached method which expects a daily_limit column

It doesn't get everything wrong all the time ofc. This is an extreme scenario that happened once so far (using Claude). But I could not get all the 5 things in sync yet though.

I'd appreciate some advice on how and where to enforce consistency here.

Metadata

Metadata

Assignees

Labels

enhancementtemplatesRelated to template definition and not the CLI.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions