---
title: "Compile status"
description: "Poll a compile or link job by job_id, and surface the engine scan and link diagnostics so the compiler is not a black box at scale."
icon: material/clipboard-text-clock
---

Check on a compile or link job by its `job_id`, the id returned by [`log10x_compile`](compile.md) or [`log10x_compile_link`](compile-link.md).

The response reports where the job stands (running, completed, failed, or timed out) and what it has produced:

- the symbol units so far
- the linked `.10x.tar` file and its size
- the elapsed time
- the engine exit code
- a credential-redacted tail of the engine log

The point of the tool is to keep the [Compiler app](../../../compiler/) legible at 100k to 500k files. A run that size writes a log hundreds of thousands of lines long, so the two diagnostics that matter are lifted to the top of the response instead of being left buried in it:

- **`scan_health`** reports how many files failed to parse during the [scan phase](../../../../compile/scan/), broken down by language, with a few examples that name the file and the reason it would not parse.
- **`link_report`** reports how many units were merged during [linking](../../../../compile/link/) and how many were excluded, plus a count of symbols by type (class, enum, log, exec).

Both fields appear only when the `compiler-10x` image includes the engine diagnostics change. On an older image the response falls back to unit counts and the log tail, and still succeeds.

Polling is safe to repeat. The first poll after the job finishes records the exit code and releases the container. Later polls keep working, and the compiled library is never removed.

## :material-code-braces: Example

!!! tenx-ask "You"

    status on compile-7c2f

!!! tenx-answer "Log10x"

    Compile job `compile-7c2f` done, 4,812 units → /tmp/log10x-mcp-compile/out/payments.10x.tar (38.6 MB), 19 files failed to scan.

    Scan health: 19 files failed (top: java 11, go 6, python 2). Example: vendor/legacy/Parser.java, unsupported syntax near token 'sealed'.

    Link report: linked 4,812 unit files (37 excluded by folder/name filters); symbols by type: class 18,204, log 9,661, exec 4,113, enum 1,290.

## :material-chat-question-outline: More to ask

- *"is compile-7c2f done yet?"*
- *"which files failed to scan on that job?"*
- *"show me the last 200 log lines for the failed link"*

## :material-check-decagram-outline: Prerequisites

Runs at the CLI tier, with no Kubernetes, deployed app, or Log10x account required. The tool reads the on-disk job record written by [`log10x_compile`](compile.md) or [`log10x_compile_link`](compile-link.md), so a `job_id` from one of those calls is the only input it needs.

The per-language scan failures and the symbol-type counts need a `compiler-10x` image that carries the engine diagnostics change. An older image returns the unit counts and the log tail without them.

## :material-code-json: Schema and samples

??? tenx-input-example "Input example"

    Poll a job_id handed back by a long first compile, asking for a deeper log tail to diagnose a failure.

    ```json
    {
      "job_id": "compile-7c2f",
      "log_lines": 200
    }
    ```

??? tenx-input-schema "Input schema"

    Agent-facing JSON Schema (the canonical shape the MCP server publishes via `tools/list`):

    ```json
    {
      "type": "object",
      "properties": {
        "job_id": {
          "type": "string",
          "description": "The job id returned by log10x_compile (data.payload.job_id)."
        },
        "log_lines": {
          "type": "integer",
          "minimum": 0,
          "maximum": 400,
          "default": 40,
          "description": "How many trailing engine-log lines to include in data.payload.log_tail (credential-redacted). 0 to omit. Raise it when diagnosing a failed run."
        },
        "view": {
          "type": "string",
          "enum": [
            "summary"
          ],
          "default": "summary",
          "description": "summary returns the typed envelope (data.payload.job_status, .diagnostics, .output, .log_tail)."
        }
      },
      "required": [
        "job_id"
      ],
      "additionalProperties": false
    }
    ```

    Source: [`src/tools/compile-status.ts`](https://github.com/log-10x/log10x-mcp/blob/main/src/tools/compile-status.ts).

??? tenx-output-example "Output example"

    Representative envelope (no captured fixture). A completed compile on a `compiler-10x` image that carries the engine diagnostics change, so `scan_health` and `link_report` are populated. Long arrays and the log tail are trimmed for readability.

    Headline (the 1-line agent-facing answer):

    > _Compile job `compile-7c2f` done: 4812 units → /tmp/log10x-mcp-compile/out/payments.10x.tar (38.6 MB), 19 files failed to scan._

    ```json
    {
      "schema_version": "1.0",
      "schema_epoch": "2026-05-25",
      "tool": "log10x_compile_status",
      "generated_at": "2026-06-15T16:04:11.730Z",
      "view": "summary",
      "status": "success",
      "summary": {
        "headline": "Compile job `compile-7c2f` done: 4812 units → /tmp/log10x-mcp-compile/out/payments.10x.tar (38.6 MB), 19 files failed to scan."
      },
      "data": {
        "status": "success",
        "decisions": {
          "threshold_used": null,
          "threshold_basis": "default"
        },
        "source_disclosure": {},
        "scope": {
          "window": "payments_compile",
          "window_basis": "explicit",
          "candidates_count": 4812,
          "candidates_usable": 1
        },
        "payload": {
          "job_id": "compile-7c2f",
          "job_status": "completed",
          "mode": "docker",
          "image": "log10x/compiler-10x",
          "exit_code": 0,
          "elapsed_ms": 184220,
          "timed_out": false,
          "sources": "local /src/payments + github acme/payments-api",
          "output": {
            "folder": "/tmp/log10x-mcp-compile/out/payments",
            "unit_count": 4812,
            "empty_unit_count": 31,
            "library_files": [
              { "path": "/tmp/log10x-mcp-compile/out/payments.10x.tar", "bytes": 40478720 }
            ]
          },
          "diagnostics": {
            "results_available": true,
            "phases": [
              {
                "operation": "scan",
                "status": "ok",
                "traversed_files": 21044,
                "scanned_files": 4843,
                "output_files": 4812,
                "warns": 19,
                "errors": 0
              },
              {
                "operation": "link",
                "status": "ok",
                "traversed_files": 4812,
                "scanned_files": 0,
                "output_files": 1,
                "warns": 0,
                "errors": 0
              }
            ],
            "scan_health": {
              "files_failed": 19,
              "failed_by_language": { "java": 11, "go": 6, "python": 2 },
              "failure_samples": [
                {
                  "name": "vendor/legacy/Parser.java",
                  "language": "java",
                  "reason": "unsupported syntax near token 'sealed'"
                }
              ]
            },
            "link_report": {
              "merged_files": 4812,
              "skipped_files": 0,
              "excluded_by_folder": 24,
              "excluded_by_file_name": 13,
              "merged_repos_count": 2,
              "non_merged_repos_count": 0,
              "symbols_by_type": {
                "class": 18204,
                "log": 9661,
                "exec": 4113,
                "enum": 1290
              },
              "symbols_excluded_by_type": 502
            }
          },
          "log_tail": [
            "INFO  ScanObserver - report phase complete: 4812 units written",
            "INFO  Linker - merged 4812 units into payments.10x.tar (38.6 MB)"
          ]
        },
        "human_summary": "Compile job compile-7c2f completed via docker in 3m04s: 4812 symbol units, linked to /tmp/log10x-mcp-compile/out/payments.10x.tar (38.6 MB). 31 units were emitted empty: every symbol filtered out (the default symbol.types keeps class/enum/log/exec only). 19 files failed to scan (top: java 11, go 6, python 2). Example: vendor/legacy/Parser.java, unsupported syntax near token 'sealed'. Linked 4812 unit files (37 excluded by folder/name filters); symbols by type: class 18204, log 9661, exec 4113, enum 1290."
      },
      "actions": [
        {
          "tool": "log10x_validate",
          "args": { "extra_args": [["symbolPaths", "/tmp/log10x-mcp-compile/out/payments"]] },
          "reason": "smoke-test the compiled library against a few sample event lines (supply input_lines)"
        }
      ],
      "truncated": false,
      "warnings": []
    }
    ```

    On an older `compiler-10x` image, `diagnostics.results_available` is `false`, `scan_health` and `link_report` are `null`, and the response carries the unit counts plus `log_tail` alone.

??? tenx-output-schema "Output schema"

    The `payload` block inside the [chassis envelope](../index.md):

    ```typescript
    interface CompileStatusPayload {
      job_id: string;
      job_status: 'running' | 'completed' | 'failed' | 'timed_out';
      mode: 'docker' | 'local';
      image: string | null;
      exit_code: number | null;
      elapsed_ms: number;
      timed_out: boolean;
      sources: string;
      output: {
        folder: string;
        unit_count: number;
        empty_unit_count: number;
        library_files: Array<{ path: string; bytes: number }>;
      };
      diagnostics: {
        results_available: boolean;
        phases: Array<{
          operation: string | null;
          status: string | null;
          traversed_files: number | null;
          scanned_files: number | null;
          output_files: number | null;
          warns: number | null;
          errors: number | null;
        }>;
        // Populated only on a compiler-10x image that carries the engine
        // diagnostics change; null otherwise (graceful degradation).
        scan_health: {
          files_failed: number;
          failed_by_language: Record<string, number>;
          failure_samples: Array<{ name: string; language: string; reason: string }>;
        } | null;
        link_report: {
          merged_files: number;
          skipped_files: number;
          excluded_by_folder: number;
          excluded_by_file_name: number;
          merged_repos_count: number;
          non_merged_repos_count: number;
          symbols_by_type: Record<string, number>;
          symbols_excluded_by_type: number;
        } | null;
      };
      log_tail: string[];
    }
    ```

    Envelope-level fields the agent should also read: `summary.headline` (1-line answer), `status` (`success` / `partial` / `no_signal` / `error`), `data.human_summary` (the quotable plain-English summary), and `actions[]` (next-call chain hints as `{tool, args, reason}`; a completed compile chains to `log10x_validate` to smoke-test the library).
