AI-Assisted Coding · Module 2 reference
Glossary
Short definitions as the module uses them, each linked to the lesson it comes from.
- Cursor IDE
The AI code editor the Module 2 notes use, so the assistant can read and edit real project files.
Review Lesson 1- File reference
Attaching a real project file to a prompt, such as @app/main.py in Cursor or # in Copilot Chat, so the assistant works from your code.
Review Lesson 1- Apply in Editor
Inserting generated code into the project from the chat. The notes allow it only after review.
Review Lesson 1- Inline completion
Editor suggestions as you type; useful for boilerplate, not a replacement for deliberate prompting for new logic.
Review Lesson 1- First verified interaction
The gate before code generation: the assistant reads app/main.py and correctly explains /health.
Review Lesson 1- Verification gate
The check that must pass before you move to the next part of the module.
Review Lesson 1- Targeted correction
A fix prompt that pastes exact failing evidence and limits the change to the responsible file or route.
Review Lesson 1- Pydantic v2
The validation library version the module requires, using ConfigDict, field_validator and model_dump instead of v1’s class Config, @validator and .dict().
Review Lesson 2- TaskStatus
The enum for task status: ToDo, InProgress and Done.
Review Lesson 2- TaskPriority
The enum for priority: Low, Medium and High, with Medium as the default.
Review Lesson 2- TaskCreate
The client input model for creating a task: a non-blank title, optional fields, and no extra or server-managed fields.
Review Lesson 2- TaskUpdate
The client input model for partial updates: every editable field optional, no server-managed fields.
Review Lesson 2- TaskResponse
The model the API returns, including the server-generated id and timestamps.
Review Lesson 2- Server-managed field
A field the server sets and a client may not send: id, created_at and updated_at.
Review Lesson 2- extra="forbid"
The model setting that rejects unknown fields instead of silently ignoring them.
Review Lesson 2- verify_a.py
The model verification script that should print PASS for eight checks before Part 2.2.
Review Lesson 2- _reset
The storage helper that clears the in-memory store, used by tests so each one starts empty.
Review Lesson 2- CRUD
Create, read, update and delete: the five endpoints POST, GET list, GET by id, PATCH and DELETE.
Review Lesson 3- DO-NOT list
A prompt’s explicit constraints against common AI mistakes, such as creating a new FastAPI() instance.
Review Lesson 3- response_model
The FastAPI route setting that fixes the shape of the response, such as TaskResponse.
Review Lesson 3- Swagger UI
FastAPI’s interactive documentation at /docs, used alongside curl to verify each route.
Review Lesson 3- Hallucinated helper
A function the assistant calls that your code doesn’t define, such as storage.find_one.
Review Lesson 3- Business rule
A domain rule the backend enforces, such as which status changes are allowed, as opposed to simply setting a field.
Review Lesson 4- VALID_TRANSITIONS
The frozenset of allowed (current, new) status pairs: ToDo to InProgress, InProgress to Done, Done to InProgress.
Review Lesson 4- validate_status_transition
The function that raises a 422 when a (current, new) pair is not in VALID_TRANSITIONS.
Review Lesson 4- Transition matrix
Six PATCH checks on one task whose expected pattern is 200, 200, 422, 200, 422, 200.
Review Lesson 4- Fixture
A pytest helper that sets up what a test needs, such as client, created_task or the reset fixture.
Review Lesson 5- autouse
A fixture setting that runs it for every test automatically; without it on the reset fixture, tests share state.
Review Lesson 5- TestClient
FastAPI’s synchronous test client the suite uses to call the app; D1 forbids AsyncClient.
Review Lesson 5- Break Test
Deliberately breaking production code after the suite is green to prove the right tests fail.
Review Lesson 5- Prompt comparison log
A deliverable comparing the vague and strict POST prompts and what changed.
Review Lesson 6- Correction log
A deliverable listing AI output you inspected and fixed.
Review Lesson 6- Reflection log
Three to five sentences on where Cursor helped, where it guessed and what your review caught.
Review Lesson 6