How rajfirke/provena works
Provena governs agent context inputs: wrapped retrieval/tool calls are recorded, provenance and freshness are checked, policies can warn or block, and records form a tamper-evident chain for later verification and reporting. The graph preserves multi-agent aggregation, retention, CLI/MCP access, framework adapters, and telemetry. Core call edges are supported by the trail excerpt or README; some major subsystems are indexed or documented but their internal wiring was not sampled, so uncertain links are omitted.
Main entry points: trail.py Context trail · main.py Command line · otel.py OpenTelemetry export · report.py Compliance reports
Components 18
Capture and validation
- Context trail
src/provena/trail.py - Context records
src/provena/models.py - Provenance checks
src/provena/validators/provenance.py - Freshness checks
src/provena/validators/freshness.py - Policy enforcement
src/provena/policy.py
Audit and persistence
- Hash chain
src/provena/hasher.py - SQLite and memory
src/provena/storage.py - PostgreSQL backend
src/provena/storage_pg.py - Async buffer
src/provena/buffer.py
Governance workflows
- Compliance reports
src/provena/report.py - Retention engine
src/provena/retention.py - Trail aggregation
src/provena/aggregator.py
Access and integrations
- Command line
src/provena/cli/main.py - MCP server
src/provena/mcp_server.py - Framework adapters
src/provena/integrations - OpenTelemetry export
src/provena/exporters/otel.py
Other components
- Agent or caller
- OpenTelemetry
Connections 18
- Agent or caller → Context trail: tracks input
README.md - Context trail → Context records: creates entries
src/provena/trail.py - Context trail → Provenance checks: validates provenance
src/provena/trail.py - Context trail → Freshness checks: checks freshness
src/provena/trail.py - Context trail → Policy enforcement: evaluates policies
src/provena/trail.py - Context trail → Hash chain: chains records
src/provena/trail.py - Context trail → SQLite and memory: persists records
src/provena/trail.py - Context trail → PostgreSQL backend: uses backend
src/provena/trail.py - Context trail → Async buffer: buffers writes
src/provena/trail.py - Context trail → OpenTelemetry export: emits events
src/provena/trail.py - Context trail → Compliance reports: exports reports
README.md - Command line → Context trail: queries and verifies
src/provena/cli/main.py - Command line → Retention engine: runs retention
src/provena/cli/main.py - Command line → Compliance reports: generates reports
src/provena/cli/main.py - Command line → MCP server: serves MCP
src/provena/cli/main.py - Agent or caller → Framework adapters: integrates framework
README.md - Trail aggregation → Context trail: aggregates trails
src/provena/aggregator.py - OpenTelemetry export → OpenTelemetry: starts spans
src/provena/exporters/otel.py