Skip to main content

HPL Runtime Verification

This project provides tools from which you can build and manage runtime monitors based on HPL properties.

Installation

Install this package with

pip install hpl-rv

Usage

Code Generation

This package provides a command line interface from which you can generate runtime monitors with a simple command.

# generating monitors from a specification file
hpl-rv gen -f my_spec.hpl
# generating monitors directly from properties
hpl-rv gen "globally: no /a"
# redirecting the output to a file
hpl-rv gen -o ./code.py "globally: some /b within 100ms"

When used as a library, you can generate Python code for a runtime monitor class with a few simple steps. For example:

from hplrv.gen import lib_from_properties
hpl_properties = ['globally: no (/a or /b)']
code: str = lib_from_properties(hpl_properties)
print(code)

Monitoring Dashboard

This package also includes a web-based dashboard that enables live feedback from runtime monitors in a human-friendly format.

Monitoring Dashboard

To execute the web server for this dashboard, run the gui command:

hpl-rv gui --host "127.0.0.1" --port 8080

Then, open the dashboard client with a web browser (e.g., on http://localhost:8080).

Through the dashboard, you can connect to runtime monitors to get live feedback. To enable this feature, though, your runtime monitors should first start the feedback server.

For example, for code generated with lib_from_properties(), the main script where these monitors are included should follow roughly the following guidelines.

from threading import Thread
from .generated_monitors import HplMonitorManager

man = HplMonitorManager()
man.live_server.host = '127.0.0.1'
man.live_server.port = 4242
thread: Thread = man.live_server.start_thread()
now: float = 0.0
man.launch(now)
try:
    # sleep or feed messages to the monitors; example:
    while True:
        sleep(1.0)
        now += 1.0
        man.on_timer(now)
except KeyboardInterrupt:
    pass
man.shutdown(now)
thread.join(10.0)

The call to live_server.start_thread() is what enables the dashboard to get live feedback.

GitHub Features

The .github directory comes with a number of files to configure certain GitHub features.

  • Various Issue templates can be found under ISSUE_TEMPLATE.
  • A Pull Request template can be found at PULL_REQUEST_TEMPLATE.md.
  • Automatically mark issues as stale after a period of inactivity. The configuration file can be found at .stale.yml.
  • Keep package dependencies up to date with Dependabot. The configuration file can be found at dependabot.yml.
  • Keep Release Drafts automatically up to date with Pull Requests, using the Release Drafter GitHub Action. The configuration file can be found at release-drafter.yml and the workflow at workflows/release-drafter.yml.
  • Automatic package building and publishing when pushing a new version tag to main. The workflow can be found at workflows/publish-package.yml.

Tooling

This package sets up various tox environments for static checks, testing, building and publishing. It is also configured with pre-commit hooks to perform static checks and automatic formatting.

If you do not use tox, you can build the package with build and install a development version with pip.

Assume cd into the repository's root.

To install the pre-commit hooks:

pre-commit install

To run type checking:

tox -e typecheck

To run linting tools:

tox -e lint

To run automatic formatting:

tox -e format

To run tests:

tox

To build the package:

tox -e build

To build the package (with build):

python -m build

To clean the previous build files:

tox -e clean

To test package publication (publish to Test PyPI):

tox -e publish

To publish the package to PyPI:

tox -e publish -- --repository pypi

To install an editable version:

pip install -e .

Metadata

Release files for hpl-rv 1.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 hpl-rv 1.2.0
File Size Uploaded Provenance Actions
hpl-rv-1.2.0.tar.gz 218.0 kB Without provenance Details for hpl-rv-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hpl-rv 1.2.0
File Interpreter ABI Platform Actions
hpl_rv-1.2.0-py3-none-any.whl Python 3 none any Details for hpl_rv-1.2.0-py3-none-any.whl

Total release size: 271.9 kB

Release files / hpl-rv-1.2.0.tar.gz

Download URL hpl-rv-1.2.0.tar.gz
Size 218.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1b243684d35d079fc2b61f9825d8e5e98159a2d6e5a0bef108c7e9a41c2d9754
BLAKE2b-256 checksum
How to use checksums
194fc97226223ad2b6e46147ccaeaba62e845a5a167137b727957cc7ea9f5d6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / hpl_rv-1.2.0-py3-none-any.whl

Download URL hpl_rv-1.2.0-py3-none-any.whl
Size 53.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eece5241972059660f0d7a7ffa6d17c1e63000bd294e8c0e73351c606ca53b4e
BLAKE2b-256 checksum
How to use checksums
ada982e800297937e1a04cf726e03f1918355a1074e1daf335fd089f10d13b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Security for hpl-rv 1.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.

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.

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