← Back to documentation
Snapshot of projects/edgestream-gw/SBOM.md — 28 Nov 2026

Software Bill of Materials — EdgeStream-GW (Milestone 1)

_Date: 2026-10-28 · Scope: all Python source & test files under projects/edgestream-gw/ · State: Milestone 1 (KPI −75 % proven)_

1. Runtime & toolchain

ItemValue
LanguagePython (requires ≥ 3.10; verified on 3.14.4)
Runtime dependencypydantic (≥ 2.10; verified 2.13.5)
Dev dependenciespytest (≥ 7), hypothesis (≥ 6), pytest-cov, ruff (line-length 100)
Packageedgestream-protocol-adapters v0.1.0

2. Source files (build vs reuse)

Legend: BUILD = in-house (TDD, Fail-Fast) · REUSE = standard library / 3rd party.

2.1 src/protocol-adapters/ — Protocol Adapters (BUILD)

FileContains
protocol_adapters/frame.pyStrict Pydantic v2 models: Frame, Source, Measurement (extra="forbid", bounded unit_id, non-empty measurements).
protocol_adapters/errors.pyCorruptedPayloadError(reason_code, detail, offending_field) — the Fail-Fast exception.
protocol_adapters/base.pyRawPayload frozen dataclass (input contract) + ProtocolAdapter ABC (parse()).
protocol_adapters/modbus_common.pyRegisterDefinition + decode_holding_registers() (shared FC03 decode + bounds checks).
protocol_adapters/modbus_rtu.pycrc16() + ModbusRtuAdapter (RTU ADU parsing, Fail-Fast).
protocol_adapters/modbus_tcp.pyModbusTcpAdapter (MBAP/TCP ADU parsing, Fail-Fast).
protocol_adapters/__init__.pyPublic API re-exports (Frame, Measurement, adapters, crc16, RegisterDefinition, …).
conftest.pyPytest bootstrap: makes the package importable.

2.2 src/edge-analytics/ps/ — Edge Analytics PS (BUILD)

FileContains
edge_analytics_ps/stats.pyAggregate dataclass + compute_stats() (mean/rms/min/max/last/count).
edge_analytics_ps/aggregate.pyaggregate_window() (N frames → 1) + dedupe() (consecutive dedup).
edge_analytics_ps/window.pyWindowAggregator (time-window buffering, deterministic on collected_at).
edge_analytics_ps/__init__.pyPublic API re-exports.
conftest.pyPytest bootstrap: makes edge_analytics_ps + protocol_adapters importable.

2.3 testbench/ — Virtual test bench (BUILD)

FileContains
meter_simulator/meters.pySTANDARD_REGISTER_MAP (4 registers), EnergyMeter, MeterFleet (deterministic 50-meter simulator).
meter_simulator/frame_builders.pybuild_rtu_response() / build_tcp_response() (raw Modbus ADU builders).
meter_simulator/__init__.pyPublic API re-exports.
conftest.pyPytest bootstrap: makes meter_simulator + protocol_adapters importable.

2.4 performance/ — Measurement (BUILD)

FileContains
measure_volume_reduction.pyMeasures the −75 % KPI (simulator → adapter → WindowAggregator → JSON byte counts), writes volume_reduction_results.json.

2.5 reports/ — Documentation tooling (BUILD)

FileContains
make_report.pypython-docx generator for the Word technical report.

3. Test files

3.1 src/protocol-adapters/tests/ — 38 tests

FileCovers
test_frame_schema.pyPhase 0 — strict schema (required fields, types, extra, empty list, unit_id bounds).
test_modbus_rtu.pyPhases 1–2 — RTU happy path + all 7 reason_code negatives.
test_modbus_tcp.pyTCP happy path + MBAP/negatives.
test_properties.pyPhase 3 — hypothesis invariants (arbitrary bytes never crash; roundtrip).
test_contract.pyPhase 4 — mocked south-driver → adapter → ingestion-core boundary.

3.2 src/edge-analytics/ps/tests/ — 19 tests

FileCovers
test_stats.pycompute_stats (empty, single, multiple, grouping).
test_aggregate.pyaggregate_window (empty, bad reducer, mixed sources, N→1, rms/min/max, mean, timestamp).
test_dedupe.pydedupe (consecutive, non-consecutive, empty, identical).
test_window.pyWindowAggregator (flush on crossing, no flush within, empty flush).

3.3 testbench/tests/ — 9 tests

FileCovers
test_meter_fleet.pyFleet properties (50, unique ids, determinism, bounds).
test_southbound_chain.pyE2E chain simulator → adapter → Frame (RTU/TCP + 5 000-frame volume).

4. Verification summary (as of 2026-10-28)

SuiteTestsCoverage
protocol-adapters38 passed99 % (154 stmts, 2 defensive lines missed)
edge-analytics/ps19 passed100 % (90 stmts)
testbench9 passed— (integration)
Total66 passed

KPI (Milestone 1): 96.07 % northbound volume reduction (target ≥ 75 %).

Source: raw markdown — published as-is from the source repository.