Skip to content

SPEC-004

Status: Draft

Standard: CKS Runtime

Category: Runtime Diagnostics Specification


This specification defines the Runtime Diagnostics model.

Runtime Diagnostics describe operational events that occur during the execution of Runtime services.

This specification also defines how canonical diagnostics produced by CKS Core are transported, associated and exposed within Runtime.


This specification defines:

  • diagnostic categories;
  • diagnostic ownership;
  • diagnostic aggregation;
  • diagnostic lifetime;
  • diagnostic exposure;
  • Runtime responsibilities.

It does not redefine the canonical Diagnostic model defined by CKS Core.


Diagnostics communicate observations.

Diagnostics are observational artifacts rather than state transitions.

Diagnostics never modify Canonical Knowledge Structures.

Runtime may retain, aggregate and expose diagnostics without altering their meaning.

Diagnostics are immutable after creation.

Runtime may create references, associations or retention records, but shall not alter diagnostic meaning.


Runtime distinguishes two categories of diagnostics.


Core Diagnostics originate exclusively from CKS Core.

Examples include:

  • structural diagnostics;
  • semantic diagnostics;
  • constraint diagnostics;
  • validation diagnostics.

Runtime shall preserve these diagnostics without modification.

Runtime may associate Core Diagnostics with Runtime execution context without changing their canonical identity.


Runtime Diagnostics describe operational behavior.

Examples include:

  • session events;
  • transaction failures;
  • persistence failures;
  • storage events;
  • runtime lifecycle events.

Runtime Diagnostics shall never redefine canonical semantics.


Core Diagnostics are owned by CKS Core.

Runtime Diagnostics are owned by Runtime.

Ownership shall remain immutable throughout the diagnostic lifetime.

Ownership is independent from storage location.

Persisting a diagnostic does not transfer ownership.


Runtime aggregates diagnostics originating from multiple Runtime components.

Conceptually:

Runtime
Diagnostic Aggregator
┌─────────┴─────────┐
│ │
Core Diagnostics Runtime Diagnostics

In the reference implementation, aggregation is performed by the DiagnosticAggregator class. It collects both Diagnostic objects (Runtime‑owned) and diagnostics forwarded from CksCoreAdapter (Core‑owned), preserving their ownership and immutability.

Aggregation shall preserve diagnostic ownership.

Aggregation shall never modify diagnostic content.


Every Runtime Diagnostic belongs to exactly one Runtime Session.

Core Diagnostics become associated with the Session during Runtime execution.

Session association is a Runtime operational association and does not change Core Diagnostic ownership.

Diagnostics shall never simultaneously belong to multiple Sessions.


Runtime Diagnostic lifetime is controlled by Runtime retention policies.

Core Diagnostic lifetime is defined by CKS Core.

Runtime retention shall not affect Core Diagnostic semantics.

Removing diagnostics shall never modify the associated Canonical Knowledge Structure.


Runtime is responsible for:

  • collecting diagnostics;
  • preserving diagnostic ownership;
  • preserving diagnostic ordering where deterministic ordering exists;
  • exposing diagnostics through Runtime APIs;
  • associating diagnostics with Sessions.

Runtime shall not reinterpret canonical diagnostics produced by CKS Core.


Runtime API may expose diagnostics together with operation results.

Conceptually:

Runtime Operation Result
├── Operation Outcome
├── Core Diagnostics
└── Runtime Diagnostics

The reference implementation realises this model in the RuntimeValidationResult class, which combines the validation outcome, Core diagnostics, and Runtime diagnostics into a single immutable object returned by CksCoreAdapter.validate.

Diagnostic exposure shall preserve:

  • diagnostic ownership;
  • diagnostic identity;
  • diagnostic meaning;
  • deterministic ordering when applicable.

Runtime may transform external representation while preserving diagnostic semantics.


CKS Core produces canonical diagnostics.

Runtime receives those diagnostics.

Runtime may:

  • associate;
  • aggregate;
  • retain;
  • expose

diagnostics.

Runtime shall never modify:

  • diagnostic identity;
  • diagnostic severity;
  • diagnostic meaning.

Runtime components may emit Runtime Diagnostics.

Examples include:

  • Session Manager;
  • Transaction Engine;
  • Storage Layer;
  • Version Manager;
  • Explainability Coordinator.

All Runtime Diagnostics are collected through the Runtime diagnostic aggregation mechanism.

Validation-related diagnostics originate from CKS Core through Runtime validation coordination.


The canonical Runtime diagnostic flow is:

Runtime Operation
├──────────────┐
▼ ▼
CKS Core Runtime Components
│ │
▼ ▼
Core Diagnostics Runtime Diagnostics
└──────┬───────┘
Diagnostic Aggregator
Runtime API
Adapters

The reference implementation follows this flow in the ExecutionPipeline.commit method: Core validation is invoked via CksCoreAdapter, diagnostics are aggregated through runtime.diagnostics, and the final RuntimeValidationResult is propagated back to the caller.


The Runtime Diagnostics model follows these principles.


Runtime preserves canonical diagnostic semantics.


Runtime Diagnostics describe operational behavior only.


Runtime shall preserve deterministic diagnostic ordering whenever the originating components provide deterministic ordering.


Diagnostics remain independent of the transport through which they are exposed.


A Runtime implementation conforms to this specification when it:

  • preserves Core Diagnostics unchanged;
  • separates Runtime Diagnostics from Core Diagnostics;
  • aggregates diagnostics without semantic modification;
  • preserves diagnostic ownership across aggregation and persistence;
  • associates diagnostics with Runtime Sessions.

Conformance to this specification does not imply conformance to the complete Runtime Standard.


Runtime Diagnostics provide operational observability while preserving the canonical semantic diagnostics defined by CKS Core.

The Runtime Standard distinguishes diagnostic ownership, aggregates diagnostic information originating from Runtime components and CKS Core, and provides a unified operational view while preserving the ownership, identity and semantics of every diagnostic.