Scaffold the .sln and M0 project structure

Buildable skeleton matching docs/kernel-contract.md:

- src/Engine.Kernel — the frozen kernel. Interfaces and data types only
  (World, Component, GameObject, Transform, ISchedule, IServiceRegistry,
  IEventBus, ILogger, IPlugin/IPluginContext, plugin.json and project.json
  manifest models). No PluginHost/Scheduler/World implementation yet —
  that's M0's actual work, not scaffolding.
- src/Engine.Host — the CLI runtime entry point, placeholder for now.
- plugins/sandbox.echo — a minimal two-assembly plugin (Contracts in
  Default ALC, implementation in collectible ALC) that exists only to
  exercise the reload loop end to end once PluginHost exists.
- tests/Engine.Kernel.Tests, tests/Engine.ConformanceHarness — wired up
  with one Skip-marked placeholder test each, naming what M0 needs to
  make them real (including the 200-cycle ALC leak test from §4). The
  harness references the sandbox plugin with
  ReferenceOutputAssembly="false" so it loads it dynamically by path
  instead of linking its types into its own Default ALC.
- samples/EmptyProject — a starter project.json.
- Directory.Build.props centralizes shared settings across every
  project, including AllowUnsafeBlocks=false to enforce the §7 rule at
  the build level rather than by convention.

Solution builds clean and `dotnet test` runs both placeholders as
Skipped (not failing) — confirms the wiring, not the engine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1qPfzq8TDCUMFMV3UwV5N
This commit is contained in:
Emil
2026-09-02 00:26:08 +03:00
co-authored by Claude Sonnet 5
parent 7fe966e42f
commit 1459657408
29 changed files with 556 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
namespace Engine.Kernel.Scheduling;
/// <summary>
/// Frame stages and system ordering. See docs/kernel-contract.md §2.
/// </summary>
public interface ISchedule
{
ISystemBuilder Add(Stage stage, Delegate system);
/// <summary>Called from a plugin's Shutdown() — must remove everything
/// Configure() added, or the ALC it lives in will never unload. See §4.</summary>
void RemoveAllFrom(string pluginId);
}
@@ -0,0 +1,16 @@
using Engine.Kernel.World;
namespace Engine.Kernel.Scheduling;
/// <summary>
/// Fluent builder returned by <see cref="ISchedule.Add"/>. Declared
/// Reads/Writes are what lets the scheduler run systems with disjoint
/// access in parallel and, in debug builds, enforce that a system only
/// touches what it declared. See docs/kernel-contract.md §2 and §7.
/// </summary>
public interface ISystemBuilder
{
ISystemBuilder After(string systemId);
ISystemBuilder Reads<T>() where T : Component;
ISystemBuilder Writes<T>() where T : Component;
}
+12
View File
@@ -0,0 +1,12 @@
namespace Engine.Kernel.Scheduling;
/// <summary>
/// Open question (see the footer of docs/kernel-contract.md): whether the
/// set of stages is fixed or plugin-extensible. This is only enough to
/// make the §3 example compile — not a decision.
/// </summary>
public enum Stage
{
Update,
Render,
}