# Threadline v0.4.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)

- Reference
  - [Performance](performance.md)
  - [Threadline domain reference](domain-reference.md)
  - [Operator Surface](operator-surface.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)
  - [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.TriggerSQL](Threadline.Capture.TriggerSQL.md): Generates PL/pgSQL trigger DDL for Threadline audit capture.
- [Threadline.ChangeDiff](Threadline.ChangeDiff.md): Pure projection of a single captured row change into deterministic, JSON-friendly maps.
- [Threadline.Investigation](Threadline.Investigation.md): Higher-level investigation helpers layered on top of Threadline query primitives.
- [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.Live.ActorLive](Threadline.OperatorSurface.Live.ActorLive.md)
- [Threadline.OperatorSurface.Live.TransactionLive](Threadline.OperatorSurface.Live.TransactionLive.md)
- [Threadline.OperatorSurface.Style](Threadline.OperatorSurface.Style.md): Provides isolated CSS for the Threadline Operator Surface.

- [Threadline.Query](Threadline.Query.md): Ecto query implementations for the Threadline public API.
- [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.Semantics.Migration](Threadline.Semantics.Migration.md): DDL helpers for the Threadline semantics schema (Phase 2).
- [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.Export](Threadline.Export.md): CSV and JSON export for audited row changes.
  - [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.

- 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
  - [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.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.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.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`.

