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
@@ -30,8 +30,11 @@ public sealed class StaleInstanceProbe : IStaleInstanceProbe
// instance as "staleness indeterminate" and skips it. Flattening reuses
// the scoped ITemplateEngineRepository, so it observes template rows the
// in-flight import has staged on the shared change tracker.
// Staleness only needs the revision hash — skip the expensive Roslyn
// script-compilation stage (this probe is called per-instance across a whole
// bundle import in BundleImporter.ComputeStaleInstanceIdsAsync).
var result = await _flatteningPipeline
.FlattenAndValidateAsync(instanceId, cancellationToken)
.FlattenAndValidateAsync(instanceId, cancellationToken, validateScripts: false)
.ConfigureAwait(false);
return result.IsSuccess ? result.Value.RevisionHash : null;
}