Skip to content
2 min read · 403 words

Module 6: Production Mastery

**Advanced**  ·  **~35 min**  ·  **7 lessons**

Overview

This module is the closest thing this course has to a code review. Every lesson is grounded in what's actually in backend/app/ — including the topics where the honest answer is "not implemented." You'll get a ranked, source-grounded security audit, three concrete verified performance costs (not generic advice), and a real testing strategy for a codebase that currently has zero tests.

What You'll Learn

  • The ToolCall/AgentRun/WorkflowRun observability model and exactly where its coverage gaps are
  • The repeated try/log/re-raise exception pattern, and the one endpoint that breaks it on purpose
  • How you'd test each layer of this codebase, starting from the cheapest, highest-value tests
  • Three real performance costs found by reading the source: sequential embedding calls, Python-side aggregation, missing indexes
  • A ranked security audit: no auth, no CORS, no rate limiting — and what's not actually a risk here (SQL injection)
  • Every real os.getenv call in the codebase, and what's hardcoded instead

Prerequisites

Lessons in This Module

#LessonWhat it covers
21Logging & ObservabilityThe ToolCall model and its coverage gaps
22Exception HandlingThe repeated pattern, and the one exception to it
23TestingConfirmed absent — a real strategy per layer
24PerformanceThree verified, concrete costs
25SecurityA ranked, source-grounded audit
26CachingConfirmed absent — where it would and wouldn't help
27Configuration & Environment VariablesEvery real env var, and what's hardcoded

Learning Outcomes

By the end of this module you can:

  • Explain why the dashboard endpoint's cost total systematically undercounts real spend
  • Rewrite the dashboard's Python-side aggregation as a single grouped SQL query
  • Rank this backend's top three security gaps by actual severity, not by checklist order
  • Name all three real environment variables this backend reads, and the two hardcoded values that should be one

Start Module → Back to Module 5