Metadata-Version: 2.5
Name: atlas-env
Version: 0.6.1
Summary: CLI + SDK + agent framework for the 3I Atlas Gym
Author: 3I Atlas
License: MIT
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Provides-Extra: http
Requires-Dist: httpx>=0.27; extra == 'http'
Description-Content-Type: text/markdown

# atlas-env

A pip-installable CLI + SDK + agent framework for the **3I Atlas Gym**.

- Import name: `atlas_env`
- Console script: `atlas`
- No hard third-party dependencies.

## Install

```bash
pip install atlas-env
```

## CLI

```bash
atlas init my-agent --task analyst_forecast_v1
atlas list
atlas eval --task analyst_forecast_v1 --domain compute --as_of 2026-11-25
atlas train
atlas run-app
```

## Project layout

```
my-agent/
  agent/agent.py          # the agent (Agent subclass)
  application/main.py     # the app entrypoint (`atlas run-app`)
  tasks/__init__.py       # project task registry (custom tasks)
  scoring/__init__.py     # project scoring schemes (custom metrics)
  atlas.json              # name / task_id / trainable
  pyproject.toml
  README.md
  train/train.py          # only when trainable (`atlas train`)
```

Tasks live in the SDK (`atlas_env.tasks.base.Task`, `atlas_env.tasks.manager.TaskManager`)
and scoring in `atlas_env.grading.base.GradingScheme` (`PinballGrading`,
net-return, ...). Projects add their own in `tasks/` and `scoring/`; `atlas eval`
and `atlas list` merge the project registry with the built-ins.

## Prebuilt tasks

The SDK ships three default tasks, registered in `atlas_env.tasks` and exposed
by name through `Prebuilt`:

```python
from atlas_env.tasks import Prebuilt

task = Prebuilt.ForecastHorizon      # analyst_forecast_v1
task = Prebuilt.MacroRates           # macro_rates_v1
task = Prebuilt.PortfolioAllocator   # portfolio_allocator_v1

Prebuilt.all()                       # [Task, Task, Task]
Prebuilt.ids()                       # ["analyst_forecast_v1", ...]
Prebuilt.get("analyst_forecast_v1")  # Task | None
```

Agents opt into one or more of these by listing their ids in
`compatible_tasks`; the project's `tasks/` registry adds custom tasks on top.

## Prebuilt scoring

Every task carries a default scheme; the runner scores each action with
`task.grading.grade(action, realized)`. The same schemes are exposed by name:

```python
from atlas_env.grading import Scoring
from atlas_env.tasks import Prebuilt as Tasks

Scoring.Prebuilt.pinball                              # PinballGrading()
Scoring.Prebuilt.net_return                           # NetReturnGrading()
Scoring.Prebuilt.for_task(Tasks.ForecastHorizon)      # PinballGrading()
Scoring.Prebuilt.get("net_return")                    # NetReturnGrading()

Scoring.Prebuilt.pinball.grade(
    {"p10": -0.01, "p50": 0.0, "p90": 0.01}, {"change": 0.005}
)
# {"pinball": 0.0068, "coverage": 1.0}
```
