Mini-lecture lessons
Read one idea closely, then test whether you can explain it without looking back. Use the example to connect the principle to a decision at work.
Lesson previews
The move: make the script stop when the business situation looks wrong. Jidoka changes the question from Did the code run? to Should the process continue? A Python script can execute without exceptions and still create damage if the source data, timing, or business context is abnormal. Detection Add checks that compare the current run with expected shape: row counts, required fields, duplicate rates, total dollars, recipient counts, and changed records. Stop For high-risk actions, fail closed. Write a review artifact, log the reason, and exit before sending, deleting, or updating. Human Judgment The reviewer should not redo the whole…
5 minMap the process before you scriptThe move: write the process map before the script. SIPOC gives you a compact view of the workflow that Python will inherit. Start with the customer and output, then work backward to the inputs and suppliers. This keeps the automation tied to the business result instead of the first file you happen to receive. Suppliers and Inputs Name the mailbox, API, folder, person, database, or form that provides data. Then name the exact inputs: file type, required columns, date range, credentials, and timing. Process and Outputs Write five to seven major steps: fetch, validate, transform, reconcile, export, notify. Then define…
5 minErrors should explain the broken assumptionThe move: Expose the failed assumption A try-except block is not a blanket for uncertainty. It is a place to catch a specific failure, add context, and either recover or stop loudly. Broad silent catches create bad data with a clean terminal. PEP 8 frames style as a tool for readability, not decoration. The official tutorial teaches the same bias through examples: write the thing you mean, choose the built-in shape that matches the data, and keep the control flow visible. When a script moves from personal scratchpad to shared work, the cost of cleverness rises. Names, indentation, data shape,…
5 minIndentation is the control flowThe move: Treat indentation as logic Python uses indentation to define blocks, so a visual nudge is also a behavior change. Four spaces per level is not cosmetic; it makes nesting predictable and keeps reviews from becoming archaeology. PEP 8 frames style as a tool for readability, not decoration. The official tutorial teaches the same bias through examples: write the thing you mean, choose the built-in shape that matches the data, and keep the control flow visible. When a script moves from personal scratchpad to shared work, the cost of cleverness rises. Names, indentation, data shape, and explicit error behavior…
5 minLet the data structure choose the syntaxThe move: Choose structure by question Lists preserve order, dictionaries connect keys to values, sets answer membership and uniqueness questions, and tuples carry fixed small records. The structure is a decision about how the code will be read and checked. PEP 8 frames style as a tool for readability, not decoration. The official tutorial teaches the same bias through examples: write the thing you mean, choose the built-in shape that matches the data, and keep the control flow visible. When a script moves from personal scratchpad to shared work, the cost of cleverness rises. Names, indentation, data shape, and explicit…
5 minName variables for the shape they holdThe move: Name the data shape A name like rows, row, totals_by_region, or active_users tells the reader what operations should be legal. Shape-aware names prevent mistakes like treating a string as a list or a list as a dictionary. PEP 8 frames style as a tool for readability, not decoration. The official tutorial teaches the same bias through examples: write the thing you mean, choose the built-in shape that matches the data, and keep the control flow visible. When a script moves from personal scratchpad to shared work, the cost of cleverness rises. Names, indentation, data shape, and explicit error…
5 minExplain priority without breaking fairnessThe move: make exceptions part of the queue design, not a surprise. FIFO feels fair because the person who waited longest goes next. But services often need exception rules. A clinic triages by urgency. A grocery store uses an express lane. A bank may route complex transactions to a specialist. These can be fair, but only if customers understand the logic. The danger is invisible priority. When someone who arrived later is served first and the rule is not obvious, the waiting customer fills the gap with a hostile story: staff are playing favorites, the system is disorganized, or their…
5 minFind the service-flow bottleneckThe move: trace the wait through the whole service flow. A service blueprint separates what the customer does, what staff do in view, what staff do out of view, and what support systems must complete. This is useful in queues because the visible line often gets blamed for delays created somewhere else. Use four questions. Where does the customer enter? That reveals preprocess waiting and confusion. Where does frontstage service pause? That reveals visible idleness, repeated questions, or unclear scripts. What backstage dependency does the customer not see? That reveals approvals, checks, searches, or rework. What evidence does the customer…
5 minManage the wait people feelThe move: manage perception and expectation as deliberately as minutes. Maister's core service formula is satisfaction equals perception minus expectation. A wait is not judged only by its stopwatch length. People judge whether the wait matched what they expected, whether it felt under control, and whether the service provider seemed to respect their time. Use a two-clock scan. The clock wait asks: how long from arrival to service? The felt wait asks: what is the customer experiencing during that time? An 8-minute wait with a greeting, a clear place in line, an honest update, and a useful intake step can…
5 minMake AI Answer Like It Has an Open BookA model can sound sure while answering from memory. RAG gives it an open book first. Teach Retrieval-augmented generation, usually called RAG, is a workflow: retrieve relevant knowledge, then generate an answer with that knowledge in context. The original research framed it as combining a retrieval system with a generation model for knowledge-intensive tasks. In business use, the idea is practical: connect the assistant to your own approved docs, search those docs at answer time, and make the answer trace back to the retrieved material. This lowers unsupported guessing because the model has fresh, specific evidence in front of it.…
5 minWhat Grounding Actually ChangesGrounded does not mean perfect. It means the answer has a declared evidence base. Teach Grounding connects an answer to external evidence. In RAG, that usually means searching an indexed collection, placing relevant chunks into the prompt, and asking the model to answer from them. This helps because the model can use current, domain-specific material instead of leaning only on training data. The important shift is auditability. With a grounded answer, you can inspect the source trail. Did the system retrieve the right policy? Did it miss a more specific page? Did the final sentence claim more than the cited…
5 minWhy Fluent AI Can Still HallucinateThe danger is not that the model is confused. The danger is that it can be wrong in a polished voice. Teach A hallucination is generated content that is unsupported by the input or wrong against the facts. The problem is not limited to casual chat. Any system that generates fluent language can produce a statement that sounds reasonable while lacking evidence. RAG helps because it changes the input. Instead of asking the model to answer from memory, you provide retrieved source passages from a defined collection. The model can now anchor the answer in the passages. But two things…
5 minAsk for Citations You Can Actually CheckA citation is only useful if it lets a human find the supporting evidence quickly. Teach Grounded AI becomes safer when the answer shows where each key claim came from. The citation should be specific enough to check: source title, section, URL, page, record ID, or timestamp depending on the source type. General citations create false comfort. A link to the employee handbook does not prove the PTO sentence unless the linked section actually says it. A good prompt also asks the assistant to expose uncertainty. If the retrieved sources do not support a claim, it should say not found…
5 minSplit the RAG ScorecardA single quality score can hide the broken part of a RAG system. The three-part scorecard A RAG answer is not one event. The system retrieves context, the model writes from that context, and the user receives an answer. Each step can fail in a different way. Retrieval relevance asks whether the returned passages are actually useful for the question. Groundedness asks whether answer claims are supported by those passages. Answer relevance asks whether the response addresses the user need instead of reciting nearby facts. The reason this works is diagnostic isolation. If the retrieved context is wrong, a better…
5 minFaithfulness Is Claim SupportFaithfulness is claim support, not a feeling that the answer looks cited. The claim-support test RAGAS treats faithfulness as factual consistency between the response and retrieved context. In a human review, the simplest version is to split the answer into claims and ask whether each claim follows from the retrieved passages. The claim can be small: a date, eligibility rule, numeric limit, obligation, exception, or named source. This makes the metric useful because it ignores polish. A confident answer with a real citation can still fail if the citation does not support the exact claim. It also prevents reviewers from…
5 minYour Eval Set Is a Product SpecYour eval set is a product spec in disguise. Capability, evidence, score Evidence-centered benchmark design asks you to connect the thing you claim to measure with the evidence your tasks collect. In RAG evaluation, the capability might be policy exception handling, cross-document synthesis, source abstention, or retrieval under noisy wording. The evidence is what the system must retrieve and say. The scoring rule explains how a reviewer or judge decides pass or fail. This matters because random questions create random confidence. A RAG assistant can pass many easy lookup questions and still fail the moments users actually care about. Valid…
5 minHuman Anchors for Judge ScoresA judge score without human anchors is only a guess at your standard. Calibrate before you automate LLM judges can grade RAG dimensions such as relevance, groundedness, and correctness at useful speed. But they inherit ambiguity from the rubric and bias from the judge model. ARES shows a practical pattern: combine automated evaluation with a smaller human-annotated set so the automated scorer is checked against expert labels. The anchor set is the stabilizer. It contains examples your team agrees are pass, fail, and borderline. You run the judge on those examples and inspect where it disagrees. Agreement metrics help summarize…
5 minDraw component boundaries before you codeThe move: name the boundaries before writing JSX. React components work best when they mirror the way the user sees the screen and the way the data is shaped. Start with the mockup. Circle repeated pieces, regions with their own responsibility, and places where a single data object appears. Then name those pieces as components. This prevents the common beginner failure mode: one component that renders everything and owns every interaction. That file feels fast for the first hour, then becomes hard to test, reuse, and debug. Thinking in React gives you a sequence: component hierarchy first, static rendering second,…
5 minUse Effects as escape hatchesThe move: ask what world the code is syncing with. React's render phase is for calculating what the UI should look like from current props and state. Event handlers are for user-triggered actions. Effects are for synchronization with external systems after the UI is committed. This split prevents accidental feedback loops. A derived value in an Effect causes an extra render. A click-specific API call in an Effect may fire on page load or refresh because the Effect cannot know which user action caused the current state. A subscription or DOM integration, however, really does need an Effect because React…
5 minTreat JSX as rendering logic, not HTML pasteThe move: write JSX as the output of a component function. JSX lets markup live next to the rendering logic that controls it. That is useful because interactive UI is rarely static HTML. A button label may depend on loading state, a row badge may depend on a status, and a form message may depend on validation. The core rules follow from JSX being JavaScript: use className, close tags, return one tree, and put JavaScript expressions inside curly braces. When JSX becomes hard to read, the fix is usually not more clever inline syntax. The fix is to pull decisions…
5 minKeep only the minimal stateThe move: store causes, calculate consequences. State is for information the component must remember between renders. It is not for values that are already known from props, constants, or calculations. In a searchable list, the search text is state because the user changes it. The original list may be props. The filtered list is derived because it can be computed from the list and search text. This distinction is the heart of predictable React. If you store both the cause and the consequence, you must update both perfectly forever. If you store only the cause, React can recalculate the consequence…
5 minDisplay rules change the faceThe move: read the room around the face. Emotion expressions are not produced in a vacuum. People manage what they show based on culture, role, hierarchy, safety, and stakes. A universal signal can be softened, delayed, exaggerated, or replaced with a socially acceptable expression. This is why a polite smile in a high-stakes room is not automatically enjoyment or agreement. Ekman’s emotion families help you notice possible signals, including brief leakage when a person’s appraisal outruns their display rule. Barrett’s framework asks you to interpret those signals in context, because emotion meaning is constructed from the situation as well as…
5 minEmotions are data, not verdictsThe move: treat emotion cues as evidence, not proof. Emotion cues matter. A sudden stillness, tightened jaw, flat voice, or fast smile can tell you the work has hit something important. Ekman’s framework gives you a starting vocabulary for the family of response you may be seeing. Fear often points to threat or uncertainty. Anger often points to a blocked goal or crossed boundary. Sadness often points to loss. Surprise often points to new information. Enjoyment often points to approach and openness. But cue-reading fails when the first label becomes the final answer. Barrett’s work on constructed emotion and granularity…
5 minGranularity beats “upset”The move: split “upset” into useful possibilities. Low-granularity emotion reading sounds efficient: “She’s upset,” “He’s negative,” “They’re emotional.” It is actually vague. A broad label hides the mechanism. A person who is disappointed may need acknowledgement of loss. A person who is anxious may need risk clarity. A person who is angry may need a boundary or fairness issue named. A person who is embarrassed may need privacy and dignity. Barrett’s emotional granularity helps you build a richer vocabulary, and richer vocabulary changes action. You are not trying to sound therapeutic. You are trying to avoid the wrong intervention. Ekman’s…
5 min