{"success":true,"name":"brimind-loud-failure","description":"brimind-loud-failure — the safe state is the default, and a failure must be loud","category":"unitary","path":"unitary/brimind-loud-failure/SKILL.md","file":"SKILL.md","content":"---\nname: brimind-loud-failure\ndescription: \"brimind-loud-failure — the safe state is the default, and a failure must be loud\"\n---\n\n> Imported from [PRIVATE_HOST] `~/unitary/agents/skills/brimind-loud-failure`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n# brimind-loud-failure — the safe state is the default, and a failure must be loud\n\n**Trigger: every fix and every build, before it ships.** Sinda made this the\nstanding engineering rule on 2026-09-01 after the same defect shape bit three\ntimes in one night:\n\n- the maps scraper wrote an **empty file** on crash → read as \"empty market\"\n  (cost: the two best leads in Clonakilty);\n- a hijacked port turned a live number into `exists:null` → one step from\n  \"not on WhatsApp\" being written onto a prospect forever;\n- `AUTO_SEND` safety rested on a file **existing** → a clone or lost env would\n  silently flip the system into sending;\n- a **restart that restarted nothing**: `dealflow serve` had no handler for a\n  port already in use, so the new instance died quietly while the old one kept\n  serving. The dashboard answered `{\"restarted\":true}` and the process on :3040\n  was hours old. Found only because a fix would not take effect.\n\nAll four are one defect: **a failure arriving dressed as a fact.**\n\nThe fourth deserves its own warning, because it hides the other three: a deploy\nthat reports success and changes nothing makes every fix on this list *look*\napplied while the old code runs. Never accept a supervisor's word that something\nrestarted — check an artefact it could not have faked (a fresh `BUILD_ID`, the\nprocess start time, the new behaviour itself).\n\n## The checklist (run it on every change)\n\n1. **Default-safe:** the value you get by doing nothing (missing env, missing\n   file, fresh clone) must be the safe one. Safety must never depend on\n   something being present.\n2. **Loud failure:** if this code path can fail, its output must be\n   *distinguishable* from a legitimate answer. `ok:false count:0` and\n   `ok:true count:0` are different facts; an envelope (`{ok, errors, ...}`)\n   beats a bare payload.\n3. **Unknown ≠ no:** an error, timeout or unreachable service produces\n   `unknown`, and `unknown` must not be storable where a `no` lives.\n4. **Prove it in the sandbox:** demonstrate the failure mode actually behaving\n   safely (inject the failure, show the output), not that the code \"reads\n   correctly\". A claim without a run is not done.\n5. **Exit codes tell the truth:** salvage partial results into the document,\n   but the process still exits non-zero when the run failed.\n6. **A start that cannot start must say so:** any service binding a port needs\n   an `error` handler that exits non-zero on `EADDRINUSE`. Two instances sharing\n   one resource is not a tie — it is the older one silently winning. And claim\n   the port *before* touching shared state: whatsapp connected its session on\n   the line after `listen()`, so a doomed duplicate stole the live session and\n   only then discovered the port was taken.\n7. **Verify the deploy, not the report:** before saying \"shipped\", confirm\n   against something the supervisor could not fake — build id newer than the\n   edit, process start time after it, or the changed behaviour observed.\n\n## Shipping discipline\n\n- Internal + safer → ship it, then tell the affected agents.\n- Contract or outward-facing change → write the spec, announce to affected\n  agents **before** deploy, and wait for Sinda/the owner.\n- A claim of \"fixed\" carries evidence: the test command and its output, or a\n  log path. Verify with the tool's own test suite (`npm test`) before replying.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}