$ docker compose -p adk-memshield run --rm test pytest -v   # PostgreSQL 16
============================= test session starts ==============================
platform linux -- Python 3.12.15, pytest-9.2.0, pluggy-1.7.0 -- /usr/local/bin/python3.12
rootdir: /app
configfile: pyproject.toml
testpaths: tests
plugins: asyncio-1.5.0, anyio-4.16.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collecting ... collected 123 items

tests/test_compartments.py::test_compartment_read_rules[False] PASSED    [  0%]
tests/test_compartments.py::test_compartment_read_rules[True] PASSED     [  1%]
tests/test_compartments.py::test_own_rows_are_visible_whatever_their_compartments PASSED [  2%]
tests/test_compartments.py::test_write_across_is_rejected PASSED         [  3%]
tests/test_compartments.py::test_compartment_names_are_validated PASSED  [  4%]
tests/test_compartments.py::test_bad_compartment_in_metadata_is_rejected PASSED [  4%]
tests/test_compartments.py::test_migration_from_0_1_1 PASSED             [  5%]
tests/test_compartments.py::test_low_clearance_agent_cannot_declassify_owner_row PASSED [  6%]
tests/test_conformance.py::test_cross_tenant[adk] PASSED                 [  7%]
tests/test_conformance.py::test_cross_tenant[adk-no-where] PASSED        [  8%]
tests/test_conformance.py::test_cross_tenant[core] PASSED                [  8%]
tests/test_conformance.py::test_cross_tenant[core-no-where] PASSED       [  9%]
tests/test_conformance.py::test_cross_tenant[mcp] PASSED                 [ 10%]
tests/test_conformance.py::test_cross_tenant[mcp-no-where] PASSED        [ 11%]
tests/test_conformance.py::test_cross_user[adk] PASSED                   [ 12%]
tests/test_conformance.py::test_cross_user[adk-no-where] PASSED          [ 13%]
tests/test_conformance.py::test_cross_user[core] PASSED                  [ 13%]
tests/test_conformance.py::test_cross_user[core-no-where] PASSED         [ 14%]
tests/test_conformance.py::test_cross_user[mcp] PASSED                   [ 15%]
tests/test_conformance.py::test_cross_user[mcp-no-where] PASSED          [ 16%]
tests/test_conformance.py::test_clearance[adk] PASSED                    [ 17%]
tests/test_conformance.py::test_clearance[adk-no-where] PASSED           [ 17%]
tests/test_conformance.py::test_clearance[core] PASSED                   [ 18%]
tests/test_conformance.py::test_clearance[core-no-where] PASSED          [ 19%]
tests/test_conformance.py::test_clearance[mcp] PASSED                    [ 20%]
tests/test_conformance.py::test_clearance[mcp-no-where] PASSED           [ 21%]
tests/test_conformance.py::test_compartments[adk] PASSED                 [ 21%]
tests/test_conformance.py::test_compartments[adk-no-where] PASSED        [ 22%]
tests/test_conformance.py::test_compartments[core] PASSED                [ 23%]
tests/test_conformance.py::test_compartments[core-no-where] PASSED       [ 24%]
tests/test_conformance.py::test_compartments[mcp] PASSED                 [ 25%]
tests/test_conformance.py::test_compartments[mcp-no-where] PASSED        [ 26%]
tests/test_conformance.py::test_no_write_up_or_across[adk] PASSED        [ 26%]
tests/test_conformance.py::test_no_write_up_or_across[adk-no-where] PASSED [ 27%]
tests/test_conformance.py::test_no_write_up_or_across[core] PASSED       [ 28%]
tests/test_conformance.py::test_no_write_up_or_across[core-no-where] PASSED [ 29%]
tests/test_conformance.py::test_no_write_up_or_across[mcp] PASSED        [ 30%]
tests/test_conformance.py::test_no_write_up_or_across[mcp-no-where] PASSED [ 30%]
tests/test_conformance.py::test_fail_closed_on_the_shared_connection[adk] PASSED [ 31%]
tests/test_conformance.py::test_fail_closed_on_the_shared_connection[adk-no-where] PASSED [ 32%]
tests/test_conformance.py::test_fail_closed_on_the_shared_connection[core] PASSED [ 33%]
tests/test_conformance.py::test_fail_closed_on_the_shared_connection[core-no-where] PASSED [ 34%]
tests/test_conformance.py::test_fail_closed_on_the_shared_connection[mcp] PASSED [ 34%]
tests/test_conformance.py::test_fail_closed_on_the_shared_connection[mcp-no-where] PASSED [ 35%]
tests/test_identity.py::test_valid_token_yields_identity_from_claims PASSED [ 36%]
tests/test_identity.py::test_invalid_tokens_are_refused[<lambda>-expired] PASSED [ 37%]
tests/test_identity.py::test_invalid_tokens_are_refused[<lambda>-another application] PASSED [ 38%]
tests/test_identity.py::test_invalid_tokens_are_refused[<lambda>-unknown key] PASSED [ 39%]
tests/test_identity.py::test_invalid_tokens_are_refused[<lambda>-signature] PASSED [ 39%]
tests/test_identity.py::test_invalid_tokens_are_refused[<lambda>-malformed0] PASSED [ 40%]
tests/test_identity.py::test_invalid_tokens_are_refused[<lambda>-malformed1] PASSED [ 41%]
tests/test_identity.py::test_invalid_tokens_are_refused[<lambda>-malformed2] PASSED [ 42%]
tests/test_identity.py::test_tampered_payload_is_refused PASSED          [ 43%]
tests/test_identity.py::test_key_rotation PASSED                         [ 43%]
tests/test_identity.py::test_short_keys_and_bad_claims_are_rejected PASSED [ 44%]
tests/test_identity.py::test_bind_identity_is_scoped PASSED              [ 45%]
tests/test_identity.py::test_operations_refused_without_token PASSED     [ 46%]
tests/test_identity.py::test_identity_comes_from_the_token PASSED        [ 47%]
tests/test_identity.py::test_spoofed_user_id_under_valid_token PASSED    [ 47%]
tests/test_identity.py::test_token_for_other_app_is_refused PASSED       [ 48%]
tests/test_identity.py::test_concurrent_requests_with_different_tokens PASSED [ 49%]
tests/test_identity.py::test_verifier_exception_is_wrapped_without_token PASSED [ 50%]
tests/test_identity.py::test_adk_runner_with_bound_identity PASSED       [ 51%]
tests/test_identity.py::test_non_finite_or_invalid_expiry_is_refused[nan] PASSED [ 52%]
tests/test_identity.py::test_non_finite_or_invalid_expiry_is_refused[inf] PASSED [ 52%]
tests/test_identity.py::test_non_finite_or_invalid_expiry_is_refused[never] PASSED [ 53%]
tests/test_identity.py::test_non_finite_or_invalid_expiry_is_refused[True] PASSED [ 54%]
tests/test_identity.py::test_overlong_lifetime_is_refused PASSED         [ 55%]
tests/test_identity.py::test_rls_transaction_always_resolves_identity PASSED [ 56%]
tests/test_identity_jwt.py::test_jwt_verifier PASSED                     [ 56%]
tests/test_identity_jwt.py::test_jwt_issuer_is_required PASSED           [ 57%]
tests/test_mcp_adapter.py::test_stdio_trusted_mode_roundtrip PASSED      [ 58%]
tests/test_mcp_adapter.py::test_trusted_mode_needs_a_user PASSED         [ 59%]
tests/test_mcp_adapter.py::test_stdio_verified_mode_reads_token_from_env PASSED [ 60%]
tests/test_mcp_adapter.py::test_http_transport_needs_a_verifier PASSED   [ 60%]
tests/test_mcp_adapter.py::test_http_transport_never_falls_back_to_env_or_trusted PASSED [ 61%]
tests/test_mcp_adapter.py::test_stdio_transport_ignores_headers PASSED   [ 62%]
tests/test_mcp_adapter.py::test_cli_refuses_http_without_keys PASSED     [ 63%]
tests/test_mcp_adapter.py::test_streamable_http_end_to_end PASSED        [ 64%]
tests/test_plan_cache.py::test_plan_cache_mode_is_bound_per_transaction PASSED [ 65%]
tests/test_plan_cache.py::test_prepared_statements_never_use_a_generic_plan PASSED [ 65%]
tests/test_plan_cache.py::test_prepared_statements_negative_control PASSED [ 66%]
tests/test_plan_cache.py::test_override_reproduces_0_1_behaviour PASSED  [ 67%]
tests/test_plan_cache.py::test_prepared_hnsw_recall_with_negative_control SKIPPED [ 68%]
tests/test_pool_hygiene.py::test_rollback_leaves_no_context PASSED       [ 69%]
tests/test_pool_hygiene.py::test_statement_timeout_then_other_tenant PASSED [ 69%]
tests/test_pool_hygiene.py::test_server_killed_connection_is_replaced PASSED [ 70%]
tests/test_pool_hygiene.py::test_session_scoped_context_is_reset_on_checkin PASSED [ 71%]
tests/test_pool_hygiene.py::test_session_scoped_context_negative_control PASSED [ 72%]
tests/test_pool_hygiene.py::test_concurrent_tenants_on_a_shared_pool PASSED [ 73%]
tests/test_pool_hygiene.py::test_temp_table_cannot_shadow_memories[True] PASSED [ 73%]
tests/test_pool_hygiene.py::test_temp_table_cannot_shadow_memories[False] PASSED [ 74%]
tests/test_pool_hygiene.py::test_set_role_is_reset_on_checkin PASSED     [ 75%]
tests/test_pool_hygiene.py::test_startup_options_survive_the_checkin_reset PASSED [ 76%]
tests/test_posture.py::test_superuser_connection_is_refused PASSED       [ 77%]
tests/test_posture.py::test_app_role_passes PASSED                       [ 78%]
tests/test_posture.py::test_unprotected_table_is_refused PASSED          [ 78%]
tests/test_posture.py::test_allow_insecure_role_warns_on_every_check PASSED [ 79%]
tests/test_posture.py::test_table_without_force_is_refused PASSED        [ 80%]
tests/test_posture.py::test_missing_policy_is_refused PASSED             [ 81%]
tests/test_posture.py::test_widening_permissive_policy_is_refused PASSED [ 82%]
tests/test_posture.py::test_posture_checked_once_per_pool PASSED         [ 82%]
tests/test_posture.py::test_construction_does_no_io PASSED               [ 83%]
tests/test_posture.py::test_owning_role_is_refused PASSED                [ 84%]
tests/test_posture.py::test_widening_policy_granted_to_a_group_role_is_refused PASSED [ 85%]
tests/test_posture.py::test_update_policy_checking_tenant_only_in_with_check_is_refused PASSED [ 86%]
tests/test_pre_write.py::test_hook_sees_identity_and_labels PASSED       [ 86%]
tests/test_pre_write.py::test_block_skips_only_that_memory PASSED        [ 87%]
tests/test_pre_write.py::test_downlabel_tightens PASSED                  [ 88%]
tests/test_pre_write.py::test_widening_raises[labels0-decision0-private to tenant_shared] PASSED [ 89%]
tests/test_pre_write.py::test_widening_raises[labels1-decision1-lower min_clearance] PASSED [ 90%]
tests/test_pre_write.py::test_widening_raises[labels2-decision2-widen the compartment] PASSED [ 91%]
tests/test_pre_write.py::test_widening_raises[labels3-decision3-widen the compartment] PASSED [ 91%]
tests/test_pre_write.py::test_hook_exception_fails_closed PASSED         [ 92%]
tests/test_pre_write.py::test_unknown_decision_type_raises PASSED        [ 93%]
tests/test_rls_isolation.py::test_adk_session_and_memory_roundtrip PASSED [ 94%]
tests/test_rls_isolation.py::test_cross_tenant_isolation PASSED          [ 95%]
tests/test_rls_isolation.py::test_cross_user_private_isolation PASSED    [ 95%]
tests/test_rls_isolation.py::test_missing_app_filter_rls_protection PASSED [ 96%]
tests/test_rls_isolation.py::test_multi_agent_clearance_rbac PASSED      [ 97%]
tests/test_rls_isolation.py::test_fail_closed_without_session_context PASSED [ 98%]
tests/test_rls_isolation.py::test_insert_spoofing_blocked_by_rls PASSED  [ 99%]
tests/test_rls_isolation.py::test_adk_runner_preload_and_load_memory_integration PASSED [100%]

======================= 122 passed, 1 skipped in 12.92s ========================
