# arlishansenn/podsum architecture

> Architecture diagram of the GitHub repository arlishansenn/podsum, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arlishansenn/podsum
- Repository: https://github.com/arlishansenn/podsum

## Overview

1. **Overall shape**
   - This repo is a stateful content-processing pipeline, not a traditional app.
   - Its primary purpose is to take audio or email inputs, transform them locally, generate Hermes-based interpretations/summaries, convert the result to EPUB, and deliver it to a configured target.
   - The architecture is split between a reusable Python core, operational wrappers in `outputs/`, Hermes skill assets in `skills/`, and tests/fixtures.

2. **Main production domain: podcast pipeline**
   - The podcast flow is the core path described in the README: RSS feed discovery, episode download, local transcription with `mlx-whisper`, Hermes interpretation, markdown aggregation, EPUB generation, and delivery.
   - The key statefulness is that each stage records progress so interrupted runs can resume instead of restarting from scratch.
   - The repo-level configuration for production execution lives under `outputs/` alongside launchd plist templates and feed configuration.

3. **Email summary pipeline as a second workflow**
   - The email feature is an opt-in parallel pipeline that reuses the same final delivery mechanism as podcast reports.
   - It scans IMAP/Gmail messages, produces a structured scan JSON, generates a Hermes summary, converts that to EPUB, then sends it through the Podsum target.
   - This subsystem is intentionally supported by offline acceptance tests using sanitized `.eml` fixtures rather than real mailbox access.

4. **Core reusable Python package**
   - `outputs/podsum_core/` holds shared implementation used by the production workflows.
   - `delivery/hermes_adapter.py` is the integration boundary to Hermes-based processing and delivery orchestration.
   - `epub_converter/` contains the markdown-to-EPUB path, with preprocessing and markdown normalization split into separate modules.

5. **Operational entrypoints and runners**
   - `outputs/podsum.py`, `outputs/podsum_runtime.py`, `outputs/podsum_send_to_feishu.py`, and `outputs/podcast_downloader.py` are the concrete runtime-facing scripts.
   - `outputs/podsum_email_summary.py`, `outputs/podsum_email_workbench.py`, and `outputs/podsum_email_fixture_tool.py` support the email workflow and its local tooling.
   - The launchd plist files in `outputs/` show that the project is designed to run as scheduled macOS jobs, with one launcher per major task.

6. **Email processing subsystem**
   - `outputs/email/` is a self-contained package for the email summary feature.
   - It is structured around agents and shared state: `brief_agent.py`, `evidence_agent.py`, `graph.py`, `need_store.py`, `providers.py`, and `schemas.py`.
   - Supporting files such as `email_mailparser_cleaner.js`, `email_summary_prompt.md`, and `email_evidence_preprocess_prompt.md` indicate a pipeline that preprocesses raw mail, extracts evidence, and assembles the final LLM/Hermes prompt inputs.

7. **Transcript cleaning as a separate product boundary**
   - `outputs/transcript_cleaner/` is explicitly described as an independent project.
   - It has its own `README.md`, `PRD.md`, CLI entrypoints, EPUB support, and cleaner implementation, so it should be treated as a sibling subsystem rather than a helper library.
   - The `skills/media/make-markdown-readable/` skill copies are used by this workflow for Markdown cleanup and EPUB export.

8. **Hermes skills as an externalized integration layer**
   - The repo owns project-specific copies of Hermes skills under `skills/`.
   - The two important skills are readable-Markdown cleanup/export and Feishu file delivery; the README says these copies are the source of truth.
   - This means Hermes behavior is not embedded solely in Python code; part of the processing logic lives in skill documents and scripts that the runtime installs into the active Hermes profile.

9. **Delivery boundary**
   - Delivery is abstracted as a final stage rather than hardcoded into each workflow.
   - The Feishu-specific path is represented by `skills/social-media/hermes-feishu-file-send/` and related output scripts, while the core pipeline talks to a delivery adapter in `podsum_core/delivery/`.
   - That makes “generate content” and “send content” separate architectural concerns.

10. **Configuration and deployment**
   - The repo is deployment-aware: `outputs/README.md`, launchd plist templates, and `outputs/feeds.json` define how the pipeline runs in practice.
   - `scripts/install-hermes-skills.sh` is part of the operational story, ensuring Hermes skill copies are installed into the correct profile.
   - `outputs/podsum.env.example` indicates environment-variable-driven runtime configuration, with `PODSUM_PYTHON` called out as a required boundary to the application virtualenv.

11. **Testing and fixtures**
   - `tests/test_podsum_cli.py` and `tests/test_transcript_cleaner.py` cover the two major executable surfaces.
   - Email behavior is validated with `.eml` fixtures and scan JSON fixtures under `tests/fixtures/`, which shows the email pipeline is designed to be testable without live external services.
   - This fixture strategy is important for understanding the architecture: parsing and summarization are isolated from transport and mailbox access.

12. **Data flow summary for an architecture diagram**
   - For podcasts: RSS feed config → download audio → local transcription → Hermes interpretation → markdown merge → EPUB conversion → delivery target → persisted run state.
   - For email: mailbox scan → structured scan JSON → evidence/brief generation → Hermes summary → EPUB conversion → same delivery target.
   - The shared end of both flows is the EPUB/delivery boundary, while the upstream collectors/transcribers differ by source type.

13. **Key architectural boundaries to draw**
   - Separate source collectors: RSS/audio vs. mailbox/email.
   - Separate transformation engines: transcription and email parsing/agent graph.
   - Shared content assembly: markdown and EPUB generation.
   - Shared delivery mechanism: Hermes-driven send stage, including Feishu integration.
   - Shared operational state and resumability: outputs and runtime artifacts are part of the product, not just build outputs.

14. **What is intentionally not the core**
   - There is no indication of a traditional web server, database service, or user-facing UI in this repo.
   - The central runtime model is batch, scheduled, and file-oriented, with local processing and external service calls only at the input/output edges.

Main entry points: [`outputs/email/graph.py`](https://github.com/arlishansenn/podsum/blob/main/outputs/email/graph.py) (Agent graph), [`outputs/podsum.py`](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum.py) (Podsum runtime), [`outputs/podsum_email_summary.py`](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_email_summary.py) (Email summary CLI), [`outputs/transcript_cleaner/cli.py`](https://github.com/arlishansenn/podsum/blob/main/outputs/transcript_cleaner/cli.py) (Transcript CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_outputs["Outputs & Runtimes"]
  node_node_podcast_runtime["Podsum runtime<br/>batch runner<br/>[podsum.py]"]
  node_node_podcast_downloader["Podcast downloader<br/>feed collector"]
  node_node_runtime_shell["Runtime shell<br/>job orchestration<br/>[podsum_runtime.py]"]
  node_node_feishu_send["Feishu sender<br/>delivery runner"]
  node_node_email_summary["Email summary CLI<br/>email runner"]
  node_node_email_workbench["Email workbench<br/>local tooling"]
  node_node_email_fixture_tool["Fixture tool"]
  node_node_feeds_config["Feeds config<br/>runtime config<br/>[feeds.json]"]
end

subgraph group_group_core["Shared Core"]
  node_node_core_epub["EPUB generator<br/>content builder<br/>[epub_generator.py]"]
  node_node_core_markdown["Markdown processor<br/>content normalization"]
  node_node_core_preprocess["Preprocess<br/>[preprocess.py]"]
  node_node_core_delivery["Hermes adapter<br/>delivery integration<br/>[hermes_adapter.py]"]
end

subgraph group_group_email["Email Pipeline"]
  node_node_email_graph["Agent graph<br/>email pipeline<br/>[graph.py]"]
  node_node_email_brief["Brief agent<br/>email agent<br/>[brief_agent.py]"]
  node_node_email_evidence["Evidence agent<br/>email agent<br/>[evidence_agent.py]"]
  node_node_email_state[("Need store<br/>shared state<br/>[need_store.py]")]
  node_node_email_providers["Providers<br/>mail adapters<br/>[providers.py]"]
  node_node_email_schemas["Schemas<br/>data model<br/>[schemas.py]"]
  node_node_email_io["Email I/O<br/>mail parsing<br/>[io.py]"]
end

subgraph group_group_transcript["Transcript Cleaner"]
  node_node_transcript_cli["Transcript CLI<br/>standalone cli<br/>[cli.py]"]
  node_node_transcript_cleaner["Cleaner<br/>transcript transform<br/>[cleaner.py]"]
  node_node_transcript_epub["Transcript EPUB<br/>epub export<br/>[epub.py]"]
end

subgraph group_group_skills["Hermes Skills"]
  node_node_skill_markdown["Readable markdown<br/>hermes skill<br/>[SKILL.md]"]
  node_node_skill_feishu["Feishu send skill<br/>hermes skill<br/>[SKILL.md]"]
end

subgraph group_group_tests["Tests & Fixtures"]
  node_node_test_cli["CLI tests<br/>pytest<br/>[test_podsum_cli.py]"]
  node_node_test_transcript["Transcript tests<br/>pytest"]
end

node_node_podcast_runtime -->|"downloads"| node_node_podcast_downloader
node_node_podcast_runtime -->|"interprets & sends"| node_node_core_delivery
node_node_podcast_runtime -->|"builds EPUB"| node_node_core_epub
node_node_podcast_runtime -->|"reads feeds"| node_node_feeds_config
node_node_runtime_shell -->|"wraps"| node_node_podcast_runtime
node_node_runtime_shell -->|"launches"| node_node_feishu_send
node_node_email_summary -->|"coordinates"| node_node_email_graph
node_node_email_graph -->|"uses"| node_node_email_brief
node_node_email_graph -->|"uses"| node_node_email_evidence
node_node_email_graph -->|"persists"| node_node_email_state
node_node_email_graph -->|"ingests"| node_node_email_providers
node_node_email_graph -->|"structures"| node_node_email_schemas
node_node_email_summary -->|"exports EPUB"| node_node_core_epub
node_node_email_summary -->|"delivers"| node_node_core_delivery
node_node_email_io -->|"parses input"| node_node_email_providers
node_node_email_io -->|"emits"| node_node_email_schemas
node_node_transcript_cli -->|"runs"| node_node_transcript_cleaner
node_node_transcript_cli -->|"exports"| node_node_transcript_epub
node_node_transcript_cleaner -->|"uses skill"| node_node_skill_markdown
node_node_transcript_epub -->|"uses skill"| node_node_skill_markdown
node_node_core_delivery -->|"bridges"| node_node_skill_feishu
node_node_core_epub -->|"depends on"| node_node_core_markdown
node_node_core_markdown -->|"depends on"| node_node_core_preprocess
node_node_feishu_send -->|"invokes"| node_node_skill_feishu
node_node_podcast_downloader -->|"feeds"| node_node_core_preprocess
node_node_test_cli -.->|"covers"| node_node_podcast_runtime
node_node_test_transcript -.->|"covers"| node_node_transcript_cli

click node_node_podcast_runtime "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum.py"
click node_node_podcast_downloader "https://github.com/arlishansenn/podsum/blob/main/outputs/podcast_downloader.py"
click node_node_runtime_shell "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_runtime.py"
click node_node_feishu_send "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_send_to_feishu.py"
click node_node_email_summary "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_email_summary.py"
click node_node_email_workbench "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_email_workbench.py"
click node_node_email_fixture_tool "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_email_fixture_tool.py"
click node_node_feeds_config "https://github.com/arlishansenn/podsum/blob/main/outputs/feeds.json"
click node_node_core_epub "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/epub_converter/epub_generator.py"
click node_node_core_markdown "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/epub_converter/markdown_processor.py"
click node_node_core_preprocess "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/epub_converter/preprocess.py"
click node_node_core_delivery "https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/delivery/hermes_adapter.py"
click node_node_email_graph "https://github.com/arlishansenn/podsum/blob/main/outputs/email/graph.py"
click node_node_email_brief "https://github.com/arlishansenn/podsum/blob/main/outputs/email/brief_agent.py"
click node_node_email_evidence "https://github.com/arlishansenn/podsum/blob/main/outputs/email/evidence_agent.py"
click node_node_email_state "https://github.com/arlishansenn/podsum/blob/main/outputs/email/need_store.py"
click node_node_email_providers "https://github.com/arlishansenn/podsum/blob/main/outputs/email/providers.py"
click node_node_email_schemas "https://github.com/arlishansenn/podsum/blob/main/outputs/email/schemas.py"
click node_node_email_io "https://github.com/arlishansenn/podsum/blob/main/outputs/email/io.py"
click node_node_transcript_cli "https://github.com/arlishansenn/podsum/blob/main/outputs/transcript_cleaner/cli.py"
click node_node_transcript_cleaner "https://github.com/arlishansenn/podsum/blob/main/outputs/transcript_cleaner/cleaner.py"
click node_node_transcript_epub "https://github.com/arlishansenn/podsum/blob/main/outputs/transcript_cleaner/epub.py"
click node_node_skill_markdown "https://github.com/arlishansenn/podsum/blob/main/skills/media/make-markdown-readable/SKILL.md"
click node_node_skill_feishu "https://github.com/arlishansenn/podsum/blob/main/skills/social-media/hermes-feishu-file-send/SKILL.md"
click node_node_test_cli "https://github.com/arlishansenn/podsum/blob/main/tests/test_podsum_cli.py"
click node_node_test_transcript "https://github.com/arlishansenn/podsum/blob/main/tests/test_transcript_cleaner.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_podcast_runtime,node_node_podcast_downloader,node_node_runtime_shell,node_node_feishu_send,node_node_email_summary,node_node_email_workbench,node_node_email_fixture_tool,node_node_feeds_config toneBlue
class node_node_core_epub,node_node_core_markdown,node_node_core_preprocess,node_node_core_delivery toneAmber
class node_node_email_graph,node_node_email_brief,node_node_email_evidence,node_node_email_state,node_node_email_providers,node_node_email_schemas,node_node_email_io toneMint
class node_node_transcript_cli,node_node_transcript_cleaner,node_node_transcript_epub toneRose
class node_node_skill_markdown,node_node_skill_feishu toneIndigo
class node_node_test_cli,node_node_test_transcript toneTeal
```

## Components

### Outputs & Runtimes

Production entrypoints, job configs, and runtime state.

- [Podsum runtime](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum.py): batch runner · Main podcast processing entrypoint with resumable run state. · `outputs/podsum.py`
- [Podcast downloader](https://github.com/arlishansenn/podsum/blob/main/outputs/podcast_downloader.py): feed collector · Discovers feeds and downloads episode audio for the podcast flow. · `outputs/podcast_downloader.py`
- [Runtime shell](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_runtime.py): job orchestration · Operational wrapper for scheduled runs and environment wiring. · `outputs/podsum_runtime.py`
- [Feishu sender](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_send_to_feishu.py): delivery runner · Concrete script for sending generated files to Feishu. · `outputs/podsum_send_to_feishu.py`
- [Email summary CLI](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_email_summary.py): email runner · Entry script for generating email summaries end to end. · `outputs/podsum_email_summary.py`
- [Email workbench](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_email_workbench.py): local tooling · Interactive tooling for inspecting and iterating on email processing. · `outputs/podsum_email_workbench.py`
- [Fixture tool](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_email_fixture_tool.py): fixture tooling · Utility for working with email summary fixtures offline. · `outputs/podsum_email_fixture_tool.py`
- [Feeds config](https://github.com/arlishansenn/podsum/blob/main/outputs/feeds.json): runtime config · Podcast feed definitions and operational runtime inputs. · `outputs/feeds.json`

### Shared Core

Reusable EPUB and delivery logic shared by workflows.

- [EPUB generator](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/epub_converter/epub_generator.py): content builder · Markdown-to-EPUB pipeline used by both major workflows. · `outputs/podsum_core/epub_converter/epub_generator.py`
- [Markdown processor](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/epub_converter/markdown_processor.py): content normalization · Normalizes and assembles markdown before EPUB generation. · `outputs/podsum_core/epub_converter/markdown_processor.py`
- [Preprocess](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/epub_converter/preprocess.py): content preprocessing · Prepares raw content for downstream EPUB conversion. · `outputs/podsum_core/epub_converter/preprocess.py`
- [Hermes adapter](https://github.com/arlishansenn/podsum/blob/main/outputs/podsum_core/delivery/hermes_adapter.py): delivery integration · Shared boundary for Hermes-driven interpretation and delivery orchestration. · `outputs/podsum_core/delivery/hermes_adapter.py`

### Email Pipeline

Mailbox scanning, evidence extraction, and summary generation.

- [Agent graph](https://github.com/arlishansenn/podsum/blob/main/outputs/email/graph.py): email pipeline · Coordinates brief, evidence, and shared state for email summarization. · `outputs/email/graph.py`
- [Brief agent](https://github.com/arlishansenn/podsum/blob/main/outputs/email/brief_agent.py): email agent · Creates the compact summary layer for mailbox content. · `outputs/email/brief_agent.py`
- [Evidence agent](https://github.com/arlishansenn/podsum/blob/main/outputs/email/evidence_agent.py): email agent · Extracts supporting evidence and source detail from messages. · `outputs/email/evidence_agent.py`
- [Need store](https://github.com/arlishansenn/podsum/blob/main/outputs/email/need_store.py): shared state · Persists intermediate needs and progress for the email workflow. · `outputs/email/need_store.py`
- [Providers](https://github.com/arlishansenn/podsum/blob/main/outputs/email/providers.py): mail adapters · Mailbox and provider access layer for email ingestion. · `outputs/email/providers.py`
- [Schemas](https://github.com/arlishansenn/podsum/blob/main/outputs/email/schemas.py): data model · Structured records for scans, evidence, and summary inputs. · `outputs/email/schemas.py`
- [Email I/O](https://github.com/arlishansenn/podsum/blob/main/outputs/email/io.py): mail parsing · Input/output utilities for mailbox messages and scan artifacts. · `outputs/email/io.py`

### Transcript Cleaner

Standalone transcript cleanup and EPUB export subsystem.

- [Transcript CLI](https://github.com/arlishansenn/podsum/blob/main/outputs/transcript_cleaner/cli.py): standalone cli · Independent transcript-cleaner command surface. · `outputs/transcript_cleaner/cli.py`
- [Cleaner](https://github.com/arlishansenn/podsum/blob/main/outputs/transcript_cleaner/cleaner.py): transcript transform · Core transcript cleanup implementation. · `outputs/transcript_cleaner/cleaner.py`
- [Transcript EPUB](https://github.com/arlishansenn/podsum/blob/main/outputs/transcript_cleaner/epub.py): epub export · EPUB export path for the transcript-cleaner subsystem. · `outputs/transcript_cleaner/epub.py`

### Hermes Skills

Externalized skill copies installed into Hermes profiles.

- [Readable markdown](https://github.com/arlishansenn/podsum/blob/main/skills/media/make-markdown-readable/SKILL.md): hermes skill · Hermes skill copy for markdown cleanup and EPUB export. · `skills/media/make-markdown-readable/SKILL.md`
- [Feishu send skill](https://github.com/arlishansenn/podsum/blob/main/skills/social-media/hermes-feishu-file-send/SKILL.md): hermes skill · Hermes skill copy for safe file preparation and Feishu delivery. · `skills/social-media/hermes-feishu-file-send/SKILL.md`

### Tests & Fixtures

Executable surfaces and offline fixture coverage.

- [CLI tests](https://github.com/arlishansenn/podsum/blob/main/tests/test_podsum_cli.py): pytest · Coverage for the podcast/runtime command surfaces. · `tests/test_podsum_cli.py`
- [Transcript tests](https://github.com/arlishansenn/podsum/blob/main/tests/test_transcript_cleaner.py): pytest · Coverage for the standalone transcript cleaner. · `tests/test_transcript_cleaner.py`

## Connections

- Podsum runtime → Podcast downloader: downloads · Podcast runs start by collecting and downloading episode audio.
- Podsum runtime → Hermes adapter: interprets & sends · The main run delegates Hermes interpretation and delivery orchestration.
- Podsum runtime → EPUB generator: builds EPUB · Final podcast output is assembled into EPUB.
- Podsum runtime → Feeds config: reads feeds · Feed discovery and scheduling are driven by repo configuration.
- Runtime shell → Podsum runtime: wraps · Operational launcher around the main batch runner.
- Runtime shell → Feishu sender: launches · Scheduled runtime also exposes the delivery job surface.
- Email summary CLI → Agent graph: coordinates · Email summary entrypoint executes the agent graph.
- Agent graph → Brief agent: uses · The graph invokes the brief-generation agent.
- Agent graph → Evidence agent: uses · The graph invokes the evidence-extraction agent.
- Agent graph → Need store: persists · Intermediate needs and progress are stored for resumability.
- Agent graph → Providers: ingests · Mailbox/provider access feeds the summary pipeline.
- Agent graph → Schemas: structures · Structured scan and summary data are defined by schemas.
- Email summary CLI → EPUB generator: exports EPUB · Email summaries share the common EPUB generation boundary.
- Email summary CLI → Hermes adapter: delivers · Email summaries use the shared Hermes delivery adapter.
- Email I/O → Providers: parses input · Mailbox data is normalized into pipeline-ready form.
- Email I/O → Schemas: emits · Scan artifacts are represented as structured records.
- Transcript CLI → Cleaner: runs · CLI entrypoint drives transcript cleanup.
- Transcript CLI → Transcript EPUB: exports · Standalone tool can emit EPUB output.
- Cleaner → Readable markdown: uses skill · Transcript cleanup relies on the markdown-readability skill copy.
- Transcript EPUB → Readable markdown: uses skill · EPUB export is aligned with the markdown cleanup skill assets.
- Hermes adapter → Feishu send skill: bridges · Shared delivery adapter connects to Feishu skill-based sending.
- EPUB generator → Markdown processor: depends on · EPUB generation consumes normalized markdown.
- Markdown processor → Preprocess: depends on · Markdown processing is preceded by preprocessing.
- Feishu sender → Feishu send skill: invokes · Concrete sender script uses the Feishu skill implementation.
- Podcast downloader → Preprocess: feeds · Downloaded source material enters the shared preprocessing path.
- CLI tests → Podsum runtime: covers · Tests validate the primary podcast/runtime surface.
- Transcript tests → Transcript CLI: covers · Tests validate the standalone transcript cleaner CLI.
