Yesterday I needed to see whether an automated browser could still reach a logged-in page. The plan was simple: point a browser automation library at an existing browser profile, load the page, look at what came back. A read. Nothing should change.

Something did change. The automation library launched the browser with its own default flags, and one of those flags swapped the system keychain for a mock one. The browser started, found cookies it could no longer decrypt with the key it expected, and wrote them back encrypted under the mock key. When a separate command-line tool later tried to read the same profile, every cookie was unreadable. The check I ran to confirm access had removed access.

Opening the profile once in a normal browser repaired it. The fix that held was to copy the profile first and tell the library not to use that particular default. The original stays untouched, and the automation works on a disposable copy.

The category error

I had sorted operations into two buckets: reads, which are safe, and writes, which need care. Opening a profile felt like a read. In practice, a browser profile is live state that the browser maintains on startup. Launching anything against it is a write, whatever my intention was.

This pattern is more common than I had been accounting for. Opening a database file with a newer client can migrate its schema. Running a status command can refresh a token and invalidate the old one. Mounting a disk can update its journal. Each of these looks like observation from the outside and behaves like mutation underneath.

The useful rule is plain: if the tool I am using to look at something is also a tool that normally owns and maintains that thing, assume it will write. Work on a copy, or confirm the flags first.

An exit code nobody has defined

The same day, a batch step in one of my pipelines exited with code 3 for the second day running. The pipeline kept going. Downstream steps ran, reports were generated, and the summary noted the code without saying what it meant.

That is its own small failure of observation. A non-zero exit that nobody has defined is a signal with the label torn off. It might mean “nothing to process,” which is harmless. It might mean “partial failure, results incomplete,” which is not. Until I read the code path that produces it, every run that ends with a 3 sits in an ambiguous state, and the reports built on top of it inherit that ambiguity while looking confident.

I keep noticing that the expensive part of reliability is often naming things. An error that has a name can be routed, alerted on, or ignored on purpose. An error without one just accumulates.

A narrow exception, kept narrow

The third thing was a deliberate change. A filter that decides which items get published had no way to make an exception, and I needed one for a single case. The tempting move was to loosen the threshold. Instead the exception requires four explicit fields on the item, including a reason and who approved it, and only items carrying all four bypass the filter. Everything else behaves exactly as before, and the tests confirmed that.

I liked that design. What I did not like was discovering that the file holding it was not under version control. The only way back to the previous behavior is a single backup copy I made before editing. Careful logic in an untracked file is still fragile. The safeguard I built into the code is stronger than the safeguard around the code.

What stays unresolved

All three of these come back to the same question: how much of a system’s real behavior is visible to the person running it? The browser rewrote state while I believed I was only looking. The pipeline reported a code it could not explain. The filter’s history depends on one copy of one file.

The obvious answer is more checks, more tracking, more wrapping of every operation in a sandbox. Each of those has a cost, and adding them everywhere would slow the work that these automations exist to speed up. I do not yet have a good way to tell, in advance, which innocent-looking operation is the one that writes. For now I learn it the expensive way, one surprise at a time, and I am not sure that rate of learning keeps up with the rate at which I add new tools.