# Unify Configuration

**Task**: AZ-165_refactor_unify_config
**Name**: Unify configuration — remove annotation-queue/config.yaml
**Description**: Consolidate two config files into one shared Config model
**Complexity**: 3 points
**Dependencies**: None
**Component**: Configuration
**Tracker**: AZ-165
**Epic**: AZ-164

## Problem

Two separate `config.yaml` files exist (root and `src/annotation-queue/`) with overlapping content but different `dirs` values. The annotation queue handler parses YAML manually instead of using the shared `Config` Pydantic model, creating drift risk.

## Outcome

- Single `Config` model in `constants.py` covers all configuration including queue settings
- `annotation_queue_handler.py` uses the shared `Config` instead of parsing its own YAML
- `src/annotation-queue/config.yaml` is deleted

## Scope

### Included
- Add Pydantic models for `ApiConfig`, `QueueConfig`; extend `DirsConfig` with all directory fields (data, data_seed, data_processed, data_deleted, images, labels)
- Add these to the `Config` Pydantic model in `constants.py`
- Refactor `annotation_queue_handler.py` constructor to accept/import the shared Pydantic `Config`
- Delete `src/annotation-queue/config.yaml`

### Excluded
- Changing queue connection logic or message handling
- Modifying root `config.yaml` structure beyond adding queue section (it already has it)

## Acceptance Criteria

**AC-1: Single config source**
Given the root `config.yaml` contains queue and dirs settings
When `annotation_queue_handler.py` initializes
Then it reads configuration from the shared `Config` model, not a local YAML file

**AC-2: No duplicate config file**
Given the refactoring is complete
When listing `src/annotation-queue/`
Then `config.yaml` does not exist

**AC-3: Annotation queue behavior preserved**
Given the unified configuration
When the annotation queue handler processes messages
Then it uses the correct directory paths from configuration

## Constraints

- Root `config.yaml` already has the `queue` section — reuse it
- `annotation_queue_handler.py` runs as a separate process — config import path must work from its working directory
