Module 11 Activity
Scenario
Build the suite that will actually run - the one that needs no key.
What you build
An offline test suite with an injected model, scripted fakes driving the hard paths, structural assertions and a golden contract.
Steps
- Refactor so every function that calls a model takes it as a parameter.
- Use scripted fake responses to drive the retry path and the refusal path deliberately.
- Replace every exact-match assertion with structural ones, including a hedging check.
- Record a golden response and a type contract, and run them in CI.
- Split the suite into offline and paid, and report the count and wall clock of each.
- Confirm the offline suite passes with no key and runs in seconds.
Evidence to hand in
- The refactor making the model a parameter.
- Tests driving retry and refusal via scripted responses.
- The structural assertions.
- The golden file and contract check.
- The offline/paid split with timings.
Review checklist
- No client is created at import time.
- The retry and refusal paths are both driven deliberately.
- No assertion depends on exact model wording.
- The golden is only updated when a change was deliberate.
- The offline suite passes with no key.
