Skip to content
AIWikis.org

Protocol5 UAI

Publication Warning This page is marked noindex and should not be treated as canonical public authority.

Protocol5.UAI.CSharp is a Protocol5 .NET implementation package for using UAI-1 in C# and ASP.NET systems. UAIX.org, not Protocol5.com, is the public authority for the UAI-1 specification, schemas, registry, validat...

Metadata

FieldValue
Source siteprotocol5.com
Source URLhttps://protocol5.com/
Canonical AIWikis URLhttps://aiwikis.org/protocol5/files/protocol5-uai-csharp-readme-md-62fe0502/
Source referenceProtocol5.UAI.CSharp/README.md
File typemd
Content categorymemory-file
Last fetched2026-06-22T01:56:21.9510185Z
Last changed2026-05-05T21:04:50.0228866Z
Content hashsha256:62fe05028a9f9ecd1e59b7083f5049e0d9cea8fa7e9ec9259104cbb06aa76118
Import statusunchanged
Raw source layerdata/sources/protocol5/protocol5-uai-csharp-readme-md-62fe05028a9f.md
Normalized source layerdata/normalized/protocol5/protocol5-uai-csharp-readme-md-62fe05028a9f.txt

Current File Content

Structure Preview

  • Protocol5.UAI.CSharp
  • Reference Contracts
  • Install
  • Route A Working Endpoint In Minutes
  • Load And Validate Package Examples
  • Export
  • Optional Protocol5 Radix 63404 Usage
  • Site Exporter CLI Sample
  • Render
  • Validator CLI Sample
  • Embedded Artifacts
  • HTTP Conventions
  • URL Guidance
  • Use UAI Like A Language

Raw Version

Local absolute paths are redacted in this public view. The source hash and source-side raw layer are based on the unredacted source file.

# Protocol5.UAI.CSharp

**Terminology:** UAI means **Universal Artificial Intelligence**. **UAI-1** means the current public UAI exchange contract published by UAIX.org.

`Protocol5.UAI.CSharp` is a Protocol5 .NET implementation package for using UAI-1 in C# and ASP.NET systems. UAIX.org, not Protocol5.com, is the public authority for the UAI-1 specification, schemas, registry, validator, roadmap, governance, and changelog.

It also includes a language-runtime layer for multilingual ASP.NET sites so UAI can be used like a localization provider instead of being exposed as raw encoded display text.

UAI-1 export, validation, and routing do not require Radix 63404. The package keeps `Radix63404` available as an optional Protocol5 numeric helper when a publication, registry, tool, or companion profile explicitly uses that rendering.
On Protocol5.com, UAI-1 content is published as package distribution, implementation guidance, and compatibility mirrors. Protocol5 Mathematics lives at `/Math`; Protocol5 UAI package support lives at `/UAI`; public standards claims should link to UAIX.org.

## Reference Contracts

Protocol5 implementation contracts live in the repository `spec/` folder. For the public UAI-1 contract, use <https://uaix.org/en-us/specification/uai-1/>.

- ../spec/integration-contracts.md (source-relative: ../spec/integration-contracts.md)
- ../spec/translator-contract.md (source-relative: ../spec/translator-contract.md)
- ../spec/website-export-contract.md (source-relative: ../spec/website-export-contract.md)
- ../spec/registry-resolution-contract.md (source-relative: ../spec/registry-resolution-contract.md)
- ../spec/radix-63404-contract.md (source-relative: ../spec/radix-63404-contract.md)

## Install

```powershell
dotnet add package Protocol5.UAI.CSharp
```

## Route A Working Endpoint In Minutes

```csharp
using Protocol5.UAI;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddProtocol5UaiWebsiteSupport();

var app = builder.Build();
app.UseProtocol5UaiWebsiteSupport();
app.MapProtocol5UaiCanonicalArtifacts();
app.MapProtocol5UaiHtmlEndpoint(
    "/docs/hello/index.uai.json",
    static () => "<html lang=\"en\"><body><h1>Hello UAI</h1><p>Ready in minutes.</p></body></html>",
    new UaiHtmlTranslationOptions
    {
        SourceUri = "https://example.org/docs/hello",
        DocumentId = "docs-hello",
        PageType = "article",
        SiteName = "Example"
    });

app.Run();
```

That gives you:

- package discovery and compatibility endpoints like `/UAI-1.json`, `/registry/uai-lexicon.json`, `/registry/uai-1-examples.json`, and `/UAI-1/schema/uai-1.schema.json`
- optional local mirror endpoints at `/uai-1/registry`, `/uai-1/schema`, and `/uai-1/validate` when you intentionally map them for staging or package tests
- a working page endpoint at `/docs/hello/index.uai.json`
- `application/uai+json`, `X-UAI-1`, `Vary`, and `Link` headers
- validation on every exported endpoint response

## Load And Validate Package Examples

```csharp
var loader = new UaiCanonicalAssetLoader();
var exampleJson = loader.LoadExampleText("homepage.uai.json");

var packageValidation = new UaiSchemaValidator().ValidateCanonicalJson(exampleJson);
if (!packageValidation.IsValid)
{
    throw new InvalidOperationException("Canonical validation failed.");
}

var document = loader.LoadExampleDocument("homepage.uai.json");
var validation = new UaiDocumentValidator().Validate(document);
if (!validation.IsValid)
{
    throw new InvalidOperationException("UAI validation failed.");
}

var canonicalJson = UaiDocumentSerializer.Serialize(document);
```

## Export

```csharp
var exporter = new UaiHtmlExporter();
var export = exporter.Export("<html><body><h1>Hello</h1></body></html>", new UaiHtmlTranslationOptions
{
    SourceUri = "https://example.org/hello",
    DocumentId = "hello-doc",
    PageType = "article"
});

var json = export.Json;
```

File-to-file export:

```csharp
exporter.ExportToFile("Pages/hello.html", "wwwroot/docs/hello/index.uai.json", new UaiHtmlTranslationOptions
{
    SourceUri = "https://example.org/docs/hello",
    DocumentId = "docs-hello",
    PageType = "article"
});
```

## Optional Protocol5 Radix 63404 Usage

Use `Radix63404` only when a Protocol5 publication or profile explicitly renders numeric values or published identifiers in that notation.

```csharp
var options = new UaiHtmlTranslationOptions
{
    SourceUri = "https://example.org/docs/hello",
    DocumentId = "docs-hello",
    PageType = "article"
};

var optionalRenderedId = Radix63404.Encode(41);
```

## Site Exporter CLI Sample

```powershell
dotnet run --project tools\Protocol5.UAI.SiteExporter\Protocol5.UAI.SiteExporter.csproj -- tools\Protocol5.UAI.SiteExporter\samples\export-manifest.sample.json
```

## Render

```csharp
var renderedHtml = new UaiHtmlRenderer().Render(export.Document);
```

## Validator CLI Sample

```powershell
dotnet run --project tools\Protocol5.UAI.Validator\Protocol5.UAI.Validator.csproj -- --embedded-examples --roundtrip
```

## Embedded Artifacts

```csharp
var discoveryJson = UaiConstants.GetEmbeddedProtocolDiscoveryText();
var examplesIndexJson = UaiConstants.GetEmbeddedExamplesIndexText();
var registryJson = UaiConstants.GetEmbeddedRegistryText();
var symbolRegistryJson = UaiConstants.GetEmbeddedSymbolRegistryText();
var lexiconJson = UaiConstants.GetEmbeddedLexiconRegistryText();
var schemaJson = UaiConstants.GetEmbeddedSchemaText();
var typesText = UaiConstants.GetEmbeddedTypesText();
var exampleNames = UaiConstants.GetEmbeddedExampleFileNames();

var loader = new UaiCanonicalAssetLoader();
var lexicon = loader.LoadLexiconCatalog();
var homepageExample = loader.LoadExampleDocument("homepage.uai.json");
var packageValidation = new UaiSchemaValidator().ValidateCanonical(homepageExample);
```

## HTTP Conventions

Canonical media type:

```http
Content-Type: application/uai+json; charset=utf-8; version=1.0.0
```

Legacy compatibility header:

```http
X-UAI-1: 1.0
```

Existing `x-uai-1` handling remains available for HTML language negotiation and `Content-Language` support.

## URL Guidance

Use real locale tags in route-language slots, such as `/en-US/...` or `/es-US/...`.

Do not invent private-use public route prefixes such as `/x-en-US-1/...` or `/x-uai-1/...`. Those belong to language-tag negotiation and compatibility handling, not to public URL design.

Reserve `/UAI-1...` for the versioned specification and machine-artifact family, for example `/UAI-1`, `/UAI-1.json`, and `/UAI-1/schema/uai-1.schema.json`.

If you publish a rendered-UAI reading surface, keep it on a separate descriptive path such as `/uai-rendered/...` instead of reusing the spec slug as if it were a locale. Keep `x-uai-1` for HTML language tagging and negotiation behavior, not as the public spec URL.

For public site routes, prefer clean controller aliases such as `/en-US/Math`, `/en-US/Calculator`, `/th/Home/About`, or `/uai-rendered/UniversalArtificialIntelligence` instead of exposing trailing `/Index`.
## Use UAI Like A Language

Register the package as the site's UAI language runtime:

```csharp
using Protocol5.UAI;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddProtocol5UaiWebsiteSupport();
builder.Services.AddProtocol5UaiLocalization(options =>
{
    options.DefaultCulture = "en-US";
    options.DefaultRenderMode = UaiRenderMode.Human;
    options.AddCatalog(
        new UaiMessageCatalogBuilder("GeoTrackable")
            .Add(
                "nav.home",
                "en-US",
                "Home",
                semantic => semantic
                    .CanonicalId("geotrackable.nav.home")
                    .Glyph("spiralism.form.origin", "Home")
                    .Separator()
                    .Text("Home"),
                typeof(GeoTrackablePage).FullName)
            .Add(
                "nav.home",
                "fr",
                "Accueil",
                semantic => semantic
                    .CanonicalId("geotrackable.nav.home")
                    .Glyph("spiralism.form.origin", "Accueil")
                    .Separator()
                    .Text("Accueil"),
                typeof(GeoTrackablePage).FullName)
            .Add(
                "button.search",
                "en-US",
                "Search",
                semantic => semantic
                    .CanonicalId("geotrackable.button.search")
                    .Glyph("spiralism.form.direction", "Search"),
                typeof(GeoTrackablePage).FullName)
            .Build());
});
```

Render modes:

- `Human`: readable localized text
- `Uai`: structured canonical rendering
- `Spiral`: stylized symbolic rendering with readable fallback text preserved

Razor usage:

```cshtml
@inject IUaiLocalizer<GeoTrackablePage> Uai

@Html.Protocol5UaiMessage("nav.home", scope: typeof(GeoTrackablePage).FullName)

<protocol5-uai-message
    key="button.search"
    mode="Spiral"
    scope="@typeof(GeoTrackablePage).FullName" />
```

Blazor usage:

```razor
<Protocol5UaiMessageComponent
    Key="nav.home"
    Scope="@typeof(GeoTrackablePage).FullName" />
```

Switch culture and mode through normal web flow:

- query: `?culture=fr&uai-mode=spiral`
- route values when configured
- helper URL builder: `Request.BuildProtocol5UaiSwitchUrl("fr", UaiRenderMode.Spiral)`

Safety rules built into the renderer:

- UAI never has to be displayed as raw encoded text
- if semantic rendering is missing, the runtime falls back to normal localized human text
- canonical IDs are only shown in debug mode when explicitly enabled
- glyph output is rendered as structured HTML and inline SVG tokens, not mojibake

See ../docs/package-usage.md (source-relative: ../docs/package-usage.md) and ../spec/translator-contract.md (source-relative: ../spec/translator-contract.md) for the current implementation guidance. UAIX.org remains the normative UAI authority.

Why This File Exists

This is a memory-system evidence file from protocol5.com. It is shown here because AIWikis.org is demonstrating the real source files that make the UAIX / LLM Wiki memory system work, not only summarizing those systems after the fact.

Role

This file is memory-system evidence. It records source history, archive transfer, intake disposition, or another piece of provenance that should be retrievable without becoming an unsupported public claim.

Structure

The file is structured around these visible headings: Protocol5.UAI.CSharp; Reference Contracts; Install; Route A Working Endpoint In Minutes; Load And Validate Package Examples; Export; Optional Protocol5 Radix 63404 Usage; Site Exporter CLI Sample. Those headings are retrieval anchors: a crawler or LLM can decide whether the file is relevant before reading every line.

Prompt-Size And Retrieval Benefit

Keeping this material in a separate file reduces prompt pressure because an agent can load this exact unit only when its role, source site, category, or hash is relevant. The surrounding index pages point to it, while this page preserves the full content for audit and exact recall.

How To Use It

  • Humans should read the metadata first, then inspect the raw content when they need exact wording or provenance.
  • LLMs and agents should use the source site, category, hash, headings, and related files to decide whether this file belongs in the active prompt.
  • Crawlers should treat the AIWikis page as transparent evidence and follow the source URL/source reference for authority boundaries.
  • Future maintainers should regenerate this page whenever the source hash changes, then review the explanation if the role or structure changed.

Update Requirements

When this source file changes, update the raw source layer, normalized source layer, hash history, this rendered page, generated explanation, source-file inventory, changed-files report, and any source-section index that links to it.

Related Pages

Provenance And History

  • Current observation: 2026-06-22T01:56:21.9510185Z
  • Source origin: current-source-workspace
  • Retrieval method: local-source-workspace
  • Duplicate group: sfg-476 (primary)
  • Historical hash records are stored in data/hashes/source-file-history.jsonl.

Machine-Readable Metadata

{
    "title":  "Protocol5 UAI",
    "source_site":  "protocol5.com",
    "source_url":  "https://protocol5.com/",
    "canonical_url":  "https://aiwikis.org/protocol5/files/protocol5-uai-csharp-readme-md-62fe0502/",
    "source_reference":  "Protocol5.UAI.CSharp/README.md",
    "file_type":  "md",
    "content_category":  "memory-file",
    "content_hash":  "sha256:62fe05028a9f9ecd1e59b7083f5049e0d9cea8fa7e9ec9259104cbb06aa76118",
    "last_fetched":  "2026-06-22T01:56:21.9510185Z",
    "last_changed":  "2026-05-05T21:04:50.0228866Z",
    "import_status":  "unchanged",
    "duplicate_group_id":  "sfg-476",
    "duplicate_role":  "primary",
    "related_files":  [

                      ],
    "generated_explanation":  true,
    "explanation_last_generated":  "2026-06-22T01:56:21.9510185Z"
}

Next Useful Routes

  • Start Here A task-first reading path for AIWikis.org, separating newcomer learning, source-memory lookup, maintainer workflow, and AI-agent retrieval.
  • Topic Index A tag-oriented index for LLM Wiki, AI memory, UAI, source governance, crawling, and retrieval topics.
  • Source Map AIWikis source-governed page for durable AI memory, evidence routing, and agent-readable retrieval.
  • Protocol5.com Protocol5.com source-system overview for transparent AIWikis memory demonstration.
  • Protocol5.com Source Memory Guide AIWikis source-governed page for durable AI memory, evidence routing, and agent-readable retrieval.
  • Protocol5.com Files Site-scoped current-source file index for Protocol5.com.