Skip to main content

Typed DSL for Compositional Game Theory — define, verify, and report on open game patterns

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

open-games-spec

Typed DSL for compositional game theory, built on gds-framework.

What is this?

open-games-spec extends the GDS framework with game-theoretic vocabulary — open games, strategic interactions, and compositional game patterns. It provides:

  • 6 atomic game types — Decision, CovariantFunction, ContravariantFunction, FeedbackGame, CorecursiveGame, IdentityGame
  • Pattern composition — Sequential, Parallel, Feedback, and Corecursive composition operators
  • IR compilation — Flatten game patterns into JSON-serializable intermediate representation
  • 13 verification checks — Type matching (T-001..T-006) and structural validation (S-001..S-007)
  • 7 Markdown report templates — System overview, verification summary, state machine, interface contracts, and more
  • 6 Mermaid diagram generators — Structural, hierarchy, flow topology, architecture views
  • CLIogs compile, ogs verify, ogs report

Architecture

gds-framework (pip install gds-framework)
│
│  Domain-neutral composition algebra, typed spaces,
│  state model, verification engine, flat IR compiler.
│
└── open-games-spec (pip install open-games-spec)
    │
    │  Game-theoretic DSL: OpenGame types, Pattern composition,
    │  compile_to_ir(), domain verification, reports, visualization.
    │
    └── Your application
        │
        │  Concrete pattern definitions, analysis notebooks,
        │  verification runners.

Quick start

pip install open-games-spec
from ogs.dsl.games import Decision, CovariantFunction
from ogs.dsl.composition import Flow
from ogs.dsl.pattern import Pattern
from ogs.dsl.compile import compile_to_ir
from ogs import verify

# Define games
sensor = CovariantFunction(name="Sensor", x="observation", y="signal")
agent = Decision(name="Agent", x="signal", y="action", r="reward", s="experience")

# Compose into a pattern
pattern = Pattern(
    name="Simple Decision",
    games=[sensor, agent],
    flows=[Flow(source="Sensor", target="Agent", label="signal")],
)

# Compile and verify
ir_doc = compile_to_ir(pattern)
report = verify(ir_doc)
print(f"{report.checks_passed}/{report.checks_total} checks passed")

License

Apache-2.0

Credits & Attribution

Development & Implementation

Theoretical Foundation

This codebase is a direct implementation of the research and mathematical frameworks developed by:

Architectural Inspiration

The design patterns and structural approach of this library are heavily influenced by the prior work of Sean McOwen (@SeanMcOwen), specifically:

  • MSML: For system specification logic.
  • bdp-lib: For block-data processing architecture.

Contributors

  • Peter Hacker (@phacker3) — Code auditing and review (BlockScience).

Intellectual Lineage

This project exists within the broader ecosystem of:

  • cadCAD: For foundational philosophy in Complex Adaptive Dynamics.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_games_spec-0.1.0.tar.gz (60.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_games_spec-0.1.0-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

Details for the file open_games_spec-0.1.0.tar.gz.

File metadata

  • Download URL: open_games_spec-0.1.0.tar.gz
  • Upload date:
  • Size: 60.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for open_games_spec-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b5d588c2abdbdc5b9efe43832472ccd3f10140b8967d86e3e4f740606c628a02
MD5 b315b36ed4f1ac1bcd1ed918734a41f4
BLAKE2b-256 757f9247011d925412c9b43222f2aecf55a2d045885f5a748e220677c21185e0

See more details on using hashes here.

File details

Details for the file open_games_spec-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: open_games_spec-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 59.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for open_games_spec-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c53501ad171a18523bf8761263002a36a27653ce8d3b4b94d34f6719a149a15
MD5 f1bb31695561a16b607971a7dbb3c27e
BLAKE2b-256 0cf4cdc9fded87c394edea88e5e68f4bc7eaace7e150b4bafb4e00ecebeced4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page