fish-rules
The rules engine for Fish, a six-player team card game of asking, deduction and calls, as specified by the Canonical Ruleset v1.1. It is the foundation of the Fish benchmark.
- Deterministic. A game is its seed and its actions: replaying them gives the same states and records on any machine, with a frozen, documented random-number scheme.
- Immutable.
apply(state, action)returns a new state and the records the action produced. - One projection.
fish_rules.view.projectdecides what each seat may see, and is the only way information reaches a player. - Standard library only, typed, and tested to 100% branch coverage.
from fish_rules.engine import apply, legal_actions
from fish_rules.state import new_game
state = new_game(42)
action = legal_actions(state, state.current)[0]
state, records = apply(state, action)
Layer 1 (fish_rules.deduce) works out, exactly, which seats could hold each card given
everything one seat has seen and remembers. This plays part of a random game and prints the
cards seat 3 can place for certain:
from fish_rules.cards import card_name
from fish_rules.deduce.tracker import Tracker
from fish_rules.engine import replay
from fish_rules.playout import random_game
from fish_rules.view import latest_event, project
tracker = Tracker(3) # what seat 3 can work out, remembering everything it is shown
last = None
for state, records in replay(42, random_game(42, 7)[:150]):
last = latest_event(records, last)
deduction = tracker.observe(project(state, 3, last))
for card in range(54):
seat = deduction.known(card)
if seat is not None and seat != 3:
print(card_name(card), "is with seat", seat)
Install with pip install fish-rules (Python 3.14 or later). For a multi-agent environment
built on it, see fish-env; for baseline agents,
fish-agents. Documentation, including the
frozen encodings, is in the repository.
Licensed under Apache-2.0.
Metadata
Release files for fish-rules 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fish_rules-0.2.0.tar.gz | 52.3 kB | Without provenance | Details for fish_rules-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fish_rules-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for fish_rules-0.2.0-py3-none-any.whl |
Total release size: 114.5 kB
Release files / fish_rules-0.2.0.tar.gz
| Download URL | fish_rules-0.2.0.tar.gz |
|---|---|
| Size | 52.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d639692e3e91d05c8afb90622f7469fa39405f503ac0e9e541aae302902d89ba
|
|
BLAKE2b-256 checksum How to use checksums |
6a580403d6b3ca385f0522a1120874094a325c7939a092348411449daa50b6bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fish_rules-0.2.0-py3-none-any.whl
| Download URL | fish_rules-0.2.0-py3-none-any.whl |
|---|---|
| Size | 62.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7887dab29737058b1078eefe772d0409fb2fb6ef6f4b345abc675272373425e
|
|
BLAKE2b-256 checksum How to use checksums |
d37c7ebc249d10b56c3a937e66c04dd7dfdc407c102001213b625811c4760e0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for fish-rules 0.2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.