> ## Documentation Index
> Fetch the complete documentation index at: https://docs.evolvingmachines.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# analyses

> Read trace-analysis runs.

`analyses()` returns the analyses client. Analyses are started from a job, with `jobs().analyze()`; this client reads them back.

## list

<Tabs>
  <Tab title="TypeScript">
    ```ts theme={null}
    list(options?: { scope?: "my" | "shared"; job?: string; status?: AnalysisStatus[]; limit?: number; cursor?: string }): AnalysisList
    ```

    Analysis runs, newest first, each naming the trial, job and task it judged.

    ```ts theme={null}
    for await (const a of analyses().list({
      job: job.id,
      status: ["failed"],
    })) {
      console.log(a.id, a.label);
    }
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    def list(
        *,
        scope: Optional[JobListScope] = None,
        job: Optional[str] = None,
        status: Optional[List[AnalysisStatus]] = None,
        limit: Optional[int] = None,
        cursor: Optional[str] = None,
    )
    ```

    Analysis runs, newest first, each naming the trial, job and task it judged.

    ```python theme={null}
    async for a in analyses().list(
        job=job.id,
        status=["failed"],
    ):
        print(a["id"], a["label"])
    ```
  </Tab>
</Tabs>

## get, transcript, artifact

<Tabs>
  <Tab title="TypeScript">
    ```ts theme={null}
    get(analysisId: string): Promise<TrialAnalysis>
    transcript(
      analysisId: string,
      options?: { since?: number },
    ): Promise<AnalysisTranscript>
    artifact(
      analysisId: string,
      stream: "trace-stdout" | "trace-stderr",
    ): Promise<string | null>
    artifact(
      analysisId: string,
      stream: "agent-home",
    ): Promise<Record<string, string> | null>
    ```

    The verdict document for every analysis, failed ones included, the analyzer's own transcript (everything after `since` in one read), or one stored artifact; an analysis has no verifier log and no trajectory. A run opens to its job's creator and every member of the organization; any other id answers `analysis_not_found` (`trial_not_found` from `transcript`).

    ```ts theme={null}
    const verdict = await analyses().get("a0a1b2c3-…");
    ```
  </Tab>

  <Tab title="Python">
    The Python client has `list` and `download` only. Read a verdict from the analyzed trial: `(await trials().get(trial_id)).analysis`.
  </Tab>
</Tabs>

## download

<Tabs>
  <Tab title="TypeScript">
    ```ts theme={null}
    download(analysisId: string): Promise<Buffer>
    download(
      analysisId: string,
      options: { to: string },
    ): Promise<string>
    download(
      analysisId: string,
      options: { stream: true },
    ): Promise<ReadableStream<Uint8Array>>
    ```

    The run as one `.tar.gz`, `analyze-<analyzed trial>__<7 chars>/`: a trial tree of the analyzer's own run, with `artifacts/analysis.json` on a completed run. The bytes, the saved file's path, or a stream. `analysis_not_terminal` while the run is queued or running.

    ```ts theme={null}
    const path = await analyses().download(
      "a0a1b2c3-…",
      { to: "./analyses" },
    );
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    async def download(
        analysis_id: str,
        *,
        to: Optional[str] = None,
    )
    ```

    The run as one `.tar.gz`, `analyze-<analyzed trial>__<7 chars>/`: the bytes, or with `to` the saved file's path. `analysis_not_found` for an id you cannot read, `analysis_not_terminal` while the run is queued or running.

    ```python theme={null}
    path = await analyses().download(
        "a0a1b2c3-…",
        to="./analyses",
    )
    ```
  </Tab>
</Tabs>
