The MASTRA-OWNED tables purgeExpiredWorkflowRuns deletes from under the run
TTL — the production anchor the schema guard cross-checks every run-ttl
retention declaration against. The guard reads THIS, not a literal copied
into the test, so a purge that changes what it targets and a guard that still
blesses the old set cannot drift apart silently.
Mastra-owned specifically: the purge ALSO deletes from flowsafe's own
registries when a caller wires them, and those live in
RUN_TTL_FLOWSAFE_PURGE_TABLES below rather than here — see its note for why
the two sets are not one.
The MASTRA-OWNED tables
purgeExpiredWorkflowRunsdeletes from under the run TTL — the production anchor the schema guard cross-checks everyrun-ttlretention declaration against. The guard reads THIS, not a literal copied into the test, so a purge that changes what it targets and a guard that still blesses the old set cannot drift apart silently.Mastra-owned specifically: the purge ALSO deletes from flowsafe's own registries when a caller wires them, and those live in RUN_TTL_FLOWSAFE_PURGE_TABLES below rather than here — see its note for why the two sets are not one.