Complete extension SDK maturity
This commit is contained in:
parent
67f2fc5346
commit
6758b3992c
19 changed files with 680 additions and 14 deletions
28
extensions/sdk-fixture/normalizers/native_probe.py
Normal file
28
extensions/sdk-fixture/normalizers/native_probe.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"""SDK fixture normalizer for native runner output."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def normalize(context: dict) -> dict:
|
||||
run_dir = Path(context["run_dir"])
|
||||
runner_result = context["runner_result"]
|
||||
artifact_ref = runner_result["facts"]["native_result_ref"]
|
||||
native_result = json.loads((run_dir / artifact_ref).read_text(encoding="utf-8"))
|
||||
native_status = native_result.get("native_status")
|
||||
result = "pass" if native_status == "ok" else "fail"
|
||||
return {
|
||||
"result": result,
|
||||
"observations": native_result.get("observations", []),
|
||||
"facts": {
|
||||
"native_status": native_status,
|
||||
"native_score": native_result.get("native_score"),
|
||||
"normalized_by": "native-probe-normalizer"
|
||||
},
|
||||
"artifact_refs": [
|
||||
artifact_ref
|
||||
],
|
||||
"requirement_refs": native_result.get("requirement_refs", []),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue