Directory these artifacts live in, so callers can address a run's files directly.
Per-entity outcome counts for a sync run, recovered from its event stream.
The run ROW records only TotalRecords, so history could never show created vs updated vs
skipped per table — the field existed on the API type and was never populated, which is what
thing.txt saw as an empty breakdown. The engine already emits every number needed on
sync.entity-map.complete; this reads them back.
Honest ceiling: artifacts are pruned by the retention cap and are node-local, so a run old enough to have been pruned yields nothing. The caller must render that as "not recorded" rather than as zeros.
Find all in-flight (non-terminated) runs — for restart-resumption discovery.
Read snapshot of a single run. Returns undefined if runID not found.
Find the latest checkpoint for a run (for resumption).
List runs, newest-STARTED first.
Ordering is by the manifest's startedAt, not by directory mtime. A stranded run stops being
written to, so its mtime freezes at the moment it stranded and mtime ordering sank it below
every later run — hiding, behind the limit, exactly the run an operator is looking for. A
start time never moves. (The same reasoning governs retention; see
IntegrationProgressEmitter.pruneOldRuns.)
offset exists because the caller authorization-filters AFTER this returns, so a short page
does not mean the source is exhausted — it may just mean the caller could not read some of
what came back. Without an offset there is no way to ask for the next slice, and both UI
surfaces faked paging by re-requesting with a doubled limit.
Filters and the limit are applied on the run HEADS — manifest.json plus the presence of
result.json — so only the runs actually being returned are hydrated.
Tail events since a given sequence.
StaticCompanyThe complete set of connections a run touched, normalised across the two manifest shapes.
Single-connection runs (every sync, every discovery) carry only companyIntegrationID;
runs that can span a batch (RSU) carry the full set in companyIntegrationIDs and set the
singular field only when the set has exactly one member. Callers that make a per-connection
decision — listing, and above all AUTHORIZATION — must read the set, not the singular field,
or a batch run silently looks connection-less.
Returns an empty array for a run with no connection identity at all.
StaticRunWhether the given connection is one of the connections a run touched.
Read API for the progress artifacts. Frontend / health-check / resumption code uses this to inspect ongoing or completed runs without touching the emitter.
Implementation is purely file-system reads; no shared state with the emitter (an emitter in another process can write while this reader tails).
Read cost is part of the contract. A run's journal reaches 12–13 k events with multi-KB payloads, and on App Service's SMB filesystem
IntegrationListRunswithlimit:1once took 73 seconds and then timed out (MJ-RUN-5/21) — because it hydrated EVERY run before applying the limit, and each hydration read the whole journal four times. So:manifest.json/result.json, and the limit is applied BEFORE anything opens a journal;result.json, and they are taken from there rather than re-derived;