Module 04 Activity
Scenario
The graph works on the happy path. Everything in this module is about the paths nobody has run yet.
What you build
A routing layer with an error branch, a bounded retry, and a coverage report showing every destination has been exercised.
Steps
- Rewrite every router to read named state fields only. If any router inspects free text or asks a model, change the upstream node to set a validated field instead.
- Add error handling to every node that can raise: catch the expected exceptions into an
errorfield and route on it. - Add a bounded retry with a counter, a ceiling, and a give-up node distinct from success. Check success before the ceiling.
- Run the dead-end and unreachable-node checks over your edge list and fix what they find.
- Write one test per router destination, asserting on which branch was taken, and compute branch coverage.
Evidence to hand in
- Every router, rewritten to read named fields.
- The error field, the catch sites, and the error branch.
- The retry with its counter, ceiling and give-up node.
- The dead-end and unreachable-node check output.
- The branch coverage figure with any missing destinations named.
Review checklist
- No router reads free text or calls a model.
- Every node that can raise catches its expected exceptions into state.
- The retry checks success before the ceiling, and give-up is a distinct node.
- Branch coverage is reported as a fraction, and the error path is covered.
- Bare
except Exceptionis not used to keep the run going.
