33
44from __future__ import annotations
55
6+ import json
67import unittest
78from pathlib import Path
89
@@ -41,23 +42,37 @@ def setUpClass(cls) -> None:
4142 / "support"
4243 / "page.tsx"
4344 ).read_text (encoding = "utf-8" )
45+ cls .browser_validation = json .loads (
46+ (
47+ REPO_ROOT
48+ / "docs"
49+ / "validation"
50+ / "browser-flashing"
51+ / "v0.4.2-production.json"
52+ ).read_text (encoding = "utf-8" )
53+ )
4454
45- def test_readme_identifies_the_exact_unqualified_public_beta (self ) -> None :
55+ def test_readme_identifies_the_exact_hardware_tested_public_beta (self ) -> None :
4656 firmware = markdown_section (self .readme , "What works" )
4757
4858 self .assertIn (
49- "public browser installer currently offers the exact v0.4.2 unqualified beta" ,
59+ "public browser installer currently offers the exact v0.4.2 hardware-tested beta" ,
5060 firmware ,
5161 )
52- self .assertIn ("full project HIL is pending" , firmware )
62+ self .assertIn ("Production Chrome erase/install" , firmware )
63+ self .assertIn ("interrupted-flash recovery passed" , firmware )
64+ self .assertIn ("Complete release qualification continues" , firmware )
5365 self .assertIn ("`esp32-4mb`" , firmware )
5466 self .assertIn ("Classic ESP32, 4 MiB external SPI flash" , firmware )
5567 self .assertIn ("`esp32-s3-n16r8`" , firmware )
5668 self .assertIn ("16 MiB flash / 8 MiB Octal PSRAM" , firmware )
57- self .assertIn ("Unqualified v0.4.2 beta; HIL pending" , firmware )
69+ self .assertIn (
70+ "v0.4.2 hardware-tested beta; browser install/recovery passed" ,
71+ firmware ,
72+ )
5873 self .assertIn ("Planned; unavailable" , firmware )
5974 self .assertNotIn ("currently offers qualified images" , firmware )
60- self .assertNotIn ("v0.4.2 HIL pending; installer unavailable " , firmware )
75+ self .assertNotIn ("full HIL pending" , firmware )
6176
6277 def test_readme_caption_describes_only_the_visible_app (self ) -> None :
6378 caption_start = self .readme .index ("<em>Actual PyBLE app" )
@@ -69,12 +84,14 @@ def test_readme_caption_describes_only_the_visible_app(self) -> None:
6984 self .assertIn ("generated MicroPython" , caption )
7085 self .assertNotRegex (caption , r"(?i)pictured|board|module" )
7186
72- def test_readme_try_steps_use_the_active_beta_safely (self ) -> None :
87+ def test_readme_try_steps_use_the_hardware_tested_beta_safely (self ) -> None :
7388 try_section = markdown_section (self .readme , "Try PyBLE" )
7489
75- self .assertIn ("v0.4.2 unqualified beta" , try_section )
76- self .assertIn ("full HIL is pending" , try_section )
77- self .assertIn ("use it at your own risk" , try_section )
90+ self .assertIn ("v0.4.2 hardware-tested beta" , try_section )
91+ self .assertIn ("Browser installation and interrupted-flash recovery passed" , try_section )
92+ self .assertIn ("complete release qualification continues" , try_section )
93+ self .assertNotIn ("full HIL pending" , try_section )
94+ self .assertNotIn ("use it at your own risk" , try_section )
7895 self .assertIn ("exact profile" , try_section )
7996 self .assertIn ("back up" , try_section )
8097 self .assertIn ("enabled install action" , try_section )
@@ -88,13 +105,17 @@ def test_current_public_surfaces_agree_on_beta_and_c3_state(self) -> None:
88105
89106 for wording in (
90107 "v0.4.2" ,
91- "unqualified beta" ,
92- "HIL pending" ,
108+ "hardware-tested beta" ,
109+ "browser install/recovery passed" ,
110+ "release qualification pending" ,
93111 "esp32-4mb" ,
94112 "esp32-s3-n16r8" ,
95113 ):
96114 self .assertIn (wording , combined )
97- self .assertIn ("use it at your own risk" , combined .lower ())
115+ self .assertIn ("Production Chrome install" , combined )
116+ self .assertIn ("interrupted-flash recovery passed" , combined )
117+ self .assertNotIn ("full HIL pending" , combined )
118+ self .assertNotIn ("use it at your own risk" , combined .lower ())
98119 self .assertIn ("ESP32-C3" , combined )
99120 self .assertRegex (combined , r"(?is)ESP32-C3.{0,180}unavailable" )
100121 for stale in (
@@ -107,10 +128,37 @@ def test_current_public_surfaces_agree_on_beta_and_c3_state(self) -> None:
107128
108129 near_term = markdown_section (self .roadmap , "Near term" )
109130 self .assertIn (
110- "Complete full HIL qualification for the exact `esp32-4mb` and " ,
131+ "Complete the app, PBLE/1, resource, and remaining firmware release " ,
111132 near_term ,
112133 )
113134
135+ def test_production_browser_claim_is_bound_to_public_evidence (self ) -> None :
136+ evidence = self .browser_validation
137+
138+ self .assertEqual (evidence ["result" ], "passed" )
139+ self .assertEqual (evidence ["release" ]["version" ], "0.4.2" )
140+ self .assertEqual (
141+ evidence ["release" ]["release_json_sha256" ],
142+ "5d1b0db8c4b90cccf054cd244530afb3b9112d489aa02f7c5da650e92161acde" ,
143+ )
144+ self .assertEqual (
145+ [profile ["profile_id" ] for profile in evidence ["profiles" ]],
146+ ["esp32-4mb" , "esp32-s3-n16r8" ],
147+ )
148+ for profile in evidence ["profiles" ]:
149+ self .assertGreater (profile ["interruption_percentage" ], 5 )
150+ self .assertLess (profile ["interruption_percentage" ], 100 )
151+ self .assertEqual (profile ["recovery_write_percentage" ], 100 )
152+ self .assertTrue (profile ["full_erase" ])
153+ self .assertTrue (profile ["hard_reset" ])
154+ self .assertTrue (profile ["visible_completion" ])
155+ self .assertTrue (profile ["serial_route_released" ])
156+ self .assertEqual (profile ["interruption_fetch_rounds" ]["firmware" ], 2 )
157+ self .assertEqual (profile ["recovery_fetch_rounds" ]["firmware" ], 2 )
158+ self .assertTrue (
159+ any ("not the formal" in limitation for limitation in evidence ["limitations" ])
160+ )
161+
114162 def test_bug_template_collects_the_exact_installer_diagnostics (self ) -> None :
115163 for field_id in (
116164 "profile" ,
0 commit comments