Summary
Remove unused Pydantic models User, Session, ClientMeta, and Tag from backend/app/domain/models.py and their re-exports from backend/app/domain/__init__.py.
Background / Context
These four Pydantic models were likely defined as aspirational domain models early in development but never adopted. The codebase works with raw MongoDB documents throughout — the auth system, session management, and tags API all use dicts, not these models.
A full-codebase search confirms zero usage outside their own definitions and __init__.py re-exports:
User (L181-189) — re-exported from domain/__init__.py, never imported elsewhere
Session (L192-199) — re-exported from domain/__init__.py, never imported elsewhere
ClientMeta (L115-117) — only referenced as a field type on the unused Session model
Tag (L202-207) — not even re-exported, never imported anywhere
Problem
Dead code increases cognitive load for developers reading models.py. These models suggest a domain modeling approach that the codebase does not actually follow, which is misleading.
Goal / Expected Behavior
The four unused model classes and their re-exports are removed. No runtime behavior changes.
Scope
This issue should cover:
- Removing
User, Session, ClientMeta, Tag class definitions from domain/models.py
- Removing their re-exports from
domain/__init__.py
- Removing any imports that only existed to support these models (e.g., if
ClientMeta was only imported for Session's type annotation)
Out of Scope
This issue should not cover:
- Removing other models from
models.py that ARE in use
- Refactoring the auth/session/tags system to use Pydantic models
- Changing any production behavior
Chosen Implementation Approach
Straight deletion. Remove the class definitions and their exports. Run tests to confirm nothing breaks.
Implementation Plan
The implementor should:
- Verify zero usage by running:
grep -rn "from app.domain.models import.*User\|from app.domain import.*User\|from app.domain.models import.*Session\|from app.domain import.*Session\|from app.domain.models import.*ClientMeta\|from app.domain import.*ClientMeta\|from app.domain.models import.*Tag\b" backend/app/ backend/tests/
- Remove
ClientMeta class (L115-117) from models.py
- Remove
User class (L181-189) from models.py
- Remove
Session class (L192-199) from models.py
- Remove
Tag class (L202-207) from models.py
- Remove corresponding entries from
domain/__init__.py (both import lines and __all__ entries if present)
- Clean up any orphaned imports in
models.py that were only used by the deleted classes
- Run the full test suite
Relevant Files / Areas
backend/app/domain/models.py — model definitions (delete from here)
backend/app/domain/__init__.py — re-exports (clean up)
Tests Required
The implementor must add or update automated tests covering:
- No new tests are needed — this is pure dead code removal
- All existing tests must pass unchanged
At minimum, tests should verify:
- The full test suite passes:
cd backend && python -m pytest tests/ -v
- The application starts without import errors
Manual Verification / Self-Check
Before claiming this issue is done, the implementor must:
- Run:
cd backend && python -m pytest tests/ -v
- Run:
grep -rn "ClientMeta\|class User\|class Session\|class Tag" backend/app/domain/ to verify no remnants
- Verify
models.py still contains all OTHER models that are in use
- Record the exact commands run and results in the PR description
Reviewer Acceptance Checklist
The reviewer should verify that:
Dependencies
None.
Follow-Up Work
None.
Definition of Done
This issue is done when:
User, Session, ClientMeta, Tag are removed from domain/models.py
- Their re-exports are removed from
domain/__init__.py
- All tests pass
Summary
Remove unused Pydantic models
User,Session,ClientMeta, andTagfrombackend/app/domain/models.pyand their re-exports frombackend/app/domain/__init__.py.Background / Context
These four Pydantic models were likely defined as aspirational domain models early in development but never adopted. The codebase works with raw MongoDB documents throughout — the auth system, session management, and tags API all use dicts, not these models.
A full-codebase search confirms zero usage outside their own definitions and
__init__.pyre-exports:User(L181-189) — re-exported fromdomain/__init__.py, never imported elsewhereSession(L192-199) — re-exported fromdomain/__init__.py, never imported elsewhereClientMeta(L115-117) — only referenced as a field type on the unusedSessionmodelTag(L202-207) — not even re-exported, never imported anywhereProblem
Dead code increases cognitive load for developers reading
models.py. These models suggest a domain modeling approach that the codebase does not actually follow, which is misleading.Goal / Expected Behavior
The four unused model classes and their re-exports are removed. No runtime behavior changes.
Scope
This issue should cover:
User,Session,ClientMeta,Tagclass definitions fromdomain/models.pydomain/__init__.pyClientMetawas only imported forSession's type annotation)Out of Scope
This issue should not cover:
models.pythat ARE in useChosen Implementation Approach
Straight deletion. Remove the class definitions and their exports. Run tests to confirm nothing breaks.
Implementation Plan
The implementor should:
grep -rn "from app.domain.models import.*User\|from app.domain import.*User\|from app.domain.models import.*Session\|from app.domain import.*Session\|from app.domain.models import.*ClientMeta\|from app.domain import.*ClientMeta\|from app.domain.models import.*Tag\b" backend/app/ backend/tests/ClientMetaclass (L115-117) frommodels.pyUserclass (L181-189) frommodels.pySessionclass (L192-199) frommodels.pyTagclass (L202-207) frommodels.pydomain/__init__.py(both import lines and__all__entries if present)models.pythat were only used by the deleted classesRelevant Files / Areas
backend/app/domain/models.py— model definitions (delete from here)backend/app/domain/__init__.py— re-exports (clean up)Tests Required
The implementor must add or update automated tests covering:
At minimum, tests should verify:
cd backend && python -m pytest tests/ -vManual Verification / Self-Check
Before claiming this issue is done, the implementor must:
cd backend && python -m pytest tests/ -vgrep -rn "ClientMeta\|class User\|class Session\|class Tag" backend/app/domain/to verify no remnantsmodels.pystill contains all OTHER models that are in useReviewer Acceptance Checklist
The reviewer should verify that:
__init__.pywere cleaned upDependencies
None.
Follow-Up Work
None.
Definition of Done
This issue is done when:
User,Session,ClientMeta,Tagare removed fromdomain/models.pydomain/__init__.py