The connective tissue of the Seren stack: shared runtime plumbing (request logging now; cluster client / discovery / DTOs later).
Project description
SerenSinew
The connective tissue of the Seren stack.
If SerenMeninges is the membrane - the UI shell, auth, config, credentials every service wears - then Sinew is the tendon: the cross-cutting runtime plumbing every Seren web service repeats. One copy, so a fix lands everywhere at once.
What's in it (today)
Request logging. Drop-in middleware that logs every HTTP request as
<client> <METHOD> <path> -> <status> (<ms>ms) - INFO for 2xx/3xx, WARNING for
4xx (and slow 2xx), ERROR with a full traceback for 5xx. Goes to both stderr
(so journalctl catches it) and a rotating file the running user owns at
~/seren-logs/<service>-requests.log, so anyone debugging can tail it without
sudo.
It's parameterized, not hardcoded - service_name picks the logger name and
log filename, env_prefix picks the env-var namespace:
from seren_sinew.request_log import RequestLoggingMiddleware
# Mount OUTERMOST - before auth - so 401s get logged too.
app.add_middleware(BearerAuthMiddleware, expected_token=token) # inner
app.add_middleware( # outer
RequestLoggingMiddleware,
service_name="seren-observatory",
env_prefix="SEREN_AGENT", # -> SEREN_AGENT_LOG_LEVEL / SEREN_AGENT_LOG_QUERY
)
Knobs (per env_prefix):
| env var | effect |
|---|---|
<PREFIX>_LOG_LEVEL |
INFO (default) | DEBUG | WARNING | ERROR |
<PREFIX>_LOG_QUERY |
1 to append ?query to the logged path (off by default - query strings can carry tokens / PII) |
What's coming
The Python landing pad for the cluster client / discovery / DTOs when Lodestar (RuntimeHost) and Workbench port over from C#. Sinew is where the connective runtime code goes; Meninges stays the membrane.
Install
pip install seren-sinew
Light by design - depends only on starlette (already in every leaf via
FastAPI), so it stays FastAPI-agnostic and adds nothing to a real install.
GPL-3.0-or-later.
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 seren_sinew-1.0.0.tar.gz.
File metadata
- Download URL: seren_sinew-1.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bb56ad1d76db8cb942f9b500b5a8906afcb9805b366ab6c4d18b14567a51cbb
|
|
| MD5 |
31e98a607bbb188e4e51ad31b44e552a
|
|
| BLAKE2b-256 |
5b1b1c4ef43e635ad2b6cc99fde0596f20c809de949bd0b0180e3666f4aae2e4
|
Provenance
The following attestation bundles were made for seren_sinew-1.0.0.tar.gz:
Publisher:
release.yml on ChadRoesler/SerenSinew
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seren_sinew-1.0.0.tar.gz -
Subject digest:
0bb56ad1d76db8cb942f9b500b5a8906afcb9805b366ab6c4d18b14567a51cbb - Sigstore transparency entry: 1958963774
- Sigstore integration time:
-
Permalink:
ChadRoesler/SerenSinew@5549343f4b4075b76e94ad43208078f283db90ef -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ChadRoesler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5549343f4b4075b76e94ad43208078f283db90ef -
Trigger Event:
push
-
Statement type:
File details
Details for the file seren_sinew-1.0.0-py3-none-any.whl.
File metadata
- Download URL: seren_sinew-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28dd163a02a6e81b3c4832dcdb1db0f3e51ac8c625948f5264fb8811aae71b59
|
|
| MD5 |
0d01eec6a7348a06de13c5e72f5dbfb2
|
|
| BLAKE2b-256 |
d45ee0f0c1dc530c36628ea450f7b3765090ad1f01d3306958e31c2494d383ee
|
Provenance
The following attestation bundles were made for seren_sinew-1.0.0-py3-none-any.whl:
Publisher:
release.yml on ChadRoesler/SerenSinew
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seren_sinew-1.0.0-py3-none-any.whl -
Subject digest:
28dd163a02a6e81b3c4832dcdb1db0f3e51ac8c625948f5264fb8811aae71b59 - Sigstore transparency entry: 1958963879
- Sigstore integration time:
-
Permalink:
ChadRoesler/SerenSinew@5549343f4b4075b76e94ad43208078f283db90ef -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ChadRoesler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5549343f4b4075b76e94ad43208078f283db90ef -
Trigger Event:
push
-
Statement type: