PyO3-backed Manyfold RFC scaffolding and in-memory runtime.
Project description
manyfold
This repository now contains a first-pass implementation scaffold for the
docs/rfc/wiregraph_rfc_rev2.md Manyfold RFC.
Layout
pyproject.toml: maturin/PyO3 Python packaging entrypointCargo.toml: Rust crate for the native core and Python extensionsrc/: Rust in-memory runtime, typed refs, descriptors, envelopes, mailboxes, queries, and control-loop stubspython/manyfold/: Python-facing ergonomic wrapper layerpython/manyfold/primitives.py: primary nouns and verbs for the Python APIpython/manyfold/embedded.py: RFC 21 embedded device profile helpers and validationpython/manyfold/reference_examples.py: RFC 23 reference example suite registryexamples/: executable API examples that are also covered by the test suiteproto/manyfold/v1/wiregraph.proto: extracted protobuf schema scaffold from the RFC appendix
Status
This is an RFC stub implementation, not a production runtime. The current code focuses on:
- typed namespace/route/schema identity objects,
- explicit
ReadablePort,WritablePort,WriteBinding, andMailboxsurfaces, - descriptor and envelope scaffolding,
- catalog/latest/topology/validation query helpers,
- a minimal
ControlLoopepoch stub, - Python object-first routes and shared-stream
ReadThenWriteNextEpochStepcomposition, - embedded device profile helpers for scalar and bulk sensors,
- a named reference example suite that tracks the RFC examples and runs the supported subset,
- Python bindings via PyO3 in the same layout as the referenced project style.
API Design Rules
The repository follows four implementation rules:
- write both very small examples and deeper behavioral tests;
- prefer extensive docstrings, targeted comments for non-obvious logic, and README-level guidance;
- add types aggressively and shape APIs around understandable objects rather than stringly calls;
- keep the top-level
manyfoldnamespace narrow, with advanced helpers living undermanyfold.graphand helper internals prefixed with_.
The intended Python wrapper surface is deliberately narrow:
- build a
TypedRoutewithOwnerName,StreamFamily,StreamName, andSchema - build a
ReadThenWriteNextEpochStepfrom a read stream and an output route graph.latest(route)for snapshot readsgraph.observe(route)for Rx subscriptionsgraph.publish(route, payload)for writesgraph.pipe(source, route)for wiring an Rx source into a routegraph.install(step)for attaching aReadThenWriteNextEpochStepgraph.run_control_loop(name)for advancing a control loop once
These route inputs are object-based rather than ad hoc strings. Schema also
owns payload encoding/decoding, so latest(route) and observe(route) can
return typed values instead of raw payload bytes.
ReadThenWriteNextEpochStep lives in the primary primitives module because it is
becoming a composition unit: it has one required input stream (read), one
required output route (output), and one shared derived stream (write). Any
subscriber to write observes the same emitted values that the graph sees when
the step is installed and started.
The examples/ directory demonstrates these calls directly, and the examples are
validated by the regular unittest run so they do not drift away from the API.
examples/simple_latest.py is the smallest publish/read-back example; more
involved query, join, transport, mesh, and security coverage stays in
tests/test_graph_reactive.py.
Best Practices
When extending this repository, prefer a narrow, explicit, well-documented API over a broad convenience surface.
- Write tests for every meaningful behavior change. Keep the smallest,
easiest-to-understand examples close to the usage they demonstrate in
examples/and mirror them with straightforward assertions intests/test_examples.py. Put more complex integration, reactive, and repository-level coverage in the rest of thetests/directory. - Write extensive docstrings and supporting documentation for public modules, classes, and functions. If a section of code is non-obvious, add a concise comment that explains the invariant, constraint, or design reason behind it.
- Always add types. Prefer signatures, return types, and data shapes that make the code self-describing, and keep pushing the API toward something a new reader can grok quickly without tracing through multiple layers of code.
- Only elevate essential concepts into the primary API. Keep helper functions and intermediate building blocks semi-private by default, and use a leading underscore liberally for methods and functions that support the implementation but should not become part of the stable surface area.
Verification
Use cargo test for native verification.
Use uv sync to provision the Python environment and build the extension into
the local .venv. Then run Python verification with uv run.
Typical Python commands:
uv run python -m unittest discover -s tests -p 'test_*.py'uv run python -m manyfold.rfc_checklist_gen --check
Generate PyO3 .pyi stubs with cargo run --features stub-gen --bin stub_gen.
If the default interpreter is older than Python 3.10, set PYO3_PYTHON to a
3.10+ interpreter first, for example
PYO3_PYTHON=/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/bin/python3.14 cargo run --features stub-gen --bin stub_gen.
Regenerate the RFC implementation checklist with
uv run manyfold-rfc-checklist (or uv run python -m manyfold.rfc_checklist_gen).
The Python package now targets Python 3.10+ because reactivex==5.0.0a2
requires it.
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 Distributions
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 manyfold-0.1.0.tar.gz.
File metadata
- Download URL: manyfold-0.1.0.tar.gz
- Upload date:
- Size: 110.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89cd09f3ad536f2b39239ac4616afd4e5dde3e4e7b8c1ec1c6938b145429e481
|
|
| MD5 |
7b25ab0596df607bdfc502cabaa52e94
|
|
| BLAKE2b-256 |
832317f9841b6a0eec314bf304b096369b06f31e95e000b977befa28da53440a
|
Provenance
The following attestation bundles were made for manyfold-0.1.0.tar.gz:
Publisher:
pypi.yml on Organization5762/manyfold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manyfold-0.1.0.tar.gz -
Subject digest:
89cd09f3ad536f2b39239ac4616afd4e5dde3e4e7b8c1ec1c6938b145429e481 - Sigstore transparency entry: 1429784046
- Sigstore integration time:
-
Permalink:
Organization5762/manyfold@c758af5679535760bf34fa42f48131ced9514018 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Organization5762
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@c758af5679535760bf34fa42f48131ced9514018 -
Trigger Event:
release
-
Statement type:
File details
Details for the file manyfold-0.1.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: manyfold-0.1.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 331.4 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f394004dc86cd46fcb74fe4cc2a7aec385c187cec7b9aae7fe31a214d05a5d88
|
|
| MD5 |
c73122e7aeeb56b4dc699c23a79857c7
|
|
| BLAKE2b-256 |
469009f93ef38b27082ae6b430772328196320b2a12bef73e4f713cec07ae126
|
Provenance
The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-win_amd64.whl:
Publisher:
pypi.yml on Organization5762/manyfold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manyfold-0.1.0-cp310-abi3-win_amd64.whl -
Subject digest:
f394004dc86cd46fcb74fe4cc2a7aec385c187cec7b9aae7fe31a214d05a5d88 - Sigstore transparency entry: 1429784095
- Sigstore integration time:
-
Permalink:
Organization5762/manyfold@c758af5679535760bf34fa42f48131ced9514018 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Organization5762
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@c758af5679535760bf34fa42f48131ced9514018 -
Trigger Event:
release
-
Statement type:
File details
Details for the file manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 493.4 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3edaae857c18883ac86052cfb1670f56fd653b555f5c65411ee48c29b9eef5e1
|
|
| MD5 |
68511f97fef9335a82ea69f5ec792e80
|
|
| BLAKE2b-256 |
ca0353373a63c43f642ec958d0da2c6d40b243c283e36225df6b61ad7e4db7c2
|
Provenance
The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
pypi.yml on Organization5762/manyfold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
3edaae857c18883ac86052cfb1670f56fd653b555f5c65411ee48c29b9eef5e1 - Sigstore transparency entry: 1429784082
- Sigstore integration time:
-
Permalink:
Organization5762/manyfold@c758af5679535760bf34fa42f48131ced9514018 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Organization5762
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@c758af5679535760bf34fa42f48131ced9514018 -
Trigger Event:
release
-
Statement type:
File details
Details for the file manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 447.8 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3377fbd24ffc774acabf45af176be850071f0805ad54eb9ae1e0fddd28ff7488
|
|
| MD5 |
3f0fcaeb714ce188d674f2867f234089
|
|
| BLAKE2b-256 |
d4d28ed65de404cc1f812d9683810c61d771c553289ae28024ccd019e5007c49
|
Provenance
The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
pypi.yml on Organization5762/manyfold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
3377fbd24ffc774acabf45af176be850071f0805ad54eb9ae1e0fddd28ff7488 - Sigstore transparency entry: 1429784067
- Sigstore integration time:
-
Permalink:
Organization5762/manyfold@c758af5679535760bf34fa42f48131ced9514018 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Organization5762
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@c758af5679535760bf34fa42f48131ced9514018 -
Trigger Event:
release
-
Statement type:
File details
Details for the file manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 454.4 kB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00450f34e4252566b76f1a0e43f842590a79025ddecf2fb770458f250554abc2
|
|
| MD5 |
67b0f550e216b5583871ab94c1d6bb49
|
|
| BLAKE2b-256 |
6b247eaf900f005ca7b11f9f763d2c46b8d6a8fc5a9ecf0eb97f8dbb2953b5d8
|
Provenance
The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
pypi.yml on Organization5762/manyfold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
00450f34e4252566b76f1a0e43f842590a79025ddecf2fb770458f250554abc2 - Sigstore transparency entry: 1429784058
- Sigstore integration time:
-
Permalink:
Organization5762/manyfold@c758af5679535760bf34fa42f48131ced9514018 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Organization5762
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@c758af5679535760bf34fa42f48131ced9514018 -
Trigger Event:
release
-
Statement type: