fix(core): tell value-type Auto settings without advice from an advised default

Auto<T>.Resolve returned default instead of the fallback for value types
because AutoValue cannot be null there. Auto<T> now records HasAdvice;
the render pipeline's ProjectValues workaround and the advisor's
ReasonKey heuristic are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 12:26:17 +00:00
1 parent 5774592c44
commit f78a76513c
9 files changed
+41 -61

No files matched your search

@@ -30,6 +30,23 @@ public sealed class ProjectSettingsTests
Assert.Contains("\"deflickerWindow\"", settings.ToJson());
}
[Test]
public void ValueTypesFallBackOnlyWithoutAdvice()
{
Assert.Equal(21, new Auto<int>().Resolve(21));
Assert.Equal(FlowQualitySetting.Balanced, new Auto<FlowQualitySetting>().Resolve(FlowQualitySetting.Balanced));
Assert.Equal(0, new Auto<int>().WithAdvice(0, null).Resolve(21));
Assert.False(new Auto<bool>().WithAdvice(false, null).Resolve(true));
Assert.Equal(0.5, new Auto<double>().WithAdvice(0.8, null).WithManual(0.5).Resolve(1.0));
Assert.False(new Auto<bool>().WithManual(false).Resolve(true));
var back = ProjectSettings.FromJson(new ProjectSettings
{
Exposure = new ExposureSettings { Deflicker = new Auto<bool>().WithAdvice(false, null) },
}.ToJson());
Assert.False(back.Exposure.Deflicker.Resolve(true));
Assert.True(ProjectSettings.FromJson(new ProjectSettings().ToJson()).Exposure.Deflicker.Resolve(true));
}
[Test]
public void ResetReturnsToAdvice()
{
@@ -1,20 +0,0 @@
using Titano.Core.Project;
using Titano.Core.Render;
using Titano.Testing;
namespace Titano.Core.Tests.Render;
public sealed class ProjectValuesTests
{
[Test]
public void ValueTypeSettingsFallBackWithoutAdvice()
{
Assert.Equal(21, ProjectValues.Get(new Auto<int>(), 21));
Assert.Equal(180.0, ProjectValues.Get(new Auto<double>(), 180.0));
Assert.Equal(FlowQualitySetting.Balanced, ProjectValues.Get(new Auto<FlowQualitySetting>(), FlowQualitySetting.Balanced));
Assert.Equal(41, ProjectValues.Get(new Auto<int>().WithAdvice(41, null), 21));
Assert.Equal(0.5, ProjectValues.Get(new Auto<double>().WithAdvice(0.8, null).WithManual(0.5), 1.0));
Assert.Equal(FlowQualitySetting.Draft, ProjectValues.Get(new Auto<FlowQualitySetting>().WithManual(FlowQualitySetting.Draft), FlowQualitySetting.Balanced));
Assert.False(ProjectValues.Get(new Auto<bool>().WithManual(false), true));
}
}