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.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 system-runtime-spec 0.3.0
File Size Uploaded Provenance Actions
system_runtime_spec-0.3.0.tar.gz 66.0 kB With provenance Details for system_runtime_spec-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 104.7 kB

Release files / system_runtime_spec-0.3.0.tar.gz

Download URL system_runtime_spec-0.3.0.tar.gz
Size 66.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7539df440e05c3a83e379d7fa77d2ea8aa1d2bdb7d079f710be726a48954e306
BLAKE2b-256 checksum
How to use checksums
75add23fb222142575c416b0c568ffe940d065d1befba42ff83c1ceb10f1e6de
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 Dec 3, 2026.

Transparency log

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

Download URL system_runtime_spec-0.3.0-py3-none-any.whl
Size 38.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9a76ba230f575108d3c9b55e9a7b89f260bf820ccfb2cddc5e5089df3372f2a
BLAKE2b-256 checksum
How to use checksums
d2f48b4d942fc2c59ab467958e61cad2dac50ca86da7df59da150392f693f1d6
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 Dec 3, 2026.

Transparency log

Security for system-runtime-spec 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 system_runtime_spec-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 Dec 3, 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