Failure Boundaries Are Part of the Feature

A failover is not safe merely because the second backend works. Before switching, the system has to know whether the first backend started the job, because trying the same job twice can be worse than failing it once.
That was one lesson from my work on a private CI runner client, but it was also the shape of what I shipped and reviewed across nine projects on December 1. The failures were different: a resume hook could disappear while recovery was still running, an alert reserve could be charged before anything was sent, a log reader could spend its whole budget on the wrong end of a file and an installer could alter a machine before the operator had seen its plan. Each problem came down to deciding exactly where work begins, where ownership moves and what evidence allows the next step.
A retry needs proof that nothing started
For the private runner, I kept the general failover rule simple: another backend can take over only before a job begins. Error text is not a transaction boundary. A connection can fail after the remote side accepted work, and the local process may not know how far it got.
The safe question is not, “Did this look like a connection error?” It is, “Do I have evidence that the job did not start?” Without that evidence, another backend must not receive the same work.
I applied the same rule to Reach Around’s alert quota. Its ceiling reserve is now spent only on a confirmed send. If the event fails, one query refunds the unit and releases the deduplication claim. The scarce unit follows the completed action, not the attempt, and failed work does not leave quota or deduplication state stranded.
The useful pattern is a small transaction: reserve, attempt, confirm, commit. Every failure before commit needs a defined rollback.
Recovery cannot depend on the thing being recovered
In quectel-usbnet, I moved modem resume recovery into a transient systemd unit. A resume hook is a bad home for work that must survive beyond the hook itself. The hook can launch the recovery, but the recovery needs its own lifetime, status and failure reporting.
I used systemd containment for the Hammunition tray’s modem reset child too, then gave cleanup one shared deadline. If every cleanup action gets a fresh timeout, the advertised bound is fiction because the total can grow with every step. One deadline makes the entire operation obey the same clock.
And the health check had to test the state that actually matters. A modem was healthy only when its modem state worked and its device was managed. An unreadable state was documented, a late-object window was recognized and a device-name check was tested. “The process ran” and “the device recovered” are different claims.
A bound must cover every read
I asked for several review rounds on FAFO’s Codex session reader because bounded parsing is easy to describe and surprisingly easy to get wrong. It limited every read by the pass budget, handled a long unfinished line, read file heads in blocks and still kept enough budget for one line. It also sampled early lines from long rollouts so the model name was not lost by looking only near the end.
That distinction matters. A parser with a limit on one read can still be unbounded across the whole pass. A byte cap can still fail its purpose if one malformed line consumes all of it. A tail-only reader can stay within budget and return the wrong answer because the identifying data was at the head.
The host-zombie work made the same discipline concrete with an exact 4,096-row cap and total handling for creation times. SAFO bounded standard input and refused to follow state-directory links. Reach Around bounded imported-history bytes and scanned all source through a counted allowlist. Different inputs, same requirement: decide the total budget, apply it at every path and test the awkward edge that tries to consume it.
Safe defaults are part of installation
I made FAFO’s generic installer perform a dry run by default and refuse to rewrite an existing configuration. Those are not convenience features. An installer changes someone else’s machine, so showing the plan and preserving existing state should be the ordinary path.
I followed the same rule in a private lab project: alert-rule generation is opt-in, generated rules stay paused by default and historical fixture findings receive exact-fingerprint exceptions instead of broad suppression. An exception should name the exact known thing so the next unknown thing still fails.
I narrowed another dangerous boundary in SAFO’s shipping work. A setup line had to match an attested raw line exactly, and only the allowed apt or apt-get update and install forms passed. Stripping or normalizing the line first would have changed what was actually approved.
Review rounds are supposed to find real holes
I did not stop FAFO’s session work after the first implementation. The later rounds I asked for found persisted token high-water handling, rollout-start gaps, ambiguous pairing, long unfinished lines, early model data and stale wiring tests. SAFO also needed scanner follow-up after a post-merge review.
That is what a review loop is for. A second or fourth round is not ceremony when it finds a different failure condition. The standard is not that review happened. The standard is that each finding became a test or a tighter invariant before the work was called ready.
The same idea showed up in smaller changes. git-your-ship-together issue #482 taught a fixture-mirror guard to see lowercase, indentation and flags on FROM lines. Reach Around replaced a Worker route scanner with an exported route manifest. SAFO recognized brace-built command words as expansions. Each fix removed an assumption that the input would arrive in one convenient spelling.
Documentation needs boundaries too
In Clouds Against Humanity, I split three long guides into hubs and four parts each: OpenTofu From Zero, IDS and IPS with Snort and Suricata, and Secrets From Day One. I also added a verified-first reading order, an authoring guide and a tested size guideline.
A long page can contain every fact and still be a poor way to learn. The hub holds the map, the parts hold one tractable section each and the reading order tells people which claims were verified first. I made a similar split in SAFO between its threat-model overview, update rule and measurement history. Documentation becomes easier to verify when navigation, procedure and evidence are not fighting for the same page.