Skip to content

Restructure src into db, emails, and agents/providers packages - #4

Merged
kevinhermawan merged 1 commit into
mainfrom
refactor/restructure-src-packages
Jun 18, 2026
Merged

Restructure src into db, emails, and agents/providers packages#4
kevinhermawan merged 1 commit into
mainfrom
refactor/restructure-src-packages

Conversation

@kevinhermawan

Copy link
Copy Markdown
Collaborator

Summary

Moves the flat src/utils/ modules into purpose-built packages: src/db/ for all database access, src/emails/ for the mailer and template rendering, and src/agents/providers/ for the context-provider layer (ticker profile and subject memory). All imports are updated, and the test suite is expanded to cover the new module boundaries.

Related issues

Closes #3

Changes

  • src/db/: engine, MediaPulse reads (mediapulse.py), newsletter archive (newsletters.py), subject memory (memory.py).
  • src/emails/: mailer and templates/newsletter.py (moved from utils/).
  • src/agents/providers/: ticker-profile and subject-memory context providers.
  • Removed src/utils/db.py, email_template.py, mailer.py, memory.py, ticker.py.
  • Added tests/test_newsletters.py and tests/test_providers.py; renamed test_db.py to test_mediapulse.py.

How to test

  1. conda run -n agentic-mediapulse python -m pytest from the repo root — 93 tests should pass.
  2. cd email-playground && npm run build:templates to regenerate the HTML, then re-run pytest.

Moves flat utils/ modules into purpose-built packages: src/db/ for all database
access (engine, MediaPulse reads, newsletter archive, subject memory),
src/emails/ for mailer and template rendering, and src/agents/providers/ for
the context-provider layer (ticker profile, subject memory). Updates all imports,
adds a newsletters store and subject-memory upsert with in-memory SQLite tests,
and expands the test suite to cover the new module boundaries.
@kevinhermawan
kevinhermawan merged commit b9edca9 into main Jun 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restructure src/ into db, emails, and agents/providers packages

1 participant