diff --git a/ams/roadmap.py b/ams/roadmap.py index 24bbcfc..8c594aa 100644 --- a/ams/roadmap.py +++ b/ams/roadmap.py @@ -5,11 +5,11 @@ Per scope: methods without a registration (with the signature read from the original), emulator stubs, events and properties the emulator never names. Every item lists the engine families whose DLLs have it - an item present in every family is core API, one present only -in BlooMoo is late. With `--usage` (python -m ams.usage) every item also says how many games -use it and in how many places of their scripts, gaps are ordered by that, and the report -lists the most used gaps and what the scripts use beyond the original's known API. The report -restates the tracker's limits: registration is not correctness, and "never named" means no -literal was found. +in BlooMoo is late; a scene module counts as the engine it runs in. With `--usage` +(python -m ams.usage) every item also says how many games use it and in how many places of +their scripts, gaps are ordered by that, and the report lists the most used gaps and what +the scripts use beyond the original's known API. The report restates the tracker's limits: +registration is not correctness, and "never named" means no literal was found. """ from __future__ import annotations @@ -127,7 +127,7 @@ def used_text(use) -> str: def render(tracker: dict, usage: dict | None = None) -> str: - family_of = {b["id"]: b.get("family") for b in tracker["binaries"]} + family_of = {b["id"]: b.get("host_family") or b.get("family") for b in tracker["binaries"]} # modules: their engine types = {t["name"]: t for t in tracker["types"]} used, outside, counted = usage_index(usage, types) if usage else (None, None, None) scopes = [scope_gaps(t, family_of, used) for t in tracker["types"] if t["name"] not in HIDDEN] diff --git a/ams/tracker.py b/ams/tracker.py index 9ab6f1f..51a2339 100644 --- a/ams/tracker.py +++ b/ams/tracker.py @@ -417,6 +417,9 @@ def build_tracker(snapshots: list[Snapshot], emulator: dict, reviews: list[dict] "engine": snap.binary.get("engine"), "identity": "binary" if sha else "snapshot_only", "library": snap.binary.get("library", snap.binary.get("name", "?").split("__")[-1]), "family": binary_family(snap.binary), + # A scene module runs inside the engine it imports. + "host_family": binary_family({"library": snap.binary["module_of"]}) + if snap.binary.get("module_of") else None, "sources": snap.binary.get("sources", []), "games": snap.binary.get("games", []), "coverage": snap.raw.get("coverage", snap.raw.get("extraction", {}).get("scope", snap.binary.get("extraction", {}).get("coverage"))), diff --git a/tests/test_tracker.py b/tests/test_tracker.py index 38d4ad9..fd03661 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -132,6 +132,7 @@ def test_scene_module_types_map_through_the_runner_their_objects_install(tmp_pat tick = row(result, "MATRIX", "TICK")["original"][0] assert (tick["owner"], tick["mapping"]) == ("CMC_Matrix", "module") assert typ(result, "MATRIX")["inherits"] == ["*"] + assert next(b for b in result["binaries"] if b["sha256"] == "b" * 64)["host_family"] == "Piklib 8" def test_builtin_statements_are_read_from_the_parser(tmp_path):