@context-hydration
Feature: Context tier hydration from linked resources (#1028)
  Verifies that ContextTierService is populated from project
  resources before LLM context assembly.

  Scenario: Hydrate tiers from git-checkout resource for ctx_hydrate
    Given a temp git repo with 2 files for ctx_hydrate
    And a ContextTierService instance for ctx_hydrate
    When I hydrate tiers from the resource for ctx_hydrate
    Then the tier service should have 2 fragments for ctx_hydrate

  Scenario: Hydrate skips binary files for ctx_hydrate
    Given a temp dir with 1 text and 1 binary file for ctx_hydrate
    And a ContextTierService instance for ctx_hydrate
    When I hydrate tiers from the resource for ctx_hydrate
    Then the tier service should have 1 fragment for ctx_hydrate

  Scenario: Hydrate skips files over size limit for ctx_hydrate
    Given a temp dir with 1 large file for ctx_hydrate
    And a ContextTierService instance for ctx_hydrate
    When I hydrate tiers from the resource for ctx_hydrate
    Then the tier service should have 0 fragments for ctx_hydrate

  Scenario: Hydrate sets project_name on fragments for ctx_hydrate
    Given a temp dir with 1 text file for ctx_hydrate
    And a ContextTierService instance for ctx_hydrate
    When I hydrate tiers from the resource for ctx_hydrate
    Then each fragment project_name should be "local/test-project" for ctx_hydrate

  Scenario: Hydrate sets resource_id on fragments for ctx_hydrate
    Given a temp dir with 1 text file for ctx_hydrate
    And a ContextTierService instance for ctx_hydrate
    When I hydrate tiers from the resource for ctx_hydrate
    Then each fragment resource_id should not be empty for ctx_hydrate

  Scenario: Hydrate returns 0 for missing location for ctx_hydrate
    Given a ContextTierService instance for ctx_hydrate
    When I hydrate tiers from a missing location for ctx_hydrate
    Then the hydration count should be 0 for ctx_hydrate
