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
@@ -648,8 +648,12 @@ public class DeploymentService
if (snapshot == null)
return Result<DeploymentComparisonResult>.Failure("No deployed snapshot found for this instance.");
// Compute current template-derived config
var currentResult = await _flatteningPipeline.FlattenAndValidateAsync(instanceId, cancellationToken);
// Compute current template-derived config. This read-only comparison only needs
// the revision hash (staleness) + the flattened config (structured diff) — NOT a
// script compile — so skip the expensive Roslyn ValidateScriptCompilation stage.
// The deploy gate remains the authoritative compile.
var currentResult = await _flatteningPipeline.FlattenAndValidateAsync(
instanceId, cancellationToken, validateScripts: false);
if (currentResult.IsFailure)
return Result<DeploymentComparisonResult>.Failure($"Cannot compute current config: {currentResult.Error}");