docs(development): define isolated PR packages and remaining porting gates

This commit is contained in:
Andreas
2026-09-16 13:26:16 +02:00
parent d91820009f
commit 786f02f5c0
4 changed files with 173 additions and 2 deletions
@@ -0,0 +1,36 @@
# feat(measurement): add typed energy, quality and capacity APIs
Local branch: `feat/measurement-energy-quality-capacity`.
Review base: `feat/config-integration-base` (`d546f08`).
Eventual target: official main, after its configuration prerequisites land.
Status: tested local package, NOT yet an independent main-target PR.
## Proposed PR body
Add typed measurement channels with explicit units and timestamp semantics, sample
quality, energy integration, household energy balances and battery capacity estimates.
Adapt persistence and REST access to main's asynchronous storage. Battery estimates
use keyed device identities and remain separate from the configured active capacity;
storing an estimate requires an explicit request and preserves runtime config updates.
Expose `/v1/measurement/samples`, `/v1/measurement/energy`,
`/v1/measurement/household` and `/v1/measurement/battery-capacity/{device_id}`.
Regenerate the configuration and OpenAPI contracts. Use synthetic data only.
Validation: 453 configuration/measurement/device simulation tests and 5 documentation
tests pass. A further 74 measurement/capacity tests pass after carrying over fixture
isolation. Ruff passes for measurement source and the measurement REST module.
Local Windows/Python 3.11.9 validation; full pinned CI remains required.
Depends on the device maps/converters in #1256, runtime configuration in #1305 and
local fixes for stable device IDs, LCOS migration and charge-rate compatibility.
Includes the independently prepared JSON restore fix; it should land separately first.
No new GENETIC orchestration or battery/inverter physics is included in this branch.
## Submission gate
Do not open this whole branch against main now: its ancestry still includes the
unmerged configuration PRs. Preserve those contributors' existing PRs and credit.
Once prerequisites are merged, rebuild/rebase the measurement package onto that
main, inspect the resulting diff and rerun relevant tests before publication.
The comparison to `feat/config-integration-base` isolates today's measurement work.
@@ -0,0 +1,35 @@
# fix(measurement): restore JSON records into the existing singleton
Target: `Akkudoktor-EOS/EOS:main`.
Local branch: `fix/measurement-json-reload`.
Local head: `dba0c9c` (based on main `7ebe6d7`).
Status: locally ready for review; not pushed or published.
## Proposed PR body
When measurement persistence falls back to JSON, loading a saved file reports success
but does not restore its records: validating a second `Measurement` returns the
existing singleton. Parse and validate the individual records before inserting them
into that singleton. Invalid files now return `False` instead of reporting success.
Regression coverage checks round trips, timestamp preservation, repeated loading,
merging with existing timestamps, malformed files without partial validation writes,
and database-provider precedence. Four regression cases fail on unchanged main.
With the fix, all 49 measurement tests pass.
Validation: `python -m pytest tests/test_measurement_file_restore.py tests/test_measurement.py -q`;
Ruff check and format check of the changed source; `git diff --check`.
Run locally on Windows/Python 3.11.9. The repository's Linux/Python 3.13 pinned CI
and complete test suite have not run for this branch yet.
No settings or API schema changes. This fix is independent of #1256, #1305 and the
GENETIC port.
## Exact review scope
- `src/akkudoktoreos/measurement/measurement.py`
- `tests/test_measurement_file_restore.py`
Only these two files differ from the pinned main. Do not publish the integration
branch as part of this PR. After explicit publication approval, push this named
branch and open a PR against main; inspect CI before any merge.