From 2795a47b9ea26819e0d3c1a2e2ea4fedae524312 Mon Sep 17 00:00:00 2001 From: Zebsi Date: Thu, 27 Aug 2026 14:37:22 +0200 Subject: [PATCH 1/2] tooling: key the doc-comment baseline on POSIX paths, so the gate passes a clean tree on Windows doc_comment_lint builds its baseline lookup key with str(path.relative_to(ROOT)), which yields OS-native separators. The baseline file is written with forward slashes, so on Windows every lookup misses and, on a completely unmodified checkout, the gate exits 1 with all 25 grandfathered sites counted as new regressions - while simultaneously reporting every baselined file as "IMPROVED n -> 0", advice that points at regenerating the baseline, which the script's own comment forbids. CI runs on Linux, so it stays green there and the failure is only visible to a Windows contributor trying to follow the "run it locally" guidance. as_posix() forces forward slashes and is a no-op on POSIX hosts. Verified on Windows 11 / Python 3.11 against a clean checkout: before, exit 1 with 25 false regressions and 13 false IMPROVED lines; after, "OK no NEW detached doc comments (1819 files, 25 baselined site(s) remaining)", exit 0. The baselined count is unchanged, which is the check that the fix restores the intended lookup rather than hiding anything. --- Tools/doc_comment_lint.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tools/doc_comment_lint.py b/Tools/doc_comment_lint.py index a82755c2a6..b25c32c920 100644 --- a/Tools/doc_comment_lint.py +++ b/Tools/doc_comment_lint.py @@ -130,7 +130,11 @@ def main() -> int: scanned += 1 found = findings(path) if found: - rel = str(path.relative_to(ROOT)) + # as_posix(), not str(): the baseline is written with forward slashes, so on Windows + # str() yields "android\app\..." and every baseline lookup misses. That made the gate fail + # on a clean tree there (every grandfathered site read as a regression, and every + # baselined file as IMPROVED -> 0), so a Windows contributor could not run it locally. + rel = path.relative_to(ROOT).as_posix() by_file[rel] = [f"{rel}:{ln} {why}" for ln, why in found] regressions = [h for f, hs in sorted(by_file.items()) From b4a04f069480d5350203ed7dc227022634af932f Mon Sep 17 00:00:00 2001 From: Zebsi Date: Thu, 27 Aug 2026 14:50:19 +0200 Subject: [PATCH 2/2] test(i18n): pin the reader's-unit skin-temp label from #1671 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 240c48ae changed AppModel's illness-signal label from "Skin temperature +\(temperature) °C" to "Skin temperature \(temperature)" (the sign and unit now come from UnitFormatter.skinTempSignalPhrase in the reader's unit) and renamed the catalog key to match, but the home-i18n contract test kept both old literals. tools-python.yml is path-filtered to Tools/**, so the suite never ran on that commit and the break sat invisible until the next PR to touch Tools/ surfaced it. Both pins updated to the current contract: the assertIn literal and the catalog-key list. No behaviour change anywhere outside the test. --- Tools/test_home_i18n.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/test_home_i18n.py b/Tools/test_home_i18n.py index ce2da56f11..8c140b7ba8 100644 --- a/Tools/test_home_i18n.py +++ b/Tools/test_home_i18n.py @@ -505,7 +505,9 @@ def test_apple_home_semantic_display_contracts(self) -> None: self.assertNotIn('result.copy.contains("numbers agree")', (ROOT / "Strand/Screens/SkinTempCardsView.swift").read_text(encoding="utf-8")) self.assertIn('String(localized: "RHR +\\(delta)")', app_model) self.assertIn('String(localized: "HRV −\\(percent)%")', app_model) - self.assertIn('String(localized: "Skin temperature +\\(temperature) °C")', app_model) + # 240c48ae (#1671): the label now carries the reader's unit via UnitFormatter.skinTempSignalPhrase, + # so the sign and the hardcoded °C moved out of the localized literal. + self.assertIn('String(localized: "Skin temperature \\(temperature)")', app_model) self.assertIn('String(localized: "Respiration up")', app_model) self.assertIn("public enum Evidence", readiness) @@ -521,7 +523,7 @@ def test_apple_home_semantic_display_contracts(self) -> None: strings = audit.load_catalog(ROOT / "Strand/Resources/Localizable.xcstrings")["strings"] for key in ( - "RHR +%lld", "HRV −%lld%%", "Skin temperature +%@ °C", "Respiration up", + "RHR +%lld", "HRV −%lld%%", "Skin temperature %@", "Respiration up", "%@ vs %@ %@", "7d %@ / 28d %@", "monotony %@", ): self.assertIn(key, strings)