Load status for a workspace-county pair.
Lifecycle: provisioning (initial — set by workspace standup before the
Neon project is ready) → pending (set by provision_workspace_op
after schema apply succeeds; the pickup sensor's gate value) →
loading (set by sandbox_load when it starts writing for one
county) → succeeded | failed (terminal, set by the asset's
try/finally). provisioning and the mid-load loading were
previously the same value; MAIA-2309 split them so the lifecycle reads
literally instead of overloading loading across two phases.
canceled is the admin-initiated terminal state: an in-flight
(pending/loading) row canceled before the load finished. The Dagster
stamps are status-guarded so a canceled row is never resurrected by a
run that was already queued; retry via the reload seam re-queues it.
inherited sits outside that lifecycle: the county's data arrived with
the workspace's Neon branch and no load ever ran for this workspace. A
self-serve workspace is a copy-on-write fork of a prepared parent, so its
counties are queryable the moment the branch exists. The distinction from
succeeded is what a future refresh needs — re-forking from a refreshed
parent carries inherited counties for free and drops separately loaded
ones, and without the distinction a refresh either reloads everything or
silently loses the one-offs.
A producer writing this status should stamp data_loaded_at with the
fork time in the same statement. Access does not depend on it — the reload
seam backstops a missing value with now(), so an unstamped inherited row
keeps its access through a refresh — but the backstop records when someone
first refreshed the county rather than when its data actually arrived, and
that column is what a later refresh reads to tell inherited data from data
loaded afterwards.
commons_served sits outside the lifecycle for the opposite reason to
inherited: the workspace is entitled to the county and its branch holds
nothing. A thin workspace reads county data from the shared corpus, so
no load ever runs, none can be re-queued, and refreshing the county happens
in the corpus for every workspace at once rather than in this row.
Its producer writes neither timestamp, and each NULL is load-bearing for
an unrelated reason. data_loaded_at is the second disjunct of the
data-present rule, so stamping it would make branch-local consumers treat
the county as physically present. completed_at gates the all-terminal
index sweep, which selects a workspace whose counties are every one terminal
and whose latest completion is not null; a stamp there dispatches an index
build at a branch with no county tables in it.