Skip to content

InvForge: multi-vendor inverter/BESS Modbus TCP emulator - #2

Merged
miklosbagi merged 4 commits into
mainfrom
invforge-import2
Aug 15, 2026
Merged

InvForge: multi-vendor inverter/BESS Modbus TCP emulator#2
miklosbagi merged 4 commits into
mainfrom
invforge-import2

Conversation

@miklosbagi

Copy link
Copy Markdown
Owner

Summary

  • Vendor-agnostic core engine (register/scenario/state/generator/connectivity)
  • Sigenergy SigenStor profile built from real device Modbus captures
  • Docker/docker-compose support, unit + integration test suites, CI workflow

Test plan

  • ruff format --check / ruff check / mypy all clean
  • pytest tests/unit -q -- 25 passed
  • scripts/integration-test.sh (full Docker build + integration suite) -- 14 passed

Vendor-agnostic core engine (register/scenario/state/generator/
connectivity), a Sigenergy SigenStor profile built from real device
captures, Docker/docker-compose support, and a unit+integration test
suite runnable locally or in CI.
CodeQL (security-and-quality query suite) runs on push/PR against main
plus a weekly schedule. Unit test coverage is measured via pytest-cov
and uploaded as a Cobertura report so the repo's code_coverage ruleset
rule (75% minimum, 10-point max drop) has real data to enforce.

Note: unit-only coverage is currently ~50% -- control_api.py,
connectivity.py, and __main__.py are exercised by the integration
suite instead, which runs the app in a separate Docker container that
pytest-cov can't instrument. Closing that gap is tracked as follow-up
work, not hidden.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread invforge/__main__.py Fixed
Comment thread invforge/__main__.py Fixed
Comment thread invforge/core/generator.py Fixed
Comment thread invforge/core/generator.py Fixed
Comment thread invforge/core/profile.py Fixed
Comment thread invforge/core/scenario.py Fixed
- __main__.py: parser.error() isn't statically guaranteed to exit, so
  add explicit returns rather than relying on argparse's default
  sys.exit(2) behavior (py/uninitialized-local-variable, 2 findings).
- generator.py/profile.py/scenario.py: suppress py/unsafe-cyclic-import
  with an explanation -- not a real runtime cycle, profile.py's
  reciprocal import is TYPE_CHECKING-guarded and never executes; mypy
  already resolves it fine (4 findings, all false positives).
- ci.yml: fail-on-error: false on the coverage upload step -- it 404s
  until "Code Quality" is turned on in repo Settings (no API for that
  toggle), which shouldn't hard-fail the whole unit job in the
  meantime.
Comment thread invforge/core/generator.py Fixed
Comment thread invforge/core/generator.py Fixed
Comment thread invforge/core/profile.py Fixed
Comment thread invforge/core/scenario.py Fixed
The prior TYPE_CHECKING-guarded import wasn't a real runtime cycle, but
CodeQL's py/unsafe-cyclic-import flagged it anyway, and inline codeql[]
suppression comments didn't take for this query (still 4 findings after
adding them). Simpler to actually remove the cycle: RampParams moves to
its own core/ramp_params.py with no dependency on either generator.py
or profile.py, so profile.py can import it directly instead of only
under TYPE_CHECKING.
@miklosbagi
miklosbagi merged commit 1ba4836 into main Aug 15, 2026
6 checks passed
@miklosbagi
miklosbagi deleted the invforge-import2 branch August 15, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants