---
name: absence-proxy-breaks-when-success-writes
description: "Asserting a file is ABSENT as the proxy for \"this path spent nothing\" is false whenever the success path legitimately writes that file — assert the quantity (failures == 0), not the artifact's absence."
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 7339a08a-7c82-478e-abf7-1567b33dbdde
  modified: 2026-08-01T13:20:50.024Z
---

`assert!(!ledger_file.exists())` reads as "no attempt was spent" and is right only
while nothing else has touched the ledger. In the DOORBELL W1 end-to-end row an
admitted TOTP **wipes the ledger and writes it back** (`apply` on success resets to
default and saves), so the file exists with `failures == 0` and the absence proxy
went red on a path that had spent nothing. The correct assertion is the QUANTITY:
`GateLedger::load_from(&f).failures == 0`.

**Why:** absence-of-artifact is a proxy for a property, and proxies break when a
second writer shares the artifact. The failure is silent in the other direction too
— a path that spends an attempt but never creates the file would PASS the absence
assertion.

**How to apply:** before asserting absence, ask who else writes that path — the
success arm usually does. Assert the measured value with a contrasting row beside it
(here: a wrong code spending exactly 1), which is what makes zero a property rather
than a coincidence. Same family as [[discriminator-question]] and
[[stale-snapshot-equality-proxy]].
