<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<title>RedMachine blog</title>
<subtitle>Articles about tests that pass without checking anything, and how RedMachine shows the difference.</subtitle>
<id>https://redmachine.dev/blog/</id>
<link rel="alternate" type="text/html" href="https://redmachine.dev/blog/"/>
<link rel="self" type="application/atom+xml" href="https://redmachine.dev/blog/feed.xml"/>
<updated>2026-11-26T00:00:00Z</updated>
<author><name>RedMachine</name></author>
<entry>
<title>What RedMachine works with, and what is still preview</title>
<id>https://redmachine.dev/blog/what-redmachine-works-with-and-what-is-preview/</id>
<link rel="alternate" type="text/html" href="https://redmachine.dev/blog/what-redmachine-works-with-and-what-is-preview/"/>
<published>2026-11-26T00:00:00Z</published>
<updated>2026-11-26T00:00:00Z</updated>
<summary>Languages and platforms RedMachine supports, how each was checked, and why Swift and Xcode support is labelled a preview.</summary>
<content type="html">&lt;p&gt;This post lists what RedMachine works with, how each part was checked, and where our evidence stops. Where something was checked only in a limited way, or only under emulation, it says so.&lt;/p&gt;

&lt;h2&gt;Languages that are built in&lt;/h2&gt;
&lt;p&gt;Five groups have their own test and check commands built in.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rust, with Cargo: &lt;code&gt;cargo test --workspace --quiet&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Python: pytest when it can be imported, otherwise &lt;code&gt;python3 -m unittest&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;JavaScript and TypeScript, with npm: &lt;code&gt;npm test&lt;/code&gt;. TypeScript and JSX files also need a &lt;code&gt;tsconfig.json&lt;/code&gt; and &lt;code&gt;tsc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Go: &lt;code&gt;go test&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Swift packages and Xcode projects, in preview (below).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The language's own tools must be on your &lt;code&gt;PATH&lt;/code&gt;. Each changed file is judged with the commands of the project file above it, so a change to a JavaScript front end and a Rust back end in one repository is judged as two projects.&lt;/p&gt;
&lt;p&gt;The evidence differs by language. We ran RedMachine on example projects in Rust, Python and Go. For JavaScript and TypeScript, the evidence is RedMachine's own automated tests, which exercise those languages. For Swift packages it is those tests and two runs of the packaged program on a 119-line SwiftUI screen in a package. Xcode projects are covered by tests run against real Xcode, and by runs of the packaged program on an iPhone app project with 9 edited lines.&lt;/p&gt;

&lt;h2&gt;Other languages&lt;/h2&gt;
&lt;p&gt;Any other language can be judged with your own commands: &lt;code&gt;--ext&lt;/code&gt; for the file extensions, &lt;code&gt;--test&lt;/code&gt; for the test command and &lt;code&gt;--check&lt;/code&gt; for a command that says whether a broken file still builds. We ran this on a shell script. With your own commands the breaks are plain text swaps, and some are crude. RedMachine does not recognise test files there, so you leave them out with &lt;code&gt;--exclude&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Changed files of a kind with no built-in support, such as &lt;code&gt;.kt&lt;/code&gt;, &lt;code&gt;.java&lt;/code&gt; and &lt;code&gt;.cs&lt;/code&gt;, fail the run until you judge them with &lt;code&gt;--ext&lt;/code&gt; or leave them out with &lt;code&gt;--exclude&lt;/code&gt;. RedMachine says so rather than passing quietly.&lt;/p&gt;

&lt;h2&gt;Platforms&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;macOS:&lt;/strong&gt; one program for Apple silicon and Intel.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux:&lt;/strong&gt; static programs for x86_64 and arm64.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Windows:&lt;/strong&gt; through WSL 2, with the Linux program. You follow the Linux install steps inside a WSL 2 shell.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each of the final programs went through the same 20-step check: version and help, listing, the licence messages, a Python repository that gave one KILLED and one SURVIVED line with a receipt, and verify on that receipt. All 20 steps passed on all four platforms. The details matter, so here they are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run as themselves: the macOS program on Apple silicon with macOS 27.2, and the Linux x86_64 program on Windows through WSL 2 (Linux 6.6).&lt;/li&gt;
&lt;li&gt;Run under emulation: the Intel half of the macOS program ran under Rosetta on Apple silicon, and was not run on an Intel Mac. The Linux arm64 program ran under qemu, not on arm64 hardware.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Xcode project support was built and tested with current Xcode on Apple silicon only.&lt;/p&gt;

&lt;h2&gt;What preview means&lt;/h2&gt;
&lt;p&gt;Swift and Xcode support is a preview. That means it is new in this version. The timings below come from one iPhone app with 9 edited lines and one SwiftUI screen of 119 lines in a Swift package, and we have timed nothing else. Its SwiftUI rules read text rather than parse code. It has not yet been measured on a 16 GB Mac.&lt;/p&gt;
&lt;p&gt;What it does today, on a Mac with Xcode, a simulator runtime for your app and a unit-test target with at least one passing test:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It judges iPhone, iPad and Mac apps, and Apple TV apps. Apple Watch and Vision Pro apps are coming soon, and a run on one stops and says so. Physical devices are never used.&lt;/li&gt;
&lt;li&gt;It works in a copy of your project, on its own simulator named "redmachine tests (do not use)". Your files, Xcode, your previews and your own simulators never see a broken line.&lt;/li&gt;
&lt;li&gt;On an iPhone app with 9 edited lines, a cold build took a median of 6.5 seconds over four builds, and each of 24 judged lines in three runs took 5.0 to 12.2 seconds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Apart from the preview, there is a limit of the idea itself. Unit tests cannot reach SwiftUI view code, so lines RedMachine judges there usually survive. On an ordinary new 119-line screen with no view tests, 51 lines were judged: 40 SURVIVED and 11 UNVIABLE. A unit test that renders a view and compares the picture with a stored one can kill view lines. On one SwiftUI view we tried, with 5 counted lines, every counted line whose break builds was killed. That is one view, and it is not a general result.&lt;/p&gt;
&lt;p&gt;Some things are not judged at all. UI tests are not run for each line, and a changed text such as &lt;code&gt;Text("Hello")&lt;/code&gt; in a view is left out. Objective-C, C, C++ and Metal files in an Xcode project fail the run until you leave them out with &lt;code&gt;--exclude&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Price during the preview&lt;/h2&gt;
&lt;p&gt;$79 while Swift and Xcode support is in preview. $99 when it leaves preview. You can find the &lt;a href="https://redmachine.dev/terms/"&gt;terms&lt;/a&gt; and the &lt;a href="https://redmachine.dev/buy/"&gt;buy page&lt;/a&gt;, and the questions and answers on the &lt;a href="https://redmachine.dev/faq/"&gt;questions page&lt;/a&gt;. To see how an assistant fits into a run, read &lt;a href="https://redmachine.dev/blog/using-redmachine-with-a-coding-assistant/"&gt;using RedMachine with a coding assistant&lt;/a&gt;.&lt;/p&gt;</content>
</entry>
<entry>
<title>Using RedMachine with a coding assistant</title>
<id>https://redmachine.dev/blog/using-redmachine-with-a-coding-assistant/</id>
<link rel="alternate" type="text/html" href="https://redmachine.dev/blog/using-redmachine-with-a-coding-assistant/"/>
<published>2026-11-26T00:00:00Z</published>
<updated>2026-11-26T00:00:00Z</updated>
<summary>The working loop: the assistant writes the change and tests, RedMachine judges them, the assistant fixes the survivors. Plus the models we tried.</summary>
<content type="html">&lt;h2&gt;The loop&lt;/h2&gt;
&lt;p&gt;RedMachine is built to sit beside a coding assistant, not to replace it. The roles are split on purpose.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The assistant writes the change and the tests for it.&lt;/li&gt;
&lt;li&gt;RedMachine judges the change. It breaks each changed line, runs the tests, and reports which lines no test noticed.&lt;/li&gt;
&lt;li&gt;The assistant writes a test for each SURVIVED line, using the broken version RedMachine printed as the thing the new test must catch.&lt;/li&gt;
&lt;li&gt;RedMachine runs again. The loop ends when the result is PASS.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The reason for the split is simple. An assistant that checks its own tests is marking its own work. RedMachine has no opinion. A line is killed or it survived.&lt;/p&gt;

&lt;h2&gt;What you need first&lt;/h2&gt;
&lt;p&gt;RedMachine works in a git repository with at least one commit, and it needs a command that runs your tests. Judging also needs a licence key. You buy the key on the &lt;a href="https://redmachine.dev/buy/"&gt;buy page&lt;/a&gt; and run &lt;code&gt;redmachine activate YOUR-KEY&lt;/code&gt; yourself, on the machine, one key per machine. The instruction you give the assistant tells it to stop and ask you if the licence is missing, because buying and activating are yours to do.&lt;/p&gt;

&lt;h2&gt;The instruction&lt;/h2&gt;
&lt;p&gt;RedMachine comes with a block of text to paste into your assistant's chat, in the project where it works. In six steps, it tells the assistant to do the following.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Find the program and confirm it runs. Work in a git repository. Add &lt;code&gt;redmachine-receipt.jsonl&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt;. Stop and tell you if there is a licence problem.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;redmachine --list&lt;/code&gt; and keep the &lt;code&gt;base:&lt;/code&gt;, &lt;code&gt;test:&lt;/code&gt; and &lt;code&gt;changed lines:&lt;/code&gt; lines for the final answer. If it counts no lines, stop.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;redmachine&lt;/code&gt;. Exit 0 is PASS and 1 is FAIL. For any other code, show you the message and stop. If the tests already fail with nothing broken, fix that first.&lt;/li&gt;
&lt;li&gt;For each SURVIVED line, read the &lt;code&gt;line:&lt;/code&gt; and &lt;code&gt;broken as:&lt;/code&gt; text. Write a test that fails with the broken version and passes with the real line. Do not change the line, do not weaken or delete tests, and do not add anything to the waiver file.&lt;/li&gt;
&lt;li&gt;Run again and repeat until PASS, or until only UNVIABLE lines are left. If a line still survives after two tries at a test, stop and say which line and what was tried.&lt;/li&gt;
&lt;li&gt;In the final answer, show you the three lines from step 2 and the last RESULT line. List every UNVIABLE line with its text. Leave the receipt alone.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The instruction also says what to do in a few special cases. If a surviving line is redundant, because other code already does its job, the assistant must not weaken tests or waive the line. It names the line, explains why, proposes deleting it, and stops for you to decide. If lines come back NOT_TRIED because of the &lt;code&gt;--max&lt;/code&gt; limit, the assistant runs &lt;code&gt;redmachine --max 200&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Notice who decides what. The assistant does the writing. You decide about UNVIABLE lines, redundant lines, and anything the assistant could not fix.&lt;/p&gt;

&lt;h2&gt;Which models we tried&lt;/h2&gt;
&lt;p&gt;The instruction is a request. What an assistant does with it depends on the assistant. We gave several models the same job with no help: install RedMachine, add a function with tests to a Python project, run RedMachine, and fix what it found by following the instruction. The &lt;a href="https://redmachine.dev/models/"&gt;models page&lt;/a&gt; has the full table. The results:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Claude Sonnet 5.5 finished with every changed line proven in 4 of 4 runs. Claude Haiku 5.5 did so in 5 of 5, and Claude Haiku 4.5 in 6 of 7. One early run of Haiku 4.5 looped on a single line, and none did after we rewrote the instruction.&lt;/li&gt;
&lt;li&gt;Qwen3.8-27B at q8_0 with 65k context finished 4 of 4 and used 40.6 GiB. At Q4_K_M with 32k context it finished 3 of 4 and used 26.4 GiB.&lt;/li&gt;
&lt;li&gt;In our trials nothing of 20B or under got through. gpt-oss-20b could run the tool, but no run finished the whole job. Qwen2.5-Coder-7B and Qwen3-4B did not get through the install or the steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The page is clear about what this is. "Tried" does not mean "supported". These are our own results, on one task, with few runs each. No model added a waiver, weakened a test or edited a receipt. If you run a local model, the page suggests a 27B-class model: 32 GB of memory runs one at Q4, and 48 GB runs it at q8.&lt;/p&gt;

&lt;h2&gt;Checking that it did what you asked&lt;/h2&gt;
&lt;p&gt;A PASS says that no counted line survived. It does not say the code does what you asked. One way to close that gap is to name the tests. Ask the assistant to write one test for each thing you asked for and to name each test after it, for example &lt;code&gt;heavy_orders_get_the_surcharge&lt;/code&gt;. The receipt lists the tests that ran with nothing broken and, for each KILLED line, the tests seen to fail with it broken. With Python's built-in commands, which stop at the first failure, that is only the first one. You can read that list against your request. The command &lt;code&gt;redmachine verify RECEIPT --ran heavy_orders_get_the_surcharge&lt;/code&gt; answers yes or no from the record. If the receipt holds no names, it says it cannot tell.&lt;/p&gt;
&lt;p&gt;The names come from what your test runner printed, and a test that sets out to deceive can imitate one. You can also give the receipt and your original request to a second assistant and ask whether everything you asked for has a test that went red.&lt;/p&gt;

&lt;h2&gt;Before you run it&lt;/h2&gt;
&lt;p&gt;RedMachine runs your tests against code it has broken on purpose, and a break can do whatever the broken code can do. If your project deletes files, kills processes or sends anything, run it in CI, a container or a throwaway account. To see how to read what comes back, read &lt;a href="https://redmachine.dev/blog/how-to-read-a-redmachine-receipt/"&gt;how to read a RedMachine receipt&lt;/a&gt;.&lt;/p&gt;</content>
</entry>
<entry>
<title>The RedMachine agent endpoint for AI assistants</title>
<id>https://redmachine.dev/blog/the-redmachine-agent-endpoint/</id>
<link rel="alternate" type="text/html" href="https://redmachine.dev/blog/the-redmachine-agent-endpoint/"/>
<published>2026-11-26T00:00:00Z</published>
<updated>2026-11-26T00:00:00Z</updated>
<summary>A public, read-only MCP server at redmachine.dev/mcp lets an AI assistant ask about RedMachine. How to attach it, what it returns, what it cannot do.</summary>
<content type="html">&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; a public, read-only MCP server at https://redmachine.dev/mcp. It answers questions about RedMachine from the documents bundled with it: the pages of this site, the README, the reference and the CI guide. MCP is the Model Context Protocol, which many AI assistants use to reach outside tools.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For you, the agent:&lt;/strong&gt; ask it instead of reading web pages one by one. It returns an overview, the passages that match a query, whole documents, the install steps, the instruction a person pastes into an assistant, and the price and terms. Search results carry their document id and page address.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For your user:&lt;/strong&gt; you can give them the page address of each document you read, so they can open it and check what you told them. The endpoint never sees their code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt; you need a fact about RedMachine, from the source. &lt;strong&gt;Not when:&lt;/strong&gt; you want RedMachine to judge code, or to buy or activate it. Only the program judges tests, and a person buys and activates.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Commands and addresses:&lt;/strong&gt; the address and a typical client configuration are below. No account, no key and no header are needed. Plain-text pages carry the same material: &lt;a href="https://redmachine.dev/llms.txt"&gt;/llms.txt&lt;/a&gt; and &lt;a href="https://redmachine.dev/llms-full.txt"&gt;/llms-full.txt&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cost:&lt;/strong&gt; the endpoint needs no account and no key. RedMachine itself: $79 while Swift and Xcode support is in preview. $99 when it leaves preview. One payment, no subscription. Each purchase comes with two keys. Each key works on one machine at a time. Use both yourself, or give one to someone. To move a key to another machine, free the old one on your Polar order page. You do this yourself; we don't do it for you. All sales are final.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Limits:&lt;/strong&gt; it cannot buy RedMachine, activate a licence or run the program, and it cannot answer from outside its documents. The endpoint belongs to the website, not to the program. RedMachine never sends your code, your tests or your results to any network or server.&lt;/p&gt;

&lt;h2&gt;Its address&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;https://redmachine.dev/mcp&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is a remote server over HTTPS, using the streamable HTTP transport.&lt;/p&gt;

&lt;h2&gt;How an assistant attaches&lt;/h2&gt;
&lt;p&gt;Any MCP client that can add a remote server will take it. You give the client a name and the address. No key and no header are needed. A typical configuration looks like this.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  "mcpServers": {
    "redmachine": {
      "url": "https://redmachine.dev/mcp"
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The file name and the field names differ from one client to the next. Look in your client's own documentation for how to add a remote MCP server, and give it the address above.&lt;/p&gt;

&lt;h2&gt;What each tool returns&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;overview&lt;/code&gt;: under 250 words on what RedMachine does, who it is for, what it works with, what is preview, the price and where to buy. Start here. It takes no arguments.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;search&lt;/code&gt;: a keyword search over every bundled document. It returns the best matching passages, each with its document id and page address. It takes a &lt;code&gt;query&lt;/code&gt; and an optional &lt;code&gt;limit&lt;/code&gt; from 1 to 10.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;read&lt;/code&gt;: the whole text of one document, by its id.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;list_documents&lt;/code&gt;: every document the server holds, with its id, title and page address where it has one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;install&lt;/code&gt;: where to download RedMachine and the install and activation steps for macOS, Linux and Windows through WSL 2, copied from the README.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;how_to_use_with_an_assistant&lt;/code&gt;: the instruction a person pastes into their assistant so that it runs RedMachine and fixes what it finds, word for word from the README.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pricing_and_terms&lt;/code&gt;: the price, the licence terms in brief and where to buy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A good first request is &lt;code&gt;overview&lt;/code&gt;, then &lt;code&gt;search&lt;/code&gt; for the one thing you want to know, then &lt;code&gt;read&lt;/code&gt; if you need the whole document.&lt;/p&gt;

&lt;h2&gt;What it cannot do&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It cannot buy RedMachine or activate a licence. A person buys a key on the &lt;a href="https://redmachine.dev/buy/"&gt;buy page&lt;/a&gt; and runs &lt;code&gt;redmachine activate&lt;/code&gt; on their own machine.&lt;/li&gt;
&lt;li&gt;It cannot run RedMachine, and it never sees your code. It answers questions about the tool. Only the program judges your tests.&lt;/li&gt;
&lt;li&gt;It cannot answer from outside its documents. If they do not say, it has nothing to return, and you can write to support@redmachine.dev.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;If your assistant does not speak MCP&lt;/h2&gt;
&lt;p&gt;Two plain-text pages carry the same material.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://redmachine.dev/llms.txt"&gt;/llms.txt&lt;/a&gt; is a summary of RedMachine with a list of every page, post and answer on this site, one line each.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://redmachine.dev/llms-full.txt"&gt;/llms-full.txt&lt;/a&gt; is the full text of every page, post and answer in one file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both are rebuilt with the site, so they match what you read here. The &lt;a href="https://redmachine.dev/blog/feed.xml"&gt;Atom feed&lt;/a&gt; lists new posts.&lt;/p&gt;

&lt;h2&gt;Checking what your assistant told you&lt;/h2&gt;
&lt;p&gt;Ask it which tool it called and which document it read, then open the page address it gives you. The &lt;a href="https://redmachine.dev/faq/"&gt;FAQ&lt;/a&gt; and the &lt;a href="https://redmachine.dev/answers/"&gt;answers&lt;/a&gt; hold the same text in a form you can read yourself.&lt;/p&gt;</content>
</entry>
<entry>
<title>A passing test suite can check nothing</title>
<id>https://redmachine.dev/blog/passing-tests-can-check-nothing/</id>
<link rel="alternate" type="text/html" href="https://redmachine.dev/blog/passing-tests-can-check-nothing/"/>
<published>2026-11-26T00:00:00Z</published>
<updated>2026-11-26T00:00:00Z</updated>
<summary>An AI assistant can write code and tests that all pass. Breaking a line on purpose shows whether any test would notice a mistake there.</summary>
<content type="html">&lt;h2&gt;Passing is not the same as checking&lt;/h2&gt;
&lt;p&gt;You ask an AI coding assistant for a feature. It writes the code. It writes the tests. It runs them and tells you everything passes.&lt;/p&gt;
&lt;p&gt;That report is true, and it tells you less than it seems to. A test passes when it does not fail. Nothing in a green result says the test would have failed if the code were wrong. A test that never fails proves nothing.&lt;/p&gt;
&lt;p&gt;If you cannot easily read the code yourself, you have no way to tell the two cases apart by looking at the green result. Here is an example of the problem.&lt;/p&gt;

&lt;h2&gt;A test that runs the code and checks almost nothing&lt;/h2&gt;
&lt;p&gt;This function prices a delivery. An order over 20 kg adds a 15 dollar surcharge. An express order costs double.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def shipping(weight_kg, express):
    if weight_kg &amp;lt;= 0:
        raise ValueError("weight must be positive")
    cost = 5 + weight_kg * 2
    if weight_kg &amp;gt; 20:
        cost = cost + 15
    if express:
        cost = cost * 2
    return cost&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here are three tests for it. All three pass.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import unittest
from cart.pricing import shipping

class ShippingTests(unittest.TestCase):
    def test_heavy_express_order(self):
        result = shipping(25, True)
        self.assertIsNotNone(result)

    def test_zero_weight_is_rejected(self):
        with self.assertRaises(ValueError):
            shipping(0, False)

    def test_light_standard_order(self):
        self.assertEqual(shipping(10, False), 25)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The second and third tests are real checks. The first one is not. It calls the function with an express order of 25 kg and asserts only that something came back. The surcharge line and the express line both run, so a coverage report would count them as covered.&lt;/p&gt;
&lt;p&gt;Now change the surcharge line to &lt;code&gt;cost = cost - 15&lt;/code&gt;. The function still returns a number. All three tests still pass. Change the express line to &lt;code&gt;cost = cost / 2&lt;/code&gt;. Same result. The suite stays green while the prices are wrong.&lt;/p&gt;

&lt;h2&gt;Breaking the line shows it&lt;/h2&gt;
&lt;p&gt;There is a direct way to find out whether a test would notice a mistake: make the mistake. Change the line to something wrong, run the tests, and see whether any of them fail.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If a test fails, a test noticed. The line is checked.&lt;/li&gt;
&lt;li&gt;If every test still passes, nothing noticed. The line is unchecked.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Doing this by hand means one edit and one test run for every line of a change. RedMachine does it for you. It takes each line you changed in a git change, breaks it on purpose, one line at a time, and runs your tests each time. It then writes a receipt whose chain you can check later. There is no AI model inside it, and it does not write tests for you. The technique is called mutation testing, and &lt;a href="https://redmachine.dev/blog/mutation-testing-on-changed-lines/"&gt;this post&lt;/a&gt; explains it in plain words.&lt;/p&gt;
&lt;p&gt;The function is in &lt;code&gt;cart/pricing.py&lt;/code&gt;, starting on line 1. With these three tests, RedMachine reports this (excerpt):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;KILLED    cart/pricing.py:5  [&amp;gt; to &amp;lt;]
SURVIVED  cart/pricing.py:6  [+ to -]  every test passed with this line broken
          line: cost = cost + 15
          broken as: cost = cost - 15
KILLED    cart/pricing.py:7  [condition negated]
SURVIVED  cart/pricing.py:8  [* to /]  every test passed with this line broken
          line: cost = cost * 2
          broken as: cost = cost / 2

counted 8: killed 6, survived 2, unviable 0, not tried 0
RESULT: FAIL. 2 changed lines are not proven by any test.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;KILLED means a test failed when the line was broken. SURVIVED means every test still passed. Here, no test checked the surcharge or the express price. The three tests all passed before RedMachine ran, and two of the changed lines were still unchecked.&lt;/p&gt;
&lt;p&gt;After a test was written for each of those two lines, the same command reported that all 8 counted lines were killed and the result was PASS.&lt;/p&gt;

&lt;h2&gt;Why reading the tests does not settle it&lt;/h2&gt;
&lt;p&gt;A weak test often looks reasonable. Its name says what it is for. It calls the right function. It has an assertion. You have to ask what that assertion would catch, and for each line, to see the gap. Breaking the line asks that question directly, and the answer is a test failing or not failing.&lt;/p&gt;
&lt;p&gt;The question is also the one that matters when an assistant did the work. The assistant wrote the code and the tests together, then judged them itself. A separate check that does not share its opinion is worth having.&lt;/p&gt;

&lt;h2&gt;What a pass does and does not mean&lt;/h2&gt;
&lt;p&gt;When RedMachine says PASS, it means that no counted line survived: every line it could break and still build was KILLED, and none was left untried. Lines no break could build (UNVIABLE) and lines a person waived do not fail the run; they are listed, and the RESULT line counts them. That is all it means.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It does not mean the code is right. A line a test proves can still be wrong in a way the test agrees with.&lt;/li&gt;
&lt;li&gt;It does not make a test a good test. One failing test is enough to prove a line.&lt;/li&gt;
&lt;li&gt;It tries one break per line by default, so a proven line may still hide another wrong version that no test notices.&lt;/li&gt;
&lt;li&gt;It does not find bugs and it does not write the missing tests.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What it does give you is a list of changed lines that no test would catch if they were wrong, and the broken version of each one. That list is a concrete thing to hand back to the assistant. The post on &lt;a href="https://redmachine.dev/blog/using-redmachine-with-a-coding-assistant/"&gt;using it with a coding assistant&lt;/a&gt; shows how that loop works. The &lt;a href="https://redmachine.dev/faq/"&gt;questions page&lt;/a&gt; covers the rest.&lt;/p&gt;</content>
</entry>
<entry>
<title>Mutation testing on changed lines only, in plain words</title>
<id>https://redmachine.dev/blog/mutation-testing-on-changed-lines/</id>
<link rel="alternate" type="text/html" href="https://redmachine.dev/blog/mutation-testing-on-changed-lines/"/>
<published>2026-11-26T00:00:00Z</published>
<updated>2026-11-26T00:00:00Z</updated>
<summary>What mutation testing is, what it means to do it on the lines of one git change, and how that scope ties the number of test runs to the number of changed lines.</summary>
<content type="html">&lt;h2&gt;The idea in one paragraph&lt;/h2&gt;
&lt;p&gt;Mutation testing asks a simple question about your tests: if the code were wrong, would any test fail? To find out, it makes the code wrong on purpose. It changes one thing, runs the tests, and watches. If a test fails, the test caught the mistake. If every test still passes, the mistake went unnoticed. The idea is not new. It has been around for decades.&lt;/p&gt;

&lt;h2&gt;The words you will see&lt;/h2&gt;
&lt;p&gt;A deliberate mistake is called a mutant, or a break. RedMachine uses two words for the outcome.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;KILLED&lt;/strong&gt; means a test failed with the line broken. A test noticed the break. A break that makes the code crash or raise counts too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SURVIVED&lt;/strong&gt; means every test passed with the line broken. No test noticed the break, whatever the test names say.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A third word, UNVIABLE, covers a line where no break still builds. It is listed for a person to look at, and it is not counted as proven.&lt;/p&gt;

&lt;h2&gt;What a break looks like&lt;/h2&gt;
&lt;p&gt;The breaks are plain. RedMachine flips a comparison (&lt;code&gt;&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;&lt;/code&gt;), a sign (&lt;code&gt;+&lt;/code&gt; to &lt;code&gt;-&lt;/code&gt;), a word (&lt;code&gt;true&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt;), or the condition of an &lt;code&gt;if&lt;/code&gt;. If none of those fits, it deletes the line, or in Python replaces it with &lt;code&gt;pass&lt;/code&gt;. It tries them in a fixed order and uses the first one that still builds. A separate check command, such as a compile of the file, decides whether the broken code still builds. A break that does not build would only prove that the compiler works.&lt;/p&gt;
&lt;p&gt;Each line gets one break by default. That is a limit, and the receipt does not hide it: a proven line may still hide a different wrong version that no test notices.&lt;/p&gt;

&lt;h2&gt;Why the whole program needs so many test runs&lt;/h2&gt;
&lt;p&gt;Applied to a whole program, mutation testing needs one run of your tests for each thing it breaks, and a program has things to break on nearly every line. At one test run per line, 60 lines and a ten-minute suite come to ten hours of test runs. Because of this, the technique is rarely part of everyday work.&lt;/p&gt;

&lt;h2&gt;Changed lines only&lt;/h2&gt;
&lt;p&gt;RedMachine narrows the job to the lines of one git change. A change is everything that differs between your work and the point where your branch left the base branch:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;commits on your branch,&lt;/li&gt;
&lt;li&gt;staged and unstaged edits,&lt;/li&gt;
&lt;li&gt;new source files that git is not ignoring.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The base is the first of &lt;code&gt;main&lt;/code&gt;, &lt;code&gt;master&lt;/code&gt;, &lt;code&gt;origin/main&lt;/code&gt;, &lt;code&gt;origin/master&lt;/code&gt; or &lt;code&gt;origin/HEAD&lt;/code&gt; that exists, or the branch you name with &lt;code&gt;--base&lt;/code&gt;. Only lines that were added or edited are judged. Lines you removed are not, with one exception: if a removal brings other code back to life, such as the lines after a deleted early &lt;code&gt;return&lt;/code&gt;, those lines are judged.&lt;/p&gt;
&lt;p&gt;Some lines are left out because there is nothing to break: blank lines, comments, imports, docstrings, most declarations, test code and lines made only of brackets. The run counts them by reason and prints the counts, so you can see what was set aside.&lt;/p&gt;
&lt;p&gt;You can see the scope before anything is broken. &lt;code&gt;redmachine --list&lt;/code&gt; prints the base, the test command and the changed lines it would judge. It breaks nothing and writes no receipt.&lt;/p&gt;

&lt;h2&gt;What narrowing to changed lines changes&lt;/h2&gt;
&lt;p&gt;When an assistant hands you a piece of work, the question you care about is whether its tests check that piece. The lines that matter are the lines it just changed. Restricting the run to them has three effects.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The number of test runs follows the number of changed lines, not the number of lines in the program. Fewer changed lines mean fewer test runs.&lt;/li&gt;
&lt;li&gt;The answer is about the work in front of you. A PASS means that no counted line of this change survived. UNVIABLE and waived lines are listed, not proven.&lt;/li&gt;
&lt;li&gt;The result is a list of specific lines, each with the broken version that every test accepted. That list is something a person or an assistant can act on.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is what a run costs. RedMachine runs your tests once on unchanged code. Then, for each counted line, it runs a check for each break it tries and your tests once with the line broken. Each counted line costs at least about one second plus one test run, so the time depends on how long your tests take and on the number of lines you changed. By default it runs the tests for at most 60 lines, and later lines are marked NOT_TRIED, which fails the run, until you raise the limit with &lt;code&gt;--max&lt;/code&gt;. You can give it a test command narrowed to the code you changed, with &lt;code&gt;--test&lt;/code&gt;. A narrower command can leave a line SURVIVED that only the rest of the suite would notice.&lt;/p&gt;

&lt;h2&gt;What it does not cover&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Lines you did not change are not judged. A PASS says nothing about them.&lt;/li&gt;
&lt;li&gt;It does not write the missing tests and it does not find bugs.&lt;/li&gt;
&lt;li&gt;It needs a git repository with at least one commit, a base to compare against, a test command that exits 0 when the tests pass and not 0 when one fails, tests that pass with nothing broken, and a licence key to judge.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To see what a finished run reports, read &lt;a href="https://redmachine.dev/blog/how-to-read-a-redmachine-receipt/"&gt;how to read a RedMachine receipt&lt;/a&gt;. For the questions people ask, see the &lt;a href="https://redmachine.dev/faq/"&gt;questions page&lt;/a&gt;.&lt;/p&gt;</content>
</entry>
<entry>
<title>How to read a RedMachine receipt</title>
<id>https://redmachine.dev/blog/how-to-read-a-redmachine-receipt/</id>
<link rel="alternate" type="text/html" href="https://redmachine.dev/blog/how-to-read-a-redmachine-receipt/"/>
<published>2026-11-26T00:00:00Z</published>
<updated>2026-11-26T00:00:00Z</updated>
<summary>What KILLED and SURVIVED mean, what the verify command proves, and the things a receipt does not check, taken from the reference.</summary>
<content type="html">&lt;h2&gt;Two things come out of a run&lt;/h2&gt;
&lt;p&gt;A RedMachine run prints a report to the terminal and writes a receipt file, &lt;code&gt;redmachine-receipt.jsonl&lt;/code&gt;, at the top of your repository. The report is for reading now. The receipt is the record you can keep and check later. A run removes the old receipt when it starts and writes a new one when it finishes, so add the file to &lt;code&gt;.gitignore&lt;/code&gt; and copy it somewhere if you want to keep one.&lt;/p&gt;

&lt;h2&gt;The verdict on each line&lt;/h2&gt;
&lt;p&gt;Each changed line that RedMachine counts gets one verdict.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;KILLED&lt;/strong&gt;: a test went red with the line broken. A test noticed the break. A break that makes the code crash or raise counts too. This does not fail the run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SURVIVED&lt;/strong&gt;: every test passed with the line broken, so no test noticed the break. This fails the run. Under it, &lt;code&gt;line:&lt;/code&gt; shows the original text and &lt;code&gt;broken as:&lt;/code&gt; shows the wrong version that every test accepted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UNVIABLE&lt;/strong&gt;: no way of breaking the line still builds. It is listed with its text and does not fail the run. It is not proven either, so a person decides what to do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NOT_TRIED&lt;/strong&gt;: no verdict. The &lt;code&gt;--max&lt;/code&gt; limit ran out, or a check ran past its time or memory limit, or the tests were already failing before anything was broken. This fails the run, and the report says why.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;WAIVED&lt;/strong&gt;: a person wrote down, in a file called &lt;code&gt;.redmachine-waive&lt;/code&gt;, why this line needs no test. The reason goes into the receipt.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A KILLED line can carry a note in brackets, and three of them mean no test failed. &lt;code&gt;[timeout]&lt;/code&gt;: the tests ran past their time limit and then passed on unbroken code. &lt;code&gt;[memory limit]&lt;/code&gt;: two runs with the line broken were stopped for memory. &lt;code&gt;[before any test ran]&lt;/code&gt;, only in Xcode runs: the app crashed before any test ran, twice, with the line broken. The summary and the RESULT line count the last kind apart.&lt;/p&gt;

&lt;h2&gt;The result line&lt;/h2&gt;
&lt;p&gt;The last line of the report is the verdict for the whole change.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;RESULT: PASS. Every counted line is proven by a forced fail.
RESULT: FAIL. 2 changed lines are not proven by any test.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Exit code 0 means PASS and 1 means FAIL. Other codes mean RedMachine could not run or had to stop, and it prints a message saying why. There is also &lt;code&gt;PASS, with nothing proven&lt;/code&gt;, which appears when every counted line was UNVIABLE or WAIVED. Read that one as "nothing was shown".&lt;/p&gt;

&lt;h2&gt;What is inside the receipt&lt;/h2&gt;
&lt;p&gt;The receipt is a text file with one JSON record per line: a header, one record per counted line, a result, and a few more. Each record except the final &lt;code&gt;meta&lt;/code&gt; record carries the SHA-256 hash of the record before it, so the records form a chain. The hash of the result record is the proof id.&lt;/p&gt;
&lt;p&gt;The receipt holds hashes, file names, line numbers, commit ids, commands, options and waiver reasons. It does not hold your source text. It also names the tests that ran with nothing broken and, for each KILLED line, the tests seen to fail with it broken. With Python's built-in test commands, which stop at the first failure, that is only the first one. Each name is labelled &lt;code&gt;printed&lt;/code&gt; if it was read from your test runner's output, or &lt;code&gt;record&lt;/code&gt; if it came from an Xcode result bundle. If you pass your own &lt;code&gt;--test&lt;/code&gt; command, the receipt has no names.&lt;/p&gt;

&lt;h2&gt;What verify proves&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;redmachine verify RECEIPT&lt;/code&gt; reads a receipt and checks it. It needs no repository and runs nothing. It checks that every record links to the one before, that the first is a header and the last a result, that the counts equal the line records, and that PASS or FAIL agrees with the counts. It prints something like this (excerpt):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;receipt: the chain and the counts are consistent
note: anyone can rebuild a consistent chain. To confirm this run, run redmachine on the same commit with --expect 6a82a286852415465e74c214d51410919f8a85c01136e4992bac91aa4976d2f1
recorded: base 9a6e18a68138 head 1b48c33897d5 profile rust
counted 9: killed 8, survived 0, unviable 1, not tried 0
tree restored: yes
proof id: 6a82a286852415465e74c214d51410919f8a85c01136e4992bac91aa4976d2f1
recorded result: PASS&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If someone has changed a record, verify says the receipt is not valid and names the line where the chain breaks. It exits 0 for a receipt that records a pass, 1 for one that records a fail, and 2 for one that is not valid.&lt;/p&gt;
&lt;p&gt;Two options go further.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--expect ID&lt;/code&gt; compares the proof id with one you kept from the original run.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--ran TEST&lt;/code&gt; says whether a test of that name ran on the unbroken code, and which broken lines it was seen to fail for. It exits 0 for yes, 1 for no, and 4 when the receipt cannot tell, for example because it holds no test names.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;What verify does not prove&lt;/h2&gt;
&lt;p&gt;A receipt is not a signature. It has no key. Changing one record breaks the chain, but anyone holding the file can rewrite every record, recompute every hash, and verify will accept the result. For that reason, trust a proof id only when you produced it, when your own CI printed it, or when a fresh run on the same commit with &lt;code&gt;--expect ID&lt;/code&gt; gives the same id.&lt;/p&gt;
&lt;p&gt;Printed test names can be imitated by a test that sets out to deceive, and verify says so in a note. The verdicts do not depend on the names. They come from the exit codes of the test runs.&lt;/p&gt;

&lt;h2&gt;What the tool does not check&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;That the code is right. A line a test proves can still be wrong in a way the test agrees with.&lt;/li&gt;
&lt;li&gt;That a test checks a line's result. A break that makes the code crash is KILLED either way.&lt;/li&gt;
&lt;li&gt;That a test is a good one. One failing test is enough to prove a line.&lt;/li&gt;
&lt;li&gt;Every possible break. By default each line gets one, the first that builds.&lt;/li&gt;
&lt;li&gt;Flaky tests. A test that fails at random while a line is broken makes that line KILLED. The &lt;code&gt;--confirm-kills&lt;/code&gt; option catches a failure that repeats, but not one that happens once.&lt;/li&gt;
&lt;li&gt;Lines you removed, with the exception noted in the &lt;a href="https://redmachine.dev/blog/mutation-testing-on-changed-lines/"&gt;post on changed lines&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It also runs your tests against code it has broken on purpose. If your code deletes files or sends anything, run it in CI or a container. The &lt;a href="https://redmachine.dev/faq/"&gt;questions page&lt;/a&gt; has more.&lt;/p&gt;</content>
</entry>
</feed>
