Skip to content

feat: Pydantic StrictModel base + example schemas (health, session, config) #18

@constk

Description

@constk

Problem

Every contract crossing a module boundary should reject unknown keys. Without a StrictModel base, individual models can drift from the rule and unknown-key bugs surface only at runtime.

Proposed solution

Port src/models/_base.py (StrictModel(BaseModel) with model_config = ConfigDict(extra="forbid", strict=True)). Add src/models/health.py, src/models/session.py, src/models/config.py. The config module uses Pydantic-Settings with generic env-driven LLM provider config (LLM_PROVIDER, LLM_API_KEY, LLM_BASE_URL, LLM_MODEL). Add tests/test_models.py asserting that unknown keys raise ValidationError.

Acceptance criteria

  • StrictModel definition matches Teller's _base.py byte-for-byte modulo imports.
  • Every example schema inherits from StrictModel.
  • tests/test_models.py covers the extra="forbid" guarantee.
  • config.py does not reference Azure or OpenAI specifically; provider is pluggable via env.

Priority rationale

Critical: invariant 1 of docs/INVARIANTS.md depends on this. The whole "every seam is typed" story rests here.

Depends on

#17

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendPython + FastAPI backend scaffoldenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions