@acms-large-project-index
Feature: ACMS large-project indexing without timeout (#8726)
  Verifies that the context tier hydrator can index projects with 10,000+
  files without timing out, satisfying the v3.4.0 milestone acceptance
  criterion: "Projects with 10,000+ files index without timeout."

  The implementation uses ``git ls-files`` (30-second timeout) for
  git-checkout resources and ``os.walk`` as a fallback for other resource
  types.  Both paths must handle large file trees correctly.

  Scenario: Walk-based indexing of 10,000+ files completes without timeout
    Given a temp directory with 10000 small text files for large_idx
    And a ContextTierService instance for large_idx
    When I hydrate tiers from the walk-based resource for large_idx
    Then the hydration should complete without timeout for large_idx
    And the fragment count should be greater than 0 for large_idx

  Scenario: Walk-based indexing does not produce more fragments than input files for large_idx
    Given a temp directory with 10000 small text files for large_idx
    And a ContextTierService instance for large_idx
    When I hydrate tiers from the walk-based resource for large_idx
    Then the fragment count should be greater than 0 for large_idx
    And the fragment count should be at most 10000 for large_idx

  Scenario: Walk-based indexing skips binary files in large project for large_idx
    Given a temp directory with 5000 text files and 5000 binary files for large_idx
    And a ContextTierService instance for large_idx
    When I hydrate tiers from the walk-based resource for large_idx
    Then the fragment count should be greater than 0 for large_idx
    And all indexed fragments should have text content for large_idx

  Scenario: Walk-based indexing skips oversized files in large project for large_idx
    Given a temp directory with 10000 small files and 10 oversized files for large_idx
    And a ContextTierService instance for large_idx
    When I hydrate tiers from the walk-based resource for large_idx
    Then the fragment count should be greater than 0 for large_idx
    And no oversized file should appear in the indexed fragments for large_idx

  Scenario: Git-checkout indexing of 10,000+ files completes without timeout
    Given a temp git repo with 10000 small text files for large_idx
    And a ContextTierService instance for large_idx
    When I hydrate tiers from the git-checkout resource for large_idx
    Then the hydration should complete without timeout for large_idx
    And the fragment count should be greater than 0 for large_idx

  Scenario: Fallback to walk when git ls-files is unavailable for large_idx
    Given a temp non-git directory with 10000 small text files for large_idx
    And a ContextTierService instance for large_idx
    When I hydrate tiers from the git-checkout resource on a non-git directory for large_idx
    Then the hydration should complete without timeout for large_idx
    And the fragment count should be greater than 0 for large_idx

  Scenario: Walk-based indexing enforces max_total_size budget for large_idx
    Given a temp directory with files exceeding the total-bytes budget for large_idx
    And a ContextTierService instance for large_idx
    When I hydrate tiers from the walk-based resource for large_idx
    Then the fragment count should be greater than 0 for large_idx
    And the total indexed size should not exceed the max total bytes budget for large_idx
