Programming Explainers That Ship With a Passing Test
Working code can become a visual lesson as soon as the tests pass. Golpo draws the run, narrates it in the developer's voice, and a selfie can introduce the problem.

The short answer: Working code can become a visual lesson as soon as the tests pass. Golpo writes the explanatory script, plans the control-flow scenes, narrates the run, syncs the pictures, and returns a polished video while the repository stays the source of truth.
Why this is practical now: A developer can introduce the problem from a selfie, explain it in their own voice, and let Golpo draw the path the test just proved. Students see the run instead of only reading the file.
Frame editing repairs a token on screen. The API can generate the next explainer from Cursor, Claude Code, Codex, or Copilot the moment the suite is green. One developer can teach the codebase in video.
Use the full Golpo production system
Golpo is built to be the world's best AI whiteboard explainer video maker. Give it a topic, a prompt, a script, an audio recording, or a source document. It scripts, plans the scenes, designs the visuals, narrates, times and synchronizes every frame, and returns a polished video. One person can run that system across a whole course.
For programming lessons, let tested code remain canonical. Golpo can visualize control flow and narration; frame editing can repair a token or label, while a developer presenter can introduce the problem from a selfie.
- Start with an idea or source. Golpo can draft the script and plan the scenes from a topic, a document, or your outline. Script Mode can also speak the exact words you already trust.
- Keep the creator present. With AI Presenter, a course creator, founder, professor, or YouTuber can upload a selfie and appear beside the whiteboard. One person can lead a large lesson library without recording every visual sequence on camera.
- Use the right voice. Own Narration turns uploaded or live-recorded audio into the visual lesson. An authorized Voice Clone gives recurring lessons a recognizable voice at scale. Consent and pronunciation review remain required.
- Repair instead of restarting. The frame-by-frame editor can replace text, images, references, or an individual visual when the QA pass finds a local problem.
- Automate at scale. The Golpo API can be called from Codex, Claude Code, or through the Golpo MCP server in Cursor, VS Code with GitHub Copilot, Claude Code, Claude Desktop, and Visual Studio. The course platform can generate, poll, review, and publish without a person moving files between tools.
What this page does not take over
Science and engineering explainers cover technical diagrams broadly. The LaTeX guide covers how an equation is entered. Floating-point surprises such as 0.1 + 0.2 belong to the recurring-question spoke when they arrive as a repeated student question. This page owns the pairing: a test in the repo, a printed result, a script that quotes it, a render that a watcher can compare to the printout.
The hub still blocks release on a failed watch-back. The test passing is necessary. It is not the watch-back.
The pairing workflow
- Pin the interpreter. The record stores the implementation and version, for example the python3 the course’s CI image actually runs. “Python” is not a pin.
- Write the assertion first. The test expects the values the lesson will speak. A failing assertion is a failed lesson, not a script opportunity, except when the lesson’s point is the failure. In that case the video quotes the failure and then shows the assertion that passes. The second pilot does that with range.
- Run it. CI or the QA agent runs the file and stores stdout next to the commit SHA.
- Draft from stdout. The creator agent may turn those lines into sentences. It may not round them into a friendlier story. If stdout says 0, the script says 0.
- Rerun. The QA agent runs the test again, ideally from a clean checkout of that SHA. A pass on a developer’s laptop and a fail in CI blocks the lesson.
- Render the passing script. Golpo does not import the repository and does not run pytest. The platform sends words. Watch-back compares the drawn numerals to stdout.
Round half to even
Python’s built-in round uses bankers’ rounding when two integers are equally close: it chooses the even one. The course should re-run these three calls on the pinned interpreter and print them in the article’s lesson record as well as in the script. The documented results this guide is willing to teach, and that a current CPython 3 reproduces, are round(0.5) = 0, round(−0.5) = 0, and round(1.5) = 2. The even integers among the neighbors of 0.5 are 0, of −0.5 are 0, and of 1.5 are 2. A script that says “.5 always rounds away from zero” is teaching a different language. The QA agent fails that sentence even if a different library would do that.
Binary floating point can make some decimal fractions surprising. This lesson does not open that topic. It teaches the tie behavior on these three calls. The 0.1 + 0.2 question stays on the mini-lesson spoke so the two surprises do not collapse into one vague “floats are weird” video.
The stop that is not included
range(1, 10) yields 1 through 9. The sum is 1 + 2 + … + 9 = 45, which is also 9 × 10 / 2. The sum of 1 through 10 is 10 × 11 / 2 = 55, and that is sum(range(1, 11)). An assertion that sum(range(1, 10)) == 55 fails. The lesson shows that failing expectation and then the call that passes. The video’s credited line is 45 for the first call and 55 for range(1, 11). A picture that labels range(1, 10) as 1 through 10 fails watch-back, because that picture is the bug.
The creator agent drafts only after the passing test is green. The failing assertion may appear in the lesson as the contrast, and the test file should contain the passing assertions the narration credits. A course that deletes the test after render has thrown away the pairing. Keep the test in the same commit the script hash records.
Script Mode lesson 1 of 2
1. Ties go to even
Finished Golpo video · Lesson 1 · Script Mode · open MP4
Audience: Learners who expect every .5 to round away from zero
Lesson job: Show three ties and the even results a pinned interpreter printed
Checked against: Python's docs: round half to even. On CPython 3.12.9, round(0.5) is 0, round(-0.5) is 0, and round(1.5) is 2. Python documentation: round. The course runs those three calls before the script is sent. Keep binary-fraction error for the recurring-question episode.
Exact Golpo configuration
Own Narration: OFF · Script Mode: ON · Duration: 1 minute · Orientation: Horizontal (16:9) · Style: Professional Clean · Color: ON · Language: English · Voice: Male 1 · Pace: Normal · Music: None
Exact script used for this video
Python rounds a tie to the nearest even integer. The course pins an interpreter and runs three calls before this lesson is recorded. round of zero point five returns zero. round of negative zero point five returns zero. round of one point five returns two. Zero is even, so both ties at one half land on zero. One point five sits halfway between one and two, and two is the even neighbor, so the result is two. The spoken results are the results the test just printed. The unit test lives in the course repository. This lesson is recorded only after that test passes. A script that says one for a half tie does not get a picture. Show all three calls, and show zero, zero, and two. Zero, zero, and two have to match the printout from the pinned interpreter. The picture may not invent another call.
Video Instructions
Three Python calls on a pinned interpreter. Zero point five and negative zero point five round to zero. One point five rounds to two. End on those three results. Do not add a fourth call. Allowed labels: round(0.5) = 0; round(-0.5) = 0; round(1.5) = 2; Ties to even. Do not add a sample stamp, a demo label, or any claim that the lesson is fictional. Show only the labels listed. If a number appears, it must match the narration exactly. No extra dates, prices, percentages, logos, or quotations.
Voice Instructions
Exact about Python rounding. Read each call, then its result.
Course package
- Lesson title: Ties go to even
- Title card: TIES GO TO EVEN
- Closing line: Why did both halves land on zero?
Review before a learner can watch
The three printed results are 0, 0, and 2. Block a fourth call or a result of 1 for a half tie.
Script Mode lesson 2 of 2
2. The stop that is not included
Finished Golpo video · Lesson 2 · Script Mode · open MP4
Audience: Learners whose test expected the stop value to be included
Lesson job: Show the failing assertion and the call that actually returns 55
Checked against: sum(range(1, 10)) is 45, the sum of 1 through 9. The sum of 1 through 10 is 10 × 11 / 2 = 55, which is sum(range(1, 11)). The failing assertion is the lesson. The video uses the assertion that passes.
Exact Golpo configuration
Own Narration: OFF · Script Mode: ON · Duration: 1 minute · Orientation: Horizontal (16:9) · Style: Professional Clean · Color: ON · Language: English · Voice: Female 2 · Pace: Normal · Music: None
Exact script used for this video
The stop value in range is not included. sum of range from one up to but not including ten is forty five. That adds one through nine. The sum of one through ten is ten times eleven, divided by two. Ten times eleven is one hundred ten. One hundred ten divided by two is fifty five. The call that returns fifty five is sum of range from one up to but not including eleven. An assertion that expects fifty five from the first call fails, and that failure is worth showing. The video uses the assertion that passes. Forty five for the stop at ten. Fifty five for the stop at eleven. The course runs the test, and the spoken numbers are the numbers that passed. Mark the excluded stop on both calls. Forty five and fifty five should both be on the last frame, with the stop that each call excluded.
Video Instructions
The first call stops before ten and sums to forty five. One through ten is fifty five, which is the call that stops before eleven. Show the failing assertion briefly, then the passing one. End with forty five and fifty five and the excluded stops. Allowed labels: sum(range(1, 10)) = 45; 1 through 9; 10 x 11 / 2 = 55; sum(range(1, 11)) = 55. Do not add a sample stamp, a demo label, or any claim that the lesson is fictional. Show only the labels listed. If a number appears, it must match the narration exactly. No extra dates, prices, percentages, logos, or quotations.
Voice Instructions
Show the excluded stop. Forty five and fifty five must stay distinct.
Course package
- Lesson title: The stop that is not included
- Title card: THE STOP IS EXCLUDED
- Closing line: Which call returns fifty-five?
Review before a learner can watch
45 and 55 both appear, each with its excluded stop. The spoken numbers are the ones the passing test produced.
Release blocks
- No pin, no SHA, or no stored stdout.
- A script numeral that stdout does not contain.
- CI red. The platform does not render “so the video team can stay on schedule.”
- A drawn range that includes the stop value the narration excluded.
- A claim that every language rounds ties the same way. This lesson is about the pinned Python.
Risks
Tests can encode the bug. If the assertion expects round(0.5) to be 1, a careful rerun will fail, and that is the system working. If someone changes the assertion to match a wrong video, both sides agree and the students learn the wrong rule. The protection is the language documentation in the record, not only the test. The QA checklist includes “open the docs for round and for range” on the pinned major version. Docs and stdout should agree. If they do not, a person investigates before either is treated as the lesson.
Versions drift. A pin of Python 3.11 and a laptop on 3.13 may still agree on these two behaviors, and they may disagree on something else the course teaches next. The next lesson re-pins. It does not inherit “we already checked Python.”
The test the narration is allowed to quote
The lesson record links a test file, and the script is not allowed to claim a result the file does not assert. For the rounding lesson, the file the course re-runs on its pinned interpreter should assert the three ties the video will speak: round(0.5) equals 0, round(-0.5) equals 0, and round(1.5) equals 2. It should print those three values so stdout, not a comment, is what the creator agent reads. Comments rot. Stdout is what CI stored. A developer who “updates the comment” and leaves a stale print is caught when the QA agent diffs the script against stdout rather than against the comment.
For the range lesson, the file asserts that sum(range(1, 10)) equals 45 and that sum(range(1, 11)) equals 55. It may also show, in a separate test or a commented demonstration the suite does not treat as the lesson, that expecting 55 from range(1, 10) fails. If that failure is executed as a test, the suite’s overall status has to stay defined. A course that wants a red assertion on screen can capture the failure message in a controlled way and store that captured text. A suite that is simply red blocks release. The video’s contrast is a captured message plus a green assertion, not a broken main branch that someone rendered anyway.
The commit SHA is what a student can check out. The video description, or the lesson page beside it, names the SHA and the path. A student who runs the file and sees a different number has found a real incident: pin mismatch, an uncommitted edit, or a script that quoted the wrong stdout. The instructor treats that incident as a block on the lesson, not as a comment-section argument. The next render waits for a new green SHA. Golpo does not resolve the incident by rewriting the code. The platform sends a new script only after the new stdout exists.
Keep binary-fraction material out of this test file. Adding 0.1 + 0.2 to the rounding test invites a video that tries to explain two mechanisms in one minute and explains neither. The recurring-question spoke has the float mini-lesson, with its own printout and its own repair, math.isclose or Decimal, matching whatever the course’s other tests use.
Document the import surface the lesson is allowed to mention. The rounding video uses the built-in round and no import. The range video uses the built-in sum and range and no import. If a draft adds from math import * or a helper the tests do not call, the QA agent fails the draft. Unused imports in a one-minute lesson become myths about what the program needed. The lesson page can link the official library page for round and for range at the pinned major version, next to the SHA. The link is for students who want the full signature, including ndigits, which this minute deliberately does not teach. A script that starts explaining ndigits has left the test file. Cut it back or write a second lesson whose test actually calls round with two arguments and stores that stdout.
Automate it: review gates and publishing with the Golpo API
For programming explainers, the whole path from source to published lesson can run as one pipeline on the course platform. An agent in Codex with the Golpo Codex Skill, in Claude Code with the Golpo Claude Skill, or in Cursor, VS Code with GitHub Copilot, Claude Code, Claude Desktop, or Visual Studio through the Golpo MCP server can call the Golpo API, wait for the render, and hand the file to the platform's review steps. Production stops being the limit on how many checked lessons a course can offer.
- Attach the reference first. Store the code and its passing tests with the lesson before any script is drafted.
- Review the script against the reference before rendering. If a solution or source exists, the platform's QA agent checks the draft against it: it re-solves, re-adds, or re-reads, then compares. A mismatch or an uncertain result stops the job before Golpo renders anything.
- Generate with Golpo. The agent sends the approved script in Script Mode, with the course's locked style, voice, Video Instructions, and Voice Instructions.
- Transcribe what was actually said. Run speech-to-text on the finished video's audio. Learners hear the transcript, not the draft.
- Run two independent transcript reviews. Make two separate LLM calls, separate from the creator agent and the QA agent. Each gets only the transcript and the reference, with no access to the draft or to the other reviewer's verdict. Each checks every spoken number, term, and claim, then returns pass or fail and quotes the line it objects to. The lesson moves on only when both pass. A failure or a disagreement goes to an instructor.
- Check the frames. Pull a frame every few seconds and confirm every number and label on screen matches the approved script.
- Publish. The pipeline posts the video to the course platform or LMS through its API as a draft, then releases it under the course's own approval rule.
FAQ
Can these lessons be generated and published automatically?
Yes, on the course platform's side. Using the Golpo MCP server or the Golpo Claude Skill, a pipeline can check the script against the code and its passing tests, generate the video, run two independent transcript reviews, and post the lesson to the platform as a draft. Anything that fails a check goes to an instructor.
Why pair the video with a test at all?
Because the spoken result can drift from the code the students run. The test’s stdout is the source. The script quotes it. Watch-back confirms the pictures quote it too.
What does Python’s round do with 0.5 and 1.5?
On the tie-to-even rule, round(0.5) is 0, round(−0.5) is 0, and round(1.5) is 2. Re-run all three on the course’s pinned interpreter and store the printout. Do not extend this lesson into 0.1 + 0.2. That question has its own mini-lesson.
What is sum(range(1, 10))?
45, because the stop value 10 is excluded, so the addends are 1 through 9. sum(range(1, 11)) is 55, the sum of 1 through 10. The failing assertion is the contrast. The video credits the assertion that passes.
Does Golpo run the tests?
No. The course repository runs them. The platform’s QA agent reruns them. Golpo renders the script the platform sends after the pass. A green badge inside Golpo is not a thing this workflow uses.
What is stored with the lesson?
Interpreter pin, commit SHA, test path, stdout, script hash, and the watch-back result. A later commit that changes the assertion starts a new version even if the prose looks untouched.
Can the video show a failure?
Yes, when the failure is the point, as with the range stop. The file still has to include the passing call the course wants students to write. A video that ends on a red assertion and no repair is an incomplete lesson.
Who handles a red CI run?
The instructor or the maintainer of the repo. The creator agent does not get to soften the expected value so a video can ship. Uncertain disagreements between docs and stdout go to a person.
Related guides
- Checked lesson videos — render only after the check, here a test plus a watch-back.
- Science and engineering explainers — technical diagrams beyond this pairing.
- Markdown and LaTeX equations — entering the formula on screen.
- Recurring questions — the 0.1 + 0.2 mini-lesson, kept separate from round.
- Script to video — the stdout sentences stay exact.
Pin the interpreter, store the passing stdout, and send Golpo only the script that quotes those lines.
Tags


