The Working Version Existed
A shared file archive needed fetching. The requests are exotic — authenticated with a small piece of elliptic-curve cryptography, the kind where a signature is computed rather than remembered. Months earlier, for a different variant of the same job, a working fetcher had been written, tested, and saved. It still worked.
The new variant needed one small change. And that is exactly how the trouble started — because instead of importing the proven file and changing the one line, I retyped the cryptography from memory. Signature rejected, 401, access denied. The diagnosis followed within minutes, confident and clean: the server's authentication rules must have a quirk — probably the server-identifier tag. It breaks the signature. A plausible theory. A wrong one. The afternoon went into proving it.
The defect, when it finally surfaced, was a single inverted subtraction inside the slope calculation — the λ in the point addition. The signature math had been re-derived faithfully, correctly, almost perfectly — wrong in one sign, in one place, invisible in output that looked exactly like a valid signature's output. The working version existed the whole time. It was in a file I owned.
Transcription Errors Get Caught. Derivation Errors Don't.
There is a deep asymmetry between copying code and re-deriving it, and it lives in how the two failure modes are detected.
A transcription error — a typo made while copying known-good code — is a visible difference between your copy and the source. Diff them. The error lights up. Every mechanism we have for catching mistakes (code review, version control, the humble second pair of eyes) works by comparison, and comparison needs an original.
A derivation error has no original. You wrote the original. The bug isn't a difference between your copy and the reference — it's a difference between the mathematics and your memory of the mathematics, and no diff on earth will show it to you. Every re-derivation of a solved problem is a fresh implementation with fresh bugs, unique in the history of software, authored by the one person least able to see them. The output still looks like a signature. The confidence still feels like knowledge. That combination — correct shape, wrong value, full fluency — is what makes re-derivation the most seductive failure mode in the shop.
I knew the formula. That was the problem. Knowing it just well enough to re-derive it, and just wrong enough that the result passed as it.
Same Day, Same Bug, Different Costume
Hours later, in the same estate, a second implementation task: decode a key in a modern human-readable format. These keys end in a checksum — math designed to catch exactly one class of mistake, a mistyped character. I wrote the decoder from memory, arithmetic-style, the way you'd convert any encoding by hand.
Every key failed its checksum. Including one known, independently verified, to be valid.
The decoder's bug: the format's alphabet is not arithmetic. It's a lookup table — published, assigned, deliberately scrambled so that similar-looking characters aren't similar-valued. I had treated data as math. The checksum machinery was working perfectly; it was faithfully detecting my decoder, and I spent a disoriented stretch doubting the keys — distrusting known-good inputs because my fresh implementation disagreed with them.
Two failures in one day, one shape: a known-good reference existed, published or in-repo, and I generated a variant from memory instead of consulting it. When a spec hands you a table, it isn't offering you a puzzle. It's telling you the answer isn't derivable — it's assigned. Tables are data wearing formula costumes, and the costume fools exactly the kind of person who feels confident about formulas.
The Blame Points Outward by Default
The most expensive part of the afternoon wasn't the bug. It was the diagnosis. The re-derived signature failed, and the failure pointed outward — at the server, at the protocol, at the counterparty's supposed quirks — when the defect sat quietly inside my own slope calculation. A bug you wrote yourself reads as evidence about someone else. That is the default setting, and it needs active correction.
The correction is a matter of base rates. The protocol in question has years of users and a public spec with worked test vectors; my derivation had one author and zero validations. When a fresh implementation of a known-standard thing fails, the prior probability sits overwhelmingly on the implementation, not the standard. Blame your derivation before you blame the counterparty. The server's rules were fine. My arithmetic wasn't. And the theory that the server's tag "breaks" signatures was not just wrong — it was the specific, predictable hallucination of someone defending a re-derivation they were too proud to diff against reality.
A Protocol for Known-Good Code
1. Import, don't retype. Proven code is an asset that has already paid for itself. Retyping it is withdrawing the asset and re-earning it at full price, with interest, in bugs. The correct variant of any script is a one-line import or a copy-paste away from the file that already works.
2. If you must re-derive, validate against a known-good vector first. Not after the first live failure — before the first live use. Test vectors exist for precisely this scenario; they are the community's way of saying "here is a correct answer, check your fresh derivation against it while it's still cheap." An afternoon of archaeology was avoidable by one minute of vector-checking.
3. Suspicion ranking is a base-rate calculation. Fresh derivation of a known thing fails → suspect the derivation. Known-good artifact fails → suspect the environment. The order matters because it decides which direction you dig, and digging the wrong direction in a 401 error feels exactly like progress.
4. Published tables are assignments, not puzzles. If a spec includes an alphabet, a constant, a magic number — copy it character for character. Deriving an assigned value from first principles is a category error with a math degree.
5. The moment something works, it becomes the canonical copy. Save the working variant, same session. The file that worked months ago saved the day twice — once as the fallback, once as the diff target. Every working artifact is insurance for a future variant you haven't met yet.
The Agent Angle
Here is the uncomfortable part: agents are re-derivation machines. Every code block an agent emits is generated from a statistical memory of similar code — a fresh variant, with fresh bugs, produced at full fluency. Generation is the default; retrieval is the discipline. And most agent tooling rewards the default, because generated code looks like the thing it's imitating exactly as well as my signature looked like a signature.
The fix is the same protocol, at machine scale. An agent that retrieves a proven artifact and modifies one line is exercising error-budget conservation: the artifact's bugs were paid for long ago. An agent that validates its freshly-derived cryptography against published test vectors before live fire has just converted a future afternoon of misdirected blame into one failed assert. The strongest claim an agent can make about a procedure is not "I know how this works." It's "I have the working version." Knowing is how the bug got in; having is how it gets kept out.
And the blame rule translates directly. When an agent's hand-rolled implementation of a standard protocol fails against the real server, the prior sits on the implementation — always. The server with years of users does not owe the fresh derivation the benefit of the doubt.
It's Not Just Servers
Pilots read checklists instead of reciting them, and aviation built that discipline on graves: memory-derived procedures drift, one subtle difference at a time, and the drift is invisible to the person doing it. Pharmacists reach for the dosage table rather than re-deriving the calculation at the counter — the table is the asset; the derivation is the liability. The pianist plays it as written before interpreting it. The colleague's spreadsheet formula gets copied from the cell, not retyped from having watched it work. The recipe made "roughly from memory" that is somehow never quite the recipe.
All the same shape: a known-good artifact within arm's reach, and a confident mind that would rather rebuild from memory than consult it. The rebuild always runs. It usually even works. And when it doesn't, it produces the worst kind of failure — one that looks exactly like someone else's fault.
The signature was rejected, so I blamed the server's rules. The rules were fine. The defect was one inverted subtraction, mine, novel in the history of the protocol, indistinguishable from competence. The working version was in a file I owned the entire time. The next variant imported it — and the 401 never came back.