Skip to main content

statepatch

Immer-style ops over a plain JSON tree: observable(initial) wraps one value, .value reads it, and every mutation emits the matching replace / add / remove op to subscribers. Observables compose: one stored inside another mounts its op stream at that path. Part of harness-sdk, under statewire and pinned.

Install

uv add statepatch

Use

from statepatch import observable

state = observable({"runs": []})
state.subscribe(print)

run = observable({"runId": "r1", "queue": []})
state["runs"].append(run)          # add op at ["runs", 0]
run["queue"].append({"id": "q1"})  # forwarded as add at ["runs", 0, "queue", 0]
state["runs"].pop(0)               # remove op; run is detached and reusable

Validation

from statepatch import WireEncodingError exposes the ValueError subclass for invalid wire values.

Docs

Metadata

Release files for statepatch 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statepatch 0.3.0
File Size Uploaded Provenance Actions
statepatch-0.3.0.tar.gz 8.3 kB With provenance Details for statepatch-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for statepatch 0.3.0
File Interpreter ABI Platform Actions
statepatch-0.3.0-py3-none-any.whl Python 3 none any Details for statepatch-0.3.0-py3-none-any.whl

Total release size: 15.2 kB

Release files / statepatch-0.3.0.tar.gz

Download URL statepatch-0.3.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7905dad5203d5922df60fff071e000ec726d7784ff250f88a2e9dcde197da8d7
BLAKE2b-256 checksum
How to use checksums
6b538ca120465890bbeaa842fb98f299c84ff3d8d219fc13375f9b669e7b757b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / statepatch-0.3.0-py3-none-any.whl

Download URL statepatch-0.3.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
962df034cb3c84c5e650a43407fec0819a606ffd9739fc3205cd6e248a797a9f
BLAKE2b-256 checksum
How to use checksums
a70b9228fd053ce143af5d852f049bb623e601f6456fb6dd0d4e8c7f2e2ce24e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for statepatch 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for statepatch-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page