Standard inbox/outbox worker runtime for MetaSPN agent systems
Project description
metaspn-ops
Standard inbox/outbox worker runtime for MetaSPN agent systems.
Features
- Filesystem queue backend with inbox/outbox semantics
- Task leasing with lock files and lease expiration
- Retries with exponential backoff and dead-letter queue
- Worker runner with polling and parallel execution
- CLI for worker runs and queue operations
Installation
pip install metaspn-ops
Quickstart
1) Define a worker
# example_worker.py
from metaspn_ops import Result, Task
class EnrichWorker:
name = "enrich"
def handle(self, task: Task) -> Result:
payload = {"seen": task.payload}
return Result(task_id=task.task_id, status="ok", payload=payload)
2) Run a worker once
metaspn worker run example_worker:EnrichWorker --workspace . --once --max-tasks 10
3) Queue inspection
metaspn queue stats enrich --workspace .
metaspn queue deadletter list enrich --workspace .
metaspn queue retry enrich --workspace .
Queue layout
workspace/
inbox/{worker_name}/
outbox/{worker_name}/
runs/{worker_name}/
deadletter/{worker_name}/
locks/{worker_name}/
Development
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
PYTHONPATH=src python -m unittest discover -s tests -v
python -m build
python -m twine check dist/*
Release
- Tag a release in GitHub (for example
v0.1.0). - GitHub Actions builds and publishes to PyPI using trusted publishing.
- Configure a PyPI Trusted Publisher for this repository before the first release.
- See
/Users/leoguinan/MetaSPN/metaspn-ops/PUBLISHING.mdfor the full flow.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaspn_ops-0.1.0.tar.gz.
File metadata
- Download URL: metaspn_ops-0.1.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2268588b80f4ce6af4b8174ef3c8c408cbb1f7079da336dbfecbbfc195fca827
|
|
| MD5 |
4f88bea6721617493089b83bdf1ef3dc
|
|
| BLAKE2b-256 |
38936838b6a0dc8a459f23d04f3bc21599824115e06b66a4c951cd1d9d7c2e66
|
Provenance
The following attestation bundles were made for metaspn_ops-0.1.0.tar.gz:
Publisher:
publish.yml on MetaSPN/metaspn-ops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaspn_ops-0.1.0.tar.gz -
Subject digest:
2268588b80f4ce6af4b8174ef3c8c408cbb1f7079da336dbfecbbfc195fca827 - Sigstore transparency entry: 921197153
- Sigstore integration time:
-
Permalink:
MetaSPN/metaspn-ops@64df16b15f6dacf84fd68621a723243b92d5586c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MetaSPN
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64df16b15f6dacf84fd68621a723243b92d5586c -
Trigger Event:
release
-
Statement type:
File details
Details for the file metaspn_ops-0.1.0-py3-none-any.whl.
File metadata
- Download URL: metaspn_ops-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e690e24d71f8e2b4a94e2214717bbdb95a342e473cf76c07f2ee9e6d0541d324
|
|
| MD5 |
50f44b0c15fb1afea4dc18bd49490520
|
|
| BLAKE2b-256 |
a9fa5e19baded127f4869ed83bcf854a2a51f19b68ea13963a21f661a7836cd1
|
Provenance
The following attestation bundles were made for metaspn_ops-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on MetaSPN/metaspn-ops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaspn_ops-0.1.0-py3-none-any.whl -
Subject digest:
e690e24d71f8e2b4a94e2214717bbdb95a342e473cf76c07f2ee9e6d0541d324 - Sigstore transparency entry: 921197182
- Sigstore integration time:
-
Permalink:
MetaSPN/metaspn-ops@64df16b15f6dacf84fd68621a723243b92d5586c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MetaSPN
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64df16b15f6dacf84fd68621a723243b92d5586c -
Trigger Event:
release
-
Statement type: