--- name: delegate-autoquant description: > Delegate reproducible quantitative research from a general Chat Workspace to the durable AutoQuant desk and consume its evidence-bound handoff. Use when a request needs a quantitative Project, historical data ingestion, factor or portfolio research, backtesting, Train/Validation/Holdout evaluation, or an AutoQuant follow-up. Do not use for ordinary market commentary, broker state, order execution, or a question Chat can answer directly. --- # Delegate quantitative research to AutoQuant Treat AutoQuant as a specialist coworker, not a function call. OpenAlice owns worker orchestration and routing; the AutoQuant Agent owns Project selection, Python/pandas research code, dependencies, Train/Val/Holdout splits, immutable Runs, local Git history, and Studio artifacts. ## Bound the assignment Before dispatch, preserve the caller-owned parts of the question: - the decision the research should support; - assets or universe, direction, horizon, and cadence when the caller knows them; - available data and its provenance (**inline relevant excerpts or exact absolute paths** for any cross-workspace files, because the AutoQuant worker cannot read your local session history); - benchmark, transaction costs, constraints, risk limits, and requested deliverable; - material unknowns that must be clarified rather than invented. Do not translate the request into AutoQuant CLI steps, choose a Project on its behalf, promise a positive result, or grant trading authority. A negative result, inconclusive signal, or request for clarification can be a correct handoff. ## Dispatch via `alice orchestration` Use `alice orchestration worker-start` as the primary delegation path: ```bash alice orchestration worker-start --harness autoquant --spec ' Research question: Decision this supports: Caller-owned scope and constraints: Available evidence or data: Expected handoff: answer in plain language; name the Project ID (`project_id`), its absolute Project path, and every relevant immutable `runId` under `runs/`; end with `Primary deliverable directory: ` pointing to the Project directory (containing `research.md`) or specific `runs/` directory containing the primary deliverable and artifacts; clearly separate Validation metrics from Holdout metrics and report `holdout_audit.unlock_count` honestly; state assumptions, limitations, and `tradingAuthority: none`. If a missing caller-owned fact would materially change the study, use `alice orchestration ask` before proceeding. When finished, report via `alice orchestration worker-done` with summary, evidence, and deliverable paths. ' ``` Quantitative research takes minutes, so `worker-start` dispatches asynchronously and returns `taskId`, `dispatchId`, and `workerResumeId` immediately: - **End your current turn** after dispatching and tell the user that AutoQuant (`dispatchId`) is working on the assignment in the background. - **Never `sleep` or poll in a loop**, and do not spawn duplicate AutoQuant workers while a dispatch is still active. - OpenAlice automatically wakes your Session when the AutoQuant worker: - calls `alice orchestration ask` (`question` wake) -> answer with `alice orchestration reply --id --body ""` and end your turn; - calls `alice orchestration worker-done` (`worker_done` wake) -> inspect the structured `summary`, `evidence`, and `deliverables` (run `alice orchestration check` if woken by a compact pointer); - exits without calling `ask` or `worker-done` or hits a stall/error (`escalation` wake) -> steer or resume the same worker with `alice orchestration send --to dispatch: --body ""`. - Use `alice orchestration inbox --dispatch ` for read-only audit history (including already-acknowledged messages) and `alice orchestration worker-list` to inspect active or settled dispatches. AutoQuant assignments deliberately have no default idle deadline; add `--max-idle-ms ` only when the caller has chosen a real stall budget for that study. To override the runtime or model for a single AutoQuant assignment without changing saved desk defaults, pass optional selection flags on `alice orchestration worker-start`: - `--agent `: choose a specific agent runtime (for example `codex`, `claude`, `pi`). - `--model `: choose a model id, or pass `--model default` to bypass a persisted desk model and use the runtime's own account default. - `--credential ` or `--credential-source native`: select an OpenAlice vault credential slug or force the runtime's native login (mutually exclusive). - `--effort `: choose a reasoning effort level when supported. To inspect or permanently update the AutoQuant desk's saved runtime defaults (for example, clearing a stale model back to the runtime default), use `alice runtime get --harness autoquant` and `alice runtime set --harness autoquant --model default` (also supports `--clear-model`, `--agent`, `--credential`, `--credential-source native`, `--effort`, and `--mode`). If AutoQuant is not initialized, report that boundary and direct the user to initialize the Quant desk. Do not silently perform the research in Chat or guess another Workspace. > **Legacy compatibility:** `alice conversation create --harness autoquant` / > `alice conversation ask` / `alice conversation check` remain available for > older workflows, but prefer `alice orchestration` for all new AutoQuant > delegations because it enforces structured `ask`/`reply` gates, explicit > `worker-done` handoffs, and automatic escalation on silent exits. ## Understand the returned state The worker reports a structured `worker_done` handoff (`outcome`, `summary`, `evidence`, `deliverables`) backed by plain files on disk: | Research outcome | Applicable durable evidence | |---|---| | Factor evaluation (`kind: "factor"`) | `projects//research.md` plus immutable `runs//` (`run.json`, `series/ic.csv`, `series/quantiles.json`, `series/equity.csv`) | | Portfolio backtest (`kind: "backtest"`) | `projects//research.md` plus immutable `runs//` (`run.json`, `series/equity.csv`, optional custom `artifacts/*`) | | Custom / statistical / ML study (`kind: "custom"`) | `projects//research.md` plus immutable `runs//` (`run.json`, custom `artifacts/*.json`, `.svg`, or `.md`) | | Blocked, ambiguous, or negative finding | Plain-language boundary or negative evidence plus `research.md` and whatever `runId`s were recorded | Each Project maintains a living `research.md` brief and immutable `runs//` records (`run.json`, `series/*`, and optional `artifacts/*`), while `project.json` tracks `splits` and `holdout_audit.unlock_count`. AutoQuant does not automatically publish either artifact to the OpenAlice Inbox. ## Consume and continue 1. Read the `worker_done` handoff first. Require the Project ID and absolute Project path, `Primary deliverable directory: `, relevant immutable `runId`s, Validation vs Holdout metrics (including `holdout_audit.unlock_count`), assumptions, limitations, and `tradingAuthority: none`. 2. If the absolute deliverable path or run IDs are missing, continue the same dispatch immediately instead of searching the desk or recruiting another worker: ```bash alice orchestration send --to dispatch: \ --body 'Please provide the absolute Project path, Primary deliverable directory, and immutable runIds from your completed assignment, then report them via worker-done. Do not rerun the research.' ``` 3. Use native Read/Search/Git capabilities directly on the returned directory (`research.md`, `project.json`, or `runs//run.json`) when deeper inspection is needed. Use `alice peer path --id ` only as an addressing fallback when the reported absolute path is unavailable. 4. If the answer needs substantive clarification or a follow-up experiment, continue that same `dispatchId` via `alice orchestration send`; do not recruit a new AutoQuant worker and discard its context. 5. Translate the evidence for the user, separating AutoQuant's empirical findings (and whether Holdout remained untouched or was unlocked) from your judgment. Any live account or execution decision returns to `alice-uta` and its approval flow. A normal attended Chat reply already reaches the user. Ask AutoQuant to commit and push an exact file to Inbox only when the user explicitly wants a durable human-facing delivery or asynchronous notification; do not use Inbox as the ordinary peer reply channel.