Harborline Data Layer
Worked example · Harborline Logistics is invented · example data
Data platform only · not the full SK8 backend

The Shipment Desk team describes its tables. SK8 builds and runs the data under them.

Harborline's digital team is building Marcus's Shipment Desk in its own app tool. The app keeps its screens and logic. SK8 gives it live tables in Harborline's own Postgres, fed from Körber, MercuryGate, Salesforce and project44, with access rules on every read and write, columns the app owns, and changes written back to MercuryGate.

From a sourceApp-ownedWritten backVerified by source
Leah · app developer, Harborline digital
coding agent connected to SK8
MCP
tenant · harborline

Catalog

What Harborline already has in SK8, and what each system offers.

Search: po, appointment, eta, account

Existing datasets that match reuse, nothing synced twice

DatasetSourceUsed byOwnerFresh
korber_ordersKörber WMSDock SchedulerWarehouse systemsseconds
mg_loadsMercuryGate TMSDock SchedulerTransportation systems2 min
sf_accountsSalesforceClaims RecoverySalesforce adminseconds
sf_casesSalesforceClaims RecoverySalesforce adminseconds

Accounts

accountkorber-wmsConnected
accountmercurygate-tmsConnected
accountsalesforce-prodConnected
accountproject44New · connected todayapproved by Operations
streamtracking_events · 1,284 events in the last 24 h
objectshipments · eta
clusterops_pgHarborline's PostgreSQL · RDS · SK8 may create databases, tables and logins hereConnected
databaseshipment_desk · created by SK8 for this app

shipment-desk · data plan

Three ways to lay out the same app data. Chosen by Leah.

Option 3 chosen
1 · Read in place
korber_ordersmg_loadssf_accountsp44
  • Nothing new copied
  • 4 reads and a join per screen
  • No place for app-owned columns
  • Carrier-cost rule on three datasets
2 · One wide table
shipments(with every tracking event)
  • One read per screen
  • Event history lost or row churn on every ping
  • Customers' history screen needs it
3 · Shipments + events
shipments+tracking_events
  • One row per PO, latest ETA on it
  • Events kept 30 days, append only
  • Fed from existing datasets: no new load on Körber, MercuryGate or Salesforce
  • Home for app-owned and write-back columns

Decisions

Where
Cluster ops_pg · database shipment_desk · Harborline's own Postgres
Key
po_number (unique in Körber across all DCs)
Freshness
As fresh as each source: Körber and Salesforce seconds, MercuryGate 2 min, project44 live
Authority
MercuryGate owns the appointment. The app's request shows as pending until MercuryGate confirms.

Datasets

Every dataset in tenant harborline.

DatasetSubstrateReadinessSchemaAccessFeeds
shipmentspg-default · ops_pgActive20 fields3 rolesShipment Desk
tracking_eventspg-default · ops_pgActive7 fields3 rolesShipment Desk
korber_orderspg-default · wh_pgActive24 fields2 rolesDock Scheduler, shipments
mg_loadspg-default · wh_pgActive31 fields2 rolesDock Scheduler, shipments
sf_accountspg-default · cs_pgActive18 fields4 rolesClaims Recovery, shipments
sf_casespg-default · cs_pgActive22 fields2 rolesClaims Recovery

shipments

ops_pg › shipment_desk.public.shipments · key po_number · owner Leah K.

Active
FieldTypeOriginFrom / toLabels
po_numberSTRING · keysourcekorber_orders.po_num
account_idSTRINGsourcekorber_orders.customer_id
customer_nameSTRINGsourcesf_accounts.name, on account_id
origin · destinationSTRINGsourcekorber_orders.ship_from / ship_to
palletsINTEGERsourcekorber_orders.pallet_count
pick_statusSTRINGsourcekorber_orders.status
load_id · carrierSTRINGsourcemg_loads.load_id / carrier_name
carrier_costDECIMAL(10,2)sourcemg_loads.linehaul_costFINANCIAL
out_for_deliveryBOOLEANsourcemg_loads.stop_status
eta · last_carrier_update_atTIMESTAMPsourceproject44 tracking (latest)
appointment_start · _endTIMESTAMPwrite-back⇄ MercuryGate appointment
appointment_verifiedENUMverifiedMercuryGate: PENDING · CONFIRMED · REJECTED
at_risk · risk_reasonBOOLEAN · STRINGapp-ownedwritten by Shipment Desk
coordinator_notified_atTIMESTAMPapp-ownedwritten by Shipment Desk
contact_emailSTRINGsourcesf_accounts.coordinator_emailPII_EMAIL

Source fields refresh from their datasets. App-owned fields are kept when a source row changes or the dataset is reloaded. Write-back fields go to MercuryGate, and MercuryGate's answer lands in appointment_verified.

tracking_events append only · 30 days

event_id · keypo_numbertypeoccurred_atetacitycarrier

shipments

Live rows, read through the SK8 gateway as a role.

Active2,146 open shipments

Provisioned in ops_pg Done 14:26 · SK8 provisioner

✓CREATE DATABASE shipment_desk14:26:02
✓CREATE TABLE shipments (20 columns, key po_number)14:26:03
✓CREATE TABLE tracking_events (7 columns) · 30-day retention14:26:03
✓CREATE ROLE sk8_shipment_desk LOGIN · password kept by SK814:26:04
✓GRANT SELECT, INSERT, UPDATE ON both tables TO sk8_shipment_desk14:26:04

SK8 used the provisioning login Harborline's DBA set up once for ops_pg. Every statement is recorded.

Rows
2,146
open shipments
Events · 24 h
1,284
tracking_events
At risk
37
set by the app
Pending in MG
2
write-backs

As role customer-coordinator · Brightway Home Goods own account only · carrier_cost hidden

po_numbertocarrieretaappointmentverifiedat_risk
4471Sacramento #12Sierra FreightTue 16:40Wed 08:00–10:00Confirmed 11:59Yes · ETA past window
4476Fresno #3Sierra FreightTue 13:05Tue 13:00–15:00ConfirmedNo
4490Stockton DCCoastline HaulWed 09:20Thu 07:00–09:00PendingNo
4502Reno #4Coastline HaulWed 15:10Wed 14:00–16:00ConfirmedNo

Same read for the app's screens (POST /datasets/shipments/query) and for customers' AI assistants (query_dataset). The role decides rows and columns; the app adds no filter of its own.

Pipelines

What feeds shipments and tracking_events.

NameTemplateSyncExecutionHealth
shipments · builddatasets → pgCDC from 3 datasets⚡ ActiveHealthy
tracking · project44p44-stream → pgStream⚡ ActiveHealthy
appointments · write-backpg → mercurygateOn change⚡ ActiveHealthy

shipments · build

Source datasets
srckorber_orderschange feed
srcmg_loadschange feed
srcsf_accountschange feed
srcproject44latest eta per PO
Pipeline nodes
mapJoin on po_number, account_id14 fields mapped
Sink
sinkshipmentskeeps app-owned fields
resetauto-reset: strictreload if changes are lost

tracking · project44

srcproject44 eventsconnector built today
mapShipment ref → po_number7 fields
sinktracking_eventsappend · 30 days

Access

Checked by SK8 on every read and write, from the app, an agent or an AI assistant.

Grants on shipments and tracking_events

RoleRowsReadWrite
customer-coordinator
customers + their AI assistants
account_id = caller.account_idAll but carrier_costappointment_start · _end
service-agent
Harborline service team
All rowsAll fieldsappointment_start · _end
shipment-desk-app
the app's own background jobs
All rowsAll but contact_email masked to domainat_risk · risk_reason · coordinator_notified_at

Each field is written by one kind of role only: app-owned fields by the app, write-back fields by people, source fields by nobody.

Approvals for this app

WhatOwnerStatus
Read korber_ordersWarehouse systems leadApproved 14:05
Read mg_loads, write appointments to MercuryGateTransportation systems leadApproved 14:22
Read sf_accountsSalesforce adminApproved 14:09
Connect project44, read trackingOperationsApproved 13:40

Credentials

App
One SK8 API key per role. No database or MercuryGate password in the app.
Database
Login sk8_shipment_desk on ops_pg, created by SK8. Its password is generated and kept by SK8; nobody sees it.

Write-back · appointments

shipments.appointment_* → MercuryGate. MercuryGate decides; its answer comes back to the row.

Active
Writer
Brightway's AI assistantcustomer-coordinator
Dataset
wbshipments.appointmentverified = PENDING
Sink
sinkMercuryGateupdate appointment
Answer
verCONFIRMEDor REJECTED + reason

Recent write-backs

TimePORequestedByMercuryGate
11:584471Wed 08:00–10:00Brightway's AI assistantConfirmed 11:59
11:204490Thu 07:00–09:00Service agentPending
10:474415Tue 15:00–17:00Customer user, NorthpeakRejected · load out for delivery

On a rejection SK8 puts MercuryGate's appointment back in the row, and the app shows the reason. The rule "not once it's out for delivery" lives in MercuryGate and in the app, not in SK8.

Lineage · PO 4471

Where each value on the row came from, and who wrote it.

Systems
project44ETA 16:40 · at 11:50
MercuryGatewindow ends 14:00
Salesforcecoordinator email
Datasets
tracking_eventsevent 88123
mg_loadsload L-20931
sf_accountsBrightway
shipments · 4471
srceta · appointment16:40 · 12:00–14:00
wbappointment (new)Wed 08:00 · confirmed
srccontact_emailops@brightway…
Written by the app
appat_risk = trueShipment Desk · 11:51

shipments.at_risk on PO 4471

Value
true · "ETA 2h40m past window"
Written by
shipment-desk-app at 11:51, using eta and appointment it read at 11:50
Logic
In the Shipment Desk app (its own code). SK8 records which fields it read and what it wrote.

Audit log

Every read and write on shipments and tracking_events, allowed or not.

Today
TimeCallerRoleCallResult
11:59MercuryGatewrite-backappointment 4471 confirmedApplied
11:58Brightway's AI assistantcustomer-coordinatorupdate 4471 appointment → Wed 08:00Allowed · sent to MG
11:52Shipment Deskshipment-desk-appupdate 4471 coordinator_notified_atAllowed
11:51Shipment Deskshipment-desk-appupdate 4471 at_risk = trueAllowed
11:41Customer user, Northpeak Foodscustomer-coordinatorquery po_number = 44710 rows · other account
11:33Customer user, Northpeak Foodscustomer-coordinatorupdate 4390 at_riskDenied · app-owned field
10:02Carrier Scorecard (in build)—read carrier_costWaiting for owner

Overview

Shipment Desk data, a week after launch.

Pipelines
3 / 3
healthy
Reads · 24 h
48,210
app 71% · assistants 29%
Write-backs
212
204 confirmed · 6 rejected
Denied
19
all other-account reads

Freshness

Into shipments fromBehind sourceChanges · 24 hHealth
korber_orders4 s3,912Healthy
mg_loads1 m 50 s1,377Healthy
sf_accounts6 s41Healthy
project44live1,284Healthy

Reset reloads shipments from its sources and keeps every app-owned field.