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 (fiction/ Ceptre, GoL, kitchen/Overcooked, nav, sysadmin, xtraffic, road). Their catalogs live in metis-catalog.
  • 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.0

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.0
File Size Uploaded Provenance
metispy-0.1.0.tar.gz 357.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 706.5 kB

Release files / metispy-0.1.0.tar.gz

Download URL metispy-0.1.0.tar.gz
Size 357.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f3ea34197cecaa756b2e37cfad6aa85f8d6187734036cebcd0ec240ce083a6e7
BLAKE2b-256 checksum
How to use checksums
c1be23c9bf182b9882bea5ce5e761c2af2031db48eabf8bac427754da589ecda
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.0-py3-none-any.whl

Download URL metispy-0.1.0-py3-none-any.whl
Size 349.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e83d843c5e30af1ede04cffb52df4d55d8a125a8684216346275275a7ba3de54
BLAKE2b-256 checksum
How to use checksums
d2a427fd271da2681aed5d6b3d66ce6f8814e5c51d2a64abf6ea888ec3b49bc7
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.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

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

Select from 2 files

Attestation for metispy-0.1.0.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