Files
Duriin-API/docs/autonomy.md

47 lines
1.8 KiB
Markdown

# Duriin autonomy runtime
The autonomy runtime is additive to the existing archive and intelligence
tables. Its workers are part of the default runtime and restart automatically.
## Services
- `api`: HTTP only; no background scheduler when `DURIIN_RUN_SCHEDULER=false`.
- `autonomy`: bounded archive reconciliation and live/historical job creation.
- `coordinator`: LLM proposal extraction only. It cannot create an order.
- `autonomy-outcomes`: resolves matured predictions against market and benchmark returns.
- `calibration`: creates empirical calibration snapshots and deterministic decisions.
- `intelligence`: legacy worker, available only under the `legacy` Compose profile.
Start the API and autonomy runtime:
```bash
docker compose up -d
```
## Authority rules
The coordinator may return categorical, evidence-backed proposals. It may not
return probabilities, returns, position sizes or trade actions. Proposals must
reference existing archive article IDs and instruments in
`autonomy_instruments` with `active=1` and `tradable=1`.
Calibration is computed from resolved market-relative outcomes. The policy
engine emits `BUY`, `SELL`, `HOLD` or `ABSTAIN`; an LLM is not in this path.
Paper order intents use deterministic client IDs and are bounded by the
execution validator. A broker adapter must be explicitly configured; the
included simulator is the default test adapter.
## Database initialization
The autonomy schema is initialized additively by the autonomy workers and
maintenance scripts in the intelligence database. To create the initial
reconciliation job without starting workers:
```bash
npm run autonomy:init
```
Legacy predictions remain legacy records and are not silently included in
calibration. New prospective predictions are the trusted learning set.