Back to the diagnostic
Synthetic example · not customer work

Sample diagnostic: duplicated Pine webhook action

This fictional incident shows how one Pine alert is reconciled across the alert event, HTTP receipts and the recorded downstream outcome. All identifiers, times and systems are invented.

Finding

One logical alert produced two actions because retry handling was not idempotent.

First divergence

The duplicate receipt passed the action-creation boundary.

Smallest next step

Deduplicate on a stable event ID before side effects occur.

1. Frozen event timeline

UTC timeObserved eventEvidence source
14:30:00.000Bar closes; Pine condition becomes trueTradingView
14:30:00.184Alert event emitted with event_id EVT-1042TradingView
14:30:00.492First HTTP 200 receipt recordedWebhook gateway
14:30:01.037Retry received with the same event_idWebhook gateway
14:30:01.091Second downstream action createdSynthetic executor

Reconciliation result

The alert source emitted one logical event. The gateway recorded two receipts with the same event ID, and both receipts crossed the side-effect boundary. The first proven divergence is therefore downstream of HTTP receipt and upstream of action creation—not in the Pine condition itself.

2. Acceptance matrix

ScenarioInputExpected behaviourClass
First valid eventNew event_id and valid payloadRecord one receipt and create one downstream actionPositive
Transport retrySame event_id received againReturn success without creating another actionBoundary
Changed eventNew event_id on a later closed barCreate exactly one new actionPositive
Missing identifierPayload has no stable event_idReject safely and preserve the raw receipt for reviewNegative

Run the matching test fixture

The public, dependency-free Node fixture implements the receiver boundary described here and includes seven deterministic tests for first receipt, retry, payload conflict, missing identifier, later event, concurrent retry and uncertain downstream failure.

Inspect code and tests on GitHub

3. Bounded recommendation

  • Define a stable event ID from the alert source or at the trusted ingress boundary.
  • Persist the ID before any order, notification or other side effect is created.
  • Return the same successful acknowledgement for a retry without repeating the action.
  • Rerun the four frozen cases and retain the receipt-to-outcome evidence.

Software-engineering example only. It is not trading advice and does not represent a client, account, execution venue or performance result.