fix(deploymentmanager): bulk deploy skips Disabled + reconcile circuit-breaker + probe captures pre-flatten versions (arch-review 2026-08-19 P7-2 + P7-3 + P7-4)

This commit is contained in:
Joseph Doherty
2026-08-19 14:52:00 -04:00
parent b68f553f1e
commit 5cbc143b01
10 changed files with 541 additions and 32 deletions
@@ -86,6 +86,23 @@ public sealed class FlattenSession
/// </summary>
public IReadOnlyCollection<int> VisitedTemplateIds => _templates.Keys;
/// <summary>
/// Every visited template id paired with the watermark version this session
/// READ it at — the pre-flatten watermark the staleness fast path must memoise
/// against.
///
/// <para>
/// Re-reading the versions after the flatten instead is a correctness bug, not
/// an optimisation detail: an edit that lands mid-flatten pairs the PRE-edit
/// content (and therefore the pre-edit hash) with the POST-edit version, and
/// the memo then answers "not stale" until something else moves the watermark.
/// Recording the version each template was read at can only ever cause an extra
/// flatten, never a stale answer.
/// </para>
/// </summary>
public IReadOnlyDictionary<int, long> VisitedTemplateVersions =>
_templates.ToDictionary(entry => entry.Key, entry => entry.Value.Version);
/// <summary>
/// Returns the inheritance chain for <paramref name="templateId"/> (the
/// template itself, then each ancestor), loading it through