feat(podcast): render the episode from the agents' own script
deploy / test (push) Successful in 4m32s
deploy / build (push) Successful in 5m25s

GenFM is unreachable. `GET /v1/studio/projects` and `POST /v1/studio/podcasts`
both return 403 — "Access to the Studio API requires your account to be
explicitly whitelisted to use it. Please contact our sales team." Measured with
two different keys on the account, so it is an account restriction, not a key
scope. Plain text-to-speech on the same key returns a valid MP3.

That suits the operator's choice better than GenFM would have. GenFM always runs
its own LLM over the source, so the agents' script would have been REWRITTEN;
rendering each line ourselves speaks it verbatim. The agents did the reading and
the judging, and the episode says what they wrote.

`AudioBackend` is a trait because every candidate has a different shape:
NotebookLM documents no programmatic retrieval at all, GenFM needs a sales
conversation, Gemini TTS is a third form. The renderer hands over a `Script` and
gets bytes.

`parse_script` is a parser rather than a `read_to_string` because structure must
not be spoken: headings, rules and block quotes are skipped, a wrapped paragraph
stays ONE turn (splitting per line would stutter at the seam), and a colon mid
sentence does not start a new speaker — "The finding: recall dropped" would
otherwise be truncated to everything after the colon. Voices are assigned by
order of appearance, so a script using names instead of HOST/GUEST still
alternates, and an unexpected third speaker falls back rather than failing.

`from_env` returns None without a key, so a deployment with none produces no
audio instead of failing a mission that otherwise succeeded.

Proven end to end on the real script this morning's mission wrote: 25 turns,
887 words, 5,614 billable characters, 6.1 MB of MP3 in 33 seconds. The live test
drives `parse_script` + `ElevenLabs::render` — the production path — and is
`#[ignore]`d because it spends credits.

359 tests pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
Omar Sobh
2026-08-18 08:19:26 -07:00
co-authored by Claude Opus 5
parent 850f11838b
commit 656662850d
2 changed files with 347 additions and 0 deletions
+1
View File
@@ -26,6 +26,7 @@ pub mod microvm_executor;
pub mod microvm_turn_executor;
pub mod continuous_research;
pub mod mission_delivery;
pub mod podcast;
pub mod mission_events;
pub mod mission_fs;
pub mod mission_gc;