Public entry. De-dups the known create-time double-invocation: the connection's IsActive
false→true Save fires the entity-server hook (which runs this pipeline WITH LLM PK inference),
and the create resolver then calls it again. Both converge here, so we run the pipeline ONCE
per CompanyIntegration and hand both callers the same result — no double introspect/persist/
classify, no double live API calls, and the resolver still gets a real summary. A legitimate
re-refresh later (outside the window) runs fresh.
COALESCING vs. A CALLER-SUPPLIED RunID. A coalesced call never reaches runInternal, so
opts.RunID is not the ID of the run that served it. That is fine for a caller who awaits the
result (it gets the real RunID back), but NOT for a caller that already handed opts.RunID to
a client as "the run to tail" — for that client, the ID would resolve to a run directory that
never gets created, and IntegrationTailRunEvents would answer "Run not found" forever, which
is indistinguishable from "the run hasn't opened its stream yet". So whenever a caller supplied
a RunID and coalescing served a different run, we publish a terminal ALIAS run under the
requested ID pointing at the run that actually did the work. See honourRequestedRunID.
The unified pipeline that drives connector creation / refresh end-to-end:
Every stage emits structured events through IntegrationProgressEmitter so the stream is identical regardless of vendor. Stages also emit checkpoint events carrying enough resumableState that the orchestrator can pick up from a kill or container restart without re-running prior stages.
The pipeline does NOT generate MJ entities itself — that gate (D7) lives in the CodeGen metadata layer: rows without a PK are simply not promoted to
__mj.Entity. The pipeline emitsentity.skipped-no-pkevents for visibility.