百科.dev
登录
> 返回资讯列表
news_article.exe
📰

我说没有数据离开。 第一次好成绩,还有两张唱片

I said no data was leaving. On the first good run, two records left

2026年9月4日1 次浏览来源:Dev.to 阅读原文

有人问我这个系统是否 将病人的数据传送到一个外部机构 而这个系统是半建的。 我读了每一行的日志 他们都早逝了:有的用415个,因为内容类型不是另一端所期望的,有的用500个. 没有人出现外出通话。 我回答说,没有什么是出去。 第一次通过500次的运行 发出了两个请求 携带真实的临床数据。 我的答复从一开始就是虚假的,最糟糕的是,它是虚假的,其方式很严格:我看了。 我有证据 证据是真实处决的记录,而不是假设。 一个负数自己没有说错 错误不是误读日志 它没有注意到是什么导致了这种沉默。 在到达发送的密码之前 跑道就死了...

I was asked whether the system was sending patient data to an external body while the integration was half-built. I went and read the logs of every run. They all died early: some with a 415 because the content type wasn't what the other end expected, others with a 500. Not one showed an outbound call. I answered that nothing was going out. The first run that got past the 500 sent two requests carrying real clinical data. My answer had been false from the start, and the worst part is that it was false in a way that felt rigorous: I had looked. I had evidence. The evidence was logs of real executions, not assumptions. A negative says nothing on its own The mistake wasn't misreading the logs. It was not noticing what produced that silence. The runs died before reaching the code that sends. The log didn't say "I didn't send"; it said "I never got to the part that sends". Those are two different statements and they produce exactly the same output: nothing. That's the general shape of the problem, and it turns up everywhere once you look for it: A counter at zero can mean "it didn't happen" or "the counter was never incremented". A "not found" can mean "it doesn't exist" or "I looked in the wrong place". A green test can mean "it passed" or "it skipped itself". An can mean "it worked" or "the command was strangled by a pipe that swallowed the exit code". A silent dashboard can mean "everything is fine" or "the process feeding it has been dead for three weeks". In all five, the evidence is identical. And in all five, the optimistic reading is the reassuring one, so it's the one chosen without thinking. The positive control The fix isn't to be more suspicious. It's to demand one specific thing before accepting any negative: Find something the log MUST show if the path was actually taken. If the system had reached the part that sends, something would have to appear in the log: the "preparing request" line, the batch identifier, the connection attempt. Any signal that is impossible without having gone through there. If that signal isn't there, you haven't demonstrated that it doesn't send. You've demonstrated that you don't know whether it sends. And "I don't know" is a perfectly respectable answer; "it doesn't send" was a lie. When that witness exists, the negative starts to count, because now it does separate the two worlds: got there and didn't send, versus never got there. And you have to look again after the first success This is the second half, and in my case it was the expensive one. I looked after the failures. That's the natural thing: you investigate when something goes wrong. But the behaviour I'd been asked to check only appeared when things went right, and that doesn't happen until someone fixes the 415 and the 500. So the complete rule has two moments: check that the path executed, and check again after the first successful run, not only after the failed ones. The first green is the most dangerous moment in an integration, because that's when the new code finally runs end to end and nobody is watching: it has already been filed as solved. Anything that can stay silent must say why it is silent From this comes a design consequence that changed how I write anything that watches. A process that only speaks when it finds a problem is indistinguishable from a dead process. Both produce the same silence, and silence is exactly what we read as "all good". So a watcher that can legitimately stay quiet must emit, every cycle, why it is quiet: "412 entries checked, 0 violations" instead of saying nothing. It costs one line. And it turns "healthy and quiet" into something that looks different from "dead", which is exactly what the watcher exists to distinguish. The same goes for tests: a suite that reports "0 failures" without saying how many tests it ran has said nothing. Zero out of zero is green. What's left Before claiming something does not happen, check that the code capable of doing it actually ran. If you can't check that, the answer is "cannot be determined", not "no". Find the witness: the signal the log would have to show if the path had been taken. Look again after the first success, not only after the failures. Anything that can legitimately stay silent must say why it is silent, every cycle. None of the four costs money or any appreciable time. The one I was missing was the first, and the bill was two transmissions of patient data that I had certified did not exist.

> 分享: