# Market ML Production Package

This directory contains production-grade research ML artifacts for Julian AI Command Center.

## What “production-grade” means here

Production-grade for this project means:

- versioned model artifacts with SHA-256 hashes
- leakage exclusions stored in the deployment manifest
- walk-forward validation reports
- model cards with blockers/cautions
- stable prediction contract: `market_ml_prediction_v1`
- explicit allowed/forbidden use
- explicit slippage/spread assumptions and cost-adjusted top-decile returns
- trap-risk recall and regime-wise confusion matrix diagnostics
- reproducible trainer and inference scripts

It does **not** mean fully automated trading. These models are for watchlist/radar probabilities only.

## Lanes

- `spy/` — SPY/S&P 500 lane
- `idx/` — IDX/IHSG/Indonesian stocks lane
- `crypto/` — BTC/crypto lane
- `all/` — combined cross-asset model

## Required files per lane

- `model.joblib`
- `metadata.json`
- `deployment_manifest.json`
- `walk_forward_report.json`
- `prediction_sample.json`
- `model_card.md`

## Runtime

Training/inference venv:

```text
/root/.venvs/market-ml
```

Trainer:

```text
/root/.hermes/scripts/train_production_market_ml.py
```

Inference:

```text
/root/.hermes/scripts/predict_market_ml.py
```

Production summary builder:

```text
/root/.hermes/scripts/build_market_ml_production_summary.py
```

After retraining lane artifacts, run the summary builder so `/command-center/ml.html` receives the latest cost assumptions, trap recall, and regime confusion data.

## Safety rule

No model here is allowed to execute trades directly. A separate execution stack must include:

- broker connection guard
- slippage/spread model
- max loss / kill switch
- position sizing
- audit log
- paper/live separation
