Skip to main content

System Runtime Specification for Python

system-runtime-spec implements the System Runtime Specification in Python: it discovers records on Linux, checks the compatibility of compositions and updates, evaluates health, and sends records to other systems as snapshots.

Installation

Python 3.12 or later is required:

python -m pip install system-runtime-spec

Import the package as system_runtime_spec. Records holds the records of a system and the diagnostics about them. The Pydantic models in system_runtime_spec.models are generated from the specification's schemas.

Read and Check a System

from system_runtime_spec import Records, current_context

records = Records.discover("/")
compatibility = records.check_compatibility()
health = records.evaluate_health(current_context())
print("consistent:", compatibility.consistent)
for result in health.results:
    print(f"{result.id}: usable {result.usable}, healthy {result.healthy}")

Records.discover reads the standard directories and the directories that directory configurations add, and applies overrides. Files that cannot be read or do not contain a valid record are skipped and reported as diagnostics. Reports take the diagnostics of their part into account: an error about component declarations makes a composition inconsistent, and a decision should not rely on a health report with errors about health nodes or directory configurations.

Add Records in Code

push adds a record given as a model, and push_json one given as JSON, such as a record received from another system. Both validate the record and skip it with an error diagnostic if it is invalid:

from system_runtime_spec import Records
from system_runtime_spec.models.component import (
    CapabilitySelectorDeclaration,
    ComponentDeclaration,
)

records = Records()
records.push(ComponentDeclaration(id="os", version="2.1"))
records.push(
    ComponentDeclaration(
        id="app",
        requires=[CapabilitySelectorDeclaration(id="os", version=">=2")],
    )
)
records.push_json(ComponentDeclaration, {"id": "tool"})
assert records.check_compatibility().consistent

Check an Update

with_update builds the composition that an update would produce: it replaces all component declarations of the given owners with those of the update.

from system_runtime_spec import Records
from system_runtime_spec.models.component import ComponentDeclaration

records = Records.discover("/")
update = Records()
update.push(ComponentDeclaration(id="os", owner="rugix.system", version="2.0"))
candidate = records.with_update(["rugix.system"], update)
print("consistent:", candidate.check_compatibility().consistent)

Send Records as a Snapshot

A Snapshot contains the original records, so the receiving system evaluates them as the sending system read them. Take the clock sample after reading the records:

import json

from system_runtime_spec import (
    Records,
    Snapshot,
    current_clock_sample,
    estimate_timestamp,
)

records = Records.discover("/")
payload = json.dumps(Snapshot(records, current_clock_sample()).to_json())

# On the receiving system:
received = Snapshot.from_json(json.loads(payload))
report = received.records.evaluate_health(received.clock.context)
for status in received.records.health_statuses:
    print(status.id, estimate_timestamp(received.clock, status))

Snapshot takes components=False or health=False to leave out a part. Snapshot.from_json raises a SnapshotError for snapshots of an unsupported version or with an invalid structure. Evaluating a snapshot gives health at the time of its clock sample, and estimate_timestamp places evidence in wall-clock time for display.

Records.discover, current_context, and current_clock_sample are available on Linux only.

License

Available under either the MIT License or the Apache License 2.0.

Metadata

Release files for system-runtime-spec 0.2.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 system-runtime-spec 0.2.0
File Size Uploaded Provenance Actions
system_runtime_spec-0.2.0.tar.gz 65.4 kB With provenance Details for system_runtime_spec-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for system-runtime-spec 0.2.0
File Interpreter ABI Platform Actions
system_runtime_spec-0.2.0-py3-none-any.whl Python 3 none any Details for system_runtime_spec-0.2.0-py3-none-any.whl

Total release size: 103.4 kB

Release files / system_runtime_spec-0.2.0.tar.gz

Download URL system_runtime_spec-0.2.0.tar.gz
Size 65.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b024a910ba855f25b95f4d01a2c1b16e25f58255c030ac0ca172773c80d2cf27
BLAKE2b-256 checksum
How to use checksums
9c3fb7a8377d51622be01576404945b7d5f8721fb7443f6b4685655c4c385920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

Release files / system_runtime_spec-0.2.0-py3-none-any.whl

Download URL system_runtime_spec-0.2.0-py3-none-any.whl
Size 38.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9292c16d84ed9acea39c139c5690124fe1180651e13804a8b72b4e3e85192217
BLAKE2b-256 checksum
How to use checksums
e804c54fada8520beb6b56c48c688c2e528f46e3167958f9a5df66ef32889239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

Security for system-runtime-spec 0.2.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 system_runtime_spec-0.2.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 Nov 16, 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