API Reference Threadline v#0.5.0

Copy Markdown View Source

Modules

Audit platform for Elixir teams using Phoenix, Ecto, and PostgreSQL.

Ecto schema for the audit_changes table.

Ecto schema for the audit_transactions table.

SQL DDL for the Threadline audit schema.

Validates trigger redaction options at codegen time (Mix / TriggerSQL).

Shared loader for config :threadline, :trigger_capture.

Generates PL/pgSQL trigger DDL for Threadline audit capture.

Pure projection of a single captured row change into deterministic, JSON-friendly maps.

Brownfield cutover helpers for honest T₀ semantics with Threadline capture.

CSV and JSON export for audited row changes.

Health checks for Threadline infrastructure.

Validates :expected_uncovered_tables and :audit_anyway configuration for Threadline.Health.trigger_coverage/1's third bucket.

Soft-dependency adapter for deriving Threadline audit context from Sigra state.

Higher-level investigation helpers layered on top of Threadline query primitives.

One transaction-focused incident bundle with linked context and packaged diffs.

One bundled incident change with raw linked structs and a packaged diff.

One investigation change row with linked transaction and optional action context.

One transaction-oriented investigation slice with optional action metadata.

Helpers for propagating audit context through background job args maps.

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.

Authentication contract for the Threadline operator surface.

Surface-wide header showing a coverage-drift badge that links to /audit/coverage.

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.

live_session on_mount/4 callback that drives polled trigger-coverage for every LV in the :threadline session.

Snapshot of Threadline.Health.trigger_coverage/1 results for the operator surface coverage dashboard and surface-header pill.

Conn-shaped authorize plug for the Threadline operator-surface export endpoints. Conn-shaped twin of Threadline.OperatorSurface.Auth.on_mount/4.

Canonical filename for operator-surface exports.

Parses a string-keyed URL params map into a keyword list ready for Threadline.Query.validate_timeline_filters!/1.

Provides the threadline_operator_surface/2 macro to mount the Threadline LiveView interface within a Phoenix router.

Host-owned query scoping helpers for operator-surface flows.

Provides isolated CSS for the Threadline Operator Surface.

Plug that extracts AuditContext from a Plug.Conn and stores it in conn.assigns[:audit_context].

Shared redaction drift presenter for Mix and LiveView parity.

Ecto query implementations for the Threadline public API.

One keyset page from the actor history query layer.

One keyset page from the timeline query layer.

Batched retention purge for audit_changes and empty audit_transactions.

Validates config :threadline, :retention before purge runs.

Value object representing the actor who performed an audited operation.

Ecto schema for the audit_actions table.

Execution context for an audited request or job.

DDL helpers for the Threadline semantics schema (Phase 2).

Telemetry integration helpers for Threadline.

Pure policy for comparing Threadline.Health.trigger_coverage/1 output with host-configured expected audited table names.

Mix Tasks

Shows trigger coverage as reported by Threadline.Health.trigger_coverage/1, with a three-section table (default) or JSON output (--json).

Shows configured versus deployed redaction policy drift for Threadline capture triggers, using the shared Threadline.Policy.RedactionPresenter.

Brownfield capture cutover helper — honest T0 semantics (see guides/brownfield-continuity.md).

Loads application config, starts the configured Ecto repo, and writes an export file using Threadline.Exportno ad-hoc Ecto.Query in this task (parity with mix threadline.retention.purge).

Generates an Ecto migration that installs Threadline audit triggers on the specified tables.

Loads application config, starts the configured Ecto repo, and fetches the incident bundle for a given transaction ID.

Generates an Ecto migration file for the Threadline audit schema.

Delegates to Threadline.Retention.purge/1 after loading application config and starting the configured Ecto repo (same resolution pattern as mix threadline.verify_coverage).

Verifies that tables listed in application config have Threadline audit triggers installed, using the same catalog queries as Threadline.Health.trigger_coverage/1.