sergent-py-runtime
This package is the execution engine of the Sergent Python reference implementation. It is the only package in the stack that may change application data. The specification's rule that the model only proposes is kept here or nowhere: every decode, every check, the rehearsal, and the single commit happen inside this package.
Why this package carries the weight
Three properties give the runtime its architectural position.
It holds mutation authority alone. The core package holds values and interfaces, the providers package holds transport, and the battery package holds wiring. None of them touches a Scene. An application therefore reasons about data safety by reasoning about one engine.
It knows nothing about providers. Concrete model transport reaches the runtime only through a core interface, so this package never imports the providers package. That one restriction keeps provider changes out of the safety path and lets the whole engine run under test with scripted clients and no network. It is the layering the specification recommends in for implementers.
It owns the asynchronous shape of a Run. Model calls are the Run's only suspension points, exactly as async execution expects. The deterministic tail never suspends, so the stretch from Patch validation to commit cannot interleave with another Run on the same event loop.
What the runtime does not decide is just as fixed: Scene shape, Target meaning, Intent semantics, the Operation vocabulary, prompt text, and evidence retention all belong to the application. The engine contributes order, isolation, and evidence.
A Run in Python
SergentRuntime is the Sergent Runtime.
One instance is built from a model client, the Scene Actions, and the Recipe, and it may drive
many Runs concurrently.
A caller starts a Run in one of two ways. run() is the asynchronous entry point and returns
the terminal result. start() schedules the same pipeline on an asyncio task and returns a
RunHandle that reports progress, requests cancellation, and awaits the result. There is no
synchronous execution twin.
The caller also chooses the Scene authority, and that choice is the application's
writer model rather than a
detail of its user interface. A plain Scene is a snapshot input: the runtime clones it once and
commits to the isolated clone. A SceneState is shared live authority: many Runs may hold the
same one, and commit compares the observed revision against the current revision before it
mutates anything.
Between those two ends the Run follows the specification's flow with at most two awaited model calls. The first may propose the Intent; recipes that skip it receive the runtime-provided pass-through proposal instead. The second proposes the Execution Plan. Every remaining step, including the admissibility pass, Patch validation, the dry-run, and commit, is a plain synchronous function.
The Run ends with a Sergent Result, not with an exception. The result carries the terminal Scene, the closed Run Record, the last reached stage, the terminal facts, and any contained observer failures. Ordinary failures inside the pipeline become that structured value, and the Scene stays untouched unless commit succeeded.
Persisting the evidence stays optional. When an application opts in, the runtime's Run Record harness writes Run Record files and the application keeps the surrounding policy that observability ownership assigns to it.
Where to read next
docs/KNOWLEDGE.md walks the whole engine: which Python owner performs each step of the Run flow, how this package meets the core and providers packages, and how it handles side effects, failure, cancellation, concurrency, and durability.
Metadata
Release files for sergent-py-runtime 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sergent_py_runtime-0.1.0.tar.gz | 24.8 kB | Without provenance | Details for sergent_py_runtime-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sergent_py_runtime-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for sergent_py_runtime-0.1.0-py3-none-any.whl |
Total release size: 56.0 kB
Release files / sergent_py_runtime-0.1.0.tar.gz
| Download URL | sergent_py_runtime-0.1.0.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5cec92176c81cee9e258677366ffab08ea31910fbbe64249c5fc51708875d037
|
|
BLAKE2b-256 checksum How to use checksums |
48bda06adc44c23c2c211c2f3699036787f84d48cd0323101348717febc8a2b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / sergent_py_runtime-0.1.0-py3-none-any.whl
| Download URL | sergent_py_runtime-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
176cb20475670fc451550dfa4b709d9aa9eb160faa1754b040e7f70a5decaa68
|
|
BLAKE2b-256 checksum How to use checksums |
5d42367952e0b724cd1b90b9cecc38ad626549d46bd3866d5688abe6132fc803
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for sergent-py-runtime 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.