Repository navigation
feat(stats): count drivers by version from one, and every sharing box reports - #1989
Conversation
A driver is a driver. The hand-kept labels (untested, in testing, verified on hardware) said little and went stale: one driver verified on four inverters read as untested. A box now reports each driver that delivered readings, with its version, and the driver lists say how many homes ran exactly that version the last closed day, from one and up. Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93adce04a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if name := driverFileType(d.Lua); name != "" { | ||
| out[name] = version(d.Lua) |
There was a problem hiding this comment.
Preserve every running version of the same driver type
When two configured devices use different versions of the same driver filename (for example, bundled pixii.lua and a separately retained pixii.lua), this assignment overwrites the first version with the last one in configuration order. Both devices can have delivered readings within the reporting window, but driverTypes receives only one version, so the household is omitted from the other version's usage count. Collect and deduplicate driver/version pairs instead of storing a single version per driver type.
Useful? React with 👍 / 👎.
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st kWh A box that shared by default waited for a relay that does not exist, so only boxes with FTW Cloud reported. Every box that shares now reports (Fredrik, 8 November 2026). FTW Cloud keeps no report and no address. Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
FTW's driver lists show a hand-kept label: "untested", "in testing" or "verified on hardware". Nobody keeps it up.
sma_pvis verified on four inverters and reads "untested", because its file says"tested", a value Core does not know. A driver running on many sites reads the same as one nobody has tried. Asked what it takes to get a driver "tested", the owner decided on 8 November 2026 to drop the idea:Change
pixii@2.1.9. A configured driver that never answers does not count. A household's own file still reports asother, with no version.fleetwireaccepts the new label, and also hyphens, which catalogue ids contain.GET /api/drivers/catalogcarriesrun_by, read from the fleet's public counts for the last closed day. The box asks only when someone opens a list, keeps an answer for 6 hours and waits 10 minutes after a failure. No answer leaves the number off. A box whose owner declined statistics never asks; the request carries only what any HTTP request does. Until boxes report versions, no number shows, so the lists do not say nobody runs anything.verification_statusstays in the driver files, unread by these screens.Two more changes to the daily report, on the owner's word of 8 November 2026:
12), not a range.fleetwireaccepts both.Changeset: minor, on the owner's word.
Rollout
FTW Cloud must accept the new label before a Core release sends it: this PR's
go/protocol, then the paired ftw-cloud PR pinned to it and deployed, then a Core beta.Evidence
make verifypasses;npm test915 passed.other; the wire accepts and refuses the right labels; counts read from the newest day and kept; no answer shows nothing; a feed without versions shows nothing; the catalogue carries the count.Review
An independent review (Sonnet) found the wire and UI sound. Fixed from it: the read ran under a lock, so one slow answer held up every list; a box that declined statistics still asked; right after a restart a report would have carried no drivers at all. Accepted: a household that edits a catalogue-named file can report its own number as a version, digits only; a count of 1 on a small day says one home runs that version, which is the point.
🤖 Generated with Claude Code