feat(diagnostics): ITraceSink seam + TraceEvent + Null/Text sinks

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-07 15:19:40 -04:00
parent 6981bd0e41
commit 10cf79a41b
5 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
namespace Age.Engine.Diagnostics;
/// <summary>The engine's diagnostics seam. The VM emits typed <see cref="TraceEvent"/>s here; any
/// consumer (CLI, Godot, tests) supplies a sink instead of reimplementing IHost. Observe-only:
/// a sink never reads/writes VM state or influences control flow (that guarantees trace parity).</summary>
public interface ITraceSink
{
/// <summary>Cheap gate: when false the VM skips constructing per-instruction Step events, keeping
/// the hot path (a corpus sweep is ~1.46M instructions) free. Rare events emit regardless.</summary>
bool TracingSteps { get; }
void Emit(in TraceEvent e);
}