MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1
Nullable usage and journal
Verify unknown usage and commit evidence read back in another process.
Objectives
- Use this page to understand: Nullable usage and journal.
Prepare model-free checks
Prepare the Release solution, a fresh SQLite file and Maf.Observability.Tests. This exercise uses fixtures and real local storage without a model server. Keep archives and historical databases intact. Submit a table attributing each value to its fixture or execution.
Produce three kinds of evidence
dotnet test tests/Maf.Observability.Tests/Maf.Observability.Tests.csproj -m:1 -c Release --no-build --no-restore$journal = Join-Path $env:TEMP ("maf-lot012-" + [guid]::NewGuid().ToString("N") + ".db")dotnet run --project demos/Demo430_BusinessAudit/Demo430.App.csproj -c Release --no-build -- --deterministic --db $journal1. Read MissingUsageIsNotZero: record Input, Output, DerivedTotal, CharacterEstimate and EstimatedCost for absent, zero and partial usage. 2. Record the successful GUID, end the process and read with --read in a new process. 3. Execute --fail against the same file; retain its different GUID and read it back. Explain why its readback can exit 0 without an action.
dotnet run --project demos/Demo430_BusinessAudit/Demo430.App.csproj -c Release --no-build -- --deterministic --fail --db $journal$executionId = Read-Host 'ExecutionId to inspect'dotnet run --project demos/Demo430_BusinessAudit/Demo430.App.csproj -c Release --no-build -- --db $journal --read $executionIdSeparate conclusions
Record date, revision, file, GUID, TraceId, Kind, ActionId and HasAction. Span duration answers a technical question; ActionCommitted with HasAction answers the local commit question; neither establishes answer quality. A context estimate can be known while provider usage is null.
Link each expectation to an existing check
var input = usage?.InputTokenCount;
var output = usage?.OutputTokenCount;
long? derived = input.HasValue && output.HasValue ? checked(input.Value + output.Value) : null;
decimal? cost = rate is not null && input.HasValue && output.HasValue
? (input.Value * rate.InputPerMillion + output.Value * rate.OutputPerMillion) / 1_000_000m : null;
return new(input, output, usage?.TotalTokenCount, derived,
contextCharacters.HasValue ? ((long)contextCharacters.Value + 3) / 4 : null,
cost, rate?.Currency, rate?.Version);
Source code · Maf.Observability · Folder
public bool HasAction(Guid executionId, long actionId)
{
using var connection = Open();
using var command = connection.CreateCommand();
command.CommandText = "SELECT COUNT(*) FROM RecordedDecisions WHERE ExecutionId=$id AND Id=$action";
command.Parameters.AddWithValue("$id", executionId.ToString("N"));
command.Parameters.AddWithValue("$action", actionId);
return (long)command.ExecuteScalar()! == 1;
Source code · Maf.Observability · Folder
MissingUsageIsNotZero retains null despite CharacterEstimate=100 for 400 fixture characters. CommittedActionSurvivesRestartAndReplay verifies one action and event after replay of the same GUID. IntentAndFailureDoNotProveAction forbids creating evidence through Append. RetentionAndErasurePreserveBusinessEffect shows that metadata deletion does not mean rollback. These are application checks rather than model measurements.
Verification hints
Before reading the correction, record prediction and observation. Separate generated text, terminal state, decision and persisted state. If they differ, follow the file and test named in the procedure; do not remove the guard to obtain the expected result.
Keep evidence bounded
The procedure establishes neither remote effect, continuous tracing after restart nor actual billing. Publish neither SQLite files nor raw transcripts. For a rate experiment, use an explicitly fictional versioned assumption; the exercise needs no actual price.
