Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 6e5089bd6b feat(build): every managed binary names FrameLedger, says what it is and carries the native copyright line, and versioninfo-check reads both kinds (beta.14 PR-6, D50)
Owner request 2026-10-05 ("Thêm Assembly metadata"); D50: company and product "FrameLedger", the copyright the
native FL_COPYRIGHT word for word.

Measured before the change, from the built binaries: FrameLedger.Agent.exe/.dll read Company and Product
"FrameLedger.Agent" and FileDescription "FrameLedger.Agent" (what Task Manager lists); each library its own assembly
name; every managed LegalCopyright was one space; the apphost's OriginalFilename is its assembly's (FrameLedger.dll).
tools/versioninfo-check.ps1 read the five native binaries and nothing else.

- Directory.Build.props: Company, Product, Authors, Copyright, Description (the native blocks' sentence, the Comments
  field), RepositoryUrl (stamped as AssemblyMetadata by the SDK); the FrameLedgerSourceRef metadata moved here from the
  App csproj, and release.yml passes the same ref to the Agent's publish.
- App: AssemblyTitle "FrameLedger" and a Description. Agent: AssemblyTitle "FrameLedger Agent" and a Description.
- versioninfo-check.ps1: the rules in one function over a block, a managed half (-ManagedDir, -ExpectedProductVersion -
  required, -ManagedOnly), one LegalCopyright across every binary read, the apphost carrying its assembly's block,
  Company as well as Product = FrameLedger, and -SelfTest: ten cases, nine RED, each for the reason it names (four
  mutations of the rules each turn the self-test red). build.ps1 runs the self-test and both halves (the managed half
  alone under -SkipNative); release.yml reads out/app with the tag's version.
- AssemblyIdentityTests (App, Agent): company, product, copyright = FL_COPYRIGHT parsed from CMakeLists.txt,
  description, RepositoryUrl = IssueLink.Repository, and the Win32 block Explorer shows. Red on the source before.

Docs: 12_BUILD (Identity table, the gate, the publish lines), 13_CI_CD, 19_SAFETY, FORKING (what a fork changes),
CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 03:54:16 +07:00
poli0981andClaude Opus 5.5 1f7aebd0a4 fix(capture): a crash is a crash report of this game or the engine crash reporter it started (beta.14 PR-5) (#267)
Owner request 2026-10-05 (prevention; example SILENT HILL 2, UE 5.1), and a false crash found on the
owner's ledger: The Witcher 3, 2026-10-04, exit code 0, stored crashed by a WER 1001
RADAR_PRE_LEAK_64 (Windows' memory-leak detector) whose P1 named witcher3.exe.

E1 - CrashEventMatcher (pure): a 1000 from "Application Error" counts only when its AppName [0] equals
the executable's, its AppPath [10] (when given) is the executable's, and its ProcessId [8] (typed)
is the session's pid; a 1001 from "Windows Error Reporting" only when EventName [2] is a crash report
(APPCRASH, BEX, BEX64, CLR20r3, MoAppCrash, MoBEX) and P1 [5] equals the name. EventLogCrashSource
filters by provider in the XPath and asks the matcher; ICrashEventSource.FoundCrash(CrashQuery).
Checked once against the owner's real Application log: the Witcher 3 window no longer matches.

E2 - CrashReporterWitness, fed by the watcher's 1 s snapshots (CaptureOrchestrator.PollOnceAsync):
every on-crash reporter (CrashReporterCatalog: CrashReportClient, CrashReporter, CrashReport,
BsSndRpt/BsSndRpt64) with its parent by pid, image and start (a pid reused by a later process is not
the parent); always-on handlers (UnityCrashHandler64/32, crashpad_handler) never. SessionRecorder asks
at the end (two more polls when the game just left, at most 2.5 s); CrashReporterRule counts it when it
started >= 10 s after the game and the game left within 60 s: crashed, notes crash_reporter=<image>;
otherwise a note crash_reporter_seen=. Unreal's crash (exit code 3, no event) is crashed now. No
process is opened. Formats.ExitText names the reporter (string en/vi/ja).

E4 - ExecutableLocator: "bssndrpt" and "bugsplat" are helper fragments (KCD2 picked its game by rank).

Privacy Policy 2.7 (section 4): the Application log's crash reports about a tracked game, and the names
of programs a tracked game starts (the first was read since P2 and not stated).

Tests: CrashEventMatcherTests (the real RADAR record shape, a hang, a name inside another, pid and path
ties, typed and hex values), CrashReporterWitnessTests, CrashReporterRuleTests, SessionRecorderTests
(exit code 3 + reporter = crashed and named; a game that kept running = note only), ExitStatusMapper,
CaptureNotes, ReasonText (ExitText), ExecutableLocator, EventLogCrashSource.

Docs: 04_CAPTURE (crash classification corrected in place), 19_SAFETY (crash safety), 06_DATA_MODEL
(note slots), LIMITATIONS (When a game crashed), CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 03:54:05 +07:00
poli0981andClaude Opus 5.5 101b6cf4d3 test(infra): the build-id mismatch check uses another id of the same length, not one longer than the field (beta.14) (#273)
ShmHandshakeValidatorTests.TheGuardReportsThisInstallsBuildId appended "x" to this install's build id and expected a
mismatch. The handshake's buildId holds 31 characters plus NUL, and the helper cuts at 31: once `git describe` is 31
characters long - ten commits after a tag, v0.1.0-beta.13-10-g15ec7c1c5fd4 in a local gate on 2026-10-06 - the cut id
equals the real one and the check read Ok. It passed for the first nine commits after every tag and failed from the
tenth, locally and on CI alike.

The mismatch is now another id of the same length (the last character changed), which can never be cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 02:59:31 +07:00
poli0981andClaude Opus 5.5 e8bb477415 test(app): the chart-wheel test says which keys are held instead of reading the machine's keyboard (beta.14) (#268)
A local ./build.ps1 check (PR-6) went red on ChartWheelTests.APlainWheelOverAChartScrollsThePageAndNotTheChart:
offset 0. Nothing in that gate touched the App. ChartWheel read Keyboard.Modifiers, which is the machine's real
keyboard from any thread - measured: a fresh background STA thread's GetKeyState reported the machine's NumLock - so a
Ctrl held anywhere while the test ran sent the plain wheel down the zoom path (page not scrolled). CI, with no person at
the keyboard, never saw it.

ChartWheel.CurrentModifiers (default Keyboard.Modifiers; the App never sets it) is what both handlers read; the test sets
it inside its own work item on the one STA thread and puts it back. The keys are a parameter now, so the Ctrl+wheel half
is driven end to end too (page stays, the surface ScottPlot zooms from is reached). A mutation that stops Ctrl+wheel at
the plot turns that case red.

Docs: 14_TESTING (a test that sends input says which keys are held), CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 02:20:27 +07:00
poli0981andClaude Opus 5.5 5ac1555a8b fix(guard): a scan-set member still loading or already gone is read again once before the guard refuses, and a refused re-scan of a game that has exited ends as its exit (beta.14 PR-4, D48) (#266)
Owner decision D48 (2026-10-05), from the crash-reporter question: the 30 s re-scan reads every process
in the game's tree; a member still being created (an engine's crash reporter as its game dies, any
helper started a moment before - EnumProcessModulesEx ERROR_PARTIAL_COPY) or gone between the snapshot
and the open (OpenProcess ERROR_INVALID_PARAMETER) refused the session as unreadable, ending it as a
safety unhook - which also ends a user-mode exception's trial for good.

Native (FrameLedger.Guard): Collected::kRetry, produced by EnumerateModules only for those two errors;
ACCESS_DENIED (a protected process) stays kFailed and is never retried. CheckModules runs one pass,
notes a kRetry and goes on (a finding anywhere still refuses at once), then Pause(kScanRetryPauseMs =
250) and a second pass over a FRESH scan set, where kRetry refuses as kProcessUnreadable and a gone
target leaves no set (kProcessTreeUnavailable). Sources::Pause seam (Sleep in SystemSources).
FindPresentationRuntime treats kRetry as "not yet". fl_prescan's chain ended in an implicit pass for
any new Collected value - it refuses anything but kOk now. fl-baseline-probe names the new value.

Managed: ExitScanRelabel - when the re-scan refused for ProcessUnreadable / ModuleScanFailed /
ProcessTreeUnavailable (never a finding) and the game itself has exited at conclusion, the session is
TargetExited (exit code decides normal/crashed), CaptureOutcome.ExitScanReason, notes
`scan_at_exit=<reason>` (CaptureNotes.ScanAtExit). Findings, live games and other checks unchanged.

Tests: ctest fl_guard [D48] (re-read clean; still unreadable refuses; exited member drops out; gone
target refuses; ACCESS_DENIED never retried; a finding refuses at once; a finding the re-read sees
refuses; [live]: a suspended process and a pid with no process answer kRetry against the real source),
CaptureSessionTests (relabel for the three reasons; live game, finding, driver failure unchanged),
SessionRecorderTests (the note and the exit status), CaptureNotesTests.

Docs: 19_SAFETY (check 1 amended; During a session), 04_CAPTURE, 14_TESTING, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 02:02:46 +07:00
poli0981andClaude Opus 5.5 544a6c6202 fix(update): the channel follows the running copy, no update is applied at start behind FR-12, and the apply waits for a game still holding the Overlay (beta.14 PR-3, D47) (#265)
Owner request 2026-10-05: audit the update logic (no failure reported). Read against Velopack 1.2.0
and the owner's own updater log.

- update.channel defaulted to stable while every release is a GitHub pre-release: a copy left on its
  defaults never found one (the log: "No releases found" since the ledger reset). Owner decision D47:
  default `auto` (choices auto/stable/beta) - UpdateChannelPolicy: a pre-release copy asks for
  pre-releases, a release for releases; a stored stable/beta wins. Settings lists "Automatic (Beta)".
- VelopackApp applied a downloaded package at the next start (SetAutoApplyOnStartup is ON by default)
  inside Run(), before FR-12 and the Agent's stop - the log shows the Agent killed. Off now; the
  package is adopted at start (UpdateService.AdoptPending over UpdateManager.UpdatePendingRestart, no
  feed request) and goes Ready/Deferred like any other.
- OnBeforeUpdateFastCallback asks the Agent to stop before Velopack replaces the version (installer
  over an installed copy); Velopack's diagnostics go to the App's log (VelopackSerilogLogger).
- The apply waits while a game still has FrameLedger.Overlay.dll (or the Vulkan layer) loaded from the
  install folder (PayloadInUse: a mapped image refuses an exclusive write; no process opened), and
  while an Agent waits on the administrator prompt (ElevationMarker, beside the instance lock).
- Stop budget = IpcProtocol.AgentShutdownGrace (15 s, the Agent's host reads it too) + 5 s; was 10 s.
- The offer states the delta's size (UpdateInfo.DeltasToTarget) with the full package as fallback.
- IOException is Offline only from the network (HttpIOException, a socket error); the uninstaller
  removes the "Start FrameLedger with Windows" Run value.

Tests: UpdateChannelPolicyTests, UpdateServiceTests (pre-release copy asks for pre-releases; a stable
choice wins; a pending package is Ready without a feed request and applies; deferred under a session;
a held Overlay keeps it Ready, leaves the Agent alone and says why; the elevation marker holds the
folder; the stop budget outlasts the grace), VelopackHooksTests (private fields of the pinned 1.2.0
builder: _autoApply false, the logger, the before-update hook), UpdatePromptsTests, PayloadInUseTests,
UpdateFailureMapperTests, UninstallHookTests, SettingsViewModelTests, SettingsRegistryTests.
Strings en/vi/ja (ja marked review).

Docs: 11_UPDATER (the update audit, beta.14), 06_DATA_MODEL, 08_UI, 12_BUILD, LIMITATIONS,
guide/01-install, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 01:46:24 +07:00
poli0981andClaude Opus 5.5 c1984cab74 feat(app): Settings > Window > Hide scroll bars - no bar drawn anywhere, every scroller still scrolls (beta.14 PR-2) (#264)
Owner request 2026-10-05: an option to hide the scroll bars but still scroll.

ui.hide_scrollbars (bool, default 0, App only - AgentReads false). A bar's visibility is bound inside
its scroller's template, so no style reaches it: Services/ScrollBarHiding registers one class handler
on ScrollViewer's Loaded at start (beside DialogKeyboard) and, while on, sets an Auto or Visible axis to
Hidden - WPF's "no bar, still scrolls" for wheel, keyboard and touch - keeping the scroller's own value
on it; a Disabled axis is never touched (it lays its content out at the viewport's width). The Settings
toggle applies to the open windows at once (posted to the dispatcher from another thread), and off puts
every kept value back. Read at start beside ui.fps_decimals.

Strings en/vi/ja (ja marked review). Tests: ScrollBarHidingTests (a plain scroller, a disabled one, a
DataGrid's, a multi-line TextBox's and a FlowDocumentScrollViewer's: on hides every bar and the wheel
still scrolls; off restores each scroller's own setting; one that loads while on is hidden and one that
loads after off is left alone), SettingsViewModelTests.HidingScrollBars..., SettingsRegistryTests.
The class joins the strings-culture collection (process-wide state, runs alone).

Docs: 06_DATA_MODEL (settings row), 08_UI (Settings), 16_WPFUI_SYNTAX (gotcha), CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 01:31:02 +07:00
poli0981andClaude Opus 5.5 32e3c5aa8e fix(app): the import list readable in the dark theme with whole tick boxes, and the mouse wheel scrolls every page, dialog and chart (beta.14 PR-1) (#263)
Owner report 2026-10-05 (screenshot of File > Import library in the dark theme; "the wheel does not
scroll, I have to drag the scroll bar").

Import list: the row style added in beta.11 was based on {x:Type DataGridRow}, which WPF UI 4.3.0 does
not define - it keys its row style DefaultDataGridRowStyle - so the lookup fell through to Aero2's row and
SystemColors.WindowBrush (white in every theme) under the dark theme's white text. Based on
DefaultDataGridRowStyle now. WPF UI's CheckBox (MinWidth 120, padding 11) drew a sliver of the box in the
40 px column: MinWidth 0, no padding. The dialog's own scrolling is off (ImportReviewPrompt.Create), so the
list takes the height the window leaves and is the one thing that scrolls; the intro and the count stay.
Compare's DataGridCheckBoxColumn (an Aero2 box) is a template column with the theme's CheckBox.

Wheel: NavigationViewContentPresenter makes ScrollViewer.CanContentScroll default to true for Page and wraps
such a page in a DynamicScrollViewer; the five pages' own root ScrollViewer then had infinite height,
nothing to scroll, and took every wheel. Every Page sets CanContentScroll="False"; page roots and the
session summary show their bar on Auto. The Logs tail is bounded again, so autoscroll follows the end.
Scrollers nested in dialogs are ui:PassiveScrollViewer. Charts/ChartWheel (through ChartTheme.Attach, all
nine plots): a plain wheel is re-raised on the plot's parent so ScottPlot never zooms; Ctrl+wheel zooms
and stops there.

Tests (each run red against the unfixed XAML first): ImportReviewRenderTests (every text cell >= 4.5:1
against the composited colour painted under it, Dark and Light; ticked boxes drawn whole, counted in a
RenderTargetBitmap; a 60-row list scrolls inside the list with the footer in view), AccessibilityTests
(no BasedOn a type the App's dictionaries hold no style for; no DataGridCheckBoxColumn; every Page opts out
of the DynamicScrollViewer; no plain ScrollViewer in a dialog), PagesLoadTests (pages navigated in the real
presenter are not wrapped and the wheel scrolls them; the Logs tail is bounded and follows the end; every
page reads CanContentScroll false after WPF UI's override), ChartWheelTests. Visuals/Wcag test helpers;
ContrastTests uses Wcag.

Docs: 08_UI (UX rules, Contrast's third hole), 16_WPFUI_SYNTAX (two corrections in place, five gotchas),
14_TESTING (what the App draws), guide/03 (Ctrl+wheel), CHANGELOG.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 01:03:04 +07:00
poli0981andClaude Opus 5.5 0ffecb5851 release: 0.1.0-beta.13 - Velopack deltas in release.yml, the CHANGELOG section, the accuracy block's release line, README's release lines, LIMITATIONS' version, HANDOFF's train section and owner-only item 10 (#261)
* ci(release): publish a Velopack delta - download the previous release before vpk pack, keep only what this pack built, filter the feed to this build (beta.13)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* release: 0.1.0-beta.13 - the CHANGELOG section, the accuracy block's release line, README's release lines, LIMITATIONS' version, HANDOFF's train section with the one START HERE and owner-only item 10

VERSION stays 0.1.0: the tag's numeric core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(capture): the four sessions that must end on a scan, a throw, the kill switch or an exit get a 30 s safety net instead of a 120 ms ceiling they raced on a loaded runner (beta.13)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 09:39:53 +07:00
poli0981andClaude Opus 5.5 e77a130fc9 fix: a refusal for a driver or service says "on this PC", the unhook notice promises nothing untrue, the GPU sensors follow the game's adapter, and the language-changing tests run alone (beta.13 PR-1) (#260)
The four follow-ups the beta.12 documentation audit left as chips; three of
them here, the fourth (Velopack deltas) rides the release PR.

S23-3. The guard's checks 2 and 2b are machine-wide: while Easy Anti-Cheat's
service runs for another title, every game refuses with BlockedService, and
the notice read "Easy Anti-Cheat was detected in this game". CaptureRefused
and SafetyUnhook gain an optional guardReason (additive; reason stays the
session's end reason), and BlockedService / BlockedDriver read
Safety_Refused_MachineWide_Format, Safety_Unhooked_MachineWide_Format and
Summary_Tier2_Why_MachineWide_Format (en/vi; ja as an English copy awaiting
the human safety review, like its siblings). Safety_Unhooked_Format loses
"will not inject into this game again until you enable it again", untrue both
ways since 2026-09-22. Formats.NamedRefusal is the one place a named refusal
is worded; SafetyNotices and HookingConsentResult both use it.

L1's adapter. SelectAdapter had no caller, and fixing that alone would have
changed little: the composite merges L3 > L2 > L1 per field, and L2 and L3
read their own first GPU. CaptureProgress carries the handshake's AdapterLuid;
the recorder hands it to the poller once (noted in the .partial);
CompositeTelemetrySource.SelectAdapter points L1 at it (IGpuAdapterSelector)
and tells the other layers its vendor (IGpuVendorFollower): L2 maps that
vendor's LHM node, L3 contributes nothing for a non-NVIDIA adapter. What stays
first-found is written in 18_GPU_VENDOR_APIS and LIMITATIONS.

Culture races. The strings-culture collection serialized its own members but
ran beside every other class; it now has a definition with
DisableParallelization, and StringsTests asserts xUnit bound it.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 09:11:38 +07:00
poli0981andClaude Opus 5.5 ff43d8cdb3 release: 0.1.0-beta.12 - the CHANGELOG section, the accuracy block's release line, README's release lines, LIMITATIONS' version, HANDOFF's train section with the one START HERE and owner-only item 9 (#259)
The [Unreleased] entries move under ## [0.1.0-beta.12] - 2026-10-04 with a
summary for a user and the update notes from beta.11 (schema 0018; the
Legal Gate shows EULA 1.5 / Disclaimer 2.10 / Privacy 2.6 once; the GPL is
no longer accepted). The date is the local one, as beta.9 and beta.10 did
when their runs fell on the previous UTC day.

The accuracy block's release line moves in its three copies (ACCURACY,
README, Disclaimer - the precedent of beta.6-8: no version bump for the
release line). README's release list and count, LIMITATIONS' version line.

HANDOFF: the beta.12 train section (D43-D46, the traps, the code gaps the
documentation audit found and left for their own PRs) carries the file's
one START HERE, and owner-only item 9 lists what only real hardware and the
owner can check: the game's memory beside Task Manager, the Legal Gate, the
guide and About, the ja strings, and LIST_GAME_TESTED's refresh (D35).

VERSION stays 0.1.0: the tag's numeric core.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 01:52:22 +07:00
158 changed files with 4525 additions and 378 deletions

No files matched your search

+41 -2
View File
@@ -154,7 +154,9 @@ jobs:
$ref = if ('${{ steps.version.outputs.dry_run }}' -eq 'true') { '${{ github.sha }}' } else { "v$v" }
dotnet publish src/FrameLedger.App -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:Version=$v -p:FrameLedgerSourceRef=$ref -o out/app
if ($LASTEXITCODE -ne 0) { throw 'App publish failed' }
dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:Version=$v -o out/app
# beta.14 (D50): the same ref for the Agent - Directory.Build.props stamps it on every assembly, and both
# publishes build the same libraries into this one folder.
dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:Version=$v -p:FrameLedgerSourceRef=$ref -o out/app
if ($LASTEXITCODE -ne 0) { throw 'Agent publish failed' }
# A self-contained package redistributes the .NET runtime, and its licence and
@@ -195,7 +197,8 @@ jobs:
if ($missing.Count -gt 0) { throw "out/app is missing: $($missing -join ', ')" }
if (Test-Path out/app/FrameLedger.CaptureHost.exe) { throw 'out/app contains the unshipped capture host (12_BUILD: exactly two roots)' }
if (@(Get-ChildItem out/app/licenses/dotnet -File -ErrorAction SilentlyContinue).Count -lt 2) { throw 'out/app/licenses/dotnet holds fewer than two files -- the runtime licence step did not run' }
./tools/versioninfo-check.ps1 -BuildDir out/app
# beta.14 (D50): the managed half too - the eight managed binaries, carrying the tag's full version.
./tools/versioninfo-check.ps1 -BuildDir out/app -ManagedDir out/app -ExpectedProductVersion '${{ steps.version.outputs.version }}'
if ($LASTEXITCODE -ne 0) { throw 'versioninfo-check over the published tree' }
$size = (Get-ChildItem out/app -Recurse -File | Measure-Object Length -Sum).Sum / 1MB
Write-Host ("published tree: {0:N0} MB" -f $size)
@@ -210,17 +213,53 @@ jobs:
# ledger.db, logs, the layer manifest). The same id would put the install inside
# the ledger's folder and have the uninstaller remove every session without the
# question 12_BUILD promises. The title the user sees is still "FrameLedger".
# A DELTA (beta.13): vpk pack diffs against the newest full package already in --outputDir, and until beta.13 that
# directory was always empty - so no release carried a delta and every update downloaded the whole package
# (11_UPDATER §Built). The previous release is downloaded first; what THIS pack produced is assets.win.json, and only
# that is kept: the previous full package moves out (not uploaded, not checksummed) and the feed lists this build
# alone, as `vpk upload github` would write it. No previous release, or a download that fails, is a full-only
# release - said as a warning, not a stop, because it is exactly what every release before this one was.
- name: Pack (Velopack)
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$ErrorActionPreference = 'Stop'
dotnet tool install -g vpk --version 1.2.0
if ($LASTEXITCODE -ne 0) { throw 'vpk install failed' }
$v = '${{ steps.version.outputs.version }}'
New-Item -ItemType Directory out/release -Force | Out-Null
vpk download github --repoUrl "https://github.com/${{ github.repository }}" --channel win --pre --token $env:GH_TOKEN --outputDir out/release
if ($LASTEXITCODE -ne 0) { Write-Host '::warning::the previous release could not be downloaded - this release carries a full package only' }
Write-Host 'previous release:'
Get-ChildItem out/release -File | ForEach-Object { Write-Host (" {0,-48} {1,12:N0}" -f $_.Name, $_.Length) }
vpk pack --packId FrameLedger.App --packVersion $v --packDir out/app --mainExe FrameLedger.exe --packTitle FrameLedger --packAuthors FrameLedger --releaseNotes out/notes.md --outputDir out/release
if ($LASTEXITCODE -ne 0) { throw 'vpk pack failed' }
$built = @((Get-Content out/release/assets.win.json -Raw | ConvertFrom-Json) | ForEach-Object { $_.RelativeFileName })
if ($built.Count -eq 0) { throw 'vpk pack wrote no assets.win.json entries' }
$keep = $built + @('releases.win.json', 'assets.win.json', 'RELEASES')
New-Item -ItemType Directory out/previous -Force | Out-Null
Get-ChildItem out/release -File | Where-Object { $keep -notcontains $_.Name } | Move-Item -Destination out/previous
$feed = Get-Content out/release/releases.win.json -Raw | ConvertFrom-Json
$feed.Assets = @($feed.Assets | Where-Object { $built -contains $_.FileName })
if ($feed.Assets.Count -eq 0) { throw 'the feed lists none of this build''s packages' }
[System.IO.File]::WriteAllText((Join-Path $PWD 'out/release/releases.win.json'), ($feed | ConvertTo-Json -Depth 8 -Compress), [System.Text.UTF8Encoding]::new($false))
if (Test-Path out/release/RELEASES) {
$legacy = @(Get-Content out/release/RELEASES | Where-Object { $built -contains ($_ -split ' ')[1] })
[System.IO.File]::WriteAllLines((Join-Path $PWD 'out/release/RELEASES'), [string[]]$legacy, [System.Text.UTF8Encoding]::new($false))
}
Write-Host 'this release:'
Get-ChildItem out/release | ForEach-Object { Write-Host (" {0,-48} {1,12:N0}" -f $_.Name, $_.Length) }
Write-Host ('feed: ' + (($feed.Assets | ForEach-Object { '{0} {1} {2}' -f $_.Type, $_.Version, $_.FileName }) -join '; '))
if (-not (Test-Path out/release/FrameLedger.App-win-Setup.exe)) { throw 'vpk did not produce FrameLedger.App-win-Setup.exe (README §Install names it)' }
$delta = "out/release/FrameLedger.App-$v-delta.nupkg"
if (Get-ChildItem out/previous -Filter '*-full.nupkg' -ErrorAction SilentlyContinue) {
if (-not (Test-Path $delta)) { throw "the previous full package was downloaded, but vpk produced no delta ($delta)" }
} else {
Write-Host '::warning::no previous full package - this release carries no delta'
}
- name: Checksums
shell: pwsh
+141 -3
View File
@@ -30,6 +30,146 @@ numeric core and does not move; the heading is the full version — corrected 20
### Added
- **Settings ▸ Window ▸ Hide scroll bars.** No scroll bar is drawn anywhere in the app while it is on, and everything
still scrolls with the mouse wheel, the keyboard and touch. Off by default; it applies at once, to the open windows
too, and off brings every bar back.
### Fixed
- **A session could read "crashed" when the game had not crashed, and an Unreal game's crash read "ended normally".**
Any Windows report that named the game counted as a crash — on the developer's machine a memory-leak report Windows
writes about large games marked an ordinary The Witcher 3 session *crashed*; hang reports and another program whose
name contains the game's would have done the same. Only a crash report of this game's own process counts now. And
Unreal Engine games handle their own crash: they open their crash reporter and exit with code 3, which said nothing;
FrameLedger now sees the crash reporter a game starts (Unreal's, CD PROJEKT RED's, Capcom's, BugSplat's) and records
the session as crashed when the game exits within a minute of it — the summary names the reporter. Unity's and
Chromium's crash handlers start with their game and are never taken for a crash. Sessions already stored keep their
status. BugSplat's sender (Kingdom Come: Deliverance II) can no longer be picked as a game's executable by the import.
The Privacy Policy (2.7) now says that FrameLedger reads Windows' crash reports and the names of programs a game starts.
- **A game that exited as FrameLedger's anti-cheat check ran could be recorded as "unhooked (safety)"** — and, under a
user-mode anti-cheat exception, end the exception's trial for good. The check reads every process in the game's
tree every 30 s; one that was just starting (an engine's crash reporter as its game dies, any helper the game launched
a moment before) or already gone could not be read, and the check refused. Such a process is now read once more a
quarter of a second later, and refused only if it is still unreadable (a protected process never gets the second
look). And when the check could not read and the game itself has exited, the session ends as that exit, normal or
crashed by its exit code. Anything the check *finds* is a refusal exactly as before (owner decision D48).
- **An installed copy never found an update unless you had changed its channel.** The update channel was *Stable* by
default and every FrameLedger release so far is a pre-release, so the check found nothing. The channel is now
*Automatic*: a pre-release looks for pre-releases and a release for releases; choosing *Stable* or *Beta* still decides.
- **A downloaded update was applied the next time FrameLedger started, before anything could check for a running game.**
The update library applies a waiting package at start unless told not to, and nothing told it: it stopped the capture
agent mid-session instead of letting it finish. The App now offers such a package as *Restart to update*, which waits
for the session to end and stops the agent properly, as it always did for a download in the same run.
- **The update dialog said ~102 MB when the download was the 1.6 MB delta.** It now says the delta's size and names the
full package as the fallback; the updater's own lines are in the App's log, so a full download shows there.
- **Restart to update could fail half way** when a game FrameLedger had measured was still running — its loaded overlay
cannot be replaced — or when an agent was still waiting on the administrator prompt, and it gave the agent 10 s to stop
where the agent takes up to 15. It waits for all three now and says why. A full disk no longer reads as "offline",
and uninstalling removes the *Start FrameLedger with Windows* entry.
- **The import list was unreadable in the dark theme.** File ▸ Import library (and Games ▸ Refresh) drew every row white
with white text, and each tick box as a sliver at the row's edge: a row style added in beta.11 to dim the games already
in the library fell through to Windows' own row, which is white in every theme, and WPF UI's check box is too wide for
its 40 px column. The rows take the theme's colours again and the boxes are whole, and the list is the one thing in the
dialog that scrolls — its intro and the count under it stay in view, where a list scrolling inside a scrolling dialog
used to carry the intro away. Compare's session picker draws the theme's check boxes too (it drew Windows' old ones).
- **The mouse wheel scrolled nothing on the Dashboard, Games, a game's page, Compare and Settings** — only dragging the
scroll bar did. WPF UI wraps a page in a scroller of its own unless the page says otherwise, and inside it each page's
own scroller had nothing to scroll and still took every wheel. Every page scrolls itself now. The Logs page had the same
cause: its tail grew to hold every line and never followed the newest one, as it was meant to. A scroller inside a
dialog (the consent, administrator, anti-cheat exception and bug report dialogs) hands the wheel on at its ends.
- **The chart-wheel test read the real keyboard** (developers): a Ctrl held anywhere on the machine while the test ran
turned its plain wheel into a zoom, and a local gate went red once. The keys held are now the test's own input, and the
Ctrl+wheel half is driven end to end as well.
### Changed
- **Over a chart, the wheel scrolls the page; Ctrl+wheel zooms the chart.** ScottPlot zoomed on every wheel, which with
the pages scrolling again would have zoomed the chart and scrolled the page at once. Dragging still pans and
double-click still resets.
- **FrameLedger's own programs say what they are.** In Explorer (*Properties ▸ Details*) `FrameLedger.exe` and
`FrameLedger.Agent.exe` now name the product, the author's copyright and what each one does, as the native DLLs always
have; Task Manager lists the background service as *FrameLedger Agent* rather than *FrameLedger.Agent*. Until this
release the Agent called its company and product "FrameLedger.Agent" and no managed file carried a copyright. The
release check now reads both kinds of file and fails when one of them does not name FrameLedger or carries a different
copyright line.
## [0.1.0-beta.13] - 2026-10-04
**The thirteenth pre-release: refusal notices that say where the anti-cheat is, GPU sensors that follow the game's graphics
card, and smaller updates.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run
anyway*. What changed for a user:
- **An anti-cheat driver or service running on the PC is said as that.** While, for example, Easy Anti-Cheat's service
runs for another game, FrameLedger hooks no game at all; the notice used to say the anti-cheat "was detected in this
game", naming a game that may not even use it. It now says the anti-cheat is running on this PC, and the session's
summary says the same. A finding in the game itself still says "in this game".
- **The notice for a capture stopped mid-game** no longer promises that FrameLedger will hook the game again "when you
enable it again" — which was not true either way. It says where the anti-cheat was found and whether hooking was
turned off.
- **On a PC with more than one graphics card**, the GPU figures follow the card the game draws on once it has shown its
first frame, instead of the first card Windows lists (often a laptop's integrated GPU). Not yet tested on such a PC.
- **Updates download only what changed**: this release carries a delta package against `0.1.0-beta.12`, so updating
from it through the App downloads a fraction of the full ~107 MB.
**Updating from `0.1.0-beta.12`:**
- Help ▸ Check for updates downloads the delta; or quit the App (tray icon → Exit), end `FrameLedger.Agent.exe` and
run the installer as before.
- No database change, and no document to accept again.
### Fixed
- **A refusal because of a driver or service said the anti-cheat "was detected in this game".** The guard's checks for
drivers and services are machine-wide: while Easy Anti-Cheat's service runs for another title, every game is refused,
and the notice named a game the user may not even own. It now says the anti-cheat is running on this PC — a driver or
service that may belong to another game or program — and the session summary says the same; a finding in the game
itself still says "in this game" (`20_OPEN_QUESTIONS` §S23-3, closed). The Agent's refusal and unhook events carry the
guard's own reason for this (`guardReason`, additive).
- **The notice for a mid-session stop promised "FrameLedger will not inject into this game again until you enable it
again"**, untrue both ways since beta.5: a driver or service that starts on the PC turns no hooking off, and a finding
in the game turns it off for good. It says where the finding was, and whether hooking was turned off.
- **On a PC with more than one graphics card, the GPU sensors could describe a card the game was not using.** The
adapter the game draws on is now followed once it has shown its first frame: the DXGI layer switches to it,
LibreHardwareMonitor reads that brand's GPU rather than the first one it lists (often a laptop's integrated GPU), and
NVAPI says nothing when the game runs on an AMD or Intel card — N/A rather than another card's temperature.
`LIMITATIONS.md` says what still describes the first card.
- **Updates download only what changed**, from this release on: each release now carries a Velopack delta package
against the previous one beside the full package, and an installed copy one release behind downloads the delta. No
earlier release had one — every update so far downloaded the whole ~107 MB package — so the first update that can use
a delta is from `0.1.0-beta.12` to this one; Velopack falls back to the full package whenever the delta does not apply.
- **Tests that change the App's language ran beside tests that read its text**, so the second kind could read the
wrong language once in many runs; the language-changing tests now run on their own.
## [0.1.0-beta.12] - 2026-10-04
**The twelfth pre-release: how much memory each game itself uses, documents you can read, and a user guide.** The same
unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*. What changed for a user:
- **The game's own memory, in every session** — its video memory and its RAM, the figures Task Manager's Details tab
shows for the game's process, read once a second from outside the game, whether or not the game is hooked. The
session summary shows the median and the peak, the Sessions tab has two new columns, the Trend and Compare have the
memory metrics, the Sensors charts draw this game's memory beside the whole graphics card's and the whole PC's, and
the Dashboard shows it live.
- **Statistics per series**: every sensor's mean, median, minimum and peak, at the bottom of a session's summary.
- **Documents are rendered**, not shown as raw text: the first-start documents, Help ▸ Limitations, the update notes,
and a new **Help ▸ About** with the program's legal notices, the third-party licences and the legal documents.
- **A user guide** — eight short pages, under **Help ▸ User guide**.
- **The GPL is no longer something you accept**: it is your licence, shown for information. You accept the EULA (now
1.5), the Disclaimer (2.10) and the Privacy Policy (2.6), so the first-start window opens once after the update.
- Links to the project's documents open the version you run, not the newest one.
- **The Logs page's Warning and Error filters show the Agent's lines** too; they showed only the App's.
- **Settings no longer has "Record games launched outside FrameLedger"**: the switch never did anything.
**Updating from `0.1.0-beta.11`:**
- Quit the App (tray icon → Exit) and end `FrameLedger.Agent.exe` before running the installer.
- Schema 0018 adds the memory columns; the database opens in place, and an older version cannot open it again.
- Sessions recorded before this version have no memory figures and no per-series statistics: they read N/A, and the
summary says so.
- The new `FrameLedger.ProcessStats.dll` is installed beside the Agent; without it the memory figures read N/A.
### Added
- **The game's own memory, measured from outside the game, in every session** (owner decision D43, beta.12). A new
C++ library loaded by the Agent — never into a game — `FrameLedger.ProcessStats.dll`, reads once a second the game
process's **dedicated and shared GPU memory** (the documented `GPU Process Memory` performance counters, which need no
@@ -43,7 +183,7 @@ numeric core and does not move; the heading is the full version — corrected 20
(`game_vram_dedicated_*`, `game_ram_private_*`, …), the process count, the sources, and every sensor series'
n / mean / median / min / max in `sensor_stats_json`; carried live to the Dashboard (`SessionProgress`, `SessionHeld`)
and through the crash-recovery file (a new chunk type; beta.11's files still recover). The video-memory **budget** is
still not measured (`20_OPEN_QUESTIONS` §M11). The App shows all of it in the next change.
still not measured (`20_OPEN_QUESTIONS` §M11). The App shows all of it (below).
- **Sensor statistics have a median and a minimum** beside the mean and the maximum (`SeriesAggregates`).
- **The App shows the game's own memory everywhere a session is** (D43, beta.12), in Task Manager's units — MB below
1 GB, GB to two decimals, 1 GB = 1024 MB. The **session summary** has two new cards, *VRAM (this game)* and *RAM (this
@@ -71,7 +211,6 @@ numeric core and does not move; the heading is the full version — corrected 20
game, read your results, anti-cheat and safety, your data, questions and answers, and the terms in plain words — in
the app under **Help ▸ User guide** (the first item of the Help menu) and in the repository's `guide/` folder. The
README now opens with a pointer to it and keeps a separate section for developers and forks.
- **`NOTICE`, and the licence header in every source file** (owner decision D45, beta.12). FrameLedger's own material is
GPL-3.0-only with three additional terms of the kinds GPLv3 §7 permits: keep the copyright line and the attribution in
the program's legal notices (b), mark a modified version as different and do not call it "FrameLedger" alone (c), and
@@ -123,7 +262,6 @@ numeric core and does not move; the heading is the full version — corrected 20
rules file's own comment and the rules workflow's header made the feed claim too, and are corrected. `docs/README.md`
is a new index for developers. Code comments that said what is not so (a sparkline, a flyout, a layer flag "false by
construction", two self-test counts) are corrected with them.
- **The first start's summary said "there is no way to override that refusal"** although a per-game user-mode exception
has existed since beta.9, and **"Nothing is sent anywhere"** although the update check is a request to GitHub; it now
names the exception and the one request. The README's safety table still said an exception needed two earlier
+1 -1
View File
@@ -76,7 +76,7 @@ src/
FrameLedger.NvapiBridge/ # C++ DLL loaded by the Agent (never a game): NVAPI telemetry, NGX state (P2 PR-E2)
FrameLedger.ProcessStats/ # C++ DLL loaded by the Agent (never a game): the game process's memory (beta.12, D43)
tests/ tools/ third_party/ # ctest suites; probes, hook-harness, vendor stubs; vendored headers
# (these five lines added 2026-10-04 — the list stopped at Shm)
# (these three lines added 2026-10-04 — the list stopped at Shm)
FrameLedger.Domain/ # entities, metric calculators — zero dependencies
# (Metrics/ WRITTEN 2026-09-09, P2 PR-A: frame times,
# percentiles, lows, stutter, the FG window and its
+26
View File
@@ -69,6 +69,32 @@
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>
<!-- beta.14 (D50): every managed binary names the product and who wrote it, as the native ones always have
(19_SAFETY: a binary says plainly what it is). Explorer's Properties > Details and Task Manager read these. Until
beta.14 the SDK's defaults stood: the Agent's Company and Product read "FrameLedger.Agent", each library's its own
assembly name, and no managed binary carried a copyright. The copyright is the native FL_COPYRIGHT
(src/native/CMakeLists.txt) word for word: tools/versioninfo-check.ps1 reads both from the built binaries and is
red when they differ. The file description is the AssemblyTitle - an entry point sets its own, a library keeps its
assembly name - and the Description is the Comments field, the native blocks' sentence for a library. The SDK
stamps RepositoryUrl into every assembly as AssemblyMetadata; it is the App's IssueLink.Repository, and the App's
AssemblyIdentityTests holds the two equal (a fork changes both - FORKING.md). -->
<PropertyGroup>
<Company>FrameLedger</Company>
<Product>FrameLedger</Product>
<Authors>poli0981</Authors>
<Copyright>Copyright (C) 2026 poli0981. GPL-3.0-only with additional terms: see NOTICE</Copyright>
<Description>Performance measurement tool. Identifies itself deliberately; see https://github.com/poli0981/frameledger</Description>
<RepositoryUrl>https://github.com/poli0981/frameledger</RepositoryUrl>
</PropertyGroup>
<!-- beta.12: the source a build was made from - release.yml passes the tag (a rehearsal, its commit); a local build has
none. The App's links into the repository open THIS version's documents with it (Services/RepositoryLinks.cs).
Every assembly since beta.14 (D50), not the App's alone: the two publishes build the same libraries into one
out/app, and release.yml passes the same ref to both. -->
<ItemGroup Condition="'$(FrameLedgerSourceRef)' != ''">
<AssemblyMetadata Include="FrameLedgerSourceRef" Value="$(FrameLedgerSourceRef)" />
</ItemGroup>
<!-- Test projects: documentation comments are noise, and xUnit's own
analyzers already cover what matters there. -->
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
+1 -1
View File
@@ -68,7 +68,7 @@ share — and migrate — one database, and fight over the same pipe and shared
| Logon task | `LogonTask` (the Agent's maintenance verbs) | one task per name |
| Issue and help links | `IssueLink.Repository` (`src/FrameLedger.App/Services/IssueLink.cs`) — `RepositoryLinks` builds every document link in the App from it and the source ref `release.yml` passes — plus the Releases link in `guide/01-install.md` and `.github/ISSUE_TEMPLATE/` | your users' reports belong in your tracker |
| Who the documents name | `legal/EULA.md`, `legal/DISCLAIMER.md`, `legal/PRIVACY_POLICY.md` name poli0981 as the Developer, with a contact | the person who distributes a build is the one its users deal with; review every claim they make, too — they describe FrameLedger's builds, not yours |
| Version information | `FL_COMPANY_NAME` / `FL_PRODUCT_NAME` in `src/native/CMakeLists.txt`, and the `ProductName` that `tools/versioninfo-check.ps1` requires | anti-cheat vendors and users identify the DLLs loaded into games by it (`docs/19_SAFETY_AND_ANTICHEAT.md`); it must name your project |
| Version information | `FL_COMPANY_NAME` / `FL_PRODUCT_NAME` / `FL_COPYRIGHT` in `src/native/CMakeLists.txt`; `Company` / `Product` / `Authors` / `Copyright` / `Description` / `RepositoryUrl` in `Directory.Build.props` and the `AssemblyTitle` / `Description` of the App's and the Agent's csproj (since beta.14); and the names `tools/versioninfo-check.ps1` and the two `AssemblyIdentityTests` require | anti-cheat vendors and users identify the DLLs loaded into games and the processes beside them by it (`docs/19_SAFETY_AND_ANTICHEAT.md`); it must name your project, and the copyright line must be one line on every binary — the check compares them |
| Checksums | your own `SHA256SUMS.txt` | users verify what *you* built |
The detection rules and the anti-cheat blocklist (`rules/detection-rules.json`) ship with each build; keeping them
+23 -1
View File
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
page lists them in plain words; each item links to the document that has the details.
*Beta software: this page describes version 0.1.0-beta.11.*
*Beta software: this page describes version 0.1.0-beta.13.*
## Games it will not measure
@@ -39,6 +39,18 @@ Windows, outside the game) and why nothing was measured.** Every
frame-rate, upscaler, frame-generation and ray-tracing value reads **N/A**, never 0. How the game's window was
shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
## When a game crashed
- A session reads **crashed** when the game ended with an exception's code, when Windows logged a crash report of it,
or — since 0.1.0-beta.14 — when it started its engine's crash reporter (Unreal's, CD PROJEKT RED's, Capcom's,
BugSplat's) and exited within a minute. A game that handles its own crash quietly, starts no reporter and leaves no
crash report reads **ended normally**, with its exit code.
- A crash reporter is seen from a once-a-second look at running programs: one that opens and closes faster can be
missed, and one started in the game's first 10 seconds is not counted (it could be a monitor that starts with the
game). Unity's crash handler and Chromium's `crashpad_handler` start with every game that has them, so their presence
says nothing. Sessions recorded before 0.1.0-beta.14 keep how they were stored — a few of them may read *crashed*
because Windows logged a memory report about the game. ([details](docs/04_CAPTURE.md))
## Frame rate and frame generation
- **One inflated number is never shown.** When frame generation is measured, the page shows the game's own
@@ -103,6 +115,11 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
- GPU temperature, load, power and memory are best supported on **NVIDIA** GPUs. **AMD and Intel GPUs have
not been tested** on real hardware yet.
- **On a PC with more than one graphics card**, the GPU figures follow the card the game draws on once a Direct3D game
has shown its first frame; before that, in an unmeasured session, and for OpenGL or Vulkan games they describe the
first card Windows lists, and with two cards of one brand the temperature and load come from that brand's first card.
The session's hardware details always name the first card. None of this has been tested on a machine with two cards.
([Telemetry](docs/18_GPU_VENDOR_APIS.md))
- **CPU temperature** needs *Run the agent as administrator* and the separately installed PawnIO driver, and
has not been verified on real hardware yet. CPU load is the time the processor was busy — not Task
Manager's "utility" figure, which can exceed 100%. ([Telemetry](docs/18_GPU_VENDOR_APIS.md))
@@ -141,3 +158,8 @@ you accept the prompt. Turn it on only if you trust everything that runs under y
FrameLedger's programs are **not code-signed**: Windows SmartScreen may warn when you install it, and the
administrator prompt names an unknown publisher. Each release publishes SHA-256 checksums you can compare.
**An update waits while a game FrameLedger measured is still running.** The part of FrameLedger loaded into a game stays
loaded until the game exits, and Windows will not let the update replace it; *Restart to update* says which file is held
until you close that game ([details](docs/11_UPDATER.md)). Copies older than 0.1.0-beta.14 look only for stable
releases unless you choose *Beta* in Settings ▸ Updates, and apply a downloaded update the next time they start.
+4 -4
View File
@@ -9,8 +9,8 @@ anti-cheat, and look after your data, a page each. What FrameLedger cannot do is
[Limitations](LIMITATIONS.md). Both are in the app too (Help ▸ User guide, Help ▸ Limitations).
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.11`** (2026-10-03), an unsigned installer built from that tag with its
> ⚠ **What FrameLedger actually measures today — 2026-10-04.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
> checksums published beside it. The source holds the desktop app
> (library, store import, charts, settings) and the background Agent, which records a session when a
> game in the library runs (unless you switched its recording off), injects only into games you enabled
@@ -153,7 +153,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
## Install
> **The latest pre-release is `v0.1.0-beta.11` (2026-10-03); before it `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
> **The latest pre-release is `v0.1.0-beta.13` (2026-10-04); before it `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
@@ -200,4 +200,4 @@ GPU telemetry is layered so the project never depends on a proprietary vendor li
---
**Status:** pre-release (beta). Eleven tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
**Status:** pre-release (beta). Thirteen tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
+19 -5
View File
@@ -320,13 +320,27 @@ function Invoke-ProjectGates {
# Being plainly identifiable to anti-cheat is a requirement, not packaging
# polish (docs/19_SAFETY_AND_ANTICHEAT.md). Reads the built binary, because
# what ships is what an anti-cheat vendor sees.
#
# beta.14 (D50): BOTH HALVES. The rules prove themselves first (ten cases,
# nine RED, each for its own reason), then the live pass reads the native five
# and the managed eight from the App's and the Agent's build output, whose
# ProductVersion is the VERSION file's here (release.yml passes the tag's).
# Under -SkipNative the managed half still runs.
Write-Step 'versioninfo-check'
$versionTool = Join-Path $repo 'tools/versioninfo-check.ps1'
if ((Test-Path $versionTool) -and -not $SkipNative) {
Invoke-Checked 'versioninfo-check' { & $versionTool -BuildDir (Join-Path $repo "build/native/x64-$($Configuration.ToLower())") }
}
elseif ($SkipNative) {
Skip-Gate 'versioninfo-check' 'native build skipped, so there is no binary to inspect'
if (Test-Path $versionTool) {
Invoke-Checked 'versioninfo-check (self-test)' { & $versionTool -SelfTest }
$managedDirs = @('FrameLedger.App', 'FrameLedger.Agent' | ForEach-Object { Join-Path $repo "src/$_/bin/$Configuration" })
$productVersion = (Get-Content (Join-Path $repo 'VERSION') -Raw).Trim()
if ($SkipNative) {
Invoke-Checked 'versioninfo-check (managed)' { & $versionTool -ManagedOnly -ManagedDir $managedDirs -ExpectedProductVersion $productVersion }
Skip-Gate 'versioninfo-check (native)' 'native build skipped, so there is no binary to inspect'
}
else {
Invoke-Checked 'versioninfo-check' {
& $versionTool -BuildDir (Join-Path $repo "build/native/x64-$($Configuration.ToLower())") -ManagedDir $managedDirs -ExpectedProductVersion $productVersion
}
}
}
else {
Skip-Gate 'versioninfo-check' 'tools/versioninfo-check.ps1 not implemented yet'
+23 -2
View File
@@ -437,8 +437,29 @@ because a layer cannot leave a running game's loader chain.
## Crash & exit classification
- Normal: presenting PID exit code 0 — **and since beta.8 any exit code that is not an exception's** (End task and taskkill leave 1; a program's own error exit; Ctrl+C's `0xC000013A`), kept in `capture_notes` and said as what it is.
- `crashed`: ~~nonzero exit code~~ **an exception's exit code** (`ExitStatusMapper.IsExceptionCode`: NTSTATUS `0xC0000000–0xC0FFFFFF` but `0xC000013A`, `0xE06D7363` C++, `0xE0434352` .NET, `0x80000003` breakpoint), **or** an Application Error (1000) / WER (1001) event log record naming the exe within `[start, end + 30 s]`.
- `unhooked_safety`: the guard fired mid-session.
- `crashed`: ~~nonzero exit code~~ **an exception's exit code** (`ExitStatusMapper.IsExceptionCode`: NTSTATUS `0xC0000000–0xC0FFFFFF` but `0xC000013A`, `0xE06D7363` C++, `0xE0434352` .NET, `0x80000003` breakpoint), **or** an Application Error (1000) / WER (1001) event log record ~~naming the exe~~ **that is a crash report of this game** within `[start, end + 30 s]`, **or** (beta.14) an engine's crash reporter the game started before it left.
> **Corrected 2026-10-05 (beta.14, the crash-reporter question): the event-log witness was too broad, and one engine's
> crashes had no witness at all.** A record counted when any of its strings *contained* the executable's name: on the
> owner's machine a WER 1001 `RADAR_PRE_LEAK_64` — Windows' memory-leak detector — named `witcher3.exe` and a session
> that ended with exit code 0 was stored `crashed` (2026-10-04, read from a copy of the ledger and the event log); a hang
> report, another program whose name contains this one's, or a crash of a same-image child would have done the same.
> `CrashEventMatcher` now takes a 1000 from `Application Error` only when its application name equals the executable's,
> its path (when given) is the executable's and its process id is the session's, and a 1001 from `Windows Error
> Reporting` only when it is a crash report (`APPCRASH`, `BEX`, `BEX64`, `CLR20r3`, `MoAppCrash`, `MoBEX`) whose first
> parameter is the executable's name. And Unreal handles its own crash — it starts `CrashReportClient.exe` and exits
> with code 3, no exception code and no event — so it read `normal`. The watcher's once-a-second snapshots now record
> every **on-crash** reporter a process starts (`Watch.CrashReporterCatalog`: Unreal's `CrashReportClient.exe`,
> REDengine's `CrashReporter.exe`, RE Engine's `CrashReport.exe`, BugSplat's `BsSndRpt(64).exe`) with its parent by pid,
> image and start (`CrashReporterWitness` — a pid reused by a later process is not the parent); the recorder asks at the
> end, after two more polls when the game just left. It counts (`CrashReporterRule`) when it started at least 10 s after
> the game and the game left within 60 s of it: `crashed`, with `crash_reporter=<image>` in the notes. A reporter whose
> game kept running is a note (`crash_reporter_seen=`). **Always-on handlers never count** — Unity's
> `UnityCrashHandler64.exe` and `crashpad_handler.exe` start with their game. No process is opened for any of this.
> Sessions stored before beta.14 keep their status.
- `unhooked_safety`: the guard fired mid-session. *(Since beta.14, D48: a re-scan that refused only because it could not
read the game's tree, concluded after the game itself had exited, is the game's exit instead — `normal` or `crashed` by
its exit code — with `scan_at_exit=<reason>` in `capture_notes`; `19_SAFETY` §During a session.)*
- `degraded`: Overlay self-disabled after faults, or ring layout mismatch mid-session.
- `interrupted`: Agent died mid-session; recovered from `.partial` on next start.
- A **user stop** (FR-3.6; `StopSession` over the pipe, P3 PR-1b) is `normal`: the loop ends as `SessionEndReason.StoppedByUser` at its next tick, drains once more and finalizes; the target keeps running, unhooked from here. It is the session's own stop token, not the host's cancellation — the latter leaves a `.partial`.
+5 -2
View File
@@ -197,7 +197,9 @@ CREATE TABLE sessions (
started_at INTEGER NOT NULL, ended_at INTEGER NOT NULL, duration_s REAL NOT NULL,
capture_tier INTEGER NOT NULL, -- 1 = hooked, 2 = not hooked; CHECK (capture_tier IN (1,2))
capture_notes TEXT, -- why tier degraded, late_attach, etc.
capture_notes TEXT, -- why tier degraded, late_attach, etc.; beta.14 adds crash_reporter= /
-- crash_reporter_seen= (an engine's crash reporter the game started) and
-- scan_at_exit= (D48: a re-scan that could not read as the game exited)
late_attach INTEGER NOT NULL DEFAULT 0,
telemetry_source TEXT, -- composite descriptor, e.g. 'l1+lhm+nvapi' (18_GPU_VENDOR_APIS)
overlay_build_id TEXT, -- native DLL build that produced this data
@@ -415,6 +417,7 @@ switch's rule); integers are invariant-culture within an inclusive range; choice
| `ui.minimize_to_tray` | bool | `0` | | UI (PR-8) |
| `ui.hide_anticheat_hooking` | bool | `1` | | UI (beta.8, 2026-09-25): the game page of an entry the guard found anti-cheat in shows the finding in place of its Hooking card (`08_UI` §Game detail) |
| `ui.fps_decimals` | bool | `0` | | UI (beta.8, 2026-09-25): every FPS figure with two decimals ("62.40") instead of a whole number |
| `ui.hide_scrollbars` | bool | `0` | | UI (beta.14, 2026-10-05): no scroll bar drawn anywhere; every scroller still scrolls with the wheel, the keyboard and touch (`App.Services.ScrollBarHiding`, `08_UI` §Settings) |
| `ui.library_view` | choice `grid`\|`list` | `grid` | | UI (beta.11, 2026-10-03): the Games library as a grid of cards that fills the width, or as a list; written by the page's own switch, no Settings row (`08_UI` §Games) |
| `capture.background` | bool | `1` | | ~~Agent~~ nobody *(corrected 2026-10-04: no Agent code ever read it, so the watcher recorded every tracked game whatever it said; beta.12 removed its switch from Settings and reserved the key — `SettingsRegistry.CaptureBackground`)* |
| `hooking.kill_switch` | bool | `0` | | Agent (FR-2.4, since P2 PR-F) |
@@ -423,7 +426,7 @@ switch's rule); integers are invariant-culture within an inclusive range; choice
| `capture.min_session_s` | int | `30` | 5–600 | Agent, per session (FR-3.6) |
| `telemetry.interval_ms` | int | `1000` | 500–2000 | Agent, per session (FR-3.5) |
| `retention.raw_sessions_per_game` | int | `20` | 0–10000; **0 = unlimited** | Agent, per session (§Retention) |
| `update.channel` | choice | `stable` | `stable` · `beta` | UI (P4 PR-5 reads it: `beta` = GitHub pre-releases too) |
| `update.channel` | choice | ~~`stable`~~ `auto` (beta.14, D47) | `auto` · `stable` · `beta` | UI (P4 PR-5 reads it: `beta` = GitHub pre-releases too; `auto` follows the running copy, a pre-release asking for pre-releases — `11_UPDATER` §The update audit) |
| `update.auto_check` | bool | `1` | | UI (P4 PR-5: the startup silent check, `11_UPDATER` §Flow "if enabled") |
| `privacy.online_metadata` | bool | `0` | | *reserved* — no consumer and, since 2026-09-16, no toggle on Settings either: the store request it would enable has no code (CLAUDE.md rule 8), and PRIVACY_POLICY 2.2 removed the row that described it |
| `log.debug` | bool | `0` | | UI |
+2 -2
View File
@@ -406,9 +406,9 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
| `SessionHeld` | A→UI | **Added 2026-09-23.** 1 Hz while a client listens, for a session held unhooked only: `{ sessionGuid, elapsedS, gpuTempC?, cpuTempC?, gpuLoadPct?, cpuLoadPct?, gameVramDedicatedMb?, gameRamPrivateMb? }` — how long it has run and the machine's sensors (and since beta.12 the game process's own memory, read from outside it — optional, an older client ignores them). **Never `SessionProgress`**: its `presents5s`, `presentedQualifier` and `fgMode` are required, and zeros there would put measured-looking numbers on the wire for a session that measures nothing (rule 6 has nothing to show and shows nothing) |
| `SessionProgress` | A→UI | 1 Hz: `{ sessionGuid, elapsedS, presents5s, presentedFps5s?, presentedQualifier, nativeFps5s?, displayedFps5s?, fgFactor?, fgMode, upscaler?, upscalerQuality?, upscalerDriverReported?, renderW/H?, outputW/H?, rtActive?, gpuTempC?, cpuTempC?, cpuLoadPct?, vramProcMb?, latencyUs?, fgRefusal?, fgRuntimeCensus?, gameVramDedicatedMb?, gameRamPrivateMb? }` (the last two added 2026-10-03, beta.12, optional: the game process's dedicated GPU memory and private working set, MiB, from the newest telemetry tick; `vramProcMb` stays reserved for the in-process figure and has no producer) — a 5 s rolling window over the ring through the SAME Domain calculators the row uses (`SessionProgressCalculator`, D13). **`upscalerDriverReported` added 2026-09-21, optional:** `dlss` when the NVIDIA driver reports an NGX super-resolution feature created and evaluated in the target (`03_METRICS` §The driver-reported rung), so the live card says `DLSS (driver-reported)` where no hook can name the upscaler; identity only. **`cpuLoadPct` added 2026-09-21, optional** (CPU time busy over the last telemetry tick, 0–100; `cpuTempC` has a producer from the same date, present only when the Agent is elevated with PawnIO). **Two fields added 2026-09-14, both optional (an older client ignores them, §C):** `fgRefusal` is the row's `fg_refusal` (schema 0003) — present when `fgMode` names a technology and `fgFactor` is absent, so the live card can say "DLSS-G active — factor not counted" rather than N/A; `fgRuntimeCensus` is the raw census so the `fg_runtime_loaded` chip can name the module. **Rule 6 at the wire (2026-09-13):** `nativeFps5s` / `displayedFps5s` / `fgFactor` are present only when frame generation was measured in the window; otherwise `presentedFps5s` stands alone with `presentedQualifier` (`census_not_run` · `no_fg_runtime` · `fg_runtime_loaded` · `none_withheld`, the row's `presented_qualifier` from the same function). Every unmeasured field is absent, never 0. Suppressed when no client is connected |
| `SessionCompleted` | A→UI | `{ sessionGuid, sessionId?, exitStatus, tier, finalize, reason, gameId?, gameName? }` — UI loads the full row from SQLite; `sessionId` is null and `finalize` is `discarded` when the row was not stored (under the minimum length), or `game_removed` when its entry was removed with its sessions while it ran (2026-09-23), or **`faulted` when the session's task threw before it could finalize** (2026-09-23: it follows the `CaptureError SessionFaulted`, with `exitStatus` `interrupted` and `reason` `SessionFaulted`, so the live card and the tray let go of a session that no longer runs; the `.partial` stays for recovery); `exitStatus` is the row's vocabulary (`normal` · `crashed` · `unhooked_safety` · `degraded`); `reason` is the loop's `SessionEndReason`. **`gameId` / `gameName` added 2026-09-23, optional:** the entry the session was stored under — the finalizer's owner when it re-keyed a session whose entry was removed, else the one it started under — so the notice names the session that completed, not whatever the live card last showed |
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff }` — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff, guardReason? }` — **`guardReason` (beta.13, optional)** is the guard's own reason when it named a family; `BlockedService` / `BlockedDriver` is a finding on the PC, not in the game, and the notice says so (§S23-3); `reason` stays the session's end reason — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
| `CaptureDegraded` | A→UI | `{ sessionGuid, from: 1, to: 2, reason }` — Tier 1 → Tier 2 mid-flight, or overlay self-disabled. **Under a two-rung ladder this means measurement STOPPED**, not that it continued at lower fidelity, and the notice must say so. *(Built: `SupervisionLost`, `WriterSelfDisabled`, `WriterStoppedBlocklisted`, `WriterNeverInstalledHooks`, `SupervisionFaulted`, `KillSwitchEngaged` — `RecordedSessionEvents.Classify` is the table.)* |
| `SafetyUnhook` | A→UI | `{ sessionGuid, family?, signal?, hookingTurnedOff }` — anti-cheat appeared mid-session; prominent UI notice; `hookingTurnedOff` as on `CaptureRefused`. *(Built: the verdict that FIRED, not the pass that started the session — `CaptureOutcome.Verdict` carries the supervisor's last verdict on this reason since 2026-09-13.)* |
| `SafetyUnhook` | A→UI | `{ sessionGuid, family?, signal?, hookingTurnedOff, guardReason? }` — `guardReason` as on `CaptureRefused` (beta.13) — anti-cheat appeared mid-session; prominent UI notice; `hookingTurnedOff` as on `CaptureRefused`. *(Built: the verdict that FIRED, not the pass that started the session — `CaptureOutcome.Verdict` carries the supervisor's last verdict on this reason since 2026-09-13.)* |
| `HookingTurnedOff` | A→UI | `{ gameId, gameName?, reason, family?, signal? }` — **since 2026-09-25 (beta.8):** the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) found anti-cheat in a game whose hooking the user had turned on, and turned it off. Not a session event — no session is running — so the UI's notice carries no "record without measuring" action, only Dismiss (`SafetyNoticeKind.HookingOff`). A finding on a game whose hooking was already off sends nothing: its page and its library card change, nothing the user switched on did. Additive: a client that does not know the type ignores it (§Versioning). |
| `CaptureError` | A→UI | `{ sessionGuid?, code, message }` — `InjectFailed`, `RingVersionMismatch`, `AttachRefused`, ~~`EtwAccessDenied`~~ (struck 2026-09-13 with the tier), ~~`PresentMonMissing`~~ (retired with the tool, 2026-08-27 — a code naming an implementation nobody chose), `TelemetryUnavailable`, `DbWriteFailed`, `SessionFaulted` (the session's task threw before finalize; the `.partial` stays for recovery, and ~~no `SessionCompleted` follows~~ a `SessionCompleted` with `finalize: faulted` follows since 2026-09-23). *(Built: `RingVersionMismatch` for a layout / record-size / build-id refusal — the "restart the game after an update" case — `AttachRefused` for the rest of the ring's refusals, `InjectFailed` for a target that could not be started, pinned, read or singled out.)* |
| `Ping`/`Pong` | ~~both~~ UI→A | 15 s keepalive, **client-driven** (built 2026-09-13): the client pings, the Agent answers; the Agent initiates nothing on an idle connection |
+41 -1
View File
@@ -138,6 +138,18 @@ The Menu sits in its own row **below** the TitleBar (never inside the drag regio
> `SafetyNoticesTests` (the three kinds, the sentence per refusal reason, the strip for errors, nothing for a
> session event, dismiss only by the user).
>
> **On this PC, not in this game — beta.13 (§S23-3).** A driver or a service is found machine-wide: while Easy
> Anti-Cheat's service runs for another title, every game refuses with `BlockedService`, and the notice said the
> family "was detected in this game". The events carry the guard's own reason (`guardReason`, `07_IPC`), and a
> `BlockedService` / `BlockedDriver` refusal reads `Safety_Refused_MachineWide_Format` ("… is running on this PC (…): a
> driver or service, which may belong to another game or program …"), an unhook `Safety_Unhooked_MachineWide_Format`,
> and the summary's Tier-2 reason `Summary_Tier2_Why_MachineWide_Format`; a module, a title list or a file in the game
> still reads "in this game". `Safety_Unhooked_Format` lost "will not inject into this game again until you enable it
> again", untrue both ways since 2026-09-22 (a machine-wide finding turns no hooking off; a finding about the game turns
> it off for good, which `Safety_HookingTurnedOff` then says). Without a `guardReason` — an older Agent — the notice
> reads as before. Tests: `SafetyNoticesTests.AServiceOrDriverIsOnThisPcAndAModuleIsInThisGame`,
> `…AnUnhookSaysWhereTheFindingWasAndPromisesNoReEnable`, `Tier2ReasonTests`.
>
> **Corrected 2026-09-14, after the owner saw a red bar with no way out.** WPF UI 4.3.0's `InfoBar` template has
> **no `ContentPresenter`**, so the action button above — placed as the InfoBar's Content, the only dismissal once
> `IsClosable="False"` removed the X — was never rendered. The view model was right and the screen was wrong.
@@ -540,6 +552,16 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
> `PagesLoadTests`.
### Settings
> **beta.14 (owner request 2026-10-05: "an option to hide the scroll bars but still scroll").** The Window section has
> **Hide scroll bars** (`ui.hide_scrollbars`, off by default). A bar's visibility is bound inside its scroller's template,
> which no style reaches, so `Services.ScrollBarHiding` sets the scrollers themselves: one class handler on
> `ScrollViewer`'s Loaded (registered at start beside `DialogKeyboard`) reaches every scroller the App shows, those inside a
> DataGrid, a TextBox, a rendered document and a dialog included. While on, an axis that is `Auto` or `Visible` becomes
> `Hidden` — WPF's "no bar, still scrolls": wheel, keyboard and touch — and its own value is kept on it; a `Disabled` axis is
> never touched (it lays its content out at the viewport's width). The toggle applies to the open windows at once, and off
> puts every kept value back. Tests: `ScrollBarHidingTests` (on hides every bar and the wheel still scrolls; off restores
> each; a scroller that loads later follows), `SettingsViewModelTests.HidingScrollBars…`.
> **beta.11 (owner request 2026-10-03: "remove the Settings rows that have no button or similar").** Every row has a control
> now: the *Games with hooking on* card shows only while a game has hooking on (its empty sentence is gone); the *Elevation*
> card is gone and its state is the third line of *Run the agent as administrator* (its explanation a tooltip on it); the
@@ -587,7 +609,7 @@ Agent section: elevation state with a plain explanation of what elevation *optio
> `Infrastructure.Startup.RunAtLogon` — this user's `HKCU\…\Run` value, quoted executable path, never HKLM —
> and the Run entry is the truth the toggle loads from; "Minimize to tray on close" is stored now and honoured
> when the tray exists. **Privacy:** ~~`privacy.online_metadata`, off by default, with the network sentence~~ — the card is not shown since 2026-09-16 (no code makes the request; the setting stays reserved).
> **Updates:** `update.channel` is read by PR-5's updater (beta = GitHub pre-releases), and `update.auto_check` — the startup check, on by default — sits beside it. **Logging:** `log.debug` moves this app's `LoggingLevelSwitch` at
> **Updates:** `update.channel` is read by PR-5's updater (beta = GitHub pre-releases; since beta.14 *Automatic (Beta)* or *(Stable)* first, the default, following the running copy — D47), and `update.auto_check` — the startup check, on by default — sits beside it. **Logging:** `log.debug` moves this app's `LoggingLevelSwitch` at
> once; the Agent has no reader for the key yet, and the row says so. **Legal:** reopen is a "not yet" line
> until PR-9's gate exists. ~~Register/Unregister the layer, Register/Repair/Remove the task~~ — PR-8b, with the
> Agent flags they need. Tests: `SettingsViewModelTests` (seven cases), `RunAtLogonTests` (Infrastructure, under
@@ -664,6 +686,12 @@ Agent section: elevation state with a plain explanation of what elevation *optio
- Keyboard: ~~NavigationView items Ctrl+1…5; grids fully navigable; Esc closes flyouts/dialogs~~ — §Accessibility below, since P4 PR-8 (2026-09-15); this bullet named three behaviours and none of them was built or checked.
- No blocking dialogs during capture; errors surface as InfoBars/tray toasts.
- Charts and stat numbers use culture-aware formatting per active UI culture (09); colors only from theme resources or the per-theme chart palette (16 §ScottPlot).
- **The mouse wheel scrolls whatever is under the pointer (beta.14).** Every page scrolls itself
(`ScrollViewer.CanContentScroll="False"` on the `Page` — `16_WPFUI_SYNTAX` §Gotchas: until beta.14 the wheel scrolled
nothing on five pages, and the Logs tail did not follow the newest line); a scroller nested in a dialog hands the wheel
on at its ends (`ui:PassiveScrollViewer`); over a chart a plain wheel scrolls the page and **Ctrl+wheel zooms the chart**
(`Charts/ChartWheel`, every plot through `ChartTheme.Attach`) — drag still pans and double-click still resets, as
ScottPlot does. The import checklist scrolls inside its list and nowhere else, so its intro and its count stay put.
## Accessibility
@@ -731,6 +759,18 @@ palette per theme, chosen with the theme).
> primary text, ≈ 12:1) but **clipping** — the pill sat in a star column with no trimming, so a sentence-length
> qualifier overflowed the row. The qualifier text trims with an ellipsis at 260 px (the readout's tooltip carries the
> full sentence), and the row's readout column is sized to content with the game's name trimming first.
>
> **A third hole, closed 2026-10-05 (beta.14; the owner's screenshot of File ▸ Import library in the dark theme: every
> row white, its text invisible, each tick box a sliver).** A style `BasedOn="{StaticResource {x:Type DataGridRow}}"`,
> added in beta.11 to dim the rows already in the library: WPF UI 4.3.0 keys its row style `DefaultDataGridRowStyle`
> and defines no implicit one, so the lookup fell through to Aero2's row and its `SystemColors.WindowBrush` — a white no
> theme reaches, under the dark theme's white text. No `#` in our XAML, no palette badge: neither check above could see
> it, and light-theme rows read fine. The tick boxes were WPF UI's `CheckBox` (`MinWidth` 120, padding 11) in a 40 px
> column. Held three ways: `AccessibilityTests.NoStyleIsBasedOnAnImplicitStyleTheThemeDoesNotDefine` (every `BasedOn`
> type has a style in the App's dictionaries), `ImportReviewRenderTests` (the rendered dialog, both themes: every cell's
> text against the composited colour painted under it ≥ 4.5:1, each ticked box drawn whole), and
> `AccessibilityTests.NoDataGridCheckBoxColumn` (Compare's checkbox column drew an Aero2 box). Each went red on the
> unfixed XAML before it went green.
### DPI
+51 -2
View File
@@ -1,6 +1,6 @@
# 11 — Updater
Velopack, feeding from GitHub Releases of `https://github.com/poli0981/frameledger`. ~~Stable channel only in v1.~~ *(Corrected 2026-10-04: two channels since P4 PR-5 — `update.channel`, stable by default or beta, which adds pre-releases. Every release so far is a pre-release; see §Built, Channels.)*
Velopack, feeding from GitHub Releases of `https://github.com/poli0981/frameledger`. ~~Stable channel only in v1.~~ *(Corrected 2026-10-04: two channels since P4 PR-5 — `update.channel`, ~~stable by default~~ or beta, which adds pre-releases. Every release so far is a pre-release; see §Built, Channels.)* *(Corrected 2026-10-05: the default is `auto` since beta.14, which follows the running copy — §The update audit, beta.14.)*
## Flow
@@ -29,7 +29,12 @@ All update HTTP goes through one `GitHubHttpClient` (also used by rules updates)
Binaries are not code-signed (project policy). Consequences and mitigations, documented in README and the update dialog footer:
- SmartScreen warning on first run of a new version — expected; SHA-256 checksums (`SHA256SUMS.txt`) published with every release; CI prints them into release notes.
- ~~Velopack delta packages reduce download size; full package fallback automatic.~~ *(Corrected 2026-10-04: no delta has been published — `release.yml` never puts the previous release in `out/release` before `vpk pack`, so every update downloads the full package; a delta needs a `vpk download github` step first.)*
- ~~Velopack delta packages reduce download size; full package fallback automatic.~~ *(Corrected 2026-10-04: no delta has been published — `release.yml` never puts the previous release in `out/release` before `vpk pack`, so every update downloads the full package; a delta needs a `vpk download github` step first.)* **Built in beta.13:**
`release.yml` downloads the previous release into `out/release` before `vpk pack`, so a release carries
`FrameLedger.App-<version>-delta.nupkg` beside the full package; the previous full package is moved out (neither uploaded
nor checksummed) and the feed lists this build alone, as `vpk upload github` would write it. Velopack applies the delta
when the installed copy is the previous release and falls back to the full package otherwise — `0.1.0-beta.13` is the
first release with one, so beta.12 → beta.13 is the first update that can use it (owner-only: HANDOFF item 10).
- Never bypass or suppress OS warnings programmatically.
## Versioning
@@ -106,6 +111,50 @@ flow, and the tests run the flow over a fake client because nothing here may tou
longer claims the updater provides one.
- ~~Release notes are rendered as plain text, not Markdown.~~ Corrected 2026-10-03: rendered since beta.12 (Markdig; HTML off, no image fetched).
## The update audit, beta.14 (owner request 2026-10-05: "check the update logic")
No failure had been reported; the audit read the flow above against Velopack 1.2.0 and the owner's own updater log
(`%LOCALAPPDATA%\velopack\velopack_FrameLedger.App.log`, read-only) and found two defects that made the flow above
partly fiction, and six smaller ones. Each is fixed in place:
- **A copy left on its defaults never found an update.** `update.channel` defaulted to `stable` while every release is a
GitHub pre-release; the owner's log reads "No releases found" from the day their ledger (and its settings row) was reset.
**Owner decision D47:** the default is `auto`, which follows the running copy — a pre-release asks for pre-releases, a
release for releases (`Update/UpdateChannelPolicy`, SemVer's `-` before any `+`) — and a stored `stable` or `beta` is the
user's choice and wins. Settings shows *Automatic (Beta)* or *(Stable)* first. Only an explicit selection ever wrote the
row (`SettingsViewModel.Persist` is guarded while loading), so existing copies with no row move to `auto`.
- **Velopack applied a downloaded update at the next start, behind FR-12.** `VelopackApp` applies a package waiting in
the install folder on startup unless told not to (`SetAutoApplyOnStartup`, ON by default), and the startup check
downloads in the background — so the next start of `FrameLedger.exe` (the Start menu, the logon Run value, a second
click, `--diag`) applied it inside `VelopackApp.Run()`, before the single-instance claim, before FR-12 could ask
whether a session runs, and before the Agent was asked to stop; its updater killed the Agent instead (the owner's log:
"Auto apply is true, so restarting to apply update…", then "Killing process: …FrameLedger.Agent.exe"). Off now
(`VelopackHooks`, pinned by `VelopackHooksTests` through the builder's private fields); a package an earlier run left
is adopted at start — `UpdateService.AdoptPending`, from `UpdateManager.UpdatePendingRestart`, no feed request — and is
Ready or Deferred like any other.
- **An update Velopack starts itself** (the installer run over an installed copy) asks the Agent to stop first, as the
uninstaller does (`OnBeforeUpdateFastCallback`, 15 s budget, a line in `logs\update.log`). The hook runs in the
version being replaced, so it first works for the update after beta.14.
- **The apply waits while a game still has the Overlay loaded** from the install folder (`Update/PayloadInUse`: a mapped
image refuses an exclusive write — a file-system question, no process opened). The Overlay is never unloaded from a
live game (`17_HOOK_ENGINE`), so after a mid-game stop the swap would fail half way after the App had quit. Asked before
the Agent is stopped; the strip names the file.
- **An Agent waiting on the administrator prompt** (the logon task's, the admin mode) holds only its elevation marker, not
the instance lock; the apply now waits for either (`UpdateService.AgentHolds`).
- **The stop budget is the Agent's own shutdown grace and five seconds** (`IpcProtocol.AgentShutdownGrace`, 15 s, which
the Agent's host now reads too): the App waited 10 s for an Agent that took up to 15 to finalize its sessions.
- **The offer says the download Velopack will make:** the deltas from the installed version when the feed has them
(`UpdateInfo.DeltasToTarget`; 1.6 MB for beta.12 → beta.13) and the full package as the fallback — it said ~102 MB.
Velopack's own lines are in the App's log since beta.14 (`velopack: …`, `VelopackSerilogLogger`), so whether a delta
or the full package came is in the bug report too.
- **Smaller:** an `IOException` is "offline" only from the network (`HttpIOException`, a socket error) — a full disk
read as offline; the uninstaller removes the "Start FrameLedger with Windows" Run value, which named an executable it
deletes.
**What none of this reaches:** a copy still on 0.1.0-beta.13 or older runs its own code for the update to beta.14 —
stable by default, apply-at-start on. Its user chooses *Beta* in Settings ▸ Updates and updates with no game running
(the beta.14 release notes say so); everything above holds from beta.14 on.
`UpdateServiceTests` (App.Tests/Update) cover the two skips, the channels, Deferred ↔ Ready, each error row, and
the apply's three endings; `UpdateFailureMapperTests` the table; `UninstallHookTests` the hook; ~~a real feed has
not been exercised — the first tag is the measurement~~ *(corrected 2026-10-04: the feed has existed since
+31 -5
View File
@@ -44,7 +44,7 @@ Compiler/linker flags (enforced in CMake, not per-target ad hoc): `/std:c++20 /M
**No AMD or Intel GPU *telemetry* SDK is vendored.** Those vendors' sensors are covered by LibreHardwareMonitor and the DXGI/PDH baseline (`18_GPU_VENDOR_APIS`). A build that pulls in Intel IGCL or AMD ADLX material is a licensing regression, not a feature — CI greps for it. **The AMD FidelityFX ffx-api headers (MIT by exception, tag v2.3.0) ARE vendored since 2026-09-04**, for the Overlay's upscaler hook and for types only — `fl_fidelityfx_headers` above, `18_GPU_VENDOR_APIS` §AMD for the licence reading, and `license-check.ps1` §2d for the per-file gate. Intel's XeSS SDK failed the checklist and nothing of it is here.
**VERSIONINFO is mandatory** on ~~`FrameLedger.Overlay.dll` and `FrameLedger.VkLayer.dll`~~ every shipped native — the five `tools/versioninfo-check.ps1` lists (corrected 2026-10-04): real `CompanyName`, `ProductName=FrameLedger`, `FileDescription`, version. Identifiability is a requirement (`19_SAFETY`), and a CI check fails the build if the resource block is missing.
**VERSIONINFO is mandatory** on ~~`FrameLedger.Overlay.dll` and `FrameLedger.VkLayer.dll`~~ every shipped native — the five `tools/versioninfo-check.ps1` lists (corrected 2026-10-04): real `CompanyName`, `ProductName=FrameLedger`, `FileDescription`, version. Identifiability is a requirement (`19_SAFETY`), and a CI check fails the build if the resource block is missing. **Since beta.14 (D50) the managed binaries are held to the same** — §Version, *Identity*.
## Managed build & native integration
@@ -170,6 +170,29 @@ two products claiming to be one.
- `release.yml` refuses a tag whose numeric core is not the file's. Bumping the version is one edit to
`VERSION`, in the same commit as the changelog section, before the tag.
**Identity (beta.14, D50).** Every binary names the product, says what it is and carries one copyright line. Until
beta.14 only the native blocks did: the managed ones carried the SDK's defaults — the Agent's company and product read
`FrameLedger.Agent`, each library's its own assembly name — and no copyright, and those blocks are what Explorer's
*Properties ▸ Details* and Task Manager show (Task Manager lists the Agent by its file description).
| Field | Native (`src/native/CMakeLists.txt`) | Managed (`Directory.Build.props`, the two entry points' csproj) |
|---|---|---|
| CompanyName, ProductName | `FL_COMPANY_NAME`, `FL_PRODUCT_NAME` = `FrameLedger` | `Company`, `Product` = `FrameLedger` |
| LegalCopyright | `FL_COPYRIGHT` | `Copyright` — the same line, word for word |
| FileDescription | each target's `fl_add_version_resource` description | `AssemblyTitle`: `FrameLedger` (App), `FrameLedger Agent` (Agent); a library keeps its assembly name |
| Comments | the identification sentence | `Description` — the same sentence for a library, a line of its own for each entry point |
| FileVersion / ProductVersion | the numeric core, `x.y.z.0` | `x.y.z.0` / the full version (`-p:Version`, a pre-release's tag included) |
| OriginalFilename | the file's own name | the assembly's (`FrameLedger.dll`) — the apphost `.exe` carries a copy of its assembly's block |
Also stamped on every assembly: `AssemblyMetadata("RepositoryUrl")` (the SDK, from `RepositoryUrl`; the App test holds
it equal to `IssueLink.Repository`) and, when `release.yml` passes it, `FrameLedgerSourceRef` — the App csproj's alone
until beta.14, now `Directory.Build.props`', and passed to both publishes. `tools/versioninfo-check.ps1` reads all of it
from the BUILT binaries — the native five and, with `-ManagedDir`, the managed eight (`FrameLedger.exe`/`.dll`,
`FrameLedger.Agent.exe`/`.dll`, Domain, Application, Infrastructure, Shared) — and is red when a copyright differs
anywhere, when a managed `ProductVersion` is not `-ExpectedProductVersion` (required: a comparison with nothing passes
everything), or when an apphost does not carry its assembly's block; its `-SelfTest` (ten cases, nine RED, each for the
reason it names) runs first. `AssemblyIdentityTests` (App and Agent) pins the source against `FL_COPYRIGHT`.
The Velopack package version is the tag's (`vpk pack --packVersion`), and `UpdateManager.CurrentVersion` reads
the installed package's manifest — not the assembly — which is why the two are made to agree here rather than
assumed to.
@@ -179,7 +202,8 @@ assumed to.
```
cmake --build --preset x64-release
dotnet publish src/FrameLedger.App -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:FrameLedgerSourceRef={tag} -o out/app
dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -o out/app
dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:FrameLedgerSourceRef={tag} -o out/app
vpk download github --repoUrl https://github.com/poli0981/frameledger --channel win --pre --outputDir out/release # beta.13: the previous release, for a delta
vpk pack --packId FrameLedger.App --packVersion {ver} --packDir out/app --mainExe FrameLedger.exe --packTitle FrameLedger --packAuthors FrameLedger --releaseNotes out/notes.md --outputDir out/release
```
@@ -188,7 +212,9 @@ vpk pack --packId FrameLedger.App --packVersion {ver} --packDir out/app --mainEx
> take `-p:Version=<tag>` (§Version). No `--icon`: `assets/icon.ico` does not exist, and this line named it
> for six weeks. **Since beta.12 the App also takes `-p:FrameLedgerSourceRef`** — the tag, or for a rehearsal the
> commit — stamped as assembly metadata so its links into the repository open THIS version's documents
> (`Services/RepositoryLinks`); a build without it links to `main`.
> (`Services/RepositoryLinks`); a build without it links to `main`. **Since beta.14 the Agent takes it too**, because
> `Directory.Build.props` stamps it on every assembly and both publishes build the same libraries into `out/app` (§Version,
> *Identity*).
>
> **The package id is `FrameLedger.App`, and this line said `FrameLedger` until 2026-09-14 — which would have
> deleted every user's ledger on uninstall.** Velopack installs into `%LOCALAPPDATA%\<packId>` and removes that
@@ -223,7 +249,7 @@ vpk pack --packId FrameLedger.App --packVersion {ver} --packDir out/app --mainEx
- No trimming (WPF + reflection), no NativeAOT (WPF unsupported), **no obfuscation** (GPLv3 policy, and `19_SAFETY` forbids making our binaries harder to identify).
- `SatelliteResourceLanguages=en;vi;ja`. ~~Expected package ≈ 95–130 MB self-contained.~~ **Measured 2026-09-14 (P4 PR-5): the published tree is 250 MB in 362 files** (App + Agent, self-contained, ReadyToRun roughly doubles the IL). `vpk pack` 1.2.0 over that tree, run by hand the same day with the workflow's arguments: `FrameLedger.App-win-Setup.exe` **104 MB**, the full `.nupkg` and the portable zip 100 MB each, plus `releases.win.json` / `RELEASES` / `assets.win.json`; vpk's own pre-process step verified `VelopackApp.Run()` in `FrameLedger.App.Program::Main()`. **From the hosted runner on the first tag (2026-09-16, `v0.1.0-beta.1`):** the tree 252 MB, `Setup.exe` 110 MB, the nupkg and the zip 105 MB — the same shape, a few MB heavier for two more days of code.
- Velopack hooks (**built 2026-09-14, P4 PR-5**: `App/Update/VelopackHooks`, wired in the hand-written `Program.Main` before any window). **Install registers nothing** — the first-run flow is the offer (Agent setup), and the layer follows the ledger (§The Vulkan layer is not registered at install time); this line used to say "offer Agent setup + Vulkan layer registration", and the second half was the thing the section below forbids. Uninstall runs `UninstallHook`: `Shutdown` to a running Agent over the pipe (best effort, it holds the install directory), unregister the layer (HKCU), remove the logon task, then **ask** about the data folder — deleted on Yes only, never when it and the install overlap (`AreSeparate`), and a question unanswered inside Velopack's 30 s callback budget keeps it.
- Velopack hooks (**built 2026-09-14, P4 PR-5**: `App/Update/VelopackHooks`, wired in the hand-written `Program.Main` before any window; since beta.14 Velopack's apply-at-start is off and an update it starts itself stops the Agent first — `11_UPDATER` §The update audit). **Install registers nothing** — the first-run flow is the offer (Agent setup), and the layer follows the ledger (§The Vulkan layer is not registered at install time); this line used to say "offer Agent setup + Vulkan layer registration", and the second half was the thing the section below forbids. Uninstall runs `UninstallHook`: `Shutdown` to a running Agent over the pipe (best effort, it holds the install directory), unregister the layer (HKCU), remove the logon task, remove the *Start FrameLedger with Windows* Run value (beta.14 — it named the executable being deleted), then **ask** about the data folder — deleted on Yes only, never when it and the install overlap (`AreSeparate`), and a question unanswered inside Velopack's 30 s callback budget keeps it.
## Release-time token substitution
@@ -255,7 +281,7 @@ document the app displays for acceptance (FR-11) is a defect, not a template.
7. `tools/coverage-gate.ps1` — reads this run's cobertura reports; self-arming, and armed today for
`FrameLedger.Domain` and `FrameLedger.Application`
8. `tools/rules-validate.ps1` (schema + `anticheat` block sanity — a malformed or empty blocklist is a safety bug)
9. `tools/versioninfo-check.ps1` — reads the built binary, because what ships is what an anti-cheat vendor sees; since P4 PR-5 it also compares every `FileVersion` against the `VERSION` file (§Version)
9. `tools/versioninfo-check.ps1` — reads the built binary, because what ships is what an anti-cheat vendor sees; since P4 PR-5 it also compares every `FileVersion` against the `VERSION` file (§Version); **since beta.14 (D50) both halves run — the self-test, then the native five and the managed eight from the App's and the Agent's build output** (`-ManagedDir`, `-ExpectedProductVersion` = `VERSION`), one copyright across all of them (§Version, *Identity*). Under `-SkipNative` the managed half still runs
10. `tools/chokepoint-check.ps1` — injection and evasion primitives confined to one file, native **and** managed, plus the `FL_GUARD_TESTABLE` symbol check against the shipped artifacts
11. **`tools/hookinventory-check.ps1`** — three passes: A resolves every vendor symbol the Overlay names against `docs/vendor-exports.json`, B sweeps for stray literals, C reads the BUILT Overlay's import table and asserts it imports no vendor module. C skips loudly under `-SkipNative`. **Missing from this list until 2026-08-28**, which is §R10 happening again
12. **`tools/package-closure-check.ps1`** — both halves: the self-test (5 cases, 4 of which must go RED) **and** a live pass over this repository. It walks the transitive `ProjectReference` closure of the two publish roots below and fails on anything outside the allowlist, naming the reference edge. `FrameLedger.CaptureHost` is an injecting entry point kept out of the package by construction, and `20_OPEN_QUESTIONS` §S27 is closed on exactly that basis
+9 -1
View File
@@ -135,7 +135,15 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
- **The published tree asserted by name**: `FrameLedger.exe`, `FrameLedger.Agent.exe`, the ~~four~~ five shipped natives
`versioninfo-check` lists (`FrameLedger.ProcessStats.dll` since beta.12 — corrected 2026-10-04), `rules/detection-rules.json`; `FrameLedger.CaptureHost.exe` absent (`12_BUILD`:
exactly two roots — `package-closure-check` proves it statically, this reads the directory); `versioninfo-check`
run again over `out/app`, because a `.targets`-staged DLL that failed to copy is a warning to `dotnet publish`.
run again over `out/app`, because a `.targets`-staged DLL that failed to copy is a warning to `dotnet publish` —
**since beta.14 (D50) with its managed half** (`-ManagedDir out/app -ExpectedProductVersion <tag>`): the eight managed
binaries name FrameLedger, carry the tag's full version and the native binaries' copyright line (`12_BUILD` §Version,
*Identity*). Both publishes take `-p:FrameLedgerSourceRef` since beta.14.
- **since beta.13, `vpk download github --pre` first**, so `vpk pack` finds the previous release's full package in
`out/release` and writes a delta; after the pack, what `assets.win.json` names is kept and the rest (the previous full
package) moves to `out/previous`, the feed and `RELEASES` are filtered to this build, and a downloaded previous package
with no delta beside it fails the job. A failed download is a warning: the release is full-only, as every one before it
was (`11_UPDATER` §Built).
- `vpk pack --packId FrameLedger.App` (the `vpk` tool pinned to the library's 1.2.0) with the release notes;
`FrameLedger.App-win-Setup.exe` must come out, because README §Install names it. **Not `--packId FrameLedger`**:
Velopack installs into and uninstalls `%LOCALAPPDATA%\<packId>`, which with that id is the data folder
+27 -1
View File
@@ -16,6 +16,13 @@ The anti-cheat guard is the one component where a bug can cost someone an accoun
- **Absence-of-override test:** no code path may reach the injection primitive without a passing guard result. The mechanism previously described here — a `sealed` token type "only the guard can produce" — does not work and was disproved by compiling (`20_OPEN_QUESTIONS` §S8: C# accessibility flows inward, `CS0122`). The replacement is structural: the guard **owns the chokepoint** and calls the primitive itself, the primitive has internal linkage in the guard's own translation unit so no other TU has a symbol to call, and a build-time check asserts that nothing else references it. A token that escapes can be ignored; a symbol that does not exist cannot.
- Static pre-scan: a game directory containing `EasyAntiCheat/` renders `hook_enabled` un-settable; API-level attempt to set it is rejected — including via `SetWatchlist`, which no longer carries hooking state at all (`07_IPC` §The pipe is not a trust boundary). ~~**The toggle half needs persistence and is not built yet**~~ **built in P2/P3**: `SqliteGameConsentStore.RecordGuardBlockAsync` forces `hook_enabled = 0`, `AgentCommandHandler.SetHookEnabledAsync` re-runs the pre-scan and answers `Refused`, and `GameDetailViewModel` disables the toggle on a blocked row (corrected 2026-09-21; since 2026-09-22 a finding at a session's start or at the re-scan writes the same block — `CaptureSessionTests`); the scan itself is ctest `fl_prescan`, whose matrix is mostly fail-closed: a listing that FAILED, one that was TRUNCATED, a directory that could not be established, unusable rules, and a missing evidence source must each be *undetermined*, never clean. Two cases exist only to stop the rest passing vacuously — a genuinely clean directory must be **allowed**, and a name matching the wrong group (a directory named like a `files` entry) must **not** fire. One case removes a family from the rules and asserts the hit disappears, which is what proves there is a single matcher rather than a second one that happens to agree.
> **D48 (beta.14):** the module check's one re-read is held both ways in ctest `fl_guard` `[D48]` — a member still
> loading reads clean on the re-read (one pause, two snapshots); one still unreadable refuses; one that exited drops out of
> the fresh set; a target that exited refuses; `ACCESS_DENIED` is never retried; a finding refuses at once and a finding
> the re-read sees refuses — and against the real source (`[live]`: a process created suspended and a pid with no process
> answer `kRetry`). The managed half — a refused re-scan of a game that has exited ends as its exit, never for a finding —
> is `CaptureSessionTests` and `SessionRecorderTests`.
## Native unit tests (Catch2)
- **Ring buffer:** SPSC correctness under a hammering writer thread; seqlock torn-read detection; wrap and overwrite-oldest semantics; power-of-two capacity assumptions. Include the **one-full-lap case**: a reader stalled exactly `capacity` records must not validate a different frame as unchanged (this is what the never-reset `seq` counter defends, `07_IPC` §Protocol rules).
@@ -44,6 +51,24 @@ The anti-cheat guard is the one component where a bug can cost someone an accoun
- Blob codecs round-trip for every series in `frame_blobs` (NaN forbidden — assert), including the two-pair `render_res` encoding and the three-bit `rt_flags` byte. SQLite migrations apply cleanly from an empty file to the current schema, and re-applying is a no-op. (There is no v1→v2 upgrade to test — `06_DATA_MODEL` §Migrations.)
- IPC pipe: framing, split reads, oversize rejection, unknown fields/types ignored, protocol mismatch.
### What the App draws (beta.14)
A page or dialog that only *loads* has proved nothing about how it looks: `PagesLoadTests` counted the import list's
rows while every row was white text on white in the dark theme (`08_UI` §Contrast). The rendered checks run on the one
STA thread with the App's three dictionaries (`PagesLoadTests.OnStaAsync`) and look at the result: `Visuals` lays a
control out at a window's size, pumps the dispatcher (a `NavigationViewContentPresenter`'s navigation), swaps the theme
dictionary for one check and puts Dark back, and composites every Border and Panel background between a text and the
window into the colour actually painted under it; `Wcag` is the arithmetic. `ImportReviewRenderTests` measures each text
cell against that colour in both themes and counts the accent pixels of each ticked box in a `RenderTargetBitmap`; the
paging checks navigate a real page in WPF UI's presenter and send it the wheel. Each was run red against the unfixed XAML
first — a rendered check that cannot fail is the counted-rows check again.
**A test that sends input must also say which keys are held.** `Keyboard.Modifiers` is the machine's real keyboard, read
from any thread (a fresh background thread's `GetKeyState` reports the machine's NumLock — measured 2026-10-06), so a
wheel test that read it held whatever key a person pressed while the gate ran: `ChartWheelTests`' plain half went red once
on the developer's machine and never on CI. The handlers read `ChartWheel.CurrentModifiers`, which the test sets inside its
own work item on the STA thread and puts back — and with the keys a parameter, the Ctrl half is driven end to end too.
## Integration tests (CI-runnable, no game, no anti-cheat surface)
`hook-harness` is what makes this architecture testable without touching a real title:
@@ -131,7 +156,8 @@ that it was checked against anything.
| Mode | launch mode · attach mode · mid-session settings change |
| Safety | game with anti-cheat → toggle disabled · simulated late AC load → unhook · double-crash → auto-disable |
| Tier | forced Tier 2 (records duration, available sensors and the reason — and nothing else) · Tier 1 → Tier 2 degradation notice |
| Update | Velopack delta; update deferred while a game is hooked (FR-12) — *a delta needs a previous release, so this row is reachable from the second release, not the first* *(corrected 2026-10-04: no release has carried a delta — `release.yml` never fetches the previous release before `vpk pack`, `11_UPDATER` §Built — so the update leg is a full package)* |
| Update | Velopack delta; update deferred while a game is hooked (FR-12) — *a delta needs a previous release, so this row is reachable from the second release, not the first* *(corrected 2026-10-04: no release has carried a delta — `release.yml` never fetches the previous release before `vpk pack`, `11_UPDATER` §Built — so the update leg is a full package; **since beta.13** a release carries a delta against the previous one, and the first
update that can use it is beta.12 → beta.13 — HANDOFF owner-only item 10)* |
## Release smoke
+30 -2
View File
@@ -132,9 +132,9 @@ Code-behind wires services once: `navigationService.SetNavigationControl(RootNav
| Busy | `ui:ProgressRing` | |
| Contextual popup | `ui:Flyout` | Popup hand-rolling |
| Hyperlink-ish | `ui:HyperlinkButton`, `ui:Anchor` | |
| Grid of records | native `DataGrid` (WPF UI restyles it) | third-party grids |
| Grid of records | native `DataGrid` (WPF UI restyles it — through the grid's own `RowStyle`/`CellStyle`/`ColumnHeaderStyle` setters, so a local one is based on WPF UI's keyed style: §Gotchas, added 2026-10-05) | third-party grids |
Native `Menu`, `TabControl`, `ComboBox`, `Slider`, `ListView` are fine — the `ControlsDictionary` restyles standard WPF controls to Fluent automatically.
Native `Menu`, `TabControl`, `ComboBox`, `Slider`~~, `ListView`~~ are fine — the `ControlsDictionary` restyles standard WPF controls to Fluent automatically. *(Corrected 2026-10-05: 4.3.0 has no implicit style for the native `ListView`, `ListViewItem` or `GridViewColumnHeader` — only `ui:ListView` is restyled — nor for `DataGridRow`, `DataGridCell`, `DataGridColumnHeader` or `FlowDocumentScrollViewer`; read from the loaded `ControlsDictionary`.)*
## Icons
@@ -227,6 +227,34 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
bar with no exit, which is exactly how the safety notices shipped (2026-09-14). `Styles/FrameLedger.xaml` carries
the upstream template plus one presenter column; `PagesLoadTests.TheInfoBarTemplateRendersItsContent` renders both
templates and turns red when upstream gains a presenter, which is when the copy comes out.
- [ ] **WPF UI 4.3.0 keys its DataGrid parts' styles and defines no implicit one** (`DefaultDataGridRowStyle`,
`DefaultDataGridCellStyle`, `DefaultDataGridColumnHeaderStyle`, handed to the grid by its implicit `DataGrid` style's
`RowStyle`/`CellStyle`/`ColumnHeaderStyle` setters). A local `RowStyle` replaces WPF UI's; based on
`{StaticResource {x:Type DataGridRow}}` it falls through to Aero2's row, whose `SystemColors.WindowBrush` no theme
reaches: the import list was white text on white in the dark theme (owner's screenshot, beta.14). Base it on
`DefaultDataGridRowStyle`. `AccessibilityTests.NoStyleIsBasedOnAnImplicitStyleTheThemeDoesNotDefine` refuses any
`BasedOn` a type the App's dictionaries hold no style for, and `ImportReviewRenderTests` measures the rendered rows.
- [ ] **WPF UI's `CheckBox` is `MinWidth` 120 with an 11 px padding**: in a narrow grid column it draws a sliver of the box.
`MinWidth="0" Padding="0"` there. A `DataGridCheckBoxColumn` uses WPF's own element style, an Aero2 box — use a template
column (`AccessibilityTests.NoDataGridCheckBoxColumn`).
- [ ] **Every page sets `ScrollViewer.CanContentScroll="False"`.** `NavigationViewContentPresenter` changes that property's
default to true for `Page` and, on each navigation, wraps a page that keeps it in a `DynamicScrollViewer`. A page with
its own root `ScrollViewer` inside that wrapper has infinite height, nothing to scroll — and a stock `ScrollViewer`
marks every wheel handled even then, so the wheel scrolled nothing on five pages until beta.14 (owner: "I have to drag
the scroll bar"); the Logs tail grew to hold every line and never followed the end.
`AccessibilityTests.EveryPageOptsOutOfTheDynamicScrollViewer`, `PagesLoadTests.ANavigatedPageIsNot…`.
- [ ] **A stock `ScrollViewer` nested in a scroller takes the wheel at its ends too.** Inside a dialog use
`ui:PassiveScrollViewer`, which hands the wheel on when it cannot scroll (`AccessibilityTests.NoPlainScrollViewerInsideADialog`).
A `ContentDialog` whose content should not scroll as a whole sets `ScrollViewer.VerticalScrollBarVisibility="Disabled"`
on the dialog: its content row then has the window's height, and a `*` row inside it can hold a list that scrolls alone
(`ImportReviewPrompt`).
- [ ] **ScottPlot 5 zooms on every wheel and never marks it handled.** Without `Charts/ChartWheel` a wheel over a chart
zoomed it and scrolled the page at once; a plain wheel is the page's, Ctrl+wheel the chart's, for every plot that
`ChartTheme.Attach` registers.
- [ ] **A scroll bar's visibility is bound inside its scroller's template** (`ComputedVerticalScrollBarVisibility`), so a style
on `ScrollBar` or `ui:DynamicScrollBar` cannot hide it. Set the scroller's own `ScrollBarVisibility` to `Hidden` — no
bar, and the wheel, the keyboard and touch still scroll (`ui:PassiveScrollViewer` treats only `Disabled` as "cannot
scroll") — as `Services.ScrollBarHiding` does for `ui.hide_scrollbars` (beta.14).
- [ ] **No dialog in 4.3.0 closes on Esc.** Neither `ContentDialog.cs` nor `MessageBox.cs` at the 4.3.0 tag handles a
key (read 2026-09-15), and `ContentDialog.CloseButtonText` DEFAULTS to "Close" — an empty string is how a dialog
says it has no Close button. `MessageBox.Close()` is `[Obsolete("Use Close with MessageBoxResult instead")]` while no
+9 -1
View File
@@ -57,7 +57,15 @@ Implementations compose rather than compete:
> nothing calls `SelectAdapter` outside tests. L1 stays on the first hardware adapter in DXGI's high-performance order,
> as `HardwareSnapshotSource` does, and the handshake's `adapterLuid` is read by no managed code — so on a
> multi-adapter machine L1 can describe an adapter the game did not present on. The game's own memory, D43, is
> summed over every adapter and is not affected.)* Every
> summed over every adapter and is not affected.)* **Built in beta.13:** the recorder hands the handshake's
> `adapterLuid` to the poller at the first tick that carries one (`CaptureProgress.AdapterLuid`, noted in the
> `.partial`), and `CompositeTelemetrySource.SelectAdapter` points L1 at it (`IGpuAdapterSelector`) and tells the layers
> that read their own GPU its vendor (`IGpuVendorFollower`): L2 maps that vendor's GPU node instead of the first one
> LibreHardwareMonitor lists (on a laptop often the integrated GPU), and L3 contributes nothing when the game's adapter
> is not NVIDIA's — N/A rather than another card's temperature. **What stays first-found:** a session before the game's
> first present, a Tier-2 session (no handshake), a game presenting through OpenGL or Vulkan (they publish no LUID), two
> GPUs of one vendor (L2 and L3 take that vendor's first), and the session's hardware snapshot
> (`HardwareSnapshotSource`, taken before the first present). Every
> poller sample is stamped with QPC (`TelemetrySample.QpcTicks`), the ring's clock, and
> `QpcClockTests` pins `Stopwatch` / `TimeProvider.GetTimestamp` to the real counter.
+28 -1
View File
@@ -22,7 +22,7 @@ These are permanently out of scope. A PR implementing any of them is rejected re
- Reading or writing game memory outside the arguments of APIs we hooked
- Kernel drivers of our own
The DLL ships with its real filename, a populated VERSIONINFO block (`CompanyName`, `ProductName=FrameLedger`, version), and named kernel objects that clearly say `FrameLedger`. Being identifiable is a feature.
The DLL ships with its real filename, a populated VERSIONINFO block (`CompanyName`, `ProductName=FrameLedger`, version), and named kernel objects that clearly say `FrameLedger`. Being identifiable is a feature. Since beta.14 (D50) the Agent — the process that injects — and the App say the same about themselves: `FrameLedger` as company and product, *FrameLedger Agent* as the Agent's description, the native binaries' copyright line (`12_BUILD` §Version, *Identity*; `tools/versioninfo-check.ps1` reads both kinds).
## The anti-cheat guard (hard gate)
@@ -51,6 +51,19 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
> handle rights above are confirmed sufficient for every target this call can
> legitimately reach.
>
> **Amended 2026-10-05 (owner decision D48, beta.14): one re-read, never a pass.** A member of the scan set that
> is still being created answers `ERROR_PARTIAL_COPY` (its loader has not built a module list), and one that exited
> between the snapshot and the open answers `ERROR_INVALID_PARAMETER`. Both refused the whole session — and at the
> 30 s re-scan an engine's crash reporter starting as its game died, or any helper started a moment before the scan,
> turned an ordinary exit into a "safety" unhook, which ends a user-mode exception's trial for good. Such a member
> (`Collected::kRetry`, `fl_guard.h`) is now read once more: the pass finishes (a finding in any member still refuses
> at once), waits `kScanRetryPauseMs` (250 ms), takes a **fresh** scan set and scans it whole. A member still unreadable
> then refuses `kProcessUnreadable`, as before; one that has gone is not in the new set; a target that has gone leaves
> no set, which refuses `kProcessTreeUnavailable`. **`ERROR_ACCESS_DENIED` — a protected process — is never retried**,
> and no other answer of any source is. The sentence above stands: every failure still means REFUSE; what changed is
> how many times "still loading" is asked before it counts as one. ctest `fl_guard` `[D48]` holds both directions,
> against fakes and against the real source (a process created suspended, a pid with no process).
>
> **Launch mode (2026-09-06, P1 item 2) does not weaken this.** `FlGuardedInjectWhenReady` polls
> the same enumeration to learn *when* the launched target has mapped a presentation runtime, and a
> failing enumeration there means "not yet" — the poll continues. That is not a pass: the poll
@@ -836,6 +849,15 @@ checked stays untrusted and refuses — that direction is deliberate.
Re-run **every pre-injection check** every 30 s, for **every Tier-1 session —
injected or layered**.
> **A refused re-scan of a game that has already exited is that exit (owner decision D48, beta.14).** When the re-scan
> refuses only because it could not read the game's tree (`ProcessUnreadable`, `ModuleScanFailed`,
> `ProcessTreeUnavailable` — never a finding) and the game itself has exited by the time the session concludes, the
> session ends as `TargetExited`, its exit code deciding normal or crashed, with `scan_at_exit=<reason>` in its notes
> (`Application.Capture.ExitScanRelabel`). The stop was still published to the Overlay — the game it would have stopped
> is gone. A finding, any refusal while the game still runs, and a refusal of another check (drivers, services, the
> pre-scan) are a safety unhook exactly as before. `CaptureSessionTests.AnUnreadableRescanOfAGameThatHasExited…` and
> its three refusing neighbours.
> **This said "both the module scan and the driver scan" until 2026-08-05, and
> the loop runs four checks, not two** (`20_OPEN_QUESTIONS` §S23-4).
> `FlGuardEvaluate` → `EvaluateImpl` runs `CheckDrivers`, `CheckServices`,
@@ -1078,6 +1100,11 @@ outlives a rules change, a game update and *Change executable*; §What a finding
## Crash & stability safety
- Two crashes of the same game within 60 s of injection ⇒ hooking auto-disabled for that game, UI explains, Tier-2 takes over. Recorded in `games.hook_autodisabled_reason`. *"Crash" here is any abnormal end: since beta.8 a session whose exit code is not an exception's (End task's 1) is `normal` on its row, and this policy still counts it inside the window — a hang our hook caused, ended by the user, is the case it exists for. The row's reason says "ended abnormally twice within 60 s of injection" (`04_CAPTURE` §Crash & exit classification).*
- **What reads as a crash changed in beta.14, in both directions** (`04_CAPTURE` §Crash & exit classification): a
Windows report that is not a crash (a memory-leak or hang report) no longer makes one, and an engine's crash reporter
started by a game that then left does — Unreal's crash ended with exit code 3 and read `normal`. Both feed this policy,
the D33 lapse and D38's trial as `crashed` always has: an Unreal game that crashes under a user-mode exception ends it
now, where before beta.14 the crash went unseen; a leak report no longer ends one.
- The Overlay DLL self-disables after 3 faults in hook bodies (`17_HOOK_ENGINE` §Fault policy) and reports it.
- Every hooked session writes a breadcrumb file before injection~~; if the game process dies before the first frame record arrives, the next run is recorded as suspect~~ *(corrected 2026-10-04: no "suspect" mark exists; the breadcrumb is the `.partial` file, and an early death counts toward the two-within-60-s auto-disable above)*.
+3 -3
View File
@@ -116,7 +116,7 @@ or it becomes the next stale status claim this file exists to record.
| **S19(c)** | ✅ **resolved 2026-09-06** | The fields are constants the schema pins and the guard never reads, because the policy is code by CLAUDE.md rule 2 and `19_SAFETY`; `rules-validate` now proves the schema rejects `action: "allow"` and `signerField: "CN"` (canary 3), so the data cannot say otherwise |
| **S19(d) residual** | ✅ **resolved 2026-08-05** | A second canary, **derived from the shipped document** rather than hand-written, carries `nameFragments: []` and must be rejected. The entry's stated consequence was overstated and is corrected in place: the generated floor would not have disappeared, `gen-ac-floor.ps1` hard-errors and the native build fails — what was unguarded is the *schema* half |
| **S20 feed half** | 🅓 **deferred ~~to P4~~, unscheduled — P4 closed without it (corrected 2026-10-04); rationale written 2026-09-06** | **FR-7.3 stays unmet and written as unmet**: the fetch needs a shipped Agent, §S4's signing and the privacy policy's rows, all P4; until then a rules edit ships with the next release, checksum-attested |
| **S23-3** | ~~🅓 **deferred to P3, rationale written 2026-09-06**~~ 🔴 **open: P3 shipped the refusal UI without it** *(corrected 2026-10-04: a machine-wide `BlockedService` / `BlockedDriver` notice still reads "… was detected in this game", `SafetyNotices.RefusalText`)* | `08_UI`'s refusal notice is wrong in the commonest case; the requirement reaches `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI — a string with no view would read as done |
| **S23-3** | ~~🅓 **deferred to P3, rationale written 2026-09-06**~~ ~~🔴 **open: P3 shipped the refusal UI without it**~~ ✅ **closed in beta.13** — the events carry the guard's own reason and a `BlockedService` / `BlockedDriver` notice says the family is running on this PC (`08_UI` §Safety events) *(it was 🔴 from 2026-10-04: a machine-wide notice still read "… was detected in this game")* | `08_UI`'s refusal notice is wrong in the commonest case; the requirement reaches `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI — a string with no view would read as done |
| **S23-5** | ✅ **resolved 2026-08-05** | Closed the way §S23-4 closed the same class — by **removing** the restatement, not correcting it — and `rules-validate` now fails when any `$comment` enumerates checks again. The rule's own first version was scoped to the wrong object and could not fire; it now walks every `$comment` and fails if it finds none |
| **S23-6** | ✅ **closed 2026-09-06** | `license-check` binds `THIRD_PARTY_NOTICES` bidirectionally, and the accuracy blocks are now ONE text — `legal/ACCURACY.md`, embedded verbatim in `README.md` and `DISCLAIMER.md` §4, gated by `tools/accuracy-check.ps1` (self-tested both directions). Truth stays a human's job; drift between copies no longer is |
| **S23-2** | 🚫 **owner only — no PR can close it** | `Rules / validate` is **not** a required status check on `main`. **Re-verified against the live branch protection 2026-08-05**, not repeated from the entry: `required_status_checks.contexts` is exactly `["check", "analyze (csharp, none)", "analyze (cpp, manual)"]` (`strict: true`, `enforce_admins: true`, `required_linear_history: true`). The `validate` job is path-filtered and `pull_request`-only, so a red removal check does not block the merge button. **The gate that exists to make the anti-cheat blocklist un-removable is advisory.** This is a branch-protection setting |
@@ -137,7 +137,7 @@ either work or a rationale written down:
correction. **S30 closed 2026-08-15 and S31 opened 2026-08-20**, and this bullet went on
naming S30 until 2026-08-27 — so the total below stayed right by coincidence rather than
by count.)*
- **three ⏳** — S2 part three, S4 signing, S23-3
- **three ⏳** — S2 part three, S4 signing, S23-3 *(S2 part three built 2026-09-06 and S23-3 closed in beta.13 — noted 2026-10-04; S4 signing stays deferred)*
- ~~two ◐~~ ~~**three ◐**~~ **two ◐ (2026-09-04)** — S14, S23-6. ~~**S31**~~ *(moved out of ❓ on 2026-08-27 when its test landed on row P2; **resolved 2026-09-04** when the token count landed on row P1 with `tokens/batch = 1.00` — the question answered by a second count rather than by an oracle)*
- **one 🔴** — S29, added by the audit that produced this recount; **five of its seven
findings are now closed**, and the residue is (a) the ungated managed drain and (d) the
@@ -3083,7 +3083,7 @@ required contexts are exactly `check`, `analyze (csharp, none)` and
the gate that exists to make the anti-cheat blocklist un-removable is advisory.
Fixing it is a branch-protection change, i.e. the owner's, not a code change.
**3. ~~🅓 Deferred to P3, rationale written 2026-09-06~~ 🔴 Open — P3 built the refusal UI without it (corrected 2026-10-04: `SafetyNotices.RefusalText` formats every named refusal as "… was detected in this game", so the measured case below still reads wrong) — `08_UI` describes a refusal notice that is wrong in the commonest case.** *(The requirement below must reach `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI, and not before: there is no UI to be wrong in yet, and a `.resx` string with no view is the kind of fix that reads as done. The spike log carries the measurement; this line is the reminder.)* It
**3. ~~🅓 Deferred to P3, rationale written 2026-09-06~~ ~~🔴 Open~~ ✅ Closed in beta.13 (`08_UI` §Safety events: a driver or service is said as running on this PC) — P3 built the refusal UI without it (corrected 2026-10-04: `SafetyNotices.RefusalText` formats every named refusal as "… was detected in this game", so the measured case below still reads wrong) — `08_UI` describes a refusal notice that is wrong in the commonest case.** *(The requirement below must reach `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI, and not before: there is no UI to be wrong in yet, and a `.resx` string with no view is the kind of fix that reads as done. The spike log carries the measurement; this line is the reminder.)* It
promises "the specific signal named in plain language". Measured (`spike-notes`
§13): while any Easy Anti-Cheat title is running, **every** target — including a
freshly spawned, unrelated process — refuses with `BlockedService` naming
+115
View File
@@ -1804,6 +1804,106 @@ library and the import, PR-4 delete sessions, the charts across sessions and the
**Owner-only, added to the list below:** item 8.
## ~~**START HERE**~~ — 2026-10-04, the beta.12 train: the game's own memory, rendered documents, a user guide, the legal split *(struck the same day: the head is §beta.13 below)*
*Status is `CHANGELOG.md` `[0.1.0-beta.12]`; this is what no other file carries. The approved plan was eight PRs: PR-0 the
recorder test that went red on a loaded runner, PR-1 `NOTICE` and the licence header (D45), PR-2 the game's memory
measured from outside the game (C++ `FrameLedger.ProcessStats.dll`, schema 0018, D43), PR-3 the App showing it, PR-4
Markdown rendered and a tabbed About, PR-5 the user guide and the documents a user accepts, PR-6 the documentation sweep,
PR-7 the release.*
**Decisions (owner, 2026-10-03, asked before the plan — do not re-ask):**
- **D43 — the game's memory is measured from OUTSIDE the game, in both tiers.** A new C++ library loaded by the Agent,
never into a game: dedicated and shared GPU memory from the documented `GPU Process Memory` performance counters (no
handle to the game), private working set / working set / commit from `GetProcessMemoryInfo` with
`PROCESS_QUERY_LIMITED_INFORMATION` only — a hooked game through the handle the session holds, any other through a
handle opened for the read and closed after it, the creation time checked, every process of the executable summed.
Task Manager's figures are the definition; no budget (§M11 stays open); not `D3DKMTQueryStatistics` ("Reserved for
system use"). Measured first: `spike-notes` §16.
- **D44 — a user guide in English**, `guide/`, rendered in the App (Help ▸ User guide), linked from the README.
- **D45 — the legal split.** `legal/TRADEMARKS.md`; `FORKING.md` and `CONTRIBUTING.md`; the GPL shown as information,
not accepted (GPLv3 §9, FR-11 changed); GPLv3 §7(b)(c)(e) additional terms in `NOTICE` and named in every source file's
header; the Appropriate Legal Notices in a tabbed About; the EULA's consumer-law carve-out and severability; the
Privacy Policy's section on sharing exports and bug reports; `CODE_OF_CONDUCT.md`.
- **D46 — documentation is corrected in place** (struck, dated) with an index, `docs/README.md`; history stays.
**Traps met on the way:**
- **A test whose session length came from a fake clock but whose end came from a real 150 ms timer** went red whenever a
loaded runner fitted fewer than six drains into it (PR-0): make the fake drive both.
- **Two LibreHardwareMonitor `Computer`s updating in one process** threw a NullReferenceException in `GenericCpu.Update`
in the local gate (`LhmRealHardwareTests` beside `PrivilegeFootprintTests`); the Agent's own read was already behind a
catch. The two test classes share a collection now.
- **A test reading resource text outside the culture collection** races a class that flips `Strings.Culture`; a class
that adds many flips (`GameMemoryTextTests`) makes it likelier. `GamesViewModelTests` moved in; the rest are a chip. *(Ended in beta.13: the
collection runs alone.)*
- **`ShmDrainIntegrationTests.AnUnhookRequestStops…` failed once on CI at the injection step** (≈1 s, `IsAllowed`
false) and passed on the re-run; it passed on the PR before. A flake to watch, not yet a fix.
- **Markdig follows the table spec strictly**: a line without cells between a table's rows ends the table, and GitHub
still draws it. `MarkdownRendererTests` fails any embedded document whose table would show as `|---|` text.
- **`AccentTextFillColorPrimaryBrush` is the dark accent until `ApplicationThemeManager.Apply(…, updateAccent: true)`
runs** — a test host that skips it draws links #003E92 on #202020; the App (and the Legal Gate, via `WpfThemeApplier`)
applies it.
- **`tools/license-gather.ps1` took an override only for a URL-only package**; Markdig declares BSD-2-Clause and ships no
file, so the expression branch takes an override too now.
- **A file git sees as mixed line endings is `-text`**: no EOL conversion, so a CRLF rewrite shows as a whole-file change.
Keep such a file's working copy LF (`docs/legal-drift-history.md`).
- **Inserting a `### Changed` heading after an entry in the middle of `### Added`** moves every later Added entry under
it — read the section's headings back before committing.
- **The stacked-branch recipe carried four PRs** (PR-3 on PR-2, PR-4 on PR-3, PR-5 on PR-4): after each squash merge,
`git rebase --onto origin/main <old parent>` replays only the PR's own commit, and resx / CHANGELOG additions stay
clean because each PR appends after the previous one's.
- **A test can hide the defect it exists to catch**: `LogTailTests` fed App-form lines into the fake *Agent* log, so
the Logs page's level filter matched no real Agent line (Serilog's default template, a date first) and nobody saw
it for three weeks. A fixture for another process's file is a copy of a real line from that process.
- **A setting with `AgentReads = true` that no Agent code reads is a switch that lies**: Settings' *Record games
launched outside FrameLedger* wrote `capture.background` and nothing read it (removed in PR-6, the key reserved).
Before trusting a registry row's flag, grep for a reader.
- **The audits (PR-6) found code gaps the docs had been describing as built**, each left for its own PR and named
here so it is not rediscovered: L1 telemetry is never pointed at the game's adapter (`SelectAdapter` has no caller,
`18_GPU_VENDOR_APIS`); a machine-wide service refusal still says "detected in this game" (§S23-3, 🔴); no release
has carried a Velopack delta (`release.yml` never fetches the previous release); there is no rules feed (§S20). *(Three of the four closed in
beta.13 — §S23-3, the adapter, the delta; the rules feed stays.)*
**Owner-only, added to the list below:** item 9.
## **START HERE** — 2026-10-04, the beta.13 train: the four follow-ups the beta.12 audit left
*Status is `CHANGELOG.md` `[0.1.0-beta.13]`; this is what no other file carries. The owner asked (2026-10-04) for the
four chips the beta.12 documentation audit had left — §S23-3's wording, the App tests' culture races, L1's adapter, the
Velopack delta — then a release and the session closed. Two PRs: PR-1 the three code changes, PR-2 the release with the
delta in `release.yml`.*
**No new owner decision.** The choices below follow rules already written: a figure from the wrong graphics card is worse
than N/A (`FlShmHandshake.AdapterLuid`'s own comment), and a finding on the PC is not a finding in the game (§S23-3,
2026-09-06).
**Traps met on the way:**
- **Pointing L1 at the game's adapter changes nothing visible on its own**: `CompositeTelemetrySource` merges L3 > L2 >
L1 per field, and L2 (LibreHardwareMonitor's first GPU node) and L3 (NVAPI's first physical GPU) read their own card.
Every layer has to agree on the card — L1 by LUID (`IGpuAdapterSelector`), the others by the adapter's vendor
(`IGpuVendorFollower`), and L3 says nothing for an AMD or Intel adapter. Two GPUs of one vendor stay first-found.
- **A `CaptureRefused`'s `reason` is the session's end reason** (`RefusedByGuard`), not the guard's: the App could not
tell a service from a module until the events carried `guardReason`. A `RefusedAck`'s `Reason`, by contrast, IS the
guard's — two "reason" fields one pipe apart that mean different things.
- **A collection definition must be public** (xUnit1027), which CA1515 then flags in a test project that is an exe — the
suppression carries the reason. `TestContext.Current.TestCollection.TestCollectionClassName` proves the definition
bound, so a definition xUnit did not find fails a test instead of bringing the races back silently.
- **`vpk download github --pre` puts the previous release's full package in `out/release`**: `vpk pack` needs it there to
write a delta, and nothing else may ship it — `assets.win.json` names what this pack built, the rest moves to
`out/previous`, and the feed and `RELEASES` are filtered to this build, as `vpk upload github` writes them.
- **A 120 ms wall-clock ceiling races the second scan on a loaded runner**: the release rehearsal failed on
`CaptureSessionTests.AGuardThatThrowsMidSessionKeepsTheRecordsItAlreadyDrained`, which ended as `Running` before the
guard's second evaluation threw — the class beta.12's PR-0 fixed in the recorder tests. The four tests whose ending is a
scan, a throw, the kill switch or an exit take `EndsOnItsOwn` (a 30 s safety net); a test that EXPECTS `Running` keeps
the short ceiling, because that ceiling is its ending.
- **The beta.12 traps about the culture race and the four code gaps are closed here** (the rules feed stays open, §S20).
**Owner-only, added to the list below:** item 10.
## Owner-only — no PR can close these
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
@@ -1853,6 +1953,21 @@ library and the import, PR-4 delete sessions, the charts across sessions and the
on a game's page and in Settings ▸ Data. (d) *Sessions at a glance* and the Trend with a second unit. (e) The Legal
Gate shows the Disclaimer 2.9 and the EULA 1.4 once. (f) The `ja` text of `Safety_Exception_Trial` (English until
reviewed) and the App strings marked `review`.
9. **beta.12 on real hardware.** (a) **The game's memory:** one hooked game and one that is not (hooking off, or a
blocked game), each beside Task Manager's Details tab at the same moment — the summary's *VRAM (this game)* against
*Dedicated GPU memory*, *RAM (this game)* against *Memory (private working set)*; the Dashboard's live line; the
Sessions columns, the Trend's memory metrics and the Sensors charts. (b) **The Legal Gate** shows the EULA 1.5, the
Disclaimer 2.10 and the Privacy Policy 2.6 once, rendered, with the GPL as *your licence*, needing no acceptance.
(c) **Help ▸ User guide**, **Help ▸ About** (its three tabs; *Open the licences folder* in the installed copy), and
*View on GitHub* opening the `v0.1.0-beta.12` tag. (d) The `ja` strings marked `review` (the memory labels, the
About window, the first-start summary). (e) `docs/LIST_GAME_TESTED.md` is as of beta.10: refresh it from a copy of
the ledger, with the games' memory figures, and approve it before it is committed (D35).
10. **beta.13 on real hardware.** (a) **The first delta:** update an installed `0.1.0-beta.12` through Help ▸ Check for
updates — the download is a fraction of the full ~107 MB, and the App comes back as beta.13; if it downloaded the
full package instead, say so (Velopack falls back silently). (b) **On this PC:** with an Easy Anti-Cheat service
running for any game, start a hook-enabled game — the notice says the anti-cheat is running on this PC, not in
the game. (c) **Two graphics cards**, if a machine with them is at hand: the Sensors chart's GPU figures are the
game's card. (d) The `ja` review of the new safety strings, with the others still marked for it.
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
+7 -3
View File
@@ -36,9 +36,13 @@ The first window walks you through four short steps:
## Updates
A few seconds after it starts, FrameLedger asks GitHub whether a newer version exists. A new version downloads in the
background and is installed only when you restart FrameLedger — never while a game is being measured. You can switch
the check off in **Settings ▸ Updates ▸ Check for updates at startup**, and check by hand with Help ▸ Check for
updates.
background and is installed only when you restart FrameLedger — never while a game is being measured, and not while a
game it measured earlier is still running. You can switch the check off in **Settings ▸ Updates ▸ Check for updates at
startup**, and check by hand with Help ▸ Check for updates.
**Settings ▸ Updates ▸ Channel** is *Automatic* unless you choose: a test version (a pre-release, like every version so
far) looks for test versions, a release looks for releases. Choose *Stable* or *Beta* to decide yourself. Before
0.1.0-beta.14 the channel was *Stable* by default and found no version at all — on an older copy, choose *Beta* to update.
## Uninstall
+3
View File
@@ -44,6 +44,9 @@ correct it by hand — your correction is labelled as yours.
Changes to your hardware or driver are marked on it.
- **Compare** (in the navigation on the left) — pick sessions, even of different games, and see them side by side.
To look closer, hold **Ctrl** and turn the mouse wheel over a chart to zoom, drag to pan, and double-click to reset. The
wheel alone scrolls the page.
## Export
The summary's **Export CSV**, **Export JSON** and **Export PNG** buttons — or File ▸ Export — save a session to a file.
+2 -2
View File
@@ -11,8 +11,8 @@
that changes what FrameLedger.Overlay or the capture host does; date the change.
HTML comments are not part of the block.
-->
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.11`** (2026-10-03), an unsigned installer built from that tag with its
> ⚠ **What FrameLedger actually measures today — 2026-10-04.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
> checksums published beside it. The source holds the desktop app
> (library, store import, charts, settings) and the background Agent, which records a session when a
> game in the library runs (unless you switched its recording off), injects only into games you enabled
+2 -2
View File
@@ -113,8 +113,8 @@ Software running inside another process can, in principle, destabilize it. Frame
Frame timing is derived from high-resolution timestamps taken at the moment the game presents each frame; upscaling, frame-generation and ray-tracing state are read from the parameters the game passes to those APIs. This is substantially more accurate than inferring settings from files on disk, but **no measurement is guaranteed to be exact**:
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.11`** (2026-10-03), an unsigned installer built from that tag with its
> ⚠ **What FrameLedger actually measures today — 2026-10-04.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
> checksums published beside it. The source holds the desktop app
> (library, store import, charts, settings) and the background Agent, which records a session when a
> game in the library runs (unless you switched its recording off), injects only into games you enabled
+2 -2
View File
@@ -1,6 +1,6 @@
# FrameLedger — Privacy Policy
**Version:** 2.6 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.7 · **Effective:** {{RELEASE_DATE}}
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
@@ -39,7 +39,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
## 4. What the app can technically observe
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and how busy the processor is and how much memory is in use, from Windows' own counters.
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
@@ -43,6 +43,7 @@ internal sealed class AgentRecording
private readonly IOverlayToleranceChannel _tolerance;
private readonly WindowGeometryProbe _display = new();
private readonly UserModeExceptionLapsePolicy _exceptionLapse;
private readonly ICrashReporterSightings _reporters;
public AgentRecording(
IGameConsentStore store,
@@ -66,8 +67,10 @@ internal sealed class AgentRecording
IDriverProfileSource profiles,
IUserModeExceptionSwitch exceptions,
IOverlayToleranceChannel tolerance,
UserModeExceptionLapsePolicy exceptionLapse)
UserModeExceptionLapsePolicy exceptionLapse,
ICrashReporterSightings reporters)
{
_reporters = reporters;
_profiles = profiles;
_exceptions = exceptions;
_tolerance = tolerance;
@@ -123,7 +126,8 @@ internal sealed class AgentRecording
_observer,
_policy,
_profiles,
_exceptionLapse);
_exceptionLapse,
_reporters);
}
/// <summary>L1 + L2 + L3 under the composite, one poller per session; the poller owns and disposes the layers. The interval is the session's (<c>telemetry.interval_ms</c>, D16).</summary>
@@ -94,14 +94,7 @@ internal static class AgentServices
services.AddSingleton<IRuntimeModuleSnapshot>(static _ => new RuntimeModuleSnapshot(CensusNames.ModuleFileNames));
AddNvidia(services);
// The recorder's adapters (PR-D).
services.AddSingleton<IPartialSessionStore>(_ => new PartialSessionStore(paths.Tmp));
services.AddSingleton<ICrashEventSource, EventLogCrashSource>();
services.AddSingleton<IHardwareSnapshotSource>(static _ => new HardwareSnapshotSource(new DxgiAdapters()));
services.AddSingleton<ISeriesCodec, DeflateSeriesCodec>();
services.AddSingleton<SessionFinalizer>();
services.AddSingleton(static sp => new PartialRecovery(sp.GetRequiredService<IPartialSessionStore>(), sp.GetRequiredService<SessionFinalizer>()));
services.AddSingleton<AgentRecording>();
AddRecording(services, paths);
// The watcher (this PR): snapshots, identity, and the orchestrator over an unbounded recorder.
services.AddSingleton<IProcessSnapshotSource, ToolhelpProcessSnapshotSource>();
@@ -115,6 +108,20 @@ internal static class AgentServices
return services;
}
/// <summary>The recorder's adapters (PR-D), and since beta.14 the witness of engine crash reporters the watcher feeds and the recorder asks.</summary>
private static void AddRecording(IServiceCollection services, AgentPaths paths)
{
services.AddSingleton<IPartialSessionStore>(_ => new PartialSessionStore(paths.Tmp));
services.AddSingleton<ICrashEventSource, EventLogCrashSource>();
services.AddSingleton<CrashReporterWitness>();
services.AddSingleton<ICrashReporterSightings>(static sp => sp.GetRequiredService<CrashReporterWitness>());
services.AddSingleton<IHardwareSnapshotSource>(static _ => new HardwareSnapshotSource(new DxgiAdapters()));
services.AddSingleton<ISeriesCodec, DeflateSeriesCodec>();
services.AddSingleton<SessionFinalizer>();
services.AddSingleton(static sp => new PartialRecovery(sp.GetRequiredService<IPartialSessionStore>(), sp.GetRequiredService<SessionFinalizer>()));
services.AddSingleton<AgentRecording>();
}
/// <summary>
/// D33 (owner decision 2026-09-26): the user-mode exception's option (one row in <c>settings</c>), its channel to the
/// Overlay (<c>Local\FrameLedger.Tolerate.&lt;pid&gt;</c>, created before an injection under it), and the policy that ends
@@ -238,7 +245,8 @@ internal static class AgentServices
static line => Serilog.Log.Information("{Line}", line),
sp.GetRequiredService<ILaunchRecorderFactory>(),
sp.GetRequiredService<ExecutableRelocator>(),
sp.GetRequiredService<LatestProcessSnapshot>()));
sp.GetRequiredService<LatestProcessSnapshot>(),
sp.GetRequiredService<CrashReporterWitness>()));
services.AddSingleton<ILaunchRecorderFactory, AgentLaunches>();
}
@@ -12,6 +12,10 @@
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<AssemblyName>FrameLedger.Agent</AssemblyName>
<RootNamespace>FrameLedger.Agent</RootNamespace>
<!-- beta.14 (D50): Task Manager lists a process by its file description, and until beta.14 this one read
"FrameLedger.Agent" - the SDK's default, the assembly name - with the same as its company and product. -->
<AssemblyTitle>FrameLedger Agent</AssemblyTitle>
<Description>FrameLedger Agent: watches the games you added and records their sessions. Identifies itself deliberately; see https://github.com/poli0981/frameledger</Description>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -353,7 +353,7 @@ internal static class Program
builder.Services.AddHostedService<PipeServerHostedService>();
// Finalize's grace on shutdown (04_CAPTURE §Threading model): a session that does not make it leaves
// its .partial for the next start's recovery.
builder.Services.Configure<HostOptions>(static o => o.ShutdownTimeout = TimeSpan.FromSeconds(15));
builder.Services.Configure<HostOptions>(static o => o.ShutdownTimeout = Shared.Ipc.IpcProtocol.AgentShutdownGrace);
using IHost host = builder.Build();
AgentConsole.Line($@"serve: ledger {paths.Database}; logs {paths.Logs}; pipe \.\pipe\{Shared.Ipc.IpcProtocol.PipeName}; Ctrl+C stops");
+3
View File
@@ -78,6 +78,8 @@ public partial class App : System.Windows.Application
HookCrashHandlers();
// 08_UI §Accessibility (P4 PR-8): Esc closes the open ContentDialog or MessageBox, before any window exists.
DialogKeyboard.Register();
// beta.14: ui.hide_scrollbars reaches every scroller as it loads, those in a control's template too.
ScrollBarHiding.Register();
_run = DiagReport.Requested(e.Args) ? DiagAsync() : RunAsync();
}
@@ -102,6 +104,7 @@ public partial class App : System.Windows.Application
var registered = new RegisteredSettings(store);
LoggingLevel.SetDebug(await registered.GetBooleanAsync(SettingsRegistry.LogDebug).ConfigureAwait(true));
FpsDecimals.Two = await registered.GetBooleanAsync(SettingsRegistry.UiFpsDecimals).ConfigureAwait(true);
ScrollBarHiding.Apply(await registered.GetBooleanAsync(SettingsRegistry.UiHideScrollBars).ConfigureAwait(true));
var closePolicy = new WindowClosePolicy { MinimizeToTray = await registered.GetBooleanAsync(SettingsRegistry.UiMinimizeToTray).ConfigureAwait(true) };
_host = BuildHost(_db, appearance, registered, closePolicy);
+5 -1
View File
@@ -70,10 +70,14 @@ public static class ChartTheme
(byte)Math.Round((top.B * a) + (under.B * (1 - a))));
}
/// <summary>Registers a control so a theme change re-applies and refreshes it (weakly held; a closed window is forgotten).</summary>
/// <summary>
/// Registers a control so a theme change re-applies and refreshes it (weakly held; a closed window is forgotten), and
/// gives it the App's wheel: a plain wheel scrolls the page, Ctrl+wheel zooms (<see cref="ChartWheel"/>, beta.14).
/// </summary>
public static void Attach(WpfPlot control)
{
ArgumentNullException.ThrowIfNull(control);
ChartWheel.Attach(control);
lock (_lock)
{
_live.RemoveAll(static w => !w.TryGetTarget(out _));
+66
View File
@@ -0,0 +1,66 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using ScottPlot.WPF;
namespace FrameLedger.App.Charts;
/// <summary>
/// The mouse wheel over a chart (beta.14). ScottPlot 5's <see cref="WpfPlot"/> zooms on every wheel and never marks it
/// handled, so with the pages scrolling again (<c>16_WPFUI_SYNTAX</c> §Gotchas: they did not until beta.14) a wheel over a
/// chart would have zoomed it AND scrolled the page under the pointer. A plain wheel now belongs to the page — ScottPlot
/// never sees it — and Ctrl+wheel to the chart, which zooms and keeps the page where it is. Every plot reaches this through
/// <see cref="ChartTheme.Attach"/>.
/// </summary>
internal static class ChartWheel
{
/// <summary>Whether a wheel with these modifier keys zooms the chart rather than scrolling the page: Ctrl held.</summary>
public static bool Zooms(ModifierKeys modifiers) => (modifiers & ModifierKeys.Control) == ModifierKeys.Control;
/// <summary>
/// The modifier keys the two handlers read: <see cref="Keyboard.Modifiers"/>, which is the machine's real keyboard — a
/// thread that never had keyboard focus still reads it (measured 2026-10-06: a fresh background thread's
/// <c>GetKeyState</c> reported the machine's NumLock). So a test driving the wheel end to end held whatever key a person
/// pressed while it ran — the one input it did not control, and the plain half went red once in a gate on the developer's
/// machine and never on CI. The tests set this for the length of one dispatcher work item and put it back; the App never
/// sets it.
/// </summary>
internal static Func<ModifierKeys> CurrentModifiers { get; set; } = static () => Keyboard.Modifiers;
public static void Attach(WpfPlot plot)
{
ArgumentNullException.ThrowIfNull(plot);
plot.PreviewMouseWheel += OnPreviewMouseWheel;
plot.MouseWheel += OnMouseWheel;
}
/// <summary>
/// The tunnelling half, before ScottPlot's own handler on its inner element: a plain wheel is taken from the plot and
/// raised again on the plot's parent, from where it bubbles to the page's scroller as any other wheel would.
/// </summary>
private static void OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (e.Handled || Zooms(CurrentModifiers()) || sender is not DependencyObject plot)
{
return;
}
e.Handled = true;
if (VisualTreeHelper.GetParent(plot) is UIElement parent)
{
parent.RaiseEvent(new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta) { RoutedEvent = UIElement.MouseWheelEvent, Source = sender });
}
}
/// <summary>The bubbling half, after ScottPlot has zoomed: Ctrl+wheel stops here, so the page does not scroll as well.</summary>
private static void OnMouseWheel(object sender, MouseWheelEventArgs e)
{
if (Zooms(CurrentModifiers()))
{
e.Handled = true;
}
}
}
@@ -7,7 +7,8 @@
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:sp="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
MinHeight="260">
<!-- 08_UI §Session summary / FR-5.1: the frametime timeline, min/max decimated (FR-5.3); zoom and pan are ScottPlot's.
<!-- 08_UI §Session summary / FR-5.1: the frametime timeline, min/max decimated (FR-5.3); zoom and pan are ScottPlot's —
zoom with Ctrl+wheel since beta.14, a plain wheel scrolls the page (ChartWheel).
The note above it says what the lines are not, when that is not obvious (beta.8). -->
<Grid>
<Grid.RowDefinitions>
@@ -16,7 +16,7 @@
Safety_AdminMode_* only, versioned by AgentAdminDisclosure.Version. It states what the option adds, what it does not
change, how Windows asks, and the risk; every colour is a theme brush.
-->
<ScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
<ui:PassiveScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
<StackPanel>
<ui:TextBlock Text="{x:Static vm:AgentAdminDialogViewModel.Intro}" TextWrapping="Wrap" />
<ui:TextBlock Margin="0,14,0,0" Text="{x:Static vm:AgentAdminDialogViewModel.Adds}" TextWrapping="Wrap" />
@@ -34,5 +34,5 @@
IsChecked="{Binding Accepted, Mode=TwoWay}" />
<ui:TextBlock Margin="0,12,0,0" HorizontalAlignment="Right" Appearance="Tertiary" Text="{x:Static vm:AgentAdminDialogViewModel.Version}" />
</StackPanel>
</ScrollViewer>
</ui:PassiveScrollViewer>
</UserControl>
@@ -16,7 +16,7 @@
versioned by AntiCheatExceptionDisclosure.Version. It states why the exception is offered, the risk, what is still
refused, how it ends, and that it turns nothing on; it recommends neither choice. Every colour is a theme brush.
-->
<ScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
<ui:PassiveScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
<StackPanel>
<ui:TextBlock Text="{Binding Intro}" TextWrapping="Wrap" />
<ui:TextBlock Margin="0,14,0,0" Text="{Binding Why}" TextWrapping="Wrap" />
@@ -37,5 +37,5 @@
Content="{x:Static vm:AntiCheatExceptionDialogViewModel.AcceptText}"
IsChecked="{Binding Accepted, Mode=TwoWay}" />
</StackPanel>
</ScrollViewer>
</ui:PassiveScrollViewer>
</UserControl>
@@ -19,7 +19,7 @@
<ui:TextBlock TextWrapping="Wrap" Text="{Binding Intro}" />
<Border Margin="0,10,0,10" Padding="10,6" CornerRadius="6"
Background="{DynamicResource ControlFillColorDefaultBrush}" BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}" BorderThickness="1">
<ScrollViewer MaxHeight="220" VerticalScrollBarVisibility="Auto">
<ui:PassiveScrollViewer MaxHeight="220" VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding Entries}">
<ItemsControl.ItemTemplate>
<DataTemplate>
@@ -27,7 +27,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</ui:PassiveScrollViewer>
</Border>
<ui:HyperlinkButton Padding="0" Content="{x:Static vm:BugReportPreviewViewModel.ShowZipText}" Command="{Binding ShowZipCommand}" />
<ui:TextBlock Margin="0,10,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:BugReportPreviewViewModel.DragInstruction}" />
@@ -16,7 +16,7 @@
tiers are two paragraphs of the same shape, in the order enable / do-not-enable, with nothing between
them that reads as a recommendation. Every colour is a theme brush (16_WPFUI §Theming).
-->
<ScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
<ui:PassiveScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
<StackPanel>
<ui:TextBlock Text="{x:Static vm:ConsentDialogViewModel.Intro}" TextWrapping="Wrap" />
@@ -38,5 +38,5 @@
Text="{Binding Typed, UpdateSourceTrigger=PropertyChanged}"
PlaceholderText="{x:Static vm:ConsentDialogViewModel.Phrase}" />
</StackPanel>
</ScrollViewer>
</ui:PassiveScrollViewer>
</UserControl>
@@ -16,15 +16,30 @@
or has no executable cannot be ticked (its box is disabled since beta.11 - before, a tick was taken and ignored).
Rows already in the library are hidden unless "Show the N games already in the library" is ticked, and then
dimmed. Import never enables hooking (the intro says so).
beta.14 (owner's screenshot, dark theme): every row was white with white text and every tick box a sliver. The row
style was based on {x:Type DataGridRow}, which WPF UI 4.3.0 does not define - it keys its row style
DefaultDataGridRowStyle and hands it to the grid through the DataGrid style's RowStyle - so the lookup fell through
to Aero2's row template and its SystemColors.WindowBrush, which no theme reaches. The sliver is WPF UI's CheckBox
style, MinWidth 120 and padding 11, in a 40 px column: MinWidth 0 and no padding draw the whole box. And the list
no longer scrolls inside a dialog that scrolls too: ImportReviewPrompt turns the dialog's own
scrolling off, so the grid takes the height the window leaves and is the one thing that scrolls - the intro and the
count stay where they are (ImportReviewRenderTests).
-->
<StackPanel>
<ui:TextBlock TextWrapping="Wrap" Text="{x:Static vm:ImportReviewViewModel.Intro}" />
<CheckBox Margin="0,8,0,0" Content="{Binding ShowExistingText}" IsChecked="{Binding ShowExisting, Mode=TwoWay}"
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" MinHeight="120" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ui:TextBlock Grid.Row="0" TextWrapping="Wrap" Text="{x:Static vm:ImportReviewViewModel.Intro}" />
<CheckBox Grid.Row="1" Margin="0,8,0,0" Content="{Binding ShowExistingText}" IsChecked="{Binding ShowExisting, Mode=TwoWay}"
Visibility="{Binding HasExisting, Converter={StaticResource BoolToVis}}" />
<DataGrid Margin="0,10,0,8" MaxHeight="360" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column"
<DataGrid x:Name="Candidates" Grid.Row="2" Margin="0,10,0,8" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column"
ItemsSource="{Binding Shown}" SelectionMode="Single" IsReadOnly="False">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRowStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsExisting}" Value="True">
<Setter Property="Opacity" Value="0.55" />
@@ -36,7 +51,7 @@
<DataGridTemplateColumn Width="40">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox HorizontalAlignment="Center" IsEnabled="{Binding CanImport}"
<CheckBox MinWidth="0" Padding="0" HorizontalAlignment="Center" IsEnabled="{Binding CanImport}"
AutomationProperties.Name="{Binding Name}"
IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
@@ -48,12 +63,12 @@
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnNote}" Binding="{Binding Note}" IsReadOnly="True" Width="Auto" />
</DataGrid.Columns>
</DataGrid>
<DockPanel>
<DockPanel Grid.Row="3">
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
<ui:HyperlinkButton Padding="4,0" Content="{x:Static res:Strings.Import_SelectAll}" Command="{Binding SelectAllCommand}" xmlns:res="clr-namespace:FrameLedger.App" />
<ui:HyperlinkButton Padding="4,0" Content="{x:Static res:Strings.Import_SelectNone}" Command="{Binding SelectNoneCommand}" xmlns:res="clr-namespace:FrameLedger.App" />
</StackPanel>
<ui:TextBlock Appearance="Secondary" VerticalAlignment="Center" Text="{Binding SelectedText}" />
</DockPanel>
</StackPanel>
</Grid>
</UserControl>
+4 -7
View File
@@ -24,6 +24,10 @@
<!-- 11_UPDATER (P4 PR-5): Velopack must run before any window exists, so the
entry point is Program.Main rather than the generated App.Main. -->
<StartupObject>FrameLedger.App.Program</StartupObject>
<!-- beta.14 (D50): the file description Explorer and Task Manager show, and the Comments line. The company, product
and copyright are every assembly's (Directory.Build.props). -->
<AssemblyTitle>FrameLedger</AssemblyTitle>
<Description>FrameLedger: records game performance sessions and shows them over time. Identifies itself deliberately; see https://github.com/poli0981/frameledger</Description>
</PropertyGroup>
<ItemGroup>
@@ -57,13 +61,6 @@
<EmbeddedResource Include="..\..\guide\*.md" LogicalName="guide/%(Filename)%(Extension)" />
</ItemGroup>
<!-- beta.12: the source this build was made from, so the App's links into the repository open THIS version's documents
(Services/RepositoryLinks.cs). release.yml passes the tag (a rehearsal, its commit); a local build has none and links
to main. -->
<ItemGroup Condition="'$(FrameLedgerSourceRef)' != ''">
<AssemblyMetadata Include="FrameLedgerSourceRef" Value="$(FrameLedgerSourceRef)" />
</ItemGroup>
<ItemGroup>
<!-- P4 PR-6: the licence texts travel with the package (legal/THIRD_PARTY_NOTICES.md: "Full license texts must be
shipped in legal/licenses/ in release packages"). PUBLISH ONLY: a build output has no recipient, and copying
+13 -3
View File
@@ -8,9 +8,10 @@
xmlns:res="clr-namespace:FrameLedger.App"
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
Title="{x:Static res:Strings.Compare_Header}">
Title="{x:Static res:Strings.Compare_Header}"
ScrollViewer.CanContentScroll="False">
<!-- 08_UI §Compare: the picker (2–5, cross-game), the overlaid percentile curves, the stat table; FR-6.2's guard is the view model's. -->
<ScrollViewer>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
<ui:TextBlock FontTypography="Title" Text="{x:Static vm:CompareViewModel.Header}" />
<ui:TextBlock Margin="0,16,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:CompareViewModel.EmptyText}"
@@ -32,7 +33,16 @@
ItemsSource="{Binding ViewModel.Candidates}" SelectionMode="Single"
Visibility="{Binding ViewModel.IsEmpty, Converter={StaticResource InverseBoolToVis}}">
<DataGrid.Columns>
<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" Width="40" />
<!-- A template column, not DataGridCheckBoxColumn: that one's element style is WPF's own, an Aero2 box on the Fluent grid; MinWidth 0
and no padding, or WPF UI's CheckBox (MinWidth 120, padding 11) draws a sliver of the box in 40 px (beta.14). -->
<DataGridTemplateColumn Width="40">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:CompareCandidateViewModel}">
<CheckBox MinWidth="0" Padding="0" HorizontalAlignment="Center" AutomationProperties.Name="{Binding Label}"
IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Game}" Binding="{Binding GameName}" IsReadOnly="True" Width="2*" />
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Date}" Binding="{Binding DateText}" IsReadOnly="True" Width="*" />
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Tier}" Binding="{Binding TierText}" IsReadOnly="True" Width="Auto" />
+3 -2
View File
@@ -8,8 +8,9 @@
xmlns:res="clr-namespace:FrameLedger.App"
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
Title="{x:Static res:Strings.Dashboard_Header}">
<ScrollViewer>
Title="{x:Static res:Strings.Dashboard_Header}"
ScrollViewer.CanContentScroll="False">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
<ui:TextBlock FontTypography="Title" Text="{x:Static vm:DashboardViewModel.Header}" />
@@ -9,13 +9,14 @@
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
Title="{x:Static res:Strings.Games_Header}">
Title="{x:Static res:Strings.Games_Header}"
ScrollViewer.CanContentScroll="False">
<!--
08_UI §Games › Game detail. The two rows — Supports (files on disk) and Last session measured (the
hooks) — are two cards and never mixed. The hooking control opens FR-2.1's dialog; a blocked pre-scan
disables it with the reason inline; a refusal is a persistent InfoBar on this page, never a toast.
-->
<ScrollViewer>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
<ui:HyperlinkButton Padding="0" Command="{Binding ViewModel.BackCommand}" Content="{x:Static vm:GameDetailViewModel.BackText}" Icon="{ui:SymbolIcon ArrowLeft24}" />
+3 -2
View File
@@ -10,14 +10,15 @@
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
Title="{x:Static res:Strings.Games_Header}"
AllowDrop="True"
Drop="OnDrop">
Drop="OnDrop"
ScrollViewer.CanContentScroll="False">
<!--
08_UI §Games: search, sort, FR-1.1 add by pick or by dropping an .exe here. Since beta.11 (owner requests 2026-10-03):
the count in the title; a grid of cards that fills the width (UniformWrapPanel - a WrapPanel of 300 px cards left a
card's width unused at the right) or a list (ui.library_view); Refresh reads the library again, offers the games the
stores installed since, and marks the entries whose executable is gone.
-->
<ScrollViewer>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
<Grid>
<Grid.ColumnDefinitions>
+2 -1
View File
@@ -7,7 +7,8 @@
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:res="clr-namespace:FrameLedger.App"
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
Title="{x:Static res:Strings.Logs_Header}">
Title="{x:Static res:Strings.Logs_Header}"
ScrollViewer.CanContentScroll="False">
<Grid Margin="24,16,24,16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
+14 -2
View File
@@ -7,8 +7,9 @@
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:res="clr-namespace:FrameLedger.App"
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
Title="{x:Static res:Strings.Settings_Header}">
<ScrollViewer>
Title="{x:Static res:Strings.Settings_Header}"
ScrollViewer.CanContentScroll="False">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
<ui:TextBlock FontTypography="Title" Text="{x:Static vm:SettingsViewModel.Header}" />
@@ -310,6 +311,17 @@
</ui:CardControl.Header>
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_FpsDecimals_Label}" IsChecked="{Binding ViewModel.FpsTwoDecimals, Mode=TwoWay}" />
</ui:CardControl>
<!-- beta.14 (owner request 2026-10-05): no scroll bars drawn; the wheel, the keyboard and touch still scroll. -->
<ui:CardControl Margin="0,8,0,0" Icon="{ui:SymbolIcon ArrowSortDownLines24}">
<ui:CardControl.Header>
<StackPanel>
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_HideScrollBars_Label}" />
<ui:TextBlock MaxWidth="520" HorizontalAlignment="Left" Appearance="Secondary" TextWrapping="Wrap"
Text="{x:Static res:Strings.Settings_HideScrollBars_Body}" />
</StackPanel>
</ui:CardControl.Header>
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_HideScrollBars_Label}" IsChecked="{Binding ViewModel.HideScrollBars, Mode=TwoWay}" />
</ui:CardControl>
<!--
Updates, logging, legal. The Privacy card — the `privacy.online_metadata` toggle — is not shown
+21 -3
View File
@@ -305,7 +305,10 @@ public static class Formats
case "RefusedHookNotEnabled":
return Strings.Summary_Tier2_Why_HookOff;
case "RefusedByGuard" or "SafetyUnhook" when n.GuardFamily is { Length: > 0 } family:
return string.Format(CultureInfo.CurrentCulture, Strings.Summary_Tier2_Why_Guard_Format, family, n.GuardSignal ?? Strings.Common_NotAvailable);
// A driver or service is on the PC, not in the game (beta.13, §S23-3).
return string.Format(CultureInfo.CurrentCulture,
IsMachineWide(n.GuardReason) ? Strings.Summary_Tier2_Why_MachineWide_Format : Strings.Summary_Tier2_Why_Guard_Format,
family, n.GuardSignal ?? Strings.Common_NotAvailable);
case "RefusedByGuard" when n.GuardReason is { Length: > 0 } reason:
// A refusal no family names (beta.8): the guard could not look, the game is 32-bit… — said as what it is,
// never "… was detected in this game", which read as a finding.
@@ -364,6 +367,18 @@ public static class Formats
public static string GuardSentence(string reason) =>
string.Format(CultureInfo.CurrentCulture, Strings.Guard_Refused_Format, GuardReasonText(reason));
/// <summary>
/// §S23-3 (beta.13): a driver or a service is found on the PC, not in the game. The guard's checks 2 and 2b are
/// machine-wide, so while one runs every game refuses — the measured case is Easy Anti-Cheat's service, running for
/// another title — and a notice must not say it was detected "in this game".
/// </summary>
public static bool IsMachineWide(string? guardReason) => guardReason is "BlockedDriver" or "BlockedService";
/// <summary>A refusal the guard named a family for, as a sentence: found on this PC, or found in this game.</summary>
public static string NamedRefusal(string? guardReason, string family, string signal) =>
string.Format(CultureInfo.CurrentCulture,
IsMachineWide(guardReason) ? Shared.Strings.Safety_Refused_MachineWide_Format : Shared.Strings.Safety_Refused_Named_Format, family, signal);
/// <summary>What a familyless guard reason means, as a clause.</summary>
public static string GuardReasonText(string reason) => reason switch
{
@@ -392,13 +407,16 @@ public static class Formats
/// <summary>
/// How a session ended, in words (beta.8): a crash names its exception ("crashed (0xC0000005 access violation)"), an
/// exit code that is not one is an ordinary end with its code — End task's 1 said as what it is — and the other
/// statuses keep their words.
/// statuses keep their words. Since beta.14 a crash witnessed by the engine's crash reporter names it ("crashed (the
/// game started its crash reporter, CrashReportClient.exe)"): the exception's code first, then the reporter, then the log.
/// </summary>
public static string ExitText(ExitStatus status, CaptureNotes notes) => status switch
{
ExitStatus.Crashed => notes.ExitCode is { } code && ExitStatusMapper.IsExceptionCode(code)
? string.Format(CultureInfo.CurrentCulture, Strings.Exit_Crashed_Format, ExceptionName(code))
: Strings.Exit_CrashEvent,
: notes.CrashReporter is { Length: > 0 } reporter
? string.Format(CultureInfo.CurrentCulture, Strings.Exit_CrashReporter_Format, reporter)
: Strings.Exit_CrashEvent,
ExitStatus.Normal => notes.ExitCode switch
{
null or 0 => Strings.Exit_EndedNormally,
@@ -36,6 +36,7 @@ public sealed record HookingConsentResult(HookingConsentOutcome Outcome, string?
return string.IsNullOrEmpty(Refusal.Reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(Refusal.Reason);
}
return string.Format(System.Globalization.CultureInfo.CurrentCulture, Shared.Strings.Safety_Refused_Named_Format, Refusal.Family, Refusal.Signal ?? Refusal.Reason);
// The pre-scan's reason is the guard's own: a driver or service would be on the PC, not in the game (beta.13, §S23-3).
return Formats.NamedRefusal(Refusal.Reason, Refusal.Family, Refusal.Signal ?? Refusal.Reason);
}
}
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Windows.Controls;
using System.Windows.Data;
using FrameLedger.App.Dialogs;
using FrameLedger.App.ViewModels;
@@ -10,7 +11,11 @@ using Wpf.Ui.Controls;
namespace FrameLedger.App.Services;
/// <summary>FR-1.2's review checklist in WPF UI: a <c>ContentDialog</c> whose primary button follows the tick count; Cancel adds nothing.</summary>
/// <summary>
/// FR-1.2's review checklist in WPF UI: a <c>ContentDialog</c> whose primary button follows the tick count; Cancel adds nothing.
/// The dialog's own scrolling is off (beta.14): its content row then has the height the window leaves, the list fills it and is
/// the one thing that scrolls — a scrolling list inside a scrolling dialog pushed the intro out of sight at the list's end.
/// </summary>
public sealed class ImportReviewPrompt : IImportReview
{
private readonly IContentDialogService _dialogs;
@@ -21,18 +26,24 @@ public sealed class ImportReviewPrompt : IImportReview
{
ArgumentNullException.ThrowIfNull(candidates);
var viewModel = new ImportReviewViewModel(candidates);
var dialog = new ContentDialog
{
Title = ImportReviewViewModel.Title,
Content = new ImportReviewContent(viewModel),
PrimaryButtonText = Strings.Import_Add,
CloseButtonText = Strings.Common_Cancel,
DefaultButton = ContentDialogButton.Primary,
DialogMaxWidth = 900,
};
ContentDialog dialog = Create(viewModel);
_ = dialog.SetBinding(ContentDialog.IsPrimaryButtonEnabledProperty, new Binding(nameof(ImportReviewViewModel.CanImport)) { Source = viewModel, Mode = BindingMode.OneWay });
ContentDialogResult result = await _dialogs.ShowAsync(dialog, ct).ConfigureAwait(true);
return result == ContentDialogResult.Primary ? viewModel.Selected : null;
}
/// <summary>The dialog as shown, without a host: a test lays it out in one of its own.</summary>
internal static ContentDialog Create(ImportReviewViewModel viewModel, ContentDialogHost? host = null)
{
ContentDialog dialog = host is null ? new ContentDialog() : new ContentDialog(host);
dialog.Title = ImportReviewViewModel.Title;
dialog.Content = new ImportReviewContent(viewModel);
dialog.PrimaryButtonText = Strings.Import_Add;
dialog.CloseButtonText = Strings.Common_Cancel;
dialog.DefaultButton = ContentDialogButton.Primary;
dialog.DialogMaxWidth = 900;
ScrollViewer.SetVerticalScrollBarVisibility(dialog, ScrollBarVisibility.Disabled);
return dialog;
}
}
@@ -8,13 +8,13 @@ namespace FrameLedger.App.Services;
/// <summary>
/// Links into the repository at the source THIS build was made from (beta.12): <c>release.yml</c> passes the release's tag
/// (<c>-p:FrameLedgerSourceRef=v0.1.0-beta.12</c>, a rehearsal its commit), which the App csproj stamps as assembly
/// metadata; a local build carries none and links to <c>main</c>. Until beta.12 every link said <c>blob/main</c>, so an
/// (<c>-p:FrameLedgerSourceRef=v0.1.0-beta.12</c>, a rehearsal its commit), which <c>Directory.Build.props</c> stamps as
/// assembly metadata (the App csproj until beta.14); a local build carries none and links to <c>main</c>. Until beta.12 every link said <c>blob/main</c>, so an
/// installed release opened documents that had moved on since it was built — a different EULA from the one it showed.
/// </summary>
public static partial class RepositoryLinks
{
/// <summary>The metadata key the App csproj writes.</summary>
/// <summary>The metadata key <c>Directory.Build.props</c> writes.</summary>
public const string MetadataKey = "FrameLedgerSourceRef";
/// <summary>The branch a build without a stamped source links to.</summary>
+16 -6
View File
@@ -50,16 +50,15 @@ public sealed class SafetyNotices : IDisposable
string.Format(CultureInfo.CurrentCulture, Strings.Notice_Refused_Title_Format, refused.GameName ?? Strings.Common_NotAvailable),
// "The session is still recorded" is true for every refusal since 2026-09-22: the loop holds a refused session
// open, unhooked, until the game exits (it was untrue for a process that could not be opened, 2026-09-21).
TurnedOff(RefusalText(refused.Reason, refused.Family, refused.Signal) + " " + Strings.Notice_Refused_Recording, refused.HookingTurnedOff), now);
TurnedOff(RefusalText(refused.Reason, refused.GuardReason, refused.Family, refused.Signal) + " " + Strings.Notice_Refused_Recording, refused.HookingTurnedOff), now);
case IpcMessageType.SafetyUnhook when IpcCodec.Payload<SafetyUnhookEvent>(envelope) is { } unhooked:
return new SafetyNotice(SafetyNoticeKind.Unhooked, Strings.Notice_Unhooked_Title,
TurnedOff(string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable), unhooked.HookingTurnedOff), now);
return new SafetyNotice(SafetyNoticeKind.Unhooked, Strings.Notice_Unhooked_Title, TurnedOff(UnhookText(unhooked), unhooked.HookingTurnedOff), now);
// The Agent's pre-scan of the library turned hooking off for a game the user had turned it on for (2026-09-25):
// not a session event, so none of a refusal's "this run is still recorded" — no run is going on.
case IpcMessageType.HookingTurnedOff when IpcCodec.Payload<HookingTurnedOffEvent>(envelope) is { } off:
return new SafetyNotice(SafetyNoticeKind.HookingOff,
string.Format(CultureInfo.CurrentCulture, Strings.Notice_HookingOff_Title_Format, off.GameName ?? Strings.Common_NotAvailable),
TurnedOff(RefusalText(off.Reason, off.Family, off.Signal), turnedOff: true), now);
TurnedOff(RefusalText(off.Reason, off.Reason, off.Family, off.Signal), turnedOff: true), now);
case IpcMessageType.CaptureDegraded when IpcCodec.Payload<CaptureDegradedEvent>(envelope) is { } degraded:
return new SafetyNotice(SafetyNoticeKind.Degraded, Strings.Notice_Degraded_Title,
string.Format(CultureInfo.CurrentCulture, Strings.Notice_Degraded_Body_Format, degraded.Reason), now);
@@ -71,7 +70,18 @@ public sealed class SafetyNotices : IDisposable
/// <summary>The finding turned the game's hooking off (2026-09-22): the notice says so, because the page will.</summary>
private static string TurnedOff(string text, bool turnedOff) => turnedOff ? text + " " + Shared.Strings.Safety_HookingTurnedOff : text;
private static string RefusalText(string reason, string? family, string? signal)
/// <summary>
/// A driver or service that started on the PC mid-session is said as that (beta.13, §S23-3) — not "detected while the
/// game was running … until you enable it again", which was untrue twice: such a finding turns no hooking off, and a
/// finding about the game turns it off for good (the turned-off sentence follows).
/// </summary>
private static string UnhookText(SafetyUnhookEvent unhooked) =>
Formats.IsMachineWide(unhooked.GuardReason) && unhooked.Family is { } family
? string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_MachineWide_Format, family, unhooked.Signal ?? Strings.Common_NotAvailable)
: string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable);
/// <summary><paramref name="reason"/> is the session's end reason; <paramref name="guardReason"/> the guard's own, when it named a family.</summary>
private static string RefusalText(string reason, string? guardReason, string? family, string? signal)
{
if (string.Equals(reason, "PreScanCouldNotVerify", StringComparison.Ordinal))
{
@@ -90,7 +100,7 @@ public sealed class SafetyNotices : IDisposable
return string.IsNullOrEmpty(reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(reason);
}
return string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Refused_Named_Format, family, signal ?? reason);
return Formats.NamedRefusal(guardReason, family, signal ?? reason);
}
private void OnEvent(object? sender, AgentEventArgs e)
@@ -0,0 +1,122 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace FrameLedger.App.Services;
/// <summary>
/// <c>ui.hide_scrollbars</c> (beta.14, owner request 2026-10-05): the App draws no scroll bars, and every scroller still
/// scrolls — with the wheel, the keyboard and touch. A bar's visibility is bound in its scroller's template, so no style can
/// reach it; this sets the scroller's own <see cref="ScrollBarVisibility"/> instead. One class handler on
/// <see cref="ScrollViewer"/>'s <c>Loaded</c>, registered at start beside <see cref="DialogKeyboard"/>, sees every scroller the
/// App shows, those inside a control's template too (a DataGrid's, a TextBox's, a rendered document's, a dialog's). While
/// on, an axis whose bar is <see cref="ScrollBarVisibility.Auto"/> or <see cref="ScrollBarVisibility.Visible"/> becomes
/// <see cref="ScrollBarVisibility.Hidden"/> — WPF's "no bar, still scrolls" — and its own value is remembered on it;
/// <see cref="ScrollBarVisibility.Disabled"/> is never touched, because a disabled axis lays its content out at the viewport's
/// size and wraps text. Off puts every remembered value back, on screen at once and on the next load for the rest.
/// </summary>
public static class ScrollBarHiding
{
private static readonly DependencyProperty _ownVerticalProperty =
DependencyProperty.RegisterAttached("OwnVertical", typeof(ScrollBarVisibility?), typeof(ScrollBarHiding), new PropertyMetadata(null));
private static readonly DependencyProperty _ownHorizontalProperty =
DependencyProperty.RegisterAttached("OwnHorizontal", typeof(ScrollBarVisibility?), typeof(ScrollBarHiding), new PropertyMetadata(null));
private static volatile bool _hidden;
private static int _registered;
/// <summary>Whether the bars are hidden right now.</summary>
public static bool Hidden => _hidden;
/// <summary>Registers the class handler, once per process.</summary>
public static void Register()
{
if (Interlocked.Exchange(ref _registered, 1) == 0)
{
EventManager.RegisterClassHandler(typeof(ScrollViewer), FrameworkElement.LoadedEvent, new RoutedEventHandler(OnLoaded), handledEventsToo: true);
}
}
/// <summary>
/// Sets the preference and applies it to every scroller of every open window — at once on the App's own thread, where
/// Settings changes it; from any other thread the windows are visited when that thread's dispatcher next runs.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD001:Avoid legacy thread switching APIs", Justification = "a WPF application has no JoinableTaskFactory; the windows belong to the dispatcher's thread, and posting to it never blocks (UiThread does the same)")]
public static void Apply(bool hidden)
{
_hidden = hidden;
if (System.Windows.Application.Current is not { } app)
{
return;
}
if (app.Dispatcher.CheckAccess())
{
ApplyToWindows(app);
}
else
{
_ = app.Dispatcher.InvokeAsync(() => ApplyToWindows(app));
}
}
private static void ApplyToWindows(System.Windows.Application app)
{
foreach (Window window in app.Windows)
{
ApplyUnder(window);
}
}
/// <summary>Applies the current preference to every scroller under <paramref name="root"/>: an open window, or a test's tree.</summary>
public static void ApplyUnder(DependencyObject root)
{
ArgumentNullException.ThrowIfNull(root);
if (root is ScrollViewer viewer)
{
Set(viewer);
}
int count = VisualTreeHelper.GetChildrenCount(root);
for (int i = 0; i < count; i++)
{
ApplyUnder(VisualTreeHelper.GetChild(root, i));
}
}
private static void OnLoaded(object sender, RoutedEventArgs e)
{
if (sender is ScrollViewer viewer)
{
Set(viewer);
}
}
private static void Set(ScrollViewer viewer)
{
Axis(viewer, ScrollViewer.VerticalScrollBarVisibilityProperty, _ownVerticalProperty);
Axis(viewer, ScrollViewer.HorizontalScrollBarVisibilityProperty, _ownHorizontalProperty);
}
private static void Axis(ScrollViewer viewer, DependencyProperty axis, DependencyProperty own)
{
var remembered = (ScrollBarVisibility?)viewer.GetValue(own);
if (_hidden)
{
if (remembered is null && viewer.GetValue(axis) is ScrollBarVisibility current and (ScrollBarVisibility.Auto or ScrollBarVisibility.Visible))
{
viewer.SetValue(own, current);
viewer.SetCurrentValue(axis, ScrollBarVisibility.Hidden);
}
}
else if (remembered is { } value)
{
viewer.ClearValue(own);
viewer.SetCurrentValue(axis, value);
}
}
}
+21
View File
@@ -304,6 +304,7 @@ public static class Strings
nameof(Exit_Crashed),
nameof(Exit_Crashed_Format),
nameof(Exit_CrashEvent),
nameof(Exit_CrashReporter_Format),
nameof(Exit_Degraded),
nameof(Exit_EndedNormally),
nameof(Exit_Ex_AccessViolation),
@@ -749,6 +750,7 @@ public static class Strings
nameof(Settings_AutoCheck_Body),
nameof(Settings_AutoCheck_Label),
nameof(Settings_Capture_Header),
nameof(Settings_Channel_Auto_Format),
nameof(Settings_Channel_Beta),
nameof(Settings_Channel_Stable),
nameof(Settings_Data_Header),
@@ -769,6 +771,8 @@ public static class Strings
nameof(Settings_Header),
nameof(Settings_HideAntiCheatHooking_Body),
nameof(Settings_HideAntiCheatHooking_Label),
nameof(Settings_HideScrollBars_Body),
nameof(Settings_HideScrollBars_Label),
nameof(Settings_HookedGames_Label),
nameof(Settings_HookedGames_Revoke),
nameof(Settings_Interval_Body),
@@ -873,6 +877,7 @@ public static class Strings
nameof(Summary_Tier2_Why_ConsentChanged),
nameof(Summary_Tier2_Why_Guard_Format),
nameof(Summary_Tier2_Why_HookOff),
nameof(Summary_Tier2_Why_MachineWide_Format),
nameof(Summary_Tier2_Why_Other_Format),
nameof(Summary_Tier2_Why_Unreadable),
nameof(Summary_Title_Format),
@@ -952,6 +957,7 @@ public static class Strings
nameof(Uninstall_DataFolder_Body),
nameof(Uninstall_DataFolder_Title),
nameof(Update_AgentStillRunning),
nameof(Update_Available_Body_Delta_Format),
nameof(Update_Available_Body_Format),
nameof(Update_Available_Title_Format),
nameof(Update_Banner_Applying_Format),
@@ -973,6 +979,7 @@ public static class Strings
nameof(Update_Notes_Header),
nameof(Update_NotInstalled),
nameof(Update_OpenReleases),
nameof(Update_PayloadInUse_Format),
nameof(Update_Toast_Body_Format),
nameof(Update_Toast_Title),
nameof(Update_Unsigned_Footer),
@@ -1532,6 +1539,8 @@ public static class Strings
public static string Exit_CrashEvent => ResourceManager.GetString(nameof(Exit_CrashEvent), Culture) ?? nameof(Exit_CrashEvent);
public static string Exit_CrashReporter_Format => ResourceManager.GetString(nameof(Exit_CrashReporter_Format), Culture) ?? nameof(Exit_CrashReporter_Format);
public static string Exit_Degraded => ResourceManager.GetString(nameof(Exit_Degraded), Culture) ?? nameof(Exit_Degraded);
public static string Exit_EndedNormally => ResourceManager.GetString(nameof(Exit_EndedNormally), Culture) ?? nameof(Exit_EndedNormally);
@@ -2422,6 +2431,8 @@ public static class Strings
public static string Settings_Capture_Header => ResourceManager.GetString(nameof(Settings_Capture_Header), Culture) ?? nameof(Settings_Capture_Header);
public static string Settings_Channel_Auto_Format => ResourceManager.GetString(nameof(Settings_Channel_Auto_Format), Culture) ?? nameof(Settings_Channel_Auto_Format);
public static string Settings_Channel_Beta => ResourceManager.GetString(nameof(Settings_Channel_Beta), Culture) ?? nameof(Settings_Channel_Beta);
public static string Settings_Channel_Stable => ResourceManager.GetString(nameof(Settings_Channel_Stable), Culture) ?? nameof(Settings_Channel_Stable);
@@ -2462,6 +2473,10 @@ public static class Strings
public static string Settings_HideAntiCheatHooking_Label => ResourceManager.GetString(nameof(Settings_HideAntiCheatHooking_Label), Culture) ?? nameof(Settings_HideAntiCheatHooking_Label);
public static string Settings_HideScrollBars_Body => ResourceManager.GetString(nameof(Settings_HideScrollBars_Body), Culture) ?? nameof(Settings_HideScrollBars_Body);
public static string Settings_HideScrollBars_Label => ResourceManager.GetString(nameof(Settings_HideScrollBars_Label), Culture) ?? nameof(Settings_HideScrollBars_Label);
public static string Settings_HookedGames_Label => ResourceManager.GetString(nameof(Settings_HookedGames_Label), Culture) ?? nameof(Settings_HookedGames_Label);
public static string Settings_HookedGames_Revoke => ResourceManager.GetString(nameof(Settings_HookedGames_Revoke), Culture) ?? nameof(Settings_HookedGames_Revoke);
@@ -2670,6 +2685,8 @@ public static class Strings
public static string Summary_Tier2_Why_HookOff => ResourceManager.GetString(nameof(Summary_Tier2_Why_HookOff), Culture) ?? nameof(Summary_Tier2_Why_HookOff);
public static string Summary_Tier2_Why_MachineWide_Format => ResourceManager.GetString(nameof(Summary_Tier2_Why_MachineWide_Format), Culture) ?? nameof(Summary_Tier2_Why_MachineWide_Format);
public static string Summary_Tier2_Why_Other_Format => ResourceManager.GetString(nameof(Summary_Tier2_Why_Other_Format), Culture) ?? nameof(Summary_Tier2_Why_Other_Format);
public static string Summary_Tier2_Why_Unreadable => ResourceManager.GetString(nameof(Summary_Tier2_Why_Unreadable), Culture) ?? nameof(Summary_Tier2_Why_Unreadable);
@@ -2828,6 +2845,8 @@ public static class Strings
public static string Update_AgentStillRunning => ResourceManager.GetString(nameof(Update_AgentStillRunning), Culture) ?? nameof(Update_AgentStillRunning);
public static string Update_Available_Body_Delta_Format => ResourceManager.GetString(nameof(Update_Available_Body_Delta_Format), Culture) ?? nameof(Update_Available_Body_Delta_Format);
public static string Update_Available_Body_Format => ResourceManager.GetString(nameof(Update_Available_Body_Format), Culture) ?? nameof(Update_Available_Body_Format);
public static string Update_Available_Title_Format => ResourceManager.GetString(nameof(Update_Available_Title_Format), Culture) ?? nameof(Update_Available_Title_Format);
@@ -2870,6 +2889,8 @@ public static class Strings
public static string Update_OpenReleases => ResourceManager.GetString(nameof(Update_OpenReleases), Culture) ?? nameof(Update_OpenReleases);
public static string Update_PayloadInUse_Format => ResourceManager.GetString(nameof(Update_PayloadInUse_Format), Culture) ?? nameof(Update_PayloadInUse_Format);
public static string Update_Toast_Body_Format => ResourceManager.GetString(nameof(Update_Toast_Body_Format), Culture) ?? nameof(Update_Toast_Body_Format);
public static string Update_Toast_Title => ResourceManager.GetString(nameof(Update_Toast_Title), Culture) ?? nameof(Update_Toast_Title);
+29 -1
View File
@@ -1457,6 +1457,10 @@
<value>理由: ガードが拒否しました — {0}({1})。</value>
<comment>review</comment>
</data>
<data name="Summary_Tier2_Why_MachineWide_Format" xml:space="preserve">
<value>理由: このPCで {0} が動作していました({1})— ドライバーまたはサービスです。これが動作している間、FrameLedger はどのゲームにも注入しません。</value>
<comment>review</comment>
</data>
<data name="Summary_Tier2_Why_HookOff" xml:space="preserve">
<value>理由: このゲームのフックはオフだったため、何も読み込まれていません。</value>
<comment>review</comment>
@@ -2046,7 +2050,7 @@
<comment>review</comment>
</data>
<data name="Settings_UpdateChannel_Body" xml:space="preserve">
<value>安定版のみ、または安定版とプレリリース。見つかった更新はバックグラウンドでダウンロードされ、再起動時にのみ適用されます。ゲームがフックされている間は適用されません。</value>
<value>自動は、このコピーに合わせます。プレリリース版はプレリリースを、正式版は正式リリースを探します。安定版、またはベータ(安定版とプレリリース)を選ぶこともできます。見つかった更新はバックグラウンドでダウンロードされ、再起動時にのみ適用されます。ゲームがフックされている間は適用されません。</value>
<comment>review</comment>
</data>
<data name="Settings_UpdateChannel_Label" xml:space="preserve">
@@ -3837,4 +3841,28 @@
<value>FrameLedger に対するあなたのライセンスです。参考として表示しています。プログラムを実行するために同意する必要はありません(GPLv3 第 9 条)。</value>
<comment>review</comment>
</data>
<data name="Settings_HideScrollBars_Label" xml:space="preserve">
<value>スクロール バーを非表示にする</value>
<comment>review</comment>
</data>
<data name="Settings_HideScrollBars_Body" xml:space="preserve">
<value>アプリ内のどこにもスクロール バーを表示しません。マウス ホイール、キーボード、タッチでのスクロールは引き続き使えます。</value>
<comment>review</comment>
</data>
<data name="Settings_Channel_Auto_Format" xml:space="preserve">
<value>自動({0})</value>
<comment>review</comment>
</data>
<data name="Update_Available_Body_Delta_Format" xml:space="preserve">
<value>バージョン {0} を今すぐダウンロードできます:約 {1} MB(お使いのバージョンからの変更分のみ。適用できない場合は {2} MB の完全なパッケージ)。適用は FrameLedger の再起動時のみで、ゲームがフックされている間は行われません。</value>
<comment>review</comment>
</data>
<data name="Update_PayloadInUse_Format" xml:space="preserve">
<value>{0} は FrameLedger が計測したゲームにまだ読み込まれているため、更新は途中で失敗します。そのゲームを終了してから、再起動して更新してください。</value>
<comment>review</comment>
</data>
<data name="Exit_CrashReporter_Format" xml:space="preserve">
<value>クラッシュ(ゲームがクラッシュ レポーター {0} を起動しました)</value>
<comment>review</comment>
</data>
</root>
+22 -1
View File
@@ -1098,6 +1098,9 @@
<data name="Summary_Tier2_Why_Guard_Format" xml:space="preserve">
<value>Why: the guard refused — {0} ({1}).</value>
</data>
<data name="Summary_Tier2_Why_MachineWide_Format" xml:space="preserve">
<value>Why: {0} was running on this PC ({1}) — a driver or service — and FrameLedger injects into no game while it runs.</value>
</data>
<data name="Summary_Tier2_Why_HookOff" xml:space="preserve">
<value>Why: hooking was off for this game, so nothing was injected.</value>
</data>
@@ -1540,7 +1543,7 @@
<value>Start FrameLedger with Windows</value>
</data>
<data name="Settings_UpdateChannel_Body" xml:space="preserve">
<value>Stable, or stable plus pre-releases. A found update downloads in the background and is applied only when you restart — never while a game is hooked.</value>
<value>Automatic follows this copy: a pre-release looks for pre-releases, a release for releases. Or choose Stable, or Beta (stable plus pre-releases). A found update downloads in the background and is applied only when you restart — never while a game is hooked.</value>
</data>
<data name="Settings_UpdateChannel_Label" xml:space="preserve">
<value>Channel</value>
@@ -2888,4 +2891,22 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="FirstRun_Doc_InformationNote" xml:space="preserve">
<value>Your licence to FrameLedger, shown for information: you do not need to accept it to run the program (GPLv3 section 9).</value>
</data>
<data name="Settings_HideScrollBars_Label" xml:space="preserve">
<value>Hide scroll bars</value>
</data>
<data name="Settings_HideScrollBars_Body" xml:space="preserve">
<value>No scroll bars are drawn anywhere in the app. Everything still scrolls with the mouse wheel, the keyboard and touch.</value>
</data>
<data name="Settings_Channel_Auto_Format" xml:space="preserve">
<value>Automatic ({0})</value>
</data>
<data name="Update_Available_Body_Delta_Format" xml:space="preserve">
<value>Version {0} can be downloaded now: about {1} MB — only what changed since your version, or the full {2} MB package if that cannot be applied. It is applied only when you restart FrameLedger, and never while a game is hooked.</value>
</data>
<data name="Update_PayloadInUse_Format" xml:space="preserve">
<value>{0} is still loaded in a game FrameLedger measured, and the update would fail half way. Close that game, then restart to update.</value>
</data>
<data name="Exit_CrashReporter_Format" xml:space="preserve">
<value>crashed (the game started its crash reporter, {0})</value>
</data>
</root>
+22 -1
View File
@@ -1093,6 +1093,9 @@
<data name="Summary_Tier2_Why_Guard_Format" xml:space="preserve">
<value>Lý do: guard đã từ chối — {0} ({1}).</value>
</data>
<data name="Summary_Tier2_Why_MachineWide_Format" xml:space="preserve">
<value>Lý do: {0} đang chạy trên máy này ({1}) — một driver hoặc service — và FrameLedger không inject vào game nào khi nó còn chạy.</value>
</data>
<data name="Summary_Tier2_Why_HookOff" xml:space="preserve">
<value>Lý do: hooking đang tắt cho game này, nên không có gì được inject.</value>
</data>
@@ -1535,7 +1538,7 @@
<value>Khởi động FrameLedger cùng Windows</value>
</data>
<data name="Settings_UpdateChannel_Body" xml:space="preserve">
<value>Ổn định, hoặc ổn định kèm bản tiền phát hành. Bản cập nhật tìm thấy sẽ tải ở nền và chỉ được áp dụng khi bạn khởi động lại — không bao giờ khi game đang được hook.</value>
<value>Tự động theo bản đang dùng: bản tiền phát hành tìm bản tiền phát hành, bản chính thức tìm bản chính thức. Hoặc chọn Ổn định, hay Beta (ổn định kèm bản tiền phát hành). Bản cập nhật tìm thấy sẽ tải ở nền và chỉ được áp dụng khi bạn khởi động lại — không bao giờ khi game đang được hook.</value>
</data>
<data name="Settings_UpdateChannel_Label" xml:space="preserve">
<value>Kênh</value>
@@ -2883,4 +2886,22 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="FirstRun_Doc_InformationNote" xml:space="preserve">
<value>Giấy phép của bạn đối với FrameLedger, hiển thị để bạn biết: bạn không cần chấp nhận nó để chạy chương trình (GPLv3 mục 9).</value>
</data>
<data name="Settings_HideScrollBars_Label" xml:space="preserve">
<value>Ẩn thanh cuộn</value>
</data>
<data name="Settings_HideScrollBars_Body" xml:space="preserve">
<value>Không vẽ thanh cuộn ở bất kỳ đâu trong ứng dụng. Mọi thứ vẫn cuộn được bằng con lăn chuột, bàn phím và cảm ứng.</value>
</data>
<data name="Settings_Channel_Auto_Format" xml:space="preserve">
<value>Tự động ({0})</value>
</data>
<data name="Update_Available_Body_Delta_Format" xml:space="preserve">
<value>Có thể tải phiên bản {0} ngay bây giờ: khoảng {1} MB — chỉ phần thay đổi so với phiên bản của bạn, hoặc gói đầy đủ {2} MB nếu phần đó không áp dụng được. Bản cập nhật chỉ được áp dụng khi bạn khởi động lại FrameLedger, và không bao giờ khi game đang được hook.</value>
</data>
<data name="Update_PayloadInUse_Format" xml:space="preserve">
<value>{0} vẫn đang được nạp trong một game mà FrameLedger đã đo, và bản cập nhật sẽ thất bại giữa chừng. Hãy đóng game đó, rồi khởi động lại để cập nhật.</value>
</data>
<data name="Exit_CrashReporter_Format" xml:space="preserve">
<value>bị crash (game đã mở trình báo lỗi crash của nó, {0})</value>
</data>
</root>
@@ -16,6 +16,12 @@ public interface IUpdateClient
/// <summary>The installed version as the package manifest states it, or null when not installed.</summary>
string? CurrentVersion { get; }
/// <summary>
/// A package an earlier run downloaded and nobody applied, or null — read from the install folder, no feed request
/// (beta.14: with Velopack's own apply-at-start switched off, the App offers it as any other).
/// </summary>
UpdateCandidate? FindPendingRestart();
/// <summary>One feed request; null when the installed version is current.</summary>
/// <exception cref="UpdateException">The feed could not be read.</exception>
Task<UpdateCandidate?> CheckAsync(bool includePrereleases, CancellationToken ct = default);
@@ -0,0 +1,59 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.IO;
namespace FrameLedger.App.Update;
/// <summary>
/// Whether a library FrameLedger loads into games is still loaded in one (beta.14). The Overlay is never unloaded from a live
/// game (<c>17_HOOK_ENGINE</c>), so after a capture is stopped mid-game, or an Agent is restarted, the game keeps
/// <c>current\FrameLedger.Overlay.dll</c> mapped until it exits — and Velopack, which swaps the whole install folder, then
/// fails half way, after the App has already quit. A mapped image cannot be opened for writing (Windows answers with a
/// sharing violation), so the check asks the file system and opens no process: nothing about the game is read.
/// </summary>
public static class PayloadInUse
{
/// <summary>The libraries a game can hold: the Overlay FrameLedger injects, and the Vulkan layer a Vulkan game loads.</summary>
public static IReadOnlyList<string> Files { get; } = ["FrameLedger.Overlay.dll", "FrameLedger.VkLayer.dll"];
private const int _sharingViolation = unchecked((int)0x80070020);
private const int _lockViolation = unchecked((int)0x80070021);
private const int _userMappedFile = unchecked((int)0x800704C8);
/// <summary>The first of <see cref="Files"/> under <paramref name="directory"/> that something still holds, or null.</summary>
public static string? Find(string directory)
{
ArgumentException.ThrowIfNullOrWhiteSpace(directory);
foreach (string name in Files)
{
string path = Path.Combine(directory, name);
if (File.Exists(path) && IsHeld(path))
{
return name;
}
}
return null;
}
private static bool IsHeld(string path)
{
try
{
using (new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
{
return false;
}
}
catch (IOException ex) when (ex.HResult is _sharingViolation or _lockViolation or _userMappedFile)
{
return true;
}
catch (UnauthorizedAccessException)
{
// Not writable to this user: the updater could not replace it either.
return true;
}
}
}
+5 -2
View File
@@ -5,7 +5,8 @@ namespace FrameLedger.App.Update;
/// <summary>
/// The uninstall hook's decisions (<c>12_BUILD</c> §Publish &amp; package: "uninstalled → unregister the layer, remove
/// the scheduled task, ask about the data folder"), over delegates so a test runs it without a pipe, a registry, a
/// the scheduled task, ask about the data folder" — and since beta.14 remove "Start FrameLedger with Windows", which named an
/// executable the uninstaller deletes), over delegates so a test runs it without a pipe, a registry, a
/// Task Scheduler or a data folder. Every step is independent: a failure in one is logged and the next still
/// runs, and the data folder is deleted only on an explicit yes — a question that goes unanswered inside
/// Velopack's 30 s budget leaves the folder where it is.
@@ -14,6 +15,7 @@ public sealed class UninstallHook(
Func<bool> stopAgent,
Func<bool> unregisterLayer,
Func<bool> removeTask,
Func<bool> removeRunValue,
Func<bool> askDeleteData,
Action deleteData,
Action<string> log)
@@ -23,6 +25,7 @@ public sealed class UninstallHook(
bool agent = Step("agent shutdown", stopAgent);
bool layer = Step("vulkan layer unregister", unregisterLayer);
bool task = Step("logon task remove", removeTask);
bool run = Step("start with windows remove", removeRunValue);
bool asked = false;
bool deleted = false;
if (Step("data folder question", () =>
@@ -38,7 +41,7 @@ public sealed class UninstallHook(
});
}
var outcome = new UninstallOutcome(agent, layer, task, asked, deleted);
var outcome = new UninstallOutcome(agent, layer, task, run, asked, deleted);
log("uninstall: " + outcome);
return outcome;
}
@@ -4,4 +4,4 @@
namespace FrameLedger.App.Update;
/// <summary>What the uninstall hook did, for its log line and its test.</summary>
public sealed record UninstallOutcome(bool AgentAsked, bool LayerUnregistered, bool TaskRemoved, bool DataAsked, bool DataDeleted);
public sealed record UninstallOutcome(bool AgentAsked, bool LayerUnregistered, bool TaskRemoved, bool RunValueRemoved, bool DataAsked, bool DataDeleted);
+10 -2
View File
@@ -3,5 +3,13 @@
namespace FrameLedger.App.Update;
/// <summary>A release newer than the installed one, as the feed describes it: the version, its notes (the GitHub release body, Markdown), the full package's size.</summary>
public sealed record UpdateCandidate(string Version, string? NotesMarkdown, long SizeBytes);
/// <summary>
/// A release newer than the installed one, as the feed describes it: the version, its notes (the GitHub release body,
/// Markdown), the full package's size, and — since beta.14 — the size of the delta packages from the installed version
/// when the feed has them (<see cref="DeltaBytes"/>), which is what Velopack downloads unless they fail to apply.
/// </summary>
public sealed record UpdateCandidate(string Version, string? NotesMarkdown, long SizeBytes)
{
/// <summary>The deltas' size together, or null when there is none and the full package is the download.</summary>
public long? DeltaBytes { get; init; }
}
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.App.Update;
/// <summary>
/// Which releases a check asks for (beta.14, owner decision D47). <c>update.channel</c> is <c>auto</c> unless the user chose:
/// a copy that is itself a pre-release looks for pre-releases and a release looks for releases. Until beta.14 the default was
/// <c>stable</c> while every release so far is a GitHub pre-release, so a copy left on its defaults never found an update —
/// the owner's own updater log read "No releases found" from the day the ledger was reset. A stored <c>stable</c> or
/// <c>beta</c> is a choice the user made, and it wins.
/// </summary>
public static class UpdateChannelPolicy
{
public const string Automatic = "auto";
public const string Stable = "stable";
public const string Beta = "beta";
/// <summary>Whether a version is a pre-release in SemVer's sense: a <c>-</c> before any build metadata (<c>0.1.0-beta.14</c>).</summary>
public static bool IsPrerelease(string? version)
{
if (string.IsNullOrWhiteSpace(version))
{
return false;
}
int build = version.IndexOf('+', StringComparison.Ordinal);
int dash = version.IndexOf('-', StringComparison.Ordinal);
return dash > 0 && (build < 0 || dash < build);
}
/// <summary>Whether a check on <paramref name="channel"/> asks for pre-releases, for a copy running <paramref name="runningVersion"/>.</summary>
public static bool IncludesPrereleases(string? channel, string? runningVersion) => channel switch
{
Beta => true,
Stable => false,
_ => IsPrerelease(runningVersion),
};
}
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Sockets;
@@ -12,7 +11,7 @@ namespace FrameLedger.App.Update;
/// <summary>
/// <c>11_UPDATER</c> §Error mapping as a function of the exception Velopack's client threw: the HTTP status when
/// there is one (404 → <see cref="UpdateFailure.NotFound"/>, 403/429 → <see cref="UpdateFailure.RateLimited"/>,
/// 5xx → <see cref="UpdateFailure.Server"/>), the transport failures → <see cref="UpdateFailure.Offline"/>, a
/// 5xx → <see cref="UpdateFailure.Server"/>), the transport failures (never a local disk's) → <see cref="UpdateFailure.Offline"/>, a
/// checksum → <see cref="UpdateFailure.Corrupt"/>, the rest → <see cref="UpdateFailure.Unknown"/>. Walks the inner
/// chain, because the source wraps what its downloader threw.
/// </summary>
@@ -40,7 +39,9 @@ public static class UpdateFailureMapper
HttpRequestException { StatusCode: { } status } when (int)status >= 500 => UpdateFailure.Server,
HttpRequestException { StatusCode: null } => UpdateFailure.Offline,
HttpRequestException => UpdateFailure.Unknown,
TaskCanceledException or TimeoutException or SocketException or IOException => UpdateFailure.Offline,
// An I/O error is "offline" only from the network (beta.14): a full disk or a locked file is not, and an IOException
// that wraps a socket error is classified at the socket, one step down the chain.
TaskCanceledException or TimeoutException or SocketException or HttpIOException => UpdateFailure.Offline,
_ => null,
};
}
@@ -9,7 +9,7 @@ using Serilog;
namespace FrameLedger.App.Update;
/// <summary>
/// The startup leg of <c>11_UPDATER</c> §Flow: the silent check 5 s after the host is up (the spec's "5 s after UI
/// The startup leg of <c>11_UPDATER</c> §Flow: a package an earlier run left downloaded offered at once (beta.14), the silent check 5 s after the host is up (the spec's "5 s after UI
/// idle", measured from start because the shell shows synchronously inside it), and — on the first run after an
/// update — the logon task's action path re-validated, because the updater rewrote the install directory
/// (<c>LogonTaskState.Stale</c> is the signal; <c>--install-task</c> the repair, this user's own task).
@@ -27,6 +27,8 @@ internal sealed class UpdateHostedService(UpdateService updates, IMaintenanceSta
await RepairTaskAsync(stoppingToken).ConfigureAwait(false);
}
// A package an earlier run downloaded is offered first, from the install folder; the check then has nothing to do.
updates.AdoptPending();
await Task.Delay(_startupDelay, stoppingToken).ConfigureAwait(false);
await updates.CheckSilentlyAsync(stoppingToken).ConfigureAwait(false);
}
+22 -1
View File
@@ -24,7 +24,7 @@ public sealed class UpdatePrompts(IUrlOpener urls, BugReportFlow bugReports) : I
var body = new StackPanel();
body.Children.Add(new System.Windows.Controls.TextBlock
{
Text = string.Format(CultureInfo.CurrentCulture, Strings.Update_Available_Body_Format, candidate.Version, candidate.SizeBytes / (1024 * 1024)),
Text = OfferText(candidate),
TextWrapping = TextWrapping.Wrap,
});
if (!string.IsNullOrWhiteSpace(candidate.NotesMarkdown))
@@ -50,6 +50,27 @@ public sealed class UpdatePrompts(IUrlOpener urls, BugReportFlow bugReports) : I
return result == MessageBoxResult.Primary;
}
/// <summary>
/// The offer's first line. Since beta.14 it says the download Velopack will make: the deltas from the installed version
/// when the feed has them — 1.6 MB for beta.12 → beta.13 — with the full package named as the fallback; it said the full
/// package's ~102 MB even when the delta was what came.
/// </summary>
public static string OfferText(UpdateCandidate candidate)
{
ArgumentNullException.ThrowIfNull(candidate);
string full = Megabytes(candidate.SizeBytes);
return candidate.DeltaBytes is { } delta && delta < candidate.SizeBytes
? string.Format(CultureInfo.CurrentCulture, Strings.Update_Available_Body_Delta_Format, candidate.Version, Megabytes(delta), full)
: string.Format(CultureInfo.CurrentCulture, Strings.Update_Available_Body_Format, candidate.Version, full);
}
/// <summary>Whole megabytes, one decimal under ten ("1.5", "102").</summary>
private static string Megabytes(long bytes)
{
double mb = bytes / (1024.0 * 1024.0);
return mb.ToString(mb < 10 ? "0.#" : "0", CultureInfo.CurrentCulture);
}
public Task UpToDateAsync(string version, CancellationToken ct = default) =>
ShowAsync(Strings.Menu_Help_CheckUpdates, string.Format(CultureInfo.CurrentCulture, Strings.Update_UpToDate_Format, version), ct);
+61 -7
View File
@@ -20,12 +20,22 @@ namespace FrameLedger.App.Update;
/// the host once the pipe has dropped; Velopack waits for the exit, applies, and restarts the App, which starts
/// the Agent beside itself as it always does.
/// </summary>
/// <remarks>
/// beta.14 (the update audit): Velopack's own apply-at-start is off (<see cref="VelopackHooks"/>), so a package an earlier
/// run downloaded is adopted here (<see cref="AdoptPending"/>) and goes through FR-12 and the Agent's stop like any other —
/// until then the next start applied it inside <c>VelopackApp.Run</c>, killing the Agent, before any of this ran. The
/// channel follows the running copy unless the user chose one (<see cref="UpdateChannelPolicy"/>, D47); an apply waits
/// while a game still has the Overlay loaded (<see cref="PayloadInUse"/>) and while an Agent waits on the administrator
/// prompt; the stop budget outlasts the Agent's own shutdown grace.
/// </remarks>
public sealed partial class UpdateService : ObservableObject, IDisposable
{
private static readonly TimeSpan _defaultAgentStopTimeout = TimeSpan.FromSeconds(10);
/// <summary>The Agent's own shutdown grace (it finalizes its sessions inside it), and five seconds to leave after it.</summary>
internal static readonly TimeSpan DefaultAgentStopTimeout = IpcProtocol.AgentShutdownGrace + TimeSpan.FromSeconds(5);
private readonly TimeSpan _agentStopTimeout;
private readonly Func<bool> _agentHeld;
private readonly Func<string?> _payloadInUse;
private readonly IUpdateClient _client;
private readonly IAgentLink _agent;
private readonly RegisteredSettings _settings;
@@ -47,14 +57,17 @@ public sealed partial class UpdateService : ObservableObject, IDisposable
/// <summary>
/// The flow over its ports; subscribes to the Agent link for the session facts FR-12 needs. <paramref name="agentStopTimeout"/>
/// is how long the apply waits for the Agent to stop after <c>Shutdown</c> (10 s), overridable as a test's clock;
/// <paramref name="agentHeld"/> is whether an Agent process still holds the data folder (the instance lock), a test's own.
/// is how long the apply waits for the Agent to stop after <c>Shutdown</c> (<see cref="DefaultAgentStopTimeout"/>), overridable
/// as a test's clock; <paramref name="agentHeld"/> is whether an Agent process still holds the data folder — its instance
/// lock, or the marker of one waiting on the administrator prompt — and <paramref name="payloadInUse"/> which library a game
/// still has loaded from the install folder, both a test's own.
/// </summary>
public UpdateService(IUpdateClient client, IAgentLink agent, RegisteredSettings settings, IUpdatePrompts prompts, IShellPresence shell, IMessageStrip strip,
TimeSpan? agentStopTimeout = null, Func<bool>? agentHeld = null)
TimeSpan? agentStopTimeout = null, Func<bool>? agentHeld = null, Func<string?>? payloadInUse = null)
{
_agentStopTimeout = agentStopTimeout ?? _defaultAgentStopTimeout;
_agentHeld = agentHeld ?? (static () => Infrastructure.Startup.AgentInstanceLock.IsHeld(Services.UiPaths.DataDirectory));
_agentStopTimeout = agentStopTimeout ?? DefaultAgentStopTimeout;
_agentHeld = agentHeld ?? (static () => AgentHolds(Services.UiPaths.DataDirectory));
_payloadInUse = payloadInUse ?? (static () => PayloadInUse.Find(AppContext.BaseDirectory));
_client = client ?? throw new ArgumentNullException(nameof(client));
_agent = agent ?? throw new ArgumentNullException(nameof(agent));
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
@@ -82,6 +95,34 @@ public sealed partial class UpdateService : ObservableObject, IDisposable
_agent.EventReceived -= OnAgentEvent;
}
/// <summary>
/// Whether an Agent holds <paramref name="dataDirectory"/>: its instance lock, or — since beta.14 — the marker of one waiting on
/// the administrator prompt, which holds no lock yet and was stopped by nothing (Velopack's updater killed it).
/// </summary>
internal static bool AgentHolds(string dataDirectory) =>
Infrastructure.Startup.AgentInstanceLock.IsHeld(dataDirectory) || Infrastructure.Startup.ElevationMarker.IsHeld(dataDirectory);
/// <summary>
/// A package an earlier run downloaded and nobody applied (beta.14): Ready, or Deferred while a session runs — no feed request.
/// Velopack applied it at the next start until then, before FR-12 or the Agent's stop could run. Called before the startup check.
/// </summary>
public void AdoptPending()
{
if (!_client.IsInstalled || Stage != UpdateStage.Idle || _client.FindPendingRestart() is not { } pending)
{
return;
}
Log.Information("update: {Version} was downloaded by an earlier run and is waiting for a restart", pending.Version);
_pending = pending;
Post(() =>
{
Version = pending.Version;
Percent = 100;
Settle();
});
}
/// <summary>The startup check: skipped for an uninstalled copy and when the setting is off; every failure is a log line, never a dialog (NFR-10).</summary>
public async Task CheckSilentlyAsync(CancellationToken ct = default)
{
@@ -172,6 +213,7 @@ public sealed partial class UpdateService : ObservableObject, IDisposable
/// Then <c>Shutdown</c> to the Agent, the relaunch held, the pipe watched until it drops, the updater told to
/// wait for this process, and the host ended. An Agent that does not stop in time leaves everything as it was.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
public async Task RestartToUpdateAsync(CancellationToken ct = default)
{
UpdateCandidate? pending = _pending;
@@ -187,6 +229,16 @@ public sealed partial class UpdateService : ObservableObject, IDisposable
return;
}
// A game FrameLedger measured earlier can still have the Overlay loaded from the install folder; the swap would fail
// half way after this App had quit. Asked before the Agent is stopped, so a refusal leaves it running.
if (_payloadInUse() is { } held)
{
Log.Information("update: {File} is still loaded by a running game; the apply waits", held);
Stage = UpdateStage.Ready;
_strip.Warn(Strings.Update_Banner_Title, string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.Update_PayloadInUse_Format, held));
return;
}
Stage = UpdateStage.Applying;
_agent.SetLaunchHold(true);
if (!await StopAgentAsync(ct).ConfigureAwait(true))
@@ -217,7 +269,9 @@ public sealed partial class UpdateService : ObservableObject, IDisposable
private async Task<UpdateCandidate?> CheckCoreAsync(CancellationToken ct)
{
Post(() => Stage = UpdateStage.Checking);
bool prereleases = string.Equals(await _settings.GetAsync(SettingsRegistry.UpdateChannel, ct).ConfigureAwait(false), "beta", StringComparison.Ordinal);
// D47 (beta.14): `auto` follows this copy; a stored `stable` or `beta` is the user's choice.
string channel = await _settings.GetAsync(SettingsRegistry.UpdateChannel, ct).ConfigureAwait(false);
bool prereleases = UpdateChannelPolicy.IncludesPrereleases(channel, _client.CurrentVersion ?? UiIdentity.Version);
UpdateCandidate? candidate = await _client.CheckAsync(prereleases, ct).ConfigureAwait(false);
if (candidate is null)
{
+33 -3
View File
@@ -21,6 +21,15 @@ namespace FrameLedger.App.Update;
/// is <see cref="UninstallHook"/> over the real pieces. A restart after an update sets <see cref="UpdateRestart"/>
/// so the host re-validates the logon task's action path.
/// </summary>
/// <remarks>
/// beta.14 (the update audit). <b>Velopack's apply-at-start is off</b>: it is on by default, and a package the startup check
/// downloaded was applied by the next start of this executable inside <see cref="VelopackApp.Run"/> — before FR-12 could
/// ask whether a session runs and before the Agent could be stopped; its updater killed the Agent instead ("Killing
/// process: …FrameLedger.Agent.exe", the owner's own log). <c>UpdateService.AdoptPending</c> offers such a package now.
/// Velopack's own diagnostics go to this App's log (<see cref="VelopackSerilogLogger"/>). An update Velopack starts itself — the
/// installer run over an installed copy — asks the Agent to stop first, as the uninstaller does; that hook runs in the
/// version being replaced, so it first works for the update after beta.14.
/// </remarks>
internal static class VelopackHooks
{
/// <summary>
@@ -34,9 +43,19 @@ internal static class VelopackHooks
private static readonly TimeSpan _exitTimeout = TimeSpan.FromSeconds(5);
public static VelopackApp Configure(VelopackApp app) => app
.SetAutoApplyOnStartup(false)
.SetLogger(new VelopackSerilogLogger())
.OnRestarted(static _ => UpdateRestart.Detected = true)
.OnBeforeUpdateFastCallback(static _ => BeforeUpdate())
.OnBeforeUninstallFastCallback(static _ => BeforeUninstall());
/// <summary>Velopack is about to replace this version: the Agent finalizes its sessions and leaves, rather than being killed.</summary>
private static void BeforeUpdate()
{
bool asked = StopAgent();
Log("update.log", "before update: " + (asked ? "the Agent was asked to stop" : "no Agent answered; nothing to stop"));
}
private static void BeforeUninstall()
{
string manifest = Path.Combine(VkLayerLaunchEnvironment.DefaultDirectory, VkLayerLaunchEnvironment.ManifestFileName);
@@ -44,11 +63,22 @@ internal static class VelopackHooks
stopAgent: StopAgent,
unregisterLayer: () => new VkLayerRegistration().Unregister(manifest),
removeTask: static () => new LogonTask().Remove() is null,
removeRunValue: static () =>
{
var run = new RunAtLogonRegistry();
if (!run.IsSet)
{
return false;
}
run.Apply(enabled: false);
return true;
},
askDeleteData: static () => UninstallHook.AreSeparate(UiPaths.DataDirectory, AppContext.BaseDirectory)
? System.Windows.MessageBox.Show(Strings.Uninstall_DataFolder_Body, Strings.Uninstall_DataFolder_Title, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes
: throw new InvalidOperationException($"the install ({AppContext.BaseDirectory}) and the data folder ({UiPaths.DataDirectory}) overlap; nothing is deleted"),
deleteData: static () => Directory.Delete(UiPaths.DataDirectory, recursive: true),
log: Log);
log: static line => Log("uninstall.log", line));
hook.Run();
}
@@ -109,7 +139,7 @@ internal static class VelopackHooks
}
/// <summary>Serilog is not configured this early; the hook's own file under <c>logs/</c>, appended, never thrown from.</summary>
private static void Log(string line)
private static void Log(string file, string line)
{
try
{
@@ -120,7 +150,7 @@ internal static class VelopackHooks
}
Directory.CreateDirectory(UiPaths.Logs);
File.AppendAllText(Path.Combine(UiPaths.Logs, "uninstall.log"), $"[{DateTimeOffset.UtcNow:O}] {line}{Environment.NewLine}");
File.AppendAllText(Path.Combine(UiPaths.Logs, file), $"[{DateTimeOffset.UtcNow:O}] {line}{Environment.NewLine}");
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using Serilog;
using Serilog.Events;
using Velopack.Logging;
namespace FrameLedger.App.Update;
/// <summary>
/// Velopack's own diagnostics in the App's log (beta.14), each line prefixed <c>velopack:</c> — whether an update came as a
/// delta or as the full package, which processes it stopped, why an apply failed. Until then they were only in Velopack's
/// file under <c>%LOCALAPPDATA%\velopack</c>, which the bug report does not collect. Set in <c>Program.Main</c>, before Serilog
/// is configured: each line reads <see cref="Log.Logger"/> when it is written, so the early ones go nowhere and the rest arrive.
/// </summary>
internal sealed class VelopackSerilogLogger : IVelopackLogger
{
public void Log(VelopackLogLevel logLevel, string? message, Exception? exception) =>
Serilog.Log.Logger.Write(Level(logLevel), exception, "velopack: {Message}", message ?? string.Empty);
internal static LogEventLevel Level(VelopackLogLevel level) => level switch
{
VelopackLogLevel.Trace => LogEventLevel.Verbose,
VelopackLogLevel.Debug => LogEventLevel.Debug,
VelopackLogLevel.Information => LogEventLevel.Information,
VelopackLogLevel.Warning => LogEventLevel.Warning,
VelopackLogLevel.Error => LogEventLevel.Error,
_ => LogEventLevel.Fatal,
};
}
@@ -12,7 +12,8 @@ namespace FrameLedger.App.Update;
/// (<c>11_UPDATER</c>): the stable channel is the releases GitHub does not mark pre-release, the beta channel adds the
/// ones it does (<c>13_CI_CD</c> §Branch &amp; release policy — <c>vX.Y.Z-beta.N</c>). One manager per check, because
/// the channel is a constructor argument there; the <see cref="UpdateInfo"/> a check returned is held for the
/// download and the apply that follow it.
/// download and the apply that follow it — or, since beta.14, the package an earlier run left downloaded
/// (<see cref="FindPendingRestart"/>), which is applied without a download.
/// </summary>
public sealed class VelopackUpdateClient : IUpdateClient
{
@@ -20,12 +21,37 @@ public sealed class VelopackUpdateClient : IUpdateClient
public const string RepositoryUrl = "https://github.com/poli0981/frameledger";
private readonly Lock _lock = new();
private (UpdateManager Manager, UpdateInfo Info, string Version)? _held;
private (UpdateManager Manager, UpdateInfo? Info, VelopackAsset Asset, string Version)? _held;
public bool IsInstalled => Probe(static m => m.IsInstalled, false);
public string? CurrentVersion => Probe(static m => m.CurrentVersion?.ToString(), null);
public UpdateCandidate? FindPendingRestart()
{
try
{
UpdateManager manager = Create(false);
if (manager.UpdatePendingRestart is not { } pending)
{
return null;
}
string version = pending.Version.ToString();
lock (_lock)
{
_held = (manager, null, pending, version);
}
return new UpdateCandidate(version, pending.NotesMarkdown, pending.Size);
}
catch (Exception ex) when (ex is not OutOfMemoryException)
{
Serilog.Log.Debug(ex, "update: the install folder's pending package could not be read");
return null;
}
}
public async Task<UpdateCandidate?> CheckAsync(bool includePrereleases, CancellationToken ct = default)
{
ct.ThrowIfCancellationRequested();
@@ -42,10 +68,13 @@ public sealed class VelopackUpdateClient : IUpdateClient
string version = target.Version.ToString();
lock (_lock)
{
_held = (manager, info, version);
_held = (manager, info, target, version);
}
return new UpdateCandidate(version, target.NotesMarkdown, target.Size);
// Velopack downloads the deltas from the installed version when the feed has them (beta.13 on), the full
// package when it has none or a delta fails to apply; the offer says the first and names the second.
long? delta = info.DeltasToTarget is { Length: > 0 } deltas ? deltas.Sum(static d => d.Size) : null;
return new UpdateCandidate(version, target.NotesMarkdown, target.Size) { DeltaBytes = delta };
}
catch (Exception ex) when (IsFailure(ex, ct))
{
@@ -55,7 +84,14 @@ public sealed class VelopackUpdateClient : IUpdateClient
public async Task DownloadAsync(UpdateCandidate candidate, IProgress<int>? progress, CancellationToken ct = default)
{
(UpdateManager manager, UpdateInfo info) = Held(candidate);
(UpdateManager manager, UpdateInfo? info, _) = Held(candidate);
if (info is null)
{
// The package an earlier run downloaded: already in place, verified when it was downloaded.
progress?.Report(100);
return;
}
try
{
await manager.DownloadUpdatesAsync(info, p => progress?.Report(p), ct).ConfigureAwait(false);
@@ -69,8 +105,8 @@ public sealed class VelopackUpdateClient : IUpdateClient
/// <summary>Velopack's updater waits up to 60 s for this process to exit; the caller ends the host right after.</summary>
public void ApplyOnExit(UpdateCandidate candidate)
{
(UpdateManager manager, UpdateInfo info) = Held(candidate);
manager.WaitExitThenApplyUpdates(info.TargetFullRelease, silent: false, restart: true);
(UpdateManager manager, _, VelopackAsset asset) = Held(candidate);
manager.WaitExitThenApplyUpdates(asset, silent: false, restart: true);
}
/// <summary>
@@ -99,14 +135,14 @@ public sealed class VelopackUpdateClient : IUpdateClient
}
}
private (UpdateManager Manager, UpdateInfo Info) Held(UpdateCandidate candidate)
private (UpdateManager Manager, UpdateInfo? Info, VelopackAsset Asset) Held(UpdateCandidate candidate)
{
ArgumentNullException.ThrowIfNull(candidate);
lock (_lock)
{
if (_held is { } held && string.Equals(held.Version, candidate.Version, StringComparison.Ordinal))
{
return (held.Manager, held.Info);
return (held.Manager, held.Info, held.Asset);
}
}
@@ -105,6 +105,10 @@ public sealed partial class SettingsViewModel : ObservableObject
[ObservableProperty]
private bool _fpsTwoDecimals;
/// <summary><c>ui.hide_scrollbars</c> (beta.14): no scroll bars drawn; every scroller still scrolls.</summary>
[ObservableProperty]
private bool _hideScrollBars;
[ObservableProperty]
private bool _onlineMetadata;
@@ -206,10 +210,16 @@ public sealed partial class SettingsViewModel : ObservableObject
new("ja", "日本語"),
];
/// <summary>
/// D47 (beta.14): Automatic first, its label saying what it resolves to for this copy — "Automatic (Beta)" on a
/// pre-release — then the two explicit choices, either of which wins over the copy.
/// </summary>
public static IReadOnlyList<Choice<string>> UpdateChannels { get; } =
[
new("stable", Strings.Settings_Channel_Stable),
new("beta", Strings.Settings_Channel_Beta),
new(Update.UpdateChannelPolicy.Automatic, string.Format(CultureInfo.CurrentCulture, Strings.Settings_Channel_Auto_Format,
Update.UpdateChannelPolicy.IsPrerelease(UiIdentity.Version) ? Strings.Settings_Channel_Beta : Strings.Settings_Channel_Stable)),
new(Update.UpdateChannelPolicy.Stable, Strings.Settings_Channel_Stable),
new(Update.UpdateChannelPolicy.Beta, Strings.Settings_Channel_Beta),
];
public static double MinSessionMinimum => SettingsRegistry.CaptureMinSessionSeconds.Minimum;
@@ -385,6 +395,18 @@ public sealed partial class SettingsViewModel : ObservableObject
Persist(SettingsRegistry.UiFpsDecimals, value);
}
partial void OnHideScrollBarsChanged(bool value)
{
if (_loading)
{
return;
}
// On screen at once — this page's own bars included — and on every scroller that loads from now on.
ScrollBarHiding.Apply(value);
Persist(SettingsRegistry.UiHideScrollBars, value);
}
partial void OnMinimizeToTrayChanged(bool value)
{
if (!_loading)
@@ -497,6 +519,7 @@ public sealed partial class SettingsViewModel : ObservableObject
UserModeExceptions = await _settings.GetBooleanAsync(SettingsRegistry.HookingUserModeExceptions).ConfigureAwait(true);
RunElevated = await _settings.GetBooleanAsync(SettingsRegistry.CaptureRunElevated).ConfigureAwait(true);
FpsTwoDecimals = await _settings.GetBooleanAsync(SettingsRegistry.UiFpsDecimals).ConfigureAwait(true);
HideScrollBars = await _settings.GetBooleanAsync(SettingsRegistry.UiHideScrollBars).ConfigureAwait(true);
OnlineMetadata = await _settings.GetBooleanAsync(SettingsRegistry.PrivacyOnlineMetadata).ConfigureAwait(true);
UpdateChannel = await _settings.GetAsync(SettingsRegistry.UpdateChannel).ConfigureAwait(true);
AutoCheckUpdates = await _settings.GetBooleanAsync(SettingsRegistry.UpdateAutoCheck).ConfigureAwait(true);
@@ -24,7 +24,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:TitleBar Grid.Row="0" Title="{Binding ViewModel.Title}" ShowMaximize="True" ShowMinimize="True" />
<ScrollViewer Grid.Row="1">
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
<ui:TextBlock Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:SessionSummaryViewModel.NotFoundText}"
Visibility="{Binding ViewModel.NotFound, Converter={StaticResource BoolToVis}}" />
@@ -20,6 +20,13 @@ public sealed record CaptureOutcome
/// </summary>
public bool HookingTurnedOff { get; init; }
/// <summary>
/// D48(b), beta.14: the guard's "could not read" refusal at the last re-scan, when the session concluded as the game's
/// exit rather than a safety unhook because the game itself had already exited (<see cref="ExitScanRelabel"/>); null
/// otherwise. Written to the notes as <c>scan_at_exit=</c>.
/// </summary>
public AntiCheatRefusalReason? ExitScanReason { get; init; }
/// <summary>
/// D33 (owner decision 2026-09-26): the family the game's user-mode exception covered for this session — published to
/// the Overlay and named to the guard at the injection and at every re-scan — or null when none was in force. The
@@ -31,6 +31,12 @@ public sealed record CaptureProgress
public required NgxDriverState NgxDriver { get; init; }
/// <summary>
/// The adapter the game presents on, as the Overlay published it in the handshake at its first present (beta.13); 0
/// before that, on every Tier-2 tick, and for a game that presents through OpenGL or Vulkan, which publish none.
/// </summary>
public ulong AdapterLuid { get; init; }
/// <summary>
/// On a held session's tick (2026-09-23): the refusal it is held under — its reason, and the guard's verdict when the
/// guard spoke — so the pipe can say, while the game runs, why nothing is measured. Null on every hooked tick.
@@ -431,6 +431,9 @@ public sealed class CaptureSession(
// about the game at the 30 s re-scan turns its hooking off exactly as one at the start does (2026-09-22).
AntiCheatVerdict final = end == SessionEndReason.SafetyUnhook && supervisor.LastVerdict is { } fired ? fired : verdict;
bool turnedOff = end == SessionEndReason.SafetyUnhook && await TurnHookingOffAsync(observed, final, ct).ConfigureAwait(false);
// D48(b): a re-scan that could not read, concluded as the game's exit (ExitScanRelabel) — its reason goes in the notes.
AntiCheatRefusalReason? exitScan = end == SessionEndReason.TargetExited && supervisor.LastVerdict is { IsAllowed: false } last
&& ExitScanRelabel.Applies(last.Reason) ? last.Reason : null;
return new CaptureOutcome
{
@@ -440,6 +443,7 @@ public sealed class CaptureSession(
Reason = end,
Verdict = final,
HookingTurnedOff = turnedOff,
ExitScanReason = exitScan,
ExceptionFamily = toleratedFamily,
AttachRefusal = ShmAttachRefusal.Ok,
Records = state.Records,
@@ -555,7 +559,7 @@ public sealed class CaptureSession(
await FlushNativeLogAsync(sink, alive, end, ct).ConfigureAwait(false);
// The switch's stop is the user's, not the guard's: it ends the session as its own reason rather
// than as the safety refusal a false mayContinue would otherwise read as.
return state.KillSwitchStopped ? SessionEndReason.KillSwitchEngaged : Conclude(end, faulted, mayContinue);
return state.KillSwitchStopped ? SessionEndReason.KillSwitchEngaged : Conclude(end, faulted, mayContinue, supervisor.LastVerdict, alive.HasExited);
}
/// <summary>
@@ -725,6 +729,7 @@ public sealed class CaptureSession(
TouchQpc = Loaded.TouchQpc,
RuntimeModules = Loaded.Set,
NgxDriver = Loaded.Ngx,
AdapterLuid = sink.Handshake.AdapterLuid,
};
}
@@ -737,14 +742,18 @@ public sealed class CaptureSession(
/// <see cref="SessionEndClassifier"/> cannot know that, because the mapping stores
/// one status for both stops.
/// </remarks>
private static SessionEndReason Conclude(SessionEndReason end, Exception? faulted, bool mayContinue)
/// <remarks>
/// D48(b), beta.14: a refusal that says only that the guard could not read, concluded after the game itself has exited
/// (read after the last drain), is the game's exit — <see cref="ExitScanRelabel"/>. A finding never is.
/// </remarks>
private static SessionEndReason Conclude(SessionEndReason end, Exception? faulted, bool mayContinue, AntiCheatVerdict? lastVerdict, bool targetExited)
{
if (faulted is not null)
{
return SessionEndReason.SupervisionFaulted;
}
return mayContinue ? end : SessionEndReason.SafetyUnhook;
return mayContinue ? end : ExitScanRelabel.EndOf(lastVerdict, targetExited);
}
/// <summary>
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Domain.AntiCheat;
namespace FrameLedger.Application.Capture;
/// <summary>
/// Owner decision D48(b), beta.14. The guard's 30 s re-scan reads every process in the game's tree; one that is
/// starting (an engine's crash reporter, as its game dies) or gone could not be read, the scan refused, and the session
/// ended as a <see cref="SessionEndReason.SafetyUnhook"/> — a "safety" stop for a game that had simply exited, which also
/// ended a user-mode exception's trial for good. When the refusal says only that the guard COULD NOT READ and the game
/// itself has exited by the time the session concludes, the session ends as the game's exit
/// (<see cref="SessionEndReason.TargetExited"/>), its exit code deciding normal or crashed, and the scan's reason is kept
/// in the notes (<c>scan_at_exit=</c>). A finding — any anti-cheat the guard identified — is never relabelled, and neither
/// is a refusal while the game still runs.
/// </summary>
public static class ExitScanRelabel
{
/// <summary>The guard's "could not read" refusals of the module check (<c>fl_guard.cpp</c> check 1) — never a finding.</summary>
public static bool Applies(AntiCheatRefusalReason reason) =>
reason is AntiCheatRefusalReason.ProcessUnreadable or AntiCheatRefusalReason.ModuleScanFailed or AntiCheatRefusalReason.ProcessTreeUnavailable;
/// <summary>The end a refused re-scan concludes as: the game's exit when <see cref="Applies"/> and it has exited, else a safety unhook.</summary>
public static SessionEndReason EndOf(AntiCheatVerdict? lastVerdict, bool targetExited) =>
targetExited && lastVerdict is { IsAllowed: false } refused && Applies(refused.Reason)
? SessionEndReason.TargetExited
: SessionEndReason.SafetyUnhook;
}
@@ -3,6 +3,7 @@
using FrameLedger.Application.Capture;
using FrameLedger.Application.Recording;
using FrameLedger.Domain.AntiCheat;
using FrameLedger.Shared;
using FrameLedger.Shared.Ipc;
@@ -106,10 +107,12 @@ public static class RecordedSessionEvents
{
case Kind.Refused:
pipe.Publish(IpcMessageType.CaptureRefused,
new CaptureRefusedEvent(info.GameId, info.GameName, o.Reason.ToString(), NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff));
new CaptureRefusedEvent(info.GameId, info.GameName, o.Reason.ToString(), NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff,
GuardReasonOf(o.Verdict)));
break;
case Kind.SafetyUnhook:
pipe.Publish(IpcMessageType.SafetyUnhook, new SafetyUnhookEvent(sessionGuid, NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff));
pipe.Publish(IpcMessageType.SafetyUnhook,
new SafetyUnhookEvent(sessionGuid, NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff, GuardReasonOf(o.Verdict)));
break;
case Kind.Degraded:
pipe.Publish(IpcMessageType.CaptureDegraded, new CaptureDegradedEvent(sessionGuid, From: 1, To: 2, o.Reason.ToString()));
@@ -156,4 +159,10 @@ public static class RecordedSessionEvents
};
private static string? NullIfEmpty(string? value) => string.IsNullOrEmpty(value) ? null : value;
/// <summary>
/// The guard's own reason when it named a family (beta.13, §S23-3): the App says a <c>BlockedService</c> or
/// <c>BlockedDriver</c> was found on the PC, not in the game. Null when the guard named nothing.
/// </summary>
private static string? GuardReasonOf(AntiCheatVerdict verdict) => string.IsNullOrEmpty(verdict.Family) ? null : verdict.Reason.ToString();
}
@@ -40,6 +40,18 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
/// <summary>D33: the family the game's user-mode exception let through while the session was hooked (<c>ac-exception=</c>).</summary>
public string? AcExceptionFamily { get; init; }
/// <summary>
/// D48(b), beta.14: the guard's "could not read" answer at the last re-scan of a session that ended as the game's exit
/// (<c>scan_at_exit=</c>), or null.
/// </summary>
public string? ScanAtExit { get; init; }
/// <summary>beta.14: the crash reporter the game started that made the session crashed (<c>crash_reporter=</c>), or null.</summary>
public string? CrashReporter { get; init; }
/// <summary>beta.14: a crash reporter the game started that did not count — the game kept running (<c>crash_reporter_seen=</c>).</summary>
public string? CrashReporterSeen { get; init; }
public static CaptureNotes Parse(string? notes)
{
if (string.IsNullOrWhiteSpace(notes))
@@ -47,7 +59,7 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
return default;
}
string? end = null, reason = null, family = null, signal = null, acException = null;
string? end = null, reason = null, family = null, signal = null, acException = null, scanAtExit = null, reporter = null, reporterSeen = null;
int? exitCode = null, launchError = null;
bool crashEvent = false;
foreach (string raw in notes.Split(';'))
@@ -77,6 +89,18 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
{
acException = Blank(part[_acExceptionPrefix.Length..]);
}
else if (part.StartsWith(_scanAtExitPrefix, StringComparison.Ordinal))
{
scanAtExit = Blank(part[_scanAtExitPrefix.Length..]);
}
else if (part.StartsWith(_reporterPrefix, StringComparison.Ordinal))
{
reporter = Blank(part[_reporterPrefix.Length..]);
}
else if (part.StartsWith(_reporterSeenPrefix, StringComparison.Ordinal))
{
reporterSeen = Blank(part[_reporterSeenPrefix.Length..]);
}
}
return new CaptureNotes(end, reason, family, signal)
@@ -85,6 +109,9 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
CrashEvent = crashEvent,
LaunchError = launchError,
AcExceptionFamily = acException,
ScanAtExit = scanAtExit,
CrashReporter = reporter,
CrashReporterSeen = reporterSeen,
};
}
@@ -132,6 +159,12 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
private const string _acExceptionPrefix = "ac-exception=";
private const string _scanAtExitPrefix = "scan_at_exit=";
private const string _reporterPrefix = "crash_reporter=";
private const string _reporterSeenPrefix = "crash_reporter_seen=";
private static string Clean(string? s) => string.IsNullOrEmpty(s) ? string.Empty : s.Replace(';', ',');
private static string? Blank(string s) => s.Length > 0 ? s : null;
@@ -0,0 +1,94 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
namespace FrameLedger.Application.Recording;
/// <summary>
/// Whether an Application-log record is a crash of THIS session's game (beta.14). Until then a record with id 1000 or 1001
/// counted when any of its strings CONTAINED the executable's name: Windows' memory-leak report (<c>RADAR_PRE_LEAK_64</c>, a
/// WER 1001 naming <c>witcher3.exe</c>) marked a session that ended with exit code 0 as crashed on the owner's machine, and so
/// would a hang report, another program's crash whose name contains this one's (<c>Game.exe</c> in <c>MyGame.exe</c>), or a
/// crash of a same-image child. Now:
/// <list type="bullet">
/// <item>1000 from <c>Application Error</c>: the faulting application's name equals the executable's, its path (when given)
/// is the executable's, and its process id (when the session held one) is the session's.</item>
/// <item>1001 from <c>Windows Error Reporting</c>: the report is a crash (<see cref="CrashReports"/>) and its first parameter
/// equals the executable's name.</item>
/// </list>
/// The indices are Windows' own templates (read on Windows 11 with <c>Get-WinEvent -ListProvider</c>): 1000 [0] AppName,
/// [8] ProcessId, [10] AppPath; 1001 [2] EventName, [5] P1. Pid and creation time are typed values, not strings.
/// </summary>
public static class CrashEventMatcher
{
public const string ApplicationErrorProvider = "Application Error";
public const string WerProvider = "Windows Error Reporting";
/// <summary>The WER event names that are a crash; a hang (<c>AppHangB1</c>) or a leak report (<c>RADAR_PRE_LEAK_*</c>) is not.</summary>
public static IReadOnlySet<string> CrashReports { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"APPCRASH", "BEX", "BEX64", "CLR20r3", "MoAppCrash", "MoBEX",
};
public static bool Matches(CrashLogRecord record, CrashQuery query)
{
ArgumentNullException.ThrowIfNull(record);
ArgumentNullException.ThrowIfNull(query);
return record.EventId switch
{
1000 when string.Equals(record.Provider, ApplicationErrorProvider, StringComparison.OrdinalIgnoreCase) => ApplicationError(record.Properties, query),
1001 when string.Equals(record.Provider, WerProvider, StringComparison.OrdinalIgnoreCase) => WerCrash(record.Properties, query),
_ => false,
};
}
private static bool ApplicationError(IReadOnlyList<object?> p, CrashQuery query)
{
if (!SameName(At(p, 0), query.ExeFileName))
{
return false;
}
if (At(p, 10) is string { Length: > 0 } appPath && !SamePath(appPath, query.ExePath))
{
return false;
}
return query.TargetPid == 0 || Number(At(p, 8)) is not { } pid || pid == (ulong)query.TargetPid;
}
private static bool WerCrash(IReadOnlyList<object?> p, CrashQuery query) =>
At(p, 2) is string eventName && CrashReports.Contains(eventName) && SameName(At(p, 5), query.ExeFileName);
private static object? At(IReadOnlyList<object?> p, int index) => index < p.Count ? p[index] : null;
private static bool SameName(object? value, string exeFileName) =>
value is string s && string.Equals(s.Trim(), exeFileName, StringComparison.OrdinalIgnoreCase);
private static bool SamePath(string a, string b)
{
try
{
return string.Equals(Path.GetFullPath(a.Trim()), Path.GetFullPath(b), StringComparison.OrdinalIgnoreCase);
}
catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
{
return false;
}
}
/// <summary>A number as the log gives it: an unsigned or signed integer, or text in decimal or <c>0x</c> hex.</summary>
internal static ulong? Number(object? value) => value switch
{
ulong u => u,
uint u => u,
long l when l >= 0 => (ulong)l,
int i when i >= 0 => (ulong)i,
string s when s.Trim().StartsWith("0x", StringComparison.OrdinalIgnoreCase)
&& ulong.TryParse(s.Trim()[2..], NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong hex) => hex,
string s when ulong.TryParse(s.Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out ulong dec) => dec,
_ => null,
};
}
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>One Application-log record as the matcher reads it: its id, its provider, and its properties in order (typed as the log gives them).</summary>
public sealed record CrashLogRecord(int EventId, string? Provider, IReadOnlyList<object?> Properties);
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// What a crash witness is asked about one session (beta.14): the executable, the pid the session held (0 when it held
/// none), the window <c>[start, end + grace]</c>, and whether the session ended because the game itself left — a crash
/// reporter only counts for a game that exited.
/// </summary>
public sealed record CrashQuery(string ExePath, int TargetPid, DateTimeOffset WindowStart, DateTimeOffset WindowEnd, bool TargetLeft)
{
/// <summary>The executable's file name, the form the event log names it by.</summary>
public string ExeFileName => Path.GetFileName(ExePath);
}
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// When a crash reporter the game started counts as its crash (beta.14). It must have started at least
/// <see cref="StartedWithTheGame"/> after the game — a reporter that starts with its game is a monitor, not a crash, and a
/// crash in the game's first seconds is under-reported rather than a monitor fabricating one — and the game must have left
/// within <see cref="ExitWithin"/> of it: a game that kept running reported an error it survived, which is a note and not
/// a crash.
/// </summary>
public static class CrashReporterRule
{
public static readonly TimeSpan StartedWithTheGame = TimeSpan.FromSeconds(10);
public static readonly TimeSpan ExitWithin = TimeSpan.FromSeconds(60);
public static bool Counts(CrashReporterSighting sighting, CrashQuery query, DateTimeOffset endedAt)
{
ArgumentNullException.ThrowIfNull(sighting);
ArgumentNullException.ThrowIfNull(query);
bool afterStart = sighting.ParentStartedAt is not { } gameStarted || sighting.StartedAt - gameStarted >= StartedWithTheGame;
return query.TargetLeft && afterStart && endedAt - sighting.StartedAt <= ExitWithin;
}
}
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// An engine's crash reporter seen starting as a child of a process (beta.14): its image, its parent's pid and — when the
/// watcher had seen the parent — the parent's image and start, and its own start.
/// </summary>
public sealed record CrashReporterSighting(string Image, int ParentPid, string? ParentImagePath, DateTimeOffset? ParentStartedAt, DateTimeOffset StartedAt);
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>What the crash witnesses said about one session (beta.14): the Application log, and the crash reporter the game started, counted or only seen.</summary>
internal readonly record struct CrashWitness(bool ApplicationLog, string? Reporter, bool ReporterCounted);
@@ -15,8 +15,9 @@ namespace FrameLedger.Application.Recording;
/// The crash-witness window is <c>[start, end + 30 s]</c>; the caller asks the
/// <see cref="ICrashEventSource"/> with exactly that and hands the answer in. The precedence is
/// the document's: our own safety stop is <c>unhooked_safety</c> whatever the process did next; the
/// capture side stopping on its own is <c>degraded</c>; an exception's exit code (<see cref="IsExceptionCode"/>) or an
/// event is <c>crashed</c> — since beta.8; any non-zero code was until then, End task's 1 included — and anything else,
/// capture side stopping on its own is <c>degraded</c>; an exception's exit code (<see cref="IsExceptionCode"/>), an
/// event, or — since beta.14 — an engine's crash reporter the game started before it left is <c>crashed</c> — since
/// beta.8; any non-zero code was until then, End task's 1 included — and anything else,
/// including a target still running when the session ends, is <c>normal</c> with its code in the notes.
/// </para>
/// <para>
@@ -29,7 +30,12 @@ public static class ExitStatusMapper
/// <summary>How long after the session's end an event may still be attributed to it.</summary>
public static readonly TimeSpan CrashWitnessGrace = TimeSpan.FromSeconds(30);
public static ExitStatus Map(SessionEndReason reason, int? exitCode, bool crashEventFound)
/// <summary>
/// The status from the end, the exit code and the witnesses. <c>crashReporterCounted</c> (beta.14): the game started an
/// engine's crash reporter and left within a minute (<see cref="CrashReporterRule"/>) — Unreal's crash ends with exit
/// code 3 and no event, so this is its only witness.
/// </summary>
public static ExitStatus Map(SessionEndReason reason, int? exitCode, bool crashEventFound, bool crashReporterCounted = false)
{
switch (reason)
{
@@ -44,7 +50,7 @@ public static class ExitStatusMapper
// A crash is an exception's exit code or the Application log's witness (beta.8). Any other non-zero code is
// the program's own exit — End task and taskkill leave 1 — and was a "crash" until 2026-09-25; the code stays
// in the notes, and the crash policy still counts it inside its window (CrashAutoDisablePolicy).
return crashEventFound || exitCode is { } code && IsExceptionCode(code) ? ExitStatus.Crashed : ExitStatus.Normal;
return crashEventFound || crashReporterCounted || exitCode is { } code && IsExceptionCode(code) ? ExitStatus.Crashed : ExitStatus.Normal;
}
}
@@ -68,9 +74,10 @@ public static class ExitStatusMapper
/// <summary>
/// What <c>sessions.capture_notes</c> carries about the end: the fine reason the four statuses
/// collapse, the exit code when there was one, the witness when there was one.
/// collapse, the exit code when there was one, the witness when there was one — and since beta.14 the crash reporter the
/// game started, if one was seen: <c>crash_reporter=</c> when it counted, <c>crash_reporter_seen=</c> when it did not.
/// </summary>
public static string Describe(SessionEndReason reason, int? exitCode, bool crashEventFound)
public static string Describe(SessionEndReason reason, int? exitCode, bool crashEventFound, string? crashReporter = null, bool crashReporterCounted = false)
{
string note = "end=" + reason;
if (exitCode is { } code)
@@ -83,6 +90,11 @@ public static class ExitStatusMapper
note += "; crash_event=application_log";
}
if (crashReporter is { Length: > 0 })
{
note += (crashReporterCounted ? "; crash_reporter=" : "; crash_reporter_seen=") + crashReporter;
}
return note;
}
}
@@ -5,12 +5,13 @@ namespace FrameLedger.Application.Recording;
/// <summary>
/// The second witness for <c>crashed</c> (<c>04_CAPTURE</c> §Crash &amp; exit classification): an
/// Application Error (1000) or WER (1001) event naming the executable inside <c>[start, end + 30 s]</c>.
/// Application Error (1000) or WER (1001) crash report of THIS session's game inside its window
/// (<see cref="CrashEventMatcher"/> since beta.14 — a WER memory-leak report named the game and read as a crash).
/// A process that was killed, or that returned 0 after an unhandled exception's handler, exits with a
/// code that says nothing; the event log still does.
/// </summary>
public interface ICrashEventSource
{
/// <summary>Whether such an event exists; false when the log cannot be read — absence of evidence, not a crash.</summary>
bool FoundCrash(string exeFileName, DateTimeOffset windowStart, DateTimeOffset windowEnd);
bool FoundCrash(CrashQuery query);
}
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// The engine crash reporters the watcher saw a session's game start (beta.14, <c>Watch.CrashReporterWitness</c>): the third
/// witness for <c>crashed</c>, beside the exit code and the Application log, for the engines that handle a crash themselves —
/// Unreal starts <c>CrashReportClient.exe</c> and exits with code 3, which says nothing and reaches no event log.
/// </summary>
public interface ICrashReporterSightings
{
/// <summary>The first sighting the session's game started inside its window, or null; waits for a poll or two when the game just left.</summary>
Task<CrashReporterSighting?> FindAsync(CrashQuery query, CancellationToken ct = default);
}
@@ -48,12 +48,16 @@ public sealed class SessionRecorder : ISessionRecorder
private readonly ISessionObserver? _observer;
private readonly IDriverProfileSource? _profiles;
private readonly UserModeExceptionLapsePolicy? _exceptionLapse;
private readonly ICrashReporterSightings? _reporters;
public SessionRecorder(ICaptureSessionFactory sessions, IGameRepository games, IHardwareSnapshotRepository snapshots,
IHardwareSnapshotSource hardware, IPartialSessionStore partials, SessionFinalizer finalizer, ICrashEventSource crashes,
Func<RecorderOptions, ITelemetryPoller?> pollers, TimeProvider clock, RecorderOptions? options = null, ISessionObserver? observer = null,
IRecorderPolicy? policy = null, IDriverProfileSource? profiles = null, UserModeExceptionLapsePolicy? exceptionLapse = null)
IRecorderPolicy? policy = null, IDriverProfileSource? profiles = null, UserModeExceptionLapsePolicy? exceptionLapse = null,
ICrashReporterSightings? reporters = null)
{
// beta.14: the engine crash reporters the watcher saw the game start; null where nothing watches (the tests, the console).
_reporters = reporters;
// D33: ends a game's user-mode exception when a session under it ends badly; null in every recorder that has no
// consent store to write to (the tests, the unshipped host), where no exception can be in force either.
_exceptionLapse = exceptionLapse;
@@ -189,10 +193,15 @@ public sealed class SessionRecorder : ISessionRecorder
bool hooked = outcome.AttachRefusal == ShmAttachRefusal.Ok;
// A held Tier-2 session's duration is the game's (2026-09-22), so the Application-log witness applies to it too.
bool hadPid = hooked || outcome.TargetPid != 0 || outcome.HeldUnhooked;
bool crashEvent = hadPid && _crashes.FoundCrash(Path.GetFileName(request.NormalisedExePath), header.StartedAt, endedAt + ExitStatusMapper.CrashWitnessGrace);
ExitStatus exit = ExitStatusMapper.Map(outcome.Reason, outcome.ExitCode, crashEvent);
// beta.14: the query ties every witness to THIS game's process — its pid, its path — inside the session's window.
bool targetLeft = outcome.ExitCode is not null || outcome.Reason is SessionEndReason.TargetExited or SessionEndReason.LaunchTargetExited;
var query = new CrashQuery(request.NormalisedExePath, outcome.TargetPid, header.StartedAt, endedAt + ExitStatusMapper.CrashWitnessGrace, targetLeft);
CrashReporterSighting? reporter = hadPid && _reporters is { } reporters ? await reporters.FindAsync(query, ct).ConfigureAwait(false) : null;
bool reporterCounted = reporter is { } seen && CrashReporterRule.Counts(seen, query, endedAt);
bool crashEvent = hadPid && _crashes.FoundCrash(query);
ExitStatus exit = ExitStatusMapper.Map(outcome.Reason, outcome.ExitCode, crashEvent, reporterCounted);
SessionRow skeleton = Skeleton(header, outcome, endedAt, exit, crashEvent, hooked) with { DriverProfileJson = driverProfile };
SessionRow skeleton = Skeleton(header, outcome, endedAt, exit, new CrashWitness(crashEvent, reporter?.Image, reporterCounted), hooked) with { DriverProfileJson = driverProfile };
var input = new FinalizeInput
{
Skeleton = skeleton,
@@ -241,9 +250,9 @@ public sealed class SessionRecorder : ISessionRecorder
};
}
private static SessionRow Skeleton(PartialHeader h, CaptureOutcome o, DateTimeOffset endedAt, ExitStatus exit, bool crashEvent, bool hooked)
private static SessionRow Skeleton(PartialHeader h, CaptureOutcome o, DateTimeOffset endedAt, ExitStatus exit, CrashWitness crash, bool hooked)
{
string notes = ExitStatusMapper.Describe(o.Reason, o.ExitCode, crashEvent);
string notes = ExitStatusMapper.Describe(o.Reason, o.ExitCode, crash.ApplicationLog, crash.Reporter, crash.ReporterCounted);
if (o.LaunchError is { } launchError)
{
notes += "; launch_error=" + launchError.ToString(System.Globalization.CultureInfo.InvariantCulture);
@@ -266,6 +275,13 @@ public sealed class SessionRecorder : ISessionRecorder
notes += "; " + CaptureNotes.AcExceptionSlot(excepted);
}
// D48(b), beta.14: the last re-scan could not read the game's tree as the game exited, and the session ended as
// that exit rather than as a safety unhook; what the scan said stays with the row.
if (o.ExitScanReason is { } scanAtExit)
{
notes += "; scan_at_exit=" + scanAtExit;
}
// The session that turned the game's hooking off says so in its notes (2026-09-22): the row's block names
// the finding, and the notes travel into every bug bundle.
if (o.HookingTurnedOff)
@@ -323,6 +339,7 @@ public sealed class SessionRecorder : ISessionRecorder
{
private readonly List<TelemetrySample> _drained = [];
private CaptureProgress? _last;
private ulong _adapter;
public DateTimeOffset? AttachedAt { get; private set; }
@@ -350,11 +367,29 @@ public sealed class SessionRecorder : ISessionRecorder
public void Tick(CaptureProgress progress)
{
_last = progress;
FollowAdapter(progress.AdapterLuid);
DrainTelemetry();
writer.OnTick(progress);
observer?.Tick(guid, progress, _drained);
}
/// <summary>
/// The adapter the game presents on (beta.13): the Overlay publishes its LUID at the first present, the telemetry thread
/// is told once, and the <c>.partial</c> says whether its layers could follow — until then, and where they could not,
/// they describe the adapter they found first (<c>18_GPU_VENDOR_APIS</c> §L1).
/// </summary>
private void FollowAdapter(ulong luid)
{
if (luid == 0 || luid == _adapter)
{
return;
}
_adapter = luid;
bool followed = poller?.FollowAdapter(luid) ?? false;
writer.Note(string.Create(CultureInfo.InvariantCulture, $"adapter: luid=0x{luid:x} {(followed ? "followed" : "not followed")}"));
}
public void FinalFlush()
{
DrainTelemetry();
@@ -66,6 +66,17 @@ public static class SettingsRegistry
Default = "0",
};
/// <summary>
/// Whether the App draws no scroll bars (beta.14, owner request 2026-10-05): every scroller still scrolls with the wheel,
/// the keyboard and touch, it only stops showing its bar. Off by default — the bars are what every page showed until then.
/// </summary>
public static readonly SettingDefinition UiHideScrollBars = new()
{
Key = "ui.hide_scrollbars",
Kind = SettingKind.Boolean,
Default = "0",
};
/// <summary>
/// How the Games library is shown (beta.11, owner request 2026-10-03): a grid of cards that fills the width, or a list.
/// The page's own switch writes it; Settings has no row for it.
@@ -163,13 +174,18 @@ public static class SettingsRegistry
AgentReads = true,
};
/// <summary><c>11_UPDATER</c>: the release feed's channel — <c>stable</c> is the releases GitHub does not mark pre-release, <c>beta</c> adds the ones it does (P4 PR-5 reads it).</summary>
/// <summary>
/// <c>11_UPDATER</c>: the release feed's channel — <c>stable</c> is the releases GitHub does not mark pre-release, <c>beta</c>
/// adds the ones it does (P4 PR-5 reads it). <c>auto</c>, the default since beta.14 (owner decision D47), follows the
/// running copy: a pre-release asks for pre-releases. The default was <c>stable</c> until then, while every release is a
/// pre-release — a copy left on its defaults never found one.
/// </summary>
public static readonly SettingDefinition UpdateChannel = new()
{
Key = "update.channel",
Kind = SettingKind.Choice,
Default = "stable",
Choices = ["stable", "beta"],
Default = "auto",
Choices = ["auto", "stable", "beta"],
};
/// <summary><c>11_UPDATER</c> §Flow: the startup silent check, "if enabled" — on by default, one request to GitHub Releases after start (P4 PR-5).</summary>
@@ -199,7 +215,7 @@ public static class SettingsRegistry
/// <summary>Every definition, in the order <c>06_DATA_MODEL</c> lists them.</summary>
public static IReadOnlyList<SettingDefinition> All { get; } =
[
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals, UiLibraryView,
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals, UiHideScrollBars, UiLibraryView,
CaptureBackground, HookingKillSwitch, HookingUserModeExceptions, CaptureRunElevated, CaptureMinSessionSeconds, TelemetryIntervalMs, RetentionRawSessionsPerGame,
UpdateChannel, UpdateAutoCheck, PrivacyOnlineMetadata, LogDebug,
];
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Telemetry;
/// <summary>
/// A telemetry layer that can be pointed at one graphics adapter (beta.13): L1 reads DXGI's identity and the adapter-wide
/// memory counter for the adapter it is told, by the LUID the Overlay publishes in the handshake at the game's first
/// present. Until then it describes the first hardware adapter in DXGI's high-performance order.
/// </summary>
public interface IGpuAdapterSelector
{
/// <summary>The adapter being described; null before one is known.</summary>
GpuAdapterIdentity? Selected { get; }
/// <summary>Switch to the adapter with this LUID. False — and no change — for 0, or for a LUID it did not list.</summary>
bool SelectAdapter(ulong luid);
}
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Telemetry;
/// <summary>
/// A telemetry layer that reads its own GPU rather than one named by LUID (beta.13) — LibreHardwareMonitor's GPU node,
/// NVAPI's physical GPU — told the PCI vendor of the adapter the game presents on, so it describes that vendor's GPU or
/// nothing. A layer whose GPU is not the game's contributes no field: a confident figure from the wrong card is worse
/// than N/A (<c>FlShmHandshake.AdapterLuid</c>'s own rule).
/// </summary>
public interface IGpuVendorFollower
{
/// <summary>The game's adapter is this PCI vendor's (<c>0x10DE</c> NVIDIA, <c>0x1002</c> AMD, <c>0x8086</c> Intel, or another).</summary>
void FollowVendor(uint vendorId);
}
@@ -41,4 +41,10 @@ public interface ITelemetryPoller : IDisposable
/// what may be opened (<see cref="GameProcess"/>). A poller with no game source ignores it.
/// </summary>
void Follow(GameProcess target) { }
/// <summary>
/// The adapter the game presents on, by the LUID the Overlay publishes at its first present (beta.13): the layers follow
/// it. False when the source cannot follow adapters or did not list this one — a poller without layers says false.
/// </summary>
bool FollowAdapter(ulong luid) => false;
}
@@ -63,6 +63,7 @@ public sealed class CaptureOrchestrator
private readonly ILaunchRecorderFactory? _launches;
private readonly ExecutableRelocator? _relocator;
private readonly LatestProcessSnapshot? _latest;
private readonly CrashReporterWitness? _reporters;
private readonly ProcessWatcher _watcher = new();
private readonly Lock _table = new();
private readonly Dictionary<string, Running> _running = new(StringComparer.OrdinalIgnoreCase);
@@ -73,10 +74,12 @@ public sealed class CaptureOrchestrator
public CaptureOrchestrator(ISessionRecorder recorder, IGameRepository games, IProcessSnapshotSource processes,
IExecutableIdentitySource identity, OrchestratorOptions options, Action<string> log, ILaunchRecorderFactory? launches = null,
ExecutableRelocator? relocator = null, LatestProcessSnapshot? latest = null)
ExecutableRelocator? relocator = null, LatestProcessSnapshot? latest = null, CrashReporterWitness? reporters = null)
{
_relocator = relocator;
_latest = latest;
// beta.14: every snapshot also tells the crash-reporter witness who started what (the recorder asks it at a session's end).
_reporters = reporters;
_recorder = recorder ?? throw new ArgumentNullException(nameof(recorder));
_games = games ?? throw new ArgumentNullException(nameof(games));
_processes = processes ?? throw new ArgumentNullException(nameof(processes));
@@ -147,6 +150,7 @@ public sealed class CaptureOrchestrator
IReadOnlyList<GameRow> watchlist = Recorded(library);
IReadOnlyList<ProcessSnapshot> snapshot = _processes.Take();
_latest?.Publish(snapshot);
_reporters?.Observe(snapshot, DateTimeOffset.UtcNow);
IReadOnlyList<WatchEvent> events = _watcher.Poll(snapshot, watchlist);
foreach (WatchEvent e in events)
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Watch;
/// <summary>
/// The crash reporters engines and crash SDKs start (beta.14), by exact image name. Two kinds, and the difference is the
/// whole point: an <b>on-crash</b> reporter is started BY the crash — Unreal's <c>CrashReportClient.exe</c>, REDengine's
/// <c>CrashReporter.exe</c>, RE Engine's <c>CrashReport.exe</c>, BugSplat's <c>BsSndRpt64.exe</c> — so its start beside a
/// game that then exits is a witness; an <b>always-on</b> handler starts WITH the game and lives beside it — Unity's
/// <c>UnityCrashHandler64.exe</c>, Chromium's and Sentry's <c>crashpad_handler.exe</c> — so its presence says nothing and it
/// never counts. All six were found in the owner's Steam libraries (2026-10-05).
/// </summary>
public static class CrashReporterCatalog
{
public static IReadOnlySet<string> OnCrash { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"CrashReportClient.exe", "CrashReporter.exe", "CrashReport.exe", "BsSndRpt.exe", "BsSndRpt64.exe",
};
public static IReadOnlySet<string> AlwaysOn { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"UnityCrashHandler64.exe", "UnityCrashHandler32.exe", "crashpad_handler.exe",
};
public static bool IsOnCrash(string? imageName) => imageName is not null && OnCrash.Contains(imageName);
}
@@ -0,0 +1,99 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Application.Recording;
namespace FrameLedger.Application.Watch;
/// <summary>
/// Which on-crash reporters (<see cref="CrashReporterCatalog"/>) started as a child of which process (beta.14), from the
/// watcher's own once-a-second snapshots — no process is opened and nothing is read from any. A reporter's parent is known by
/// pid, image and start: a pid Windows reused for a process that started AFTER the reporter is not its parent. The recorder
/// asks at a session's end (<see cref="FindAsync"/>); a game that just left gets two more polls, because the reporter it
/// started as it died may not have been in the last snapshot.
/// </summary>
public sealed class CrashReporterWitness : ICrashReporterSightings
{
private static readonly TimeSpan _rememberProcess = TimeSpan.FromMinutes(5);
private static readonly TimeSpan _rememberSighting = TimeSpan.FromMinutes(30);
private static readonly TimeSpan _waitForPolls = TimeSpan.FromSeconds(2.5);
private readonly Lock _lock = new();
private readonly Dictionary<int, (string? Image, DateTimeOffset? Started, DateTimeOffset Seen)> _processes = [];
private readonly List<CrashReporterSighting> _sightings = [];
private readonly HashSet<(int Pid, DateTimeOffset Started)> _sighted = [];
private long _polls;
/// <summary>How many snapshots have been observed — what <see cref="FindAsync"/> waits on.</summary>
public long Polls => Interlocked.Read(ref _polls);
/// <summary>One watcher snapshot: remember who is running, and every on-crash reporter that appeared, with its parent as known.</summary>
public void Observe(IReadOnlyList<ProcessSnapshot> snapshot, DateTimeOffset now)
{
ArgumentNullException.ThrowIfNull(snapshot);
lock (_lock)
{
foreach (ProcessSnapshot p in snapshot)
{
_processes[p.Pid] = (p.ImagePath, p.StartedAt, now);
}
foreach (ProcessSnapshot p in snapshot)
{
if (CrashReporterCatalog.IsOnCrash(p.ImageName) && p.StartedAt is { } started && _sighted.Add((p.Pid, started)))
{
_sightings.Add(Sighting(p, started));
}
}
foreach (int gone in _processes.Where(e => now - e.Value.Seen > _rememberProcess).Select(static e => e.Key).ToList())
{
_ = _processes.Remove(gone);
}
_ = _sightings.RemoveAll(s => now - s.StartedAt > _rememberSighting);
_ = _sighted.RemoveWhere(s => now - s.Started > _rememberSighting);
}
_ = Interlocked.Increment(ref _polls);
}
public async Task<CrashReporterSighting?> FindAsync(CrashQuery query, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(query);
if (query.TargetPid == 0)
{
return null;
}
if (query.TargetLeft && Polls > 0)
{
// The reporter a dying game starts may not be in the last snapshot yet: two more polls, at most 2.5 s.
long target = Polls + 2;
DateTimeOffset deadline = DateTimeOffset.UtcNow + _waitForPolls;
while (Polls < target && DateTimeOffset.UtcNow < deadline)
{
await Task.Delay(100, ct).ConfigureAwait(false);
}
}
lock (_lock)
{
return _sightings.FirstOrDefault(s => s.ParentPid == query.TargetPid
&& s.ParentImagePath is { } parent && string.Equals(parent, query.ExePath, StringComparison.OrdinalIgnoreCase)
&& s.StartedAt >= query.WindowStart && s.StartedAt <= query.WindowEnd);
}
}
/// <summary>The parent as last seen — unless that pid belongs to a process that started after the reporter, which is a reused pid.</summary>
private CrashReporterSighting Sighting(ProcessSnapshot reporter, DateTimeOffset started)
{
if (_processes.TryGetValue(reporter.ParentPid, out (string? Image, DateTimeOffset? Started, DateTimeOffset Seen) parent)
&& (parent.Started is null || parent.Started <= started))
{
return new CrashReporterSighting(reporter.ImageName, reporter.ParentPid, parent.Image, parent.Started, started);
}
return new CrashReporterSighting(reporter.ImageName, reporter.ParentPid, null, null, started);
}
}
@@ -9,7 +9,11 @@ public enum ExitStatus
/// <summary>The presenting process exited 0 and no Application Error / WER record names it.</summary>
Normal = 0,
/// <summary>Non-zero exit code, or an event 1000 / 1001 naming the exe within <c>[start, end + 30 s]</c>.</summary>
/// <summary>
/// An exception's exit code (<c>ExitStatusMapper.IsExceptionCode</c> — "non-zero" until beta.8, corrected 2026-10-05), an
/// Application-log crash report of this game (<c>CrashEventMatcher</c>, beta.14), or an engine's crash reporter the game
/// started before it left (<c>CrashReporterRule</c>, beta.14).
/// </summary>
Crashed,
/// <summary>The guard fired mid-session.</summary>
@@ -47,6 +47,9 @@ public sealed class ExecutableLocator : IExecutableLocator
"crash", "handler", "unins", "setup", "install", "redist", "vc_redist", "dxsetup", "dotnet", "cef", "report", "updater",
"launcher_helper", "easyanticheat", "beservice", "battleye", "steamerrorreporter", "ue4prereq", "uecc", "vcredist", "python", "node",
"browser", "webview", "subprocess", "analyzer", "vconsole",
// beta.14: BugSplat's sender (BsSndRpt64.exe, Kingdom Come: Deliverance II) matches none of the above — its name says
// "report" without the letters; KCD2 picked its game by rank alone.
"bssndrpt", "bugsplat",
];
/// <summary>
@@ -9,7 +9,8 @@ namespace FrameLedger.Infrastructure.Recording;
/// <summary>
/// The Application log's Application Error (1000) and Windows Error Reporting (1001) events, filtered to
/// the window and to records that name the executable (<c>04_CAPTURE</c> §Crash &amp; exit classification).
/// the window and the two providers, and judged by <see cref="CrashEventMatcher"/> (<c>04_CAPTURE</c> §Crash &amp; exit
/// classification) — since beta.14, which counted any such record whose text contained the executable's name.
/// </summary>
/// <remarks>
/// Read-only, unprivileged (the Application log is readable by any interactive user), bounded by the
@@ -20,12 +21,13 @@ public sealed class EventLogCrashSource : ICrashEventSource
{
private const string _log = "Application";
public bool FoundCrash(string exeFileName, DateTimeOffset windowStart, DateTimeOffset windowEnd)
public bool FoundCrash(CrashQuery query)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exeFileName);
string from = windowStart.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string to = windowEnd.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string xpath = $"*[System[(EventID=1000 or EventID=1001) and TimeCreated[@SystemTime>='{from}' and @SystemTime<='{to}']]]";
ArgumentNullException.ThrowIfNull(query);
string from = query.WindowStart.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string to = query.WindowEnd.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string xpath = "*[System[Provider[@Name='" + CrashEventMatcher.ApplicationErrorProvider + "' or @Name='" + CrashEventMatcher.WerProvider + "']"
+ $" and (EventID=1000 or EventID=1001) and TimeCreated[@SystemTime>='{from}' and @SystemTime<='{to}']]]";
try
{
using var reader = new EventLogReader(new EventLogQuery(_log, PathType.LogName, xpath));
@@ -33,7 +35,8 @@ public sealed class EventLogCrashSource : ICrashEventSource
{
using (record)
{
if (Names(record, exeFileName))
var read = new CrashLogRecord(record.Id, record.ProviderName, [.. record.Properties.Select(static p => p.Value)]);
if (CrashEventMatcher.Matches(read, query))
{
return true;
}
@@ -47,18 +50,4 @@ public sealed class EventLogCrashSource : ICrashEventSource
return false;
}
}
/// <summary>The executable appears among the event's properties (1000's first field is the faulting application's name).</summary>
private static bool Names(EventRecord record, string exeFileName)
{
foreach (EventProperty property in record.Properties)
{
if (property.Value is string s && s.Contains(exeFileName, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
}
}
@@ -36,7 +36,7 @@ namespace FrameLedger.Infrastructure.Telemetry;
/// answer (N/A, layer healthy), not a fault.
/// </para>
/// </remarks>
public sealed class BaselineTelemetrySource : IGpuTelemetrySource
public sealed class BaselineTelemetrySource : IGpuTelemetrySource, IGpuAdapterSelector
{
/// <summary>Faults tolerated before the layer is disabled. The second one disables.</summary>
public const int MaxFaults = 2;
@@ -30,7 +30,7 @@ namespace FrameLedger.Infrastructure.Telemetry;
/// Owns its layers: disposing the composite disposes them.
/// </para>
/// </remarks>
public sealed class CompositeTelemetrySource : IGpuTelemetrySource
public sealed class CompositeTelemetrySource : IGpuTelemetrySource, IGpuAdapterSelector
{
/// <summary>Throws tolerated from one layer's <c>TryRead</c> before it is excluded. The second one excludes.</summary>
public const int MaxFaults = 2;
@@ -42,6 +42,7 @@ public sealed class CompositeTelemetrySource : IGpuTelemetrySource
private readonly string?[] _lastFault;
private readonly TelemetryLayer[] _fieldLayers = new TelemetryLayer[_fieldBits];
private readonly Lock _lock = new();
private GpuAdapterIdentity? _selected;
private bool _disposed;
public CompositeTelemetrySource(IEnumerable<IGpuTelemetrySource> layers)
@@ -89,6 +90,55 @@ public sealed class CompositeTelemetrySource : IGpuTelemetrySource
public string Descriptor =>
TelemetryLayerNames.Describe(Enumerable.Range(0, _layers.Length).Where(IsStanding).Select(i => _layers[i].Layer));
/// <summary>The adapter <see cref="SelectAdapter"/> last chose; null before the game's first present named one.</summary>
public GpuAdapterIdentity? Selected
{
get
{
lock (_lock)
{
return _selected;
}
}
}
/// <summary>
/// The adapter the game presents on (beta.13). The layer that names adapters by LUID (L1) switches to it, and every layer
/// that reads its own GPU is told the adapter's vendor (<see cref="IGpuVendorFollower"/>), so a merged sample describes the
/// game's card and not the first one each layer happened to find. False — nothing told — when no layer listed the LUID.
/// Under the merge lock, so no sample mixes the old adapter with the new one.
/// </summary>
public bool SelectAdapter(ulong luid)
{
lock (_lock)
{
GpuAdapterIdentity? chosen = null;
for (int i = 0; i < _layers.Length; i++)
{
if (IsStanding(i) && _layers[i] is IGpuAdapterSelector selector && selector.SelectAdapter(luid))
{
chosen ??= selector.Selected;
}
}
if (chosen is null)
{
return false;
}
_selected = chosen;
for (int i = 0; i < _layers.Length; i++)
{
if (IsStanding(i) && _layers[i] is IGpuVendorFollower follower)
{
follower.FollowVendor(chosen.VendorId);
}
}
return true;
}
}
/// <summary>What a layer's last throw said, for the report. Null if it never threw.</summary>
public string? LastFaultOf(TelemetryLayer layer)
{
@@ -42,7 +42,7 @@ namespace FrameLedger.Infrastructure.Telemetry;
/// never reports sets nothing. <see cref="GpuSample.PresentFields"/> is the only input.
/// </para>
/// </remarks>
public sealed class LhmTelemetrySource : IGpuTelemetrySource
public sealed class LhmTelemetrySource : IGpuTelemetrySource, IGpuVendorFollower
{
/// <summary>Faults tolerated before the layer is disabled. The second one disables.</summary>
public const int MaxFaults = 2;
@@ -61,6 +61,9 @@ public sealed class LhmTelemetrySource : IGpuTelemetrySource
private int _polling;
private int _hangCounted;
private long _pollStartedUtcTicks;
/// <summary>The game adapter's PCI vendor id once known (beta.13); 0 maps the first GPU node, as before.</summary>
private int _vendor;
private bool _opened;
private bool _disposed;
private string? _lastFault;
@@ -126,8 +129,15 @@ public sealed class LhmTelemetrySource : IGpuTelemetrySource
}
/// <summary>
/// One poll: refresh the tree, map the first GPU node, publish. Public so a probe or a
/// test can drive it without the thread; the thread calls exactly this.
/// The game presents on this vendor's adapter (beta.13): the next polls map that vendor's GPU node rather than the first
/// one LibreHardwareMonitor lists — on a laptop that is often the integrated GPU while the game runs on the discrete one —
/// and publish nothing when the tree has no node of that vendor.
/// </summary>
public void FollowVendor(uint vendorId) => Volatile.Write(ref _vendor, unchecked((int)vendorId));
/// <summary>
/// One poll: refresh the tree, map the first GPU node — of the game adapter's vendor once that is known (beta.13) —
/// publish. Public so a probe or a test can drive it without the thread; the thread calls exactly this.
/// </summary>
public void PollOnce()
{
@@ -143,10 +153,11 @@ public sealed class LhmTelemetrySource : IGpuTelemetrySource
{
_computer.Update();
uint vendor = unchecked((uint)Volatile.Read(ref _vendor));
IHardware? gpu = null;
foreach (IHardware hardware in _computer.Hardware)
{
if (SensorMap.IsGpu(hardware))
if (SensorMap.IsGpu(hardware) && (vendor == 0 || SensorMap.IsVendor(hardware, vendor)))
{
gpu = hardware;
break;
Loaded 100 of 158 files, more files were not shown because too many files have changed in this diff. Show more