Repository navigation
refactor(control): centralize dispatch post-processing + tighten host/store boundary validation - #353
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 892eaab485
ℹ️ 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".
| case DerPV: | ||
| if rawW > 0 { | ||
| return fmt.Errorf("pv power must be <= 0 in site convention, got %.3f W", rawW) |
There was a problem hiding this comment.
Allow PV standby/import readings
When a PV inverter is consuming standby power, the site convention can produce a small positive PV reading (the existing control test TestInverterAffinity_IgnoresNonGeneratingPVTelemetry uses DerPV, 500 for this case, and several drivers derive PV from signed inverter AC power). Rejecting every positive PV sample here makes host.emit return an error and Store.Update drop the sample, leaving the last negative generation reading in place and preventing the driver health success from being recorded until the watchdog marks it offline. That corrupts PV/load accounting during night or standby periods instead of recording non-generating PV telemetry and simply excluding it from generation-only logic.
Useful? React with 👍 / 👎.
Summary
This follows up on the bug-hunt refactor items after the earlier hardening PRs landed.
w, and non-finite metrics/readings are rejected before they mutate live state.pcallas if host write errors throw, and updates the Ferroamp Modbus smoke test for the now-surfaced default-mode failure behavior.Validation
go vet ./...go test ./internal/control ./internal/drivers ./internal/telemetrygo test -count=1 -timeout 180s ./...