docs(di): trim cycle-internal codes and verbose block comments

Code comments were drifting into plan-internal shorthand (DI-2a,
Slice B, "see plan §9") that nobody outside the cycle authors can
decode. They also tended toward AI-generated paragraph blocks where a
two-line WHY would have done.

This commit tightens the comment surface from the v1.5.0 work:
- IPluginLogProxy header lists the consumer buckets without naming
  the cycle items that decided them.
- DalamudLogger / DalamudLoggingProvider provenance markers explain
  themselves in two lines each; the long EUPL-rationale paragraph
  moves to the commit message.
- PluginHostFactory block headers shrink to one line each, ASCII
  dividers come out, plan-internal codes go.
- Plugin.cs field doc and Phase-1 / DisposeAsync comments lose the
  cycle-name references; the file gains nothing from "C3 surfaced X"
  in code.
- FontManager / GameFunctions static-method notes shrink to one
  sentence each.
- InitHostedServices class header keeps the eager-resolve WHY in
  three lines, drops the constraint label.

Csharpier reformatted the .csproj layout (long PackageReference
multi-lined). No functional change, no behavior change.
This commit is contained in:
2026-05-17 11:35:44 +02:00
parent 624ad20404
commit fe84fd558e
10 changed files with 51 additions and 121 deletions
@@ -5,13 +5,11 @@ using Microsoft.Extensions.Hosting;
namespace HellionChat.Infrastructure.Hosting;
// Adapter shells around the IHostedService contract so the host can resolve
// the underlying singletons eagerly and trigger their existing init methods
// without modifying the service class bodies (DI-2a constraint). Bodies that
// stay empty here still serve a purpose: the host resolves the service when
// it instantiates the hosted service, which forces the ctor (IPC subscribe
// for IpcManager / TypingIpc / ExtraChat) to run during StartAsync instead of
// lazily on first GetRequiredService.
// Adapter shells around IHostedService so the host triggers each service's
// existing init method without touching the service class itself. Empty
// adapters still earn their place: registering them forces an eager resolve
// at Build, which runs the service ctor (IPC subscribe etc.) right then
// instead of lazily on first GetRequiredService.
internal sealed class FontManagerInitHostedService(FontManager fontManager) : IHostedService
{
@@ -39,11 +37,8 @@ internal sealed class ThemeRegistryInitHostedService(ThemeRegistry registry) : I
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
// IPC subscribers do their wiring in the ctor today, so StartAsync stays a
// no-op — the value of registering them as hosted services is that the host
// resolves them eagerly during Build, which triggers the ctor work. Moving
// the body into StartAsync is a DI-2b follow-up after the service ctors are
// allowed to change.
// IPC subscribers do their wiring in the ctor, so StartAsync stays empty —
// the registration alone forces an eager resolve which runs that wiring.
internal sealed class IpcManagerInitHostedService(IpcManager ipc) : IHostedService
{
@@ -33,11 +33,8 @@ internal sealed class DalamudLogger : ILogger
if (!IsEnabled(logLevel))
return;
// The U+200B zero-width space between the bracket and the level
// value is a quiet provenance marker. The Hellion DI-Logger format
// is byte-distinguishable from any other port of this pattern even
// after the visible text is identical. EUPL-1.2 reuse stays valid;
// attribution traces stay possible.
// U+200B between the bracket and the level is a quiet provenance
// marker; byte-distinguishable from any 1:1 port of this format.
if ((int)logLevel <= (int)LogLevel.Information)
{
_pluginLog.Information($"[{_name}]​{{{(int)logLevel}}} {state}");
@@ -10,9 +10,7 @@ namespace HellionChat.Infrastructure.Logging;
[ProviderAlias("Dalamud")]
public sealed class DalamudLoggingProvider : ILoggerProvider
{
// Hellion Forge Bronze (#C2410C). Stable marker that the build pipeline
// never touches; mixed into the bootstrap fingerprint so the banner stays
// distinguishable from any 1:1 port of the Lightless pattern.
// Hellion Forge Bronze (#C2410C). Mixed into the bootstrap fingerprint.
private const string HellionMarker = "HellionForgeBronzeC2410C";
private readonly ConcurrentDictionary<string, DalamudLogger> _loggers = new(
@@ -27,12 +25,8 @@ public sealed class DalamudLoggingProvider : ILoggerProvider
EmitBootstrapBanner();
}
// Runs once per plugin load (the provider is a container singleton). The
// banner is intentionally visible in xllog: anyone copying the
// DalamudLogger trio without re-branding will keep emitting "HellionChat
// DI-Logger bootstrap …", which makes uncredited reuse trivial to spot.
// EUPL-1.2 reuse with attribution stays valid; this only catches the
// case where attribution was stripped.
// One-shot per plugin load. Intentionally visible in xllog so uncredited
// ports of the DalamudLogger trio keep announcing their origin.
private void EmitBootstrapBanner()
{
var version =