# Threadline v0.9.0 - Table of Contents Audit platform for Elixir teams using Phoenix, Ecto, and PostgreSQL ## Pages - Overview - [Threadline](readme.md) - Integrations - [Threadline ↔ Sigra integration](sigra.md) - [Threadline ↔ phx.gen.auth integration](phx-gen-auth.md) - Reference - [How Threadline works](how-threadline-works.md) - [Integration Contracts](integration-contracts.md) - [Performance](performance.md) - [Threadline domain reference](domain-reference.md) - [Operator Surface](operator-surface.md) - [Upgrade Path](upgrade-path.md) - [Brownfield continuity with Threadline capture](brownfield-continuity.md) - [Production checklist (Threadline)](production-checklist.md) - [Threadline Incident Playbook](incident-playbook.md) - [Getting started with Threadline in a Phoenix SaaS app](getting-started-saas.md) - [Adoption pilot backlog](adoption-pilot-backlog.md) - [Adoption evidence playbook](adoption-evidence-playbook.md) - [Evaluating Threadline](evaluating-threadline.md) - [Audit table indexing cookbook](audit-indexing.md) - Project - [Contributing to Threadline](contributing.md) - [Changelog](changelog.md) ## Modules - [Threadline.Capture.Migration](Threadline.Capture.Migration.md): SQL DDL for the Threadline audit schema. - [Threadline.Capture.RedactionPolicy](Threadline.Capture.RedactionPolicy.md): Validates trigger redaction options at codegen time (Mix / `TriggerSQL`). - [Threadline.Capture.TriggerCaptureConfig](Threadline.Capture.TriggerCaptureConfig.md): Shared loader for `config :threadline, :trigger_capture`. - [Threadline.Capture.TriggerSQL](Threadline.Capture.TriggerSQL.md): Generates PL/pgSQL trigger DDL for Threadline audit capture. - [Threadline.Export.CleanupTask](Threadline.Export.CleanupTask.md): A GenServer that periodically cleans up expired export jobs and abandons jobs that have been stuck in the "running" state for too long. - [Threadline.Export.Orchestrator](Threadline.Export.Orchestrator.md): Executes asynchronous export jobs safely by streaming directly to disk. - [Threadline.ExportQueue](Threadline.ExportQueue.md): Behaviour for enqueueing asynchronous export jobs. - [Threadline.ExportQueue.Oban](Threadline.ExportQueue.Oban.md): Oban-based implementation of `Threadline.ExportQueue`. - [Threadline.ExportQueue.TaskAdapter](Threadline.ExportQueue.TaskAdapter.md): A simple implementation of `Threadline.ExportQueue` using `Task.Supervisor`. - [Threadline.Governance.EvidenceRecord](Threadline.Governance.EvidenceRecord.md): Ecto schema for the `threadline_evidence_records` table. - [Threadline.Governance.ExportJob](Threadline.Governance.ExportJob.md): Ecto schema for the `threadline_export_jobs` table. - [Threadline.Governance.Migration](Threadline.Governance.Migration.md): SQL DDL for the Threadline governance schema . - [Threadline.Governance.RetentionRun](Threadline.Governance.RetentionRun.md): Ecto schema for the `threadline_retention_runs` table. - [Threadline.Governance.SavedView](Threadline.Governance.SavedView.md): Ecto schema for the `threadline_saved_views` table. - [Threadline.Health.Policy](Threadline.Health.Policy.md): Validates `:expected_uncovered_tables` and `:audit_anyway` configuration for `Threadline.Health.trigger_coverage/1`'s third bucket. - [Threadline.Investigation.IncidentBundle](Threadline.Investigation.IncidentBundle.md): One transaction-focused incident bundle with linked context and packaged diffs. - [Threadline.Investigation.IncidentChange](Threadline.Investigation.IncidentChange.md): One bundled incident change with raw linked structs and a packaged diff. - [Threadline.Investigation.LinkedChange](Threadline.Investigation.LinkedChange.md): One investigation change row with linked transaction and optional action context. - [Threadline.Investigation.LinkedTransaction](Threadline.Investigation.LinkedTransaction.md): One transaction-oriented investigation slice with optional action metadata. - [Threadline.OperatorSurface](Threadline.OperatorSurface.md): Namespace for the Threadline operator surface — the opt-in mountable LiveView surface that turns Threadline's investigation contracts into one-click answers for documented support questions. - [Threadline.OperatorSurface.Components.SurfaceHeader](Threadline.OperatorSurface.Components.SurfaceHeader.md): Surface-wide header showing a coverage-drift badge that links to `/audit/coverage`. - [Threadline.OperatorSurface.Controllers.ExportController](Threadline.OperatorSurface.Controllers.ExportController.md): HTTP-side parity controller for the operator-surface "Download CSV / JSON / NDJSON" affordances. Three actions (`csv/2`, `json/2`, `ndjson/2`); each dispatches through one private `dispatch/3` so the format-vs-transport branching is in one place. - [Threadline.OperatorSurface.Coverage.OnMount](Threadline.OperatorSurface.Coverage.OnMount.md): `live_session` `on_mount/4` callback that drives polled trigger-coverage for every LV in the `:threadline` session. - [Threadline.OperatorSurface.Coverage.Snapshot](Threadline.OperatorSurface.Coverage.Snapshot.md): Snapshot of `Threadline.Health.trigger_coverage/1` results for the operator surface coverage dashboard and surface-header pill. - [Threadline.OperatorSurface.ExportAuthPlug](Threadline.OperatorSurface.ExportAuthPlug.md): Conn-shaped authorize plug for the Threadline operator-surface export endpoints. Conn-shaped twin of `Threadline.OperatorSurface.Auth.on_mount/4`. - [Threadline.OperatorSurface.Exports.Filename](Threadline.OperatorSurface.Exports.Filename.md): Canonical filename for operator-surface exports. - [Threadline.OperatorSurface.Exports.FilterParams](Threadline.OperatorSurface.Exports.FilterParams.md): Parses a string-keyed URL params map into a keyword list ready for `Threadline.Query.validate_timeline_filters!/1`. - [Threadline.OperatorSurface.Live.ActorLive](Threadline.OperatorSurface.Live.ActorLive.md) - [Threadline.OperatorSurface.Live.TransactionLive](Threadline.OperatorSurface.Live.TransactionLive.md) - [Threadline.OperatorSurface.Scope](Threadline.OperatorSurface.Scope.md): Host-owned query scoping helpers for operator-surface flows. - [Threadline.OperatorSurface.Script](Threadline.OperatorSurface.Script.md): Embeds a tiny, dependency-free copy-to-clipboard helper for the operator surface. Rendered once per page alongside `Threadline.OperatorSurface.Style.css/1`. - [Threadline.OperatorSurface.SessionPlug](Threadline.OperatorSurface.SessionPlug.md): A Plug that executes a configured `actor_fn` on the connection and stores the serialized `ActorRef` in the session under the `"threadline_actor_ref"` key. - [Threadline.OperatorSurface.Style](Threadline.OperatorSurface.Style.md): Provides isolated CSS for the Threadline Operator Surface. - [Threadline.Policy.RedactionPresenter](Threadline.Policy.RedactionPresenter.md): Shared redaction drift presenter for Mix and LiveView parity. - [Threadline.Query.ActorHistoryPage](Threadline.Query.ActorHistoryPage.md): One keyset page from the actor history query layer. - [Threadline.Query.TimelinePage](Threadline.Query.TimelinePage.md): One keyset page from the timeline query layer. - [Threadline.Retention.Pruner](Threadline.Retention.Pruner.md): A GenServer that schedules and executes background retention pruning. - [Threadline.Semantics.Migration](Threadline.Semantics.Migration.md): DDL helpers for the Threadline semantics schema . - [Threadline.Storage](Threadline.Storage.md): Behaviour for storing and retrieving export files and other persistent artifacts. - [Threadline.Storage.Local](Threadline.Storage.Local.md): Local filesystem implementation of `Threadline.Storage`. - [Threadline.Storage.S3](Threadline.Storage.S3.md): S3 implementation of `Threadline.Storage`. - [Threadline.Verify.CoveragePolicy](Threadline.Verify.CoveragePolicy.md): Pure policy for comparing `Threadline.Health.trigger_coverage/1` output with host-configured expected audited table names. - Core API - [Threadline](Threadline.md): Audit platform for Elixir teams using Phoenix, Ecto, and PostgreSQL. - [Threadline.Audit](Threadline.Audit.md): Audited write-path helper — one call for transaction-local actor GUC, domain writes, optional semantic action linkage, and `audit_transaction_id` on success. - [Threadline.ChangeDiff](Threadline.ChangeDiff.md): Pure projection of a single captured row change into deterministic, JSON-friendly maps. - [Threadline.Export](Threadline.Export.md): CSV and JSON export for audited row changes. - [Threadline.Investigation](Threadline.Investigation.md): Higher-level investigation helpers layered on top of Threadline query primitives. - [Threadline.Query](Threadline.Query.md): Ecto query implementations for the Threadline public API. - [Threadline.Retention](Threadline.Retention.md): Batched retention purge for `audit_changes` and empty `audit_transactions`. - [Threadline.Retention.Policy](Threadline.Retention.Policy.md): Validates **`config :threadline, :retention`** before purge runs. - [Threadline.Semantics.ActorRef](Threadline.Semantics.ActorRef.md): Value object representing the actor who performed an audited operation. - [Threadline.Semantics.AuditContext](Threadline.Semantics.AuditContext.md): Execution context for an audited request or job. - Evidence - [Threadline.Evidence](Threadline.Evidence.md): Public create/read boundary for Threadline-owned evidence records. - [Threadline.Evidence.Proof](Threadline.Evidence.Proof.md): Reusable proof projection for Threadline evidence viewer surfaces. - [Threadline.Evidence.Subject](Threadline.Evidence.Subject.md): Closed subject inventory for Threadline-owned evidence records. - Integration - [Threadline.Continuity](Threadline.Continuity.md): Brownfield cutover helpers for honest **T₀** semantics with Threadline capture. - [Threadline.Health](Threadline.Health.md): Health checks for Threadline infrastructure. - [Threadline.Job](Threadline.Job.md): Helpers for propagating audit context through background job `args` maps. - [Threadline.Plug](Threadline.Plug.md): Plug that extracts `AuditContext` from a `Plug.Conn` and stores it in `conn.assigns[:audit_context]`. - [Threadline.Telemetry](Threadline.Telemetry.md): Telemetry integration helpers for Threadline. - Integrations - [Threadline.Integrations.Sigra](Threadline.Integrations.Sigra.md): Soft-dependency adapter for deriving Threadline audit context from Sigra state. - Operator Surface (Optional In-Tree) - [Threadline.OperatorSurface.Auth](Threadline.OperatorSurface.Auth.md): Authentication contract for the Threadline operator surface. - [Threadline.OperatorSurface.Router](Threadline.OperatorSurface.Router.md): Provides the `threadline_operator_surface/2` macro to mount the Threadline LiveView interface within a Phoenix router. - Schemas - [Threadline.Capture.AuditChange](Threadline.Capture.AuditChange.md): Ecto schema for the `audit_changes` table. - [Threadline.Capture.AuditTransaction](Threadline.Capture.AuditTransaction.md): Ecto schema for the `audit_transactions` table. - [Threadline.Semantics.AuditAction](Threadline.Semantics.AuditAction.md): Ecto schema for the `audit_actions` table. ## Mix Tasks - Mix Tasks - [mix threadline.continuity](Mix.Tasks.Threadline.Continuity.md): Brownfield capture cutover helper — honest T0 semantics (see `guides/brownfield-continuity.md`). - [mix threadline.evidence.show](Mix.Tasks.Threadline.Evidence.Show.md): Shows Threadline-owned evidence proof output through one canonical viewer task. - [mix threadline.export](Mix.Tasks.Threadline.Export.md): Loads application config, starts the configured Ecto repo, and writes an export file using `Threadline.Export` — **no** ad-hoc `Ecto.Query` in this task (parity with `mix threadline.retention.purge`). - [mix threadline.gen.triggers](Mix.Tasks.Threadline.Gen.Triggers.md): Generates an Ecto migration that installs Threadline audit triggers on the specified tables. - [mix threadline.health.coverage](Mix.Tasks.Threadline.Health.Coverage.md): Shows trigger coverage as reported by `Threadline.Health.trigger_coverage/1`, with a three-section table (default) or JSON output (`--json`). - [mix threadline.incident](Mix.Tasks.Threadline.Incident.md): Loads application config, starts the configured Ecto repo, and fetches the incident bundle for a given transaction ID. - [mix threadline.install](Mix.Tasks.Threadline.Install.md): Generates an Ecto migration file for the Threadline audit schema. - [mix threadline.policy.show](Mix.Tasks.Threadline.Policy.Show.md): Shows configured versus deployed redaction policy drift for Threadline capture triggers, using the shared `Threadline.Policy.RedactionPresenter`. - [mix threadline.retention.purge](Mix.Tasks.Threadline.Retention.Purge.md): Delegates to `Threadline.Retention.purge/1` after loading application config and starting the configured Ecto repo (same resolution pattern as `mix threadline.verify_coverage`). - [mix threadline.verify_coverage](Mix.Tasks.Threadline.VerifyCoverage.md): Verifies that tables listed in application config have Threadline audit triggers installed, using the same catalog queries as `Threadline.Health.trigger_coverage/1`.