test(overrides): case-variant override names verified end to end through the flattener; UI single path gets the hint (ScadaBridge#105)

Re-verified #105 item 2 on the real write paths: ManagementActor bulk attribute
overrides (CLI set-overrides / management API) and InstanceService.SetAttributeOverrideAsync
(Central UI single editor) both match the template member ordinally and refuse a
case-variant name, so nothing is stored for the flattener to drop. Native-source
overrides already validate against the flattener's own output.

- New theory tests drive each path, feed whatever it stored into the real
  FlatteningService, and assert every stored override is applied (exact-case row is
  the positive control). Mutation: accepting case variants (OrdinalIgnoreCase) fails
  them with "stored ... but the flattener dropped it as unresolved".
- The did-you-mean hint moves to TemplateEngine.OverrideNameMatching and is now also
  on the UI single-attribute path; ambiguous matches get no hint.

Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
This commit is contained in:
Joseph Doherty
2026-11-13 02:13:10 -05:00
parent bba3c348bc
commit 3a59c3f638
5 changed files with 164 additions and 5 deletions
@@ -1170,10 +1170,7 @@ public class ManagementActor : ReceiveActor
/// an ambiguous match gets no hint.
/// </summary>
internal static string CaseMismatchHint(string name, IEnumerable<string> candidates)
{
var matches = candidates.Where(c => string.Equals(c, name, StringComparison.OrdinalIgnoreCase)).Distinct(StringComparer.Ordinal).Take(2).ToList();
return matches.Count == 1 ? $" (names are case-sensitive; did you mean '{matches[0]}'?)" : string.Empty;
}
=> OverrideNameMatching.CaseMismatchHint(name, candidates);
private static async Task<object?> HandleSetInstanceOverrides(IServiceProvider sp, SetInstanceOverridesCommand cmd, AuthenticatedUser user)
{