134 Commits
Author SHA1 Message Date
poli0981 d769d58770 Merge pull request #60: feat(catalog) — Devices, Backup & Recovery, Accounts; 37 new commands; 2.1.0
feat(catalog): Devices, Backup & Recovery, Accounts — 37 new commands; release 2.1.0
v2.1.0
2026-10-26 13:36:24 +07:00
poli0981andClaude Opus 5.5 e2bf8eb758 chore(release): 2.1.0
Moves the unreleased notes under 2.1.0 (with the new categories and
commands) and sets the dev-build version to 2.1.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:30:46 +07:00
poli0981andClaude Opus 5.5 225c6e632c docs: 298 commands in 15 categories
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:30:46 +07:00
poli0981andClaude Opus 5.5 a5f5e4b3c1 test(catalog): category list and order, per-build coverage, launcher arguments
- The 15 categories in order, with order values running from 1 without gaps
  (replaces the 12-category count and the Storage-only check).
- Every category has commands on Windows 10 22H2, 11 23H2 and 11 24H2,
  since the navigation pane hides commands for other builds.
- No two commands share a command line.
- explorer only opens settings URIs or shell folders, and control only
  Control Panel items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:30:46 +07:00
poli0981andClaude Opus 5.5 a8ca7f4a79 feat(catalog): Devices, Backup & Recovery and Accounts categories, 37 commands
Three new categories and 37 commands (261 -> 298), with titles and
descriptions in all five languages and Fluent icons:

- Devices & Peripherals (11): Bluetooth, printer and display settings,
  the Sound panel; USB devices, cameras, audio devices, paired Bluetooth
  devices, printers and remembered-but-disconnected devices; Scan for
  hardware changes (pnputil, admin).
- Backup & Recovery (9): Recovery settings, WinRE status and Enable WinRE
  (reagentc, admin; enabling is Caution), System Protection, restore
  point disk usage (vssadmin behind a Win32_ShadowStorage check, since it
  exits 2 for both "no items" and access denied), File History, Backup
  settings, Backup and Restore (Windows 7), Recovery Drive.
- Accounts & Sign-in (8): Sign-in options, Your info, Other users,
  netplwiz, Credential Manager, cmdkey /list (never elevated, so it reads
  the user's own vault), net accounts, local groups.
- Existing categories (9): sleep states, last wake source, wake-armed
  devices, motherboard, language & region, disabled services, PATH
  entries with missing folders flagged, proxy and VPN settings.

Scripts start with $ErrorActionPreference='Stop' and filter PnP devices
client-side (Get-PnpDevice -Class throws when nothing matches). No command
needs an OS-build limit; all exist on Home editions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:30:46 +07:00
poli0981 ab082676d6 Merge pull request #59: ci — SonarCloud CI analysis with coverage, .NET 10.0.14 and dependency updates
ci: SonarCloud CI analysis with coverage; .NET 10.0.14 and dependency updates
2026-10-26 13:27:52 +07:00
poli0981andClaude Opus 5.5 24fbf9ca23 docs(changelog): SonarCloud CI analysis, dependency and runtime updates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:17:45 +07:00
poli0981andClaude Opus 5.5 c61d397199 build(deps): .NET SDK 10.0.403, DI 10.0.14, CsWin32 0.3.367, CodeQL 4.39.1
- global.json: SDK 10.0.403, so self-contained releases ship the
  .NET 10.0.14 runtime (October 2026 security update).
- Microsoft.Extensions.DependencyInjection(.Abstractions) 10.0.13 -> 10.0.14.
- Microsoft.Windows.CsWin32 0.3.366 -> 0.3.367.
- github/codeql-action v4.39.0 -> v4.39.1 (CodeQL and Scorecard uploads),
  pinned to the release commit.
- THIRD-PARTY-NOTICES: the new versions and the SonarScanner for .NET.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:17:45 +07:00
poli0981andClaude Opus 5.5 3fadfa0090 ci: analyze with SonarCloud from CI, with test coverage
Automatic Analysis can't import coverage, so SonarCloud now runs from
sonarcloud.yml: the SonarScanner for .NET 12.0.0 (pinned as a local tool
next to vpk, updated by Dependabot's build-tooling group) wraps a Release
build and an OpenCover test run.

- A token job checks for SONAR_TOKEN, so fork and Dependabot pull
  requests are skipped without trusting actor or repository names.
- The project version is passed to the scanner, so the "previous version"
  new-code period resets at each release (and now, instead of judging the
  whole 2.0.0 rewrite as new code).
- Roslyn rules stay enforced by the warnings-as-errors build and aren't
  imported as external issues; XAML code-behind and the two Program.cs
  entry points are left out of coverage.
- .sonarcloud.properties (read only by Automatic Analysis) is removed;
  its exclusions move to the scanner arguments.
- CI failure alerts also cover the SonarCloud workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:17:37 +07:00
poli0981 acb7ca4dd5 Merge pull request #58: ci, docs — release-workflow fixes, pinned shared workflows, stale comments
ci, docs: release-workflow fixes, pinned shared workflows, stale comments
2026-10-21 23:19:31 +07:00
poli0981andClaude Opus 5.5 c729a53228 docs(changelog): unreleased run-mode label and release-asset changes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:14:17 +07:00
poli0981andClaude Opus 5.5 cae3679ffa fix(ui): say whether this copy updates itself, not "Portable / dev"
Settings > Advanced and Portable info showed "Installed" or
"Portable / dev". The official portable zip counts as installed
(it carries Velopack's updater), so "Portable / dev" only ever meant
a build run from source. The labels now read "Installed or portable
(updates itself)" and "Development build (doesn't update)", in all
five languages; the key is renamed to Settings_RunModeDev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:13:53 +07:00
poli0981andClaude Opus 5.5 cad4708852 docs: the portable zip updates itself
The Velopack portable zip ships Update.exe and a .portable marker, so
it updates in place like the installed app; only a build run from
source can't update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:12:11 +07:00
poli0981andClaude Opus 5.5 06731cdd0b chore: fix stale comments and the NuGet cache key
- ISettingsService: window size and maximized state are restored again
  since the window became resizable; WarnOnCancel only asks on close.
- IDialogService, CrashHandlingService, NaturalLanguageSearch (golden
  rule #7, not #5), the test project and pack.ps1 described the
  pre-2.0 setup (message boxes, the Generic Host, EN+VI only,
  Directory.Packages.props).
- build.yml hashed the removed Directory.Packages.props for its NuGet
  cache keys; it now hashes Directory.Build.props, where the
  SonarAnalyzer version lives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:12:10 +07:00
poli0981andClaude Opus 5.5 d71da598da ci(release): drop a stale comment about draft lookups
The VirusTotal action no longer looks up the release; the links step
uses gh, which finds drafts too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:08:18 +07:00
poli0981andClaude Opus 5.5 4daf4bbf39 ci(release): take the release notes from CHANGELOG.md
vpk creates the release without notes, so v2.0.0 was published, and
announced on Discord, with an empty body. Before publishing, the
workflow now sets the notes to the version's CHANGELOG section (the
text between its heading and the next one); it warns and leaves them
empty if there is no section. The VirusTotal links are appended after
it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:07:47 +07:00
poli0981andClaude Opus 5.5 ce0f905825 ci(release): add the VirusTotal links to the release notes
The action's update_release_body only works on `release` events, and
this workflow runs on tag pushes, so the scan links never reached the
notes: the v2.0.0 release body was empty. A step now appends a
"VirusTotal" section linking each scanned file's permanent report (by
SHA-256). The scan also no longer matches the previous version's full
package, which is only downloaded to compute the delta.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:05:21 +07:00
poli0981andClaude Opus 5.5 27816e92c6 ci(release): attest and hash only what the release publishes
The 2.0.0 release showed two gaps:

- Its provenance attestation also covered the 1.5.1 full package that
  `vpk download github` fetches only to compute the delta, which this
  run didn't build.
- checksums.txt listed that package and the local assets.win.json,
  neither of which is a release asset.

The portable zip that vpk also publishes had no attestation.

Now the attestation covers Setup.exe, the portable zip and this
version's packages only. checksums.txt hashes exactly the release's
assets plus the SBOM. UPDATES and RELEASING list the portable zip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:03:48 +07:00
poli0981andClaude Opus 5.5 af8948378a ci: pin the shared workflows in poli0981/.github to a commit
The release announcer and the CI-failure notifier were called at
@main, so any later change to the shared repository would run inside
this repository's workflows (the announcer inherits its secrets)
without a change here (CodeQL actions/unpinned-tag, Scorecard
Pinned-Dependencies). They now point at the current main commit; bump
the SHA when the shared workflows change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 22:58:57 +07:00
poli0981 05abfdfc4e Merge pull request #57: docs — 2.0.0 release notes, user guide, contact addresses
docs: 2.0.0 release notes, user guide, contact addresses
v2.0.0
2026-10-21 22:56:55 +07:00
poli0981 a5860a70f0 Merge pull request #56: v2 UI — Fluent redesign with WPF-UI 4.3
v2 UI: Fluent redesign with WPF-UI 4.3
2026-10-21 22:53:06 +07:00
poli0981andClaude Opus 5.5 d82f2d45e5 docs: 2.0.0 release notes, user guide, contact addresses
- CHANGELOG: the 2.0.0 entry, plus the missing 1.5.1 compare link and
  a corrected [Unreleased] link.
- USAGE.md: a user guide for the new UI (the app's "User guide" link
  already points here).
- README: features as of 2.0 (261 commands, 12 categories, five
  languages, Fluent UI), download verification with
  `gh attestation verify`, and a contact table.
- Contact addresses on poli0981.dev: security@ (SECURITY.md, next to
  private vulnerability reporting), privacy@ (PRIVACY.md), legal@ (EULA,
  DISCLAIMER), copyright@/dmca@/takedown@ (a new takedown section in
  DISCLAIMER), code@ (CONTRIBUTING, CODE_OF_CONDUCT, MAINTAINERS).
- SECURITY: the current threat model and its known limits (per-user
  install, the winget alias), release attestations, SBOM and scanners.
- PRIVACY: every local file the app keeps, what the logs contain, and
  how the update check and bug reports work.
- BUILD, RELEASING, UPDATES: versions in each .csproj, the pinned vpk
  tool, pack.ps1 options, the CI workflows and rulesets, signed tags,
  the draft-then-publish release flow, and the new update behavior.
- THIRD-PARTY-NOTICES: WPF-UI and Fluent System Icons in, Material
  Design and Hosting out, current versions and build-time tools.
- CONTRIBUTING and the PR template: signed commits, required checks,
  five .resx files, catalog rules. The bug template points at
  More > About.
- CLAUDE.md: rule 6 allows provenance attestations; stack, namespace
  and conventions for v2.

The EULA's terms are unchanged (still version 1.1), so nobody is asked
to accept them again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 22:49:29 +07:00
poli0981andClaude Opus 5.5 64ddbebde3 feat(ui): contact addresses in About
About lists security@poli0981.dev for vulnerability reports and
code@poli0981.dev for code questions; both open the mail app. The
addresses live in ProductLinks next to the other public links. New
strings in all five languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 22:48:25 +07:00
poli0981andClaude Opus 5.5 f7bbe53f96 feat(ui)!: Fluent redesign with WPF-UI 4.3
The app now follows Windows 11: Mica window with its own title bar, a
navigation pane, in-window dialogs, snackbars and the system accent color.
MaterialDesignThemes is gone.

- Shell: resizable FluentWindow (min 960x600) that remembers its size,
  position and maximized state. The title bar has a command search box
  (Ctrl+K), an admin-session indicator with "End admin session", and a More
  menu. The pane has Home, Favorites, History, Recipes, My commands and the
  catalog with its twelve categories and counts; the selection stays in sync
  with the view-model through NavigationKey.
- MainViewModel keeps the shell only; the catalog's browsing, filters,
  detail and run logic moved to CatalogViewModel. The catalog gets risk and
  admin-only filter chips, the estimated duration and an expanded command
  line in the detail panel, and a splitter between detail and console.
- One shared console for catalog, recipes and user commands: virtualized,
  batched, capped at 10,000 lines with a "N earlier lines" note, Copy all,
  Save to file, "Waiting for administrator permission…" status and Restart
  now (asks first, never while a command runs).
- Confirmation, update and bug-report dialogs are Fluent content dialogs;
  Cancel stays the default and Run appears for a Dangerous command only
  once its name or id is typed. The Legal Gate, terms viewer, crash dialog
  and command palette are Fluent windows; the Legal Gate lets you pick the
  language first.
- Theme: light, dark or system through ApplicationThemeManager, accent from
  Windows, High Contrast always wins. Font size scales every text and
  control live. Pages set the theme text color themselves (the navigation
  frame doesn't pass it down), and list text dims instead of recoloring so
  it stays readable on a selected row; search matches are bold and
  underlined.
- A finished run notifies with a snackbar (and flashes the taskbar button)
  when the console isn't visible; the taskbar shows progress while running.
- Catalog icons map to Fluent System Icons (IconMap), checked by a test.
- The presentation namespace is now CommandForge.Desktop: a namespace named
  CommandForge.Wpf hid WPF-UI's root namespace in XAML-generated code. The
  project, assembly and exe keep the name CommandForge.Wpf.
- IElevationService raises SessionChanged when the elevated helper starts or
  stops.
- Strings: about 45 new keys in all five languages; twelve unused keys
  removed. A test now scans the UI sources so every key the XAML or code
  uses must exist in every language.

BREAKING CHANGE: new look and layout; settings, history, recipes and user
commands carry over unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 22:26:42 +07:00
poli0981 0f2f2be5d4 Merge pull request #55: v2 core — hardened elevation, reliable execution and storage, catalog fixes + 20 commands
v2 core: hardened elevation, reliable execution and storage, catalog fixes + 20 commands
2026-10-21 22:04:57 +07:00
poli0981andClaude Opus 5.5 f781690b5f test: cover decoding, path resolution, elevation environment, storage
New tests for the output decoder (UTF-8, UTF-16LE with and without BOM,
OEM fallback, chunk boundaries), executable resolution, argument tokens,
the elevated child environment (including a real PowerShell run showing
it loads modules only from admin-only folders), crash-safe JSON files and
v1.5.1 settings, accent-insensitive search, recipe confirmations, the
update dialog, the console buffer and crash codes.

Run faults and cancellation must complete the output channel; elevation
tests have time limits; the DI test uses a scratch folder instead of the
real %AppData%; culture-switching tests run on their own; Domain and
Application may reference only the runtime (and Domain).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:21:25 +07:00
poli0981andClaude Opus 5.5 ee557ab532 perf(logging): refresh the Log Viewer once per burst, not per event
Every log event made the Log Viewer and Debug panel rebuild up to 1000
rows on the UI thread. The in-memory store now raises EntriesChanged once,
150 ms after the first event of a burst; Clear still notifies at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:21:25 +07:00
poli0981andClaude Opus 5.5 6d4843465a fix(catalog): reject contradictory or unsafe catalog records
A command is registered only after it passes validation, so a rejected
command can no longer be a revert target or shadow a valid duplicate, and
a revert that points at one is cleared. New checks: unknown argument
tokens, an executable that is not a plain program name, Caution or
Dangerous without confirmBeforeRun, Launch mode with an exit-code or
output restart policy, and a restartRegex under another policy. Invalid
embedded JSON yields an empty catalog plus an error instead of a crash.

The catalog tests also enforce -NoProfile -NonInteractive for PowerShell,
no wmic, no hard-coded C:, no %VAR% outside scripts, and that elevated
scripts read only the environment variables the Elevator sets from
trusted sources. DangerLevel documents what Safe, Caution and Dangerous
mean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:21:24 +07:00
poli0981andClaude Opus 5.5 23adc8ef6d feat(catalog): safer cleanup and repair commands, 20 new commands
Automatic Disk Cleanup now enables an allow-list of safe handlers in its
own StateFlags slot (/sagerun:42), so Downloads, the Recycle Bin and
Windows.old are never touched and the user's own /sageset:1 choice is
kept. Removing Windows.old uses the "Previous Installations" handler and
is now Dangerous, as is clearing the event logs.

- Every PowerShell command runs with -NoProfile -NonInteractive. Scripts
  that printed success no matter what now stop on the first error, and
  cleanups report what they removed and what was in use.
- chkdsk.fix uses Repair-Volume -OfflineScanAndFix instead of piping a
  "Y" that is localized; drive letters come from {SystemDrive} and the
  battery report path from {UserProfile}.
- Windows Update reset keeps the old folders as .bak copies and always
  restarts the services; the Delivery Optimization cache uses its cmdlet;
  lid-close settings apply to the active power scheme; winget never
  prompts; activation status no longer needs VBScript; the Win11 Widgets
  button opens Settings, since Windows now blocks that change from scripts.
- New: restore point list, System Restore, Automatic Maintenance, clock
  resync, DNS cache, listening ports, Wi-Fi details, third-party scheduled
  tasks, Run keys, stopped automatic services, Windows Search restart,
  Store and optional updates, UAC settings, Core isolation, environment
  variables, WSL status, TRIM status, crash dumps and battery charge, with
  strings in all five languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:21:24 +07:00
poli0981andClaude Opus 5.5 c205dd0589 fix(wpf): AltGr-safe shortcuts, UI-language-only switching, user-command fixes, dead code
- Keyboard shortcuts require exactly Ctrl: AltGr arrives as Ctrl+Alt, so typing "@" on a German
  keyboard (AltGr+Q) closed the app and a Polish "ł" opened the Log Viewer. Ctrl+B (advertised in
  the menu and the shortcuts list) now toggles the sidebar.
- Switching language changes only the UI culture: number/date formats keep following the user's
  regional settings. Every window is tagged with the UI language (xml:lang) so Japanese text is not
  drawn with Chinese glyph shapes.
- User commands: a quoted "cmd" executable is recognised, "/q /c dir" no longer gains a second /c,
  and a command named like a resource key ("AppTitle") is no longer translated into that resource.
  Confirmations go through the dialog service.
- Remove the unused ExecutableKind enum and IRestorePointService port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:44:50 +07:00
poli0981andClaude Opus 5.5 4349dddd43 fix(wpf): file/shell failures are reported, not crashes; imports are validated
- Settings, Log Viewer and Report Bug use the dialog/file/shell services: exporting logs or
  settings to a locked or read-only path, or opening a link with no browser configured, now shows
  a message instead of the generic crash dialog; file-dialog filters are localized.
- Imported settings files and profiles are normalized (null lists, unknown enum values, blank or
  duplicate favorites) before they are applied. PortableSettings properties are settable so keys
  missing from a file keep their defaults — the source-generated serializer reset init-only ones
  to false/0, which could silently turn off Caution confirmations.
- The prefilled "Report a bug" URL is capped (a full stack trace could exceed URL limits).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:41:45 +07:00
poli0981andClaude Opus 5.5 b204f48a0e fix(search): relevant matches, correct highlighting, accent-insensitive
- Descriptions and tags must contain the query words as real substrings (tags by word prefix);
  matching them as loose subsequences made "dns" hit ~140 of 241 commands.
- Titles rank exact > substring (word starts first) > all words present > fuzzy abbreviation, and
  the fuzzy matcher tries every starting point, so "flush" highlights the word "flush" instead of
  the first "f"/"l" it meets; weak scattered fuzzy matches are dropped.
- Accent- and case-insensitive throughout (TextFolding keeps indices 1:1 for highlighting): typing
  "don dep" finds "Dọn dẹp". Folded text is computed once per command, not per keystroke.
- Ties keep catalog order (stable sort); the "requires restart" filter means restart-always.
- Natural-language suggestions match whole words, so "ping" or "typing" no longer suggest battery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:39:07 +07:00
poli0981andClaude Opus 5.5 62d7178eab fix(updates): end the elevated session before applying; robust errors; X cancels the download
- Download and apply are separate steps: applying first ends the elevated session and waits for the
  Elevator to exit (it runs from the folder Velopack replaces, and the non-elevated updater can't
  kill it or overwrite its locked files), and a command started during the download postpones the
  restart instead of being killed halfway.
- UpdateErrorMapper.Map(Exception) looks through wrapper/aggregate exceptions for the HTTP status;
  HttpClient timeouts now map to Offline instead of being rethrown as cancellations (which left the
  dialog stuck on "Checking"). User cancellation is still distinguished.
- Closing the update dialog with its title-bar X cancels the download; otherwise it finished in the
  background and restarted the app, possibly mid-command.
- The startup prompt never opens over another dialog; the "command running" guard reads the shared
  ExecutionViewModel (now a singleton) instead of MainWindow.DataContext.
- Settings' "Last checked" only updates when a check actually succeeded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:36:20 +07:00
poli0981andClaude Opus 5.5 48fd03983f fix(safety): one set of confirmation/restore-point rules; recipes confirm every risky step
- RunSafety (Application) holds the rules for single runs, History re-runs, reverts and recipes:
  Dangerous always asks with typing; Caution asks unless turned off; a restore point is offered
  only for risky admin commands or catalog-flagged ones — never for per-user tweaks, where it
  only added a UAC prompt.
- Type-to-confirm accepts the title Unicode-normalized and case-insensitively, or the command id:
  Vietnamese input methods that type decomposed accents (and long CJK titles typed through an
  IME) could not confirm before. Run is a CanExecute gate in the view-model, Cancel is the
  default/Esc button, and the typing box gets focus.
- Recipes no longer run Dangerous steps after a single Yes/No: an overview prompt (No by default)
  is followed by the same confirmation each risky step gets on its own, and one restore point
  before the chain. Steps unavailable on this PC are kept when the recipe is saved again.
- Restore points: "Windows already made one in the last 24 hours" is reported as skipped (exit 2)
  instead of as created; any other failure asks before running the command anyway (No default).
- A run that does not start (already running, stopped at the restore point) is never recorded in
  Recent/History; History's Run again/Undo are disabled while a command runs; Clear asks first.
- Console output goes into an OutputBuffer: one notification per batch instead of per line,
  capped at 10,000 lines; an unexpected failure is reported in the console instead of crashing.
- Every run is logged as a one-line summary (id, exit code, duration — never its output).
- New IDialogService/IClipboardService/IShellService/IFileDialogService keep view-models free of
  MessageBox/Clipboard/Process calls (and testable); new strings in all five languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:32:38 +07:00
poli0981andClaude Opus 5.5 4a4e887134 fix(storage): atomic, corruption-tolerant, thread-safe local stores
All six JSON stores (config, history, recipes, profiles, user commands, settings import/export)
go through a shared JsonFile helper:
- Writes land in a temporary file that atomically replaces the original, so a crash or power loss
  mid-save can no longer truncate config.json (which silently reset every setting, including the
  accepted terms) or wipe history/recipes/profiles.
- A corrupt file is kept as name.corrupt-<timestamp>.json before defaults are used, instead of
  being overwritten on the next save; locked or unreadable files no longer crash startup.
- Background save failures are logged rather than thrown; a user-chosen export path still
  reports its error, and import files are never renamed.
- Every store serializes access with a lock and hands out copies, not its live list.
- config.json uses a source-generated serializer with the same PascalCase/enum-name format; loads
  repair null lists, unknown enum values and blank ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:23:01 +07:00
poli0981andClaude Opus 5.5 694d98388e fix(startup): custom entry point, no Generic Host, visible startup failures
- Program.Main runs VelopackApp.Build().Run() before WPF loads App.xaml (Velopack's own
  recommendation; vpk warned about OnStartup), then the single-instance check.
- The unused Generic Host (no hosted services, configuration or Microsoft.Extensions.Logging
  consumers) is replaced by a validated ServiceCollection; Microsoft.Extensions.Hosting and
  Serilog.Extensions.Hosting are dropped (~20 transitive packages).
- A startup failure now shows an error and exits instead of leaving an invisible process that held
  the single-instance mutex and silently swallowed every later launch; a malformed language code in
  config.json falls back to the system language.
- Serilog: 14 daily files of at most 10 MB (logs grew without bound before); flushed after the
  container is disposed so shutdown logging is kept.
- Second launches pass foreground rights to the running instance (AllowSetForegroundWindow) so it
  actually comes to the front instead of flashing in the taskbar.
- Crash handler: stable support codes (FNV-1a instead of the per-process randomized
  string.GetHashCode), a nested failure no longer closes the logger for the rest of the session,
  and the error dialog only takes an owner window that is visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:19:04 +07:00
poli0981andClaude Opus 5.5 81657aa058 fix(elevation): harden the broker and the Elevator
- Elevated children get an allow-listed environment rebuilt from trusted sources: per-user
  variables (COR_PROFILER/CORECLR_* DLL injection, PSModulePath module hijacking, windir/
  SystemRoot retargeting of recursive deletes) no longer reach commands run as administrator.
  PSModulePath is $PSHOME\Modules only, the one value Windows PowerShell 5.1 keeps as-is.
- Both ends verify the peer: the UI accepts only the Elevator process it launched
  (GetNamedPipeClientProcessId); the Elevator serves only CommandForge.Wpf.exe from its own folder
  (GetNamedPipeServerProcessId) and connects with Identification impersonation.
- The Elevator writes no files any more (an elevated append to the user-writable profile could be
  redirected with a junction); diagnostics go back to the UI's log as pipe Log messages.
- StartupHookSupport=false on the Elevator: DOTNET_STARTUP_HOOKS is ignored.
- Broker: cancelling while UAC/connecting returns Cancelled instead of throwing; a command that
  ignores a cancel for 10 s ends the session; pipe/JSON errors fail the run cleanly; the output
  channel is always completed.
- IElevationService: IsSessionActive and EndSessionAsync (needed before an update replaces the
  files the elevated process runs from) replace the unused IsElevationAvailable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:19:03 +07:00
poli0981andClaude Opus 5.5 37950a05ff feat(execution): trusted executable paths, encoding-aware output, kill-on-close job
- ExecutableResolver: catalog executables resolve to absolute paths in System32/Windows (and
  the winget alias), so CreateProcess never searches the per-user, user-writable app folder —
  a planted reg.exe/powershell.exe there would otherwise run elevated. Launch-mode commands now
  pin their working directory too.
- OutputDecoder: stdout/stderr are read as raw bytes and decoded per line (UTF-16LE when the
  stream is UTF-16, else strict UTF-8 with an OEM-code-page fallback). sfc/wsl output and every
  native tool on Vietnamese/Japanese/Chinese Windows used to show as mojibake. Lone \r (progress
  updates) still breaks lines.
- ProcessJob: captured commands join a kill-on-close job object, so closing or crashing the app
  can no longer leave a half-finished command running.
- ArgumentTokens ({SystemDrive}, {SystemRoot}, {UserProfile}) filled from SystemPaths, which reads
  the kernel-reported system directory, known folders and HKLM — never %SystemRoot%-style
  variables a standard user can redefine. The command preview shows the expanded values.
- Exit code 3010 always flags a restart; Launch commands honour RestartPolicy.Always; output is
  only captured (bounded) when a restart regex needs it. ExecutionResult.OutputLines is gone
  (nothing read it, and it held the entire output in memory).
- RunCommandUseCase always completes the output channel and maps cancellation, so a failing run
  can no longer leave the console waiting forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:19:03 +07:00
poli0981 d7f816c7c8 Merge pull request #54 from poli0981/claude/v2-foundation
build/ci: v2 foundation — dependency refresh, xUnit v3, NuGet audit, hardened CI, Sonar fixes
2026-10-21 20:16:39 +07:00
poli0981andClaude Opus 5.5 d2dcebc6dd ci: address review and SonarCloud findings in workflows
- release.yml: upload the Velopack release as a draft, attach SBOM + checksums, then publish
  (publishing is what makes installed copies auto-update); VirusTotal runs after publishing
  because the release-by-tag API cannot see drafts.
- notify-ci-failure.yml: filter on the triggering event (`push`) instead of the forgeable actor
  login (SonarCloud githubactions:S8232).
- scorecard.yml: top-level `contents: read` instead of `read-all` (githubactions:S8234).
- codeql.yml: build with -p:RunAnalyzers=false; Roslyn analyzers add nothing to the extraction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:02:41 +07:00
poli0981andClaude Opus 5.5 304693cfa0 build: keep package versions in each .csproj
GitHub's dependency graph reads NuGet versions from .csproj files but not from
Directory.Packages.props, so Central Package Management would have blinded Dependabot alerts,
dependency review and the release SBOM. Versions move back into the projects (same versions),
SonarAnalyzer.CSharp is now referenced from Directory.Build.props, and the xUnit v3 test
project declares OutputType Exe explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:02:41 +07:00
poli0981andClaude Opus 5.5 db35bd70af chore: remove the Vietnamese draft legal/ folder
legal/ held early drafts ("BẢN NHÁP", unfilled "[ĐIỀN NGÀY]" placeholders) that were superseded
by the English EULA.md, PRIVACY.md, DISCLAIMER.md and LICENSE at the repository root — the only
documents the in-app Legal Gate links to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:56:43 +07:00
poli0981andClaude Opus 5.5 66415bbd61 build(release): pin vpk as a local tool, ReadyToRun publish, native x64 Velopack helpers
- .config/dotnet-tools.json pins vpk 1.2.161 to match the Velopack library (CI previously installed
  whatever vpk was latest).
- pack.ps1: ReadyToRun publish for faster startup, fail fast on any non-zero exit code, verify
  the Elevator is in the publish folder, `-SkipPack` for publish-only runs, and `--runtime` so vpk
  bundles x64 Update/Setup helpers instead of defaulting to x86 (the update channel stays "win").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:56:43 +07:00
poli0981andClaude Opus 5.5 6157c53d55 ci: harden workflows; add packaging smoke test, CodeQL for Actions, dependency review, Scorecard
- Every action pinned to a full commit SHA; least-privilege permissions per job; concurrency
  groups and timeouts; secrets passed through env instead of being expanded inside run blocks.
- build.yml: NuGet cache, test results + coverage artifact, and a `package` job that publishes
  and packs with Velopack exactly like a release (catches a missing Elevator before tagging).
- codeql.yml: matrix over csharp (Windows, manual build) and actions.
- New dependency-review.yml (moderate+ vulnerabilities, GPLv3-compatible license allow-list) and
  scorecard.yml (OpenSSF Scorecard SARIF in code scanning).
- release.yml: pinned vpk via the tool manifest, build-provenance attestations, SPDX SBOM and
  checksums as release assets, and a direct call to the shared announcer (tag releases published
  with GITHUB_TOKEN never fired the `release` event, so Discord was never notified).
- notify-ci-failure.yml: grant actions: read (every run was a startup_failure) and skip
  Dependabot-triggered runs, which have no access to the webhook secret.
- dependabot.yml: grouped updates (Velopack + vpk move together), cooldown, labels, and .NET SDK
  (global.json) updates.
- .sonarcloud.properties for SonarCloud Automatic Analysis scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:56:42 +07:00
poli0981andClaude Opus 5.5 b4cbf68cce test: migrate the suite to xUnit v3
Pass TestContext.Current.CancellationToken to cancellable calls (xUnit1051), dispose pipes
asynchronously, drop null-forgiving operators that xUnit v3's nullability annotations make
redundant, and rename the ExecutionTests helper that shadowed the fake runner's RunAsync.
All 204 test cases pass under VSTest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:56:42 +07:00
poli0981andClaude Opus 5.5 3fc7f0edf2 fix: resolve SonarCloud and SonarAnalyzer findings
- UpdateViewModel: every check/download owns a disposed CancellationTokenSource that Close
  cancels; an unexpected exception now shows an error instead of leaving the dialog on "Checking".
- Regex calls (catalog validation, restart detection) run with a match timeout.
- Elevation: CancelAsync/DisposeAsync instead of the blocking variants; implementations declare
  the interface's default CancellationToken.
- SystemProcessRunner: drop the redundant blocking WaitForExit (WaitForExitAsync already drains
  redirected output); "Restart now" launches System32\shutdown.exe by absolute path.
- ProductLinks: one home for the repository/issue/license/user-guide URLs that were duplicated
  across five files (the dead wiki link now points at the user guide).
- Smaller rule fixes (readonly fields, LINQ filters, no empty loops, nested ternaries, static
  handlers); remove the unused LegalGateViewModel.TermsVersion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:56:27 +07:00
poli0981andClaude Opus 5.5 1f89545e30 build: central package management, NuGet audit, SonarAnalyzer, dependency refresh
- Directory.Packages.props: Central Package Management for every project; SonarAnalyzer.CSharp
  as a global analyzer so the build enforces the same rules as SonarCloud.
- Directory.Build.props: NuGet audit of direct + transitive packages (moderate+ advisories fail the
  build), deterministic CI paths, dev version 2.0.0.
- global.json: .NET SDK 10.0.402 (latest LTS feature band).
- Bumps: Microsoft.Extensions.* 10.0.13, Serilog 4.4.0, Velopack 1.2.161, CsWin32 0.3.366,
  Microsoft.NET.Test.Sdk 18.11.0, coverlet.collector 10.1.0, xunit 2.9.3 -> xunit.v3 4.0.2 (VSTest
  mode) + xunit.runner.visualstudio 4.0.1.
- The Elevator publish now inherits PublishReadyToRun from the app publish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:56:18 +07:00
poli0981 e2f001baf7 Merge pull request #47 from poli0981/claude/multiple-windows-app-launch-530c62
fix(wpf): enforce single instance (relaunch focuses existing window)
v1.5.1
2026-07-09 09:03:01 +07:00
poli0981andClaude Opus 4.8 c65a5aa021 fix(wpf): enforce single instance so relaunching focuses the existing window
Launching CommandForge.Wpf.exe repeatedly opened a new window each time
because there was no single-instance guard. Add SingleInstanceGuard (a
WPF-free Infrastructure primitive) that owns a session-scoped named mutex;
a later launch signals the primary via a named auto-reset event and exits,
and the primary restores + foregrounds its existing window.

- Guard is created right after VelopackApp.Build().Run() so install/update
  hook processes are never counted as a second instance.
- Activation marshals to the UI dispatcher; SetForegroundWindow beats the
  Windows foreground lock. MainWindow is NoResize so Normal fully restores it.
- Adds unit tests for primary/secondary detection, activation signalling and
  name reclamation; CHANGELOG updated for 1.5.1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 08:55:52 +07:00
poli0981 4d9e70e599 Merge pull request #46 from poli0981/claude/admin-commands-windows-diag-8c26c5
feat(catalog): +40 rare/OS-specific commands & fix TPM/Defender elevation (v1.5.0)
v1.5.0
2026-07-08 19:58:53 +07:00