Inno.Core.Diagnostics
Section titled “Inno.Core.Diagnostics”
- Host-owned current issue state, revocable producers and complete-report presentation.
This project stores the current problems reported by compiler, importer, validator, runtime and Editor owners. It does not execute their operations or retain a log history. Start with reporting and resolving issues.
Producer and presentation contract
Section titled “Producer and presentation contract”DiagnosticHub owns reports and presentation registrations. DiagnosticReporter owns one revocable producer epoch. IDiagnosticReporter describes production; IDiagnosticSink describes consumption. These roles are deliberately separate.
Reporter issue identity combines code, semantic ID and persistent object ID. Publish suppresses unchanged updates; Replace rejects duplicate identities and replaces the complete set. Disposal releases only the reporter’s epoch. The hub’s direct public Set/Clear operations are lower-level whole-report operations; they do not provide the reporter’s per-issue de-duplication or producer-epoch ownership. Do not mix these publication paths for the same producer unless the host explicitly coordinates them.
Reports freeze the collection before publication and expose neutral immutable values. Source equality uses its stable ID. DiagnosticSource and DiagnosticReport are public contracts; there is no current DiagnosticManager type or hidden-manager-only source constructor.
Synchronization and failure
Section titled “Synchronization and failure”The hub synchronizes state and synchronously invokes presentation callbacks. Initial registration replays existing reports before installation; a replay failure throws and leaves the sink unregistered. Later failing sinks are quarantined. Callbacks are not marshalled onto a UI thread, and registration/unregistration does not transfer sink disposal ownership.
The current diagnostic failure path writes to Console.Error when no failure observer exists or an observer itself fails. Unlike Logging’s protected secondary reporting path, a throwing diagnostic stderr writer can propagate. This is an implementation limitation, not an unconditional guarantee that every secondary failure is isolated. A reliable host should register a nonthrowing failure observer and retain its own recovery policy.
Execution scopes are caller-owned and strictly last-in-first-out. Scope binding does not dispose a borrowed hub. Retire producer tokens and presentation callbacks before unloading the owning generation.
Model and surfaces
Section titled “Model and surfaces”Use diagnostics for persistent current conditions and Logging for append-only occurrences. DiagnosticLogSink, owned by Logging, projects changed issues into log entries without becoming another diagnostic state owner. Diagnostics does not use EventHub because it must retain state and replay it to late subscribers.
Diagnostic, severity, location and IDiagnosticReporter are actual Runtime script exports. Hub composition, direct publication, source identity, reporter implementation and the static caller-resolving facade remain host-side APIs.
Reference
Section titled “Reference”Browse exact diagnostic, producer and sink declarations.
Logical script references
Section titled “Logical script references”The compiler-selected script declarations are separate from this project’s host CLR surface. Read the script calling guide and the associated module contracts before using a projected member.
Source project facts
Section titled “Source project facts”Project: Inno.Core.Diagnostics
Source: src/foundation/core/Inno.Core.Diagnostics/Inno.Core.Diagnostics.csproj
| Type | API | Description |
|---|---|---|
| Diagnostic | engine | Represents one current issue reported by a compiler, importer, validator, or other diagnostic producer. |
| DiagnosticHub | engine | Owns one host’s complete diagnostic state and its presentation subscriptions. |
| DiagnosticLocation | engine | Identifies an optional source location associated with a diagnostic. |
| DiagnosticReport | engine | Represents the complete current diagnostic state published by one source. |
| DiagnosticReporter | engine | Owns one revocable diagnostic producer registration and releases its current report on retirement. |
| DiagnosticSeverity | engine | Defines the presentation severity of a diagnostic. |
| DiagnosticSource | engine | Identifies one independent producer whose diagnostics replace its previous publication. |
| Diagnostics | engine | Provides concise state-oriented diagnostic publication for the calling type. |
| IDiagnosticReporter | engine | Publishes current issues through an owner-bound producer, independently of presentation sinks. |
| IDiagnosticSink | engine | Receives complete diagnostic-state changes from a T:Inno.Core.Diagnostics.DiagnosticHub. |
| Diagnostic | Runtime | Represents one current issue reported by a compiler, importer, validator, or other diagnostic producer. |
| DiagnosticLocation | Runtime | Identifies an optional source location associated with a diagnostic. |
| DiagnosticSeverity | Runtime | Defines the presentation severity of a diagnostic. |
| IDiagnosticReporter | Runtime | Publishes current issues through an owner-bound producer, independently of presentation sinks. |