Pattern completion, not runtime verification
The notes give a practical mental model, not a theory lecture. When you submit a prompt, the assistant generates likely next tokens based on patterns it has learned. It is not automatically running your code, inspecting your terminal, reading your database, or checking your library versions. When your task matches common patterns, the output can be fast and useful. When the pattern looks right but a detail is wrong, the output can be polished and still fail.
Key ideaAI coding assistants are pattern-completion systems, not runtime-verification systems. They don’t know whether the code works until you run it and provide evidence.
Three strengths to use deliberately
The strengths are real. The point is to use them on purpose, for the jobs they fit.
| Strength | How to use it deliberately |
|---|---|
| Speed of scaffolding | Generate boilerplate, file structures, repetitive patterns, and first-pass setup quickly. |
| Syntax and framework recall | Get help with APIs, framework conventions, and language details you do not want to look up manually. |
| Explaining unfamiliar code | Paste a function, stack trace, or confusing snippet and ask for a plain-language explanation, risks, and trade-offs. |
Three limitations to plan around
Each limitation has a matching habit. You restate context, you supply the runtime evidence, and you stop reading confidence as correctness.
| Limitation | What it means for you |
|---|---|
| No automatic project memory | Restate project context, stack, constraints, and decisions at the start of a new conversation. |
| No runtime context | The assistant cannot see your terminal, logs, database, environment variables, or failures unless you provide them. |
| No reliable uncertainty signal | Correct and incorrect answers can sound equally confident. Tone is not evidence. |
Key ideaTone is not evidence.
Failure mode 1: hallucinated APIs
A hallucinated API is a method, module or function that looks like it should exist but doesn’t. Its name usually follows the library’s own style, so it passes a quick review. In the notes’ example, the call reads like ordinary Pydantic, and the method isn’t there. The review question to ask every time: does this method actually exist in the library version I am using?
Code from the notes# AI-generated and plausible-looking from pydantic import BaseModel class Task(BaseModel): title: str Task.validate_fields(data) # Problem: validate_fields() does not exist.
Read with careThe PDF’s text layer drops Python indentation, so the field line is shown indented here as Python requires. The snippet is a teaching example of a plausible-looking call, not a complete program.
Failure mode 2: missing non-functional requirements
Ask for a basic endpoint and you often get the happy path: accept input, create an object, return a generic response. What goes missing is validation, response models, status codes, structured errors and edge cases. In this module, “production-aware” means building the habit of thinking about those things. It doesn’t mean Module 1 produces production-grade software.
| Vague POST /tasks output | Production-aware POST /tasks output |
|---|---|
| Accepts JSON. | Validates title and allowed enum values. |
| Creates a task. | Uses a Pydantic response schema. |
| Returns generic 200 status. | Returns 422 with a useful detail when input is invalid. |
| Leaves scope implicit. | Keeps scope explicit and does not add unwanted features. |
Failure mode 3: shallow business logic
AI can write syntactically correct setter code without discovering the real rules behind the update. For a Task Tracker status update, shallow code simply assigns whatever new status it was given. The notes list the questions that code never asked.
- Which statuses are valid?
- Can a task in Done move back to ToDo or InProgress?
- What happens if the task does not exist?
- What happens if the same update is sent twice?
Key ideaThe answer is not to avoid AI. The answer is to review deliberately. Verify, do not hope.
Exercise: spot the flaw
For each snippet, name the failure mode and explain the risk in one sentence.
| Snippet | Question to ask |
|---|---|
| express.validateSchema(req.body, taskSchema) | Does this API exist? |
| PATCH /tasks/:id updates any field | Where are the status rules? |
| DELETE returns 200 even when id is missing | What should the API return? |
Read with careIn order: a likely hallucinated API, shallow business logic, and a missing non-functional requirement.
Key takeaways
- The assistant predicts likely text; it doesn’t run, see or check anything unless you give it evidence.
- Use its strengths on purpose: scaffolding, recall, explanation.
- Plan around its limits: no memory, no runtime context, no reliable uncertainty signal.
- Watch for hallucinated APIs, missing non-functional requirements and shallow business logic.