Skip to content

Commit 504e2fe

Browse files
committed
audit: skipped ML probes count as not passed
Greptile #60: FP/encoding skips use passed=False so all_passed stays honest; CLI shows [skip] instead of [FAIL] for skipped batteries.
1 parent f7cf25f commit 504e2fe

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎sdk/src/unplug/audit/runner.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def run_audit(
183183
checks.append(
184184
_check(
185185
"fp_probe_suite",
186-
True,
186+
False,
187187
"skipped (ML inactive; pip install unplug-ai[ml], "
188188
"set active_model=tiny, or use --require-ml)",
189189
)
@@ -203,7 +203,7 @@ def run_audit(
203203
checks.append(
204204
_check(
205205
"encoding_probe_suite",
206-
True,
206+
False,
207207
"skipped (ML inactive; use --probes --require-ml for full batteries)",
208208
)
209209
)

‎sdk/src/unplug/cli/audit.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ def main() -> None:
4545
print(json.dumps(report, indent=2))
4646
else:
4747
for row in report["checks"]:
48-
mark = "ok" if row["passed"] else "FAIL"
48+
if not row["passed"] and str(row["detail"]).startswith("skipped"):
49+
mark = "skip"
50+
else:
51+
mark = "ok" if row["passed"] else "FAIL"
4952
print(f"[{mark}] {row['name']}: {row['detail']}")
5053
print(
5154
f"\nwiring_pass={report['wiring_pass']} "

‎sdk/tests/integration/test_audit.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ def test_run_audit_with_boundary_probes() -> None:
8080
assert "encoding_probe_suite" in names
8181

8282

83+
def test_run_audit_ml_probes_skipped_mark_not_passed() -> None:
84+
"""When --probes runs without ML, skipped FP/encoding must not count as passed."""
85+
report = run_audit(workspace_root=WORKSPACE, include_probes=True)
86+
fp = next(c for c in report["checks"] if c["name"] == "fp_probe_suite")
87+
enc = next(c for c in report["checks"] if c["name"] == "encoding_probe_suite")
88+
if not fp["detail"].startswith("skipped"):
89+
pytest.skip("ML active in this environment; skipped-probe path not exercised")
90+
assert fp["passed"] is False
91+
assert enc["passed"] is False
92+
assert report["all_passed"] is False
93+
assert report["wiring_pass"] is True
94+
95+
8396
@pytest.mark.skipif(_checkpoint() is None, reason="checkpoint not available")
8497
def test_run_audit_require_ml_wires_injection() -> None:
8598
pytest.importorskip("torch")

0 commit comments

Comments
 (0)