LiteBus
Reference

Documentation Semantic Validation

LiteBus documentation CI has a fast structural gate and a post-build semantic gate. The structural gate checks Markdown, links, path casing, prose rules, and the evaluated package inventory. The semantic gate runs after the Release build and checks claims that must stay aligned with executable code.

Enforced Contracts

ContractSource of truthGate
Shipping package inventoryEvaluated IsPackable, PackageId, ProjectReference, and directly declared PackageReference MSBuild itemsGet-PackageInventory.ps1 regenerates architecture/generated-package-inventory.md; structural validation rejects a byte-level difference
C# snippetsMarked regions in compiled sample projectsThe semantic gate compares the Markdown fence with its source region and rebuilds the owning project
Referenced testsTests discovered from the built solution, plus methods declared by abstract test basesEvery test class and method reference in docs/ must resolve
Analyzer rulesLiteBus.Analyzers/DiagnosticIds.csImplemented IDs must match the analyzer table; LB1002 must remain the only reserved slot
ASP.NET management routesLiteBusManagementEndpointExtensionsThe documented inbox route table and health endpoint must match mapped methods and paths

Run both gates after a Release build:

./scripts/Test-Documentation.ps1
./scripts/Test-DocumentationSemantics.ps1 -Configuration Release

Source-Linked Snippets

Place a named region in a compiled source file:

// <docs-snippet example-name>
services.AddLiteBus(liteBus =>
{
});
// </docs-snippet>

Place the source marker immediately before the matching Markdown fence:

<!-- snippet-source: samples/MySample/Registration.cs#example-name -->
```csharp
services.AddLiteBus(liteBus =>
{
});
```

The semantic gate removes common source indentation before comparing. The Markdown block must otherwise match exactly.

Executable Capability Anchors

These tests are the executable anchors for claims that previously drifted:

Capability claimExecutable anchor
Inbox and outbox dead-letter replay routes are mapped and callableManagementEndpointOperationsTests.ManagementRoutes_WithBothAxes_ShouldReturnSuccessfulResponses
One root transport can serve inbox dispatch, outbox dispatch, and inbox ingressBrokerDispatchIngressRegistrationTests.RegisteredTransport_ShouldSupportCombinedDurableComposition
Event mediation supports multiple handlersEventModuleTests.mediating_simple_event_goes_through_registered_handlers_correctly
A real broker preserves the common transport contractRabbitMqTransportContractTests.PublishAsync_ThenConsume_PreservesPayloadAndHeaders

The normal unit and integration jobs execute these tests after semantic discovery verifies their names. A renamed or removed anchor therefore breaks documentation CI before the claim becomes stale.

On this page