{"id":28489314,"url":"https://github.com/git-afsantos/hpl-rv","last_synced_at":"2025-07-25T22:13:36.119Z","repository":{"id":180632124,"uuid":"665451609","full_name":"git-afsantos/hpl-rv","owner":"git-afsantos","description":"Tools to manage RV monitors created from HPL","archived":false,"fork":false,"pushed_at":"2025-01-24T05:54:18.000Z","size":327,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-08T06:41:58.785Z","etag":null,"topics":["code-generation","runtime-verification","safety-monitoring","verification"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/git-afsantos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-12T08:29:44.000Z","updated_at":"2024-12-12T14:21:47.000Z","dependencies_parsed_at":"2023-12-27T12:26:04.429Z","dependency_job_id":"4b40c30f-2f07-4d0e-adba-fa7afab8e5d8","html_url":"https://github.com/git-afsantos/hpl-rv","commit_stats":{"total_commits":82,"total_committers":3,"mean_commits":"27.333333333333332","dds":"0.23170731707317072","last_synced_commit":"cd9a34ad86415563192624897194412e98dfe570"},"previous_names":["git-afsantos/hpl-rv-dashboard"],"tags_count":5,"template":false,"template_full_name":"git-afsantos/bake-a-py","purl":"pkg:github/git-afsantos/hpl-rv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-afsantos%2Fhpl-rv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-afsantos%2Fhpl-rv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-afsantos%2Fhpl-rv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-afsantos%2Fhpl-rv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git-afsantos","download_url":"https://codeload.github.com/git-afsantos/hpl-rv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-afsantos%2Fhpl-rv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262239181,"owners_count":23280277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","runtime-verification","safety-monitoring","verification"],"created_at":"2025-06-08T06:36:26.950Z","updated_at":"2025-06-27T10:32:35.926Z","avatar_url":"https://github.com/git-afsantos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HPL Runtime Verification\n\nThis project provides tools from which you can build and manage runtime monitors based on [HPL properties](https://github.com/git-afsantos/hpl-specs/).\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [GitHub Features](#github-features)\n- [Tooling](#tooling)\n\n## Installation\n\nInstall this package with\n\n```\npip install hpl-rv\n```\n\n## Usage\n\n### Code Generation\n\nThis package provides a command line interface from which you can generate runtime monitors with a simple command.\n\n```bash\n# generating monitors from a specification file\nhpl-rv gen -f my_spec.hpl\n# generating monitors directly from properties\nhpl-rv gen \"globally: no /a\"\n# redirecting the output to a file\nhpl-rv gen -o ./code.py \"globally: some /b within 100ms\"\n```\n\nWhen used as a library, you can generate Python code for a runtime monitor class with a few simple steps.\nFor example:\n\n```python\nfrom hplrv.gen import lib_from_properties\nhpl_properties = ['globally: no (/a or /b)']\ncode: str = lib_from_properties(hpl_properties)\nprint(code)\n```\n\n### Monitoring Dashboard\n\nThis package also includes a web-based dashboard that enables live feedback from runtime monitors in a human-friendly format.\n\n![Monitoring Dashboard](./docs/screenshot.png)\n\nTo execute the web server for this dashboard, run the `gui` command:\n\n```bash\nhpl-rv gui --host \"127.0.0.1\" --port 8080\n```\n\nThen, open the dashboard client with a web browser (e.g., on `http://localhost:8080`).\n\nThrough the dashboard, you can connect to runtime monitors to get live feedback.\nTo enable this feature, though, your runtime monitors should first start the feedback server.\n\nFor example, for code generated with `lib_from_properties()`, the main script where these monitors are included should follow roughly the following guidelines.\n\n```py\nfrom threading import Thread\nfrom .generated_monitors import HplMonitorManager\n\nman = HplMonitorManager()\nman.live_server.host = '127.0.0.1'\nman.live_server.port = 4242\nthread: Thread = man.live_server.start_thread()\nnow: float = 0.0\nman.launch(now)\ntry:\n    # sleep or feed messages to the monitors; example:\n    while True:\n        sleep(1.0)\n        now += 1.0\n        man.on_timer(now)\nexcept KeyboardInterrupt:\n    pass\nman.shutdown(now)\nthread.join(10.0)\n```\n\nThe call to `live_server.start_thread()` is what enables the dashboard to get live feedback.\n\n## GitHub Features\n\nThe `.github` directory comes with a number of files to configure certain GitHub features.\n\n- Various Issue templates can be found under `ISSUE_TEMPLATE`.\n- A Pull Request template can be found at `PULL_REQUEST_TEMPLATE.md`.\n- Automatically mark issues as stale after a period of inactivity. The configuration file can be found at `.stale.yml`.\n- Keep package dependencies up to date with Dependabot. The configuration file can be found at `dependabot.yml`.\n- Keep Release Drafts automatically up to date with Pull Requests, using the [Release Drafter GitHub Action](https://github.com/marketplace/actions/release-drafter). The configuration file can be found at `release-drafter.yml` and the workflow at `workflows/release-drafter.yml`.\n- Automatic package building and publishing when pushing a new version tag to `main`. The workflow can be found at `workflows/publish-package.yml`.\n\n## Tooling\n\nThis package sets up various `tox` environments for static checks, testing, building and publishing.\nIt is also configured with `pre-commit` hooks to perform static checks and automatic formatting.\n\nIf you do not use `tox`, you can build the package with `build` and install a development version with `pip`.\n\nAssume `cd` into the repository's root.\n\nTo install the `pre-commit` hooks:\n\n```bash\npre-commit install\n```\n\nTo run type checking:\n\n```bash\ntox -e typecheck\n```\n\nTo run linting tools:\n\n```bash\ntox -e lint\n```\n\nTo run automatic formatting:\n\n```bash\ntox -e format\n```\n\nTo run tests:\n\n```bash\ntox\n```\n\nTo build the package:\n\n```bash\ntox -e build\n```\n\nTo build the package (with `build`):\n\n```bash\npython -m build\n```\n\nTo clean the previous build files:\n\n```bash\ntox -e clean\n```\n\nTo test package publication (publish to *Test PyPI*):\n\n```bash\ntox -e publish\n```\n\nTo publish the package to PyPI:\n\n```bash\ntox -e publish -- --repository pypi\n```\n\nTo install an editable version:\n\n```bash\npip install -e .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-afsantos%2Fhpl-rv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-afsantos%2Fhpl-rv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-afsantos%2Fhpl-rv/lists"}