Check for Contract Drift Across Files
Scenario
The library limit changes from < 3 to < 4 books. Audit three pull requests.
Try it yourself
Spot which pull request leaves sibling files out of sync.
| Case | Result |
|---|---|
| Updated library.py to < 4, left library.js and library.go on < 3 | Select a choice above to see what happens. |
| Updated all 3 languages to < 4, left error message saying "Max 3 books" | Select a choice above to see what happens. |
| Updated shared fixture JSON, Python, JS, Go, and rule copy together | Select a choice above to see what happens. |
Reveal the explanation
- Updated library.py to < 4, left library.js and library.go on < 3
Contract drift! Python approves 3 borrowed books while JS and Go decline.
- Updated all 3 languages to < 4, left error message saying "Max 3 books"
UI/doc drift! Learners see a rule description that contradicts actual behavior.
- Updated shared fixture JSON, Python, JS, Go, and rule copy together
Zero drift. Every file enforces and documents the exact same < 4 contract.
Whenever a business rule changes, grep for the contract name and constant across code, fixtures, and learner copy before committing.
Your turn
List the 4 file groups to check if PASSING_SCORE changes from 60 to 65 across this course repo.
Common mistake Updating only the JavaScript evaluator and forgetting fixtures, Python/Go snippets, and lesson copy.
Check your work
1. Shared fixture JSON, 2. Reference implementations (Python/JS/Go), 3. Automated tests, 4. Localized lesson text.
Quick check
This browser could not save your progress. Changes last until you leave the page.