AI-Assisted Coding · Module 2Summary

Module summary · 8 min

What you keep from Module 2

Module 2 turns a one-endpoint skeleton into a tested backend, one strict prompt and one verification gate at a time, and ends with proof that the tests protect what they claim to.

Listen to this lesson

Hear the lesson read aloud, with each sentence highlighted as you go.

Narrated by an AI voice.

One line per lesson

Each lesson in one sentence.

  • 1 · Cursor IDE Move the AI into the editor and prove it can read app/main.py before generating anything.
  • 2 · Data model A strict Pydantic v2 contract with enums, a validated title, no extra fields, and server-owned ids and timestamps.
  • 3 · CRUD endpoints One endpoint per prompt, verified with curl or Swagger before the next: 201, 200, 404, 422, 204.
  • 4 · Status transitions The backend checks the (current, new) pair against three allowed moves and returns 422 for the rest.
  • 5 · API tests Review generated tests, get to green, then break the code and watch the right tests fail.
  • 6 · Deliverables Code, verification evidence, and three logs that record your judgment.

Your deliverables

Before moving on, these should be in your repository and notes.

  • app/models.py, app/storage.py, app/main.py and app/business_rules.py.
  • tests/verify_a.py passing all eight checks.
  • tests/conftest.py and tests/test_tasks.py with 16 or more tests, all green.
  • The transition matrix pattern 200, 200, 422, 200, 422, 200.
  • Break Test evidence for the transition check and the title check.
  • A prompt comparison log, a correction log and a 3-5 sentence reflection log.

The chain

Each part depends on the one before it, and each gate keeps a mistake from travelling forward.

From skeleton to proven backend · Study-guide synthesis of Lessons 1-6
  1. Editor reads the repo/health explained and returning 200.
  2. Contractverify_a.py: eight PASS lines.
  3. Five routesEach verified before the next.
  4. RuleMatrix pattern matches.
  5. ProofGreen suite that fails when broken.

Strict prompt, review, verification, targeted correction, at every step.

Built from the Module 2 lecture notes and prompt library; page references are in the source notes below.

Your study checkpoint

Check what stuck

The practice page puts the module under pressure with realistic situations and a knowledge check.