> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enfors.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# The Decision Ledger

> The canonical record at the heart of Enfors — every model call as a structured decision.

The **decision ledger** is the single source of truth in Enfors. Every model call your
AI workforce makes is reconstructed into one **decision** and recorded as a row in the
ledger. Everything else — insights, Features, Pulse reports, the graph — is derived
from it.

## A hybrid record

Each ledger row combines two shapes of data:

<CardGroup cols={2}>
  <Card title="Extracted columns" icon="table-columns">
    Scalar, indexed fields for fast filtering and aggregation — agent, session, outcome,
    confidence, cost, duration, and more.
  </Card>

  <Card title="JSONB audit trail" icon="file-code">
    The full reconstructed detail — reasoning steps, findings, evidence, artifacts,
    and policy checks — stored as JSONB with GIN indexes.
  </Card>
</CardGroup>

This is why Enfors can both answer "show me every low-confidence decision over \$1 last
week" instantly *and* reconstruct exactly what happened inside any single decision.

## Key fields

| Field                                                                                                     | Description                                                                                      |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `ledger_id`                                                                                               | Unique decision ID (UUID).                                                                       |
| `agent_id` / `internal_agent_id`                                                                          | The agent that made the decision.                                                                |
| `session_id`                                                                                              | The session the decision belongs to.                                                             |
| `user_id` / `user_role`                                                                                   | The owning person and their role.                                                                |
| `outcome_class`                                                                                           | Controlled classification of the result. See [Outcomes & Intent](/concepts/outcomes-and-intent). |
| `outcome_summary`                                                                                         | Free-text "what the agent actually did."                                                         |
| `decision_title`                                                                                          | Short scannable headline (3–5 words).                                                            |
| `decision_intent`                                                                                         | Work-type classification (development, research, bug fix…).                                      |
| `confidence_score`                                                                                        | Model/decision confidence.                                                                       |
| `grounding_fidelity`, `logic_coherence`, `contradiction_ratio`, `hallucination_index`, `evidence_density` | Quality metrics.                                                                                 |
| `cost_usd`, `execution_ms`                                                                                | Operational telemetry.                                                                           |
| `human_review_required` / `human_review_status`                                                           | Human-in-the-loop state.                                                                         |
| `timestamp_utc`                                                                                           | When the decision was made.                                                                      |

Large or sensitive payloads are scrubbed of PII and offloaded to object storage rather
than kept inline. See [Tenancy, Privacy & PII](/concepts/tenancy-privacy-pii).

## The defensible record

Beyond the scalar columns, each decision's JSONB carries the structured justification that
makes it **defensible** — the answer when a decision is challenged:

| Field                                                                        | Description                                                                                                      |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `justification.supporting_steps` / `refuting_steps` / `counterfactual_steps` | The reasoning that argued for, against, and around the outcome.                                                  |
| `justification.supporting_findings` / `refuting_findings`                    | Findings that backed or contradicted the decision.                                                               |
| `justification.evidence_basis`                                               | The evidence the decision actually rested on.                                                                    |
| `confidence_derivation`                                                      | How confidence was reached — `aggregation`, `rule`, `model`, or `manual`, plus its inputs.                       |
| `uncertainty_summary`                                                        | Split into `epistemic` (what the agent didn't know) and `aleatoric` (irreducible noise).                         |
| `critical_path.step_id`                                                      | The single step the outcome hinged on.                                                                           |
| `critical_path.reversal_condition`                                           | The **minimal change that would have flipped the verdict** — the counterfactual that makes a decision auditable. |

<Tip>
  The `reversal_condition` is what lets a reviewer ask "what would it have taken to decide
  differently?" and get a concrete answer — not a re-run of the whole session.
</Tip>

## Semantic search

Each decision carries a vector embedding, enabling semantic similarity search — "find
decisions like this one" — across the ledger. This powers the
[`search_similar_decisions`](/mcp/tool-reference#search_similar_decisions) MCP tool.

## How it relates to everything else

* **Agents and sessions** are computed by aggregating ledger rows.
  See [Agents, Sessions & Decisions](/concepts/agents-sessions-decisions).
* **The graph** mirrors each decision's internal structure for traversal.
  See [Evidence & the Logic Trace](/concepts/evidence-and-logic-trace).
* **Insights, Features, and Pulse** are all derived from ledger activity over time.

<Note>
  The ledger uses the modern outcome vocabulary (`outcome_class` / `outcome_summary`).
  An older `final_verdict` field is retained for backward compatibility but is
  deprecated — prefer `outcome_class`.
</Note>
