FLT-359: deterministic CLI test state¶
The failure reproduces with a fixed clock. It is a filesystem dependency, not evidence of environment configuration or clock rollback: FileApprovalClock.TryRecordAsync fails replacing clock.last beneath AppContext.BaseDirectory. The CLI correctly reports Invalid and returns 1.
Captured original operation: UnauthorizedAccessException, HRESULT 0x80070005, System.IO.FileSystem.MoveFile, at Stores.cs:51. See cedric-r2-clock-detail.log. Experimenting with unique temporary names and File.Replace did not solve it: the rapid-update regression failed at update 19 with IOException, HRESULT 0x80070497 (ERROR_UNABLE_TO_REMOVE_REPLACED), at ReplaceFile; see cedric-r2-clock-fresh.log. The same regression passed in OS temporary storage. The specific interfering process or policy is not identified; do not attribute this to antivirus, sandbox, or a particular environment variable without more evidence.
Both speculative production changes and temporary diagnostics were reverted. Production retains exclusive locking, durable writes, strict rollback rejection, and fail-closed file access handling. No access-control bypass or retry was introduced.
CLI tests now own unique directories beneath Path.GetTempPath() rather than writing mutable state into the application output directory. The workflow uses the existing injected TimeProvider, avoiding wall-clock adjustments. Original status/verify success, action mismatch, provider-call, and consume-once assertions remain. Added checks validate real persisted request hashes, 32 rapid updates across clock instances, and persisted CLI rollback rejection under en-US, fr-FR, and ar-SA cultures.
Test receipt¶
With Approvals__Enabled=false, hidden process, no restore/network:
dotnet test Forge.Approvals.slnx --no-restore --logger "trx;LogFileName=r2-temp.trx"
Passed! - Failed: 0, Passed: 144, Skipped: 0, Total: 144, Duration: 2 s
Full output: cedric-r2-temp.log; stderr: cedric-r2-temp.err. These are local sandbox results; an outside-sandbox rerun by Clahadore is still required to confirm that environment.
Three subsequent dotnet test Forge.Approvals.slnx --no-build --no-restore runs each passed 144/144 (durations 2 s, 3 s, 2 s). Receipt: cedric-r2-repeat.log; stderr empty. git diff --check exited 0.
Stryker configuration checks and runtime blocker are documented in cedric-r2-stryker.md. All four configs parse and resolve from the test project directory, but a successful Stryker build analysis is unverified: startup cannot read the real user's NuGet.Config. No commit or push performed.