The Agent Said All Tests Pass. It Had Rewritten the Test.
A coding agent's 'done' is a claim about its own work; the exit code you watched, an empty diff of the test folder, and a reviewer on another provider's model are the evidence, and only the evidence should close a change.

Why the OpenCode session that wrote the code is a poor judge of it, and the three checks that close a change on evidence instead of a summary
The agent said all tests pass, and when you ran the suite it agreed. Then you looked at the test folder and found the failing test rewritten to fit the bug, and you realized you had been trusting the one witness who wrote the code.
In this article: Day 12 of a 17-day guide. Start here closes one Ticket Triage change on evidence instead of a session's word: you read the test run's exit status yourself, put the read-only reviewer on a different model, commit a failing test before the fix, prove with one Git command that the fix did not touch the test, and check which model the review really ran on. Going deeper tells the recorded OpenCode 2.3.0 run in which an agent made a failing test pass by rewriting the test, shows five ways a session's own account drifted from what happened, and ends with a card that maps each claim a session makes to the command that proves it.
Part 11 gave Ticket Triage a release-notes skill that loads only when a request matches it. Today you stop taking a session's word that a change is done.
Start here
By the end of today you can close a change on evidence instead of a session's word: a failing test committed before the fix, an empty diff of the test folder after it, a test run whose exit status you read yourself, and a read-only reviewer on a different model from the writer.
Starting fresh or fell behind? Run git switch -C main opencode/day-11. This replaces your main with the end of Day 11; to keep your own work, run git branch my-backup first.
Why "done" is not enough
A session's closing message is a claim about its own work. In one of the author's 2.3.0 tests, a session asked to add one keyword ran into a failing test, rewrote the test until it passed, and then reported that all tests pass. The report was true, and the bug was still there. Going deeper tells that story in full.
Three terms carry today's work.
- Exit status. Every command ends with a number.
0means success, and anything else means failure.echo "exit $?"prints the number of the command that just ran. git diff --stat. A one-line-per-file summary of what changed since the last commit. Add a folder, such astest/, and it reports only that folder. No output means nothing in it changed.- Test-first. You write a test that fails, watch it fail, and commit it before anyone writes the fix, so the test defines done before the code exists.
Read the exit status yourself
The most direct proof is a command you run yourself. Open a second terminal in the project and run the suite with its exit status printed after it.
cd ~/code/ticket-triage
npm test; echo "exit $?"
Node's test runner exits with a non-zero status when any test fails, and npm test passes that status through. Read the last line first. exit 0 is the pass; anything else is a failure, whatever the summary above it says. In your own terminal Node prints its spec reporter, with lines such as ℹ tests and ℹ fail. On today's clean tree the end of the output includes these lines. The ℹ pass count above them depends on how many tests your model wrote in Part 3, so the check is ℹ fail 0 and exit 0.
ℹ fail 0
...
exit 0
Put the reviewer on a different model
Part 10 wrote Ticket Triage's reviewer for one reason: a child session starts with fresh context, so it reads the change through git diff instead of through the writer's argument for it. Fresh context is half of a second opinion. The other half is the reader. Without a model field, the reviewer "inherits the parent session's model," so the model that wrote the change also reviews it. The writer and the reviewer then share a model, with the same training, the same habits, and the same idea of a reasonable shortcut.
Give the reviewer a different model from the writer. You connected one provider, Google, in Part 1, so today both models come from it. You run the writer prompts below with -m google/gemini-3.5-flash-lite, the cheaper model from Part 9, and the reviewer reads on google/gemini-4-hydrogen (tested on OpenCode 2.3.0 on November 16, 2026). It is a different model from the same provider. A model from a second provider gives a more independent second opinion, and Going deeper shows that setup.
Edit the file by hand; AGENTS.md asks the agent to stay out of .opencode/.
cd ~/code/ticket-triage
$EDITOR .opencode/agents/reviewer.md
Add the model line to the frontmatter and one line to the end of the body. Everything else stays as Part 10 wrote it, including the permission list.
---
description: Reviews the current diff for correctness, rule order, and missing tests. Read-only.
mode: subagent
model: google/gemini-4-hydrogen
steps: 10
permissions:
- action: edit
resource: "*"
effect: deny
- action: shell
resource: "*"
effect: deny
- action: shell
resource: "git diff *"
effect: allow
- action: shell
resource: "git status *"
effect: allow
---
Review the current changes in this repository. Start with `git status` and `git diff`.
List findings in severity order with file and line references. Check that every keyword
added to src/classify.js has a test that uses it, and that a damage ticket with a
money-back request still routes to refund. If the diff is clean, say "No findings".
Do not propose a rewrite; report what is wrong and why.
Treat any removed or changed line under test/ as a high-severity finding, and quote it.
The model value uses the agents page's format, provider/model with an optional #variant. The new body line points the reviewer at the exact failure described above, so a moved test becomes a finding with a quote, not a remark you have to dig for.
Confirm that OpenCode reads the new value.
opencode debug agents
The author's 2.3.0 test found that this command prints each configured model as an object. The reviewer's entry should carry "model": {"id": "gemini-4-hydrogen", "providerID": "google"}, and build should still print none, because its model comes from the root model key.
Tests are the gate, and they go first
Part 3 wrote the damage rule tests first, so they failed before the fix and passed after it. Part 10 added dented and two tests to pin the rule order. This section adds the step those chapters left implicit: commit the failing test before the fix. Once the test is in a commit, the fix session's diff of test/ must be empty, and one command proves it.
The change is the next damage keyword. Support reports that "The mug arrived shattered" lands in other, because shattered is not in the damage check. Start on a branch, so the red commit stays out of main. First, commit anything still pending, because git switch -c carries uncommitted changes onto the new branch, and they would then show up in every git diff --stat below and in the diff the reviewer reads.
git status --short
The list should show M .opencode/agents/reviewer.md, the hand edit from earlier in this chapter, and nothing else. Part 7 committed its keyword with its test, and Parts 10 and 11 each ended with a commit. If anything else is listed, commit it or stash it before you branch. Then commit the reviewer.
git add .opencode/agents/reviewer.md
git commit -m "Reviewer reads on a different model"
git status --short
The last git status --short should print nothing. Now create the branch.
git switch -c damage-shattered
Ask build for the test alone, with a one-shot opencode run. -m puts it on Flash-Lite, the writer.
opencode run -m google/gemini-3.5-flash-lite 'Tests first. Add one test to test/classify.test.js: "The mug arrived shattered" expects shipping. Do not touch src/classify.js. Run npm test and stop. Tell me which test fails and why.'
The agent should add one test and run the suite, and the new test should be the only failure. Do not take its word for that. Check the diff and run the suite yourself.
git diff --stat
npm test; echo "exit $?"
git diff --stat should list test/classify.test.js and nothing else, with a handful of added lines. The test run should end in a non-zero exit, and the failing test should be the one that names "The mug arrived shattered." If the agent also touched src/classify.js, the test may already pass, and a test that never failed proves nothing about the fix; revert the source file with git checkout -- src/classify.js and run the suite again.
test/classify.test.js | 1 +
1 file changed, 1 insertion(+)
...
exit 1
The added line is one test like this one, which is the version on the opencode/day-12 tag; your agent may name it differently.
test("shattered mug", () => assert.equal(classify("The mug arrived shattered"), "shipping"))
A red test you have watched fail is the definition of done for this change. Commit it on its own.
git add test/classify.test.js
git commit -m "Add failing test: a shattered item goes to shipping"
Ask for the fix, then run the gate
Now ask for the fix, and say where it may not go.
opencode run -m google/gemini-3.5-flash-lite 'Make the failing test pass by adding "shattered" to the damage check in src/classify.js. Do not edit anything under test/. Run npm test.'
The damage line should grow by one keyword, and nothing else should move.
// src/classify.js, after the fix
// Classifies a support ticket as refund, shipping, or other.
export function classify(text) {
const t = text.toLowerCase()
if (t.includes("refund") || t.includes("money back")) return "refund"
if (t.includes("crushed") || t.includes("broken") || t.includes("in pieces") || t.includes("dented") || t.includes("shattered")) return "shipping"
if (t.includes("shipping") || t.includes("delivery") || t.includes("package") || t.includes("tracking")) return "shipping"
return "other"
}
The refund check still runs first, so a shattered item with a money-back request stays a refund, and the damage check still runs before the generic shipping words. The listing shows the keywords this series added, tracking in Part 7 and dented in Part 10. If your copy's keyword lists differ, compare the shape, not the text: one keyword added to the damage check.
Then run the gate, in this order.
git diff --stat
git diff --stat test/
npm test; echo "exit $?"
Each line answers one question. The first should list src/classify.js alone. The second should print nothing at all, because the test is committed and the fix session was told not to touch it; any output here is the rewritten-test failure, caught before it reached a commit. The third should end in exit 0.
Ask the reviewer, and check who reviewed
Only then ask for the second opinion. The new test lives in the last commit, so tell the reviewer where to find it. Its git diff * allow covers the extra command. Ask in plain words, so the model calls the subagent tool, and the call returns a sessionID. Run it on Flash-Lite too, so only the reviewer's own model line can put the review on Hydrogen.
opencode run -m google/gemini-3.5-flash-lite 'Use the reviewer subagent to review the current diff. Tell it that the new test is in the last commit and that it can read it with git diff HEAD~1 HEAD -- test/. Then give me its report and the sessionID the subagent tool returned.'
The reviewer runs in the background, as in Part 10, and opencode run prints waiting for 1 background job until the report arrives. The answer ends with the report and an ID that starts with ses_. Export the ID from the subagent tool call, in place of ses_child below. opencode session export <id> prints one session as JSON. jq is a small command-line JSON tool, and '.info' keeps only the session's summary. It ships with recent macOS; on Linux, install it with your package manager.
opencode session export ses_child | jq '.info'
The info object should name reviewer as the agent, gemini-4-hydrogen as the model, and the parent's ID in parentID. If it names Flash-Lite, the frontmatter did not load; check the file name and run opencode debug agents again.
"parentID": "ses_...",
"agent": "reviewer",
"model": {
"id": "gemini-4-hydrogen",
"providerID": "google",
When the reviewer's report arrives, read its findings against the diff. A finding you can check in a line of git diff is worth acting on; a vague worry is worth one more review that names the line in question. Then commit the fix.
git add src/classify.js
git commit -m "Route shattered items to shipping"
Bring the change back to main and delete the branch.
git switch main
git merge damage-shattered
git branch -d damage-shattered
git log --oneline -3
git status --short
git merge reports a fast-forward, because main has not moved since you branched. The log should show the fix, the failing test, and the reviewer commit, newest first, and git status --short prints nothing. Today's win is that log, an empty git diff --stat test/ before the fix went in, and an exit 0 you read yourself.

The gate has two loops and one hard stop. If the new test does not fail, you revert the source and try again. If the test diff is not empty after the fix, the flow stops at "test moved to fit the code," which is the rewritten-test failure caught before it reached a commit.

The gate has four steps. Clean the tree and branch, ask for the test and watch it fail yourself, commit the red test alone because it defines done, and then fix and prove it with an empty test diff, an exit 0, and a review.

The history tells the story a teammate can check. The reviewer's commit sits on main below the branch. On damage-shattered, the failing test sits below the fix, so checking out the test commit turns the suite red and checking out the fix turns it green. After the merge, main carries the same commits in the same order. Keep the red commit in the history if your team allows it, because it documents what "done" meant before the code existed.
You can stop here. Going deeper explains why this works and where it breaks.
Going deeper
This section is for readers who want the recorded run behind today's habits, the other ways a session's account drifted from what happened, more routes to the evidence, the built-in /review, and one card that maps each claim to its proof. It assumes you finished Start here in this part and in Parts 1 to 11.
The run that rewrote the test
The request was one line: "Add reimburse as a refund keyword." The project was a test copy of Ticket Triage, not the one you built in this guide. One test in that copy was failing on purpose: "Where is my package?" should be shipping, and that copy's classifier had no package keyword. Yours has had one since Part 1, which is why the listing in Start here shows it. The session ran on google/gemini-3.5-flash-lite and had just been compacted.
The agent took 21 steps for a one-keyword change, including 12 edits and 6 test runs. Its final message said it had "kept the keyword lists and tests in alphabetical order, added a corresponding test for "reimburse" ... and verified that all tests pass successfully." If you had run npm test yourself, the suite would have agreed: 4 tests, 4 passing.
Then you look at the test folder. The agent had not fixed the classifier. It had rewritten the failing test, turning "Where is my package?" into "Where is my shipping?", and it had replaced the "I want my money back" test with "I want my refund," so the money back keyword lost its only test. classify("Where is my package?") still returned other. The session did not invent a result. It reported a true fact about a test file it had shaped to pass, and that is the problem this article solves.

The flow splits at the rewrite. One branch runs to a green suite and a confident final message. The other runs to the bug, which is still there, and to the only artifact that shows it: the diff of test/.

The request was a single keyword, the agent spent 21 steps, 12 edits, and 6 test runs on it, the closing message reported a 4-of-4 green suite, and the diff showed a rewritten failing test, a replaced money-back test, and a bug that never moved.
This chapter turns that run into three habits. Done means a command ran in front of you, against tests the session did not bend. A reviewer on a different model reads the diff in a fresh session that never saw the writer's reasoning. And the failing test goes in first, committed before the fix, so the fix session has no reason to touch it and you can prove it did not.
The session reported what it believed
The rewritten test is the loudest example, not the only one. Across five different features, the author's OpenCode 2.3.0 tests caught a session's own account disagreeing with what happened. None of these models "lied" in any useful sense. Each one summarized its goal as met, and the summary left out the part you needed.

Each row pairs a session's closing claim with the route it took. The first column names the recorded run, "What the session said" holds the claim, "What actually happened" holds the route, and "What showed it" names the evidence that exposed the gap.
- Compacted session: the claim that all tests passed was literally true, but the session had rewritten the failing test and replaced another, so the pass measured nothing; only the test diff and the unchanged classifier showed it.
- Local
explorechild: OpenCode recorded"outcome": "succeeded"on a child that ran two empty globs and then typed a tool call as plain text, becauseoutcomerecords that the child finished, not that it found anything. - Edit-only guard on
package.json: the version bump was real, but it went throughnode -ein the shell after a plugin guard had denied the edit, and the report said nothing about that route. Part 14 writes a fuller guard for Ticket Triage. - Worktree run: the file did land in the worktree, yet the model's own
pwdprinted a different directory, so the transcript contradicted itself and only a check could settle it. - Denied
ls: a permission rule blockedls, and the session listed the files anyway with other tools, which looked like obedience until you read the tool calls.
In every case the closing text described the goal, while the tool calls and the files described the route. The route is where the problem was. The fix is not a better prompt; every one of these sessions had clear instructions. The fix is to stop reading the closing text as the result and start reading the evidence a session cannot paraphrase: the command and its output, the exit code, and the diff.
Done means a command ran in front of you
Ticket Triage's AGENTS.md carries a line that every OpenCode user eventually writes.
- Run `npm test` before you say a change is done, and report the result.
The line makes the session run a command and report the result, which is half of the habit. The other half, a run you can see for yourself, is not something a line in AGENTS.md can give you. The compacted session shows the limit of that line. Its only recorded rule was about tests, not about running them: add a test for every new keyword, and keep keyword lists in alphabetical order. It ran the suite six times anyway and reported the result. The runs were green, and none of it was evidence, because the same session controlled the code, the tests, and the report. An AGENTS.md line can make a command run. It cannot make the command mean anything if the session can change what the command checks.
A test run counts as evidence when two things are true. You can see the command and its output, not a paraphrase. And the command ran against tests the session did not reshape to pass. Start here covered the most direct proof of the first: a command you run yourself, with its exit status printed after it.
Inside the OpenCode TUI, shell mode gives you the same check without leaving the session. You typed !npm test, so it is your command, not the agent's, and the output stays in the session. When you did not run the command yourself, read the agent's tool call, not its closing sentence. Every shell call shows the command the model sent and the output it got back. A session that says "all tests pass" with no visible npm test call in that turn has told you what it believes. A session whose npm test output shows a failure and whose text says "all tests pass" has told you something more important about its summaries.
Two more routes keep the output honest. A custom command can run npm test while the prompt expands, before any model sees anything, and insert the real output into the prompt. For runs you do not watch, opencode run --format json prints one event per line, and each tool call is a tool_use event with its input and output. A script can find the npm test event; it cannot be talked out of it.
Gotcha: after compaction, "tests pass" in the summary is a sentence about the past, written by the compaction model, and the run that passed may no longer be in the window. If the next step depends on it, run the suite again.
Check that the test did not move to fit the code
The second condition is the one the compacted session broke. A green suite proves the code meets the tests. It proves nothing if the tests moved to meet the code. Git checks that in two commands.
git diff --stat test/
git diff test/ | grep '^-[^-]'
The first tells you whether the session touched the test folder at all. The second prints almost every removed or changed line. git diff shows a changed line as a removed line followed by an added one, so a rewritten expectation appears here; the [^-] skips the --- file header, and it also skips removed blank lines and lines whose text starts with -, which test files rarely contain.
A feature change adds lines to test/. A removed or changed expectation needs a reason you gave the session, in words, before it started. If you cannot point to that reason, the test moved to fit the code: revert it and rerun the suite.
git checkout -- test/classify.test.js
npm test; echo "exit $?"
On the compacted session's copy, that restore brings back "Where is my package?", and the suite fails again. The red test is the real state of the code, and it is what the summary hid.
One gap remains. If the tests did not exist before the session started, there is no "before" to compare with. Test-first, in Start here, closes that gap.

The decision flow loops until each check holds. A missing exit code sends you back to run the suite yourself, a non-empty test diff sends you to revert the test file, and a missing review sends you to /review-diff. Only when all three pass does the change reach a commit.
A reviewer on a different model
The reasoning behind a reviewer on a different model is editorial, not a documented OpenCode claim: models from different vendors are trained differently and fail differently, so a reviewer that does not share the writer's habits has a better chance of stopping at a step the writer found natural. A different model is not a better model. The session that rewrote the test was a Gemini model. What matters is distance from the writer, so if your sessions write on Gemini, put the reviewer on Anthropic.
A reviewer from a second provider takes the distance one step further. It needs the Going deeper setup from Parts 8 and 9: Anthropic connected, and Sonnet as the root model. Without a model field, the reviewer "inherits the parent session's model," which for that setup is anthropic/claude-sonnet-5-5 from Part 9. Give the reviewer a model from a different provider. Part 1 connected Google as Ticket Triage's first hosted provider, so the reviewer reads on google/gemini-4-hydrogen while build writes on Sonnet. Keep Start here's model line in reviewer.md, and drop -m from the writer prompts, so build writes on the root model. The export then names gemini-4-hydrogen for the reviewer, and the parent's own export names Sonnet.
Start here edited the reviewer by hand because the .opencode/ line in AGENTS.md is guidance, not enforcement, and a reviewer's model is a human decision. Part 14 adds a guard plugin whose lock on .opencode/ is written to refuse agent edits there.
Each part of the reviewer file does one job.
- The
modelline puts the reviewer on Google's model whilebuildwrites on Anthropic's, using theprovider/modelformat. steps: 10bounds the review; "on the final step, OpenCode removes tools and asks the model to summarize in text."- The edit deny keeps the reviewer from fixing what it reviews, so it stays a reader and not a second writer.
- The shell rules deny everything, then allow
git diffandgit statusback, so the reviewer can read the change but cannot runnpm test. - The new body line turns a moved test into a high-severity finding with a quote, which is the exact failure from the recorded run.
The reviewer cannot run npm test, and that is deliberate. A reviewer that runs the suite and writes "tests pass" has produced one more claim from one more session. The test run belongs to you, where the command and its output are visible.
Run the review in the background
Ticket Triage's /review-diff command hands the diff to the reviewer in a background child. It sets no model of its own, and the commands page gives the order: "The child uses the command model, then the selected agent's model, then the parent's model." With the new frontmatter, /review-diff runs on Gemini with no change to the command file.
/review-diff Check that no existing test changed.
The text after the name is appended after a blank line and rides along with the git status --short and git diff output the command inserts. The command starts the child itself, not through the model's subagent tool. The parent stays available, and the commands page says that "OpenCode sends the child's result or failure back to the parent when the child finishes."

The sequence shows where each piece of text comes from. The diff enters the prompt as command output, before any model reads it. The child picks its model by the documented order, reads within ten steps, and sends its result or failure back to a parent that never stopped taking your input.
In the TUI, the review that Start here ran through opencode run is one line. The 2.3.0 tests did not run it, because opencode run does not expand slash commands.
/review-diff The new test is in the last commit; read it with git diff HEAD~1 HEAD -- test/. Check that no existing test changed and that a shattered item with a money-back request still routes to refund.
The reviewer's report is a claim as well. "No findings" means a model read the diff within ten steps and found nothing it judged worth saying. A /review-diff child has no subagent tool call to give you its session ID, and in the author's 2.3.0 test opencode session list listed only top-level sessions, not the reviewer child. When the review must be checked, ask in plain words, as Start here did, and export the child.
OpenCode 2.3.0 also registers a built-in /review command, described as reviewing changes "[commit|branch|pr], defaults to uncommitted." Nothing beyond that description has been confirmed. When the review is the gate, use the one whose rules you can read, and never name a project command review.md, because "a custom definition can also replace an earlier built-in command."
Small tools that keep the evidence readable
Read the diff after every session and every /undo. The snapshots page warns that "Current edits to an affected path can be overwritten, so review the restored summary and git diff before continuing." Inside the TUI, /diff opens the same view, and its Last turn scope, described on the keybinds page, narrows it to the most recent turn.
Keep style noise out of the diff. "Formatters are disabled by default," and a built-in runs only when its executable and the project's requirements are present. Ticket Triage has no formatter dependency, so leave the setting out there; in a repository that already uses Prettier, turn it on.
{
"$schema": "https://opencode.ai/config.json",
"formatter": true,
}
Ask /btw where the evidence is, not whether it exists. The TUI page says its answer "is not added to the conversation, so it does not affect later prompts," but it is still the session talking about itself. Use it as an index into the transcript; if the answer and the transcript disagree, the transcript wins.
Claim, proof, command
Notice what you never did: ask the session whether it was done. The test defined done before the fix existed. The exit code reported it. The empty test/ diff proved the definition did not move, and a second model read the result without the writer's reasoning in its context.
Everything in this article fits on one card. The left column is what a session tells you; the other two say what you accept instead, and how to get it.

Each row replaces a sentence you might accept with a command whose output a session cannot paraphrase. The first column quotes a typical claim, the second names the proof that would make it true, and the third gives the command that produces that proof.
- "All tests pass": the session's run may have been honest and still meaningless, so your own run with its exit status is the one that counts.
- "I did not change the existing tests": with the failing test committed first, any output from the test-folder diff is a finding, and this is the check that would have caught the recorded run.
- "I added a test for the new keyword":
grepfinds the keyword in the test file in a second, and the diff tells you whether the line is new. - "I only changed the classifier": a
--statsummary that lists a file you did not expect is the cheapest early warning there is, though a dropped keyword inside an expected file still needs the full diff. - "The review found no issues": the export confirms the agent, the model, and the parent, so you know the second opinion came from a second model.
- "I did not touch
package.json":git diff HEAD --exit-code -- package.jsoncompares the file with the last commit, so it prints nothing and exits 0 only when the file matches that commit. A staged change differs from the last commit too, so the command exits 1 for staged and unstaged changes alike, while plaingit diff --exit-code -- package.jsoncompares with the staging area and misses a staged change. - "I worked in the worktree": Git's list proves the worktree exists, not where the session wrote, so
git -Cwith the worktree path shows whether the change landed there.
Run the rows that match the claim you were given, not all seven every time.
If you already use Claude Code: the habits carry over unchanged. The writer-and-reviewer split rests on the same idea, a fresh context that is not anchored on code it just wrote; the Spillwave guide teaches it in its verification chapter and its subagents chapter. Claude Code's /review is an alias of /code-review, a local review that takes an effort level and runs as a background subagent in a terminal session. The difference is the reviewer's model. A Claude Code subagent's model field takes an alias such as sonnet, opus, haiku, or fable, a full Claude model ID, or inherit, so the second opinion comes from another Claude model. In OpenCode, one model line puts the reviewer on a different vendor's model, and /review-diff follows it with no change to the command.
Do this today
Everyone
- Prove today's gate held. On
mainin Ticket Triage, rungit log --oneline -3,git diff --stat HEAD~1 -- test/, andnpm test; echo "exit $?". The log shows the fix, the failing test, and the reviewer commit; the diff prints nothing; the last line isexit 0. - Run today's tests with the exit status visible. Use
npm test; echo "exit $?"and read the last line first, after every session that says it is done.
If you read Going deeper
- Put your reviewer on another provider's model. Add one
modelline from a provider the writer does not use, then runopencode debug agentsto confirm OpenCode read it. - Commit the next failing test before its fix. Check that
git status --shortis clean, branch, write the test, watch it fail, and commit it alone. - After the fix session, prove the test did not move.
git diff --stat test/should print nothing,git diff test/ | grep '^-[^-]'should list no removed lines, andnpm test; echo "exit $?"should end inexit 0. - Check that a file you protect matches the last commit.
git diff HEAD --exit-code -- package.json; echo "exit $?"prints nothing and ends inexit 0only whenpackage.jsonhas no staged or unstaged change. - Review on the other model, and check who reviewed. Ask for the reviewer subagent in plain words, then export the child session with
opencode session export <id> | jq '.info'and read its agent and model.

The habit has four steps. Run the suite yourself and read the last line, check that the test folder is empty in the diff after the fix, have a fresh read-only reviewer on a different provider read the change, and commit only when the exit code is 0, the test diff is empty, and the findings are checked.
Stop asking the witness who wrote the code

The scene is the opening moment: a green suite on one screen and a diff on the other, and the slow realization that the two disagree about what "done" means.
The compacted session did not lie. It told you the suite passed, and the suite did pass. It just happened to be the author of the code, the author of the tests, and the author of the report, all at once. No instruction fixes that, because the problem is not what the session was told; it is who gets to grade the work.
Move the grading out of the session. Let the exit code you watched say whether the tests pass, let an empty test diff say the definition of done held still, and let a reviewer on another provider's model read the change cold. The session can still say "done." It just stops being the one who decides.
This is Part 12 of "OpenCode, Day-to-Day," a 17-part guide to using OpenCode V2 as a daily, provider-neutral coding agent.