Repository navigation
fix(sigenergy): stop reading a SoH register nothing can receive - #38
Conversation
driver_poll read ESS SoH at 30087 every poll and dropped the result on the floor. The battery emit below it carried only W and SoC_nom_fract, so the read bought a Modbus round trip every 5 seconds and nothing else. There is no field to put it in. spec/host-api.md and the canonical keys in spec/host-api-profile.json both end the battery list at available_discharge_Wh, VALID_FIELDS["battery"] in drivers/tests/test_emit_fields.py has no SoH-like name, and a grep for SoH across the repository hit this driver alone. Blixt reads each emit key by exact name and silently drops one it does not know, so inventing a name would have failed test_battery_fields_valid and still lost the value at the far end. The read goes instead. sigenergy has no package target under packages/v1, so the catalog driver is the only copy. Signed-off-by: Fredrik Ahlgren <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
CI runs generate_index.py and then git diff --exit-code on index.yaml, so the derived size_bytes and sha256 have to travel with the driver edit that changed them. Same for manifests/sigenergy.yaml, which sync_manifests.py and make check hold to the same rule. Only those two fields move, in both files. No version bump, no CHANGELOG entry, signature and bytecode_sha256 left empty for the release job. generate_devices.py and generate_support_status.py produce no diff, since neither reads driver size or content. Signed-off-by: Fredrik Ahlgren <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb852cdf00
ℹ️ 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".
| @@ -53,9 +53,6 @@ function driver_poll() | |||
| bat_soc = soc_regs[1] / 1000 -- gain 10 → percent, / 100 → fraction | |||
| end | |||
There was a problem hiding this comment.
Bump the Sigenergy version for the changed artifact
When the existing 1.1.0 artifact is present in the beta channel, this source change triggers .github/workflows/ftw-drivers-release.yml, but build_publication rejects a changed SHA-256 whose manifest version is not higher than the prior version. Because manifests/sigenergy.yaml remains at 1.1.0, the signed-channel publication will fail with changed artifact needs a higher version; bump Sigenergy to a new patch version.
Useful? React with 👍 / 👎.
| @@ -53,9 +53,6 @@ function driver_poll() | |||
| bat_soc = soc_regs[1] / 1000 -- gain 10 → percent, / 100 → fraction | |||
| end | |||
There was a problem hiding this comment.
Synchronize the manifest after changing the Lua bytes
After this deletion the source is 3813 bytes with SHA-256 a5c6c433710b293c359c625bae02ed32f5823424646ef98d321a3de30355fa57, while manifests/sigenergy.yaml still claims 3925 bytes and the previous hash. test_manifest_hash_and_size_match_the_source and the manifest synchronization step therefore fail, and consumers reading the manifest receive integrity metadata for different bytes; regenerate and commit the manifest fields.
AGENTS.md reference: AGENTS.md:L64-L71
Useful? React with 👍 / 👎.
| @@ -53,9 +53,6 @@ function driver_poll() | |||
| bat_soc = soc_regs[1] / 1000 -- gain 10 → percent, / 100 → fraction | |||
| end | |||
There was a problem hiding this comment.
Lower the Sigenergy absent-register baseline
Removing register 30087 lowers Sigenergy's measured absent-register debt from 6 to 5, but drivers/tests/absent-register-baseline.json remains at 6. The ratchet deliberately requires equality after an improvement, so test_absent_register_debt_does_not_grow[sigenergy] now fails; if that check were bypassed, a future sixth permanently failing read could also be added without detection. Record the new count of 5.
AGENTS.md reference: AGENTS.md:L64-L71
Useful? React with 👍 / 👎.
The SoH read removal in the previous commit left the version, CHANGELOG and absent-register ratchet untouched. Raise the driver version since the Lua source changed, record it in the changelog, and drop the absent-register-baseline.json entry from 6 to 5 to match the register that no longer gets read. Signed-off-by: Claude <[email protected]>
Both sides added an entry at the top of the same Unreleased "Fixed" block: sungrow 1.5.1 here, sigenergy 1.1.1 from #38. Kept both. Signed-off-by: Fredrik Ahlgren <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
#37 taught the boundary check to scan the repository rather than the disk under it, so make check passes locally again with worktrees present. #38 removed sigenergy's SoH read. #39 stopped sungrow accepting a battery command on an inverter with no battery. Two real conflicts, both in drivers this branch had also touched: sigenergy main removed the SoH read at 30087 outright; this branch had bounded it. Removing a read whose result is discarded is strictly better than bounding it, so main's side stands and the bounded probe covers the remaining five reads. sungrow merged cleanly in the Lua: main's control-path guard plus this branch's bounded reads through optional_read. Zero violations, and the string-inverter refusal is intact. Both files now differ from main's bytes under main's version, so both move again -- sigenergy 1.1.1 -> 1.1.2, sungrow 1.5.1 -> 1.5.2. This is exactly what the signed channel refuses to publish otherwise, and what the SemVer gate in ftw#709 checks across a pin move. Swept the whole catalog afterwards: zero absent-register violations across every driver. make check green, 3008 tests pass. Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]>
Summary
No hardware support changes.
drivers/lua/sigenergy.luaread the ESS State ofHealth register at 30087 on every poll and threw the result away. The battery
emit right below it carried only
WandSoC_nom_fract, so the read cost aModbus round trip every 5 seconds and bought nothing. The read is gone.
Deleted rather than emitted, because there is nowhere to emit it:
spec/host-api.md, Batteryavailable_discharge_Whspec/host-api-profile.json, canonical battery keysVALID_FIELDS["battery"]indrivers/tests/test_emit_fields.pySoH/sohacross the repositoryBlixt reads each emit key by exact name and silently drops one it does not
know. Inventing a name would have failed
test_battery_fields_validand stilllost the value at the far end.
sigenergyhas no package target underpackages/v1, so the catalog driver isthe only copy.
Commits
fix(sigenergy): stop reading a SoH register nothing can receive— threelines out of the driver.
fix(sigenergy): regenerate the size and hash the driver edit changed—size_bytes3925 → 3813 and the newsha256, inindex.yamlandmanifests/sigenergy.yaml. Only those two fields move. CI regenerates bothand then runs
git diff --exit-code, so they have to travel with the edit.generate_devices.pyandgenerate_support_status.pyproduce no diff.No version bump and no
CHANGELOG.mdentry.signatureandbytecode_sha256stay empty for the release job.
One red check, and it is asking for a central file
pytestfails ontest_absent_register_settles.py::[sigenergy]. Theabsent-register count drops 6 → 5 and the ratchet fails a fall the baseline does
not record:
To merge, set
sigenergyto5indrivers/tests/absent-register-baseline.json. Left untouched here becausethat file is maintained centrally.
Worth being precise about: this is a new failure from this branch, not a
pre-existing one. The full suite is green on the parent commit — 1903 passed,
nothing failed. The ratchet is doing its job.
Driver evidence
sigenergydriver header. Register 30087 removed, no register added or reinterpreted.
whose result was never used. Every value the driver emits is byte-identical
before and after; the diff cannot change telemetry, only the poll's register
traffic.
for it. When one arrives, 30087 is U16 percent at gain 10, so raw / 1000 is
the 0-1 fraction, the same shape as SoC two lines up.
Safety
Control paths are untouched.
Unchanged, and one less failing read to survive.
Package or promotion evidence
not applicable— driver-only, read-only, no package target exists for this id.Checks
Signed-off-by../luac55 -p drivers/lua/sigenergy.lua— clean./lua55 drivers/tests/lua_harness/absent_register_probe.lua . drivers/lua/sigenergy.lua— 6 addresses down to 5, 30087 gone, the other five unchanged
make test-driver ID=sigenergy— 44 passed, 1 failed, the ratchet abovemake package-driver ID=<id> TARGET=<target>— not applicable, no packagemake check— green untilpytest, which fails on the ratchet aboveEverything else is green:
pytest drivers/tests/ -qgives 1902 passed,2072 skipped, and the single ratchet failure.
🤖 Generated with Claude Code