chore: adopt the KofTwentyTwo standards #2

Merged
KofTwentyTwo merged 11 commits from chore/adopt-k22-standards into main 2026-10-09 19:43:18 +00:00
11 Commits
Author SHA1 Message Date
james.maesandClaude Opus 5.5 c287cf191e ci: pin shared workflows to the merged standards commit
KofTwentyTwo/standards#3 merged as ae3df7a; the previous pins pointed at a
pre-rebase branch commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 14:36:56 -05:00
james.maesandClaude Opus 5.5 38629e23f3 ci: repin shared .NET workflows to the fixed standards commit
KofTwentyTwo/standards#3 now keeps MSBuild-colliding environment variables out of
dotnet steps and builds before the format check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:50 -05:00
james.maesandClaude Opus 5.5 6b48d1ec87 ci: document job permissions and serialize releases
Clears zizmor's pedantic findings: each granted permission says why it is
needed, and release runs are serialized and never cancelled mid-publish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:44 -05:00
james.maesandClaude Opus 5.5 44d84280d0 ci: run OpenSSF Scorecard weekly and on pushes to main
K22-CI-24: publishes the Scorecard results that the README badge shows and
uploads them to code scanning. Copied unchanged from the standards template;
Scorecard's publishing API requires exactly this workflow shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:43 -05:00
james.maesandClaude Opus 5.5 10bcebb98e docs: adopt the KofTwentyTwo repository standard
- README: tier and standards status, install via NuGet, usage, building from
  source, release verification (checksums and attestations), support policy,
  Scorecard badge (K22-REPO-02, -11, K22-REL-21).
- CONTRIBUTING: GitHub Flow to main (no dev branch), Conventional Commits,
  signed and DCO-signed-off commits, the exact local commands and the checks
  that gate a merge (K22-REPO-07).
- SECURITY: private reporting, security contact, response and fix timeframes,
  supported versions (K22-REPO-06, K22-REL-20).
- docs/security/threat-model.md: AppKit's interfaces and STRIDE threats
  (K22-SDLC-03).
- docs/adr/: code-built UI, Velopack in its own package, coverage scope
  (K22-SDLC-02).
- docs/RELEASING.md: tags from main, the shared release workflow, nuget.org
  trusted publishing setup.
- .github: CODEOWNERS, pull request template, issue forms from the standards
  templates; CLAUDE.md updated to the new rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:42 -05:00
james.maesandClaude Opus 5.5 6b92ab4d12 ci: call the shared KofTwentyTwo/standards workflows
Replaces the repository's own workflows with callers of the reusable
workflows in KofTwentyTwo/standards, each pinned by full commit SHA
(K22-CI-11):

- pr-gates.yml: Conventional Commit title, DCO sign-off, dependency review.
- security.yml: gitleaks over full history, Trivy and OSV-Scanner over the
  lock files, zizmor and actionlint (PRs, main, weekly).
- codeql.yml: security-extended CodeQL for C# (manual x64 build) and Actions.
- ci.yml: locked restore, zero-warning build, unit tests with the 100%
  coverage gate, pack, format gate, and the FlaUI UI tests.
- release.yml: the shared NuGet release workflow (SBOMs, SHA256SUMS, build
  provenance, immutable GitHub release) plus the publish job that must live
  here for nuget.org trusted publishing.
- dependabot.yml: weekly grouped updates for NuGet and GitHub Actions with a
  cooldown, targeting main.

dotnet.yml and release-nuget.yml are pinned to the feat/dotnet-workflows
branch of KofTwentyTwo/standards until that pull request merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:41 -05:00
james.maesandClaude Opus 5.5 20c95cffaa refactor: fix analyzer findings and add header comments
Fixes every finding the new quality gate reports, without changing behavior:

- One type per file (MA0048): AppBrand, Attribution, NullActivityLog,
  LogSnapshot, ISanitizable, AppTheme, UpdateCheckResult, UpdateText,
  IUpdateBackend, ContentDialogPrompter, WindowExtensions, MessageBoxPrompter,
  and the samples' SampleSettings/SampleSettingsContext get their own files
  (the samples now link samples/Shared/*.cs).
- Regex match timeouts on the two generated regexes (MA0009).
- AppInfo.Id reports nameof(value) as the parameter (MA0015); test updated.
- Splash dismissal is a named DismissAfterAsync started through the
  dispatcher (MA0147, MA0134), and the WinUI splash constructor is split into
  builders (MA0051). The WPF countdown must go through the dispatcher: the
  sample builds its window before Application.Run, when no synchronization
  context exists.
- The WinUI sample's startup update check is a named method (MA0147).
- CA1859 in BrandTool and the version tests; private static readonly fields
  renamed to s_camelCase (IDE1006).
- A header comment on every type and method (K22-CODE-09/CS-04): hand-written
  for library, sample, and tool code; test methods summarize their
  Subject_Behavior names.

Verified: zero-warning x64 build, 115 unit tests with 100% line coverage of
KofTwentyTwo.AppKit and KofTwentyTwo.AppKit.Updates, 12 UI tests, and
dotnet format --verify-no-changes --severity warn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:40 -05:00
james.maesandClaude Opus 5.5 44fe822201 docs: add SPDX license headers to every C# file
K22-CODE-24: every source file starts with a copyright line and an SPDX
license identifier, the same header the KofTwentyTwo IntelliJ copyright
profile inserts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:39 -05:00
james.maesandClaude Opus 5.5 9d4a21cb99 style: apply the Kingsrook layout and LF line endings
Formatting only, no behavior change. Produced mechanically:

- dotnet format on the solution (3-space indent, Allman braces, `if(`,
  usings, `var`, System.Threading.Lock); the linked samples/Shared file is
  formatted through one project, because formatting it through both writes
  conflict markers into it.
- Kingsrook blank lines the .NET formatter cannot express (K22-CODE-06,
  K22-CODE-CS-03): three blank lines around methods, constructors, types, and
  multi-line properties; at most one blank line inside code blocks and between
  single-line members; two after the using list. Applied with a Roslyn rewriter
  equivalent to Rider's resharper_blank_lines_* keys.
- XML-family files (.csproj, .props, .slnx, .xaml, manifests, .runsettings)
  re-indented to three spaces.
- git add --renormalize: every text file is stored with LF.

Listed in .git-blame-ignore-revs so git blame skips it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:38 -05:00
james.maesandClaude Opus 5.5 5006a8c822 build: adopt the KofTwentyTwo .NET quality gate and lock files
Brings in the standards' configs/dotnet files (K22-CODE-CS-01, -08):

- .editorconfig: Kingsrook layout (3-space indent, Allman braces, no space
  after control keywords), naming rules and code-style rules at build-failing
  severity, plus the AppKit samples' XAML-handler relaxations.
- .gitattributes: LF line endings everywhere (K22-CODE-07).
- Directory.Build.props: analyzers, warnings as errors, documentation file for
  IDE0005, deterministic builds, NuGetAudit mode all, lock files, and locked
  restore on CI; AppKit's version and package metadata kept.
- Directory.Packages.props: Meziantou.Analyzer and transitive pinning.
- packages.lock.json for every project (locked restore verified for x64 and
  ARM64).

The code is reformatted and the new analyzer findings are fixed in the
following commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:37 -05:00
james.maesandClaude Opus 5.5 43a5929237 CI: run test projects at their AnyCPU output path
Passing -p:Platform=x64 to a test project made dotnet test look under
bin\x64, but the x64 solution build maps test projects to AnyCPU (bin\Debug).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-09 10:23:36 -05:00