Core Concept

Command Bridge

The Command Bridge is the cross-channel awareness layer of SlabTrack. While the Channels table answers "where is this card?" per-row, the Command Bridge surfaces the holistic view: every card, every channel, every conflict, every sync drift — at a glance.

What it shows

Visit /bridge in SlabTrack. The Bridge has these key panels:

Channel grid

A matrix of every card across every channel. Green cells = active. Yellow = drift detected. Red = conflict (e.g. a card marked sold on ToT but still active on Storefront). Click any cell to drill into the card's full channel history.

Drift indicator

Pulses when SlabTrack's card_channels view disagrees with what a satellite says is actually live. Clicking opens the Sync Center with that satellite pre-selected.

Conflict log

Recent cross-channel events that needed resolution: bulk-disengages fired, sale-locks acquired, reconciler corrections. Each entry is a click-through to the affected card.

Channel summary

Per-channel totals: how many cards active, total value, sales today. The panel is the operator's "is everything alive" pulse.

Sync Center

The Sync Center (/admin/sync-center) is where you act on drift. It has four buttons:

ActionWhat it does
Reconcile Now Asks every satellite for its current active-card list, clears any card_channels row in SlabTrack that the satellite no longer has. Use after a manual delist on ToT/Storefront/etc.
Forward Reconcile Reverse direction — engages cards in SlabTrack that the satellite has but SlabTrack doesn't know about. Catches the case where a satellite created a listing without going through the bridge.
Fix ThisOrThat Orphans Targeted: clears cards.sent_to='thisorthat' for cards no longer on ToT. The legacy field equivalent of Reconcile.
Pull from ToT Read-only audit. Shows you what ToT thinks vs what SlabTrack thinks — no changes applied. Use to diagnose before reconciling.

The reconciler — how it works

1. SlabTrack hits each satellite: GET /api/reconcile/active-card-ids
2. Satellite responds with: { cards: [12, 47, 89, ...] } — slabtrack_ids of currently-listed cards
3. SlabTrack queries its own card_channels for that satellite's slug:
     SELECT card_id WHERE channel_slug = $1 AND status = 'active'
4. Diff:
     - In SlabTrack but not in satellite → status = 'inactive' (drift cleared)
     - In satellite but not in SlabTrack → forward-reconcile creates the row
5. Log every change to sync_reconciliation_log + emit SSE event
   so /admin/sync-center/stream subscribers see live updates
💡 Cron + manual

The reconciler runs automatically on a 15-minute cron. Manual "Reconcile Now" is for when you've just made a change on the satellite side and don't want to wait. Both paths hit the same code.

Conflict detection

The bridge flags these specific conflicts:

Cross-cutting with sale-locks

When a sale fires on any channel, the satellite calls the Bridge's bulk-disengage webhook:

POST https://www.slabtrack.io/api/webhooks/ecosystem-transfer/bulk-disengage
{
  cardIds: [12, 47],
  excludeChannel: 'thisorthat',  // the channel that just sold them
  reason: 'sale'
}

The Bridge then disengages those cards from every OTHER channel and fires per-channel disengage webhooks so each satellite pulls its listing. See Sale Locks for the synchronous version that prevents double-sale during checkout.

Code references