Skip to content

feat: runnable onboarding quickstart, recipes, and fixtures (issue #32)#47

Open
levleontiev wants to merge 21 commits intomainfrom
feature/issue-32-quickstart
Open

feat: runnable onboarding quickstart, recipes, and fixtures (issue #32)#47
levleontiev wants to merge 21 commits intomainfrom
feature/issue-32-quickstart

Conversation

@levleontiev
Copy link
Contributor

Summary

Implements #32 — packages the edge repo as a runnable onboarding funnel.

What's added:

  • examples/quickstart/docker compose up -d quickstart (wrapper mode, standalone). Reusable as the base for e2e-smoke CI. Demonstrates /openai/v1/chat/completions with Bearer CLIENT_JWT:UPSTREAM_KEY composite auth.
  • examples/recipes/team-budgets/ — per-team JWT TPM + 30-day cost budget with staged warn/throttle/reject
  • examples/recipes/runaway-agent-guard/ — loop detector + TPM guard keyed on jwt:agent_id
  • examples/recipes/provider-failover/ — dual-provider policies (OpenAI + circuit breaker, Anthropic fallback)
  • fixtures/ — 10 canonical artifacts:
    • normal_request.json, over_limit_request.json, anthropic_normal_request.json
    • allow_response.json (proves auth-header stripping: no Authorization/x-api-key/x-goog-api-key in response)
    • reject_tpm_exceeded.json, reject_tpd_exceeded.json, reject_prompt_too_large.json
    • reject_openai.json, reject_anthropic.json, reject_gemini.json (provider-native bodies)
  • README: quickstart pointer, updated project layout, benchmark link → fairvisor/benchmark

Spec 019 / wrapper mode coverage:

  • Quickstart uses FAIRVISOR_MODE=wrapper and provider-prefixed paths (/openai/v1/...)
  • allow_response.json explicitly documents auth-header stripping
  • reject_anthropic.json and reject_gemini.json prove provider-native error bodies
  • Business event vs. request log distinction preserved (no audit-event drift)

Acceptance criteria met:

  • docker compose up -d + curl to /openai/v1/chat/completions with over-limit fixture → 429 matching fixtures/reject_tpm_exceeded.json
  • Same path with normal fixture → 200 ✓
  • One canonical repo-owned path from clone to result ✓
  • examples/ read as deployable recipes, not disconnected policy fragments ✓
  • Benchmark links to fairvisor/benchmark instead of duplicating methodology ✓

Downstream: Fixture paths and compose structure are stable — ready to coordinate with fairvisor/documentation#8.

Test plan

  • docker compose -f examples/quickstart/docker-compose.yml up -d starts healthy
  • curl to /openai/v1/chat/completions with over_limit_request.json returns 429 with body matching fixtures/reject_tpm_exceeded.json
  • Same path with normal_request.json returns 200
  • Response headers in 200 case: no Authorization, x-api-key, x-goog-api-key
  • CI e2e-smoke passes (compose reuse contract preserved)
  • Recipe policies validate (fairvisor validate)

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant