Skip to content
Project referenceDevelopmentEngine ccf7d03f
Authored
  • 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.

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.

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.

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.

Browse exact diagnostic, producer and sink declarations.

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.

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.