Skip to main content
A consequence link is the edge between a decision and the financial event that decision caused. Links carry four fields that make the attribution actionable: which pair they connect, how strong the attribution is, how the attribution was established, and what kind of financial impact it represents. Without links, a revenue event is just revenue. With a link pointing at a decision, that revenue is attributable to an agent with a provenance trail you can show to a skeptic — or an auditor. The ledger records both automatic links created by the attribution engine and manual links created by a human confirming a suggestion on the dashboard. The attribution_method field records which — so you always know whether a number came from a machine score or a human judgment.

Shape

{
  "id": "lnk_...",
  "org_id": "o_...",
  "decision_id": "d5e7a3b0-...",
  "financial_event_id": "fev_abc",
  "correlation_strength": 0.91,
  "attribution_method": "ml_inferred",
  "link_type": "revenue",
  "notes": "attribution engine: score=0.91",
  "created_at": "2026-04-16T12:40:00.000000Z",
  "deleted_at": null
}
# ``decision_id`` is a UUID string — use whichever variable your
# caller exposes (``receipt["decision_id"]`` from ``log_decision``
# in non-batched mode, or a stored id from a prior write).
pq.link_outcome(
    "d5e7a3b0-0000-0000-0000-000000000001",
    "fev_abc",
    correlation_strength=1.0,
    link_type="revenue",
    notes="direct cause — pricing API response produced this charge",
)
When you create a link via the SDK with a known decision_id and financial_event_id, set correlation_strength: 1.0 and let the attribution_method default to direct. Reserve lower correlation values for cases where you know the relationship is partial.

Attribution methods

MethodWho creates itHow the engine decides
manualHuman via the dashboardReviewed and confirmed by a person
directSDK, passing a known idExplicit caller-supplied link
temporalCorrelation workerTime proximity and metadata overlap
ml_inferredAttribution engine (auto)Composite score at or above auto-link threshold
ml_suggestedAttribution engine (review)Score in the suggested band — awaits confirmation
The engine’s scoring combines temporal decay, Jaccard metadata overlap, a Bayesian agent-pattern prior, and amount plausibility. Links with a score in the ml_suggested band appear in the dashboard review queue rather than being applied automatically. When the attribution engine surfaces a suggested link, you confirm or reject it from the Links tab in the dashboard. Confirming promotes the attribution_method to manual and makes the link active. Rejecting soft-deletes the link — it is excluded from P&L queries but remains in forensic exports so an external reviewer can see the prior suggestion was retracted.
Soft-deleted links are never hard-deleted. The audit trail is always intact, even after a rejection.

revenue

The decision drove positive revenue — a successful upsell, a completed checkout.

cost

The decision drove a cost you would not otherwise have incurred — extra API calls, ops labour.

liability

The decision created legal or compliance exposure — an erroneous claim denial, a regulated miscommunication.

neutral

Attribution matters for the audit trail but the dollar sign is zero — for example, a canceled transaction.
The sign of a link’s contribution to the P&L comes from the linked event’s amount field, not from the link_type. The type is metadata for filtering and reporting, not an arithmetic override. A revenue link to a negative-amount event will subtract from the revenue total.
LIABILITY and NEUTRAL link types are excluded from the revenue and cost sums in the AI P&L — liability flows into the exposure column only, and neutral links are audit metadata with no P&L effect.