Metadata-Version: 2.5
Name: generalized-notation-notation
Version: 5.4.1
Summary: A text-based language for standardizing Active Inference generative models
Project-URL: Homepage, https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation
Project-URL: Documentation, https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/tree/main/docs
Project-URL: Repository, https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation.git
Project-URL: Issues, https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/issues
Author-email: Active Inference Institute <contact@activeinference.org>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: LICENSES/Apache-2.0.txt
License-File: LICENSES/CC-BY-4.0.txt
License-File: LICENSES/MIT.txt
License-File: LICENSES/OFL-1.1.txt
License-File: NOTICE
License-File: REUSE.toml
Keywords: active-inference,cognitive-modeling,gnn,scientific-computing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <3.15,>=3.12
Requires-Dist: aiohttp>=3.14.4
Requires-Dist: defusedxml>=0.7.1
Requires-Dist: discopy>=1.1.0
Requires-Dist: equinox>=0.11.0
Requires-Dist: flax>=0.12.9
Requires-Dist: h5py>=3.8.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: inferactively-pymdp>=1.0.5
Requires-Dist: jax[cpu]<0.13,>=0.7.0
Requires-Dist: jaxlib<0.13,>=0.7.0
Requires-Dist: jsonschema>=4.18.0
Requires-Dist: matplotlib>=3.9.0
Requires-Dist: msgpack>=1.2.1
Requires-Dist: multimethod>=1.11
Requires-Dist: networkx>=3.6.1
Requires-Dist: numpy>=2.0
Requires-Dist: numpyro>=0.22
Requires-Dist: ollama>=0.1.0
Requires-Dist: openai>=2.0
Requires-Dist: optax>=0.1.0
Requires-Dist: packaging>=24.0
Requires-Dist: pandas>=2.0
Requires-Dist: pillow>=13.0.0
Requires-Dist: plotly>=6.7.0
Requires-Dist: psutil>=5.8.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pygments>=2.20.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Requires-Dist: seaborn>=0.12.0
Provides-Extra: all
Requires-Dist: bleach>=6.4.0; extra == 'all'
Requires-Dist: bnlearn>=0.14.0; extra == 'all'
Requires-Dist: cmdstanpy>=1.2; extra == 'all'
Requires-Dist: cpomdp==0.5.1; extra == 'all'
Requires-Dist: cython>=3.0.0; extra == 'all'
Requires-Dist: dask>=2023.0.0; extra == 'all'
Requires-Dist: distributed>=2023.0.0; extra == 'all'
Requires-Dist: fastapi>=0.100.0; extra == 'all'
Requires-Dist: gradio>=6.32.0; extra == 'all'
Requires-Dist: graphviz>=0.20.0; extra == 'all'
Requires-Dist: h3<5,>=4.5.0; extra == 'all'
Requires-Dist: jupyter-server>=2.20.0; extra == 'all'
Requires-Dist: jupyterlab>=4.6.4; extra == 'all'
Requires-Dist: librosa>=0.10.0; extra == 'all'
Requires-Dist: lsprotocol>=2023.0.0; extra == 'all'
Requires-Dist: ngclearn>=3.2.2; extra == 'all'
Requires-Dist: ngcsimlib>=3.1.1; extra == 'all'
Requires-Dist: numba>=0.57.0; extra == 'all'
Requires-Dist: pedalboard>=0.7.0; extra == 'all'
Requires-Dist: pygls>=1.3.1; extra == 'all'
Requires-Dist: ray>=2.0.0; extra == 'all'
Requires-Dist: scikit-learn>=1.0.0; extra == 'all'
Requires-Dist: scipy>=1.17.1; extra == 'all'
Requires-Dist: setuptools>=83.0.0; extra == 'all'
Requires-Dist: soundfile>=0.12.0; extra == 'all'
Requires-Dist: starlette>=1.0.1; extra == 'all'
Requires-Dist: sympy>=1.12.0; extra == 'all'
Requires-Dist: thrml==0.1.4; extra == 'all'
Requires-Dist: torch>=2.13.0; extra == 'all'
Requires-Dist: torchlens<4,>=3.0.2; extra == 'all'
Requires-Dist: transformers>=5.10.0; extra == 'all'
Requires-Dist: uvicorn[standard]>=0.23.0; extra == 'all'
Requires-Dist: watchdog>=4.0; extra == 'all'
Requires-Dist: websockets>=16.0; extra == 'all'
Provides-Extra: api
Requires-Dist: fastapi>=0.100.0; extra == 'api'
Requires-Dist: starlette>=1.0.1; extra == 'api'
Requires-Dist: uvicorn[standard]>=0.23.0; extra == 'api'
Provides-Extra: audio
Requires-Dist: librosa>=0.10.0; extra == 'audio'
Requires-Dist: pedalboard>=0.7.0; extra == 'audio'
Requires-Dist: soundfile>=0.12.0; extra == 'audio'
Provides-Extra: bnlearn
Requires-Dist: bnlearn>=0.14.0; extra == 'bnlearn'
Provides-Extra: cpomdp
Requires-Dist: cpomdp==0.5.1; extra == 'cpomdp'
Provides-Extra: dev
Requires-Dist: cmdstanpy>=1.2; extra == 'dev'
Provides-Extra: geo-infer
Requires-Dist: h3<5,>=4.5.0; extra == 'geo-infer'
Provides-Extra: graphs
Requires-Dist: graphviz>=0.20.0; extra == 'graphs'
Provides-Extra: gui
Requires-Dist: gradio>=6.32.0; extra == 'gui'
Requires-Dist: watchdog>=4.0; extra == 'gui'
Requires-Dist: websockets>=16.0; extra == 'gui'
Provides-Extra: lsp
Requires-Dist: lsprotocol>=2023.0.0; extra == 'lsp'
Requires-Dist: pygls>=1.3.1; extra == 'lsp'
Provides-Extra: ml-ai
Requires-Dist: scikit-learn>=1.0.0; extra == 'ml-ai'
Requires-Dist: scipy>=1.17.1; extra == 'ml-ai'
Requires-Dist: transformers>=5.10.0; extra == 'ml-ai'
Provides-Extra: ngclearn
Requires-Dist: ngclearn>=3.2.2; extra == 'ngclearn'
Requires-Dist: ngcsimlib>=3.1.1; extra == 'ngclearn'
Provides-Extra: research
Requires-Dist: bleach>=6.4.0; extra == 'research'
Requires-Dist: cython>=3.0.0; extra == 'research'
Requires-Dist: jupyter-server>=2.20.0; extra == 'research'
Requires-Dist: jupyterlab>=4.6.4; extra == 'research'
Requires-Dist: numba>=0.57.0; extra == 'research'
Requires-Dist: setuptools>=83.0.0; extra == 'research'
Requires-Dist: sympy>=1.12.0; extra == 'research'
Provides-Extra: scaling
Requires-Dist: dask>=2023.0.0; extra == 'scaling'
Requires-Dist: distributed>=2023.0.0; extra == 'scaling'
Requires-Dist: ray>=2.0.0; extra == 'scaling'
Provides-Extra: stan
Requires-Dist: cmdstanpy>=1.2; extra == 'stan'
Provides-Extra: thrml
Requires-Dist: thrml==0.1.4; extra == 'thrml'
Provides-Extra: torch
Requires-Dist: torch>=2.13.0; extra == 'torch'
Provides-Extra: torchlens
Requires-Dist: torch>=2.13.0; extra == 'torchlens'
Requires-Dist: torchlens<4,>=3.0.2; extra == 'torchlens'
Description-Content-Type: text/markdown

# Generalized Notation Notation (GNN)

**Describe an Active Inference generative model in Markdown, validate it, render
framework-specific code, and inspect the evidence from its execution.**

[![GitHub release](https://img.shields.io/github/v/release/ActiveInferenceInstitute/Generalized_Notation_Notation)](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/releases/latest)
[![CI](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/actions/workflows/ci.yml)
[![Python 3.12–3.14](https://img.shields.io/badge/python-3.12%E2%80%933.14-blue.svg)](pyproject.toml)
[![Code: Apache-2.0](https://img.shields.io/badge/Code-Apache--2.0-blue.svg)](LICENSE)
[![Spec and docs: CC BY 4.0](https://img.shields.io/badge/Spec%20%26%20docs-CC%20BY%204.0-lightgrey.svg)](LICENSES/CC-BY-4.0.txt)
[![Project DOI](https://img.shields.io/badge/Project%20DOI-10.5281%2Fzenodo.7803313-blue.svg)](https://doi.org/10.5281/zenodo.7803313)
[![Software archive](https://img.shields.io/badge/Software%20archive-10.5281%2Fzenodo.24701025-blue.svg)](https://doi.org/10.5281/zenodo.24701025)

[Quick start](#quick-start) · [Models and backends](#model-kinds-and-framework-support) ·
[Documentation](#documentation) · [Examples](#examples) ·
[Contributing](#contributing) · [Zenodo archives](#zenodo-archives)

See the [current source release](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/releases/latest)
for its tag and available assets. Install from the tagged source using the
frozen lock. The [release artifacts and citation](#release-artifacts-and-citation)
section describes distribution and archival records.

## Overview

GNN is a human-readable, machine-parsable notation for
[Active Inference](https://activeinference.org/) generative models. This repository
provides the language, curated model sources, an installed Python package and a
25-step workflow for validation, visualization, simulation, analysis and publication.
Shared model specifications make assumptions accessible, structure checkable and
evidence traceable as models move between domains.

[![GNN: categorical and continuous model specifications move through Specify, Validate, Render, Execute and Inspect, with source identity, configuration and traceable artifacts connecting the workflow.](.github/gnn-overview-2026-10-21.png)](#project-architecture)

*Five conceptual stages in the 25-step workflow. Backend admission depends on
the model contract; the illustration contains no measured results.*

### Core Design Principles

- **Readable models:** state spaces, connections, parameters, equations, time and
  ontology annotations remain inspectable in source.
- **Explicit admission:** model kind and backend contracts determine what can run.
  Unsupported models, missing dependencies, warnings and failures retain distinct outcomes.
- **Reproducible evidence:** frozen selection, source hashes, resolved configuration,
  current-run indexes and bounded execution bind artifacts to one invocation.
- **Comparable results:** numerical comparisons require compatible source identities,
  inference semantics, inputs and precision. Native Gaussian uncertainty comes from covariance.

## Key Files

| Goal | Start here |
| --- | --- |
| Run your first model | [Quick start](#quick-start), [full quickstart](docs/quickstart.md), [setup guide](SETUP_GUIDE.md) |
| Write GNN | [Language hub](docs/gnn/language/README.md), [syntax reference](docs/gnn/reference/gnn_syntax.md) |
| Choose an example | [Exemplar index](input/gnn_files/INDEX.md), [model-family manifest](input/model_family_manifest.json) |
| Find a file or a canonical home | [Repository index](INDEX.md), [documentation index](docs/INDEX.md) |
| Verify a checkout | [run.sh](run.sh) — `./run.sh gates` (`just gates` runs the same arm) |
| Understand or extend the implementation | [Architecture](ARCHITECTURE.md), [module registry](AGENTS.md), [system documentation](DOCS.md) |
| Change automation | [GitHub guide](.github/README.md), [workflow index](.github/workflows/README.md) |
| Contribute or get help | [Contributing](CONTRIBUTING.md), [support](SUPPORT.md), [security](SECURITY.md), [roadmap](TO-DO.md) |

### Directory Overview

```text
Generalized_Notation_Notation/
├── src/gnn/                 # Installed package
│   ├── main.py             # Main pipeline orchestrator
│   ├── 0_template.py … 24_intelligent_analysis.py
│   └── render/, execute/, pipeline/, cli/, …
├── tests/                   # Behavior, contract and integration tests
├── input/gnn_files/          # Curated model sources
├── input/config.yaml        # Pipeline configuration
├── docs/                    # Language, backend and operator guides
├── scripts/                 # Audits, acceptance and publication tools
├── manuscript/              # Authored manuscript sources
├── output/                  # Tracked publication evidence and provenance
├── .github/                 # Automation and GitHub-facing documentation
└── pyproject.toml, pytest.ini, uv.lock, uv.toml
```

## Motivation and Goals

Active Inference models often spread assumptions across prose, equations, diagrams
and code. GNN keeps the specification in one inspectable text format and provides
validation, framework translation and reporting around it. A shared specification
helps researchers communicate and reproduce models; backend-specific admission
and evidence define the limits of each translation.

## Key Features

- Categorical POMDP/HMM and linear-Gaussian models, with explicit contracts for
  hierarchy, learning, precision and multi-agent compositions.
- Semantic parse/serialize preservation, shape/probability/covariance validation,
  exports, dependency graphs, ontology annotations and visualizations.
- Native backend execution, source-bound comparisons, reports and offline websites.
- CLI, REST, MCP, LSP and GUI interfaces; optional LLM, audio and ML integrations.
- Durable run manifests, reproduction checks, resumable acceptance sessions and
  auditable container plans. See [durable runs](docs/development/durable-runs.md).

### GNN Syntax Preview

Start from a [complete two-state model](input/gnn_files/discrete/two_state_bistable.md)
or a [template](docs/templates/README.md). A model declares `GNNSection`,
`GNNVersionAndFlags`, `ModelName`, `StateSpaceBlock` and `Connections`;
parameters and other sections provide the inputs required by downstream contracts.
The [syntax reference](docs/gnn/reference/gnn_syntax.md) owns the full format.

## Project Architecture

Numbered scripts are thin orchestrators: they parse arguments, configure logging
and output paths, delegate to the owning module, and return standard exit codes.
Domain logic lives under `src/gnn/`; public Python imports use `gnn.*`.

```mermaid
flowchart LR
  S["GNN source + configuration"] --> I["Frozen selection + identity"]
  I --> V["Parse, type-check, validate"]
  V --> R["11 · Render admitted code"]
  R --> E["12 · Execute native scripts"]
  E --> A["16 · Analyze compatible results"]
  A --> P["Reports, website, receipts"]
  V --> D["Exports, graphs, ontology"]
```

This is a conceptual workflow. [AGENTS.md](AGENTS.md) documents actual artifact
dependencies, and the [step registry](src/gnn/pipeline/step_registry.py) owns
orchestration prerequisites. Read the [v4 migration guide](docs/development/run_ownership_migration.md)
when integrating run artifacts or upgrading an earlier consumer.

### Model Kinds and Framework Support

The [renderer registry](src/gnn/render/framework_registry.py),
[executor specifications](src/gnn/execute/executor_specs.py) and
[pipeline execution discovery](src/gnn/execute/detection.py) own backend inventories
and selection. Rendering availability, model admission, installed native dependencies
and numerical acceptance are separate checks.

| Backend | Admitted scope and reference |
| --- | --- |
| [PyMDP](docs/gnn/implementations/pymdp.md), [ActiveInference.jl](docs/gnn/implementations/activeinference_jl.md) | Categorical inference and action selection under each adapter's contract |
| [JAX](docs/gnn/implementations/jax.md) | Categorical and linear-Gaussian models, with explicit scientific/composed contracts |
| [RxInfer.jl](docs/gnn/implementations/rxinfer.md) | Native Julia message passing for admitted categorical and Gaussian contracts |
| [PyTorch](docs/gnn/implementations/pytorch.md), [NumPyro](docs/gnn/implementations/numpyro.md), [Stan](docs/gnn/implementations/stan.md) | Framework-specific categorical and linear-Gaussian paths; Stan requires CmdStan |
| [DisCoPy](docs/gnn/implementations/discopy.md), [bnlearn](docs/bnlearn/README.md) | Categorical diagrams and Bayesian-network workflows |
| [ngc-learn](src/gnn/render/ngclearn/README.md) | Continuous linear-Gaussian/predictive-coding contract |
| [cpomdp](docs/gnn/implementations/cpomdp.md) | Explicit experimental selection; continuous filtering and resource-admitted finite policy enumeration |
| [THRML](docs/gnn/implementations/thrml.md) | Explicit experimental selection; strictly positive finite categorical Gibbs smoothing under fixed actions |

Composition restrictions remain backend-specific. THRML does not admit structural
zeros, coupled agents, continuous models or action search; its sample witnesses
do not establish convergence, exact inference or hardware operation. DisCoPy's
experimental Matrix route and Python 3.14 GUI callbacks remain unsupported.

`--frameworks all` selects the maintained default preset; experimental backends
require explicit selection. An `unsupported` render is not executed. A missing
optional runtime produces an unavailable/skipped result. Consult current-run
summaries before claiming that a model ran successfully.

## Processing Pipeline

The pipeline has 25 steps, numbered 0–24. See the
[step index](src/gnn/STEP_INDEX.md) for individual scripts and
[pipeline guide](docs/pipeline/README.md) for configuration and selection.

| Steps | Responsibilities |
| --- | --- |
| 0–2 | Template, environment setup and tests |
| 3–7 | Parsing, registry, type checking, validation and export |
| 8–10 | Visualization, advanced visualization and ontology |
| 11–12 | Code generation and native execution |
| 13–19 | LLM, ML, audio, analysis, integration, security and research |
| 20–24 | Website, MCP, GUI, reports and intelligent analysis |

### Running the Pipeline

After the frozen setup below, use `gnn run` or the main script:

```bash
uv run --frozen --no-sync python src/gnn/main.py --help
uv run --frozen --no-sync gnn run --help
```

`--target-dir` takes a directory; `gnn validate`, `gnn extract` and `gnn render`
take a model file. Configuration loads from `input/config.yaml`. Use dedicated
output directories and inspect `00_pipeline_summary/pipeline_execution_summary.json`.
The main-script parser also exposes `--llm-tasks` (comma-separated task names)
and `--pipeline-summary-file` (summary path); consult its help for parser defaults.
The finalization step renders the self-contained performance dashboard at
`<output-dir>/00_pipeline_summary/performance_dashboard.html` from
`src/gnn/pipeline/performance_dashboard.template.html`.
The tracked `output/` tree retains publication evidence from its recorded source;
directory presence cannot establish completion of a new run.

### CPU workers for multiple files

```bash
uv run --frozen --no-sync gnn run --only-steps 3 5 --file-workers 4
uv run --frozen --no-sync gnn run --parallel --step-workers 2 --file-workers 4
```

`--file-workers` limits CPU process workers within parsing/serialization (Step 3)
and type checking (Step 5). Each worker handles one file at a time; the parent
publishes outputs in selection order. The default is one worker. `--step-workers`
limits independent pipeline steps under `--parallel`; existing memory throttling
and the eight-step ceiling still apply. Step 12 retains its separate
`--execution-workers` option on the main-script interface. These are concurrency
limits, not CPU affinity or an operating-system CPU quota. More workers can be
slower for small files because starting processes costs time.
The file limit applies separately to each running step; concurrent steps can
each create their own pool, so the two limits are not a shared global CPU budget.

The same limits are available as `file_workers` and `step_workers` in the Python
pipeline API and the `pipeline` section of `input/config.yaml`; explicit CLI
values take precedence. Summaries record requested limits, available logical
CPUs and actual step-tier widths. Step 3/5 results record effective file-worker
limits and the PIDs that returned results. For the isolated Python 3.15
lightweight interface, use `just backend-json --workers 4 --executor process`.

## Tools and Utilities

Use the installed `gnn` entry point to inspect the available commands:

```bash
uv run --frozen --no-sync gnn --help
uv run --frozen --no-sync gnn preflight
uv run --frozen --no-sync gnn health
uv run --frozen --no-sync gnn templates list
```

| Interface | Guide |
| --- | --- |
| CLI and headless extraction | [CLI](src/gnn/cli/README.md), [extractor](src/gnn/extract/README.md) |
| REST API | [API](docs/api/README.md) |
| MCP tools and transports | [MCP](docs/mcp/README.md) |
| GUI and model editors | [GUI](src/gnn/gui/README.md) |
| LSP/editor integration | [LSP](src/gnn/lsp/README.md) |
| Complexity bounds and benchmarks | [Complexity estimator](src/gnn/type_checker/README.md) |
| Local LLM provisioning and corpus runs | [Mac local-LLM guide](docs/llm/README.md) |

`gnn serve --surface website` serves generated output; `--root` selects its
website output root and `--live-reload` injects the HTML reload poller. API
surfaces use `--surface runs`, `jobs` or `both`; see the CLI guide above.

LLM analysis is optional and advisory. The portable Ollama default remains
`smollm2:135m-instruct-q4_K_S`; use `OLLAMA_MODEL` or configuration for an explicit
profile. Runtime completion does not establish scientific answer quality.

## Quick Start

Install [uv](https://docs.astral.sh/uv/getting-started/installation/) **0.13.6**.
Commands below run from the repository root and reuse the frozen environment.

### Direct Installation

Use the version tag in the [release record](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/releases). This example selects `v5.4.0`.

```bash
git clone https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation.git
cd Generalized_Notation_Notation
git checkout v5.4.0
uv sync --frozen --python 3.14
uv run --frozen --no-sync gnn --help
```

For development, stay on `main` instead of checking out the release tag and install the tools with
`uv sync --frozen --extra dev --python 3.14`. Add only the extras required by your
backend; see [SETUP_GUIDE.md](SETUP_GUIDE.md) for Julia, Stan, GUI and other profiles.
The tagged source is available through GitHub. The [Zenodo archive table](#zenodo-archives)
identifies the separate software versions archived there.

Validate and extract one committed model:

```bash
uv run --frozen --no-sync gnn validate input/gnn_files/discrete/two_state_bistable.md --strict
uv run --frozen --no-sync gnn extract input/gnn_files/discrete/two_state_bistable.md --compact
```

Run a small local workflow without native inference or LLM provisioning:

```bash
uv run --frozen --no-sync gnn run \
  --target-dir input/gnn_files/basics \
  --output-dir output/quickstart \
  --only-steps 3 5 6 7 8 \
  --skip-steps 0 1 2
```

Inspect the summary and generated exports/graphs under `output/quickstart`.
For native simulation, follow the [full quickstart](docs/quickstart.md), select an
admitted backend, and provision its runtime before execution.

### Runtime defaults and required profiles

GNN-owned environments use uv **0.13.6**: [uv.toml](uv.toml) sets
`required-version = ">=0.13.6,<0.14"`, the GNN-owned `astral-sh/setup-uv` steps
pin `version: "0.13.6"`, and the [Dockerfile](Dockerfile) pins
`ARG UV_VERSION=0.13.6`. The [package metadata](pyproject.toml)
supports CPython 3.12 through 3.14, and the frozen scientific profile defaults to
the latest 3.14 patch. Python 3.15 qualification remains outside the current
profile. The macOS probe reached h5py's source build and required a native HDF5
installation.

The scientific stack admits JAX 0.12. Every supported Python resolves one
split: JAX 0.12.0.1, PyMDP 1.0.5 and Flax 0.12.12. PyMDP 1.0.5 carries no
JAX upper bound, so its requirement needs no split. ActiveInference.jl retains its
Distributions ceiling because DistributionsAD's extension fails with the newer
`@check_args` API; its committed Project documents that exception. RxInfer
resolves 6.1.0 on Julia 1.13.2. The separate FEP companion still requires its
own exact uv 0.13.7. Lean execution selects the FEP_Formal companion in
[the reviewed pair pin](.github/fep-lean-pair.json). The companion's declared
project identity selects its CLI (`fep-formal` for the canonical project,
`fep_lean` for pre-rename checkouts). These explicit compatibility profiles
take precedence over unqualified upgrades.

Pillow **13.0.0** is the minimum image decoder after the October 2026
advisories. The `gui` and `all` extras require Gradio **6.32.0** or newer,
whose metadata admits Pillow 13 using the normal resolver. Use
`uv sync --frozen --extra gui` for the locked GUI profile. The installed
workflow exercises ordinary wheel and sdist installation, GUI imports and image
decoding. Historical benchmarks retain the versions they measured.

To remove the Python exception, provision/review native HDF5 and remaining build
prerequisites, qualify the exact default dependency profile on 3.15, and
review any producer-range change through the documented paired re-pin ritual.
Then run the selected source/native gates before changing the default pin.
Python 3.12/3.13 tests remain compatibility lanes. The exact native coverage, paired-revision, manuscript,
GridWorld and all-extras/GUI profiles retain their declared runtimes and evidence
contracts. This bounded default-profile check does not establish all-extras,
GUI, Docker, hosted, paired, or scientific publication acceptance.
Explicit `UV_PYTHON` selects a named compatibility/profile runtime.

For headless lightweight processing and source-bound Python 3.15 measurements,
use `just backend-json` and `just profile-backend`. These isolated standard-library
commands preserve the frozen scientific environment. See the
[profiling guide](docs/performance/python315_backend.md) for exact scope and controls.

### Need Help?

Read [troubleshooting](docs/troubleshooting/README.md), run `gnn preflight` and
`gnn health`, and inspect the current run summary. Report the exact revision,
command, environment and failure through [SUPPORT.md](SUPPORT.md).

## Documentation

| Topic | Guide |
| --- | --- |
| Documentation hub and learning paths | [docs/README.md](docs/README.md), [learning paths](docs/learning_paths.md) |
| Language and authoring | [Syntax](docs/gnn/reference/gnn_syntax.md), [tutorials](docs/gnn/tutorials/README.md) |
| Framework integration | [Integration guide](docs/gnn/integration/framework_integration_guide.md), [implementations](docs/gnn/implementations/README.md) |
| Configuration and execution | [Configuration](docs/configuration/README.md), [pipeline](docs/pipeline/README.md), [availability](docs/execution/FRAMEWORK_AVAILABILITY.md) |
| Scientific evidence and boundaries | [Validation evidence](docs/pipeline/validation_evidence_guide.md), [filesystem guarantees](docs/security/filesystem_boundaries.md) |
| Releases and archival | [Release procedure](docs/releases/README.md), [exact-version archival](docs/releases/exact_version_archival.md) |
| Who uses GNN | [Downstream registry](docs/downstream/README.md) |

## Examples

| Goal | Model sources |
| --- | --- |
| Learn the notation | [Basics](input/gnn_files/basics/) |
| Categorical inference and policies | [Two-state bistable model](input/gnn_files/discrete/two_state_bistable.md), [epistemic T-maze](input/gnn_files/discrete/tmaze_epistemic.md) |
| Compare native frameworks | [GridWorld](input/gnn_files/pomdp_gridworld/README.md) |
| Continuous dynamics and control | [Navigation](input/gnn_files/continuous/continuous_navigation.md), [damped oscillator](input/gnn_files/continuous/damped_oscillator_bias.md) |
| Independent Gaussian agents | [Independent-agent model](input/gnn_files/continuous/independent_gaussian_agents.md) |
| Hierarchy, learning, precision and composition | [Full exemplar index](input/gnn_files/INDEX.md), [family manifest](input/model_family_manifest.json) |
| Experimental finite smoothing | [THRML examples](input/gnn_files/thrml/README.md) |
| Cognitive modeling | [Cognitive phenomena](docs/cognitive_phenomena/README.md) |

## Repository Health

Current CI and exact-source receipts establish operational status. The
[workflow index](.github/workflows/README.md) owns triggers, Python matrices,
native selections, security checks and coverage requirements.

The canonical local gate is `./run.sh gates` (`just gates` runs the same arm):
`ruff format --check`, `ruff check`, `mypy`, the parallel `pytest` selection
under the coverage floor, the documentation, terminology and capability-contract
audits, and the v3 orchestration acceptance gate. It mirrors the `quality` job in
[`ci.yml`](.github/workflows/ci.yml) plus the unit-suite selection and coverage
floor, so a local green gate and a green CI gate are the same evidence class.

After frozen development setup:

```bash
just release-preflight
uv run --frozen --no-sync python scripts/check_doc_contracts.py --strict
uv run --frozen --no-sync python scripts/check_repo_terminology.py --strict
uv run --frozen --no-sync python scripts/check_maintained_doc_terms.py --strict
```

Preflight catches deterministic mistakes before expensive hosted qualification.
The ordinary test matrix covers Python 3.12–3.14 on every event. Core coverage is enforced
inside the gate, not reported to a service and not shown as a badge:
`[tool.coverage.report] fail_under = 60` in [pyproject.toml](pyproject.toml)
fails `./run.sh gates` below 60 %; comprehensive native coverage requires
strictly more than 80% independently on each declared interpreter. Native,
installed-platform, all-extras, manuscript and paired-custody evidence retain
their own environments and acceptance scopes. The
[release procedure](docs/releases/README.md#repeatable-release-qualification)
collects exact commit/run/attempt/job identities across all sixteen workflows.

Use [tests/README.md](tests/README.md) for test selection and
[TO-DO.md](TO-DO.md#verification-and-execution-rules) for verification obligations.

## Contributing

Start with [CONTRIBUTING.md](CONTRIBUTING.md), [AGENTS.md](AGENTS.md) and the
[roadmap](TO-DO.md). Keep changes focused, commands runnable, and evidence tied
to the source it describes. Source-bound manuscript or companion inputs require
their documented producer and re-pin procedures.

- [Issues](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/issues): reproducible bugs and scoped improvements.
- [Discussions](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/discussions): modeling questions and ideas.
- [Security policy](SECURITY.md): vulnerability reporting.
- [Code of conduct](CODE_OF_CONDUCT.md): participation standards.

## Release artifacts and citation

The [release index](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/releases) lists each accepted version and its verified distribution files.

[GNN 5.4.0](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/releases/tag/v5.4.0)
records the accepted tag and commit and links to the verified wheel, source
distribution, source manifest, importer bootstrap, manuscript PDF,
qualification record and checksums in the
[immutable distribution bundle](https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/tree/e0ea668cb11c2d941675c24f2c91a91368258901).
The [downstream registry](docs/downstream/README.md) records each member's pin
and conformance evidence.
[The version map](docs/VERSION_MAP.md) records the history of earlier
releases. The
[E4 contract](docs/development/remaining_roadmap_contracts.md#e4-foundation-source-bound-numerical-witness-v1)
states the exact finite/Gaussian scope and its limits; the
[current delivery priorities](TO-DO.md#current-delivery-priorities) owns remaining work.

Main can contain later documentation changes; released artifacts retain their
original tag and source identities.

### Zenodo archives

| Record | DOI | Scope |
| --- | --- | --- |
| Project concept | [10.5281/zenodo.7803313](https://doi.org/10.5281/zenodo.7803313) | Identifies the version family and resolves to the latest published record |
| GNN 5.4.0 software source | [10.5281/zenodo.24701025](https://doi.org/10.5281/zenodo.24701025) | Current source record for `v5.4.0` (Apache-2.0 and CC BY 4.0); its [archive receipt](docs/development/zenodo_5_4_0_source_archive.json) records byte parity with the tag |
| GNN 5.0.3–5.3.0 software sources | [5.3.0](https://doi.org/10.5281/zenodo.24658628) · [5.2.1](https://doi.org/10.5281/zenodo.24639960) · [5.2.0](https://doi.org/10.5281/zenodo.24634761) · [5.1.0](https://doi.org/10.5281/zenodo.24167564) · [5.0.3](https://doi.org/10.5281/zenodo.23902909) | Records the GitHub integration created under CC BY-NC-SA 4.0; not separately verified in this repository |
| GNN 5.0.1 software source | [10.5281/zenodo.23631909](https://doi.org/10.5281/zenodo.23631909) | Published source record for `v5.0.1`, paired with its GitHub release |
| GNN 4.1.0 software source | [10.5281/zenodo.23245091](https://doi.org/10.5281/zenodo.23245091) | Historical version-specific record |
| GNN 4.0.1 software source | [10.5281/zenodo.23222085](https://doi.org/10.5281/zenodo.23222085) | Historical version-specific record |
| 2023 article | [zenodo.org/records/7803328](https://zenodo.org/records/7803328) | Historical manuscript publication, not a software version |

A specific software release needs its own version DOI and a directly verified
public archive; the concept DOI does not identify one version, and a historical
DOI is never reused as a current software DOI. GitHub release assets (the wheel,
sdist, manuscript PDF and checksums) and the Zenodo source archive are separate
acceptances. Zenodo's GitHub integration archives a published release from
[`.zenodo.json`](.zenodo.json); it rejected `v5.4.0`, whose `CITATION.cff` lists
two licenses, so that record was deposited through the Zenodo API. New versions follow the
[exact-version archival procedure](docs/releases/exact_version_archival.md),
which requires the archive owner's authorized provider access. The companion
[FEP_Formal 2.1.0 manuscript](https://doi.org/10.5281/zenodo.23607007) and
[software source archive](https://doi.org/10.5281/zenodo.23631895) retain their
own DOI identities.

For academic use, follow [CITATION.cff](CITATION.cff). The initial publication is
Smékal, J., & Friedman, D. A. (2023), *Generalized Notation Notation for Active
Inference Models*, Active Inference Journal. See
[release history](CHANGELOG.md) for historical records.

## License

Copyright 2023-2026 Daniel Ari Friedman. GNN is maintained by the
[Active Inference Institute](https://activeinference.org/) community.

- **Tooling** (source code, tests, scripts, configuration, example models and
  pipeline data): [Apache License 2.0](LICENSE). Redistributions keep the
  [NOTICE](NOTICE) file, and the license includes an express patent grant.
- **Specification and documentation** (the `docs/` tree, the top-level and
  contributor documentation, and the rendered manuscript, figures, slides and
  web pages): [Creative Commons Attribution 4.0 International](LICENSES/CC-BY-4.0.txt).
- **Third-party material** inside the repository keeps its own license. It is
  listed in [NOTICE](NOTICE), and [REUSE.toml](REUSE.toml) records the license
  of every path.

These licenses apply from GNN 5.4.0. Releases up to and including 5.3.0 were
published under CC BY-NC-SA 4.0 and remain available under those terms.
