Consolidate onboard QSPI infrastructure build profiles

This commit is contained in:
mikecarper committed 2026-10-16 23:42:10 -07:00
1 parent d5d84d325b
commit ce53567a4c
27 files changed
+1351 -42

No files matched your search

+3 -3
View File
@@ -18,7 +18,7 @@ import tempfile
from build_esp32_partition_migration import bundle_release, verify_archive
from package_esp32_partition_migration import BOARDS, resolve_pio_build_dir
from package_cascade_release import (category, collect_artifacts, nrf52_sensor_profile,
omit_internal_solar_room_records)
omit_retired_onboard_qspi_records)
from station_g3_profiles import omit_redundant_slot_records
@@ -251,7 +251,7 @@ def select_ordinary_full_records(records: list[dict]) -> list[dict]:
This also removes stale sibling artifacts when a matrix build is resumed.
nRF52 Full/reduced sensor OTA records pass through independently, even
when their logical target ID and storage layout are the same. MeshTower
SD and SolarXiao external-QSPI primaries replace stale internal-only
SD and onboard-QSPI primaries replace retired internal-only or lean
artifacts on resume; those files must never be relabeled with a primary's
different OTA ID.
"""
@@ -291,7 +291,7 @@ def select_ordinary_full_records(records: list[dict]) -> list[dict]:
records = omit_redundant_slot_records(
[record for record in records if ordinary_record(record)])
records = omit_internal_solar_room_records(records)
records = omit_retired_onboard_qspi_records(records)
tower_primary = "heltec_tower_v2_sdcard_repeater_lora_ota_no_external_sensors"
tower_legacy = {
+15
View File
@@ -95,6 +95,21 @@ def runtime_metadata(manifest, mqtt, release_source=None):
result['loggingSource'] = manifest.get('source_commit', release_source)
if 'companion.dedicated_usb_logging' in verified:
result['dedicatedUsbLogging'] = True
linked = {check['capability'] for check in manifest.get('verification', [])
if check.get('present') is True and check.get('source') == 'linked image'
and check.get('evidence')}
merged_runtime = any(check.get('capability') == 'bridge.rs232.merged'
and check.get('present') is True
and check.get('source') == 'packaged application'
and check.get('evidence')
for check in manifest.get('verification', []))
if (manifest.get('verified') is True
and {'bridge.rs232', 'bridge.rs232.merged'} <= capabilities
and 'bridge.rs232' in linked and merged_runtime):
source = manifest.get('source_commit', release_source)
if not isinstance(source, str) or not re.fullmatch(r'[0-9a-f]{40}', source):
raise ValueError('Merged RS232 requires an exact source commit: ' + manifest['target'])
result.update(rs232Merged=True, rs232Source=source)
return result
+54 -12
View File
@@ -55,42 +55,82 @@ def nrf52_sensor_profile(manifest):
return next(iter(choices))
def omit_internal_solar_room_records(records):
"""Omit resumed internal-only Solar Room packages from ordinary releases.
def omit_retired_onboard_qspi_records(records):
"""Omit retired onboard-QSPI alternatives from ordinary releases.
Call after package qualification. Keep the original files and OTA
identities intact, and require each retired board's matching qualified
external-QSPI Full/Reduced pair before excluding its recovery packages.
"""
legacy_targets = {
"solarxiao_30s_room_server": "solarxiao_30s_room_server_lora_ota",
"solarxiao_33s_room_server": "solarxiao_33s_room_server_lora_ota",
}
room_bases = (
"solarxiao_30s_room_server", "solarxiao_33s_room_server",
"xiao_nrf52_room_server",
"ikoka_nano_nrf_22dbm_room_server", "ikoka_nano_nrf_30dbm_room_server",
"ikoka_nano_nrf_33dbm_room_server", "ikoka_stick_nrf_22dbm_room_server",
"ikoka_stick_nrf_30dbm_room_server", "ikoka_stick_nrf_33dbm_room_server",
"ikoka_handheld_nrf_e22_30dbm_room_server",
"lilygo_t-echo_room_server", "sensecap_solar_room_server",
"thinknode_m1_room_server", "thinknode_m6_room_server", "wiotrackerl1_room_server",
"lilygo_t-echo-lite_room_server",
)
legacy_targets = {}
for base in room_bases + ("lilygo_t-echo-lite_repeater",):
for legacy in (base, base + "_lora_ota_no_external_sensors"):
legacy_targets[legacy] = base + "_lora_ota"
for primary in ("lilygo_t-echo_repeater", "sensecap_solar_repeater", "thinknode_m1_repeater",
"thinknode_m6_repeater", "wiotrackerl1_repeater"):
legacy_targets[primary + "_lora_ota_no_external_sensors"] = primary
bridge_legacy = {"xiao_nrf52_repeater_bridge_rs232",
"xiao_nrf52_repeater_bridge_rs232_lora_ota_no_external_sensors"}
legacy_targets.update({legacy: "xiao_nrf52_repeater" for legacy in bridge_legacy})
targets = {record["manifest"]["target"].lower() for record in records}
for legacy, primary in legacy_targets.items():
if legacy not in targets:
continue
# collect_artifacts() has already checked the packaged OTA identity
# and layout-matched sensor pair. Do not let internal-only leftovers
# and layout-matched sensor pair. Do not let retired leftovers
# conceal a missing normal release pair for this exact hardware.
replacements = [record["manifest"] for record in records
if record["manifest"]["target"].lower() == primary]
error = (legacy + ": ordinary SolarXiao Room release requires the qualified "
error = (legacy + ": ordinary onboard-QSPI release requires the qualified "
"external-QSPI Full/Reduced pair for " + primary
+ "; internal-only artifacts cannot substitute for its distinct OTA identity")
+ "; retired artifacts cannot substitute for its distinct OTA identity")
try:
profiles = [nrf52_sensor_profile(manifest) for manifest in replacements]
except ValueError as cause:
raise ValueError(error) from cause
if (sorted(profiles) != ["full", "reduced"]
or any((manifest.get("ota_update_requirements") or {})
or any("hardware.qualification.pending" in manifest.get("capabilities", [])
or (manifest.get("ota_update_requirements") or {})
.get("lora", {}).get("storage") != "external_qspi"
for manifest in replacements)):
for manifest in replacements)
or replacements[0].get("source_commit") != replacements[1].get("source_commit")
or replacements[0].get("ota_update_requirements") !=
replacements[1].get("ota_update_requirements")):
raise ValueError(error)
if legacy in bridge_legacy:
# The ordinary QSPI repeater may retire the separate UART role
# only when both sensor profiles retain the linked driver and
# prove its runtime controls in the packaged application.
required = {"bridge.rs232": "linked image",
"bridge.rs232.merged": "packaged application"}
for manifest in replacements:
proven = {check.get("capability") for check in manifest.get("verification", [])
if check.get("present") is True
and required.get(check.get("capability")) == check.get("source")
and isinstance(check.get("evidence"), str) and check["evidence"].strip()}
if (not required.keys() <= set(manifest.get("capabilities", []))
or not required.keys() <= proven):
raise ValueError(error + "; replacement requires a verified runtime RS232 bridge")
return [record for record in records
if record["manifest"]["target"].lower() not in legacy_targets]
def omit_internal_solar_room_records(records):
"""Compatibility entry point for the shared onboard-QSPI retirement policy."""
return omit_retired_onboard_qspi_records(records)
def release_profile_label(manifest):
sensor = nrf52_sensor_profile(manifest)
if sensor:
@@ -153,6 +193,8 @@ def validate_nrf52_sensor_pairs(records):
def validate_manifest(manifest):
target = manifest["target"]
if "hardware.qualification.pending" in manifest.get("capabilities", []):
raise ValueError(f"{target}: hardware qualification pending; experimental firmware cannot be published")
if manifest.get("schema_version", 0) < 2 or not manifest.get("verified"):
raise ValueError(f"{target}: firmware capability qualification failed")
if not is_companion(target) and not manifest.get("ota_update_verified"):
@@ -414,7 +456,7 @@ def main():
raise ValueError("matrix did not use Cascade runtime defaults")
radio = {key: status["radio_" + key] for key in ("frequency", "bandwidth", "sf", "cr")}
records = collect_artifacts(args.input, version)
records = omit_internal_solar_room_records(records)
records = omit_retired_onboard_qspi_records(records)
if args.output.exists() and any(args.output.iterdir()):
raise ValueError("staging directory must be empty; existing releases are never overwritten")
base_tag = version