unified audit envelope + fire-and-forget publish helper for the 3tears platform
Project description
3tears-agent-audit
Unified audit envelope + fire-and-forget publish helper for the 3tears platform.
Purpose
Single AuditEvent envelope + single publish_audit helper used by every
domain (workspace, rbac, memory, custom tools) so the audit pipeline is
one subject tree, one consumer, one table, one admin query API. Replaces
domain-specific envelopes (WorkspaceAuditEnvelope,
RbacAuditEnvelope) that produced slightly-different wire shapes per domain
and made cross-domain audit queries require a UNION.
The package is pure Python with no NATS consumer code and no Postgres code. Publish is the only direction: a consumer-side audit consumer owns persistence to the audit events table.
Public API
from threetears.agent.audit import AuditEvent, publish_audit
AuditEvent-- pydanticBaseModelwithextra='forbid', timezone-awaretimestampvalidator, closedevent_typestring family (dotted verb, e.g.workspace.fs_write,rbac.assignment.create). All common identity fields are typed columns on the envelope; event-type-specific extras live indetails: dict[str, Any].publish_audit(event, nats_client, namespace)-- fire-and-forget async helper. Serializes the envelope viamodel_dump_json()and awaits onenats_client.publishon{namespace}.audit.{event_type}. On any publish failure logs at WARN and returns; never raises.
Design commitments
- Fire-and-forget. Audit publish failures must never break the producing call. The helper catches every exception, logs at WARN, and returns.
- Typed wire contract.
extra='forbid'+ timezone-aware validator catch publisher-side drift at construction time, not at the consumer's decode. - No domain-specific envelope types. Every domain publishes the same
model;
event_typeconveys the domain. - No dual-emit. There is no legacy envelope the consumer still accepts in parallel. Emission sites migrate in the same PR that deletes the legacy envelope module.
Subject naming
{namespace}.audit.{event_type} where event_type is the dotted event
name (e.g. {namespace}.audit.workspace.fs_write). The consumer
subscribes to {namespace}.audit.> so new event types route automatically
without consumer-side changes.
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 3tears_agent_audit-0.17.3.tar.gz.
File metadata
- Download URL: 3tears_agent_audit-0.17.3.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdf3e9e8526f6018da94bd2346c895bc33fd88047d3372886dc50d3b68e9a38b
|
|
| MD5 |
a05c8ed15b52ba9606bfcacdcc8e9d9b
|
|
| BLAKE2b-256 |
f4699a84092038d7c1a1bc5f5e0b839aac85b8503cd6b77258b4993016f90d2b
|
Provenance
The following attestation bundles were made for 3tears_agent_audit-0.17.3.tar.gz:
Publisher:
release.yml on pacepace/3tears
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3tears_agent_audit-0.17.3.tar.gz -
Subject digest:
bdf3e9e8526f6018da94bd2346c895bc33fd88047d3372886dc50d3b68e9a38b - Sigstore transparency entry: 2188061587
- Sigstore integration time:
-
Permalink:
pacepace/3tears@09c3295ed4ad659824378652eed1c2bb5a672a09 -
Branch / Tag:
refs/tags/v0.17.3 - Owner: https://github.com/pacepace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09c3295ed4ad659824378652eed1c2bb5a672a09 -
Trigger Event:
push
-
Statement type:
File details
Details for the file 3tears_agent_audit-0.17.3-py3-none-any.whl.
File metadata
- Download URL: 3tears_agent_audit-0.17.3-py3-none-any.whl
- Upload date:
- Size: 10.5 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 |
fe8edc86d13a5313a250d27bd7fe0626c8834cb7a037abcaa60a9da97217d56a
|
|
| MD5 |
85e26d6a44bc5a551a1bdc1a4e776e5e
|
|
| BLAKE2b-256 |
26de6011d2b474dce1e4bed1fd0057c56edaafffa6f91eb659a44f2ffe5ad10b
|
Provenance
The following attestation bundles were made for 3tears_agent_audit-0.17.3-py3-none-any.whl:
Publisher:
release.yml on pacepace/3tears
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3tears_agent_audit-0.17.3-py3-none-any.whl -
Subject digest:
fe8edc86d13a5313a250d27bd7fe0626c8834cb7a037abcaa60a9da97217d56a - Sigstore transparency entry: 2188061680
- Sigstore integration time:
-
Permalink:
pacepace/3tears@09c3295ed4ad659824378652eed1c2bb5a672a09 -
Branch / Tag:
refs/tags/v0.17.3 - Owner: https://github.com/pacepace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09c3295ed4ad659824378652eed1c2bb5a672a09 -
Trigger Event:
push
-
Statement type: