e-naxosMAF COURSE / COURS
Français

MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1

Refusal, restart and replay

Observe final refusal and replay after post-commit failure, with independent SQLite inspection.

Objectives

Two isolated operations

Use two fresh directories in a complete distribution built in Release. No model. Keep checkpoints, waiting.json and business.db together. Each command below relaunches the program: the start process ends before resume.

Reject then try to change the decision

$refusal = Join-Path $env:TEMP ('maf-refusal-' + [guid]::NewGuid().ToString('N'))
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- start $refusal
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- resume $refusal maybe
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- status $refusal
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- resume $refusal reject
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- resume $refusal reject
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- resume $refusal approve
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- status $refusal

maybe must fail while retaining Waiting; reject yields Rejected, identical replay succeeds and conflicting approve fails. Record exit codes immediately through $LASTEXITCODE. ApprovedBacklogItems remains empty.

Interrupt after a real write

$approved = Join-Path $env:TEMP ('maf-approved-' + [guid]::NewGuid().ToString('N'))
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- start $approved
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- resume $approved approve "External business decision." --fail-after-write
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- status $approved
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- resume $approved approve "External business decision."
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- resume $approved approve "External business decision."
dotnet run --project demos/Demo320_DurableApproval/Demo320.App.csproj -c Release --no-build -- status $approved

Injected failure returns 1 but status already reads Completed, ItemId and StoredItem. The next two resumptions must retain that ItemId. In resume traces, expect ApplyApprovalV1 and no PrepareApprovalV1. Compare Responding with RequestId in waiting.json. Retain logs and databases for inspection.

Verify rows rather than promises

Using a SQLite reader, run SELECT OperationId, COUNT(*) FROM ApprovedBacklogItems GROUP BY OperationId; then SELECT OperationId, Status, Decision FROM Approvals;. For approval: one group containing one row, Completed and the original decision. For refusal: no business row and Rejected. StoredItem must contain the “Regional pilot” proposal. The tests below also cover rollback, rebinding a key to another draft, wrong correlation and concurrent store calls.

dotnet test tests/Maf.Durable.Tests/Maf.Durable.Tests.csproj -m:1 -c Release --no-build --no-restore

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.

Interpret the evidence

This lot’s local check reruns these scenarios in separate processes and reads SQLite directly. The tested interruption is an injected exception after commit, not power loss. Request identities stay stable within one operation; they differ between new operations. Do not delete the receipt after completion: the exercise intentionally replays an old checkpoint. No distributed transaction or independent human validation is established.

Understand coordination

Prerequisites

Continue reading

lot014-consolidation-1 · 2026-10-24 · 9a895c94534cd5fc6f3da883e37e5f7856e588c1