feat(lab): separate evidence catalogs and record methods
This commit is contained in:
@@ -43,6 +43,24 @@ from k1link.web.session_api import (
|
||||
)
|
||||
|
||||
|
||||
def lab_method() -> dict[str, object]:
|
||||
return {
|
||||
"schema_version": "missioncore.laboratory-method/v1",
|
||||
"completeness": "complete",
|
||||
"execution_class": "deterministic",
|
||||
"pipeline_id": "test-pipeline/v1",
|
||||
"components": [
|
||||
{
|
||||
"kind": "algorithm",
|
||||
"name": "test algorithm",
|
||||
"version": "v1",
|
||||
"role": "contract fixture",
|
||||
"identity_sha256": "9" * 64,
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def make_legacy_session(sessions_root: Path, session_id: str) -> Path:
|
||||
session = sessions_root / session_id
|
||||
capture = session / "captures" / "mqtt_live"
|
||||
@@ -281,17 +299,26 @@ def test_session_router_exposes_immutable_lab_provenance(tmp_path: Path) -> None
|
||||
source_result_id="e21-realtime-envelope-" + "b" * 64,
|
||||
config_sha256="c" * 64,
|
||||
run_created_at_utc="2026-07-23T15:55:15.548Z",
|
||||
provenance={"source_payloads_mutated": False},
|
||||
provenance={
|
||||
"source_payloads_mutated": False,
|
||||
"method": lab_method(),
|
||||
},
|
||||
)
|
||||
router = build_session_router(store)
|
||||
list_route = endpoint(router, "/api/v1/observation-sessions", "GET")
|
||||
detail_route = endpoint(router, "/api/v1/observation-sessions/{session_id}", "GET")
|
||||
|
||||
listing = list_route(limit=20, cursor=None)
|
||||
listing = list_route(limit=20, cursor=None, scope="all")
|
||||
item = next(value for value in listing["items"] if value["id"] == binding.session_id)
|
||||
source_listing = list_route(limit=20, cursor=None, scope="source")
|
||||
laboratory_listing = list_route(limit=20, cursor=None, scope="laboratory")
|
||||
detail = detail_route(session_id=binding.session_id)
|
||||
|
||||
assert item["lab"] == binding.as_dict()
|
||||
assert [value["id"] for value in source_listing["items"]] == [source.name]
|
||||
assert [value["id"] for value in laboratory_listing["items"]] == [
|
||||
binding.session_id
|
||||
]
|
||||
assert detail["lab"] == binding.as_dict()
|
||||
assert item["lab"]["source_session_id"] == source.name
|
||||
assert item["lab"]["provenance"]["source_payloads_mutated"] is False
|
||||
|
||||
Reference in New Issue
Block a user