# CLAUDE.md

Project-specific guidance for Claude Code when working in this repository.

## Architecture

**Read [`ARCH.md`](ARCH.md) before making structural changes.** It defines the
layered architecture (`cli → pipeline → {monitoring, snowflake} → domain →
platform`), names the public surface of each layer, and includes a decision
tree for where new code belongs.

The layering rule is enforced in CI by import-linter
([`.importlinter`](.importlinter), runs via `make check_imports` as part of
`make test`). When you place a module in the wrong layer, the build fails;
fix it by moving the code rather than by widening the contract.

## Adding or moving code

- Pure pandas / pure rule → `tadas.domain`
- Reads/writes Snowflake → `tadas.snowflake`
- Sensor / monitoring rule → `tadas.monitoring`
- End-to-end use case → `tadas.pipeline`
- argparse entrypoint → `tadas.cli`
- Cross-cutting infra (logging, config, metrics, locking, …) → `tadas.platform`

`tadas/models/` holds per-version model parameter sets (`t26XX_*/model_config.py`).
Treat as a versioned registry, not as application code. Do not import from
`tadas.snowflake`/`pipeline`/`platform` inside a `model_config.py`.

## Running tests and checks

```bash
make test            # unit tests + import-linter contract
make check_imports   # just the layering contract
```

`tests/unit/` mirrors `tadas/` (e.g. tests for `tadas/domain/features.py` live
at `tests/unit/tadas/domain/test_features.py`).

`tests/integration/` hits real Snowflake and is **not** part of `make test`.
