Module 15 Activity
Scenario
The capstone: a tested, AI-ready FastAPI service with a contract someone else could build against.
What you build
A complete service - contract, layered structure, offline suite, bounds and instrumentation - with a handover naming its gaps.
Steps
- Write the contract including every error and the guarantees you will keep, plus what is out of scope and the budget.
- Build it in layers, and state the import rules that keep the boundaries.
- Write the suite so nearly every test runs offline, including one for invalid model output.
- Decide the logged fields, the never-logged list, every bound and the alerts, before the first real request.
- Enforce every bound in code - input size, daily budget, timeout, rate limit.
- Write the handover with accepted limits, untested areas, an owner and next steps.
Evidence to hand in
- The contract with its four checks.
- The structure with its import rules.
- The offline suite with its coverage.
- The instrumentation and bounds plan.
- Evidence every bound is enforced rather than documented.
- The handover note.
Review checklist
- Every guarantee in the contract has a test.
- Services import no FastAPI and the provider is in one file.
- Nearly every test runs with no key and no network.
- Every bound is enforced in code, not stated as an intention.
- The handover names untested areas and an owner, and links a gap to a limit.
