Back to app

Strategy Commander

How AutoPilot strategies work: the lifecycle journey model, the block grammar, versioning, and how the Strategies and Fulfillment views fit together.

1 · The Lifecycle Model

A strategy is a journey definition that a ticket-lot travels from purchase to a terminal state. It is not a bag of cron jobs and not a single waterfall — it is one spine with two anchors and an explicit end:

[PHASE 2: DETECT]──▶ ⚓ ENTRY ANCHOR ──▶ AFTER PURCHASE ──▶ ONGOING ──▶ BEFORE EVENT ──▶ ⚑ TERMINAL cart signal (BQ) PO created (T+ offsets) (recurring) (T− offsets) Fulfilled ✓ TexMail confirm in Reach anchored on Canceled Reach PO create = journey start ⚓ EVENT DATE Surrendered/FVE (designed, not built) Refunded

Anchors

ANCHORSOURCEROLE
PO created in Reach (entry)PurchaseCreate webhook → PG mirror (~1s); reconciled via GET /purchases?updatedDateSince=The journey starts the moment tickets exist in Reach. Reach is truth. Which strategy claims the PO is resolved by the assignment model (§3).
Event date/time (end-side)Reach event record; venue-local time, timezone inferred carefullyAll T− offsets resolve against it. If the event date changes (postponement), pending timers re-resolve automatically.

Three timing regions

Between the two anchors, blocks live in one of three regions — this is the core organizing principle of every strategy:

Event-triggered branches hang off the spine and can fire at any point on the timeline: error categories raised, status changes, purchase-canceled signals, or criteria matches. Branch actions include the first-class Transition to strategy X (journey-to-journey handoff), retry flows, escalation, and jumps to terminals.

Terminal states — everything must end

Every journey instance ends in exactly one terminal state (Step-Functions-style Succeed/Fail). Nothing dangles — if a lot is neither fulfilled nor explicitly canceled/surrendered/refunded, the journey is still running and the system still owns it.

TERMINALMEANING
Fulfilled ✓The goal state. Delivery confirmed via API refresh — never a UI scrape.
CanceledPurchase or tickets canceled upstream; journey exits, no re-entry.
Surrendered / FVEThe destructive escalation tail. FVE buyback spends money; surrender burns TM bind count — both are approval-gated.
RefundedMoney returned; journey exits.
ONE INSTANCE, ONE STRATEGY VERSIONEach governed unit (sale/lot within an event) runs one journey instance, governed by exactly one strategy version at a time. A human lock is a journey-level pause: a human taking an item locks automation out, and vice-versa.

2 · Block Grammar

Everything you place on the timeline is one of five block families (anchors are the spine itself, not palette blocks).

Triggers

Conditions & the four property domains

Condition blocks select from four property domains — the segmentation vocabulary used at entry, on the spine, and inside branches:

DOMAINEXAMPLE PROPERTIES
Eventevent date/time, days-to-event, venue, venue override list (transfer_everything), performer, FIFA/MLB flags
Accountsite (TM 92 / FIFA 11990), credential health (bad_creds and login_403 are distinct — never bucket together), last successful sweep age, bind count, proxy class, phone-line validity
PurchasePO created date, vendor, order total, canceled flag, delivery method, tags (nofulfill…), P0–P3 priority band (48/168/336h thresholds)
Ticketbarcode present, stock type (ETicketUrl / GenericMobileTransfer / SMPWALLET / MobileQRCode), canceled flag, marketplace of sale, net-proceeds price band, link/transfer state

Actions

All existing lane actions plus three lifecycle-native ones:

Guards

Cross-cutting invariants that wrap actions:

Components (reusable macros)

Named, versioned bundles of blocks that drop into any region and expand inline (Zapier Sub-Zap semantics). Editing a component creates a new component version; consuming strategies pin a version and upgrade explicitly — the same immutability discipline as strategies. Seed library:

3 · Versioning & Assignment

AUTONOMY VS MODEPer-strategy autonomy (dry-run / approve-first / auto) is the execution authority. The app-level DRY-RUN / LIVE switch overrides everything: in DRY-RUN, every action is simulated and written to the run log, nothing mutates.

4 · Phase 2 — Buy-Side Detection

DESIGNED NOW, BUILT LATERThe greyed PHASE 2 DETECT segment at the top of every timeline is intentionally visible but not yet editable — so the start-to-finish vision is on screen today.

The journey visibly starts before the entry anchor, with three signal sources — all variations on detecting a purchase and ensuring it gets PO'd properly:

  1. Cart / interaction signals — BigQuery interactions table (cart monitoring). Earliest signal, noisiest.
  2. Purchase confirmation emails — TexMail realtime new-mail fanout (sub-second) matching order-confirmation patterns.
  3. PO created in Reach — the reconciliation target. If signals 1/2 fire but no PO appears within a grace window → escalate an "un-PO'd purchase."

The contract with Phase 1: Phase 2 terminates by producing or confirming the Reach PO — its terminal state is Phase 1's entry anchor. Nothing in the Phase 1 grammar changes when Phase 2 lands; the DETECT blocks simply become editable with the same trigger/condition/action grammar and new signal sources.

5 · The Fulfillment View

Fulfillment is the operational read-out of every running journey, grouped by event:

6 · Walkthrough

Reading the timeline

  1. Top to bottom = purchase to event. The two dark anchor pills (PO created / Event date) are fixed; everything else hangs between or off them.
  2. The greyed striped region at the very top is Phase 2 detection — visible, not yet active.
  3. Each colored region holds blocks with an offset chip (T+2d, every 24h, T−72h) showing when it fires relative to its anchor.
  4. The dashed red rail below the event anchor lists event-triggered branches — they can fire at any point, not just at the bottom.
  5. The four cards at the bottom are the terminal states. Every path through the strategy must be able to reach one.

Editing a strategy

  1. Pick a strategy in the left sidebar. Its published version and assignment footprint show in the strip above the canvas.
  2. Click a region header to target it ("✚ ADDING HERE"), then add blocks or components from the palette — they land with the region's default offset.
  3. Click any block to open it in the Inspector (right panel) — edit its offset and knobs. Component members expand inline; click a member to edit just that placement.
  4. Your first edit creates a draft — the DRAFT chip appears with a change count, and edited blocks get ADDED/MODIFIED badges.
  5. Use SIMULATE 7D to replay the last 7 days against the draft before committing.

Publishing

  1. PUBLISH freezes the draft as immutable vN+1. Events using this strategy pick it up for new journeys; running journeys finish on the version they started with.
  2. DISCARD DRAFT throws the edits away and returns to the published version.
  3. APPLY STRATEGY TO EVENTS… sets this strategy as the event-level default on selected events, with a preview of affected sales. In DRY-RUN, assignment is simulated.