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

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.3
File Size Uploaded Provenance Actions
metispy-0.1.3.tar.gz 461.9 kB With provenance Details for metispy-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 904.9 kB

Release files / metispy-0.1.3.tar.gz

Download URL metispy-0.1.3.tar.gz
Size 461.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ca3270ebaf8688e20c3397bc2e3305e32ce9eb04e20d7e0db6a2cdcdf60383ea
BLAKE2b-256 checksum
How to use checksums
c6a488b70c87d7f75f504ce8b4d4540b6024bcc6ee4c64b8b9801746fa2a668f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Release files / metispy-0.1.3-py3-none-any.whl

Download URL metispy-0.1.3-py3-none-any.whl
Size 443.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0415dee9e7afda9d697c4ffeb6d44eddd826abc6c5746ad138b621f70964099
BLAKE2b-256 checksum
How to use checksums
b91cd331befbad235682f2be1d75099cbfc5182c62ba4bf4fa40c27861be5cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Security for metispy 0.1.3

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for metispy-0.1.3.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 26, 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