feat(scripts): Log global on the compile surface and both Test Run sandboxes; trust-gate pin (D4)

This commit is contained in:
Joseph Doherty
2026-09-09 12:21:23 -04:00
parent 964bb9b2d7
commit b2418b41e1
6 changed files with 169 additions and 0 deletions
@@ -67,6 +67,9 @@ public sealed class ScriptCompileSurface
/// <summary>Mirrors <c>ScriptGlobals.Alarms</c>.</summary>
public CompileAlarmsAccessor Alarms => throw new NotSupportedException(CompileOnly);
/// <summary>Mirrors <c>ScriptGlobals.Log</c>.</summary>
public CompileLog Log => throw new NotSupportedException(CompileOnly);
/// <summary>Compile-only mirror of <c>ScriptRuntimeContext</c> (the <c>Instance</c> global).</summary>
public sealed class CompileInstance
{
@@ -104,6 +107,38 @@ public sealed class ScriptCompileSurface
/// <summary>Mirrors <c>ScriptRuntimeContext.Alarms</c>.</summary>
public CompileAlarmsAccessor Alarms => throw new NotSupportedException(CompileOnly);
/// <summary>Mirrors <c>ScriptRuntimeContext.Log</c>.</summary>
public CompileLog Log => throw new NotSupportedException(CompileOnly);
}
/// <summary>
/// Compile-only mirror of <c>ScriptLogger</c> (step logs design 2026-09-09 D4) — the
/// <c>Log</c> global a script writes leveled lines through. The optional
/// <c>exception</c> parameter is mirrored so <c>Log.Warn("…", ex)</c> binds at design
/// time exactly as it does at the site.
/// </summary>
public sealed class CompileLog
{
/// <summary>Mirrors <c>ScriptLogger.Debug</c>.</summary>
/// <param name="message">The message text.</param>
/// <param name="exception">An optional exception to attach to the line.</param>
public void Debug(string message, Exception? exception = null) => throw new NotSupportedException(CompileOnly);
/// <summary>Mirrors <c>ScriptLogger.Info</c>.</summary>
/// <param name="message">The message text.</param>
/// <param name="exception">An optional exception to attach to the line.</param>
public void Info(string message, Exception? exception = null) => throw new NotSupportedException(CompileOnly);
/// <summary>Mirrors <c>ScriptLogger.Warn</c>.</summary>
/// <param name="message">The message text.</param>
/// <param name="exception">An optional exception to attach to the line.</param>
public void Warn(string message, Exception? exception = null) => throw new NotSupportedException(CompileOnly);
/// <summary>Mirrors <c>ScriptLogger.Error</c>.</summary>
/// <param name="message">The message text.</param>
/// <param name="exception">An optional exception to attach to the line.</param>
public void Error(string message, Exception? exception = null) => throw new NotSupportedException(CompileOnly);
}
/// <summary>