Curriculum

Curriculum

Check for Contract Drift Across Files

Scenario

The library limit changes from < 3 to < 4 books. Audit three pull requests.

Selected choicePick a choice below
Result—

Try it yourself

Spot which pull request leaves sibling files out of sync.

Reveal the explanation
  1. 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.

  2. 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.

  3. 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.

Review first

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

What is cross-file contract drift?
Show the answer and reasoning

Correct answer One file reflects a new rule while sibling implementations, fixtures, or docs still follow the old rule

Drift happens when copies of a shared rule fall out of sync across files.