Skip to main content

metispy

ci parity

The metis python referee + research kit. Import name stays metis.

This is the SEMANTIC side of the metis toolchain: the exact measure (forward filter, factorized tables, clique trees), learning (Dirichlet notching, MAP-EM), decision, the surprise record + recover() replay, and the stage-45 formalization harness (metis.lang.formalize.admit_text_pack) — the gate cascade the metis-loop drives. It is NOT the shipping toolchain: the compiler is metisc (metis-lang, OCaml) and the runtime is metis-lang's C++ headers; metispy referees both.

  • metis/kernel/ — measure semantics, factorization, IR emission, canonical identity, notching, records.
  • metis/lang/ — parser/compiler/typecheck (the python front-end, kept as differential oracle for metisc), the LSP dev server, the formalize harness, and the discovery pair over #-directives (00-language-spec §8): directives.py (the llp.trace / metisc --run replay) and repl.py — the metis <file.llp> shell (readline editing/history/completion; step/sample on the reference sampler, assert/retract, exact query from the current state, reload with degrade-to-last-good, save back to directives).
  • metis/fw/ — the python evaluator product loop (truth generator for the C++ Evaluator).
  • metis/domains/ — the benchmark playground models (GoL, kitchen/Overcooked, nav, sysadmin, xtraffic, road). Their catalogs live in metis-catalog. The Ceptre love triangle the lineage tests read is metis-catalog's domains/ceptre/love_triangle/: it is under interactive-lp's license, so metispy does not ship it (since 0.1.1).
  • tools/ — golden/artifact generators writing INTO the metis-lang checkout (METIS_LANG, default: the sibling ../metis-lang).
  • tests/ — the full gate suite, including the cross-toolchain parity gates (OCaml compiles ≙ python referees ≙ C++ interprets).

Install

pip install metispy         # Python 3.12+; the import name is `metis`, the CLI `metis`

What you get: the referee and research kit above — the exact measure, learning, decision, records, the metis <file.llp> shell and the python front-end, with the domains' catalogs it builds from. It is not the compiler: metisc is metis-lang's (OCaml), built from that repo. A domain NAME (rather than a .llp path) needs the catalog's loader: install metis-catalog, or set METIS_CATALOG to a checkout.

For development, beside its siblings:

pip install -e .            # into the metis-lang dev env
METIS_LANG=../metis-lang python3 -m pytest tests/ -q
python3 -m pytest tests/ -q -m 'not slow'   # the dev loop

Optional extras: pip install overcooked-ai scipy (kitchen), pyRDDLGym (sysadmin), pgmpy (graph-evaluator comparisons). Oracle parity vs the wayplan ll2pg lineage: METIS_ORACLE_PATH.

Releasing

metispy goes to PyPI from GitHub by trusted publishing (.github/workflows/publish.yml; no token anywhere): bump version in pyproject.toml, commit, git tag vX.Y.Z (the tag must be v + that version: the workflow refuses any other), push the tag: it publishes straight through (the pypi environment has no required reviewer). The run builds the sdist and the wheel, smoke-installs the wheel in a fresh venv outside the checkout (tools/smoke_wheel.sh, which ci.yml runs on every push too) and uploads. workflow_dispatch is the dry run: everything but the upload.

Narration (narrate, metis/loop/narrate.py)

narrate tells the session's fired events as prose (narrate SEED: a fresh trace sampled with that seed). The narrator sees only certified material — the Foata beats, the final state and the catalog's %% docs — so the docs are its vocabulary: one plain sentence per story row. Four conventions keep a mined or machinery-heavy catalog tellable:

in the catalog what the narrator gets
%% [fold] bookkeeping: not told
%% [fold P …] words a run of these events → one beat line: the words, ⇒ left: the net-new atoms of P
%% phrase one | phrase two (⊕ rule) branch N's event tells phrase N
% evidence: "…" nothing — single-% lines never reach the narrator

Example, metis-catalog domains/wildfire/wildfire.llp:

  % evidence: "k, the number of its neighbors burning at the start of the step"
  %% [fold tally] the fire counts the burning neighbours of each cell
  see_fire [dyn] : scan(X, Y, S) * tally(X, Y, K) * ... -o scan(X, Y, S2) * tally(X, Y, K2).
  %% X,Y, with K burning neighbours, catches fire | X,Y, with K burning neighbours, stays unburnt.
  catch [dyn] : fresh(X, Y) * tally(X, Y, K) * not_burning(X, Y) -o (burning(X, Y) @w pign(K) | not_burning(X, Y) @w ~pign(K)).

The material asks for a length sized to what is told, and a narration the endpoint cut at its token cap ends on its last full sentence with "(narration cut at N tokens; ask fewer beats)".

License

Apache License 2.0 (see LICENSE, NOTICE).

Metadata

Release files for metispy 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 metispy 0.1.1
File Size Uploaded Provenance
metispy-0.1.1.tar.gz 355.4 kB With provenance Details

Built distribution (wheel)

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

Total release size: 702.3 kB

Release files / metispy-0.1.1.tar.gz

Download URL metispy-0.1.1.tar.gz
Size 355.4 kB
Tags Source
SHA-256 checksum
How to use checksums
48a292db912ca57377066638b98f1612a54d6ec2ffed8fb5f88744b5762fb956
BLAKE2b-256 checksum
How to use checksums
00d0c64b2afe05b7feb47ebe10d3b3638c79e16f408340e6e8fe09e74a942218
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 / metispy-0.1.1-py3-none-any.whl

Download URL metispy-0.1.1-py3-none-any.whl
Size 347.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60dfab01424a63d36fa828f1f0aca4a7a74a4dc533c3e05446a382d563a3fb57
BLAKE2b-256 checksum
How to use checksums
e8a6498174ec62b283dbb9574182aed1110ca20b127408be463d841b958db6cc
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 metispy 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 metispy-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 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.

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