Skip to main content

Millwork Solver for Python

millwork-solver is an early preview client for the Millwork Solver API. Import millwork_solver to use the synchronous Solver client or the asynchronous AsyncSolver client on CPython 3.11 through 3.14.

The generated REST lifecycle reference owns output-check operation IDs and fields. The verifier-dock contract owns the endpoint request and response. Follow Recipe 0 for local tests, deployment, and a receipt.

Pass api_key and base_url directly, or use SOLVERAPI_API_KEY and SOLVERAPI_BASE_URL. Retry settings use SOLVERAPI_MAX_RETRIES (default 2) and SOLVERAPI_RETRY_BACKOFF_MS (default 500).

Both clients provide the same typed operation surface, explicit timeout and close behavior, and receipt-aware responses. Echo reaches a terminal status and returns a receipt; it does not return result content.

Use the API base URL with its /v1 suffix:

export SOLVERAPI_BASE_URL="https://api.getmillwork.dev/v1"
export SOLVERAPI_API_KEY="<organization API key>"

Call an operation by its OpenAPI operation_id. This complete test run uses postExecutions; the request must include both task and policy:

import uuid

from millwork_solver import Solver

with Solver() as client:
    run = client.request(
        "postExecutions",
        body={
            "mode": "echo",
            "task": {"objective": "Check the Millwork API lifecycle."},
            "policy": {
                "data_classes": ["public"],
                "budget": {"max_cost_usd": 1, "max_runtime_s": 30},
            },
        },
        idempotency_key=str(uuid.uuid4()),
    )
    receipt = client.request(
        "getReceiptsByExecutionId",
        path_parameters={"executionId": run["execution_id"]},
    )
    print(run["status"], receipt["mode"])

Common operation IDs include getAccount, getArms, getModelCatalog, getVerifiers, postExecutions, getExecutionsByExecutionId, getExecutionsByExecutionIdResult, and getReceiptsByExecutionId. The package ships the complete operation contract in millwork_solver/_contract.json.

Verifier lifecycle

The installed client can register and test a public output check. Set VERIFIER_URL to an endpoint implementing the output-check contract:

import os
import uuid
from millwork_solver import Solver

with Solver() as client:
    registered = client.request("postVerifiers", body={
        "display_name": "My output check", "version": "1.0.0", "kind": "endpoint",
        "endpoint": {"url": os.environ["VERIFIER_URL"], "auth_ref": ""},
        "input_data_classes": ["public"],
        "scoring": {"correctness": "boolean_anchors", "quality": "scalar_0_1"},
    }, idempotency_key=str(uuid.uuid4()))
    verifier_id = registered["verifier_id"]
    print(verifier_id, client.request("postVerifiersByVerifierIdTest",
          path_parameters={"verifierId": verifier_id}, idempotency_key=str(uuid.uuid4())))

The published millwork-solver==0.1.1 wheel includes the public verifier operation IDs and verifier_connection. Install that pinned release to run the protected-connection methods below. The earlier 0.1.0 wheel does not include these methods.

For a protected endpoint, register that endpoint with the same secretless postVerifiers body, then use its verifier_id for the private handoff. The REST registration has no access field; the protected connection is established by verifier_connection. Give continue_url only to the intended person through your host's private browser handoff. The callback below belongs to that host and must not log or expose the URL. The endpoint key is never an argument to these methods.

import uuid
from urllib.parse import urlsplit

def start_protected(client, verifier_id, trusted_app_origin, open_private_url):
    intent = client.verifier_connection.create_intent(
        verifier_id, {"kind": "preset_days", "days": 90},
        idempotency_key=str(uuid.uuid4()))
    expected = urlsplit(trusted_app_origin)
    actual = urlsplit(intent["continue_url"])
    if (actual.scheme, actual.netloc) != (expected.scheme, expected.netloc):
        raise ValueError("Unexpected private-entry origin")
    open_private_url(intent["continue_url"])
    return intent["intent_id"]

def continue_protected(client, verifier_id, operation_key):
    return client.verifier_connection.continue_connection(
        verifier_id, operation_key=operation_key,
        idempotency_key=str(uuid.uuid4()))

enter_key means private entry is still needed. resume means retain the same operation key and use a fresh request idempotency key. start_again means the endpoint test failed; correct the endpoint or key and create a new intent. inspect means another connection change intervened. refused means the server rejected the change with a non-retryable client error; read outcome.error["status"] and outcome.error["title"], inspect that operation, and correct the cause before another action. A 401 or 403 raises a ProblemError instead of returning a lifecycle outcome. Only a read-backed done confirms completion. The async AsyncSolver.verifier_connection has the same methods, awaited. Replacement and restoration use a new intent and the same private-entry path. Disconnect requires explicit caller confirmation: client.verifier_connection.disconnect(verifier_id, operation_key=..., idempotency_key=..., confirmed=True). Millwork stopping use of a key does not revoke it at your endpoint. A governed run requires separate authorization and uses this verifier_id.

Metadata

Release files for millwork-solver 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for millwork-solver 0.1.2
File Size Uploaded Provenance
millwork_solver-0.1.2.tar.gz 19.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for millwork-solver 0.1.2
File Interpreter ABI Platform
millwork_solver-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 112.1 kB

Release files / millwork_solver-0.1.2.tar.gz

Download URL millwork_solver-0.1.2.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
460071ab8754d166d122de7e128e60a6e21a517e7c1e0529784fb45bd45056a1
BLAKE2b-256 checksum
How to use checksums
cc83d90960e1caa8283180daeafa4644c8c5d33284c1c415190661dd774838dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / millwork_solver-0.1.2-py3-none-any.whl

Download URL millwork_solver-0.1.2-py3-none-any.whl
Size 92.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f3e93ac2f50a3a9bb643ec425f6b1666455c209c03abae0561b4e611a6d881f
BLAKE2b-256 checksum
How to use checksums
2374bfda8fe06a99b90531fb1c0badd0d0a21a930ecce0a68f3d3f0dfc9f88be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for millwork-solver 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for millwork_solver-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page