ci: Qodana for .NET on the Ultimate licence reads the managed code - native on Windows, hints off, every process start read, ShellUrlOpener opens web and mail links only (Qodana PR-1, D99/D100) (#384)

The owner took an Ultimate licence for the Qodana Cloud organisation and asked for Qodana over every language. This is
the first of two pull requests: the existing job moves to Qodana for .NET (Rider's engine) and what it reports over the
managed code is settled. The C++ is the next one's, as a second report.

The job
- qodana.yaml: linter qodana-dotnet, withinDocker false (native mode on the job's Windows runner, the SDK from
  global.json; no container, no EnableWindowsTargeting, no bootstrap line). Everything a run needs is in the file.
- qodana.yml: the job is `managed` (Qodana (managed)), on windows-latest - checkout, setup-dotnet, the NuGet cache
  restored, dotnet build -c Release, then the action pinned by commit. Still advisory, still a gate of zero.

What its first run reported, and what was done (docs/13_CI_CD.md, section Qodana, has each)
- 3,953 problems, 3,607 of them hints - the level an editor offers without underlining anything; the Community linter
  never reported them. Hints are off as a severity (one group in qodana.yaml). 347 left.
- 271: a vi or ja value equal to the English one - off in .editorconfig for .resx (names, units, format strings).
- 23 + 10: two Markdown inspections (table padding; anchors computed otherwise than GitHub does) off in qodana.yaml;
  the application manifest's XML ignored for XmlHighlighting.
- 6 in PrimaryDisplay.cs are the linter's own fault (an internal assertion, in its log); two inspections are excluded
  for that file, and the file is as it was.
- 1 fixed: a test expression that carried a clause its first half implied.
- 36 from JetBrains' security rules: 35 process starts and 1 SQL text. Each was read - what it starts, where the path
  and the arguments come from (a table in the docs). None takes a value from outside the PC, except the game the user
  added. One place was hardened: ShellUrlOpener now refuses any address that is not http, https or mailto itself,
  where it trusted each caller to have checked (ShellUrlOpenerTests).
  The rules stay on. A rule's own id is honoured nowhere - a profile entry's `ignore`, an `exclude` path and
  `enabled: false` were each tried in a run of its own and every result stood: the OpenGrep plugin reports every rule
  through one inspection, OpenGrepInspection, and hands its server every rule file whatever the profile says. That
  inspection does take a path, so the eleven files of src the results were read in, and tests, are listed under its
  name in qodana.yaml: a new file that starts a process is reported.
- ProcessStartSitesTests, in the gate, is the same tripwire where a merge is blocked: it sweeps src for every way a
  process is started here - Process.Start, a ProcessStartInfo, CreateProcessWithTokenW, the logon task's
  registration - and fails on a file that has not been read and listed.

Also: ShmDrainIntegrationTests' drain under supervision supervises at least twice whatever the first drain holds. On
a busy machine the first scan was slow enough for fifty presents to be waiting, the loop ended after one evaluation,
and the test failed its own "supervised more than once" (once, in a local gate of this change).

Where an inspection is switched off (D100, amending D93's "never in qodana.yaml"): in the place the engine that raised
it reads - one of ReSharper's in .editorconfig, what has no key there in qodana.yaml.

Docs: 13_CI_CD (section Qodana rewritten above D93's account, which is kept as history), CLAUDE.md (the rule, the
layout), HANDOFF (D99, D100, this part's section, and the facts of the two releases of 2026-11-11: v0.1.0-beta.37 and
v0.1.0-alpha.4), wiki/Releasing, CHANGELOG.

Shipped code: ShellUrlOpener.cs alone. No link the App could open before stops opening.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Fable 5.2 authored and GitHub committed 2026-11-11 02:14:04 +00:00
1 parent 428b723bb3
commit 7cd933f62d
13 files changed
+530 -54

No files matched your search

+12 -4
View File
@@ -59,10 +59,12 @@ dotnet_diagnostic.MA0011.severity = warning
# and GenerateDocumentationFile is on for the shipping ones.
dotnet_diagnostic.CS1591.severity = suggestion
# --- ReSharper inspections: what Qodana reads (docs/13_CI_CD.md §Qodana, D93) ---
# Qodana Community for .NET is ReSharper's InspectCode, and InspectCode reads these keys - so does Rider or ReSharper
# in the editor, which is why they are here and not in qodana.yaml: the same list everywhere. An inspection is off
# only where it argues with a choice this project made; each line says which. Everything else it reports is fixed.
# --- ReSharper inspections: what Qodana reads (docs/13_CI_CD.md §Qodana, D93 and D100) ---
# Qodana's linters run ReSharper's engine - Qodana for .NET since 2026-11-11, the Community linter before it - and the
# engine reads these keys; so does Rider or ReSharper in the editor, which is why they are here and not in
# qodana.yaml: the same list everywhere. An inspection is off only where it argues with a choice this project made;
# each line says which. Everything else it reports is fixed. (What is NOT ReSharper's - a whole severity, the
# IntelliJ platform's Markdown and XML inspections, JetBrains' security rules - has no key here and is in qodana.yaml.)
[*.{cs,xaml}]
# The compiler's missing-XML-comment warning, already a suggestion above (CS1591): InspectCode reports suggestions.
resharper_c_sharp_warnings_cs1591_highlighting = none
@@ -147,6 +149,12 @@ resharper_redundant_empty_switch_section_highlighting = none
# A binding path through a null yields no value, and the template shows nothing: that is the design.
resharper_xaml_possible_null_reference_exception_highlighting = none
[*.resx]
# A vi or ja value that equals the English one is deliberate: product and technology names, units and format strings
# are not translated, and a ja safety string is the English verbatim until a reviewer signs it (docs/09_I18N.md;
# tools/resx-audit.ps1 holds that rule). 271 results on Qodana for .NET's first run.
resharper_overridden_with_same_value_highlighting = none
[src/FrameLedger.App/**.cs]
# WPF codegen constraints, not style choices. The generated App.g.cs and
# *.g.cs partials declare these types public, so making them internal is a
+48 -21
View File
@@ -1,28 +1,25 @@
# Qodana (owner decision D93, 2026-11-10; docs/13_CI_CD.md §Qodana).
# Qodana (owner decisions D93, 2026-11-10, and D99, 2026-11-11; docs/13_CI_CD.md §Qodana).
#
# JetBrains' template for the Qodana Scan action, changed where FrameLedger differs
# and each change said here:
#
# - The linter is Qodana Community for .NET (qodana.yaml names it and says why): a
# Linux container, which is why this job alone runs on ubuntu-latest in a
# Windows-only project. EnableWindowsTargeting lets the .NET SDK there build and
# load projects whose target is Windows; it is passed to the container rather than
# written into Directory.Build.props, because no build of the product is meant to
# run anywhere but Windows.
# - The action is pinned to a commit (v2026.2.2, the newest; the template names
# v2026.1), as every action that is not GitHub's own is here.
# - The linter is Qodana for .NET (Rider's engine) in NATIVE mode, on a Windows
# runner: the projects target Windows, and the linter then builds and loads them
# with the SDK this job installs from global.json - no container, and no
# EnableWindowsTargeting. qodana.yaml names the linter and the mode; nothing is
# passed as an action argument. (Until beta.37 this was the Community linter in a
# Linux container, the one Linux job this repository had.)
# - The action is pinned to a commit, as every action that is not GitHub's own is
# here.
# - Permissions are the ones the job uses: it reads the repository, writes a check
# run with the annotations and one comment on the pull request. The template's
# `contents: write` is for pushing quick-fixes, which this job never does.
# - A workflow of its own, as JetBrains advises, and ADVISORY: `main`'s required
# contexts stay `check` and the two `analyze` jobs. A problem Qodana finds, or a
# Qodana Cloud outage, is a red job beside a green `check`, never a blocked merge.
# contexts stay `check` and the two `analyze` jobs. A problem Qodana finds, a
# Qodana Cloud outage or a lapsed licence is a red job beside a green `check`,
# never a blocked merge.
# - `main` only: the `alpha` branch is main's source under another release line
# (docs/13_CI_CD.md §The alpha line), and main's is what is analysed.
# - INTERIM since beta.37 (D94, 2026-11-11): main builds on .NET 11, which the
# linter's image does not carry (SDKs 8 to 10), so qodana.yaml's `bootstrap`
# installs the SDK global.json names into the container first. The Ultimate
# linter's pull request replaces this job with one on Windows.
name: Qodana
@@ -40,7 +37,8 @@ concurrency:
cancel-in-progress: true
jobs:
qodana:
managed:
name: Qodana (managed)
# A pull request from this repository, or a push or a dispatch. QODANA_TOKEN
# reaches neither a fork's pull request nor Dependabot's, and their token cannot
# write the check run or the comment.
@@ -48,7 +46,7 @@ jobs:
github.event_name != 'pull_request' ||
(github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'dependabot[bot]')
runs-on: ubuntu-latest
runs-on: windows-latest
timeout-minutes: 60
permissions:
contents: read
@@ -64,19 +62,48 @@ jobs:
# A full history is required for pull request analysis.
fetch-depth: 0
# Native mode runs the linter in this job's environment, so the SDK it loads
# the projects with is this one. No MSVC step here on purpose: it exports
# Platform=x64, which MSBuild reads as a solution platform (build.ps1's
# Clear-VcxprojPlatform).
- name: Set up .NET
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
# Restored only: `check` saves this cache, under the same key.
- name: Restore the NuGet cache
uses: actions/cache/restore@v6
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/Directory.Packages.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-
# Built before it is inspected: a build that fails is then one red step with
# the compiler's own message, not a report of thousands of unresolved symbols.
# The native DLLs are absent here, so the .targets that copy them warn and the
# build goes on, as on a fresh clone.
- name: Build what the linter loads
shell: pwsh
run: |
dotnet build FrameLedger.slnx -c Release
if ($LASTEXITCODE -ne 0) { throw 'the build failed' }
# pr-mode false: the whole solution every time, so a pull request and `main`
# are judged by the same list. upload-result: the SARIF and the linter's log
# as an artifact of the run, for a reader with no Qodana Cloud account.
# Caches are saved from `main` only (a pull request reads them): one per
# branch would crowd the repository's cache quota, which NuGet's share.
# Caches are saved from `main` only (a pull request reads them), under keys of
# this job's own: one per branch would crowd the repository's cache quota,
# which NuGet's share.
- name: Qodana Scan
uses: JetBrains/qodana-action@3e8d76ff0e0241618abd808682f426afe84bab3f # v2026.2.2
with:
pr-mode: false
upload-result: true
artifact-name: qodana-report
cache-default-branch-only: true
env-vars-to-linter: EnableWindowsTargeting
primary-cache-key: qodana-managed-${{ github.ref_name }}-${{ github.sha }}
additional-cache-key: qodana-managed-main
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
QODANA_ENDPOINT: 'https://qodana.cloud'
EnableWindowsTargeting: 'true'
+37
View File
@@ -35,6 +35,43 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Changed
- **Qodana for .NET, on the Ultimate licence, reads the managed code** (developers only; owner decisions D99 and D100).
The owner took an Ultimate licence for the Qodana Cloud organisation and asked for Qodana over every language. The
job — `managed`, *Qodana (managed)* in a pull request's checks — now runs Qodana for .NET (Rider's engine) in native
mode on a Windows runner, after a `dotnet build`, where the Community linter ran in a Linux container. Besides the
C#, the XAML and the `.resx` it reads the Markdown and XML around the solution, and JetBrains' security rules read
the C#. Its first run reported 3,953 problems, 3,607 of them **hints** — the level an editor offers without
underlining anything, which the Community linter never reported; hints are off as a severity. Of the 347 left: a vi
or ja string equal to the English one (271) is off in `.editorconfig` for `.resx` files — names, units and format
strings are not translated; two Markdown inspections (table padding, and anchors computed otherwise than GitHub
does) and the application manifest's XML are off in `qodana.yaml`; six results in `PrimaryDisplay.cs` are the
linter's own fault (an internal assertion, in its log) and are excluded for that file; one test expression was
simplified. The gate stays zero problems and the job stays advisory. An inspection is now switched off **where the
engine that raised it reads** — one of ReSharper's in `.editorconfig`, what has no key there in `qodana.yaml` — which
amends D93's "never in `qodana.yaml`" (`docs/13_CI_CD.md` §Qodana). The C++ goes to a second report, the next pull
request's.
- **Every place that starts a process was read, and the App now opens web and mail links only.** JetBrains' rule for
"a process started with something that is not a literal" reported 35 places — 11 in the product, 24 in tests. Each
was read: what it starts, and where the path and the arguments come from (the table in `docs/13_CI_CD.md` §Qodana).
None takes a value from outside the PC or from a file FrameLedger did not write, except the path and arguments of
the game the user added. One was hardened: `ShellUrlOpener` — what opens a link in the browser or the mail client —
now refuses any address that is not `http`, `https` or `mailto` itself, where it trusted each caller to have
checked; the shell runs whatever it is handed, and a `file:` address is a program. Every caller already passed one
of the project's own pages or a link held to those schemes, so no link you could click before stops working. The
rule stays on: the files its results were read in are listed in `qodana.yaml`, so a new file that starts a
process is reported — by path on the plugin's one inspection, since a rule's own id is honoured nowhere (three
runs measured it). And a test of the repository's own, `ProcessStartSitesTests`, in the gate, fails on a new file
that starts a process, or registers a scheduled task, until it has been read and listed.
### Fixed
- **A test that failed on a busy machine** (developers only). `ShmDrainIntegrationTests`' drain under supervision
ended after one guard evaluation whenever the first scan was slow enough for fifty presents to be waiting, and
then failed its own "supervised more than once"; the loop now supervises at least twice whatever the first
drain holds.
## Releases
Newest first. Each file holds that release's section exactly as it stood here.
+5 -4
View File
@@ -73,9 +73,10 @@ RELEASE_LINE # `main`, or `alpha` on the alpha branch (D73, 20
build.ps1 # the quality gate; CI runs this identical script
SonarQube.Analysis.xml # SonarCloud's settings for ci.yml's sonarcloud job (D68, 2026-10-25; it replaced
.config/dotnet-tools.json # .sonarcloud.properties) and the scanner it runs — 13_CI_CD §SonarCloud
qodana.yaml # Qodana's settings for .github/workflows/qodana.yml (D93, 2026-11-10): the linter, the
# solution, a gate of zero problems; the inspections' severities are .editorconfig's
# resharper_* keys — 13_CI_CD §Qodana
qodana.yaml # Qodana's settings for the managed job of .github/workflows/qodana.yml (D93; Qodana for
# .NET on the Ultimate licence since 2026-11-11, D99): the linter, the solution, a gate
# of zero problems, and what is switched off that .editorconfig has no key for —
# ReSharper's inspections are .editorconfig's resharper_* keys (D100) — 13_CI_CD §Qodana
src/
native/
FrameLedger.Overlay/ # C++20 DLL injected into the game (hooks + ring writer + optional overlay)
@@ -178,7 +179,7 @@ Dependency direction: `App/Agent → Application → Domain`; **`Application →
## Coding conventions
**C# —** `Nullable enable`, `TreatWarningsAsErrors`, `AnalysisLevel latest-all`, file-scoped namespaces, Roslynator + Meziantou + VS Threading analyzers, `dotnet format` clean. Qodana Community for .NET (ReSharper's inspections) reads the C# and the XAML in an advisory workflow of its own, with a gate of zero problems *(since 2026-11-10, D93 — `13_CI_CD` §Qodana)*: fix what it reports, or switch the inspection off in `.editorconfig` with the reason beside it — never in `qodana.yaml`, never without one. Async suffixed `Async`, `ConfigureAwait(false)` off the UI. All user-visible strings from `.resx`. Timestamps UTC (unix-ms in SQLite); QPC ticks only inside the capture pipeline.
**C# —** `Nullable enable`, `TreatWarningsAsErrors`, `AnalysisLevel latest-all`, file-scoped namespaces, Roslynator + Meziantou + VS Threading analyzers, `dotnet format` clean. Qodana reads the C# and the XAML in an advisory workflow of its own, with a gate of zero problems *(since 2026-11-10, D93; Qodana for .NET on the Ultimate licence since 2026-11-11, D99 — `13_CI_CD` §Qodana)*: fix what it reports, or switch the inspection off with the reason on the line above, **in the place the engine that raised it reads** *(D100)* — one of ReSharper's (C#, XAML, `.resx`, the C++) in `.editorconfig`; what has no key there (the hints as a severity, the Markdown and XML inspections, the files JetBrains' security rules were read in) in `qodana.yaml` — never anywhere else, never without a reason. A new file that starts a process fails `ProcessStartSitesTests`, and Qodana's security rule reports it: read what it starts and where the path and the arguments come from, then list it in the test, in `qodana.yaml` and in `13_CI_CD` §Qodana. Async suffixed `Async`, `ConfigureAwait(false)` off the UI. All user-visible strings from `.resx`. Timestamps UTC (unix-ms in SQLite); QPC ticks only inside the capture pipeline.
**C++ —** `clang-format` (LLVM base, 4-space, 120 col) enforced in CI. No STL containers that allocate in hook paths. No `std::mutex` in hook paths. `-D_HAS_EXCEPTIONS=0` in the Overlay target. Every hook entry point wrapped per the `FL_HOOK_GUARD` macro (`17_HOOK_ENGINE`). Static analysis: ~~`/analyze` + clang-tidy (`bugprone-*`, `cert-*`, `concurrency-*`)~~ CodeQL (`codeql.yml`, a required check); `/analyze` and clang-tidy are not configured *(corrected 2026-10-04)*. SonarCloud analyses the C++ too, from CMake's compilation database, in `ci.yml`'s advisory `sonarcloud` job *(since 2026-10-25, D68 — `13_CI_CD` §SonarCloud)*.
+122 -6
View File
@@ -124,11 +124,12 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
read `net10.0`; and for a construct it has not met, a pull request's run is not the evidence — a
`workflow_dispatch` on the branch is, §C# 15 and the analyses.)*
### `qodana.yml` — push to `main`, pull requests into `main`, `workflow_dispatch` · **repo-local, built 2026-11-10 (D93)**
- One job, `qodana`, on `ubuntu-latest` — the only Linux job in this repository, because the linter is a Linux
container: `JetBrains/qodana-action` (pinned to `v2026.2.2`'s commit; Dependabot moves the pin) runs Qodana Community
for .NET over `FrameLedger.slnx` with `qodana.yaml`'s settings. §Qodana below says what it reads, what was changed
from JetBrains' template and where an inspection is switched off.
### `qodana.yml` — push to `main`, pull requests into `main`, `workflow_dispatch` · **repo-local, built 2026-11-10 (D93); Qodana for .NET since 2026-11-11 (D99)**
- ~~One job, `qodana`, on `ubuntu-latest` — the only Linux job in this repository, because the linter is a Linux
container~~ The job `managed` (*Qodana (managed)*), on `windows-latest`: `JetBrains/qodana-action` (pinned to
`v2026.2.2`'s commit; Dependabot moves the pin) runs **Qodana for .NET** in native mode over `FrameLedger.slnx`
with `qodana.yaml`'s settings, after a `dotnet build`. No job here runs on Linux any more. §Qodana below says what
it reads, what was changed from JetBrains' template and where an inspection is switched off.
- **Advisory, with a gate of zero problems:** one problem turns the job red; it is not a required context.
- `permissions: contents: read, checks: write, pull-requests: write` — the annotations and the one comment; granted to
the job, the workflow grants none.
@@ -487,7 +488,122 @@ on `src/FrameLedger.Infrastructure/**/*` and `src/FrameLedger.Shared/**/*`, so n
stop reappearing on pull requests. *(Since D68 the `S8417` and `S6640` rows are `SonarQube.Analysis.xml`'s, in the
repository; `S6232`'s are not — a union read outside `LARGE_INTEGER` would be a finding — and its 24 stay marked.)*
## Qodana — `qodana.yml`, a workflow of its own (owner decision D93, 2026-11-10)
## Qodana — `qodana.yml`, a workflow of its own (owner decisions D93, 2026-11-10; D99 and D100, 2026-11-11)
**Since 2026-11-11 the linter is Qodana for .NET, on the Ultimate licence (D99).** The owner took an Ultimate licence for
the Qodana Cloud organisation and asked for Qodana over every language. So the linter is **Qodana for .NET**
(`qodana-dotnet`: Rider's engine) where it was the Community one, in **native mode** on a Windows runner: no container,
the projects built and loaded with the SDK the job installs from `global.json`, and no `EnableWindowsTargeting`.
`qodana.yaml` names the linter and the mode (`withinDocker: false`); nothing is an action argument, so `qodana scan` on
a developer's PC reads the same file. The job is `managed` — *Qodana (managed)* in a pull request's checks: checkout,
`setup-dotnet`, the NuGet cache restored, `dotnet build -c Release` first — so that a build that fails is one red step
with the compiler's own message, not a report of unresolved symbols — then the action, pinned by commit. No MSVC step,
on purpose: it exports `Platform=x64`, which MSBuild reads as a solution platform. The linter's log says what the token
bought: "Qodana license plan: Ultimate", and the Qodana Cloud project it is linked to (`frameledger`). Still advisory,
still a gate of zero, still `main` and its pull requests alone. From here down to *As it was built* is the job as it
is; below that is D93's own account, which is now history.
**Two reports (D99).** Asked how to gather the C# and the C++, the owner chose two reports from the start, and made a
second Qodana Cloud project (`frameledger-cpp`, the `QODANA_TOKEN_NATIVE` secret). The managed report leaves
`src/native` out; the native one — the next pull request's — reads nothing else, so every file is in exactly one.
**What is read, and by what.**
| What | Read by | |
|---|---|---|
| The C#, XAML and `.resx` of the thirteen projects | `managed` | ReSharper's engine, as under D93 |
| Markdown and XML around the solution | `managed` | the IntelliJ platform's own inspections — 23 and 10 results on the first run |
| JetBrains' security rules over the C# — pattern rules for a process start, an SQL text and the like | `managed` | new with this linter (its OpenGrep plugin) — 36 results on the first run, every one read; the files they were read in are listed in `qodana.yaml`, so a new one is reported |
| The C++ of `src/native` | the `native` job | the pull request after this one |
| JSON and YAML, the workflows among them | nothing reported | whether the profile inspects them and found nothing, or does not inspect them, was not established; CodeQL's `actions` language reads the workflows |
| PowerShell (`build.ps1`, `tools/`) and CMake files | no linter of JetBrains' reads them here | SonarCloud reads the PowerShell |
**The first runs on this linter, and what was done (2026-11-11).** Run 42923079119 — the job with no settings beyond the
solution: **3,953 problems** in 92 inspections, and 3,607 of them **hints**: the lowest level an IDE has, which the
editor offers without underlining anything (this linter files them as `TYPO`, Qodana as *Low*). Meziantou's "name the
parameter" 1,084 times, a trailing comma 979, a XAML binding whose `DataContext` the engine cannot know 414, the MVVM
Toolkit's partial-property proposal 224, "invert `if`" 114 — and every other Roslyn analyzer message below the level
this build makes an error. **Hints are off as a severity**, one group in `qodana.yaml` (`severity:TYPO`): the Community
linter never reported them, and D93's rule is about warnings and suggestions. With that, run 42928814104: **347**.
| What | n | Done |
|---|---|---|
| `OverriddenWithSameValue` — a vi or ja value equal to the English one | 271 | off in `.editorconfig` (`[*.resx]`): product and technology names, units and format strings are not translated, and a ja safety string is the English verbatim until a reviewer signs it |
| `csharp_injection_rule-CommandInjection` — a process started with something that is not a literal | 35 | **read, one by one** (below): 11 places in `src`, 24 in tests; one place was hardened. The rule stays on, and the files read are left out of the plugin's inspection by path in `qodana.yaml` (*How the security rules are scoped*, below), so a new file that starts a process is reported |
| `MarkdownIncorrectTableFormatting` | 20 | off in `qodana.yaml`: Rider wants columns padded to one width; these tables are written to be diffed |
| `XmlHighlighting` in `src/FrameLedger.App/app.manifest` | 10 | that file ignored for that inspection: the linter has no schema for a Windows application manifest |
| `UnusedVariable.Compiler` and `RedundantUsingDirective` in `PrimaryDisplay.cs` | 6 | **the linter's own fault**, and the file is left as it is: resolving `PInvoke.EnumDisplaySettings(null, …)` — the `null`-to-`PCWSTR` conversion — the engine of this linter's build (QDNET-262.12299) fails an internal assertion (`IsStandardImplicitConversionFromExpression(conversion.Kind)`, in its `backend.log`), loses the method, and reports its three locals and the file's three usings as unused. The compiler builds the file with warnings as errors, and InspectCode 2026.2.3.1 and 2026.3.0 report nothing in it. Those two inspections are excluded for that one file in `qodana.yaml`, to be removed when a linter build reads it |
| `MarkdownUnresolvedHeaderReference` | 3 | off in `qodana.yaml`: all three resolve on GitHub, whose anchor rule the linter does not follow (`#display-mode--both-tiers-beta10`) |
| `csharp_injection_rule-SQLInjection` | 1 | the same: the one place assigns a constant command text and binds every value as a parameter, as every statement in this repository does; its file is listed with the others |
| `RedundantBoolCompare`, in a test | 1 | fixed — the expression also carried a clause its first half implied |
With those settled, run 42940926340 (2026-11-11, this pull request's branch, the whole solution): **no problem
reported** — the gate's zero, on this linter.
**How the security rules are scoped — by the plugin's one inspection, not by a rule.** Every result of the
OpenGrep plugin's several hundred rules is produced by one inspection, `OpenGrepInspection`; a rule's own id
(`csharp_injection_rule-CommandInjection`) is in the report and is honoured nowhere. Three runs measured it — a
profile entry's `ignore` (42932842462), an `exclude` path under the rule's id (42935752891), `enabled: false`
on the rule (42938295264): all 36 results stood each time, and the linter's log shows why — the plugin hands its
server every rule file whatever the profile says. What the plugin's inspection does honour is a path: an
`exclude` entry named `OpenGrepInspection` (its scopes are in the report's `log/effective.profile.xml`). So the
eleven files of `src` the results were read in, and `tests`, are listed there — and in the run above the
inspection was performed on 943 files, where it had been 1,308, and reported nothing: it is on, and it reads
what is not listed. The price is stated in `qodana.yaml`: a listed file is left out of **all** of the plugin's
rules, not only the one that fired. The plugin is also most of the job's time — about six of its fifteen
minutes.
**A second tripwire, in the gate: `ProcessStartSitesTests`.** Qodana is advisory, and its rule is a pattern for
`Process.Start`. The test sweeps `src` for every way a process is started here — `Process.Start`, a
`ProcessStartInfo`, `CreateProcessWithTokenW` through CsWin32, and the registration of the logon task — and fails
on a file that is not in its list, until that file has been read and listed. `Startup/UnelevatedProcess`, which
the rule never saw, is in it.
**Every place that starts a process, as read on 2026-11-11.** The rule is a pattern, not a data flow: it reports any
`Process.Start` whose argument is not a literal. What matters at each is what is started and where its path and
arguments come from.
| Place | What it starts | Where the path and the arguments come from |
|---|---|---|
| `App/Services/AgentLauncher` | `FrameLedger.Agent.exe` | the file beside the App (`AppContext.BaseDirectory`); arguments the App builds (`--serve`, the data folder) |
| `App/Services/AgentTool` | the same Agent, with one maintenance flag | a constant at each of its two callers (`--install-task`, the Settings page's flags) |
| `Infrastructure/Startup/AgentElevation` | the Agent, elevated (`runas`) | the Agent's own path; `--serve --for-user <this user's SID>` |
| `Infrastructure/Startup/LogonTask` | nothing itself — it registers the logon task, whose action Windows starts at sign-in | the Agent's path and constant arguments (`--serve`), into a Task Scheduler definition for this user, at the lowest privileges |
| `Infrastructure/Diagnostics/CrashDumpWriter` | this process's own executable, as the dumper | `Environment.ProcessPath`; an `ArgumentList`, no shell |
| `Infrastructure/Capture/ProcessLauncher` | the game | the executable the user added and enabled hooking for, and the launch arguments the user wrote for it; no shell |
| `App/Services/ShellStarter` | a game, directly or through its store (`steam://…`, `explorer.exe shell:AppsFolder\<AUMID>`) | the launch `GamePlayer` resolves from the record of a game the user added (D59, D80) |
| `App/Services/Explorer` | `explorer.exe` on a folder or a file | a quoted path of FrameLedger's own: the data folder, the logs, a bug report's zip, the licences folder |
| `App/Services/ShellUrlOpener` | the browser or the mail client | the project's own pages, or a Markdown link `MarkdownLinks` has already held to `http`, `https` and `mailto`. **Hardened here**: the opener now refuses any other scheme itself (`ShellUrlOpenerTests`) — the shell runs whatever it is handed, and a `file:` address is a program |
| `App/ViewModels/SettingsViewModel` | the browser | one constant address |
| `Infrastructure/Startup/UnelevatedProcess` | the Agent or a game with the shell's token, from an elevated process (`CreateProcessWithTokenW`) | its two callers above, `AgentLauncher` and `ProcessLauncher` — not a `Process.Start`, so the rule did not see it; the sweep does |
None takes a value from outside the PC or from a file FrameLedger did not write, except the game's own path and
arguments — which starting the game the user chose is.
**Where an inspection is switched off: by the engine that raised it (D100, amending D93's "never in `qodana.yaml`").**
What Qodana reports is fixed, unless the inspection argues with a choice this project made; then it is off, with the
reason on the line above — in the place the engine that raised it reads:
- **ReSharper's** — the C#, the XAML, the `.resx`, and the C++ of the native report — in **`.editorconfig`**
(`resharper_*_highlighting`), where Rider and ReSharper in the editor read it too. Sixty-four keys since this pull
request.
- **What has no key there** — in **`qodana.yaml`**: a whole severity (the hints) and the IntelliJ platform's Markdown
and XML inspections under `profile.inspections`; under `exclude`, by inspection and path, the files JetBrains'
security rules were read in and a file the linter itself fails on.
- **What is not FrameLedger's code** is left out by path (`exclude`): `SonarQube.Analysis.xml`'s list, for its reasons.
**What it does not use, and what happens if the licence lapses.** Quick-fixes (the linter would push commits — the job
has no `contents: write`, and a change nobody read is not wanted), code coverage in Qodana (the gate's coverage and
SonarCloud's already read the same reports) and FlexInspect are Ultimate features this job leaves alone. Without a
valid licence the linter does not start, so the job is red — advisory, never a blocked merge; the way back is
`linter: qodana-cdnet` with the job on `ubuntu-latest`, as it ran until beta.37.
**Running it on a developer's PC.** `qodana scan` in the repository root reads `qodana.yaml`, downloads the linter and
needs the project's token in `QODANA_TOKEN` — the Ultimate linter checks the licence. Without a token, InspectCode
still gives ReSharper's part (*As it was built*, below), with `--toolset-path` at the 11.0 SDK's `MSBuild.dll`; the
Markdown, XML and security results are the Rider linter's alone.
**As it was built — the Community linter, 2026-11-10 to beta.37 (D93).** Kept as written; where it says *is*, read *was*.
**D93 — Qodana reads the C# and the XAML from CI.** The owner made the project on Qodana Cloud, set the `QODANA_TOKEN`
secret (2026-11-10) and asked for Qodana in CI from the workflow JetBrains gives, changed where it had to be, with what
+72
View File
@@ -155,6 +155,13 @@ SonarScanner 12.0.0 on the 11.0 runtime; InspectCode 2026.2.3.1 and 2026.3.0 aga
- **A local gate reseeds `%LOCALAPPDATA%\FrameLedger\rules`** while the owner's installed copy runs beside it: the
files were hashed before and after every gate (identical each time — the repository's rules were the installed ones).
**The release (the tag, 2026-11-11).** Rehearsed first (`release.yml` dispatched on the release branch, run
42926539241), then the signed tag `v0.1.0-beta.37` on `1a7fbf3`: run 42930394186, published 2026-11-11T00:36:54Z.
Eight assets, the seven listed in `SHA256SUMS.txt` equal to the digests GitHub computed; `FL_BUILD_ID v0.1.0-beta.37`
in the shipped natives. The delta across two major runtimes exists — the stop condition the plan had named: "Delta
processed 0443 files. 0373 patched, 0070 unchanged, 0009 new, 0017 removed", 72,681,960 bytes beside a full package of
110,325,368. The wiki was published by its own run (42932792575).
**Owner-only:** item 34 — beta.37 on real hardware, a hooked session on .NET 11.0.0, and Windows 10 if a PC with it is
at hand.
@@ -175,9 +182,72 @@ alpha.3. Its notes are `docs/changelog/0.1.0-alpha.4.md`: the warning, and that
included; and once ten betas have followed it, a copy of alpha.3 or older no longer finds alpha.4 (Velopack reads
the newest ten releases).
**The sync and the release (2026-11-11).** #382 put the notes on main (`428b723`); #383 merged main into `alpha` by
hand (`134115b`): twenty-seven conflicts, every one resolved to main's side, and `git diff --name-only origin/main
origin/alpha` prints `RELEASE_LINE` alone. Rehearsed on `alpha` (run 42933603983: channel `alpha`, a delta from
alpha.3), then the signed tag `v0.1.0-alpha.4`: run 42935876535, published 2026-11-11T01:16:22Z as *FrameLedger
0.1.0-alpha.4 (experimental alpha)*, a pre-release. Eight assets, seven of seven digests equal; "Delta processed 0448
files. 0369 patched, 0079 unchanged, 0004 new, 0005 removed", 18,207,557 bytes; `FrameLedger.App-alpha-Setup.exe`,
`releases.alpha.json`; the wiki run skipped, as it does for an alpha.
- **One tag push started two release runs** (42935876535 and 42935878584, both `push`, created in the same second;
the tag was pushed once). `release.yml`'s concurrency group made the second wait for the first, and it then began
the whole build again. It was cancelled once the first had published: it could only have ended red, at
`gh release create` on a release that existed. If a tag ever shows two runs, let the first finish, verify the
release, then cancel the other.
**Owner-only:** item 35 — the fourth alpha on real hardware, and the beta installed over it.
### Qodana for .NET on the Ultimate licence — the managed report (D99, D100)
*Status is `docs/13_CI_CD.md` §Qodana and `CHANGELOG.md`; this is what no other file carries.* The third part of the
plan, in two pull requests: this one moves the existing job to Qodana for .NET (Rider's engine, native on a Windows
runner) and settles what it reports over the managed code; the next adds the C++ as a second report.
**Decisions:**
- **D99 — two reports from the start** ("Hai báo cáo ngay từ đầu"). The owner made a second Qodana Cloud project,
`frameledger-cpp`, and the secret `QODANA_TOKEN_NATIVE`; the managed report goes to `frameledger` with
`QODANA_TOKEN`. Both secrets are the owner's; no token was ever read or handled here.
- **D100 — where an inspection is switched off** (the plan's design, approved with it; it amends D93's "never in
`qodana.yaml`"): in the place the engine that raised it reads — one of ReSharper's in `.editorconfig`; what has no
key there in `qodana.yaml`. Hints are off as a severity. In code loaded into a game only defects are fixed.
**Choices made here:**
- **JetBrains' security rules stay on, scoped by path — which took four runs to find.** Every result was read first
(the table in `13_CI_CD` §Qodana), and one place hardened (`ShellUrlOpener` refuses anything but `http`, `https`
and `mailto`). Then the files read had to be told to the linter, and a rule's own id is honoured nowhere:
`ignore`, an `exclude` path and `enabled: false` each left all 36 results standing. The report's own
`log/effective.profile.xml` and `qodana_inspections_summary.csv` gave the answer — one inspection,
`OpenGrepInspection`, produces every rule's results, and it does take a path. Between the third run and the
fourth the rules were written as off, with a test in their place; the test stayed (`ProcessStartSitesTests`, in
the gate, and wider than the rule), the rules came back on.
- **`PrimaryDisplay.cs` was not changed to please the linter.** Its six results come from an internal assertion in
this linter's build (in the job's `backend.log`), not from the file; the first guess — that the engine misreads an
`unsafe` tuple — was wrong, and a rewrite made on it was reverted. Two inspections are excluded for that one file,
to be removed when a linter build reads it.
- **What the Ultimate licence offers and this job does not use**: quick-fixes (the job cannot push, on purpose), code
coverage in Qodana, FlexInspect. If the licence lapses the job is red and advisory; the way back is in `qodana.yaml`.
**Traps:**
- **A security rule's id is not an inspection.** The OpenGrep plugin's rules all report through
`OpenGrepInspection`; only that name works in `qodana.yaml`, and only by path. Read
`log/qodana_inspections_summary.csv` in the report artifact to see which inspection produced a result before
spending a run on a guess.
- **A report artifact is a zip inside the download, with backslash paths**: `unzip` extracts it and exits non-zero
on the warnings, so do not chain on its exit code.
- **A linter result can be the linter's fault**: read the job's log directory (the report artifact carries it) for an
`AssertionException` before changing the code it points at.
- **A Qodana run of the managed job takes fifteen to seventeen minutes**, most of it the scan; a pull request's own run
reads the whole solution (`pr-mode: false`), so there is no quick partial run to iterate on.
**Next:** the native report — a Visual Studio solution generated by CMake (`x64-vs-analysis`), `qodana-native.yaml`,
the job `native`; 655 results on its first run with the hints off, 494 of them distinct (a file compiled into three
targets is reported three times), about a quarter in code loaded into a game.
## Owner-only — no PR can close these
*The items that passed — 3, 12, 14–19 — moved verbatim to [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) on 2026-10-19 (D66); the numbers are kept, and a number is never reused.*
@@ -562,6 +632,8 @@ Where each owner decision is recorded — the file and its section, and a label
| D96 | [`13_CI_CD.md`](13_CI_CD.md) §C# 15 and the analyses | C# 15 on the main line from beta.37, a construct only where the build, CodeQL and Qodana read it — none of the four yet (Qodana's engine reads none, 2026-11-11), so beta.37 takes .NET 11's API and no syntax; no preview feature |
| D97 | [`../legal/ALPHA_NOTICE.md`](../legal/ALPHA_NOTICE.md) | an alpha is "a beta's source built to try a newer version of .NET, at times a prerelease one": EULA 1.7, Disclaimer 2.14 (with a paragraph on Windows and the processor), Alpha notice 1.1, approved with the plan; the App says "a prerelease .NET" only where the runtime is one |
| D98 | [`12_BUILD.md`](12_BUILD.md) §The alpha line | alpha.4 is beta.37's source on .NET 11.0.0, and then the alpha line rests until a newer .NET has a preview; a resting alpha tells its user to install the beta |
| D99 | [`13_CI_CD.md`](13_CI_CD.md) §Qodana | Qodana for .NET on the Ultimate licence, in two reports from the start: the managed code to the Qodana Cloud project `frameledger`, the C++ to `frameledger-cpp` |
| D100 | [`13_CI_CD.md`](13_CI_CD.md) §Qodana | an inspection is switched off where the engine that raised it reads — ReSharper's in `.editorconfig`, the rest in `qodana.yaml` (amends D93); hints are off as a severity; in code loaded into a game only defects are fixed |
---
+99 -15
View File
@@ -1,29 +1,113 @@
# Qodana's settings for .github/workflows/qodana.yml (owner decision D93, 2026-11-10; docs/13_CI_CD.md §Qodana).
# Qodana's settings for the `managed` job of .github/workflows/qodana.yml (owner decisions D93, 2026-11-10, and D99,
# 2026-11-11; docs/13_CI_CD.md §Qodana).
#
# The linter is Qodana Community for .NET (ReSharper's InspectCode in a Linux container), and not Qodana for .NET
# (Rider): that one needs an Ultimate licence, and the Qodana Cloud organisation holds a 30-day trial, so a job
# built on it would turn red the day the trial ends. The Community linter runs under every licence.
# The linter is Qodana for .NET (qodana-dotnet: Rider's engine), in NATIVE mode - on the job's own Windows runner, with
# the .NET SDK global.json names, no container. It needs the Ultimate licence the Qodana Cloud organisation holds since
# 2026-11-10; the Community linter (qodana-cdnet, InspectCode in a Linux container) ran here until then, and is the way
# back if the subscription ever lapses - `linter: qodana-cdnet`, and the job on ubuntu-latest again.
#
# It analyses the C# of FrameLedger.slnx - and its XAML and .resx - and nothing native: src/native is a CMake
# tree no solution names, and it is MSVC-only, which no Linux container compiles. CodeQL and SonarCloud read the C++.
# It reads the solution's C#, XAML and .resx, and what Rider's own plugins read of the repository around it (Markdown,
# XML, and JetBrains' security rules over the C#). Not the C++: that is qodana-native.yaml's report, over the Visual
# Studio solution CMake generates, sent to a Qodana Cloud project of its own.
#
# The linter's image is the action's own version (the action pins the CLI, the CLI its image), so the one pin is the
# action's commit in the workflow.
# Everything a run needs to know is here and nothing is an action argument, so `qodana scan` on a developer's PC reads
# the same settings. The linter's version is the action's (the action pins the CLI, the CLI its linter), so the one pin
# is the action's commit in the workflow.
version: "1.0"
linter: qodana-cdnet
linter: qodana-dotnet
withinDocker: false
# INTERIM, from beta.37's move to .NET 11 (D94, 2026-11-11) until the Ultimate linter's pull request replaces this
# file: the linter's image carries the .NET SDKs 8 to 10, and main builds on 11. The SDK global.json names is installed
# into the container before the build, with the line JetBrains' page gives for an SDK the image lacks.
bootstrap: curl -fsSL https://dot.net/v1/dotnet-install.sh | bash -s -- --jsonfile /data/project/global.json -i /usr/share/dotnet
# WHERE AN INSPECTION IS SWITCHED OFF (docs/13_CI_CD.md §Qodana, CLAUDE.md §Coding conventions): one of ReSharper's -
# C#, XAML, .resx - in .editorconfig, where Rider reads it too. Here only what has no key there: a whole severity and
# the IntelliJ platform's own inspections (Markdown, XML) under `profile`; and, under `exclude` further down, the files
# JetBrains' security rules were read in, and one file the linter itself fails on. Each with its reason above it.
profile:
base:
name: qodana.recommended
groups:
# A HINT is what the editor offers without underlining anything (ReSharper's lowest level; this linter files it as
# TYPO, Qodana as Low): "invert if", "convert to LINQ", a trailing comma, and every Roslyn analyzer message below
# the level this build makes an error. The Community linter never reported them, and the rule D93 set is about
# warnings and suggestions. 3,607 of this job's first 3,953 results were hints (run 42923079119).
- groupId: Hints
groups:
- "severity:TYPO"
inspections:
- group: Hints
enabled: false
# Rider wants a table's columns padded to one width. The tables here are written to be diffed: a cell's text changes
# and its row alone moves.
- inspection: MarkdownIncorrectTableFormatting
enabled: false
# It computes a heading's anchor its own way; the documents are read on GitHub, whose anchors these links follow
# (`#display-mode--both-tiers-beta10` for "Display mode — both tiers (beta.10)"), and tools/wiki-build.ps1 checks
# the links of every page it publishes. All three it reported resolve on GitHub.
- inspection: MarkdownUnresolvedHeaderReference
enabled: false
# A Windows application manifest: the linter has no schema for urn:schemas-microsoft-com:asm.v1 and reports every
# element of the file as undeclared.
- inspection: XmlHighlighting
ignore:
- "src/FrameLedger.App/app.manifest"
dotnet:
solution: FrameLedger.slnx
configuration: Release
# What is not FrameLedger's code, or not code at all - SonarQube.Analysis.xml's list, for its reasons - and what the
# other report reads.
exclude:
- name: All
paths:
- src/native
- src/FrameLedger.App/Strings.Designer.cs
- tests/fixtures
- legal/licenses
- docs/vendor-exports.json
- src/FrameLedger.Infrastructure/Persistence/Migrations
- build
- out
# JETBRAINS' SECURITY RULES (the OpenGrep plugin: pattern rules, several hundred of them) stay on, and the files
# their results were READ in are listed here - so a new file that starts a process, or builds an SQL text, is
# reported. Two rules fired, 36 times, on 2026-11-11: "a process is started with something that is not a literal"
# (35) - and starting processes is part of what FrameLedger is: the Agent beside the App, the game the user added,
# Explorer on a folder, the browser on a link - and the same for an SQL text (1: a constant field, every value a
# parameter). docs/13_CI_CD.md §Qodana has each place, what it starts and where that comes from.
#
# The name is the PLUGIN'S ONE INSPECTION, not a rule's: every rule's result is produced by OpenGrepInspection, and
# a rule's own id is honoured nowhere - not by `ignore`, not by an `exclude` path, not by `enabled: false` (three
# runs, 42932842462, 42935752891 and 42938295264: all 36 stood each time; the server is handed every rule file
# whatever the profile says). So a file listed here is left out of ALL of the plugin's rules, which is the price.
# ProcessStartSitesTests, in the gate, names the same files and fails on a new one.
- name: OpenGrepInspection
paths:
- src/FrameLedger.App/Services/AgentLauncher.cs
- src/FrameLedger.App/Services/AgentTool.cs
- src/FrameLedger.App/Services/Explorer.cs
- src/FrameLedger.App/Services/ShellStarter.cs
- src/FrameLedger.App/Services/ShellUrlOpener.cs
- src/FrameLedger.App/ViewModels/SettingsViewModel.cs
- src/FrameLedger.Infrastructure/Capture/ProcessLauncher.cs
- src/FrameLedger.Infrastructure/Diagnostics/CrashDumpWriter.cs
- src/FrameLedger.Infrastructure/Startup/AgentElevation.cs
- src/FrameLedger.Infrastructure/Startup/LogonTask.cs
- src/FrameLedger.Infrastructure/Persistence/SqliteSessionRepository.cs
# The tests start what they test - the harness, the Agent, a process to hold a handle on (24 of the 35).
- tests
# THE LINTER'S OWN FAULT, not the file's: resolving `PInvoke.EnumDisplaySettings(null, ...)` - the `null` to PCWSTR
# conversion - the engine of this linter's build (QDNET-262.12299) fails an internal assertion
# ("IsStandardImplicitConversionFromExpression(conversion.Kind)", in its log), loses the method, and reports its
# three locals and the file's three usings as unused. The compiler builds it with warnings as errors, and
# InspectCode 2026.2.3.1 and 2026.3.0 report nothing there. To be removed when a linter build reads the file.
- name: UnusedVariable.Compiler
paths:
- src/FrameLedger.Infrastructure/Recording/PrimaryDisplay.cs
- name: RedundantUsingDirective
paths:
- src/FrameLedger.Infrastructure/Recording/PrimaryDisplay.cs
# The gate: no problem at all. What the linter reports is settled where it is found - fixed, or its inspection
# switched off in .editorconfig with the reason beside it (InspectCode reads its severities there, and so does
# Rider) - so a count above zero is something new.
# switched off with the reason beside it - so a count above zero is something new.
failureConditions:
severityThresholds:
any: 0
+19 -1
View File
@@ -6,12 +6,30 @@ using System.Diagnostics;
namespace FrameLedger.App.Services;
/// <summary><see cref="IUrlOpener"/> through the shell (<c>UseShellExecute</c>), the same launch every other link in the App makes; a refusal is logged, never thrown.</summary>
/// <summary>
/// <see cref="IUrlOpener"/> through the shell (<c>UseShellExecute</c>), the same launch every other link in the App makes; a
/// refusal is logged, never thrown. The shell runs whatever it is handed - a <c>file:</c> address is a program - so this
/// opens web and mail links only, and says so itself rather than trusting each caller to have checked (2026-11-11: every
/// caller passes one of the project's own pages or a link <c>MarkdownLinks</c> has already held to these schemes).
/// </summary>
public sealed class ShellUrlOpener : IUrlOpener
{
/// <summary>Whether <paramref name="url"/> is a link the shell may be handed: absolute, and <c>http</c>, <c>https</c> or <c>mailto</c>.</summary>
public static bool IsOpenable(Uri url)
{
ArgumentNullException.ThrowIfNull(url);
return url.IsAbsoluteUri && url.Scheme is "https" or "http" or "mailto";
}
public bool Open(Uri url)
{
ArgumentNullException.ThrowIfNull(url);
if (!IsOpenable(url))
{
Serilog.Log.Warning("ui: not opened - {Url} is neither a web nor a mail link", url);
return false;
}
try
{
using Process? _ = Process.Start(new ProcessStartInfo(url.AbsoluteUri) { UseShellExecute = true });
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.App.Services;
namespace FrameLedger.App.Tests;
/// <summary>
/// The shell runs what it is handed, so the opener hands it web and mail links only - and decides that itself, whoever
/// calls it (2026-11-11, from Qodana's rule on every place that starts a process). Only the refusals are exercised:
/// accepting one would open the tester's browser.
/// </summary>
public sealed class ShellUrlOpenerTests
{
[Theory]
[InlineData("https://github.com/poli0981/frameledger", true)]
[InlineData("http://example.org/", true)]
[InlineData("mailto:contact@example.org", true)]
[InlineData("file:///C:/Windows/System32/calc.exe", false)]
[InlineData(@"C:\Windows\System32\calc.exe", false)]
[InlineData("steam://rungameid/1", false)]
[InlineData("ms-settings:display", false)]
[InlineData("javascript:alert(1)", false)]
public void OnlyWebAndMailLinksMayReachTheShell(string address, bool openable) =>
ShellUrlOpener.IsOpenable(new Uri(address)).Should().Be(openable);
[Fact]
public void ARelativeAddressIsNotOpenable() =>
ShellUrlOpener.IsOpenable(new Uri("docs/08_UI.md", UriKind.Relative)).Should().BeFalse();
[Theory]
[InlineData("file:///C:/Windows/System32/calc.exe")]
[InlineData("ms-settings:display")]
public void OpenRefusesWithoutStartingAnything(string address) =>
new ShellUrlOpener().Open(new Uri(address)).Should().BeFalse();
}
@@ -0,0 +1,70 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
namespace FrameLedger.Infrastructure.Tests;
/// <summary>
/// Every file in <c>src</c> that starts a process — or, the logon task, has Windows start one — by name (2026-11-11,
/// <c>docs/13_CI_CD.md</c> §Qodana). Qodana's rule for it — JetBrains' <c>csharp_injection_rule-CommandInjection</c>,
/// any <c>Process.Start</c> whose argument is not a literal — reported ten of these; each was read, and its file is
/// listed in <c>qodana.yaml</c>. That rule is a pattern in an advisory job. This sweep is the same tripwire in the
/// gate, and wider: it also sees <c>CreateProcessWithTokenW</c> and the logon task. A new file that starts a process
/// fails here until someone has read what it starts and where the path and the arguments come from, and added it to
/// the list — and to <c>qodana.yaml</c> and the table in that section, where each of these is described.
/// </summary>
public sealed class ProcessStartSitesTests
{
/// <summary>Read on 2026-11-11: what each starts, and from where, is the table in <c>13_CI_CD</c> §Qodana.</summary>
private static readonly string[] _read =
[
"FrameLedger.App/Services/AgentLauncher.cs",
"FrameLedger.App/Services/AgentTool.cs",
"FrameLedger.App/Services/Explorer.cs",
"FrameLedger.App/Services/ShellStarter.cs",
"FrameLedger.App/Services/ShellUrlOpener.cs",
"FrameLedger.App/ViewModels/SettingsViewModel.cs",
"FrameLedger.Infrastructure/Capture/ProcessLauncher.cs",
"FrameLedger.Infrastructure/Diagnostics/CrashDumpWriter.cs",
"FrameLedger.Infrastructure/Startup/AgentElevation.cs",
"FrameLedger.Infrastructure/Startup/LogonTask.cs",
"FrameLedger.Infrastructure/Startup/UnelevatedProcess.cs",
];
private static string RepoRoot()
{
string? dir = AppContext.BaseDirectory;
while (dir is not null && !File.Exists(Path.Combine(dir, "FrameLedger.slnx")))
{
dir = Path.GetDirectoryName(dir);
}
return dir ?? throw new InvalidOperationException("FrameLedger.slnx not found above the test binary");
}
private static bool StartsAProcess(string file)
{
string text = File.ReadAllText(file);
return text.Contains("Process.Start(", StringComparison.Ordinal)
|| text.Contains("new ProcessStartInfo", StringComparison.Ordinal)
|| text.Contains("PInvoke.CreateProcess", StringComparison.Ordinal)
|| text.Contains("RegisterTaskDefinition(", StringComparison.Ordinal);
}
[Fact]
public void EveryFileThatStartsAProcessIsOneThatWasRead()
{
string src = Path.Combine(RepoRoot(), "src");
string obj = $"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}";
string bin = $"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}";
string[] found = [.. Directory.EnumerateFiles(src, "*.cs", SearchOption.AllDirectories)
.Where(f => !f.Contains(obj, StringComparison.Ordinal) && !f.Contains(bin, StringComparison.Ordinal))
.Where(StartsAProcess)
.Select(f => Path.GetRelativePath(src, f).Replace('\\', '/'))
.Order(StringComparer.Ordinal)];
found.Should().Equal(_read,
"a file that starts a process is read first - what it starts, and where the path and the arguments come from - and then listed here and in docs/13_CI_CD.md §Qodana");
}
}
@@ -211,7 +211,7 @@ public sealed class PartialSessionFileTests : IDisposable
}
p.Should().NotBeNull($"cut at {cut}");
p.Truncated.Should().Be(cut != whole.Length && boundaries.Contains(cut) == false || (cut != whole.Length && cut < whole.Length && !boundaries.Contains(cut)),
p.Truncated.Should().Be(cut != whole.Length && !boundaries.Contains(cut),
$"cut at {cut}: mid-chunk is truncated, on a boundary is not");
// Everything before the cut that was complete is present; nothing after it is.
int recordsExpected = complete >= 3 ? 3 : 0;
@@ -492,12 +492,18 @@ public sealed class ShmDrainIntegrationTests
/// one site, on the far side of a returned verdict — a timer-shaped tick is what
/// <c>fl_shm.h</c> spends sixteen lines forbidding, and a loop-owned counter here
/// would be one.
/// <para>
/// <b>It supervises at least twice, whatever the first drain holds</b> (2026-11-11). The floor alone
/// ended the loop after one evaluation whenever the first scan was slow enough for fifty presents to
/// be waiting — a busy machine — and the caller's "supervised more than once" then failed on a run
/// in which nothing was wrong (seen once in a local gate: <c>CompletedEvaluations</c> was 1).
/// </para>
/// </remarks>
private static async Task DrainUnderSupervisionAsync(ShmRingReader reader, GuardSupervisor supervisor,
int pid, FlFrameRecord[] buffer, IList<ulong> gaps, List<FlFrameRecord> records, int floor)
{
DateTimeOffset until = DateTimeOffset.UtcNow + TimeSpan.FromSeconds(10);
while (records.Count <= floor && DateTimeOffset.UtcNow < until)
while ((records.Count <= floor || supervisor.CompletedEvaluations < 2) && DateTimeOffset.UtcNow < until)
{
bool mayContinue = await supervisor.ScanOnceAsync(pid, TestContext.Current.CancellationToken)
.ConfigureAwait(false);
+1 -1
View File
@@ -8,7 +8,7 @@ The full documents are [`docs/13_CI_CD.md`](../docs/13_CI_CD.md) and [`docs/11_U
|---|---|---|
| `.github/workflows/ci.yml` | pushes to `main` and `alpha`, pull requests | `./build.ps1 check`, and on a pull request the changelog check; then, in a job of its own, the SonarCloud analysis with the gate's coverage (settings: `SonarQube.Analysis.xml`). |
| `.github/workflows/codeql.yml` | pushes and pull requests to `main`, weekly | CodeQL for C#, C++ and the workflows themselves. |
| `.github/workflows/qodana.yml` | pushes and pull requests to `main`; by hand | Qodana Community for .NET (ReSharper's inspections) over the C# and the XAML; fails on any problem, and blocks nothing (settings: `qodana.yaml`, and `.editorconfig` for the inspections). |
| `.github/workflows/qodana.yml` | pushes and pull requests to `main`; by hand | Qodana for .NET (Rider's engine, on the Ultimate licence) over the C# and the XAML, the Markdown and XML around them, and JetBrains' security rules over the C#; fails on any problem, and blocks nothing (settings: `qodana.yaml`, and `.editorconfig` for the inspections). |
| `.github/workflows/rules-publish.yml` | a change to the detection rules or their validator | Fails when an anti-cheat entry is removed. |
| `.github/workflows/release.yml` | a pushed `v*` tag; by hand, a rehearsal | Builds, gates and publishes a release. |
| `.github/workflows/wiki.yml` | a successful release; by hand | Builds this wiki from `wiki/` and `guide/` and publishes it to the Wiki tab. |