Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

ci: judge a covered row's partial_evidence case in the scenario evidence gate (#2776)

Call White8e59a2716e9a
diff --git a/scripts/ci_scenario_evidence.py b/scripts/ci_scenario_evidence.py
index ec91aa19d..c209c39b7 100644
--- a/scripts/ci_scenario_evidence.py
+++ b/scripts/ci_scenario_evidence.py
@@ -65,7 +65,11 @@ class Evidence:
def covered_evidence(scenario_root: Path = SCENARIO_ROOT) -> dict[str, Evidence]:
- """Every pytest case a ``covered`` row cites under ``test``, by citation."""
+ """Every pytest case a ``covered`` row cites as evidence, by citation.
+
+ Its evidence keys are those the citation check reads as evidence: each case
+ under ``test``, and the one ``partial_evidence.test`` names.
+ """
evidence: dict[str, Evidence] = {}
for catalog in sorted(scenario_root.glob("*/catalog.yaml")):
@@ -73,7 +77,11 @@ def covered_evidence(scenario_root: Path = SCENARIO_ROOT) -> dict[str, Evidence]
if row.get("status") != "covered":
continue
cited = row.get("test")
- for citation in cited if isinstance(cited, list) else [cited]:
+ cited = list(cited) if isinstance(cited, list) else [cited]
+ partial = row.get("partial_evidence")
+ if isinstance(partial, dict):
+ cited.append(partial.get("test"))
+ for citation in cited:
if isinstance(citation, str) and citation.partition("::")[0].endswith(".py") and "::" in citation:
evidence.setdefault(citation, Evidence(citation, [])).rows.append(row["id"])
return evidence
diff --git a/tests/test_ci_scenario_evidence.py b/tests/test_ci_scenario_evidence.py
index 03f087d68..81152e9a8 100644
--- a/tests/test_ci_scenario_evidence.py
+++ b/tests/test_ci_scenario_evidence.py
@@ -5,6 +5,7 @@ from __future__ import annotations
from pathlib import Path
import pytest
+import yaml
from scripts import pytest_collection
from scripts.ci_scenario_evidence import (
@@ -129,3 +130,30 @@ def test_release_gating_is_read_from_the_release_workflows() -> None:
assert evidence["tests/e2e/test_model_hub_mock_upstream.py::test_mh_routing_001_mock_model_errors_are_request_scoped_and_inventory_independent"].rows == ["MH-ROUTING-001"]
assert "tests/e2e/test_model_hub_mock_upstream.py::test_mh_routing_001_mock_model_errors_are_request_scoped_and_inventory_independent" in gated
assert "tests/e2e/test_retired_updater_bridge.py::test_released_updater_replaces_companion_without_touching_user_data" in gated
+
+
+def test_a_covered_rows_partial_evidence_case_is_evidence_too(tmp_path: Path) -> None:
+ """#2775: the case ``partial_evidence.test`` names must run as its row's ``test`` cases must."""
+
+ (tmp_path / "capability").mkdir()
+ (tmp_path / "capability" / "catalog.yaml").write_text(
+ yaml.safe_dump(
+ {
+ "scenarios": [
+ {
+ "id": "ROW-1",
+ "status": "covered",
+ "test": "tests/test_x.py::test_main",
+ "partial_evidence": {"test": "tests/test_x.py::test_more", "covers": "the second half"},
+ },
+ {"id": "ROW-2", "status": "partial", "test": "tests/test_x.py::test_not_covered"},
+ ]
+ }
+ ),
+ encoding="utf-8",
+ )
+
+ evidence = covered_evidence(tmp_path)
+
+ assert sorted(evidence) == ["tests/test_x.py::test_main", "tests/test_x.py::test_more"]
+ assert evidence["tests/test_x.py::test_more"].rows == ["ROW-1"]