updated mcp
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-03-08 17:57:34 +05:30
parent 9191de9dff
commit 0e49f02c4c
167 changed files with 7632 additions and 98942 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,912 +0,0 @@
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.23">
<title>Dagpipe - dagpipe</title>
<link rel="stylesheet" href="../assets/stylesheets/main.84d31ad4.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i%7CJetBrains+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Inter";--md-code-font:"JetBrains Mono"}</style>
<link rel="stylesheet" href="../assets/_mkdocstrings.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#dagpipe_1" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="dagpipe" class="md-header__button md-logo" aria-label="dagpipe" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
dagpipe
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Dagpipe
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan" aria-hidden="true" type="radio" name="__palette" id="__palette_0">
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"/></svg>
</a>
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="dagpipe" class="md-nav__button md-logo" aria-label="dagpipe" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
dagpipe
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="">
<span class="md-ellipsis">
State
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
State
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../state/" class="md-nav__link">
<span class="md-ellipsis">
State
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
<span class="md-ellipsis">
Node
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Node
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../node/" class="md-nav__link">
<span class="md-ellipsis">
Node
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
<span class="md-ellipsis">
Graph
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Graph
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../graph/" class="md-nav__link">
<span class="md-ellipsis">
Graph
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="">
<span class="md-ellipsis">
Engine
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Engine
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../engine/" class="md-nav__link">
<span class="md-ellipsis">
Engine
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="">
<span class="md-ellipsis">
Yaml
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
Yaml
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../yaml_loader/" class="md-nav__link">
<span class="md-ellipsis">
Yaml Loader
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#dagpipe" class="md-nav__link">
<span class="md-ellipsis">
dagpipe
</span>
</a>
<nav class="md-nav" aria-label="dagpipe">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#dagpipe--summary" class="md-nav__link">
<span class="md-ellipsis">
Summary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe--installation" class="md-nav__link">
<span class="md-ellipsis">
Installation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe--quick-start" class="md-nav__link">
<span class="md-ellipsis">
Quick Start
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe--public-api" class="md-nav__link">
<span class="md-ellipsis">
Public API
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe-classes" class="md-nav__link">
<span class="md-ellipsis">
Classes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe-functions" class="md-nav__link">
<span class="md-ellipsis">
Functions
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="dagpipe_1">Dagpipe</h1>
<div class="doc doc-object doc-module">
<h2 id="dagpipe" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">dagpipe</span>
</h2>
<div class="doc doc-contents first">
<p>Directed acyclic graph execution framework for deterministic state propagation.</p>
<hr />
<h4 id="dagpipe--summary">Summary</h4>
<p><code>dagpipe</code> executes pipelines composed of nodes connected in a directed acyclic
graph (DAG). Each node receives an immutable state and optionally produces
derived states for downstream nodes.</p>
<hr />
<h4 id="dagpipe--installation">Installation</h4>
<p>Install using pip:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>pip install dagpipe
</code></pre></div></td></tr></table></div>
<hr />
<h4 id="dagpipe--quick-start">Quick Start</h4>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span></pre></div></td><td class="code"><div><pre><span></span><code>from dagpipe import State, Payload, Schema, Graph, Engine
from dagpipe.node import Node
class HelloNode(Node):
id = &quot;hello&quot;
def resolve(self, state):
yield self.fork(state, payload_update={&quot;msg&quot;: &quot;hello&quot;})
# Build and run
graph = Graph()
graph.add_root(HelloNode())
engine = Engine(graph)
class MyState(State):
schema = Schema({})
results = engine.run(MyState(payload=Payload({})))
</code></pre></div></td></tr></table></div>
<hr />
<h4 id="dagpipe--public-api">Public API</h4>
<p>This package re-exports the <strong>core pipeline components</strong>.
Consumers should import from this namespace for standard usage.</p>
<p><strong>Execution Core:</strong>
- Engine
- Graph
- Node</p>
<p><strong>State &amp; Data:</strong>
- State / MyState (custom base)
- Payload
- Schema / SchemaError</p>
<p><strong>Declarative Pipelines:</strong>
- Pipeline
- load_pipeline</p>
<hr />
<div class="doc doc-children">
<h3 id="dagpipe-classes">Classes</h3>
<h3 id="dagpipe-functions">Functions</h3>
</div>
</div>
</div><ul>
<li><a href="engine/">Engine</a></li>
<li><a href="graph/">Graph</a></li>
<li><a href="node/">Node</a></li>
<li><a href="state/">State</a></li>
<li><a href="yaml_loader/">Yaml Loader</a></li>
</ul>
</article>
</div>
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.sections", "navigation.expand", "navigation.top", "navigation.instant", "navigation.tracking", "navigation.indexes", "content.code.copy", "content.code.annotate", "content.tabs.link", "content.action.edit", "search.highlight", "search.share", "search.suggest"], "search": "../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../assets/javascripts/bundle.f55a23d4.min.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -599,6 +599,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.engine--guarantees" class="md-nav__link">
<span class="md-ellipsis">
Guarantees
</span>
</a>
</li>
<li class="md-nav__item">
@@ -831,6 +840,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.engine--guarantees" class="md-nav__link">
<span class="md-ellipsis">
Guarantees
</span>
</a>
</li>
<li class="md-nav__item">
@@ -956,23 +974,19 @@
<div class="doc doc-contents first">
<p>Execution engine responsible for running pipelines and graphs.</p>
<hr />
<h4 id="dagpipe.engine--summary">Summary</h4>
<p>The Engine executes Node objects and propagates immutable State instances
through either a linear sequence or a directed acyclic graph (Graph).
<h3 id="dagpipe.engine--summary">Summary</h3>
<p>Execution engine responsible for running pipelines and graphs.</p>
<p>The <code>Engine</code> executes <code>Node</code> objects and propagates immutable <code>State</code> instances
through either a linear sequence or a directed acyclic graph (<code>Graph</code>).
It orchestrates execution order, branching, and state propagation.</p>
<hr />
<h3 id="dagpipe.engine--guarantees">Guarantees</h3>
<ul>
<li>Deterministic execution and consistent state lineage.</li>
<li>Orchestrates execution without modifying <code>Graph</code>, <code>Node</code>, or <code>State</code> objects.</li>
</ul>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Deterministic execution and consistent state lineage.
- Orchestrates execution without modifying Graph, Node, or State objects.
</code></pre></div></td></tr></table></div>
</details>
<div class="doc doc-children">
@@ -1005,15 +1019,21 @@ It orchestrates execution order, branching, and state propagation.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Accepts either a linear sequence of Nodes or a Graph defining execution topology.
- Propagates immutable State objects through Nodes and collects terminal States.
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Accepts either a linear sequence of `Node` objects or a `Graph`
defining execution topology.
- Propagates immutable `State` objects through `Node` objects and
collects terminal states.
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Never mutates State, Node, or Graph instances.
- State objects are never modified in place; each branch produces independent instances.
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- Never mutates `State`, `Node`, or `Graph` instances.
- `State` objects are never modified in place; each branch produces
independent instances.
- Execution order is deterministic and follows graph or pipeline topology.
- Thread-safe for concurrent execution.
</code></pre></div></td></tr></table></div>
@@ -1035,7 +1055,7 @@ It orchestrates execution order, branching, and state propagation.</p>
<tr class="doc-section-item">
<td><code>nodes_or_graph</code></td>
<td>
<code><span title="typing.Sequence">Sequence</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a>] | <a class="autorefs autorefs-internal" title="dagpipe.graph.Graph" href="../dagpipe/graph/#dagpipe.graph.Graph">Graph</a></code>
<code><span title="typing.Sequence">Sequence</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a>] | <a class="autorefs autorefs-internal" title="dagpipe.graph.Graph" href="../graph/#dagpipe.graph.Graph">Graph</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1065,7 +1085,8 @@ It orchestrates execution order, branching, and state propagation.</p>
</td>
<td>
<div class="doc-md-description">
<p>If input is not a Sequence[Node] or Graph, or contains invalid node types.</p>
<p>If input is not a <code>Sequence[Node]</code> or <code>Graph</code>, or contains
invalid node types.</p>
</div>
</td>
</tr>
@@ -1076,7 +1097,9 @@ It orchestrates execution order, branching, and state propagation.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Detects execution mode (linear or DAG) and validates node types and structure.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Detects execution mode (linear or DAG) and validates node
types and structure.
</code></pre></div></td></tr></table></div>
</details>
@@ -1122,7 +1145,7 @@ It orchestrates execution order, branching, and state propagation.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code>tuple[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a>, ...]</code>
<code>tuple[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a>, ...]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1194,7 +1217,7 @@ Ordered sequence in linear mode or all nodes in graph mode.</p>
<div class="doc doc-contents ">
<p>Execute the pipeline starting from a root State.</p>
<p>Execute the pipeline starting from a root <code>State</code>.</p>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -1211,7 +1234,7 @@ Ordered sequence in linear mode or all nodes in graph mode.</p>
<tr class="doc-section-item">
<td><code>root</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1237,7 +1260,7 @@ Ordered sequence in linear mode or all nodes in graph mode.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>]</code>
<code><span title="typing.List">List</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a>]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1265,7 +1288,7 @@ Terminal execution states produced by the pipeline.</p>
</td>
<td>
<div class="doc-md-description">
<p>If root is not a State instance.</p>
<p>If <code>root</code> is not a <code>State</code> instance.</p>
</div>
</td>
</tr>
@@ -1286,7 +1309,9 @@ Terminal execution states produced by the pipeline.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Selects execution mode, propagates state through nodes, creates new instances for branches, and collects terminal states.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Selects execution mode, propagates state through nodes, creates
new instances for branches, and collects terminal states.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -520,6 +520,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph--responsibilities" class="md-nav__link">
<span class="md-ellipsis">
Responsibilities
</span>
</a>
</li>
<li class="md-nav__item">
@@ -586,42 +595,6 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--add-directed-edge-from-src-to-dst" class="md-nav__link">
<span class="md-ellipsis">
Add directed edge from src to dst.
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--parameters" class="md-nav__link">
<span class="md-ellipsis">
Parameters
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--raises" class="md-nav__link">
<span class="md-ellipsis">
Raises
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--behavior" class="md-nav__link">
<span class="md-ellipsis">
Behavior
</span>
</a>
</li>
<li class="md-nav__item">
@@ -906,6 +879,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph--responsibilities" class="md-nav__link">
<span class="md-ellipsis">
Responsibilities
</span>
</a>
</li>
<li class="md-nav__item">
@@ -972,42 +954,6 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--add-directed-edge-from-src-to-dst" class="md-nav__link">
<span class="md-ellipsis">
Add directed edge from src to dst.
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--parameters" class="md-nav__link">
<span class="md-ellipsis">
Parameters
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--raises" class="md-nav__link">
<span class="md-ellipsis">
Raises
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.graph.Graph.add_edge--behavior" class="md-nav__link">
<span class="md-ellipsis">
Behavior
</span>
</a>
</li>
<li class="md-nav__item">
@@ -1106,24 +1052,19 @@
<div class="doc doc-contents first">
<p>Defines DAG structure connecting Nodes.</p>
<h3 id="dagpipe.graph--summary">Summary</h3>
<p>Defines DAG structure connecting nodes.</p>
<p>A <code>Graph</code> describes execution topology only. It does not execute nodes or manage
<code>State</code>. Execution is handled by an <code>Engine</code>.</p>
<hr />
<h4 id="dagpipe.graph--summary">Summary</h4>
<p>Graph describes execution topology only. It does not execute nodes or manage State.
Execution is handled by Engine.</p>
<h3 id="dagpipe.graph--responsibilities">Responsibilities</h3>
<ul>
<li>Multiple roots, branching, and merging support.</li>
<li>Deterministic traversal based on topology.</li>
<li>Graph is mutable during construction but treated as immutable at runtime.</li>
</ul>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Multiple roots, branching, and merging support.
- Deterministic traversal based on topology.
- Graph is mutable during construction but treated as immutable at runtime.
</code></pre></div></td></tr></table></div>
</details>
<div class="doc doc-children">
@@ -1149,7 +1090,7 @@ Execution is handled by Engine.</p>
<div class="doc doc-contents ">
<p>Directed Acyclic Graph defining execution topology of Nodes.</p>
<p>Directed Acyclic Graph defining execution topology of <code>Node</code> objects.</p>
<details class="notes" open>
@@ -1157,7 +1098,7 @@ Execution is handled by Engine.</p>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Stores node connectivity and validates that the topology remains acyclic.
- Structure determines how State flows between nodes during execution.
- Structure determines how `State` flows between nodes during execution.
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
@@ -1215,35 +1156,94 @@ Execution is handled by Engine.</p>
<div class="doc doc-contents ">
<h6 id="dagpipe.graph.Graph.add_edge--add-directed-edge-from-src-to-dst">Add directed edge from src to dst.</h6>
<h6 id="dagpipe.graph.Graph.add_edge--parameters">Parameters</h6>
<p>src : Node
required: True
source node</p>
<p>Add a directed edge from <code>src</code> to <code>dst</code>.</p>
<details class="dst-" open>
<summary>Node</summary>
<p>required: True
destination node</p>
</details> <hr />
<h6 id="dagpipe.graph.Graph.add_edge--raises">Raises</h6>
<p>TypeError
if src or dst is not a Node</p>
<p>ValueError
if edge would create a cycle</p>
<p>ValueError
if src and dst are the same node</p>
<hr />
<h6 id="dagpipe.graph.Graph.add_edge--behavior">Behavior</h6>
<ul>
<li>validates node types</li>
<li>prevents cycles</li>
<li>registers nodes if not present</li>
<li>updates parent and child mappings</li>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>src</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Source node.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
<tr class="doc-section-item">
<td><code>dst</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Destination node.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>If <code>src</code> or <code>dst</code> is not a <code>Node</code>.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td>
<code>ValueError</code>
</td>
<td>
<div class="doc-md-description">
<p>If the edge would create a cycle or if <code>src</code> and <code>dst</code> are common.</p>
</div>
</td>
</tr>
</tbody>
</table>
<details class="notes" open>
<summary>Notes</summary>
<ul>
<li>Validates node types.</li>
<li>Prevents cycles.</li>
<li>Registers nodes if not present.</li>
<li>Updates parent and child mappings.</li>
</ul>
<hr />
</details>
</div>
</div>
@@ -1278,7 +1278,7 @@ destination node</p>
<tr class="doc-section-item">
<td><code>node</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1349,7 +1349,7 @@ destination node</p>
<tr class="doc-section-item">
<td><code>node</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1375,7 +1375,7 @@ destination node</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a>, ...]</code>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a>, ...]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1418,7 +1418,7 @@ Outgoing neighbors.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a>, ...]</code>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a>, ...]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1464,7 +1464,7 @@ All registered nodes.</p>
<tr class="doc-section-item">
<td><code>node</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1490,7 +1490,7 @@ All registered nodes.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a>, ...]</code>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a>, ...]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1533,7 +1533,7 @@ Incoming neighbors.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../dagpipe/node/#dagpipe.node.Node">Node</a>, ...]</code>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="../node/#dagpipe.node.Node">Node</a>, ...]</code>
</td>
<td>
<div class="doc-md-description">

File diff suppressed because it is too large Load Diff

View File

@@ -441,6 +441,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.node--design-principles" class="md-nav__link">
<span class="md-ellipsis">
Design principles
</span>
</a>
</li>
<li class="md-nav__item">
@@ -897,6 +906,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.node--design-principles" class="md-nav__link">
<span class="md-ellipsis">
Design principles
</span>
</a>
</li>
<li class="md-nav__item">
@@ -1088,27 +1106,21 @@
<div class="doc doc-contents first">
<p>Defines the Node abstraction used by dagpipe.</p>
<h3 id="dagpipe.node--summary">Summary</h3>
<p>Defines the <code>Node</code> abstraction used by <code>dagpipe</code>.</p>
<p>A node represents a single unit of pipeline execution logic. It consumes one
<code>State</code> and produces zero, one, or many new <code>State</code> objects.</p>
<p>Nodes are connected using a <code>Graph</code> and executed by an <code>Engine</code>.</p>
<hr />
<h4 id="dagpipe.node--summary">Summary</h4>
<p>A Node represents a single unit of pipeline execution logic. It consumes one
State and produces zero, one, or many new States.</p>
<p>Nodes are connected using Graph and executed by Engine.</p>
<h3 id="dagpipe.node--design-principles">Design principles</h3>
<ul>
<li><strong>Pure:</strong> Must not mutate input state.</li>
<li><strong>Deterministic:</strong> Same input produces same output.</li>
<li><strong>Stateless:</strong> Recommended to be stateless for reuse.</li>
<li><strong>Composable:</strong> Nodes enable branching execution graphs.</li>
</ul>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Design Principles:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- **Pure:** Must not mutate input state.
- **Deterministic:** Same input produces same output.
- **Stateless:** Recommended to be stateless for reuse.
- **Composable:** Nodes enable branching execution graphs.
</code></pre></div></td></tr></table></div>
</details>
<div class="doc doc-children">
@@ -1180,11 +1192,13 @@ State and produces zero, one, or many new States.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents a deterministic unit of execution in the pipeline graph.
- Consumes one State and produces zero, one, or many derived States.
- Consumes one `State` and produces zero, one, or many derived states.
- Defines execution logic and enables branching, filtering, and transformation.
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Nodes must never mutate the input State. Instances are singletons per subclass and reused across executions.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Nodes must never mutate the input `State`.
- Instances are singletons per subclass and reused across executions.
</code></pre></div></td></tr></table></div>
</details>
@@ -1229,7 +1243,7 @@ State and produces zero, one, or many new States.</p>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="fm">__new__</span><span class="p">()</span>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="fm">__new__</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="nf">Node</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
@@ -1248,6 +1262,7 @@ State and produces zero, one, or many new States.</p>
<tbody>
<tr class="doc-section-item">
<td><code>Node</code></td> <td>
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="#dagpipe.node.Node">Node</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1384,7 +1399,7 @@ State and produces zero, one, or many new States.</p>
<div class="doc doc-contents ">
<p>Create a child State attributed to this node.</p>
<p>Create a child <code>State</code> attributed to this node.</p>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -1401,7 +1416,7 @@ State and produces zero, one, or many new States.</p>
<tr class="doc-section-item">
<td><code>state</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1469,7 +1484,7 @@ State and produces zero, one, or many new States.</p>
<tbody>
<tr class="doc-section-item">
<td><code>State</code></td> <td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1484,7 +1499,9 @@ State and produces zero, one, or many new States.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Convenience wrapper around State.fork() that automatically records this node&#39;s ID in state history.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Convenience wrapper around `State.fork()` that automatically
records this node&#39;s ID in state history.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1600,7 +1617,7 @@ State and produces zero, one, or many new States.</p>
<tr class="doc-section-item">
<td><code>state</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1626,7 +1643,7 @@ State and produces zero, one, or many new States.</p>
<tbody>
<tr class="doc-section-item">
<td><code>State</code></td> <td>
<code><span title="typing.Iterable">Iterable</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>]</code>
<code><span title="typing.Iterable">Iterable</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a>]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1641,7 +1658,13 @@ State and produces zero, one, or many new States.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Subclasses implement specific resolution behavior. Must not mutate input state. Should use fork() to create child states. May yield zero states to terminate a branch.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Subclasses implement specific resolution behavior.
- Must not mutate input state.
- Should use `fork()` to create child states.
- May yield zero states to terminate a branch.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1661,7 +1684,7 @@ State and produces zero, one, or many new States.</p>
<div class="doc doc-contents ">
<p>Execute this node on a State.</p>
<p>Execute this node on a <code>State</code>.</p>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -1678,7 +1701,7 @@ State and produces zero, one, or many new States.</p>
<tr class="doc-section-item">
<td><code>state</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1704,7 +1727,7 @@ State and produces zero, one, or many new States.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code>tuple[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>, ...]</code>
<code>tuple[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a>, ...]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1732,7 +1755,7 @@ Derived execution states.</p>
</td>
<td>
<div class="doc-md-description">
<p>If resolve() yields a non-State object.</p>
<p>If <code>resolve()</code> yields a non-<code>State</code> object.</p>
</div>
</td>
</tr>

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -362,6 +362,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.state--design-principles" class="md-nav__link">
<span class="md-ellipsis">
Design principles
</span>
</a>
</li>
<li class="md-nav__item">
@@ -990,6 +999,15 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#dagpipe.state--design-principles" class="md-nav__link">
<span class="md-ellipsis">
Design principles
</span>
</a>
</li>
<li class="md-nav__item">
@@ -1274,29 +1292,25 @@
<div class="doc doc-contents first">
<p>Defines the core State object used by dagpipe.</p>
<hr />
<h4 id="dagpipe.state--summary">Summary</h4>
<p>The State represents a single point in pipeline execution. It contains
<h3 id="dagpipe.state--summary">Summary</h3>
<p>Defines the core <code>State</code> object used by <code>dagpipe</code>.</p>
<p>The <code>State</code> represents a single point in pipeline execution. It contains
arbitrary data and metadata and is designed to be immutable. Instead of
modifying an existing state, nodes create new child states via fork().</p>
modifying an existing state, nodes create new child states via <code>fork()</code>.</p>
<hr />
<h3 id="dagpipe.state--design-principles">Design principles</h3>
<ul>
<li><strong>Immutability:</strong> States must never be modified after creation.
All transformations must create a new state via <code>fork()</code>.</li>
<li><strong>Cheap cloning:</strong> Forking must be efficient since branching may create many states.</li>
<li><strong>Lineage tracking:</strong> Each state maintains a reference to its parent and
execution metadata for debugging and observability.</li>
<li><strong>Domain agnostic:</strong> State contains generic key-value data and does not
assume any schema.</li>
<li><strong>Engine-friendly:</strong> State contains execution metadata such as depth and history.</li>
</ul>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Key design principles:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- **Immutability:** States must never be modified after creation. All transformations must create a new state via fork().
- **Cheap cloning:** Forking must be efficient since branching may create many states.
- **Lineage tracking:** Each state maintains a reference to its parent and execution metadata for debugging and observability.
- **Domain agnostic:** State contains generic keyvalue data and does not assume any schema.
- **Enginefriendly:** State contains execution metadata such as depth and history.
</code></pre></div></td></tr></table></div>
</details>
<div class="doc doc-children">
@@ -1358,8 +1372,10 @@ modifying an existing state, nodes create new child states via fork().</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Stores execution data used by State. Supports efficient atomic updates without modifying existing instances.
- Payload instances are fully thread-safe due to immutability.
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Stores execution data used by `State`.
- Supports efficient atomic updates without modifying existing instances.
- `Payload` instances are fully thread-safe due to immutability.
</code></pre></div></td></tr></table></div>
</details>
@@ -1720,7 +1736,7 @@ Iterator over top-level keys.</p>
<div class="doc doc-contents ">
<p>Create a new Payload with dot-path updates applied.</p>
<p>Create a new <code>Payload</code> with dot-path updates applied.</p>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -1763,7 +1779,7 @@ Iterator over top-level keys.</p>
<tbody>
<tr class="doc-section-item">
<td><code>Payload</code></td> <td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="../dagpipe/state/#dagpipe.state.Payload">Payload</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="#dagpipe.state.Payload">Payload</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1778,7 +1794,9 @@ Iterator over top-level keys.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Preserves existing data by copying only modified branches. Returns a new immutable payload.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Preserves existing data by copying only modified branches.
- Returns a new immutable `Payload`.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1844,7 +1862,9 @@ Iterator over top-level keys.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Validates State payloads and updates. Reuseable across all State instances.
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Validates `State` payloads and updates.
- Reusable across all `State` instances.
- Fully thread-safe due to immutability.
</code></pre></div></td></tr></table></div>
</details>
@@ -1891,7 +1911,7 @@ Iterator over top-level keys.</p>
<tr class="doc-section-item">
<td><code>payload</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="../dagpipe/state/#dagpipe.state.Payload">Payload</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="#dagpipe.state.Payload">Payload</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1917,7 +1937,7 @@ Iterator over top-level keys.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.SchemaError" href="../dagpipe/state/#dagpipe.state.SchemaError">SchemaError</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.SchemaError" href="#dagpipe.state.SchemaError">SchemaError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1988,7 +2008,7 @@ Iterator over top-level keys.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.SchemaError" href="../dagpipe/state/#dagpipe.state.SchemaError">SchemaError</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.SchemaError" href="#dagpipe.state.SchemaError">SchemaError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -2070,7 +2090,7 @@ Iterator over top-level keys.</p>
<tr class="doc-section-item">
<td><code><span title="dagpipe.state.State.payload">payload</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="../dagpipe/state/#dagpipe.state.Payload">Payload</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="#dagpipe.state.Payload">Payload</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -2081,7 +2101,7 @@ Iterator over top-level keys.</p>
<tr class="doc-section-item">
<td><code><span title="dagpipe.state.State.schema">schema</span></code></td>
<td>
<code><span title="typing.ClassVar">ClassVar</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.Schema" href="../dagpipe/state/#dagpipe.state.Schema">Schema</a>]</code>
<code><span title="typing.ClassVar">ClassVar</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.Schema" href="#dagpipe.state.Schema">Schema</a>]</code>
</td>
<td>
<div class="doc-md-description">
@@ -2103,7 +2123,7 @@ Iterator over top-level keys.</p>
<tr class="doc-section-item">
<td><code><span title="dagpipe.state.State.parent">parent</span></code></td>
<td>
<code><span title="typing.Optional">Optional</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>]</code>
<code><span title="typing.Optional">Optional</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="#dagpipe.state.State">State</a>]</code>
</td>
<td>
<div class="doc-md-description">
@@ -2152,7 +2172,11 @@ Iterator over top-level keys.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents a complete execution snapshot at a specific point in pipeline traversal. Fundamental unit of execution in dagpipe.
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents a complete execution snapshot at a specific point in
pipeline traversal.
- Fundamental unit of execution in `dagpipe`.
- Fully thread-safe due to immutability.
</code></pre></div></td></tr></table></div>
</details>
@@ -2202,7 +2226,7 @@ Iterator over top-level keys.</p>
<div class="doc doc-contents ">
<p>Create a new child State derived from this State.</p>
<p>Create a new child <code>State</code> derived from this state.</p>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -2287,11 +2311,11 @@ Iterator over top-level keys.</p>
<tbody>
<tr class="doc-section-item">
<td><code>State</code></td> <td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="#dagpipe.state.State">State</a></code>
</td>
<td>
<div class="doc-md-description">
<p>A new immutable State instance.</p>
<p>A new immutable <code>State</code> instance.</p>
</div>
</td>
</tr>
@@ -2303,8 +2327,10 @@ Iterator over top-level keys.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This is the only supported mechanism for modifying execution data.
- Validates payload updates, preserves lineage, increments depth, and appends to history.
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This is the only supported mechanism for modifying execution data.
- Validates payload updates, preserves lineage, increments depth,
and appends to history.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -2494,7 +2520,7 @@ Iterator over top-level keys.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>, ...]</code>
<code><span title="typing.Tuple">Tuple</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="#dagpipe.state.State">State</a>, ...]</code>
</td>
<td>
<div class="doc-md-description">

View File

@@ -936,12 +936,11 @@
<div class="doc doc-contents first">
<p>Loads dagpipe pipelines from YAML configuration.</p>
<hr />
<h4 id="dagpipe.yaml_loader--summary">Summary</h4>
<h3 id="dagpipe.yaml_loader--summary">Summary</h3>
<p>Loads dagpipe pipelines from YAML configuration.</p>
<p>Creates fully configured pipeline objects from declarative YAML definitions,
including Schema, State subclasses, Node instances, Graph topology,
and initial Payloads.</p>
including <code>Schema</code>, <code>State</code> subclasses, <code>Node</code> instances, <code>Graph</code> topology,
and initial payloads.</p>
@@ -989,7 +988,7 @@ and initial Payloads.</p>
<tr class="doc-section-item">
<td><code><span title="dagpipe.yaml_loader.Pipeline.engine">engine</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.engine.Engine" href="../dagpipe/engine/#dagpipe.engine.Engine">Engine</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.engine.Engine" href="../engine/#dagpipe.engine.Engine">Engine</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1000,18 +999,18 @@ and initial Payloads.</p>
<tr class="doc-section-item">
<td><code><span title="dagpipe.yaml_loader.Pipeline.state_cls">state_cls</span></code></td>
<td>
<code><span title="typing.Type">Type</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>]</code>
<code><span title="typing.Type">Type</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Dynamically created State subclass with configured schema.</p>
<p>Dynamically created <code>State</code> subclass with configured schema.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="dagpipe.yaml_loader.Pipeline.initial_payload">initial_payload</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="../dagpipe/state/#dagpipe.state.Payload">Payload</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.state.Payload" href="../state/#dagpipe.state.Payload">Payload</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1027,8 +1026,10 @@ and initial Payloads.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Encapsulates engine, state type, and initial payload. Provides a simplified interface for executing configured pipelines.
- Safe for concurrent execution if underlying Nodes are thread-safe.
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Encapsulates engine, state type, and initial payload.
- Provides a simplified interface for executing configured pipelines.
- Safe for concurrent execution if underlying nodes are thread-safe.
</code></pre></div></td></tr></table></div>
</details>
@@ -1052,12 +1053,12 @@ and initial Payloads.</p>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">run</span><span class="p">(</span><span class="n">payload_override</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Mapping</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">run</span><span class="p">(</span><span class="n">payload_override</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Mapping</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">list</span><span class="p">[</span><span class="n">State</span><span class="p">]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Execute pipeline.</p>
<p>Execute the pipeline.</p>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -1100,6 +1101,7 @@ and initial Payloads.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code>list[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a>]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1115,7 +1117,9 @@ Terminal execution states.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Merges override payload with initial payload, creates root State, and executes engine.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Merges override payload with initial payload.
- Creates root `State` and executes engine.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1187,7 +1191,7 @@ Terminal execution states.</p>
<tbody>
<tr class="doc-section-item">
<td><code>Pipeline</code></td> <td>
<code><a class="autorefs autorefs-internal" title="dagpipe.yaml_loader.Pipeline" href="../dagpipe/yaml_loader/#dagpipe.yaml_loader.Pipeline">Pipeline</a></code>
<code><a class="autorefs autorefs-internal" title="dagpipe.yaml_loader.Pipeline" href="#dagpipe.yaml_loader.Pipeline">Pipeline</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1202,7 +1206,11 @@ Terminal execution states.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Loads YAML configuration, builds schema, creates State subclass, loads Node instances, builds Graph topology, and initializes Engine.
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Loads YAML configuration and builds schema.
- Creates `State` subclass and loads `Node` instances.
- Builds `Graph` topology and initializes `Engine`.
</code></pre></div></td></tr></table></div>
</details>
</div>