Skip to main content

Archway

archway is the lightweight command-line client for an Archway service. It contains no translation engine, analysis engine, or server implementation.

Portable IR revision 21

This client prefers portable IR revision 21 and still reaches older engines, and so older revisions, with --engine; archway health lists the hosted engines and the revision each writes. Engine selection defaults to the engine pinned by this CLI release, unless you set --engine or ARCHWAY_ENGINE.

  • archway translate sends a revision-21 engine one module and writes its response: the module's document (or its error), its source sha256 and the document's fingerprint. A module that fails exits with status 1.
  • archway ir guide prints revision 21's complete specification, and archway ir catalogue its record catalogue as data.
  • Moving from revision 9 is a retranslation, not a field update: the change log lists every change with the consumer action and an example.

Installation

Install the command into an isolated environment:

uv tool install archway      # or: pipx install archway

Signing in

archway login

This opens a browser to sign in with your Archway account (--no-browser prints the address and code instead, for a machine without one). You stay signed in: the client keeps your sign-in in a private file (~/.config/archway/cli-credentials.json) and renews its short-lived tokens itself. archway whoami shows who you are signed in as; archway logout forgets the sign-in.

Scripts that run unattended use their own machine credentials instead (a WorkOS M2M application your administrator issues):

export ARCHWAY_CLIENT_ID="client_..."
export ARCHWAY_CLIENT_SECRET="<secret>"

ARCHWAY_TOKEN, a raw bearer token, overrides both; it is meant for tests.

Agents

An agent (a Claude session, an overnight job) should act as itself, not as you. It registers and you claim it:

archway agent register nightly --email you@example.com   # prints a link for you
archway agent claim nightly <code>                        # the code the link showed you
ARCHWAY_AGENT=nightly archway translate module.py         # or: archway --agent nightly …

The agent gets its own Archway identity, capped by your access, and renews itself while it runs at least monthly. archway agent list shows the agents on this machine; archway agent revoke nightly revokes it in Archway for good (you must be signed in; services refuse it within a minute) and forgets it here.

All of your agents act as one Archway identity, <you>-agents, capped by your access; each agent is a separate credential of it, so records show which one acted and each can be revoked alone.

Configuration

The client talks to https://engine.archway-labs.ai unless ARCHWAY_URL (or --server) names another Archway service.

A service can host several engine commits. archway health lists them; without further configuration this CLI release's pinned engine answers (see archway capabilities). To use another one, pass --engine <commit> (or set ARCHWAY_ENGINE); a unique prefix of at least 7 hex digits is enough:

archway --engine 27913a47 translate example.py

To follow the service's latest release instead of this CLI's pin, use latest, for example by setting ARCHWAY_ENGINE=latest in your shell profile. The latest release is the engine the newest CLI release pins, and it also answers requests that name no engine.

Flag selection takes precedence over ARCHWAY_ENGINE, then the release pin. This applies to both translation commands and archway mcp serve, including custom server URLs. An unavailable engine fails clearly; there is no fallback to an older engine. In the Python transport API, ArchwayClient(..., engine="latest") (or engine=None, which names no engine) uses the latest release; pass DEFAULT_ENGINE_SHA from archway_client.client to adopt the CLI release target. Analysis sessions are bound to one engine and need a full commit.

Each translation records the engine that produced it as engine_sha.

Releasing a client

Select an already deployed, immutable engine commit in archway_client.client.DEFAULT_ENGINE_SHA and its documented PORTABLE_REVISION. The engine commit is independent of the client release commit, avoiding a circular self-reference. Update the pin deliberately when advancing translation behavior; client-only releases can retain it. The PyPI release workflow checks that the public service hosts that exact ready engine as its latest release (default engine) and advertises the preferred revision before publication, so a release that advances the pin follows the deployment that makes its engine the latest. Keep historical engines available for older pinned clients. Never repoint a pin or automatically substitute an available engine.

The health check does not require signing in:

archway health

Discover the installed client's current commands and agent guidance:

archway --help
archway agent-guide
archway capabilities --format json

Translate one Python file:

archway translate example.py

Specify its dotted module name and write the IR response to a file:

archway translate src/example.py \
  --module-name package.example \
  --output example.ir.json

Proofs about your program

A repository's Lean proofs about its Python program live in an archway/ folder:

  • archway/manifest.toml, yours to edit: the entry module, the in-scope modules (modules = ["**/*.py"] and exclude, globs from the repository root; archway/, hidden directories and __pycache__ are never in scope), the shards (shards, Python definitions by qualified name, e.g. "Bank", "Bank.__init__", each rendered as its own Lean module, whose generated names your proofs refer to; a program does not fit one module), the claims (claims, the theorems your proofs are for, each by its full Lean name, e.g. "LargerProof.larger_correct": what a review starts from) and the pins ([pins] lean_commit, the Lean library commit, and python, the version it pins);
  • archway/<Name>.lean, your specifications and proofs, in the proof API's vocabulary;
  • archway/status.json, the verdicts (archway.proof-status.v1), written only by these commands;
  • archway/history/, every check kept, written only by check: one record per check (archway.proof-check-record.v1: the answer as printed, or the error of a check that could not run, the proofs' text as checked, the program's module hashes and the seconds, and, when the Lean commit gives one, presentation: each file as Lean shows it, its tokens, hovers and the goals after each tactic, archway.proof-presentation.v1, and structure: every declaration of your proof files and the program with the constants its statement and its value each use and whether you wrote it or Lean made it (from Lean's records, never its name), the theory constants used, by signature, and each module's package, archway.proof-structure.v2, kept as its own file beside the record (<record>.structure.json, removed with it), its catalogued theory constants' signatures and documentation fetched once per Lean commit into archway/history/theory/<commit>/; check keeps both but prints neither), and index.json (archway.proof-check-index.v1) listing them oldest first. The newest 200 within 64 MB are kept. It is a local record, not part of the proof: the folder's own .gitignore keeps it out of Git;
  • archway/site.json, the latest outline site printed (archway.proof-site.v1).
archway proofs init --entry package.main   # writes the manifest; never overwrites it
archway proofs sync                        # optional: translates the program now
archway proofs guide                       # the proof API's guide, under archway/guide/
archway proofs site                        # the program's outline: where to cut a proof
archway proofs check                       # every archway/*.lean, or name some
archway proofs status                      # offline: passed, refused, stale, unchecked
archway proofs structure --claim NS.thm    # offline: a claim's review set and what it claims
archway proofs view                        # offline: a page following the proofs and checks

guide writes the proof API's guide for the pinned Lean commit under archway/guide/ (start with GUIDE.md; proof-api/reference/names.md indexes every public declaration) and prints where; it fetches once per Lean commit.

site prints, before you write a proof, how the Lean library's recognition reads the program: per function, its statements as a tree with each one's construct family and whether the proof API covers it, the handle a proof names it by ((program.function 0).loop 0, statement ranges), its size, and twins (arms or loops of the same shape). --function limits it to one. It also writes the program's generated Lean, which proofs import, under archway/program/ (replaced by each site, never a proof file); a check afterwards reuses the program's build. Exit 0 with an outline, 2 when there is none (message says why: the program did not build, or recognition outlined no function, as for a class module).

init pins the Lean commit the service serves (archway health lists it under serving), unless --lean-commit names one. check sends the in-scope modules and the proof files, waits for the verdict, records it and prints it as JSON: exit 0 when it passed, 1 when it was refused (gate names the check that refused, message why, and gates holds every refusal by file and line, and the build's Lean messages whole: errors with the goals left open, messages with warnings and the answers of #check, #print, #reduce and trace_state), 2 when it could not run. With claims in the manifest and a Lean commit that gives the structure, the answer's claims says whether each names a theorem of the proof files checked (given only a name's last part, full_names lists the full names it could mean) and, for one that does, recognized: whether its statement is of a form the checker takes apart (see the Structure panel below). A check whose structure could not be given says why (structure_error), and one over a bound says its size and the bound (structure_refused): a structure is never shortened. theory_error says the catalogued theory could not be fetched (the check stands). archway proofs structure asks a kept check's structure offline: --claim (its review set and what it claims), --declaration (it and its neighbours) or --via (what it reaches), as JSON. status reads only local files: a proof is stale once a module in scope, the entry, the Lean commit or the proof itself changed since its verdict, and it exits 0 only when every proof passed and none is stale. Every command works on the current directory, or --repo.

Following a proof: archway proofs view

view serves a page over the repository's archway/ folder and opens it, for a person proving by hand or watching an agent prove. It reads only local files (the records check, site and guide wrote, the proof files and the in-scope modules), never calls the service, needs no sign-in and writes nothing. It shows:

  • the proof file with the selected check's messages on their lines (a mark in the gutter, the range tinted, Lean's whole message in the Messages panel). When the file has changed since that check, it shows the text as checked; t switches to the current file;
  • when the check carries Lean's presentation of the file (Lean commits that give one), what a Lean editor shows, read-only: Lean's own highlighting, each name's type and docstring on hover, and a goals panel with the goals before and after the tactic at the cursor, what the tactic changed marked, and the expected type or docstring at the cursor. Click to place the cursor; , and . step tactic by tactic; Ctrl/⌘-click or F12 goes to a name's definition (in the proof files, the generated Lean, or the guide); i shows or hides the goals;
  • the check's six gates, each passed, refused or not reached, with its seconds;
  • the history: every kept check with its outcome, refusing gate, errors, seconds and the lines changed since the previous check, with a chart of errors per check;
  • the program: the site outline (statements, coverage, the handle a proof names each by) beside the Python source and the generated Lean. A proof's GeneratedPython….dN names link to the outlined statement of that stage;
  • the guide, with the name index searchable;
  • the structure (s, Lean commits that give one): a review from a claim (its statement, the definitions it reaches with what they are defined as, the theorems it reaches by statement, and the theory it reaches by signature, Lean's core and libraries apart by package), or every declaration; for each, its signature and, for a definition in your proof files, its body as Lean checked it (a recursive one by its unfolding equation), each with every name a link to the constant it is and the instance it was given marked (two definitions that print alike but use different instances differ there), constants not printed listed under it; its docstring, marked as the author's words, which Lean does not check; what its statement and its proof or definition use, and what uses it, each a link. A claim of a form the checker recognizes is taken apart, as Lean read it: the Python function, the specification and its headroom, the specification's domain, arguments, completion and result (unfolded through your proof files and the specification builders computes and satisfies only), the entry it assumes and its requirements, and any hypothesis it assumes without proving. A claim of another form is shown as Lean states it, and says so. What Lean made rather than you (equation lemmas, matchers, recursors, split-off proofs: from Lean's records, never a name) is followed through, named on the declaration it serves ("includes"), and listed in its own folded group. Enter or Open goes to the declaration in the proof file or the generated Lean. A check whose structure is older than archway.proof-structure.v2 says so: check again on a Lean commit that gives v2.

It follows new checks as they land and files as they change. Arrow keys move between checks (left and right) and messages or rows (up and down); ? lists every key. It serves on 127.0.0.1 on a free port (--port to choose one); --host with a Tailscale address serves it on the tailnet. Stop it with Ctrl-C.

MCP server

Run a local stdio MCP adapter for agent hosts:

archway mcp serve

The MCP host launches this command as a child process. It exposes capability discovery, service health, Python translation and the proofs commands (archway_proofs_init, _sync, _check, _status, each on a repository's absolute path, writing nothing outside its archway/ folder) backed by the same configured Archway Engine Service as the CLI. It does not listen on a port or contain the engine itself.

The process uses this machine's archway login sign-in and renews its tokens for as long as it runs; a host can instead pass ARCHWAY_CLIENT_ID/ARCHWAY_CLIENT_SECRET (or, for tests, ARCHWAY_TOKEN). Never put a credential in command arguments or commit it in a host configuration file.

Command output is JSON. Errors are written to standard error and do not include the configured bearer token.

The installed client also provides an offline reference for portable categorical IR:

archway ir guide
archway ir catalogue --output revision-21.catalogue.json
archway ir definitions classifier_spec
archway ir operations python.call
archway ir search "merge class"

These reference commands need neither a service nor a sign-in. They describe revision 21; for a document from an older engine, archway ir guide --revision N and archway ir schema --revision N give that revision's specification and JSON Schema (revisions 9 to 20).

Metadata

Release files for archway 0.31.0

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

Built distribution (wheel)

Table of built distributions (wheels) for archway 0.31.0
File Interpreter ABI Platform Actions
archway-0.31.0-py3-none-any.whl Python 3 none any Details for archway-0.31.0-py3-none-any.whl

Release files / archway-0.31.0-py3-none-any.whl

Download URL archway-0.31.0-py3-none-any.whl
Size 356.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c5e22d1f4a76b6b95c52341c0253bf4f54cecff32c9b242de9a4b37533581b2
BLAKE2b-256 checksum
How to use checksums
473b1a4a7b3eb399e393a523040c5da484b8fbe5e1bc21c8425c6cb27075d4dc
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 Nov 23, 2026.

Transparency log

Security for archway 0.31.0

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

1 file in this release has been uploaded with provenance metadata.

Attestation for archway-0.31.0-py3-none-any.whl

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 Nov 23, 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.

Release history Release notifications | RSS feed

This release

0.31.0 This release

1 release file Full provenance

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