Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shared job API

The job envelope optimization.job/0.1, the result contract optimization.result/0.2, the worker SDK and the optimization-run runner live in optimization-jobs, shared with the other worker repositories (fcmaes-rust, LP-IP-craft, SQP-craft). This repository depends on its crates optimization-job-api and optimization-runner at the revision pinned in the root Cargo.toml, and contributes lp-ip-job-worker.

The shared guide

TopicSection of the guide
Envelope fields, inputs and validationEnvelope
cpu_slots, outer_workers and inner_threadsEight CPU slots
Commands, lifecycle states and cancellationRun, inspect and stop
Error codesErrors
Claims, evidence and refutationsTermination, claim and evidence
Journals, accounting and recoveryAccounting and recovery
Agents and MCPAgents and MCP
JSON Schemas of jobs and resultsdocs/job-api/schemas
Implementation history and gatesPlan

lp-ip-job-worker

Profiles lp-ip.solve/1 (sparse LP/MIP artifacts, candidate starts, node and pivot budgets, numerical checks) and lp-ip.evaluate/1 (given points); see the tutorial and the validation report; the review records the corrections made before the 0.1 merge. cargo build --release --locked -p optimization-runner -p lp-ip-job-worker builds the runner, the MCP server and the worker; Cargo fetches the shared crates. The worker’s describe lists JSON Schemas of both payloads and of the model artifact, and runnable examples (payload_schemas, input_schemas, examples, from crates/lp-ip-job-worker/discovery); scripts/mps_to_model.py converts MPS files to the model artifact.

Agents: the MCP server

The same build makes optimization-mcp, an MCP server over one node (Agents and MCP). On a node with this worker registered (as lp-ip), connect an MCP client, for example Claude Code:

claude mcp add lp-ip-jobs -- "$PWD/target/release/optimization-mcp" --root /abs/node

Its tools describe the node and the worker, validate and submit jobs, wait for them, read their claims and evidence, and cancel or repair them; with the MCP Tasks extension, a submitted job is a task that completes with its result. The tutorial connects it to the tutorial’s node.

Running the shared tests here

The shared harness runs from Cargo’s checkout of optimization-jobs at the pinned revision, against this repository’s binaries:

cargo build --release --locked -p optimization-runner -p lp-ip-job-worker
SHARED=$(python3 scripts/job-api/shared_root.py)
export JOB_API_TARGET="$PWD/target/release" JOB_API_TUTORIALS="$PWD/tutorials/job-api"
python3 "$SHARED/scripts/job-api/test_integration.py"
python3 "$SHARED/scripts/job-api/test_review.py"
python3 "$SHARED/scripts/job-api/test_mcp.py"

A change to the shared crates lands in optimization-jobs first. Then change rev in the root Cargo.toml and run cargo update -p optimization-job-api -p optimization-runner. To develop both at once, add a [patch."https://github.com/dietmarwo/optimization-jobs"] section with path dependencies to a local checkout, as the optimization-jobs README shows.

Optional MIP gap controls

lp-ip.solve/1 accepts optional nonnegative mip_relative_gap and mip_absolute_gap. Absent/null leaves each off; zero preserves complete search. The resolved payload retains supplied values. gap_limit maps to claim feasible, never numerical_optimum, and reports the incumbent’s details.gap. LPs ignore MIP-only stops. See native gap semantics.

The optional Boolean fields adaptive_root, integer_equality_presolve and integral_slack_reduction default to false. Set presolve: true to use them. The common-slack reduction runs on cold single-thread tasks and falls back to the general solver when a structural condition fails. The separate objective_cutoff_bounds field also defaults to false and uses the same master switch. It can admit additional MIPs under a checked incumbent cutoff. Objective-implied MIP bounds. See the native option details.

one_sided_mip opts into serial MIP search with finite discrete domains and one-sided continuous bounds. The payload can use it with either setting of presolve. Missing sides in the model artifact still use JSON null. One-sided continuous bounds.

large_rational_witness (default false) allows bounded sparse rational incumbent reconstruction on larger MIPs. It applies with either setting of presolve. The solver checks the exact original data and applies the normal arithmetic, time and cancellation limits before using a witness for pruning. Rational certification settings.

lot_sizing_cut_rounds is an optional integer from 0 to 32. A positive value enables interval-demand separation when presolve recognizes production, stock or backlog balances with setup links. Lot-sizing interval cuts.

Interchangeable MIP blocks

block_symmetry_bits (integer 0–8, default 0) enables ordering of binary prefixes in a cold MIP solve with presolve. The native solver checks the objective, bounds, integer domains, local rows and coefficients in each linking row before ordering two blocks. A supplied primal start bypasses the ordering pass. The proof bound refers to the original optimum.