From d5657608300371099b9193fb91435afdc78914e1 Mon Sep 17 00:00:00 2001 From: poli0981 <127664709+poli0981@users.noreply.github.com> Date: Tue, 6 Oct 2026 04:33:07 +0700 Subject: [PATCH] feat(build): every managed binary names FrameLedger and carries the native copyright line; versioninfo-check reads both kinds (beta.14 PR-6, D50) (#269) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Owner request 2026-10-05 ("Thêm Assembly metadata"); D50: company and product "FrameLedger", the copyright the native FL_COPYRIGHT word for word. Measured before the change, from the built binaries: FrameLedger.Agent.exe/.dll read Company and Product "FrameLedger.Agent" and FileDescription "FrameLedger.Agent" (what Task Manager lists); each library its own assembly name; every managed LegalCopyright was one space; the apphost's OriginalFilename is its assembly's (FrameLedger.dll). tools/versioninfo-check.ps1 read the five native binaries and nothing else. - Directory.Build.props: Company, Product, Authors, Copyright, Description (the native blocks' sentence, the Comments field), RepositoryUrl (stamped as AssemblyMetadata by the SDK); the FrameLedgerSourceRef metadata moved here from the App csproj, and release.yml passes the same ref to the Agent's publish. - App: AssemblyTitle "FrameLedger" and a Description. Agent: AssemblyTitle "FrameLedger Agent" and a Description. - versioninfo-check.ps1: the rules in one function over a block, a managed half (-ManagedDir, -ExpectedProductVersion - required, -ManagedOnly), one LegalCopyright across every binary read, the apphost carrying its assembly's block, Company as well as Product = FrameLedger, and -SelfTest: ten cases, nine RED, each for the reason it names (four mutations of the rules each turn the self-test red). build.ps1 runs the self-test and both halves (the managed half alone under -SkipNative); release.yml reads out/app with the tag's version. - AssemblyIdentityTests (App, Agent): company, product, copyright = FL_COPYRIGHT parsed from CMakeLists.txt, description, RepositoryUrl = IssueLink.Repository, and the Win32 block Explorer shows. Red on the source before. Docs: 12_BUILD (Identity table, the gate, the publish lines), 13_CI_CD, 19_SAFETY, FORKING (what a fork changes), CHANGELOG. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 7 +- CHANGELOG.md | 6 + Directory.Build.props | 26 ++ FORKING.md | 2 +- build.ps1 | 24 +- docs/12_BUILD.md | 33 +- docs/13_CI_CD.md | 5 +- docs/19_SAFETY_AND_ANTICHEAT.md | 2 +- .../FrameLedger.Agent.csproj | 4 + src/FrameLedger.App/FrameLedger.App.csproj | 11 +- .../Services/RepositoryLinks.cs | 6 +- .../AssemblyIdentityTests.cs | 46 +++ .../AssemblyIdentityTests.cs | 83 +++++ tools/versioninfo-check.ps1 | 306 +++++++++++++++--- 14 files changed, 491 insertions(+), 70 deletions(-) create mode 100644 tests/FrameLedger.Agent.Tests/AssemblyIdentityTests.cs create mode 100644 tests/FrameLedger.App.Tests/AssemblyIdentityTests.cs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb6b9426..87893f3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -154,7 +154,9 @@ jobs: $ref = if ('${{ steps.version.outputs.dry_run }}' -eq 'true') { '${{ github.sha }}' } else { "v$v" } dotnet publish src/FrameLedger.App -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:Version=$v -p:FrameLedgerSourceRef=$ref -o out/app if ($LASTEXITCODE -ne 0) { throw 'App publish failed' } - dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:Version=$v -o out/app + # beta.14 (D50): the same ref for the Agent - Directory.Build.props stamps it on every assembly, and both + # publishes build the same libraries into this one folder. + dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:Version=$v -p:FrameLedgerSourceRef=$ref -o out/app if ($LASTEXITCODE -ne 0) { throw 'Agent publish failed' } # A self-contained package redistributes the .NET runtime, and its licence and @@ -195,7 +197,8 @@ jobs: if ($missing.Count -gt 0) { throw "out/app is missing: $($missing -join ', ')" } if (Test-Path out/app/FrameLedger.CaptureHost.exe) { throw 'out/app contains the unshipped capture host (12_BUILD: exactly two roots)' } if (@(Get-ChildItem out/app/licenses/dotnet -File -ErrorAction SilentlyContinue).Count -lt 2) { throw 'out/app/licenses/dotnet holds fewer than two files -- the runtime licence step did not run' } - ./tools/versioninfo-check.ps1 -BuildDir out/app + # beta.14 (D50): the managed half too - the eight managed binaries, carrying the tag's full version. + ./tools/versioninfo-check.ps1 -BuildDir out/app -ManagedDir out/app -ExpectedProductVersion '${{ steps.version.outputs.version }}' if ($LASTEXITCODE -ne 0) { throw 'versioninfo-check over the published tree' } $size = (Get-ChildItem out/app -Recurse -File | Measure-Object Length -Sum).Sum / 1MB Write-Host ("published tree: {0:N0} MB" -f $size) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ed3c84b..5a4efcf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,12 @@ numeric core and does not move; the heading is the full version — corrected 20 - **Over a chart, the wheel scrolls the page; Ctrl+wheel zooms the chart.** ScottPlot zoomed on every wheel, which with the pages scrolling again would have zoomed the chart and scrolled the page at once. Dragging still pans and double-click still resets. +- **FrameLedger's own programs say what they are.** In Explorer (*Properties ▸ Details*) `FrameLedger.exe` and + `FrameLedger.Agent.exe` now name the product, the author's copyright and what each one does, as the native DLLs always + have; Task Manager lists the background service as *FrameLedger Agent* rather than *FrameLedger.Agent*. Until this + release the Agent called its company and product "FrameLedger.Agent" and no managed file carried a copyright. The + release check now reads both kinds of file and fails when one of them does not name FrameLedger or carries a different + copyright line. ## [0.1.0-beta.13] - 2026-10-04 diff --git a/Directory.Build.props b/Directory.Build.props index 95b0e234..434b43b1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -69,6 +69,32 @@ false + + + FrameLedger + FrameLedger + poli0981 + Copyright (C) 2026 poli0981. GPL-3.0-only with additional terms: see NOTICE + Performance measurement tool. Identifies itself deliberately; see https://github.com/poli0981/frameledger + https://github.com/poli0981/frameledger + + + + + + + diff --git a/FORKING.md b/FORKING.md index f2b40c92..bd62a6d2 100644 --- a/FORKING.md +++ b/FORKING.md @@ -68,7 +68,7 @@ share — and migrate — one database, and fight over the same pipe and shared | Logon task | `LogonTask` (the Agent's maintenance verbs) | one task per name | | Issue and help links | `IssueLink.Repository` (`src/FrameLedger.App/Services/IssueLink.cs`) — `RepositoryLinks` builds every document link in the App from it and the source ref `release.yml` passes — plus the Releases link in `guide/01-install.md` and `.github/ISSUE_TEMPLATE/` | your users' reports belong in your tracker | | Who the documents name | `legal/EULA.md`, `legal/DISCLAIMER.md`, `legal/PRIVACY_POLICY.md` name poli0981 as the Developer, with a contact | the person who distributes a build is the one its users deal with; review every claim they make, too — they describe FrameLedger's builds, not yours | -| Version information | `FL_COMPANY_NAME` / `FL_PRODUCT_NAME` in `src/native/CMakeLists.txt`, and the `ProductName` that `tools/versioninfo-check.ps1` requires | anti-cheat vendors and users identify the DLLs loaded into games by it (`docs/19_SAFETY_AND_ANTICHEAT.md`); it must name your project | +| Version information | `FL_COMPANY_NAME` / `FL_PRODUCT_NAME` / `FL_COPYRIGHT` in `src/native/CMakeLists.txt`; `Company` / `Product` / `Authors` / `Copyright` / `Description` / `RepositoryUrl` in `Directory.Build.props` and the `AssemblyTitle` / `Description` of the App's and the Agent's csproj (since beta.14); and the names `tools/versioninfo-check.ps1` and the two `AssemblyIdentityTests` require | anti-cheat vendors and users identify the DLLs loaded into games and the processes beside them by it (`docs/19_SAFETY_AND_ANTICHEAT.md`); it must name your project, and the copyright line must be one line on every binary — the check compares them | | Checksums | your own `SHA256SUMS.txt` | users verify what *you* built | The detection rules and the anti-cheat blocklist (`rules/detection-rules.json`) ship with each build; keeping them diff --git a/build.ps1 b/build.ps1 index 148b73f9..e5ccb774 100644 --- a/build.ps1 +++ b/build.ps1 @@ -320,13 +320,27 @@ function Invoke-ProjectGates { # Being plainly identifiable to anti-cheat is a requirement, not packaging # polish (docs/19_SAFETY_AND_ANTICHEAT.md). Reads the built binary, because # what ships is what an anti-cheat vendor sees. + # + # beta.14 (D50): BOTH HALVES. The rules prove themselves first (ten cases, + # nine RED, each for its own reason), then the live pass reads the native five + # and the managed eight from the App's and the Agent's build output, whose + # ProductVersion is the VERSION file's here (release.yml passes the tag's). + # Under -SkipNative the managed half still runs. Write-Step 'versioninfo-check' $versionTool = Join-Path $repo 'tools/versioninfo-check.ps1' - if ((Test-Path $versionTool) -and -not $SkipNative) { - Invoke-Checked 'versioninfo-check' { & $versionTool -BuildDir (Join-Path $repo "build/native/x64-$($Configuration.ToLower())") } - } - elseif ($SkipNative) { - Skip-Gate 'versioninfo-check' 'native build skipped, so there is no binary to inspect' + if (Test-Path $versionTool) { + Invoke-Checked 'versioninfo-check (self-test)' { & $versionTool -SelfTest } + $managedDirs = @('FrameLedger.App', 'FrameLedger.Agent' | ForEach-Object { Join-Path $repo "src/$_/bin/$Configuration" }) + $productVersion = (Get-Content (Join-Path $repo 'VERSION') -Raw).Trim() + if ($SkipNative) { + Invoke-Checked 'versioninfo-check (managed)' { & $versionTool -ManagedOnly -ManagedDir $managedDirs -ExpectedProductVersion $productVersion } + Skip-Gate 'versioninfo-check (native)' 'native build skipped, so there is no binary to inspect' + } + else { + Invoke-Checked 'versioninfo-check' { + & $versionTool -BuildDir (Join-Path $repo "build/native/x64-$($Configuration.ToLower())") -ManagedDir $managedDirs -ExpectedProductVersion $productVersion + } + } } else { Skip-Gate 'versioninfo-check' 'tools/versioninfo-check.ps1 not implemented yet' diff --git a/docs/12_BUILD.md b/docs/12_BUILD.md index f406ae9d..0c5e948d 100644 --- a/docs/12_BUILD.md +++ b/docs/12_BUILD.md @@ -44,7 +44,7 @@ Compiler/linker flags (enforced in CMake, not per-target ad hoc): `/std:c++20 /M **No AMD or Intel GPU *telemetry* SDK is vendored.** Those vendors' sensors are covered by LibreHardwareMonitor and the DXGI/PDH baseline (`18_GPU_VENDOR_APIS`). A build that pulls in Intel IGCL or AMD ADLX material is a licensing regression, not a feature — CI greps for it. **The AMD FidelityFX ffx-api headers (MIT by exception, tag v2.3.0) ARE vendored since 2026-09-04**, for the Overlay's upscaler hook and for types only — `fl_fidelityfx_headers` above, `18_GPU_VENDOR_APIS` §AMD for the licence reading, and `license-check.ps1` §2d for the per-file gate. Intel's XeSS SDK failed the checklist and nothing of it is here. -**VERSIONINFO is mandatory** on ~~`FrameLedger.Overlay.dll` and `FrameLedger.VkLayer.dll`~~ every shipped native — the five `tools/versioninfo-check.ps1` lists (corrected 2026-10-04): real `CompanyName`, `ProductName=FrameLedger`, `FileDescription`, version. Identifiability is a requirement (`19_SAFETY`), and a CI check fails the build if the resource block is missing. +**VERSIONINFO is mandatory** on ~~`FrameLedger.Overlay.dll` and `FrameLedger.VkLayer.dll`~~ every shipped native — the five `tools/versioninfo-check.ps1` lists (corrected 2026-10-04): real `CompanyName`, `ProductName=FrameLedger`, `FileDescription`, version. Identifiability is a requirement (`19_SAFETY`), and a CI check fails the build if the resource block is missing. **Since beta.14 (D50) the managed binaries are held to the same** — §Version, *Identity*. ## Managed build & native integration @@ -170,6 +170,29 @@ two products claiming to be one. - `release.yml` refuses a tag whose numeric core is not the file's. Bumping the version is one edit to `VERSION`, in the same commit as the changelog section, before the tag. +**Identity (beta.14, D50).** Every binary names the product, says what it is and carries one copyright line. Until +beta.14 only the native blocks did: the managed ones carried the SDK's defaults — the Agent's company and product read +`FrameLedger.Agent`, each library's its own assembly name — and no copyright, and those blocks are what Explorer's +*Properties ▸ Details* and Task Manager show (Task Manager lists the Agent by its file description). + +| Field | Native (`src/native/CMakeLists.txt`) | Managed (`Directory.Build.props`, the two entry points' csproj) | +|---|---|---| +| CompanyName, ProductName | `FL_COMPANY_NAME`, `FL_PRODUCT_NAME` = `FrameLedger` | `Company`, `Product` = `FrameLedger` | +| LegalCopyright | `FL_COPYRIGHT` | `Copyright` — the same line, word for word | +| FileDescription | each target's `fl_add_version_resource` description | `AssemblyTitle`: `FrameLedger` (App), `FrameLedger Agent` (Agent); a library keeps its assembly name | +| Comments | the identification sentence | `Description` — the same sentence for a library, a line of its own for each entry point | +| FileVersion / ProductVersion | the numeric core, `x.y.z.0` | `x.y.z.0` / the full version (`-p:Version`, a pre-release's tag included) | +| OriginalFilename | the file's own name | the assembly's (`FrameLedger.dll`) — the apphost `.exe` carries a copy of its assembly's block | + +Also stamped on every assembly: `AssemblyMetadata("RepositoryUrl")` (the SDK, from `RepositoryUrl`; the App test holds +it equal to `IssueLink.Repository`) and, when `release.yml` passes it, `FrameLedgerSourceRef` — the App csproj's alone +until beta.14, now `Directory.Build.props`', and passed to both publishes. `tools/versioninfo-check.ps1` reads all of it +from the BUILT binaries — the native five and, with `-ManagedDir`, the managed eight (`FrameLedger.exe`/`.dll`, +`FrameLedger.Agent.exe`/`.dll`, Domain, Application, Infrastructure, Shared) — and is red when a copyright differs +anywhere, when a managed `ProductVersion` is not `-ExpectedProductVersion` (required: a comparison with nothing passes +everything), or when an apphost does not carry its assembly's block; its `-SelfTest` (ten cases, nine RED, each for the +reason it names) runs first. `AssemblyIdentityTests` (App and Agent) pins the source against `FL_COPYRIGHT`. + The Velopack package version is the tag's (`vpk pack --packVersion`), and `UpdateManager.CurrentVersion` reads the installed package's manifest — not the assembly — which is why the two are made to agree here rather than assumed to. @@ -179,7 +202,7 @@ assumed to. ``` cmake --build --preset x64-release dotnet publish src/FrameLedger.App -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:FrameLedgerSourceRef={tag} -o out/app -dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -o out/app +dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:FrameLedgerSourceRef={tag} -o out/app vpk download github --repoUrl https://github.com/poli0981/frameledger --channel win --pre --outputDir out/release # beta.13: the previous release, for a delta vpk pack --packId FrameLedger.App --packVersion {ver} --packDir out/app --mainExe FrameLedger.exe --packTitle FrameLedger --packAuthors FrameLedger --releaseNotes out/notes.md --outputDir out/release ``` @@ -189,7 +212,9 @@ vpk pack --packId FrameLedger.App --packVersion {ver} --packDir out/app --mainEx > take `-p:Version=` (§Version). No `--icon`: `assets/icon.ico` does not exist, and this line named it > for six weeks. **Since beta.12 the App also takes `-p:FrameLedgerSourceRef`** — the tag, or for a rehearsal the > commit — stamped as assembly metadata so its links into the repository open THIS version's documents -> (`Services/RepositoryLinks`); a build without it links to `main`. +> (`Services/RepositoryLinks`); a build without it links to `main`. **Since beta.14 the Agent takes it too**, because +> `Directory.Build.props` stamps it on every assembly and both publishes build the same libraries into `out/app` (§Version, +> *Identity*). > > **The package id is `FrameLedger.App`, and this line said `FrameLedger` until 2026-09-14 — which would have > deleted every user's ledger on uninstall.** Velopack installs into `%LOCALAPPDATA%\` and removes that @@ -256,7 +281,7 @@ document the app displays for acceptance (FR-11) is a defect, not a template. 7. `tools/coverage-gate.ps1` — reads this run's cobertura reports; self-arming, and armed today for `FrameLedger.Domain` and `FrameLedger.Application` 8. `tools/rules-validate.ps1` (schema + `anticheat` block sanity — a malformed or empty blocklist is a safety bug) -9. `tools/versioninfo-check.ps1` — reads the built binary, because what ships is what an anti-cheat vendor sees; since P4 PR-5 it also compares every `FileVersion` against the `VERSION` file (§Version) +9. `tools/versioninfo-check.ps1` — reads the built binary, because what ships is what an anti-cheat vendor sees; since P4 PR-5 it also compares every `FileVersion` against the `VERSION` file (§Version); **since beta.14 (D50) both halves run — the self-test, then the native five and the managed eight from the App's and the Agent's build output** (`-ManagedDir`, `-ExpectedProductVersion` = `VERSION`), one copyright across all of them (§Version, *Identity*). Under `-SkipNative` the managed half still runs 10. `tools/chokepoint-check.ps1` — injection and evasion primitives confined to one file, native **and** managed, plus the `FL_GUARD_TESTABLE` symbol check against the shipped artifacts 11. **`tools/hookinventory-check.ps1`** — three passes: A resolves every vendor symbol the Overlay names against `docs/vendor-exports.json`, B sweeps for stray literals, C reads the BUILT Overlay's import table and asserts it imports no vendor module. C skips loudly under `-SkipNative`. **Missing from this list until 2026-08-28**, which is §R10 happening again 12. **`tools/package-closure-check.ps1`** — both halves: the self-test (5 cases, 4 of which must go RED) **and** a live pass over this repository. It walks the transitive `ProjectReference` closure of the two publish roots below and fails on anything outside the allowlist, naming the reference edge. `FrameLedger.CaptureHost` is an injecting entry point kept out of the package by construction, and `20_OPEN_QUESTIONS` §S27 is closed on exactly that basis diff --git a/docs/13_CI_CD.md b/docs/13_CI_CD.md index 6c066ef2..aa0e5da5 100644 --- a/docs/13_CI_CD.md +++ b/docs/13_CI_CD.md @@ -135,7 +135,10 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an - **The published tree asserted by name**: `FrameLedger.exe`, `FrameLedger.Agent.exe`, the ~~four~~ five shipped natives `versioninfo-check` lists (`FrameLedger.ProcessStats.dll` since beta.12 — corrected 2026-10-04), `rules/detection-rules.json`; `FrameLedger.CaptureHost.exe` absent (`12_BUILD`: exactly two roots — `package-closure-check` proves it statically, this reads the directory); `versioninfo-check` - run again over `out/app`, because a `.targets`-staged DLL that failed to copy is a warning to `dotnet publish`. + run again over `out/app`, because a `.targets`-staged DLL that failed to copy is a warning to `dotnet publish` — + **since beta.14 (D50) with its managed half** (`-ManagedDir out/app -ExpectedProductVersion `): the eight managed + binaries name FrameLedger, carry the tag's full version and the native binaries' copyright line (`12_BUILD` §Version, + *Identity*). Both publishes take `-p:FrameLedgerSourceRef` since beta.14. - **since beta.13, `vpk download github --pre` first**, so `vpk pack` finds the previous release's full package in `out/release` and writes a delta; after the pack, what `assets.win.json` names is kept and the rest (the previous full package) moves to `out/previous`, the feed and `RELEASES` are filtered to this build, and a downloaded previous package diff --git a/docs/19_SAFETY_AND_ANTICHEAT.md b/docs/19_SAFETY_AND_ANTICHEAT.md index 13c7b2d1..b2c23e09 100644 --- a/docs/19_SAFETY_AND_ANTICHEAT.md +++ b/docs/19_SAFETY_AND_ANTICHEAT.md @@ -22,7 +22,7 @@ These are permanently out of scope. A PR implementing any of them is rejected re - Reading or writing game memory outside the arguments of APIs we hooked - Kernel drivers of our own -The DLL ships with its real filename, a populated VERSIONINFO block (`CompanyName`, `ProductName=FrameLedger`, version), and named kernel objects that clearly say `FrameLedger`. Being identifiable is a feature. +The DLL ships with its real filename, a populated VERSIONINFO block (`CompanyName`, `ProductName=FrameLedger`, version), and named kernel objects that clearly say `FrameLedger`. Being identifiable is a feature. Since beta.14 (D50) the Agent — the process that injects — and the App say the same about themselves: `FrameLedger` as company and product, *FrameLedger Agent* as the Agent's description, the native binaries' copyright line (`12_BUILD` §Version, *Identity*; `tools/versioninfo-check.ps1` reads both kinds). ## The anti-cheat guard (hard gate) diff --git a/src/FrameLedger.Agent/FrameLedger.Agent.csproj b/src/FrameLedger.Agent/FrameLedger.Agent.csproj index 4f549320..a41ac6f3 100644 --- a/src/FrameLedger.Agent/FrameLedger.Agent.csproj +++ b/src/FrameLedger.Agent/FrameLedger.Agent.csproj @@ -12,6 +12,10 @@ win-x64 FrameLedger.Agent FrameLedger.Agent + + FrameLedger Agent + FrameLedger Agent: watches the games you added and records their sessions. Identifies itself deliberately; see https://github.com/poli0981/frameledger diff --git a/src/FrameLedger.App/FrameLedger.App.csproj b/src/FrameLedger.App/FrameLedger.App.csproj index 5cbbf3df..e7ace583 100644 --- a/src/FrameLedger.App/FrameLedger.App.csproj +++ b/src/FrameLedger.App/FrameLedger.App.csproj @@ -24,6 +24,10 @@ FrameLedger.App.Program + + FrameLedger + FrameLedger: records game performance sessions and shows them over time. Identifies itself deliberately; see https://github.com/poli0981/frameledger @@ -57,13 +61,6 @@ - - - - -