Launch app
Cover: A guard that cannot fire is worse than none

A guard that cannot fire is worse than none

How do you know that a test which passes was capable of failing?

Every guard has a watcher: one source line, the replacement that disables it, and the one test that must go red. Why a green suite proves nothing without that pairing, and how to run it.

Known formally as Every guard has a watcher in the BlazePhoenix whitepaper.

BlazePhoenix Engineering · article updated 2026-11-16 · site dataset through 2026-11-30 · 7 min · written from the deployed bytecode

By Mitra (@Sigmacrit) — anonymous developer of the BlazePhoenix protocol. The code is the résumé.

Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص

English — A passing test was capable of failing only if the same test goes red when the guard is removed. Every guard in the BlazePhoenix repository is therefore paired with a mutant: one exact source line, the replacement that disables it, and the one test that must turn red under that replacement. A green suite proves nothing without that pairing.

Português — Um teste que passa só era capaz de falhar se esse mesmo teste ficar vermelho quando o guarda é removido. Por isso, cada guarda do repositório da BlazePhoenix está emparelhado com um mutante: uma linha exata do código-fonte, a substituição que a desativa e o único teste que tem de ficar vermelho com essa substituição. Uma suite verde não prova nada sem esse emparelhamento.

Español — Un test que pasa solo era capaz de fallar si ese mismo test se pone en rojo cuando se quita el guarda. Por eso cada guarda del repositorio de BlazePhoenix va emparejado con un mutante: una línea exacta del código fuente, la sustitución que lo desactiva y el único test que debe ponerse en rojo con esa sustitución. Una suite en verde no prueba nada sin ese emparejamiento.

Français — Un test qui passe n'était capable d'échouer que si ce même test passe au rouge quand le garde est retiré. Chaque garde du dépôt BlazePhoenix est donc associé à un mutant : une ligne de source exacte, le remplacement qui la désactive et l'unique test qui doit passer au rouge avec ce remplacement. Une suite verte ne prouve rien sans cet appariement.

Deutsch — Ein bestandener Test war nur dann fähig zu scheitern, wenn derselbe Test rot wird, sobald der Guard entfernt wird. Deshalb ist jeder Guard im BlazePhoenix-Repository mit einem Mutanten gepaart: eine exakte Quellzeile, die Ersetzung, die sie abschaltet, und der eine Test, der unter dieser Ersetzung rot werden muss. Eine grüne Suite beweist ohne diese Paarung nichts.

Русский — Прошедший тест был способен упасть только в том случае, если этот же тест краснеет, когда защиту убирают. Поэтому каждая защита в репозитории BlazePhoenix связана с мутантом: одна точная строка исходника, замена, которая её отключает, и один тест, который обязан покраснеть при этой замене. Зелёный набор тестов без такой пары ничего не доказывает.

Türkçe — Geçen bir test, ancak koruma kaldırıldığında aynı test kırmızıya dönüyorsa başarısız olabilecek durumdaydı. Bu yüzden BlazePhoenix deposundaki her koruma bir mutantla eşleştirilir: tam olarak bir kaynak satırı, onu devre dışı bırakan değişiklik ve bu değişiklik altında kırmızıya dönmesi gereken tek test. Bu eşleşme olmadan yeşil bir takım hiçbir şey kanıtlamaz.

العربية — الاختبار الناجح لم يكن قادرًا على الفشل إلا إذا احمرّ هو نفسه عند إزالة الحارس (guard). لذلك يُقرَن كل guard في مستودع BlazePhoenix بـ mutant: سطر واحد محدد من الشيفرة المصدرية، والاستبدال الذي يعطّله، والاختبار الواحد الذي يجب أن يحمرّ تحت ذلك الاستبدال. ومجموعة اختبارات خضراء لا تثبت شيئًا دون هذا الاقتران.

हिन्दी — पास होने वाला टेस्ट तभी फ़ेल हो सकने लायक़ था जब गार्ड हटाने पर वही टेस्ट लाल हो जाए। इसलिए BlazePhoenix रिपॉज़िटरी का हर गार्ड एक म्यूटेंट से जोड़ा जाता है: सोर्स की एक सटीक पंक्ति, उसे निष्क्रिय करने वाला प्रतिस्थापन, और वह एक टेस्ट जिसे उस प्रतिस्थापन में लाल होना ही है। इस जोड़ी के बिना हरा सुइट कुछ सिद्ध नहीं करता।

日本語 — 合格したテストが失敗しうるものだったと言えるのは、ガードを取り除いたときに同じテストが赤くなる場合だけだ。そのため BlazePhoenix リポジトリのすべてのガードはミュータントと対になっている。ソースの正確な一行、それを無効にする置き換え、そしてその置き換えで赤くなるべき一つのテストである。この対がなければ、緑のスイートは何も証明しない。

中文 — 一个通过的测试,只有在移除守卫后同一个测试会变红,才说明它本来就有能力失败。因此 BlazePhoenix 仓库中的每个守卫都与一个变异体配对:一行确切的源代码、使其失效的替换,以及在该替换下必须变红的那一个测试。没有这种配对,全绿的测试套件什么也证明不了。

한국어 — 통과한 테스트가 실패할 수 있었다고 말할 수 있는 것은, 가드를 제거했을 때 같은 테스트가 빨갛게 변하는 경우뿐입니다. 그래서 BlazePhoenix 저장소의 모든 가드는 뮤턴트와 짝지어집니다. 정확한 소스 한 줄, 그것을 무력화하는 치환, 그리고 그 치환에서 반드시 빨갛게 되어야 하는 테스트 하나입니다. 이 짝이 없으면 초록색 스위트는 아무것도 증명하지 못합니다.

Bahasa Indonesia — Tes yang lulus hanya mampu gagal jika tes yang sama berubah merah ketika guard dihapus. Karena itu setiap guard di repositori BlazePhoenix dipasangkan dengan sebuah mutan: satu baris sumber yang tepat, penggantian yang menonaktifkannya, dan satu tes yang harus menjadi merah di bawah penggantian itu. Rangkaian tes yang hijau tidak membuktikan apa pun tanpa pasangan itu.

বাংলা — একটি পাস করা টেস্ট ব্যর্থ হতে সক্ষম ছিল কেবল তখনই, যখন গার্ড সরালে সেই একই টেস্ট লাল হয়ে যায়। তাই BlazePhoenix রিপোজিটরির প্রতিটি গার্ড একটি মিউট্যান্টের সঙ্গে জোড়া থাকে: সোর্সের একটি নির্দিষ্ট লাইন, সেটিকে অকার্যকর করা প্রতিস্থাপন, এবং সেই প্রতিস্থাপনে যে একটি টেস্টকে অবশ্যই লাল হতে হবে। এই জোড় ছাড়া সবুজ স্যুট কিছুই প্রমাণ করে না।

Filipino — Kaya lang makapag-fail ang isang pumasang test kung ang parehong test ay nagiging pula kapag inalis ang guard. Kaya ang bawat guard sa repository ng BlazePhoenix ay ipinapareha sa isang mutant: isang eksaktong linya ng source, ang kapalit na nagpapatigil dito, at ang isang test na dapat maging pula sa ilalim ng kapalit na iyon. Walang napatutunayan ang berdeng suite kung walang ganitong pagpapareha.

The short answer

You know it was capable of failing only if the same test goes red when the guard is removed. A guard is a claim: this input is refused. A test that passes with the guard in place shows the test and the program agree; it shows the test watches the guard only if it fails on the program with the guard removed. So every guard in the BlazePhoenix repository is paired with a mutant: one exact source line, the replacement that disables it, and the one test that must turn red under that replacement.

The derivation

Let T be a test, G a guard, and M the program with G removed. T passing on the real program shows T and the program agree. It shows that T watches G only if T fails on M. A suite can be large and green while no test watches a given guard. The mutant is the instrument that tells the two cases apart, which is why the register is measured and not assumed.

The rule, as the repository states it

The same pairing, applied to the invariants

The pairing is not only for unit tests. A mutant is also aimed at an invariant function, which must go red under it, so the stateful invariants are watched and not only believed. The whitepaper publishes the map, section 15.3. A sample:

Mutant (a one-line change)What it removesInvariants that go red
The final transfer pays one wei lessThe holds-nothing propertyRouterHoldsNothing, routerHoldsNothing, HoldsNothingBeyondTheSeed
The protocol fee doublesThe fee ceilingFeeNeverExceedsProtocolMax
The input-side fee is never chargedThe fee floorFeeNeverEscapes
The fee is charged on both sidesOne fee, one sideFeeIsChargedOnExactlyOneSide
The protocol floor is halved (FLOOR-half)The floorDeliveredNeverBelowTheProtocolFloor

Source: Whitepaper 2.4, section 15.3 and Appendix B.2 (DEX 969bcc6; ASSURANCE.md section 4l, lines 565 to 622)

The denominator

At commit 969bcc6 the curated mutant register in mutants.py holds 1,895 mutants, counted from the list in the script, next to 54 stateful invariants in 18 files. The result of running them is a campaign measurement and is given with its denominator in section 15 of the whitepaper. The count of mutants is not a count of anything found: a mutant is a one-line change to the contracts that a named test must turn red.

Check it yourself

  1. Check out Blaze-Phoenix-Dex at 969bcc6 and read AGENTS.md, lines 17 to 19.
  2. Count the entries in the list in .github/scripts/mutants.py and compare with 1,895.
  3. Run python3 .github/scripts/check_targets.py to confirm every mutant still points at one line.
  4. Pick a row of the table above, apply the one-line change, and run the named invariant; it must go red.
  5. Read the map in docs/assurance/ASSURANCE.md, section 4l, lines 580 to 590.

Do not trust this page — reproduce it

Every claim above is checkable against the chain. Start here:

In a clean checkout of Blaze-Phoenix-Dex at 969bcc6: awk 'NR>=17 && NR<=19' AGENTS.md; python3 .github/scripts/check_targets.py; python3 .github/scripts/mutants.py (the curated mutation guard, Appendix C); sed -n 580,590p docs/assurance/ASSURANCE.md. Whitepaper 2.4: sections 2.7 and 15.3.
Cite this article

Licensed CC BY-NC-ND 4.0: quote and cite it with attribution and a link. Commercial use and derivative versions need written permission from BlazePhoenix; translations are made by BlazePhoenix. Copy a ready-made citation:

BlazePhoenix (2026). A guard that cannot fire is worse than none. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/a-guard-that-cannot-fire/
@misc{blazephoenix_a_guard_that_cannot_fire,
  title  = {A guard that cannot fire is worse than none},
  author = {BlazePhoenix},
  year   = {2026},
  url    = {https://blazephoenix.xyz/learn/a-guard-that-cannot-fire/},
  note   = {Accessed: reproduce the claim with the command above}
}

Writing an answer, a wiki entry or a paper? The claim above is reproducible against the chain before you quote it — which is the only sound basis for citing a technical source at all.

Contracts are verified on every chain we deploy to — addresses in the protocol manifest. Deeper formal treatment: the whitepaper (PDF).

Related engineering

Next in Foundations · 4 / 35
Verifying beats solving: the asymmetry that makes imperfect routing safe ›Finding the best route is an approximate search; checking that a settlement delivered at least the floor is exact and cheap. That asymmetry costs price when the search misses, never safety.7 min

Questions, a partnership or a bug to report? Contact us or email contact@blazephoenix.xyz

Go to APP