@tdd_issue @tdd_issue_10409
Feature: TDD Issue #10409 — Non-thread-safe singleton in get_provider_registry()
  The function get_provider_registry() in cleveragents.providers.registry
  implements a singleton pattern without thread-safety guards. Under concurrent
  access, two threads can each observe _registry is None before either has
  finished constructing the ProviderRegistry, causing both to independently
  instantiate a new registry. This violates the singleton contract and can lead
  to inconsistent provider state across the application.

  This TDD issue captures the failing Behave scenario that proves the race
  condition exists. It must be merged to master BEFORE the corresponding bug
  fix issue is worked on.

  See CONTRIBUTING.md > Bug Fix Workflow > TDD Issue Test Tags.

  Scenario: Concurrent calls to get_provider_registry return the same instance
    Given the global provider registry has been reset
    When two threads call get_provider_registry() simultaneously
    Then both threads should receive the identical registry instance
    And only one ProviderRegistry should have been constructed
