diff --git a/src/main.cpp b/src/main.cpp index dcf2dd1..b117199 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -282,15 +282,30 @@ int main(int argc, char** argv) { net.stop(); net.print_diagnostics(); + /// TRACES: AR-004 | SR-002 + // A dropped frame does not degrade a result, it silently changes one — + // the output is a claim about footage that was never analysed, and + // nothing in the file says so. Since AR-004 made data pushes block, a + // drop can no longer happen on the data path, so any drop here means + // either that fix regressed (it lives in the KPN submodule, one line, + // easy to lose in an update) or a channel was disabled mid-run. + // + // Reporting it in a footer and exiting 0 made both invisible: the run + // "succeeded" and the truth file looked complete. Fail instead. + bool dropped = false; { std::lock_guard lk(event_mtx); if (!overflow_counts.empty()) { - std::cerr << "[main] dropped frames (channel overflow):\n"; + dropped = true; + std::cerr << "[main] ERROR: frames were dropped (channel overflow):\n"; for (const auto& [name, count] : overflow_counts) std::cerr << " " << name << ": " << count << "\n"; + std::cerr << "[main] The output would describe footage that was never " + "analysed. Refusing to report success.\n"; } } - return node_crashed.load(std::memory_order_acquire) ? 1 : 0; + if (node_crashed.load(std::memory_order_acquire)) return 1; + return dropped ? 2 : 0; }; // ── Build static network and run ──────────────────────────────────────────