Compare commits

...
Author SHA1 Message Date
poli0981andClaude Fable 5.1 60c2c5b412 feat(rules): RPG Maker MV/MZ and XP/VX/VX Ace engine rules, rulesVersion 2026.09.1
05_DETECTION marked both RPG Maker rows ⛔ "cannot be expressed in
schemaVersion 2". The MV/MZ reasoning wanted a nested group for nw.dll AND
(www/ OR package.json), but MV and MZ both ship package.json beside nw.dll
unconditionally — www/ is only where MV keeps its data — so
all: [nw.dll, package.json] is the whole signal. Measured on the owner's
Flower in Us (Steam) and a hand-extracted MV title: both engine=none before,
both rpgmaker_mv now; Godot, Ren'Py and the rest unchanged.

- rpgmaker_mv: all of nw.dll + package.json siblings, version null (the .js
  header needs a `from` that strings_regex lacks).
- rpgmaker_rgss "RPG Maker XP/VX/VX Ace": any of RGSS1*/RGSS2*/RGSS3*.dll or a
  *.rgssad/*.rgss2a/*.rgss3a archive, version null (which DLL matched is not a
  value any extractor produces) — one rule, the variant unnamed.
- Both after unity/unreal and before godot (an MV game has no .pck; a Godot
  game has no nw.dll).
- Fixtures engines/rpgmaker_mv, engines/rpgmaker_rgss; every_engine_marker
  gains nw.dll, package.json, RGSS301.dll and still expects unity.
- rulesVersion 2026.09.1: the sweep's cache key changes, so every game is
  re-detected on the Agent's next pass.
- Docs: 05_DETECTION §Engine signatures (the ⛔ note kept, struck), CHANGELOG.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 18:42:26 +07:00
poli0981andClaude Opus 5 5ae5c14e1b feat(app): the bug report's last optional item, the last session's summary when ticked (#185)
10_LOGGING's bug report step 2 listed "last session metadata + aggregates JSON (never raw blobs by default)" beside
the crash dump, and the privacy policy promises both only when ticked. The Optional items dialog now shows a
checkbox for each item that exists: the crash dump, and the newest session in the ledger (LastSessionSummary),
labelled with its game and start time. Ticked, the zip gains session.json, File > Export's own JSON (metadata,
aggregates, segments, hardware) without the user's notes and tags, passed through LogRedactor because it names the
executable. No frame or sensor series. With neither item there is no question.

CrashDumpChoice became BugBundleOptions, and IBugReportPreview.AskCrashDumpAsync became AskOptionsAsync with a
BugBundleOffer. Two strings in en/vi/ja.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 22:06:15 +07:00
poli0981andClaude Opus 5 3efe89facc docs(legal): the accuracy block says what the code measures on 2026-09-15 (#184)
legal/ACCURACY.md, embedded in README.md and legal/DISCLAIMER.md, was dated 2026-09-06 and still said there was no
Agent loop, storage, charts, library import or UI, that OpenGL intercepted nothing, that no shipped component ran
the 30 s re-scan and that video memory was not measured. Every sentence was re-checked against the code: OpenGL
is measured; Vulkan only when FrameLedger starts the game; FSR is named FSR 3 or unversioned; the preset is not
reported; frame generation is Direct3D-only; whole-card VRAM is recorded while per-game VRAM, shader-stutter
attribution, Reflex, HDR and CPU temperature are not; the shipped Agent runs the re-scan; nothing is released.

README outside the block and DISCLAIMER (now 2.1-draft) drop the claims the code no longer supports. Docs that
contradicted the code are corrected, including 04_CAPTURE's "attach mode on a running Vulkan title stays Tier 2",
which it does not: attach mode injects the Direct3D Overlay, an open decision for the owner. Stale comments in
dllmain.cpp, layer.cpp and fl_guard.cpp now describe the code; no behaviour changes.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 21:55:07 +07:00
poli0981andClaude Opus 5 7a596a3697 fix(capture): a quality the hook could not tell and an unmeasured Reflex are no longer stored as values (#183)
The quality byte's 0xFF is the Overlay's "a hook ran and could not tell" (fl_shm.h upscalerQuality), and every
AMD dispatch carries it. SessionAggregator (row and segments) and SessionProgressCalculator took it as a number,
so a session and the live card carried the text "255", which the game page and the Dashboard append to the
upscaler's name: an FSR title would read "FSR 255". Frames that did not tell are now left out, and a quality
nobody told is null (FrameSample.QualityNotTold).

reflex_active was written false on every hooked row with no latency sample, although nothing measures Reflex
today; it is null there now, so an export no longer says "off" for a thing never measured.

Found while checking legal/ACCURACY.md against the code.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 21:32:19 +07:00
poli0981andClaude Opus 5 a7075547e1 fix(app): a start that fails says so on screen instead of exiting silently (#182)
When App.RunAsync caught its own exception (a ledger that would not open, a newer schema, a locked file, a host
that would not start) FrameLedger wrote a Fatal line to ui-*.log and exited with code 1 with nothing on screen.

It now shows StartupFailureDialog, a Win32 message box like the crash dialog, because the shell is what failed: the
exception's message, the log folder, and Yes to open that folder. The exit code is still 1, and a crash the
dispatcher already reported shows no second dialog. Two strings in en/vi/ja.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 21:18:56 +07:00
poli0981andClaude Opus 5 dcf5796bf2 fix(app): bug bundles no longer carry the user's name in log paths, as the privacy policy already promised (#181)
legal/PRIVACY_POLICY.md section 3 says logs are redacted (user directory paths removed) before bundling, and
10_LOGGING named a RedactingEnricher. Neither existed: BugBundleBuilder copied ui-*.log, agent-*.log and
overlay-*.log verbatim, on the ground that they carry no paths beyond the data directory, which is itself under the
user's profile. On the dev box the profile path appeared 8 times in the UI log, 7 in the Agent's and in 175 overlay
headers.

LogRedactor rewrites every log copy in the zip: the name in each X:\Users\<name> path becomes <user>, and so does a
profile directory's last segment elsewhere, in backslash, doubled-backslash (Serilog's JSON), forward-slash, any-case
and ANSI-question-mark spellings. The file is read through Latin-1, so UTF-8 and ANSI logs come out byte for byte
except the names. The files on disk keep their paths, and the policy's sentence is now true unchanged. The enricher
claim is struck in 10_LOGGING with where the rule is enforced instead.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 21:04:10 +07:00
58 changed files with 1027 additions and 238 deletions

No files matched your search

+65
View File
@@ -21,6 +21,25 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
### Added
- **RPG Maker is detected — MV/MZ and XP/VX/VX Ace — and `rulesVersion` is `2026.09.1` (2026-09-16).** Two engine
rows `05_DETECTION` marked ⛔ "cannot be expressed in schemaVersion 2": the MV/MZ reasoning wanted a nested group
for `nw.dll` **and** (`www/` **or** `package.json`), but MV and MZ both ship `package.json` beside `nw.dll`
unconditionally, so `all: [nw.dll, package.json]` is the signal — measured on the owner's *Flower in Us* and a
hand-extracted MV title, both `engine=none` until now. The RGSS family is one rule over the three DLL prefixes and
the three archive extensions, no version (which DLL matched is not a value any extractor produces). Both sit
after `unity`/`unreal` and before `godot`. Fixtures `engines/rpgmaker_mv`, `engines/rpgmaker_rgss`; the
`every_engine_marker` canary carries both engines' markers and still expects `unity`. The version bump changes the
sweep's cache key, so every game is re-detected on the Agent's next pass. Docs: `05_DETECTION` §Engine signatures.
- **The bug report's last optional item: the last session's summary, when ticked (2026-09-15).** `10_LOGGING` §Bug
report flow step 2 listed "last session metadata + aggregates JSON (never raw blobs by default)" beside the crash
dump, and `legal/PRIVACY_POLICY.md` §3 promises both only when ticked. The Optional items dialog PR-9 added now shows
a box for each item that exists: the crash dump, and the newest session in the ledger (`LastSessionSummary`) labelled
with its game and start time. Ticked, the zip gains `session.json`, File ▸ Export's own JSON (metadata, aggregates,
segments, hardware) without the user's notes and tags, passed through `LogRedactor` because it names the executable;
no frame or sensor series. With neither item there is no question. `CrashDumpChoice` became `BugBundleOptions`, and
`IBugReportPreview.AskCrashDumpAsync` became `AskOptionsAsync(BugBundleOffer)`. Two strings (en/vi/ja). Tests:
`LastSessionSummaryTests`, `BugReportFlowTests`, `BugBundleOptionsViewModelTests`, `PagesLoadTests`. Docs:
`10_LOGGING` §Bug report flow step 2.
- **P4 PR-9 — the crash dialog, the minidump in both processes, and the crash dump as the bug report's opt-in
(2026-09-15).** `10_LOGGING` §Crash handling specified Fatal → `MiniDumpWriteDump` → a dialog offering the bug report
→ exit code 1; only the Fatal line existed, and `Crash_Title` / `Crash_Body` were translated for a dialog nothing
@@ -241,6 +260,35 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
### Fixed
- **A start that fails says so on screen (2026-09-15).** When `App.RunAsync` caught its own exception — a ledger
that would not open (a newer schema, a locked file), a host that would not start — FrameLedger wrote a Fatal line to
`ui-*.log` and exited with code 1 with nothing on screen, so a user saw a click do nothing. It now shows
`StartupFailureDialog`, a Win32 message box like the crash dialog (the shell is what failed): the exception's message,
the log folder, and Yes to open that folder; the exit code is still 1, and a crash the dispatcher already reported
shows no second dialog. Two strings (en/vi/ja). Tests: `StartupFailureDialogTests`. Docs: `10_LOGGING` §Crash
handling.
- **Bug bundles no longer carry the user's name in log paths, which the privacy policy already promised
(2026-09-15).** `legal/PRIVACY_POLICY.md` §3 says "logs are redacted (user directory paths removed) before
bundling" and `10_LOGGING` named a `RedactingEnricher`; neither existed, and `BugBundleBuilder` copied `ui-*.log`,
`agent-*.log` and `overlay-*.log` verbatim on the stated ground that they carry no paths beyond the data directory,
which is itself under the user's profile. On the dev box the profile path appeared 8 times in the UI log, 7 in the
Agent's and in 175 overlay headers. `App/Services/LogRedactor` now rewrites every log copy in the zip: the name in
each `X:\Users\<name>` path becomes `<user>`, and so does a profile directory's last segment elsewhere, in
backslash, doubled-backslash (Serilog's JSON), forward-slash, any-case and ANSI-`?` spellings, byte for byte
otherwise (Latin-1 round trip, so UTF-8 and ANSI logs both survive). The files on disk keep their paths; the policy's
sentence is now true without a word of it changing. Tests: `LogRedactorTests`, `BugBundleBuilderTests`. Docs:
`10_LOGGING` §Serilog configuration (the enricher claim struck, with where the rule is enforced) and §Bug report
flow step 2.
- **Two unmeasured facts were stored as values (2026-09-15).** The quality byte's `0xFF`, the Overlay's "a hook ran
and could not tell" (`fl_shm.h` `upscalerQuality`), was aggregated as a number, so a session and the live card
carried the text `255`, which the game page and the Dashboard append to the upscaler's name: every AMD dispatch
carries `0xFF`, so an FSR title would read "FSR 255". `SessionAggregator` (row and segments) and
`SessionProgressCalculator` now leave those frames out, and a quality nobody told is null (`FrameSample.QualityNotTold`).
And `reflex_active` was written `false` on every hooked row with no latency sample, although nothing measures Reflex
today; it is null there now, so an export no longer says "off" for a thing never measured. Tests:
`SessionAggregatorTests` (not told is null, told frames still count; Reflex null), `SessionProgressCalculatorTests`.
Found while checking `legal/ACCURACY.md` against the code. Not done: naming a preset the hook did read, which
`03_METRICS` assigns to a `Domain.UpscalerNames` that does not exist; no measured title has produced one.
- **Test runs stop filling the real data folder with hook-harness logs (2026-09-15).** The injection tests inject the
shipped Overlay, whose log goes to `%LOCALAPPDATA%\FrameLedger\logs` by design (§S21: not the environment, and no
switch in the injected DLL), so the owner's folder held 2506 overlay logs, 2492 of them hook-harness's from test
@@ -255,6 +303,23 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
created during the gate and still there, which is red on the unswept tree. Tests: `[sweep]` in `fl_guard_test`,
`HarnessOverlayLogSweepTests`. The logs from before this change are left for the owner. Docs: `17_HOOK_ENGINE`
§Native logging, `12_BUILD` gate list, `14_TESTING`, HANDOFF §Traps. No Overlay change, so no hook-path overhead.
- **The accuracy block says what the code measures on 2026-09-15 (`legal/ACCURACY.md`, embedded in `README.md` and
`legal/DISCLAIMER.md`).** Dated 2026-09-06, it still said there was no Agent loop, storage, charts, library import
or UI, that OpenGL intercepted nothing, that no shipped component drove the 30 s re-scan and that video memory was
not measured — all false since. Every sentence was re-checked against the code: OpenGL is measured; Vulkan only
when FrameLedger starts the game (a running Vulkan title gets the Direct3D component, unverified); FSR is named FSR 3
or unversioned, never FSR 2 or 4; the preset is not reported anywhere; frame generation is Direct3D-only and falls
back to a qualified Presented FPS; whole-card video memory is recorded while per-game VRAM, shader-stutter
attribution, Reflex, HDR and CPU temperature are not; the shipped Agent runs the re-scan and the kill switch can
only refuse. Nothing has been released. `README.md` outside the block: the safety row's "re-scan does not run at
all", the XeSS and "always shown" promises, the Vulkan requirement, CPU temperature, NVAPI's Reflex, and a note that
no release exists. `legal/DISCLAIMER.md` is 2.1-draft (the first-run gate shows it again): two history bullets the
software caught up with are struck, and the path-tracing "confidence-scored suggestion" it never computes is
corrected. Docs that contradicted the code: `04_CAPTURE` (attach mode on a running Vulkan title is not Tier 2 — an
open decision for the owner), `05_DETECTION` (four runtime facts have no writer), `17_HOOK_ENGINE` (`wglSwapBuffers`
is built), `15_ROADMAP` and HANDOFF (`StaticGameDetector` runs in `DetectionSweep`). Stale comments in `dllmain.cpp`
(OpenGL "NOT HERE"), `layer.cpp` (`vkQueuePresentKHR` "NOT hooked") and `fl_guard.cpp` (the signer lookup "not wired
yet") now say what the code does; comments only, no behaviour change.
- **The native log test read another process's log, and was filed as a flake four times (2026-09-14).**
`guard_test.cpp`'s `FindOverlayLog` took the first `overlay-<pid>-*.log` by name in the real
`%LOCALAPPDATA%\FrameLedger\logs`, which keeps every run's log — 2130 on the dev box. A harness that drew a
+58 -38
View File
@@ -5,38 +5,56 @@
> No telemetry. No accounts. All data stays on your machine.
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-09-06.** The software is pre-alpha: the
> measurement path exists as an injected Direct3D 11/12 component and an **unshipped** capture
> host that drives the guard loop and prints a report; there is no Agent loop, no storage, no
> charts, no library import, no UI and no installer yet.
> ⚠ **What FrameLedger actually measures today — 2026-09-15.** The software is pre-alpha and
> **unreleased**: no tagged build or installer has been published. 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, injects only into games you enabled and only past the safety guard, and
> stores sessions in a local database. What that path measures:
>
> - **Frame times and output resolution:** measured, from the present hook, for injected D3D11/12
> titles, and for Vulkan titles **launched through FrameLedger** (the layer intercepts
> `vkQueuePresentKHR` since 2026-09-06; a Vulkan title already running when FrameLedger attaches is
> not observed). OpenGL/D3D9 intercept nothing yet.
> - **Which upscaler is running:** measured from the API the game calls — DLSS (with Ray
> Reconstruction Yes/No) through NVIDIA Streamline; FSR 2/3.x/4 through AMD's shipped DLLs; DLSS on
> titles that bypass Streamline is reported from the NVIDIA driver's own per-process record,
> labelled *driver-reported*. Intel XeSS is **not** read (its SDK licence forbids it) and reads
> `N/A` by policy; an upscaler compiled into the game executable reads `N/A`.
> - **Quality preset:** `N/A` everywhere. No route this software may use exposes it.
> - **Render → output resolution:** measured where the vendor's own call carries the size (AMD
> dispatches, some Streamline titles); `N/A` where it does not (NVIDIA-direct titles, most
> Direct3D 12 Streamline titles).
> - **Frame generation:** the Displayed rate is counted from presents — including, on one title,
> presents DXGI counted that the hook could not — and the Native rate from the vendor's own
> per-frame calls where the title makes them. Identity: DLSS-G and FSR-FG named from the calls
> the game makes; anything else (XeSS-FG, a generator compiled into the game) is reported *by
> elimination* and never named. Where no per-frame call exists the Native rate is `N/A`.
> - **Ray tracing:** Yes/No measured from DXR dispatches and acceleration-structure builds on
> Direct3D 12; the technique and path tracing are `N/A`.
> - **Not measured at all:** video memory, shader-compilation stutter, PC latency (Reflex), HDR.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-
> vendor half of the suspicious-module rule (since 2026-09-06), and the unshipped capture host
> re-runs them every 30 s and stops the capture on refusal. No shipped component drives that loop
> yet. There is no override anywhere.
> - **Frame times and output resolution:** measured from the present call for Direct3D 11/12 and
> OpenGL titles FrameLedger injects into. Vulkan titles are measured only when FrameLedger itself
> starts the game with its Vulkan layer enabled, which today only the Agent's command-line launch
> does. A Vulkan title started any other way is not observed by the layer; FrameLedger injects its
> Direct3D component into it instead, and what that records on a Vulkan title has not been
> verified. Direct3D 9 and every 32-bit title are not measured.
> - **Which upscaler is running:** measured from the API a Direct3D title calls — DLSS or NIS through
> NVIDIA Streamline (with Ray Reconstruction Yes/No), and FSR through AMD's shipped FidelityFX DLLs:
> named FSR 3 from the older DLLs, and FSR without a version from the newer ones, which host both
> FSR 3.1 and FSR 4. FSR 2, and FSR shipped any other way, is not identified. For DLSS titles that
> bypass Streamline, the NVIDIA driver's own per-process record is stored with the session, labelled
> *driver-reported*; the app does not display it yet. Intel XeSS is **not** read (its SDK licence
> forbids it), and neither is an upscaler compiled into the game: those read `N/A`, or "Unknown
> upscaler" when another vendor's hook ran in the game. Vulkan and OpenGL titles read `N/A`.
> - **Quality preset:** not reported on any title measured. The one route this software may use — the
> DLSS options a Streamline title passes with its per-frame call — has not been seen on a real
> title, and AMD's per-frame call carries no preset.
> - **Render → output resolution:** measured where the vendor's own per-frame call carries the render
> size (AMD FidelityFX dispatches, and Streamline titles whose resource tags state it); `N/A` where it
> does not: DLSS titles that bypass Streamline, Streamline titles whose tags carry no size, and Vulkan
> and OpenGL titles.
> - **Frame generation (Direct3D titles only):** the Displayed rate is counted from presents, plus the
> presents DXGI's own counter saw on the same swap chain that the hook did not; the Native rate from
> the vendor's own per-frame calls (NVIDIA Streamline, AMD FidelityFX) where the title makes them, and
> `N/A` where it does not. DLSS-G and FSR FG are named from the calls the game makes; any other
> generator (XeSS-FG, one compiled into the game) is shown only as active with the technology not
> identified, and is never named. Where a technology is named but its frames could not be counted, or
> frame generation is not measured, the software shows **Presented FPS** with a note on what it may
> include — never a Native figure.
> - **Ray tracing:** Yes/No measured on Direct3D 12 from ray-dispatch and acceleration-structure-build
> calls; the technique and path tracing are `N/A`, and so is ray tracing on other APIs.
> - **Video memory:** in use on the whole graphics card, recorded from Windows and GPU-driver telemetry
> and charted. **Not measured at all:** each game's own video-memory use and budget, which frame
> spikes were shader compilation, PC latency (Reflex), HDR, and CPU temperature. Stutter count and
> stutter time are measured from frame times.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
> goes passthrough. A global switch in Settings turns all hooking off, and a running capture stops at
> its next check; it can only refuse, never permit. There is no override anywhere.
>
> Where a value is not measured it reads `N/A`; the software never substitutes an estimate.
> Where a value is not measured it reads `N/A`, with two exceptions: FPS then shows Presented FPS with a
> note on what it may include, and ray-tracing flags may show a value you set yourself, labelled as
> yours. The software never substitutes an estimate.
<!-- accuracy-block:end -->
> The rows below that describe **safety behaviour** are qualified where they sit, rather than
@@ -48,8 +66,8 @@
Most tools tell you your frame rate. FrameLedger tells you **what produced that frame rate**:
- **Real render resolution vs output resolution** — the actual internal resolution, not the one in the settings menu.
- **Which upscaler is running, at which quality preset** — DLSS / FSR / XeSS, read from the API the game calls, not guessed from files on disk.
- **Frame Generation, measured** — native and generated frames counted separately. Always shown as `62 → 118 FPS (×1.9 FG)`, never as one inflated number.
- **Which upscaler is running** — DLSS / FSR, read from the API the game calls, not guessed from files on disk. Intel XeSS is not read: its SDK licence forbids it.
- **Frame Generation, measured** — native and generated frames counted separately. Shown as `62 → 118 FPS (×1.9 FG)` when both are counted, and as a qualified Presented FPS when they are not — never as one inflated number.
- **Ray tracing, actually detected** — including inline ray tracing (DXR 1.1 `RayQuery`), which frame-counting tools miss entirely.
- **Per-process VRAM** and whether the driver was exceeding its budget (a real stutter explanation).
- **Shader-compilation stutter attribution** — which frame spikes were pipeline compiles.
@@ -59,7 +77,7 @@ Plus the usual: Avg / Min / Max / Median FPS, 1% Low, 0.1% Low, frametime distri
## How it works — and the trade-off, stated plainly
None of the settings data above is visible from outside a game process. To read it, FrameLedger loads a component into the game and observes the calls the game makes to graphics APIs — the same class of technique used by frame-rate overlays, recording software, and post-processing injectors. Vulkan titles use a standard Vulkan layer instead.
None of the settings data above is visible from outside a game process. To read it, FrameLedger loads a component into the game and observes the calls the game makes to graphics APIs — the same class of technique used by frame-rate overlays, recording software, and post-processing injectors. Vulkan titles use a standard Vulkan layer instead, when FrameLedger starts them.
**That carries a real risk: anti-cheat systems can detect injected code and may ban accounts.**
@@ -68,7 +86,7 @@ FrameLedger is built to keep that risk small and to be honest about it:
| Safeguard | |
|---|---|
| **Off by default** | Injection is disabled for every game until you enable it individually, after a consent prompt |
| **Hard refusal** | Known anti-cheat/anti-tamper components are detected before injection and every 30 s during a session. Detected ⇒ FrameLedger refuses, or stops capturing at the next scan — so up to 30 s can pass before it reacts to anti-cheat that loads mid-session. For Direct3D/OpenGL that means hooks are removed; for Vulkan it means the layer goes passthrough, because a layer cannot leave the loader chain of a running game. **There is no override — not in settings, not in a config file, not on the command line**<br><br>⚠ **Half of this is built.** The *pre-injection* refusal is real and runs every documented check. The **in-session re-scan does not run at all**: the component inside the game removes its hooks within one frame of being told to, and within 65 s if it stops hearing from the scanner — but nothing yet drives the scanner during a session, so nothing ever tells it. `legal/DISCLAIMER.md` §2 states this in full. For a Vulkan title the stop is the layer's own: it checks the scanner's counter on every present and goes passthrough within one present of the stop flag, or after 65 s without a scan — a title that has stopped presenting is not stopped by that deadline, and presents nothing to be observed either. |
| **Hard refusal** | Known anti-cheat/anti-tamper components are detected before injection and every 30 s during a session. Detected ⇒ FrameLedger refuses, or stops capturing at the next scan — so up to 30 s can pass before it reacts to anti-cheat that loads mid-session. For Direct3D/OpenGL that means hooks are removed; for Vulkan it means the layer goes passthrough, because a layer cannot leave the loader chain of a running game. **There is no override — not in settings, not in a config file, not on the command line**<br><br>✅ **Both halves run since 2026-09-10.** The *pre-injection* refusal runs every documented check, and during every capture the Agent re-runs them every 30 s: the component inside the game removes its hooks within one frame of being told to, and within 65 s if it stops hearing from the scanner. *(Until 2026-09-15 this cell said the in-session re-scan did not run at all, which stopped being true when the Agent's capture loop landed.)* For a Vulkan title the stop is the layer's own: it checks the scanner's counter on every present and goes passthrough within one present of the stop flag, or after 65 s without a scan — a title that has stopped presenting is not stopped by that deadline, and presents nothing to be observed either. |
| **No evasion, ever** | FrameLedger does not hide, rename, obfuscate, or disguise itself. It keeps its real name, real exports, and version info. It is meant to be plainly visible to any security software that looks. This is an architectural rule, not a setting |
| **Read-only** | It never reads or writes game memory, never modifies game behavior, never touches saves or input, and never changes GPU clocks, fans, or power limits |
| **Always a way out** | FrameLedger refuses rather than pushes through. When the guard finds anti-cheat, or the hook fails, or you have not enabled a game, it **stops** — and records the session anyway: start, end, duration, whatever hardware sensors your machine provides, and the reason there is nothing else. Every measured value reads `N/A`; it never estimates one.<br><br>**The way out is that it does not inject, not that it measures another way.** An earlier version of this row promised a no-injection measurement mode. It was designed around Intel PresentMon, that was dropped on 2026-08-27 after measurement, and no replacement was chosen — so **frame times require hooking**. Said in this row rather than a footnote because the row is in the SAFETY table, and a reader deciding whether to enable a game needs the real alternative, not a comfortable one |
@@ -95,16 +113,18 @@ The tier is recorded on every session and shown in the UI. Metrics unavailable a
| `FrameLedger.Overlay.dll` | Inside the game | C++20 hooks + lock-free shared-memory writer. Records only; never analyzes, allocates, or blocks |
| `FrameLedger.VkLayer.dll` | Inside the game | Vulkan implicit layer (Vulkan titles use this instead of injection) |
Elevation is **optional — for everything.** Hooked capture is the normal path and runs as a standard user, and there is no longer any tier that needs more than that. Elevation unlocks exactly two extras: CPU temperature sensors, and attaching to games that themselves run elevated. ~~and the Tier-2 ETW fallback. If you expect to rely on Tier 2, run the Agent elevated.~~ — there is no ETW fallback to rely on.
Elevation is **optional — for everything.** Hooked capture is the normal path and runs as a standard user, and there is no longer any tier that needs more than that. Elevation unlocks exactly two extras: CPU temperature sensors (not read yet — see the block above), and attaching to games that themselves run elevated. ~~and the Tier-2 ETW fallback. If you expect to rely on Tier 2, run the Agent elevated.~~ — there is no ETW fallback to rely on.
## Requirements
- Windows 10 (22H2) or Windows 11, 64-bit
- A 64-bit DirectX 11/12, Vulkan, or OpenGL game for full (Tier-1) capture. **32-bit games — including most DirectX 9 titles — cannot be measured at all**: the component FrameLedger loads is x64 and an x64 DLL cannot enter a 32-bit process. Such a title records duration and hardware telemetry and nothing else. *(This line previously said "supported at Tier 2 only", which meant frame times without injection. That tier no longer exists.)*
- Optional: [PawnIO](https://pawnio.eu/) for CPU temperature (GPU telemetry works without it, through your graphics driver's own libraries)
- A 64-bit DirectX 11/12 or OpenGL game, or a Vulkan game FrameLedger starts, for hooked (Tier-1) capture. **32-bit games — including most DirectX 9 titles — cannot be measured at all**: the component FrameLedger loads is x64 and an x64 DLL cannot enter a 32-bit process. Such a title records duration and hardware telemetry and nothing else. *(This line previously said "supported at Tier 2 only", which meant frame times without injection. That tier no longer exists.)*
- Optional: [PawnIO](https://pawnio.eu/) for CPU temperature, which is not read yet (GPU telemetry works without it, through your graphics driver's own libraries)
## Install
> **No release has been published yet.** The steps below are for the first tagged release; until then FrameLedger runs only from a source build (`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**.
3. Follow the first-run Legal Gate and Agent setup. Nothing is injected until you enable it for a specific game.
@@ -119,7 +139,7 @@ Everything lives locally in `%LOCALAPPDATA%\FrameLedger`. The only network calls
GPL-3.0-only. See `LICENSE`. Third-party components: [`legal/THIRD_PARTY_NOTICES.md`](legal/THIRD_PARTY_NOTICES.md).
GPU telemetry is layered so the project never depends on a proprietary vendor licence: a vendor-neutral DXGI/performance-counter baseline, LibreHardwareMonitor (MPL-2.0) for sensors on all vendors, and NVIDIA's NVAPI SDK (MIT) for NVIDIA-only extras such as Reflex latency. No Intel or AMD GPU *telemetry* SDK is bundled — see `docs/18_GPU_VENDOR_APIS.md` for why. The one AMD component in the tree is five MIT headers from the FidelityFX SDK, used for types only so the upscaler hook can read an FSR title's own dispatch descriptor; nothing AMD-built is linked or redistributed.
GPU telemetry is layered so the project never depends on a proprietary vendor licence: a vendor-neutral DXGI/performance-counter baseline, LibreHardwareMonitor (MPL-2.0) for sensors on all vendors, and NVIDIA's NVAPI SDK (MIT) for NVIDIA-only extras (telemetry and the driver's DLSS record today; Reflex latency is not read yet). No Intel or AMD GPU *telemetry* SDK is bundled — see `docs/18_GPU_VENDOR_APIS.md` for why. The one AMD component in the tree is five MIT headers from the FidelityFX SDK, used for types only so the upscaler hook can read an FSR title's own dispatch descriptor; nothing AMD-built is linked or redistributed.
## Documentation
+7 -2
View File
@@ -301,8 +301,13 @@ Vulkan loader when the Agent launches an opted-in game, so the path is
> layer's ring" with launch mode's budget (the ring appears at the title's first `vkCreateDevice`). The
> CaptureHost's `launch` gives the process the layer's environment (`VkLayerLaunchEnvironment`:
> `VK_ADD_IMPLICIT_LAYER_PATH`, the enable variable, the enable-list line for the session); a D3D title
> ignores all of it. One ring per process, the first creator owns it (`fl_shm_host.h`). Attach mode on a
> running Vulkan title stays Tier 2: only a launch can set the loader's environment. This is
> ignores all of it. One ring per process, the first creator owns it (`fl_shm_host.h`). ~~Attach mode on a
> running Vulkan title stays Tier 2~~ **— not what the code does, found 2026-09-15 while checking `legal/ACCURACY.md`:
> attach mode calls `FlGuardedInject`, which has no presentation-runtime branch (only launch mode's
> `GuardedInjectWhenReady` refuses a Vulkan title with `TargetIsVulkanLayered`), so a running Vulkan title that
> passes the guard gets the Direct3D Overlay injected. What it records there is unverified and nothing tests it;
> whether attach mode should refuse a Vulkan title instead is the owner's open decision.** Only a launch can set
> the loader's environment. This is
stated because the state machine above, read literally, meant the 30 s guard
re-scan — which `19_SAFETY` calls the most important runtime behaviour in the
capture layer — was not specified to run for Vulkan at all. It runs for **every
+24 -5
View File
@@ -27,6 +27,11 @@ Derived in the Agent from the record stream; the mapping is in `03_METRICS`. Sum
| Per-process VRAM | `QueryVideoMemoryInfo` |
| PSO compilation events | pipeline-creation hooks |
> **Not built, 2026-09-15:** four rows above have no writer yet — HDR output, Reflex and PC latency, per-process
> VRAM, and PSO compilation events. The Overlay never sets their measured bits, so every calculator over them
> returns nothing and the columns stay null; `legal/ACCURACY.md` lists them as not measured. This table is the
> design; the block is the state.
> **"present-count delta" is removed from the FG row, and it was not merely unreliable —
> it was structurally zero.** `03_METRICS` §Frame Generation retired that rung on
> 2026-08-05: `IDXGISwapChain::GetFrameStatistics().PresentCount` counts presents *the
@@ -130,8 +135,8 @@ Recorded as a residual risk, not as a solved problem.
| Unreal 4/5 | exe matches `*-Win64-Shipping.exe` **or** `*/Content/Paks/*.pak` | ProductVersion regex `\+\+UE(4\|5)\+Release-(\d+\.\d+)` |
| Godot | `.pck` sibling **or** `strings_contains("Godot Engine v")` | strings regex `Godot Engine v(\d+\.\d+[\.\d]*)` |
| GameMaker | `data.win` | `N/A` |
| RPG Maker MV/MZ ⛔ | `nw.dll` + `www/` or `package.json` | `rpg_core.js` / `rmmz_core.js` header |
| RPG Maker XP/VX/VXAce ⛔ | `RGSS10*`/`RGSS20*`/`RGSS30*.dll` | dll name → XP/VX/VXAce |
| 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 |
| Ren'Py | `renpy/` dir **or** `*.rpa` | `renpy/__init__` strings / `log.txt` first line |
| CryEngine | `CrySystem.dll` | FileVersion |
| Source | `gameinfo.txt` + `bin/engine.dll` | `N/A` |
@@ -141,10 +146,24 @@ Order matters (first match wins). Engine is user-overridable.
**The array order in `detection-rules.json` *is* that precedence**, and the only thing in the repository that notices a reorder is `tests/fixtures/rules/ordering/unity_markers_with_ue_structure` — a directory carrying Unity markers *and* Unreal structure, which is the case `14_TESTING` names.
⛔ **Two rows cannot be expressed in schemaVersion 2**, and are documented rather than half-implemented — a rule that exists but never fires is worse than one that is absent, because it reads as coverage:
> **Both RPG Maker rows were ⛔ "cannot be expressed in schemaVersion 2" until 2026-09-16, and the reasoning was
> half right.** It said MV/MZ needs `nw.dll` **and** (`www/` **or** `package.json`), a nested group v2 refuses. But
> MV and MZ both ship `package.json` beside `nw.dll` unconditionally — `www/` is only where MV keeps its data — so
> `all: [nw.dll, package.json]` is the whole signal and needs no nesting. Measured on the owner's *Flower in Us*
> (Steam) and a hand-extracted MV title, both `Game.exe` + `nw.dll` + `package.json` (+ `www/`), both `engine=none`
> until this rule. The RGSS family is one rule, `rpgmaker_rgss` "RPG Maker XP/VX/VX Ace", `any` over the three DLL
> prefixes and the three archive extensions, `version: null` — the variant is not named, which is the product
> decision the old note deferred, taken as "one engine, no version" rather than three rules. **What still cannot be
> expressed** is a version for either: MV/MZ's lives in a sibling `.js` header and `strings_regex` has no `from`;
> RGSS's is which DLL matched. Both rules sit after `unity` and `unreal` and before `godot` (an MV game has no
> `.pck`; a Godot game has no `nw.dll`), with fixtures `engines/rpgmaker_mv` and `engines/rpgmaker_rgss`, and the
> `every_engine_marker` canary carries both engines' markers and still expects `unity`. `rulesVersion` is
> `2026.09.1`, so the sweep's cache key changes and every game is re-detected on the next pass.
- **RPG Maker MV/MZ.** The signal is `nw.dll` **and** (`www/` **or** `package.json`) — a nested group, and `signalGroup` sets `maxProperties: 1` with its own `$comment` saying nesting is unsupported in v2. Its version is a header inside a sibling `.js`, and `strings_regex` carries no `from`, so it cannot be aimed at a file other than the executable.
- **RPG Maker XP/VX/VXAce.** The signals *are* expressible (`any` over the three `RGSS*` prefixes), but the version is "which of them matched" — an answer no extractor produces. Splitting it into three engine rules with `version: null` and the variant in the display name would work and is a product decision about how the engine reads in the UI, not a mechanical fill-in.
⛔ *(kept for the record — the two rows above were the ones this note described)* **Two rows cannot be expressed in schemaVersion 2**, and are documented rather than half-implemented — a rule that exists but never fires is worse than one that is absent, because it reads as coverage:
- ~~**RPG Maker MV/MZ.** The signal is `nw.dll` **and** (`www/` **or** `package.json`) — a nested group, and `signalGroup` sets `maxProperties: 1` with its own `$comment` saying nesting is unsupported in v2.~~ Its version is a header inside a sibling `.js`, and `strings_regex` carries no `from`, so it cannot be aimed at a file other than the executable.
- ~~**RPG Maker XP/VX/VXAce.** The signals *are* expressible (`any` over the three `RGSS*` prefixes), but the version is "which of them matched" — an answer no extractor produces. Splitting it into three engine rules with `version: null` and the variant in the display name would work and is a product decision about how the engine reads in the UI, not a mechanical fill-in.~~
Everything else in the table is in the data and has a fixture; `rules-validate.ps1` fails if a rule id has no fixture directory, or a fixture no rule.
+37 -9
View File
@@ -6,7 +6,7 @@
- Minimum level `Information` (`Debug` toggle in Settings → applies live via `LoggingLevelSwitch`).
- Enrichers: process name, version, `SessionGuid` and `GamePid` scoped properties during capture (`LogContext.PushProperty`).
- Template: `[{Timestamp:HH:mm:ss.fff} {Level:u3}] {SourceContext} {Message:lj} {Properties:j}{NewLine}{Exception}`.
- **Never log:** full user paths outside `%LOCALAPPDATA%\FrameLedger` (redact to `<user>`), machine name, any exe arguments of games. A `RedactingEnricher` enforces the path rule.
- **Never log:** full user paths outside `%LOCALAPPDATA%\FrameLedger` (redact to `<user>`), machine name, any exe arguments of games. ~~A `RedactingEnricher` enforces the path rule.~~ *(No such enricher was ever written: found 2026-09-15, checking `legal/PRIVACY_POLICY.md` §3's "logs are redacted (user directory paths removed) before bundling" against the bundle, which copied the logs verbatim. An enricher could not have kept the rule anyway: exception text and the Overlay's native log never pass through one, and the data directory itself sits under the user's profile, so every run logs a user name. The rule is enforced where a log leaves the machine instead: `App/Services/LogRedactor` over every log copy in the bug bundle, §Bug report flow step 2. The files in `logs\` keep their full paths; they leave the PC only if the user copies them.)*
- Capture hot path logs nothing per-frame; counters summarized at finalize.
## Crash handling (the app's own crashes)
@@ -33,7 +33,10 @@
> `AppDomain.UnhandledException` (any other thread) is Fatal + dump only: the runtime is already ending the process and
> no dialog can be relied on to appear, so the next bug report offers that dump instead. An unobserved task stays an
> Error line. A startup failure `RunAsync` catches itself (the ledger will not open, the host will not start) is not an
> unhandled exception: it is still a Fatal line and exit code 1 with no dialog.
> unhandled exception: ~~it is still a Fatal line and exit code 1 with no dialog~~ **since 2026-09-15 it is the Fatal
> line and `Services/StartupFailureDialog`**, a Win32 message box with the exception's message and the log folder, whose
> Yes opens that folder; exit code 1 either way. Until then nothing on screen said FrameLedger had even tried to start.
> Tests: `StartupFailureDialogTests`.
>
> **The Agent** (no window, so no dialog): the same Fatal + dump from `AppDomain.UnhandledException` and from `Main`'s
> own catch, once per process whichever sees it first, then the exception stays unhandled, so the exit is the runtime's
@@ -67,8 +70,9 @@ Tails the active files (shared read), level filter, text search, pause autoscrol
> **Step 2 built 2026-09-14 (P3 PR-8a), narrower than this list; steps 1 (Help menu, crash dialog), 3, 4 and 5
> are P4's.** `App/Services/BugBundleBuilder` writes the zip where the Logs page's save dialog says
> (`FrameLedger-bugreport-YYYYMMDD-HHmm.zip`): `logs/` = every `ui-*.log` and `agent-*.log` modified in the last
> seven days, **copied verbatim, not redacted** — the files carry no paths beyond the data directory and no
> game data, and a redaction pass that nobody has specified would be a claim; `overlay/` = the five newest
> seven days, ~~**copied verbatim, not redacted** — the files carry no paths beyond the data directory and no
> game data, and a redaction pass that nobody has specified would be a claim~~ **redacted since 2026-09-15, note
> below** (the data directory is under the user's profile, so the claim was false on every machine); `overlay/` = the five newest
> `overlay-<pid>-*.log` (the ring's counters and the `FAULT`/`UNHOOK_*` lines are in those files, not
> separately); `sysinfo.json` = app version, and from the Agent's `HelloAck` when connected its version, the
> overlay build id, telemetry source, Vulkan layer state, elevation, CPU-temperature availability (the
@@ -90,7 +94,20 @@ Tails the active files (shared read), level filter, text search, pause autoscrol
> summary as Markdown** puts `sysinfo.json`'s twelve keys on the clipboard as a table. Both behind ports
> (`IBugReportPreview`, `IUrlOpener`, `IClipboard`) so `BugReportFlowTests` pins the exact URL without a browser.
> ~~Still open from this list: the **crash dialog and the minidump** (§Crash handling, step 1's third entry point)
> and the optional session-metadata / dump checkboxes of step 2.~~ PR-9 below; the session-metadata checkbox is open.
> and the optional session-metadata / dump checkboxes of step 2.~~ PR-9 below, and the session-metadata checkbox after it (2026-09-15).
>
> **The log copies are redacted since 2026-09-15.** `App/Services/LogRedactor` is what the list's "redacted copies"
> and `legal/PRIVACY_POLICY.md` §3 promised: in every `logs/` and `overlay/` entry the name in each
> `X:\Users\<name>` path becomes `<user>`, and so does the last segment of this user's profile directory when it
> lives elsewhere (`D:\Profiles\<name>`). Every spelling a log carries is covered: backslashes, the doubled
> backslashes of Serilog's JSON properties, forward slashes, any case, a name with spaces, and the `?` the Overlay's
> ANSI image path writes for a letter its code page lacks. The file is read as bytes through Latin-1, so a UTF-8
> log and an ANSI one both come out byte for byte except the names. Over-redaction is the chosen failure:
> `C:\Users\Public` reads `<user>` too. The measured need on the dev box: the profile path appeared 8 times in
> `ui-*.log`, 7 in `agent-*.log` and in 175 overlay headers; no machine name or bare user name did. A crash dump is
> memory and cannot be redacted, which its checkbox says. Tests: `LogRedactorTests` (fifteen cases, both
> directions, UTF-8 and ANSI bytes), `BugBundleBuilderTests` (the copies carry no user name, the file on disk is
> untouched).
>
> **The crash dump's checkbox and step 1's third entry point built 2026-09-15 (P4 PR-9).** When
> `BugBundleBuilder.LatestCrashDump` finds a `*.dmp` written in the last seven days under `crashdumps\` (either
@@ -100,10 +117,21 @@ Tails the active files (shared read), level filter, text search, pause autoscrol
> settings. Continue with the box clear writes the bundle without it; ticked, `crashdumps/<name>.dmp` goes in;
> Cancel writes nothing. `WriteAsync` refuses a dump from anywhere but that directory, before the zip is created. It
> is a dialog before the save rather than a box on step 3's preview because the preview lists a zip that is already
> written. The crash dialog (§Crash handling) is step 1's third entry point. Still open: the session-metadata
> checkbox. Tests: `BugBundleBuilderTests` (only when passed, only from the directory, the newest of the week),
> `BugReportFlowTests` (no dump no question; left clear, ticked, cancelled), `BugBundleOptionsViewModelTests`,
> `PagesLoadTests`.
> written. The crash dialog (§Crash handling) is step 1's third entry point. ~~Still open: the session-metadata
> checkbox.~~ Built the same day, below. Tests: `BugBundleBuilderTests` (only when passed, only from the directory,
> the newest of the week), `BugReportFlowTests` (no dump no question; left clear, ticked, cancelled),
> `BugBundleOptionsViewModelTests`, `PagesLoadTests`.
>
> **The last session's checkbox built 2026-09-15**, which completes this list's optional items. The same **Optional
> items** dialog carries a second box when the ledger holds a session: the newest one (`App/Services/LastSessionSummary`),
> labelled with its game and local start time, with a line saying what the file holds. Ticked, the bundle gains
> `session.json`: File ▸ Export's own JSON (`SessionExporter.Document` — metadata, aggregates, segments, hardware)
> **without the user's notes and tags**, and passed through `LogRedactor` like a log because it names the executable.
> No frame or sensor series, which is the list's "never raw blobs". The dialog now appears when either item exists and
> not at all when neither does; the port's answer is `BugBundleOptions` (closed, or which boxes were ticked) where
> PR-9's was `CrashDumpChoice`. Tests: `LastSessionSummaryTests` (the newest session, no notes or tags, nothing for an
> empty ledger), `BugReportFlowTests` (left clear, and ticked with a profile path redacted in the zip),
> `BugBundleOptionsViewModelTests` (every box clear, an absent item cannot be included), `PagesLoadTests`.
3. **Preview step:** the dialog lists every file included and lets the user open the zip before continuing. Nothing is ever sent automatically.
4. "Open GitHub issue" → launches browser to
`https://github.com/poli0981/frameledger/issues/new?template=bug_report.yml&title=[Bug]%20&labels=bug&app_version=…&os=…`
+2 -2
View File
@@ -249,8 +249,8 @@ Findings written to `docs/spike-notes.md`. Nothing in P1 starts until the exit c
> **Two things keep this ◐ rather than ✅:**
>
> - **The baseline side cannot be run.** This item's text says *"compare against what the
> item-3 baseline reports"*, and `StaticGameDetector` has **no runnable vehicle** — every
> construction of it is in `tests/`. So the comparison has one arm. `HANDOFF` item 5
> item-3 baseline reports"*, and `StaticGameDetector` ~~has **no runnable vehicle** — every
> construction of it is in `tests/`~~ *(has had one since P4 PR-1, 2026-09-14: the Agent's `DetectionSweep`)*. So the comparison has one arm. `HANDOFF` item 5
> records this as uncosted; this file had never said it at all.
> - **The README sentence does not exist**, and it is the artifact this item is for. It is
> **not a percentage** — item 3 and `spike-notes` §8 already record that the baseline
+1 -1
View File
@@ -133,7 +133,7 @@ Every hook must be listed here with a purpose. Anything not on this list is not
> Reset is load-bearing — and no vendor symbol is resolved by name, so `FL_HOOK_INVENTORY`
> and `hookinventory-check` do not cover them at all.
> **Every other row below is unwritten**, including
> `SetFullscreenState`, `SetColorSpace1`, `CreateSwapChain*`, `wglSwapBuffers`,
> `SetFullscreenState`, `SetColorSpace1`, `CreateSwapChain*`, ~~`wglSwapBuffers`~~ (built 2026-09-06, #141, its row below),
> `ID3D12Device5::CreateStateObject`, §Pipeline and §Memory/latency.
>
> Stated here because the distinction is invisible from the table. What a writer may then
+1 -1
View File
@@ -690,7 +690,7 @@ The README sentence is **not a percentage** — the recorded decision is that th
cannot answer four of the five questions at all.
**Two things nobody has costed** (found by the completeness critic, 2026-08-05):
`StaticGameDetector` has **no runnable vehicle** — every construction is in tests — so
`StaticGameDetector` ~~has **no runnable vehicle** — every construction is in tests~~ *(runs in the Agent's `DetectionSweep` since P4 PR-1, 2026-09-14)* — so
item 4's mandated comparison cannot be re-run on the *baseline* side either; and the
only candidate title exercising all five required values is a **Streamline** title,
i.e. the one class where the hook premise is recorded INCONCLUSIVE.
+48 -30
View File
@@ -11,35 +11,53 @@
that changes what FrameLedger.Overlay or the capture host does; date the change.
HTML comments are not part of the block.
-->
> ⚠ **What FrameLedger actually measures today — 2026-09-06.** The software is pre-alpha: the
> measurement path exists as an injected Direct3D 11/12 component and an **unshipped** capture
> host that drives the guard loop and prints a report; there is no Agent loop, no storage, no
> charts, no library import, no UI and no installer yet.
> ⚠ **What FrameLedger actually measures today — 2026-09-15.** The software is pre-alpha and
> **unreleased**: no tagged build or installer has been published. 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, injects only into games you enabled and only past the safety guard, and
> stores sessions in a local database. What that path measures:
>
> - **Frame times and output resolution:** measured, from the present hook, for injected D3D11/12
> titles, and for Vulkan titles **launched through FrameLedger** (the layer intercepts
> `vkQueuePresentKHR` since 2026-09-06; a Vulkan title already running when FrameLedger attaches is
> not observed). OpenGL/D3D9 intercept nothing yet.
> - **Which upscaler is running:** measured from the API the game calls — DLSS (with Ray
> Reconstruction Yes/No) through NVIDIA Streamline; FSR 2/3.x/4 through AMD's shipped DLLs; DLSS on
> titles that bypass Streamline is reported from the NVIDIA driver's own per-process record,
> labelled *driver-reported*. Intel XeSS is **not** read (its SDK licence forbids it) and reads
> `N/A` by policy; an upscaler compiled into the game executable reads `N/A`.
> - **Quality preset:** `N/A` everywhere. No route this software may use exposes it.
> - **Render → output resolution:** measured where the vendor's own call carries the size (AMD
> dispatches, some Streamline titles); `N/A` where it does not (NVIDIA-direct titles, most
> Direct3D 12 Streamline titles).
> - **Frame generation:** the Displayed rate is counted from presents — including, on one title,
> presents DXGI counted that the hook could not — and the Native rate from the vendor's own
> per-frame calls where the title makes them. Identity: DLSS-G and FSR-FG named from the calls
> the game makes; anything else (XeSS-FG, a generator compiled into the game) is reported *by
> elimination* and never named. Where no per-frame call exists the Native rate is `N/A`.
> - **Ray tracing:** Yes/No measured from DXR dispatches and acceleration-structure builds on
> Direct3D 12; the technique and path tracing are `N/A`.
> - **Not measured at all:** video memory, shader-compilation stutter, PC latency (Reflex), HDR.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-
> vendor half of the suspicious-module rule (since 2026-09-06), and the unshipped capture host
> re-runs them every 30 s and stops the capture on refusal. No shipped component drives that loop
> yet. There is no override anywhere.
> - **Frame times and output resolution:** measured from the present call for Direct3D 11/12 and
> OpenGL titles FrameLedger injects into. Vulkan titles are measured only when FrameLedger itself
> starts the game with its Vulkan layer enabled, which today only the Agent's command-line launch
> does. A Vulkan title started any other way is not observed by the layer; FrameLedger injects its
> Direct3D component into it instead, and what that records on a Vulkan title has not been
> verified. Direct3D 9 and every 32-bit title are not measured.
> - **Which upscaler is running:** measured from the API a Direct3D title calls — DLSS or NIS through
> NVIDIA Streamline (with Ray Reconstruction Yes/No), and FSR through AMD's shipped FidelityFX DLLs:
> named FSR 3 from the older DLLs, and FSR without a version from the newer ones, which host both
> FSR 3.1 and FSR 4. FSR 2, and FSR shipped any other way, is not identified. For DLSS titles that
> bypass Streamline, the NVIDIA driver's own per-process record is stored with the session, labelled
> *driver-reported*; the app does not display it yet. Intel XeSS is **not** read (its SDK licence
> forbids it), and neither is an upscaler compiled into the game: those read `N/A`, or "Unknown
> upscaler" when another vendor's hook ran in the game. Vulkan and OpenGL titles read `N/A`.
> - **Quality preset:** not reported on any title measured. The one route this software may use — the
> DLSS options a Streamline title passes with its per-frame call — has not been seen on a real
> title, and AMD's per-frame call carries no preset.
> - **Render → output resolution:** measured where the vendor's own per-frame call carries the render
> size (AMD FidelityFX dispatches, and Streamline titles whose resource tags state it); `N/A` where it
> does not: DLSS titles that bypass Streamline, Streamline titles whose tags carry no size, and Vulkan
> and OpenGL titles.
> - **Frame generation (Direct3D titles only):** the Displayed rate is counted from presents, plus the
> presents DXGI's own counter saw on the same swap chain that the hook did not; the Native rate from
> the vendor's own per-frame calls (NVIDIA Streamline, AMD FidelityFX) where the title makes them, and
> `N/A` where it does not. DLSS-G and FSR FG are named from the calls the game makes; any other
> generator (XeSS-FG, one compiled into the game) is shown only as active with the technology not
> identified, and is never named. Where a technology is named but its frames could not be counted, or
> frame generation is not measured, the software shows **Presented FPS** with a note on what it may
> include — never a Native figure.
> - **Ray tracing:** Yes/No measured on Direct3D 12 from ray-dispatch and acceleration-structure-build
> calls; the technique and path tracing are `N/A`, and so is ray tracing on other APIs.
> - **Video memory:** in use on the whole graphics card, recorded from Windows and GPU-driver telemetry
> and charted. **Not measured at all:** each game's own video-memory use and budget, which frame
> spikes were shader compilation, PC latency (Reflex), HDR, and CPU temperature. Stutter count and
> stutter time are measured from frame times.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
> goes passthrough. A global switch in Settings turns all hooking off, and a running capture stops at
> its next check; it can only refuse, never permit. There is no override anywhere.
>
> Where a value is not measured it reads `N/A`; the software never substitutes an estimate.
> Where a value is not measured it reads `N/A`, with two exceptions: FPS then shows Presented FPS with a
> note on what it may include, and ray-tracing flags may show a value you set yourself, labelled as
> yours. The software never substitutes an estimate.
+54 -34
View File
@@ -1,6 +1,6 @@
# FrameLedger — Disclaimer
**Version:** 2.0-draft · **Effective:** {{RELEASE_DATE}}
**Version:** 2.1-draft · **Effective:** {{RELEASE_DATE}}
> ⚠ Draft for review. Not legal advice. Review before first public release — this version covers code injection and should be read carefully.
@@ -8,6 +8,8 @@
>
> **A FIFTH time, 2026-09-06, and the mechanism changed rather than the count.** Every drift this block records came from the same cause: the sentence about what the software measures lived in three places and was re-read in none of them. It now lives in **one** — `legal/ACCURACY.md`, embedded verbatim in §4 below and in `README.md`, and `tools/accuracy-check.ps1` fails the build when a copy differs from the source (`20_OPEN_QUESTIONS` §S23-6). The bullets below are the history of the four drifts and are kept as history; the block in §4 is the current statement, dated.
>
> **A SIXTH time, 2026-09-15, and the drift ran the safe way again.** The block in §4 is re-dated and rewritten against the code: OpenGL is measured, the shipped Agent runs the in-session re-scan, the whole-card video memory is recorded, and the Vulkan, preset, FSR-version and frame-generation sentences say exactly what the code does. Two bullets below became false because the software caught up with them, and they are struck where they sit. Version 2.1-draft, so the first-run gate shows this document again.
>
> **The fourth drift is the first one that ran the other way, and that is the finding.** Every previous re-count found this document claiming *more* than the software did. #64 landed the upscaler identity hook and this block went on saying "there is no upscaler hook anywhere in the software" — an under-claim, in the one file whose failure mode everybody was watching for in the opposite direction. It went unnoticed for five days for exactly that reason: a reviewer checking whether `legal/` over-promises reads a sentence like that and moves on. **Re-reading this block means checking both directions.**
>
> **The re-count was overdue and this block's own rule is what says so.** The last line of this block requires whoever changes what `FrameLedger.Overlay` does to re-read it. #48 changed exactly that — the Overlay now drops `DXGI_PRESENT_TEST` presents without recording them — and this block was not re-read. That is the second time the rule has been broken since it was written, and both breaches were invisible from inside the PR that caused them.
@@ -17,9 +19,9 @@
> **Two bullets changed substance and neither could be struck.** The capture side that *receives* a stop now exists and now runs whether or not the game is presenting; the side that would *send* one still does not. That is the pattern to watch for when re-counting: half a mechanism reads as a whole one, and the half that is missing is usually the one nobody was looking at.
>
> - ~~§1's *"what it observes: … presentation, upscaling, ray tracing, pipeline creation"* and §4's *"upscaling, frame-generation and ray-tracing state are read from the parameters the game passes to those APIs"* — **only the presentation path is intercepted.** There is no upscaler hook, no frame-generation hook, no ray-tracing hook and no pipeline hook anywhere in the software.~~ **FALSE SINCE #64, corrected 2026-08-14 — the fourth drift, and this one is the block's own subject.** An **upscaler hook exists**: one detour on `sl.interposer.dll!slEvaluateFeature`, module-scoped, reading one argument. It measures **which upscaler is running** (DLSS, NIS, or `unknown` — never "none") and, for Streamline titles, **whether Ray Reconstruction is active**, which is a `Yes`/`No` the software now publishes. What still does not exist: quality preset, render resolution, frame generation, ray tracing, pipeline. The capture side states all of that in its own data on every frame rather than defaulting to "none", so nothing false is *recorded*; what over-promised was this document, in the direction of under-claiming rather than over-claiming — which is the safer direction and is still wrong. Both sentences are qualified where they sit.
> - §2's *"and every 30 seconds afterwards … it stops at the next scan"* — the pre-injection guard is real and refuses. The **receiving half is implemented**: an injected D3D title removes its hooks within one frame of the stop flag being set. The **sending half is still missing, and the missing part is narrower than this block used to say.** Both the write path (`ShmRingReader.PublishGuardResult`, which maps the shared memory and advances the field) and the read path exist in shipped code and are tested; what does not exist is a production caller that runs the loop between them. A missing loop, not a missing subsystem — and the user-facing consequence is identical: **no re-scan runs and no stop is ever sent.**
> - ~~§2's *"and every 30 seconds afterwards … it stops at the next scan"* — the pre-injection guard is real and refuses. The **receiving half is implemented**: an injected D3D title removes its hooks within one frame of the stop flag being set. The **sending half is still missing, and the missing part is narrower than this block used to say.** Both the write path (`ShmRingReader.PublishGuardResult`, which maps the shared memory and advances the field) and the read path exist in shipped code and are tested; what does not exist is a production caller that runs the loop between them. A missing loop, not a missing subsystem — and the user-facing consequence is identical: **no re-scan runs and no stop is ever sent.**~~ **FALSE SINCE 2026-09-10 (P2 PR-F), struck 2026-09-15:** the shipped Agent drives the loop — during every capture it re-runs the checks every 30 s and sends the stop on a refusal (`legal/ACCURACY.md`, embedded in §4).
> - §2's *"waits **65 seconds** before concluding that contact is lost"* — **the deadline now has a reader, and since 2026-08-05 it runs whether or not the game is presenting.** For one day it was evaluated only on a present, so a title that had hung or been alt-tabbed never reached it — the exact case the mechanism was specified for. A watchdog inside the injected component now checks once a second regardless. Two qualifications remain: for **Vulkan titles the check runs on each present rather than once a second** — the layer may not own a thread, so a Vulkan title that has stopped presenting is not stopped by the deadline (and presents nothing to be observed) — and **the 65-second value itself is not covered by a test** — the stop is proven to fire, but a suite that runs on every build cannot wait 65 seconds, so what is verified is the mechanism, not the number.
> - §3's *"automatically stops injecting into a game that crashes shortly after injection twice"* — the only trace of this anywhere is a `hook_crash_count` column in a schema for which no `.sql` file exists. There is no design for it.
> - ~~§3's *"automatically stops injecting into a game that crashes shortly after injection twice"* — the only trace of this anywhere is a `hook_crash_count` column in a schema for which no `.sql` file exists. There is no design for it.~~ **BUILT 2026-09-10 (P2 PR-D), struck 2026-09-15:** two crashes of the same game within 60 s of injection disable hooking for that game, with the reason on its row (`CrashAutoDisablePolicy`).
> - §1's *"Only FrameLedger's own component is ever loaded"* — **narrower than it sounds, and the qualification is now in §1 itself.** The check is a directory test: the payload must resolve into FrameLedger's own install directory. It does not compare a filename, a version or any content, deliberately — a name check would be defeated by any DLL that borrowed the name. A published self-contained build puts several hundred files in that directory.
>
> **None of this may ship as-is.** Either the behaviour exists at first release or these sentences change. Tracked in `docs/20_OPEN_QUESTIONS.md`.
@@ -92,43 +94,61 @@ Software running inside another process can, in principle, destabilize it. Frame
Frame timing is derived from high-resolution timestamps taken at the moment the game presents each frame; upscaling, frame-generation and ray-tracing state are read from the parameters the game passes to those APIs. This is substantially more accurate than inferring settings from files on disk, but **no measurement is guaranteed to be exact**:
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-09-06.** The software is pre-alpha: the
> measurement path exists as an injected Direct3D 11/12 component and an **unshipped** capture
> host that drives the guard loop and prints a report; there is no Agent loop, no storage, no
> charts, no library import, no UI and no installer yet.
> ⚠ **What FrameLedger actually measures today — 2026-09-15.** The software is pre-alpha and
> **unreleased**: no tagged build or installer has been published. 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, injects only into games you enabled and only past the safety guard, and
> stores sessions in a local database. What that path measures:
>
> - **Frame times and output resolution:** measured, from the present hook, for injected D3D11/12
> titles, and for Vulkan titles **launched through FrameLedger** (the layer intercepts
> `vkQueuePresentKHR` since 2026-09-06; a Vulkan title already running when FrameLedger attaches is
> not observed). OpenGL/D3D9 intercept nothing yet.
> - **Which upscaler is running:** measured from the API the game calls — DLSS (with Ray
> Reconstruction Yes/No) through NVIDIA Streamline; FSR 2/3.x/4 through AMD's shipped DLLs; DLSS on
> titles that bypass Streamline is reported from the NVIDIA driver's own per-process record,
> labelled *driver-reported*. Intel XeSS is **not** read (its SDK licence forbids it) and reads
> `N/A` by policy; an upscaler compiled into the game executable reads `N/A`.
> - **Quality preset:** `N/A` everywhere. No route this software may use exposes it.
> - **Render → output resolution:** measured where the vendor's own call carries the size (AMD
> dispatches, some Streamline titles); `N/A` where it does not (NVIDIA-direct titles, most
> Direct3D 12 Streamline titles).
> - **Frame generation:** the Displayed rate is counted from presents — including, on one title,
> presents DXGI counted that the hook could not — and the Native rate from the vendor's own
> per-frame calls where the title makes them. Identity: DLSS-G and FSR-FG named from the calls
> the game makes; anything else (XeSS-FG, a generator compiled into the game) is reported *by
> elimination* and never named. Where no per-frame call exists the Native rate is `N/A`.
> - **Ray tracing:** Yes/No measured from DXR dispatches and acceleration-structure builds on
> Direct3D 12; the technique and path tracing are `N/A`.
> - **Not measured at all:** video memory, shader-compilation stutter, PC latency (Reflex), HDR.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-
> vendor half of the suspicious-module rule (since 2026-09-06), and the unshipped capture host
> re-runs them every 30 s and stops the capture on refusal. No shipped component drives that loop
> yet. There is no override anywhere.
> - **Frame times and output resolution:** measured from the present call for Direct3D 11/12 and
> OpenGL titles FrameLedger injects into. Vulkan titles are measured only when FrameLedger itself
> starts the game with its Vulkan layer enabled, which today only the Agent's command-line launch
> does. A Vulkan title started any other way is not observed by the layer; FrameLedger injects its
> Direct3D component into it instead, and what that records on a Vulkan title has not been
> verified. Direct3D 9 and every 32-bit title are not measured.
> - **Which upscaler is running:** measured from the API a Direct3D title calls — DLSS or NIS through
> NVIDIA Streamline (with Ray Reconstruction Yes/No), and FSR through AMD's shipped FidelityFX DLLs:
> named FSR 3 from the older DLLs, and FSR without a version from the newer ones, which host both
> FSR 3.1 and FSR 4. FSR 2, and FSR shipped any other way, is not identified. For DLSS titles that
> bypass Streamline, the NVIDIA driver's own per-process record is stored with the session, labelled
> *driver-reported*; the app does not display it yet. Intel XeSS is **not** read (its SDK licence
> forbids it), and neither is an upscaler compiled into the game: those read `N/A`, or "Unknown
> upscaler" when another vendor's hook ran in the game. Vulkan and OpenGL titles read `N/A`.
> - **Quality preset:** not reported on any title measured. The one route this software may use — the
> DLSS options a Streamline title passes with its per-frame call — has not been seen on a real
> title, and AMD's per-frame call carries no preset.
> - **Render → output resolution:** measured where the vendor's own per-frame call carries the render
> size (AMD FidelityFX dispatches, and Streamline titles whose resource tags state it); `N/A` where it
> does not: DLSS titles that bypass Streamline, Streamline titles whose tags carry no size, and Vulkan
> and OpenGL titles.
> - **Frame generation (Direct3D titles only):** the Displayed rate is counted from presents, plus the
> presents DXGI's own counter saw on the same swap chain that the hook did not; the Native rate from
> the vendor's own per-frame calls (NVIDIA Streamline, AMD FidelityFX) where the title makes them, and
> `N/A` where it does not. DLSS-G and FSR FG are named from the calls the game makes; any other
> generator (XeSS-FG, one compiled into the game) is shown only as active with the technology not
> identified, and is never named. Where a technology is named but its frames could not be counted, or
> frame generation is not measured, the software shows **Presented FPS** with a note on what it may
> include — never a Native figure.
> - **Ray tracing:** Yes/No measured on Direct3D 12 from ray-dispatch and acceleration-structure-build
> calls; the technique and path tracing are `N/A`, and so is ray tracing on other APIs.
> - **Video memory:** in use on the whole graphics card, recorded from Windows and GPU-driver telemetry
> and charted. **Not measured at all:** each game's own video-memory use and budget, which frame
> spikes were shader compilation, PC latency (Reflex), HDR, and CPU temperature. Stutter count and
> stutter time are measured from frame times.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
> goes passthrough. A global switch in Settings turns all hooking off, and a running capture stops at
> its next check; it can only refuse, never permit. There is no override anywhere.
>
> Where a value is not measured it reads `N/A`; the software never substitutes an estimate.
> Where a value is not measured it reads `N/A`, with two exceptions: FPS then shows Presented FPS with a
> note on what it may include, and ray-tracing flags may show a value you set yourself, labelled as
> yours. The software never substitutes an estimate.
<!-- accuracy-block:end -->
- Frame timing: typically better than 0.05% error; hardware sensors carry their own accuracy limits (±1–2 °C is normal).
- 1% Low and 0.1% Low are statistical and are hidden when the sample size is insufficient.
- Path tracing has no reliable technical signature; FrameLedger reports it as a confidence-scored suggestion only and never asserts it.
- Path tracing has no reliable technical signature; FrameLedger reports it as `N/A` and never asserts it. *(This line promised a confidence-scored suggestion; none is computed. Corrected 2026-09-15.)*
- When measurement is unavailable (no-injection mode, unsupported API, missing vendor support), fields read `N/A`. FrameLedger does not substitute estimates for measurements.
Do not use FrameLedger's output as the sole basis for purchasing, warranty, overclocking, or safety decisions.
+23 -1
View File
@@ -41,7 +41,7 @@
"level, which made it a check that could not fire."
],
"schemaVersion": 2,
"rulesVersion": "2026.08.2",
"rulesVersion": "2026.09.1",
"engines": [
{
@@ -62,6 +62,28 @@
] },
"version": { "type": "pe_product_version_regex", "value": "\\+\\+UE(4|5)\\+Release-(\\d+\\.\\d+)" }
},
{
"id": "rpgmaker_mv",
"name": "RPG Maker MV/MZ",
"signals": { "all": [
{ "type": "sibling_glob", "value": "nw.dll" },
{ "type": "sibling_glob", "value": "package.json" }
] },
"version": null
},
{
"id": "rpgmaker_rgss",
"name": "RPG Maker XP/VX/VX Ace",
"signals": { "any": [
{ "type": "sibling_glob", "value": "RGSS1*.dll" },
{ "type": "sibling_glob", "value": "RGSS2*.dll" },
{ "type": "sibling_glob", "value": "RGSS3*.dll" },
{ "type": "sibling_glob", "value": "*.rgssad" },
{ "type": "sibling_glob", "value": "*.rgss2a" },
{ "type": "sibling_glob", "value": "*.rgss3a" }
] },
"version": null
},
{
"id": "godot",
"name": "Godot",
+9 -1
View File
@@ -103,6 +103,13 @@ public partial class App : System.Windows.Application
{
Log.Fatal(ex, "ui: the run ended in an exception");
exitCode = 1;
// 10_LOGGING §Crash handling: a start that fails is said on screen, not only in the log. A crash the dispatcher
// already reported has had its dialog.
if (!_crashes.Crashed)
{
StartupFailureDialog.Show(ex, UiPaths.Logs);
}
}
finally
{
@@ -280,13 +287,14 @@ public partial class App : System.Windows.Application
services.AddSingleton<IRunAtLogon, RunAtLogonRegistry>();
services.AddSingleton<SafetyNotices>();
services.AddSingleton(static _ => new LogTail(UiPaths.Logs));
services.AddSingleton(static sp => new BugBundleBuilder(UiPaths.Logs, sp.GetRequiredService<RegisteredSettings>(), crashDumpDirectory: UiPaths.CrashDumps));
services.AddSingleton(static sp => new BugBundleBuilder(UiPaths.Logs, sp.GetRequiredService<RegisteredSettings>(), crashDumpDirectory: UiPaths.CrashDumps, redactor: LogRedactor.ForCurrentUser()));
// The bug report's steps 3-4 and the shell's Export (P4 PR-3): the preview dialog, the browser, the clipboard,
// the flow over them, the session the shell exports, and the CSV/JSON service the summary window's writers serve.
services.AddSingleton<IUrlOpener, ShellUrlOpener>();
services.AddSingleton<IClipboard, WpfClipboard>();
services.AddSingleton<IBugReportPreview, BugReportPreviewPrompt>();
services.AddSingleton<LastSessionSummary>();
services.AddSingleton<BugReportFlow>();
services.AddSingleton<SessionSelection>();
services.AddSingleton<SessionExportService>();
@@ -9,13 +9,19 @@
mc:Ignorable="d"
MinWidth="480">
<!--
10_LOGGING §Bug report flow step 2's optional item (P4 PR-9): the crash dump goes in only when it is ticked
(legal/PRIVACY_POLICY.md §3). The box starts clear, and its label and the line under it say how large the dump is
and what it can hold before anyone ticks it.
10_LOGGING §Bug report flow step 2's optional items: the crash dump (P4 PR-9) and the last session's summary each go
in only when ticked (legal/PRIVACY_POLICY.md §3). Only the items there are get a box; every box starts clear, and
the line under it says what the item holds before anyone ticks it.
-->
<StackPanel>
<ui:TextBlock TextWrapping="Wrap" Text="{x:Static vm:BugBundleOptionsViewModel.Intro}" />
<CheckBox Margin="0,12,0,0" IsChecked="{Binding IncludeCrashDump}" Content="{Binding DumpLabel}" />
<ui:TextBlock Margin="28,4,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:BugBundleOptionsViewModel.DumpDetail}" />
<StackPanel Visibility="{Binding HasCrashDump, Converter={StaticResource BoolToVis}}">
<CheckBox Margin="0,12,0,0" IsChecked="{Binding IncludeCrashDump}" Content="{Binding DumpLabel}" />
<ui:TextBlock Margin="28,4,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:BugBundleOptionsViewModel.DumpDetail}" />
</StackPanel>
<StackPanel Visibility="{Binding HasLastSession, Converter={StaticResource BoolToVis}}">
<CheckBox Margin="0,12,0,0" IsChecked="{Binding IncludeLastSession}" Content="{Binding SessionLabel}" />
<ui:TextBlock Margin="28,4,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:BugBundleOptionsViewModel.SessionDetail}" />
</StackPanel>
</StackPanel>
</UserControl>
@@ -11,7 +11,8 @@ namespace FrameLedger.App.Services;
/// <summary>
/// <c>10_LOGGING</c> §Bug report flow, step 2 — the bundle: <c>logs/</c> (this app's and the Agent's files of the
/// last seven days), the last <c>overlay-*.log</c> files, <c>sysinfo.json</c> (app, agent, overlay build id, OS,
/// last seven days) and the last <c>overlay-*.log</c> files, both as copies with every user name in a path replaced
/// (<see cref="LogRedactor"/>), <c>sysinfo.json</c> (app, agent, overlay build id, OS,
/// locale, telemetry source, Vulkan layer state, elevation), <c>settings.json</c> (the registry's keys and values —
/// no paths), and <c>crashdumps/</c> with one minidump only when the user ticked it (P4 PR-9). We ship our files only,
/// never a game's; nothing is sent anywhere (<see cref="BugReportFlow"/> is steps 3 and 4).
@@ -24,18 +25,21 @@ public sealed class BugBundleBuilder
private readonly RegisteredSettings _settings;
private readonly TimeProvider _clock;
private readonly string? _crashDumps;
private readonly LogRedactor _redactor;
/// <summary>A builder over the logs directory, the settings registry and, when given, the crash dump directory.</summary>
/// <param name="logsDirectory">The logs directory: ours and the Overlay's.</param>
/// <param name="settings">The registry the bundle's <c>settings.json</c> reads.</param>
/// <param name="clock">The seven-day cut's clock.</param>
/// <param name="crashDumpDirectory">The minidumps' directory (P4 PR-9); null offers none.</param>
public BugBundleBuilder(string logsDirectory, RegisteredSettings settings, TimeProvider? clock = null, string? crashDumpDirectory = null)
/// <param name="redactor">What the log copies pass through; the current user's by default.</param>
public BugBundleBuilder(string logsDirectory, RegisteredSettings settings, TimeProvider? clock = null, string? crashDumpDirectory = null, LogRedactor? redactor = null)
{
_logs = logsDirectory ?? throw new ArgumentNullException(nameof(logsDirectory));
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
_clock = clock ?? TimeProvider.System;
_crashDumps = crashDumpDirectory;
_redactor = redactor ?? LogRedactor.ForCurrentUser();
}
/// <summary>
@@ -59,9 +63,10 @@ public sealed class BugBundleBuilder
/// <summary>
/// Writes the zip at <paramref name="path"/>; returns the entry names written. <paramref name="crashDump"/> goes in only
/// when the caller passes one, which is the user's tick (P4 PR-9), and only from the crash dump directory.
/// when the caller passes one, which is the user's tick (P4 PR-9), and only from the crash dump directory;
/// <paramref name="lastSessionJson"/> likewise, as <c>session.json</c> with the user names in its paths replaced.
/// </summary>
public async Task<IReadOnlyList<string>> WriteAsync(string path, HelloAck? agent, CrashDumpInfo? crashDump = null, CancellationToken ct = default)
public async Task<IReadOnlyList<string>> WriteAsync(string path, HelloAck? agent, CrashDumpInfo? crashDump = null, byte[]? lastSessionJson = null, CancellationToken ct = default)
{
ArgumentException.ThrowIfNullOrWhiteSpace(path);
if (crashDump is not null && !IsOurDump(crashDump.Path))
@@ -77,12 +82,12 @@ public sealed class BugBundleBuilder
{
foreach (string log in Directory.EnumerateFiles(_logs, "*.log").Where(f => IsOurs(f) && File.GetLastWriteTimeUtc(f) >= cutoff))
{
AddFile(zip, log, "logs/" + Path.GetFileName(log), written);
AddRedactedFile(zip, log, "logs/" + Path.GetFileName(log), written);
}
foreach (string overlay in Directory.EnumerateFiles(_logs, "overlay-*.log").OrderByDescending(File.GetLastWriteTimeUtc).Take(OverlayLogsKept))
{
AddFile(zip, overlay, "overlay/" + Path.GetFileName(overlay), written);
AddRedactedFile(zip, overlay, "overlay/" + Path.GetFileName(overlay), written);
}
}
@@ -92,6 +97,12 @@ public sealed class BugBundleBuilder
AddFile(zip, crashDump.Path, "crashdumps/" + Path.GetFileName(crashDump.Path), written);
}
// The other optional item: the last session's summary the user ticked, redacted like a log (it names the executable).
if (lastSessionJson is not null)
{
AddBytes(zip, "session.json", _redactor.Redact(lastSessionJson), written);
}
AddText(zip, "sysinfo.json", SysInfo(agent), written);
AddText(zip, "settings.json", await SettingsJsonAsync(ct).ConfigureAwait(false), written);
return written;
@@ -121,6 +132,29 @@ public sealed class BugBundleBuilder
written.Add(entryName);
}
// legal/PRIVACY_POLICY.md §3: a log leaves this machine only as a copy with the user names in its paths replaced. A log is
// at most 10 MB (Serilog's roll size), so it is read whole; a crash dump is memory and goes in as it is, behind its box.
private void AddRedactedFile(ZipArchive zip, string source, string entryName, List<string> written)
{
byte[] bytes;
using (var stream = new FileStream(source, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete))
using (var buffer = new MemoryStream())
{
stream.CopyTo(buffer);
bytes = buffer.ToArray();
}
AddBytes(zip, entryName, _redactor.Redact(bytes), written);
}
private static void AddBytes(ZipArchive zip, string entryName, byte[] bytes, List<string> written)
{
ZipArchiveEntry entry = zip.CreateEntry(entryName, CompressionLevel.Optimal);
using Stream target = entry.Open();
target.Write(bytes, 0, bytes.Length);
written.Add(entryName);
}
private static void AddText(ZipArchive zip, string entryName, string text, List<string> written)
{
ZipArchiveEntry entry = zip.CreateEntry(entryName, CompressionLevel.Optimal);
@@ -0,0 +1,11 @@
namespace FrameLedger.App.Services;
/// <summary>
/// The optional items a bug report can offer (<c>10_LOGGING</c> §Bug report flow step 2), each null when there is none:
/// the newest crash dump of the last seven days (P4 PR-9) and the last session's summary.
/// </summary>
public sealed record BugBundleOffer(CrashDumpInfo? CrashDump, LastSessionInfo? LastSession)
{
/// <summary>Nothing to offer, so no question is asked.</summary>
public bool IsEmpty => CrashDump is null && LastSession is null;
}
@@ -0,0 +1,14 @@
namespace FrameLedger.App.Services;
/// <summary>
/// The answer to the optional items (<c>legal/PRIVACY_POLICY.md</c> §3: included only when ticked): the dialog closed, or
/// which boxes were ticked. Every box starts clear.
/// </summary>
public sealed record BugBundleOptions(bool Cancelled, bool IncludeCrashDump, bool IncludeLastSession)
{
/// <summary>The dialog was closed: no bundle is written.</summary>
public static BugBundleOptions Cancel { get; } = new(Cancelled: true, IncludeCrashDump: false, IncludeLastSession: false);
/// <summary>Continue with every box clear, and what an empty offer means.</summary>
public static BugBundleOptions NothingTicked { get; } = new(Cancelled: false, IncludeCrashDump: false, IncludeLastSession: false);
}
+24 -12
View File
@@ -7,7 +7,7 @@ namespace FrameLedger.App.Services;
/// <summary>
/// <c>10_LOGGING</c> §Bug report flow, steps 2–4 in one place (P4 PR-3), reached from Help ▸ Report a bug, the Logs
/// page's button and the crash dialog (P4 PR-9): a recent crash dump offered as a checkbox that starts clear, the zip
/// page's button and the crash dialog (P4 PR-9): a recent crash dump and the last session offered as checkboxes that start clear, the zip
/// where the user says (step 2, <see cref="BugBundleBuilder"/>), the preview listing every entry (step 3), then either
/// the GitHub issue form with the two short fields prefilled or the environment summary on the clipboard as Markdown
/// (step 4). Nothing is ever sent automatically; the zip is dragged in by hand.
@@ -23,8 +23,9 @@ public sealed class BugReportFlow
private readonly IClipboard _clipboard;
private readonly IMessageStrip _strip;
private readonly TimeProvider _clock;
private readonly LastSessionSummary? _lastSession;
public BugReportFlow(BugBundleBuilder bundles, IFileSaver saver, IAgentRequests agent, IBugReportPreview preview, IUrlOpener urls, IClipboard clipboard, IMessageStrip strip, TimeProvider? clock = null)
public BugReportFlow(BugBundleBuilder bundles, IFileSaver saver, IAgentRequests agent, IBugReportPreview preview, IUrlOpener urls, IClipboard clipboard, IMessageStrip strip, TimeProvider? clock = null, LastSessionSummary? lastSession = null)
{
_bundles = bundles ?? throw new ArgumentNullException(nameof(bundles));
_saver = saver ?? throw new ArgumentNullException(nameof(saver));
@@ -34,13 +35,14 @@ public sealed class BugReportFlow
_clipboard = clipboard ?? throw new ArgumentNullException(nameof(clipboard));
_strip = strip ?? throw new ArgumentNullException(nameof(strip));
_clock = clock ?? TimeProvider.System;
_lastSession = lastSession;
}
/// <summary>The whole flow; the outcome says how far it went, for the tests and the caller's log.</summary>
public async Task<BugReportOutcome> RunAsync(CancellationToken ct = default)
{
DateTimeOffset now = _clock.GetUtcNow();
(bool cancelled, CrashDumpInfo? dump) = await ChooseCrashDumpAsync(ct).ConfigureAwait(true);
(bool cancelled, CrashDumpInfo? dump, byte[]? sessionJson) = await ChooseOptionalItemsAsync(ct).ConfigureAwait(true);
if (cancelled)
{
return new BugReportOutcome(null, BugReportChoice.Close, Written: false);
@@ -56,7 +58,7 @@ public sealed class BugReportFlow
IReadOnlyList<string> entries;
try
{
entries = await _bundles.WriteAsync(path, hello, dump, ct).ConfigureAwait(true);
entries = await _bundles.WriteAsync(path, hello, dump, sessionJson, ct).ConfigureAwait(true);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
@@ -91,18 +93,28 @@ public sealed class BugReportFlow
}
/// <summary>
/// Step 2's optional item (P4 PR-9): a crash dump of the last seven days is offered before the save dialog, in a
/// checkbox that starts clear. No dump, no question; the dump comes back only when it was ticked.
/// Step 2's optional items, offered before the save dialog, each in a checkbox that starts clear: a crash dump of the
/// last seven days (P4 PR-9) and the last session's summary. Nothing to offer, no question; an item comes back only
/// when it was ticked.
/// </summary>
private async Task<(bool Cancelled, CrashDumpInfo? Dump)> ChooseCrashDumpAsync(CancellationToken ct)
private async Task<(bool Cancelled, CrashDumpInfo? Dump, byte[]? SessionJson)> ChooseOptionalItemsAsync(CancellationToken ct)
{
CrashDumpInfo? dump = _bundles.LatestCrashDump();
if (dump is null)
LastSessionInfo? session = _lastSession is null ? null : await _lastSession.FindAsync(ct).ConfigureAwait(true);
var offer = new BugBundleOffer(_bundles.LatestCrashDump(), session);
if (offer.IsEmpty)
{
return (false, null);
return (false, null, null);
}
CrashDumpChoice answer = await _preview.AskCrashDumpAsync(dump, ct).ConfigureAwait(true);
return (answer == CrashDumpChoice.Cancel, answer == CrashDumpChoice.Include ? dump : null);
BugBundleOptions options = await _preview.AskOptionsAsync(offer, ct).ConfigureAwait(true);
if (options.Cancelled)
{
return (true, null, null);
}
byte[]? json = options.IncludeLastSession && session is not null && _lastSession is not null
? await _lastSession.JsonAsync(session.SessionId, ct).ConfigureAwait(true)
: null;
return (false, options.IncludeCrashDump ? offer.CrashDump : null, json);
}
}
@@ -7,7 +7,7 @@ namespace FrameLedger.App.Services;
/// <summary>
/// The bug report's dialogs in WPF UI: step 3's <c>ContentDialog</c> listing the zip's entries, whose primary button is
/// step 4 and whose secondary is the clipboard fallback; and step 2's optional crash dump, a checkbox (P4 PR-9).
/// step 4 and whose secondary is the clipboard fallback; and step 2's optional items, a checkbox each.
/// </summary>
public sealed class BugReportPreviewPrompt : IBugReportPreview
{
@@ -38,10 +38,10 @@ public sealed class BugReportPreviewPrompt : IBugReportPreview
};
}
public async Task<CrashDumpChoice> AskCrashDumpAsync(CrashDumpInfo dump, CancellationToken ct = default)
public async Task<BugBundleOptions> AskOptionsAsync(BugBundleOffer offer, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(dump);
var viewModel = new BugBundleOptionsViewModel(dump);
ArgumentNullException.ThrowIfNull(offer);
var viewModel = new BugBundleOptionsViewModel(offer);
var dialog = new ContentDialog
{
Title = BugBundleOptionsViewModel.Title,
@@ -53,6 +53,6 @@ public sealed class BugReportPreviewPrompt : IBugReportPreview
};
ContentDialogResult result = await _dialogs.ShowAsync(dialog, ct).ConfigureAwait(true);
return viewModel.Choice(result == ContentDialogResult.Primary);
return viewModel.Options(result == ContentDialogResult.Primary);
}
}
@@ -1,14 +0,0 @@
namespace FrameLedger.App.Services;
/// <summary>The answer to the bug report's optional crash dump (P4 PR-9, <c>10_LOGGING</c> §Bug report flow step 2).</summary>
public enum CrashDumpChoice
{
/// <summary>The dialog was closed: no bundle is written.</summary>
Cancel,
/// <summary>Continue without the dump: the checkbox was left clear, which is how it starts.</summary>
LeaveOut,
/// <summary>Continue with the dump: the user ticked it.</summary>
Include,
}
@@ -7,8 +7,8 @@ public interface IBugReportPreview
Task<BugReportChoice> ShowAsync(BugReportPreviewModel model, CancellationToken ct = default);
/// <summary>
/// Step 2's optional item (P4 PR-9): the crash dump's checkbox, clear until the user ticks it
/// (<c>legal/PRIVACY_POLICY.md</c> §3). Closing the dialog is <see cref="CrashDumpChoice.Cancel"/>.
/// Step 2's optional items: a checkbox for each item <paramref name="offer"/> has, clear until the user ticks it
/// (<c>legal/PRIVACY_POLICY.md</c> §3). Closing the dialog is <see cref="BugBundleOptions.Cancel"/>.
/// </summary>
Task<CrashDumpChoice> AskCrashDumpAsync(CrashDumpInfo dump, CancellationToken ct = default);
Task<BugBundleOptions> AskOptionsAsync(BugBundleOffer offer, CancellationToken ct = default);
}
@@ -0,0 +1,4 @@
namespace FrameLedger.App.Services;
/// <summary>The newest session in the ledger, as the bug report offers it: which one, of what, and when.</summary>
public sealed record LastSessionInfo(long SessionId, string Game, DateTimeOffset StartedAt);
@@ -0,0 +1,56 @@
using System.IO;
using FrameLedger.Application.Persistence;
using FrameLedger.Domain.Sessions;
namespace FrameLedger.App.Services;
/// <summary>
/// Step 2's other optional item, "last session metadata + aggregates JSON (never raw blobs by default)"
/// (<c>10_LOGGING</c> §Bug report flow): the newest session in the ledger, written as the same <c>session.json</c> File ▸
/// Export writes (<see cref="SessionExporter.Document"/>: metadata, aggregates, segments, hardware) but without the
/// user's notes and tags, which are theirs and are not a diagnosis. No frame or sensor series.
/// </summary>
public sealed class LastSessionSummary
{
private readonly ISessionRepository _sessions;
private readonly IGameRepository _games;
private readonly IHardwareSnapshotRepository _hardware;
public LastSessionSummary(ISessionRepository sessions, IGameRepository games, IHardwareSnapshotRepository hardware)
{
_sessions = sessions ?? throw new ArgumentNullException(nameof(sessions));
_games = games ?? throw new ArgumentNullException(nameof(games));
_hardware = hardware ?? throw new ArgumentNullException(nameof(hardware));
}
/// <summary>The newest session and its game, or null when the ledger has none.</summary>
public async Task<LastSessionInfo?> FindAsync(CancellationToken ct = default)
{
IReadOnlyList<SessionRow> recent = await _sessions.ListRecentAsync(1, ct).ConfigureAwait(false);
if (recent.Count == 0)
{
return null;
}
SessionRow row = recent[0];
GameRow? game = await _games.FindByIdAsync(row.GameId, ct).ConfigureAwait(false);
return game is null ? null : new LastSessionInfo(row.Id, game.Name, row.StartedAt);
}
/// <summary>The session's <c>session.json</c> bytes without notes or tags, or null when it is gone.</summary>
public async Task<byte[]?> JsonAsync(long sessionId, CancellationToken ct = default)
{
SessionRow? row = await _sessions.FindByIdAsync(sessionId, ct).ConfigureAwait(false);
GameRow? game = row is null ? null : await _games.FindByIdAsync(row.GameId, ct).ConfigureAwait(false);
if (row is null || game is null)
{
return null;
}
IReadOnlyList<SegmentRow> segments = await _sessions.FindSegmentsAsync(sessionId, ct).ConfigureAwait(false);
HardwareSnapshot? snapshot = await _hardware.FindAsync(row.SnapshotId, ct).ConfigureAwait(false);
using var buffer = new MemoryStream();
SessionExporter.WriteJson(buffer, SessionExporter.Document(row, game, snapshot, segments, annotation: null));
return buffer.ToArray();
}
}
@@ -0,0 +1,77 @@
using System.Text;
using System.Text.RegularExpressions;
namespace FrameLedger.App.Services;
/// <summary>
/// The "redacted copies" of <c>10_LOGGING</c> §Bug report flow step 2, and what makes <c>legal/PRIVACY_POLICY.md</c> §3's
/// "logs are redacted (user directory paths removed) before bundling" true: the name in every <c>X:\Users\&lt;name&gt;</c>
/// path becomes <c>&lt;user&gt;</c>, and so does the last segment of this user's own profile directory when it lives
/// somewhere else. Applied to the bundle's copies only; the files in <c>logs\</c> keep their paths.
/// </summary>
/// <remarks>
/// Every spelling a log carries: backslashes, the doubled backslashes of Serilog's JSON properties, forward slashes, any
/// case, a name with spaces, and a name the Overlay's ANSI header could only spell with <c>?</c>. Files are read as bytes
/// through Latin-1, which maps each byte to one character and back, so a UTF-8 log (Serilog) and an ANSI one (the Overlay's
/// image path) both come out byte for byte except the names. Over-redaction is the failure direction chosen: another
/// account's folder, or <c>C:\Users\Public</c>, reads <c>&lt;user&gt;</c> too.
/// </remarks>
public sealed partial class LogRedactor
{
/// <summary>What a user name in a path becomes.</summary>
public const string Placeholder = "<user>";
private const string _separator = @"(?:\\{1,2}|/)";
private const string _end = @"(?=[\\/""'<>|\r\n\t]|\z)";
private readonly Regex? _profile;
/// <summary>A redactor for <paramref name="profileDirectory"/>'s owner; null or empty redacts <c>X:\Users\&lt;name&gt;</c> paths only.</summary>
public LogRedactor(string? profileDirectory)
{
_profile = ProfilePattern(profileDirectory);
}
/// <summary>The redactor for the user running FrameLedger.</summary>
public static LogRedactor ForCurrentUser() => new(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
/// <summary>The text with every user name in a path replaced by <see cref="Placeholder"/>.</summary>
public string Redact(string text)
{
ArgumentNullException.ThrowIfNull(text);
string result = UsersPath().Replace(text, "${prefix}" + Placeholder);
return _profile is null ? result : _profile.Replace(result, "${prefix}" + Placeholder);
}
/// <summary>A log file's bytes, redacted, and otherwise byte for byte what was read.</summary>
public byte[] Redact(byte[] bytes)
{
ArgumentNullException.ThrowIfNull(bytes);
return Encoding.Latin1.GetBytes(Redact(Encoding.Latin1.GetString(bytes)));
}
[GeneratedRegex(@"(?<prefix>\b[A-Za-z]:" + _separator + "Users" + _separator + @")(?<name>[^\\/""'<>|\r\n\t]+?)" + _end, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture, matchTimeoutMilliseconds: 2000)]
private static partial Regex UsersPath();
// A profile outside X:\Users (a redirected or a domain-managed one): its own parent, then its name. The name is matched
// as its UTF-8 bytes read through Latin-1, which is how Redact(byte[]) sees a Serilog log.
private static Regex? ProfilePattern(string? profileDirectory)
{
if (string.IsNullOrWhiteSpace(profileDirectory))
{
return null;
}
string[] segments = profileDirectory.Split(['\\', '/'], StringSplitOptions.RemoveEmptyEntries);
if (segments.Length < 2 || segments[0].Length != 2 || segments[0][1] != ':'
|| (segments.Length == 3 && string.Equals(segments[1], "Users", StringComparison.OrdinalIgnoreCase)))
{
return null;
}
static string Escaped(string segment) => Regex.Escape(Encoding.Latin1.GetString(Encoding.UTF8.GetBytes(segment)));
string parent = string.Join(_separator, segments[..^1].Select(Escaped));
string pattern = @"(?<prefix>\b" + parent + _separator + ")" + Escaped(segments[^1]) + _end;
return new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(2));
}
}
@@ -0,0 +1,41 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows;
namespace FrameLedger.App.Services;
/// <summary>
/// What a start that fails says on screen (<c>10_LOGGING</c> §Crash handling, 2026-09-15). Until then a ledger that would
/// not open or a host that would not start was a Fatal line in <c>ui-*.log</c> and a silent exit: nothing told the user
/// FrameLedger had even tried. A Win32 message box, like the crash dialog, because the shell is what failed to start.
/// It gives the reason and the log folder, and Yes opens that folder; FrameLedger exits with code 1 either way.
/// </summary>
internal static class StartupFailureDialog
{
public static void Show(Exception exception, string logsDirectory)
{
if (MessageBox.Show(Body(exception, logsDirectory), Strings.StartupFailed_Title, MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.Yes) != MessageBoxResult.Yes)
{
return;
}
try
{
using Process? _ = Process.Start(new ProcessStartInfo("explorer.exe", logsDirectory) { UseShellExecute = true });
}
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
{
Serilog.Log.Warning(ex, "ui: the logs folder could not be opened after the failed start");
}
}
/// <summary>The dialog's text: the exception's own message and the folder its whole record is in.</summary>
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture")]
public static string Body(Exception exception, string logsDirectory)
{
ArgumentNullException.ThrowIfNull(exception);
return string.Format(CultureInfo.CurrentCulture, Strings.StartupFailed_Body_Format, exception.Message, logsDirectory);
}
}
+12
View File
@@ -56,6 +56,8 @@ public static class Strings
nameof(BugReport_Options_Dump_Detail),
nameof(BugReport_Options_Dump_Format),
nameof(BugReport_Options_Intro),
nameof(BugReport_Options_Session_Detail),
nameof(BugReport_Options_Session_Format),
nameof(BugReport_Options_Title),
nameof(BugReport_Preview_Drag),
nameof(BugReport_Preview_Intro_Format),
@@ -477,6 +479,8 @@ public static class Strings
nameof(Settings_VkLayer_Unknown),
nameof(Settings_VkLayer_Unregister),
nameof(Settings_Window_Header),
nameof(StartupFailed_Body_Format),
nameof(StartupFailed_Title),
nameof(Summary_Annotations_Header),
nameof(Summary_Crash_Body),
nameof(Summary_Crash_Title),
@@ -642,6 +646,10 @@ public static class Strings
public static string BugReport_Options_Intro => ResourceManager.GetString(nameof(BugReport_Options_Intro), Culture) ?? nameof(BugReport_Options_Intro);
public static string BugReport_Options_Session_Detail => ResourceManager.GetString(nameof(BugReport_Options_Session_Detail), Culture) ?? nameof(BugReport_Options_Session_Detail);
public static string BugReport_Options_Session_Format => ResourceManager.GetString(nameof(BugReport_Options_Session_Format), Culture) ?? nameof(BugReport_Options_Session_Format);
public static string BugReport_Options_Title => ResourceManager.GetString(nameof(BugReport_Options_Title), Culture) ?? nameof(BugReport_Options_Title);
public static string BugReport_Preview_Drag => ResourceManager.GetString(nameof(BugReport_Preview_Drag), Culture) ?? nameof(BugReport_Preview_Drag);
@@ -1484,6 +1492,10 @@ public static class Strings
public static string Settings_Window_Header => ResourceManager.GetString(nameof(Settings_Window_Header), Culture) ?? nameof(Settings_Window_Header);
public static string StartupFailed_Body_Format => ResourceManager.GetString(nameof(StartupFailed_Body_Format), Culture) ?? nameof(StartupFailed_Body_Format);
public static string StartupFailed_Title => ResourceManager.GetString(nameof(StartupFailed_Title), Culture) ?? nameof(StartupFailed_Title);
public static string Summary_Annotations_Header => ResourceManager.GetString(nameof(Summary_Annotations_Header), Culture) ?? nameof(Summary_Annotations_Header);
public static string Summary_Crash_Body => ResourceManager.GetString(nameof(Summary_Crash_Body), Culture) ?? nameof(Summary_Crash_Body);
+23
View File
@@ -2233,8 +2233,31 @@
<value>クラッシュ時の FrameLedger 自身のメモリのスナップショットです。原因の特定に役立ちますが、この PC のファイルパス、ゲーム名、設定が含まれる場合があります。</value>
<comment>review</comment>
</data>
<data name="BugReport_Options_Session_Format" xml:space="preserve">
<value>直近のセッション: {0}、{1}</value>
<comment>review</comment>
</data>
<data name="BugReport_Options_Session_Detail" xml:space="preserve">
<value>session.json: ゲームの名前と実行ファイルのパス、キャプチャ方法、設定と統計、この PC の CPU と GPU。フレームごとのデータ、メモやタグは含まれません。パス内のユーザー名は置き換えられます。</value>
<comment>review</comment>
</data>
<data name="BugReport_Options_Continue" xml:space="preserve">
<value>続行</value>
<comment>review</comment>
</data>
<data name="StartupFailed_Title" xml:space="preserve">
<value>FrameLedger を起動できませんでした</value>
<comment>review</comment>
</data>
<data name="StartupFailed_Body_Format" xml:space="preserve">
<value>FrameLedger は起動中にエラーが発生したため、終了します:
{0}
詳細はログフォルダーにあります:
{1}
ログフォルダーを開きますか?</value>
<comment>review</comment>
</data>
</root>
+19
View File
@@ -1682,7 +1682,26 @@ Open the bug report now? It shows you every file in the zip, sends nothing by it
<data name="BugReport_Options_Dump_Detail" xml:space="preserve">
<value>A snapshot of FrameLedger's own memory when it crashed. It helps find the cause, and it can contain file paths, game names and settings from this PC.</value>
</data>
<data name="BugReport_Options_Session_Format" xml:space="preserve">
<value>The last session: {0}, {1}</value>
</data>
<data name="BugReport_Options_Session_Detail" xml:space="preserve">
<value>session.json: the game's name and executable path, how it was captured, its settings and statistics, and this PC's CPU and GPU. No frame data, and not your notes or tags. User names in paths are replaced.</value>
</data>
<data name="BugReport_Options_Continue" xml:space="preserve">
<value>Continue</value>
</data>
<data name="StartupFailed_Title" xml:space="preserve">
<value>FrameLedger could not start</value>
</data>
<data name="StartupFailed_Body_Format" xml:space="preserve">
<value>FrameLedger hit an error while starting and will close:
{0}
The details are in the log folder:
{1}
Open the log folder?</value>
</data>
</root>
+19
View File
@@ -1677,7 +1677,26 @@ Mở báo cáo lỗi ngay bây giờ? Báo cáo cho bạn xem mọi tệp trong
<data name="BugReport_Options_Dump_Detail" xml:space="preserve">
<value>Ảnh chụp bộ nhớ của chính FrameLedger lúc bị lỗi. Nó giúp tìm nguyên nhân, và có thể chứa đường dẫn tệp, tên game và cài đặt trên máy này.</value>
</data>
<data name="BugReport_Options_Session_Format" xml:space="preserve">
<value>Phiên gần nhất: {0}, {1}</value>
</data>
<data name="BugReport_Options_Session_Detail" xml:space="preserve">
<value>session.json: tên game và đường dẫn tệp chạy, cách ghi, các thiết lập và thống kê, cùng CPU và GPU của máy này. Không có dữ liệu từng khung hình, không có ghi chú hay thẻ của bạn. Tên người dùng trong đường dẫn được thay thế.</value>
</data>
<data name="BugReport_Options_Continue" xml:space="preserve">
<value>Tiếp tục</value>
</data>
<data name="StartupFailed_Title" xml:space="preserve">
<value>FrameLedger không khởi động được</value>
</data>
<data name="StartupFailed_Body_Format" xml:space="preserve">
<value>FrameLedger gặp lỗi khi khởi động và sẽ đóng lại:
{0}
Chi tiết nằm trong thư mục log:
{1}
Mở thư mục log?</value>
</data>
</root>
@@ -6,24 +6,41 @@ using FrameLedger.App.Services;
namespace FrameLedger.App.ViewModels;
/// <summary>
/// The bug report's optional crash dump (P4 PR-9, <c>10_LOGGING</c> §Bug report flow step 2): one checkbox, clear until the
/// user ticks it (<c>legal/PRIVACY_POLICY.md</c> §3), labelled with the dump's time and size, and a line saying what a
/// dump can hold.
/// The bug report's optional items (<c>10_LOGGING</c> §Bug report flow step 2): a checkbox for each item there is — the
/// crash dump (P4 PR-9) and the last session's summary — each clear until the user ticks it
/// (<c>legal/PRIVACY_POLICY.md</c> §3), each with a line saying what it holds.
/// </summary>
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
public sealed partial class BugBundleOptionsViewModel : ObservableObject
{
[ObservableProperty]
private bool _includeCrashDump;
public BugBundleOptionsViewModel(CrashDumpInfo dump)
[ObservableProperty]
private bool _includeLastSession;
public BugBundleOptionsViewModel(BugBundleOffer offer)
{
ArgumentNullException.ThrowIfNull(dump);
DumpLabel = string.Format(
CultureInfo.CurrentCulture,
Strings.BugReport_Options_Dump_Format,
dump.WrittenAt.ToLocalTime().ToString("g", CultureInfo.CurrentCulture),
dump.Bytes / (1024.0 * 1024.0));
ArgumentNullException.ThrowIfNull(offer);
HasCrashDump = offer.CrashDump is not null;
HasLastSession = offer.LastSession is not null;
if (offer.CrashDump is { } dump)
{
DumpLabel = string.Format(
CultureInfo.CurrentCulture,
Strings.BugReport_Options_Dump_Format,
dump.WrittenAt.ToLocalTime().ToString("g", CultureInfo.CurrentCulture),
dump.Bytes / (1024.0 * 1024.0));
}
if (offer.LastSession is { } session)
{
SessionLabel = string.Format(
CultureInfo.CurrentCulture,
Strings.BugReport_Options_Session_Format,
session.Game,
session.StartedAt.ToLocalTime().ToString("g", CultureInfo.CurrentCulture));
}
}
public static string Title => Strings.BugReport_Options_Title;
@@ -32,17 +49,20 @@ public sealed partial class BugBundleOptionsViewModel : ObservableObject
public static string DumpDetail => Strings.BugReport_Options_Dump_Detail;
/// <summary>The checkbox's text: the dump's local time and its size in MB.</summary>
public string DumpLabel { get; }
public static string SessionDetail => Strings.BugReport_Options_Session_Detail;
public bool HasCrashDump { get; }
public bool HasLastSession { get; }
/// <summary>The crash dump's checkbox text: its local time and size in MB; empty when there is no dump.</summary>
public string DumpLabel { get; } = string.Empty;
/// <summary>The last session's checkbox text: the game and the local start time; empty when there is no session.</summary>
public string SessionLabel { get; } = string.Empty;
/// <summary>The answer, once the dialog closed: <paramref name="continued"/> is its primary button.</summary>
public CrashDumpChoice Choice(bool continued)
{
if (!continued)
{
return CrashDumpChoice.Cancel;
}
return IncludeCrashDump ? CrashDumpChoice.Include : CrashDumpChoice.LeaveOut;
}
public BugBundleOptions Options(bool continued) => continued
? new BugBundleOptions(Cancelled: false, IncludeCrashDump: HasCrashDump && IncludeCrashDump, IncludeLastSession: HasLastSession && IncludeLastSession)
: BugBundleOptions.Cancel;
}
@@ -60,7 +60,7 @@ public static class SessionProgressCalculator
FgRefusal = usable ? null : fg?.Refusal is { } refusal ? Vocabulary.FgRefusal(refusal.Kind) : null,
FgRuntimeCensus = progress.WriterState.RuntimeCensus,
Upscaler = upscaler is { } u ? Vocabulary.Upscaler(u) : FgLadder.UpscalerHookRan(progress.Records) ? "unknown" : null,
UpscalerQuality = Modal(withParams)?.ToString(CultureInfo.InvariantCulture),
UpscalerQuality = Modal([.. withParams.Where(static s => s.UpscalerQuality != FrameSample.QualityNotTold)])?.ToString(CultureInfo.InvariantCulture),
RenderW = extent?.RenderW,
RenderH = extent?.RenderH,
OutputW = extent?.OutputW,
@@ -66,7 +66,8 @@ public static class SessionAggregator
StutterCount = stutter?.Count,
StutterTimePct = stutter?.TimePct,
PsoStutterPct = stutter is null || c.Series is null ? null : StutterDetector.PsoStutterPct(stutter, c.Series, c.Dominant),
ReflexActive = latency.Count > 0,
// Null, not false, when no latency sample exists: nothing measures Reflex today, and a false is an answer nobody gave.
ReflexActive = latency.Count > 0 ? true : null,
LatencyAvgUs = latency.AverageUs is { } a ? (long)Math.Round(a) : null,
LatencyP95Us = latency.P95Us is { } p ? (long)Math.Round(p) : null,
GapCount = c.Input.TotalGaps,
@@ -109,10 +110,11 @@ public static class SessionAggregator
FlUpscaler? identity = FgLadder.UpscalerIdentity(c.Input.Records);
bool hookRan = FgLadder.UpscalerHookRan(c.Input.Records);
IReadOnlyList<FrameSample> withParams = [.. c.Dominant.Where(static s => s.Claims(MeasuredFields.UpscalerParams))];
IReadOnlyList<FrameSample> withQuality = [.. withParams.Where(static s => s.UpscalerQuality != FrameSample.QualityNotTold)];
return row with
{
Upscaler = identity is { } u ? Vocabulary.Upscaler(u) : hookRan ? "unknown" : null,
UpscalerQuality = Modal(withParams, static s => s.UpscalerQuality)?.ToString(CultureInfo.InvariantCulture),
UpscalerQuality = Modal(withQuality, static s => s.UpscalerQuality)?.ToString(CultureInfo.InvariantCulture),
UpscalerSharpness = Modal(withParams, static s => s.UpscalerSharpness),
UpscalerDriverReported = c.Input.Ngx.SrCreatedAndEvaluated ? "dlss" : null,
RenderW = extent?.RenderW,
@@ -238,7 +240,7 @@ public static class SessionAggregator
OutputW = seg.OutputW == 0 ? null : seg.OutputW,
OutputH = seg.OutputH == 0 ? null : seg.OutputH,
Upscaler = upscaler is { } u && u != UpscalerKind.NotReported ? Vocabulary.Upscaler(u) : null,
UpscalerQuality = Modal([.. seg.Samples.Where(static s => s.Claims(MeasuredFields.UpscalerParams))], static s => s.UpscalerQuality)
UpscalerQuality = Modal([.. seg.Samples.Where(static s => s.Claims(MeasuredFields.UpscalerParams) && s.UpscalerQuality != FrameSample.QualityNotTold)], static s => s.UpscalerQuality)
?.ToString(CultureInfo.InvariantCulture),
FgMode = null,
NativeFps = null,
@@ -48,7 +48,13 @@ public readonly record struct FrameSample
public UpscalerKind Upscaler { get; init; }
/// <summary>Vendor enum; <c>0xFF</c> unknown.</summary>
/// <summary>
/// <see cref="UpscalerQuality"/>'s "a hook ran and could not tell" (<c>fl_shm.h</c> <c>upscalerQuality</c>): not a preset,
/// so it is never a value in a row. Every AMD dispatch carries it, because that call has no preset.
/// </summary>
public const byte QualityNotTold = 0xFF;
/// <summary>Vendor enum; <see cref="QualityNotTold"/> when the hook could not tell.</summary>
public byte UpscalerQuality { get; init; }
/// <summary>Percent, 0-100; <c>0xFF</c> means the API reports no sharpness.</summary>
@@ -404,9 +404,11 @@ Verdict CheckModules(const Sources& s, const Rules& rules, std::uint32_t targetP
}
if (st.sawSuspicious) {
// 19_SAFETY: fragment AND not signed by a known vendor. The signer
// lookup is not wired yet, and an unchecked signature is UNTRUSTED
// by definition — so this refuses today. That is the correct
// direction, and it is why the fragment list must stay narrow.
// half runs before this latch (ModuleIsTrustedSigned): a match whose
// signer both the rules file and the compiled-in list trust is never
// latched, and a signature that cannot be read is untrusted, so it
// refuses. That is the safe direction, and it is why the fragment
// list must stay narrow.
//
// `sawSuspicious` is already the post-exemption answer: ModuleSinkFn
// never latches a module that is ours. Asking a second question here
@@ -12,12 +12,11 @@
// both, and `api` is resolved per swapchain by asking the swapchain which device
// created it -- FL_API_UNKNOWN when it will not say, never a guess.
//
// NOT HERE: OpenGL (wglSwapBuffers is a flat export in opengl32.dll and needs no
// vtable, but hook-harness has no OpenGL mode, and shipping an untested hook into
// a game process is not something this project does), Vulkan (the layer, P1), and
// the upscaler / FG / RT feature hooks. The record's measuredMask says so on
// every frame rather than letting the zero-defaults assert a measurement nobody
// made.
// NOT HERE: Vulkan (the layer, FrameLedger.VkLayer) and the pipeline, memory and
// latency hooks. OpenGL IS here since P1 item 4 (2026-09-06): opengl32!wglSwapBuffers,
// once hook-harness gained its --opengl mode; so are the upscaler, FG and RT feature
// hooks. The record's measuredMask says what each frame measured rather than letting
// the zero-defaults assert a measurement nobody made.
//
// docs/17_HOOK_ENGINE.md is the specification. The constraints that shape every
// line:
+3 -3
View File
@@ -37,9 +37,9 @@
// blocklist would be a second matcher that can disagree with the first, which
// is the defect the managed facade was built to avoid.
//
// vkQueuePresentKHR is still deliberately NOT hooked: presentation
// interception is P1. Passthrough remains the correct state, not an unfinished
// one — but the gate that will protect it is in place and tested first.
// vkQueuePresentKHR IS intercepted since 2026-09-06 (P1 item 3, QueuePresentKHR
// below). The gate that protects it was in place and tested first, and
// passthrough is still the state the layer returns to on any refusal.
#include <windows.h>
@@ -80,6 +80,29 @@ public sealed class BugBundleBuilderTests : IDisposable
sysinfo["telemetry_source"].Should().Be("l3");
}
[Fact]
public async Task TheLogCopiesCarryNoUserNameAndTheFilesOnDiskAreUntouched()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
var clock = new FixedClock(new DateTimeOffset(2026, 9, 15, 12, 0, 0, TimeSpan.Zero));
DateTime now = clock.GetUtcNow().UtcDateTime;
string ui = Path.Combine(_dir, "ui-20260915.log");
await File.WriteAllTextAsync(ui, "[12:00:00.000 INF] ui: started (0.1.0), ledger C:\\Users\\tester\\AppData\\Local\\FrameLedger\\ledger.db {\"Path\":\"C:\\\\Users\\\\tester\\\\AppData\"}\r\n", Ct);
File.SetLastWriteTimeUtc(ui, now);
string overlay = Path.Combine(_dir, "overlay-4242-20260915-120000.log");
await File.WriteAllTextAsync(overlay, "# FrameLedger.Overlay build x pid 4242 layout v9 image C:\\Users\\tester\\Games\\title.exe\nSTOP\n", Ct);
File.SetLastWriteTimeUtc(overlay, now);
string zip = Path.Combine(_dir, "bundle.zip");
await new BugBundleBuilder(_dir, new RegisteredSettings(new SqliteSettingsStore(s.Db)), clock, redactor: new LogRedactor(@"C:\Users\tester")).WriteAsync(zip, agent: null, ct: Ct);
string uiCopy = ReadEntry(zip, "logs/ui-20260915.log");
string overlayCopy = ReadEntry(zip, "overlay/overlay-4242-20260915-120000.log");
uiCopy.Should().NotContain("tester").And.Contain(@"C:\Users\<user>\AppData\Local\FrameLedger\ledger.db").And.Contain(@"C:\\Users\\<user>\\AppData");
overlayCopy.Should().NotContain("tester").And.StartWith(@"# FrameLedger.Overlay build x pid 4242 layout v9 image C:\Users\<user>\Games\title.exe");
(await File.ReadAllTextAsync(ui, Ct)).Should().Contain("tester", "the redaction is the bundle's copy, never the log on disk");
}
[Fact]
public void TheSuggestedNameIsTheDocsFormat()
{
@@ -99,13 +122,13 @@ public sealed class BugBundleBuilderTests : IDisposable
latest.Bytes.Should().Be(3000);
IReadOnlyList<string> without = await builder.WriteAsync(Path.Combine(_dir, "without.zip"), agent: null, ct: Ct);
IReadOnlyList<string> with = await builder.WriteAsync(Path.Combine(_dir, "with.zip"), agent: null, latest, Ct);
IReadOnlyList<string> with = await builder.WriteAsync(Path.Combine(_dir, "with.zip"), agent: null, latest, ct: Ct);
without.Should().NotContain(static e => e.StartsWith("crashdumps/", StringComparison.Ordinal), "a dump goes in only when the user ticked it");
with.Should().Contain("crashdumps/ui-20260915-100000-42.dmp");
string foreign = Path.Combine(_dir, "game.dmp");
await File.WriteAllTextAsync(foreign, "MDMP", Ct);
Func<Task> outside = () => builder.WriteAsync(Path.Combine(_dir, "foreign.zip"), agent: null, latest with { Path = foreign }, Ct);
Func<Task> outside = () => builder.WriteAsync(Path.Combine(_dir, "foreign.zip"), agent: null, latest with { Path = foreign }, ct: Ct);
await outside.Should().ThrowAsync<ArgumentException>("the bundle never carries a file from outside the dump directory");
File.Exists(Path.Combine(_dir, "foreign.zip")).Should().BeFalse("refused before the zip is created");
}
@@ -143,6 +166,13 @@ public sealed class BugBundleBuilderTests : IDisposable
return path;
}
private static string ReadEntry(string zip, string entry)
{
using ZipArchive archive = ZipFile.OpenRead(zip);
using var reader = new StreamReader(archive.GetEntry(entry)!.Open());
return reader.ReadToEnd();
}
private static Dictionary<string, string> ReadJson(string zip, string entry)
{
using ZipArchive archive = ZipFile.OpenRead(zip);
@@ -6,22 +6,42 @@ using FrameLedger.App.ViewModels;
namespace FrameLedger.App.Tests;
/// <summary>
/// The bug report's optional crash dump (P4 PR-9): the box starts clear (<c>legal/PRIVACY_POLICY.md</c> §3, only when
/// ticked), closing the dialog never includes it, and the label carries the dump's size.
/// The bug report's optional items: every box starts clear (<c>legal/PRIVACY_POLICY.md</c> §3, only when ticked), only an
/// item that exists can be included, closing the dialog includes nothing, and each label says what and how big.
/// </summary>
public sealed class BugBundleOptionsViewModelTests
{
private static readonly CrashDumpInfo _dump = new(@"C:\data\crashdumps\ui-1.dmp", new DateTimeOffset(2026, 9, 15, 1, 2, 3, TimeSpan.Zero), 1536 * 1024);
private static readonly LastSessionInfo _session = new(42, "Title", new DateTimeOffset(2026, 9, 15, 3, 4, 5, TimeSpan.Zero));
[Fact]
public void TheBoxStartsClearAndOnlyATickAndContinueIncludesTheDump()
public void EveryBoxStartsClearAndOnlyATickAndContinueIncludesAnItem()
{
var vm = new BugBundleOptionsViewModel(new CrashDumpInfo(@"C:\data\crashdumps\ui-1.dmp", new DateTimeOffset(2026, 9, 15, 1, 2, 3, TimeSpan.Zero), 1536 * 1024));
var vm = new BugBundleOptionsViewModel(new BugBundleOffer(_dump, _session));
vm.IncludeCrashDump.Should().BeFalse();
vm.Choice(continued: true).Should().Be(CrashDumpChoice.LeaveOut);
vm.Choice(continued: false).Should().Be(CrashDumpChoice.Cancel);
vm.IncludeLastSession.Should().BeFalse();
vm.Options(continued: true).Should().Be(BugBundleOptions.NothingTicked);
vm.Options(continued: false).Should().Be(BugBundleOptions.Cancel);
vm.IncludeCrashDump = true;
vm.Choice(continued: true).Should().Be(CrashDumpChoice.Include);
vm.Choice(continued: false).Should().Be(CrashDumpChoice.Cancel, "closing the dialog never includes the dump");
vm.Options(continued: true).Should().Be(new BugBundleOptions(Cancelled: false, IncludeCrashDump: true, IncludeLastSession: false));
vm.IncludeLastSession = true;
vm.Options(continued: true).Should().Be(new BugBundleOptions(Cancelled: false, IncludeCrashDump: true, IncludeLastSession: true));
vm.Options(continued: false).Should().Be(BugBundleOptions.Cancel, "closing the dialog never includes anything");
vm.DumpLabel.Should().Contain(string.Format(CultureInfo.CurrentCulture, "{0:0.0}", 1.5), "the size is in the label, in MB");
vm.SessionLabel.Should().Contain("Title");
}
[Fact]
public void AnItemThereIsNoneOfHasNoBoxAndCannotBeIncluded()
{
var vm = new BugBundleOptionsViewModel(new BugBundleOffer(CrashDump: null, _session));
vm.HasCrashDump.Should().BeFalse();
vm.HasLastSession.Should().BeTrue();
vm.DumpLabel.Should().BeEmpty();
vm.IncludeCrashDump = true;
vm.Options(continued: true).IncludeCrashDump.Should().BeFalse("there is no dump to include");
new BugBundleOffer(null, null).IsEmpty.Should().BeTrue();
}
}
@@ -2,6 +2,7 @@ using System.IO;
using System.IO.Compression;
using FluentAssertions;
using FrameLedger.App.Services;
using FrameLedger.Application.Persistence;
using FrameLedger.Application.Settings;
using FrameLedger.Infrastructure.Persistence;
using FrameLedger.Shared.Ipc;
@@ -41,17 +42,18 @@ public sealed class BugReportFlowTests : IDisposable
private sealed record Harness(BugReportFlow Flow, ClosePreview Preview, NoUrlOpener Urls, NoClipboard Clipboard, RecordingStrip Strip, string Zip);
private async Task<Harness> BuildAsync(ScratchLedger s, BugReportChoice choice, bool cancel = false, CrashDumpChoice dumpChoice = CrashDumpChoice.LeaveOut)
private async Task<Harness> BuildAsync(ScratchLedger s, BugReportChoice choice, bool cancel = false, BugBundleOptions? options = null)
{
await File.WriteAllTextAsync(Path.Combine(_dir, "ui-20260914.log"), "[12:00:00.000 INF] hello\n", Ct).ConfigureAwait(false);
var builder = new BugBundleBuilder(_dir, new RegisteredSettings(new SqliteSettingsStore(s.Db)), crashDumpDirectory: Path.Combine(_dir, "crashdumps"));
string zip = Path.Combine(_dir, "bundle.zip");
var preview = new ClosePreview(choice, dumpChoice);
var preview = new ClosePreview(choice, options);
var urls = new NoUrlOpener();
var clipboard = new NoClipboard();
var strip = new RecordingStrip();
var agent = new FakeAgentLink { Hello = new HelloAck("9.9.9", IpcProtocol.Version, 4, false, "build-z", false, "l1", false, "consent-dialog/1") };
return new Harness(new BugReportFlow(builder, new PathSaver(cancel ? null : zip), agent, preview, urls, clipboard, strip), preview, urls, clipboard, strip, zip);
var lastSession = new LastSessionSummary(s.Sessions, s.Games, new SqliteHardwareSnapshotRepository(s.Db));
return new Harness(new BugReportFlow(builder, new PathSaver(cancel ? null : zip), agent, preview, urls, clipboard, strip, lastSession: lastSession), preview, urls, clipboard, strip, zip);
}
[Fact]
@@ -77,22 +79,22 @@ public sealed class BugReportFlowTests : IDisposable
.And.Contain("&os=Windows%20", "the form's field ids are app-version and os, hyphenated");
h.Clipboard.Texts.Should().BeEmpty();
h.Strip.Shown.Should().BeEmpty("the browser opened; there is nothing to say");
h.Preview.DumpsOffered.Should().BeEmpty("no crash dump, no question");
h.Preview.Offers.Should().BeEmpty("no crash dump and no session: no question");
}
[Theory]
[InlineData(CrashDumpChoice.LeaveOut, false)]
[InlineData(CrashDumpChoice.Include, true)]
public async Task ARecentCrashDumpIsOfferedAndGoesInOnlyWhenTicked(CrashDumpChoice answer, bool included)
[InlineData(false)]
[InlineData(true)]
public async Task ARecentCrashDumpIsOfferedAndGoesInOnlyWhenTicked(bool included)
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
string dump = WriteDump();
Harness h = await BuildAsync(s, BugReportChoice.Close, dumpChoice: answer);
Harness h = await BuildAsync(s, BugReportChoice.Close, options: new BugBundleOptions(Cancelled: false, IncludeCrashDump: included, IncludeLastSession: false));
BugReportOutcome o = await h.Flow.RunAsync(Ct);
o.Written.Should().BeTrue();
h.Preview.DumpsOffered.Should().ContainSingle().Which.Path.Should().Be(dump);
h.Preview.Offers.Should().ContainSingle().Which.CrashDump!.Path.Should().Be(dump);
IReadOnlyList<string> entries = h.Preview.Shown.Should().ContainSingle().Subject.Entries;
string entry = "crashdumps/" + Path.GetFileName(dump);
if (included)
@@ -110,7 +112,7 @@ public sealed class BugReportFlowTests : IDisposable
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
WriteDump();
Harness h = await BuildAsync(s, BugReportChoice.OpenIssue, dumpChoice: CrashDumpChoice.Cancel);
Harness h = await BuildAsync(s, BugReportChoice.OpenIssue, options: BugBundleOptions.Cancel);
BugReportOutcome o = await h.Flow.RunAsync(Ct);
@@ -121,6 +123,36 @@ public sealed class BugReportFlowTests : IDisposable
h.Urls.Opened.Should().BeEmpty();
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public async Task TheLastSessionIsOfferedAndGoesInOnlyWhenTickedWithItsPathsRedacted(bool included)
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
GameRow game = await s.GameAsync("Title", @"C:\Users\tester\Games\Title\title.exe");
long id = await s.SessionAsync(game.Id, new DateTimeOffset(2026, 9, 14, 10, 0, 0, TimeSpan.Zero));
Harness h = await BuildAsync(s, BugReportChoice.Close, options: new BugBundleOptions(Cancelled: false, IncludeCrashDump: false, IncludeLastSession: included));
BugReportOutcome o = await h.Flow.RunAsync(Ct);
o.Written.Should().BeTrue();
BugBundleOffer offer = h.Preview.Offers.Should().ContainSingle().Subject;
offer.CrashDump.Should().BeNull();
offer.LastSession.Should().Be(new LastSessionInfo(id, "Title", new DateTimeOffset(2026, 9, 14, 10, 0, 0, TimeSpan.Zero)));
IReadOnlyList<string> entries = h.Preview.Shown.Should().ContainSingle().Subject.Entries;
if (!included)
{
entries.Should().NotContain("session.json", "the box starts clear and was left so");
return;
}
entries.Should().Contain("session.json");
using ZipArchive archive = await ZipFile.OpenReadAsync(h.Zip, Ct);
using var reader = new StreamReader(await archive.GetEntry("session.json")!.OpenAsync(Ct));
string json = await reader.ReadToEndAsync(Ct);
json.Should().Contain("Title").And.NotContain("tester", "a path in the summary is redacted like a log");
}
private string WriteDump()
{
string dumps = Path.Combine(_dir, "crashdumps");
+7 -6
View File
@@ -4,13 +4,14 @@ namespace FrameLedger.App.Tests;
/// <summary>
/// The bug report flow's three ports, scripted (P4 PR-3): a preview that answers what the test says, a browser and a
/// clipboard that record. The crash dump question (P4 PR-9) answers <paramref name="dumpChoice"/> and records each offer.
/// clipboard that record. The optional items' question answers <paramref name="options"/> (nothing ticked by default) and
/// records each offer.
/// </summary>
internal sealed class ClosePreview(BugReportChoice choice = BugReportChoice.Close, CrashDumpChoice dumpChoice = CrashDumpChoice.LeaveOut) : IBugReportPreview
internal sealed class ClosePreview(BugReportChoice choice = BugReportChoice.Close, BugBundleOptions? options = null) : IBugReportPreview
{
public List<BugReportPreviewModel> Shown { get; } = [];
public List<CrashDumpInfo> DumpsOffered { get; } = [];
public List<BugBundleOffer> Offers { get; } = [];
public Task<BugReportChoice> ShowAsync(BugReportPreviewModel model, CancellationToken ct = default)
{
@@ -18,9 +19,9 @@ internal sealed class ClosePreview(BugReportChoice choice = BugReportChoice.Clos
return Task.FromResult(choice);
}
public Task<CrashDumpChoice> AskCrashDumpAsync(CrashDumpInfo dump, CancellationToken ct = default)
public Task<BugBundleOptions> AskOptionsAsync(BugBundleOffer offer, CancellationToken ct = default)
{
DumpsOffered.Add(dump);
return Task.FromResult(dumpChoice);
Offers.Add(offer);
return Task.FromResult(options ?? BugBundleOptions.NothingTicked);
}
}
@@ -0,0 +1,40 @@
using System.Text.Json;
using FluentAssertions;
using FrameLedger.App.Services;
using FrameLedger.Application.Persistence;
using FrameLedger.Infrastructure.Persistence;
namespace FrameLedger.App.Tests;
/// <summary>
/// The last session's summary (<c>10_LOGGING</c> §Bug report flow step 2): the newest session, as File ▸ Export's
/// <c>session.json</c> without the user's notes and tags; nothing when the ledger has no session.
/// </summary>
public sealed class LastSessionSummaryTests
{
private static CancellationToken Ct => TestContext.Current.CancellationToken;
[Fact]
public async Task TheNewestSessionIsOfferedAndWrittenWithoutNotesOrTags()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
var summary = new LastSessionSummary(s.Sessions, s.Games, new SqliteHardwareSnapshotRepository(s.Db));
(await summary.FindAsync(Ct)).Should().BeNull("an empty ledger offers nothing");
GameRow older = await s.GameAsync("Older");
GameRow newer = await s.GameAsync("Newer");
await s.SessionAsync(older.Id, new DateTimeOffset(2026, 9, 1, 10, 0, 0, TimeSpan.Zero));
long id = await s.SessionAsync(newer.Id, new DateTimeOffset(2026, 9, 14, 10, 0, 0, TimeSpan.Zero));
await s.Annotations.UpsertAsync(new SessionAnnotation { SessionId = id, Notes = "private note", Tags = ["mine"] }, Ct);
LastSessionInfo? info = await summary.FindAsync(Ct);
byte[]? json = await summary.JsonAsync(id, Ct);
info.Should().Be(new LastSessionInfo(id, "Newer", new DateTimeOffset(2026, 9, 14, 10, 0, 0, TimeSpan.Zero)));
json.Should().NotBeNull();
using JsonDocument doc = JsonDocument.Parse(json!);
doc.RootElement.GetProperty("game").GetString().Should().Be("Newer");
System.Text.Encoding.UTF8.GetString(json!).Should().NotContain("private note").And.NotContain("mine");
(await summary.JsonAsync(id + 1000, Ct)).Should().BeNull("a session that is gone writes nothing");
}
}
@@ -0,0 +1,60 @@
using System.Text;
using FluentAssertions;
using FrameLedger.App.Services;
namespace FrameLedger.App.Tests;
/// <summary>
/// <c>legal/PRIVACY_POLICY.md</c> §3 (P4 follow-up, 2026-09-15): a user name in a path never leaves the machine in a log
/// copy, in any spelling a log carries, and nothing else in the file changes.
/// </summary>
public sealed class LogRedactorTests
{
private static readonly LogRedactor _redactor = new(@"C:\Users\kuujo");
[Theory]
[InlineData(@"ledger C:\Users\kuujo\AppData\Local\FrameLedger\ledger.db", @"ledger C:\Users\<user>\AppData\Local\FrameLedger\ledger.db")]
[InlineData(@"{""Path"":""C:\\Users\\kuujo\\AppData\\Local""}", @"{""Path"":""C:\\Users\\<user>\\AppData\\Local""}")]
[InlineData("file:///c:/users/KUUJO/Documents/x.txt", "file:///c:/users/<user>/Documents/x.txt")]
[InlineData(@"C:\Users\John Smith\Documents", @"C:\Users\<user>\Documents")]
[InlineData(@"'C:\Users\kuujo'", @"'C:\Users\<user>'")]
[InlineData("profile C:\\Users\\kuujo\r\nnext", "profile C:\\Users\\<user>\r\nnext")]
[InlineData(@"image C:\Users\Nguy?n\Games\title.exe", @"image C:\Users\<user>\Games\title.exe")]
[InlineData(@"two C:\Users\a\x and D:\Users\b\y", @"two C:\Users\<user>\x and D:\Users\<user>\y")]
public void TheNameInAUsersPathBecomesThePlaceholderInEverySpelling(string log, string expected)
{
_redactor.Redact(log).Should().Be(expected);
_redactor.Redact(_redactor.Redact(log)).Should().Be(expected, "redacting a copy twice changes nothing more");
}
[Theory]
[InlineData(@"C:\Program Files\FrameLedger\FrameLedger.exe")]
[InlineData(@"D:\Games\Users\title.exe")]
[InlineData(@"C:\Userspace\x")]
[InlineData("Users: 3, sessions: 12")]
[InlineData(@"C:\Users\")]
public void TextThatNamesNoUserIsUnchanged(string log) => _redactor.Redact(log).Should().Be(log);
[Fact]
public void AProfileOutsideTheUsersFolderIsRedactedByItsOwnPath()
{
var redirected = new LogRedactor(@"D:\Profiles\kuujo");
redirected.Redact(@"ledger D:\Profiles\kuujo\AppData\Local\FrameLedger\ledger.db").Should().Be(@"ledger D:\Profiles\<user>\AppData\Local\FrameLedger\ledger.db");
redirected.Redact(@"{""P"":""d:\\profiles\\KUUJO\\x""}").Should().Be(@"{""P"":""d:\\profiles\\<user>\\x""}");
redirected.Redact(@"D:\Profiles\kuujo2\x").Should().Be(@"D:\Profiles\kuujo2\x", "another folder that merely starts with the name");
new LogRedactor(null).Redact(@"D:\Profiles\kuujo\x").Should().Be(@"D:\Profiles\kuujo\x", "without a profile only X:\\Users paths are known");
}
[Fact]
public void BytesOutsideTheNamesAreKeptExactlyInUtf8AndInAnsi()
{
byte[] utf8 = Encoding.UTF8.GetBytes("[12:00:00.000 INF] Thiết lập đã lưu C:\\Users\\Nguyễn\\AppData\r\n");
byte[] expectedUtf8 = Encoding.UTF8.GetBytes("[12:00:00.000 INF] Thiết lập đã lưu C:\\Users\\<user>\\AppData\r\n");
byte[] ansi = [.. Encoding.ASCII.GetBytes("# image C:\\Users\\Jos"), 0xE9, .. Encoding.ASCII.GetBytes("\\Games\\t.exe\n")];
byte[] expectedAnsi = Encoding.ASCII.GetBytes("# image C:\\Users\\<user>\\Games\\t.exe\n");
_redactor.Redact(utf8).Should().Equal(expectedUtf8);
_redactor.Redact(ansi).Should().Equal(expectedAnsi);
}
}
@@ -267,11 +267,11 @@ public sealed class PagesLoadTests
public Task<bool> ConfirmSweepAsync(int keep, CancellationToken ct = default) => Task.FromResult(false);
}
/// <summary>The bug report's optional crash dump (P4 PR-9) under the real dictionaries: the checkbox and both texts bind.</summary>
/// <summary>The bug report's optional items under the real dictionaries: both checkboxes, their texts, the visibility converter.</summary>
[Fact]
public async Task TheBundleOptionsDialogLoads()
{
var vm = new BugBundleOptionsViewModel(new CrashDumpInfo(@"C:\data\crashdumps\ui-20260915-010203-42.dmp", DateTimeOffset.UtcNow, 2 * 1024 * 1024));
var vm = new BugBundleOptionsViewModel(new BugBundleOffer(new CrashDumpInfo(@"C:\data\crashdumps\ui-20260915-010203-42.dmp", DateTimeOffset.UtcNow, 2 * 1024 * 1024), new LastSessionInfo(1, "Title", DateTimeOffset.UtcNow)));
double width = await OnStaAsync(() =>
{
@@ -0,0 +1,20 @@
using FluentAssertions;
using FrameLedger.App.Services;
namespace FrameLedger.App.Tests;
/// <summary>A failed start says why and where the log is (<c>10_LOGGING</c> §Crash handling, 2026-09-15).</summary>
public sealed class StartupFailureDialogTests
{
[Fact]
public void TheTextNamesTheReasonAndTheLogFolder()
{
const string logs = @"C:\data\FrameLedger\logs";
var failure = new InvalidOperationException("ledger schema 9 is newer than this build (4)");
string body = StartupFailureDialog.Body(failure, logs);
body.Should().Contain("ledger schema 9 is newer than this build (4)").And.Contain(logs);
body.Should().NotContain("{0}").And.NotContain("{1}");
}
}
@@ -56,6 +56,18 @@ public sealed class SessionProgressCalculatorTests
e.CpuTempC.Should().BeNull();
}
[Fact]
public void TheLiveCardNeverShowsAQualityTheHookCouldNotTell()
{
FlMeasured claims = FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.Upscaler | FlMeasured.UpscalerParams;
List<FlFrameRecord> records = [.. SessionFixtures.Stream(1000, claims, upscaler: FlUpscaler.Dlss).Select(static r => r with { UpscalerQuality = 0xFF })];
SessionProgressEvent e = SessionProgressCalculator.Compute(_guid, Progress(records), SessionFixtures.QpcFrequency, 12.5, gpu: null);
e.Upscaler.Should().Be("dlss");
e.UpscalerQuality.Should().BeNull("0xFF is the hook's 'could not tell', which the card would print as 'DLSS 255'");
}
[Fact]
public void AMeasuredFrameGenerationFactorSplitsNativeFromDisplayed()
{
@@ -38,7 +38,7 @@ public sealed class SessionAggregatorTests
row.RtFlag.Should().Be("na");
row.HdrFlag.Should().Be("na");
row.VramProcAvgMb.Should().BeNull();
row.ReflexActive.Should().BeFalse();
row.ReflexActive.Should().BeNull("no latency sample was measured: not measured, not 'off'");
row.LatencyAvgUs.Should().BeNull();
row.StutterCount.Should().Be(0);
row.AvgGpuTemp.Should().BeNull("no sensors");
@@ -129,6 +129,30 @@ public sealed class SessionAggregatorTests
r.Segments[0].OutputW.Should().Be(2560);
}
/// <summary>
/// <c>0xFF</c> is the Overlay's "a hook ran and could not tell" for the quality byte, and every AMD dispatch carries it.
/// Aggregated as a number it became the text "255", which the game page appends to the upscaler's name ("FSR 255").
/// </summary>
[Fact]
public void AQualityTheHookCouldNotTellIsNoValueWhileAToldOneStillIs()
{
FlMeasured claims = _presentOnly | FlMeasured.Upscaler | FlMeasured.UpscalerParams;
var writer = new FlWriterState { Status = 1, HooksInstalledMask = 0x7 };
List<FlFrameRecord> notTold = [.. SessionFixtures.Stream(500, claims, upscaler: FlUpscaler.Dlss).Select(static r => r with { UpscalerQuality = 0xFF })];
AggregationResult r = SessionAggregator.Aggregate(SessionFixtures.Skeleton(), SessionFixtures.Hooked(notTold, writer));
r.Row.Upscaler.Should().Be("dlss");
r.Row.UpscalerQuality.Should().BeNull("0xFF is not a preset");
r.Segments.Should().ContainSingle().Which.UpscalerQuality.Should().BeNull();
List<FlFrameRecord> mixed = [.. SessionFixtures.Stream(500, claims, upscaler: FlUpscaler.Dlss).Select(static (r, i) => r with { UpscalerQuality = (byte)(i % 5 == 0 ? 3 : 0xFF) })];
AggregationResult m = SessionAggregator.Aggregate(SessionFixtures.Skeleton(), SessionFixtures.Hooked(mixed, writer));
m.Row.UpscalerQuality.Should().Be("3", "the frames that told are the only ones that count");
m.Segments[0].UpscalerQuality.Should().Be("3");
}
[Fact]
public void AnUpscalerHookThatSawOnlyUnknownIsUnknownNotNull()
{
Whitespace-only changes.
@@ -1 +1 @@
{ "engine": "unity", "platform": null, "capabilities": [], "$why": "UNDER-MATCH CANARY. Markers for unity, gamemaker, godot and renpy are all present. Exactly one engine must be reported and it must be the first in the array - an evaluator returning a set, or the last match, fails here and nowhere else." }
{ "engine": "unity", "platform": null, "capabilities": [], "$why": "UNDER-MATCH CANARY. Markers for unity, rpgmaker_mv, rpgmaker_rgss, gamemaker, godot and renpy are all present. Exactly one engine must be reported and it must be the first in the array - an evaluator returning a set, or the last match, fails here and nowhere else." }
Whitespace-only changes.
Whitespace-only changes.
View File
Whitespace-only changes.
@@ -0,0 +1 @@
{ "engine": "rpgmaker_mv", "platform": null, "capabilities": [], "$why": "nw.dll AND package.json beside the exe: MV and MZ both ship both (MV keeps its data under www/, MZ at the root), so the nested group 05_DETECTION once said this needed is not needed. No .pck, so Godot does not fire." }
View File
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1 @@
{ "engine": "rpgmaker_rgss", "platform": null, "capabilities": [], "$why": "RGSS3*.dll beside the exe (VX Ace); the archive alone would do for a title that relies on the installed RTP. One rule for XP/VX/VX Ace with no version: which prefix matched is not a value any extractor produces (05_DETECTION)." }