fix: 增加插件 V3t 运行时兼容门禁 (#6475)

* fix(plugin): enforce declared runtime compatibility

* chore(ci): record plugin runtime compatibility edges

---------

Co-authored-by: jxxghp <jxxghp@gmail.com>
This commit is contained in:
InfinityPacer
2026-08-27 07:06:16 +08:00
committed by GitHub
co-authored by jxxghp
parent 627775c090
commit 3b7f8c357d
8 changed files with 119 additions and 5 deletions
+21
View File
@@ -82,6 +82,27 @@ def test_only_v3_compatible_entries_are_candidates() -> None:
assert not inventory.candidates_for("Undeclared")
def test_free_threaded_runtime_excludes_explicit_v3t_false(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""V3t 只拒绝明确声明不支持的插件,未声明仍保持兼容。"""
monkeypatch.setattr(
"app.application.plugin.inventory.is_free_threaded_runtime",
lambda: True,
)
inventory = PluginCandidateInventoryReader(
market_loader=lambda *_args: {
"Allowed": {"version": "1.0.0"},
"Rejected": {"version": "1.0.0", "v3t": False},
},
).load([THIRD_PARTY_MARKET])
assert {candidate.plugin_id for candidate in inventory.online_candidates} == {
"Allowed"
}
def test_official_source_is_classified_and_public_candidate_uses_plugin_version() -> None:
"""官方仓库使用官方来源类型,候选公共字段与 Plugin schema 对齐。"""
reader = PluginCandidateInventoryReader(