From 1da773f60c29f318e7b4fdd69c8456829554e45f Mon Sep 17 00:00:00 2001 From: Tim de Bruijn Date: Sat, 29 Aug 2026 11:12:56 +0200 Subject: [PATCH] Bump to 0.27.3: the round that found its own gates were the problem A review round, like 0.27.1 and 0.27.2 -- no new capability, so a patch. What it fixes is mostly the machinery that was supposed to be catching things. Mutation testing across thirteen suites, 114 mutations, found seventeen guards that no test protected. Two mattered: patternFor() refusing DRM mode "none" (without it, POST /api/v1/drm/set?mode=none energises every unassigned relay on a board wired to DRM inputs), and writeSingleRegister's echo validation, which had no test at all while two drivers call it -- a setpoint that never arrived would have been recorded as delivered. A stored XSS in the dashboard: inline handlers interpolated a device id built from the serial number an inverter reports over RS485, filtered only to printable ASCII, which includes the apostrophe. esc() does not help there -- the browser HTML-decodes an attribute before compiling the handler. All nine handlers now pass their value as data-*. The release gate recognised a tag as /^v[0-9]/ while release.yml triggers on "v*", so vtest, v-wip and a bare v each built and published a release with no version check at all. It keys off the ref type now, and has a self-test that runs on every push. Three dependency ranges became pins. This builds an OTA image; the version that shipped has to be reconstructible from the tag, and a caret is not a pin. TWO BEHAVIOUR CHANGES, both in the diagnostics payload: previous_uptime_ms is still milliseconds and is now always a whole number of seconds. Accuracy is unchanged -- it was only ever sampled once per second -- but the low digits are zeros now. The uint32 behind it was wrapping at 49.7 days, so the long-lived bridges the field exists to describe were exactly the ones it misreported. Every device reports ONE cold start on this update, with its boot count restarting at 1. The fix above changed a field's unit without changing the layout, so an old record still checksummed and read back a thousandfold too large; a schema tag folded into the CRC makes it fail validation instead. Unknown is the honest answer -- those bytes cannot be interpreted. Three of the four gates in this release were themselves broken, and each was found by review rather than by running them: a dashboard check that could not fail after the attributes it looked for were renamed, a handler check with four ways round it, and a hostile-serial test whose probe had drifted one character from its own fixture. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 481d200..08eb066 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -545,7 +545,7 @@ namespace { // // And four ternaries became std::min, for +3 lines net once is counted -- the honest // arithmetic for a change made on clarity rather than size. -#define HELIOGRAPH_VERSION_PATCH 2 +#define HELIOGRAPH_VERSION_PATCH 3 #define HELIOGRAPH_STRINGIFY_(x) #x #define HELIOGRAPH_STRINGIFY(x) HELIOGRAPH_STRINGIFY_(x) constexpr uint16_t kFirmwareMajor = HELIOGRAPH_VERSION_MAJOR;