Nothing in this repository ever wrote the file the hard gate reads, so on any machine that had not hand-installed one the guard answered `RulesUnreadable` for every title. Correct fail-closed behaviour, and also the whole story: the first real injection's opening refusal was exactly this. Measured end to end: remove the file and the guard says `RulesUnreadable`; run the Agent and the guard reads its rules and reaches check 1. Four Agent branches exercised against the machine's real rules location, with its own file backed up and restored by hash — already-current, installed-from-nothing, idempotent second run, corrupt-file-replaced. ## Four decisions, each replacing something the design review disproved - **Provenance, not `rulesVersion`.** The first design replaced the installed file when the packaged seed was strictly newer. Measured against this repository's own history, `31825cf` and `ba5355e` both changed the `anticheat` block without touching `rulesVersion`, and `a4a2c63` — the only commit that bumped it — changed the block not at all. The rule would have delivered NONE of the two changes it existed for. The seeder records a hash of what it installed instead. - **`ReplaceFileW`, not `MoveFileEx`.** Measured: `MoveFileEx(REPLACE_EXISTING)` returns `ERROR_ACCESS_DENIED` against a reader holding the guard's exact share mode. Its backup parameter also makes `05_DETECTION`'s "the last valid copy is kept" a mechanism rather than a sentence. - **Validated by the guard's own parser.** `FlGuardCheckRules` — buffer in, `ParseResult` out, no path parameter, so §S3/§S21's "the rules source is not selectable" is untouched. `DetectionRulesFile` never reads the `anticheat` block (§S15), so validating with the managed reader would have checked everything except the half the hard gate consumes, and could have installed a document the guard then refuses for every title while the seeder logged success. - **A usable file we did not write is left alone.** Safe only because the floor is generated from the shipped blocklist: a rules file can ADD and cannot remove. Under the narrow floor the same rule would have handed permanent control of the blocklist to whoever created the file first. An UNUSABLE file is replaced whoever wrote it — there is nothing to clobber and nothing else repairs it. ## Mechanics Random temp name in the DESTINATION directory (same volume, and `%TEMP%` is the inherited-environment vector §S21 closed), opened `FileShare.None`, flushed through to disk before the swap, and a reparse-point check on the directory chain. ## The caller is real `FrameLedger.Agent/Program.cs` was `return 0`. It now runs the seeder and reports the outcome, and a no-op seeder fails 8 Application tests and 2 Infrastructure tests — proven by making it one. ## One regression caught by an existing test `RuleFixtureCorpusTests` walks up from the test binary looking for a directory called `rules`, and this puts one in the test's own output. The walk stopped immediately and every fixture went missing. Re-keyed on `FrameLedger.slnx`. ## §S20 does not close Rewritten to the residual rather than deleted: the HTTPS feed does not exist so FR-7.3 is unmet; the guard still reads no version so binary and data have no handshake, and `13_CI_CD`'s claim that rules-publish checks the bump was false and is corrected; `trustedSigners` is the one allow-widening field a foreign file still controls, inert until §S19(b) wires the signer half; and this is what makes the Vulkan layer's §S2 self-scan reachable for the first time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
40 lines
1.3 KiB
XML
40 lines
1.3 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<IsPackable>false</IsPackable>
|
|
<RootNamespace>FrameLedger.Infrastructure.Tests</RootNamespace>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\..\src\FrameLedger.Infrastructure\FrameLedger.Infrastructure.csproj" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
|
<PackageReference Include="xunit.v3" />
|
|
<PackageReference Include="xunit.runner.visualstudio" />
|
|
<PackageReference Include="FluentAssertions" />
|
|
<PackageReference Include="NSubstitute" />
|
|
<PackageReference Include="coverlet.collector" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<Using Include="Xunit" />
|
|
</ItemGroup>
|
|
|
|
<!--
|
|
GuardMirrorTests and RulesPathAgreementTests P/Invoke into the real
|
|
FrameLedger.Guard.dll, which NativeAntiCheatGuard loads by absolute path from
|
|
AppContext.BaseDirectory — so it has to sit beside the test binary.
|
|
-->
|
|
<Import Project="$(MSBuildThisFileDirectory)..\..\FrameLedger.Guard.targets" />
|
|
|
|
<!--
|
|
The packaged seed, so the seeder tests run against the artifact that ships
|
|
rather than against the repository path. One of them asserts the two are the
|
|
same file.
|
|
-->
|
|
<Import Project="$(MSBuildThisFileDirectory)..\..\FrameLedger.Rules.targets" />
|
|
|
|
</Project>
|