refactor(engine): route console and MCP nesting through named job engines

Console --engine now names a jobs engine for --autonest (solved once
through NestingEngineRegistry.Create and committed onto the plate) or a
built-in fill strategy for single-plate fill through the public
PlateFillService; unknown names exit with the valid choices instead of
consulting the process-global legacy registry. MCP nesting tools take an
explicit engine argument per call with the session default, never read
process-global active-engine state, and reject whole-job engine names on
single-plate fill tools. NestingEngineRegistry gains an explicit Create
(name) resolution; PlateFillService gains a public ResolveStrategy and a
plate-number Nest overload used by interactive callers.
This commit is contained in:
aj
2026-09-22 00:30:03 -04:00
parent f36e124039
commit 88966d118c
8 changed files with 416 additions and 73 deletions
@@ -42,6 +42,27 @@ public class NestingEngineRegistryTests
Assert.Equal(before, NestingEngineRegistry.AvailableEngines.Count);
}
[Fact]
public void CreateResolvesKnownNamesCaseInsensitivelyAndRejectsUnknown()
{
Assert.NotNull(NestingEngineRegistry.Create("default"));
Assert.NotNull(NestingEngineRegistry.Create("Vertical Remnant"));
Assert.NotNull(NestingEngineRegistry.Create("stockladder"));
Assert.Throws<NotSupportedException>(() => NestingEngineRegistry.Create("Mystery Engine"));
Assert.Throws<ArgumentException>(() => NestingEngineRegistry.Create(" "));
Assert.Throws<ArgumentNullException>(() => NestingEngineRegistry.Create(null!));
}
[Fact]
public void CreateProducesAWorkingEngine()
{
var engine = NestingEngineRegistry.Create("Strip");
var result = engine.Solve(FiniteStockJobTests.Job(1));
Assert.Equal(NestJobStatus.Complete, result.Status);
}
[Fact]
public void LoadPluginsAgainstMissingDirectoryIsANoOp()
{