============================= test session starts ==============================
platform darwin -- Python 3.12.12, pytest-9.0.2, pluggy-1.6.0 -- /Users/dondoe/coding/zeroth/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/dondoe/coding/zeroth
configfile: pyproject.toml
plugins: anyio-4.12.1, langsmith-0.7.20, asyncio-1.3.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... collected 2 items

tests/service/test_tenant_isolation.py::test_cross_tenant_run_read_returns_not_found_and_audits_denial FAILED [ 50%]
tests/service/test_tenant_isolation.py::test_cross_tenant_approval_resolution_is_hidden FAILED [100%]

=================================== FAILURES ===================================
________ test_cross_tenant_run_read_returns_not_found_and_audits_denial ________

sqlite_db = <zeroth.storage.sqlite.SQLiteDatabase object at 0x1086c07d0>

    def test_cross_tenant_run_read_returns_not_found_and_audits_denial(sqlite_db) -> None:
        auth_config = _scoped_auth_config()
        service, _ = deploy_service(
            sqlite_db,
            approval_resume_graph(graph_id="graph-tenant-run-read"),
            auth_config=auth_config,
            tenant_id="tenant-a",
        )
        app = bootstrap_app(
            sqlite_db,
            deployment_ref=service.deployment.deployment_ref,
            auth_config=auth_config,
        )
        app.state.bootstrap = service
    
        with TestClient(app) as client:
            create_response = client.post(
                "/runs",
                json={"input_payload": {"value": 3}},
                headers=_headers("tenant-a-operator-key"),
            )
>           run_id = create_response.json()["run_id"]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           KeyError: 'run_id'

tests/service/test_tenant_isolation.py:71: KeyError
_______________ test_cross_tenant_approval_resolution_is_hidden ________________

sqlite_db = <zeroth.storage.sqlite.SQLiteDatabase object at 0x1088330e0>

    def test_cross_tenant_approval_resolution_is_hidden(sqlite_db) -> None:
        auth_config = _scoped_auth_config()
        service, _ = deploy_service(
            sqlite_db,
            approval_resume_graph(graph_id="graph-tenant-approval"),
            auth_config=auth_config,
            tenant_id="tenant-a",
        )
        app = bootstrap_app(
            sqlite_db,
            deployment_ref=service.deployment.deployment_ref,
            auth_config=auth_config,
        )
        app.state.bootstrap = service
    
        with TestClient(app) as client:
            create_response = client.post(
                "/runs",
                json={"input_payload": {"value": 3}},
                headers=_headers("tenant-a-operator-key"),
            )
>           run_id = create_response.json()["run_id"]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           KeyError: 'run_id'

tests/service/test_tenant_isolation.py:108: KeyError
=========================== short test summary info ============================
FAILED tests/service/test_tenant_isolation.py::test_cross_tenant_run_read_returns_not_found_and_audits_denial
FAILED tests/service/test_tenant_isolation.py::test_cross_tenant_approval_resolution_is_hidden
============================== 2 failed in 0.20s ===============================
