<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc 3.13" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <meta name="author" content="Daniel Ari Friedman" />
  <meta name="description" content="A text language and modular processing pipeline for Active Inference generative models" />
  <title>GeneralizedNotationNotation: A Text Language for Active
Inference Models</title>
  <style>
    /* Default styles provided by pandoc.
    ** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
    */
    html {
      color: #1a1a1a;
      color: light-dark(#1a1a1a, #fdfdfd);
      background-color: #fdfdfd;
      background-color: light-dark(#fdfdfd, #1a1a1a);
      color-scheme: light dark;
    }
    body {
      margin: 0 auto;
      max-width: 36em;
      padding-left: 50px;
      padding-right: 50px;
      padding-top: 50px;
      padding-bottom: 50px;
      hyphens: auto;
      overflow-wrap: break-word;
      text-rendering: optimizeLegibility;
      font-kerning: normal;
    }
    @media (max-width: 600px) {
      body {
        font-size: 0.9em;
        padding: 12px;
      }
      h1 {
        font-size: 1.8em;
      }
    }
    @media print {
      html {
        color-scheme: light only;
      }
      html, body, pre, code {
        background-color: transparent;
      }
      body, a, a:visited, blockquote {
        color: black;
      }
      pre, code {
        padding: 0;
      }
      p, h2, h3 {
        orphans: 3;
        widows: 3;
      }
      h2, h3, h4 {
        page-break-after: avoid;
      }
    }
    p {
      margin: 1em 0;
    }
    a, a:visited {
      color: inherit;
    }
    img {
      max-width: 100%;
    }
    svg {
      height: auto;
      max-width: 100%;
    }
    h1, h2, h3, h4, h5, h6 {
      margin-top: 1.4em;
    }
    h5, h6 {
      font-size: 1em;
      font-style: italic;
    }
    h6 {
      font-weight: normal;
    }
    ol, ul {
      padding-left: 1.7em;
      margin-top: 1em;
    }
    li > ol, li > ul {
      margin-top: 0;
    }
    blockquote {
      margin: 1em 0 1em 1.7em;
      padding-left: 1em;
      border-left: 2px solid;
      border-color: #e6e6e6;
      border-color: light-dark(#e6e6e6, #4c4c4c);
      color: #606060;
      color: light-dark(#606060, #b6b6b6);
    }
    code {
      white-space: pre-wrap;
      font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace;
      font-size: 85%;
      margin: 0;
      hyphens: manual;
    }
    pre {
      margin: 1em 0;
      overflow: auto;
    }
    pre code {
      padding: 0;
      overflow: visible;
      overflow-wrap: normal;
    }
    .sourceCode {
     background-color: transparent;
     overflow: visible;
    }
    hr {
      border: none;
      border-top: 1px solid currentColor;
      height: 1px;
      margin: 1em 0;
    }
    table {
      margin: 1em 0;
      border-collapse: collapse;
      width: 100%;
      overflow-x: auto;
      display: block;
      font-variant-numeric: lining-nums tabular-nums;
    }
    table caption {
      margin-bottom: 0.75em;
    }
    tbody {
      margin-top: 0.5em;
      border-top: 1px solid currentColor;
      border-bottom: 1px solid currentColor;
    }
    th {
      border-top: 1px solid currentColor;
      padding: 0.25em 0.5em 0.25em 0.5em;
    }
    td {
      padding: 0.125em 0.5em 0.25em 0.5em;
    }
    header {
      margin-bottom: 4em;
      text-align: center;
    }
    #TOC li {
      list-style: none;
    }
    #TOC ul {
      padding-left: 1.3em;
    }
    #TOC > ul {
      padding-left: 0;
    }
    #TOC a:not(:hover) {
      text-decoration: none;
    }
    span.smallcaps{font-variant: small-caps;}
    div.columns{display: flex; gap: 1.5em;}
    div.column{flex: auto;}
    @media screen {
    div.columns{gap: min(4vw, 1.5em);}
    div.column{overflow-x: auto;}
    }
    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
    /* The extra [class] is a hack that increases specificity enough to
       override a similar rule in reveal.js */
    ul.task-list[class]{list-style: none;}
    ul.task-list li input[type="checkbox"] {
      font-size: inherit;
      width: 0.8em;
      margin: 0 0.8em 0.2em -1.6em;
      vertical-align: middle;
    }
    /* CSS for syntax highlighting */
    html { -webkit-text-size-adjust: 100%; }
    pre > code.sourceCode { white-space: pre; position: relative; }
    pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
    pre > code.sourceCode > span:empty { height: 1.2em; }
    .sourceCode { overflow: visible; }
    code.sourceCode > span { color: inherit; text-decoration: inherit; }
    div.sourceCode { margin: 1em 0; }
    pre.sourceCode { margin: 0; }
    @media screen {
    div.sourceCode { overflow: auto; }
    }
    @media print {
    pre > code.sourceCode { white-space: pre-wrap; }
    pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
    }
    pre.numberSource code
      { counter-reset: source-line 0; }
    pre.numberSource code > span
      { position: relative; left: -4em; counter-increment: source-line; }
    pre.numberSource code > span > a:first-child::before
      { content: counter(source-line);
        position: relative; left: -1em; text-align: right; vertical-align: baseline;
        border: none; display: inline-block;
        -webkit-touch-callout: none; -webkit-user-select: none;
        -khtml-user-select: none; -moz-user-select: none;
        -ms-user-select: none; user-select: none;
        padding: 0 4px; width: 4em;
        color: #aaaaaa;
      }
    pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
    div.sourceCode
      {   }
    @media screen {
    pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
    }
    code span.al { color: #ff0000; font-weight: bold; } /* Alert */
    code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
    code span.at { color: #7d9029; } /* Attribute */
    code span.bn { color: #40a070; } /* BaseN */
    code span.bu { color: #008000; } /* BuiltIn */
    code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
    code span.ch { color: #4070a0; } /* Char */
    code span.cn { color: #880000; } /* Constant */
    code span.co { color: #60a0b0; font-style: italic; } /* Comment */
    code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
    code span.do { color: #ba2121; font-style: italic; } /* Documentation */
    code span.dt { color: #902000; } /* DataType */
    code span.dv { color: #40a070; } /* DecVal */
    code span.er { color: #ff0000; font-weight: bold; } /* Error */
    code span.ex { } /* Extension */
    code span.fl { color: #40a070; } /* Float */
    code span.fu { color: #06287e; } /* Function */
    code span.im { color: #008000; font-weight: bold; } /* Import */
    code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
    code span.kw { color: #007020; font-weight: bold; } /* Keyword */
    code span.op { color: #666666; } /* Operator */
    code span.ot { color: #007020; } /* Other */
    code span.pp { color: #bc7a00; } /* Preprocessor */
    code span.sc { color: #4070a0; } /* SpecialChar */
    code span.ss { color: #bb6688; } /* SpecialString */
    code span.st { color: #4070a0; } /* String */
    code span.va { color: #19177c; } /* Variable */
    code span.vs { color: #4070a0; } /* VerbatimString */
    code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
    /* CSS for citations */
    div.csl-bib-body { }
    div.csl-entry {
      clear: both;
    }
    .hanging-indent div.csl-entry {
      margin-left:2em;
      text-indent:-2em;
    }
    div.csl-left-margin {
      min-width:2em;
      float:left;
    }
    div.csl-right-inline {
      margin-left:2em;
      padding-left:1em;
    }
    div.csl-indent {
      margin-left: 2em;
    }  </style>
  <script data-template-mathjax-config>
window.MathJax = window.MathJax || {};
window.MathJax.chtml = Object.assign({}, window.MathJax.chtml, {
  fontURL: "https://cdn.jsdelivr.net/npm/@mathjax/mathjax-newcm-font@4.0.0/chtml/woff2",
  dynamicPrefix: "https://cdn.jsdelivr.net/npm/@mathjax/mathjax-newcm-font@4.0.0/chtml/dynamic"
});
var templateMathOutput = window.MathJax.output || {};
window.MathJax.output = Object.assign({}, templateMathOutput, {
  displayOverflow: "linebreak",
  linebreaks: Object.assign({}, templateMathOutput.linebreaks, {
    inline: true,
    width: "100%",
    lineleading: 0.5
  })
});
window.normalizeTemplateMathJaxAria = function () {
  document.querySelectorAll("mjx-speech[aria-roledescription]").forEach(function (node) {
    var roleDescription = node.getAttribute("aria-roledescription") || "";
    if (/[-]/.test(roleDescription)) {
      node.setAttribute("aria-roledescription", "mathematical expression");
    }
  });
};
window.MathJax.startup = Object.assign({}, window.MathJax.startup, {
  ready: function () {
    var measuredWidth = document.documentElement.clientWidth;
    var reflowQueued = false;
    window.MathJax.startup.defaultReady();
    window.templateMathJaxReflowPromise = window.MathJax.startup.promise.then(
      window.normalizeTemplateMathJaxAria
    );
    function reflowDisplayMath() {
      if (reflowQueued || document.documentElement.clientWidth === measuredWidth) return;
      reflowQueued = true;
      window.templateMathJaxReflowPromise = window.templateMathJaxReflowPromise
        .catch(function () { /* A later resize may retry a failed render. */ })
        .then(async function () {
          var width = document.documentElement.clientWidth;
          try {
            // MathJax 4 MathItem.STATE.METRICS = 110. The default RERENDER
            // state retains old container metrics and cannot reflow on zoom.
            await window.MathJax.startup.document.rerenderPromise(110);
            window.normalizeTemplateMathJaxAria();
            window.templateMathJaxReflowError = null;
          } catch (error) {
            window.templateMathJaxReflowError = String(error);
            console.error("MathJax viewport reflow failed", error);
            throw error;
          } finally {
            measuredWidth = width;
            reflowQueued = false;
          }
        })
        .then(reflowDisplayMath);
      // Keep failure observable to callers without an unhandled rejection.
      window.templateMathJaxReflowPromise.catch(function () {});
    }
    window.addEventListener("resize", reflowDisplayMath);
    // Also cover a resize that happened during the initial asynchronous render.
    window.templateMathJaxReflowPromise.then(reflowDisplayMath);
  }
});
</script>
<script defer=""
  type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@4.0.0/tex-chtml.js" integrity="sha384-2BWc4dVaHADUocwKrUrK9u3iDwHxVMKXWEcoRmUkXYSFKhAsgVAYClu9ydNuo5Oz" crossorigin="anonymous"></script>

<link data-template-favicon rel="icon" href="favicon.ico">

<style>
:root {
  --brand-1: #5b6ee0;
  --web-bg: #f8f8f8;
  --web-surface: #ffffff;
  --web-text: #2c3e50;
  --web-border: #bdc3c7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-1: #7e8ce8;
    --web-bg: #0f1420;
    --web-surface: #161c2b;
    --web-text: #e6eaf2;
    --web-border: #2a3447;
  }
}
.theorem-box {
  border-left: 4px solid var(--brand-1);
  background: var(--web-surface);
  padding: 0.6em 1em;
  margin: 1.1em 0;
  border-radius: 0 4px 4px 0;
}
.theorem-box.definition { border-left-style: dashed; }
.theorem-box > p:first-child { margin-top: 0; }
.theorem-box > p:last-child { margin-bottom: 0; }
.figure-long-description {
  border: 1px solid var(--web-border);
  border-radius: 4px;
  margin-block: 0.75rem;
  padding: 0.5rem 0.75rem;
}
.figure-long-description > summary { cursor: pointer; font-weight: 700; }
.figure-long-description > p { max-width: 80ch; overflow-wrap: anywhere; }
.figure-exact-values { max-width: 80ch; overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; word-break: break-word; }
pre {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}
pre code { overflow-wrap: inherit; white-space: inherit; word-break: inherit; }
div.sourceCode { max-width: 100%; overflow: visible; }
pre.sourceCode { background: #2c3e50; color: #ecf0f1; }
pre.sourceCode code,
pre.sourceCode code span { color: inherit; }
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}
mjx-container[display="true"] { max-width: 100%; overflow: visible; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.table-scroll:focus-visible {
  outline: 3px solid var(--brand-1);
  outline-offset: 3px;
}
.table-scroll > table { margin-block: 0; display: table; min-width: 100%; width: 100%; }
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: 'Liberation Serif', 'Times New Roman', serif;
  line-height: 1.6;
  width: min(100%, 800px);
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f8f8f8;
  color: #1a1a1a;
  overflow-wrap: break-word;
  overflow-x: hidden;
  overflow-x: clip;
}

main,
nav,
section,
article,
figure,
figcaption {
  min-width: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 0.65rem 0.9rem;
  transform: translateY(-120%);
  background-color: #1a1a1a;
  color: #ffffff;
  font-family: sans-serif;
  font-weight: 700;
  text-decoration: underline;
}

.skip-link:visited {
  color: #ffffff;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

@media (max-width: 600px) {
  body {
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

  figure img {
    width: 100% !important;
  }
}

@media (max-width: 800px) {
  body {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
  }
}

h1, h2, h3, h4, h5, h6 {
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 5px;
  overflow-wrap: anywhere;
}

code {
  background-color: #ecf0f1;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Liberation Mono', 'Courier New', monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 5px;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  overflow-wrap: inherit;
  white-space: inherit;
  word-break: inherit;
}

div.sourceCode {
  max-width: 100%;
  overflow: visible;
}

pre.sourceCode {
  background: #2c3e50;
  color: #ecf0f1;
}

pre.sourceCode code,
pre.sourceCode code span {
  color: inherit;
}

pre > code.sourceCode {
  white-space: pre-wrap;
}

pre > code.sourceCode > span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.table-scroll:focus-visible {
  outline: 3px solid #1f6f8b;
  outline-offset: 3px;
}

.table-scroll > table {
  margin-block: 0;
  display: table;
  min-width: 100%;
  width: 100%;
}

figure {
  max-width: 100%;
  margin: 1.5rem 0;
}

th, td {
  border: 1px solid #bdc3c7;
  padding: 8px;
  text-align: left;
}

th {
  background-color: #1f6f8b;
  color: white;
}

/* Preserve a complete inline-code header within the table's scroll region. */
th code {
  color: inherit;
  background-color: transparent;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

img {
  max-width: 100%;
  height: auto;
  border: 1px solid #bdc3c7;
  border-radius: 5px;
  margin: 20px 0;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

a {
  color: #b91c1c;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}

a:visited {
  color: #8f1d1d;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

a:focus-visible {
  outline: 3px solid #1f6f8b;
  outline-offset: 3px;
}

.toc {
  background-color: #ecf0f1;
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 30px;
}

.toc a,
#TOC a {
  color: #b91c1c;
  display: inline-block;
  min-height: 28px;
  line-height: 1.5;
  padding-block: 2px;
}

.toc li,
#TOC li {
  margin-block: 1px;
}

.math {
  text-align: center;
  margin: 20px 0;
  font-size: 1.1em;
}

mjx-container[display="true"] {
  display: block;
  max-width: 100%;
  overflow: visible;
  padding-bottom: 0.25rem;
}

.figure {
  text-align: center;
  margin: 30px 0;
}

.figure img {
  max-width: 100%;
  height: auto;
  border: 2px solid #3498db;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* A reading column keeps prose comfortable, but dense scientific figures need
   a larger inspection surface.  The rendered image remains responsive and the
   explicit link opens its source-resolution asset without changing the PDF. */
.figure-full-size-link {
  color: inherit;
  display: block;
  max-width: 100%;
  text-align: center;
}

.figure-full-size-link img {
  cursor: zoom-in;
  margin-bottom: 0.45rem;
}

.figure-full-size-label {
  color: #1f6f8b;
  display: inline-block;
  font-family: sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.figure-full-size-link:focus-visible {
  outline: 3px solid #1f6f8b;
  outline-offset: 4px;
}

@media (min-width: 1000px) {
  /* Wide figure links stay within the viewport but extend beyond the prose
     column. Do not clip their labels at the narrower body boundary. */
  body {
    overflow-x: visible;
  }

  .figure-full-size-link {
    left: 50%;
    max-width: none;
    position: relative;
    transform: translateX(-50%);
    width: min(1080px, calc(100vw - 3rem));
  }
}

.figure-caption {
  font-style: italic;
  color: #4b5563;
  margin-top: 10px;
  text-align: center;
}

.figure-long-description,
.figure-exact-values {
  max-width: 100%;
  overflow-wrap: anywhere;
}

</style>
<script data-template-source-font-loader src="assets/source-web-fonts.js"></script>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to main content</a>
<header id="title-block-header">
<h1 class="title">GeneralizedNotationNotation: A Text Language for
Active Inference Models</h1>
<p class="subtitle">A text language and modular processing pipeline for
Active Inference generative models</p>
<p class="author">Daniel Ari Friedman</p>
</header>
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#sec:abstract" id="toc-sec:abstract"><span
class="toc-section-number">1</span> Abstract</a></li>
<li><a href="#sec:introduction" id="toc-sec:introduction"><span
class="toc-section-number">2</span> Introduction</a>
<ul>
<li><a href="#motivation" id="toc-motivation"><span
class="toc-section-number">2.1</span> Motivation</a></li>
<li><a href="#the-gnn-approach" id="toc-the-gnn-approach"><span
class="toc-section-number">2.2</span> The GNN Approach</a></li>
<li><a href="#contributions" id="toc-contributions"><span
class="toc-section-number">2.3</span> Contributions</a></li>
<li><a href="#reader-orientation" id="toc-reader-orientation"><span
class="toc-section-number">2.4</span> Reader Orientation</a></li>
</ul></li>
<li><a href="#sec:system_context" id="toc-sec:system_context"><span
class="toc-section-number">3</span> System Context</a>
<ul>
<li><a href="#the-gnn-language" id="toc-the-gnn-language"><span
class="toc-section-number">3.1</span> The GNN Language</a></li>
<li><a href="#sec:model_kinds" id="toc-sec:model_kinds"><span
class="toc-section-number">3.2</span> Model Kinds</a>
<ul>
<li><a href="#the-discrete-categorical-kind"
id="toc-the-discrete-categorical-kind"><span
class="toc-section-number">3.2.1</span> The Discrete Categorical
Kind</a></li>
<li><a href="#the-continuous-linear-gaussian-kind"
id="toc-the-continuous-linear-gaussian-kind"><span
class="toc-section-number">3.2.2</span> The Continuous Linear-Gaussian
Kind</a></li>
<li><a href="#sec:structural_variants"
id="toc-sec:structural_variants"><span
class="toc-section-number">3.2.3</span> Multi-Agent, Hierarchical, and
Structural Kinds</a></li>
<li><a href="#reading-exemplars-by-kind"
id="toc-reading-exemplars-by-kind"><span
class="toc-section-number">3.2.4</span> Reading Exemplars by
Kind</a></li>
<li><a href="#what-the-kind-classification-governs"
id="toc-what-the-kind-classification-governs"><span
class="toc-section-number">3.2.5</span> What the Kind Classification
Governs</a></li>
</ul></li>
<li><a href="#the-processing-pipeline"
id="toc-the-processing-pipeline"><span
class="toc-section-number">3.3</span> The Processing Pipeline</a></li>
<li><a href="#the-triple-play" id="toc-the-triple-play"><span
class="toc-section-number">3.4</span> The Triple Play</a></li>
</ul></li>
<li><a href="#sec:methods" id="toc-sec:methods"><span
class="toc-section-number">4</span> Methods</a>
<ul>
<li><a href="#parsing-and-multi-format-export"
id="toc-parsing-and-multi-format-export"><span
class="toc-section-number">4.1</span> Parsing and Multi-Format
Export</a></li>
<li><a href="#type-checking-and-validation"
id="toc-type-checking-and-validation"><span
class="toc-section-number">4.2</span> Type Checking and
Validation</a></li>
<li><a href="#rendering-to-multiple-backends"
id="toc-rendering-to-multiple-backends"><span
class="toc-section-number">4.3</span> Rendering to Multiple Backends</a>
<ul>
<li><a href="#rendering-by-model-kind"
id="toc-rendering-by-model-kind"><span
class="toc-section-number">4.3.1</span> Rendering by Model Kind</a></li>
</ul></li>
<li><a href="#execution" id="toc-execution"><span
class="toc-section-number">4.4</span> Execution</a>
<ul>
<li><a href="#executing-by-model-kind"
id="toc-executing-by-model-kind"><span
class="toc-section-number">4.4.1</span> Executing by Model Kind</a></li>
</ul></li>
<li><a href="#long-running-orchestration-contracts"
id="toc-long-running-orchestration-contracts"><span
class="toc-section-number">4.5</span> Long-Running Orchestration
Contracts</a></li>
<li><a href="#analysis-visualization-and-reporting"
id="toc-analysis-visualization-and-reporting"><span
class="toc-section-number">4.6</span> Analysis, Visualization, and
Reporting</a></li>
<li><a href="#reproducibility-and-auto-injection"
id="toc-reproducibility-and-auto-injection"><span
class="toc-section-number">4.7</span> Reproducibility and
Auto-Injection</a>
<ul>
<li><a href="#bounded-file-processing"
id="toc-bounded-file-processing"><span
class="toc-section-number">4.7.1</span> Bounded file processing</a></li>
</ul></li>
</ul></li>
<li><a href="#sec:artifacts_evidence"
id="toc-sec:artifacts_evidence"><span
class="toc-section-number">5</span> Artifacts and Evidence</a>
<ul>
<li><a href="#model-family-coverage"
id="toc-model-family-coverage"><span
class="toc-section-number">5.1</span> Model-Family Coverage</a></li>
<li><a href="#semantic-fidelity-and-cross-framework-reliability-gates"
id="toc-semantic-fidelity-and-cross-framework-reliability-gates"><span
class="toc-section-number">5.2</span> Semantic-Fidelity and
Cross-Framework Reliability Gates</a></li>
<li><a href="#source-preserving-llm-processing"
id="toc-source-preserving-llm-processing"><span
class="toc-section-number">5.3</span> Source-Preserving LLM
Processing</a></li>
<li><a href="#repository-scale" id="toc-repository-scale"><span
class="toc-section-number">5.4</span> Repository Scale</a></li>
<li><a href="#claim-discipline" id="toc-claim-discipline"><span
class="toc-section-number">5.5</span> Claim Discipline</a></li>
</ul></li>
<li><a href="#sec:reproducibility" id="toc-sec:reproducibility"><span
class="toc-section-number">6</span> Reproducibility</a>
<ul>
<li><a href="#pipeline-smoke-run" id="toc-pipeline-smoke-run"><span
class="toc-section-number">6.1</span> Pipeline Smoke Run</a></li>
<li><a href="#validation-gates" id="toc-validation-gates"><span
class="toc-section-number">6.2</span> Validation Gates</a></li>
<li><a href="#manuscript-reproducibility"
id="toc-manuscript-reproducibility"><span
class="toc-section-number">6.3</span> Manuscript
Reproducibility</a></li>
<li><a href="#reproducibility-contract"
id="toc-reproducibility-contract"><span
class="toc-section-number">6.4</span> Reproducibility Contract</a></li>
</ul></li>
<li><a href="#sec:limitations_next_steps"
id="toc-sec:limitations_next_steps"><span
class="toc-section-number">7</span> Limitations and Next Steps</a>
<ul>
<li><a href="#current-limitations" id="toc-current-limitations"><span
class="toc-section-number">7.1</span> Current Limitations</a></li>
<li><a href="#next-steps" id="toc-next-steps"><span
class="toc-section-number">7.2</span> Next Steps</a></li>
</ul></li>
<li><a href="#sec:source_surface" id="toc-sec:source_surface"><span
class="toc-section-number">8</span> Supplemental Source Surface</a>
<ul>
<li><a href="#authored-source-versus-generated-output"
id="toc-authored-source-versus-generated-output"><span
class="toc-section-number">8.1</span> Authored Source Versus Generated
Output</a></li>
</ul></li>
<li><a href="#sec:symbols_glossary" id="toc-sec:symbols_glossary"><span
class="toc-section-number">9</span> Symbols and Glossary</a>
<ul>
<li><a href="#language-constructs" id="toc-language-constructs"><span
class="toc-section-number">9.1</span> Language Constructs</a></li>
<li><a href="#symbols-by-model-kind"
id="toc-symbols-by-model-kind"><span
class="toc-section-number">9.2</span> Symbols by Model Kind</a></li>
<li><a href="#ontology-bindings-and-implementations"
id="toc-ontology-bindings-and-implementations"><span
class="toc-section-number">9.3</span> Ontology Bindings and
Implementations</a></li>
</ul></li>
<li><a href="#sec:references" id="toc-sec:references"><span
class="toc-section-number">10</span> References</a></li>
</ul>
</nav>
<main id="main-content" tabindex="-1">
<h1 data-number="1" id="sec:abstract"><span
class="header-section-number">1</span> Abstract</h1>
<figure id="fig:graphical_abstract">
<a class="figure-full-size-link" href="../figures/gnn_graphical_abstract.png" target="_blank" rel="noopener" aria-label="Open full-size Figure 1, The GeneralizedNotationNotation (GNN) pipeline at a glance, generated from the producer’s…"><img src="../figures/gnn_graphical_abstract.png" style="width:100.0%"
alt="End-to-end summary panel of the GNN pipeline in seven left-to-right stage cards: a plain-text GNN document declaring A, B, C, D and E; parsing; validation and type checking with the B-tensor orientation check; code rendering to the registered backends; supervised dispatch through execution adapters including the bnlearn lane; analysis; and cross-repository interchange with GEO-INFER and fep_lean. Step pills name the pipeline step behind each stage, a callout states the two newest capabilities, and a footer strip carries the producer&#x27;s scale counts for steps, families, backends and MCP tools." /><span class="figure-full-size-label" aria-hidden="true">Open full-size figure</span></a>
<figcaption>Figure 1: The GeneralizedNotationNotation
(GNN) pipeline at a glance, generated from the producer’s token map at
commit 92f285b5b. A plain-text specification — the
<code>StateSpaceBlock</code> declaring the model’s tensors,
<code>A</code>, <code>B</code>, <code>C</code>, <code>D</code>, and
<code>E</code> for the discrete categorical kind of eq. <a
href="#eq:generative_model">1</a> through eq. <a href="#eq:policy">8</a>
and its own matrix vocabulary for the other model kinds — is parsed
(Step 3), type-checked and validated (Steps 5–6), rendered as
backend-specific code (Step 11), executed (Step 12), and analyzed (Step
16), before artifacts flow into the cross-repository interchange checks
against the pinned GEO-INFER and fep_lean pairs. Read the cards left to
right: each header names the stage, each pill names the pipeline step
(or the source role), and the body states what the stage produces. The
validation stage includes the B-tensor orientation check — every
discrete <code>B</code> literal is read as column-stochastic
<code>B[s', s, a]</code>, and <code>--transpose-b</code> maps
row-stochastic textbook literals onto that canonical order — and the
execution stage includes the bnlearn lane, which generates runnable
Python from the same parsed model and skips with a recorded status when
its runtime is absent. The footer states the scale the panel summarizes:
25 pipeline steps, 9 model families, 12 registered render backends with
12 render targets having Step 12 execution adapters, and 164 Model
Context Protocol tools.</figcaption>
</figure>
<p>Active Inference offers a unifying account of perception, learning,
and action under the free energy principle <span class="citation"
data-cites="friston2010">(<a href="#ref-friston2010"
role="doc-biblioref">Friston 2010</a>)</span>, yet the generative models
at its core are still communicated ad hoc: scattered across prose
descriptions, bespoke notebooks, and framework-specific code that rarely
agree. This fragmentation makes published models hard to reproduce,
compare, or port between tools, and it raises the barrier for newcomers
learning the formalism <span class="citation" data-cites="parr2022">(<a
href="#ref-parr2022" role="doc-biblioref">Parr et al. 2022</a>)</span>.
GeneralizedNotationNotation (GNN) addresses this gap with a
standardized, human- and machine-readable text language for specifying
Active Inference generative models, paired with a 25-step processing
pipeline that transforms a single specification into validation,
visualization, simulation, and analysis artifacts <span class="citation"
data-cites="gnn2023">(<a href="#ref-gnn2023" role="doc-biblioref">Smékal
and Friedman 2023</a>)</span>. A GNN file denotes a generative model,
and the language lets that model take the several shapes the field
actually uses: the notation blocks a file declares — categorical
<code>A</code>/<code>B</code>/<code>C</code>/<code>D</code>[/<code>E</code>]
tensors, linear-Gaussian system matrices
<code>F</code>/<code>H</code>/<code>Q</code>/<code>R</code> with a
Gaussian prior, per-agent and per-level compositions — fix its model
kind, which the pipeline classifies structurally and carries through
rendering and execution, recording explicitly which registered backends
can render and run a model of each kind and which report it unsupported.
GNN’s “Triple Play” treats each model as three coordinated views — a
textual specification, graphical visualizations, and executable
cognitive models — so that outputs share an authored source and can be
checked for consistency through identity, parameter, semantic, and
numerical receipts. The framework spans 38 exemplar specifications (29
discrete-state and 9 continuous linear-Gaussian) across 9 model families
and 12 registered rendering backends, with explicit gates for
cross-format semantic fidelity and cross-framework reliability. GNN
3.0.0 layered safe-by-design long-running orchestration on top of this
language and pipeline — durable observation streams, resumable run
sessions, and auditable container plans that generate, validate, and
replay data only, with no live infrastructure mutation. We describe the
language, the model kinds it denotes, the pipeline architecture, and the
validation contracts and source-bound checks used to assess
specification round trips and admitted executions across simulation
backends — with coverage gaps recorded as explicit profiled-unsupported
statuses rather than silently omitted — providing inspectable
infrastructure for reproducing and comparing Active Inference models
within the recorded capability and verification boundaries.</p>
<hr />
<h1 data-number="2" id="sec:introduction"><span
class="header-section-number">2</span> Introduction</h1>
<h2 data-number="2.1" id="motivation"><span
class="header-section-number">2.1</span> Motivation</h2>
<p>Active Inference has matured into a broad research program spanning
the free energy principle <span class="citation"
data-cites="friston2010">(<a href="#ref-friston2010"
role="doc-biblioref">Friston 2010</a>)</span>, discrete state-space
formulations of perception and action <span class="citation"
data-cites="dacosta2020">(<a href="#ref-dacosta2020"
role="doc-biblioref">Da Costa et al. 2020</a>)</span>, and a growing
body of pedagogy and reference implementations <span class="citation"
data-cites="parr2022 smith2022">(<a href="#ref-parr2022"
role="doc-biblioref">Parr et al. 2022</a>; <a href="#ref-smith2022"
role="doc-biblioref">Smith et al. 2022</a>)</span>. Recent
graphical-specification and message-passing work makes the same
practical pressure visible: active-inference agents need representations
that can be inspected as model structure and then carried into
executable inference updates without being reauthored by hand <span
class="citation"
data-cites="koudahl2023syntheticAgents1 vandelaaar2023syntheticAgents2 bagaev2021reactiveMessagePassing">(<a
href="#ref-koudahl2023syntheticAgents1" role="doc-biblioref">Koudahl et
al. 2023</a>; <a href="#ref-vandelaaar2023syntheticAgents2"
role="doc-biblioref">Laar et al. 2023</a>; <a
href="#ref-bagaev2021reactiveMessagePassing" role="doc-biblioref">Bagaev
and Vries 2021</a>)</span>. As the field has grown, so has a quieter
problem: the models themselves are difficult to share, reproduce, and
compare. A generative model that lives only as a tangle of matrix
definitions inside one author’s script, a diagram in a slide deck, and a
paragraph of prose in a paper has no single authoritative form. The same
model is described three times, in three incompatible media, with no
guarantee that they agree. When a reader wants to re-run that model in a
different toolkit, they must reverse-engineer it from whichever fragment
they happen to have.</p>
<p>This is a reproducibility and interoperability crisis specific to the
structure of Active Inference work. The discipline depends on precisely
specified state spaces, observation and transition tensors, prior
preferences, and policy structures; small notational ambiguities
propagate into materially different behaviour. The heterogeneity of the
models themselves compounds the problem: the field works in several
model kinds at once — discrete categorical POMDPs over finite state
spaces, continuous linear-Gaussian state-space models, multi-agent
systems whose agents each carry their own generative vocabulary,
hierarchical compositions layered over timescales — and each kind
attracts its own notation, its own notebooks, and its own simulation
stack. Yet the community has lacked a notation that is simultaneously
human-readable, machine-parseable, and faithful to the underlying
mathematics across those kinds. Generalized Notation Notation (GNN) was
introduced to fill exactly that gap <span class="citation"
data-cites="gnn2023">(<a href="#ref-gnn2023" role="doc-biblioref">Smékal
and Friedman 2023</a>)</span>: a standard, text-based way to write down
an Active Inference generative model once, such that every downstream
use derives from the same source of truth.</p>
<h2 data-number="2.2" id="the-gnn-approach"><span
class="header-section-number">2.2</span> The GNN Approach</h2>
<p>GNN treats the model specification as a first-class artifact. A model
is written in a plain-text language whose syntax captures the components
an Active Inference modeller actually reasons about — state factors,
observation modalities, the matrices that link them, control structure,
and the temporal organization of the model — and whose declared matrix
vocabulary fixes which kind of generative model the file denotes:
categorical
<code>A</code>/<code>B</code>/<code>C</code>/<code>D</code>[/<code>E</code>]
tensors for a discrete state-space model, linear-Gaussian system
matrices for a continuous one, per-agent and per-level compositions for
structured variants. Because the specification is text, it lives
comfortably in version control, diffs cleanly across revisions, and can
be authored and reviewed by humans without specialized tooling.</p>
<p>The defining commitment of GNN is what the project calls the Triple
Play: a single text specification is the common origin for three
coordinated renderings of the same model. The text form is the
authoritative, editable description. From it, GNN produces graphical
visualizations that expose the model’s factor and dependency structure
for inspection and communication. And from the same source it produces
executable cognitive models that can actually be run, so that the
diagram, the equations, and the running code are all generated from one
parsed document rather than three artifacts that merely claim to
describe the same model. The Triple Play turns a model from a
description scattered across media into one specification with traceable
projections (see fig. <a href="#fig:triple_play">3</a>). Shared source
identity supports their comparison; parameter, orientation, model-kind,
and numerical checks are still required to establish fidelity.</p>
<h2 data-number="2.3" id="contributions"><span
class="header-section-number">2.3</span> Contributions</h2>
<p>This work contributes a standard notation together with the
infrastructure that makes it usable in practice:</p>
<ul>
<li><strong>A parseable, human-readable notation</strong> for Active
Inference generative models, whose text form is authoritative and from
which every other representation is derived.</li>
<li><strong>A model-kind taxonomy with per-kind rendering and execution
semantics</strong> — discrete categorical, continuous linear-Gaussian,
multi-agent, hierarchical, learning, and structural kinds, classified
structurally from the declared notation and rendered or
recorded-unsupported per backend — so that what a specification can do
on a given framework is a checkable property of the model’s kind, not a
trial-and-error discovery.</li>
<li><strong>A 25-step processing pipeline</strong> (0–24), whose stages
are implemented across 44 source packages, that carries a specification
from parsing and validation through visualization, rendering, and
execution.</li>
<li><strong>12 rendering backends</strong> (PyMDP, RxInfer.jl,
ActiveInference.jl, JAX, DisCoPy, PyTorch, NumPyro, Stan, bnlearn,
cpomdp, THRML, ngc-learn) that materialize a single GNN specification as
backend-specific model code, of which 12 (PyMDP, RxInfer.jl,
ActiveInference.jl, JAX, DisCoPy, PyTorch, NumPyro, Stan, bnlearn,
cpomdp, THRML, ngc-learn) have Step 12 execution adapters. Actual
execution requires an admitted model, a ready runtime, and a
source-bound run receipt.</li>
<li><strong>164 Model Context Protocol tools</strong> that expose the
pipeline’s capabilities to agentic and programmatic clients, so the
notation and its tooling are directly accessible to automated
workflows.</li>
<li><strong>9-family reliability gates</strong> that exercise the
pipeline against a curated set of model families (basics, discrete,
continuous, hierarchical, multiagent, precision, structured, gridworld,
scaling-study), turning interoperability claims into checks that must
pass rather than assertions that are merely made.</li>
</ul>
<h2 data-number="2.4" id="reader-orientation"><span
class="header-section-number">2.4</span> Reader Orientation</h2>
<p>The remainder of this manuscript is organized to move from language
to mechanism to evidence. sec. <a href="#sec:system_context">3</a>
states the notation and the model kinds it denotes — the discrete
categorical factorization, its four matrices, and its two free-energy
objectives as explicit equations (eq. <a
href="#eq:generative_model">1</a> through eq. <a
href="#eq:policy">8</a>), the continuous linear-Gaussian state-space
kind with its optional closed-loop control structure (eq. <a
href="#eq:lgssm_state">9</a> through eq. <a
href="#eq:closed_loop">11</a>), and the multi-agent, hierarchical,
learning, and structural compositions — and it presents the model-kind
table (tbl. <a href="#tbl:model_kinds">1</a>), the pipeline structure
(fig. <a href="#fig:pipeline">2</a>), the Triple Play (fig. <a
href="#fig:triple_play">3</a>), and the per-step responsibility table
(tbl. <a href="#tbl:pipeline_steps">2</a>). sec. <a
href="#sec:methods">4</a> follows a specification through the pipeline —
parsing, kind-scoped type checking, rendering, execution, and reporting
— and presents the backend registry (tbl. <a
href="#tbl:backend_registry">3</a>), the per-kind framework capability
matrix (tbl. <a href="#tbl:framework_capability">4</a>), the backend
registry surface (fig. <a href="#fig:backend_matrix">4</a>), and the
long-running orchestration contracts (fig. <a
href="#fig:orchestration">5</a>). sec. <a
href="#sec:artifacts_evidence">5</a> reports what the project has
produced and how each number is grounded, with the model-family registry
(tbl. <a href="#tbl:model_families">5</a>), the family-by-framework
coverage (fig. <a href="#fig:family_matrix">6</a>), and repository-scale
metrics (fig. <a href="#fig:repo_metrics">7</a>). fig. <a
href="#fig:graphical_abstract">1</a> condenses this same arc —
specification, validation, rendering, execution, analysis, and
interchange — into the summary panel at the head of the manuscript.
Claims of independent re-execution are addressed in sec. <a
href="#sec:reproducibility">6</a>, the boundaries of the current system
in sec. <a href="#sec:limitations_next_steps">7</a>, the symbol and
construct tables in sec. <a href="#sec:symbols_glossary">9</a>, and full
source details in sec. <a href="#sec:references">10</a>. Read in this
order, the manuscript moves from why a standard notation is needed,
through how GNN realizes it across model kinds, to the scoped evidence
available for the notation and its implementations.</p>
<hr />
<h1 data-number="3" id="sec:system_context"><span
class="header-section-number">3</span> System Context</h1>
<p>Generalized Notation Notation (GNN) couples a small, declarative text
language for generative models in the Active Inference lineage to a
pipeline of source-processing transformations and bounded execution that
produces validation, visualization, simulation, and analysis artifacts
<span class="citation" data-cites="gnn2023">(<a href="#ref-gnn2023"
role="doc-biblioref">Smékal and Friedman 2023</a>)</span>. The language
gives a model one canonical written form; the pipeline gives that form
many executable and graphical realizations. This section describes both
halves of the architecture and the way they meet, and it states the
mathematical objects the language is obliged to carry — per model kind,
because the language is not tied to a single shape of generative
model.</p>
<h2 data-number="3.1" id="the-gnn-language"><span
class="header-section-number">3.1</span> The GNN Language</h2>
<p>A GNN model is a plain-text document organized into named sections
that together pin down the generative model its author intends. The
<code>StateSpaceBlock</code> declares the variables of the model and
their dimensions — hidden states, observations, control factors,
policies, or the system matrices of a continuous model — establishing
the shape of every tensor that follows. The <code>Connections</code>
section records the directed and undirected dependencies among those
variables, the edges of the underlying factor graph that downstream
tools read to lay out diagrams and wire up inference. Which family of
generative model a file declares is decided by the notation the file
carries, not by its filename or its directory: the declared matrix
vocabulary is what the pipeline reads to classify the model, as sec. <a
href="#sec:model_kinds">3.2</a> specifies. The full construct vocabulary
is catalogued in tbl. <a href="#tbl:gnn_constructs">6</a>.</p>
<h2 data-number="3.2" id="sec:model_kinds"><span
class="header-section-number">3.2</span> Model Kinds</h2>
<p>Every GNN file denotes one generative model, and the language lets
that model take several distinct mathematical shapes. A file whose
<code>StateSpaceBlock</code> declares the categorical tensors
<code>A</code>, <code>B</code>, <code>C</code>, <code>D</code> —
optionally <code>E</code> — denotes a discrete state-space generative
model. A file that declares the system matrices <code>F</code>,
<code>H</code>, <code>Q</code>, <code>R</code> together with a Gaussian
prior over the initial state (<code>prior_mean</code>,
<code>prior_cov</code>) denotes a continuous linear-Gaussian state-space
model. Per-agent and per-level declarations (<code>A_agent1</code>,
<code>A_level1</code>, …) compose the categorical vocabulary into
multi-agent and hierarchical structures. A file that declares boundary
structure only — neither a categorical nor a continuous parameterization
— is a structural wrapper: it names the model’s interfaces but carries
no renderable form.</p>
<p>The pipeline classifies each parsed specification structurally, and
it does so from typed fields alone: the raw <code>## GNNSection</code>
value, the declared matrix-key patterns, explicit agent counts, and
explicit <code>## ModelParameters</code> keys. The classifier
(<code>detect_model_kind</code> in
<code>src/gnn/render/pomdp_contract.py</code>) resolves kinds in a fixed
precedence order — multi-agent, then hybrid, then hierarchical, then
continuous, then nonstationary, then learning, then factored, then
structural, then the flat single-factor case. This single-winner
interface identifies the most specific kind; composition-aware dispatch
consults the complete <code>detect_model_kinds</code> set to admit or
refuse the whole declared composition. Two properties of this
classification matter for everything downstream. First, it is
structural, not textual: prose in a model name or annotation never
changes how a model renders, so a passing mention of “Dirichlet” in free
text cannot reroute a specification into the parameter-learning kind.
Second, it is computed from the parsed specification, not asserted by
the author: the same file classifies the same way on every machine,
which is what lets rendering and execution behavior be stated per kind
rather than per file. The taxonomy, its notation blocks, exemplar
folder, and rendering and execution reach per kind are enumerated in
tbl. <a href="#tbl:model_kinds">1</a>. Registry flags do not establish
runtime availability; execution receipts do.</p>
<div class="table-scroll" role="region" tabindex="0" aria-label="Scrollable table: Table 1: The model kinds the pipeline represents and executes, one row per kind. Notation blocks are the parameteriza…"><table id="tbl:model_kinds" data-responsive-table="true">
<caption>Table 1: The model kinds the pipeline represents and executes,
one row per kind. Notation blocks are the parameterization each kind
declares; exemplar folders are the committed corpus under
<code>input/gnn_files/</code>. Renderer(s)/Executor(s) cells are
generated from the registry flags (see tbl. <a
href="#tbl:framework_capability">4</a>): the two parameterization rows
carry their own flag sets, excluding continuous-only targets from
categorical coverage. These flags do not establish universal multi-agent
support: THRML accepts independent categorical components, and coupled
models require a backend-specific representation and acceptance
evidence. Native independent linear-Gaussian agent exemplars are
verified on JAX and RxInfer in the v4 acceptance ledger;
<code>recursive/</code> is reserved for bounded
<code>--autonomous</code> proposal-loop runs and holds no committed
models.</caption>
<colgroup>
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
</colgroup>
<thead>
<tr>
<th>Model kind</th>
<th>Notation block</th>
<th>Exemplar folder</th>
<th>Renderer(s)</th>
<th>Executor(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Discrete categorical</td>
<td><code>A</code>/<code>B</code>/<code>C</code>/<code>D</code>[/<code>E</code>]
(column-stochastic <code>B</code> slices)</td>
<td><code>input/gnn_files/discrete/</code></td>
<td>PyMDP, RxInfer.jl, ActiveInference.jl, JAX, DisCoPy, PyTorch,
NumPyro, Stan, bnlearn, THRML</td>
<td>PyMDP, RxInfer.jl, ActiveInference.jl, JAX, DisCoPy, PyTorch,
NumPyro, Stan, bnlearn, THRML</td>
</tr>
<tr>
<td>Continuous linear-Gaussian</td>
<td><code>F</code>/<code>H</code>/<code>Q</code>/<code>R</code> + priors
(optional closed-loop pair)</td>
<td><code>input/gnn_files/continuous/</code></td>
<td>RxInfer.jl, JAX, PyTorch, NumPyro, Stan, cpomdp, ngc-learn</td>
<td>RxInfer.jl, JAX, PyTorch, NumPyro, Stan, cpomdp, ngc-learn</td>
</tr>
<tr>
<td>Multi-agent</td>
<td><code>nr_agents</code> + per-agent categorical or linear-Gaussian
parameters</td>
<td><code>input/gnn_files/multiagent/</code></td>
<td>Model/backend dependent composition</td>
<td>Model/backend dependent; explicit acceptance required</td>
</tr>
<tr>
<td>Recursive</td>
<td>—</td>
<td><code>input/gnn_files/recursive/</code></td>
<td>—</td>
<td>—</td>
</tr>
</tbody>
</table></div>
<h3 data-number="3.2.1" id="the-discrete-categorical-kind"><span
class="header-section-number">3.2.1</span> The Discrete Categorical
Kind</h3>
<p>A discrete specification denotes a partially observable Markov
decision process over a horizon <span class="math inline">\(T\)</span>,
factorized as in eq. <a href="#eq:generative_model">1</a> following the
standard formulation <span class="citation"
data-cites="dacosta2020 smith2022">(<a href="#ref-dacosta2020"
role="doc-biblioref">Da Costa et al. 2020</a>; <a href="#ref-smith2022"
role="doc-biblioref">Smith et al. 2022</a>)</span>.</p>
<p><span id="eq:generative_model"><span
class="math display">\[P(o_{1:T},\, s_{1:T},\, \pi) \;=\; P(\pi)\;
P(s_1) \prod_{t=1}^{T} P(o_t \mid s_t) \prod_{t=2}^{T} P(s_t \mid
s_{t-1},\, \pi)\qquad{(1)}\]</span></span></p>
<p>The four matrices named in the <code>StateSpaceBlock</code> are
exactly the factors of eq. <a href="#eq:generative_model">1</a>, and
this correspondence is what makes the notation translatable rather than
merely descriptive. The <code>A</code> matrix is the likelihood, a
column-stochastic map from hidden states to observation outcomes, given
in eq. <a href="#eq:likelihood">2</a>.</p>
<p><span id="eq:likelihood"><span class="math display">\[P(o_t = i \mid
s_t = j) \;=\; A_{ij}, \qquad \sum_i A_{ij} =
1\qquad{(2)}\]</span></span></p>
<p>The <code>B</code> matrix is the controlled transition dynamics: one
column-stochastic slice per action, as in eq. <a
href="#eq:transition">3</a>. The canonical reading of the tensor is
column-stochastic, <code>B[next_state][previous_state][action]</code>,
matching the convention of the discrete message-passing libraries the
pipeline targets <span class="citation" data-cites="heins2022">(<a
href="#ref-heins2022" role="doc-biblioref">Heins et al.
2022</a>)</span>; validation records every declared tensor’s detected
orientation and can transpose row-stochastic textbook literals on
request, as described in sec. <a href="#sec:methods">4</a>.</p>
<p><span id="eq:transition"><span class="math display">\[P(s_{t+1} = i
\mid s_t = j,\, u_t = k) \;=\; B^{(k)}_{ij}, \qquad \sum_i B^{(k)}_{ij}
= 1\qquad{(3)}\]</span></span></p>
<p>The <code>C</code> vector holds log-preferences over observations,
which enter inference as the biased outcome distribution of eq. <a
href="#eq:preference">4</a>; the <code>D</code> vector is the prior over
initial hidden states, eq. <a href="#eq:prior">5</a>.</p>
<p><span id="eq:preference"><span class="math display">\[\tilde{P}(o_t =
i) \;=\; \sigma(C)_i \;=\; \frac{\exp C_i}{\sum_j \exp
C_j}\qquad{(4)}\]</span></span></p>
<p><span id="eq:prior"><span class="math display">\[P(s_1 = i) \;=\;
D_i, \qquad \sum_i D_i = 1\qquad{(5)}\]</span></span></p>
<p>Given those factors, perception is approximate Bayesian inference: a
variational posterior <span class="math inline">\(Q(s)\)</span> is
fitted by minimizing the variational free energy of eq. <a
href="#eq:vfe">6</a>, which decomposes into a complexity term and an
accuracy term <span class="citation" data-cites="friston2010">(<a
href="#ref-friston2010" role="doc-biblioref">Friston
2010</a>)</span>.</p>
<p><span id="eq:vfe"><span class="math display">\[F[Q] \;=\;
\underbrace{D_{\mathrm{KL}}\!\left[\,Q(s) \,\|\,
P(s)\,\right]}_{\text{complexity}} \;-\;
\underbrace{\mathbb{E}_{Q(s)}\!\left[\ln P(o \mid
s)\right]}_{\text{accuracy}}\qquad{(6)}\]</span></span></p>
<p>Action is expected-free-energy minimization: each policy <span
class="math inline">\(\pi\)</span> is scored over future steps <span
class="math inline">\(\tau\)</span> by eq. <a href="#eq:efe">7</a>,
whose two terms are the information gain a policy is expected to yield
and the extent to which its predicted outcomes match <code>C</code>
<span class="citation" data-cites="dacosta2020">(<a
href="#ref-dacosta2020" role="doc-biblioref">Da Costa et al.
2020</a>)</span>.</p>
<p><span id="eq:efe"><span class="math display">\[G(\pi) \;=\;
-\underbrace{\mathbb{E}_{Q(o_\tau,\, s_\tau \mid \pi)}\!\left[\ln
Q(s_\tau \mid o_\tau, \pi) - \ln Q(s_\tau \mid
\pi)\right]}_{\text{epistemic value}} \;-\;
\underbrace{\mathbb{E}_{Q(o_\tau \mid \pi)}\!\left[\ln
\tilde{P}(o_\tau)\right]}_{\text{pragmatic
value}}\qquad{(7)}\]</span></span></p>
<p>The policy posterior then combines those scores with the habit prior
<code>E</code> declared in the specification, as in eq. <a
href="#eq:policy">8</a>, and the selected action <span
class="math inline">\(u\)</span> is sampled from it.</p>
<p><span id="eq:policy"><span class="math display">\[Q(\pi) \;=\;
\sigma\!\left(\ln E - G\right)\qquad{(8)}\]</span></span></p>
<p>The discrete categorical kind is the language’s original and most
densely exercised target: 29 of the 38 exemplar specifications in the
corpus are discrete-state. The discrete family folder holds the kind’s
core set — from minimal <code>markov_chain.md</code> and
<code>hmm_baseline.md</code> fixtures through epistemic planning
(<code>tmaze_epistemic.md</code>) and deep planning horizons
(<code>deep_planning_horizon.md</code>) to the canonical full agent
(<code>actinf_pomdp_agent.md</code>) — and further categorical fixtures
populate the basics, precision, structured, gridworld, and scaling-study
corpora. The kind composes upward as well: multiple independent state
factors (a factored model), per-level and per-agent matrix declarations
(sec. <a href="#sec:structural_variants">3.2.3</a>), and Dirichlet
priors that turn a declared matrix into a learned latent (sec. <a
href="#sec:limitations_next_steps">7</a>) are all extensions of this
same categorical substrate.</p>
<p>Recent work continues to refine how expected-free-energy objectives
relate to variational inference and to alternative but equivalent
formulations, which is why GNN keeps the objects of eq. <a
href="#eq:generative_model">1</a> through eq. <a href="#eq:policy">8</a>
explicit in the notation rather than burying them in backend-specific
code <span class="citation"
data-cites="champion2024reframingEfe nuijten2026typeInference nuijten2026efePlanningVariational">(<a
href="#ref-champion2024reframingEfe" role="doc-biblioref">Champion et
al. 2024</a>; <a href="#ref-nuijten2026typeInference"
role="doc-biblioref">Nuijten, Lukashchuk, et al. 2026</a>; <a
href="#ref-nuijten2026efePlanningVariational"
role="doc-biblioref">Nuijten, Laar, et al. 2026</a>)</span>. A
<code>ModelParameters</code> section fixes the scalars those objects
depend on — factor cardinalities and precision terms — while a
<code>Time</code> section declares whether the model is static or
dynamic and, if dynamic, how the horizon <span
class="math inline">\(T\)</span> and its discretization are organized.
Because every one of these sections is explicit text, a GNN file is at
once human-readable, diffable under version control, and unambiguous to
a parser — the property that makes the declared source contract
inspectable; numerical replay also depends on the chosen inference and
runtime configuration.</p>
<h3 data-number="3.2.2" id="the-continuous-linear-gaussian-kind"><span
class="header-section-number">3.2.2</span> The Continuous
Linear-Gaussian Kind</h3>
<p>A file whose <code>StateSpaceBlock</code> declares <code>F</code>,
<code>H</code>, <code>Q</code>, <code>R</code> together with
<code>prior_mean</code> and <code>prior_cov</code> denotes a
continuous-state linear-Gaussian state-space model stepped in discrete
time: a Gaussian latent state <span class="math inline">\(x_t \in
\mathbb{R}^n\)</span> evolves linearly, and a Gaussian observation <span
class="math inline">\(y_t \in \mathbb{R}^m\)</span> reads it out
linearly.</p>
<p><span id="eq:lgssm_state"><span class="math display">\[x_1 \sim
\mathcal{N}(\mu_0,\, \Sigma_0), \qquad x_t = F\, x_{t-1} + u_{t-1} +
w_t, \qquad w_t \sim \mathcal{N}(0,\, Q)\qquad{(9)}\]</span></span></p>
<p><span id="eq:lgssm_obs"><span class="math display">\[y_t = H\, x_t +
v_t, \qquad v_t \sim \mathcal{N}(0,\, R)\qquad{(10)}\]</span></span></p>
<p>Here <code>F</code> is the state-transition matrix, <code>H</code>
the observation matrix, <code>Q</code> the process-noise covariance, and
<code>R</code> the observation-noise covariance; <code>prior_mean</code>
(<span class="math inline">\(\mu_0\)</span>) and <code>prior_cov</code>
(<span class="math inline">\(\Sigma_0\)</span>) fix the Gaussian prior
over the initial state, so the model’s randomness is declared entirely
in its parameterization rather than in categorical tables. The shape
contract mirrors the semantics: <code>prior_mean</code> must carry
exactly <span class="math inline">\(n\)</span> entries, and
<code>Q</code>, <code>R</code>, and <code>prior_cov</code> must be <span
class="math inline">\(n \times n\)</span>, <span class="math inline">\(m
\times m\)</span>, and <span class="math inline">\(n \times n\)</span>
respectively — a mismatch is a validation-time diagnostic in the
notation, not a runtime surprise inside a numerical backend.</p>
<p>The kind also carries an optional closed-loop control structure. When
a specification declares <code>goal_mean</code> (<span
class="math inline">\(\mu^\star\)</span>, the preferred state) and
<code>control_gain</code> (<span class="math inline">\(k\)</span>, a
scalar proportional gain) alongside a control input <span
class="math inline">\(u_t\)</span>, the rendered model closes the loop
on beliefs: the controller steers the filtered posterior mean toward the
preferred state.</p>
<p><span id="eq:closed_loop"><span class="math display">\[u_t \;=\; k
\,\bigl(\mu^\star - \mu_t\bigr), \qquad \mu_t = \mathbb{E}\!\left[x_t
\,\middle|\, y_{1:t}\right]\qquad{(11)}\]</span></span></p>
<p>This is how
<code>input/gnn_files/continuous/continuous_navigation.md</code> is
built: a two-dimensional navigator whose position persists between steps
(<span class="math inline">\(F = I\)</span>), whose observation is a
noisy identity readout of that position, and whose control input pushes
the believed position toward <code>goal_mean</code> with gain
<code>control_gain</code>. The other continuous exemplars are passive:
<code>predictive_coding_agent.md</code> and
<code>stochastic_dynamics.md</code> filter without steering. In total
the corpus ships 9 continuous linear-Gaussian exemplars in the
continuous family folder. Symbolically the kind reuses letters the
discrete vocabulary already claims — most prominently <code>F</code>,
which names the state-transition matrix here and the variational free
energy in eq. <a href="#eq:vfe">6</a> — and sec. <a
href="#sec:symbols_glossary">9</a> resolves that collision by scoping
each symbol table to its kind.</p>
<h3 data-number="3.2.3" id="sec:structural_variants"><span
class="header-section-number">3.2.3</span> Multi-Agent, Hierarchical,
and Structural Kinds</h3>
<p>The remaining kinds are structural compositions of the two
parameterization vocabularies above, and the classifier recognizes each
by its declared key pattern rather than by convention.</p>
<p><strong>Multi-agent.</strong> A specification with an explicit agent
count greater than one, or with per-agent matrix keys
(<code>A_agent1</code>, <code>B_agent1</code>, <code>C_agent1</code>,
…), declares a multi-agent model: each agent carries its own categorical
vocabulary, and coordination is expressed in the
<code>Connections</code> section rather than by merging the agents into
one joint table.
<code>input/gnn_files/multiagent/stigmergic_swarm.md</code> is the
worked exemplar — three agents coordinating through environmental traces
(stigmergy) on a shared grid, with no direct communication between them
— alongside <code>multi_agent_coordination.md</code> and a compact
clustered mean-field acceptance fixture.</p>
<p><strong>Hierarchical.</strong> Per-level matrix keys
(<code>A_level1</code>, <code>B_level1</code>, <code>A_level2</code>, …)
declare a multi-level model in which one level’s beliefs supply another
level’s context —
<code>input/gnn_files/hierarchical/hierarchical_pomdp.md</code> couples
a fast lower level to a slow higher level that switches its context, and
<code>temporal_hierarchy.md</code> develops the same structure over
time. These fixtures explicitly declare <code>block_reset_v1</code> and
<code>timed_soft_controller_v1</code>. JAX preserves their block resets
and approximate 10/100-clock controller semantics; other backends report
these contracts unsupported. Generic hierarchical strategies without
these contracts retain their separate capability boundaries.</p>
<p><strong>Learning and factored.</strong> A specification that declares
a Dirichlet prior over one of its matrices (<code>dirichlet_A</code>, …)
— or declares a learning <code>## GNNSection</code> value — is the
parameter-learning kind: a matrix becomes a latent variable inferred
from observations rather than a fixed table.
<code>input/gnn_files/learning/dirichlet_likelihood_learning.md</code>
is the worked exemplar: its <code>StateSpaceBlock</code> still declares
<code>A[3,3]</code> in the categorical vocabulary, but <code>A</code> is
a latent variable with prior pseudo-counts declared in
<code>dirichlet_A[3,3]</code>, and hidden-state inference and likelihood
learning run jointly by variational message passing with a mean-field
factorization. The file is explicit about what its
<code>InitialParameterization</code> means — the numeric <code>A</code>
there is the environment’s ground-truth likelihood that the agent never
observes and must recover, not the agent’s belief — and its annotation
records why the Dirichlet prior is identity-biased rather than uniform:
a fully uniform prior leaves the column-permutation symmetry unbroken
and inference converges to a label-switched optimum. A specification
whose <code>## ModelParameters</code> declare more than one independent
state factor without per-level or per-agent keys is the factored kind,
the standard multi-factor categorical POMDP.</p>
<p><strong>Structural.</strong> A file that declares boundary structure
only — a Markov-blanket-style wrapper with neither a categorical
<code>A</code>/<code>B</code>/<code>C</code>/<code>D</code>[/<code>E</code>]
parameterization nor a continuous
<code>F</code>/<code>H</code>/<code>Q</code>/<code>R</code> one — is
classified structural and is informational, with no renderable model
body: it names interfaces the surrounding system can reason about, and
every framework reports it <code>unsupported</code> with the reason that
it has no renderable form, rather than being forced through a discrete
render path that would fail on missing matrices.</p>
<p><strong>The recursive corpus.</strong> The
<code>input/gnn_files/recursive/</code> directory is reserved for
bounded <code>--autonomous</code> proposal-loop runs and holds no
committed models; recursion today enters the taxonomy as structure — a
level referencing its own kind, as in the hierarchical compositions
above — rather than as a separately renderable kind. The corpus
directory is part of the tree so that autonomous runs have a bounded,
inspectable home, and its emptiness is a fact of the current release
rather than an omission of the documentation.</p>
<h3 data-number="3.2.4" id="reading-exemplars-by-kind"><span
class="header-section-number">3.2.4</span> Reading Exemplars by
Kind</h3>
<p>Each kind is best understood through a specification that exercises
it, and the corpus pairs every kind with at least one canonical
exemplar. Reading one file per kind side by side makes the
notation-block difference — the entire content of the taxonomy —
concrete.</p>
<p>The discrete canonical is
<code>input/gnn_files/discrete/actinf_pomdp_agent.md</code>, a fully
controllable one-factor POMDP. Its <code>StateSpaceBlock</code> declares
<code>A[3,3]</code>, <code>B[3,3,3]</code>, <code>C[3]</code>,
<code>D[3]</code>, and <code>E[3]</code> — one observation modality, one
hidden-state factor, and three actions — and every tensor of eq. <a
href="#eq:generative_model">1</a> through eq. <a href="#eq:policy">8</a>
is present by name: <code>A</code> carries the likelihood mapping,
<code>B</code> carries the controlled transitions in the canonical
column-stochastic slice order, <code>C</code> holds log-preferences,
<code>D</code> the initial-state prior, and <code>E</code> the habit
prior. The <code>Connections</code> section then wires the inference
cycle explicitly — <code>D&gt;s</code> conditions the initial belief,
<code>s-A</code> ties states to observations, <code>C&gt;G</code> and
<code>E&gt;π</code> feed preference and habit into policy scoring, and
<code>π&gt;u</code> closes the loop from policy to action — so the file
reads as a literal transcription of eq. <a href="#eq:vfe">6</a> and
eq. <a href="#eq:efe">7</a> into declared variables and edges.</p>
<p>The continuous canonical is
<code>input/gnn_files/continuous/continuous_navigation.md</code> (eq. <a
href="#eq:lgssm_state">9</a> through eq. <a
href="#eq:closed_loop">11</a>). Its <code>StateSpaceBlock</code>
declares no categorical tensors at all: <code>x[2,1]</code> and
<code>y[2,1]</code> are the Gaussian state and observation,
<code>F[2,2]</code>, <code>H[2,2]</code>, <code>Q[2,2]</code>, and
<code>R[2,2]</code> carry the linear dynamics and noise,
<code>prior_mean[2]</code> and <code>prior_cov[2,2]</code> fix the
initial belief, and <code>goal_mean[2]</code> and
<code>control_gain[1]</code> add the closed-loop control structure. The
<code>InitialParameterization</code> gives the matrices numerically —
identity dynamics and identity readout, diagonal process and observation
noise, a prior centered on the origin, a preferred position, and the
proportional gain — and the <code>Equations</code> section restates
eq. <a href="#eq:lgssm_state">9</a>, eq. <a href="#eq:lgssm_obs">10</a>,
and eq. <a href="#eq:closed_loop">11</a> as the model’s declared
dynamics. Nothing about the file is a discretized stand-in for a POMDP;
it is a linear-Gaussian model by declaration, which is what lets the
classifier label it <code>CONTINUOUS</code> and the continuous-capable
backends render it natively.</p>
<p>The composed kinds show their structure in their key names.
<code>input/gnn_files/multiagent/stigmergic_swarm.md</code> declares
<code>A_agent1[4,9]</code>, <code>B_agent1[9,9,4]</code>,
<code>C_agent1[4]</code>, and <code>D_agent1[9]</code>, then repeats the
block for each further agent, so the per-agent pattern that the
classifier keys on is visible directly in the
<code>StateSpaceBlock</code>; coordination between the agents is
expressed through shared environment variables in
<code>Connections</code>, not by merging the agents into one joint
table. <code>input/gnn_files/hierarchical/hierarchical_pomdp.md</code>
declares <code>A_level1[4,4]</code> and <code>A_level2[4,2]</code> with
matching per-level transitions and priors — the
<code>block_reset_v1</code> execution contract preserves those levels
and resets through JAX rather than flattening this fixture or routing it
through RxInfer.jl. In every case the classification is a mechanical
reading of the declared names, which is the property that keeps the
taxonomy honest: a file is its kind because of what it declares, not
because of where it sits.</p>
<h3 data-number="3.2.5" id="what-the-kind-classification-governs"><span
class="header-section-number">3.2.5</span> What the Kind Classification
Governs</h3>
<p>The classification is not an annotation a report displays and
forgets; it governs observable pipeline behavior at each stage that
touches a model. At the render step, the per-framework receipts group
outcomes into three disjoint sets — frameworks processed, frameworks
failed, and frameworks unsupported — and the unsupported set is excluded
from the success denominator rather than counted against it: a
categorical backend facing a continuous model, or any backend facing a
structural wrapper, reports a status with a reason and drops out of the
rate, so a pipeline run over a mixed-kind corpus neither inflates its
failures nor hides its gaps. At the execute step the same discipline
applies, with skipped and degraded lanes recorded as explicit statuses.
At the analysis and reporting steps, the receipts keep the distinctions
legible: a continuous model whose categorical-only lanes report
<code>unsupported</code> by capability reads differently from a discrete
model whose continuous attempt failed, and the per-family acceptance
ledger that the model-family gate writes carries those statuses per
family, per backend, per step.</p>
<p>The governance runs in the direction the taxonomy promises:
classification is computed from the parsed specification’s declared
fields, and composition-aware adapters must preserve the whole kind set.
Source-bound render receipts, execution traces, and acceptance ledgers
make their handling of those kinds auditable. A reader auditing any of
those artifacts can recompute the classification from the file’s
declared vocabulary alone — tbl. <a href="#tbl:model_kinds">1</a> is the
key — and expect to match what the pipeline recorded, which is what
makes the kind taxonomy a checkable claim rather than a documentation
convention.</p>
<h2 data-number="3.3" id="the-processing-pipeline"><span
class="header-section-number">3.3</span> The Processing Pipeline</h2>
<p>The pipeline is a fixed sequence of 25 numbered steps, 0–24, each a
self-contained stage that consumes the artifacts of its predecessors and
writes typed outputs for those that follow. Early steps parse and
type-check the GNN text and validate it against the language schema;
middle steps render visualizations, export the model to executable
backends, and run simulations; later steps perform analysis, reporting,
and downstream integration. The declared orchestration prerequisites
among the steps form the directed acyclic graph shown in fig. <a
href="#fig:pipeline">2</a>. The graph records which steps must precede
others; artifact receipts separately identify source inputs and produced
files, including optional enrichments.</p>
<figure id="fig:pipeline">
<a class="figure-full-size-link" href="../figures/gnn_pipeline_dag.png" target="_blank" rel="noopener" aria-label="Open full-size Figure 2, The 25-step GNN processing pipeline as a directed acyclic graph, arranged in rowwise…"><img src="../figures/gnn_pipeline_dag.png" style="width:90.0%"
alt="Directed acyclic graph of the numbered GNN pipeline steps. Nodes are the step modules under src/gnn/, arranged in rowwise topological order across five columns. Each node shows the complete step number and module name; the legend above the nodes identifies execution phases by color. Arrows show the required orchestration prerequisites declared in src/gnn/STEP_INDEX.md, linking each prerequisite step to its consumers. Optional artifact enrichments are documented separately." /><span class="figure-full-size-label" aria-hidden="true">Open full-size figure</span></a>
<figcaption>Figure 2: The 25-step GNN processing
pipeline as a directed acyclic graph, arranged in rowwise topological
order and colored by execution phase (legend above the nodes). Each node
is the thin step orchestrator under <code>src/gnn/</code> named in
tbl. <a href="#tbl:pipeline_steps">2</a>; each arrow is a required
orchestration prerequisite parsed from the Data Dependency Graph block
of <code>src/gnn/STEP_INDEX.md</code>, which mirrors the live step
registry. Parsing (Step 3) precedes many later steps. Optional artifact
enrichments are documented separately and are not shown as required
edges. The figure is generated from <code>src/gnn/STEP_INDEX.md</code>
at commit 92f285b5b; its footer restates the step count, the number of
required prerequisites, and the layout rule.</figcaption>
</figure>
<p>The per-step responsibilities are enumerated in tbl. <a
href="#tbl:pipeline_steps">2</a>; each row names a step and the
transformation it owns within the 0–24 range.</p>
<div class="table-scroll" role="region" tabindex="0" aria-label="Scrollable table: Table 2: The pipeline steps with the thin orchestrator module that owns each and the one-line purpose parsed from the…"><table id="tbl:pipeline_steps" data-responsive-table="true">
<caption>Table 2: The pipeline steps with the thin orchestrator module
that owns each and the one-line purpose parsed from the master table in
<code>src/gnn/STEP_INDEX.md</code>. Read the Step column against the
arrows of fig. <a href="#fig:pipeline">2</a>: each row’s purpose is the
transformation that module owns, and the table is regenerated from the
index at every build, so it cannot drift from the code it
describes.</caption>
<colgroup>
<col style="width: 40%" />
<col style="width: 30%" />
<col style="width: 30%" />
</colgroup>
<thead>
<tr>
<th style="text-align: right;">Step</th>
<th>Module</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right;">0</td>
<td><code>0_template.py</code></td>
<td>Pipeline template &amp; initialization</td>
</tr>
<tr>
<td style="text-align: right;">1</td>
<td><code>1_setup.py</code></td>
<td>Environment setup &amp; UV dependency install</td>
</tr>
<tr>
<td style="text-align: right;">2</td>
<td><code>2_tests.py</code></td>
<td>Test suite execution (pytest)</td>
</tr>
<tr>
<td style="text-align: right;">3</td>
<td><code>3_gnn.py</code></td>
<td>GNN file discovery &amp; multi-format parsing</td>
</tr>
<tr>
<td style="text-align: right;">4</td>
<td><code>4_model_registry.py</code></td>
<td>Model versioning &amp; registry management</td>
</tr>
<tr>
<td style="text-align: right;">5</td>
<td><code>5_type_checker.py</code></td>
<td>GNN type validation &amp; resource estimation</td>
</tr>
<tr>
<td style="text-align: right;">6</td>
<td><code>6_validation.py</code></td>
<td>Consistency &amp; semantic quality checking</td>
</tr>
<tr>
<td style="text-align: right;">7</td>
<td><code>7_export.py</code></td>
<td>Multi-format export (JSON, XML, GraphML, GEXF, Pickle)</td>
</tr>
<tr>
<td style="text-align: right;">8</td>
<td><code>8_visualization.py</code></td>
<td>Graph &amp; matrix visualization generation</td>
</tr>
<tr>
<td style="text-align: right;">9</td>
<td><code>9_advanced_viz.py</code></td>
<td>Interactive / advanced visualization (Plotly, D3)</td>
</tr>
<tr>
<td style="text-align: right;">10</td>
<td><code>10_ontology.py</code></td>
<td>Active Inference ontology processing &amp; validation</td>
</tr>
<tr>
<td style="text-align: right;">11</td>
<td><code>11_render.py</code></td>
<td>Code generation for simulation frameworks</td>
</tr>
<tr>
<td style="text-align: right;">12</td>
<td><code>12_execute.py</code></td>
<td>Execute rendered simulation scripts</td>
</tr>
<tr>
<td style="text-align: right;">13</td>
<td><code>13_llm.py</code></td>
<td>LLM-enhanced analysis &amp; model interpretation</td>
</tr>
<tr>
<td style="text-align: right;">14</td>
<td><code>14_ml_integration.py</code></td>
<td>Machine learning integration &amp; model training</td>
</tr>
<tr>
<td style="text-align: right;">15</td>
<td><code>15_audio.py</code></td>
<td>Audio sonification generation (SAPF)</td>
</tr>
<tr>
<td style="text-align: right;">16</td>
<td><code>16_analysis.py</code></td>
<td>Statistical analysis &amp; cross-simulation aggregation</td>
</tr>
<tr>
<td style="text-align: right;">17</td>
<td><code>17_integration.py</code></td>
<td>System integration &amp; cross-module coordination</td>
</tr>
<tr>
<td style="text-align: right;">18</td>
<td><code>18_security.py</code></td>
<td>Security validation &amp; generated code scanning</td>
</tr>
<tr>
<td style="text-align: right;">19</td>
<td><code>19_research.py</code></td>
<td>Research tools &amp; literature references</td>
</tr>
<tr>
<td style="text-align: right;">20</td>
<td><code>20_website.py</code></td>
<td>Static HTML website generation</td>
</tr>
<tr>
<td style="text-align: right;">21</td>
<td><code>21_mcp.py</code></td>
<td>Model Context Protocol processing &amp; tool registration</td>
</tr>
<tr>
<td style="text-align: right;">22</td>
<td><code>22_gui.py</code></td>
<td>Interactive GNN constructor GUI</td>
</tr>
<tr>
<td style="text-align: right;">23</td>
<td><code>23_report.py</code></td>
<td>Comprehensive analysis report generation</td>
</tr>
<tr>
<td style="text-align: right;">24</td>
<td><code>24_intelligent_analysis.py</code></td>
<td>AI-powered pipeline analysis &amp; executive reports</td>
</tr>
</tbody>
</table></div>
<p>This staged design keeps the architecture modular. The implementation
is organized into 44 source packages, one cluster of responsibilities
per concern, and is documented across 672 documentation files so that
each step’s contract, inputs, and outputs are specified independently of
the others. New backends or analyses attach to the graph by declaring
their dependencies rather than by editing a monolith, and deterministic
step ordering makes the processing sequence reproducible. Artifact
receipts bind each run to its selected model sources and resolved
configuration; numerical replay also depends on the backend, dependency
versions, dtype, and random seed, while run identifiers and timestamps
may differ. The pipeline is kind-agnostic in its plumbing and kind-aware
at its edges: parsing, validation, and export operate on whatever the
file declares, while the rendering and execution steps consult the
classification of sec. <a href="#sec:model_kinds">3.2</a> to decide
which backends a given model can reach and record, explicitly, the ones
it cannot.</p>
<h2 data-number="3.4" id="the-triple-play"><span
class="header-section-number">3.4</span> The Triple Play</h2>
<p>The reason for separating a single written language from a
multi-stage pipeline is the design goal GNN calls the Triple Play: one
model specification, three coordinated modes of existence. The same GNN
text supplies a human-readable model description, the declared
state-space and factor structure for graphical visualization, and input
to supported executable renderers. Source identity and validation
receipts connect these representations to the authored model; runtime
readiness and model-kind admission govern which simulations can execute.
fig. <a href="#fig:triple_play">3</a> depicts these three faces and the
shared specification at their center.</p>
<figure id="fig:triple_play">
<a class="figure-full-size-link" href="../figures/gnn_triple_play.png" target="_blank" rel="noopener" aria-label="Open full-size Figure 3, The Triple Play: one GNN text specification"><img src="../figures/gnn_triple_play.png" style="width:70.0%"
alt="The Triple Play as one central GNN specification with three projections radiating from it: the readable text form, graphical visualizations of state-space and factor structure, and executable model code. All three point back to the single specification at the center." /><span class="figure-full-size-label" aria-hidden="true">Open full-size figure</span></a>
<figcaption>Figure 3: The Triple Play: one GNN text
specification (left) and its three coordinated projections (right) — the
human-readable text form, graphical model visualizations, and executable
simulation code. All three arrows originate at the same source box to
show their shared parsed input. Source binding, parameter validation,
and semantic-fidelity checks provide evidence of agreement among the
projections. The executable node summarizes 12 of 12 registered render
targets with implemented Step 12 execution adapters and previews three
by name; execution depends on runtime readiness, admitted model kind,
and a successful source-bound run receipt. Counts are producer tokens at
commit 92f285b5b, and the panel is generated by
<code>scripts/manuscript_fig_triple_play.py</code>. Take-away: a model
is authored once and then read, seen, and run from that single
source.</figcaption>
</figure>
<p>Each face derives from a shared authored source. The text is the
contract a researcher reads and reviews; the visualizations expose the
declared factor-graph structure for inspection and communication; and
the executable rendering targets inference frameworks, connecting the
written specification to the discrete message-passing libraries for
categorical Active Inference <span class="citation"
data-cites="heins2022">(<a href="#ref-heins2022"
role="doc-biblioref">Heins et al. 2022</a>)</span>, to the reactive
message-passing and probabilistic-programming engines that carry the
linear-Gaussian kind, and to the broader tooling ecosystem for
compositional model representation <span class="citation"
data-cites="defelice2021">(<a href="#ref-defelice2021"
role="doc-biblioref">Felice et al. 2021</a>)</span>. Common source
identity makes the projections traceable, while parameter values, tensor
orientation, model-kind semantics, and source-bound numerical results
still require validation to establish agreement. A supported model can
therefore be read, seen, and run without authoring a separate
specification for each purpose <span class="citation"
data-cites="smith2022">(<a href="#ref-smith2022"
role="doc-biblioref">Smith et al. 2022</a>)</span>. The Triple Play is
governed per kind: renderers and executors apply the computed
classification and their declared capability boundaries, and receipts
distinguish successful, unsupported, skipped, partial, and failed
outcomes for the selected model.</p>
<hr />
<h1 data-number="4" id="sec:methods"><span
class="header-section-number">4</span> Methods</h1>
<p>The GeneralizedNotationNotation (GNN) method carries a plain-text
model specification through source-processing transformations, bounded
execution, and reporting. Parsing and code generation can be
deterministic for fixed inputs and configuration; inference may involve
stochastic sampling and depends on the runtime, dtype, and seed. The
processing pipeline is organized into 25 numbered steps (steps 0–24),
each implemented as a standalone module with a single responsibility.
The methods below describe the path that a model travels from notation
to executable cognitive model and back to analyzed results, and they
state that path per model kind wherever the kinds part ways: the
pipeline’s plumbing is kind-agnostic, but rendering and execution are
kind-aware by design. Every quantity reported in this section is
produced from the live repository rather than asserted by hand; the
closing subsection makes that contract explicit.</p>
<h2 data-number="4.1" id="parsing-and-multi-format-export"><span
class="header-section-number">4.1</span> Parsing and Multi-Format
Export</h2>
<p>The pipeline begins by ingesting GNN model files written in the
plain-text notation. Parsing (step 3) reads each specification, builds
an internal model representation, and re-emits it across a family of
structured export formats so that downstream tools, and human readers,
can consume the same model through whichever serialization they prefer.
The corpus that exercises this stage spans 38 example model files
organized into 12 curated corpora, and it spans the model kinds of
sec. <a href="#sec:model_kinds">3.2</a>: minimal perception fixtures
used to test the parser, discrete categorical agents, continuous
linear-Gaussian state-space models, multi-agent swarms, hierarchical
two-level compositions, and the scaling-study corpus that grows a single
family across state-space sizes. The presence of hierarchical fixtures
should be read as a coverage target, not as a claim that every current
backend fully executes every hierarchical formulation; scaling
hierarchical active inference remains an active research problem in its
own right <span class="citation"
data-cites="rangarajan2026hierarchicalSuccessor">(<a
href="#ref-rangarajan2026hierarchicalSuccessor"
role="doc-biblioref">Rangarajan and Rao 2026</a>)</span>. Treating
parsing and export as a single round-trippable stage means a model
authored once becomes immediately available as a typed object, a
normalized text form, and machine-readable serializations without any
manual re-encoding — and because the typed object carries the declared
matrix vocabulary verbatim, the kind classification of sec. <a
href="#sec:model_kinds">3.2</a> is computed from the parse result rather
than re-derived downstream.</p>
<h2 data-number="4.2" id="type-checking-and-validation"><span
class="header-section-number">4.2</span> Type Checking and
Validation</h2>
<p>A model that parses is not yet a model that is well-formed. Steps 5
and 6 apply type checking and validation to confirm that the state
spaces, observation modalities, control factors, and the matrices
relating them are mutually consistent before any code is generated. This
catches dimensional mismatches and malformed factor structures at the
notation level, where the diagnostic is cheap and legible, rather than
allowing them to surface as opaque runtime errors deep inside a
numerical backend. Validation is where the kinds receive their shape
contracts, and each kind’s contract checks the objects its notation
actually declares.</p>
<p>For a discrete categorical specification, validation reads each
declared <code>B</code> tensor through an orientation diagnostic: the
canonical reading is column-stochastic,
<code>B[next_state][previous_state][action]</code>, matching the pymdp
convention <span class="citation" data-cites="heins2022">(<a
href="#ref-heins2022" role="doc-biblioref">Heins et al. 2022</a>)</span>
and the transition semantics fixed by eq. <a
href="#eq:transition">3</a>, and the check records every tensor’s
detected orientation in its receipt. A row-stochastic textbook literal —
the transpose of the canonical layout — is flagged with the tensor,
state factor, and flipped slice indices named, and the opt-in
<code>--transpose-b</code> flag maps such literals onto the canonical
order at load time instead of failing them, recording the transposition
per tensor.</p>
<p>For a continuous linear-Gaussian specification, validation enforces
the Gaussian shape contract of eq. <a href="#eq:lgssm_state">9</a> and
eq. <a href="#eq:lgssm_obs">10</a>: <code>prior_mean</code> must carry
exactly as many entries as the latent state, <code>Q</code> and
<code>prior_cov</code> must be square in the state dimension, and
<code>R</code> must be square in the observation dimension. A covariance
whose shape disagrees with the state or observation declaration is a
validation-time diagnostic naming the mismatched matrix and its
dimensions, not a broadcast error inside a generated script; and the
optional closed-loop declarations are checked as a pair, since a
<code>goal_mean</code> without a <code>control_gain</code> (or the
reverse) is an incomplete control structure rather than a passive
model.</p>
<p>Validation supplies explicit checks of the declared model contract
before rendering. Passing those checks establishes their scoped
conditions, not a certificate of every later numerical or backend
behavior; execution and analysis retain their own validation and
source-bound receipts.</p>
<h2 data-number="4.3" id="rendering-to-multiple-backends"><span
class="header-section-number">4.3</span> Rendering to Multiple
Backends</h2>
<p>The central act of the “Triple Play” is turning a validated
specification into executable cognitive models. The rendering stage
emits backend-specific code for 12 registered target frameworks — PyMDP,
RxInfer.jl, ActiveInference.jl, JAX, DisCoPy, PyTorch, NumPyro, Stan,
bnlearn, cpomdp, THRML, ngc-learn — so that a single GNN model can be
instantiated as a simulation in whichever computational ecosystem a
researcher already works in. Each backend is addressed through a
registry key that maps the abstract model onto that framework’s idioms
for representing generative models and performing inference. The full
mapping from registry key to backend is given below.</p>
<div class="table-scroll" role="region" tabindex="0" aria-label="Scrollable table: Table 3: Render targets declared in src/gnn/render/framework_registry.py , one row per registry key in registry order…"><table id="tbl:backend_registry" data-responsive-table="true">
<caption>Table 3: Render targets declared in
<code>src/gnn/render/framework_registry.py</code>, one row per registry
key in registry order. The <em>Executes</em> column is the registry’s
own <code>supports_execution</code> flag: 12 of 12 backends have a
Step-12 executor, and a <code>render-only</code> entry would mean
generated code with no Step-12 executor. Read this table against tbl. <a
href="#tbl:model_families">5</a>, which shows which families actually
target each backend.</caption>
<thead>
<tr>
<th>Registry key</th>
<th>Backend</th>
<th>Executes</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>pymdp</code></td>
<td>PyMDP</td>
<td>yes</td>
</tr>
<tr>
<td><code>rxinfer</code></td>
<td>RxInfer.jl</td>
<td>yes</td>
</tr>
<tr>
<td><code>activeinference_jl</code></td>
<td>ActiveInference.jl</td>
<td>yes</td>
</tr>
<tr>
<td><code>jax</code></td>
<td>JAX</td>
<td>yes</td>
</tr>
<tr>
<td><code>discopy</code></td>
<td>DisCoPy</td>
<td>yes</td>
</tr>
<tr>
<td><code>pytorch</code></td>
<td>PyTorch</td>
<td>yes</td>
</tr>
<tr>
<td><code>numpyro</code></td>
<td>NumPyro</td>
<td>yes</td>
</tr>
<tr>
<td><code>stan</code></td>
<td>Stan</td>
<td>yes</td>
</tr>
<tr>
<td><code>bnlearn</code></td>
<td>bnlearn</td>
<td>yes</td>
</tr>
<tr>
<td><code>cpomdp</code></td>
<td>cpomdp</td>
<td>yes</td>
</tr>
<tr>
<td><code>thrml</code></td>
<td>THRML</td>
<td>yes</td>
</tr>
<tr>
<td><code>ngclearn</code></td>
<td>ngc-learn</td>
<td>yes</td>
</tr>
</tbody>
</table></div>
<p>Because rendering is kind-aware, the registry is best read as a
capability matrix rather than a flat list: which backends can render a
discrete categorical model, which can render a continuous
linear-Gaussian model, and which have execution adapters at Step 12.
That per-framework, per-kind view is auto-injected below.</p>
<div class="table-scroll" role="region" tabindex="0" aria-label="Scrollable table: Table 4: Model kinds each render framework supports, read entirely from the flags in src/gnn/render/framework_registr…"><table id="tbl:framework_capability" data-responsive-table="true">
<caption>Table 4: Model kinds each render framework supports, read
entirely from the flags in
<code>src/gnn/render/framework_registry.py</code> — the same source as
tbl. <a href="#tbl:backend_registry">3</a>. A continuous cell of
<code>unsupported</code> is the renderer’s own status for
continuous-state models; continuous-only targets do not render
categorical models. An executor entry declares dispatch support, not
acceptance of every model or inference mode; a render-only entry has no
Step-12 executor. Read with tbl. <a href="#tbl:model_kinds">1</a>, which
groups the same flags by model kind.</caption>
<thead>
<tr>
<th>Framework</th>
<th>Discrete render</th>
<th>Continuous render</th>
<th>Executor status</th>
</tr>
</thead>
<tbody>
<tr>
<td>PyMDP</td>
<td>yes</td>
<td>unsupported</td>
<td>executor</td>
</tr>
<tr>
<td>RxInfer.jl</td>
<td>yes</td>
<td>yes</td>
<td>executor</td>
</tr>
<tr>
<td>ActiveInference.jl</td>
<td>yes</td>
<td>unsupported</td>
<td>executor</td>
</tr>
<tr>
<td>JAX</td>
<td>yes</td>
<td>yes</td>
<td>executor</td>
</tr>
<tr>
<td>DisCoPy</td>
<td>yes</td>
<td>unsupported</td>
<td>executor</td>
</tr>
<tr>
<td>PyTorch</td>
<td>yes</td>
<td>yes</td>
<td>executor</td>
</tr>
<tr>
<td>NumPyro</td>
<td>yes</td>
<td>yes</td>
<td>executor</td>
</tr>
<tr>
<td>Stan</td>
<td>yes</td>
<td>yes</td>
<td>executor</td>
</tr>
<tr>
<td>bnlearn</td>
<td>yes</td>
<td>unsupported</td>
<td>executor</td>
</tr>
<tr>
<td>cpomdp</td>
<td>no</td>
<td>yes</td>
<td>executor</td>
</tr>
<tr>
<td>THRML</td>
<td>yes</td>
<td>unsupported</td>
<td>executor</td>
</tr>
<tr>
<td>ngc-learn</td>
<td>no</td>
<td>yes</td>
<td>executor</td>
</tr>
</tbody>
</table></div>
<p>The registry surface of these backends — registry key, display name,
implementation language, and which of them the cross-framework gate
compares — is summarized in fig. <a href="#fig:backend_matrix">4</a>;
the family-by-backend coverage itself is shown in fig. <a
href="#fig:family_matrix">6</a>.</p>
<figure id="fig:backend_matrix">
<a class="figure-full-size-link" href="../figures/gnn_backend_capability_matrix.png" target="_blank" rel="noopener" aria-label="Open full-size Figure 4, The GNN rendering backend registry as a table: one row per registered backend, with its…"><img src="../figures/gnn_backend_capability_matrix.png"
style="width:85.0%"
alt="Table of the registered rendering backends, one row each, with columns for registry key, display name, implementation language, whether a render-output subdirectory exists under src/gnn/render/, and the backend&#x27;s role in the cross-framework reference comparison. Highlighted rows are the backends the reliability gate profiles; a backend the family declares but the gate never profiles is marked separately." /><span class="figure-full-size-label" aria-hidden="true">Open full-size figure</span></a>
<figcaption>Figure 4: The GNN rendering backend
registry as a table: one row per registered backend, with its registry
key, display name, implementation language, whether a render-output
subdirectory exists under <code>src/gnn/render/</code>, and its role in
the cross-framework reference comparison. Amber rows are the backends
the reliability gate profiles for the continuous family; the tan row
(Stan, ngc-learn) is declared by that family but sits outside the
maintained set, so it is never profiled; a red Render-Subdir cell would
mean a registry entry with no subdirectory. The table is read directly
from <code>src/gnn/render/framework_registry.py</code> and the
model-family manifest at commit 92f285b5b, and its footer summarizes the
row counts. Take-away: registration, render presence, and profiling
status are three different claims, and the table keeps them
apart.</figcaption>
</figure>
<h3 data-number="4.3.1" id="rendering-by-model-kind"><span
class="header-section-number">4.3.1</span> Rendering by Model Kind</h3>
<p><strong>Discrete categorical models</strong> use the
categorical-capable renderers, subject to each renderer’s dimension,
parameter, and composition checks. The continuous-only cpomdp and
ngc-learn targets report these models as <code>unsupported</code>.
Experimental THRML must be selected explicitly: it implements
fixed-action categorical posterior sampling, with bounded independent or
validated joint compositions, and does not optimize policies or expected
free energy. Registry membership therefore does not imply categorical
support for every target or every categorical composition; the profiled
cross-framework reference in sec. <a
href="#sec:artifacts_evidence">5</a> is a separate, selected
comparison.</p>
<p><strong>Continuous linear-Gaussian models</strong> take the native
paths built for them. The RxInfer.jl renderer carries dedicated
continuous strategies that emit reactive message-passing code over the
Gaussian state-space model; the JAX, PyTorch, and NumPyro renderers
generate standalone scripts that filter the belief state numerically —
and, when the closed-loop declarations of eq. <a
href="#eq:closed_loop">11</a> are present, steer it toward the preferred
state — with the JAX lane enabling 64-bit precision for the covariance
arithmetic; and the Stan renderer emits the model as a probabilistic
program. The categorical-only backends — pymdp, ActiveInference.jl,
DisCoPy, and bnlearn — do not fabricate a translation: each reports the
continuous model as <code>unsupported</code>, with a recorded reason,
and the status is counted under unsupported framework renderings rather
than as a failure — never rendered, never executed, and excluded from
the success denominator so the run’s rate measures the backends that
could actually attempt the model. DisCoPy’s boundary is representative:
its translator draws categorical POMDP string diagrams and has no
linear-Gaussian diagram semantics, so a continuous model is reported
unsupported rather than drawn as a discrete stand-in.</p>
<p><strong>Composed kinds</strong> require admission of the whole
declared composition, not just one recognized substrate. Supported
categorical multi-agent paths map per-agent declarations to their target
structures. Independent continuous agents use native JAX or RxInfer.jl
paths only when independence and a complete linear-Gaussian parameter
block for every agent are declared; other continuous-agent compositions
are reported <code>unsupported</code>. Generic hierarchical paths
without a semantic execution contract may compose per-level matrices
into a joint POMDP or use the RxInfer.jl two-level strategies; the
maintained <code>block_reset_v1</code> and
<code>timed_soft_controller_v1</code> fixtures instead route to
structure-preserving JAX execution and are explicitly unsupported
elsewhere; parameter-learning paths use strategies for the declared
Dirichlet matrix. These paths retain backend-specific capability
boundaries, and a recognized component does not authorize silently
dropping another declared component.</p>
<p><strong>Structural wrappers</strong> have no renderable form at all:
they declare boundary structure only, with neither a categorical nor a
continuous parameterization, so every framework reports them
<code>unsupported</code> upstream with the structural-spec reason rather
than silently rendering them as a discrete stand-in that would fail on
missing matrices. The status is the design working, not a defect: a
wrapper is an interface statement, and the pipeline’s response is to say
so in every receipt rather than to guess a model body the author never
declared.</p>
<p>By generating code rather than asking authors to port models by hand,
the method keeps a single source of truth in the notation while still
reaching the discrete message-passing libraries <span class="citation"
data-cites="heins2022">(<a href="#ref-heins2022"
role="doc-biblioref">Heins et al. 2022</a>)</span>, reactive
message-passing lineage <span class="citation"
data-cites="bagaev2021reactiveMessagePassing">(<a
href="#ref-bagaev2021reactiveMessagePassing" role="doc-biblioref">Bagaev
and Vries 2021</a>)</span>, and categorical, diagrammatic frameworks
<span class="citation" data-cites="defelice2021">(<a
href="#ref-defelice2021" role="doc-biblioref">Felice et al.
2021</a>)</span> that different research communities have built. The
underlying mathematics that compatible backends share — inference over
the generative model the notation declares, whether that is categorical
free-energy minimization <span class="citation"
data-cites="dacosta2020 smith2022">(<a href="#ref-dacosta2020"
role="doc-biblioref">Da Costa et al. 2020</a>; <a href="#ref-smith2022"
role="doc-biblioref">Smith et al. 2022</a>)</span> or Gaussian filtering
and control — is the common substrate the renderer attempts to preserve;
where a backend cannot express a kind faithfully, GNN records that
boundary as an explicit unsupported status rather than treating all
registered backends as equivalent.</p>
<h2 data-number="4.4" id="execution"><span
class="header-section-number">4.4</span> Execution</h2>
<h3 data-number="4.4.1" id="executing-by-model-kind"><span
class="header-section-number">4.4.1</span> Executing by Model Kind</h3>
<p>Generated backend code is not left as a static artifact. The
execution stage (step 12) runs the rendered models, driving the
inference and behavior that the notation describes and producing
concrete traces, beliefs, and outputs. The 12 render targets — PyMDP,
RxInfer.jl, ActiveInference.jl, JAX, DisCoPy, PyTorch, NumPyro, Stan,
bnlearn, cpomdp, THRML, ngc-learn — have implemented execution adapters
at this step. This is a registry claim, not evidence that every adapter
has run in a given environment. Model-kind admission, validated
parameters, package and toolchain readiness, supported Python, and
remaining budgets determine whether an execution can proceed; the
current-run receipt records its actual outcome.</p>
<p><strong>Discrete executors</strong> run the categorical models end to
end, and they guard their own runtime assumptions: the generated pymdp
scripts, for example, sanity-check the installed library for the current
Agent interface at startup and exit fast with a clear message when an
unsupported wheel is present, so a stale environment produces a legible
diagnostic instead of a mysterious failure deep in a simulation
loop.</p>
<p><strong>Continuous executors</strong> run the generated standalone
scripts over the Gaussian state-space model — filtering to a posterior,
and with the closed-loop declarations in place, closing the control loop
on beliefs — so a continuous model produces traces on the same terms as
a discrete one, on the backends that carry the kind.</p>
<p><strong>Generator-backed and render-adjacent lanes</strong> extend
execution beyond the registry’s render paths. The bnlearn lane is
generator-backed: it renders a runnable Python program from the same
parsed model the other lanes consume, and it skips with a recorded
status when the <code>bnlearn</code> package is absent, so a lean
checkout degrades explicitly rather than failing. A separate
execute-side bridge verifies rendered Lean documents against the
fep_lean bridge contract, which is how the notation reaches a proof
assistant without a render-registry entry. Skipped, degraded, and
unsupported lanes are recorded as explicit statuses in the
cross-framework comparison rather than silently omitted.</p>
<p>For a successfully executed, source-bound model, this closes the loop
from text to numerical traces. Claims about its behavior require the
actual result, inference mode, environment, and validation receipts; a
generated script or implemented adapter alone does not establish that
behavior.</p>
<h2 data-number="4.5" id="long-running-orchestration-contracts"><span
class="header-section-number">4.5</span> Long-Running Orchestration
Contracts</h2>
<p>GNN 3.0.0 extended the pipeline with three safe-by-design
orchestration contracts that let an extended run be observed, paused,
resumed, and audited without ever mutating live infrastructure.
<em>Durable observation streams</em> record file- and array-backed
stream manifests with content checksums and replayable execution traces,
so that a long run can be re-derived deterministically before any live
sensor or device-backed stream is introduced. <em>Resumable run
sessions</em> carry run-session manifests with atomic checkpoint and
resume, status inspection, and cancellation-safe cleanup, so that an
extended model-family acceptance run can be interrupted and resumed
without corrupting partial state. <em>Auditable container plans</em>
generate hardened container plans together with an explicit static
security review and a rollback descriptor, deliberately stopping short
of touching any real cluster. Each contract only generates and validates
data; none performs live mutation, and each is governed by a strict
acceptance gate and exercised through dedicated Model Context Protocol
tools. fig. <a href="#fig:orchestration">5</a> shows how the three
contracts compose into one inspectable orchestration surface.</p>
<figure id="fig:orchestration">
<a class="figure-full-size-link" href="../figures/gnn_orchestration.png" target="_blank" rel="noopener" aria-label="Open full-size Figure 5, The three safe-by-design orchestration contracts introduced in GNN 3.0.0, side by side…"><img src="../figures/gnn_orchestration.png" style="width:85.0%"
alt="The three long-running orchestration contracts side by side — durable observation streams, resumable run sessions, and auditable container plans — each shown with the artifacts it generates and validates, and each stopping short of any live mutation." /><span class="figure-full-size-label" aria-hidden="true">Open full-size figure</span></a>
<figcaption>Figure 5: The three safe-by-design
orchestration contracts introduced in GNN 3.0.0, side by side inside the
dashed boundary that states their shared invariant: generate and
validate data only, never mutate live infrastructure. Each column names
the contract’s source module under <code>src/gnn/pipeline/</code> and
chains its stages top to bottom — StreamManifest, ExecutionTrace, and
replay for durable observation streams; checkpoint, resume, status, and
safe cleanup for resumable run sessions; generate, static security
review, and rollback for container plans. Arrows give the order the
stages run in, and nothing exits the boundary. The panel is a
fixed-layout drawing of the three contracts; the acceptance gates and
the Model Context Protocol tools that exercise them are described in the
text above. Take-away: long-running orchestration gains capability only
as fast as it becomes inspectable.</figcaption>
</figure>
<h2 data-number="4.6" id="analysis-visualization-and-reporting"><span
class="header-section-number">4.6</span> Analysis, Visualization, and
Reporting</h2>
<p>The final group of stages turns execution results into interpretable
evidence. Analysis (step 16) processes the outputs of execution into
structured findings; visualization (step 8) and the rendering of figures
(step 9) translate model structure and results into graphical form,
supporting the graphical leg of the Triple Play; and the reporting stage
(step 23) assembles these artifacts into a coherent summary of what the
model is and how it behaved. Known output locations and current-run
identity indexes connect a notation file to its report artifacts.
Tracing a figure or number requires its selected model identity and
source, script, result, and artifact receipts; an output path alone is
insufficient evidence of a current run. Analysis reads the per-kind
rendering and execution receipts as well: a continuous model whose
categorical-only lanes report <code>unsupported</code> yields a
different evidence profile than one whose continuous-capable lanes
failed, and the reports keep those situations apart.</p>
<h2 data-number="4.7" id="reproducibility-and-auto-injection"><span
class="header-section-number">4.7</span> Reproducibility and
Auto-Injection</h2>
<p>Every count reported in this manuscript is emitted by the producer
<code>scripts/z_generate_manuscript_variables.py</code> from the
repository state at commit 92f285b5b, not typed by hand. The producer
reads that commit’s source surfaces directly — the step modules, the
source tree, the model-family manifest, and the framework registry —
together with the project’s maintained ledgers, notably the Model
Context Protocol tool audit (<code>src/gnn/mcp/audit_report.json</code>,
itself regenerated by the test suite). From these it emits a manifest of
named tokens — counts of pipeline steps and their modules, source
packages and files, model families, backends, example files partitioned
by model kind, tests, and tools — plus the two capability tables this
manuscript injects: the model-kind table (tbl. <a
href="#tbl:model_kinds">1</a>) and the framework capability matrix
(tbl. <a href="#tbl:framework_capability">4</a>). The renderer
substitutes the tokens into the prose at build time. Filesystem-derived
counts are recomputed on every run; ledger-derived counts (such as the
backend registry) are re-read from a fixed repository state, so a fixed
repository state yields the same values, and authors are prohibited from
hard-coding any number that has a corresponding token. This makes the
manuscript a faithful, regenerable description of the system it
documents: when the 25-step pipeline, the 12 rendering backends, or the
38-file example corpus change — or when the discrete-to-continuous
exemplar balance shifts — the reported numbers change with them on the
next build, and <code>scripts/check_manuscript_tokens.py</code> fails
the build if a section reintroduces a literal that a token already
owns.</p>
<h3 data-number="4.7.1" id="bounded-file-processing"><span
class="header-section-number">4.7.1</span> Bounded file processing</h3>
<p>Parsing/serialization and type checking accept an explicit per-step
file-worker limit. Spawned processes compute file outcomes while the
parent owns publication in the frozen model-selection order. Admission
retains source identities and rejects noninteger or out-of-range limits
before output setup. Scheduling and publication check cancellation and
the run deadline, and abnormal process completion triggers cleanup of
the owned children. Independent pipeline-step concurrency has a separate
limit, so concurrently running steps may each create a file pool;
neither setting specifies CPU affinity or a global operating-system
quota. The default remains serial because worker startup and
serialization can exceed the cost of processing small files. Profiling
records unprofiled wall times, separate parent and terminated-child CPU
times, runtime/source/input identities and the PIDs that actually return
results; deterministic traces describe their calling thread rather than
unobserved worker internals.</p>
<hr />
<h1 data-number="5" id="sec:artifacts_evidence"><span
class="header-section-number">5</span> Artifacts and Evidence</h1>
<p>This section reports what the project has actually produced and how
each quantitative claim is grounded. Every number below is substituted
at render time from the deterministic producer, which reads the
repository state at commit 92f285b5b, so each figure here is regenerated
from the artifacts it describes rather than transcribed.</p>
<h2 data-number="5.1" id="model-family-coverage"><span
class="header-section-number">5.1</span> Model-Family Coverage</h2>
<p>GNN ships a curated corpus of model families that exercise the
language across the difficulty gradient from minimal parser fixtures to
full multi-agent and scaling studies. The manifest registers 9 families
(basics, discrete, continuous, hierarchical, multiagent, precision,
structured, gridworld, scaling-study) across 9 target directories, and
<code>input/gnn_files</code> holds 12 corpus directories containing 38
concrete example models. The three sets are not coextensive, and the
manuscript does not treat them as one. Registered in no family:
<code>input/gnn_files/learning</code>,
<code>input/gnn_files/recursive</code>,
<code>input/gnn_files/thrml</code> (3 of the 12 corpus directories),
covered in sec. <a href="#sec:limitations_next_steps">7</a>. Registered
but outside the scanned tree: none, because all 9 target directories are
themselves <code>input/gnn_files</code> corpus directories. Each family
declares the simulation frameworks it is meant to drive, which is what
lets the same text model fan out across the executable-model leg of the
Triple Play <span class="citation" data-cites="gnn2023">(<a
href="#ref-gnn2023" role="doc-biblioref">Smékal and Friedman
2023</a>)</span>. The families and their declared frameworks are
enumerated below.</p>
<p>The exemplar corpus partitions cleanly by model kind, and the
partition is itself a token: 29 of the 38 example specifications are
discrete-state — the discrete categorical kind and its composed variants
— and 9 are continuous linear-Gaussian specifications in the continuous
family folder. The cold-start index
<code>input/gnn_files/INDEX.md</code> catalogues every exemplar with its
kind, its task folder, and a suggested reading order, and is the fastest
surface for a reader who wants to move from this prose to a runnable
file of a given kind.</p>
<p>Families that declare a capability axis (the continuous family
declares the continuous-render axis) carry a backend split in tbl. <a
href="#tbl:model_families">5</a> generated directly from the registry’s
declared capability flags. This avoids a manually copied registry table;
actual model admission still depends on the full parameter and
composition checks recorded by the renderer. The generated flags
describe declared capability, while current-run receipts record which
selected backends were actually attempted, unsupported, skipped, or
failed. The profiled cross-framework reference uses the continuous
family, so it does not establish categorical coverage across the
registry (tbl. <a href="#tbl:framework_capability">4</a> is the per-kind
key).</p>
<div class="table-scroll" role="region" tabindex="0" aria-label="Scrollable table: Table 5: Model families declared in input/model_family_manifest.json with the simulation frameworks each family targe…"><table id="tbl:model_families" data-responsive-table="true">
<caption>Table 5: Model families declared in
<code>input/model_family_manifest.json</code> with the simulation
frameworks each family targets and a generated description. The
<em>Frameworks</em> column is the family’s declared targets, verbatim
from the manifest; the capability splits appended to some descriptions
are generated from <code>src/gnn/render/framework_registry.py</code>
flags, not authored in the manifest, so they cannot disagree with the
registry. Read with tbl. <a href="#tbl:backend_registry">3</a> (what
each backend is) and fig. <a href="#fig:family_matrix">6</a> (the same
coverage as a matrix).</caption>
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
</colgroup>
<thead>
<tr>
<th>Family</th>
<th>Frameworks</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>basics</code></td>
<td>pymdp</td>
<td>Minimal perception fixtures used for parser and validator smoke
coverage.</td>
</tr>
<tr>
<td><code>discrete</code></td>
<td>pymdp, jax</td>
<td>Discrete POMDP, passive HMM filtering and episodic contingent T-maze
fixtures.</td>
</tr>
<tr>
<td><code>continuous</code></td>
<td>rxinfer, jax, pytorch, numpyro, stan, ngclearn</td>
<td>Continuous-state linear-Gaussian fixtures (F/H/Q/R + Gaussian prior;
continuous_navigation closes the loop on beliefs; ngc-learn LGSSM
exemplar for the ngclearn backend). Native on RxInfer.jl, JAX, PyTorch,
NumPyro, Stan, cpomdp, ngc-learn; reported unsupported (not failed) on
PyMDP, ActiveInference.jl, DisCoPy, bnlearn, THRML.</td>
</tr>
<tr>
<td><code>hierarchical</code></td>
<td>jax</td>
<td>Declared block-reset hierarchy and approximate 10/100-clock
soft-message controller fixtures.</td>
</tr>
<tr>
<td><code>multiagent</code></td>
<td>rxinfer</td>
<td>Multi-agent coordination and swarm fixtures.</td>
</tr>
<tr>
<td><code>precision</code></td>
<td>pymdp</td>
<td>Precision weighting and curiosity-driven fixtures.</td>
</tr>
<tr>
<td><code>structured</code></td>
<td>pymdp</td>
<td>Structured factor graph and posterior fixtures.</td>
</tr>
<tr>
<td><code>gridworld</code></td>
<td>pymdp, rxinfer, activeinference_jl</td>
<td>Gridworld POMDP fixture used for cross-framework acceptance
checks.</td>
</tr>
<tr>
<td><code>scaling-study</code></td>
<td>pymdp</td>
<td>PyMDP scaling-study fixtures, sampled conservatively for
acceptance.</td>
</tr>
</tbody>
</table></div>
<p>The family-by-framework structure is shown in fig. <a
href="#fig:family_matrix">6</a>, which renders the coverage matrix
directly from the family registry rather than from a hand-maintained
table.</p>
<figure id="fig:family_matrix">
<a class="figure-full-size-link" href="../figures/gnn_family_framework_matrix.png" target="_blank" rel="noopener" aria-label="Open full-size Figure 6, Model-family coverage across the registered rendering backends: one row per family from…"><img src="../figures/gnn_family_framework_matrix.png"
style="width:85.0%"
alt="Grid of model families (rows) against rendering backends (columns). A filled cell means the family declares that backend in input/model_family_manifest.json. The grid is sparse: most families declare a single backend, and only the continuous, discrete and gridworld families declare several. Cells record declared coverage, not profiled outcomes." /><span class="figure-full-size-label" aria-hidden="true">Open full-size figure</span></a>
<figcaption>Figure 6: Model-family coverage across
the registered rendering backends: one row per family from
<code>input/model_family_manifest.json</code>, one column per backend
from <code>src/gnn/render/framework_registry.py</code>, and a green cell
wherever the family declares that backend in its <code>frameworks</code>
field. The right-hand count states how many backends each family
declares; the grid is deliberately sparse — most families declare a
single backend, and only continuous, discrete, and gridworld declare
several. Read it as declared intent, not as profiled outcomes: the gates
described below supply the outcomes. The matrix is generated from the
two registries at commit 92f285b5b.</figcaption>
</figure>
<p>These families are not illustrative prose: they are the inputs over
which the parser, the type checker, and the cross-framework code
generators are exercised, and they are the substrate for the reliability
gates described next.</p>
<h2 data-number="5.2"
id="semantic-fidelity-and-cross-framework-reliability-gates"><span
class="header-section-number">5.2</span> Semantic-Fidelity and
Cross-Framework Reliability Gates</h2>
<p>Two command-defined gates check distinct parts of GNN’s shared-source
contract on selected family fixtures. Both live under
<code>scripts/</code> and use the family manifest described above. Their
actual source-bound command receipts determine the scope and outcome of
verification; the presence of a gate is not itself a passing result.</p>
<p>The semantic-fidelity gate,
<code>scripts/run_semantic_fidelity_gate.py</code>, checks
parse–serialize–parse preservation using the versioned
<code>gnn_semantic_contract_v2</code> contract. It compares model
identity, variables, edges, parameter names, shapes, values and
metadata, equations, timing, and ontology mappings; the default strict
round trip is JSON. Parameter values and their axis order contribute to
the contract hash, so changing values without changing shape changes the
hash. The digest binds the represented contract; it does not prove that
extraction was correct, that generated inference implements the intended
mathematics <span class="citation" data-cites="dacosta2020">(<a
href="#ref-dacosta2020" role="doc-biblioref">Da Costa et al.
2020</a>)</span>, or that independent numerical executions agree. The
gate reports scoped fidelity per selected model and format.</p>
<p>A separate numerical witness foundation independently reads a
deliberately restricted source subset without importing the production
parser or renderer. For a small asymmetric categorical model, exhaustive
latent-path enumeration distinguishes filtering on each observation
prefix from smoothing on the complete sequence; actual bnlearn filtering
is compared with the former. For a passive linear-Gaussian model with
rectangular observations, nonzero means and correlated covariances, an
independent joint-Gaussian construction conditions each observation
prefix and is compared with every posterior mean and full covariance
from the generated JAX filter. The first observation uses the declared
prior without an extra prediction. Exact source bytes, variable and axis
identities, conditioning horizons, numerical precision and
quantity-specific tolerances remain explicit. Counterexamples change
source identity, orientation, transition/action timing, conditioning,
initial prediction, covariance or precision. These finite, source-bound
comparisons do not establish universal extraction or backend
equivalence, planning correctness or a new Lean proof; formal evidence
remains separately scoped.</p>
<p>The replayable <code>gnn-semantic-witness-v2</code> receipt retains
the exact source, native result and generated-program bytes together
with the independently reconstructed reference and per-quantity
outcomes. The <code>gnn witness</code> interface rebuilds the entire
receipt before accepting a passing numerical outcome; saved arrays or a
prior verdict cannot replace this reconstruction. FEP_Formal
independently replays the same restricted cases with forward Bayes and
recursive Kalman/Joseph updates, using different algorithms from finite
path enumeration and joint-Gaussian conditioning. Separate Lean checks
establish finite-weight normalization and scalar measurement/covariance
identities under their explicit assumptions. These scalar laws are a
structural analogue of the multidimensional Gaussian fixture, not a
proof of its parser, runner or complete translation. Numerical
agreement, source custody, actual program execution and formal
compilation remain separate evidence planes.</p>
<p>An additional <code>gnn-semantic-witness-v3</code> contract admits
two independent stationary passive Gaussian agents. It reconstructs
their authored source independently, builds the joint block-diagonal
Gaussian model and conditions observation prefixes, while retaining
complete native JAX child records and their within-agent covariance
matrices. A separate FEP adapter checks those same authored inputs and
native records with recursive Kalman/Joseph updates. The cross-agent
zero covariance is a consequence of the declared product model, not a
measured native joint covariance. Separate finite post-evidence
product-weight laws and false-claim controls establish their stated
algebraic premises; they do not prove Gaussian conditioning, a parser or
generated execution. Coupling, shared noise, control and unsupported
source or conditioning contracts refuse explicitly.</p>
<p>The generated website exposes reported outcomes through offline
status/text filters, posterior and covariance-variance traces, and
residual views, with full tables and raw receipts available alongside
them. Per-agent selectors and full covariance tables expose retained
component results; separate cards show the independent FEP comparisons
and finite compiler controls with their stated scope. Changing a display
control does not rerun a numerical reference or a proof compiler.
Missing or incompatible evidence remains unavailable or refused; an
informative visualization cannot strengthen its underlying scientific
claim.</p>
<p>The cross-framework reliability gate,
<code>scripts/run_cross_framework_reliability.py</code>, takes a single
GNN model and renders it across multiple simulation backends, then
checks that the resulting executable models agree on the structure they
were generated from. The reference comparison runs on the continuous
family across RxInfer.jl, JAX, PyTorch, NumPyro — 4 independent Active
Inference engines spanning the Python and Julia ecosystems <span
class="citation" data-cites="heins2022">(<a href="#ref-heins2022"
role="doc-biblioref">Heins et al. 2022</a>)</span>. The family declares
6 backends (RxInfer.jl, JAX, PyTorch, NumPyro, Stan, ngc-learn); Stan,
ngc-learn is declared but not among the 7 frameworks the gate profiles,
so it is excluded from the comparison. Because the same source model
drives all 4 renderings, source identity helps investigate disagreement.
The gate compares shared matrix shapes, trace lengths, timesteps, and
reported seeds, recording absent comparable fields separately. These
checks do not establish numerical equivalence: a mismatch may arise from
extraction, code generation, runtime or toolchain behavior, inference
mode, dtype, or a backend defect. Numerical comparisons require
compatible models and inference semantics, explicit tolerances, and
source-bound numerical witnesses.</p>
<p>Both gates are stated here as commands you can run, not as asserted
pass counts. The manuscript deliberately does not quote a fixed number
of passing checks: an authoritative result is a retained command receipt
bound to its source revision, selected corpus, environment, and
artifacts, and binding a frozen count into prose would invite exactly
the drift the auto-injection contract exists to prevent.</p>
<p>A third interchange check extends the same discipline across
repositories: <code>scripts/run_geo_interchange_checks.py</code>
validates the committed pin in <code>.github/gnn-pair.json</code>
against a selected GEO-INFER checkout and replays exported GNN artifacts
— the tracked gridworld, a compiled H3 stay/diffuse model, a rectangular
Gaussian, and an explicit factored fixture — inside the GEO environment,
writing its receipts even on failure. Like the gates above it is stated
as a command, not as a pass count, and its pinned pair
(<code>ActiveInferenceInstitute/GEO_INFER</code> at a recorded revision)
is what makes “interchange” a checkable claim rather than a promise.</p>
<h2 data-number="5.3" id="source-preserving-llm-processing"><span
class="header-section-number">5.3</span> Source-Preserving LLM
Processing</h2>
<p>The LLM analysis step retains exact UTF-8 source parts, task
identities, native responses and resumable checkpoints. Its opt-in
<code>joint_source</code> mode makes a final request containing the
original source and all ordered fragment answers for each multipart
task; <code>part_evidence</code> instead supplies derived answers and
source identities. The latter mode does not present the original source
jointly, and neither silently substitutes for the other. Every submitted
source block, task and output reserve must fit the selected model’s
context; <code>joint_source</code> additionally requires the complete
original to fit its final request. Exact source, request, response and
dependency hashes bind cache and resume; incomplete or nonterminal
native outputs remain unfinished.</p>
<p>Context admission is limited to reviewed Ollama GGUF runtime
contracts. It binds the exact model digest, advertised and loaded
capacity, request messages, native usage and declared output reserve,
with explicit no-shortening controls and overflow refusal. This is
admission under a reviewed provider contract, not an independent
tokenizer or attention measurement. A retained explicit
<code>qwen3-coder:30b</code> profile checks controlled cross-part fact
recovery and a resume with no new generations; they do not establish
general scientific interpretation, arbitrarily large source coverage or
another model’s completion quality. The website presents retained
evidence without strengthening those claims.</p>
<h2 data-number="5.4" id="repository-scale"><span
class="header-section-number">5.4</span> Repository Scale</h2>
<p>The repository’s scale is itself evidence of the surface that the
gates and pipeline cover, and it is reported in fig. <a
href="#fig:repo_metrics">7</a> directly from the tracked files at commit
92f285b5b.</p>
<figure id="fig:repo_metrics">
<a class="figure-full-size-link" href="../figures/gnn_repo_metrics.png" target="_blank" rel="noopener" aria-label="Open full-size Figure 7, Repository-scale counts on a logarithmic axis: pipeline steps, model families, registered…"><img src="../figures/gnn_repo_metrics.png" style="width:80.0%"
alt="Horizontal bar chart on a logarithmic axis of repository-scale counts: pipeline steps, model families, registered backends, render-target adapters, MCP tools, source packages, test files, example models and documentation files. Each bar is annotated with its exact value; all values come from output/data/manuscript_variables.json." /><span class="figure-full-size-label" aria-hidden="true">Open full-size figure</span></a>
<figcaption>Figure 7: Repository-scale counts on a
logarithmic axis: pipeline steps, model families, registered backends,
render-target execution adapters, Model Context Protocol tools, source
packages, test files, example models, and documentation files. Every bar
is annotated with its exact value, and every value is a producer token
read from <code>output/data/manuscript_variables.json</code> at commit
92f285b5b — the same token map that substitutes the prose counts. The
figure-freshness suite binds the committed image digest and its recorded
producer inputs and counts; semantic content and visual correctness
require their own review. The two backend bars are deliberately
distinct: <em>registered backends</em> (12) counts render targets,
<em>render-target adapters</em> (12) counts the render-target subset
with implemented Step 12 execution adapters. It excludes the separate
execution-only Lean bridge and is not a count of observed native runs.
Read the chart as the scale of the surface the pipeline maintains, not
as a quality measure.</figcaption>
</figure>
<p>The test suite comprises 679 test files containing 7071 test
functions, exercising a source base of 777 Python files across 44
packages (233096 lines of source). The pipeline’s step modules — the
thin orchestrators named in tbl. <a href="#tbl:pipeline_steps">2</a> —
number 25, one per numbered step. The Model Context Protocol surface —
which exposes GNN’s capabilities to external agents and tools — provides
164 tools across 36 modules. The pipeline itself runs as 25 steps
(0–24), and 7 figure artifacts from the rendering of figures, models,
and reports are committed under <code>output/</code>, of which 7 are the
manuscript’s own.</p>
<h2 data-number="5.5" id="claim-discipline"><span
class="header-section-number">5.5</span> Claim Discipline</h2>
<p>A claim is manuscript-ready only when it is bound to a verifiable
artifact. Concretely, every claim in this manuscript must rest on one of
four support types:</p>
<ul>
<li>A retained passing test or validator command receipt, bound to the
source revision, selected inputs, environment, and artifacts — for
example a scoped execution of the semantic-fidelity or cross-framework
gates above.</li>
<li>A generated output produced by a deterministic producer, such as the
figures rendered from the family and repository scans, or the token
values emitted by the manuscript-variable producer that backs every
number on this page.</li>
<li>A source ledger, manifest, or configuration file that fixes a
declared value or capability; actual execution still requires its own
result receipt.</li>
<li>A resolved entry in <code>references.bib</code> for any
external-literature claim <span class="citation"
data-cites="friston2010 parr2022">(<a href="#ref-friston2010"
role="doc-biblioref">Friston 2010</a>; <a href="#ref-parr2022"
role="doc-biblioref">Parr et al. 2022</a>)</span>.</li>
</ul>
<p>The pipeline records its own evidence trail under
<code>output/</code>. The run-level summary is written to
<code>output/PIPELINE_REPORT.md</code>, and the per-step execution
record — including which steps ran, their status, and their artifacts —
is captured in <code>output/00_pipeline_summary</code>. Readers should
use those current-run records and their identity bindings to assess
actual pipeline outcomes. Repository counts and declared capability
tokens describe the source surface and do not by themselves establish
native execution or scientific correctness. When a value would otherwise
need a literal number with no producer behind it, the discipline is to
omit the number rather than to hard-code it.</p>
<hr />
<h1 data-number="6" id="sec:reproducibility"><span
class="header-section-number">6</span> Reproducibility</h1>
<p>Reproducibility in GNN is a source- and run-binding contract across
the 0–24 processing steps. Fixed-source parsing and token production are
distinct from stochastic inference, dependency provisioning, and
environment-dependent execution. Reproducing a reported outcome requires
the selected inputs, configuration, source revision, dependencies,
dtype, seed, and retained command and artifact receipts. This section
lists only commands that exist in the repository, so that a reader with
a clean checkout can reproduce the pipeline, the validation gates, and
this manuscript itself.</p>
<h2 data-number="6.1" id="pipeline-smoke-run"><span
class="header-section-number">6.1</span> Pipeline Smoke Run</h2>
<p>The fastest way to confirm a working installation is to drive the
full pipeline over the discrete model family without invoking the
optional LLM steps:</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run python src/gnn/main.py <span class="dt">\</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>  <span class="at">--target-dir</span> input/gnn_files/discrete <span class="dt">\</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a>  <span class="at">--output-dir</span> /tmp/gnn-smoke <span class="dt">\</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a>  <span class="at">--skip-llm</span></span></code></pre></div>
<p>This parses the discrete GNN files, runs visualization and rendering
across the maintained backends, and writes all artifacts under the
chosen output directory. The <code>--skip-llm</code> flag disables the
LLM processing step; it does not establish network isolation or
guarantee that every other step executes. Default framework selection
excludes the experimental targets, and dependency readiness, model-kind
admission, configured steps, and budgets determine the actual work.
Inspect the current-run statuses and terminal exit code (0 success, 1
error, 2 warning); missing or unfinished required work must remain a
non-success outcome. To exercise every registered family rather than a
single one, drive the manifest through the model-family acceptance gate
given below: pointing <code>--target-dir</code> at
<code>input/gnn_files</code> covers that tree’s 12 corpus directories.
All 9 registered family target directories lie inside that tree, so a
single invocation reaches every registered family.</p>
<p>The discrete family exercises the categorical kind end to end. The
continuous linear-Gaussian kind smoke-runs the same way, and the
contrast between the two runs is itself a check of the per-kind
contract:</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run python src/gnn/main.py <span class="dt">\</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>  <span class="at">--target-dir</span> input/gnn_files/continuous <span class="dt">\</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>  <span class="at">--output-dir</span> /tmp/gnn-smoke-continuous <span class="dt">\</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>  <span class="at">--skip-llm</span></span></code></pre></div>
<p>This selects the continuous specifications for the same pipeline.
Admitted, ready continuous-capable lanes can render and execute
filtering (and, for the closed-loop exemplar, belief-steering) programs;
categorical-only targets record <code>unsupported</code>, while
readiness and budget failures retain their own outcomes. A reader
comparing the two receipts sees the kind taxonomy behaving as described
in sec. <a href="#sec:system_context">3</a>: same pipeline, same steps,
per-kind rendering and execution reach.</p>
<h2 data-number="6.2" id="validation-gates"><span
class="header-section-number">6.2</span> Validation Gates</h2>
<p>GNN provides strict gates with distinct verification scopes. The
model-family acceptance gate runs the selected manifest families and
evaluates their declared acceptance profiles; its receipt must record
actual execution, unsupported and skipped work, and failures:</p>
<div class="sourceCode" id="cb3"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run python scripts/run_model_family_acceptance.py <span class="dt">\</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>  <span class="at">--manifest</span> input/model_family_manifest.json <span class="dt">\</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>  <span class="at">--output-dir</span> output/model_family_acceptance <span class="at">--strict</span></span></code></pre></div>
<p>The semantic-fidelity gate verifies that a parse → serialize → parse
round trip preserves variables, edges, dimensions, parameter shapes and
values, parameter metadata, equations, time semantics, and ontology
mappings across the 9 model families; the cross-framework gate profiles
the 7 maintained backends (PyMDP, RxInfer.jl, JAX, NumPyro, PyTorch,
ActiveInference.jl, DisCoPy) — refusing any framework outside that set —
and records explicit compatible and unsupported statuses rather than
silently degrading. Both write their ledgers to an output directory of
your choosing:</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run python scripts/run_semantic_fidelity_gate.py <span class="dt">\</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>  <span class="at">--manifest</span> input/model_family_manifest.json <span class="dt">\</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>  <span class="at">--output-dir</span> output/semantic_fidelity <span class="at">--strict</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run python scripts/run_cross_framework_reliability.py <span class="dt">\</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a>  <span class="at">--manifest</span> input/model_family_manifest.json <span class="dt">\</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>  <span class="at">--output-dir</span> output/cross_framework <span class="at">--strict</span></span></code></pre></div>
<p>Under <code>--strict</code>, required mismatches make these gates
exit non-zero, so these commands double as assertions in an automated
reproduction run. Code-quality reproducibility is enforced separately
through the developer command reference: <code>just lint</code> runs the
Ruff linter over <code>src</code> and <code>scripts</code>, and the
broader <code>just quality</code> recipe chains formatting, terminology,
documentation, type, and security checks for a full pre-commit gate.</p>
<h2 data-number="6.3" id="manuscript-reproducibility"><span
class="header-section-number">6.3</span> Manuscript Reproducibility</h2>
<p>This manuscript is itself a reproducible artifact. Every quantitative
value in the prose — the pipeline step count, the family and backend
counts, the source and test inventories — is a token rather than a
hard-coded literal, and the deterministic producer regenerates all of
them from the tracked files at the current commit:</p>
<div class="sourceCode" id="cb5"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run python scripts/z_generate_manuscript_variables.py</span></code></pre></div>
<p>That command recomputes the {{…}} tokens, persists them to
<code>output/data/manuscript_variables.json</code> for audit, and
hydrates the manuscript sources into <code>output/manuscript/</code>.
The manuscript’s own figures are rebuilt from the same token map:</p>
<div class="sourceCode" id="cb6"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run python <span class="at">-m</span> scripts.manuscript_build_figures</span></code></pre></div>
<p>The hydrated sources are then rendered to PDF by the docxology
template’s render stage. That stage lives in a separate checkout of the
template, with this repository checked out inside it as a real directory
at <code>projects/active/GeneralizedNotationNotation</code> (the
template’s analysis-read custody refuses a symlinked project); run from
the template root:</p>
<div class="sourceCode" id="cb7"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">uv</span> run <span class="at">--frozen</span> python scripts/pipeline/stage_03_render.py <span class="dt">\</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>  <span class="at">--project</span> GeneralizedNotationNotation</span></code></pre></div>
<p>The render needs a LaTeX installation providing the packages listed
in <code>manuscript/preamble.md</code> plus <code>seqsplit</code>; the
template guards <code>seqsplit</code> with <code>\IfFileExists</code>,
so a missing copy degrades rather than failing the build.</p>
<p>Because the variables file is regenerated before rendering, the
counts in the rendered PDF track the repository state at the commit
recorded in <code>output/data/manuscript_variables.json</code>
(92f285b5b): a code change that alters, for example, the test inventory
(679 test files, 7071 test functions) propagates into the prose on the
next regeneration without any manual editing.</p>
<h2 data-number="6.4" id="reproducibility-contract"><span
class="header-section-number">6.4</span> Reproducibility Contract</h2>
<ul>
<li>Do not cite results that cannot be regenerated or directly traced to
a command in this repository.</li>
<li>Keep generated outputs under <code>output/</code> and maintained
manuscript source under <code>manuscript/</code>. Regenerate owned build
artifacts when their inputs change, and preserve the raw command
receipts and numerical results needed to substantiate historical
runs.</li>
<li>Express every quantitative claim in the prose as a double-brace
<code>{{...}}</code> token substituted by
<code>scripts/z_generate_manuscript_variables.py</code>, never as a
hard-coded number.</li>
<li>Keep private data, credentials, and unpublished sensitive details
out of the manuscript and out of version control.</li>
<li>Record the exact verification commands — the smoke run, the
acceptance and fidelity gates, and <code>just lint</code> — before
marking this manuscript publication-ready.</li>
</ul>
<hr />
<h1 data-number="7" id="sec:limitations_next_steps"><span
class="header-section-number">7</span> Limitations and Next Steps</h1>
<h2 data-number="7.1" id="current-limitations"><span
class="header-section-number">7.1</span> Current Limitations</h2>
<p>GNN 5.0.3 is a working system with deliberately scoped boundaries,
and it is worth stating those boundaries plainly rather than implying
broader completeness than the artifacts support. The reliability gates
that underpin our confidence in the system — the semantic-fidelity
ledger and the cross-framework reliability ledger — are reproducible by
command and recorded against the 9 model families, but this manuscript
does not assert a particular full-suite pass rate as a headline number.
Pass and skip counts shift with the local toolchain, the presence or
absence of optional simulation dependencies, and whether the optional
Ollama integration paths are exercised, so we retain the reproducing
command together with its source, environment, selected-input, and
artifact bindings, leaving run-specific tallies in the ledgers and
execution traces. A fresh run supplies new evidence for its own
environment; it does not replace a preserved historical receipt.</p>
<p>A second limitation lives at the boundary between the model families
and the rendering backends. GNN registers 12 simulation backends, but
coverage across the family-by-backend matrix is intentionally uneven,
and the gaps are recorded as explicit <em>profiled-unsupported</em>
statuses rather than silently omitted. The cross-framework acceptance
check is anchored on the continuous family, where RxInfer.jl, JAX,
PyTorch, NumPyro are compared directly; selected continuous and
hierarchical lanes carry profiled-unsupported markers at the render and
execute steps (Steps 11 and 12) for backends that cannot yet faithfully
realize their continuous-state or temporal-depth structure. This is
honest bookkeeping, not a defect to be hidden: an unsupported status
with a recorded reason is more trustworthy than a forced translation
that quietly misrepresents the model. It also reflects the state of the
surrounding literature, where expected-free-energy formulations,
variational-inference reductions, and hierarchical active-inference
methods are still being actively refined rather than collapsed into one
settled executable recipe <span class="citation"
data-cites="champion2024reframingEfe nuijten2026typeInference rangarajan2026hierarchicalSuccessor">(<a
href="#ref-champion2024reframingEfe" role="doc-biblioref">Champion et
al. 2024</a>; <a href="#ref-nuijten2026typeInference"
role="doc-biblioref">Nuijten, Lukashchuk, et al. 2026</a>; <a
href="#ref-rangarajan2026hierarchicalSuccessor"
role="doc-biblioref">Rangarajan and Rao 2026</a>)</span>. The practical
consequence is that not every model expressible in the GNN syntax can be
executed on every registered backend today, and authors should consult
the profiled-unsupported ledger that
<code>scripts/run_model_family_acceptance.py</code> writes — the command
is given in sec. <a href="#sec:reproducibility">6</a> — before assuming
a given family will round-trip through a given framework. The per-kind
shape of that matrix matters as much as its gaps: the categorical-only
backends report the continuous linear-Gaussian kind
<code>unsupported</code> by declared capability rather than by accident,
structural wrappers have no renderable model body and are reported
<code>unsupported</code>, and the recursive corpus is reserved for
bounded proposal-only <code>--autonomous</code> runs and holds no
committed models yet — boundaries recorded where the kinds are defined
(sec. <a href="#sec:model_kinds">3.2</a>) rather than discovered
mid-run.</p>
<p>A third limitation is one of scope rather than capability. The formal
account in sec. <a href="#sec:system_context">3</a> fixes each kind’s
parameterization as given — the categorical tensors <code>A</code>,
<code>B</code>, <code>C</code>, <code>D</code>, and <code>E</code> of
the discrete kind and the system matrices, Gaussian prior, and optional
control declarations of the linear-Gaussian kind — and states only
belief-level inference: state and policy inference for the categorical
kind (eq. <a href="#eq:vfe">6</a>, eq. <a href="#eq:efe">7</a>) and
fixed-parameter filtering and control for the continuous kind. GNN can
also express <em>parameter</em> learning: a matrix may be declared as a
latent variable with a Dirichlet prior, and the repository ships both a
corpus model that does so
(<code>input/gnn_files/learning/dirichlet_likelihood_learning.md</code>,
which learns its likelihood matrix <code>A</code> from observations by
joint variational message passing) and the renderer strategy that emits
code for it
(<code>src/gnn/render/rxinfer/_strategies_learning.py</code>). That
corpus directory is registered in no manifest family — the unregistered
set is exactly <code>input/gnn_files/learning</code>,
<code>input/gnn_files/recursive</code>,
<code>input/gnn_files/thrml</code> — so parameter learning is exercised
by neither the semantic-fidelity nor the cross-framework ledger and
carries no figure or table in this manuscript. We state it here as
implemented-but-out-of-scope rather than leave the omission to be
inferred from the family tables.</p>
<p>Experimental targets also have explicit admission boundaries. THRML
performs fixed-action categorical posterior sampling with bounded
independent or validated joint composition; it does not supply Gaussian
inference or policy/EFE optimization. cpomdp accepts linear-Gaussian
models with resource-admitted finite policy search, and rejects
unsupported kinds or over-budget search rather than reducing the request
silently. Both require explicit framework selection, so registration
does not promote either into the default execution set.</p>
<p>Finally, several capabilities depend on optional dependencies that
are not part of the minimal install. The simulation frameworks
themselves, the audio sonification path, the LLM-enhanced analysis step,
and the interactive visualization step all require extra packages that a
lean checkout will not have, and readiness diagnoses distinguish absent
packages, toolchains, unsupported Python, failed probes, and timeouts.
Their recorded outcomes depend on the step’s requirements; missing
dependencies or required unfinished work do not establish successful
execution. This keeps the core parse-validate-export-visualize spine
runnable in constrained environments, but it means a full 0–24 traversal
of all 25 steps reflects the optional surface that a particular machine
has installed. We consider this an acceptable engineering trade for
portability, but it is a limitation a reader should hold in mind when
interpreting any single end-to-end run.</p>
<h2 data-number="7.2" id="next-steps"><span
class="header-section-number">7.2</span> Next Steps</h2>
<p>The roadmap is concrete and staged. The current software version is
GNN 5.0.3. It builds on the three safe-by-design orchestration contracts
introduced in GNN 3.0.0, which generate and validate data only, with no
live infrastructure mutation. The first is <em>durable observation
streams</em>: file- and array-backed stream manifests
(content-checksummed) with replayable execution traces, so that an
extended run can be observed, paused, and re-derived deterministically
before any live sensor or device-backed stream is ever introduced. The
second is <em>resumable run sessions</em>: run-session manifests with
atomic checkpoint/resume, status inspection, and cancellation-safe
cleanup so that extended model-family acceptance runs can be interrupted
and resumed without corrupting partial state. The third is <em>auditable
container plans</em>: generating hardened container plans with an
explicit static security-review and rollback descriptor, deliberately
stopping short of mutating any real cluster. Each contract is covered by
tests over real objects with negative controls and a strict acceptance
gate, additive live wiring connects them to the session-acceptance and
run-manifest paths, and three new Model Context Protocol tools expose
them. The unifying discipline across all three is that orchestration
becomes more capable only as fast as it becomes more inspectable.</p>
<p>The next major release pushes toward bounded autonomy, and it is
gated behind the 3.0.0 orchestration work for good reason. The intent is
to promote today’s proposal-only candidate-scoring machinery — which
already ranks candidate patches using the existing validators,
model-family ledgers, and interpretability reports — toward <em>reviewed
self-editing of GNN files</em>. Crucially, the design keeps a human in
the loop: edits are proposed and applied only after explicit user
approval, with no automatic source mutation, and the autonomy is wrapped
in policy, rollback, and audit controls before any self-modifying or
distributed action is permitted. This continues the same principle that
governs the rest of the system, in the lineage of active-inference
accounts of self-organizing systems that act to minimize free energy
under explicit generative models <span class="citation"
data-cites="friston2010 parr2022">(<a href="#ref-friston2010"
role="doc-biblioref">Friston 2010</a>; <a href="#ref-parr2022"
role="doc-biblioref">Parr et al. 2022</a>)</span>: an agent should
expand its license to act only in proportion to the reviewability of
what it does. The next-release items are not claimed as complete here;
they are the recorded direction of travel, and each will be evidenced by
its own gates when it lands, just as the 3.0.0 contracts are evidenced
by theirs today. On the model-kind axis the same staging applies:
extending native hierarchical rendering beyond the two-level strategies,
broadening continuous reach across the remaining registered backends,
and populating the reserved recursive corpus each arrive with their own
gate evidence rather than by prose assertion.</p>
<hr />
<h1 data-number="8" id="sec:source_surface"><span
class="header-section-number">8</span> Supplemental Source Surface</h1>
<p>This supplement records the top-level source surfaces a reader or
reviewer should inspect before turning any prose in the main manuscript
into a verifiable claim. Each surface below is authored material under
version control; the generated artifacts it produces are described
separately so that the boundary between hand-written source and
reproducible output stays explicit.</p>
<p>The <code>src/</code> tree is the executable core of GNN. It is
organized into 44 Python packages spanning 777 source files and roughly
233096 lines of code. Alongside these packages sit the 25 top-level step
modules (0–24) that implement the numbered pipeline as thin
orchestrators delegating into the packages, each module owning one stage
of the progression from a parsed GNN text model through visualization,
type checking, code export, and executable cognitive simulation. A claim
about declared pipeline behavior should identify its source
implementation; a claim about actual execution additionally requires a
source-bound command and result receipt.</p>
<p>The <code>input/</code> tree holds the model corpora that exercise
the pipeline. Its <code>gnn_files/</code> subtree contains 12 corpus
directories organized by model family, together totaling 38 example
files — 29 discrete-state specifications and 9 continuous
linear-Gaussian specifications, the partition the manuscript’s
model-kind accounting uses (sec. <a href="#sec:model_kinds">3.2</a>).
The cold-start index <code>input/gnn_files/INDEX.md</code> catalogues
every exemplar with its kind and task folder, and the
<code>recursive/</code> directory is reserved for bounded
<code>--autonomous</code> proposal-loop runs, holding no committed
models. Every model file under <code>input/</code> lives in that
subtree, so the 38-file count covers the whole tree. A
<code>model_family_manifest.json</code> enumerates the 9 registered
families and their target directories. This manifest is the
authoritative registry that downstream steps and the manuscript variable
producer read when they report family counts and cross-framework
coverage; it should be consulted directly rather than inferred from
directory listings.</p>
<p>The <code>scripts/</code> tree contains the thin orchestrators that
gate and reproduce the project. These include acceptance scripts that
evaluate scoped pipeline runs, reliability gates that check selected
semantic and coverage contracts, and the manuscript variable producer
(<code>src/gnn/manuscript/variables.py</code> driven from this layer)
that emits the double-brace <code>{{...}}</code> token values consumed
throughout the manuscript. Treating these scripts as the source of
reproduction commands keeps reported numbers bound to what the code
actually computes.</p>
<p>The <code>docs/</code> tree is the prose and reference surface,
comprising 672 files of specification, tutorial, and design
documentation for the GNN language and its Active Inference grounding
<span class="citation" data-cites="gnn2023">(<a href="#ref-gnn2023"
role="doc-biblioref">Smékal and Friedman 2023</a>)</span>. It is the
place to verify that a manuscript statement about GNN syntax or
semantics matches the documented language rather than a convenient
paraphrase.</p>
<p>The <code>output/</code> tree collects per-step pipeline artifacts:
the data dumps, intermediate representations, validation reports, and
the 7 figure artifacts committed under it. Generated build artifacts can
be regenerated from bound inputs, while raw receipts and numerical
results preserve evidence of particular runs. Reproduction requires
their source and environment bindings; the directory location alone does
not establish current-run evidence. Notably,
<code>output/data/manuscript_variables.json</code> is where the
manuscript’s substituted token values are materialized.</p>
<h2 data-number="8.1" id="authored-source-versus-generated-output"><span
class="header-section-number">8.1</span> Authored Source Versus
Generated Output</h2>
<p><code>src/</code>, <code>scripts/</code>, <code>input/</code>,
<code>docs/</code> and <code>manuscript/</code> are authored and
reviewed. The <code>output/</code> tree holds generated artifacts and
retained run evidence; <code>output/manuscript/</code> contains
token-substituted copies of the authored <code>manuscript/</code>
sections. Regenerate owned build artifacts when appropriate, while
preserving the receipts required to support historical outcomes. The
commands that regenerate the output surfaces are listed in sec. <a
href="#sec:reproducibility">6</a>: the smoke run for the per-step
artifacts, <code>scripts/z_generate_manuscript_variables.py</code> for
the token map and the hydrated sections,
<code>scripts.manuscript_build_figures</code> for the 7 manuscript
figures, and the template render stage for the PDF. Which values become
tokens is not a matter of taste: any quantity the producer can derive
from a source surface is a token,
<code>scripts/check_manuscript_tokens.py</code> fails the build when a
section hard-codes one instead, and the resulting 93-entry map is
committed at <code>output/data/manuscript_variables.json</code> for
audit. External references are resolved from
<code>manuscript/references.bib</code>, which the same gate cross-checks
against every citation key in the prose. This manuscript quotes no
private or unpublished material.</p>
<hr />
<h1 data-number="9" id="sec:symbols_glossary"><span
class="header-section-number">9</span> Symbols and Glossary</h1>
<p>This glossary defines the Generalized Notation Notation (GNN)
language constructs used to specify generative models, together with the
Active Inference symbols those constructs carry across the model kinds
of sec. <a href="#sec:model_kinds">3.2</a>. Definitions follow the GNN
syntax specification and the exemplar specifications distributed with
the repository — the discrete POMDP exemplars and the continuous
linear-Gaussian exemplars alike — and they align with the standard
formulations of both kinds <span class="citation"
data-cites="gnn2023 dacosta2020 parr2022">(<a href="#ref-gnn2023"
role="doc-biblioref">Smékal and Friedman 2023</a>; <a
href="#ref-dacosta2020" role="doc-biblioref">Da Costa et al. 2020</a>;
<a href="#ref-parr2022" role="doc-biblioref">Parr et al.
2022</a>)</span>.</p>
<h2 data-number="9.1" id="language-constructs"><span
class="header-section-number">9.1</span> Language Constructs</h2>
<p>A GNN file is an ordered, UTF-8 Markdown document whose level-2
headers name required and optional sections. The strict schema validator
enforces section order, declaration grammar, and connection syntax; the
constructs below are the load-bearing sections a parser must recognize;
they are catalogued in tbl. <a href="#tbl:gnn_constructs">6</a>.</p>
<div class="table-scroll" role="region" tabindex="0" aria-label="Scrollable table: Table 6: The GNN language constructs a conforming parser must recognize, with the meaning each carries. The first row…"><table id="tbl:gnn_constructs" data-responsive-table="true">
<caption>Table 6: The GNN language constructs a conforming parser must
recognize, with the meaning each carries. The first rows are the
required sections that pin a model’s identity, variables, and factor
graph; the optional sections that follow carry parameterization,
ontology bindings, timing, equations, and provenance. The operator rows
are the connection vocabulary the <code>Connections</code> section is
written in — directed <code>A&gt;B</code>, undirected <code>A-B</code>,
and their labeled v1.1 forms — and <code>default=…</code> supplies
initialization hints. Definitions follow the GNN syntax specification
and the exemplar specifications under <code>input/gnn_files</code>, and
the strict schema validator enforces section order and declaration
grammar before any downstream step runs. The construct vocabulary is
deliberately kind-agnostic: the same <code>StateSpaceBlock</code>,
<code>Connections</code>, and operator syntax declare a discrete
categorical model, a continuous linear-Gaussian model, or a composed
multi-agent or hierarchical one — what differs between kinds is which
matrix names the block declares, as tbl. <a
href="#tbl:actinf_symbols">7</a> details.</caption>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr>
<th>Construct</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>## GNNSection</code></td>
<td>Required short identifier for the model block (no spaces,
e.g. <code>ActInfPOMDP</code>).</td>
</tr>
<tr>
<td><code>## GNNVersionAndFlags</code></td>
<td>Required version declaration (<code>GNN v1</code> or
<code>GNN v1.1</code>) with optional flags.</td>
</tr>
<tr>
<td><code>## ModelName</code></td>
<td>Required human-readable title of the generative model.</td>
</tr>
<tr>
<td><code>## StateSpaceBlock</code></td>
<td>Required block declaring every variable and matrix as
<code>NAME[dim, …, type=…]</code>, one per line — the block whose
declared vocabulary fixes the model’s kind.</td>
</tr>
<tr>
<td><code>## Connections</code></td>
<td>Required edge list relating state-space variables, expressing the
model’s factor graph.</td>
</tr>
<tr>
<td><code>## ModelAnnotation</code></td>
<td>Optional free-text description of the model’s modalities, factors,
and assumptions.</td>
</tr>
<tr>
<td><code>## InitialParameterization</code></td>
<td>Optional concrete numeric values for declared matrices and
vectors.</td>
</tr>
<tr>
<td><code>## ActInfOntologyAnnotation</code></td>
<td>Optional bindings from each variable to a CamelCase Active Inference
ontology term.</td>
</tr>
<tr>
<td><code>## ModelParameters</code></td>
<td>Optional key-value dimensions (e.g. <code>num_hidden_states</code>,
<code>num_obs</code>, <code>num_actions</code>) consumed by code
generators.</td>
</tr>
<tr>
<td><code>## Time</code></td>
<td>Optional dynamics declaration: a time variable plus
<code>Dynamic</code>/<code>Static</code>,
<code>Discrete</code>/<code>Continuous</code>, and
<code>ModelTimeHorizon</code>.</td>
</tr>
<tr>
<td><code>## Equations</code></td>
<td>Optional LaTeX-rendered formulas defining model dynamics and the
relationships between declared variables; round-tripped by the
semantic-fidelity gate.</td>
</tr>
<tr>
<td><code>## Footer</code></td>
<td>Optional closing section that terminates the file and lets a reader
or parser enter it from either end.</td>
</tr>
<tr>
<td><code>## Signature</code></td>
<td>Optional provenance block carrying a cryptographic signature over
the specification.</td>
</tr>
<tr>
<td><code>NAME[d₁,d₂,…,type=…]</code></td>
<td>A variable or tensor declaration; dimensions are positive integers
or named references, and a <code>type</code> (<code>float</code>,
<code>int</code>, <code>bool</code>) is required.</td>
</tr>
<tr>
<td><code>A&gt;B</code></td>
<td>Directed (causal) connection operator: edge from <code>A</code> to
<code>B</code>, e.g. <code>D&gt;s</code> (a prior conditions a hidden
state) or <code>F&gt;x</code> (a transition matrix drives a continuous
state).</td>
</tr>
<tr>
<td><code>A-B</code></td>
<td>Undirected (bidirectional) connection operator,
e.g. <code>s-A</code> (a hidden state participates in the likelihood
mapping).</td>
</tr>
<tr>
<td><code>A&gt;B:label</code> / <code>A-B:label</code></td>
<td>A v1.1 annotated edge; the trailing label documents the relation and
is preserved but may be ignored for structural validation.</td>
</tr>
<tr>
<td><code>default=…</code></td>
<td>A v1.1 declaration hint (<code>uniform</code>, <code>zeros</code>,
<code>ones</code>, <code>eye</code>, <code>random</code>) supplying an
initialization for a matrix or vector.</td>
</tr>
</tbody>
</table></div>
<h2 data-number="9.2" id="symbols-by-model-kind"><span
class="header-section-number">9.2</span> Symbols by Model Kind</h2>
<p>The exemplar specifications declare the generative-model components
of Active Inference, mapping each GNN variable to its probabilistic
meaning <span class="citation"
data-cites="dacosta2020 smith2022 parr2022">(<a href="#ref-dacosta2020"
role="doc-biblioref">Da Costa et al. 2020</a>; <a href="#ref-smith2022"
role="doc-biblioref">Smith et al. 2022</a>; <a href="#ref-parr2022"
role="doc-biblioref">Parr et al. 2022</a>)</span>. Because the notation
spans model kinds, the same letter can name different objects in
different kinds — most prominently <code>F</code>, which is the
variational free energy of eq. <a href="#eq:vfe">6</a> in the discrete
kind and the state-transition matrix of eq. <a
href="#eq:lgssm_state">9</a> in the continuous kind — so each row of
tbl. <a href="#tbl:actinf_symbols">7</a> names the kind its reading
belongs to and the equation in sec. <a href="#sec:system_context">3</a>
that fixes it. These authored cross-references support review of
agreement between the glossary and formal statement; their consistency
still requires validation when either changes.</p>
<div class="table-scroll" role="region" tabindex="0" aria-label="Scrollable table: Table 7: The Active Inference symbols a GNN specification carries, scoped by model kind and bound to the equation of…"><table id="tbl:actinf_symbols" data-responsive-table="true">
<caption>Table 7: The Active Inference symbols a GNN specification
carries, scoped by model kind and bound to the equation of sec. <a
href="#sec:system_context">3</a> that fixes each role. Read the
discrete-kind rows as the categorical generative-model tensors
(likelihood, controlled transitions, log-preferences, prior over initial
states, habit prior) with <code>s</code>, <code>o</code>,
<code>π</code>, and <code>u</code> as the inference variables and
<code>F</code> and <code>G</code> as the two free-energy functionals
minimized at eq. <a href="#eq:vfe">6</a> and eq. <a
href="#eq:efe">7</a>; read the continuous-kind rows as the
linear-Gaussian parameterization — system matrices, covariances,
Gaussian prior, and the optional closed-loop declarations of eq. <a
href="#eq:closed_loop">11</a>. The rows where one letter carries two
kind-scoped readings (<code>F</code>, <code>u</code>, <code>t</code>)
are deliberate: the notation reuses a compact alphabet across kinds, and
the declared matrix vocabulary of the <code>StateSpaceBlock</code> — not
the letter alone — is what fixes the reading, which is exactly what the
kind classification of sec. <a href="#sec:model_kinds">3.2</a> computes.
Use the table as a decoding key when reading a
<code>StateSpaceBlock</code>: every declared matrix name should map to
exactly one kind-scoped row here, and the
<code>## ActInfOntologyAnnotation</code> bindings described below are
what make that mapping machine-checkable downstream.</caption>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr>
<th>Symbol</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>A</code></td>
<td>Discrete kind: likelihood (observation) matrix encoding <span
class="math inline">\(P(o \mid s)\)</span>, a column-stochastic map from
hidden states to observation outcomes (eq. <a
href="#eq:likelihood">2</a>).</td>
</tr>
<tr>
<td><code>B</code></td>
<td>Discrete kind: transition tensor encoding <span
class="math inline">\(P(s&#39; \mid s, u)\)</span>, one
column-stochastic slice per action in the canonical
<code>B[next_state][previous_state][action]</code> order (eq. <a
href="#eq:transition">3</a>).</td>
</tr>
<tr>
<td><code>C</code></td>
<td>Discrete kind: preference vector — log-preferences over observation
outcomes that bias the agent toward preferred outcomes (eq. <a
href="#eq:preference">4</a>).</td>
</tr>
<tr>
<td><code>D</code></td>
<td>Discrete kind: prior vector over initial hidden states (eq. <a
href="#eq:prior">5</a>).</td>
</tr>
<tr>
<td><code>E</code></td>
<td>Discrete kind: habit vector — an initial policy prior over actions,
entering the policy posterior (eq. <a href="#eq:policy">8</a>).</td>
</tr>
<tr>
<td><code>s</code></td>
<td>Discrete kind: current hidden-state distribution;
<code>s_prime</code> (<code>s'</code>) is the next hidden-state
distribution.</td>
</tr>
<tr>
<td><code>o</code></td>
<td>Discrete kind: current observation, an integer index over outcome
modalities.</td>
</tr>
<tr>
<td><code>π</code></td>
<td>Discrete kind: policy — a distribution over actions inferred from
expected free energy (eq. <a href="#eq:policy">8</a>).</td>
</tr>
<tr>
<td><code>u</code></td>
<td>Discrete kind: the selected (sampled) action, sampled from the
policy posterior. Continuous kind: the control input added to the state
each step (eq. <a href="#eq:lgssm_state">9</a>).</td>
</tr>
<tr>
<td><code>F</code></td>
<td>Discrete kind: variational free energy, minimized during state
inference (eq. <a href="#eq:vfe">6</a>) <span class="citation"
data-cites="friston2010">(<a href="#ref-friston2010"
role="doc-biblioref">Friston 2010</a>)</span>. Continuous kind: the
state-transition matrix of the linear-Gaussian model (eq. <a
href="#eq:lgssm_state">9</a>).</td>
</tr>
<tr>
<td><code>G</code></td>
<td>Discrete kind: expected free energy per policy, minimized during
policy inference to score candidate actions (eq. <a
href="#eq:efe">7</a>) <span class="citation"
data-cites="dacosta2020">(<a href="#ref-dacosta2020"
role="doc-biblioref">Da Costa et al. 2020</a>)</span>.</td>
</tr>
<tr>
<td><code>t</code></td>
<td>Discrete time step; the horizon <span
class="math inline">\(T\)</span> bounds the product in eq. <a
href="#eq:generative_model">1</a>. Continuous kind: the time index of
the state-space model.</td>
</tr>
<tr>
<td><code>H</code></td>
<td>Continuous kind: observation matrix mapping the latent state to the
observation (eq. <a href="#eq:lgssm_obs">10</a>).</td>
</tr>
<tr>
<td><code>Q</code></td>
<td>Continuous kind: process-noise covariance of the state evolution
(eq. <a href="#eq:lgssm_state">9</a>).</td>
</tr>
<tr>
<td><code>R</code></td>
<td>Continuous kind: observation-noise covariance of the readout (eq. <a
href="#eq:lgssm_obs">10</a>).</td>
</tr>
<tr>
<td><code>x</code></td>
<td>Continuous kind: the Gaussian latent state <span
class="math inline">\(x_t\)</span>; <code>x[2,1,type=float]</code> in
the navigation exemplar declares a two-dimensional position.</td>
</tr>
<tr>
<td><code>y</code></td>
<td>Continuous kind: the continuous observation read out linearly from
the state (eq. <a href="#eq:lgssm_obs">10</a>).</td>
</tr>
<tr>
<td><code>prior_mean</code></td>
<td>Continuous kind: prior mean <span
class="math inline">\(\mu_0\)</span> over the initial latent state
(eq. <a href="#eq:lgssm_state">9</a>).</td>
</tr>
<tr>
<td><code>prior_cov</code></td>
<td>Continuous kind: prior covariance <span
class="math inline">\(\Sigma_0\)</span> over the initial latent state
(eq. <a href="#eq:lgssm_state">9</a>).</td>
</tr>
<tr>
<td><code>goal_mean</code></td>
<td>Continuous kind: preferred state <span
class="math inline">\(\mu^\star\)</span> the closed-loop controller
steers toward (eq. <a href="#eq:closed_loop">11</a>).</td>
</tr>
<tr>
<td><code>control_gain</code></td>
<td>Continuous kind: scalar proportional gain <span
class="math inline">\(k\)</span> on the belief error in the closed loop
(eq. <a href="#eq:closed_loop">11</a>).</td>
</tr>
</tbody>
</table></div>
<h2 data-number="9.3" id="ontology-bindings-and-implementations"><span
class="header-section-number">9.3</span> Ontology Bindings and
Implementations</h2>
<p>The <code>## ActInfOntologyAnnotation</code> section binds each
variable to a canonical term — <code>A=LikelihoodMatrix</code>,
<code>B=TransitionMatrix</code>, <code>C=LogPreferenceVector</code>,
<code>D=PriorOverHiddenStates</code>, <code>s=HiddenState</code>,
<code>o=Observation</code>, <code>π=PolicyVector</code> in the discrete
exemplars; <code>F=StateTransitionMatrix</code>,
<code>H=ObservationMatrix</code>, <code>Q=ProcessNoiseCovariance</code>,
<code>R=ObservationNoiseCovariance</code>,
<code>prior_mean=PriorMean</code>,
<code>prior_cov=PriorCovariance</code>,
<code>goal_mean=PreferredState</code>,
<code>control_gain=ControlGain</code>,
<code>x=ContinuousHiddenState</code>,
<code>y=ContinuousObservation</code>, <code>u=ControlInput</code> in the
continuous exemplars — which downstream pipeline steps use for semantic
analysis and validation. The bindings are per-kind by construction: a
continuous exemplar binds <code>F</code> to
<code>StateTransitionMatrix</code>, never to a free-energy term, so the
ontology layer carries the same kind-scoped reading tbl. <a
href="#tbl:actinf_symbols">7</a> fixes by hand. The same GNN
specification feeds the project’s rendering backends — including the 12
registered targets (PyMDP, RxInfer.jl, ActiveInference.jl, JAX, DisCoPy,
PyTorch, NumPyro, Stan, bnlearn, cpomdp, THRML, ngc-learn), of which the
12 render targets with execution adapters (PyMDP, RxInfer.jl,
ActiveInference.jl, JAX, DisCoPy, PyTorch, NumPyro, Stan, bnlearn,
cpomdp, THRML, ngc-learn) can be selected at Step 12 subject to
model-kind admission and runtime readiness — with per-kind reach
recorded as explicit statuses (tbl. <a
href="#tbl:framework_capability">4</a>) — so that a model written once
in this notation can be parsed, visualized, and executed across the
25-step pipeline (0–24) without restating its mathematics <span
class="citation" data-cites="gnn2023 heins2022 defelice2021">(<a
href="#ref-gnn2023" role="doc-biblioref">Smékal and Friedman 2023</a>;
<a href="#ref-heins2022" role="doc-biblioref">Heins et al. 2022</a>; <a
href="#ref-defelice2021" role="doc-biblioref">Felice et al.
2021</a>)</span>.</p>
<hr />
<h1 data-number="10" id="sec:references"><span
class="header-section-number">10</span> References</h1>
<p>Entries below are resolved by Pandoc from <a
href="https://github.com/ActiveInferenceInstitute/Generalized_Notation_Notation/blob/main/manuscript/references.bib"><code>manuscript/references.bib</code></a>
at render time; <code>scripts/check_manuscript_tokens.py</code> fails
the build on a citation key that file does not define.</p>
<div id="refs" class="references csl-bib-body hanging-indent"
role="list">
<div id="ref-bagaev2021reactiveMessagePassing" class="csl-entry"
role="listitem">
Bagaev, Dmitry, and Bert de Vries. 2021. <em>Reactive Message Passing
for Scalable Bayesian Inference</em>. <a
href="https://arxiv.org/abs/2112.13251">https://arxiv.org/abs/2112.13251</a>.
</div>
<div id="ref-champion2024reframingEfe" class="csl-entry"
role="listitem">
Champion, Théophile, Howard Bowman, Dimitrije Marković, and Marek Grześ.
2024. <em>Reframing the Expected Free Energy: Four Formulations and a
Unification</em>. <a
href="https://arxiv.org/abs/2402.14460">https://arxiv.org/abs/2402.14460</a>.
</div>
<div id="ref-dacosta2020" class="csl-entry" role="listitem">
Da Costa, Lancelot, Thomas Parr, Noor Sajid, Sebastijan Veselic,
Victorita Neacsu, and Karl Friston. 2020. <span>“Active Inference on
Discrete State-Spaces: A Synthesis.”</span> <em>Journal of Mathematical
Psychology</em> 99: 102447. <a
href="https://doi.org/10.1016/j.jmp.2020.102447">https://doi.org/10.1016/j.jmp.2020.102447</a>.
</div>
<div id="ref-defelice2021" class="csl-entry" role="listitem">
Felice, Giovanni de, Alexis Toumi, and Bob Coecke. 2021. <span>“DisCoPy:
Monoidal Categories in Python.”</span> <em>Electronic Proceedings in
Theoretical Computer Science</em> 333: 183–97. <a
href="https://doi.org/10.4204/EPTCS.333.13">https://doi.org/10.4204/EPTCS.333.13</a>.
</div>
<div id="ref-friston2010" class="csl-entry" role="listitem">
Friston, Karl. 2010. <span>“The Free-Energy Principle: A Unified Brain
Theory?”</span> <em>Nature Reviews Neuroscience</em> 11 (2): 127–38. <a
href="https://doi.org/10.1038/nrn2787">https://doi.org/10.1038/nrn2787</a>.
</div>
<div id="ref-heins2022" class="csl-entry" role="listitem">
Heins, Conor, Beren Millidge, Daphne Demekas, et al. 2022. <span>“Pymdp:
A Python Library for Active Inference in Discrete State Spaces.”</span>
<em>Journal of Open Source Software</em> 7 (73): 4098. <a
href="https://doi.org/10.21105/joss.04098">https://doi.org/10.21105/joss.04098</a>.
</div>
<div id="ref-koudahl2023syntheticAgents1" class="csl-entry"
role="listitem">
Koudahl, Magnus, Thijs van de Laar, and Bert de Vries. 2023.
<em>Realising Synthetic Active Inference Agents, Part i: Epistemic
Objectives and Graphical Specification Language</em>. <a
href="https://arxiv.org/abs/2306.08014">https://arxiv.org/abs/2306.08014</a>.
</div>
<div id="ref-vandelaaar2023syntheticAgents2" class="csl-entry"
role="listitem">
Laar, Thijs van de, Magnus Koudahl, and Bert de Vries. 2023.
<em>Realising Synthetic Active Inference Agents, Part II: Variational
Message Updates</em>. <a
href="https://doi.org/10.1162/neco_a_01713">https://doi.org/10.1162/neco_a_01713</a>.
</div>
<div id="ref-nuijten2026efePlanningVariational" class="csl-entry"
role="listitem">
Nuijten, Wouter W. L., Thijs van de Laar, and Bert de Vries. 2026.
<span>“Expected Free Energy-Based Planning as Variational
Inference.”</span> <em>Transactions on Machine Learning Research</em>.
<a
href="https://arxiv.org/abs/2606.20658">https://arxiv.org/abs/2606.20658</a>.
</div>
<div id="ref-nuijten2026typeInference" class="csl-entry"
role="listitem">
Nuijten, Wouter W. L., Mykola Lukashchuk, Thijs van de Laar, and Bert de
Vries. 2026. <em>What Type of Inference Is Active Inference?</em> <a
href="https://arxiv.org/abs/2606.04935">https://arxiv.org/abs/2606.04935</a>.
</div>
<div id="ref-parr2022" class="csl-entry" role="listitem">
Parr, Thomas, Giovanni Pezzulo, and Karl J. Friston. 2022. <em>Active
Inference: The Free Energy Principle in Mind, Brain, and Behavior</em>.
MIT Press. <a
href="https://doi.org/10.7551/mitpress/12441.001.0001">https://doi.org/10.7551/mitpress/12441.001.0001</a>.
</div>
<div id="ref-rangarajan2026hierarchicalSuccessor" class="csl-entry"
role="listitem">
Rangarajan, Prashant, and Rajesh P. N. Rao. 2026. <em>Hierarchical
Active Inference Using Successor Representations</em>. <a
href="https://arxiv.org/abs/2604.15679">https://arxiv.org/abs/2604.15679</a>.
</div>
<div id="ref-gnn2023" class="csl-entry" role="listitem">
Smékal, Jakub, and Daniel Ari Friedman. 2023. <span>“Generalized
Notation Notation for Active Inference Models.”</span> <em>Active
Inference Journal</em>, ahead of print. <a
href="https://doi.org/10.5281/zenodo.22820299">https://doi.org/10.5281/zenodo.22820299</a>.
</div>
<div id="ref-smith2022" class="csl-entry" role="listitem">
Smith, Ryan, Karl J. Friston, and Christopher J. Whyte. 2022. <span>“A
Step-by-Step Tutorial on Active Inference and Its Application to
Empirical Data.”</span> <em>Journal of Mathematical Psychology</em> 107:
102632. <a
href="https://doi.org/10.1016/j.jmp.2021.102632">https://doi.org/10.1016/j.jmp.2021.102632</a>.
</div>
</div>
</main>
</body>
</html>
