Deterministic Python runtime for relational execution lineage DAGs.
Project description
Musubito
Musubito is a Python runtime for recording execution lineage in a relational DAG. It is designed for agentic and LLM-heavy workflows where repeated non-deterministic loops create avoidable token cost and latency.
The runtime records execution nodes, artifacts, and dependencies in SQLite. It uses deterministic node identity, replay semantics, downstream invalidation, and explicit multi-parent merge contexts to decide when a previous result can be reused safely.
Install
pip install musubito
Quickstart
import asyncio
from musubito import MusubitoResult, musubito_merge, musubito_step
@musubito_step()
async def fetch_context(topic: str) -> dict[str, str]:
return {"topic": topic, "source": "local"}
@musubito_step()
async def fetch_policy(topic: str) -> dict[str, str]:
return {"topic": topic, "policy": "strict-replay"}
@musubito_step()
def summarize(
context: MusubitoResult[dict[str, str]],
policy: MusubitoResult[dict[str, str]],
) -> dict[str, str]:
return {
"topic": context.value["topic"],
"policy": policy.value["policy"],
}
async def main() -> None:
context, policy = await asyncio.gather(
fetch_context("lineage"),
fetch_policy("lineage"),
)
with musubito_merge(context, policy):
result = summarize(context, policy)
print(result.value)
asyncio.run(main())
Decorated functions return MusubitoResult[T]. The wrapper does not unwrap .value;
the result carries lineage meta
value: the typed user value.artifact_id: the persisted output artifact identifier.producer_node_id: the historical node that originally produced the value.node_id: the node identity in the current DAG run.
Replay Model
Musubito computes deterministic node identity from the operation name, canonical input hash, and sorted upstream node identifiers. Replay is allowed only when the stored node is successful, has an available output artifact, is not stale, does not force re-execution, and any configured TTL has not expired.
Time-dependent replay checks use an explicit now value inside the semantics layer;
the replay decision itself does not read the system clock.
Local Storage
SQLite is used as local relational storage. The storage layer enables WAL mode and uses
short BEGIN IMMEDIATE write transactions. Downstream invalidation is performed with a
recursive CTE. By default, local state is stored under:
.musubito/musubito.db
License
Musubito is dual-licensed:
- Open Source: AGPL-3.0-or-later — free for open-source projects. See LICENSE.
- Commercial: closed-source or proprietary use requires a separate license. See COMMERCIAL_LICENSE.md or contact softwaretamrsv@gmail.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file musubito-0.1.0.tar.gz.
File metadata
- Download URL: musubito-0.1.0.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48f7dfedacefa01a6785d914dd60efd833d86c7d371840345d9ff3265a486911
|
|
| MD5 |
d9f9c92ccd13e937fb65795f530cdf5c
|
|
| BLAKE2b-256 |
ffa0d7e6e54c9e6756a781e211bbbd932199d15b76f783de356a83fc86eac0a9
|
File details
Details for the file musubito-0.1.0-py3-none-any.whl.
File metadata
- Download URL: musubito-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85e9e97ad05df0e49700cf6f1d450731a549b846ca20431ac0ae20dc332de71d
|
|
| MD5 |
64050c4e2da3879829c5eddfa930ef32
|
|
| BLAKE2b-256 |
6a7bc14519fb9f451119c32f89f0c4545f7dd758e754361a3905403493313e66
|