feat(tracker): signatures and per-type validity from method facts
Original entries carry the signature read from the method body and the per-type verdict of shared runners: a method the original skips for a type via obj.getType() is no longer attributed to it, and a trivial virtual is flagged as a no-op. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5f3006cdf0
commit
edae0929d7
@@ -86,12 +86,18 @@ def factory_snapshot():
|
||||
{"script_name": "STRING", "cpp_class": "CMC_String", "type_id": 2},
|
||||
{"script_name": "VECTOR", "cpp_class": None, "type_id": 0x7e0}],
|
||||
"methods": [{"owner": "CMC_Variable", "runner": "CMC_Variable_Runner", "name": "ADD", "id": 6},
|
||||
{"owner": "CMC_Variable", "runner": "CMC_Variable_Runner", "name": "UPPER", "id": 30},
|
||||
{"owner": "CMC_Vector", "runner": "CMC_Vector_Runner", "name": "NORMALIZE", "id": 8},
|
||||
{"owner": "CMC_Dummy", "runner": "CMC_Dummy_Runner", "name": "IF", "id": 1},
|
||||
{"owner": "CMC_Dummy", "runner": "CMC_Dummy_Runner", "name": "MSGBOX", "id": 6},
|
||||
{"owner": "CMC", "runner": "CMC_Runner", "name": "CLONE", "id": 100}],
|
||||
"method_inheritance": [{"runner": "CMC_Variable_Runner", "base_runner": "CMC_Runner"},
|
||||
{"runner": "CMC_Vector_Runner", "base_runner": "CMC_Runner"}],
|
||||
"method_dispatch": [
|
||||
{"owner": "CMC_Variable", "runner": "CMC_Variable_Runner", "id": 6, "params": [{"index": 0, "types": ["int"]}],
|
||||
"variadic": False, "returns": ["copy"], "per_type": {"INTEGER": "trivial_virtual", "STRING": "applies"}},
|
||||
{"owner": "CMC_Variable", "runner": "CMC_Variable_Runner", "id": 30, "params": [], "variadic": False,
|
||||
"returns": [], "per_type": {"INTEGER": "excluded_by_type_check", "STRING": "applies"}}],
|
||||
"runner_map": {"by_type_id": [{"type_id": 0, "runner": "CMC_Dummy_Runner"},
|
||||
{"type_id": 1, "runner": "CMC_Variable_Runner"},
|
||||
{"type_id": 2, "runner": "CMC_Variable_Runner"},
|
||||
@@ -243,3 +249,16 @@ def test_api_configuration_and_download(tmp_path, monkeypatch):
|
||||
assert "attachment" in response.headers["content-disposition"]
|
||||
assert response.json()["schema"] == "tracker/1"
|
||||
assert client.get("/ui/tracker.html").status_code == 200
|
||||
|
||||
|
||||
def test_shared_runner_methods_follow_per_type_verdicts(tmp_path):
|
||||
emu = emulator(tmp_path)
|
||||
emu["types"]["INTEGER"] = {"mapping_notes": [], "methods": {
|
||||
"UPPER": {"status": "registered", "notes": [], "source": {"owner": "INTEGER"}}}}
|
||||
result = build_tracker([factory_snapshot()], emu)
|
||||
assert row(result, "STRING", "UPPER")["original"]
|
||||
upper = row(result, "INTEGER", "UPPER") # registered by the emulator, skipped by the original
|
||||
assert upper["original"] == [] and any("obj.getType()" in n for n in upper["notes"])
|
||||
assert row(result, "STRING", "ADD")["signatures"] == ["(int) → copy"]
|
||||
assert any("bez efektu" in n for n in row(result, "INTEGER", "ADD")["notes"])
|
||||
assert row(result, "INTEGER", "ADD")["original"][0]["per_type"] == "trivial_virtual"
|
||||
|
||||
Reference in New Issue
Block a user