100% mutation kill score, 12 thread-safety fixes, and ASGI context restoration
42 files · 2,078+ · 211-

Reach 100% Mutation Kill Score

6 files changed
  • provider.py Identity-comparison refactor: uses `is` where object identity is intended to catch is/== mutations
  • provider.py Metrics provider identity comparison hardened
  • test_external_provider_compat.py External provider compatibility tests for OTel SDK interop (new file)
  • test_otel_integration.py OTel integration tests updated for full mutation coverage
  • test_trace_context_sync.py Trace context sync tests expanded (188 lines)
  • test_tracing_edge_cases.py Tracing edge-case tests updated
  • Identity-comparison refactor in provider detection to catch is/== mutations (uses is where object identity is intended) qualify internal
    2 files
    • provider.py
    • provider.py
  • Added external provider compatibility tests for OTel SDK interop qualify internal
    1 file
    • test_external_provider_compat.py

Thread Safety and Shutdown Fixes

13 files changed
  • setup.py Atomicity gaps in provider state transitions fixed; shutdown_logging() sentinel flag now resets correctly on exception
  • runtime.py Concurrent access patterns hardened
  • provider.py Concurrent access patterns in metrics provider hardened
  • fallback.py Metrics fallback thread safety improvements
  • resilience.py Resilience subsystem thread safety improvements
  • sampling.py Sampling subsystem thread safety improvements
  • backpressure.py `_validate_signal()` added; replaces silent fallback-to-'logs' with explicit ValueError for unknown signal names
  • health.py `_VALID_SIGNALS` frozenset added; `_known_signal()` now raises rather than silently returning 'logs'
  • propagation.py Propagation thread safety improvements
  • pii.py PII subsystem thread safety improvements
  • test_code_review_regressions_4.py Fourth batch of code review regression tests covering thread-safety fixes
  • test_code_review_regressions_4b.py Supplemental regression tests for thread-safety edge cases
  • test_thread_safety.py Concurrency thread-safety tests expanded
  • Fixed atomicity gaps in provider state transitions — state now transitions atomically rather than in separable steps remediate behavioral
    1 file
    • setup.py
  • Fixed reconfigure_telemetry() guard: blocks handler reinstall after OTel providers are shut down to prevent use-after-shutdown remediate behavioral
    1 file
    • setup.py
  • Fixed shutdown_logging() state leak: sentinel flag now resets correctly even when provider.shutdown() raises an exception (was left in inconsistent state on exception) remediate behavioral
    1 file
    • setup.py
  • Hardened concurrent access patterns in metrics and tracing providers harden internal
    2 files
    • provider.py
    • runtime.py
  • Added _validate_signal() in backpressure.py replacing silent fallback-to-’logs’ with an explicit ValueError for unknown signal names harden behavioral
    1 file
    • backpressure.py
  • Added _VALID_SIGNALS frozenset in health.py and changed _known_signal() to raise rather than silently return ’logs’ (improves mutation detectability) harden behavioral
    1 file
    • health.py

ASGI Middleware Context Restoration

3 files changed
  • middleware.py Captures pre-request context; restores it after request rather than clearing, fixing nested ASGI call correctness
  • test_middleware_and_setup.py ASGI middleware tests updated for context restoration behavior
  • test_middleware_cancellation.py ASGI cancellation tests updated
  • ASGI middleware now captures pre_request_ctx = get_context() before binding request context harden behavioral
    1 file
    • middleware.py
  • Replaced clear_context() in cleanup path with restore_context(pre_request_ctx) — correctly restores prior context state rather than clearing it, which matters for nested ASGI calls remediate behavioral
    1 file
    • middleware.py

Config URL Decoding Fix

1 file changed
  • config.py `unquote()` now applied to header keys as well as values
  • Fixed unquote() applied to header key in config.py (was only applied to values) remediate internal
    1 file
    • config.py

Architecture Documentation Update

2 files changed
  • ARCHITECTURE.md Documents `reconfigure_telemetry()` constraint: provider-changing OTel reconfiguration requires process restart once real providers are installed
  • README.md README updated to reflect current architecture and constraints
  • Documented reconfigure_telemetry() constraint: provider-changing OTel reconfiguration requires process restart once real OTel providers are installed specify architectural
    2 files
    • ARCHITECTURE.md
    • README.md