diff --git a/scripts/generate_site.py b/scripts/generate_site.py index e148155f..c10d6196 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -1227,7 +1227,11 @@ def _page_description(markdown: str, relative: Path, title: str) -> str: if key.startswith("platforms/") and relative.stem != "index": return f"{title}: declared BIOS contract, verification mode, coverage, destinations and emulator complement." if key.startswith("emulators/") and relative.stem != "index": - return f"{title}: source-pinned emulator firmware profile with paths, hashes, requirements and validation behavior." + # Pinned only when the profile names the revision it was read at: + # 48 pages without one called themselves source-pinned. + pinned = PAGE_DATA.get(key, {}).get("about", {}).get("version") + kind = "source-pinned emulator firmware profile" if pinned else "emulator firmware profile" + return f"{title}: {kind} with paths, hashes, requirements and validation behavior." if key.startswith("systems/") and relative.stem != "index": return f"{title}: indexed firmware files, hashes, variants, provenance and platform or emulator usage." diff --git a/tests/test_site_exports.py b/tests/test_site_exports.py index c9550f79..da1d2d30 100644 --- a/tests/test_site_exports.py +++ b/tests/test_site_exports.py @@ -565,5 +565,24 @@ class EmulatorPartsCarryTheirIdentity(unittest.TestCase): ) +class OnlyAPinnedProfileClaimsAPin(unittest.TestCase): + """Redream, with no revision at all, was described as source-pinned.""" + + def test_the_description_follows_the_pin(self): + from unittest import mock # noqa: PLC0415 + + import generate_site # noqa: PLC0415 + + pages = { + "emulators/pinned.md": {"about": {"version": "a" * 40}}, + "emulators/redream.md": {}, + } + with mock.patch.dict(generate_site.PAGE_DATA, pages, clear=True): + pinned = generate_site._page_description("", Path("emulators/pinned.md"), "P") + loose = generate_site._page_description("", Path("emulators/redream.md"), "R") + self.assertIn("source-pinned", pinned) + self.assertNotIn("source-pinned", loose) + + if __name__ == "__main__": unittest.main()