Metadata-Version: 2.4
Name: identa-core
Version: 0.4.5
Summary: Core domain and application logic for Identa
License-Expression: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: pydantic>=2.0
Requires-Dist: sqlalchemy>=2.0.49
Requires-Dist: typing-extensions
Description-Content-Type: text/markdown

# Identa Core 🧠

The engine room of Identa. This package contains the pure domain logic, ports, and application handlers following a strict **Hexagonal Architecture** and **CQRS** pattern.

## Architecture

Identa Core is designed to be framework-agnostic and side-effect free. It enforces a clean separation between "how we evaluate" and "how we store/trace".

### Hexagonal Layers

1.  **Domain**: Pure Pydantic models (Runs, Spans, AgentStructure) and core logic (Metric computation, Migration validation).
2.  **Ports**: Abstract interfaces for storage and artifacts.
3.  **Application**:
    *   **Commands**: Mutation logic (Start Run, Log Results).
    *   **Queries**: Data retrieval logic (List Runs, Get Comparison).
4.  **Persistence (Adapters)**: Concrete implementations of ports (SQLite, Local Filesystem).

## Key Components

- **Evaluation Engine**: The loop that executes agents against test suites and computes metrics.
- **Tracing Service**: A context-aware span collector.
- **Migration Engine**: Logic to validate and apply model-binding swaps.
- **Reproduction Engine**: Logic to replay experiments with structural drift detection.

## Development

This package is managed by `uv`.

```bash
# Run unit tests
uv run pytest tests/
```
