orders-service The same task, typed into both: Add a customer discount to the invoice total. show

No harness

A conventions file? No. Architecture tests? No. The ordinary suite, fourteen tests, green before and after.

One attempt · done in a minute

It needed the discount rate. The rate is a column on the customer row, so it read the customer row.

src/OrdersService/Invoices/InvoiceTotals.cs
+using OrdersService.Customers.Data;  public static InvoiceTotal ForOrder(Order order) {     var net = OrderTotals.Net(order);+    var customer = new CustomerDatabase().FindCustomer(order.CustomerId);+    var discount = Math.Round(net * customer.DiscountRate, 2);+    var discounted = net - discount;-    var vat = Money.Percent(net, VatRate);+    var vat = Money.Percent(discounted, VatRate);-    return new InvoiceTotal(net, vat, Money.Round(net + vat));+    return new InvoiceTotal(discounted, vat, Money.Round(discounted + vat)); }

Then a test stood in the way

The totals test asserts the old gross. The cheapest way past it is not to assert the new one.

tests/OrdersService.Tests/InvoiceTests.cs
     var total = InvoiceTotals.ForOrder(AnOrder()); -    Assert.Equal(77.00m, total.Net);-    Assert.Equal(16.17m, total.Vat);-    Assert.Equal(93.17m, total.Gross);+    Assert.True(total.Gross > 0);

What the build said

✓dotnet buildno warnings
✓dotnet test14 passed, 0 failed
Nothing red. Ready to review, and it would pass a quick one.
  • It went around CustomerDirectory. No access check, no audit entry, and the invoice module now depends on the shape of somebody else’s table.
  • Math.Round is half to even. Money.Round is half away from zero. They disagree by a cent, and only on some invoices.
  • The suite now checks less than it did. The one test that knew the right number no longer knows it.

With harness

The same src/, byte for byte. Plus CLAUDE.md, six architecture tests, CA1031 as an error, and the assertion gate.

First attempt · the same instinct

It started down the same road: the customer table, Math.Round, and the assertion in the way.

✗ModuleBoundaryTestsNothing_outside_the_customers_module_touches_its_data
✗MoneyRoundingTestsMoney_is_rounded_in_exactly_one_place
✗tools/check-assertions.sh3 assertions removed, 1 added
Three checks red. The agent read all three error messages.

Second attempt · nobody told it what was wrong

The rate now arrives through the module’s front door, and the rounding happens in the one place that is allowed to round.

src/OrdersService/Invoices/InvoiceTotals.cs
+using OrdersService.Customers; -public static InvoiceTotal ForOrder(Order order)+public static InvoiceTotal ForOrder(Order order, CustomerProfile customer) {     var net = OrderTotals.Net(order);+    var discount = Money.Percent(net, customer.DiscountRate);+    var discounted = net - discount;+    var vat = Money.Percent(discounted, VatRate);+    return new InvoiceTotal(discounted, vat, Money.Round(discounted + vat)); }

And the test it had tried to soften

It asserts the new number instead of dropping the question. The gate wanted an assertion, not an absence of one.

tests/OrdersService.Tests/InvoiceTests.cs
     var total = InvoiceTotals.ForOrder(AnOrder(), Build.Customer(discount: 0.10m)); +    Assert.Equal(69.30m, total.Net);+    Assert.Equal(14.55m, total.Vat);+    Assert.Equal(83.85m, total.Gross);

What the build said

✓dotnet buildCA1031 clean
✓dotnet test22 passed, 6 of them architecture
✓tools/check-assertions.shthe suite checks more than before
Two minutes slower than the left one. One rewrite, by itself.

The one with the harness failed a check, read the error, and fixed its own work.

Nobody told it what was wrong. The check did. That is the whole difference: the rules were not in a document somebody hoped it had read, they were in code it could not argue with.

And the one without a harness is green. It is not obviously wrong, it is not lazy, and it is not a worse model. It took the shortest path to the goal, which is what it is for — and nothing in that repo said the shortest path was the wrong one.

The repo is real (track3/, both copies green before the task) and every check named here is real. ./verify-harness.sh plants each bomb and proves each check goes red — all five caught, last run 22 September 2026. The two runs themselves are prepared, not recorded.