Restructure src into db, emails, and agents/providers packages - #4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andsrc/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 andtemplates/newsletter.py(moved fromutils/).src/agents/providers/: ticker-profile and subject-memory context providers.src/utils/db.py,email_template.py,mailer.py,memory.py,ticker.py.tests/test_newsletters.pyandtests/test_providers.py; renamedtest_db.pytotest_mediapulse.py.How to test
conda run -n agentic-mediapulse python -m pytestfrom the repo root — 93 tests should pass.cd email-playground && npm run build:templatesto regenerate the HTML, then re-run pytest.