Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 beb248c8bd perf(app): the documents scroll by Windows' lines and glide, and a page is rendered once - MarkdownView handles the wheel and renders ahead of layout (beta.21 PR-3)
The owner's request of 2026-10-13: scrolling the documents in the app is slow.
Measured first (rendering every embedded document in memory): layout costs
about 1 ms per wheel step, so drawing was not it. Two things were:

- WPF's ScrollViewer moves a FIXED 48 DIP per wheel message, whatever its
  delta (ScrollViewer._mouseWheelDelta; deltas of -1, -15, -120 and -360 each
  moved 48 on a FlowDocumentScrollViewer): about 2.4 lines of body text,
  Windows' "lines to scroll" ignored, a touchpad's small deltas each jumping
  the whole step - LICENSE took about 200 notches to the end.
- Each of MarkdownView's three properties rendered the whole document on its
  own: DocumentBrowser.ShowPage rendered the old text under the new path first,
  the Legal Gate's three bindings rendered three times, and nothing was kept.

Changed:

- MarkdownView handles PreviewMouseWheel itself: the delta in proportion, at
  Windows' lines per notch at a browser's line (100/3 DIP; three lines = 100,
  scaled by the zoom; -1 = a screen), eased there over about 120 ms through
  CompositionTarget.Rendering unless Windows' animations are off; a notch
  turned while easing adds to the target; something else moving the view, a
  new page or Unloaded ends the easing. At either end the wheel is left
  unhandled, so the update notes' dialog scrolls instead; Ctrl+wheel stays the
  zoom. The keyboard modifiers and the lines setting are injectable, as
  ChartWheel's are.
- One render per page: MarkdownView.Show sets the three properties and renders
  once, now (DocumentBrowser uses it); property changes post one render at
  DataBind priority, ahead of layout; Anchors and ScrollTo render what is
  pending first. A view keeps the last 16 documents it rendered (path, plain,
  text), so going back to a page costs its layout only.
- The table renderer's TableColumn Width = GridLength.Auto is gone: it is
  WPF's default.
- The ui log and --diag name WPF's render tier (0 = software rendering, where
  every scroll is drawn on the CPU).

Tests: MarkdownViewTests - the step's arithmetic; on a real view, one notch
moves 100 DIP and a delta of 15 an eighth of that, the end leaves the wheel to
the host, Ctrl leaves it to the zoom; easing adds notches to the target and a
new page stops it; Show renders once, a page shown before is not rendered
again, past 16 the oldest is; properties set one by one render once, after the
dispatcher runs. DiagReportTests: render_tier. Docs: 08_UI (rendered
documents), 16_WPFUI_SYNTAX (the 48 DIP trap), CHANGELOG.

Gate: ./build.ps1 ALL GATES PASSED (272 s); App tests 605; MarkdownViewTests
looped 5x green. The owner's live rules files were pre-seeded with the
repository's for the run and restored byte for byte after (a test run with
their older file in place raced two seeders on one replace -
AgentReadOnlyVerbsTests: "could not write the rules file").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:07:11 +07:00
poli0981andClaude Opus 5.5 df113c0888 fix: the four itch "launchers" are malware - the docs say so and stop advising to run one (D57); the Supports card says what a scan found (beta.21 PR-2) (#302)
The owner's report of 2026-10-13 ("the RPG Maker path is wrong" for HELLO,
HELLO WORLD!) led to the files behind it. Read without running anything
(spike-notes section 20): the 213 MB .NET program HELLO, HELLO WORLD!, A
Doll's Locket - Remake, City of Bones and Traumerei Chapter 2 put in front of
their RPG Maker game is not a launcher. Beside each sits a byte-identical
3,060-byte registry file that sets AmsiEnable=0 (HKCU and HKLM) and adds
Microsoft Defender exclusions for .exe, .msi, powershell.exe, rundll32.exe,
msiexec.exe and regasm.exe, plus SpyNet off, and a 3,216-byte encrypted
".xml"; the program's metadata names VM and debugger checks, AES decryption,
an in-process PowerShell runspace and RunPayload/PayloadStep steps, and it
starts the RPG Maker runtime beside it - the decoy. SHA-256 of all four in
spike-notes section 20.

Owner decision D57 (asked, 2026-10-13): correct the documentation; the import
keeps taking a store's own pick when it is not a helper.

- docs/spike-notes.md: section 17's "front their runtime with a 213 MB .NET
  launcher" struck and corrected; new section 20 with what the files are.
- docs/05_DETECTION.md: the beta.19 note's rationale annotated, its "measured
  with the admin mode on (D34)" sentence struck; the RPG Maker paragraph's
  examples annotated.
- docs/HANDOFF.md: D28, D56 ("the locator now picks the same file" - not for
  HHW's import: itch's verdict names the program in front, which is not a
  helper) and owner-only item 15(a) (do not run Doll's Locket's launcher).
- CHANGELOG: a Security entry under [Unreleased]; the beta.19 entry's admin
  advice marked withdrawn.
- docs/LIST_GAME_TESTED.md: the HELLO, HELLO WORLD! row says its download is
  malware (approved with the plan, D35).
- LIMITATIONS.md: FrameLedger does not tell whether a game is safe to run.

The repository states only what the files are; nothing here was run,
decrypted or uploaded.

Also fixed, from the same screenshot: the game page's Supports card read "Not
scanned yet" for every game that ships none of the capability files, even
beside a Details card the sweep had read. It now says that until the sweep has
read the executable (ExeMachine set), then "None found" (new string
GameDetail_Supports_None, en/vi/ja - ja marked review). Test:
TheSupportsCardSaysNotScannedOnlyUntilTheSweepHasReadTheExecutable. 08_UI
says the same.

Gate: ./build.ps1 ALL GATES PASSED (301 s); App tests 600. The owner's live
rules files were copied aside and restored byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:07:05 +07:00
poli0981andClaude Opus 5.5 1070cd303f fix(guard): an anti-cheat beside the executable is found before anything is injected - check 4 walks the executable's own folder too; rules 2026.10.4 (beta.21 PR-1) (#301)
The owner's report of 2026-10-13: no anti-cheat found in Wuthering Waves
(Steam 3513350). Measured read-only on the owner's disk and in the Agent's log
(spike-notes section 19):

- The install root holds a launcher, Client\ and Engine\; the entry is
  Client\Binaries\Win64\Client-Win64-Shipping.exe, and Tencent's ACE sits
  beside it in Client\Binaries\Win64\AntiCheatExpert\ (ACE-BASE.sys,
  ACE-CORE.sys, ACE-Base64.dll, ACE-Service64.exe, ACE-Setup64.exe) - four
  levels under the root.
- Check 4 walked the install root only (ResolveInstallRoot, since
  2026-09-25), and WalkDir opens folders only while depth + 1 <
  kMaxPreScanDepth (3): a folder at the last level is named and never opened,
  SILENTLY - the walk reports kOk. The rules already named the folder; the
  walk never handed it to the matcher. The library pre-scan read the game
  clean three times, and the session of 2026-10-12 was hooked for 37 s until
  the 30 s re-scan met ACE-BASE.sys - a machine-wide finding, which turned
  nothing off.

Fixed:

- Check 4 walks the install root, then - when the executable lives below it -
  the executable's own folder (ScanGameFolders): same walk, same reach, its
  own 4096-entry budget, same matcher, same D33 tolerance and finding record.
  Sources::ImageDirectory names the executable's folder and the checks
  resolve the root from it (CheckStaticPreScan, CheckBlockedStoreId). Raising
  the reach was measured and rejected (spike-notes section 19): depth 4 still
  misses NTE's AntiCheatExpert\ (six levels down), depth 5 overruns 4096
  entries on three installed titles, which would refuse them. Across the
  owner's 83 Steam installs the second walk costs at most 103 entries and
  newly finds exactly those two folders.
- Rules 2026.10.4 (the bump is also what makes every game's pre-scan run
  again - the sweep re-scans only on a rules version or executable change):
  the five ACE-* files, ACE-CORE.sys (drivers), the ACE-BASE service, a
  modules row of its own for ACE-Base64.dll appended at the end (the
  Overlay's early-stop index), and Wuthering Waves' Steam id on the title
  list (owner decision D58). Notes within the schema's 300 characters.
- Comments that said the depth cap refuses (fl_prescan.h, guard_test.cpp)
  and docs that said so (19_SAFETY item 4, 05_DETECTION) are corrected in
  place; CLAUDE.md's D33 ".sys anywhere in the install tree" now says what
  check 4 reaches.

Tests: the fake lists a folder per directory and records every directory
check 4 walks; Wuthering Waves' layout refuses from the path and from the
pid; an executable at its root is walked once; an unfinished walk of the
executable's folder refuses; D33's tolerance and the .sys rule hold in the
second walk; and two REAL-filesystem cases - the real walk names Win64 from
the root and never opens it, the pre-scan over the real walk and store seam
finds AntiCheatExpert\ beside a nested executable and passes the same tree
without it; the real ImageDirectory names the executable's own folder.

Before/after on the owner's disk, read-only (FlStaticPreScanGame): the
installed beta.20 guard answers Allow for Wuthering Waves; this build answers
BlockedStoreId Anti-Cheat Expert. NTE, GF2 (NEP2.dll) and nine other Unreal
installs read as before.

Gate: ./build.ps1 ALL GATES PASSED (296 s); native 32/32. The owner's live
rules files were copied aside before the run and restored byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 19:51:38 +07:00
dependabot[bot]andpoli0981 f8ecc19371 Bump the minor-and-patch group with 1 update (#291)
Bumps Meziantou.Analyzer from 3.0.294 to 3.0.299

---
updated-dependencies:
- dependency-name: Meziantou.Analyzer
  dependency-version: 3.0.299
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: poli0981 <127664709+poli0981@users.noreply.github.com>
2026-10-12 13:17:25 +00:00
poli0981andClaude Opus 5.5 57a428846e release: 0.1.0-beta.20 - the CHANGELOG section, release lines, HANDOFF's beta.20 section and owner-only item 16 (beta.20 PR-2) (#300)
VERSION stays 0.1.0: the tag's numeric core. The owner (2026-10-12, the
same evening as beta.19): "tung bản beta20 rồi đóng phiên hẳn". The release
carries #299: a Ren'Py game's engine version from the engine's own
renpy/vc_version.py (rules 2026.10.3, Privacy Policy 2.9).

- CHANGELOG: [Unreleased] becomes [0.1.0-beta.20] - 2026-10-12, with its
  summary and "Updating from 0.1.0-beta.19" (Privacy 2.9 shown once; every
  game read again for its engine); tools/release-notes.ps1 -Version
  0.1.0-beta.20 extracts it (957 characters).
- The accuracy block's release line (legal/ACCURACY.md, embedded in README
  and the Disclaimer; accuracy-check green), README's release lines and
  count, LIMITATIONS' version.
- HANDOFF: beta.19's START HERE struck; the beta.20 section - the owner's
  two words, no new decision (the 2.9 wording was shown with #299), the
  traps (keyboxd's I/O error, the owner's live rules copied aside and back,
  looping a touched test class); owner-only item 16 (Bound Between Desks
  reads Ren'Py 8.5.0; Privacy 2.9 once; the ja string).

Gates run locally on this tree: accuracy-check, wiki-check (self-test and
27 pages), notice-check, test-artifacts, release-notes. The code is #299's,
whose tree passed ./build.ps1 (325 s) and CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 19:12:26 +07:00
poli0981andClaude Opus 5.5 4ae563c97e feat(detection): the engine version of Ren'Py games, read from the engine's own version file (beta.20 PR-1) (#299)
The owner asked (2026-10-12, after beta.19's Unity, Godot and RPG Maker
versions) for the version of Ren'Py games. The renpy rule had no version
extractor.

Ren'Py ships its engine as Python beside the game's launcher, and
renpy/vc_version.py names its release: version = '8.5.0.25111603', beside
branch, nightly, official and version_name. Measured read-only on the
owner's one Ren'Py install, Bound Between Desks (Steam): 109 bytes, the
same number the game's log.txt printed at its last start; the launcher has
no version resource (spike-notes §18).

- Rules 2026.10.3: renpy -> {"type": "renpy_build"}; the schema's enum of
  code-decided extractors gains it. Every entry is read again once.
- Domain: RenPyBuildFacts + RenPyVersion.Decide keep MAJOR.MINOR.PATCH,
  as Ren'Py names its releases (the fourth number is the build), source
  renpy_vc_version; VersionExtractorType.RenPyBuild; the evaluator leaves
  it to the detector, as the other code-decided types.
- Application: IGameFileProbe.ReadRenPyBuildAsync; StaticGameDetector
  makes the one second read for a Ren'Py match.
- Infrastructure: RenPyBuildReader reads the first 4 KiB of
  renpy/vc_version.py beside the executable, its version line only.
- App: the game page says "Ren'Py 8.5.0" and that it was read from the
  engine's version file (en/vi/ja, ja marked review); a Ren'Py row whose
  file names no version says "Not found in the game's files".
- Privacy Policy 2.9: §4's list of the version marks an engine keeps in
  its own files names Ren'Py's (legal-drift-history). The Legal Gate shows
  it once at the next update.
- The accuracy block (ACCURACY, README, DISCLAIMER), LIMITATIONS,
  05_DETECTION §Engine version - Ren'Py, 06_DATA_MODEL, 08_UI, CHANGELOG.
- HANDOFF: owner-only item 15 struck, passed 2026-10-12 (the owner's
  report, and the Agent's log for the removal: one check at 18:04:00 took
  three session-less entries); the rules-reseed trap gains the backup the
  session made of the owner's two rules files.

Through the shipped pipeline (StaticGameDetector over GameFileProbe, read
only): Bound Between Desks renpy 8.5.0 renpy_vc_version in 79 ms; Dialoop,
Plethora of Bullets 2, A Doll's Locket and City of Bones read as before.

Tests: RenPyVersionTests (the measured value; the build dropped; shapes
that are not a version), EngineBuildReadersTests (the measured file beside
the launcher; no file, a version_name only, past the bounded head),
StaticGameDetectorTests (one read for the matched engine),
GameDetailViewModelTests and FormatsTests (the page's words).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 18:41:13 +07:00
poli0981andClaude Opus 5.5 3e9028c139 release: 0.1.0-beta.19 - the CHANGELOG section, release lines, HANDOFF's beta.19 section and owner-only item 15 (beta.19 PR-5) (#296)
VERSION stays 0.1.0: the tag's numeric core. The owner (2026-10-12) asked for
four items; the train is #292 (the import never takes a helper; D56), #293
(Change executable... opens in the game's folder), #294 (Unity, Godot and RPG
Maker versions; rules 2026.10.2; Privacy Policy 2.8) and #295 (an uninstalled
game with no session leaves the library; D55), then the two follow-ups of
#295's review the owner asked for as separate PRs: #297 (one notice per check;
the Games page shows its newest read) and #298 (the presence probe's
unreadable-folder tests).

- CHANGELOG: [Unreleased] becomes [0.1.0-beta.19] - 2026-10-12, with its summary
  and "Updating from 0.1.0-beta.18" (Privacy 2.8 shown once; every game read
  again for its engine; the removal switch to turn off first if wanted; an
  entry made for a helper is re-pointed by hand); tools/release-notes.ps1
  -Version 0.1.0-beta.19 extracts it.
- The accuracy block's release line (legal/ACCURACY.md, embedded in README and
  the Disclaimer; accuracy-check green), README's release lines and count,
  LIMITATIONS' version.
- HANDOFF: beta.18's START HERE struck; the beta.19 section - D55, D56, the
  existing entry not rewritten, the owner's two train instructions; the traps
  (a store's own pick can be a helper, substring helpers never overrule a
  store, Godot's string past the scan and Unity's FileVersion string, Exists
  answering false for what it may not see, the locked signing key, the
  mechanical ones, what the pre-merge review of #295 found, looping a touched
  test class, the rules reseed); owner-only item 15.

Release rehearsal: release.yml dispatched on the branch (run 38226132220)
green - FL_BUILD_ID from the clean checkout, buildid-check ok over 4 native
binaries, a 2.35 MB delta from 0.1.0-beta.18 (28 of 460 files patched).
The final tree passed ./build.ps1 (ALL GATES PASSED in 284 s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:13:55 +07:00
poli0981andClaude Opus 5.5 59e8ea4967 test(infrastructure): a game folder Windows will not list is never gone (beta.19 PR-7) (#298)
The presence probe (#295, D55) decides whether an entry's executable is
gone — FileGone, the one answer that lets the Agent remove the entry — or
merely unreadable. File.Exists and Directory.Exists say false for what
they may not look at, so the probe asks listings: the file in its folder's,
a folder that reads as missing in its parent's, and a listing it is refused
is Unknown. The review of #295 found those two branches untested.

ExecutablePresenceProbeTests now denies the current user rights on real
folders and gives them back in a finally (the owner can always change the
access list):

- ListDirectory denied on the game folder: the executable there and a
  Gone.exe there are both Unknown, and Present again once it lists;
- ListDirectory + ReadAttributes denied on the game folder and
  ListDirectory on the library folder it is in: Directory.Exists says false
  for the game folder, and the probe still says Unknown.

Each skips (Assert.SkipUnless) when the process can list what it is denied
— a backup privilege enabled — rather than asserting something else.

Measured red on this machine: with the folder listing replaced by
File.Exists the first test fails (Present for a folder that will not list);
with the parent-listing check dropped the second fails with FileGone, the
answer that would have removed an installed game. Both restored.

FR-1.8 (02_SPEC) names the case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:03:21 +07:00
poli0981andClaude Opus 5.5 89aae82432 fix(app): one check's removals are said once, after one read of the library (beta.19 PR-6) (#297)
The Agent removes an uninstalled, session-less entry by itself since this
train (D55), and says each removal in its own GameRemoved event. One check
that removes several sends them milliseconds apart, and the Games page on
screen showed a snackbar and started a full library read for each. WPF UI
4.3.0's SnackbarService keeps one snackbar and shows every message at once
in it (Show(true) -> SnackbarPresenter.ImmediatelyDisplay, read from the
4.3.0 assembly), so only the last name stayed on screen.

The page now waits GamesViewModel.RemovalSettle (one second, over an
injected TimeProvider) after the first removal for the rest of the check,
reads the library once and says them in one notice: the game's name as
before, or the count, five names and how many more
(Games_Removed_Many_Format, Games_Removed_More_Format; en/vi/ja, ja marked
review). A removal heard during the read starts the next notice. The game
page's own handling of its entry is unchanged.

Tests: GamesViewModelTests — the single removal waits, then says the one
name; three removals in one check make one wait, one notice naming all
three and the remaining card; six name five and "1 more". Both over a
clock whose timers fire when the test says so.

Docs: 08_UI §Games; CHANGELOG's D55 entry.

fix(app): the Games page shows its newest read of the library (beta.19 PR-6)

Reads of the library overlap - a session that ends, an import, a removal -
and each awaits its executable checks off the UI thread. The read that
started first could finish last, its checks waiting on a slow drive, and
its older list was shown over the newer one: after the Agent removed a
game, an overlapping older read put the removed game's card back until the
next read.

Found by running GamesViewModelTests in a loop while the release train was
gated: one local run in about 165 failed. The pre-existing
ACardSaysWhetherItsExecutableIsThereAndWhy starts its own two reads (the
constructor's and an explicit one), and the first could be applied last.

GamesViewModel.LoadAsync now numbers each read (Interlocked) and shows it
only if no newer read began meanwhile. The executable check is injectable
(Func<string, bool>, default GameLibrary.ExecutableExists) so a test can
hold one read's check.

Tests:
- GamesViewModelTests.AnOlderReadThatFinishesLastIsNotShownOverANewerOne
  holds the first read in its check (bounded waits, so a broken test
  fails rather than hangs), lets a newer read list two games, then lets
  the first finish. It goes red without the guard ("found 1").
- ACardSaysWhetherItsExecutableIsThereAndWhy awaits the page's first read
  before adding the games it lists.

Measured: 10 runs of the class green and the whole App suite 599/599.

Docs: 08_UI §Games; CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:49:59 +07:00
poli0981andClaude Opus 5.5 c1a9e16cc4 feat(agent): a game that is no longer installed and has no session leaves the library by itself (beta.19 PR-4, D55) (#295)
The owner asked (2026-10-12) whether the Agent removes games whose executable
is gone, and if not, to remove them when no session was recorded. It did not:
D41 (2026-10-03) marked them Not installed and removed nothing. Owner decision
D55 amends it: removed after ten minutes, behind a Settings switch on by
default.

- UninstalledEntryPrune (Application/Watch), asked by DetectionSweep about an
  entry whose executable stayed unreadable after the relocator: the file gone
  at sweeps >= 10 minutes apart at the same path (counted in memory - a restart
  only delays it), the switch on (retention.remove_uninstalled_games, read at
  every sweep), not recording and no .partial waiting (the merge's busy test),
  and no anti-cheat block, exception grant or failed-trial mark (rule 2 and
  D38: an uninstall must not be how a block or "never again" disappears).
- ExecutablePresenceProbe tells what ExecutableIdentity.Read's null runs
  together: a drive not connected, nothing left of the path but the drive's
  root (a different disk under the same letter), a folder Windows will not list
  (asked of the parent's listing, since Exists answers false for both) - and
  FileGone, the only answer that removes: the file gone from a folder that is
  still there, or the game's folder gone from one that is.
- SqliteGamePrune: one DELETE that holds every stored condition in the same
  statement - same row, same path, in the library, NOT EXISTS a session, no
  block, no grant, no trial mark - so a session finalized meanwhile wins.
- IPC GameRemoved (additive): the Games page on screen reloads and says why in
  the snackbar; a game page showing that entry reloads into its not-found state.
- Settings > Data > Remove uninstalled games (off in a viewer like every
  Agent-read setting; its strip says the Agent reads it within 15 seconds).
  Strings en/vi/ja (ja marked review).
- Docs: 02_SPEC FR-1.8, 06_DATA_MODEL (writer ownership, settings registry),
  07_IPC, 08_UI, 19_SAFETY, the guide's data, screens and settings pages.

A self-review after the gate (before the merge): the presence probe asks the entry's own
drive (VolumeRoots.IsReady: the type first, so a dead share is never asked whether it is
ready) instead of listing every drive per entry; an entry the delete refused is asked again
after an hour (its sessions may since have been deleted) rather than never; 06_DATA_MODEL's
cross-reference names the 19_SAFETY section that exists. The vi and ja switch texts name the
pill as those languages show it (“Chưa cài”, “未インストール”).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:50:26 +07:00
poli0981andClaude Opus 5.5 a53ebee683 feat(detection): the engine version of Unity, Godot and RPG Maker games, read from their own files (beta.19 PR-3) (#294)
The owner's request of 2026-10-12. Rules 2026.10.1 gave: Unity's
pe_file_version stored UnityPlayer.dll's FileVersion string as it is
(2022.3.39.5118735 - the build number where the release letter belongs);
Godot's strings_regex scanned the executable's first 8 MiB while the
"Godot Engine v..." string sits 57-78 MB into both exports on the owner's
disk, so it never read one; both RPG Maker rules had version: null.

Measured read-only on 23 installs first (spike-notes section 17), then decided
in code as Unreal's is since beta.10:

- Rules 2026.10.2: unity_build, godot_build, rpgmaker_build - extractor types
  that take no parameter (the schema's enum beside unreal_build).
  StaticGameDetector makes one second read for the engine that matched;
  RuleEvaluator answers null for them as for unreal_build.
- Domain: UnityVersion (player ProductVersion, else the data file's header,
  else the player's numeric version), GodotVersion (a data pack's header,
  beside the executable or appended to it, else the executable's version
  while it is still Godot's; a zero patch dropped, as Godot names it),
  RpgMakerVersion (MZ/MV core-script header; the RGSS library Game.ini names
  -> XP/VX/VX Ace, its version or the one its name carries). New
  EngineVersionSource ids name the witness - and the maker.
- Infrastructure: UnityBuildReader, GodotBuildReader, RpgMakerBuildReader -
  version resources and at most a few kilobytes of any file; RPG Maker's files
  beside the executable or up to two folders above, as RpgMakerTitle looks.
- App: Formats.Engine(id, source) and EngineWithVersion - "RPG Maker MZ
  1.10.0", "RPG Maker VX Ace (RGSS 3.0.1)", "Unity 2022.3.39f1", "Godot 4.4.1"
  on the page, the subtitle and the card; the Engine version row says what
  each was read from, and "Not found in the game's files" once read. Strings
  en/vi/ja (ja marked review).
- Privacy Policy 2.8: section 4 names the version marks an engine keeps in its
  own files (the owner-approved wording), which also covers two reads that were
  never stated (UnityPlayer.dll's version, an RPG Maker title). The accuracy
  block, LIMITATIONS, 05_DETECTION, 06_DATA_MODEL, 08_UI and
  legal-drift-history say the same.

The shipped pipeline over the owner's installs (read-only): Unity 15 of 15,
Godot 2 of 2, RPG Maker 6 of 6, every one as measured; 24 ms to 4.1 s per
entry on the USB drive, nearly all of it the install's walk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:40:00 +07:00
poli0981andClaude Opus 5.5 3f798ad364 feat(app): Change executable... opens in the game's own folder (beta.19 PR-2) (#293)
The owner's request of 2026-10-12: the file dialog of Change executable...
opened wherever the last file dialog was, and the pick is almost always
another file of the same install.

GameFolder.StartFolder derives the folder from the row's path - the only
place one is stored: the install folder a store boundary names (InstallRoot:
steamapps\common\X, GOG Galaxy\Games\X, Epic Games\X, GamesInstalled\X), above
an Unreal package's <Project>\Binaries\Win64 where no boundary is recognised,
else the executable's folder; the nearest folder still there when that one is
gone (a Not installed entry); null for a drive that is not connected, where
Windows opens its last folder. It asks the file system, so the page runs it off
the UI thread. IGamePicker.PickExecutable takes the folder; Add game passes
none and keeps Windows' own choice.

Tests: GameFolderTests (each layout, a gone folder, an absent drive),
GameDetailViewModelTests.ChangingTheExecutableOpensThePickInTheGamesOwnFolder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:25:07 +07:00
poli0981andClaude Opus 5.5 38fdb6bd32 fix(import): a helper a store names is never the game, and an NW.js runtime outranks its launcher (beta.19 PR-1) (#292)
The owner's A Doll's Locket - Remake (itch 5085165, RPG Maker MZ) was imported as
Dolls Locket\notification_helper.exe. The pick was butler's verdict, taken as is:
butler stores a filtered verdict - the shallowest candidates, minus those whose
manifest asks for elevation - and does not rank what is left, so with the 213 MB
DollsLocket.exe launcher asking for administrator and the NW.js runtime a level
deeper in css\, the helper was the whole verdict (read from the owner's butler.db,
read-only).

- ItchLibrarySource skips a verdict candidate whose whole name is a runtime helper
  (ExecutableLocator.RuntimeHelperNames) or that sits in a Unity plugin folder; with
  nothing left the locator guesses and the review marks the row guessed. Whole
  names, not the locator's fragments: "node" is inside Nodebuster.
- ExecutableLocator ranks an executable beside nw.dll + package.json as an NW.js
  runtime (owner decision D56): below the Unity and Unreal layouts, above a name
  match. On the owner's disk it now picks css\Game.exe for Doll's Locket and
  swiftshader\Game.exe for HELLO, HELLO WORLD! (what D28 chose by hand); every other
  install it was run over picks what it picked before. notification_helper, nwjc
  and chromedriver join the helper fragments.
- LibraryImporter matches a store title to an entry by platform + store id as well
  as by path, so a corrected guess does not offer the same game a second time; the
  existing entry is re-pointed with Change executable... (nothing rewrites it).

HANDOFF owner-only item 14 (beta.18 on real hardware) is struck: passed 2026-10-08.

* fix(import): a store title is its entry by store id also when the entry's executable is inside the title's folder (beta.19 PR-1)

Found in a self-review after the stack's gate: the platform an import writes
is badged "detected", and the detection sweep refreshes it with what its own
rules find - an itch build that ships steam_api64.dll reads as Steam. Matching
the store id under the same platform only would then offer the same itch
title again beside its entry. The id now matches under the same platform, or
with the entry's executable inside the title's install folder; the same number
under another platform elsewhere is another store's numbering and stays a new
candidate (LibraryImporterTests.TheSameStoreIdInsideTheTitlesFolderIsTheSameTitleWhateverThePlatformReadsAs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:10:47 +07:00
poli0981andClaude Opus 5.5 6ed7851d90 test(capturehost): the Vulkan launch case asks the harness before the host runs; the target-exit case holds 15 s (beta.18 PR-5) (#290)
The two CaptureHost end-to-end races that failed beta.18's CI (both re-run green), taken at the owner's request
(2026-10-07) before the tag.

LaunchModeOnAVulkanTargetAttachesToTheLayersRingAndInjectsNothing failed #288 (run 37627351438) with
"session: RefusedByGuard / verdict: ModuleScanFailed  a module list came back incomplete". A hosted runner has the
Vulkan loader and no device, so the harness exits 77 with a "[SKIP]" line; the test read that line, or the session's
LaunchTargetExited, off the HOST's output. The runner is elevated, so the host starts the harness through
CreateProcessWithTokenW (UnelevatedProcess), which hands the child no stdout: the line never reached the host's output,
and when the guard's scan hit the dying harness the test failed instead of skipping. It now runs the plain harness
itself first (`--vulkan --hold-presenting 1`, bounded at 60 s), skips on 77 with the harness's own line, and otherwise
runs in full with no skip after the host - once the harness has presented here, every failure is real.
Measured: on this machine (a device) both cases pass, the Vulkan one in full; with the probe's ICDs hidden
(VK_DRIVER_FILES / VK_ICD_FILENAMES at a missing file, a throwaway edit) it skips in 0.66 s:
"[SKIP] vkCreateInstance failed (no ICD, or no surface extensions)".

WhenTheTargetExitsTheHostStopsAndSaysWhy failed #286 (run 37619719203) with TargetNotRunning: the host resolves its
target once, as it starts, and a host slower than the harness's 6 s hold found it gone (recorded since 2026-09-21).
The host prints nothing until its session ends, so there is no "attached" to wait for; the hold is 15 s, a margin.

The class's remark said CI does not run it; CI has, since 2026-09-06 - corrected in place. Docs: 13_CI_CD (the flake
tally), HANDOFF (beta.18's trap, struck to fixed), CHANGELOG [0.1.0-beta.18] (this ships in that tag).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 23:39:14 +07:00
poli0981andClaude Opus 5.5 dadcacf1a0 release: 0.1.0-beta.18 - the CHANGELOG section with how to update from beta.17, the accuracy block's release line, README's release lines, LIMITATIONS' version, HANDOFF's beta.18 section and owner-only item 14 (beta.18 PR-4) (#289)
* fix(release): the natives carry the clean checkout's build id - read before the date substitution, handed to CMake, read back out of the binaries (beta.18 PR-3)

The chip from beta.17, open since beta.4 (HANDOFF §0.1.0-beta.4, "Found and NOT fixed"): the owner's Dashboard read
"Overlay build v0.1.0-beta.17-dirty", and beta.16's the same. The release run's own log says why:
"RELEASE_DATE = 2026-10-07 in 3 file(s)" and, 22 s later, "FL_BUILD_ID = v0.1.0-beta.17-dirty". release.yml writes the
release date into the tracked legal/*.md before the gate, and CMake's configure reads `git describe --dirty` after it.
CI's own checkout is clean (main's last run: "FL_BUILD_ID = 15b4c6b0ecc1").

- release.yml: a step before the substitution reads describe from the clean checkout (12 digits, as CMake does),
  refuses one that is already dirty or longer than 31 characters, and exports FL_BUILD_ID. After the publish,
  tools/buildid-check.ps1 reads it back out of the four natives that compile it.
- src/native/FrameLedger.Shm/CMakeLists.txt: the environment's FL_BUILD_ID is taken as given, after a check for the
  characters a C string literal carries without escaping; otherwise describe as before. Its comment said a released
  build was exact - "CI configures and builds once from a clean checkout" - corrected in place.
- tools/buildid-check.ps1 (new): looks for the id as the C string it is compiled as (characters + NUL) in each
  binary's bytes; nothing is loaded - loading the Overlay would run its DllMain. -SelfTest, eight cases, both
  directions, runs in the gate (build.ps1 'buildid-check').

Measured here: ./build.ps1 native with FL_BUILD_ID=b18-envtest.1+x_y printed "FL_BUILD_ID = b18-envtest.1+x_y", and
buildid-check over the four built DLLs: "ok - 4 native binaries carry 'b18-envtest.1+x_y'"; with FL_BUILD_ID='bad "id"'
the configure stopped ("holds a character no build id has"). On this branch's own describe (dirty, "+"), the tool
refused the id itself and found it in all four binaries.

Docs: 12_BUILD (§Release-time token substitution; gate 14c), 13_CI_CD (§release.yml), HANDOFF (§0.1.0-beta.4's bullet
struck, dated), CLAUDE.md (tools), wiki Releasing, CHANGELOG [Unreleased].

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

* release: 0.1.0-beta.18 - the CHANGELOG section with how to update from beta.17, the accuracy block's release line, README's release lines, LIMITATIONS' version, HANDOFF's beta.18 section and owner-only item 14 (beta.18 PR-4)

VERSION stays 0.1.0: the tag's numeric core. The owner (2026-10-07) asked for beta.18 - the two chips beta.17 left and
the page text that blends into the dark window; the train follows beta.17's: merge on green CI, then the signed tag
v0.1.0-beta.18 on the merge commit. wiki.yml publishes the wiki after the Release run succeeds.

- CHANGELOG: [Unreleased] becomes [0.1.0-beta.18] - 2026-10-07, with its summary and "Updating from 0.1.0-beta.17";
  tools/release-notes.ps1 -Version 0.1.0-beta.18 extracts it (3948 characters).
- The accuracy block's release line (legal/ACCURACY.md, embedded in README and the Disclaimer; accuracy-check green),
  README's release lines and count, LIMITATIONS' version.
- HANDOFF: beta.17's START HERE struck; the beta.18 section - no new decisions; the traps (a page in the NavigationView
  inherits nothing; the accent is not in the theme dictionary; the gate's own refusals look like findings on the wire;
  Safety_Consent_* strings are versioned with the disclosure; a release's natives were -dirty by its own hand; the
  CaptureHost e2e flake met again); owner-only item 14.

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

* docs(handoff): the beta.18 traps name the Vulkan launch e2e race that failed #288's CI

On an elevated runner the harness starts through CreateProcessWithTokenW, its "[SKIP]" line never reaches the host's
output, and a guard scan that hits the exiting harness (ModuleScanFailed) fails the test instead of skipping it.
Re-run; the deterministic fix is a task.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:06:45 +07:00
poli0981andClaude Opus 5.5 1d0e8407bd fix(release): the natives carry the clean checkout's build id - read before the date substitution, handed to CMake, read back out of the binaries (beta.18 PR-3) (#288)
The chip from beta.17, open since beta.4 (HANDOFF §0.1.0-beta.4, "Found and NOT fixed"): the owner's Dashboard read
"Overlay build v0.1.0-beta.17-dirty", and beta.16's the same. The release run's own log says why:
"RELEASE_DATE = 2026-10-07 in 3 file(s)" and, 22 s later, "FL_BUILD_ID = v0.1.0-beta.17-dirty". release.yml writes the
release date into the tracked legal/*.md before the gate, and CMake's configure reads `git describe --dirty` after it.
CI's own checkout is clean (main's last run: "FL_BUILD_ID = 15b4c6b0ecc1").

- release.yml: a step before the substitution reads describe from the clean checkout (12 digits, as CMake does),
  refuses one that is already dirty or longer than 31 characters, and exports FL_BUILD_ID. After the publish,
  tools/buildid-check.ps1 reads it back out of the four natives that compile it.
- src/native/FrameLedger.Shm/CMakeLists.txt: the environment's FL_BUILD_ID is taken as given, after a check for the
  characters a C string literal carries without escaping; otherwise describe as before. Its comment said a released
  build was exact - "CI configures and builds once from a clean checkout" - corrected in place.
- tools/buildid-check.ps1 (new): looks for the id as the C string it is compiled as (characters + NUL) in each
  binary's bytes; nothing is loaded - loading the Overlay would run its DllMain. -SelfTest, eight cases, both
  directions, runs in the gate (build.ps1 'buildid-check').

Measured here: ./build.ps1 native with FL_BUILD_ID=b18-envtest.1+x_y printed "FL_BUILD_ID = b18-envtest.1+x_y", and
buildid-check over the four built DLLs: "ok - 4 native binaries carry 'b18-envtest.1+x_y'"; with FL_BUILD_ID='bad "id"'
the configure stopped ("holds a character no build id has"). On this branch's own describe (dirty, "+"), the tool
refused the id itself and found it in all four binaries.

Docs: 12_BUILD (§Release-time token substitution; gate 14c), 13_CI_CD (§release.yml), HANDOFF (§0.1.0-beta.4's bullet
struck, dated), CLAUDE.md (tools), wiki Releasing, CHANGELOG [Unreleased].

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 20:53:00 +07:00
116 changed files with 5180 additions and 222 deletions

No files matched your search

+19
View File
@@ -116,6 +116,22 @@ jobs:
"dry_run=$($dry.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
Write-Host "$(if ($dry) { 'DRY RUN of' } else { 'releasing' }) $full (pre-release: $pre)"
# The Overlay's build id is `git describe --dirty` at CMake's configure
# (src/native/FrameLedger.Shm/CMakeLists.txt), and the next step edits tracked
# files: every release until beta.18 shipped "<tag>-dirty". So the id is read
# here, from the clean checkout, and handed to CMake through the environment;
# buildid-check reads it back out of the published binaries.
- name: Build id (the clean checkout)
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$id = "$(git describe --always --dirty --abbrev=12)".Trim()
if ($LASTEXITCODE -ne 0 -or -not $id) { throw 'git describe failed' }
if ($id.EndsWith('-dirty')) { throw "the checkout is dirty before the release has touched it: $id" }
if ($id.Length -gt 31) { throw "build id '$id' is $($id.Length) characters; FlShmHandshake::buildId holds 31" }
"FL_BUILD_ID=$id" >> $env:GITHUB_ENV
Write-Host "FL_BUILD_ID = $id"
# 12_BUILD §Release-time token substitution: the effective date of a legal
# document is the date it ships. The only placeholder that survives into the
# repository, substituted here and nowhere else; the App embeds legal/*.md at
@@ -200,6 +216,9 @@ jobs:
# 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' }
# beta.18: the native binaries carry the build id read from the clean checkout, exactly - never "<tag>-dirty".
./tools/buildid-check.ps1 -BuildDir out/app -Expected $env:FL_BUILD_ID
if ($LASTEXITCODE -ne 0) { throw 'buildid-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)
+119
View File
@@ -28,6 +28,115 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Changed
- **The documents in the app scroll further and smoothly** — the user guide, Help ▸ Limitations, About's documents, the
Legal Gate and the update notes. A wheel notch moved them a fixed short step whatever the wheel or touchpad sent;
it now moves the number of lines Windows is set to scroll (a screen if it is set to that), about twice as far by
default, in proportion for a touchpad, and glides there unless Windows' animations are off. At the end of the update
notes the wheel scrolls the window instead; Ctrl+wheel still zooms. A page is drawn once when it is opened, not two or
three times, and going back to a page you have read in the same window is immediate.
### Security
- **Four itch.io downloads this project's documentation used as examples carry malware.** HELLO, HELLO WORLD!, A Doll's
Locket - Remake, City of Bones and Träumerei Chapter 2 put the same 213 MB program in front of their RPG Maker game.
Read without running it, it ships a registry file that switches off Windows' script scanning (AMSI) and adds
Microsoft Defender exclusions, carries an encrypted payload, and checks for virtual machines and debuggers before it
starts the game. The documentation called it a launcher and, for A Doll's Locket, said to measure it with the agent
running as administrator: that advice is withdrawn. If you installed one of them, remove it and scan your PC.
FrameLedger itself does not change: it reads a game's files to find its engine and anti-cheat, and does not judge
whether a game is safe (`docs/spike-notes.md` §20).
### Fixed
- **An anti-cheat kept beside a game's executable is found before anything is injected.** The safety check looked three folder
levels into a game's install folder and no further, so an anti-cheat beside an executable that is itself three levels down
was never seen: Wuthering Waves keeps Tencent's Anti-Cheat Expert in `Client\Binaries\Win64\AntiCheatExpert\`, its
page read clean, and a session with hooking turned on was hooked for 37 seconds before the check that runs every 30 seconds
met the anti-cheat's driver — and because a driver counts for the whole PC, the game's hooking stayed on. The check now also
looks in the executable's own folder, on the game's page and before every injection. Wuthering Waves is also named by its
Steam id (owner decision D58), and ACE's files, its second driver, its driver's service and its module are named (detection
rules `2026.10.4`). Every game is checked for anti-cheat once more after the update; one found this way has its hooking
turned off, as any finding does (`docs/19_SAFETY_AND_ANTICHEAT.md` §Pre-injection checks, item 4).
## [0.1.0-beta.20] - 2026-10-12
**The twentieth pre-release: the engine version of Ren'Py games.** The same unsigned installer: verify its hash against
`SHA256SUMS.txt`, then *More info → Run anyway*.
**Updating from `0.1.0-beta.19`:** Help ▸ Check for updates, then *Restart to update* with no game running. The Privacy
Policy (2.9) is shown once for you to accept. Every game is read once more for its engine (detection rules `2026.10.3`).
### Added
- **The engine version of Ren'Py games**, as Unity's, Godot's and RPG Maker's have been shown since beta.19 — on the game's
page with what it was read from, the engine's own `renpy/vc_version.py`: *Ren'Py 8.5.0*. A game whose engine names no
version there reads as not found. Every game is read once more after the update (detection rules `2026.10.3`;
`docs/05_DETECTION.md` §Engine version — Ren'Py).
- **The Privacy Policy (version 2.9)** names that file among the version marks it reads; it is shown once for you to
accept.
## [0.1.0-beta.19] - 2026-10-12
**The nineteenth pre-release: an imported game that is its own runtime and not a helper, Change executable… in the game's
folder, the engine version of Unity, Godot and RPG Maker games, and games you uninstalled leaving the library by
themselves.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*.
**Updating from `0.1.0-beta.18`:** Help ▸ Check for updates, then *Restart to update* with no game running. The Privacy
Policy (2.8) is shown once for you to accept. Every game is read once more for its engine (detection rules `2026.10.2`).
The agent removes the entries of games you uninstalled that have no sessions, about ten minutes after it sees them gone —
turn **Settings ▸ Data ▸ Remove uninstalled games** off first if you want them kept. An entry an earlier import made for a
helper is not changed: re-point it with *Change executable…*.
### Added
- **The engine version of Unity, Godot and RPG Maker games**, as Unreal Engine's has been shown since beta.10 — on the game's
page with what it was read from, and the maker on the library card too: *Unity 2022.3.39f1* (from the player library,
else its data file; a game whose data file is encrypted reads without the release letter, *2019.4.40*), *Godot 4.4.1*
(from its data pack), *RPG Maker MZ 1.10.0* and *MV 1.6.2* (from the core script), *RPG Maker VX Ace (RGSS 3.0.1)*
(from the runtime library its `Game.ini` names — that number is the library's, not the editor's). A Unity version used
to read as its library's build number (`2022.3.39.5118735`), and a Godot one was never found. Every game is read once
more after the update (detection rules `2026.10.2`). RPG Maker 2000/2003 is not recognised (`docs/05_DETECTION.md`
§Engine version — Unity, Godot, RPG Maker).
- **The Privacy Policy (version 2.8)** names the files those versions are read from, and two that were already read and
never named (Unity's player library and an RPG Maker game's title); it is shown once for you to accept.
- **A game you uninstalled leaves the library by itself** when it has no sessions: the agent removes an entry whose `.exe`
has been gone for ten minutes, if its drive is connected and the folder it was installed in is still there — an
unplugged or re-lettered drive never counts — and never one where anti-cheat was found. A game with sessions stays, with
them, and reads *Not installed* as before. The Games page says so when it happens — once, naming them, for all the games
one check removes; **Settings ▸ Data ▸ Remove uninstalled games** turns it off (`docs/02_SPEC.md` FR-1.8).
### Changed
- **Change executable… opens in the game's own folder** — the install folder a store made (`steamapps\common\<game>`
and the like), or above an Unreal game's `Binaries\Win64`, else the folder the executable is in — instead of wherever
the last file dialog was. For a game whose folder is gone it opens at the nearest folder still there
(`docs/08_UI.md` §Games).
### Fixed
- **An imported game is no longer one of its helpers, and an RPG Maker MV/MZ game behind a launcher is its runtime.**
A Doll's Locket - Remake (itch) was added as `notification_helper.exe`, NW.js's notification helper, because the itch
app's own record named only that file (it leaves out a launcher that asks for administrator and anything a folder
deeper) and the import took it as the game. A helper named by the store is skipped now and the executable is guessed —
the import list says so — and the guess takes the executable beside NW.js's `nw.dll` and `package.json`, the process
that draws (`css\Game.exe` there; its launcher asks for administrator, so it is measured with *Run the agent as
administrator* on — *withdrawn 2026-10-13: that launcher is malware, do not run it; [0.1.0-beta.21]'s Security*). The
import also no longer offers a store's game again when the library has it at another
executable: an entry already there is re-pointed with *Change executable…* (`docs/05_DETECTION.md` §Library import).
- **The Games page shows its newest read of the library.** When two reads overlapped — a session ending while an import
added games — the one that started first could finish last and be shown, an older list until the next read.
## [0.1.0-beta.18] - 2026-10-07
**The eighteenth pre-release: every page readable in the dark theme, notices that say what happened in words, and a
release whose build no longer calls itself dirty.** The same unsigned installer: verify its hash against
`SHA256SUMS.txt`, then *More info → Run anyway*.
**Updating from `0.1.0-beta.17`:** Help ▸ Check for updates, then *Restart to update* with no game running. Nothing in
the database changes and nothing is shown again for you to accept; sessions already stored keep their status.
### Fixed
- **Page titles and section headings read in the dark theme again.** Every page's title and its section headings — Dashboard,
@@ -54,6 +163,16 @@ numeric core and does not move; the heading is the full version — corrected 20
- **A viewer over a copy leaves every agent setting alone.** The user-mode exception option, the three Recording numbers
and the update channel stayed live in `--data-dir`, where no agent reads them (`ViewerModeTests`).
- `docs/08_UI.md` listed a "PawnIO missing" banner that was never built; struck, with the banners that do exist.
- **A release's overlay build no longer calls itself dirty.** The Dashboard read *Overlay build v0.1.0-beta.17-dirty* (and
beta.16's, and every release's before): the release workflow writes the release date into the legal documents before
the build, and the build id was read from the tree after that. It is read from the clean checkout first and handed to
the build, and `tools/buildid-check.ps1` reads it back out of the published binaries (`docs/12_BUILD.md` §Release-time
token substitution). Nothing changes for a game: both sides of the ring's handshake always carried the same id.
- **Two end-to-end tests no longer fail CI by a race** (developers only). The Vulkan launch test asks the test harness
whether this machine can present through Vulkan before it starts the capture host: on GitHub's runners the harness's
own "skip" line never reached the host's output, and a scan of the exiting harness failed the test instead of skipping
it. The target-exit test holds its harness 15 seconds instead of 6, the margin a slow runner's host needed
(`docs/13_CI_CD.md`).
## [0.1.0-beta.17] - 2026-10-07
+3 -2
View File
@@ -16,7 +16,7 @@ A C++ DLL (`FrameLedger.Overlay.dll`) is injected into games the user explicitly
> **Amended 2026-09-22 (owner decision): the override of 2026-09-21 is withdrawn, and the sentence above is the rule again.** For one day (releases `0.1.0-beta.3` and `beta.4`) a per-game override existed. The owner withdrew it: no entry point, no message, no column (schema 0008 drops 0007's five), no string. Do not add one in any form.
>
> **A finding turns the game's hooking off** (`19_SAFETY` §What a finding does to the game). An anti-cheat named in the game itself — its process, its title lists, its folder — is written to the row exactly as the pre-scan always wrote it (`hook_enabled = 0`, `hook_blocked_reason`, `hook_prescan_state = 'blocked'`), and since 2026-09-22 also when the guard finds it at a session's start or at the 30 s re-scan (`AntiCheatVerdict.IsFindingAboutTheGame`). A machine-wide driver or service refuses that session only. The notice, the game's page, the session's notes and the Agent's log all say it happened. Nothing clears the block, as before.
> **Amended 2026-09-26 (owner decision D33): one narrow, evidence-bound exception.** Asked with the 2026-09-22 withdrawal and this rule quoted back, the owner chose a per-game exception for anti-cheat that is **user-mode throughout** — a Settings option off by default, then the user ticks each eligible game through a versioned disclosure (bans are possible and can arrive days later). Eligible only when every finding about the game is `BlockedModule` / `AntiCheatFile` / `AntiCheatDirectory` of ONE family whose floor-and-file footprint has no driver, service or `.sys` (`fl::guard::FamilyIsUserModeOnly` — the GUARD decides, from a family NAME the caller passes), no `.sys` is anywhere in the install tree, no title list names the game, and the ledger holds ≥ 2 successful Tier-1 sessions of it. Drivers, services, title lists, the `.sys` rule, the fuzzy tier, scan failures, `TargetUnreadable`, 32-bit, the kill switch and Vulkan are never excepted. The guard runs every check and keeps scanning past the tolerated family (`kAllowedUserModeException`, reason 28); the Overlay learns the family from `Local\FrameLedger.Tolerate.<pid>` before its loader detour exists. A new finding, a crash / safety unhook / floor stop under it, or an executable change ends it; the block is never cleared. **No other form of override is to be added** (`19_SAFETY` §The user-mode exception).
> **Amended 2026-09-26 (owner decision D33): one narrow, evidence-bound exception.** Asked with the 2026-09-22 withdrawal and this rule quoted back, the owner chose a per-game exception for anti-cheat that is **user-mode throughout** — a Settings option off by default, then the user ticks each eligible game through a versioned disclosure (bans are possible and can arrive days later). Eligible only when every finding about the game is `BlockedModule` / `AntiCheatFile` / `AntiCheatDirectory` of ONE family whose floor-and-file footprint has no driver, service or `.sys` (`fl::guard::FamilyIsUserModeOnly` — the GUARD decides, from a family NAME the caller passes), no `.sys` is anywhere in the install tree *(within check 4's reach: three levels under the install root and, since 2026-10-13, under the executable's own folder)*, no title list names the game, and the ledger holds ≥ 2 successful Tier-1 sessions of it. Drivers, services, title lists, the `.sys` rule, the fuzzy tier, scan failures, `TargetUnreadable`, 32-bit, the kill switch and Vulkan are never excepted. The guard runs every check and keeps scanning past the tolerated family (`kAllowedUserModeException`, reason 28); the Overlay learns the family from `Local\FrameLedger.Tolerate.<pid>` before its loader detour exists. A new finding, a crash / safety unhook / floor stop under it, or an executable change ends it; the block is never cleared. **No other form of override is to be added** (`19_SAFETY` §The user-mode exception).
> **Amended 2026-10-03 (owner decision D38): the evidence moved from before the grant to its trial.** "≥ 2 successful Tier-1 sessions" above could never be met by a game blocked at add time — since beta.8 that is every blocked game — nor after a ledger reset. Asked with that, the owner chose: a grant needs no session; the first two hooked sessions under it are a trial, and any end during the trial (a crash, a safety unhook, a floor stop, a new finding, or a stored hooked session with no frames or an abnormal exit) ends the exception **for good** (`games.ac_exception_trial_failed_at`, schema 0017, never cleared). Every other condition above is unchanged, and so is the last sentence.
3. **Never implement evasion.** No manual mapping, no PE header erasure, no thread hiding, no signature obfuscation, no unlinking from the PEB module list. Injection uses documented `LoadLibraryW`. The DLL keeps its real name, real exports, and version info. A performance tool must be *visible* to anti-cheat, not hidden from it. Any PR that makes FrameLedger harder to detect is rejected on principle.
4. **Never read or write game memory outside our own hooks.** We read arguments passed to APIs we hooked and COM/handle objects we legitimately own. No pattern scanning for game internals, no reading player/entity state, no writing to game memory. Ever.
@@ -139,7 +139,8 @@ tools/ # accuracy-check, changelog-check, chokepoint-che
# (+ license-overrides/), notice-check, package-closure-check,
# release-notes, rules-validate, test-artifacts-check, vendor-exports,
# versioninfo-check, vklayer-blastradius, fps-impact-runbook,
# wiki-build (beta.17: builds and checks the wiki; the wiki-check gate)
# wiki-build (beta.17: builds and checks the wiki; the wiki-check gate),
# buildid-check (beta.18: the release's build id in the shipped natives)
# (six names added 2026-10-04)
# (PowerShell). This line used to name three, one of which
# — resx-audit — ~~does not exist~~ exists since 2026-09-13 with
+1 -1
View File
@@ -76,7 +76,7 @@
<ItemGroup Label="Analyzers (build-time only)">
<PackageVersion Include="Roslynator.Analyzers" Version="5.0.1" />
<PackageVersion Include="Meziantou.Analyzer" Version="3.0.294" />
<PackageVersion Include="Meziantou.Analyzer" Version="3.0.299" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="18.7.23" />
</ItemGroup>
+13 -3
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.17.*
*Beta software: this page describes version 0.1.0-beta.20.*
## Games it will not measure
@@ -117,8 +117,15 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
- The exact version is read for **Unreal Engine 4 and 5** games, from the game's executable file on disk.
A studio can remove or rename what it is read from; then the page says the version was not found.
**Unreal Engine 3 and older are not recognised.** Other engines show a version only where their files
state one. ([Detection](docs/05_DETECTION.md))
**Unreal Engine 3 and older are not recognised.**
- Since beta.19 also **Unity**, **Godot** and **RPG Maker** (MV, MZ, XP, VX, VX Ace): from the engine's own files —
Unity's player library or data file, Godot's data pack, RPG Maker's core script or the runtime library its `Game.ini`
names. A Unity game whose data file is encrypted shows the version without its release letter (`2019.4.40`, not
`2019.4.40f1`); an XP, VX or VX Ace game shows its runtime library's number, which is not the editor's.
**RPG Maker 2000 and 2003 are not recognised.**
- Since beta.20 also **Ren'Py**: from the engine's own version file (`renpy/vc_version.py`); a Ren'Py game whose engine
names no version there shows none. Other engines show a version only where their files state one.
([Detection](docs/05_DETECTION.md))
## Sensors
@@ -156,6 +163,9 @@ you accept the prompt. Turn it on only if you trust everything that runs under y
GeForce RTX 5080 with an Intel Core i7-14700KF on Windows 11); other hardware is untested.
- **No real Vulkan or OpenGL game has been measured yet** — only FrameLedger's own test program.
- There is **no in-game overlay**; everything is shown in the FrameLedger window.
- **FrameLedger does not tell whether a game is safe to run.** It reads a game's files to find its engine and its
anti-cheat, never to judge it, and recording or measuring a game vouches for nothing. Four itch.io downloads this
project once used as examples turned out to carry malware ([details](docs/spike-notes.md)).
## Your data
+8 -5
View File
@@ -12,7 +12,7 @@ pages.
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.17`** (2026-10-07), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.20`** (2026-10-12), 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
@@ -63,8 +63,11 @@ pages.
> swap chain; for every other session the window alone is read, and a window covering its monitor reads
> *full-screen or borderless*. What Windows does behind the game (fullscreen optimizations) is not visible.
> - **Engine version:** the exact Unreal Engine 4 or 5 version, read from the game's executable on disk and
> labelled with what it rests on; `N/A` where the executable names none. Other engines show what their own
> files state.
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
> player library or its data file — without the release letter where only the library's number is readable),
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Since
> beta.20 also Ren'Py's (from its engine's version file). Other engines show what their own files state.
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
> once a second from Windows' own counters, from outside the game, in every session: a game
@@ -163,7 +166,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
## Install
> **The latest pre-release is `v0.1.0-beta.17` (2026-10-07); before it `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `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`.
> **The latest pre-release is `v0.1.0-beta.20` (2026-10-12); before it `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `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**.
@@ -212,4 +215,4 @@ GPU telemetry is layered so the project never depends on a proprietary vendor li
---
**Status:** pre-release (beta). Seventeen 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). Twenty 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.
+6
View File
@@ -488,6 +488,12 @@ function Invoke-ProjectGates {
Write-Step 'release-notes'
Invoke-Checked 'release-notes (self-test)' { & (Join-Path $repo 'tools/release-notes.ps1') -SelfTest }
# beta.18: the build id a release hands CMake (read from the clean checkout before the date substitution edits
# legal/*.md) is read back out of the published native binaries by release.yml. Self-test only here — the live
# pass needs that id, which only a release has (12_BUILD §Release-time token substitution).
Write-Step 'buildid-check'
Invoke-Checked 'buildid-check (self-test)' { & (Join-Path $repo 'tools/buildid-check.ps1') -SelfTest }
# 09_I18N's gate, built with the first .resx family (P3 PR-2, 2026-09-13): every key in en/vi/ja, ja
# Safety_* marked for human review, the generated accessor current. Self-test first (at least four
# cases must go red), then the live pass; a tree with no family is red, not skipped.
+1
View File
@@ -11,6 +11,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
- FR-1.4 Remove game (asks whether to keep or delete its sessions).
- FR-1.5 "Supports" row shows shipped-capability hints (DLSS/FSR/XeSS/FG) — visually distinct from measured per-session values (`05_DETECTION` §Capability hints).
- FR-1.7 Delete all sessions (beta.11, owner decision D40): of one game from its page, or of every game from Settings ▸ Data, after a confirmation that says how many — with their frame and sensor series and notes; the library, the settings and every consent stay. The Agent deletes them (the rows are its, `06_DATA_MODEL` §Writer ownership) and refuses while a session it would delete under is being recorded.
- FR-1.8 Uninstalled games leave the library by themselves (beta.19, owner decision D55, amending D41): an entry whose executable has been gone for ten minutes — its drive connected and the folder it was installed in still there, so an unplugged or re-lettered drive never counts, and neither does a folder Windows will not list (`ExecutablePresenceProbeTests`) — and that has no session (stored, being recorded or waiting to be recovered) is removed by the Agent, behind Settings ▸ Data ▸ *Remove uninstalled games* (on by default). Never an entry carrying an anti-cheat block, an exception or a failed-trial mark (FR-2.2, rule 2). The App is told (`GameRemoved`).
- FR-1.6 Recording switch per entry (2026-09-23, HANDOFF D29): off, the program is not watched at all — no session, no measurement, no injection — and a session of it that is running stops. On by default; entries an old import made for Steam's own tools start with it off. The library card says "Not recorded".
### FR-2 Hooking consent & control (new, safety-critical — see `19_SAFETY`)
+97 -6
View File
@@ -143,12 +143,12 @@ Recorded as a residual risk, not as a solved problem.
| Engine | Signals | Version |
|---|---|---|
| Unity | `UnityPlayer.dll` sibling **or** `<Exe>_Data/` dir | FileVersion of `UnityPlayer.dll` |
| Unity | `UnityPlayer.dll` sibling **or** `<Exe>_Data/` dir | `unity_build` (since 2026-10-12, §Engine version — Unity, Godot, RPG Maker): the player library's ProductVersion, the data file's header, the library's numeric version. ~~FileVersion of `UnityPlayer.dll`~~ — the string as it is, `2022.3.39.5118735`, the build number where the release letter belongs |
| Unreal 4/5 | exe matches `*-Win64-Shipping.exe` **or** `*/Content/Paks/*.pak` | `unreal_build` (since 2026-09-27, §Engine version): the shipping executable's numeric file version and the engine's branch name inside it. ~~ProductVersion regex `\+\+UE(4\|5)\+Release-(\d+\.\d+)`~~ — two capture groups, of which the evaluator returns the first, so every Unreal version it ever stored was a bare `4` or `5` |
| Godot | `.pck` sibling **or** `strings_contains("Godot Engine v")` | strings regex `Godot Engine v(\d+\.\d+[\.\d]*)` |
| Godot | `.pck` sibling **or** `strings_contains("Godot Engine v")` | `godot_build` (since 2026-10-12): a data pack's header, beside the executable or appended to it. ~~strings regex `Godot Engine v(\d+\.\d+[\.\d]*)`~~ — the string sits 57–78 MB into a real export, past the 8 MiB scan, so it never read one |
| GameMaker | `data.win` | `N/A` |
| RPG Maker MV/MZ | `nw.dll` **and** `package.json` siblings (since 2026-09-16) | `N/A` — the `.js` header needs a `from` that `strings_regex` lacks |
| RPG Maker XP/VX/VX Ace | `RGSS1*`/`RGSS2*`/`RGSS3*.dll` sibling **or** a `*.rgssad`/`*.rgss2a`/`*.rgss3a` archive (since 2026-09-16) | `N/A` — one rule, the variant unnamed |
| RPG Maker MV/MZ | `nw.dll` **and** `package.json` siblings (since 2026-09-16) | `rpgmaker_build` (since 2026-10-12): the core script's header, which also names the maker (MZ or MV). ~~`N/A` — the `.js` header needs a `from` that `strings_regex` lacks~~ |
| RPG Maker XP/VX/VX Ace | `RGSS1*`/`RGSS2*`/`RGSS3*.dll` sibling **or** a `*.rgssad`/`*.rgss2a`/`*.rgss3a` archive (since 2026-09-16) | `rpgmaker_build` (since 2026-10-12): the RGSS library `Game.ini` names — its generation names the maker (XP, VX, VX Ace), its version is the library's. ~~`N/A` — one rule, the variant unnamed~~ |
| RE Engine (Capcom) | `re_chunk_000.pak` sibling, the exact name (since 2026-09-23) | `N/A` |
| FromSoftware | a `*.bhd` **and** a `*.bdt` sibling (since 2026-09-23) | `N/A` |
| Ren'Py | `renpy/` dir **or** `*.rpa` | ~~`renpy/__init__` strings / `log.txt` first line~~ `N/A` *(corrected 2026-10-04: no extractor — `strings_regex` reads only the executable)* |
@@ -246,6 +246,68 @@ numbered release lines to report. A version the user typed is never overwritten
`2026.09.6` change the key, so every library entry is read again once; schema 0015 removes the bare `4`/`5` the old rule
wrote, where detection wrote it.
### Engine version — Unity, Godot, RPG Maker (beta.19, 2026-10-12, rules 2026.10.2)
The owner asked for the version of RPG Maker, Unity and Godot games ("if possible"). What the rules gave: Unity's
`pe_file_version` stored `UnityPlayer.dll`'s FileVersion string as it is (`2022.3.39.5118735`, the build number where the
release letter belongs); Godot's `strings_regex` scanned the executable's first 8 MiB, and in both Godot exports on the
owner's disk the `Godot Engine v…` string sits 57–78 MB in, so it never read one; both RPG Maker rules had `version: null`.
**Measured before anything was written, read-only, on 23 installs** (`spike-notes` §17), and decided in code as Unreal's
is — three extractor types that take no parameter (`unity_build`, `godot_build`, `rpgmaker_build`; the schema's enum),
one second read by `StaticGameDetector` for the engine that matched, a decider in `Domain.Detection` and the witness in
`games.engine_version_source`:
| Engine | Witness, strongest first | Source id | On the owner's disk |
|---|---|---|---|
| Unity | `UnityPlayer.dll`'s ProductVersion is an editor version (`2022.3.39f1 (4e1b…)` → `2022.3.39f1`) | `unity_player` | 13 of 15 |
| | the header of `<Game>_Data\globalgamemanagers` (first 256 bytes) names one | `unity_data` | A Space for the Unbound, 2019.4.1f1 |
| | the library's numeric file version, MAJOR.MINOR.PATCH and no release letter — Unity's own binary, so the engine's, only shorter | `unity_player_file` | GIRLS' FRONTLINE 2 (data file encrypted), 2019.4.40 |
| Godot | the 20-byte header of the data pack beside the executable (`<exe>.pck`, else the only `.pck` there): `GDPC`, format, MAJOR, MINOR, PATCH | `godot_pck` | both: 4.2.2, 4.4.1 |
| | the same header of a pack appended to the executable, found through its 12-byte trailer (size + `GDPC`) | `godot_pck_embedded` | none (synthetic files only) |
| | the executable's ProductVersion while its ProductName is still `Godot Engine` (a project that set its own carries the game's: 衔蝶 `0.1.0.3`) | `godot_exe` | — |
| RPG Maker MV/MZ | line 2 of the core script: `js/rmmz_core.js` → MZ, `www/js/rpg_core.js` or `js/rpg_core.js` → MV (first 4 KiB) | `rpgmaker_mz_core`, `rpgmaker_mv_core` | MZ 1.10.0; MV 1.6.2, 1.6.2, 1.6.1 |
| RPG Maker XP/VX/VX Ace | the RGSS library `Game.ini`'s `Library=` names: RGSS1 → XP, RGSS2 → VX, RGSS3 → VX Ace; its numeric version when it is its generation's, else the one its name carries (`RGSS301` → 3.0.1) | `rgss1_library`, `rgss2_library`, `rgss3_library` | VX Ace 3.0.1, twice |
A Godot version leaves out a zero patch, as Godot names its releases (4.3, 4.2.2). The App names the maker from the
witness — the two RPG Maker rules each cover several makers — and says that an RGSS number is the runtime library's, not
the editor's: *RPG Maker MZ 1.10.0*, *RPG Maker VX Ace (RGSS 3.0.1)* (`Formats.Engine(id, source)`,
`Formats.EngineWithVersion`); the game page's *Engine version* row says what each version was read from, and *Not found in
the game's files* once the sweep has read a row of these engines and found none.
**Where it is read.** Beside the row's executable first: `UnityPlayer.dll` (else the shallowest one the walk listed) and
`<exe>_Data` (else a `*_Data` beside that player); `<exe>.pck`. RPG Maker's files are looked for beside the executable and
up to two folders above it, as `RpgMakerTitle` already looked for a title — a launcher-fronted game keeps its runtime in
a subfolder (A Doll's Locket's `css\`, HELLO, HELLO WORLD!'s `swiftshader\` — *both "launchers" are malware, D57,
`spike-notes.md` §20*); a `Library=` that points outside the ini's
folder is named and not read. Version resources and at most a few kilobytes of any file; the whole detection of one entry
measured 24 ms to 4.1 s on the owner's USB drive, nearly all of it the install's walk, once per executable and rules
version. The Privacy Policy says so since 2.8 (§4).
**What it is not.** RPG Maker 2000/2003 is not detected at all (no install to measure, no rule). XP and VX libraries are
read by the VX Ace rule's reader unmeasured. A Unity build older than 2019 keeps its player in the executable (no
`UnityPlayer.dll`): its data file's header is the only witness. Rules `2026.10.2` change the detection key, so every
library entry is read again once; a Unity row keeps the old raw string only if none of its witnesses can be read now.
### Engine version — Ren'Py (beta.20, 2026-10-12, rules 2026.10.3)
The owner asked for the version of Ren'Py games once beta.19's were on screen. The `renpy` rule had no version extractor
(`version: null`). Ren'Py ships its engine as Python beside the game's launcher, and `renpy/vc_version.py` names its
release — `version = '8.5.0.25111603'`, beside `branch`, `nightly`, `official` and `version_name`. Measured 2026-10-12 on
the owner's one Ren'Py install, Bound Between Desks (Steam): 109 bytes, and the game's own `log.txt` printed
`Ren'Py 8.5.0.25111603` at its last start; the launcher carries no version resource (`spike-notes` §18).
**What is read and how it is decided.** `renpy_build` (`RenPyBuildReader`): the first 4 KiB of `renpy/vc_version.py`
beside the row's executable, its `version` line only (`version_name` is not it). `RenPyVersion.Decide` keeps
MAJOR.MINOR.PATCH — Ren'Py names its releases by those three; the fourth is the build — and records `renpy_vc_version`.
The page says *Ren'Py 8.5.0* and that it was read from the engine's version file; a Ren'Py row whose file names no
version says *Not found in the game's files*. Through the shipped pipeline (`StaticGameDetector` over `GameFileProbe`)
Bound Between Desks read `8.5.0` in 79 ms, and the Unity, Godot and RPG Maker installs read as before. The Privacy
Policy names the file since 2.9 (§4). Rules `2026.10.3` change the detection key, so every library entry is read again
once.
**What it is not.** Nothing else is guessed from: a Ren'Py game whose `vc_version.py` names no version, or that ships its
engine compiled only, reads as not found. One Ren'Py install was measured.
### Platform signatures & metadata
| Platform | Signals | Metadata |
@@ -293,6 +355,35 @@ wrote, where detection wrote it.
> is fetched (CLAUDE.md rule 8's "opt-in store metadata" is the online lookup, which does not exist). First-run
> step 4 now points at File ▸ Import library… rather than saying "later build".
> **beta.19 (owner report 2026-10-12): a store's own pick can be a helper, and a launcher is not the game.** The owner's
> A Doll's Locket - Remake (itch 5085165, RPG Maker MZ) was imported as `Dolls Locket\notification_helper.exe` — NW.js's
> toast helper. The pick was **butler's verdict**, taken as is: butler stores a *filtered* verdict (the shallowest
> candidates, minus those whose manifest asks for elevation) and does not rank what is left, and on that install the
> 213 MB `DollsLocket.exe` launcher asks for administrator while the NW.js runtime sits a level deeper in `css\`, so the
> helper was the whole verdict (read from the owner's `butler.db`, read-only). *(Corrected 2026-10-13, owner decision
> D57: that "launcher" — the same 213 MB program HELLO, HELLO WORLD!, City of Bones and Träumerei put in front of their
> runtime — is malware: it ships a registry file that switches off Windows' script scanning and adds Microsoft Defender
> exclusions (`spike-notes.md` §20). Do not run it. The admin-mode sentence below is withdrawn; the three changes stand
> as rules about helpers and NW.js layouts, and the import still takes a store's own pick when it is not a helper.)*
> Three changes:
> **(1)** a verdict candidate whose whole name is a runtime helper (`ExecutableLocator.RuntimeHelperNames`:
> `notification_helper`, `crashpad_handler`, `UnityCrashHandler64/32`, `CrashReportClient`, NW.js's `nwjc` and
> `chromedriver`) or that sits in a Unity plugin folder is skipped, and with nothing left the locator guesses and the
> review marks the row *guessed* — whole names, because the locator's fragments are inside real games' names (`node` in
> *Nodebuster*) and a store's pick is overruled only when it cannot be the game; the locator's `HelperFragments` gain the
> same three NW.js names. **(2)** The locator ranks **an executable beside `nw.dll` + `package.json`** — the `rpgmaker_mv`
> rule's own signal — as an NW.js runtime (owner decision D56), below the Unity and Unreal layouts (an NW.js folder can
> be a tool shipped beside such a game) and above a name match (the launcher in front of the runtime is named after the
> install): the install's guess is `css\Game.exe`, the process that draws, as D28 pointed HELLO, HELLO WORLD!'s entry at
> its runtime by hand. ~~That runtime starts elevated (its launcher asks for administrator), so it is measured with the
> admin mode on (D34).~~ *(Withdrawn 2026-10-13, D57: it starts elevated because the malware in front of it asks for
> administrator.)* **(3)** Discovery matches a store title to an entry by **platform + store id** as well as by
> path: the entry an earlier import made at another executable is "already in the library" (the log names its path),
> so a corrected guess never adds the same game a second time — that entry is re-pointed with Change executable…, and
> nothing rewrites it by itself (D25/D27). Tests: `ExecutableLocatorTests.AnNwjsRuntimeBeatsTheLauncherNamedAfterTheInstallAndItsHelpersAreDropped`,
> `StoreLibrarySourcesTests.ItchSkipsAVerdictCandidateThatIsARuntimeHelper` (the verdict as stored),
> `LibraryImporterTests.AStoreTitleAlreadyInTheLibraryAtAnotherExecutableIsNotOfferedAgain`.
**Publisher/version order:** store manifest → PE `CompanyName`/`ProductVersion` → *(opt-in)* Steam `appdetails` lookup, cached 7 days. *(Since beta.8 the PE versions are stored beside the store's rather than instead of it — §What the files say about themselves; the page labels a store's value with its store, "Steam build 20374416".)*
## Capability hints (explicitly labelled as such)
@@ -350,12 +441,12 @@ it does not claim who loaded it.
Before a game is ever launched with hooking enabled, the static scan checks for anti-cheat SDKs shipped alongside it (`EasyAntiCheat/` directory, BattlEye binaries, EOS anti-cheat components, etc.). A hit **disables the hooking toggle for that game entirely** in the UI, with an explanation — the user cannot enable it, so the guard never even has to fire at launch. Prevention beats interception.
**Implemented in the native guard, not here** (`fl_prescan.cpp`, exposed as ~~`FlStaticPreScan`~~ `FlStaticPreScanGame` since 2026-09-25, which takes the executable, resolves the install root itself and runs check 3 as well). It uses the same `MatchName` and the same rules file as the injection guard, matching directory names against the `anticheat.directories` group and file names against `anticheat.files`. Nothing managed matches a blocklist (§S15 item 1).
**Implemented in the native guard, not here** (`fl_prescan.cpp`, exposed as ~~`FlStaticPreScan`~~ `FlStaticPreScanGame` since 2026-09-25, which takes the executable, resolves the install root itself and runs check 3 as well). It uses the same `MatchName` and the same rules file as the injection guard, matching directory names against the `anticheat.directories` group and file names against `anticheat.files`. Nothing managed matches a blocklist (§S15 item 1). **It walks two folders since 2026-10-13:** the install root and, when the executable lives below it, the executable's own folder — each three levels deep. The root alone missed Wuthering Waves' `Client\Binaries\Win64\AntiCheatExpert\`, which sits beside the executable and four levels under the root (`19_SAFETY` §Pre-injection checks, item 4; `spike-notes.md` §19).
Three things this section previously implied that are not true, and are worth stating:
- **The UI answer is advisory.** It decides whether the toggle is *offered*; it does not gate injection. The same scan runs a second time inside the guard's chokepoint against a directory derived from the target's own pid, so "prevention beats interception" is a convenience, not the enforcement.
- **A hit disables the toggle; "could not scan" must not.** The scan is tri-state. `Reason::kPreScanFailed` — directory absent, unlistable, past a bound, or behind a reparse point — is *neither* a hit nor a pass. It must surface as "could not verify", distinct from "anti-cheat found": disabling the toggle on it would be a false refusal with no appeal, and clearing it would be a fail-open.
- **A hit disables the toggle; "could not scan" must not.** The scan is tri-state. `Reason::kPreScanFailed` — directory absent, unlistable, past the entry bound, or behind a reparse point — is *neither* a hit nor a pass. *("Past a bound" until 2026-10-13: the depth bound is a reach, not a refusal — a folder at the last level is named and never opened, and the walk still reads as complete.)* It must surface as "could not verify", distinct from "anti-cheat found": disabling the toggle on it would be a false refusal with no appeal, and clearing it would be a fail-open.
- **The token list is thin.** `directories` and `files` ~~carry three tokens today~~ *(corrected 2026-10-04: rules 2026.10.1 carry 9 directory families (12 names) and 18 file families (55 names), and since 2026-09-25 any `*.sys` in the install tree is a finding by code, not data)*. Widening needs verified names; a guessed token fails closed by never firing, which is a silent hole (`19_SAFETY` §Blocklist seed).
## Caching & privacy constraints
+7 -3
View File
@@ -2,7 +2,7 @@
`%LOCALAPPDATA%\FrameLedger\ledger.db`. Pragmas: `journal_mode=WAL`, `synchronous=NORMAL`, `foreign_keys=ON`, `busy_timeout=5000`. `Microsoft.Data.Sqlite` + Dapper; all writes in explicit transactions.
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It is the one Agent write that deletes a `games` row; it never touches a consent column. **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **And since 2026-10-03 (beta.11, D40) the Agent deletes sessions on request** — every session of one game or of every game, `DeleteSessions` over the pipe, through `ISessionRepository.DeleteSessionsAsync` in one transaction (segments, blobs and annotations cascade), never while one is being recorded; the UI asks and never deletes a session row itself *(for Delete all sessions; FR-1.4's removal is the App's own cascade, above — corrected 2026-10-04)*. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built note). UI writes `games` (user-editable fields — since P3 PR-3 that is the FR-1.3 metadata, the `*_default` tri-states, and `removed_at`; ~~never a `hook_*` column~~ **and two downgrades** *(corrected 2026-10-04)*: *Change executable* (2026-09-21, `GameLibrary.ChangeExecutableAsync`) turns hooking off, clears the consent and pre-scan columns and ends an exception grant — it never writes a block or a grant — and *Remove game ▸ Delete sessions too* (FR-1.4) deletes the `games` row, cascading to its sessions, segments, blobs and annotations), `session_annotations` (tags, notes, and since schema 0002 the FR-8.3 overrides — which is WHY they are on this table and not on `sessions`), `settings`, `legal_acceptance`. Both read everything. The ports say the same in their names: `IGameRepository.UpdateMetadataAsync` / `SetTriStateDefaultAsync` / `RemoveAsync`, `ISessionAnnotationRepository`, `RegisteredSettings`, `ILegalAcceptanceStore.RecordAsync` (all P3 PR-3).
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It was the one Agent write that deletes a `games` row until beta.19; it never touches a consent column. **And since beta.19 (2026-10-12, D55) the Agent removes an entry whose game is no longer installed** (`IGamePrune`, `SqliteGamePrune`, asked by the detection sweep through `UninstalledEntryPrune`): one `DELETE` that holds every stored condition in the same statement — the same row at the same path, `removed_at` NULL, no session stored (`NOT EXISTS` on `sessions` — nothing cascades), no `hook_blocked_reason`, `hook_prescan_state` not `blocked`, no `ac_exception_at` and no `ac_exception_trial_failed_at` — behind `retention.remove_uninstalled_games`; a block, a grant and D38's mark are never removed with their entry (`19_SAFETY` §What a finding does to the game, *What clears it*). **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **And since 2026-10-03 (beta.11, D40) the Agent deletes sessions on request** — every session of one game or of every game, `DeleteSessions` over the pipe, through `ISessionRepository.DeleteSessionsAsync` in one transaction (segments, blobs and annotations cascade), never while one is being recorded; the UI asks and never deletes a session row itself *(for Delete all sessions; FR-1.4's removal is the App's own cascade, above — corrected 2026-10-04)*. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built note). UI writes `games` (user-editable fields — since P3 PR-3 that is the FR-1.3 metadata, the `*_default` tri-states, and `removed_at`; ~~never a `hook_*` column~~ **and two downgrades** *(corrected 2026-10-04)*: *Change executable* (2026-09-21, `GameLibrary.ChangeExecutableAsync`) turns hooking off, clears the consent and pre-scan columns and ends an exception grant — it never writes a block or a grant — and *Remove game ▸ DeLine truncated
## Schema (v2 — hook architecture)
@@ -47,8 +47,11 @@ CREATE TABLE games (
store_id TEXT,
engine TEXT, engine_version TEXT,
-- (schema 0015, ALTERed last) engine_version_source TEXT: where engine_version came from — a
-- Domain.Detection.EngineVersionSource id (unreal_branch_file | unreal_branch | unreal_file_version, or the rule's
-- extractor type); NULL for a version the user typed. Written with the version only (05_DETECTION §Engine version)
-- Domain.Detection.EngineVersionSource id (unreal_branch_file | unreal_branch | unreal_file_version; since beta.19
-- unity_player | unity_data | unity_player_file | godot_pck | godot_pck_embedded | godot_exe | rpgmaker_mz_core |
-- rpgmaker_mv_core | rgss1_library | rgss2_library | rgss3_library — the RPG Maker ids also name the maker; since
-- beta.20 renpy_vc_version; or the
-- rule's extractor type); NULL for a version the user typed. Written with the version only (05_DETECTION §Engine version)
publisher TEXT, game_version TEXT,
cover_path TEXT, notes TEXT,
removed_at INTEGER, -- schema 0002 (P3 PR-3): FR-1.4 "remove, keep sessions" — the row stays
@@ -440,6 +443,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) |
| `retention.remove_uninstalled_games` | bool | `1` | | Agent, at every detection sweep (beta.19, D55, FR-1.8): on, an entry whose executable has been gone for ten minutes — its drive connected, the folder it was installed in still there — and that has no session and no anti-cheat block or exception is removed; off, it stays and reads *Not installed* (D41's behaviour) |
| `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 |
+1
View File
@@ -409,6 +409,7 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
| `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~~ **whenever it refused (beta.18; beside a family only until then)**: `BlockedService` / `BlockedDriver` is a finding on the PC, not in the game, and the notice says so (§S23-3), and a refusal no family names is said in the guard's words (`Formats.GuardSentence`) — it printed the end's name, "reason RefusedByGuard"; `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. *(Since beta.18 it says the end in words, `Formats.EndReasonText`; it printed `reason` raw — "The hook stopped (WriterSelfDisabled); the session continues without measuring" — and a stop ends the session, it does not continue it.)* *(Built: `SupervisionLost`, `WriterSelfDisabled`, `WriterStoppedBlocklisted`, `WriterNeverInstalledHooks`, `SupervisionFaulted`, `KillSwitchEngaged` — `RecordedSessionEvents.Classify` is the table.)* |
| `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.)* |
| `GameRemoved` | A→UI | `{ gameId, gameName?, exePath, reason }` — **since beta.19 (D55):** the Agent removed a library entry by itself; `reason` is `uninstalled` (its executable gone for ten minutes from a folder that is still there, no session, no anti-cheat block or exception — `06_DATA_MODEL` §Writer ownership). Not a session event. The Games page on screen reloads and says so; a game page showing that entry reloads into its not-found state. Additive: a client that does not know the type ignores it (§Versioning). |
| `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 |
+36 -4
View File
@@ -66,7 +66,14 @@ WPF + **WPF UI (Wpf.Ui, Fluent)**. Shell = `ui:FluentWindow` with custom `ui:Tit
> off** — a tag is shown as the text it is; **no image is fetched** — its description stands in; a node the renderer
> does not know is shown as its own source text, and `MarkdownRendererTests` proves for every embedded document that
> no word of its plain text is lost and no table is left as `|---|` source. The GPL's `LICENSE` is not Markdown: it is
> shown as written, monospace. Colours and the font are theme resources (`16_WPFUI_SYNTAX` §FlowDocument). Links
> shown as written, monospace. Colours and the font are theme resources (`16_WPFUI_SYNTAX` §FlowDocument).
> **The wheel and the render, beta.21 (owner request 2026-10-13: "scrolling the documents is slow"):** a notch moves
> Windows' *lines to scroll* at a browser's line (100/3 DIP; three lines = 100 DIP, scaled by the zoom; a delta in
> proportion, so a touchpad's small deltas move a little; Windows' *one screen at a time* a screen) and eases there in
> about 120 ms unless Windows' animations are off — WPF moved a fixed 48 DIP per message, whatever its delta. At its ends
> the view leaves the wheel to what holds it (the update notes' dialog), and Ctrl+wheel stays the zoom. A page is
> rendered once (`MarkdownView.Show`; three bindings changing ask for one render, ahead of layout), and a view keeps the
> last 16 documents it rendered, so going back to a page costs its layout only (`MarkdownViewTests`). Links
> follow `Markdown/MarkdownLinks`: http, https and mailto through `IUrlOpener`; `#section` scrolls to the heading
> (GitHub's anchors); a relative path resolves against the document's place in the repository and opens in the App
> when the window holds that page, on GitHub otherwise — **at this build's own source** (`Services/RepositoryLinks`:
@@ -272,7 +279,17 @@ All screens are `Page`s registered with the navigation page provider and navigat
> since (`ImportLibraryFlow.RunAsync(onlyNew: true)`: *No new games* and no checklist when there are none), and every entry
> whose executable is not on disk carries a **Not installed** pill — its tooltip is the game page's own sentence for it,
> the drive that is not connected or the path the file is gone from (`GameLibrary.ExecutableExists` and
> `Formats.ExecutableMissingText`, asked off the UI thread on every listing, never stored; nothing is removed for it). **The page reloads by itself** while it is on screen when a session ends (`SessionCompleted`) or an
> `Formats.ExecutableMissingText`, asked off the UI thread on every listing, never stored; ~~nothing is removed for it~~
> *since beta.19 (D55) the Agent removes such an entry by itself after ten minutes when it has no session and no
> anti-cheat block or exception, and its drive is connected — Settings ▸ Data ▸ Remove uninstalled games, on by default; the
> page on screen hears `GameRemoved`, reloads and says so in the snackbar (`Games_Removed_Format`); one with sessions keeps
> its pill. One check removes its games in one event each, milliseconds apart: the page waits `GamesViewModel.RemovalSettle`
> (one second) after the first, then reads the library once and says them all in one notice — the count, five names and
> how many more, `Games_Removed_Many_Format`. It said each and reloaded each, and WPF UI 4.3.0's `SnackbarService` shows every
> message at once in its one snackbar, so only the last name stayed on screen. And only the newest read of the library is
> shown: reads overlap — a session that ends, an import, a removal — and the one that started first could finish last,
> its executable checks waiting on a slow drive, and put back a removed game's card (`GamesViewModel.LoadAsync`,
> `GamesViewModelTests.AnOlderReadThatFinishesLastIsNotShownOverANewerOne`)*). **The page reloads by itself** while it is on screen when a session ends (`SessionCompleted`) or an
> import adds games (`LibraryChanges` — navigating to the page already on screen does nothing in WPF UI 4.3.0, so an
> import from the menu never showed until the page was left). **Import** (FR-1.2): the games already in the library — at
> this path or under another drive letter — are hidden by default (*Show the N games already in the library* brings them
@@ -284,7 +301,7 @@ All screens are `Page`s registered with the navigation page provider and navigat
- **Game detail:**
- Header: cover, name, publisher, version, platform, engine+version, API + Present Mode of last session, `FpsReadout` (lifetime avg), TriState chips, Edit button.
- **Two clearly separated rows** (`05_DETECTION` §Capability hints — conflating these was the old design's core mistake):
- **Supports** — greyed capability chips from files on disk ("Supports DLSS-G", "Supports XeSS"). Static inference.
- **Supports** — greyed capability chips from files on disk ("Supports DLSS-G", "Supports XeSS"). Static inference. With none: *not scanned yet* until the Agent's sweep has read the executable, then *none found* (beta.21 — it read "not scanned yet" for every game that ships none of the files).
- **Last session measured** — accent chips with real values ("DLSS Quality · 1440p → 2160p", "Frame Generation DLSS-G ×1.9", "Ray Tracing: Yes"). Measured.
- **Hooking control** (`ui:CardControl` with `ToggleSwitch`): off by default. Turning it on opens the consent dialog (FR-2.1). When the static anti-cheat pre-scan blocked it, the switch is **disabled** with the reason shown inline and no way to force it. When auto-disabled after crashes, an `InfoBar` explains and offers manual re-enable.
@@ -299,7 +316,10 @@ All screens are `Page`s registered with the navigation page provider and navigat
> fields), **the row's executable path under the subtitle and Change executable… since 2026-09-21** (a store import
> guesses the executable and everything downstream is keyed on it; the pick re-points the row, which comes back
> hooking-off and unconsented like a new game, consent revoked over the pipe first, a block never cleared —
> `05_DETECTION` §Library import), **one App per data folder since 2026-09-21** (`Services.SingleInstance`: a named mutex and a named event keyed on a hash of the data directory, claimed in `Program.Main` after Velopack's hooks and before any window; a later start sets the event and exits 0, and the first instance brings its window forward through `ShellHost.Reveal` — from the tray too. Nothing stopped a second App before: the owner's log shows two started 360 ms apart, two tray icons, a second log file. `--diag` never claims), ~~**the guard-bypass switch since 2026-09-21**~~ **withdrawn 2026-09-22** (the card, its dialog, the session mark and the export line are gone; a blocked row's toggle is disabled and `Safety_Blocked_Toggle_Format` is the whole story; a refusal or unhook notice that turned hooking off ends with `Safety_HookingTurnedOff` — `19_SAFETY` §What a finding does to the game), **Supports** (from `capability_flags`; ~~empty until P4's scan writes it, and the card says so~~ **written by the Agent's detection sweep since P4 PR-1, 2026-09-14** — the rule ids as product names via `CapabilityNames`, "not scanned yet" only until the Agent's next tick) beside
> `05_DETECTION` §Library import; **since beta.19 the file dialog opens in the game's own folder** — `GameFolder.StartFolder`:
> the store boundary's install folder (`InstallRoot`), an Unreal package's root above `<Project>\Binaries\Win64`, else
> the executable's folder, and the nearest folder still there when that one is gone; nothing for a drive that is not
> connected, where Windows opens its last folder; owner request 2026-10-12, `GameFolderTests`), **one App per data folder since 2026-09-21** (`Services.SingleInstance`: a named mutex and a named event keyed on a hash of the data directory, claimed in `Program.Main` after Velopack's hooks and before any window; a later start sets the event and exits 0, and the first instance brings its window forward through `ShellHost.Reveal` — from the tray too. Nothing stopped a second App before: the owner's log shows two started 360 ms apart, two tray icons, a second log file. `--diag` never claims), ~~**the guard-bypass switch since 2026-09-21**~~ **withdrawn 2026-09-22** (the card, its dialog, the session mark and the export line are gone; a blocked row's toggle is disabled and `Safety_Blocked_Toggle_Format` is the whole story; a refusal or unhook notice that turned hooking off ends with `Safety_HookingTurnedOff` — `19_SAFETY` §What a finding does to the game), **Supports** (from `capability_flags`; ~~empty until P4's scan writes it, and the card says so~~ **written by the Agent's detection sweep since P4 PR-1, 2026-09-14** — the rule ids as product names via `CapabilityNames`, "not scanned yet" only until the Agent's next tick) beside
> **Last session measured** (upscaler · resolution, frame generation, the non-N/A chips — accent pills, from the
> hooks). Hooking: the toggle is `OneWay` from the row and its command runs `HookingConsent`; a refusal, a
> mismatch or a failure is a persistent `InfoBar` on the page (never a toast); a blocked row disables the
@@ -374,6 +394,14 @@ All screens are `Page`s registered with the navigation page provider and navigat
> `FormatsTests`, and the page renders in `PagesLoadTests`. **The Details card's *NVIDIA App override* row** (same day)
> is the newest session that read a driver profile, in the same words; no row where none did. Tests:
> `NvidiaOverridesTests`, `GameDetailViewModelTests.TheDetailsCardNamesTheNvidiaAppsOverridesFromTheNewestSessionThatReadThem`.
> **The *Engine* row carries the version, and an *Engine version* row says what it was read from** (beta.10 for Unreal;
> beta.19 for Unity, Godot and RPG Maker; beta.20 for Ren'Py — `05_DETECTION` §Engine version): the player library, the
> data file's header, a data pack, a core script, the RGSS library `Game.ini` names or Ren'Py's `renpy/vc_version.py`, and
> *Not found in the game's files* once the Agent has
> read such a title and found none. RPG Maker's witness names the maker on the page, the subtitle and the library card
> (*RPG Maker MZ 1.10.0*, *RPG Maker VX Ace (RGSS 3.0.1)*; `Formats.Engine(id, source)`). Tests:
> `GameDetailViewModelTests.TheDetailsCardSaysWhatAUnityGodotOrRpgMakerVersionWasReadFrom`,
> `FormatsTests.TheVersionsWitnessNamesTheMakerAndRgssSaysWhoseNumberItIs`.
- Tabs (WPF `TabControl`, Fluent-styled):
1. **Sessions** — `DataGrid`: date, duration, **tier badge (T1/T2)**, Native, Displayed, FG×, 1% Low, 0.1% Low, resolution + upscaler, max GPU temp, API, chips, ⚠ crash badge, tags. Row → Session summary. ~~Multi-select → "Compare".~~ (not built; Compare's own picker chooses) Tier-2 rows render ~~`—`~~ `N/A` (not blank, not zero) in Tier-1-only columns, with a tooltip explaining why *(corrected 2026-10-04: as built — `—` means a measured none, §FPS display rule)*.
2. **Frametime** — ScottPlot timeline of selected session (decimated), stutter markers, sensor overlay toggle (temp on right axis).
@@ -651,6 +679,10 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
> sentence under the language row is gone. A **Data** section has one row, **Delete all sessions…** (FR-1.7): the
> confirmation names how many, the Agent deletes them (`DeleteSessions`), and the strip says what happened or why nothing
> was deleted (a session being recorded, no agent, an older agent). Tests: `SettingsViewModelTests.DeleteAllSessionsAsksWithTheTotalThenGoesThroughTheAgent`.
> **Since beta.19 (D55) the Data section's first row is *Remove uninstalled games*** (`retention.remove_uninstalled_games`,
> on by default, off in a viewer like every setting the Agent reads): its strip says the Agent reads it within 15 seconds
> (`Settings_RemoveUninstalled_Applied`), not at the next session — the detection sweep reads it at every pass. Tests:
> `ViewerModeTests.EverySettingTheAgentReadsIsOffInAViewer`, `GuideDocumentsTests.TheSettingsPageOfTheGuideNamesEverySetting`.
Sections per FR-10 using the WPF UI settings idiom: `ui:CardControl`/`ui:CardExpander` rows with `ToggleSwitch`, `ComboBox`, `ui:NumberBox` (numeric inputs — min session length, sensor interval, retention). Language switch applies immediately (09_I18N). Theme selector (Light/Dark/System) drives `ApplicationThemeManager` (16 §Theming). **Capture section (top, most important):** the global **hooking kill switch** (`ToggleSwitch`, prominent) with a one-line summary of what it does; a list of games currently hook-enabled with a per-game revoke; Vulkan layer registration state + Register/Unregister; a link to the safety documentation. Turning the global switch off must take effect immediately, including for the Vulkan layer.
+11
View File
@@ -272,6 +272,16 @@ substitutes it with ~~the tag date~~ the run's UTC date (corrected 2026-10-04) w
address — is resolved in the source files, because an unsubstituted token in a
document the app displays for acceptance (FR-11) is a defect, not a template.
**The build id is read before it (beta.18).** The substitution edits tracked files, and the native build id is
`git describe --dirty` at CMake's configure (`src/native/FrameLedger.Shm/CMakeLists.txt`): every release until beta.18
shipped `<tag>-dirty` — the owner's Dashboard read *Overlay build v0.1.0-beta.17-dirty*, and that run's log printed
`FL_BUILD_ID = v0.1.0-beta.17-dirty` two lines after `RELEASE_DATE = 2026-10-07 in 3 file(s)`. `release.yml` now reads
describe from the clean checkout first, refuses one that is already dirty or longer than 31 characters, and passes it
as the environment's `FL_BUILD_ID`, which CMake takes as given (checked for the characters a C string literal carries);
after the publish, `tools/buildid-check.ps1` reads it back out of the four native binaries that compile it, by their
bytes — nothing is loaded. A developer's build still runs describe itself (`+` marks a dirty tree when the long form
would not fit).
## Local quality gate (pre-push)
`./build.ps1 check`:
@@ -301,6 +311,7 @@ Seven self-test cases, both directions; `./tools/notice-check.ps1 -Fix` writes a
13d. **`tools/wiki-build.ps1 -SelfTest`, then `-Check`** (beta.17, owner decisions D53/D54, 2026-10-07) — assembles the GitHub Wiki from `wiki/`, `guide/` and `LIMITATIONS.md` into a temporary folder, as `wiki.yml` does at a release (`13_CI_CD` §wiki.yml), and fails on a link to a file, folder or section that does not exist, two sources for one page, a page that neither Home nor the sidebar leads to, a sidebar that lists the guide in another order than `guide/README.md`, a backticked repository path in a `wiki/` page that names nothing, and a version number written into a `wiki/` page (the footer says which release the wiki shows). Nine self-test cases, both directions
14. `tools/changelog-check.ps1 -SelfTest` — nine cases, five expected RED. The live half needs a pull request's changed-file list and is supplied by `ci.yml`
14b. `tools/release-notes.ps1 -SelfTest` — five cases over a fixture changelog (a dated and an undated section, a missing one, a prefix that must not match, an empty one). The live half needs a tag's version and runs in `release.yml`, where a missing or empty section is a red release (P4 PR-5)
14c. **`tools/buildid-check.ps1 -SelfTest`** (beta.18) — eight cases, both directions: a binary built from a dirty tree (`-dirty`, or the short form's `+`), one with no id, a missing one, and an expected id that is dirty or not an id are red. The live half needs the release's clean-checkout id and runs in `release.yml` over the published tree (§Release-time token substitution)
15. `tools/resx-audit.ps1` — ~~**skipped loudly; it does not exist, and no `.resx` file does either**~~ **built 2026-09-13 (P3 PR-2)**: `-SelfTest` first (11 fixture cases, both directions), then the live pass over every `Strings.resx` family under `src/` — key sets equal across en/vi/ja, `Safety_*` in `ja` marked for review or signed, `Strings.Designer.cs` current with `tools/resx-gen.ps1`. A tree with no family is red (`09_I18N` §Translation workflow)
16. **struct-mirror** — reads this run's `.trx` and fails when `ShmLayoutMirrorTests` did not execute, so deleting the mirror test is red as well as breaking it
16b. **`tools/test-artifacts-check.ps1`** — `-SelfTest` first (seven cases, two RED), then live: an `overlay-*.log` created since this gate started, still in the real `%LOCALAPPDATA%\FrameLedger\logs` after the tests, whose first line names a `hook-harness*` image, fails the gate. It is what makes a test binary without its log sweep red (`17_HOOK_ENGINE` §Native logging, 2026-09-15); a game's log never counts
+15
View File
@@ -52,6 +52,17 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
case. `Kill` now waits for exit (bounded, asserted) and the delete retries. Not §S19(b) either — a test-harness
race, and the third flake shape of the day (the registry-subtree race between `VkLayerRegistrationTests` and the
GOG reader's test, fixed in #188) was the same kind.
- **Two more on 2026-10-07 (beta.18), both re-run green and then fixed the same day.**
`WhenTheTargetExitsTheHostStopsAndSaysWhy` ended **`TargetNotRunning`** (#286, run 37619719203): the host resolves its
target once, as it starts, and a host slower than the harness's 6 s hold found it gone — the shape recorded since
2026-09-21. The hold is 15 s: a margin, not a signal, because the host prints nothing until its session ends.
`LaunchModeOnAVulkanTargetAttachesToTheLayersRingAndInjectsNothing` ended **`RefusedByGuard` / `ModuleScanFailed`**
(#288, run 37627351438): the hosted runner has the Vulkan loader and no device, so the harness exits 77 with a
`[SKIP]` line — but the runner is elevated, the host starts the harness through `CreateProcessWithTokenW`
(`UnelevatedProcess`), the child gets no stdout, and the line never reached the host's output; the test then
depended on the session reading `LaunchTargetExited`, and a scan that hit the dying harness failed it instead. The
test now asks the harness directly, before the host runs (exit 77 = skip, with the harness's own line); hiding the
Vulkan ICDs from that probe makes it skip in under a second, and on a machine with a device it runs in full.
- **A re-run ERASES the evidence, which is why the count above had to be kept by hand.**
`gh run rerun --failed` updates the original run's conclusion, so `gh run list` showed **18 success, 1
cancelled, 0 failed** across the twenty runs that contained all three failures above. Anyone measuring
@@ -127,6 +138,10 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
`VERSION` file (`12_BUILD` §Version); and `CHANGELOG.md` must carry a **non-empty** `## [x.y.z]` section for the
full version, extracted by `tools/release-notes.ps1` (self-tested on every `build.ps1 check`). A missing
section is a red release, not an empty note — the ledger's header said the opposite for five weeks.
- **The build id from the clean checkout** (beta.18): `git describe --always --dirty --abbrev=12` before anything edits a
tracked file — a dirty one or one over 31 characters stops the run — into `FL_BUILD_ID` for CMake. Until beta.18 the
substitution below ran first and every release's natives called themselves `<tag>-dirty` (`12_BUILD` §Release-time
token substitution).
- `{{RELEASE_DATE}}` substituted in `legal/*.md` with the run's UTC date **before the build**, because the App
embeds those documents (FR-11); any `{{` token left anywhere after that fails the job.
- **The identical gate** — `./build.ps1 check`, native first, every tool including `versioninfo-check` against
+5
View File
@@ -250,6 +250,11 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
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`).
- [ ] **A `ScrollViewer` moves a FIXED 48 DIP per wheel message, whatever its delta** (`ScrollViewer._mouseWheelDelta`,
read from .NET 10.0.12; measured on a `FlowDocumentScrollViewer`: deltas of −1, −15, −120 and −360 each moved 48). It
ignores Windows' *lines to scroll*, and a precision touchpad's small deltas each jump the whole step — a long document
read as slow and jerky while its layout cost about a millisecond a step. `Controls/MarkdownView` handles
`PreviewMouseWheel` itself (beta.21): the delta in proportion at Windows' lines, eased, unhandled at its ends.
- [ ] **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.
+36 -8
View File
@@ -267,13 +267,17 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
> be read (a manifest that will not open, more than 4096 of them, a listing error) refuses as `PreScanFailed`. With
> nothing listed, nothing is read. Epic has no reader: an Epic install carries no identity to this check.
>
> **What is listed, and why a title list at all:** 33 Steam app ids and 33 executable names across ten families —
> **What is listed, and why a title list at all:** ~~33~~ 34 Steam app ids and 33 executable names across ten families —
> Valve VAC (CS2, Dota 2, TF2, Deadlock and Valve's older VAC titles), Riot Vanguard, Roblox Hyperion, Blizzard's
> online titles ("Blizzard Warden"), Call of Duty (Activision Ricochet), NetEase (Marvel Rivals, NARAKA, FragPunk,
> Once Human), ACE (Delta Force, Arena Breakout: Infinite), HoYoverse and EA (Battlefield 2042/6, EA SPORTS FC 25/26),
> and since 2026-10-03 (rules `2026.10.1`, owner's list) HyperTech's **CrackProof** (Umamusume: Pretty Derby
> `3224770`, Heaven Burns Red `1973710`, Madoka Magica Magia Exedra `2987800` — Steam ids only: no executable name
> was verified, and a guessed one is a false refusal waiting for an unrelated game).
> was verified, and a guessed one is a false refusal waiting for an unrelated game). **Since 2026-10-13 (rules
> `2026.10.4`, owner decision D58) Wuthering Waves `3513350`, under ACE**, by its Steam id alone (its executable,
> `Client-Win64-Shipping.exe`, is a name Unreal games share): its ACE sits beside the executable, where check 4 did
> not reach until the same rules (item 4 below), and a session was hooked for 37 s on 2026-10-12 before the 30 s
> re-scan met the driver — a machine-wide finding, which turned nothing off (`spike-notes.md` §19).
> These are the titles whose anti-cheat leaves nothing of the game's own for checks 1, 2 and 4 to find — VAC runs
> inside Steam, Blizzard's scanner is built into the game — or whose kernel driver loads only after the checks run.
> CrackProof is the second kind: a Proton log of Umamusume shows its driver loaded from `C:\Windows\System32` under a
@@ -337,7 +341,8 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
> `ResolveInstallRoot`, plus check 3 on the executable's name and the install's store identity.
> **Implemented, and stated narrowly.** `fl_prescan.cpp` walks the target's
> own directory (derived from its pid, never from a caller-supplied path) to
> install root and, since 2026-10-13, its executable's own folder (both derived from its pid, never from a
> caller-supplied path — "Which directory" below) to
> **depth 3** — raised from 2 on 2026-08-04 (§S22, `spike-notes.md` §13), because a
> title shipping its own kernel driver two levels below the install root was
> invisible from where the scan starts, so the blocklist row naming it could not
@@ -382,6 +387,21 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
> appeal. A nested executable outside a recognised store layout is therefore
> still scanned narrowly; that residual is stated, not closed.
>
> **Amended 2026-10-13: the root AND the executable's folder.** The root replaced the executable's folder, and
> that was half the answer. The walk reaches three levels below where it starts, and an Unreal executable is
> already three below its root, so a folder **beside** the executable is four: MEASURED on Wuthering Waves, whose
> Tencent ACE lives in `Client\Binaries\Win64\AntiCheatExpert\` (with `ACE-BASE.sys` and `ACE-CORE.sys` in it). The
> walk from the root listed `Win64` and never opened it, so the library pre-scan read the game clean three times,
> hooking stayed available, and the first session was hooked for 37 s until the 30 s re-scan met ACE's driver —
> machine-wide, so nothing was turned off (`spike-notes.md` §19). Neverness To Everness keeps a second
> `AntiCheatExpert\` beside its `HTGame.exe`, six levels down, that no walk had seen either. Check 4 now walks the
> root and then, when the executable lives below it, the executable's own folder — same walk, same reach, its own
> 4096-entry budget, the same matcher and the same D33 tolerance (`ScanGameFolders`). `ImageDirectory` names the
> executable's folder and the checks resolve the root from it. Raising the reach instead was measured and rejected:
> depth 4 still misses NTE's folder, and at depth 5 three installed titles overrun 4096 entries (Yu-Gi-Oh! Master
> Duel: 41,251), which would refuse them. Measured across the owner's 83 Steam installs, the second walk costs at most
> 103 entries and newly finds exactly those two folders.
>
> **What it does not cover.** Beyond the above, the residual is an anti-cheat
> SDK sitting on disk whose service is not installed and whose module is not
> loaded; checks 1, 2 and 2b already cover the rest. And today the `directories` + `files`
@@ -393,9 +413,11 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
> closed by never firing, which is a silent hole.
>
> **Every uncertainty refuses**, with `Reason::kPreScanFailed` rather than a
> hit: directory absent or unlistable, either bound exceeded, a name we could
> hit: directory absent or unlistable, ~~either bound exceeded~~ the 4096-entry bound exceeded, a name we could
> not convert, or a reparse point — which is never followed, because a
> junction can hide an `EasyAntiCheat/` beneath it. **Unmeasured:** how often
> junction can hide an `EasyAntiCheat/` beneath it. *(Corrected 2026-10-13: the DEPTH bound never refused. It is a
> reach — a folder at the last level is named and not opened, and the walk still reads as complete — which is how
> Wuthering Waves' ACE was missed; the paragraph above is what answers it.)* **Unmeasured:** how often
> a legitimate library trips the reparse-point rule or the 4096-entry bound.
> That needs a real game library, and it is a false-refusal path, so it is
> recorded rather than assumed benign.
@@ -499,7 +521,10 @@ card is back with the finding under its disabled switch. The finding itself is o
**What clears it.** Nothing, as before: the block outlives *Change executable* and a re-import (§A game already enabled
can become blocked later). The owner asked for hooking to be turned off when anti-cheat is detected, not for a second
switch. *(Still true under D33: an exception is a separate layer over the block, never a clearing of it — §The user-mode
exception.)*
exception.)* *(And under D55, beta.19: the Agent removes an entry whose game is no longer installed and that has no session,
but never one that carries a block, an exception's grant or a failed trial — the delete's own SQL refuses them
(`SqliteGamePrune`), so an uninstall is not how a block, a grant or D38's "never again" disappears. Only the user's
*Remove… ▸ Delete sessions too* deletes such a row, as before.)*
**D21 stands as a fact.** A process an anti-cheat driver protects is `SessionEndReason.TargetUnreadable` (2026-09-21:
every candidate of that name exists and none can be opened; ELDEN RING under Easy Anti-Cheat on the owner's machine).
@@ -541,7 +566,7 @@ says so, including that a ban can arrive days later and that FrameLedger cannot
FredaikisAntiCheat and Roblox Hyperion *(Hyperion added 2026-10-04: its rows are one module and one file; its only title
is on the executable list, so it is never excepted in practice)*; Easy Anti-Cheat, BattlEye, ACE, NetEase Anti-Cheat, mihoyo protect, Vanguard, Ricochet and every
other family carry a driver or a service and are never excepted;
- no `*.sys` anywhere in the install tree — the kernel-driver rule (D30) is never excepted, whichever family a driver
- no `*.sys` anywhere in the install tree *(within check 4's reach: three levels under the install root and, since 2026-10-13, under the executable's own folder)* — the kernel-driver rule (D30) is never excepted, whichever family a driver
belongs to (so *Aniimo*, which unpacks `NEPKernel.sys` beside `NEP2.dll` on its first run, stays blocked);
- the game is on no title list (`BlockedExecutable`, `BlockedStoreId` — the notorious titles are there by design);
- ~~the ledger holds **at least two successful Tier-1 sessions** of the game: hooked, frames recorded, `exit_status = normal`
@@ -723,10 +748,13 @@ normative documentation. Write tokens here exactly as the data must hold them.
| mihoyo protect | `services` | name | `mhyprot2`, `mhyprot3`, `HoYoKProtect` | 2026-09-25 |
| mihoyo protect | `files` | name | `mhypbase.dll`, `mhyprot2.sys`, `mhyprot3.sys`, `HoYoKProtect.sys` | 2026-09-25 |
| Anti-Cheat Expert | `modules` | prefix | `SGuard`, `AntiCheatExpert` | 2026-09-25 |
| Anti-Cheat Expert | `modules` | exact | `ACE-Base64.dll` | 2026-10-13 |
| Anti-Cheat Expert | `drivers` | exact | `ACE-BASE.sys`, `ACE-ADVT.sys`, `ACE-GAME.sys` — **machine-wide refusal** (check 2) | seed |
| Anti-Cheat Expert | `drivers` | exact | `ACE-CORE.sys` — **machine-wide refusal** (check 2) | 2026-10-13 |
| Anti-Cheat Expert | `directories` | name | `AntiCheatExpert`, `AceAntibotClient` | 2026-09-25 |
| Anti-Cheat Expert | `services` | name | `AntiCheatExpert Protection`, `AntiCheatExpert Service` | seed |
| Anti-Cheat Expert | `services` | name | `AntiCheatExpert Protection`, `AntiCheatExpert Service`, `ACE-BASE` | seed; `ACE-BASE` 2026-10-13 |
| Anti-Cheat Expert | `files` | name | `PGameProtectDriver_X64.sys`, `SGuard64.exe`, `SGuardSvc64.exe` | seed; `SGuard64.exe`, `SGuardSvc64.exe` 2026-09-25 |
| Anti-Cheat Expert | `files` | name | `ACE-BASE.sys`, `ACE-CORE.sys`, `ACE-Base64.dll`, `ACE-Service64.exe`, `ACE-Setup64.exe` (measured in Wuthering Waves' folder) | 2026-10-13 |
| EA AntiCheat | `modules` | prefix | `EAAntiCheat` | 2026-09-25 |
| EA AntiCheat | `drivers` | exact | `EAAntiCheat.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| EA AntiCheat | `files` | name | `EAAntiCheat.Installer.exe`, `EAAntiCheat.GameServiceLauncher.exe`, `EAAntiCheat.GameServiceLauncher.dll` | 2026-09-25 |
+166 -4
View File
@@ -1410,9 +1410,11 @@ stops there"~~ — the override itself is gone since 2026-09-22 (D22).
**Found and NOT fixed — each needs its own PR.**
- ~~**A refused session is not recorded, though the notice says it is.**~~ **Fixed 2026-09-22 (D23):** the loop holds a
refused session open until the target exits, so Tier 2 has a producer and the sentence is true for every refusal.
- **A released Overlay logs its build as `v0.1.0-beta.3-dirty`**: the CI checkout is dirty by the time CMake runs
- ~~**A released Overlay logs its build as `v0.1.0-beta.3-dirty`**: the CI checkout is dirty by the time CMake runs
`git describe`. Both sides of the handshake compile the same string, so nothing breaks; it is a release that calls
itself dirty.
itself dirty.~~ **Fixed 2026-10-07 (beta.18 PR-3):** the dirt was `release.yml`'s own date substitution in
`legal/*.md`; the workflow reads describe from the clean checkout before it and hands it to CMake as `FL_BUILD_ID`,
and `tools/buildid-check.ps1` reads it back out of the published binaries (`12_BUILD` §Release-time token substitution).
- ~~**An install over a running Agent half-replaces the folder** (three failed starts, `Microsoft.Data.Sqlite` not
found).~~ **A GUESS, WITHDRAWN the same evening, and it had already been published in beta.4's notes.** Nothing was
installed between the failures (20:59–21:01) and the start that worked (21:02); the PC had been restarted at 20:57
@@ -1492,7 +1494,8 @@ wrongly-named entry through `SessionRecorder`'s `EnsureAsync`); the running tabl
launch election registers its session and defers to the watcher's. **What it costs:** a game whose FOLDER moved records
nothing until *Change executable* — accepted, because the alternative is exactly what put HHW's sessions under Flower
in Us. **D28 (owner, same day):** HHW itself is measured by pointing an entry at `swiftshader\Game.exe` (the NW.js
runtime its .NET launcher starts); no launcher-following in beta.6.
runtime its .NET launcher starts); no launcher-following in beta.6. *(Corrected 2026-10-13, D57: that ".NET launcher"
is malware — `spike-notes.md` §20. Nothing here asks for it to be run.)*
**Decision (D26, owner: "the library still shows two entries side by side after the drive letter changed, with the
data unchanged").** The Agent merges two entries for one executable under two drive letters by itself: the stale
@@ -2039,7 +2042,7 @@ added.*
- **The desktop app forbids polling CI** (no `gh` loop, Monitor or ScheduleWakeup): it wakes the session on a failure, a
conflict or a review comment, never on green, so a green PR waits for the owner's word or the owner's auto-merge.
## **START HERE** — 2026-10-07, 0.1.0-beta.17: text that follows a theme switch, scroll bars hidden everywhere, a wiki
## ~~**START HERE**~~ — 2026-10-07, 0.1.0-beta.17: text that follows a theme switch, scroll bars hidden everywhere, a wiki *(struck 2026-10-07: the head is §beta.18 below)*
*Status is `CHANGELOG.md` `[0.1.0-beta.17]`; this is what no other file carries. The owner's report (2026-10-07, three
screenshots of beta.16): Settings' descriptions kept the old theme's colour after a switch; the Dashboard kept its
@@ -2082,6 +2085,139 @@ release.*
**Owner-only, added to the list below:** item 13.
## ~~**START HERE**~~ — 2026-10-07, 0.1.0-beta.18: page titles readable in the dark theme, notices in words, a clean build id *(struck 2026-10-12: the head is §beta.19 below)*
*Status is `CHANGELOG.md` `[0.1.0-beta.18]`; this is what no other file carries. The owner's report (2026-10-07, five
screenshots of beta.17 in the dark theme): every page's title and section headings near-black on the dark window — and
the two chips beta.17 left (§beta.17, "Found while writing the guide"). Three stacked PRs — #286 the page text, #287
the notices and the rest of that list, #288 the release build id — then the release.*
**No new decisions.** The train is the owner's request of 2026-10-07 ("beta18 with the two chip tasks, and the text that
blends into the background in dark mode").
**Traps met on the way:**
- **A page in the `NavigationView` inherits nothing.** `NavigationViewContentPresenter` is a `Frame`, and a Frame sets
`InheritanceBehavior.SkipToAppNow`; WPF UI 4.3.0 makes the TextBlock default black. A page on screen during a theme
switch takes the window's new colour through the switch and a page navigated to afterwards does not, so it came and
went. Every check before hosted pages straight in a window and measured a page the App never draws — host a page in the
presenter (`PagesLoadTests.Hosted`, `16_WPFUI_SYNTAX` §Gotchas).
- **The accent is not in the theme dictionary.** WPF UI writes it into `Application.Resources` at every
`ApplicationThemeManager.Apply(…, updateAccent: true)`; a test that swaps only the dictionary measures the other theme's
accent (`Visuals.UnderTheme` derives it as the App does; `systemAccentColor: true` reads the machine's own palette).
- **The gate's own refusals look like findings on the wire.** `HookedCaptureGate` puts a label ("kill switch", "previously
blocked") where a family goes; whatever reads a family as "an anti-cheat was found" asks the end reason first. A test
of what the user reads builds the event as the Agent does (`NoticesFromTheAgentTests`), never by hand — the
hand-written events were why every notice test was green.
- **`Safety_Consent_*` strings are versioned with the consent disclosure** (`SafetyDisclosure`): a message that is wrong
on one path gets a key of its own rather than a changed meaning.
- **A release's natives were `-dirty` by the release's own hand:** its date substitution edits `legal/*.md` before CMake
reads describe. The id is read first, handed in, and read back out of the binaries (`tools/buildid-check.ps1`).
- **Met again:** `CaptureHostEndToEndTests.WhenTheTargetExitsTheHostStopsAndSaysWhy` (`TargetNotRunning` on a slow
runner) failed #286's first CI run; the job was re-run. **And a new one** failed #288's:
`…LaunchModeOnAVulkanTargetAttachesToTheLayersRingAndInjectsNothing`. A hosted runner has the Vulkan loader and no
device, so the harness exits 77 with a `[SKIP]` line — but the runner is elevated, the launch goes through
`CreateProcessWithTokenW` (`UnelevatedProcess`), the child inherits no stdout, and the line never reaches the host's
output; when the guard's scan hits the exiting harness (`ModuleScanFailed`) the test fails instead of skipping. Re-run;
~~the deterministic fix is a task of its own~~ fixed the same day by beta.18 PR-5 (the test asks the harness itself,
before the host runs), which also gave the `TargetNotRunning` case a 15 s hold (`13_CI_CD` §ci.yml).
**Owner-only, added to the list below:** item 14.
## ~~**START HERE**~~ — 2026-10-12, 0.1.0-beta.19: the import's helper, the folder Change executable opens in, three engines' versions, uninstalled games *(struck 2026-10-12: the head is §beta.20 below)*
*Status is `CHANGELOG.md` `[0.1.0-beta.19]`; this is what no other file carries. The owner's list (2026-10-12, four items):
*Change executable…* opens in the game's root folder; the version of RPG Maker, Unity and Godot games; A Doll's Locket -
Remake imported as `notification_helper.exe`; whether the Agent removes games whose executable is gone, and if not, to
remove them when no session was recorded. Four stacked PRs — #292 the import, #293 the folder, #294 the versions,
#295 the removal — and two from #295's review, #297 one notice per check and #298 the probe's unreadable-folder tests —
then the release.*
**Decisions (owner, 2026-10-12, asked before the plan — do not re-ask):**
- **D55 — a game you uninstalled leaves the library by itself when it has no session** (amends D41's "nothing is
removed"): its executable gone at sweeps ten minutes apart (counted in the Agent's memory), its drive connected and the
folder it was installed in still there, no session stored, recording or waiting to be recovered — behind Settings ▸
Data ▸ *Remove uninstalled games*, on by default (`02_SPEC` FR-1.8). **Never an entry carrying an anti-cheat block, an
exception's grant or a failed trial**: that part follows from rule 2 and D38 and was not asked (`19_SAFETY` §What a
finding does to the game).
- **D56 — an NW.js runtime is the import's game**: an executable beside `nw.dll` + `package.json` ranks as the engine's
own layout, below Unity's and Unreal's and above a name match, so a launcher-fronted RPG Maker MV/MZ install is pointed
at the process that draws. D28 did that by hand for HELLO, HELLO WORLD!; ~~the locator now picks the same file~~
*(corrected 2026-10-13: the locator does, and an import never asks it there — itch's own pick names the program in
front, which is not a helper, so the import takes it; and that program is malware, D57 — §beta.21)*.
- **The owner's existing A Doll's Locket entry is not rewritten** (D25/D27): *Change executable…* re-points it, and the
import no longer offers a twin of the same store title.
- **The train (owner, 2026-10-12, after the PRs were up):** "commit, push và release luôn" — each PR squash-merged by the
session as its CI went green, then the signed tag and the release, without asking again. Then, of the review's two
follow-ups the session had offered as separate tasks: "2 pr riêng, rồi merge, push và release" — #297 and #298, in this
release.
**Traps met on the way:**
- **A store's own pick can be a helper.** itch's butler saves a *filtered* verdict — the shallowest candidates, minus
those whose manifest asks for elevation — and ranks nothing, so A Doll's Locket's whole verdict was
`notification_helper.exe`. Its database lives in the WAL (a 4 KB main file): a read with `immutable=1` sees no tables;
open it `mode=ro` with the itch app closed, or copy the `-wal` beside it as `ItchLibrarySource` does.
- **The locator's helper fragments are substrings** (`node` is inside *Nodebuster*): good enough for a guess, never to
overrule a store — `ExecutableLocator.RuntimeHelperNames` holds whole names for that.
- **Godot's version string sits 57–78 MB into an export**, past the rules' 8 MiB strings scan; the data pack's header
has it in 20 bytes. **Unity's FileVersion string is not the editor version** (`2022.3.39.5118735`); the ProductVersion
is (`2022.3.39f1 (hash)`), except on 2019.4 players, whose data file's header carries it.
- **`File.Exists` and `Directory.Exists` answer false for a path they may not look at**: before removing anything, the
parent's listing is asked whether the child is there (`ExecutablePresenceProbe`).
- **The signing key was locked when the session began**, and ten pinentry prompts went unanswered; the code went on and
the commits waited. Probe first: `echo x | gpg --batch --pinentry-mode error --local-user <key> --clearsign`.
- **Mechanical, again:** the Write tool writes LF (convert after it); a Bash heredoc halves `\\` (patch scripts are
files); a WPF project has no implicit `System.IO` using; MA0051 (60 lines) hit `ItchLibrarySource.ReadDatabaseAsync`,
`DetectionSweep.SweepOnceAsync` and `AgentServices.AddDetection`; CA1716 rejects an interface member named `Of`.
- **A review of the PR that deletes data, after its gates were green and before it merged, found three defects no gate
could:** a cross-reference to a `19_SAFETY` section that does not exist; a presence probe that listed every drive for
every entry and asked a dead share whether it was ready (`VolumeRoots.IsReady` reads the type first); and an entry
the delete refused that was never asked again (`UninstalledEntryPrune.RetryAfter`, an hour). The `vi`/`ja` switch text
also named the pill in English where those languages show their own word. Review such a PR before the merge. The two
it left for later landed in the same release: one check's removals arrive as one event each, and WPF UI 4.3.0's
`SnackbarService` keeps ONE snackbar and shows every message in it at once (`Show(true)`, read from the assembly), so
only the last name stayed on screen (#297: the page waits `GamesViewModel.RemovalSettle` and says them once); and the
probe's two *Unknown* branches had no test (#298: real folders the test user is denied, each test measured red with its
branch broken).
- **Loop a test class you touched before the merge.** `GamesViewModelTests` run 165 times failed once: two overlapping
reads of the library, the older finishing last and shown — a removed game's card came back. #297 shows only the newest
read. The first version of its test hung: which read reached the held check first was itself a race (wait for the
first to be held before starting the second, and bound every wait).
- **A test run reseeds `%LOCALAPPDATA%\FrameLedger\rules`** with rules `2026.10.2`, whose extractor types the installed
beta.18 cannot parse: its detection sweep says "rules unusable" until it restarts or beta.19 is installed (beta.10's
trap, met again; the guard is unaffected). For beta.20 PR-1 (rules `2026.10.3`, which the installed beta.19 cannot
parse) the session copied the owner's `detection-rules.json` and `.seeded` aside before testing and back after,
byte for byte, so the owner's running Agent kept its own.
**Owner-only, added to the list below:** item 15 — **passed 2026-10-12**.
**After the release (owner, 2026-10-12):** "tiếp tục với 1 pr kèm với detect version game dùng ren'py" — beta.20 PR-1 reads
a Ren'Py game's engine version from `renpy/vc_version.py` (rules `2026.10.3`, Privacy Policy 2.9 — the Legal Gate shows it
once at the next update; `05_DETECTION` §Engine version — Ren'Py) and strikes item 15. Merged for the next pre-release;
no release was asked for.
## **START HERE** — 2026-10-12, 0.1.0-beta.20: the engine version of Ren'Py games
*Status is `CHANGELOG.md` `[0.1.0-beta.20]`; this is what no other file carries.* The owner, the same evening as beta.19 and
after confirming it on real hardware: "tiếp tục với 1 pr kèm với detect version game dùng ren'py", then "tung bản beta20
rồi đóng phiên hẳn". One PR — #299, a Ren'Py game's version from the engine's own `renpy/vc_version.py` (rules
`2026.10.3`, Privacy Policy 2.9, item 15 struck) — then the release.
**Decisions:** none new. The Privacy Policy 2.9 wording — one item added to §4's list, "the version file of a Ren'Py
game's engine" — was shown to the owner with #299 and released on their word.
**Traps met on the way:**
- **`keyboxd` can fail with "Input/output error" while the key is unlocked**: `gpgconf --kill keyboxd` alone brings it
back on the next use; killing `gpg-agent` would drop the cached passphrase and wait on a pinentry.
- **A test run still seeds the owner's live rules** (§beta.19's trap): rules `2026.10.3` cannot be parsed by an installed
beta.19, so the owner's `detection-rules.json` and `.seeded` were copied aside before each local gate and back after.
- **Loop a test class you touched before the merge** (§beta.19): `GamesViewModelTests` then ran 340 times green after #297.
**Owner-only, added to the list below:** item 16.
## Owner-only — no PR can close these
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
@@ -2177,6 +2313,32 @@ release.*
halves and a footer naming `v0.1.0-beta.17` — then tick *Restrict editing to collaborators only* (Settings ▸ General
▸ Features ▸ Wikis), or anyone can change a page until the next release overwrites it. (e) The `ja` strings marked
`review`.
14. ~~**beta.18 on real hardware.**~~ **Passed 2026-10-08** — the owner ran it on real hardware and reported it OK ("Đã
test và ok"). *(The item as written:)* (a) **The dark theme:** every page's title and section headings — Dashboard, Games, a
game's page, Compare, Settings, Logs — read light on the dark window, after starting in Dark, after Light → Dark, and
after moving between pages. (b) **The overlay build** on the Dashboard's *Capture agent* card reads `v0.1.0-beta.18`,
without `-dirty`. (c) **Disable all hooking:** turning it on says a game being measured stops within 30 seconds; with
it on, a hooked game's notice reads "All hooking is switched off in Settings, so nothing was measured." (d) The `ja`
strings marked `review`, `Safety_Unhooked_Unnamed_Format` among them.
15. ~~**beta.19 on real hardware.**~~ **Passed 2026-10-12** — the owner ran it and reported (a), (c), (d)'s unplugged
drive, (e) and (f) OK ("Các mục đã test: 1, 2. 5, 6, 4, ok"); (b) and (d)'s removal were read from the logs: Refresh
named the existing entry instead of offering a twin, and one check at 18:04:00 removed Deadly Heart Gambit, Vibe Train
Demo and 衔蝶 (the App's restart at 17:47 had started the ten minutes again), the library then reading *Games · 46*.
*(The item as written:)* (a) **A Doll's Locket - Remake:** its page ▸ *Change executable…* opens in `Dolls
Locket\`; pick `css\Game.exe`. Its launcher asks for administrator, so the runtime is measured only with *Run the agent
as administrator* on — otherwise the session says why nothing was measured. *(Withdrawn 2026-10-13, D57: that
launcher is malware — do not run it; `spike-notes.md` §20.)* (b) **Refresh** offers no second A Doll's
Locket. (c) **Engine versions:** a Unity game's page (*Unity 2022.3.62f2* on Umamusume, *Unity 2019.4.40* on GIRLS'
FRONTLINE 2), Godot's (*Godot 4.4.1* on 衔蝶), RPG Maker's (*RPG Maker MZ 1.10.0*, *RPG Maker MV 1.6.2* on Flower in
Us, *RPG Maker VX Ace (RGSS 3.0.1)*), each with its *Engine version* line. (d) **Uninstall a game that has no session**
(or delete a copy you added): about ten minutes later its entry is gone and the Games page says so — two removed
together are said in one notice that names both; with the USB drive unplugged nothing is removed; *Remove uninstalled
games* off keeps it. (e) The Legal Gate shows the Privacy Policy 2.8
once. (f) The `ja` strings marked `review`.
16. **beta.20 on real hardware.** (a) **Bound Between Desks:** its page reads *Ren'Py 8.5.0*, and its *Engine version*
line says it was read from the engine's version file (`renpy/vc_version.py`); the first sweep after the update reads
every game once more (rules `2026.10.3`). (b) The Legal Gate shows the Privacy Policy 2.9 once. (c) The `ja` string
marked `review` (`GameDetail_EngineVersion_RenPyVcVersion`).
**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
+1 -1
View File
@@ -48,7 +48,7 @@ with the 2026-09-16 recovery and with library entries removed since.
| Game | Why nothing was measured | When | Evidence |
|---|---|---|---|
| HELLO, HELLO WORLD! | A 32-bit game (RPG Maker MV): refused by the guard once, and two sessions with hooking switched off — each recorded with its duration and sensors | 2026-09-23 | database |
| HELLO, HELLO WORLD! | A 32-bit game (RPG Maker MV): refused by the guard once, and two sessions with hooking switched off — each recorded with its duration and sensors. *Its itch.io download puts malware in front of the game — do not run it (noted 2026-10-13, [spike-notes §20](spike-notes.md))* | 2026-09-23 | database |
| Umamusume: Pretty Derby | Three sessions played with hooking switched off for the game | 2026-09-27 | database |
| Sekiro: Shadows Die Twice | One session played with hooking switched off | 2026-09-25 | database |
| GIRLS' FRONTLINE 2: EXILIUM | One session whose process Windows would not let FrameLedger open, and two recovered after the agent itself stopped mid-session (*interrupted*) | 2026-09-22 → 09-23 | database |
+15
View File
@@ -63,6 +63,21 @@ are kept because they record what each version changed and why (owner decision D
>
> Version 2.5 (2026-09-27, 0.1.0-beta.10) adds how a tracked game's window is shown — read from Windows — and the engine build name read from an Unreal Engine game's executable. It is also the first version to say two things the software already did: it reads the **content** of a library game's executable (markers in its first 8 MB and its import table, since the detection of engines and features; and, when a session starts, the graphics-library markers in the whole file), and it reads the processor load and the memory in use (since 0.1.0-beta.3). Nothing here leaves your device, as before.
### What version 2.9 of the Privacy Policy changed (0.1.0-beta.20)
§4's list of the version marks an engine keeps in its own files gains one: the version file of a Ren'Py game's engine
(`renpy/vc_version.py`), read to show a Ren'Py game's engine version (beta.20 PR-1, owner request 2026-10-12) — its first
4 KiB, for the `version` line only. Nothing here leaves your device, as before.
### What version 2.8 of the Privacy Policy changed (0.1.0-beta.19)
§4 names the version marks an engine keeps in its own files, read to show a Unity, Godot or RPG Maker game's engine
version (beta.19 PR-3, owner request 2026-10-12): Unity's player library (its version information) and the header of its
data file, the header of a Godot data pack, an RPG Maker game's core script and `Game.ini` and the library `Game.ini`
names. Two of them were read before and never stated: the version information of `UnityPlayer.dll` (the Unity rule's
extractor since the detection rules began) and an RPG Maker MV/MZ game's title in `data/System.json`, which the App reads
to name a game added by hand (since 2026-09-23). Nothing here leaves your device, as before.
### What version 2.7 of the Privacy Policy changed (0.1.0-beta.14)
§4 says two things the software reads to tell a crash from an ordinary exit: the crash reports Windows keeps in its
+139
View File
@@ -2633,3 +2633,142 @@ from this PR's build):**
refused, and the private working set then reads N/A), AMD and Intel GPUs, a laptop with two adapters (the reader sums
every adapter's instances for the pid), and a real game — the owner's beta.12 check (HANDOFF owner-only item 9) compares
a session's figures with Task Manager's Details tab at the same moment.
## 17 · Unity, Godot and RPG Maker versions in installed games *(2026-10-12, beta.19)*
Measured read-only on the owner's machine (i7-14700KF, RTX 5080, Windows 11 29648) before the readers were written:
every `UnityPlayer.dll`, `*.pck`, `rmmz_core.js`, `rpg_core.js` and `RGSS*.dll` up to five levels under `D:\another`
(GOG, itch and loose installs), `D:\SteamLibrary\steamapps\common`, Steam's own `common` and `G:\` — 23 installs, read in
9.6 s. Then again through the shipped pipeline (`StaticGameDetector` over `GameFileProbe`, rules `2026.10.2`), which read
every install as tabled. Nothing was copied or written; the decision rules are in `05_DETECTION` §Engine version — Unity,
Godot, RPG Maker.
| Engine | Installs | What the files say | Read as (shipped) | Detect time |
|---|---|---|---|---|
| Unity 2020+ | DONT GO, Dialoop, Broken Shell Demo, Deadly Heart Gambit, DreadFields, Kemono Teatime, March Out!, Umamusume, Walto, Yasha, Yu-Gi-Oh! Master Duel, 帰路, Legends of Runeterra | `UnityPlayer.dll` ProductVersion `2022.3.39f1 (4e1b0f82c39a)` … `6000.3.17f1 (cf0352b38e81)`; FileVersion `2022.3.39.5118735` (the build number where the release letter belongs) | the ProductVersion's editor version (`unity_player`) | 26 ms – 4.1 s |
| Unity 2019.4 | A Space for the Unbound - Prologue (GOG) | ProductVersion = FileVersion `2019.4.1.15122501`; `*_Data/globalgamemanagers` byte 20: `2019.4.1f1` | `2019.4.1f1` (`unity_data`) | 102 ms |
| Unity 2019.4 | GIRLS' FRONTLINE 2: EXILIUM | ProductVersion `2019.4.40.16762411`; the data file's header is not readable (encrypted) | `2019.4.40` (`unity_player_file`) | 2.2 s |
| Godot 4 | Plethora of Bullets 2 (itch), 衔蝶 (Steam) | `<exe>.pck` header `GDPC`, format 2, `4.2.2` / `4.4.1`; the exe's `Godot Engine v4.4.1.stable.official` sits 57–78 MB in; 衔蝶's version resource is the studio's (`0.1.0.3`) | `4.2.2`, `4.4.1` (`godot_pck`) | 24–41 ms |
| RPG Maker MZ | A Doll's Locket - Remake (itch) | `js/rmmz_core.js` line 2 `// rmmz_core.js v1.10.0` (also under the runtime's `css\js\`) | MZ `1.10.0` | 41–53 ms |
| RPG Maker MV | Flower in Us (Steam), 996IR, HELLO, HELLO WORLD! (itch) | `www/js/rpg_core.js` `v1.6.2`, `v1.6.2`, `v1.6.1` (HHW's one folder above its runtime) | MV `1.6.x` | 70–275 ms |
| RPG Maker VX Ace | City of Bones, Träumerei Chapter 2 (itch) | `Game.ini`: `Library=System\RGSS301.dll`; the DLL's version `3, 0, 1, 1` | VX Ace, RGSS `3.0.1` | 427–442 ms |
- **Detect time** is the whole detection of one entry — the install's walk, the rules and the second read — on the USB
drive; the second read itself is a version resource and at most a few kilobytes. It runs once per executable and rules
version, like Unreal's.
- ~~**Four of the itch installs front their runtime with a 213 MB .NET launcher**~~ **Four of the itch installs put a
213 MB .NET program in front of their runtime, and it is malware** *(corrected 2026-10-13, owner decision D57 — §20;
do not run it)* (HELLO, HELLO WORLD!, A Doll's Locket - Remake — whose launcher asks for administrator —, City of
Bones and Träumerei) — read as a launcher, the reason the import's choice of executable changed in the same train
(`05_DETECTION` §Library import, D56).
- **Not measured:** RPG Maker 2000/2003 (`RPG_RT.exe`; none installed, and no rule detects it), XP and VX (no install —
their RGSS1/RGSS2 libraries are read by the same rule as VX Ace's, unmeasured), a Unity build older than 2019 (its
player is the executable, with no `UnityPlayer.dll`), a Godot 3 export, and a Godot pack appended to the executable
(both installs ship the pack beside it; the trailer the reader follows is Godot's documented layout, tested on
synthetic files only).
## 18 · The Ren'Py version in an installed game *(2026-10-12, beta.20)*
The owner's one Ren'Py install, read-only: Bound Between Desks (Steam) — `BoundBetweenDesks.exe` (386,048 bytes, no version
resource), `BoundBetweenDesks.py`, `game\`, `lib\py3-windows-x86_64\` (Python 3.12: `libpython3.12.dll`,
`librenpython.dll`, `pythonw.exe`) and `renpy\` with the engine's `.py` sources beside `__pycache__\*.cpython-312.pyc`.
- `renpy\vc_version.py` (109 bytes, LF line ends): `branch = 'master'`, `nightly = False`, `official = True`,
`version = '8.5.0.25111603'`, `version_name = 'In Good Health'`.
- `renpy\__init__.py` imports those names from `vc_version` (else from `renpy.versions.get_version()`) and builds
`version_tuple` from `version.split(".")`; `renpy.version` is `"Ren'Py " + version_only`.
- The game's own `log.txt` (written at its last start, 2026-09-16) begins `Ren'Py 8.5.0.25111603`: the same number.
Then through the shipped pipeline (`StaticGameDetector` over `GameFileProbe`, rules `2026.10.3`): `renpy 8.5.0
renpy_vc_version` in 79 ms; Dialoop (`unity 6000.3.3f1`), Plethora of Bullets 2 (`godot 4.2.2`), A Doll's Locket - Remake
(`rpgmaker_mv 1.10.0`) and City of Bones (`rpgmaker_rgss 3.0.1`) read as in §17.
- **Not measured:** an older Ren'Py (no other install), whose `vc_version.py` may name no `version` — it then reads as
not found; a build that ships the engine compiled only (none seen).
## 19 · Anti-cheat beside the executable — Wuthering Waves *(2026-10-13, beta.21, owner decision D58)*
The owner's report: FrameLedger found no anti-cheat in `D:\SteamLibrary\steamapps\common\Wuthering Waves` (Steam
`3513350`, Unreal Engine 4.26.2). Read-only, on the owner's disk and in the Agent's own log.
**The layout.** The install root holds the launcher `Wuthering Waves.exe` (483,768 bytes), `Client\`, `Engine\` and
`ClearThirdParty.exe`; the library entry is the shipping binary `Client\Binaries\Win64\Client-Win64-Shipping.exe`
(169,213,960 bytes). Beside it, `Client\Binaries\Win64\AntiCheatExpert\` holds Tencent's ACE: `ACE-BASE.sys`
(4,125,432), `ACE-CORE.sys` (3,923,120) with `ACE-CORE.sys2`, `.sysa` and `.sysa2`, `ACE-Base64.dll` (69,736,848),
`ACE-Service64.exe`, `ACE-Setup64.exe`, `ACE-Base.dat` and `pld.dat`. The folder is **four levels** under the root;
entries per level under the root: 6, 10, 31, 276, 109, 136 (levels 1–6). Neverness To Everness keeps a second
`AntiCheatExpert\` beside its `HTGame.exe`, at `Client\WindowsNoEditor\HT\Binaries\Win64\` — **six** levels down.
**Why it read clean.** Check 4 walked the install root only (since 2026-09-25), three levels deep, and a folder at the
last level is named and never opened, silently: the walk listed `Win64` and reported a complete, clean tree. The rules
already named the folder (`directories`: `AntiCheatExpert`); the walk never handed the name to the matcher.
**What it cost, from the Agent's log.** Added by import 2026-10-11 19:50:19 → `prescan: scanned 2 — anti-cheat 1, clean 1`
(the anti-cheat was NTE's `PGameProtectDriver_X64.sys`, three levels down); re-scanned after the game's update at
21:22:14, clean; re-added 2026-10-13 18:30:44, clean. With hooking turned on, the session of 2026-10-12 started at
21:10:20 found nothing — ACE's driver not yet loaded, its services stopped — and was injected; at 21:10:57 the 30 s
re-scan met `ACE-BASE.sys` (written to `System32\drivers` at 21:10 by the game's ACE setup) and unhooked:
`SafetyUnhook; Saved (tier 1, exit=UnhookedSafety, frames=0); guard=BlockedDriver/Anti-Cheat Expert`. A driver is a
machine-wide finding, which refuses the session and turns nothing off, so the game's hooking stayed on. Registered on
the machine afterwards: the kernel service `ACE-BASE` (demand start) and the user-mode `AntiCheatExpert Protection`.
**The options, measured across the owner's 83 Steam installs** (read-only listings):
| Option | Cost | Newly finds | Verdict |
|---|---|---|---|
| Walk the executable's own folder too | ≤ 103 entries (NTE), 95 for Wuthering Waves | exactly the two `AntiCheatExpert\` folders above | **taken** |
| Depth 3 → 4 | one constant; peak 1,627 entries (Half-Life 2) | Wuthering Waves' folder name only — NTE's is six levels down, and the folder's files stay out of reach | rejected |
| Depth 5 or more | over 4096 entries for Yu-Gi-Oh! Master Duel (41,251), Yasha (12,215), GIRLS' FRONTLINE 2 (9,969) | — | rejected: those games would read *could not verify* and be refused at session start, GF2 under its D33 exception included |
| Make the depth cap refuse | — | — | rejected: it would refuse nearly every game |
**Taken (rules `2026.10.4`):** check 4 walks the install root, then the executable's folder when it lives below the
root (`ScanGameFolders`, `fl_prescan.cpp`), each with its own 4096-entry budget; the five `ACE-*` names join the
`files` group, `ACE-CORE.sys` the `drivers` group, `ACE-BASE` the `services` group and `ACE-Base64.dll` a `modules`
row of its own (so an injected Overlay stops itself if it loads); and Wuthering Waves' Steam id is on the title list.
The version bump is what makes every game's pre-scan run again: the sweep re-scans only when the rules version or the
executable changes.
- **Not measured:** that the game loads `ACE-Base64.dll` (no session has run since), and whether ACE's other titles
keep the same layout.
## 20 · The launcher in front of four itch installs is malware *(2026-10-13, beta.21, owner decision D57)*
§17 read the 213 MB program four itch.io downloads put in front of their RPG Maker game as a *launcher*, and the
documentation built on that reading (D28, D56's rationale, HANDOFF item 15(a), which told the owner to run A Doll's
Locket's with the agent as administrator). Read on 2026-10-13 without running anything — file listings, the itch
receipt, version resources, the .NET metadata strings and the files beside it — it is not a launcher. **It is malware.
Do not run it.**
| Download (itch) | The program | SHA-256 | Beside it |
|---|---|---|---|
| HELLO, HELLO WORLD! (5015466) | `HELLOHELLOWORLD.exe`, 213,572,096 bytes | `053553514C3E34865393654477631DEFB50B36509F44B8ADC5B1E555E1F64FD1` | `locales\ml.reg`, `locales\ko.xml` |
| A Doll's Locket - Remake (5085165) | `DollsLocket.exe`, 213,745,664 bytes | `51D3271AD0FFAF3652DAB9F66C1279CB2CA16F46A6AB2E5173D032600C1E5E53` | `data\Items.reg`, `data\Armors.xml` |
| City of Bones | `CityofBones.exe`, 213,557,760 bytes | `CA81BE260941E7BE2D87FE6852E7DAD0D432A84F071C2C578A7BD06BE7E61248` | `System\Windowskin.reg`, `System\RGSS301.xml` |
| Träumerei Chapter 2 | `TräumereiChapter2.exe`, 213,559,808 bytes | `65D4CCB7065227A0ED08D8977CA2F00F1E2A6DDC5F375C2C32E115D90DE29E4D` | `System\Game.reg`, `System\RGSS301.xml` |
- **The four programs are one .NET program**, unsigned, its version resource Visual Studio's template named after each
game (`HELLOHELLOWORLD`, version 1.0.0.7, "Copyright © 2026"), and nearly all of its size embedded resources.
- **Beside each, two files named like the game's own.** A 3,060-byte Windows registry file — byte-identical in all four —
that sets `AmsiEnable = 0` under `HKCU` and `HKLM\SOFTWARE\Microsoft\Windows Script\Settings` (it switches off
Windows' script scanning), and under `HKLM\SOFTWARE\Policies\Microsoft\Windows Defender` adds exclusions for the `.exe`
and `.msi` extensions and for `powershell.exe`, `rundll32.exe`, `msiexec.exe` and `regasm.exe`, and sets
`SpynetReporting = 0` and `SubmitSamplesConsent = 2` (no cloud protection, no samples sent). And a 3,216-byte `.xml`
that is no XML: high-entropy bytes, a different blob in each download.
- **What the program's own metadata names** (type and member names, read as strings): checks for virtual machines
(VMware, VirtualBox, QEMU, Hyper-V, Xen, KVM, Bochs, Parallels — through WMI, the registry and the firmware) and for
debuggers (`IsDebuggerPresent`, `CheckRemoteDebuggerPresent`, `NtQueryInformationProcess` on the debug port, object and
flags, hardware breakpoints, debugger windows); AES decryption of Base64 text; PowerShell run inside the process
(`CreateRunspace`, `AddScript`); registry writes; steps named `RunPayload` and `PayloadStep`; and the game it starts
afterwards — the RPG Maker runtime beside it (`swiftshader\Game.exe`, `css\Game.exe`, `Game.exe` with
`RGSS301.dll`), which is what makes it look like the game.
- **Where it sits in each download:** the itch receipt of HELLO, HELLO WORLD! lists the program, the runtime in
`swiftshader\` and both disguised files as what the download installed; nothing was added afterwards.
**What changes in FrameLedger (D57): the documentation, not the import.** The import still takes a store's own pick when
it is not a helper (beta.19) — FrameLedger reads a game's files to find its engine and anti-cheat, never to judge
whether it is safe, and a store's verdict stays the store's. What is corrected in place: §17's bullet, `05_DETECTION`
§Library import (D56's rationale and its admin-mode sentence), HANDOFF D28, D56 and item 15(a), the beta.19 CHANGELOG
entry, and the HELLO, HELLO WORLD! row of `LIST_GAME_TESTED.md`; `LIMITATIONS.md` says FrameLedger does not tell a safe
game from an unsafe one.
- **Not measured, and not to be:** what the payload does. Nothing here was run, decrypted or uploaded anywhere.
+2 -1
View File
@@ -26,7 +26,8 @@ a game is being recorded. Backing up is up to you — FrameLedger does not do it
## Delete it
- **A game's sessions:** Games ▸ the game ▸ Sessions ▸ **Delete all sessions…**
- **A game:** its page ▸ **Remove…**
- **A game:** its page ▸ **Remove…** A game you uninstalled goes by itself when it has no sessions (Settings ▸ Data ▸
**Remove uninstalled games**, on unless you turn it off); one with sessions stays, with them, until you remove it.
- **Every session of every game:** Settings ▸ Data ▸ **Delete all sessions…**
- **Everything:** uninstall FrameLedger and let it delete the data folder, or delete the folder yourself.
+5 -3
View File
@@ -59,7 +59,9 @@ stopped, hooking turned off — each with one button that only says you have rea
- **Search games**; sort by **Name**, **Last played** or **Playtime**; **Show as a list** or **Show as a grid**.
- **Refresh** reads your library again: it offers games newly installed through a store, and marks a game whose `.exe`
is gone as *Not installed*.
is gone as *Not installed*. The agent removes such a game by itself after ten minutes when it has no sessions and its
drive is connected — never one where anti-cheat was found (**Settings ▸ Data ▸ Remove uninstalled games** turns this
off).
- **Add game…** — or drop `.exe` files onto the page.
- Each game shows its name, its store and engine, and one state: **Hooking on**, **Hooking off**, **Anti-cheat** (found,
so it is not hooked), **Exception** (a user-mode exception is in force) or **Not recorded**; then its sessions,
@@ -69,8 +71,8 @@ stopped, hooking turned off — each with one button that only says you have rea
- **At the top:** the name, publisher, version, store and engine, the `.exe` path, the last session, the last measured
session's frame rate and its ray-tracing chips. **Edit…** changes the name, publisher, version and notes. **Change
executable…** points the entry at another `.exe` and turns hooking back off. **Remove…** asks whether to keep the
game's sessions.
executable…** points the entry at another `.exe` and turns hooking back off; its file dialog opens in the game's own
folder. **Remove…** asks whether to keep the game's sessions.
- **Recording** — off, FrameLedger ignores the program completely: for a launcher or a tool that is not a game.
- **Hooking** — on, the game is measured. A warning comes first, and you type `I ACCEPT THE INJECTION RISK` to go on.
Read [Anti-cheat and safety](04-anti-cheat-and-safety.md) before you do.
+1
View File
@@ -27,6 +27,7 @@ The link under them, *Read what the hook does and does not do*, opens the safety
| Setting | What it does | Default |
|---|---|---|
| **Remove uninstalled games** | A game whose `.exe` has been gone for ten minutes is removed from your library — only when it has no sessions, its drive is connected and the folder it was installed in is still there (an unplugged drive never counts), and never a game where anti-cheat was found. Off, it stays and reads *Not installed*. *Agent*, within 15 seconds. | On |
| **Delete all sessions** | Deletes every session of every game, with its data and notes, after asking. Your library, your settings and each game's hooking choice stay. It cannot be undone, and it is refused while a game is being recorded. | — |
## Capture agent
+6 -3
View File
@@ -12,7 +12,7 @@
HTML comments are not part of the block.
-->
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.17`** (2026-10-07), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.20`** (2026-10-12), 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
@@ -63,8 +63,11 @@
> swap chain; for every other session the window alone is read, and a window covering its monitor reads
> *full-screen or borderless*. What Windows does behind the game (fullscreen optimizations) is not visible.
> - **Engine version:** the exact Unreal Engine 4 or 5 version, read from the game's executable on disk and
> labelled with what it rests on; `N/A` where the executable names none. Other engines show what their own
> files state.
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
> player library or its data file — without the release letter where only the library's number is readable),
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Since
> beta.20 also Ren'Py's (from its engine's version file). Other engines show what their own files state.
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
> once a second from Windows' own counters, from outside the game, in every session: a game
+6 -3
View File
@@ -114,7 +114,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.17`** (2026-10-07), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.20`** (2026-10-12), 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
@@ -165,8 +165,11 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
> swap chain; for every other session the window alone is read, and a window covering its monitor reads
> *full-screen or borderless*. What Windows does behind the game (fullscreen optimizations) is not visible.
> - **Engine version:** the exact Unreal Engine 4 or 5 version, read from the game's executable on disk and
> labelled with what it rests on; `N/A` where the executable names none. Other engines show what their own
> files state.
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
> player library or its data file — without the release letter where only the library's number is readable),
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Since
> beta.20 also Ren'Py's (from its engine's version file). Other engines show what their own files state.
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
> once a second from Windows' own counters, from outside the game, in every session: a game
+2 -2
View File
@@ -1,6 +1,6 @@
# FrameLedger — Privacy Policy
**Version:** 2.7 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.9 · **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; 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.
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), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), 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.
+17 -10
View File
@@ -42,7 +42,7 @@
"level, which made it a check that could not fire."
],
"schemaVersion": 2,
"rulesVersion": "2026.10.1",
"rulesVersion": "2026.10.4",
"engines": [
{
@@ -52,7 +52,7 @@
{ "type": "sibling_glob", "value": "UnityPlayer.dll" },
{ "type": "dir_exists", "value": "${ExeName}_Data" }
] },
"version": { "type": "pe_file_version", "from": "UnityPlayer.dll" }
"version": { "type": "unity_build" }
},
{
"id": "unreal",
@@ -70,7 +70,7 @@
{ "type": "sibling_glob", "value": "nw.dll" },
{ "type": "sibling_glob", "value": "package.json" }
] },
"version": null
"version": { "type": "rpgmaker_build" }
},
{
"id": "rpgmaker_rgss",
@@ -83,7 +83,7 @@
{ "type": "sibling_glob", "value": "*.rgss2a" },
{ "type": "sibling_glob", "value": "*.rgss3a" }
] },
"version": null
"version": { "type": "rpgmaker_build" }
},
{
"id": "re_engine",
@@ -109,7 +109,7 @@
{ "type": "sibling_glob", "value": "*.pck" },
{ "type": "strings_contains", "value": "Godot Engine v" }
] },
"version": { "type": "strings_regex", "value": "Godot Engine v(\\d+\\.\\d+[\\.\\d]*)" }
"version": { "type": "godot_build" }
},
{
"id": "gamemaker",
@@ -124,7 +124,7 @@
{ "type": "dir_exists", "value": "renpy" },
{ "type": "sibling_glob", "value": "*.rpa" }
] },
"version": null
"version": { "type": "renpy_build" }
},
{
"id": "cryengine",
@@ -223,7 +223,9 @@
{ "family": "EQU8", "match": "prefix", "values": [ "equ8" ],
"note": "Splitgate. Documented (SteamDB EQU8); module names unmeasured." },
{ "family": "Xigncode3", "match": "exact", "values": [ "x3.xem" ],
"note": "x3.xem is XIGNCODE3's loader, LoadLibrary'd as an ordinary module (documented). The files row names the same token in the install tree." }
"note": "x3.xem is XIGNCODE3's loader, LoadLibrary'd as an ordinary module (documented). The files row names the same token in the install tree." },
{ "family": "Anti-Cheat Expert", "match": "exact", "values": [ "ACE-Base64.dll" ],
"note": "ACE's user-mode module, MEASURED on disk 2026-10-13 in Wuthering Waves' AntiCheatExpert/ folder; that the game loads it is unmeasured. Exact, not prefix: 'ACE-' is four characters over a namespace we do not own. Appended, as every row since 2026-09-25." }
],
"drivers": [
{ "family": "Riot Vanguard", "match": "exact", "values": [ "vgk.sys" ], "scope": "machine" },
@@ -233,6 +235,8 @@
"note": "MEASURED 2026-08-04: EasyAntiCheat_EOSSys was Running as a kernel driver while a real EAC title played, and matched NOTHING in this group — the refusal came from the service check instead. A family caught through only one of five groups is one rename away from being missed." },
{ "family": "Anti-Cheat Expert", "match": "exact", "values": [ "ACE-BASE.sys", "ACE-ADVT.sys", "ACE-GAME.sys" ], "scope": "machine",
"note": "ACE-BASE.sys and ACE-ADVT.sys MEASURED under System32\\drivers on the dev machine 2026-08-04. ACE-GAME.sys is a documented sibling and is UNMEASURED: a blocklist may over-cover, never under-cover. Exact not prefix — 'ACE-' is four characters over a namespace we do not own." },
{ "family": "Anti-Cheat Expert", "match": "exact", "values": [ "ACE-CORE.sys" ], "scope": "machine",
"note": "On disk beside ACE-BASE.sys in Wuthering Waves' AntiCheatExpert/ folder (MEASURED 2026-10-13); that it loads is unmeasured. Exact, as the row above." },
{ "family": "BattlEye", "match": "exact", "values": [ "BEDaisy.sys" ], "scope": "machine",
"note": "BattlEye's kernel driver, loaded by BEService while a protected game runs and unloaded after (documented, BattlEye FAQ). Unmeasured." },
{ "family": "FACEIT", "match": "exact", "values": [ "FACEIT.sys" ], "scope": "machine",
@@ -262,7 +266,7 @@
{ "family": "Easy Anti-Cheat", "values": [ "EasyAntiCheat", "EasyAntiCheat_EOS" ] },
{ "family": "BattlEye", "values": [ "BattlEye" ] },
{ "family": "Anti-Cheat Expert", "values": [ "AntiCheatExpert", "AceAntibotClient" ],
"note": "Documented (SteamDB FileDetectionRuleSets, AntiCheatExpert). Unmeasured." },
"note": "Documented (SteamDB FileDetectionRuleSets). AntiCheatExpert MEASURED 2026-10-13 beside the executables of Wuthering Waves and Neverness To Everness, reached from the executable's own folder and never from the root. AceAntibotClient is unmeasured." },
{ "family": "nProtect GameGuard", "values": [ "GameGuard" ] },
{ "family": "Xigncode3", "values": [ "XIGNCODE", "XIGNCODE3" ] },
{ "family": "AhnLab HackShield", "values": [ "HShield" ],
@@ -278,8 +282,8 @@
{ "family": "Easy Anti-Cheat", "values": [ "EasyAntiCheat", "EasyAntiCheat_EOS", "EasyAntiCheat_EOSSys" ] },
{ "family": "Riot Vanguard", "values": [ "vgc", "vgk" ],
"note": "vgk is the kernel driver's service, started at boot like vgk.sys itself." },
{ "family": "Anti-Cheat Expert", "values": [ "AntiCheatExpert Protection", "AntiCheatExpert Service" ],
"note": "'AntiCheatExpert Protection' MEASURED registered on the dev machine 2026-08-04 by Neverness To Everness. The sibling name is unmeasured." },
{ "family": "Anti-Cheat Expert", "values": [ "AntiCheatExpert Protection", "AntiCheatExpert Service", "ACE-BASE" ],
"note": "'AntiCheatExpert Protection' MEASURED registered on the dev machine 2026-08-04 by Neverness To Everness; 'ACE-BASE', the kernel service of ACE-BASE.sys, MEASURED registered there 2026-10-13. 'AntiCheatExpert Service' is unmeasured." },
{ "family": "BattlEye", "values": [ "BEService", "BEDaisy" ],
"note": "BEService is started by a protected game and stops after it; BEDaisy is the driver's service. A stopped service is absent (19_SAFETY). Unmeasured." },
{ "family": "FACEIT", "values": [ "FACEIT", "FACEITService" ],
@@ -298,6 +302,8 @@
"note": "Shipped beside the game. This note said 'not a loadable module' until 2026-09-25: XIGNCODE3 LoadLibrary's x3.xem as its loader (documented), which is why the modules group names it too." },
{ "family": "Anti-Cheat Expert", "values": [ "PGameProtectDriver_X64.sys", "SGuard64.exe", "SGuardSvc64.exe" ],
"note": "A KERNEL DRIVER shipped inside the game install. MEASURED at 'Neverness To Everness/NTEGlobal/driver/' 2026-08-04, where check 4 returned Allow: no group named it, and the fuzzy tier is modules-only — so a name containing 'protect' sat in the game's tree and the static scan walked past." },
{ "family": "Anti-Cheat Expert", "values": [ "ACE-BASE.sys", "ACE-CORE.sys", "ACE-Base64.dll", "ACE-Service64.exe", "ACE-Setup64.exe" ],
"note": "MEASURED 2026-10-13 in Wuthering Waves' Client/Binaries/Win64/AntiCheatExpert/, beside its executable and four levels under its install root, which the walk from the root never opened: check 4 also walks the executable's own folder since then." },
{ "family": "Easy Anti-Cheat", "values": [ "EasyAntiCheat_EOS_Setup.exe", "EasyAntiCheat_Setup.exe", "EasyAntiCheat_x64.dll", "EasyAntiCheat_x86.dll", "EasyAntiCheat_EOS.sys", "start_protected_game.exe", "eac_server64.dll" ],
"note": "For a layout where the EasyAntiCheat folder sits deeper than the scan reaches. start_protected_game.exe is the EAC launcher FromSoftware titles ship (ELDEN RING's appeared in the owner's Windows Application log on 2026-09-21)." },
{ "family": "BattlEye", "values": [ "BEService.exe", "BEService_x64.exe", "BEClient.dll", "BEClient_x64.dll", "BEDaisy.sys" ],
@@ -418,6 +424,7 @@
{ "store": "steam", "id": "2139460", "family": "NetEase Anti-Cheat", "reason": "Protected by NetEase's kernel anti-cheat (NEAC)." },
{ "store": "steam", "id": "2507950", "family": "Anti-Cheat Expert", "reason": "Protected by Tencent Anti-Cheat Expert (ACE), a kernel anti-cheat." },
{ "store": "steam", "id": "2073620", "family": "Anti-Cheat Expert", "reason": "Protected by Tencent Anti-Cheat Expert (ACE), a kernel anti-cheat." },
{ "store": "steam", "id": "3513350", "family": "Anti-Cheat Expert", "reason": "Wuthering Waves, protected by Tencent Anti-Cheat Expert (ACE), a kernel anti-cheat." },
{ "store": "steam", "id": "1517290", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." },
{ "store": "steam", "id": "2807960", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." },
{ "store": "steam", "id": "2669320", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." },
+2 -2
View File
@@ -198,12 +198,12 @@
}
},
{
"$comment": "beta.10: Unreal Engine's build facts (the shipping executable's numeric file version and the engine's branch name inside it), decided in code (Domain.Detection.UnrealVersion) rather than by a pattern - which is why it takes no parameter.",
"$comment": "beta.10: Unreal Engine's build facts (the shipping executable's numeric file version and the engine's branch name inside it), decided in code (Domain.Detection.UnrealVersion) rather than by a pattern - which is why it takes no parameter. beta.19 adds Unity's (the player library's version resource, the data file's header), Godot's (a data pack's header, the executable's version resource) and RPG Maker's (MV/MZ's core-script header, the RGSS library Game.ini names), decided by UnityVersion, GodotVersion and RpgMakerVersion. beta.20 adds Ren'Py's (the version line of the engine's renpy/vc_version.py), decided by RenPyVersion.",
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": { "const": "unreal_build" }
"type": { "enum": ["unreal_build", "unity_build", "godot_build", "rpgmaker_build", "renpy_build"] }
}
}
]
@@ -147,6 +147,25 @@ internal static class AgentServices
services.AddSingleton<IDriverProfileSource>(static sp => sp.GetRequiredService<NvapiDriverProfileSource>());
}
/// <summary>
/// An entry whose game is no longer installed and that had no session goes (beta.19, D55): asked by the detection sweep after
/// the relocator, behind the user's switch, never while a session of it is recorded or waits to be recovered — the merge's
/// own busy test — and never for an entry carrying an anti-cheat block or exception (the delete's SQL checks again).
/// </summary>
private static void AddUninstalledEntryPrune(IServiceCollection services)
{
services.AddSingleton<IGamePrune>(static sp => new SqliteGamePrune(sp.GetRequiredService<LedgerDatabase>()));
services.AddSingleton<IExecutablePresence>(static _ => new ExecutablePresenceProbe(VolumeRoots.IsReady));
services.AddSingleton(static sp => new UninstalledEntryPrune(
sp.GetRequiredService<IGamePrune>(),
sp.GetRequiredService<IExecutablePresence>(),
ct => sp.GetRequiredService<RegisteredSettings>().GetBooleanAsync(SettingsRegistry.RetentionRemoveUninstalledGames, ct),
id => sp.GetRequiredService<CaptureOrchestrator>().IsRecording(id)
|| sp.GetRequiredService<IPartialSessionStore>().PendingGameIds().Contains(id),
static line => Serilog.Log.Information("{Line}", line),
sp.GetRequiredService<IIpcEventPublisher>()));
}
/// <summary>The static detection sweep (P4 PR-1, <c>05_DETECTION</c> §Caching): hosted under <c>--serve</c> only, composed and inert under <c>--console</c>.</summary>
private static void AddDetection(IServiceCollection services, AgentPaths paths)
{
@@ -168,13 +187,15 @@ internal static class AgentServices
merge: sp.GetRequiredService<IGameMerge>(),
busy: id => sp.GetRequiredService<CaptureOrchestrator>().IsRecording(id)
|| sp.GetRequiredService<IPartialSessionStore>().PendingGameIds().Contains(id)));
AddUninstalledEntryPrune(services);
services.AddSingleton(static sp => new DetectionSweep(
sp.GetRequiredService<IGameRepository>(),
sp.GetRequiredService<IDetectionRulesSource>(),
sp.GetRequiredService<IGameFileProbe>(),
sp.GetRequiredService<IExecutableIdentitySource>(),
static line => Serilog.Log.Information("{Line}", line),
sp.GetRequiredService<ExecutableRelocator>()));
sp.GetRequiredService<ExecutableRelocator>(),
sp.GetRequiredService<UninstalledEntryPrune>()));
// The anti-cheat pre-scan of the library (beta.8, 19_SAFETY §What a finding does to the game): every entry through
// the guard's advisory checks 3 and 4, again whenever the rules or the executable change. It waits while a session
@@ -39,10 +39,10 @@ internal sealed class DetectionHostedService(DetectionSweep sweep, VkLayerReconc
DetectionSweepReport r = await sweep.SweepOnceAsync(stoppingToken).ConfigureAwait(false);
// Said when something happened or changed (2026-09-23): an unreadable entry used to repeat this line every
// 15 s — 5,760 a day — with nothing new in it.
if (r.Scanned > 0 || r.Relocated > 0 || r.RulesUnusable || (r.Unreadable > 0 && r.Unreadable != previous?.Unreadable))
if (r.Scanned > 0 || r.Relocated > 0 || r.Removed > 0 || r.RulesUnusable || (r.Unreadable > 0 && r.Unreadable != previous?.Unreadable))
{
Log.Information("detect: sweep scanned {Scanned}, current {Current}, unreadable {Unreadable}{Rules}",
r.Scanned, r.Current, r.Unreadable, r.RulesUnusable ? ", rules unusable" : string.Empty);
Log.Information("detect: sweep scanned {Scanned}, current {Current}, unreadable {Unreadable}, removed {Removed}{Rules}",
r.Scanned, r.Current, r.Unreadable, r.Removed, r.RulesUnusable ? ", rules unusable" : string.Empty);
}
previous = r;
+4 -1
View File
@@ -110,6 +110,8 @@ public partial class App : System.Windows.Application
_host = BuildHost(_db, appearance, registered, closePolicy);
await _host.StartAsync().ConfigureAwait(true);
Log.Information("ui: started ({Version}), ledger {Ledger}", UiIdentity.Version, UiPaths.Database);
// beta.21: tier 0 is software rendering (a VM without a GPU, Remote Desktop) - every scroll drawn on the CPU.
Log.Information("ui: render tier {Tier} (2 = the GPU draws; 0 = software)", System.Windows.Media.RenderCapability.Tier >> 16);
if (UiPaths.IsViewer)
{
Log.Warning("ui: a VIEWER over {Folder} (--data-dir, D52): no Agent is started or contacted, nothing on this PC is changed", UiPaths.DataDirectory);
@@ -192,7 +194,8 @@ public partial class App : System.Windows.Application
Log.Warning(ex, "diag: the hardware could not be read; its lines are n/a");
}
string report = DiagReport.Build(UiIdentity.Version, UiPaths.DataDirectory, UiPaths.Logs, schema, values, new AgentLauncher().CanLaunch, now, hardware);
string report = DiagReport.Build(UiIdentity.Version, UiPaths.DataDirectory, UiPaths.Logs, schema, values, new AgentLauncher().CanLaunch, now, hardware,
System.Windows.Media.RenderCapability.Tier >> 16);
string path = DiagReport.Write(UiPaths.Logs, report, now);
await Console.Out.WriteLineAsync(string.Format(CultureInfo.CurrentCulture, Strings.Diag_Written_Format, path)).ConfigureAwait(true);
Log.Information("ui: --diag written to {Path}", path);
@@ -97,9 +97,8 @@ public partial class DocumentBrowser : UserControl
private void ShowPage(DocumentPage? page)
{
View.DocumentPath = page?.Path;
View.IsPlainText = page?.IsPlainText ?? false;
View.MarkdownText = page?.Text ?? string.Empty;
// One render, now (beta.21): the three properties one by one rendered the old text under the new path first.
View.Show(page?.Text ?? string.Empty, page?.IsPlainText ?? false, page?.Path);
AutomationProperties.SetName(View, page?.Title ?? string.Empty);
PageChanged?.Invoke(this, EventArgs.Empty);
}
+244 -7
View File
@@ -4,7 +4,10 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Navigation;
using System.Windows.Threading;
using FrameLedger.App.Markdown;
using FrameLedger.App.Services;
@@ -18,8 +21,32 @@ namespace FrameLedger.App.Controls;
/// (<see cref="RepositoryLinkRequested"/>), which shows it when the App embeds it, and otherwise opens on GitHub at this
/// build's source (<see cref="RepositoryLinks"/>); anything else is not followed.
/// </summary>
/// <remarks>
/// <para>
/// <b>The wheel (beta.21, owner request 2026-10-13: "scrolling the documents is slow").</b> WPF's scroll viewer moves a
/// fixed 48 DIP per wheel message, whatever its delta — about two and a half lines of body text, Windows' "lines to
/// scroll" ignored, and a precision touchpad's small deltas each jumping the whole step (measured: −1, −15, −120 and −360
/// all moved 48). Layout costs about a millisecond a step, so the step was the problem, not drawing. The view now moves
/// <see cref="WheelStep"/>: the delta in proportion, Windows' lines per notch at a browser's line (100/3 DIP), scaled by
/// the zoom — and eases there over about 120 ms unless Windows' animations are off. At either end it leaves the wheel
/// unhandled, so whatever holds the view (the update notes' dialog) scrolls instead. Ctrl+wheel stays the zoom.
/// </para>
/// <para>
/// <b>One render per page.</b> Each of the three properties rendered the whole document on its own, so a page change
/// rendered the old text under the new path first, and the Legal Gate's three bindings rendered three times. Property
/// changes now ask for one render, posted to the dispatcher ahead of layout; <see cref="Show"/> sets all three and renders
/// at once; and a document this view has rendered is kept (<see cref="CacheCapacity"/>), so going back to a page costs
/// its layout and nothing else.
/// </para>
/// </remarks>
public sealed class MarkdownView : FlowDocumentScrollViewer
{
/// <summary>A line of the wheel's step: Chromium scrolls 100 DIP for Windows' default three lines at 100%.</summary>
internal const double WheelLineDip = 100.0 / 3.0;
/// <summary>How many rendered documents one view keeps (the user guide has twelve pages and Limitations).</summary>
internal const int CacheCapacity = 16;
public static readonly DependencyProperty MarkdownTextProperty =
DependencyProperty.Register(nameof(MarkdownText), typeof(string), typeof(MarkdownView), new PropertyMetadata(null, OnSourceChanged));
@@ -29,7 +56,18 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
public static readonly DependencyProperty DocumentPathProperty =
DependencyProperty.Register(nameof(DocumentPath), typeof(string), typeof(MarkdownView), new PropertyMetadata(null, OnSourceChanged));
private readonly Dictionary<RenderKey, RenderedMarkdown> _cache = [];
private readonly LinkedList<RenderKey> _recent = new();
private IReadOnlyDictionary<string, Block> _anchors = new Dictionary<string, Block>(StringComparer.Ordinal);
private RenderKey? _shown;
private bool _batching;
private DispatcherOperation? _pending;
private ScrollViewer? _scroller;
private double _wheelTarget = double.NaN;
private double _lastSetOffset = double.NaN;
private TimeSpan _lastFrame;
private bool _easing;
public MarkdownView()
{
@@ -38,7 +76,8 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
Focusable = true;
AddHandler(Hyperlink.RequestNavigateEvent, new RequestNavigateEventHandler(OnRequestNavigate));
Rebuild();
Unloaded += (_, _) => StopEasing();
RenderNow();
}
/// <summary>A link to another file of the repository; the host shows it and sets Handled, or it opens on GitHub.</summary>
@@ -69,31 +108,226 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
public IUrlOpener UrlOpener { get; set; } = new ShellUrlOpener();
/// <summary>The headings this document can scroll to, by anchor.</summary>
public IReadOnlyCollection<string> Anchors => [.. _anchors.Keys];
public IReadOnlyCollection<string> Anchors
{
get
{
RenderIfPending();
return [.. _anchors.Keys];
}
}
/// <summary>How many documents this view has rendered from text — a cache hit is not one (for tests).</summary>
internal int Renders { get; private set; }
/// <summary>Where the wheel is taking the view, or NaN when it is not easing it there (for tests).</summary>
internal double ScrollTarget => _wheelTarget;
/// <summary>The template's scroll viewer, once the template is applied (for tests).</summary>
internal ScrollViewer? Scroller => _scroller;
/// <summary>The modifier keys held, read when the wheel turns; a test gives its own rather than the real keyboard's.</summary>
internal Func<ModifierKeys> CurrentModifiers { get; set; } = static () => Keyboard.Modifiers;
/// <summary>Windows' "lines to scroll" per notch (−1: a screen); a test gives its own.</summary>
internal Func<int> WheelScrollLines { get; set; } = static () => SystemParameters.WheelScrollLines;
/// <summary>Whether the wheel eases to its target; off where Windows' animations are, and in tests.</summary>
internal bool EaseWheel { get; set; } = SystemParameters.ClientAreaAnimation;
/// <summary>Shows a document: the three properties at once, rendered once, now.</summary>
public void Show(string? text, bool isPlainText, string? path)
{
_batching = true;
try
{
DocumentPath = path;
IsPlainText = isPlainText;
MarkdownText = text;
}
finally
{
_batching = false;
}
RenderNow();
}
/// <summary>Brings the heading with <paramref name="anchor"/> into view; whether the document has it.</summary>
public bool ScrollTo(string anchor)
{
ArgumentNullException.ThrowIfNull(anchor);
RenderIfPending();
if (!_anchors.TryGetValue(anchor, out Block? block))
{
return false;
}
StopEasing();
block.BringIntoView();
return true;
}
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((MarkdownView)d).Rebuild();
private void Rebuild()
/// <summary>
/// The distance one wheel message moves the view, in DIP (positive: down). <paramref name="delta"/> in proportion (120 is a
/// notch); <paramref name="wheelScrollLines"/> lines per notch at <see cref="WheelLineDip"/>, or a screen
/// (<paramref name="viewportHeight"/>) when Windows says −1; scaled by <paramref name="zoomPercent"/>.
/// </summary>
internal static double WheelStep(int delta, int wheelScrollLines, double viewportHeight, double zoomPercent)
{
string text = MarkdownText ?? string.Empty;
RenderedMarkdown rendered = IsPlainText ? MarkdownRenderer.RenderPlainText(text) : MarkdownRenderer.Render(text, DocumentPath);
double notches = delta / 120.0;
double perNotch = wheelScrollLines < 0 ? viewportHeight : wheelScrollLines * WheelLineDip * zoomPercent / 100.0;
return -notches * perNotch;
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
StopEasing();
_scroller = GetTemplateChild("PART_ContentHost") as ScrollViewer;
}
protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
{
ArgumentNullException.ThrowIfNull(e);
base.OnPreviewMouseWheel(e);
if (e.Handled || _scroller is not { } scroller || (CurrentModifiers() & ModifierKeys.Control) != ModifierKeys.None)
{
return; // Ctrl+wheel is the zoom
}
double step = WheelStep(e.Delta, WheelScrollLines(), scroller.ViewportHeight, Zoom);
if (step == 0 || double.IsNaN(step))
{
return;
}
double from = double.IsNaN(_wheelTarget) ? scroller.VerticalOffset : _wheelTarget;
double to = Math.Clamp(from + step, 0, scroller.ScrollableHeight);
if (Math.Abs(to - scroller.VerticalOffset) < 0.5 && double.IsNaN(_wheelTarget))
{
return; // at the end it would move toward: the wheel is the host's
}
e.Handled = true;
if (!EaseWheel)
{
scroller.ScrollToVerticalOffset(to);
return;
}
_wheelTarget = to;
if (!_easing)
{
_easing = true;
_lastFrame = TimeSpan.Zero;
_lastSetOffset = scroller.VerticalOffset;
CompositionTarget.Rendering += OnRendering;
}
}
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((MarkdownView)d).RequestRender();
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD001:Avoid legacy thread switching APIs", Justification = "a WPF application has no JoinableTaskFactory; this posts to the view's own dispatcher from its own thread, at a priority ahead of layout, and never waits (ScrollBarHiding does the same)")]
private void RequestRender()
{
if (_batching || _pending is not null)
{
return;
}
// Ahead of layout, after whatever is setting the other properties has set them.
_pending = Dispatcher.InvokeAsync(RenderIfPending, DispatcherPriority.DataBind);
}
private void RenderIfPending()
{
if (_pending is null)
{
return;
}
RenderNow();
}
private void RenderNow()
{
if (_pending is { } pending)
{
_ = pending.Abort();
_pending = null;
}
var key = new RenderKey(DocumentPath, IsPlainText, MarkdownText ?? string.Empty);
if (_shown is { } shown && shown.Equals(key))
{
return;
}
if (!_cache.TryGetValue(key, out RenderedMarkdown? rendered))
{
rendered = key.IsPlainText ? MarkdownRenderer.RenderPlainText(key.Text) : MarkdownRenderer.Render(key.Text, key.Path);
Renders++;
_cache[key] = rendered;
}
else
{
_ = _recent.Remove(key);
}
_ = _recent.AddFirst(key);
while (_recent.Count > CacheCapacity && _recent.Last is { } oldest)
{
_ = _cache.Remove(oldest.Value);
_recent.RemoveLast();
}
StopEasing();
_anchors = rendered.Anchors;
_shown = key;
Document = rendered.Document;
}
private void OnRendering(object? sender, EventArgs e)
{
if (_scroller is not { } scroller || double.IsNaN(_wheelTarget))
{
StopEasing();
return;
}
// Something else moved the view since the last frame (the scroll bar, the keyboard, a link): it is theirs now.
if (Math.Abs(scroller.VerticalOffset - _lastSetOffset) > 1)
{
StopEasing();
return;
}
TimeSpan now = (e as RenderingEventArgs)?.RenderingTime ?? TimeSpan.Zero;
double elapsedMs = _lastFrame == TimeSpan.Zero ? 16 : Math.Clamp((now - _lastFrame).TotalMilliseconds, 1, 100);
_lastFrame = now;
// Exponential ease-out: about 95% of the way in 120 ms, however many notches have been added on the way.
double remaining = _wheelTarget - scroller.VerticalOffset;
double next = Math.Abs(remaining) < 0.5 ? _wheelTarget : scroller.VerticalOffset + (remaining * (1 - Math.Exp(-elapsedMs / 40.0)));
scroller.ScrollToVerticalOffset(next);
_lastSetOffset = next;
if (next == _wheelTarget)
{
StopEasing();
}
}
private void StopEasing()
{
_wheelTarget = double.NaN;
if (_easing)
{
_easing = false;
CompositionTarget.Rendering -= OnRendering;
}
}
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
e.Handled = true;
@@ -116,4 +350,7 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
_ = ScrollTo(anchor);
}
}
/// <summary>What a rendered document depends on: theme and language are not in it — its colours are resource references.</summary>
private readonly record struct RenderKey(string? Path, bool IsPlainText, string Text);
}
@@ -233,7 +233,7 @@ public static class MarkdownRenderer
int columns = Math.Max(table.ColumnDefinitions.Count, rows.Select(static r => r.Count).DefaultIfEmpty(0).Max());
for (int i = 0; i < columns; i++)
{
wpf.Columns.Add(new TableColumn { Width = GridLength.Auto });
wpf.Columns.Add(new TableColumn()); // WPF's default width is already Auto (read by reflection, beta.21)
}
var group = new TableRowGroup();
@@ -74,7 +74,7 @@
<StackPanel>
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static vm:GameDetailViewModel.SupportsHeader}" />
<ui:TextBlock Margin="0,6,0,0" Style="{StaticResource TertiaryText}" TextWrapping="Wrap"
Text="{x:Static vm:GameDetailViewModel.SupportsEmptyText}"
Text="{Binding ViewModel.SupportsEmptyText}"
Visibility="{Binding ViewModel.SupportsEmpty, Converter={StaticResource BoolToVis}}" />
<ItemsControl Margin="0,6,0,0" ItemsSource="{Binding ViewModel.Supports}">
<ItemsControl.ItemsPanel>
+13 -1
View File
@@ -219,7 +219,19 @@
<!-- beta.11 (owner request 2026-10-03: no row without a control): Data - Delete all sessions (D40). -->
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Data_Header}" />
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Delete24}">
<!-- beta.19 (owner decision D55): the Agent removes an entry whose game is no longer installed and that has no session. -->
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon BoxDismiss24}">
<ui:CardControl.Header>
<StackPanel>
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_RemoveUninstalled_Label}" />
<ui:TextBlock MaxWidth="560" HorizontalAlignment="Left" Style="{StaticResource SecondaryText}" Text="{x:Static res:Strings.Settings_RemoveUninstalled_Body}" TextWrapping="Wrap" />
</StackPanel>
</ui:CardControl.Header>
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_RemoveUninstalled_Label}"
IsChecked="{Binding ViewModel.RemoveUninstalledGames, Mode=TwoWay}"
IsEnabled="{Binding ViewModel.ActsOnThisPc}" />
</ui:CardControl>
<ui:CardControl Margin="0,8,0,0" Icon="{ui:SymbolIcon Delete24}">
<ui:CardControl.Header>
<StackPanel>
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_DeleteSessions_Label}" />
+4 -1
View File
@@ -26,7 +26,8 @@ public static class DiagReport
}
/// <summary>The report text. <paramref name="settings"/> is every registry key's effective value; <paramref name="schemaVersion"/> null when the ledger could not be opened.</summary>
public static string Build(string appVersion, string dataDirectory, string logsDirectory, long? schemaVersion, IReadOnlyDictionary<string, string> settings, bool agentBesideApp, DateTimeOffset now, HardwareSnapshot? hardware = null)
public static string Build(string appVersion, string dataDirectory, string logsDirectory, long? schemaVersion, IReadOnlyDictionary<string, string> settings, bool agentBesideApp, DateTimeOffset now, HardwareSnapshot? hardware = null,
int? renderTier = null)
{
ArgumentNullException.ThrowIfNull(settings);
var sb = new StringBuilder();
@@ -48,6 +49,8 @@ public static class DiagReport
sb.AppendLine(CultureInfo.InvariantCulture, $"gpu_driver: {hardware?.GpuDriver ?? "n/a"}");
sb.AppendLine(CultureInfo.InvariantCulture, $"ram_gb: {(hardware?.RamGb is double gb ? gb.ToString("0.#", CultureInfo.InvariantCulture) : "n/a")}");
sb.AppendLine(CultureInfo.InvariantCulture, $"display: {hardware?.DisplayRes ?? "n/a"}{(hardware?.DisplayHz is double hz ? " @ " + hz.ToString("0.#", CultureInfo.InvariantCulture) + " Hz" : string.Empty)}");
// beta.21: WPF's rendering tier — 0 is software rendering, where every scroll of a document is drawn on the CPU.
sb.AppendLine(CultureInfo.InvariantCulture, $"render_tier: {(renderTier is int tier ? tier.ToString(CultureInfo.InvariantCulture) : "n/a")}");
sb.AppendLine("settings:");
foreach (SettingDefinition definition in SettingsRegistry.All)
{
+32
View File
@@ -202,6 +202,38 @@ public static class Formats
_ => id,
};
/// <summary>
/// The engine's name as its version's witness names it (beta.19): each RPG Maker rule covers several makers, and the
/// file the version was read from says which — MZ's or MV's core script, an RGSS1, RGSS2 or RGSS3 library (XP, VX,
/// VX Ace). Any other engine, or no witness, is <see cref="Engine(string?)"/>.
/// </summary>
public static string Engine(string? id, string? versionSource) => (id, versionSource) switch
{
("rpgmaker_mv", EngineVersionSource.RpgMakerMzCore) => "RPG Maker MZ",
("rpgmaker_mv", EngineVersionSource.RpgMakerMvCore) => "RPG Maker MV",
("rpgmaker_rgss", EngineVersionSource.Rgss1Library) => "RPG Maker XP",
("rpgmaker_rgss", EngineVersionSource.Rgss2Library) => "RPG Maker VX",
("rpgmaker_rgss", EngineVersionSource.Rgss3Library) => "RPG Maker VX Ace",
_ => Engine(id),
};
/// <summary>
/// The engine and its version as one text (beta.19): "Unreal Engine 5.4.4", "Unity 2022.3.39f1", "Godot 4.4.1", "RPG Maker
/// MZ 1.10.0" — and "RPG Maker VX Ace (RGSS 3.0.1)", whose number is its runtime library's, not the maker's.
/// </summary>
public static string EngineWithVersion(string? id, string? version, string? versionSource)
{
string name = Engine(id, versionSource);
if (id is null || string.IsNullOrWhiteSpace(version))
{
return name;
}
return versionSource is EngineVersionSource.Rgss1Library or EngineVersionSource.Rgss2Library or EngineVersionSource.Rgss3Library
? string.Create(CultureInfo.InvariantCulture, $"{name} (RGSS {version})")
: string.Create(CultureInfo.InvariantCulture, $"{name} {version}");
}
/// <summary>What an executable runs as (<c>games.exe_machine</c>, beta.8), in the user's language.</summary>
public static string Architecture(string? id) => id switch
{
@@ -0,0 +1,76 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.IO;
using FrameLedger.Infrastructure.Detection;
namespace FrameLedger.App.Services;
/// <summary>
/// The folder Change executable… opens in (beta.19, owner request 2026-10-12): the game's own root folder rather than
/// wherever Windows' dialog was last — the pick is almost always another file of the same install.
/// </summary>
/// <remarks>
/// <para>
/// The root is <see cref="InstallRoot.Resolve"/>'s — the folder a store boundary names (<c>steamapps\common\X</c>,
/// <c>GOG Galaxy\Games\X</c>, <c>Epic Games\X</c>, <c>GamesInstalled\X</c>) — and, where no boundary is recognised, out of
/// an Unreal package's <c>&lt;root&gt;\&lt;Project&gt;\Binaries\Win64</c> to <c>&lt;root&gt;</c>, else the executable's own
/// folder. Only the row's path is stored (no install folder), so this is derived, never remembered.
/// </para>
/// <para>
/// An entry whose folder is gone (*Not installed*) opens at the nearest folder above it that is still there; an entry on a
/// drive that is not connected gets null, and the dialog opens where Windows last was. It asks the file system, so its
/// caller runs it off the UI thread: a share that went away can take seconds to answer.
/// </para>
/// </remarks>
public static class GameFolder
{
/// <summary>The folder to open the pick in for an entry at <paramref name="exePath"/>, or null when there is none.</summary>
public static string? StartFolder(string exePath)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
string full;
try
{
full = Path.GetFullPath(exePath);
}
catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
{
return null;
}
string? drive = Path.GetPathRoot(full);
if (string.IsNullOrEmpty(drive) || !Directory.Exists(drive))
{
return null;
}
string exeDirectory = Path.GetDirectoryName(full) ?? drive;
string root = InstallRoot.Resolve(full);
if (string.Equals(root, exeDirectory, StringComparison.OrdinalIgnoreCase) && UnrealRoot(exeDirectory) is { } unreal)
{
root = unreal;
}
for (string? folder = root; !string.IsNullOrEmpty(folder); folder = Path.GetDirectoryName(folder))
{
if (Directory.Exists(folder))
{
return folder;
}
}
return drive;
}
/// <summary><c>&lt;root&gt;\&lt;Project&gt;\Binaries\Win64</c> (or <c>WinGDK</c>) → <c>&lt;root&gt;</c>; null for any other folder.</summary>
private static string? UnrealRoot(string exeDirectory)
{
string platform = Path.GetFileName(exeDirectory);
string? binaries = Path.GetDirectoryName(exeDirectory);
bool unreal = (string.Equals(platform, "Win64", StringComparison.OrdinalIgnoreCase) || string.Equals(platform, "WinGDK", StringComparison.OrdinalIgnoreCase))
&& binaries is not null && string.Equals(Path.GetFileName(binaries), "Binaries", StringComparison.OrdinalIgnoreCase);
string? project = unreal ? Path.GetDirectoryName(binaries) : null;
return project is null ? null : Path.GetDirectoryName(project);
}
}
+9 -1
View File
@@ -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.IO;
using Microsoft.Win32;
namespace FrameLedger.App.Services;
@@ -8,7 +9,7 @@ namespace FrameLedger.App.Services;
/// <summary>The WPF <see cref="OpenFileDialog"/> for FR-1.1.</summary>
public sealed class GamePicker : IGamePicker
{
public string? PickExecutable()
public string? PickExecutable(string? initialDirectory = null)
{
var dialog = new OpenFileDialog
{
@@ -17,6 +18,13 @@ public sealed class GamePicker : IGamePicker
CheckFileExists = true,
Multiselect = false,
};
// InitialDirectory opens the dialog there whatever folder it remembers (DefaultDirectory would only be a fallback).
if (!string.IsNullOrEmpty(initialDirectory) && Directory.Exists(initialDirectory))
{
dialog.InitialDirectory = initialDirectory;
}
return dialog.ShowDialog() == true ? dialog.FileName : null;
}
}
+5 -1
View File
@@ -7,5 +7,9 @@ namespace FrameLedger.App.Services;
public interface IGamePicker
{
/// <summary>The chosen executable's full path, or null when the user cancelled.</summary>
string? PickExecutable();
/// <param name="initialDirectory">
/// The folder the dialog opens in (beta.19: Change executable… opens in the game's own folder, <see cref="GameFolder"/>);
/// null leaves it to Windows, which opens where the last pick was.
/// </param>
string? PickExecutable(string? initialDirectory = null);
}
+54
View File
@@ -446,8 +446,18 @@ public static class Strings
nameof(GameDetail_Edit),
nameof(GameDetail_EngineVersion_Branch),
nameof(GameDetail_EngineVersion_BranchAndFile),
nameof(GameDetail_EngineVersion_CoreScript_Format),
nameof(GameDetail_EngineVersion_FileVersion),
nameof(GameDetail_EngineVersion_GodotExe),
nameof(GameDetail_EngineVersion_GodotPack),
nameof(GameDetail_EngineVersion_GodotPackEmbedded),
nameof(GameDetail_EngineVersion_NotFound),
nameof(GameDetail_EngineVersion_NotFoundInFiles),
nameof(GameDetail_EngineVersion_RenPyVcVersion),
nameof(GameDetail_EngineVersion_Rgss),
nameof(GameDetail_EngineVersion_UnityData),
nameof(GameDetail_EngineVersion_UnityPlayer),
nameof(GameDetail_EngineVersion_UnityPlayerFile),
nameof(GameDetail_Exception_Grant),
nameof(GameDetail_Exception_Granted_Format),
nameof(GameDetail_Exception_Header),
@@ -478,6 +488,7 @@ public static class Strings
nameof(GameDetail_Supports_Empty),
nameof(GameDetail_Supports_Format),
nameof(GameDetail_Supports_Header),
nameof(GameDetail_Supports_None),
nameof(GameDetail_Tab_Distribution),
nameof(GameDetail_Tab_Frametime),
nameof(GameDetail_Tab_Latency),
@@ -510,6 +521,10 @@ public static class Strings
nameof(Games_NoMatch),
nameof(Games_Refresh),
nameof(Games_Refresh_ToolTip),
nameof(Games_Removed_Format),
nameof(Games_Removed_Many_Format),
nameof(Games_Removed_More_Format),
nameof(Games_Removed_Title),
nameof(Games_Search_Placeholder),
nameof(Games_Sort_Label),
nameof(Games_Sort_LastPlayed),
@@ -830,6 +845,9 @@ public static class Strings
nameof(Settings_OnlineMetadata_Label),
nameof(Settings_Policy_Header),
nameof(Settings_Privacy_Header),
nameof(Settings_RemoveUninstalled_Applied),
nameof(Settings_RemoveUninstalled_Body),
nameof(Settings_RemoveUninstalled_Label),
nameof(Settings_Retention_Body),
nameof(Settings_Retention_Label),
nameof(Settings_SafetyDocs),
@@ -1894,10 +1912,30 @@ public static class Strings
public static string GameDetail_EngineVersion_BranchAndFile => ResourceManager.GetString(nameof(GameDetail_EngineVersion_BranchAndFile), Culture) ?? nameof(GameDetail_EngineVersion_BranchAndFile);
public static string GameDetail_EngineVersion_CoreScript_Format => ResourceManager.GetString(nameof(GameDetail_EngineVersion_CoreScript_Format), Culture) ?? nameof(GameDetail_EngineVersion_CoreScript_Format);
public static string GameDetail_EngineVersion_FileVersion => ResourceManager.GetString(nameof(GameDetail_EngineVersion_FileVersion), Culture) ?? nameof(GameDetail_EngineVersion_FileVersion);
public static string GameDetail_EngineVersion_GodotExe => ResourceManager.GetString(nameof(GameDetail_EngineVersion_GodotExe), Culture) ?? nameof(GameDetail_EngineVersion_GodotExe);
public static string GameDetail_EngineVersion_GodotPack => ResourceManager.GetString(nameof(GameDetail_EngineVersion_GodotPack), Culture) ?? nameof(GameDetail_EngineVersion_GodotPack);
public static string GameDetail_EngineVersion_GodotPackEmbedded => ResourceManager.GetString(nameof(GameDetail_EngineVersion_GodotPackEmbedded), Culture) ?? nameof(GameDetail_EngineVersion_GodotPackEmbedded);
public static string GameDetail_EngineVersion_NotFound => ResourceManager.GetString(nameof(GameDetail_EngineVersion_NotFound), Culture) ?? nameof(GameDetail_EngineVersion_NotFound);
public static string GameDetail_EngineVersion_NotFoundInFiles => ResourceManager.GetString(nameof(GameDetail_EngineVersion_NotFoundInFiles), Culture) ?? nameof(GameDetail_EngineVersion_NotFoundInFiles);
public static string GameDetail_EngineVersion_RenPyVcVersion => ResourceManager.GetString(nameof(GameDetail_EngineVersion_RenPyVcVersion), Culture) ?? nameof(GameDetail_EngineVersion_RenPyVcVersion);
public static string GameDetail_EngineVersion_Rgss => ResourceManager.GetString(nameof(GameDetail_EngineVersion_Rgss), Culture) ?? nameof(GameDetail_EngineVersion_Rgss);
public static string GameDetail_EngineVersion_UnityData => ResourceManager.GetString(nameof(GameDetail_EngineVersion_UnityData), Culture) ?? nameof(GameDetail_EngineVersion_UnityData);
public static string GameDetail_EngineVersion_UnityPlayer => ResourceManager.GetString(nameof(GameDetail_EngineVersion_UnityPlayer), Culture) ?? nameof(GameDetail_EngineVersion_UnityPlayer);
public static string GameDetail_EngineVersion_UnityPlayerFile => ResourceManager.GetString(nameof(GameDetail_EngineVersion_UnityPlayerFile), Culture) ?? nameof(GameDetail_EngineVersion_UnityPlayerFile);
public static string GameDetail_Exception_Grant => ResourceManager.GetString(nameof(GameDetail_Exception_Grant), Culture) ?? nameof(GameDetail_Exception_Grant);
public static string GameDetail_Exception_Granted_Format => ResourceManager.GetString(nameof(GameDetail_Exception_Granted_Format), Culture) ?? nameof(GameDetail_Exception_Granted_Format);
@@ -1958,6 +1996,8 @@ public static class Strings
public static string GameDetail_Supports_Header => ResourceManager.GetString(nameof(GameDetail_Supports_Header), Culture) ?? nameof(GameDetail_Supports_Header);
public static string GameDetail_Supports_None => ResourceManager.GetString(nameof(GameDetail_Supports_None), Culture) ?? nameof(GameDetail_Supports_None);
public static string GameDetail_Tab_Distribution => ResourceManager.GetString(nameof(GameDetail_Tab_Distribution), Culture) ?? nameof(GameDetail_Tab_Distribution);
public static string GameDetail_Tab_Frametime => ResourceManager.GetString(nameof(GameDetail_Tab_Frametime), Culture) ?? nameof(GameDetail_Tab_Frametime);
@@ -2022,6 +2062,14 @@ public static class Strings
public static string Games_Refresh_ToolTip => ResourceManager.GetString(nameof(Games_Refresh_ToolTip), Culture) ?? nameof(Games_Refresh_ToolTip);
public static string Games_Removed_Format => ResourceManager.GetString(nameof(Games_Removed_Format), Culture) ?? nameof(Games_Removed_Format);
public static string Games_Removed_Many_Format => ResourceManager.GetString(nameof(Games_Removed_Many_Format), Culture) ?? nameof(Games_Removed_Many_Format);
public static string Games_Removed_More_Format => ResourceManager.GetString(nameof(Games_Removed_More_Format), Culture) ?? nameof(Games_Removed_More_Format);
public static string Games_Removed_Title => ResourceManager.GetString(nameof(Games_Removed_Title), Culture) ?? nameof(Games_Removed_Title);
public static string Games_Search_Placeholder => ResourceManager.GetString(nameof(Games_Search_Placeholder), Culture) ?? nameof(Games_Search_Placeholder);
public static string Games_Sort_Label => ResourceManager.GetString(nameof(Games_Sort_Label), Culture) ?? nameof(Games_Sort_Label);
@@ -2662,6 +2710,12 @@ public static class Strings
public static string Settings_Privacy_Header => ResourceManager.GetString(nameof(Settings_Privacy_Header), Culture) ?? nameof(Settings_Privacy_Header);
public static string Settings_RemoveUninstalled_Applied => ResourceManager.GetString(nameof(Settings_RemoveUninstalled_Applied), Culture) ?? nameof(Settings_RemoveUninstalled_Applied);
public static string Settings_RemoveUninstalled_Body => ResourceManager.GetString(nameof(Settings_RemoveUninstalled_Body), Culture) ?? nameof(Settings_RemoveUninstalled_Body);
public static string Settings_RemoveUninstalled_Label => ResourceManager.GetString(nameof(Settings_RemoveUninstalled_Label), Culture) ?? nameof(Settings_RemoveUninstalled_Label);
public static string Settings_Retention_Body => ResourceManager.GetString(nameof(Settings_Retention_Body), Culture) ?? nameof(Settings_Retention_Body);
public static string Settings_Retention_Label => ResourceManager.GetString(nameof(Settings_Retention_Label), Culture) ?? nameof(Settings_Retention_Label);
+72
View File
@@ -2025,6 +2025,34 @@
<value>データ</value>
<comment>review</comment>
</data>
<data name="Settings_RemoveUninstalled_Label" xml:space="preserve">
<value>アンインストールされたゲームを削除</value>
<comment>review</comment>
</data>
<data name="Settings_RemoveUninstalled_Body" xml:space="preserve">
<value>接続されているドライブから実行ファイルが 10 分間なくなっているゲームを、ライブラリから削除します。セッションが 1 つもない場合に限り、アンチチートが見つかったゲームは削除しません。オフにすると、ゲームは「未インストール」のまま残ります。</value>
<comment>review</comment>
</data>
<data name="Settings_RemoveUninstalled_Applied" xml:space="preserve">
<value>適用しました。キャプチャエージェントは 15 秒以内に読み込みます。</value>
<comment>review</comment>
</data>
<data name="Games_Removed_Title" xml:space="preserve">
<value>ライブラリから削除しました</value>
<comment>review</comment>
</data>
<data name="Games_Removed_Format" xml:space="preserve">
<value>{0} はインストールされておらずセッションもないため、キャプチャエージェントが削除しました。「設定 ▸ データ」でオフにできます。</value>
<comment>review</comment>
</data>
<data name="Games_Removed_Many_Format" xml:space="preserve">
<value>{0} 本のゲームはインストールされておらずセッションもないため、キャプチャエージェントが削除しました: {1}。「設定 ▸ データ」でオフにできます。</value>
<comment>review</comment>
</data>
<data name="Games_Removed_More_Format" xml:space="preserve">
<value>{0} ほか {1} 本</value>
<comment>review</comment>
</data>
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
<value>すべてのセッションを削除</value>
<comment>review</comment>
@@ -2921,6 +2949,46 @@
<value>ゲームの実行ファイル内に見つかりません。実行ファイルが圧縮・保護されているか、スタジオがエンジンのビルド名を変更している可能性があります。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_UnityPlayer" xml:space="preserve">
<value>ゲームの Unity プレーヤーライブラリ(UnityPlayer.dll)のバージョンから。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_UnityData" xml:space="preserve">
<value>ゲームの Unity データファイル(globalgamemanagers)の先頭から。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_UnityPlayerFile" xml:space="preserve">
<value>Unity プレーヤーライブラリのバージョン番号のみから。リリースを示す文字(f1 など)はそこに記録されていません。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_GodotPack" xml:space="preserve">
<value>ゲームの Godot データパック(.pck)の先頭から。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_GodotPackEmbedded" xml:space="preserve">
<value>ゲームの実行ファイルに含まれる Godot データパックの先頭から。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_GodotExe" xml:space="preserve">
<value>Godot がゲームの実行ファイルに残したバージョン情報から。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_CoreScript_Format" xml:space="preserve">
<value>ゲームの {0} の最初の行から。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
<value>ゲームの Game.ini が指定する RPG Maker のランタイムライブラリ(RGSS)から。この番号はエディターではなくライブラリのものです。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_RenPyVcVersion" xml:space="preserve">
<value>ゲームの Ren'Py エンジンのバージョンファイル(renpy/vc_version.py)から。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
<value>ゲームのファイルには見つかりません。</value>
<comment>review</comment>
</data>
<data name="GameDetail_Details_Libraries" xml:space="preserve">
<value>同梱ライブラリ</value>
<comment>review</comment>
@@ -4149,4 +4217,8 @@
<value>{0} は FrameLedger 自身のデータ フォルダーです。--data-dir はそのコピー用で、テスト ビルドが記録先のデータベースを開かないようにするためのものです。このフォルダーを使うには --data-dir を付けずに FrameLedger を起動してください。</value>
<comment>review</comment>
</data>
<data name="GameDetail_Supports_None" xml:space="preserve">
<value>見つかりません — ゲームのフォルダーには、ルールが挙げるアップスケーラー、フレーム生成、Vulkan のファイルがありません。</value>
<comment>review</comment>
</data>
</root>
+54
View File
@@ -1524,6 +1524,27 @@
<data name="Settings_Data_Header" xml:space="preserve">
<value>Data</value>
</data>
<data name="Settings_RemoveUninstalled_Label" xml:space="preserve">
<value>Remove uninstalled games</value>
</data>
<data name="Settings_RemoveUninstalled_Body" xml:space="preserve">
<value>A game whose executable has been gone for ten minutes, from a drive that is connected, is removed from the library — only when it has no sessions, and never one where anti-cheat was found. Off, it stays and reads Not installed.</value>
</data>
<data name="Settings_RemoveUninstalled_Applied" xml:space="preserve">
<value>Applied. The capture agent reads it within 15 seconds.</value>
</data>
<data name="Games_Removed_Title" xml:space="preserve">
<value>Removed from the library</value>
</data>
<data name="Games_Removed_Format" xml:space="preserve">
<value>{0} is no longer installed and had no sessions, so the capture agent removed it. Settings ▸ Data turns this off.</value>
</data>
<data name="Games_Removed_Many_Format" xml:space="preserve">
<value>{0} games are no longer installed and had no sessions, so the capture agent removed them: {1}. Settings ▸ Data turns this off.</value>
</data>
<data name="Games_Removed_More_Format" xml:space="preserve">
<value>{0} and {1} more</value>
</data>
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
<value>Delete all sessions</value>
</data>
@@ -2201,6 +2222,36 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="GameDetail_EngineVersion_NotFound" xml:space="preserve">
<value>Not found in the game's executable. It may be packed or protected, or the studio renamed the engine's build.</value>
</data>
<data name="GameDetail_EngineVersion_UnityPlayer" xml:space="preserve">
<value>From the version of the game's Unity player library (UnityPlayer.dll).</value>
</data>
<data name="GameDetail_EngineVersion_UnityData" xml:space="preserve">
<value>From the header of the game's Unity data file (globalgamemanagers).</value>
</data>
<data name="GameDetail_EngineVersion_UnityPlayerFile" xml:space="preserve">
<value>From the Unity player library's version number only. The release letter (such as f1) is not recorded there.</value>
</data>
<data name="GameDetail_EngineVersion_GodotPack" xml:space="preserve">
<value>From the header of the game's Godot data pack (.pck).</value>
</data>
<data name="GameDetail_EngineVersion_GodotPackEmbedded" xml:space="preserve">
<value>From the header of the Godot data pack inside the game's executable.</value>
</data>
<data name="GameDetail_EngineVersion_GodotExe" xml:space="preserve">
<value>From the version information Godot left in the game's executable.</value>
</data>
<data name="GameDetail_EngineVersion_CoreScript_Format" xml:space="preserve">
<value>From the first lines of the game's {0}.</value>
</data>
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
<value>From the RPG Maker runtime library (RGSS) that the game's Game.ini names. The number is the library's, not the editor's.</value>
</data>
<data name="GameDetail_EngineVersion_RenPyVcVersion" xml:space="preserve">
<value>From the version file of the game's Ren'Py engine (renpy/vc_version.py).</value>
</data>
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
<value>Not found in the game's files.</value>
</data>
<data name="GameDetail_Details_Libraries" xml:space="preserve">
<value>Ships with</value>
</data>
@@ -3122,4 +3173,7 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="DataDir_Profile_Format" xml:space="preserve">
<value>{0} is FrameLedger's own data folder. --data-dir is for a copy of it, so that a test build never opens the database you record into. To use this folder, start FrameLedger without --data-dir.</value>
</data>
<data name="GameDetail_Supports_None" xml:space="preserve">
<value>None found — the game's folder holds no upscaler, frame-generation or Vulkan file the rules name.</value>
</data>
</root>
+54
View File
@@ -1519,6 +1519,27 @@
<data name="Settings_Data_Header" xml:space="preserve">
<value>Dữ liệu</value>
</data>
<data name="Settings_RemoveUninstalled_Label" xml:space="preserve">
<value>Xoá game đã gỡ cài đặt</value>
</data>
<data name="Settings_RemoveUninstalled_Body" xml:space="preserve">
<value>Game có file thực thi đã biến mất mười phút, trên ổ đĩa vẫn đang cắm, sẽ được xoá khỏi thư viện — chỉ khi game chưa có phiên nào, và không bao giờ xoá game đã phát hiện anti-cheat. Khi tắt, game vẫn ở lại với nhãn Chưa cài.</value>
</data>
<data name="Settings_RemoveUninstalled_Applied" xml:space="preserve">
<value>Đã áp dụng. Capture agent đọc trong vòng 15 giây.</value>
</data>
<data name="Games_Removed_Title" xml:space="preserve">
<value>Đã xoá khỏi thư viện</value>
</data>
<data name="Games_Removed_Format" xml:space="preserve">
<value>{0} không còn được cài đặt và chưa có phiên nào, nên capture agent đã xoá nó. Tắt việc này trong Cài đặt ▸ Dữ liệu.</value>
</data>
<data name="Games_Removed_Many_Format" xml:space="preserve">
<value>{0} game không còn được cài đặt và chưa có phiên nào, nên capture agent đã xoá chúng: {1}. Tắt việc này trong Cài đặt ▸ Dữ liệu.</value>
</data>
<data name="Games_Removed_More_Format" xml:space="preserve">
<value>{0} và {1} game khác</value>
</data>
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
<value>Xoá mọi phiên</value>
</data>
@@ -2196,6 +2217,36 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="GameDetail_EngineVersion_NotFound" xml:space="preserve">
<value>Không tìm thấy trong file thực thi của game. File có thể đã bị nén hoặc bảo vệ, hoặc studio đã đổi tên bản dựng của engine.</value>
</data>
<data name="GameDetail_EngineVersion_UnityPlayer" xml:space="preserve">
<value>Lấy từ phiên bản thư viện Unity player của game (UnityPlayer.dll).</value>
</data>
<data name="GameDetail_EngineVersion_UnityData" xml:space="preserve">
<value>Lấy từ phần đầu file dữ liệu Unity của game (globalgamemanagers).</value>
</data>
<data name="GameDetail_EngineVersion_UnityPlayerFile" xml:space="preserve">
<value>Chỉ lấy từ số phiên bản của thư viện Unity player. Chữ cái của bản phát hành (như f1) không được ghi ở đó.</value>
</data>
<data name="GameDetail_EngineVersion_GodotPack" xml:space="preserve">
<value>Lấy từ phần đầu gói dữ liệu Godot của game (.pck).</value>
</data>
<data name="GameDetail_EngineVersion_GodotPackEmbedded" xml:space="preserve">
<value>Lấy từ phần đầu gói dữ liệu Godot nằm trong file thực thi của game.</value>
</data>
<data name="GameDetail_EngineVersion_GodotExe" xml:space="preserve">
<value>Lấy từ thông tin phiên bản mà Godot để lại trong file thực thi của game.</value>
</data>
<data name="GameDetail_EngineVersion_CoreScript_Format" xml:space="preserve">
<value>Lấy từ những dòng đầu của {0} trong game.</value>
</data>
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
<value>Lấy từ thư viện runtime RPG Maker (RGSS) mà file Game.ini của game chỉ định. Đây là số phiên bản của thư viện, không phải của trình biên tập.</value>
</data>
<data name="GameDetail_EngineVersion_RenPyVcVersion" xml:space="preserve">
<value>Lấy từ file phiên bản của engine Ren'Py trong game (renpy/vc_version.py).</value>
</data>
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
<value>Không tìm thấy trong các file của game.</value>
</data>
<data name="GameDetail_Details_Libraries" xml:space="preserve">
<value>Đi kèm</value>
</data>
@@ -3117,4 +3168,7 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="DataDir_Profile_Format" xml:space="preserve">
<value>{0} là thư mục dữ liệu của chính FrameLedger. --data-dir dành cho một bản sao của nó, để một bản thử nghiệm không bao giờ mở cơ sở dữ liệu bạn đang ghi vào. Để dùng thư mục này, hãy mở FrameLedger không kèm --data-dir.</value>
</data>
<data name="GameDetail_Supports_None" xml:space="preserve">
<value>Không tìm thấy — thư mục game không có file upscaler, frame generation hay Vulkan nào mà bộ quy tắc liệt kê.</value>
</data>
</root>
@@ -26,7 +26,7 @@ public sealed class GameCardViewModel
Id = card.Row.Id;
Name = card.Row.Name;
PlatformText = Formats.Platform(card.Row.Platform);
EngineText = Formats.Engine(card.Row.Engine);
EngineText = Formats.Engine(card.Row.Engine, card.Row.EngineVersionSource);
Recorded = card.Row.RecordSessions;
HookOn = Recorded && card.Row.HookEnabled;
// An entry the guard found anti-cheat in says so (beta.8): its hooking is off for good, and "Hooking off" read as
@@ -83,6 +83,14 @@ public sealed partial class GameDetailViewModel : ObservableObject
[ObservableProperty]
private bool _supportsEmpty = true;
/// <summary>
/// What the Supports card says when it lists nothing (beta.21): "not scanned yet" until the Agent's sweep has read the
/// executable, then that none of the files the rules name was found. It said "not scanned yet" for every game that
/// ships none of them — a scanned RPG Maker game's page contradicted its own Details card.
/// </summary>
[ObservableProperty]
private string _supportsEmptyText = Strings.GameDetail_Supports_Empty;
[ObservableProperty]
private string _measuredEmptyText = string.Empty;
@@ -277,8 +285,6 @@ public sealed partial class GameDetailViewModel : ObservableObject
public static string SupportsHeader => Strings.GameDetail_Supports_Header;
public static string SupportsEmptyText => Strings.GameDetail_Supports_Empty;
public static string MeasuredHeader => Strings.GameDetail_Measured_Header;
public static string RecordingHeader => Strings.GameDetail_Recording_Header;
@@ -521,6 +527,13 @@ public sealed partial class GameDetailViewModel : ObservableObject
{
Pending = LoadAsync();
}
else if (string.Equals(e.Envelope.Type, IpcMessageType.GameRemoved, StringComparison.Ordinal)
&& IpcCodec.Payload<GameRemovedEvent>(e.Envelope) is { } removed && removed.GameId == _gameId)
{
// D55 (beta.19): this very entry was removed by the Agent — the page reloads into its not-found state and says why.
_strip.Info(Strings.Games_Removed_Title, string.Format(CultureInfo.CurrentCulture, Strings.Games_Removed_Format, removed.GameName ?? removed.ExePath));
Pending = LoadAsync();
}
});
private async Task LoadSelectedAsync(SessionItemViewModel? session)
@@ -801,7 +814,8 @@ public sealed partial class GameDetailViewModel : ObservableObject
/// <summary>
/// A store import guesses the executable (Steam names none), and everything downstream is keyed on it: a wrong guess
/// is a game that can never be matched. The pick is the user's own; the row comes back hooking-off and unconsented,
/// exactly as a new game would, and consent is revoked over the pipe first, as removal does.
/// exactly as a new game would, and consent is revoked over the pipe first, as removal does. The dialog opens in the
/// game's own folder (beta.19, <see cref="GameFolder"/>), asked off the UI thread.
/// </summary>
private async Task ChangeExecutableCoreAsync()
{
@@ -810,7 +824,9 @@ public sealed partial class GameDetailViewModel : ObservableObject
return;
}
string? path = _picker.PickExecutable();
string current = Game.Fingerprint.ExePath;
string? folder = await Task.Run(() => GameFolder.StartFolder(current)).ConfigureAwait(true);
string? path = _picker.PickExecutable(folder);
if (path is null || string.Equals(ExecutableIdentity.Normalise(path), Game.Fingerprint.ExePath, StringComparison.OrdinalIgnoreCase))
{
return;
@@ -1015,6 +1031,9 @@ public sealed partial class GameDetailViewModel : ObservableObject
}
SupportsEmpty = Supports.Count == 0;
// The Details card's own test: a row the sweep has read carries the executable's machine.
SupportsEmptyText = row.ExeMachine is null ? Strings.GameDetail_Supports_Empty : Strings.GameDetail_Supports_None;
}
private void PresentDetails(GameDetail detail)
@@ -1166,13 +1185,12 @@ public sealed partial class GameDetailViewModel : ObservableObject
SessionsEmpty = Sessions.Count == 0;
}
private static string EngineText(GameRow row) =>
row.Engine is null || row.EngineVersion is null ? Formats.Engine(row.Engine) : Formats.Engine(row.Engine) + " " + row.EngineVersion;
private static string EngineText(GameRow row) => Formats.EngineWithVersion(row.Engine, row.EngineVersion, row.EngineVersionSource);
/// <summary>
/// Which witness an Unreal Engine version rests on (beta.10, schema 0015) — said, because the executable's version
/// number and the engine's build name can each be wrong in their own way (<c>05_DETECTION</c> §Engine version). An
/// Unreal title whose executable names no version says so once the sweep has read it; other engines add no line.
/// Which witness an engine version rests on (beta.10 for Unreal, schema 0015; beta.19 for Unity, Godot and RPG Maker) —
/// said, because each witness can be wrong or short in its own way (<c>05_DETECTION</c> §Engine version). A title of
/// these engines whose files name no version says so once the sweep has read it; other engines add no line.
/// </summary>
internal static string? EngineVersionSourceText(GameRow row)
{
@@ -1182,8 +1200,20 @@ public sealed partial class GameDetailViewModel : ObservableObject
EngineVersionSource.UnrealBranchAndFile => Strings.GameDetail_EngineVersion_BranchAndFile,
EngineVersionSource.UnrealBranch => Strings.GameDetail_EngineVersion_Branch,
EngineVersionSource.UnrealFileVersion => Strings.GameDetail_EngineVersion_FileVersion,
EngineVersionSource.UnityPlayer => Strings.GameDetail_EngineVersion_UnityPlayer,
EngineVersionSource.UnityData => Strings.GameDetail_EngineVersion_UnityData,
EngineVersionSource.UnityPlayerFile => Strings.GameDetail_EngineVersion_UnityPlayerFile,
EngineVersionSource.GodotPack => Strings.GameDetail_EngineVersion_GodotPack,
EngineVersionSource.GodotPackEmbedded => Strings.GameDetail_EngineVersion_GodotPackEmbedded,
EngineVersionSource.GodotExe => Strings.GameDetail_EngineVersion_GodotExe,
EngineVersionSource.RpgMakerMzCore => string.Format(CultureInfo.CurrentCulture, Strings.GameDetail_EngineVersion_CoreScript_Format, "js/rmmz_core.js"),
EngineVersionSource.RpgMakerMvCore => string.Format(CultureInfo.CurrentCulture, Strings.GameDetail_EngineVersion_CoreScript_Format, "rpg_core.js"),
EngineVersionSource.Rgss1Library or EngineVersionSource.Rgss2Library or EngineVersionSource.Rgss3Library => Strings.GameDetail_EngineVersion_Rgss,
EngineVersionSource.RenPyVcVersion => Strings.GameDetail_EngineVersion_RenPyVcVersion,
null when string.Equals(row.Engine, "unreal", StringComparison.Ordinal) && row.EngineVersion is null && row.ExeMachine is not null
=> Strings.GameDetail_EngineVersion_NotFound,
null when row.Engine is "unity" or "godot" or "rpgmaker_mv" or "rpgmaker_rgss" or "renpy" && row.EngineVersion is null && row.ExeMachine is not null
=> Strings.GameDetail_EngineVersion_NotFoundInFiles,
_ => null,
};
}
@@ -25,6 +25,9 @@ public sealed partial class GamesViewModel : ObservableObject
private const string _listValue = "list";
private const string _gridValue = "grid";
/// <summary>How many removed games one notice names; the rest are counted (<c>Games_Removed_More_Format</c>).</summary>
private const int _removedNamed = 5;
private readonly GameLibrary _library;
private readonly GameSelection _selection;
private readonly IPageNavigator _navigator;
@@ -33,8 +36,13 @@ public sealed partial class GamesViewModel : ObservableObject
private readonly RegisteredSettings? _settings;
private readonly IAgentLink? _agent;
private readonly LibraryChanges? _changes;
private readonly IMessageStrip? _strip;
private readonly TimeProvider _clock;
private readonly Func<string, bool> _exists;
private readonly UiThread _ui = new();
private readonly List<string> _removed = [];
private IReadOnlyList<GameCardViewModel> _all = [];
private int _reads;
private bool _viewRead;
private bool _attached;
@@ -58,8 +66,12 @@ public sealed partial class GamesViewModel : ObservableObject
private bool _listView;
public GamesViewModel(GameLibrary library, GameSelection selection, IPageNavigator navigator, AddGameFlow addGame, ImportLibraryFlow? import = null,
RegisteredSettings? settings = null, IAgentLink? agent = null, LibraryChanges? changes = null)
RegisteredSettings? settings = null, IAgentLink? agent = null, LibraryChanges? changes = null, IMessageStrip? strip = null, TimeProvider? clock = null,
Func<string, bool>? executableExists = null)
{
_strip = strip;
_clock = clock ?? TimeProvider.System;
_exists = executableExists ?? GameLibrary.ExecutableExists;
_library = library ?? throw new ArgumentNullException(nameof(library));
_selection = selection ?? throw new ArgumentNullException(nameof(selection));
_navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
@@ -89,6 +101,12 @@ public sealed partial class GamesViewModel : ObservableObject
public static string ListText => Strings.Games_View_List;
/// <summary>
/// How long the page waits after the Agent says it removed a game (D55) for the rest of the same check before it reloads
/// and says what went (beta.19). One check removes its games a few milliseconds apart, each in its own event.
/// </summary>
public static TimeSpan RemovalSettle { get; } = TimeSpan.FromSeconds(1);
/// <summary>The sort orders, labelled in the language this page opened in (beta.15: a static list kept the first language).</summary>
public IReadOnlyList<Choice<GamesSort>> Sorts { get; } =
[
@@ -102,14 +120,26 @@ public sealed partial class GamesViewModel : ObservableObject
/// <summary>The load in flight, for a test to await.</summary>
public Task Pending { get; private set; }
/// <summary>
/// The library read and listed. Reads overlap — a session that ends, an import, a removal — and the one that started first
/// can finish last, its checks waiting on a drive that is slow to answer: only the newest read is shown (beta.19 — an
/// older one put back the card of a game the Agent had just removed, until the next read).
/// </summary>
public async Task LoadAsync(CancellationToken ct = default)
{
int read = Interlocked.Increment(ref _reads);
await ReadViewAsync(ct).ConfigureAwait(true);
IReadOnlyList<GameCard> cards = await _library.ListCardsAsync(ct).ConfigureAwait(true);
// Whether each executable is on disk is a file-system question per entry — a drive that is gone can take a moment
// to say so — so it is asked off the UI thread, the game page's own way (GameLibrary.ExecutableExists).
bool[] installed = await Task.Run(() => cards.Select(static c => GameLibrary.ExecutableExists(c.Row.Fingerprint.ExePath)).ToArray(), ct)
Func<string, bool> exists = _exists;
bool[] installed = await Task.Run(() => cards.Select(c => exists(c.Row.Fingerprint.ExePath)).ToArray(), ct)
.ConfigureAwait(true);
if (read != Volatile.Read(ref _reads))
{
return;
}
_all = [.. cards.Select((c, i) => new GameCardViewModel(c, installed[i]))];
HeaderText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Header_Count_Format, _all.Count);
Apply();
@@ -245,8 +275,42 @@ public sealed partial class GamesViewModel : ObservableObject
{
Pending = LoadAsync();
}
else if (string.Equals(e.Envelope.Type, IpcMessageType.GameRemoved, StringComparison.Ordinal)
&& IpcCodec.Payload<GameRemovedEvent>(e.Envelope) is { } removed)
{
// D55 (beta.19): the Agent removed an entry whose game is no longer installed; the card goes, and the page says why.
// A check that removes five says it in five events: the first waits for the rest, then one reload and one notice.
_removed.Add(removed.GameName ?? removed.ExePath);
if (_removed.Count == 1)
{
Pending = SayRemovedAsync();
}
}
});
/// <summary>
/// The games the Agent removed since the first of them, after <see cref="RemovalSettle"/>: the library read once, then one
/// notice — the game's name, or how many went and which. A removal heard during the read starts the next notice.
/// </summary>
private async Task SayRemovedAsync()
{
await Task.Delay(RemovalSettle, _clock).ConfigureAwait(true);
string[] names = [.. _removed];
_removed.Clear();
await LoadAsync().ConfigureAwait(true);
if (_strip is null)
{
return;
}
string listed = names.Length <= _removedNamed
? string.Join(", ", names)
: string.Format(CultureInfo.CurrentCulture, Strings.Games_Removed_More_Format, string.Join(", ", names.Take(_removedNamed)), names.Length - _removedNamed);
_strip.Info(Strings.Games_Removed_Title, names.Length == 1
? string.Format(CultureInfo.CurrentCulture, Strings.Games_Removed_Format, names[0])
: string.Format(CultureInfo.CurrentCulture, Strings.Games_Removed_Many_Format, names.Length, listed));
}
private void OnLibraryChanged(object? sender, EventArgs e) => _ui.Post(() => Pending = LoadAsync());
private void Apply()
@@ -71,6 +71,13 @@ public sealed partial class SettingsViewModel : ObservableObject
[NotifyPropertyChangedFor(nameof(KillSwitchState))]
private bool _killSwitch;
/// <summary>
/// D55 (beta.19): the Agent removes an entry whose game is no longer installed and that has no session
/// (<c>retention.remove_uninstalled_games</c>, on by default).
/// </summary>
[ObservableProperty]
private bool _removeUninstalledGames;
[ObservableProperty]
private int _minSessionSeconds;
@@ -384,6 +391,8 @@ public sealed partial class SettingsViewModel : ObservableObject
partial void OnRetentionRawSessionsChanged(int oldValue, int newValue) => PersistNumber(SettingsRegistry.RetentionRawSessionsPerGame, Strings.Settings_Retention_Label, oldValue, newValue, v => RetentionRawSessions = v);
partial void OnRemoveUninstalledGamesChanged(bool value) => Persist(SettingsRegistry.RetentionRemoveUninstalledGames, value);
partial void OnHideAntiCheatHookingChanged(bool value) => Persist(SettingsRegistry.UiHideAntiCheatHooking, value);
/// <summary>D33: the option is one settings row the Agent reads at every session start and command; the list follows it.</summary>
@@ -532,6 +541,7 @@ public sealed partial class SettingsViewModel : ObservableObject
MinSessionSeconds = await _settings.GetIntegerAsync(SettingsRegistry.CaptureMinSessionSeconds).ConfigureAwait(true);
TelemetryIntervalMs = await _settings.GetIntegerAsync(SettingsRegistry.TelemetryIntervalMs).ConfigureAwait(true);
RetentionRawSessions = await _settings.GetIntegerAsync(SettingsRegistry.RetentionRawSessionsPerGame).ConfigureAwait(true);
RemoveUninstalledGames = await _settings.GetBooleanAsync(SettingsRegistry.RetentionRemoveUninstalledGames).ConfigureAwait(true);
MinimizeToTray = await _settings.GetBooleanAsync(SettingsRegistry.UiMinimizeToTray).ConfigureAwait(true);
HideAntiCheatHooking = await _settings.GetBooleanAsync(SettingsRegistry.UiHideAntiCheatHooking).ConfigureAwait(true);
UserModeExceptions = await _settings.GetBooleanAsync(SettingsRegistry.HookingUserModeExceptions).ConfigureAwait(true);
@@ -767,8 +777,12 @@ public sealed partial class SettingsViewModel : ObservableObject
if (definition.AgentReads)
{
// Disable all hooking does not wait for a session to start (beta.18): a measured one stops at its next safety scan.
// Nor does the removal of uninstalled games (beta.19, D55): the Agent reads it at every sweep.
bool killSwitchOn = ReferenceEquals(definition, SettingsRegistry.HookingKillSwitch) && string.Equals(value, "1", StringComparison.Ordinal);
_strip.Info(Strings.Settings_Header, killSwitchOn ? Strings.Settings_KillSwitch_Applied_On : Strings.Settings_Applied);
string applied = killSwitchOn ? Strings.Settings_KillSwitch_Applied_On
: ReferenceEquals(definition, SettingsRegistry.RetentionRemoveUninstalledGames) ? Strings.Settings_RemoveUninstalled_Applied
: Strings.Settings_Applied;
_strip.Info(Strings.Settings_Header, applied);
}
}
@@ -40,6 +40,7 @@ public sealed class DetectionSweep : IDisposable
private readonly IExecutableIdentitySource _identity;
private readonly Action<string> _log;
private readonly ExecutableRelocator? _relocator;
private readonly UninstalledEntryPrune? _prune;
private readonly SemaphoreSlim _wake = new(0, 1);
// The path each unreadable entry was last reported at (2026-09-23): said once until it changes or reads again. The
@@ -53,8 +54,9 @@ public sealed class DetectionSweep : IDisposable
/// <param name="identity">Reads each row's executable (its fingerprint), or null when it cannot.</param>
/// <param name="log">The Agent's log line.</param>
/// <param name="relocator">Follows an executable to a drive that changed its letter (2026-09-22); null sweeps without looking.</param>
/// <param name="prune">Removes an entry whose game is no longer installed and had no session (beta.19, D55); null removes nothing.</param>
public DetectionSweep(IGameRepository games, IDetectionRulesSource rules, IGameFileProbe probe, IExecutableIdentitySource identity, Action<string> log,
ExecutableRelocator? relocator = null)
ExecutableRelocator? relocator = null, UninstalledEntryPrune? prune = null)
{
_games = games ?? throw new ArgumentNullException(nameof(games));
_rules = rules ?? throw new ArgumentNullException(nameof(rules));
@@ -62,6 +64,7 @@ public sealed class DetectionSweep : IDisposable
_identity = identity ?? throw new ArgumentNullException(nameof(identity));
_log = log ?? throw new ArgumentNullException(nameof(log));
_relocator = relocator;
_prune = prune;
_detector = new StaticGameDetector(rules, probe);
}
@@ -101,6 +104,7 @@ public sealed class DetectionSweep : IDisposable
int current = 0;
int unreadable = 0;
int relocated = 0;
int removed = 0;
foreach (GameRow listed in await _games.ListAsync(ct).ConfigureAwait(false))
{
ct.ThrowIfCancellationRequested();
@@ -119,17 +123,14 @@ public sealed class DetectionSweep : IDisposable
if (read is not { } onDisk)
{
unreadable++;
if (!_unreadableSaid.TryGetValue(game.Id, out string? said) || !string.Equals(said, game.Fingerprint.ExePath, StringComparison.OrdinalIgnoreCase))
{
_unreadableSaid[game.Id] = game.Fingerprint.ExePath;
_log($"detect: {game.Name} — executable unreadable, skipped ({game.Fingerprint.ExePath}); said once until that changes");
}
bool uninstalled = await UnreadableAsync(game, ct).ConfigureAwait(false);
removed += uninstalled ? 1 : 0;
unreadable += uninstalled ? 0 : 1;
continue;
}
_unreadableSaid.Remove(game.Id);
_prune?.Present(game.Id);
if (!IsStale(game, onDisk, rules.RulesVersion))
{
@@ -143,7 +144,28 @@ public sealed class DetectionSweep : IDisposable
}
}
return new DetectionSweepReport { Scanned = scanned, Current = current, Unreadable = unreadable, Relocated = relocated };
return new DetectionSweepReport { Scanned = scanned, Current = current, Unreadable = unreadable, Relocated = relocated, Removed = removed };
}
/// <summary>
/// An entry whose executable did not read, after the relocator looked for it on every other drive: removed when its game
/// is no longer installed and it had no session (beta.19, D55), else skipped and named once. True when it was removed.
/// </summary>
private async ValueTask<bool> UnreadableAsync(GameRow game, CancellationToken ct)
{
if (_prune is not null && await _prune.ConsiderAsync(game, ct).ConfigureAwait(false))
{
_unreadableSaid.Remove(game.Id);
return true;
}
if (!_unreadableSaid.TryGetValue(game.Id, out string? said) || !string.Equals(said, game.Fingerprint.ExePath, StringComparison.OrdinalIgnoreCase))
{
_unreadableSaid[game.Id] = game.Fingerprint.ExePath;
_log($"detect: {game.Name} — executable unreadable, skipped ({game.Fingerprint.ExePath}); said once until that changes");
}
return false;
}
/// <summary>
@@ -18,6 +18,9 @@ public sealed record DetectionSweepReport
/// <summary>Rows whose executable was found under another drive letter and moved there this pass (2026-09-22).</summary>
public int Relocated { get; init; }
/// <summary>Entries removed this pass because their game is no longer installed and had no session (beta.19, D55).</summary>
public int Removed { get; init; }
/// <summary>The rules file could not be loaded; nothing was scanned.</summary>
public bool RulesUnusable { get; init; }
}
@@ -24,4 +24,29 @@ public interface IGameFileProbe
/// file. Null when no shipping executable is in the snapshot's listing or it could not be read: no facts, never a guess.
/// </summary>
ValueTask<UnrealBuildFacts?> ReadUnrealBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
/// <summary>
/// Unity's build facts (beta.19) — the player library's version resource and the header of its data file — asked only
/// after the rules matched an engine whose extractor is <see cref="VersionExtractorType.UnityBuild"/>. Null when neither
/// file is there or could be read.
/// </summary>
ValueTask<UnityBuildFacts?> ReadUnityBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
/// <summary>
/// Godot's build facts (beta.19) — a data pack's header, beside the executable or appended to it, and the executable's
/// version resource — for <see cref="VersionExtractorType.GodotBuild"/>. Null when nothing could be read.
/// </summary>
ValueTask<GodotBuildFacts?> ReadGodotBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
/// <summary>
/// RPG Maker's build facts (beta.19) — MV/MZ's core-script header, or the RGSS library <c>Game.ini</c> names — for
/// <see cref="VersionExtractorType.RpgMakerBuild"/>. Null when neither is found.
/// </summary>
ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
/// <summary>
/// Ren'Py's build facts (beta.20) — the <c>version</c> line of the engine's <c>renpy/vc_version.py</c> beside the
/// launcher — for <see cref="VersionExtractorType.RenPyBuild"/>. Null when the file names none or could not be read.
/// </summary>
ValueTask<RenPyBuildFacts?> ReadRenPyBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
}
@@ -59,8 +59,9 @@ public sealed class StaticGameDetector(IDetectionRulesSource rulesSource, IGameF
}
/// <summary>
/// The matched engine's version and its witness. Every extractor but one answers from the snapshot; Unreal's is the
/// second read (beta.10), made here for the one engine that matched rather than by the probe for every game.
/// The matched engine's version and its witness. The rules' own extractors answer from the snapshot; an engine whose
/// version is decided in code — Unreal since beta.10, Unity, Godot and RPG Maker since beta.19, Ren'Py since beta.20 — gets one second read,
/// made here for the one engine that matched rather than by the probe for every game.
/// </summary>
private async ValueTask<EngineVersionReading> VersionAsync(EngineMatch engine, GameFileSnapshot snapshot, CancellationToken ct)
{
@@ -69,12 +70,20 @@ public sealed class StaticGameDetector(IDetectionRulesSource rulesSource, IGameF
return EngineVersionReading.None;
}
if (extractor.Type != VersionExtractorType.UnrealBuild)
switch (extractor.Type)
{
return engine.Version is null ? EngineVersionReading.None : new EngineVersionReading(engine.Version, EngineVersionSource.Of(extractor.Type));
case VersionExtractorType.UnrealBuild:
return await _probe.ReadUnrealBuildAsync(snapshot, ct).ConfigureAwait(false) is { } unreal ? UnrealVersion.Decide(unreal) : EngineVersionReading.None;
case VersionExtractorType.UnityBuild:
return await _probe.ReadUnityBuildAsync(snapshot, ct).ConfigureAwait(false) is { } unity ? UnityVersion.Decide(unity) : EngineVersionReading.None;
case VersionExtractorType.GodotBuild:
return await _probe.ReadGodotBuildAsync(snapshot, ct).ConfigureAwait(false) is { } godot ? GodotVersion.Decide(godot) : EngineVersionReading.None;
case VersionExtractorType.RpgMakerBuild:
return await _probe.ReadRpgMakerBuildAsync(snapshot, ct).ConfigureAwait(false) is { } maker ? RpgMakerVersion.Decide(maker) : EngineVersionReading.None;
case VersionExtractorType.RenPyBuild:
return await _probe.ReadRenPyBuildAsync(snapshot, ct).ConfigureAwait(false) is { } renpy ? RenPyVersion.Decide(renpy) : EngineVersionReading.None;
default:
return engine.Version is null ? EngineVersionReading.None : new EngineVersionReading(engine.Version, EngineVersionSource.Of(extractor.Type));
}
UnrealBuildFacts? facts = await _probe.ReadUnrealBuildAsync(snapshot, ct).ConfigureAwait(false);
return facts is null ? EngineVersionReading.None : UnrealVersion.Decide(facts);
}
}
@@ -72,6 +72,12 @@ public sealed class LibraryImporter
bool missing = exe is not null && _identity.Read(exe) is null;
bool already = exe is not null && await _games.FindAsync(exe, ct).ConfigureAwait(false) is { InLibrary: true };
string? movedFrom = exe is null || already ? null : StaleTwinOf(exe, library)?.Fingerprint.ExePath;
if (exe is not null && !already && movedFrom is null && SameStoreTitleOf(game, library) is { } entry)
{
already = true;
_log($"import: {game.Name} ({game.Platform} {game.StoreId}) is already in the library as {entry.Fingerprint.ExePath} — not offered again at {exe}");
}
candidates.Add(new ImportCandidate(game, exe, already, guessed, missing, movedFrom));
}
@@ -130,4 +136,23 @@ public sealed class LibraryImporter
/// </summary>
private GameRow? StaleTwinOf(string exe, IReadOnlyList<GameRow> library) =>
library.FirstOrDefault(r => ExecutableRelocator.IsDriveLetterTwin(r.Fingerprint.ExePath, exe) && _identity.Read(r.Fingerprint.ExePath) is null);
/// <summary>
/// The library entry an earlier import made for this very store title, at another executable (beta.19): the store's id,
/// under the same platform or with the entry's executable inside the title's install folder. The import used to compare
/// paths only, so a guess that changed between builds — A Doll's Locket - Remake's helper became its NW.js runtime —
/// would have offered the same game again beside the entry the user already has; that entry is what Change executable…
/// re-points. The folder half is there because the platform is the detection sweep's to refresh: an itch build that
/// ships Steam's API reads as Steam. A title with no store id is never matched.
/// </summary>
private static GameRow? SameStoreTitleOf(StoreGame game, IReadOnlyList<GameRow> library) =>
string.IsNullOrEmpty(game.StoreId)
? null
: library.FirstOrDefault(r => string.Equals(r.StoreId, game.StoreId, StringComparison.Ordinal)
&& (string.Equals(r.Platform, game.Platform, StringComparison.OrdinalIgnoreCase)
|| IsInside(r.Fingerprint.ExePath, game.InstallDirectory)));
private static bool IsInside(string path, string directory) =>
!string.IsNullOrEmpty(directory)
&& path.StartsWith(Path.TrimEndingDirectorySeparator(directory) + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase);
}
@@ -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.Persistence;
/// <summary>
/// Removes a library entry whose game is no longer installed (beta.19, owner decision D55) — the second Agent write that
/// deletes a <c>games</c> row, after the twin merge (<see cref="IGameMerge"/>; <c>06_DATA_MODEL</c> §Writer ownership).
/// </summary>
public interface IGamePrune
{
/// <summary>
/// Deletes the entry when, in the same statement, it is still at <paramref name="exePath"/>, still in the library, has
/// no session stored, and carries no anti-cheat block, exception or failed-trial mark (CLAUDE.md rule 2: nothing clears
/// a block). True when it was deleted; false when any condition no longer held — nothing is written then.
/// </summary>
ValueTask<bool> RemoveUninstalledAsync(long gameId, string exePath, CancellationToken ct = default);
}
@@ -174,6 +174,20 @@ public static class SettingsRegistry
AgentReads = true,
};
/// <summary>
/// Whether the Agent removes a library entry whose game is no longer installed and that has no session (beta.19, owner
/// decision D55, amending D41's "nothing is removed"): its executable gone at sweeps ten minutes apart, on a drive that is
/// connected, from a folder whose parents are still there — never an entry carrying an anti-cheat block or exception.
/// On by default; off, such an entry stays and reads <i>Not installed</i>. The Agent reads it at every sweep (15 s).
/// </summary>
public static readonly SettingDefinition RetentionRemoveUninstalledGames = new()
{
Key = "retention.remove_uninstalled_games",
Kind = SettingKind.Boolean,
Default = "1",
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). <c>auto</c>, the default since beta.14 (owner decision D47), follows the
@@ -217,7 +231,7 @@ public static class SettingsRegistry
[
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals, UiHideScrollBars, UiLibraryView,
CaptureBackground, HookingKillSwitch, HookingUserModeExceptions, CaptureRunElevated, CaptureMinSessionSeconds, TelemetryIntervalMs, RetentionRawSessionsPerGame,
UpdateChannel, UpdateAutoCheck, PrivacyOnlineMetadata, LogDebug,
RetentionRemoveUninstalledGames, UpdateChannel, UpdateAutoCheck, PrivacyOnlineMetadata, LogDebug,
];
private static readonly Dictionary<string, SettingDefinition> _byKey = All.ToDictionary(static d => d.Key, StringComparer.Ordinal);
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Watch;
/// <summary>
/// Why an entry's executable did not read (beta.19, D55) — the distinctions <c>ExecutableIdentity.Read</c>'s null does not
/// make, and the only ones that may remove an entry: <see cref="FileGone"/> is the one answer that does.
/// </summary>
public enum ExecutablePresence
{
/// <summary>Nothing could be told (a share, a refused listing, an error) — never a reason to remove anything.</summary>
Unknown,
/// <summary>The file is there.</summary>
Present,
/// <summary>Its drive is not connected (or not ready): the relocator follows it when it is back on another letter.</summary>
DriveAbsent,
/// <summary>
/// The drive is there, and nothing of the path is but its root: a different disk under the same letter as easily as an
/// uninstall, so not one.
/// </summary>
OnlyTheDriveRemains,
/// <summary>The file is gone from a folder that is still there, or its folder is gone from one that is: uninstalled.</summary>
FileGone,
}
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Watch;
/// <summary>Tells why an entry's executable did not read (beta.19, D55; <see cref="ExecutablePresence"/>).</summary>
public interface IExecutablePresence
{
/// <summary>What the file system says about <paramref name="exePath"/> — read only, never a process.</summary>
ExecutablePresence Probe(string exePath);
}
@@ -0,0 +1,118 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using FrameLedger.Application.Ipc;
using FrameLedger.Application.Persistence;
using FrameLedger.Shared.Ipc;
namespace FrameLedger.Application.Watch;
/// <summary>
/// Removes a library entry whose game is no longer installed and that has no session (beta.19, owner decision D55, amending
/// D41's "nothing is removed"). Asked by <c>DetectionSweep</c> about every entry whose executable stayed unreadable after the
/// relocator looked for it on the other drives.
/// </summary>
/// <remarks>
/// <para>
/// <b>Every condition, or nothing.</b> The file is <see cref="ExecutablePresence.FileGone"/> — its drive connected, its folder
/// or the file gone from a folder that is still there, not a refused listing; it has been so at sweeps at least
/// <see cref="Grace"/> apart, at the same path (an update that replaces the executable is not an uninstall); the user's switch
/// (<c>retention.remove_uninstalled_games</c>, on by default) is on; no session of it is being recorded or waits in a
/// <c>.partial</c> to be recovered; and it carries no anti-cheat block, exception or failed-trial mark — rule 2's block is
/// never cleared, and a re-added entry would start without it. The delete itself (<see cref="IGamePrune"/>) checks the stored
/// conditions again in one statement, with "no session stored" among them, so a session finalized meanwhile wins.
/// </para>
/// <para>
/// <b>Counted in memory.</b> When the file was first seen gone is this object's, not the ledger's: an Agent restart starts
/// the ten minutes again, which only delays a removal. An entry the delete refused (it has sessions) is asked again at that
/// path only after <see cref="RetryAfter"/> — its sessions may since have been deleted (FR-1.7), and an answer that does not
/// change is not worth a statement every 15 seconds.
/// </para>
/// </remarks>
public sealed class UninstalledEntryPrune
{
/// <summary>How long a file must have been gone — across sweeps — before its entry goes: longer than a store takes to replace an executable.</summary>
public static readonly TimeSpan Grace = TimeSpan.FromMinutes(10);
/// <summary>How long an entry the delete refused waits before it is asked again.</summary>
public static readonly TimeSpan RetryAfter = TimeSpan.FromHours(1);
private readonly IGamePrune _prune;
private readonly IExecutablePresence _presence;
private readonly Func<CancellationToken, ValueTask<bool>> _enabled;
private readonly Func<long, bool> _busy;
private readonly Action<string> _log;
private readonly IIpcEventPublisher? _pipe;
private readonly TimeProvider _clock;
private readonly Dictionary<long, (string Path, DateTimeOffset Since)> _goneSince = [];
private readonly Dictionary<(long Id, string Path), DateTimeOffset> _kept = [];
/// <summary>The prune over its writer, the file system's answer, the user's switch and the recorder's state.</summary>
/// <param name="prune">The one conditional delete.</param>
/// <param name="presence">Why an executable did not read.</param>
/// <param name="enabled">The user's switch, read at every sweep.</param>
/// <param name="busy">True while a session of the entry is recorded or waits to be recovered.</param>
/// <param name="log">The Agent's log line.</param>
/// <param name="pipe">Where the App hears of a removal; null tells nobody.</param>
/// <param name="clock">The time the grace is counted in.</param>
public UninstalledEntryPrune(IGamePrune prune, IExecutablePresence presence, Func<CancellationToken, ValueTask<bool>> enabled, Func<long, bool> busy,
Action<string> log, IIpcEventPublisher? pipe = null, TimeProvider? clock = null)
{
_prune = prune ?? throw new ArgumentNullException(nameof(prune));
_presence = presence ?? throw new ArgumentNullException(nameof(presence));
_enabled = enabled ?? throw new ArgumentNullException(nameof(enabled));
_busy = busy ?? throw new ArgumentNullException(nameof(busy));
_log = log ?? throw new ArgumentNullException(nameof(log));
_pipe = pipe;
_clock = clock ?? TimeProvider.System;
}
/// <summary>The entry's executable read: whatever was counted against it is forgotten.</summary>
public void Present(long gameId) => _goneSince.Remove(gameId);
/// <summary>
/// The entry's executable did not read and was not relocated: is the game uninstalled, and may its entry go? True when the
/// entry was removed.
/// </summary>
public async ValueTask<bool> ConsiderAsync(GameRow game, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(game);
string path = game.Fingerprint.ExePath;
if (_presence.Probe(path) != ExecutablePresence.FileGone)
{
_goneSince.Remove(game.Id);
return false;
}
DateTimeOffset now = _clock.GetUtcNow();
if (!_goneSince.TryGetValue(game.Id, out (string Path, DateTimeOffset Since) seen) || !string.Equals(seen.Path, path, StringComparison.OrdinalIgnoreCase))
{
_goneSince[game.Id] = (path, now);
return false;
}
if (now - seen.Since < Grace || (_kept.TryGetValue((game.Id, path), out DateTimeOffset refused) && now - refused < RetryAfter)
|| CarriesAntiCheatState(game) || _busy(game.Id)
|| !await _enabled(ct).ConfigureAwait(false))
{
return false;
}
if (!await _prune.RemoveUninstalledAsync(game.Id, path, ct).ConfigureAwait(false))
{
_kept[(game.Id, path)] = now;
return false;
}
_goneSince.Remove(game.Id);
_log(string.Create(CultureInfo.InvariantCulture,
$"library: removed '{game.Name}' — {path} has been gone since {seen.Since:u} and the entry had no session (D55; Settings ▸ Data turns this off)"));
_pipe?.Publish(IpcMessageType.GameRemoved, new GameRemovedEvent(game.Id, game.Name, path, GameRemovedEvent.Uninstalled));
return true;
}
/// <summary>A block, an exception or a failed trial: what rule 2 and D38 keep for good, and a removal would drop.</summary>
private static bool CarriesAntiCheatState(GameRow game) =>
game.BlockedByGuard || game.AcException.GrantedAt is not null || game.AcException.TrialFailed;
}
@@ -18,6 +18,42 @@ public static class EngineVersionSource
/// <summary>Unreal: the numeric file version alone, where nothing suggests the studio replaced it.</summary>
public const string UnrealFileVersion = "unreal_file_version";
/// <summary>Unity (beta.19): the player library's <c>ProductVersion</c>, an editor version with its release letter.</summary>
public const string UnityPlayer = "unity_player";
/// <summary>Unity: the editor version the data file's header names.</summary>
public const string UnityData = "unity_data";
/// <summary>Unity: the player library's numeric file version — MAJOR.MINOR.PATCH, no release letter.</summary>
public const string UnityPlayerFile = "unity_player_file";
/// <summary>Godot (beta.19): the header of the data pack beside the executable.</summary>
public const string GodotPack = "godot_pck";
/// <summary>Godot: the header of the data pack appended to the executable.</summary>
public const string GodotPackEmbedded = "godot_pck_embedded";
/// <summary>Godot: the executable's version resource, still the engine's (<c>ProductName</c> is "Godot Engine").</summary>
public const string GodotExe = "godot_exe";
/// <summary>RPG Maker MZ (beta.19): the header of <c>js/rmmz_core.js</c>.</summary>
public const string RpgMakerMzCore = "rpgmaker_mz_core";
/// <summary>RPG Maker MV: the header of <c>rpg_core.js</c>.</summary>
public const string RpgMakerMvCore = "rpgmaker_mv_core";
/// <summary>RPG Maker XP: the RGSS1 library <c>Game.ini</c> names.</summary>
public const string Rgss1Library = "rgss1_library";
/// <summary>RPG Maker VX: the RGSS2 library.</summary>
public const string Rgss2Library = "rgss2_library";
/// <summary>RPG Maker VX Ace: the RGSS3 library.</summary>
public const string Rgss3Library = "rgss3_library";
/// <summary>Ren'Py (beta.20): the <c>version</c> line of the engine's <c>renpy/vc_version.py</c>, MAJOR.MINOR.PATCH.</summary>
public const string RenPyVcVersion = "renpy_vc_version";
/// <summary>The rule's own extractor, named as the rules file names it (<c>pe_file_version</c>, <c>strings_regex</c>, …).</summary>
public static string Of(VersionExtractorType type) => type switch
{
@@ -26,6 +62,10 @@ public static class EngineVersionSource
VersionExtractorType.StringsRegex => "strings_regex",
VersionExtractorType.ManifestField => "manifest_field",
VersionExtractorType.UnrealBuild => "unreal_build",
VersionExtractorType.UnityBuild => "unity_build",
VersionExtractorType.GodotBuild => "godot_build",
VersionExtractorType.RpgMakerBuild => "rpgmaker_build",
VersionExtractorType.RenPyBuild => "renpy_build",
_ => throw new ArgumentOutOfRangeException(nameof(type), type, "not a version extractor"),
};
}
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Domain.Detection;
/// <summary>
/// What a Godot title's own files say about the engine it was exported with (beta.19), read from the files on disk.
/// </summary>
/// <remarks>
/// A Godot export's data pack starts with a header — the magic <c>GDPC</c>, the pack format, then the engine's MAJOR, MINOR
/// and PATCH — whether it sits beside the executable (<c>Game.pck</c>) or is appended to it. Measured 2026-10-12 on the
/// owner's two Godot installs: Plethora of Bullets 2 (format 2, 4.2.2) and 衔蝶 (format 2, 4.4.1). The executable's
/// own <c>Godot Engine v4.4.1.stable.official</c> string sits 57 to 78 MB into it — past the 8 MiB the rules' strings scan
/// reads, which is why the old <c>strings_regex</c> extractor never found it.
/// </remarks>
public sealed record GodotBuildFacts
{
/// <summary>The engine's MAJOR, MINOR and PATCH from a data pack's header, or null when no header was read.</summary>
public IReadOnlyList<int>? PackVersion { get; init; }
/// <summary>True when that header was read from a pack appended to the executable, not from a <c>.pck</c> beside it.</summary>
public bool PackEmbedded { get; init; }
/// <summary>The executable's <c>ProductName</c>, or null.</summary>
public string? ExeProductName { get; init; }
/// <summary>The executable's <c>ProductVersion</c>, or null.</summary>
public string? ExeProductVersion { get; init; }
}
@@ -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.Globalization;
using System.Text.RegularExpressions;
namespace FrameLedger.Domain.Detection;
/// <summary>The Godot version a title was exported with (beta.19), decided from <see cref="GodotBuildFacts"/> — or nothing.</summary>
/// <remarks>
/// <para>
/// <b>The ladder:</b> (1) a data pack's header, beside the executable or appended to it — the engine writes its own
/// version there; (2) the executable's version resource, only while its <c>ProductName</c> is still <c>Godot Engine</c>:
/// an export whose project set no version information keeps the engine's (<c>4.2.2.stable.official</c> on Plethora of
/// Bullets 2), and one that set its own carries the game's (衔蝶: <c>0.1.0.3</c>), which is not the engine's.
/// </para>
/// <para>
/// A zero patch is not written, because Godot does not write it: 4.3, 4.2.2.
/// </para>
/// </remarks>
public static partial class GodotVersion
{
/// <summary>The product name a Godot export keeps when its project set none.</summary>
public const string EngineProductName = "Godot Engine";
/// <summary>The version these facts establish, and the witness it rests on.</summary>
public static EngineVersionReading Decide(GodotBuildFacts facts)
{
ArgumentNullException.ThrowIfNull(facts);
if (facts.PackVersion is { Count: >= 3 } pack && Format(pack[0], pack[1], pack[2]) is { } fromPack)
{
return new EngineVersionReading(fromPack, facts.PackEmbedded ? EngineVersionSource.GodotPackEmbedded : EngineVersionSource.GodotPack);
}
if (string.Equals(facts.ExeProductName?.Trim(), EngineProductName, StringComparison.OrdinalIgnoreCase)
&& facts.ExeProductVersion is { } text && ProductShape().Match(text.Trim()) is { Success: true } m
&& Format(Parse(m.Groups["major"].Value), Parse(m.Groups["minor"].Value), m.Groups["patch"].Success ? Parse(m.Groups["patch"].Value) : 0) is { } fromExe)
{
return new EngineVersionReading(fromExe, EngineVersionSource.GodotExe);
}
return EngineVersionReading.None;
}
/// <summary><c>4.2.2</c>, <c>4.3</c> — or null for numbers no Godot release carries (a pack written by something else).</summary>
private static string? Format(int major, int minor, int patch) =>
major is < 1 or > 9 || minor is < 0 or > 99 || patch is < 0 or > 99
? null
: patch == 0
? string.Create(CultureInfo.InvariantCulture, $"{major}.{minor}")
: string.Create(CultureInfo.InvariantCulture, $"{major}.{minor}.{patch}");
private static int Parse(string digits) =>
int.TryParse(digits, NumberStyles.None, CultureInfo.InvariantCulture, out int value) ? value : -1;
[GeneratedRegex(@"^(?<major>\d{1,2})\.(?<minor>\d{1,2})(?:\.(?<patch>\d{1,2}))?(?:\.[a-z]|$)", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex ProductShape();
}
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Domain.Detection;
/// <summary>
/// What a Ren'Py title's own files say about the engine it was built with (beta.20), read from the files on disk.
/// </summary>
/// <remarks>
/// Ren'Py ships its engine as Python beside the game's launcher, and the engine's <c>renpy/vc_version.py</c> names its
/// release: <c>version = '8.5.0.25111603'</c>, with <c>version_name</c>, <c>branch</c>, <c>official</c> and <c>nightly</c>
/// beside it. Measured 2026-10-12 on the owner's one Ren'Py install, Bound Between Desks (Steam): <c>8.5.0.25111603</c>,
/// the same number the game's own <c>log.txt</c> printed at its last start (<c>Ren'Py 8.5.0.25111603</c>). Its launcher
/// executable carries no version resource.
/// </remarks>
public sealed record RenPyBuildFacts
{
/// <summary>The <c>version</c> string of <c>renpy/vc_version.py</c> (<c>8.5.0.25111603</c>), or null when it names none.</summary>
public string? VcVersion { get; init; }
}
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Text.RegularExpressions;
namespace FrameLedger.Domain.Detection;
/// <summary>The Ren'Py version a title was built with (beta.20), decided from <see cref="RenPyBuildFacts"/> — or nothing.</summary>
/// <remarks>
/// One witness: the engine's own <c>renpy/vc_version.py</c>. Its <c>version</c> carries a fourth number, the build
/// (<c>8.5.0.25111603</c>); a Ren'Py release is named by the first three (Ren'Py 8.5.0), so those are kept. A title whose
/// engine names no version there reads as none — nothing else is guessed from.
/// </remarks>
public static partial class RenPyVersion
{
/// <summary>The version these facts establish, and the witness it rests on.</summary>
public static EngineVersionReading Decide(RenPyBuildFacts facts)
{
ArgumentNullException.ThrowIfNull(facts);
return facts.VcVersion is { } text && Shape().Match(text.Trim()) is { Success: true } m
&& Parse(m.Groups["major"].Value) is >= 1 and <= 99 and int major
&& Parse(m.Groups["minor"].Value) is >= 0 and int minor
&& Parse(m.Groups["patch"].Value) is >= 0 and int patch
? new EngineVersionReading(string.Create(CultureInfo.InvariantCulture, $"{major}.{minor}.{patch}"), EngineVersionSource.RenPyVcVersion)
: EngineVersionReading.None;
}
private static int Parse(string digits) =>
int.TryParse(digits, NumberStyles.None, CultureInfo.InvariantCulture, out int value) ? value : -1;
[GeneratedRegex(@"^(?<major>\d{1,2})\.(?<minor>\d{1,3})\.(?<patch>\d{1,3})(?:\.\d{1,12})?$", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex Shape();
}
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Domain.Detection;
/// <summary>
/// What an RPG Maker title's own files say about the maker that built it (beta.19), read from the files on disk.
/// </summary>
/// <remarks>
/// <para>
/// <b>MV and MZ</b> ship their engine as JavaScript, and its core script opens with its own name and version — line 2 of
/// <c>js/rmmz_core.js</c> reads <c>// rmmz_core.js v1.10.0</c> (A Doll's Locket - Remake), of <c>www/js/rpg_core.js</c>
/// <c>// rpg_core.js v1.6.2</c> (Flower in Us, 996IR) or <c>v1.6.1</c> (HELLO, HELLO WORLD!) — measured 2026-10-12.
/// </para>
/// <para>
/// <b>XP, VX and VX Ace</b> run on the Ruby Game Scripting System, whose library <c>Game.ini</c> names
/// (<c>Library=System\RGSS301.dll</c>): RGSS1 is XP, RGSS2 VX, RGSS3 VX Ace, and the name carries the library's version
/// (<c>RGSS301</c> is 3.0.1; its version resource reads <c>3, 0, 1, 1</c> on City of Bones and Träumerei Chapter 2).
/// </para>
/// </remarks>
public sealed record RpgMakerBuildFacts
{
/// <summary>The core script whose header was read — <c>rmmz_core.js</c> or <c>rpg_core.js</c> — or null.</summary>
public string? CoreScript { get; init; }
/// <summary>The version that script's header names (<c>1.10.0</c>), or null.</summary>
public string? CoreScriptVersion { get; init; }
/// <summary>The RGSS library's file name (<c>RGSS301.dll</c>), as <c>Game.ini</c> names it or as found, or null.</summary>
public string? RgssLibrary { get; init; }
/// <summary>That library's numeric file version (four parts), or null when it carries none or was not read.</summary>
public IReadOnlyList<int>? RgssFileVersion { get; init; }
}
@@ -0,0 +1,77 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Text.RegularExpressions;
namespace FrameLedger.Domain.Detection;
/// <summary>
/// Which RPG Maker built a title, and at which version (beta.19), decided from <see cref="RpgMakerBuildFacts"/> — or nothing.
/// The witness names the maker: the App shows <c>rpgmaker_mv</c> as "RPG Maker MZ" when the version came from MZ's core
/// script, and <c>rpgmaker_rgss</c> as "RPG Maker VX Ace" when it came from an RGSS3 library.
/// </summary>
public static partial class RpgMakerVersion
{
/// <summary>MZ's core script.</summary>
public const string MzCoreScript = "rmmz_core.js";
/// <summary>MV's core script.</summary>
public const string MvCoreScript = "rpg_core.js";
/// <summary>The version these facts establish, and the witness it rests on.</summary>
public static EngineVersionReading Decide(RpgMakerBuildFacts facts)
{
ArgumentNullException.ThrowIfNull(facts);
if (ScriptVersion(facts.CoreScriptVersion) is { } script)
{
if (string.Equals(facts.CoreScript, MzCoreScript, StringComparison.OrdinalIgnoreCase))
{
return new EngineVersionReading(script, EngineVersionSource.RpgMakerMzCore);
}
if (string.Equals(facts.CoreScript, MvCoreScript, StringComparison.OrdinalIgnoreCase))
{
return new EngineVersionReading(script, EngineVersionSource.RpgMakerMvCore);
}
}
if (facts.RgssLibrary is null || LibraryShape().Match(facts.RgssLibrary.Trim()) is not { Success: true } m)
{
return EngineVersionReading.None;
}
int generation = m.Groups["generation"].Value[0] - '0';
string source = generation switch
{
1 => EngineVersionSource.Rgss1Library,
2 => EngineVersionSource.Rgss2Library,
_ => EngineVersionSource.Rgss3Library,
};
// The library's own numbers when they are its generation's; else the ones its name carries (RGSS301 → 3.0.1).
string version = facts.RgssFileVersion is { Count: >= 3 } parts && parts[0] == generation && parts[1] is >= 0 and <= 9 && parts[2] is >= 0 and <= 9
? string.Create(CultureInfo.InvariantCulture, $"{parts[0]}.{parts[1]}.{parts[2]}")
: string.Create(CultureInfo.InvariantCulture, $"{generation}.{m.Groups["minor"].Value}.{m.Groups["patch"].Value}");
return new EngineVersionReading(version, source);
}
/// <summary>A core script's version as its header writes it (<c>1.10.0</c>), or null when it does not read as one.</summary>
public static string? ScriptVersion(string? text)
{
if (string.IsNullOrWhiteSpace(text))
{
return null;
}
Match m = ScriptShape().Match(text.Trim());
return m.Success ? m.Value : null;
}
[GeneratedRegex(@"^\d{1,2}\.\d{1,3}\.\d{1,3}$", RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex ScriptShape();
[GeneratedRegex(@"^RGSS(?<generation>[123])(?<minor>\d)(?<patch>\d)[A-Z]?\.dll$", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase, matchTimeoutMilliseconds: 250)]
private static partial Regex LibraryShape();
}
@@ -232,8 +232,10 @@ public sealed class RuleEvaluator
? v
: null,
// Not answerable from the snapshot: StaticGameDetector reads the engine's build facts for the one engine
// that matched (beta.10) — a scan the probe must not make for every game in the library.
VersionExtractorType.UnrealBuild => null,
// that matched (beta.10; Unity, Godot and RPG Maker since beta.19) — reads the probe must not make for every
// game in the library.
VersionExtractorType.UnrealBuild or VersionExtractorType.UnityBuild or VersionExtractorType.GodotBuild
or VersionExtractorType.RpgMakerBuild or VersionExtractorType.RenPyBuild => null,
_ => null,
};
}
@@ -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.Domain.Detection;
/// <summary>
/// What a Unity title's own files say about the engine it was built with (beta.19): read from the files on disk, never from
/// the game's process (CLAUDE.md rule 4 is about game memory).
/// </summary>
/// <remarks>
/// Measured read-only on the owner's fifteen Unity installs, 2026-10-12 (<c>05_DETECTION</c> §Engine version — Unity, Godot,
/// RPG Maker): the player library's <c>ProductVersion</c> names the editor version in thirteen
/// (<c>2022.3.39f1 (4e1b0f82c39a)</c>); a 2019.4 player carries only numbers there, and its data file's header names it
/// (<c>2019.4.1f1</c>); GIRLS' FRONTLINE 2's data file is encrypted, and its player's numeric file version
/// (<c>2019.4.40.16762411</c>) is all there is.
/// </remarks>
public sealed record UnityBuildFacts
{
/// <summary><c>UnityPlayer.dll</c>'s <c>ProductVersion</c> string, or null.</summary>
public string? PlayerProductVersion { get; init; }
/// <summary><c>UnityPlayer.dll</c>'s numeric file version (four parts), or null when it carries none or was not read.</summary>
public IReadOnlyList<int>? PlayerFileVersion { get; init; }
/// <summary>The editor version the header of <c>&lt;Game&gt;_Data\globalgamemanagers</c> names, as read, or null.</summary>
public string? DataHeaderVersion { get; init; }
}
@@ -0,0 +1,78 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Text.RegularExpressions;
namespace FrameLedger.Domain.Detection;
/// <summary>
/// The Unity version a title was built with (beta.19, owner request: "detect the version of Unity, Godot and RPG Maker
/// games"), decided from <see cref="UnityBuildFacts"/> — or nothing.
/// </summary>
/// <remarks>
/// <para>
/// <b>The ladder, strongest first</b> (measured on fifteen installs 2026-10-12):
/// </para>
/// <list type="number">
/// <item>The player library's <c>ProductVersion</c> is an editor version — <c>2022.3.39f1</c>, the release letter and its
/// number included (thirteen of fifteen).</item>
/// <item>The data file's header names one (A Space for the Unbound: <c>2019.4.1f1</c>, beside a player that carries only
/// numbers).</item>
/// <item>The player's numeric file version: MAJOR.MINOR.PATCH and no release letter (GIRLS' FRONTLINE 2: <c>2019.4.40</c>,
/// whose data file is encrypted). The player library is Unity's own binary — a studio does not number it — so this rung
/// is the engine's, only shorter.</item>
/// </list>
/// <para>
/// Until beta.19 the rules read the player's <c>FileVersion</c> string as it is (<c>2022.3.39.5118735</c>, the build
/// number where the release letter belongs).
/// </para>
/// </remarks>
public static partial class UnityVersion
{
/// <summary>The version these facts establish, and the rung it stands on.</summary>
public static EngineVersionReading Decide(UnityBuildFacts facts)
{
ArgumentNullException.ThrowIfNull(facts);
if (EditorVersion(facts.PlayerProductVersion) is { } product)
{
return new EngineVersionReading(product, EngineVersionSource.UnityPlayer);
}
if (EditorVersion(facts.DataHeaderVersion) is { } header)
{
return new EngineVersionReading(header, EngineVersionSource.UnityData);
}
return facts.PlayerFileVersion is { Count: >= 3 } parts && IsUnityMajor(parts[0]) && parts[1] is >= 0 and <= 99 && parts[2] is >= 0 and <= 999
? new EngineVersionReading(string.Create(CultureInfo.InvariantCulture, $"{parts[0]}.{parts[1]}.{parts[2]}"), EngineVersionSource.UnityPlayerFile)
: EngineVersionReading.None;
}
/// <summary>
/// The editor version a text starts with — <c>2022.3.39f1</c> of <c>2022.3.39f1 (4e1b0f82c39a)</c>, <c>6000.0.58f2</c> —
/// or null when it is not one: a major Unity never used, or no release letter (<c>2019.4.1.15122501</c>).
/// </summary>
public static string? EditorVersion(string? text)
{
if (string.IsNullOrWhiteSpace(text))
{
return null;
}
Match m = EditorShape().Match(text.Trim());
return m.Success && int.TryParse(m.Groups["major"].Value, NumberStyles.None, CultureInfo.InvariantCulture, out int major) && IsUnityMajor(major)
? m.Groups["version"].Value
: null;
}
/// <summary>
/// The majors Unity has shipped: 3 to 5, the years 2017 to 2023, and Unity 6's <c>6000</c> line (6000.0 is Unity 6,
/// 6000.3 is 6.3).
/// </summary>
private static bool IsUnityMajor(int major) => major is >= 3 and <= 5 or >= 2017 and <= 2023 or >= 6000 and <= 6999;
[GeneratedRegex(@"^(?<version>(?<major>\d{1,4})\.\d{1,2}\.\d{1,3}[abfpx]\d{1,3})(?![\d.])", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex EditorShape();
}
@@ -25,4 +25,22 @@ public enum VersionExtractorType
/// matched — so <see cref="RuleEvaluator"/> returns null for it.
/// </summary>
UnrealBuild,
/// <summary>
/// Unity's (beta.19): the player library's version resource and the data file's header, weighed by
/// <see cref="UnityVersion.Decide"/>. A second read, like <see cref="UnrealBuild"/>.
/// </summary>
UnityBuild,
/// <summary>Godot's (beta.19): a data pack's header and the executable's version resource (<see cref="GodotVersion.Decide"/>).</summary>
GodotBuild,
/// <summary>
/// RPG Maker's (beta.19): MV/MZ's core-script header, or the RGSS library <c>Game.ini</c> names
/// (<see cref="RpgMakerVersion.Decide"/>).
/// </summary>
RpgMakerBuild,
/// <summary>Ren'Py's (beta.20): the <c>version</c> line of the engine's <c>renpy/vc_version.py</c> (<see cref="RenPyVersion.Decide"/>).</summary>
RenPyBuild,
}
@@ -225,6 +225,10 @@ public sealed class DetectionRulesFile : IDetectionRulesSource
"strings_regex" => VersionExtractorType.StringsRegex,
"manifest_field" => VersionExtractorType.ManifestField,
"unreal_build" => VersionExtractorType.UnrealBuild,
"unity_build" => VersionExtractorType.UnityBuild,
"godot_build" => VersionExtractorType.GodotBuild,
"rpgmaker_build" => VersionExtractorType.RpgMakerBuild,
"renpy_build" => VersionExtractorType.RenPyBuild,
_ => throw new InvalidOperationException($"'{owner}' has unknown version extractor '{d.Type}'"),
},
Value = d.Value,
@@ -124,6 +124,131 @@ public sealed class GameFileProbe : IGameFileProbe
return ValueTask.FromResult(ShippingExecutable(snapshot) is { } exe ? UnrealBuildReader.Read(exe.FullPath, exe.RelativePath, ct) : null);
}
/// <inheritdoc />
/// <remarks>
/// <c>UnityPlayer.dll</c> beside the row's executable, else the shallowest one the walk listed; the data file is
/// <c>&lt;exe&gt;_Data\globalgamemanagers</c>, else the one in a <c>*_Data</c> folder beside that player.
/// </remarks>
public ValueTask<UnityBuildFacts?> ReadUnityBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(snapshot);
ct.ThrowIfCancellationRequested();
string exe = Native(snapshot.ExePath);
string? exeDirectory = Path.GetDirectoryName(exe);
string? beside = exeDirectory is null ? null : Path.Combine(exeDirectory, "UnityPlayer.dll");
string? player = beside is not null && File.Exists(beside) ? beside : Shallowest(snapshot, static name => string.Equals(name, "UnityPlayer.dll", StringComparison.OrdinalIgnoreCase));
return ValueTask.FromResult(UnityBuildReader.Read(player, UnityDataFile(snapshot, exe, player)));
}
/// <inheritdoc />
/// <remarks>The pack is <c>&lt;exe&gt;.pck</c> beside the executable, else the only <c>.pck</c> there; else the executable's own end.</remarks>
public ValueTask<GodotBuildFacts?> ReadGodotBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(snapshot);
ct.ThrowIfCancellationRequested();
string exe = Native(snapshot.ExePath);
return ValueTask.FromResult(GodotBuildReader.Read(exe, GodotPack(exe)));
}
/// <inheritdoc />
/// <remarks>The core script or <c>Game.ini</c> beside the executable or up to two folders above; else an RGSS library the walk listed.</remarks>
public ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(snapshot);
ct.ThrowIfCancellationRequested();
string? library = Shallowest(snapshot, static name => name.StartsWith("RGSS", StringComparison.OrdinalIgnoreCase) && name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase));
return ValueTask.FromResult(RpgMakerBuildReader.Read(Native(snapshot.ExePath), library));
}
/// <inheritdoc />
/// <remarks>The engine's <c>renpy/vc_version.py</c> beside the launcher, where Ren'Py keeps it.</remarks>
public ValueTask<RenPyBuildFacts?> ReadRenPyBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(snapshot);
ct.ThrowIfCancellationRequested();
return ValueTask.FromResult(RenPyBuildReader.Read(Native(snapshot.ExePath)));
}
private static string Native(string path) => path.Replace('/', Path.DirectorySeparatorChar);
/// <summary>The full path of the shallowest file the walk listed whose name <paramref name="named"/> accepts, or null.</summary>
private static string? Shallowest(GameFileSnapshot snapshot, Func<string, bool> named)
{
string? best = null;
int bestDepth = int.MaxValue;
foreach (string relative in snapshot.RelativeFiles)
{
int slash = relative.LastIndexOf('/');
if (!named(relative[(slash + 1)..]))
{
continue;
}
int depth = relative.Count(static c => c == '/');
if (depth < bestDepth)
{
(best, bestDepth) = (relative, depth);
}
}
return best is null ? null : Native(snapshot.GameDirectory.TrimEnd('/') + "/" + best);
}
private static string? UnityDataFile(GameFileSnapshot snapshot, string exe, string? player)
{
string? exeDirectory = Path.GetDirectoryName(exe);
if (exeDirectory is not null)
{
string own = Path.Combine(exeDirectory, Path.GetFileNameWithoutExtension(exe) + "_Data", "globalgamemanagers");
if (File.Exists(own))
{
return own;
}
}
string? playerDirectory = player is null ? null : Path.GetDirectoryName(player);
if (playerDirectory is null)
{
return null;
}
try
{
return Directory.EnumerateDirectories(playerDirectory, "*_Data")
.Select(static d => Path.Combine(d, "globalgamemanagers"))
.FirstOrDefault(File.Exists);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
private static string? GodotPack(string exe)
{
string? directory = Path.GetDirectoryName(exe);
if (directory is null)
{
return null;
}
string own = Path.Combine(directory, Path.GetFileNameWithoutExtension(exe) + ".pck");
if (File.Exists(own))
{
return own;
}
try
{
string[] packs = [.. Directory.EnumerateFiles(directory, "*.pck").Take(2)];
return packs.Length == 1 ? packs[0] : null;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
/// <summary>
/// The executable an Unreal title's engine version is read from (beta.10): the row's own when it is the shipping build
/// (<c>*-Win64-Shipping.exe</c>, <c>*-WinGDK-Shipping.exe</c> — what <c>ExecutableLocator</c> prefers), else the largest
@@ -303,9 +428,9 @@ public sealed class GameFileProbe : IGameFileProbe
/// name, keyed by the <c>from</c> value.
/// </summary>
/// <remarks>
/// Unity's rule reads <c>UnityPlayer.dll</c>. Answering that from the game
/// executable would report a version that is <em>wrong</em> rather than
/// merely missing, which is the worse of the two failures.
/// CryEngine's rule reads <c>CrySystem.dll</c> (Unity's read <c>UnityPlayer.dll</c> until beta.19, when its version
/// became <see cref="ReadUnityBuildAsync"/>'s). Answering that from the game executable would report a version that is
/// <em>wrong</em> rather than merely missing, which is the worse of the two failures.
/// </remarks>
private static Dictionary<string, string> ReadSiblingVersions(string dir, DetectionRuleSet rules)
{
@@ -0,0 +1,116 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Buffers.Binary;
using System.Diagnostics;
using FrameLedger.Domain.Detection;
namespace FrameLedger.Infrastructure.Detection;
/// <summary>
/// Godot's build facts from the files on disk (beta.19, <c>05_DETECTION</c> §Engine version — Unity, Godot, RPG Maker): the
/// 20-byte header of the data pack — <c>GDPC</c>, the pack format, the engine's MAJOR, MINOR and PATCH, little-endian — from
/// a <c>.pck</c> beside the executable, or from a pack appended to the executable, which ends with the pack's size and the
/// magic again; and the executable's version resource. Nothing else of either file is read.
/// </summary>
public static class GodotBuildReader
{
/// <summary><c>GDPC</c> as the little-endian <c>uint</c> a pack starts (and an appended pack ends) with.</summary>
public const uint PackMagic = 0x43504447;
/// <summary>The header: magic, format, major, minor, patch.</summary>
public const int HeaderBytes = 20;
/// <summary>What an appended pack leaves at the end of the executable: its size (a 64-bit integer), then the magic.</summary>
public const int TrailerBytes = 12;
/// <summary>The facts for <paramref name="exePath"/>, or null when nothing could be read.</summary>
/// <param name="exePath">The game's executable.</param>
/// <param name="packPath">The <c>.pck</c> beside it, or null when there is none.</param>
public static GodotBuildFacts? Read(string exePath, string? packPath)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
IReadOnlyList<int>? pack = packPath is null ? null : ReadFile(packPath, static s => ReadHeader(s, 0));
bool embedded = false;
if (pack is null)
{
pack = ReadFile(exePath, ReadAppended);
embedded = pack is not null;
}
string? productName = null;
string? productVersion = null;
try
{
FileVersionInfo info = FileVersionInfo.GetVersionInfo(exePath);
productName = string.IsNullOrWhiteSpace(info.ProductName) ? null : info.ProductName.Trim();
productVersion = string.IsNullOrWhiteSpace(info.ProductVersion) ? null : info.ProductVersion.Trim();
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
{
// The pack, if read, is the stronger witness anyway.
}
return pack is null && productName is null && productVersion is null
? null
: new GodotBuildFacts { PackVersion = pack, PackEmbedded = embedded, ExeProductName = productName, ExeProductVersion = productVersion };
}
/// <summary>MAJOR, MINOR, PATCH from a header at <paramref name="offset"/>, or null when there is none. Public for the tests.</summary>
public static IReadOnlyList<int>? ReadHeader(Stream stream, long offset)
{
ArgumentNullException.ThrowIfNull(stream);
if (offset < 0 || offset + HeaderBytes > stream.Length)
{
return null;
}
Span<byte> header = stackalloc byte[HeaderBytes];
stream.Position = offset;
if (stream.ReadAtLeast(header, HeaderBytes, throwOnEndOfStream: false) < HeaderBytes
|| BinaryPrimitives.ReadUInt32LittleEndian(header) != PackMagic)
{
return null;
}
uint major = BinaryPrimitives.ReadUInt32LittleEndian(header[8..]);
uint minor = BinaryPrimitives.ReadUInt32LittleEndian(header[12..]);
uint patch = BinaryPrimitives.ReadUInt32LittleEndian(header[16..]);
return major > 99 || minor > 99 || patch > 99 ? null : [(int)major, (int)minor, (int)patch];
}
/// <summary>The header of a pack appended to an executable, found through the trailer it ends with. Public for the tests.</summary>
public static IReadOnlyList<int>? ReadAppended(Stream stream)
{
ArgumentNullException.ThrowIfNull(stream);
long length = stream.Length;
if (length < TrailerBytes + HeaderBytes)
{
return null;
}
Span<byte> trailer = stackalloc byte[TrailerBytes];
stream.Position = length - TrailerBytes;
if (stream.ReadAtLeast(trailer, TrailerBytes, throwOnEndOfStream: false) < TrailerBytes
|| BinaryPrimitives.ReadUInt32LittleEndian(trailer[8..]) != PackMagic)
{
return null;
}
long size = BinaryPrimitives.ReadInt64LittleEndian(trailer);
return size < HeaderBytes || size > length - TrailerBytes ? null : ReadHeader(stream, length - TrailerBytes - size);
}
private static IReadOnlyList<int>? ReadFile(string path, Func<Stream, IReadOnlyList<int>?> read)
{
try
{
using var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
return read(file);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
}
@@ -0,0 +1,49 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Text;
using System.Text.RegularExpressions;
using FrameLedger.Domain.Detection;
namespace FrameLedger.Infrastructure.Detection;
/// <summary>
/// Ren'Py's build facts from the files on disk (beta.20, <c>05_DETECTION</c> §Engine version — Ren'Py): the <c>version</c>
/// line of the engine's <c>renpy/vc_version.py</c>, which Ren'Py keeps beside the game's launcher — read from its first
/// <see cref="VersionFileBytes"/> bytes. Nothing else of the engine's files is read.
/// </summary>
public static partial class RenPyBuildReader
{
/// <summary>How much of <c>vc_version.py</c> is read: the measured file is 109 bytes.</summary>
public const int VersionFileBytes = 4096;
/// <summary>The facts for the launcher <paramref name="exePath"/>, or null when its engine's version file names none.</summary>
public static RenPyBuildFacts? Read(string exePath)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
string? folder = Path.GetDirectoryName(exePath);
return folder is null ? null : ReadVersionFile(Path.Combine(folder, "renpy", "vc_version.py"));
}
/// <summary>The <c>version</c> a <c>vc_version.py</c> names, or null. Public for the tests.</summary>
public static RenPyBuildFacts? ReadVersionFile(string path)
{
ArgumentException.ThrowIfNullOrWhiteSpace(path);
try
{
using var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
byte[] head = new byte[VersionFileBytes];
int read = file.ReadAtLeast(head, head.Length, throwOnEndOfStream: false);
Match m = VersionLine().Match(Encoding.UTF8.GetString(head, 0, read));
return m.Success ? new RenPyBuildFacts { VcVersion = m.Groups["version"].Value } : null;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
/// <summary><c>version = '8.5.0.25111603'</c> at the start of a line — never <c>version_name</c>, whose name goes on.</summary>
[GeneratedRegex(@"^version\s*=\s*['""](?<version>[^'""\r\n]{1,64})['""]", RegexOptions.ExplicitCapture | RegexOptions.Multiline | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex VersionLine();
}
@@ -0,0 +1,151 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using FrameLedger.Domain.Detection;
namespace FrameLedger.Infrastructure.Detection;
/// <summary>
/// RPG Maker's build facts from the files on disk (beta.19, <c>05_DETECTION</c> §Engine version — Unity, Godot, RPG Maker):
/// the first <see cref="ScriptHeaderBytes"/> of MV/MZ's core script (<c>js/rmmz_core.js</c>, <c>www/js/rpg_core.js</c>,
/// <c>js/rpg_core.js</c>), or <c>Game.ini</c>'s <c>Library=</c> line and that RGSS library's version resource — beside the
/// executable or up to two folders above it, as <c>RpgMakerTitle</c> looks (a launcher-fronted game keeps its runtime in a
/// subfolder: HELLO, HELLO WORLD!'s is <c>swiftshader\</c>, A Doll's Locket's <c>css\</c>). Nothing else is read.
/// </summary>
public static partial class RpgMakerBuildReader
{
/// <summary>How much of a core script is read: its opening comment block, with room to spare (the version is on line 2).</summary>
public const int ScriptHeaderBytes = 4096;
/// <summary>A <c>Game.ini</c> larger than this is not RPG Maker's (it holds four short lines).</summary>
public const long MaxIniBytes = 64 * 1024;
/// <summary>How many folders above the executable's own are looked in.</summary>
public const int FoldersUp = 2;
private static readonly (string Relative, string Script)[] _scripts =
[
(Path.Combine("js", RpgMakerVersion.MzCoreScript), RpgMakerVersion.MzCoreScript),
(Path.Combine("www", "js", RpgMakerVersion.MvCoreScript), RpgMakerVersion.MvCoreScript),
(Path.Combine("js", RpgMakerVersion.MvCoreScript), RpgMakerVersion.MvCoreScript),
];
/// <summary>The facts for an entry at <paramref name="exePath"/>, or null when none of the files is there.</summary>
/// <param name="exePath">The entry's executable.</param>
/// <param name="rgssLibrary">An RGSS library the install listing holds, for an install with no readable <c>Game.ini</c>; or null.</param>
public static RpgMakerBuildFacts? Read(string exePath, string? rgssLibrary = null)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
string? folder = Path.GetDirectoryName(exePath);
for (int up = 0; up <= FoldersUp && !string.IsNullOrEmpty(folder); up++, folder = Path.GetDirectoryName(folder))
{
foreach ((string relative, string script) in _scripts)
{
if (ScriptVersion(Path.Combine(folder, relative), script) is { } version)
{
return new RpgMakerBuildFacts { CoreScript = script, CoreScriptVersion = version };
}
}
if (LibraryOf(Path.Combine(folder, "Game.ini")) is { } library)
{
return Rgss(library);
}
}
return rgssLibrary is null ? null : Rgss(rgssLibrary);
}
/// <summary>The version a core script's header names for <paramref name="script"/>, or null. Public for the tests.</summary>
public static string? ScriptVersion(string path, string script)
{
ArgumentException.ThrowIfNullOrWhiteSpace(path);
try
{
using var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
byte[] head = new byte[ScriptHeaderBytes];
int read = file.ReadAtLeast(head, head.Length, throwOnEndOfStream: false);
foreach (Match m in HeaderLine().Matches(Encoding.UTF8.GetString(head, 0, read)))
{
if (string.Equals(m.Groups["script"].Value, script, StringComparison.OrdinalIgnoreCase))
{
return RpgMakerVersion.ScriptVersion(m.Groups["version"].Value);
}
}
return null;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
/// <summary>
/// The library a <c>Game.ini</c> names (<c>Library=System\RGSS301.dll</c>), as a full path under the ini's folder — or
/// its bare file name when the value points outside that folder, which is then not read. Null without the line.
/// </summary>
public static string? LibraryOf(string iniPath)
{
ArgumentException.ThrowIfNullOrWhiteSpace(iniPath);
try
{
var ini = new FileInfo(iniPath);
if (!ini.Exists || ini.Length > MaxIniBytes || ini.DirectoryName is not { } folder)
{
return null;
}
foreach (string line in File.ReadLines(iniPath, Encoding.Latin1))
{
Match m = LibraryLine().Match(line);
if (!m.Success)
{
continue;
}
string value = m.Groups["value"].Value.Trim();
string full = Path.GetFullPath(Path.Combine(folder, value));
return full.StartsWith(Path.TrimEndingDirectorySeparator(folder) + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)
? full
: Path.GetFileName(value);
}
return null;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or NotSupportedException)
{
return null;
}
}
private static RpgMakerBuildFacts Rgss(string library)
{
IReadOnlyList<int>? version = null;
if (Path.IsPathFullyQualified(library))
{
try
{
FileVersionInfo info = FileVersionInfo.GetVersionInfo(library);
version = info.FileMajorPart == 0 && info.FileMinorPart == 0 && info.FileBuildPart == 0 && info.FilePrivatePart == 0
? null
: [info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart];
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
{
// The name still carries the version (RGSS301 is 3.0.1).
}
}
return new RpgMakerBuildFacts { RgssLibrary = Path.GetFileName(library), RgssFileVersion = version };
}
[GeneratedRegex(@"^//\s*(?<script>rmmz_core\.js|rpg_core\.js)\s+v(?<version>\d{1,2}\.\d{1,3}\.\d{1,3})\b", RegexOptions.ExplicitCapture | RegexOptions.Multiline | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex HeaderLine();
[GeneratedRegex(@"^\s*Library\s*=\s*(?<value>\S.*)$", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase, matchTimeoutMilliseconds: 250)]
private static partial Regex LibraryLine();
}
@@ -0,0 +1,71 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using FrameLedger.Domain.Detection;
namespace FrameLedger.Infrastructure.Detection;
/// <summary>
/// Unity's build facts from the files on disk (beta.19, <c>05_DETECTION</c> §Engine version — Unity, Godot, RPG Maker): the
/// player library's version resource and the first <see cref="DataHeaderBytes"/> bytes of the data file
/// <c>globalgamemanagers</c>, whose serialized-file header names the editor version (at byte 20 in a 2019.4 build, 48 in
/// later ones). Nothing else of either file is read; the game's process is never opened.
/// </summary>
public static partial class UnityBuildReader
{
/// <summary>How much of the data file is read: its header, with room to spare (the version sat at 48 at the latest).</summary>
public const int DataHeaderBytes = 256;
/// <summary>The facts in the two files, or null when neither gave any.</summary>
/// <param name="playerPath"><c>UnityPlayer.dll</c>, or null when the install has none.</param>
/// <param name="dataFilePath"><c>&lt;Game&gt;_Data\globalgamemanagers</c>, or null.</param>
public static UnityBuildFacts? Read(string? playerPath, string? dataFilePath)
{
string? product = null;
IReadOnlyList<int>? numeric = null;
if (playerPath is not null)
{
try
{
FileVersionInfo info = FileVersionInfo.GetVersionInfo(playerPath);
product = string.IsNullOrWhiteSpace(info.ProductVersion) ? null : info.ProductVersion.Trim();
numeric = info.FileMajorPart == 0 && info.FileMinorPart == 0 && info.FileBuildPart == 0 && info.FilePrivatePart == 0
? null
: [info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart];
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
{
// No version resource read: the data file may still say it.
}
}
string? header = dataFilePath is null ? null : DataHeaderVersion(dataFilePath);
return product is null && numeric is null && header is null
? null
: new UnityBuildFacts { PlayerProductVersion = product, PlayerFileVersion = numeric, DataHeaderVersion = header };
}
/// <summary>The editor version in the first <see cref="DataHeaderBytes"/> of a data file, or null. Public for the tests.</summary>
public static string? DataHeaderVersion(string dataFilePath)
{
ArgumentException.ThrowIfNullOrWhiteSpace(dataFilePath);
try
{
using var file = new FileStream(dataFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
byte[] head = new byte[DataHeaderBytes];
int read = file.ReadAtLeast(head, head.Length, throwOnEndOfStream: false);
Match m = HeaderVersion().Match(Encoding.Latin1.GetString(head, 0, read));
return m.Success ? UnityVersion.EditorVersion(m.Value) : null;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
[GeneratedRegex(@"\d{1,4}\.\d{1,2}\.\d{1,3}[abfpx]\d{1,3}", RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex HeaderVersion();
}
@@ -24,9 +24,14 @@ namespace FrameLedger.Infrastructure.Import;
/// bootstrapper and as <c>Game-Win64-Shipping.exe</c>.
/// </para>
/// <para>
/// The two layout rules are the engines' own conventions, not guesses about names: a Unity player is <c>X.exe</c>
/// beside a directory <c>X_Data</c>, and an Unreal packaged build's game process is <c>*-Win64-Shipping.exe</c> (the
/// root executable of the same name is a bootstrapper that starts it and exits).
/// The layout rules are the engines' own conventions, not guesses about names: a Unity player is <c>X.exe</c> beside a
/// directory <c>X_Data</c>, an Unreal packaged build's game process is <c>*-Win64-Shipping.exe</c> (the root executable
/// of the same name is a bootstrapper that starts it and exits), and — since beta.19 (owner decision D56) — an NW.js
/// runtime is the executable beside its <c>nw.dll</c> and <c>package.json</c>, which is how an RPG Maker MV/MZ game
/// ships. The last one ranks below the first two and above a name: an NW.js folder can be a tool shipped beside a Unity
/// or Unreal game, and a launcher named after the install is exactly what fronts the runtime on A Doll's Locket - Remake
/// (itch), whose 213 MB <c>DollsLocket.exe</c> starts <c>css\Game.exe</c> — the process that draws, the one D28 pointed
/// HELLO, HELLO WORLD!'s entry at by hand.
/// </para>
/// </remarks>
public sealed class ExecutableLocator : IExecutableLocator
@@ -37,7 +42,8 @@ public sealed class ExecutableLocator : IExecutableLocator
/// </summary>
public const int MaxDepth = 4;
private const int _rankEngineLayout = 2;
private const int _rankEngineLayout = 3;
private const int _rankNwjsRuntime = 2;
private const int _rankNamedAfterTheInstall = 1;
private const int _minimumNameLength = 4;
@@ -50,8 +56,30 @@ public sealed class ExecutableLocator : IExecutableLocator
// 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",
// beta.19: what an NW.js runtime keeps beside itself — Chromium's toast helper (NW.js 0.48.4 on A Doll's Locket - Remake,
// 0.82.0 on Flower in Us), and the SDK flavour's compiler and driver, which the NW.js rank would otherwise weigh as the game.
"notification_helper", "nwjc", "chromedriver",
];
/// <summary>
/// Whole names (no extension) of helpers a runtime ships beside a game, which no store's choice makes the game (beta.19).
/// itch's butler keeps the shallowest candidates and drops those that ask for elevation, so its verdict for A Doll's
/// Locket - Remake named <c>notification_helper.exe</c> and nothing else. Whole names rather than
/// <see cref="HelperFragments"/>: a store names its own pick, and a fragment such as <c>node</c> is inside a real game's
/// name (<c>Nodebuster</c>) — the locator's guess can afford that, overruling a store's verdict cannot.
/// </summary>
public static readonly IReadOnlySet<string> RuntimeHelperNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"notification_helper", "crashpad_handler", "UnityCrashHandler64", "UnityCrashHandler32", "CrashReportClient", "nwjc", "chromedriver",
};
/// <summary>True for a name in <see cref="RuntimeHelperNames"/>.</summary>
public static bool IsRuntimeHelper(string fileNameWithoutExtension)
{
ArgumentNullException.ThrowIfNull(fileNameWithoutExtension);
return RuntimeHelperNames.Contains(fileNameWithoutExtension);
}
/// <summary>
/// Folder-name fragments of what a store install carries beside the game: a folder whose name holds one is not walked.
/// Red Dead Redemption 2's <c>Redistributables\Rockstar-Games-Launcher.exe</c> is 140 MB to <c>RDR2.exe</c>'s 90.
@@ -164,6 +192,11 @@ public sealed class ExecutableLocator : IExecutableLocator
return _rankEngineLayout; // Unreal: the packaged game process, not the root bootstrapper
}
if (dir is not null && File.Exists(Path.Combine(dir, "nw.dll")) && File.Exists(Path.Combine(dir, "package.json")))
{
return _rankNwjsRuntime; // NW.js (RPG Maker MV/MZ): the runtime, not the launcher in front of it (D56)
}
string squashed = Squash(name);
bool named = squashed.Length >= _minimumNameLength && installName.Length >= _minimumNameLength
&& (installName.Contains(squashed, StringComparison.Ordinal) || squashed.Contains(installName, StringComparison.Ordinal));
@@ -99,16 +99,7 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
""", cancellationToken: ct)).ConfigureAwait(false)).Select(static r => new CaveRow(r.GameId, r.LocationPath, r.FolderName, r.CustomFolder, r.Verdict, r.Title))];
}
int added = 0;
foreach (CaveRow cave in caves)
{
if (ToGame(cave) is { } game && byInstall.TryAdd(game.InstallDirectory, game))
{
added++;
}
}
return $"butler.db read: {locations} location(s), {caves.Count} cave(s), {added} title(s)";
return AddCaves(locations, caves, byInstall);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or SqliteException or InvalidOperationException)
{
@@ -126,7 +117,26 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
}
}
private static StoreGame? ToGame(CaveRow cave)
/// <summary>One row per cave the database lists; returns the log fragment — with the titles whose verdict named only a helper.</summary>
private static string AddCaves(int locations, List<CaveRow> caves, Dictionary<string, StoreGame> byInstall)
{
int added = 0;
List<string> helperVerdicts = [];
foreach (CaveRow cave in caves)
{
if (ToGame(cave, helperVerdicts) is { } game && byInstall.TryAdd(game.InstallDirectory, game))
{
added++;
}
}
string note = $"butler.db read: {locations} location(s), {caves.Count} cave(s), {added} title(s)";
return helperVerdicts.Count == 0
? note
: note + $"; butler's verdict named only a helper for {string.Join(", ", helperVerdicts)} — the executable is guessed instead";
}
private static StoreGame? ToGame(CaveRow cave, List<string> helperVerdicts)
{
string? install = !string.IsNullOrWhiteSpace(cave.CustomFolder) ? cave.CustomFolder
: cave.LocationPath is { Length: > 0 } && cave.FolderName is { Length: > 0 } ? Path.Combine(cave.LocationPath, cave.FolderName)
@@ -138,7 +148,13 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
install = Path.GetFullPath(install);
string name = cave.Title is { Length: > 0 } ? cave.Title : ReadReceipt(Path.Combine(install, ".itch", "receipt.json.gz"))?.Title ?? Path.GetFileName(install);
return new StoreGame(_platform, cave.GameId.ToString(System.Globalization.CultureInfo.InvariantCulture), name, install, VerdictExecutable(cave.Verdict, install), Version: null);
string? exe = VerdictExecutable(cave.Verdict, install, out bool onlyHelpers);
if (onlyHelpers)
{
helperVerdicts.Add(name);
}
return new StoreGame(_platform, cave.GameId.ToString(System.Globalization.CultureInfo.InvariantCulture), name, install, exe, Version: null);
}
/// <summary>
@@ -146,8 +162,17 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
/// Windows candidate is the executable butler itself launches; anything else (an HTML5 or Love2D game, a
/// verdict that will not parse) leaves the guess to the locator.
/// </summary>
private static string? VerdictExecutable(string? verdict, string install)
/// <remarks>
/// <b>Not a candidate a runtime ships as a helper (beta.19).</b> butler saves a FILTERED verdict — the shallowest
/// candidates, minus those whose manifest asks for elevation — and does not rank what is left, so on A Doll's Locket -
/// Remake (game 5085165) the one candidate was <c>Dolls Locket/notification_helper.exe</c>: the 213 MB launcher asks for
/// administrator and the NW.js runtime sits a level deeper. The import took it as the game, unmarked as a guess. A
/// candidate <see cref="ExecutableLocator.IsRuntimeHelper"/> names, or one inside a Unity plugin folder, is skipped;
/// when nothing else is left, <paramref name="onlyHelpers"/> is true and the locator guesses — the review says so.
/// </remarks>
private static string? VerdictExecutable(string? verdict, string install, out bool onlyHelpers)
{
onlyHelpers = false;
if (string.IsNullOrWhiteSpace(verdict))
{
return null;
@@ -167,7 +192,15 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
&& string.Equals(flavor.GetString(), "windows", StringComparison.Ordinal);
if (windows && candidate.TryGetProperty("path", out JsonElement path) && path.ValueKind == JsonValueKind.String && path.GetString() is { Length: > 0 } relative)
{
return Path.GetFullPath(Path.Combine(install, relative.Replace('/', Path.DirectorySeparatorChar)));
string full = Path.GetFullPath(Path.Combine(install, relative.Replace('/', Path.DirectorySeparatorChar)));
if (ExecutableLocator.IsRuntimeHelper(Path.GetFileNameWithoutExtension(full)) || ExecutableLocator.IsUnderPluginFolder(install, full))
{
onlyHelpers = true;
continue;
}
onlyHelpers = false;
return full;
}
}
@@ -175,6 +208,7 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
}
catch (JsonException)
{
onlyHelpers = false;
return null;
}
}
@@ -0,0 +1,36 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using Dapper;
using FrameLedger.Application.Persistence;
namespace FrameLedger.Infrastructure.Persistence;
/// <summary>
/// <see cref="IGamePrune"/> over the ledger (beta.19, owner decision D55): one statement that deletes an uninstalled entry
/// only while every stored condition still holds — the same row at the same path, in the library, no session stored
/// (<c>sessions.game_id</c> is the only reference to <c>games</c> and would cascade), and no anti-cheat block, exception or
/// failed-trial mark. Whatever changed between the sweep's read and this write — a session finalized, a block written, the
/// entry re-pointed — leaves the row as it is.
/// </summary>
public sealed class SqliteGamePrune : IGamePrune
{
private const string _delete =
"DELETE FROM games WHERE id = @id AND exe_path = @path AND removed_at IS NULL "
+ "AND hook_blocked_reason IS NULL AND hook_prescan_state <> 'blocked' "
+ "AND ac_exception_at IS NULL AND ac_exception_trial_failed_at IS NULL "
+ "AND NOT EXISTS (SELECT 1 FROM sessions WHERE sessions.game_id = games.id)";
private readonly LedgerDatabase _db;
public SqliteGamePrune(LedgerDatabase db) => _db = db ?? throw new ArgumentNullException(nameof(db));
/// <inheritdoc />
public async ValueTask<bool> RemoveUninstalledAsync(long gameId, string exePath, CancellationToken ct = default)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
int deleted = await _db.WriteAsync((c, tx, token) => c.ExecuteAsync(new CommandDefinition(_delete, new { id = gameId, path = exePath }, tx, cancellationToken: token)), ct)
.ConfigureAwait(false);
return deleted == 1;
}
}
@@ -0,0 +1,86 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Security;
using FrameLedger.Application.Watch;
namespace FrameLedger.Infrastructure.Watch;
/// <summary>
/// <see cref="IExecutablePresence"/> over the file system (beta.19, D55): tells a game that is no longer installed from a
/// drive that is not connected, a different disk under the same letter, and a folder Windows will not list — the cases
/// <c>ExecutableIdentity.Read</c>'s null runs together.
/// </summary>
/// <remarks>
/// <para>
/// <b>Asked of listings, not of <c>Exists</c>.</b> <c>File.Exists</c> and <c>Directory.Exists</c> answer false for a path
/// they may not look at as for one that is not there, so the file is looked for in its folder's listing, and a folder that
/// reads as missing is looked for in its parent's: listed but unreadable is <see cref="ExecutablePresence.Unknown"/>.
/// </para>
/// <para>
/// <b>The drive and the path above the game.</b> A drive that <see cref="VolumeRoots"/> does not list as ready (fixed or
/// removable — never a share) is <see cref="ExecutablePresence.DriveAbsent"/>. When nothing of the path is left but the
/// drive's root, the letter may well be another disk's now (the owner's USB drive has changed letters, 2026-09-22):
/// <see cref="ExecutablePresence.OnlyTheDriveRemains"/>, never a removal. An uninstall leaves the folder the game was
/// installed in — <c>steamapps\common</c>, the itch location, <c>D:\Games</c>.
/// </para>
/// </remarks>
public sealed class ExecutablePresenceProbe : IExecutablePresence
{
private readonly Func<string, bool> _driveReady;
/// <summary>
/// The probe over <paramref name="driveReady"/>: whether a root is a ready fixed or removable drive — by default
/// <see cref="VolumeRoots.IsReady"/>, which asks that one drive rather than listing them all for every entry.
/// </summary>
public ExecutablePresenceProbe(Func<string, bool>? driveReady = null) => _driveReady = driveReady ?? VolumeRoots.IsReady;
/// <inheritdoc />
public ExecutablePresence Probe(string exePath)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
try
{
string full = Path.GetFullPath(exePath);
string? root = Path.GetPathRoot(full);
string? folder = Path.GetDirectoryName(full);
if (string.IsNullOrEmpty(root) || folder is null || full.StartsWith(@"\\", StringComparison.Ordinal))
{
return ExecutablePresence.Unknown;
}
if (!_driveReady(root))
{
return ExecutablePresence.DriveAbsent;
}
if (Directory.Exists(folder))
{
return Directory.EnumerateFiles(folder, Path.GetFileName(full)).Any() ? ExecutablePresence.Present : Gone(folder, root);
}
// The folder reads as missing: up to the nearest folder that is there, which must list the one below it as absent.
string missing = folder;
string? parent = Path.GetDirectoryName(missing);
while (parent is not null && !Directory.Exists(parent))
{
missing = parent;
parent = Path.GetDirectoryName(parent);
}
return parent is null || Directory.EnumerateDirectories(parent, Path.GetFileName(missing)).Any()
? ExecutablePresence.Unknown
: Gone(parent, root);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or NotSupportedException or SecurityException)
{
return ExecutablePresence.Unknown;
}
}
/// <summary>Gone from <paramref name="nearest"/>, the nearest folder still there — unless that is the drive's root.</summary>
private static ExecutablePresence Gone(string nearest, string root) =>
string.Equals(Path.TrimEndingDirectorySeparator(nearest), Path.TrimEndingDirectorySeparator(root), StringComparison.OrdinalIgnoreCase)
? ExecutablePresence.OnlyTheDriveRemains
: ExecutablePresence.FileGone;
}
@@ -30,4 +30,23 @@ public static class VolumeRoots
return roots;
}
/// <summary>
/// Whether the one drive <paramref name="root"/> names is a ready fixed or removable drive (beta.19) — the same test as
/// <see cref="Ready"/>, asked of one drive. The type is read first: a network or optical drive is never asked whether it
/// is ready, which can block for seconds on a share that went away.
/// </summary>
public static bool IsReady(string root)
{
ArgumentException.ThrowIfNullOrWhiteSpace(root);
try
{
var drive = new DriveInfo(root);
return drive.DriveType is DriveType.Fixed or DriveType.Removable && drive.IsReady;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
{
return false;
}
}
}
@@ -32,6 +32,7 @@ namespace FrameLedger.Shared.Ipc;
[JsonSerializable(typeof(CaptureDegradedEvent))]
[JsonSerializable(typeof(SafetyUnhookEvent))]
[JsonSerializable(typeof(HookingTurnedOffEvent))]
[JsonSerializable(typeof(GameRemovedEvent))]
[JsonSerializable(typeof(CaptureErrorEvent))]
[JsonSerializable(typeof(WatchlistEntry))]
[JsonSerializable(typeof(SetWatchlistRequest))]
+16
View File
@@ -84,6 +84,12 @@ public static class IpcMessageType
/// need be running.
/// </summary>
public const string HookingTurnedOff = "HookingTurnedOff";
/// <summary>
/// The Agent removed a library entry by itself (beta.19, owner decision D55): its game is no longer installed and it had
/// no session. Not a session event; the App reloads what shows the library.
/// </summary>
public const string GameRemoved = "GameRemoved";
}
/// <summary>Codes an <see cref="ErrorAck"/> carries.</summary>
@@ -313,6 +319,16 @@ public sealed record CaptureErrorEvent(Guid? SessionGuid, string Code, string Me
/// <summary><see cref="IpcMessageType.HookingTurnedOff"/>: which entry, and what the guard found (its reason, family and signal).</summary>
public sealed record HookingTurnedOffEvent(long GameId, string? GameName, string Reason, string? Family, string? Signal);
/// <summary>
/// <see cref="IpcMessageType.GameRemoved"/> (beta.19, D55): the entry the Agent removed, its executable's path, and why —
/// <see cref="Uninstalled"/>, the one reason there is: gone from its folder for ten minutes, with no session.
/// </summary>
public sealed record GameRemovedEvent(long GameId, string? GameName, string ExePath, string Reason)
{
/// <summary>The executable is no longer installed and the entry had no session.</summary>
public const string Uninstalled = "uninstalled";
}
// ----------------------------------------------------------------------------------------------------------------
// The command half (P3 PR-1b). 07_IPC §The pipe is not a trust boundary: none of these carries a verdict, a
// clearance, a consent record or a rules source — a client asks, the Agent establishes the fact itself.
@@ -320,15 +320,17 @@ struct Sources {
// Check 4 — the static pre-scan.
//
// The directory the target's image lives in. kFailed means we could not
// The directory the target's image lives in — its OWN folder (2026-10-13;
// until then the seam resolved the install root itself, and a folder beside
// a nested executable was out of check 4's reach). The checks resolve the
// install root from it (ResolveInstallRoot). kFailed means we could not
// name it, which refuses: check 4 cannot run against a directory we cannot
// find, and "we did not look" has never been a pass in this file.
Collected (*ImageDirectory)(std::uint32_t pid, wchar_t* out, std::size_t cap) = nullptr;
// The target's executable LEAF NAME, for check 3. A separate seam from
// ImageDirectory because it is a different fact: that one deliberately
// resolves the INSTALL ROOT (Unreal puts the exe three levels below it), and
// the name is exactly what it throws away.
// ImageDirectory because it is a different fact: that one strips the name
// to name the folder, and the name is exactly what it throws away.
//
// NARROW on purpose. `blockedExecutables` is ASCII by schema and
// MatchesBlockedExecutable compares ASCII, so converting here keeps one
@@ -90,7 +90,10 @@ FL_GUARD_ABI void FlGuardedInjectWhenReady(std::uint32_t targetPid, const wchar_
// It replaced FlStaticPreScan(gameDirectory) on 2026-09-25. That export scanned the directory it was given, and its
// one caller gave the executable's own folder, so an Unreal title's root-level EasyAntiCheat/ was never seen by the
// scan that decides whether hooking may be enabled. This one resolves the install root itself (ResolveInstallRoot, as
// the chokepoint always did) and adds check 3: the executable's name and the install's store identity.
// the chokepoint always did) and adds check 3: the executable's name and the install's store identity. Since
// 2026-10-13 check 4 walks the executable's own folder too when it lives below the root, here and in the chokepoint
// alike: the root's walk reaches three levels, and Wuthering Waves keeps its AntiCheatExpert\ beside an executable
// that is already three levels down.
//
// It reports through FlGuardResult rather than an outcome enum of its own, so there is ONE reason table and ONE
// mirror surface: kAllow means clean; BlockedExecutable, BlockedStoreId, AntiCheatDirectory and AntiCheatFile name
@@ -54,8 +54,18 @@ namespace fl::guard {
// because the entry cap is a REFUSAL: overrunning it does not scan less, it
// refuses the title.
//
// Both caps are REFUSALS, not truncations. A walk that stopped early has not
// seen the directory, and this file has no "scanned what we could" state.
// THE TWO CAPS ARE NOT THE SAME KIND — corrected 2026-10-13. This said both were
// refusals, and only the ENTRY cap is: overrunning it, an unreadable name or a
// reparse point is kIncomplete, which refuses. The DEPTH cap is a REACH: a folder
// at the last level is reported by name and never opened, silently — so what it
// holds is not seen, and the walk still reads as complete. Raising it is not the
// answer: at depth 5 three installed titles overrun 4096 entries (Master Duel
// 41,251), which would refuse them. What the reach cost was measured instead:
// Wuthering Waves keeps `AntiCheatExpert\` beside its executable at
// `Client\Binaries\Win64\` — four levels under the install root — and the walk
// from the root read it clean. Check 4 therefore walks the root AND, when the
// executable lives below it, the executable's own folder (ScanGameFolders,
// fl_prescan.cpp): each with this reach and its own entry budget.
inline constexpr std::size_t kMaxPreScanDepth = 3;
inline constexpr std::size_t kMaxPreScanEntries = 4096;
@@ -84,6 +94,11 @@ inline constexpr std::size_t kMaxPreScanPathLen = 1024;
// `D:\games\Title\` is a folder of other games, and refusing this title because
// a sibling ships anti-cheat is a false refusal with no appeal.
//
// The root REPLACED the executable's folder as check 4's one walk on 2026-09-25,
// and that was half right: what sits at the root (Lies of P's EasyAntiCheat/) is
// seen, what sits beside a nested executable is not (kMaxPreScanDepth). Since
// 2026-10-13 check 4 walks both.
//
// Returns false if the result does not fit, which the caller treats as
// "cannot determine".
[[nodiscard]] bool ResolveInstallRoot(const wchar_t* exeDir, wchar_t* out, std::size_t cap) noexcept;
@@ -96,8 +111,9 @@ inline constexpr std::size_t kMaxPreScanPathLen = 1024;
// game's hooking off like any finding (19_SAFETY §What a finding does to the game); the owner took that trade.
inline constexpr const char* kKernelDriverInTreeFamily = "Kernel driver in the game folder";
// Check 4, as EvaluateImpl runs it: derive the target's directory from its pid,
// then scan it.
// Check 4, as EvaluateImpl runs it: derive the target's own folder from its pid
// (Sources::ImageDirectory), resolve the install root from it, then walk the root
// and — when they differ — the executable's folder.
//
// Takes Sources because every evidence input in this guard is a seam — an input
// whose failure path cannot be exercised is an input whose failure path is
@@ -119,13 +135,14 @@ inline constexpr const char* kKernelDriverInTreeFamily = "Kernel driver in the g
// read.
[[nodiscard]] Verdict CheckStoreIdentity(const Sources& s, const Rules& rules, const wchar_t* installRoot) noexcept;
// The same, as EvaluateImpl runs it: the install root derived from the pid, exactly as check 4 derives it.
// The same, as EvaluateImpl runs it: the install root resolved from the target's own folder, exactly as check 4
// resolves it.
[[nodiscard]] Verdict CheckBlockedStoreId(const Sources& s, const Rules& rules, std::uint32_t targetPid) noexcept;
// The advisory form, for the question "can this game be enabled at all?" (FR-2.2) and for the Agent's pre-scan of
// the library (19_SAFETY §What a finding does to the game). Same matcher, same polarity, no pid: check 3 (the
// executable's own name, and the store identity of its install root) and check 4 (the install root's tree), from the
// EXECUTABLE's path.
// executable's own name, and the store identity of its install root) and check 4 (the install root's tree, and the
// executable's own folder's tree when it lives below the root — 2026-10-13), from the EXECUTABLE's path.
//
// It takes the executable, not a directory, since 2026-09-25. It took a directory, and its one caller passed the
// executable's own folder while nothing resolved the install root — so the pre-scan that decides whether hooking may
@@ -337,13 +337,15 @@ Collected ImageDirectoryImpl(std::uint32_t pid, wchar_t* out, std::size_t cap) n
}
*lastSep = L'\0';
// The INSTALL ROOT, not the executable's directory. Unreal puts the exe at
// <root>\<Project>\Binaries\Win64\, and EasyAntiCheat/ sits at the root —
// measured on Lies of P, where the pre-scan saw seven files none of which
// could have been an anti-cheat SDK.
if (!ResolveInstallRoot(path, out, cap)) {
// The executable's OWN folder (2026-10-13). The checks derive the install
// root from it (ResolveInstallRoot) and check 4 walks both. Until then this
// returned the root, which is where Lies of P keeps EasyAntiCheat/ — and
// that alone left a folder BESIDE an Unreal executable, three levels below
// the root, out of the walk's reach: Wuthering Waves' AntiCheatExpert\.
if (wcslen(path) + 1 > cap) {
return Collected::kFailed; // truncating a path yields a DIFFERENT directory
}
wcscpy_s(out, cap, path);
return Collected::kOk;
}
@@ -158,6 +158,23 @@ Verdict ScanWith(const Sources& s, const Rules& rules, const wchar_t* dir, const
return Passed();
}
// Check 4's two walks (2026-10-13): the install root's tree, then — when the executable lives below the root — the
// executable's own folder's tree. The walk reaches kMaxPreScanDepth levels below the folder it starts from
// (fl_prescan.h), and an Unreal executable sits three levels below its root, so a folder BESIDE it is four: MEASURED on
// Wuthering Waves, whose `Client\Binaries\Win64\AntiCheatExpert\` the root's walk listed the parent of and never
// opened, and which therefore read clean. Same walk, same caps, same tolerance and the same record of a tolerated
// finding; the first refusal is the answer.
Verdict ScanGameFolders(const Sources& s, const Rules& rules, const wchar_t* root, const wchar_t* exeDir,
const Tolerance* tolerance, ToleratedFinding* finding) noexcept {
if (Verdict v = ScanWith(s, rules, root, tolerance, finding); !v.Allowed()) {
return v;
}
if (exeDir == nullptr || exeDir[0] == L'\0' || _wcsicmp(root, exeDir) == 0) {
return Passed(); // the executable lives at its root: the one walk saw its folder
}
return ScanWith(s, rules, exeDir, tolerance, finding);
}
// Case-insensitive comparison of one path segment.
bool SegmentIs(const wchar_t* begin, const wchar_t* end, const wchar_t* literal) noexcept {
const std::size_t n = static_cast<std::size_t>(end - begin);
@@ -240,15 +257,16 @@ Verdict PreScanGameWith(const wchar_t* exePath, const Sources& s, const char* to
return Refused(Reason::kBlockedExecutable, hit->family, leaf);
}
// Check 3's store half, then check 4 — both over the install root. Title lists are never tolerated (D33): only
// check 4 takes the exception, and only for a user-mode family.
// Check 3's store half over the install root, then check 4 over the root and the executable's own folder. Title
// lists are never tolerated (D33): only check 4 takes the exception, and only for a user-mode family.
if (Verdict v = CheckStoreIdentity(s, rules, root); !v.Allowed()) {
return v;
}
Tolerance tolerance;
ResolveTolerance(rules, toleratedFamilies, tolerance);
ToleratedFinding finding;
if (Verdict v = ScanWith(s, rules, root, tolerance.any ? &tolerance : nullptr, &finding); !v.Allowed()) {
if (Verdict v = ScanGameFolders(s, rules, root, dir, tolerance.any ? &tolerance : nullptr, &finding);
!v.Allowed()) {
return v;
}
return finding.seen ? ToleratedVerdict(finding) : Passed();
@@ -335,7 +353,11 @@ Verdict CheckStaticPreScan(const Sources& s, const Rules& rules, std::uint32_t t
// 19_SAFETY has no "three of four checks passed" state.
return Refused(Reason::kPreScanFailed, nullptr, "could not establish the target's directory");
}
return ScanWith(s, rules, dir, tolerance, finding);
wchar_t root[kMaxPreScanPathLen] = {};
if (!ResolveInstallRoot(dir, root, kMaxPreScanPathLen)) {
return Refused(Reason::kPreScanFailed, nullptr, "could not establish the game's install root");
}
return ScanGameFolders(s, rules, root, dir, tolerance, finding);
}
Verdict CheckStoreIdentity(const Sources& s, const Rules& rules, const wchar_t* installRoot) noexcept {
@@ -370,10 +392,14 @@ Verdict CheckBlockedStoreId(const Sources& s, const Rules& rules, std::uint32_t
if (s.ImageDirectory == nullptr) {
return Refused(Reason::kPreScanFailed, nullptr, "no image-path source");
}
wchar_t root[kMaxPreScanPathLen] = {};
if (s.ImageDirectory(targetPid, root, kMaxPreScanPathLen) != Collected::kOk || root[0] == L'\0') {
wchar_t dir[kMaxPreScanPathLen] = {};
if (s.ImageDirectory(targetPid, dir, kMaxPreScanPathLen) != Collected::kOk || dir[0] == L'\0') {
return Refused(Reason::kPreScanFailed, nullptr, "could not establish the target's directory");
}
wchar_t root[kMaxPreScanPathLen] = {};
if (!ResolveInstallRoot(dir, root, kMaxPreScanPathLen)) {
return Refused(Reason::kPreScanFailed, nullptr, "could not establish the game's install root");
}
return CheckStoreIdentity(s, rules, root);
}
+47 -27
View File
@@ -22,40 +22,60 @@ target_compile_features(FrameLedger.Shm INTERFACE cxx_std_20)
#
# KNOWN LIMIT, stated rather than discovered: this runs at CONFIGURE time, so the
# `-dirty` suffix reflects the tree when CMake last ran, not when the DLL was
# last compiled. For a released build that is exact — CI configures and builds
# once from a clean checkout. For a developer editing between configures it is
# approximate, and the field is a version-skew signal rather than a provenance
# guarantee. Making it exact means re-running git on every build, which is a cost
# on every incremental compile for a value only the attach handshake reads.
execute_process(
COMMAND git describe --always --dirty --abbrev=12
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE FL_BUILD_ID_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(NOT FL_BUILD_ID_RAW)
set(FL_BUILD_ID_RAW "unknown")
endif()
# buildId is char[32] and the guard side compares the whole array, so a value
# that would be truncated must be caught here rather than becoming a permanent
# mismatch nobody can explain.
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
# AFTER THE FIRST TAG the long form stopped fitting on a developer's machine: `v0.1.0-beta.2-2-gd3e74988a7bc-dirty`
# is 35 characters, so every local configure with an uncommitted change failed here and the documented workaround
# was "commit before you build" (measured 2026-09-17, again 2026-09-21). The id is a version-skew signal, not a
# provenance guarantee (above), so the fallback spends fewer characters on the same facts: an 8-digit abbreviation
# and `+` for dirty. A released build is a clean checkout AT a tag and never reaches this branch. Still too long
# after that is still fatal, for the reason the check exists.
if(FL_BUILD_ID_LEN GREATER 31)
# last compiled. This comment said that for a released build it was exact, "CI
# configures and builds once from a clean checkout", and it was not (corrected
# 2026-10-07, beta.18): release.yml writes the release date into the tracked
# legal/*.md before the gate configures, and every release until beta.18 shipped
# "<tag>-dirty" — the owner's Dashboard read "Overlay build v0.1.0-beta.17-dirty",
# and the run's log "FL_BUILD_ID = v0.1.0-beta.17-dirty" two lines after
# "RELEASE_DATE = 2026-10-07 in 3 file(s)". A release now hands the id in (below). For a
# developer editing between configures it is approximate, and the field is a
# version-skew signal rather than a provenance guarantee. Making it exact means
# re-running git on every build, which is a cost on every incremental compile for a
# value only the attach handshake reads.
#
# A RELEASE HANDS THE ID IN: release.yml reads describe from the clean checkout, before
# anything edits a tracked file, and passes it as the environment's FL_BUILD_ID; it is
# taken as given here, and tools/buildid-check.ps1 then reads it back out of the
# published binaries. It goes into a C string literal, so it must be what describe can
# print and nothing a literal would have to escape.
if(DEFINED ENV{FL_BUILD_ID} AND NOT "$ENV{FL_BUILD_ID}" STREQUAL "")
set(FL_BUILD_ID_RAW "$ENV{FL_BUILD_ID}")
if(NOT FL_BUILD_ID_RAW MATCHES "^[0-9A-Za-z._+-]+$")
message(FATAL_ERROR "FL_BUILD_ID '${FL_BUILD_ID_RAW}' from the environment holds a character no build id has (0-9 A-Z a-z . _ + -).")
endif()
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
else()
execute_process(
COMMAND git describe --always --dirty=+ --abbrev=8
COMMAND git describe --always --dirty --abbrev=12
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE FL_BUILD_ID_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(NOT FL_BUILD_ID_RAW)
set(FL_BUILD_ID_RAW "unknown")
endif()
# buildId is char[32] and the guard side compares the whole array, so a value
# that would be truncated must be caught here rather than becoming a permanent
# mismatch nobody can explain.
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
# AFTER THE FIRST TAG the long form stopped fitting on a developer's machine: `v0.1.0-beta.2-2-gd3e74988a7bc-dirty`
# is 35 characters, so every local configure with an uncommitted change failed here and the documented workaround
# was "commit before you build" (measured 2026-09-17, again 2026-09-21). The id is a version-skew signal, not a
# provenance guarantee (above), so the fallback spends fewer characters on the same facts: an 8-digit abbreviation
# and `+` for dirty. A released build hands its id in (above) and never reaches this branch. Still too long
# after that is still fatal, for the reason the check exists.
if(FL_BUILD_ID_LEN GREATER 31)
execute_process(
COMMAND git describe --always --dirty=+ --abbrev=8
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE FL_BUILD_ID_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
endif()
endif()
if(FL_BUILD_ID_LEN GREATER 31)
message(FATAL_ERROR
+183 -10
View File
@@ -154,6 +154,14 @@ struct Fake {
std::wstring imageDirectory = L"C:\\Games\\Example";
Collected imageDirectoryResult = Collected::kOk;
std::wstring lastScannedDir; // what check 4 was asked to walk
// 2026-10-13: check 4 walks the install root AND the executable's own folder. A directory named here answers with
// its own listing; any other answers with `dirEntries`, so every case written before keeps its meaning.
struct Listing {
std::vector<std::pair<std::string, bool>> entries;
Collected result = Collected::kOk;
};
std::map<std::wstring, Listing> listingAt;
std::vector<std::wstring> scannedDirs; // every directory check 4 was asked to walk, in order
// Check 3's store half (2026-09-25). Defaults to "this install carries no store identity", so every
// pre-existing case keeps its meaning now that the floor lists store ids: check 3 asks, and allows.
@@ -312,12 +320,15 @@ Collected FakeImageFileName(std::uint32_t, char* out, std::size_t cap) {
Collected FakeEnumDirEntries(const wchar_t* dir, DirEntrySink sink, void* ctx) {
g.lastScannedDir = dir != nullptr ? dir : L"";
for (const auto& e : g.dirEntries) {
g.scannedDirs.push_back(g.lastScannedDir);
const auto own = g.listingAt.find(g.lastScannedDir);
const auto& entries = own != g.listingAt.end() ? own->second.entries : g.dirEntries;
for (const auto& e : entries) {
if (!sink(ctx, e.first.c_str(), e.second)) {
break;
}
}
return g.dirEntriesResult;
return own != g.listingAt.end() ? own->second.result : g.dirEntriesResult;
}
Collected FakeStoreIdentity(const wchar_t* installRoot, char* out, std::size_t cap) {
@@ -3759,10 +3770,13 @@ TEST_CASE("a directory listing that FAILED is undetermined, not clean", "[guard]
}
TEST_CASE("a TRUNCATED directory listing is undetermined, not clean", "[guard][prescan][failclosed]") {
// The entry cap, the depth cap and an unfollowed reparse point all arrive
// The entry cap, an unreadable name and an unfollowed reparse point arrive
// here as kIncomplete. An empty-but-incomplete listing is the exact shape
// of this project's worst defect: it reads as "nothing found" when it means
// "we did not finish looking".
// "we did not finish looking". The DEPTH cap does not arrive here, and this
// comment said it did until 2026-10-13: it is a reach — a folder at the last
// level is named and never opened, and the walk still reports kOk — which
// is why check 4 walks the executable's own folder too (fl_prescan.h).
ResetFake();
g.dirEntries = {{"game.exe", false}};
g.dirEntriesResult = Collected::kIncomplete;
@@ -3951,17 +3965,95 @@ TEST_CASE("the advisory pre-scan reaches the same verdict as the one inside the
CHECK(StaticPreScanGameWithSources(L"C:\\Games\\Example\\", FakeSources()).reason == Reason::kPreScanFailed);
}
TEST_CASE("the advisory pre-scan walks the INSTALL ROOT, not the executable's folder", "[guard][prescan]") {
TEST_CASE("the advisory pre-scan walks the INSTALL ROOT first, then the executable's folder", "[guard][prescan]") {
// Until 2026-09-25 the advisory pre-scan scanned the directory it was handed, and the Agent handed it the
// executable's own folder: for Lies of P's layout, a folder of seven files, with EasyAntiCheat/ three levels up.
// The chokepoint resolved the root all along; the scan that decides whether hooking may be enabled did not.
// The chokepoint resolved the root all along; the scan that decides whether hooking may be enabled did not. A hit
// at the root is the answer, so nothing is walked after it.
const std::wstring root = LR"(D:\SteamLibrary\steamapps\common\Lies of P)";
const std::wstring exe = root + LR"(\LiesofP\Binaries\Win64\LOP-Win64-Shipping.exe)";
ResetFake();
g.dirEntries = {{"EasyAntiCheat", true}};
const Verdict v = StaticPreScanGameWithSources(
LR"(D:\SteamLibrary\steamapps\common\Lies of P\LiesofP\Binaries\Win64\LOP-Win64-Shipping.exe)", FakeSources());
const Verdict v = StaticPreScanGameWithSources(exe.c_str(), FakeSources());
CHECK(v.reason == Reason::kAntiCheatDirectory);
CHECK(g.lastScannedDir == LR"(D:\SteamLibrary\steamapps\common\Lies of P)");
CHECK(g.lastStoreRoot == LR"(D:\SteamLibrary\steamapps\common\Lies of P)");
CHECK(g.lastScannedDir == root);
CHECK(g.scannedDirs.size() == 1);
CHECK(g.lastStoreRoot == root);
// A clean root: the executable's own folder is walked next (2026-10-13), and both are clean.
ResetFake();
g.dirEntries = {{"LOP-Win64-Shipping.exe", false}};
CHECK(StaticPreScanGameWithSources(exe.c_str(), FakeSources()).Allowed());
REQUIRE(g.scannedDirs.size() == 2);
CHECK(g.scannedDirs[0] == root);
CHECK(g.scannedDirs[1] == root + LR"(\LiesofP\Binaries\Win64)");
}
TEST_CASE("an anti-cheat folder beside a nested executable refuses -- Wuthering Waves", "[guard][prescan]") {
// MEASURED 2026-10-13 (spike-notes §19). Wuthering Waves keeps Tencent's ACE in `Client\Binaries\Win64\
// AntiCheatExpert\`, beside `Client-Win64-Shipping.exe` and four levels under its install root. The root's walk named
// `Win64` and never opened it (kMaxPreScanDepth), so the library pre-scan read the game clean three times, and a
// session was hooked for 37 s before the 30 s re-scan met ACE's driver — a machine-wide finding, which turned
// nothing off. The root's listing here is what the real walk returns to that depth.
const std::wstring root = LR"(D:\SteamLibrary\steamapps\common\Wuthering Waves)";
const std::wstring exeDir = root + LR"(\Client\Binaries\Win64)";
const std::wstring exe = exeDir + LR"(\Client-Win64-Shipping.exe)";
ResetFake();
g.listingAt[root].entries = {
{"Client", true}, {"Binaries", true}, {"Win64", true}, {"Engine", true}, {"Wuthering Waves.exe", false}};
g.listingAt[exeDir].entries = {
{"AntiCheatExpert", true}, {"ACE-BASE.sys", false}, {"Client-Win64-Shipping.exe", false}};
const Verdict advisory = StaticPreScanGameWithSources(exe.c_str(), FakeSources());
REQUIRE_FALSE(advisory.Allowed());
CHECK(advisory.reason == Reason::kAntiCheatDirectory);
CHECK(std::strcmp(advisory.family, "Anti-Cheat Expert") == 0);
CHECK(std::strcmp(advisory.signal, "AntiCheatExpert") == 0);
REQUIRE(g.scannedDirs.size() == 2);
CHECK(g.scannedDirs[1] == exeDir);
// The chokepoint, from the pid: the seam names the executable's folder, the store half asks the root resolved from
// it, and check 4 walks both.
g.scannedDirs.clear();
g.imageDirectory = exeDir;
const Verdict chokepoint = EvaluateWithSources(1234, FakeSources());
REQUIRE_FALSE(chokepoint.Allowed());
CHECK(chokepoint.reason == Reason::kAntiCheatDirectory);
CHECK(std::strcmp(chokepoint.family, "Anti-Cheat Expert") == 0);
CHECK(g.lastStoreRoot == root);
REQUIRE(g.scannedDirs.size() == 2);
CHECK(g.scannedDirs[0] == root);
CHECK(g.scannedDirs[1] == exeDir);
}
TEST_CASE("an executable at its install root is walked once", "[guard][prescan]") {
ResetFake();
g.dirEntries = {{"game.exe", false}};
CHECK(StaticPreScanGameWithSources(LR"(D:\SteamLibrary\steamapps\common\Some Title\game.exe)", FakeSources())
.Allowed());
REQUIRE(g.scannedDirs.size() == 1);
CHECK(g.scannedDirs[0] == LR"(D:\SteamLibrary\steamapps\common\Some Title)");
// So is one no store boundary names — its folder is its root — from the pid as from the path.
ResetFake();
g.dirEntries = {{"game.exe", false}};
CHECK(EvaluateWithSources(1234, FakeSources()).Allowed());
REQUIRE(g.scannedDirs.size() == 1);
CHECK(g.scannedDirs[0] == L"C:\\Games\\Example");
}
TEST_CASE("a walk of the executable's folder that could not finish refuses after a clean root",
"[guard][prescan][failclosed]") {
const std::wstring root = LR"(D:\SteamLibrary\steamapps\common\Nested)";
const std::wstring exeDir = root + LR"(\Game\Binaries\Win64)";
ResetFake();
g.listingAt[root].entries = {{"Game", true}};
g.listingAt[exeDir].entries = {{"Game-Win64-Shipping.exe", false}};
g.listingAt[exeDir].result = Collected::kIncomplete;
const Verdict v = StaticPreScanGameWithSources((exeDir + LR"(\Game-Win64-Shipping.exe)").c_str(), FakeSources());
REQUIRE_FALSE(v.Allowed());
CHECK(v.reason == Reason::kPreScanFailed);
}
TEST_CASE("the advisory pre-scan runs check 3 on the executable's own name", "[guard][prescan][check3]") {
@@ -4172,6 +4264,67 @@ TEST_CASE("the real seam reads a GOG product id, and a plain folder carries none
RemoveDirectoryW(root.c_str());
}
TEST_CASE("the real walk reaches an anti-cheat folder beside a nested executable", "[guard][prescan][real]") {
// Wuthering Waves' layout, on disk (2026-10-13). From the root the real walk names `Win64` and never opens it — the
// reach this test pins — and check 4's second walk, from the executable's own folder, finds `AntiCheatExpert\`.
const std::wstring lib = MakeTempTree(L"nested");
const std::wstring steamapps = lib + L"\\steamapps";
const std::wstring root = steamapps + L"\\common\\Game";
const std::wstring exeDir = root + L"\\Client\\Binaries\\Win64";
const std::wstring ac = exeDir + L"\\AntiCheatExpert";
for (const std::wstring& d : {lib, steamapps, steamapps + L"\\common", root, root + L"\\Client",
root + L"\\Client\\Binaries", exeDir, ac}) {
CreateDirectoryW(d.c_str(), nullptr);
}
const std::wstring exe = exeDir + L"\\Game-Win64-Shipping.exe";
WriteText(exe, "MZ");
WriteText(ac + L"\\ACE-Base64.dll", "MZ");
Sources s = SystemSources();
REQUIRE(s.EnumerateDirEntries != nullptr);
std::vector<std::string> fromRoot;
const DirEntrySink collect = [](void* ctx, const char* name, bool) {
static_cast<std::vector<std::string>*>(ctx)->push_back(name);
return true;
};
REQUIRE(s.EnumerateDirEntries(root.c_str(), collect, &fromRoot) == Collected::kOk);
CHECK(std::find(fromRoot.begin(), fromRoot.end(), "Win64") != fromRoot.end());
CHECK(std::find(fromRoot.begin(), fromRoot.end(), "AntiCheatExpert") == fromRoot.end());
// The pre-scan over the real walk and the real store seam (no manifest names this install), with the fixture's
// rules: the floor carries ACE's folder whatever the file says.
ResetFake();
s.ReadRulesFile = &FakeReadRules;
const Verdict v = StaticPreScanGameWithSources(exe.c_str(), s);
REQUIRE_FALSE(v.Allowed());
CHECK(v.reason == Reason::kAntiCheatDirectory);
CHECK(std::strcmp(v.family, "Anti-Cheat Expert") == 0);
// The folder gone, the same tree is clean: the second walk refuses nothing it should not.
DeleteFileW((ac + L"\\ACE-Base64.dll").c_str());
RemoveDirectoryW(ac.c_str());
CHECK(StaticPreScanGameWithSources(exe.c_str(), s).Allowed());
DeleteFileW(exe.c_str());
for (const std::wstring& d :
{exeDir, root + L"\\Client\\Binaries", root + L"\\Client", root, steamapps + L"\\common", steamapps, lib}) {
RemoveDirectoryW(d.c_str());
}
}
TEST_CASE("the real ImageDirectory names the executable's own folder", "[guard][prescan][real]") {
// Not the install root (2026-10-13): the checks resolve that themselves, and check 4 walks both.
wchar_t self[MAX_PATH] = {};
REQUIRE(GetModuleFileNameW(nullptr, self, MAX_PATH) != 0);
std::wstring folder(self);
folder.resize(folder.find_last_of(L"\\/"));
wchar_t out[kMaxPreScanPathLen] = {};
REQUIRE(SystemSources().ImageDirectory(GetCurrentProcessId(), out, kMaxPreScanPathLen) == Collected::kOk);
CHECK(_wcsicmp(out, folder.c_str()) == 0);
}
// ===========================================================================
// Check 2b against the REAL service control manager.
//
@@ -5887,6 +6040,26 @@ TEST_CASE("D33 -- the advisory pre-scan answers the same question the chokepoint
CHECK(std::string(aniimo.family) == kKernelDriverInTreeFamily);
}
TEST_CASE("D33 -- the executable's folder is walked under the same exception", "[guard][D33][prescan]") {
// 2026-10-13: check 4's second walk takes the tolerance and the finding record exactly as the first does — the
// family's file beside a nested executable is recorded, and a kernel driver there still refuses.
const std::wstring root = LR"(D:\SteamLibrary\steamapps\common\Nested Yidun)";
const std::wstring exeDir = root + LR"(\Game\Binaries\Win64)";
const std::wstring exe = exeDir + LR"(\Game-Win64-Shipping.exe)";
ResetFake();
g.listingAt[root].entries = {{"Game", true}};
g.listingAt[exeDir].entries = {{"Game-Win64-Shipping.exe", false}, {"NEP2.dll", false}};
const Verdict v = StaticPreScanGameWithSources(exe.c_str(), FakeSources(), kYidun);
CHECK(v.reason == Reason::kAllowedUserModeException);
CHECK(std::string(v.signal) == "NEP2.dll");
g.listingAt[exeDir].entries.push_back({"NEPKernel.sys", false});
const Verdict driver = StaticPreScanGameWithSources(exe.c_str(), FakeSources(), kYidun);
CHECK(driver.reason == Reason::kAntiCheatFile);
CHECK(std::string(driver.family) == kKernelDriverInTreeFamily);
}
TEST_CASE("D33 -- the excepted family's module loading late does not stop the Overlay; any other family still does",
"[guard][inject][shm][loader][D33]") {
// The Overlay's half. A decoy named `NEP2.dll` (NetEase Yidun's module, an exact floor match) loads 2.5 s after
@@ -36,6 +36,9 @@ public sealed class DiagReportTests
}
report.Should().Contain(" capture.min_session_s = 30", "a key with no row reports its default");
report.Should().Contain("render_tier: n/a", "no tier given");
DiagReport.Build("1.2.3", @"C:\data", @"C:\data\logs", 2, values, agentBesideApp: true, now, renderTier: 0)
.Should().Contain("render_tier: 0", "beta.21: software rendering, where every scroll is drawn on the CPU, is named");
}
[Fact]
@@ -171,6 +171,32 @@ public sealed class FormatsTests
Formats.Engine(null).Should().BeEmpty();
}
/// <summary>
/// beta.19: each RPG Maker rule covers several makers, and the file the version was read from names which; the RGSS
/// number is the runtime library's, and says so.
/// </summary>
[Fact]
public void TheVersionsWitnessNamesTheMakerAndRgssSaysWhoseNumberItIs()
{
Formats.Engine("rpgmaker_mv", EngineVersionSource.RpgMakerMzCore).Should().Be("RPG Maker MZ");
Formats.Engine("rpgmaker_mv", EngineVersionSource.RpgMakerMvCore).Should().Be("RPG Maker MV");
Formats.Engine("rpgmaker_rgss", EngineVersionSource.Rgss1Library).Should().Be("RPG Maker XP");
Formats.Engine("rpgmaker_rgss", EngineVersionSource.Rgss2Library).Should().Be("RPG Maker VX");
Formats.Engine("rpgmaker_rgss", EngineVersionSource.Rgss3Library).Should().Be("RPG Maker VX Ace");
Formats.Engine("rpgmaker_mv", null).Should().Be("RPG Maker MV/MZ", "no witness, no maker");
Formats.Engine("unity", EngineVersionSource.RpgMakerMzCore).Should().Be("Unity", "a witness names a maker only for its own rule");
Formats.EngineWithVersion("rpgmaker_mv", "1.10.0", EngineVersionSource.RpgMakerMzCore).Should().Be("RPG Maker MZ 1.10.0");
Formats.EngineWithVersion("rpgmaker_rgss", "3.0.1", EngineVersionSource.Rgss3Library).Should().Be("RPG Maker VX Ace (RGSS 3.0.1)");
Formats.EngineWithVersion("unity", "2022.3.39f1", EngineVersionSource.UnityPlayer).Should().Be("Unity 2022.3.39f1");
Formats.EngineWithVersion("godot", "4.4.1", EngineVersionSource.GodotPack).Should().Be("Godot 4.4.1");
Formats.EngineWithVersion("renpy", "8.5.0", EngineVersionSource.RenPyVcVersion).Should().Be("Ren'Py 8.5.0");
Formats.EngineWithVersion("unreal", "5.4.4", EngineVersionSource.UnrealFileVersion).Should().Be("Unreal Engine 5.4.4");
Formats.EngineWithVersion("unity", "6000.0", null).Should().Be("Unity 6000.0", "a version the user typed has no witness");
Formats.EngineWithVersion("godot", null, null).Should().Be("Godot");
Formats.EngineWithVersion(null, "1.0", null).Should().BeEmpty();
}
/// <summary>
/// Every engine the shipped rules can detect has a name here, and it is the rule's own <c>name</c> (2026-09-23): a rule
/// added without one would show its raw id on every card that engine lands on — which is what every engine did until
@@ -107,12 +107,19 @@ public sealed class GameDetailViewModelTests
private sealed class FakePicker(string? path) : IGamePicker
{
public string? PickExecutable() => path;
/// <summary>The folder each pick was asked to open in.</summary>
public List<string?> Folders { get; } = [];
public string? PickExecutable(string? initialDirectory = null)
{
Folders.Add(initialDirectory);
return path;
}
}
private static async Task<(GameDetailViewModel Vm, FakeAgent Agent, FakePrompt Prompt, FakeNavigator Nav, FakeStrip Strip)> BuildAsync(
ScratchLedger s, long gameId, RemoveGameChoice remove = RemoveGameChoice.Cancel, GameMetadata? edit = null, string? pick = null,
FakeAgent? withAgent = null, RegisteredSettings? settings = null, UiMode? mode = null)
FakeAgent? withAgent = null, RegisteredSettings? settings = null, UiMode? mode = null, FakePicker? picker = null)
{
FakeAgent agent = withAgent ?? new FakeAgent();
var prompt = new FakePrompt();
@@ -121,7 +128,7 @@ public sealed class GameDetailViewModelTests
var vm = new GameDetailViewModel(s.Library, new GameSelection { GameId = gameId }, new HookingConsent(agent, prompt), nav,
new FakeConfirmations(remove), new FakeEdit(edit), strip, new NoSummaries(),
new Charts.SessionSeriesLoader(s.Sessions), new Infrastructure.Persistence.SqliteHardwareSnapshotRepository(s.Db), new SessionSelection(),
new FakePicker(pick), settings, mode: mode);
picker ?? new FakePicker(pick), settings, mode: mode);
Task pending = vm.Pending;
await pending.ConfigureAwait(false);
return (vm, agent, prompt, nav, strip);
@@ -231,6 +238,35 @@ public sealed class GameDetailViewModelTests
}
}
/// <summary>
/// beta.21: a game the sweep has read and found none of the capability files in says so — the card read "not scanned yet"
/// for every such game, as HELLO, HELLO WORLD!'s page did beside a Details card that had been read.
/// </summary>
[Fact]
public async Task TheSupportsCardSaysNotScannedOnlyUntilTheSweepHasReadTheExecutable()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
GameRow game = await s.GameAsync("Plain");
(GameDetailViewModel unread, _, _, _, _) = await BuildAsync(s, game.Id);
unread.SupportsEmpty.Should().BeTrue();
unread.SupportsEmptyText.Should().Be(Strings.GameDetail_Supports_Empty, "the sweep has not read this game yet");
(await s.Games.ApplyDetectionAsync(game.Id, new DetectionWrite
{
EngineId = "rpgmaker_mv",
CapabilityIds = [],
RulesVersion = "2026.10.4",
ExeSizeBytes = 1,
ExeMtimeMs = 1,
ExeArchitecture = ExecutableArchitecture.X64,
}, Ct)).Should().BeTrue();
(GameDetailViewModel read, _, _, _, _) = await BuildAsync(s, game.Id);
read.SupportsEmpty.Should().BeTrue("the game ships none of the files the rules name");
read.SupportsEmptyText.Should().Be(Strings.GameDetail_Supports_None);
}
[Fact]
public async Task TheHeaderTheTwoRowsAndTheSessionsTabReadFromTheLedger()
{
@@ -613,7 +649,49 @@ public sealed class GameDetailViewModelTests
.And.Contain(new GameDetailRow("Engine version", Strings.GameDetail_EngineVersion_NotFound), "an Unreal title says its version was not found rather than nothing");
(GameDetailViewModel gf2, _, _, _, _) = await BuildAsync(s, unity.Id);
gf2.Details.Should().NotContain(r => r.Label == "Engine version", "other engines add no line");
gf2.Details.Should().NotContain(r => r.Label == "Engine version", "a version an older rules file's extractor wrote names no witness");
}
finally
{
Strings.Culture = previous;
}
}
/// <summary>
/// beta.19: a Unity, Godot or RPG Maker version says what it was read from, RPG Maker's witness names the maker in the
/// header, and such a title whose files named no version says so once the sweep has read it — Ren'Py's too since beta.20.
/// </summary>
[Fact]
public async Task TheDetailsCardSaysWhatAUnityGodotOrRpgMakerVersionWasReadFrom()
{
CultureInfo? previous = Strings.Culture;
Strings.Culture = CultureInfo.GetCultureInfo("en");
try
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
ValueTask<int> SetAsync(long id, string engine, string? version, string? source) => s.Db.WriteAsync((c, tx, ct) => Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(
"UPDATE games SET engine = @engine, engine_version = @version, engine_version_source = @source, exe_machine = 'x64' WHERE id = @id",
new { id, engine, version, source }, tx, cancellationToken: ct)), Ct);
(string Name, string Engine, string? Version, string? Source, string Subtitle, string Witness)[] cases =
[
("A Doll's Locket - Remake", "rpgmaker_mv", "1.10.0", EngineVersionSource.RpgMakerMzCore, "RPG Maker MZ 1.10.0", "From the first lines of the game's js/rmmz_core.js."),
("City of Bones", "rpgmaker_rgss", "3.0.1", EngineVersionSource.Rgss3Library, "RPG Maker VX Ace (RGSS 3.0.1)", Strings.GameDetail_EngineVersion_Rgss),
("xiandie", "godot", "4.4.1", EngineVersionSource.GodotPack, "Godot 4.4.1", Strings.GameDetail_EngineVersion_GodotPack),
("GF2", "unity", "2019.4.40", EngineVersionSource.UnityPlayerFile, "Unity 2019.4.40", Strings.GameDetail_EngineVersion_UnityPlayerFile),
("Unread", "unity", null, null, "Unity", Strings.GameDetail_EngineVersion_NotFoundInFiles),
("Bound Between Desks", "renpy", "8.5.0", EngineVersionSource.RenPyVcVersion, "Ren'Py 8.5.0", "From the version file of the game's Ren'Py engine (renpy/vc_version.py)."),
("Older Novel", "renpy", null, null, "Ren'Py", Strings.GameDetail_EngineVersion_NotFoundInFiles),
];
foreach ((string name, string engine, string? version, string? source, string subtitle, string witness) in cases)
{
GameRow row = await s.GameAsync(name);
await SetAsync(row.Id, engine, version, source);
(GameDetailViewModel vm, _, _, _, _) = await BuildAsync(s, row.Id);
vm.Subtitle.Should().EndWith(subtitle, name);
vm.Details.Should().Contain(new GameDetailRow("Engine version", witness), name);
}
}
finally
{
@@ -815,6 +893,36 @@ public sealed class GameDetailViewModelTests
}
}
/// <summary>
/// beta.19 (owner request 2026-10-12): the pick opens in the game's own root folder — a Steam install's folder under
/// <c>steamapps\common</c>, not the <c>bin\x64</c> the executable sits in, and not wherever the dialog was last.
/// </summary>
[Fact]
public async Task ChangingTheExecutableOpensThePickInTheGamesOwnFolder()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
string library = Path.Combine(Path.GetTempPath(), "fl-pick-" + Guid.NewGuid().ToString("N"));
string install = Path.Combine(library, "steamapps", "common", "Title");
Directory.CreateDirectory(Path.Combine(install, "bin", "x64"));
try
{
GameRow game = await s.GameAsync("Title", Infrastructure.Io.ExecutableIdentity.Normalise(Path.Combine(install, "bin", "x64", "Title.exe")));
var picker = new FakePicker(null);
(GameDetailViewModel vm, _, _, _, FakeStrip strip) = await BuildAsync(s, game.Id, picker: picker);
vm.ChangeExecutableCommand.Execute(null);
Task pending = vm.Pending;
await pending;
picker.Folders.Should().Equal([install], "the install root under steamapps\\common, not bin\\x64");
strip.Lines.Should().BeEmpty("a cancelled pick changes nothing");
}
finally
{
Directory.Delete(library, recursive: true);
}
}
[Fact]
public async Task ChangingTheExecutableToAnUnreadableFileOrCancellingChangesNothing()
{
@@ -0,0 +1,80 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.IO;
using FluentAssertions;
using FrameLedger.App.Services;
namespace FrameLedger.App.Tests;
/// <summary>
/// Where Change executable… opens (beta.19, owner request 2026-10-12): the game's root folder for each layout the library
/// holds — a store's install folder, an Unreal package outside a store, a loose folder — the nearest folder still there for
/// an entry whose folder is gone, and nothing for a drive that is not connected.
/// </summary>
public sealed class GameFolderTests : IDisposable
{
private readonly string _dir = Path.Combine(Path.GetTempPath(), "fl-gamefolder-" + Guid.NewGuid().ToString("N"));
public GameFolderTests() => Directory.CreateDirectory(_dir);
public void Dispose() => Directory.Delete(_dir, recursive: true);
private string Sub(params string[] parts)
{
string p = Path.Combine([_dir, .. parts]);
Directory.CreateDirectory(p);
return p;
}
[Fact]
public void AStoreInstallOpensAtItsFolderUnderTheStoresBoundary()
{
string install = Sub("SteamLibrary", "steamapps", "common", "Lies of P");
string bin = Sub("SteamLibrary", "steamapps", "common", "Lies of P", "LiesofP", "Binaries", "Win64");
GameFolder.StartFolder(Path.Combine(bin, "LiesofP-Win64-Shipping.exe")).Should().Be(install);
}
[Fact]
public void AnUnrealPackageOutsideAStoreOpensAboveItsProjectFolder()
{
string root = Sub("Games", "Hell Is Us");
string bin = Sub("Games", "Hell Is Us", "HellIsUs", "Binaries", "Win64");
GameFolder.StartFolder(Path.Combine(bin, "HellIsUs-Win64-Shipping.exe")).Should().Be(root, "<root>\\<Project>\\Binaries\\Win64 is Unreal's own layout");
}
[Fact]
public void ALooseFolderOpensWhereTheExecutableIs()
{
string game = Sub("it", "a-dolls-locket-remake", "Dolls Locket");
GameFolder.StartFolder(Path.Combine(game, "notification_helper.exe")).Should().Be(game);
}
[Fact]
public void AFolderThatIsGoneOpensAtTheNearestOneStillThere()
{
string library = Sub("it");
GameFolder.StartFolder(Path.Combine(library, "uninstalled", "Sub", "Game.exe")).Should().Be(library, "the entry reads Not installed; its library folder is still there");
}
[Fact]
public void ADriveThatIsNotConnectedOpensNowhereInParticular()
{
char? absent = null;
for (char letter = 'Z'; letter >= 'D'; letter--)
{
if (!Directory.Exists(letter + @":\"))
{
absent = letter;
break;
}
}
Assert.SkipWhen(absent is null, "every drive letter from D to Z is in use on this machine");
GameFolder.StartFolder(absent + @":\Games\Title\Title.exe").Should().BeNull("Windows then opens where the last pick was");
}
}
@@ -37,7 +37,7 @@ public sealed class GamesViewModelTests
private sealed class NoPicker : IGamePicker
{
public string? PickExecutable() => null;
public string? PickExecutable(string? initialDirectory = null) => null;
}
private sealed class NoStrip : IMessageStrip
@@ -92,6 +92,157 @@ public sealed class GamesViewModelTests
vm.Games.Should().HaveCount(2);
}
private sealed class RecordingStrip : IMessageStrip
{
public List<string> Lines { get; } = [];
public void Info(string title, string body) => Lines.Add(title + ": " + body);
public void Success(string title, string body) => Lines.Add(title + ": " + body);
public void Warn(string title, string body) => Lines.Add(title + ": " + body);
}
/// <summary>A clock whose timers fire when the test says so (beta.19): the page's wait for the rest of a check, held.</summary>
private sealed class HeldTimers : TimeProvider
{
private readonly List<(TimerCallback Callback, object? State)> _due = [];
public int Waiting => _due.Count;
public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
{
_due.Add((callback, state));
return new Held();
}
public void Fire()
{
(TimerCallback Callback, object? State)[] due = [.. _due];
_due.Clear();
foreach ((TimerCallback callback, object? state) in due)
{
callback(state);
}
}
private sealed class Held : ITimer
{
public bool Change(TimeSpan dueTime, TimeSpan period) => true;
public void Dispose()
{
}
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
}
}
/// <summary>
/// beta.19, D55: the Agent removed an entry whose game is no longer installed — the page on screen drops its card and says
/// why, in words that name the switch that turns it off, once it has waited a moment for the rest of the same check.
/// </summary>
[Fact]
public async Task AnEntryTheAgentRemovedLeavesThePageOnScreenWithAWord()
{
CultureInfo? previous = Strings.Culture;
Strings.Culture = CultureInfo.GetCultureInfo("en");
try
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
GameRow gone = await s.GameAsync("Gone");
_ = await s.GameAsync("Kept");
var selection = new GameSelection();
var nav = new NoNavigation();
var link = new FakeAgentLink();
var strip = new RecordingStrip();
var clock = new HeldTimers();
var vm = new GamesViewModel(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, new NoStrip()), agent: link, strip: strip, clock: clock);
Task loaded = vm.Pending;
await loaded;
vm.Attach();
// What the Agent did, then said.
await s.Db.WriteAsync((c, tx, ct) => Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition("DELETE FROM games WHERE id = @id", new { id = gone.Id }, tx, cancellationToken: ct)), Ct);
link.Raise(IpcMessageType.GameRemoved, new GameRemovedEvent(gone.Id, "Gone", gone.Fingerprint.ExePath, GameRemovedEvent.Uninstalled));
Task said = vm.Pending;
strip.Lines.Should().BeEmpty("the page waits a moment for the rest of the same check");
clock.Fire();
await said;
vm.Games.Should().ContainSingle().Which.Name.Should().Be("Kept");
strip.Lines.Should().ContainSingle().Which.Should().StartWith("Removed from the library: Gone is no longer installed").And.Contain("Settings ▸ Data");
}
finally
{
Strings.Culture = previous;
}
}
/// <summary>
/// beta.19: a check that removes several entries says each in its own event, milliseconds apart. The page read the library
/// and spoke once per event, and the shell's one snackbar kept only the last name; it now waits once, reads the library
/// once and says them all in one notice — the count, and five names at most.
/// </summary>
[Fact]
public async Task OneCheckThatRemovesSeveralEntriesIsSaidOnceAfterOneRead()
{
CultureInfo? previous = Strings.Culture;
Strings.Culture = CultureInfo.GetCultureInfo("en");
try
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
GameRow[] gone = [await s.GameAsync("Alpha"), await s.GameAsync("Bravo"), await s.GameAsync("Charlie")];
_ = await s.GameAsync("Kept");
var selection = new GameSelection();
var nav = new NoNavigation();
var link = new FakeAgentLink();
var strip = new RecordingStrip();
var clock = new HeldTimers();
var vm = new GamesViewModel(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, new NoStrip()), agent: link, strip: strip, clock: clock);
Task loaded = vm.Pending;
await loaded;
vm.Attach();
foreach (GameRow row in gone)
{
await s.Db.WriteAsync((c, tx, ct) => Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition("DELETE FROM games WHERE id = @id", new { id = row.Id }, tx, cancellationToken: ct)), Ct);
}
foreach (GameRow row in gone)
{
link.Raise(IpcMessageType.GameRemoved, new GameRemovedEvent(row.Id, row.Name, row.Fingerprint.ExePath, GameRemovedEvent.Uninstalled));
}
Task said = vm.Pending;
clock.Waiting.Should().Be(1, "one wait for the whole check, not one per entry");
clock.Fire();
await said;
vm.Games.Should().ContainSingle().Which.Name.Should().Be("Kept");
strip.Lines.Should().ContainSingle().Which.Should().Be("Removed from the library: 3 games are no longer installed and had no sessions, so the capture "
+ "agent removed them: Alpha, Bravo, Charlie. Settings ▸ Data turns this off.");
// Six in one check: the count, five names and how many more.
for (int i = 1; i <= 6; i++)
{
link.Raise(IpcMessageType.GameRemoved, new GameRemovedEvent(1000 + i, "G" + i.ToString(CultureInfo.InvariantCulture), @"Q:\G\g.exe", GameRemovedEvent.Uninstalled));
}
Task again = vm.Pending;
clock.Waiting.Should().Be(1);
clock.Fire();
await again;
strip.Lines.Should().HaveCount(2);
strip.Lines[^1].Should().Contain("6 games").And.Contain(": G1, G2, G3, G4, G5 and 1 more. ").And.NotContain("G6");
}
finally
{
Strings.Culture = previous;
}
}
[Fact]
public async Task ACardSaysWhetherItsExecutableIsThereAndWhy()
{
@@ -107,6 +258,8 @@ public sealed class GamesViewModelTests
await using ScratchLedger s2 = await ScratchLedger.OpenAsync();
var listed = new GamesViewModel(s2.Library, new GameSelection(), new NoNavigation(),
new AddGameFlow(s2.Library, new NoPicker(), new GameSelection(), new NoNavigation(), new NoStrip()));
Task opened = listed.Pending;
await opened; // the page's own first read, of an empty library, before the games below are added
string here = typeof(GamesViewModelTests).Assembly.Location;
_ = await s2.GameAsync("Here", here);
_ = await s2.GameAsync("Gone", Path.Combine(AppContext.BaseDirectory, "no-such-game.exe"));
@@ -115,6 +268,55 @@ public sealed class GamesViewModelTests
listed.Games.Single(static g => string.Equals(g.Name, "Gone", StringComparison.Ordinal)).NotInstalled.Should().BeTrue();
}
/// <summary>
/// beta.19: reads of the library overlap, and the one that started first can finish last — its checks waiting on a drive
/// that is slow to answer. It used to be shown over the newer one: a game the Agent had just removed came back until the
/// next read. One local run in about 165 failed <see cref="ACardSaysWhetherItsExecutableIsThereAndWhy"/> that way, its
/// own two reads racing.
/// </summary>
[Fact]
public async Task AnOlderReadThatFinishesLastIsNotShownOverANewerOne()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
_ = await s.GameAsync("Alpha");
var bound = TimeSpan.FromSeconds(30);
using var firstBegan = new ManualResetEventSlim();
using var firstMayEnd = new ManualResetEventSlim();
int checks = 0;
bool Exists(string path)
{
if (Interlocked.Increment(ref checks) == 1)
{
// The first read's check waits, as on a drive that is slow to answer.
firstBegan.Set();
_ = firstMayEnd.Wait(bound, Ct);
}
return true;
}
var selection = new GameSelection();
var nav = new NoNavigation();
var vm = new GamesViewModel(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, new NoStrip()), executableExists: Exists);
Task first = vm.Pending;
try
{
// Only once the first read is held in its check does the second begin: its checks are then never the held one.
firstBegan.Wait(bound, Ct).Should().BeTrue("the page's first read checks its one game");
_ = await s.GameAsync("Bravo");
await vm.LoadAsync(Ct);
vm.Games.Should().HaveCount(2, "the newer read lists both");
}
finally
{
firstMayEnd.Set();
}
await first;
vm.Games.Should().HaveCount(2, "the older read, of one game, finished last and is not shown");
vm.HeaderText.Should().EndWith("2");
}
[Theory]
[InlineData(1200, 3)]
[InlineData(1248, 4)]
@@ -0,0 +1,154 @@
// 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.Input;
using FluentAssertions;
using FrameLedger.App.Controls;
using Xunit;
namespace FrameLedger.App.Tests;
/// <summary>
/// beta.21 (owner request 2026-10-13: "scrolling the documents in the app is slow"): the wheel moves a document by Windows'
/// lines at a browser's line instead of WPF's fixed 48 DIP, in proportion to the delta, and leaves its ends to the host; a
/// page is rendered once, and a page shown before is not rendered again.
/// </summary>
public sealed class MarkdownViewTests
{
private static readonly string _longText = string.Join("\n\n", Enumerable.Range(1, 400).Select(static i => "Paragraph " + i + ": a few words that wrap."));
[Fact]
public void TheWheelStepFollowsTheDeltaWindowsLinesAndTheZoom()
{
MarkdownView.WheelStep(-120, 3, 600, 100).Should().BeApproximately(100, 1e-9, "three lines at a browser's line, downwards");
MarkdownView.WheelStep(120, 3, 600, 100).Should().BeApproximately(-100, 1e-9);
MarkdownView.WheelStep(-15, 3, 600, 100).Should().BeApproximately(12.5, 1e-9, "a touchpad's small delta moves in proportion");
MarkdownView.WheelStep(-120, 3, 600, 200).Should().BeApproximately(200, 1e-9, "zoomed in, a line is taller");
MarkdownView.WheelStep(-120, -1, 600, 100).Should().BeApproximately(600, 1e-9, "Windows' \"one screen at a time\"");
MarkdownView.WheelStep(-120, 0, 600, 100).Should().Be(0);
}
[Fact]
public async Task TheWheelMovesTheDocumentByItsStepAndLeavesItsEndsToTheHost()
{
(double notch, double touch, bool atEnd, bool withCtrl) = await PagesLoadTests.OnStaAsync(static () =>
{
var view = new MarkdownView { EaseWheel = false, WheelScrollLines = static () => 3, CurrentModifiers = static () => ModifierKeys.None };
view.Show(_longText, isPlainText: false, path: "LIMITATIONS.md");
Layout(view);
ScrollViewer scroller = view.Scroller ?? throw new InvalidOperationException("the template has no PART_ContentHost");
scroller.ScrollableHeight.Should().BeGreaterThan(1000, "the document is longer than its view");
Wheel(view, -120).Should().BeTrue();
Layout(view);
double afterNotch = scroller.VerticalOffset;
Wheel(view, -15).Should().BeTrue();
Layout(view);
double afterTouch = scroller.VerticalOffset;
scroller.ScrollToVerticalOffset(scroller.ScrollableHeight);
Layout(view);
bool handledAtEnd = Wheel(view, -120);
scroller.ScrollToVerticalOffset(0);
Layout(view);
view.CurrentModifiers = static () => ModifierKeys.Control;
bool handledWithCtrl = Wheel(view, -120);
return (afterNotch, afterTouch, handledAtEnd, handledWithCtrl);
});
notch.Should().BeApproximately(100, 0.5, "one notch is three lines of 100/3 DIP, not WPF's fixed 48");
touch.Should().BeApproximately(112.5, 0.5, "a delta of 15 is an eighth of a notch");
atEnd.Should().BeFalse("at the end the wheel is the host's — the update notes' dialog scrolls instead");
withCtrl.Should().BeFalse("Ctrl+wheel is the zoom's, never the scroll's");
}
[Fact]
public async Task EasingAddsEveryNotchToTheTargetAndANewPageStopsIt()
{
(double first, double second, double afterShow) = await PagesLoadTests.OnStaAsync(static () =>
{
var view = new MarkdownView { EaseWheel = true, WheelScrollLines = static () => 3, CurrentModifiers = static () => ModifierKeys.None };
view.Show(_longText, isPlainText: false, path: "LIMITATIONS.md");
Layout(view);
Wheel(view, -120).Should().BeTrue();
double target1 = view.ScrollTarget;
Wheel(view, -120).Should().BeTrue();
double target2 = view.ScrollTarget;
view.Show("# Another page", isPlainText: false, path: "guide/README.md");
return (target1, target2, view.ScrollTarget);
});
first.Should().BeApproximately(100, 0.5);
second.Should().BeApproximately(200, 0.5, "a notch turned while easing adds to where the view is going, not to where it is");
double.IsNaN(afterShow).Should().BeTrue("a new page ends the easing");
}
[Fact]
public async Task APageIsRenderedOnceAndAPageShownBeforeIsNotRenderedAgain()
{
(int one, int two, int back, int evicted) = await PagesLoadTests.OnStaAsync(static () =>
{
var view = new MarkdownView();
int start = view.Renders; // the constructor's empty document
view.Show("# One\n\ntext", isPlainText: false, path: "guide/a.md");
int afterOne = view.Renders - start;
view.Show("# Two\n\ntext", isPlainText: false, path: "guide/b.md");
int afterTwo = view.Renders - start;
view.Show("# One\n\ntext", isPlainText: false, path: "guide/a.md");
int afterBack = view.Renders - start;
for (int i = 0; i < MarkdownView.CacheCapacity; i++)
{
view.Show("# Page " + i, isPlainText: false, path: "guide/p" + i + ".md");
}
int beforeEvicted = view.Renders;
view.Show("# Two\n\ntext", isPlainText: false, path: "guide/b.md");
return (afterOne, afterTwo, afterBack, view.Renders - beforeEvicted);
});
one.Should().Be(1, "Show sets the three properties and renders once");
two.Should().Be(2);
back.Should().Be(2, "a page this view has rendered is kept");
evicted.Should().Be(1, "past the cache's capacity the oldest page is rendered again");
}
[Fact]
public async Task PropertiesSetOneByOneAreRenderedOnceAheadOfLayout()
{
(int beforePump, int afterPump, bool hasAnchor) = await PagesLoadTests.OnStaAsync(static () =>
{
var view = new MarkdownView();
int start = view.Renders;
view.DocumentPath = "guide/a.md";
view.IsPlainText = false;
view.MarkdownText = "# Heading\n\ntext";
int before = view.Renders - start;
Visuals.Pump();
int after = view.Renders - start;
return (before, after, view.Anchors.Count > 0);
});
beforePump.Should().Be(0, "a binding's change asks for a render; it does not render the half-set page");
afterPump.Should().Be(1, "three changes, one render");
hasAnchor.Should().BeTrue();
}
private static void Layout(FrameworkElement element)
{
element.Measure(new Size(700, 600));
element.Arrange(new Rect(0, 0, 700, 600));
element.UpdateLayout();
}
private static bool Wheel(UIElement over, int delta)
{
var wheel = new MouseWheelEventArgs(Mouse.PrimaryDevice, Environment.TickCount, delta) { RoutedEvent = UIElement.PreviewMouseWheelEvent };
over.RaiseEvent(wheel);
return wheel.Handled;
}
}
@@ -129,7 +129,7 @@ public sealed partial class PagesLoadTests
private sealed class NoPicker : IGamePicker
{
public string? PickExecutable() => null;
public string? PickExecutable(string? initialDirectory = null) => null;
}
private sealed class NoTheme : IThemeApplier
@@ -92,7 +92,7 @@ public sealed class SessionDeletionAndOverviewTests
private sealed class NoPicker : IGamePicker
{
public string? PickExecutable() => null;
public string? PickExecutable(string? initialDirectory = null) => null;
}
/// <summary>The summary windows, counting how often they were asked to close the deleted sessions' ones.</summary>
@@ -141,6 +141,7 @@ public sealed class ViewerModeTests
[SettingsRegistry.CaptureMinSessionSeconds.Key] = ("Value", "MinSessionSeconds, Mode=TwoWay"),
[SettingsRegistry.TelemetryIntervalMs.Key] = ("Value", "TelemetryIntervalMs, Mode=TwoWay"),
[SettingsRegistry.RetentionRawSessionsPerGame.Key] = ("Value", "RetentionRawSessions, Mode=TwoWay"),
[SettingsRegistry.RetentionRemoveUninstalledGames.Key] = ("IsChecked", "RemoveUninstalledGames, Mode=TwoWay"),
};
XDocument xaml = AccessibilityTests.AppXaml().Single(static x => string.Equals(x.File, Path.Combine("Pages", "SettingsPage.xaml"), StringComparison.Ordinal)).Xaml;
@@ -78,6 +78,18 @@ public sealed class DetectionSweepTests
// Unity rules only here: the sweep's second read is StaticGameDetector's, pinned in StaticGameDetectorTests.
public ValueTask<UnrealBuildFacts?> ReadUnrealBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
ValueTask.FromResult<UnrealBuildFacts?>(null);
public ValueTask<UnityBuildFacts?> ReadUnityBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
ValueTask.FromResult<UnityBuildFacts?>(null);
public ValueTask<GodotBuildFacts?> ReadGodotBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
ValueTask.FromResult<GodotBuildFacts?>(null);
public ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
ValueTask.FromResult<RpgMakerBuildFacts?>(null);
public ValueTask<RenPyBuildFacts?> ReadRenPyBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
ValueTask.FromResult<RenPyBuildFacts?>(null);
}
private sealed class FakeIdentity : IExecutableIdentitySource
@@ -261,6 +273,57 @@ public sealed class DetectionSweepTests
log.Where(static l => l.Contains("unreadable", StringComparison.Ordinal)).Should().HaveCount(2, "it read in between, so going unreadable again is news");
}
private sealed class PruneClock : TimeProvider
{
public DateTimeOffset Now { get; set; } = new(2026, 10, 12, 8, 0, 0, TimeSpan.Zero);
public override DateTimeOffset GetUtcNow() => Now;
}
private sealed class GonePresence : IExecutablePresence
{
public ExecutablePresence Probe(string exePath) => ExecutablePresence.FileGone;
}
private sealed class DeletingPrune : IGamePrune
{
public List<long> Deleted { get; } = [];
public ValueTask<bool> RemoveUninstalledAsync(long gameId, string exePath, CancellationToken ct = default)
{
Deleted.Add(gameId);
return ValueTask.FromResult(true);
}
}
/// <summary>
/// beta.19, D55: an unreadable entry whose game is no longer installed is asked about after the relocator, and once the
/// prune removes it the sweep counts it removed — not unreadable — and says nothing else about it.
/// </summary>
[Fact]
public async Task AnUninstalledEntryIsRemovedAfterTheGraceAndCountedAsRemoved()
{
var games = new FakeGameRepository();
await games.EnsureAsync(new ExecutableFingerprint { ExePath = _exe, SizeBytes = 1, MtimeUnixMs = 1 }, "Title", Ct);
var identity = new FakeIdentity { OnDisk = null };
var clock = new PruneClock();
var deleting = new DeletingPrune();
List<string> log = [];
var prune = new UninstalledEntryPrune(deleting, new GonePresence(), static _ => ValueTask.FromResult(true), static _ => false, log.Add, clock: clock);
using var sweep = new DetectionSweep(games, new ScriptedRules("2026.10.2"), new ScriptedProbe(), identity, log.Add, prune: prune);
DetectionSweepReport first = await sweep.SweepOnceAsync(Ct);
first.Unreadable.Should().Be(1);
first.Removed.Should().Be(0, "the first sweep that sees it gone only starts the count");
clock.Now += UninstalledEntryPrune.Grace;
DetectionSweepReport second = await sweep.SweepOnceAsync(Ct);
second.Removed.Should().Be(1);
second.Unreadable.Should().Be(0);
deleting.Deleted.Should().ContainSingle();
log.Should().Contain(static l => l.StartsWith("library: removed 'Title'", StringComparison.Ordinal));
}
[Fact]
public async Task RequestNowWakesTheWaitBeforeTheIntervalAndIsIdempotent()
{
Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff. Show more