Skip to content

Investigate DRY approach for TypeScript/Python schema definitions #114

@vredchenko

Description

@vredchenko

Context

From PR #113 discussion: we currently maintain schema definitions in two places:

  • TypeScript types (core/*.ts) - for webui consumption, IDE type checking
  • Python Pydantic models (packages/smartem-workspace/.../schema.py) - for CLI runtime validation

This creates maintenance overhead when schemas change.

Options to explore

  1. JSON Schema as source of truth - generate both TS types and Python models from JSON Schema
  2. Generate Python from TypeScript - tools like ts-to-python
  3. Generate TypeScript from Python - datamodel-code-generator reverse mode
  4. Keep separate - accept manual sync overhead

Acceptance criteria

  • Evaluate each approach for complexity vs benefit
  • Prototype preferred approach
  • Document decision in ADR

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementMinor improvements to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions