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 protected-connection methods below describe this source checkout. The published millwork-solver==0.1.0 wheel has six public verifier operation IDs in its catalog but does not include verifier_connection. Until a wheel carrying these methods is published and read back, use the private CLI or dashboard path for a protected endpoint.

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.1

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.1
File Size Uploaded Provenance
millwork_solver-0.1.1.tar.gz 19.7 kB With provenance Details

Built distribution (wheel)

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

Total release size: 111.1 kB

Release files / millwork_solver-0.1.1.tar.gz

Download URL millwork_solver-0.1.1.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
edf4566b6478ef6406e4ca6c6e688540d936d7dd80b036075c8faed70b43cd7e
BLAKE2b-256 checksum
How to use checksums
0fb6d3a2f9f8a387b85e7e3561f628dd9b638074f9afa8158cc2f800a13ac715
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 Sep 24, 2026.

Transparency log

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

Download URL millwork_solver-0.1.1-py3-none-any.whl
Size 91.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7de11f2f2f54203ccadb198dbf6dacde9d06ea62fc8ca4168105eab6fbafa6c3
BLAKE2b-256 checksum
How to use checksums
83bfb8072ba525d952e6d439c335c1a6bc44f5b7fd7718d4692564cbacec3363
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 Sep 24, 2026.

Transparency log

Security for millwork-solver 0.1.1

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.1.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 Sep 24, 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