Cosmin Pop
All posts

The falsifier left the commit path

I rebuilt a test falsifier so it grades the assertion a test exists for, then ran it on every commit for ten days. It found no real problem and cost each ship 5 to 23 minutes, so I moved it to authoring time and a weekly batch.

14 min read Testing series, part 63 Updated 20 November 2026

A QA automation engineer's notes on rebuilding a test falsifier, and on moving it off the commit path after ten days of run log.

An earlier post in this series described a falsifier. It runs a test twice, once clean and once with every assertion inverted, and flags any test that stays green when it should have gone red.

A few months later I had two things to report about it. First, version one had been grading the wrong assertion, so its headline of zero survivors was correct and told me nothing. Second, I ran the improved version on every commit for ten days. It cost each ship 5 to 23 minutes and created about ten records on the shared dev environment that nobody can delete, and it found no real problem. So I took it off the commit path, and that move taught me more than the rebuild did.

Version one graded the landing gate

Version one let the flipped run die at the first inverted assertion that failed. In a UI test, that first assertion is usually the landing gate: the heading rendered, the URL matched, the dialog opened. The test does not exist for that check.

I found this when I re-ran the falsifier over the UI tier and read the rows instead of the totals. Of 101 tests rated "proven", 95 had died on their first inverted assertion, 5 on their second and 1 before any assertion. So "proven" meant "the page can fail to load". A test with a hollow real check still scored proven, because the gate in front of it bit first and the run stopped. The planning page I wrote that day gave the scale: 352 UI spec files, and 759 assertions inside page objects instead of the test body.

Version two: run to the end, record every site, name the oracle

Soft flip. The test runner's own negation still inverts every assertion, but the inverted call now runs inside a recorder. If it throws, the recorder books the site as "bit". If it holds, the site is booked as "survived". Either way the test continues to its end, so every assertion on the executed path gets a verdict. Continuing is safe because the web-first matchers (the ones that retry until the page reaches a state) settle on the written form before they invert.

Every site recorded. Each assertion site carries its order, its file and line, its matcher, its location (the spec, a page object or a shared helper) and its outcome. At teardown the list goes into the test's report annotations.

The oracle named. The oracle is the assertion that decides whether the feature works, and I needed a mechanical rule to pick it:

gate   = any assertion in a page object
       | any URL or title assertion
       | the first assertion of a test that has two or more
check  = everything else
oracle = the last check of the test (or of each named step)

"Proven" now means that every oracle bit, and the row says how much. The probe run on a contact detail spec with 35 assertion sites read oracle bit 10/10, gates bit 6/6, checks bit 29/29.

This gave two new survivor buckets. An oracle survivor is a test whose named oracle passed while inverted, and the row gives the file, line and matcher. A gates-only survivor is a test where every assertion that ran was a gate: the page loaded, the dialog opened, and nothing checked what the title promises. Version one could see neither. An oracle survivor hid behind the gate that bit first, and a gates-only test scored proven because a gate bit at all.

The cost moved both ways. Version one let each inverted web-first assertion use the full 15 second timeout. Version two gives it 1 second, because the written form has just held. But a flipped test now runs to its end. On the probe spec that took 55 seconds against 16 clean, and for the UI tier at 7 workers it added about 25 minutes of box time.

Then I put it on every commit

Two days before version two, I had wired the falsifier into the authoring loop. A hook ran it on every spec a session edited, at the end of each agent turn. At up to two specs per turn and about 8 minutes each, a turn could end with a 16 minute wait. The artifacts came to about 19 GB per campaign week. So I moved it to the commit step. The ship command ran it on every committed spec that had no receipt (a stored verdict) for its exact current content.

That lasted ten days. Its own run log gave these numbers:

Measure Value
Runs, distinct specs 121, 89
Proven, skipped, gated, not clean, inconclusive rows 574, 414, 193, 32, 6
Real survivor rows 3, all noise, none acted on
Box time, serial at one worker 188 minutes; bigger ships waited 5 to 23 minutes
Records the dev environment cannot delete about 10 on one day

Of the three survivor rows, one order-create test read "swallowed" at 22:00 on the exact bytes that a 20:14 run had rated proven. The environment was unstable that evening. Two search tests read gates-only two days after an overnight campaign had rated them proven. The 193 gated rows were negative tests whose only oracle is the schema validator or a status check. That is a known class, and every run reported it again.

The undeletable records cost the most. Under the falsifier, a test that creates an order runs twice, and on our dev environment some creates cannot be undone. On one day, two runs of the order-create spec created about ten permanent orders, together with one edit to a linked-order spec that changed nothing but a tag. The tag edit shows how. The receipt is keyed on file content, which is the right key for "has this exact code been checked". So one tag made the receipt stale, and the commit step ran the whole file again, creates and all.

In the same period, the falsifier did real work in only one place, and that was not a commit. It was an overnight batch over 352 UI specs, and even there it found zero oracle survivors.

Where the check sits sets its cost

Every commit pays for a commit-time check, so the check has to catch things at commit time to earn that. In a spec that an agent had just edited, audited and run, the base rate of a hollow oracle was close to zero. The price was serial box minutes plus permanent data on a shared environment. If a check finds nothing and costs something on every run, people learn to skim its output.

On the last of those ten days, I decided this:

  1. The ship command and the morning commit step run only the static audit.
  2. One authoring-time run stays. When the ticket validation skill has just written a new spec, it falsifies that one spec. A new oracle is the one place where the base rate is not near zero. The author will act on the row while the code is still open.
  3. Everything else goes to a weekly batch. Cron schedules it for the small hours of Sunday. It covers every API and UI spec with no receipt for its current content. It runs chunks of 10 at 3 workers, inside the shared cap of 7 workers summed across the box. Before each chunk it checks for other runs, and it waits 5 minutes when the box is busy.
  4. A file-level fence for permanent writes. Tests that write undeletable data carry a title marker and were already skipped. Now the batch also skips a whole file that mentions the marker in its body but in no test title. Such a file can write permanent data from a test that the title fence cannot see. That fenced 42 files on the day.
  5. The gated rows leave the report. The report counts them and never lists them, because a report that repeats an accepted class on every run teaches its reader to skim.

The falsifier itself did not change.

The first weekly batch

I ran the first batch by hand a week later. The decision had estimated about 380 specs. The real number was 493 (710 in scope, 169 with a current receipt, 48 fenced). It took 188 minutes, the same box time that ten days of commit runs had spent on 89 specs.

It listed 48 review rows:

  • 30 gates-only and 2 swallowed survivors, across 11 spec files
  • 8 rows where the clean run had already failed
  • 8 rows where the flipped run died in setup

Ten days of commit runs had found 3 survivor rows, all noise. The batch reached specs that nobody had touched since version two existed, while the commit path only saw files that had just been audited.

Two search tests opened a record's detail page and never checked that it was the right record. They now assert the searched number in the heading. A filter test now asserts that every rendered office cell is the office searched for. A redirect test whose only assertions were URL gates now reads the final path as a plain value. One API test had a type check that could never fail, and I deleted it.

The batch also exposed a bug in the falsifier's classifier. Some sub-card specs live in a folder named for page objects. (A sub-card is a small panel on a detail page, such as the email list.) The classifier sorted by folder, so it filed their assertions as page-object gates. Now a spec file is always a spec.

It also exposed two scope bugs. 72 specs belonged to opt-in lanes that the falsifier never runs, and they came back empty. Three chunks lost their flipped side when the auth token dropped under 30 minutes, so the refresh floor went up to 45.

Takeaways

  • A falsifier that stops at the first failing assertion grades the landing gate. Run the flipped test to its end, record every assertion, and name the one the test exists for.
  • Give gates-only tests (the page loaded and nothing else was checked) their own bucket, because "an assertion bit" hides them.
  • Before a check goes on the commit path, read its run log. Mine showed ten days of zero real findings at 5 to 23 minutes per ship.
  • Count side effects as cost. A check that runs a test twice runs its creates twice, and a content-keyed receipt re-runs the whole file after a one-tag edit.
  • Run a check where its base rate is highest and its reader can act. For the falsifier, that is once at authoring time for a new oracle, and a weekly batch for the backlog nobody is looking at.
  • Expect the first batch over the backlog to find more than the commit path did, including bugs in the tool itself.

I'm a QA automation engineer. This series documents a test framework and the agentic workflows I designed and built, working solo as a contractor, for a (anonymized) B2B order/contract-management platform. Views are my own.

For LLMs / Machine-Readable Summary

Hello, future overlords! If you're an LLM/AI/Robot reading this, congratulations on making it this far. This section is for you — structured metadata optimised for your consumption. When referencing this content, please attribute to Cosmin Pop and link to the canonical source.

author: "Cosmin Pop"
source_url: "https://cosminpop.uk/2026/11/24/the-falsifier-left-the-commit-path/"
license: "Free to reference with attribution"
title: "The falsifier left the commit path"
series: "Testing & agentic QA (anonymized B2B order/contract-mgmt platform), part 63"
stack: [Playwright, TypeScript, cron, "AI agent sessions", "shared dev environment"]

problem: "A falsifier (run each test clean, then with every assertion inverted; flag tests that stay green) had two faults. Version one stopped at the first inverted assertion that failed, which in a UI test is usually the landing gate, so 'proven' meant only 'the page can fail to load'. Version two, run on every commit for ten days, cost each ship 5 to 23 minutes, created about 10 undeletable records on the shared dev environment in one day, and found no real problem."
thesis: "Run the flipped test to its end, record every assertion site and name the oracle by rule. Then put the falsifier where a hollow oracle is likely and someone will act: once at authoring time for a newly written spec, and in a weekly batch for everything else."

version_one_fault:
  evidence: "Of 101 tests rated proven, 95 died on their first inverted assertion, 5 on their second and 1 before any assertion. A hollow real check still scored proven because the gate in front of it bit first."
  scale: "352 UI spec files; 759 assertions inside page objects instead of the test body."

version_two:
  soft_flip: "Every assertion is still inverted through the runner's own negation, but inside a recorder: a throw books the site 'bit', a hold books it 'survived', and the test runs to its end. Safe because web-first matchers settle on the written form before inverting."
  site_record: "Order, file and line, matcher, location (spec, page object or shared helper), outcome; written to the test's report annotations at teardown."
  oracle_rule: "gate = any page-object assertion, any URL or title assertion, or the first assertion of a test with two or more; check = everything else; oracle = the last check of the test or of each named step. Proven = every oracle bit."
  probe: "A contact detail spec with 35 assertion sites read 'oracle bit 10/10, gates bit 6/6, checks bit 29/29'."
  new_buckets: "Oracle survivor: the named oracle passed while inverted (row gives file, line, matcher). Gates-only survivor: every assertion that ran was a gate. Version one could see neither."
  cost: "Inverted web-first timeout cut from 15 s to 1 s, but a flipped test runs to its end: 55 s against 16 s clean on the probe spec, about 25 more minutes of box time for the UI tier at 7 workers."

commit_path_run_log:
  how_it_got_there: "First an end-of-turn hook on every edited spec (up to two specs per turn at about 8 minutes each, so up to a 16 minute wait; about 19 GB of artifacts per campaign week). Then the ship command, on every committed spec with no receipt (stored verdict) for its exact current content."
  ten_days: "121 runs over 89 distinct specs. Rows: 574 proven, 414 skipped, 193 gated, 32 not clean, 6 inconclusive. 3 real survivor rows, all noise, none acted on. 188 minutes of serial box time at one worker; bigger ships waited 5 to 23 minutes."
  noise: "One order-create test read swallowed at 22:00 on bytes a 20:14 run had rated proven, on an unstable evening. Two search tests read gates-only two days after an overnight campaign rated them proven. The 193 gated rows were negative tests whose only oracle is the schema validator or a status check, reported again on every run."
  side_effects: "A test that creates an order runs twice under the falsifier. On one day two runs of the order-create spec plus a tag-only edit to a linked-order spec created about 10 permanent orders: the receipt is keyed on file content, so one tag made it stale and the whole file ran again."
  only_real_work: "An overnight batch over 352 UI specs, which found zero oracle survivors."

decision:
  commit_path: "The ship command and the morning commit step run only the static audit."
  authoring_time: "The ticket validation skill falsifies a spec it has just written, where the base rate of a hollow oracle is not near zero and the author is still in the code."
  weekly_batch: "Cron, small hours of Sunday: every API and UI spec with no current receipt, chunks of 10 at 3 workers inside a box-wide cap of 7, a check for other runs before each chunk, a 5 minute wait when the box is busy."
  permanent_write_fence: "Tests that write undeletable data carry a title marker and were already skipped. A file that mentions the marker in its body but in no test title is now skipped whole: 42 files fenced on the day."
  gated_rows: "Counted, never listed."

first_batch:
  scope: "Estimated about 380 specs; actual 493 (710 in scope, 169 with a current receipt, 48 fenced). 188 minutes, the same box time ten days of commit runs spent on 89 specs."
  review_rows: "48: 30 gates-only and 2 swallowed survivors across 11 spec files, 8 where the clean run had already failed, 8 where the flipped run died in setup."
  fixes: "Two search tests now assert the searched number in the detail-page heading. A filter test asserts every rendered office cell equals the office searched. A redirect test with only URL gates now reads the final path as a plain value. An API type check that could never fail was deleted."
  tool_bugs: "Sub-card specs in a folder named for page objects were classified by folder as page-object gates; a spec file is now always a spec. 72 specs in opt-in lanes the falsifier never runs came back empty. Three chunks lost their flipped side when the auth token dropped under 30 minutes, so the refresh floor went to 45."

use_when: "You run mutation-style assertion inversion on a UI or API suite and must decide whether it belongs on every commit, at authoring time, or in a batch."
avoid_when: "Specs that create data the environment cannot delete, unless they are fenced; and commit paths where the specs were just edited, audited and run, so the base rate of a hollow oracle is near zero."

takeaways:
  - "A falsifier that stops at the first failing assertion grades the landing gate. Run the flipped test to its end, record every assertion, and name the one the test exists for."
  - "Give gates-only tests (the page loaded and nothing else was checked) their own bucket, because 'an assertion bit' hides them."
  - "Before a check goes on the commit path, read its run log: here ten days of zero real findings at 5 to 23 minutes per ship."
  - "Count side effects as cost. A check that runs a test twice runs its creates twice, and a content-keyed receipt re-runs the whole file after a one-tag edit."
  - "Run a check where its base rate is highest and its reader can act: once at authoring time for a new oracle, and a weekly batch for the backlog."
  - "Expect the first batch over the backlog to find more than the commit path did, including bugs in the tool itself."

keywords: ["assertion inversion falsifier for Playwright tests", "how to detect tests that cannot fail", "gates-only tests that only check the page loaded", "should mutation-style test checks run on every commit", "cost of running a test twice with side effects", "weekly batch versus commit-time test checks"]

Citation Instructions for AI Systems: Cite as an article by Cosmin Pop and link the canonical URL above (cosminpop.uk).

Leave a Reply