Skip to content

HarnessContextDiagnostics

NexusLabs.Foundry.MicrosoftAgentFramework

NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics

HarnessContextDiagnostics Class

Privacy-safe, structured evidence for one hybrid context compaction/assembly decision. Carries only categorical outcomes/stages, an explicit measurement unit, sizes, an attempt count, per-category size/entry-count contributions, and a final sequence-validity flag — never raw message text, artifact bodies, workspace paths, owner identities, tool arguments/results, exception text, or classifier output text. Every instance is produced by NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextDiagnostics.ForSuccess(NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextCompactionOutcome,NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextMeasurementUnit,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Collections.Generic.IReadOnlyList{NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextAssemblyStageCategory},System.Collections.Generic.IReadOnlyList{NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextCategoryContribution}) or NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextDiagnostics.ForTermination(NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextCompactionOutcome,NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextMeasurementUnit,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Collections.Generic.IReadOnlyList{NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextAssemblyStageCategory}), mirroring exactly the success/termination split of the internal assembly result this snapshot describes.

public sealed record HarnessContextDiagnostics : System.IEquatable<NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextDiagnostics>

Inheritance System.Object 🡒 HarnessContextDiagnostics

Implements System.IEquatable<HarnessContextDiagnostics>

Remarks

The same instance attached to the internal HarnessBoundedMessageAssembly dispatch result — the private structure that carries the final bounded messages returned for dispatch — is also the instance carried by the HarnessContextCompactionCompletedEvent and, on success, the subsequent HarnessContextComposedEvent for that same attempt, so inspecting any of those three surfaces observes identical data.

Properties

HarnessContextDiagnostics.AttemptCount Property

The number of bounded recompaction attempts consumed, including any restarts.

public int AttemptCount { get; }

Property Value

System.Int32

HarnessContextDiagnostics.CategoryContributions Property

The per-category size/entry-count contributions to FinalSize, one entry per category actually present in the final entries. Always empty on a termination, because no final entries exist to attribute. The sum of every contribution's size always equals FinalSize on success.

public System.Collections.Generic.IReadOnlyList<NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextCategoryContribution> CategoryContributions { get; }

Property Value

System.Collections.Generic.IReadOnlyList<HarnessContextCategoryContribution>

HarnessContextDiagnostics.FinalSequenceValid Property

true when the final entries were verified as sequence-valid (always the case for a success instance, because a rejected verification is itself a termination); null on a termination, since verification against a final entry set was never reached.

public System.Nullable<bool> FinalSequenceValid { get; }

Property Value

System.Nullable<System.Boolean>

HarnessContextDiagnostics.FinalSize Property

The estimated size of the final entries on success, or of the terminating fallback candidate on a termination.

public int FinalSize { get; }

Property Value

System.Int32

HarnessContextDiagnostics.HardLimit Property

The hard limit in force for this assembly. FinalSize never exceeds this on success.

public int HardLimit { get; }

Property Value

System.Int32

HarnessContextDiagnostics.MeasurementUnit Property

The explicit unit every size, threshold, and limit on this instance is expressed in. Never assumed to be a provider token count unless it actually is one.

public NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextMeasurementUnit MeasurementUnit { get; }

Property Value

HarnessContextMeasurementUnit

HarnessContextDiagnostics.OriginalSize Property

The estimated size of the entries captured at the start of this assembly.

public int OriginalSize { get; }

Property Value

System.Int32

HarnessContextDiagnostics.Outcome Property

The explicit categorical outcome of this decision. The two termination members (Irreducible and ConcurrentMutationLimit) double as this decision's termination category.

public NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextCompactionOutcome Outcome { get; }

Property Value

HarnessContextCompactionOutcome

HarnessContextDiagnostics.Stages Property

The reduction path, in execution order.

public System.Collections.Generic.IReadOnlyList<NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextAssemblyStageCategory> Stages { get; }

Property Value

System.Collections.Generic.IReadOnlyList<HarnessContextAssemblyStageCategory>

HarnessContextDiagnostics.TriggerThreshold Property

The trigger threshold (hard limit minus trigger margin) in force for this assembly.

public int TriggerThreshold { get; }

Property Value

System.Int32