Create a typed, path-free JSON observation record without calling it a certificate.
Goal
Create a typed, path-free JSON observation record without calling it a certificate.
Applicability
Use this example as a host-architecture reference for the named framework. Resolve and pin dependencies through the validation solution or the consuming repository policy.
Required packages
- No runtime package is required for the standalone evidence-record type.
Host responsibilities
- Acquire and approve the model outside request or generation paths.
- Prepare the model-specific prompt and enforce limits.
- Own cancellation, UI dispatch, error presentation, persistence, and evidence retention.
Complete code
using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json;
namespace GgufRuntime.Examples.RuntimeEvidence;
/// <summary>Represents path-free host evidence for one local generation attempt.</summary>
public sealed class RuntimeEvidenceRecord
{
[Display(Name = "Schema Identifier")]
public String SchemaIdentifier { get; init; } = "https://ggufruntime.com/schemas/runtime-evidence-record/v1";
[Display(Name = "Generated UTC")]
public DateTimeOffset GeneratedUtc { get; init; } = DateTimeOffset.UtcNow;
[Display(Name = "Runtime Package Identity")]
public String RuntimePackageIdentity { get; init; } = "UAIX.LmRuntime.LocalEndpoint";
[Display(Name = "Resolved Package Version")]
public String ResolvedPackageVersion { get; init; } = String.Empty;
[Display(Name = "Model SHA-256")]
public String ModelSha256 { get; init; } = String.Empty;
[Display(Name = "Model Byte Count")]
public Int64 ModelByteCount { get; init; }
[Display(Name = "Selected Backend")]
public String SelectedBackend { get; init; } = String.Empty;
[Display(Name = "Generation Result")]
public String GenerationResult { get; init; } = String.Empty;
[Display(Name = "Known Limitations")]
public String KnownLimitations { get; init; } = String.Empty;
}
/// <summary>Serializes runtime evidence without adding execution authority.</summary>
public static class RuntimeEvidenceWriter
{
/// <summary>Serializes one evidence record as indented JSON.</summary>
/// <param name="record">The path-free evidence record.</param>
/// <returns>The JSON representation.</returns>
public static String Write(RuntimeEvidenceRecord record)
{
ArgumentNullException.ThrowIfNull(record);
return JsonSerializer.Serialize(record, new JsonSerializerOptions { WriteIndented = true });
}
}Expected behavior
The host either produces the narrow result described by the example or surfaces a specific identity, validation, load, generation, cancellation, or disposal failure. No hidden fallback is introduced.
Failure cases
- Invalid or untrusted input identity.
- GGUF structure, architecture, tokenizer, storage, kernel, or memory incompatibility.
- Cancellation or host shutdown.
- Framework dispatch or lifecycle misuse.
Security and trust notes
Do not accept remote model uploads, arbitrary paths, arbitrary URLs, provider keys, commands, or private-network targets. The loopback example binds to 127.0.0.1 and still requires a new threat model before broader exposure.
Disposal requirements
The host must finish or cancel generation, dispose the session, then dispose the model. Service and UI examples must connect this order to application shutdown.
Evidence produced
- Resolved package identity and version from the build.
- Model hash and byte count from intake.
- Session identifier, bounds, cancellation state, selected path, result, timing method, and limitations when the host records them.
Build-validation status
State: Experimental. Last compilation attempt UTC: 2026-06-25T00:00:00Z. The source was API-reviewed against current canonical public documentation; local compilation is blocked until a .NET SDK and package restore are available. CI is configured to produce the retained build result.
Open canonical package documentation.
Operational boundary
What this page covers: Create a typed, path-free JSON observation record without calling it a certificate.
Available now: The complete source and validation-project mapping are included in this release.
Host responsibility: Provide real inputs, run restore/build/tests, test the host lifecycle, and retain exact evidence.
Not claimed: A successful local build in this environment, finished downloadable application, universal compatibility, or production/safety certification.
Canonical sources: Canonical package guide · NuGet
Last reviewed UTC: