feat(headless): establish portable Linux host boundary

Add the presentation-free acdream-headless executable, strict no-connect configuration validation, dependency and assembly guards, and a Windows/Ubuntu CI lane that builds and tests only the portable runtime closure.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Erik 2026-07-27 01:10:45 +02:00
parent 953c469cac
commit aada8a37c1
14 changed files with 613 additions and 8 deletions

View file

@ -1,5 +1,6 @@
using System.Text.Json;
using System.Xml.Linq;
using System.Runtime.CompilerServices;
namespace AcDream.Runtime.Tests;
@ -59,7 +60,11 @@ public sealed class RuntimeDependencyBoundaryTests
.Descendants("ProjectReference")
.Select(reference => reference.Attribute("Include")?.Value)
.Where(static include => !string.IsNullOrWhiteSpace(include))
.Select(include => Path.GetFullPath(Path.Combine(projectDirectory, include!)))
.Select(include => Path.GetFullPath(Path.Combine(
projectDirectory,
include!.Replace(
'\\',
Path.DirectorySeparatorChar))))
.Order(StringComparer.OrdinalIgnoreCase)
.ToArray();
var expectedReferences = new[]
@ -94,21 +99,38 @@ public sealed class RuntimeDependencyBoundaryTests
Assert.DoesNotContain(loadedAssemblies, IsForbidden);
}
private static string FindRepositoryRoot()
private static string FindRepositoryRoot(
[CallerFilePath] string sourcePath = "")
{
var directory = new DirectoryInfo(AppContext.BaseDirectory);
while (directory is not null)
string[] starts =
{
if (File.Exists(Path.Combine(directory.FullName, "AcDream.slnx")))
Path.GetDirectoryName(sourcePath) ?? string.Empty,
Directory.GetCurrentDirectory(),
AppContext.BaseDirectory,
};
foreach (string start in starts)
{
if (string.IsNullOrEmpty(start))
{
return directory.FullName;
continue;
}
directory = directory.Parent;
var directory = new DirectoryInfo(start);
while (directory is not null)
{
if (File.Exists(Path.Combine(
directory.FullName,
"AcDream.slnx")))
{
return directory.FullName;
}
directory = directory.Parent;
}
}
throw new DirectoryNotFoundException(
$"Could not find AcDream.slnx above {AppContext.BaseDirectory}.");
"Could not find AcDream.slnx above the source, working, or output directory.");
}
private static string LibraryName(string libraryIdentity)