← Back to Pull requests

Run Kanzo natively on Windows #10

Closed
unknown closed this pull request without merging on Nov 01, 2026 09:20 UTC
View on GitHub
unknown unknown commented on Oct 30, 2026 03:46 UTC
Author

Summary

Kanzo runs natively on Windows (x64): installer, service, updates, browser.

 kanzo service install
   macOS   → LaunchAgent
   Linux   → systemd user unit
+  Windows → Task Scheduler logon task:
+            conhost --headless "kanzo.exe" --no-open --home "<dir>"
+            (your session: no window, no admin rights, git sign-ins work)

 kanzo update / update from the board
-  curl | sh, then exec the new program
+  Windows: rename kanzo.exe → kanzo.exe.<version>.old (Windows can't overwrite a running program)
+           run kanzo-installer.ps1, roll back if it fails
+           restart the task; a board started by hand asks the user to restart it
+           delete the .old programs at a later start

Why the task runs in the user's session behind conhost --headless:

  • An S4U task ("run whether logged on or not") needs an elevated shell, and can't read Windows Credential Manager, so sync over HTTPS fails.

  • A plain interactive task shows a console window.

  • schtasks /end stops only conhost, so the board exits when its console goes away (GetConsoleProcessList, checked once a second).
  • Other changes:

  • open_browser uses explorer <url>.

  • db_identity uses the database file's modified time. Windows has no inode, and NTFS keeps the creation time for a file replaced under the same name.

  • dist: the x86_64-pc-windows-msvc target, the powershell installer, and a windows-2025 runner. CI also tests on windows-latest. The README has the PowerShell installer and the zip.
  • Evidence

  • Before:

  • - kanzo service install → "kanzo service supports macOS and Linux".
    - The update called sh.
    - db_identity was always 0.
    - Releases had no Windows build.
  • After:

  • - CI: fmt, clippy -D warnings, and the tests pass on windows-latest, macOS and Ubuntu. New tests: task_quotes_paths (task XML escaping) and removes_only_old_programs (the .old cleanup keeps other files).
    - Release from a fork: a prerelease built kanzo-installer.ps1 and kanzo-x86_64-pc-windows-msvc.zip.
    - Windows 10, by hand: service install, restart, uninstall, kanzo update, the update from the board (service board and board started by hand), rollback after a failed installer, and the board exiting when its task ends.
    - Windows 11, by hand, as a normal (non-admin) user: the PowerShell installer, kanzo, kanzo service install, and sync from the service board over HTTPS to a Gitea repo with a saved git sign-in.

    Merge Danger

    Door: two-way

    Revert the PR. Windows users then remove the Kanzo task with kanzo service uninstall before they downgrade.

    Blast Radius: small

  • macOS and Linux: same behavior. update::install now shares one installer helper with Windows. open_browser picks the opener in one place.

  • Not tested on Windows:

  • - whether RestartOnFailure restarts the board after a crash (the task sees conhost, not kanzo.exe)
    - ARM64 Windows (runs the x64 build through emulation)
  • Install links: the README's Windows links work once a release with the new target is published.
  • Diff: 390 lines (+292 / -98) across 4 files Reviewer: emanuele-em Review duration: 3213m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 390 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.357
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.6% · Safe to merge
    18.6%