A solve call is the primary operation in ALX Protocol. You send a structured intent to the server, which selects or generates the best-matching artifact, executes a plan, and returns a response envelope carrying the result, execution metadata, and session context. All types in this document are exported fromDocumentation Index
Fetch the complete documentation index at: https://docs.xandrlabs.ai/llms.txt
Use this file to discover all available pages before exploring further.
@alx/protocol and constitute canonical wire shapes with compatibility guarantees (see WG-01).
Wire-level guarantees
The following guarantees apply to every solve request and response:| Guarantee | Rule |
|---|---|
| WG-01 | All protocol-owned wire shapes MUST live in @alx/protocol |
| WG-02 | Every major protocol surface MUST expose ok, correlationId, and protocol in the envelope |
| WG-08 | A failed request MUST NOT report ok: true |
| WG-09 | If run.failed is emitted, it MUST carry ok: false |
| WG-10 | If run.completed is emitted, it MUST carry ok: true |
Types
SolveCallInput
The top-level request shape you send to initiate a solve.
Describes what the solver should accomplish. Contains three fields:
verb— the action to perform (e.g."deploy","refactor","analyze")target— the subject of the action (e.g."api","service","codebase")domain— the knowledge domain scoping the solve (e.g."engineering","security")
Arbitrary key-value context passed to the solver. Use this to provide environment details, file paths, or any runtime state relevant to the intent.
Request metadata such as
userId. Not used for artifact selection but preserved in session history.Execution control options. See
SolveCallOptions below.SolveCallOptions
When
true, the solver evaluates and plans without executing side effects. Useful for previewing what a solve would do.When
true, bypasses confidence thresholds. Use this when you want execution to proceed even if the solver’s confidence score is below the minimum.Session ID to resume. When provided, the solver loads prior session context before planning.
Controls whether the run is recorded to session history.
enabled(boolean) — set totrueto record this runscope(string) — e.g."personal"or"team"
SolveResult
Returned inside SolveResponseEnvelope.result. Carries the quantitative outcome of the solve.
Numeric improvement score for this run, typically in the range
[0, 1]. Reflects how much better the artifact-guided outcome is relative to baseline.Arbitrary key-value metrics produced during execution. Shape varies by solver implementation.
SolveResponseEnvelope
The complete response shape returned by a solve call. All fields listed here are canonical wire fields unless noted as ergonomic aliases.
true if the request succeeded; false if it failed. A failed request MUST NOT return ok: true (WG-08).Opaque request identifier for tracing. Treat as a string; do not parse its structure.
Protocol negotiation envelope. Contains
protocol_version (string) and optionally capabilities (array of strings). See Protocol negotiation.Alias for
ok at the domain level. Both fields are present in the current protocol version.Opaque identifier for this specific execution run.
Reference to the artifact selected or produced by the solver. Contains at minimum
{ id: string }.Quantitative outcome of the solve. See
SolveResult above.Solver confidence for the selected artifact. Contains:
score(number) — confidence value in[0, 1]reason(string) — human-readable explanation
Execution metadata including:
cached(boolean) — whether a cached result was usedfallbackUsed(boolean) — whether a fallback artifact was useddurationMs(number) — wall-clock duration in millisecondssession(object) — session context withidandresumedfields
Ordered list of execution steps. Each step contains
label, success, and actionId.Post-run learning state. Contains:
memoryUpdated(boolean)artifactStatsUpdated(boolean)
null on success. On failure, a ProtocolError object with type, code, message, and optionally suggestion and details.Canonical vs ergonomic alias fields
Canonical fields carry compatibility guarantees across minor releases. Ergonomic alias fields are convenience shortcuts that may exist alongside canonical fields but are not the primary compatibility contract.| Canonical field | Ergonomic alias | Notes |
|---|---|---|
result.improvement | improvement | Alias may appear at the top level of some responses |
confidence.score | confidenceScore | Alias for the confidence score |
confidence.reason | reason | Alias for the confidence reason string |
execution.cached | cached | Alias at top level |
execution.fallbackUsed | fallbackUsed | Alias at top level |
correlationId | idempotencyKey | Alias used in some request contexts |
artifact | selectMeta | Alias in some selection-focused responses |
Always read canonical fields when writing protocol-compliant code. Ergonomic aliases MAY be removed or renamed in a major release.
Protocol negotiation
Theprotocol field in every envelope supports optional capability negotiation. You include a capabilities array in your request to advertise features you support; the server echoes back which capabilities it accepted.