promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

The HaaS shift — Harness-as-a-Service and what to build vs buy — step 9 of 9

Checkpoint

One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.

Final checkpoint for the chapter. Write portfolio_route(projects) that takes a list of project profiles and returns a routing decision plus a per-runtime count.

Each project has: name, team_size, latency_critical (bool), vertical_constraints (bool), language.

Use the same decision rules as the previous drill:

  1. tiny solo + no vertical constraints → "build-your-own"
  2. TypeScript + no vertical constraints → "vercel-ai-sdk"
  3. Python + (latency_critical OR vertical) → "build-your-own"
  4. Python (otherwise) → "claude-agents-sdk"
  5. anything else + latency_critical → "build-your-own"
  6. anything else → "openai-agents-sdk"

Return a dict with two fields:

  • routes: dict mapping project name → recommended runtime (insertion order preserved)
  • counts: dict mapping runtime → count of projects using it (insertion order = first-seen order)

Five projects run. Expected output:

routes: {'frontend-agent': 'vercel-ai-sdk', 'support-bot': 'claude-agents-sdk', 'side-project': 'build-your-own', 'trading-helper': 'build-your-own', 'data-pipeline': 'claude-agents-sdk'}
counts: {'vercel-ai-sdk': 1, 'claude-agents-sdk': 2, 'build-your-own': 2}

full-screen editor opens — close anytime to keep reading.