You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add email-playground as the visual source-of-truth for email templates (#2)
Introduces a React Email + Tailwind TypeScript project under email-playground/ that owns the newsletter design. A generic build script renders tokenized HTML into src/templates/ (gitignored), which Python fills at send time instead of hand-building HTML. The template is regenerated in CI and the multi-stage Dockerfile so the runtime image always gets a fresh build.
-`src/agents/` — one module per agent (`analyst`, `researcher`, `writer`, `editor`, `managing_editor`, `reviewer`), plus `beats.py` (beat desks), `campaign.py` (top-level run over subscriptions), and `tools/` (Serper search, web fetch).
17
17
-`src/agents/skills/` — `SKILL.md` files that control agent behavior (`subject-profile`, `section-research`, `newsletter-format`). Prefer editing these over code when changing how agents research or write.
18
-
-`src/utils/` — `db.py` (subscriptions/tickers from the Mediapulse Postgres), `memory.py`, `client.py`, `guardrails.py`, `sections.py`, `mailer.py`, `email_template.py`, `ticker.py`.
18
+
-`src/utils/` — `db.py` (subscriptions/tickers from the MediaPulse Postgres), `memory.py`, `client.py`, `guardrails.py`, `sections.py`, `mailer.py`, `email_template.py`, `ticker.py`. `email_template.py` no longer hand-builds HTML: it parses the newsletter markdown and fills the tokenized template at `src/templates/newsletter.html`.
19
+
-`email-playground/` — a standalone React Email (TypeScript) project that is the visual source-of-truth for MediaPulse email templates (the newsletter is the first one). `npm run build:templates` renders each template to a tokenized `src/templates/<name>.html` that the Python side consumes (`email_template.py` for the newsletter). Those HTML files are gitignored build artifacts, regenerated fresh in CI and the Docker build. Restyle emails there, not in Python. See `email-playground/README.md`.
19
20
-`tests/` — pytest suite covering the deterministic logic (see Testing below).
20
21
21
22
## Setup
@@ -56,6 +57,12 @@ pytest # whole suite
56
57
conda run -n agentic-mediapulse pytest # if pytest is not on PATH
57
58
```
58
59
60
+
The email-template tests read `src/templates/newsletter.html`, which is gitignored and generated by the playground. Build it once before running the suite locally (CI does this in the `tests` job):
61
+
62
+
```
63
+
cd email-playground && npm install && npm run build:templates
64
+
```
65
+
59
66
Config is in `pyproject.toml` under `[tool.pytest.ini_options]`: `pythonpath = ["src"]`, `testpaths = ["tests"]`, `asyncio_mode = "auto"` (async tests need no decorator). CI runs `pytest` in a separate `tests` job after installing both requirement files.
60
67
61
68
The suite covers the deterministic logic, not the LLM agents: orchestrator text/section helpers, the email template, Serper tools, the DB profile shaping, guardrail middleware, memory/ticker context providers, the mailer, the client model resolution, and the campaign delivery flow. Conventions for new tests:
@@ -78,5 +85,5 @@ The suite covers the deterministic logic, not the LLM agents: orchestrator text/
78
85
## External services
79
86
80
87
-`SERPER_API_KEY` — web search.
81
-
-`MEDIAPULSE_DATABASE_URL` — Postgres for subscriptions and ticker data; schema is defined in the upstream [Mediapulse](https://github.com/hyperjumptech/mediapulse) repo.
88
+
-`MEDIAPULSE_DATABASE_URL` — Postgres for subscriptions and ticker data; schema is defined in the upstream [MediaPulse](https://github.com/hyperjumptech/mediapulse) repo.
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# agentic-mediapulse
2
2
3
-
A simpler, agentic version of [Mediapulse](https://github.com/hyperjumptech/mediapulse). Give it a subject — a stock ticker, a company name, or an industry theme — and a newsroom of focused agents researches, writes, and edits a locale-aware briefing across five editorial sections, with every claim traced to a real source.
3
+
A simpler, agentic version of [MediaPulse](https://github.com/hyperjumptech/mediapulse). Give it a subject — a stock ticker, a company name, or an industry theme — and a newsroom of focused agents researches, writes, and edits a locale-aware briefing across five editorial sections, with every claim traced to a real source.
4
4
5
5
## Setup
6
6
@@ -34,7 +34,7 @@ A simpler, agentic version of [Mediapulse](https://github.com/hyperjumptech/medi
34
34
|`REDIS_URL`| Subject-memory store — default `redis://localhost:6379/0`| Yes |
|`RESEND_API_KEY`| Resend key for email delivery | Yes |
37
-
|`EMAIL_FROM`| Sender address, e.g. `Mediapulse <hello@example.com>`| Yes |
37
+
|`EMAIL_FROM`| Sender address, e.g. `MediaPulse <hello@example.com>`| Yes |
38
38
|`SECRET_KEY`| Required on every API request (`X-API-Key` header) | Yes |
39
39
|`ANALYST_MODEL`| Model override for the analyst — falls back to `OPENAI_MODEL`| No |
40
40
|`RESEARCHER_MODEL`| Model override for the researcher — falls back to `OPENAI_MODEL`| No |
@@ -120,4 +120,4 @@ To change how an agent writes or researches, edit its skill file in `src/agents/
120
120
121
121
## Database
122
122
123
-
Subscriptions and ticker data are read from the [Mediapulse](https://github.com/hyperjumptech/mediapulse) database. Set `MEDIAPULSE_DATABASE_URL` to your Mediapulse Postgres connection string — the schema is defined in that repo.
123
+
Subscriptions and ticker data are read from the [MediaPulse](https://github.com/hyperjumptech/mediapulse) database. Set `MEDIAPULSE_DATABASE_URL` to your MediaPulse Postgres connection string — the schema is defined in that repo.
0 commit comments