fix(simulation): require gaussian runtime provenance

This commit is contained in:
DCCONSTRUCTIONS
2026-08-26 00:35:05 +03:00
parent 73fbfddf6c
commit be079bf18f
3 changed files with 60 additions and 1 deletions
+35 -1
View File
@@ -34,7 +34,12 @@ def test_gateway_uploads_with_tus_and_reads_provider_contract(tmp_path: Path) ->
json={
"schema_version": "gaussian-pipeline.capabilities/v1",
"service": "ndc-gaussian-pipeline",
"api_version": "gaussian-pipeline.api/v1",
"provider": {"id": "playcanvas-splat-transform", "version": "3.3.3"},
"runtime": {
"source_revision": "a" * 40,
"image_digest": f"sha256:{'b' * 64}",
},
},
)
if request.method == "POST" and request.url.path == "/v1/uploads":
@@ -177,7 +182,14 @@ def test_gateway_submits_tracks_and_imports_digest_bound_artifact(tmp_path: Path
if request.method == "GET" and request.url.path == f"/v1/jobs/{job_id}/result":
return httpx.Response(
200,
json={"schema_version": "gaussian-pipeline.build-result/v1", "job_id": job_id},
json={
"schema_version": "gaussian-pipeline.build-result/v1",
"job_id": job_id,
"runtime": {
"source_revision": "a" * 40,
"image_digest": f"sha256:{'b' * 64}",
},
},
)
if request.method == "GET" and request.url.path.endswith("/artifacts/preview.sog"):
return httpx.Response(200, content=artifact)
@@ -201,3 +213,25 @@ def test_gateway_submits_tracks_and_imports_digest_bound_artifact(tmp_path: Path
tmp_path / "import" / "preview.sog",
)
assert destination.read_bytes() == artifact
def test_gateway_rejects_capabilities_without_runtime_provenance(tmp_path: Path) -> None:
def handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(
200,
json={
"schema_version": "gaussian-pipeline.capabilities/v1",
"service": "ndc-gaussian-pipeline",
"api_version": "gaussian-pipeline.api/v1",
},
)
with (
GaussianPipelineGateway(
"http://gaussian.test",
_token_file(tmp_path),
transport=httpx.MockTransport(handler),
) as gateway,
pytest.raises(GaussianPipelineGatewayError, match="provenance is unavailable"),
):
gateway.capabilities()
@@ -22,7 +22,12 @@ def _gateway(tmp_path: Path, status: int = 200) -> GaussianPipelineGateway:
json={
"schema_version": "gaussian-pipeline.capabilities/v1",
"service": "ndc-gaussian-pipeline",
"api_version": "gaussian-pipeline.api/v1",
"provider": {"id": "playcanvas-splat-transform", "version": "3.3.3"},
"runtime": {
"source_revision": "a" * 40,
"image_digest": f"sha256:{'b' * 64}",
},
},
)