perf(deployment): staleness/comparison paths no longer Roslyn-compile every script — deploy gate remains the authoritative compile

Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
Joseph Doherty
2026-07-09 15:48:45 -04:00
parent 730bf19162
commit 854a6a8c0b
9 changed files with 226 additions and 15 deletions
@@ -15,10 +15,19 @@ public interface IFlatteningPipeline
/// </summary>
/// <param name="instanceId">Id of the instance to flatten and validate.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <param name="validateScripts">
/// When <c>true</c> (the deploy default), the authoritative Roslyn script-compilation
/// gate runs. When <c>false</c>, that compile step is skipped — used by the read-only
/// staleness/comparison paths (Deployments comparison page,
/// <see cref="ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport.IStaleInstanceProbe"/>)
/// which need only the flattened config + revision hash, not a compile. Structural and
/// semantic validation still run in both cases.
/// </param>
/// <returns>A task that resolves to the flattened configuration, revision hash, and validation result; or a failure result if flattening could not complete.</returns>
Task<Result<FlatteningPipelineResult>> FlattenAndValidateAsync(
int instanceId,
CancellationToken cancellationToken = default);
CancellationToken cancellationToken = default,
bool validateScripts = true);
}
/// <summary>