generated from coulomb/repo-seed
Implement credentialed drill packaging workplan
This commit is contained in:
@@ -4,7 +4,7 @@ from pathlib import Path
|
||||
|
||||
from phase_memory.adapters import InMemorySemanticIndex
|
||||
from phase_memory.contracts import graph_from_markitect
|
||||
from phase_memory.evaluation import EVALUATION_REPORT_SCHEMA, evaluation_threshold_report
|
||||
from phase_memory.evaluation import EVALUATION_REPORT_SCHEMA, EVALUATION_TREND_SCHEMA, evaluation_threshold_report, evaluation_trend_artifact
|
||||
from phase_memory.models import ActivationPlan, MemoryPath
|
||||
from phase_memory.retrieval import activation_quality_report, select_event_path
|
||||
from phase_memory.runtime import PhaseMemoryRuntime
|
||||
@@ -102,6 +102,30 @@ def test_evaluation_threshold_report_summarizes_all_scenarios() -> None:
|
||||
assert report["diagnostics"] == []
|
||||
|
||||
|
||||
def test_evaluation_trend_artifact_tracks_threshold_and_metric_deltas() -> None:
|
||||
data = json.loads((FIXTURES / "evaluation-scenarios.json").read_text(encoding="utf-8"))
|
||||
report = evaluation_threshold_report(data)
|
||||
previous = {
|
||||
"id": "previous",
|
||||
"metrics": {
|
||||
**report["metrics"],
|
||||
"policy_denial_count": report["metrics"]["policy_denial_count"] + 1,
|
||||
},
|
||||
}
|
||||
|
||||
trend = evaluation_trend_artifact(
|
||||
report,
|
||||
previous_report=previous,
|
||||
run_metadata={"run_id": "pytest", "created_at": "2026-05-19T00:00:00+00:00"},
|
||||
)
|
||||
|
||||
assert trend["schema_version"] == EVALUATION_TREND_SCHEMA
|
||||
assert trend["run"]["run_id"] == "pytest"
|
||||
assert trend["threshold_deltas"]["policy_denial_count"] == 0.0
|
||||
assert trend["metric_deltas"]["policy_denial_count"] == -1.0
|
||||
assert trend["diagnostics"][0]["code"] == "evaluation_metric_regressed"
|
||||
|
||||
|
||||
def _activation_plan(response):
|
||||
data = response["data"]["activation_plan"]
|
||||
return ActivationPlan(
|
||||
|
||||
Reference in New Issue
Block a user