Skip to main content

Collect, contextualize, and structure raw system signals into governance-relevant evidence units

Project description

Evidence Collector SDK

CI DOI arXiv License: Apache-2.0 Python 3.11+ pre-commit enabled

Collect, contextualize, and structure raw system signals into governance-relevant evidence units. Transforms operational telemetry into Decision Event Schema events enriched with provenance, attribution, and temporal metadata.

Academic Context

This SDK is a primary artifact of:

Solozobov, O. (2026). Label-Free Detection of Governance Evidence Degradation in Risk Decision Systems. arXiv:2604.17836. https://arxiv.org/abs/2604.17836

The SDK provides the evidence-stream ingestion layer that feeds label-free governance monitoring (see governance-drift-toolkit). It operationalizes the evidence collection stage of the governance evidence chain introduced across the paper series.

Install

From a Package Index

Use this when the package is published to your package index:

pip install evidence-collector-sdk

From GitHub

Use this before package-index publication, or when installing directly from source control:

pip install git+https://github.com/governance-evidence/evidence-collector-sdk.git

Validation support is included in the base installation.

For Contributors

Clone the repository, create a local virtual environment, and install development dependencies:

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Quick start

from datetime import UTC, datetime

from collector import EvidenceCollector, RawSignal, SignalType, fraud_detection_config

collector = EvidenceCollector(config=fraud_detection_config())

collector.add(RawSignal(
    signal_id="txn-001",
    signal_type=SignalType.EVENT,
    payload={"score": 0.87, "amount": 1500.0, "merchant_category": "electronics"},
    source="fraud-scoring-model-v3",
    timestamp=datetime.now(tz=UTC),
))

events = collector.flush()  # list of Decision Event Schema dicts

Validation state for the last collector operation is available via collector.validation_errors.

Single signal

event = collector.collect_one(signal)  # transform + serialize + validation state update

Validation strategy

from collector import EvidenceCollector, ValidationMode

collector = EvidenceCollector(
    config=fraud_detection_config(),
    validation_mode=ValidationMode.PROVENANCE,
)

Streaming (Governance Drift Toolkit compatible)

from collector import EvidenceCollectorStream, OverflowStrategy

stream = EvidenceCollectorStream(
    fraud_detection_config(),
    max_buffer_size=10_000,
    overflow_strategy=OverflowStrategy.DROP_OLDEST,
)
stream.push(signal)
batch = stream.read_batch(batch_size=100)  # Decision Event Schema dicts for Governance Drift Toolkit

For a stable observability snapshot, use stream.stats.

stats = stream.stats
# StreamStats(queued_count=..., in_flight_count=..., buffer_size=..., ...)

Scalar properties remain available via queued_count, in_flight_count, buffer_size, processed_count, failed_batch_count, and dropped_count.

Stream writer lifecycle

from collector import JsonlStreamWriter

with JsonlStreamWriter(output_path) as writer:
    writer.write_batch(events)

Validation

from collector import validate_complete

errors = validate_complete(event, config=fraud_detection_config())

Capabilities (Governance Drift Toolkit negotiation)

caps = collector.capabilities
# StreamCapabilities(supported_signal_types=..., schema_version='0.3.0', ...)

Development

make install    # install with dev deps
make check      # lint + typecheck + test
make format     # auto-fix formatting

Related Projects

This SDK is part of the governance-evidence toolkit:

Repository Role DOI
decision-event-schema Schema that this SDK outputs events in 10.5281/zenodo.18923177
evidence-sufficiency-calc Scores the evidence events this SDK collects 10.5281/zenodo.19233930
governance-drift-toolkit Monitors drift using events from this SDK 10.5281/zenodo.19236417
governance-benchmark-dataset Cross-architecture benchmark that scores event streams from this SDK 10.5281/zenodo.19248722

All DOIs above are concept DOIs -- each resolves to the latest Zenodo release of that artifact.

Citation

If you use this SDK in your research, please cite both the paper and the software artifact.

Paper (primary):

@misc{solozobov2026labelfree,
  author = {Solozobov, Oleg},
  title  = {Label-Free Detection of Governance Evidence Degradation in Risk Decision Systems},
  year   = {2026},
  eprint = {2604.17836},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CY},
  doi    = {10.48550/arXiv.2604.17836},
  url    = {https://arxiv.org/abs/2604.17836}
}

Software (this repository):

@software{solozobov2026evidencecollectorsdk,
  author  = {Solozobov, Oleg},
  title   = {Evidence Collector SDK},
  version = {0.2.0},
  year    = {2026},
  url     = {https://github.com/governance-evidence/evidence-collector-sdk},
  doi     = {10.5281/zenodo.19245404}
}

The software doi above is the concept DOI (always resolves to the latest Zenodo release). The current v0.2.0 version DOI is 10.5281/zenodo.19478276.

See CITATION.cff for machine-readable citation metadata.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

evidence_collector_sdk-0.2.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

evidence_collector_sdk-0.2.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file evidence_collector_sdk-0.2.1.tar.gz.

File metadata

  • Download URL: evidence_collector_sdk-0.2.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evidence_collector_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1726faddf696aad1af66cb244823628b86e1b077867422b551ef751f743e2166
MD5 aabf3de02e242fcb764515a731c3a467
BLAKE2b-256 b24c7fbb1d4af9301a753a2a35ee95ec213f3863ee49466a537a1583de4889d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for evidence_collector_sdk-0.2.1.tar.gz:

Publisher: release.yml on governance-evidence/evidence-collector-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evidence_collector_sdk-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for evidence_collector_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e253b7686eb7e3916bcc32f56b738c031754efa8cb88a5971e0081ec6805482e
MD5 c38a310ccd646585bde8ea2556bb61a6
BLAKE2b-256 fe55000e9c62ea64ebf32e90afeb0c81baaa393dfa46f13456f8c240410086c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for evidence_collector_sdk-0.2.1-py3-none-any.whl:

Publisher: release.yml on governance-evidence/evidence-collector-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page