Skip to content

Native Windows support (PowerShell/cmd) — tracking #43

Closed

Description

@sandstream

Today kit runs on macOS, Linux, and Windows via WSL2 / Git Bash / Docker (documented in docs/PLATFORM_SUPPORT.md). Native Windows (PowerShell/cmd, no POSIX shell) is not supported yet. This issue tracks the concrete blockers found in a compatibility audit so the work can be picked up incrementally.

The runtime is already cross-platform-careful: execFile with arg arrays (no shell), os.homedir() / %APPDATA% resolution, platform-routed start/open/xdg-open, and a win32 BitLocker branch in the disk-encryption check. The blockers are at the operational edges.

Hard blockers

  • Git hooks are POSIX shell scripts. src/hooks.ts writes #!/bin/sh hooks using date, stat -c/-f, rm. Rewrite as Node-based hooks (invoke node/kit directly) or emit .ps1/.cmd with conditional install.
  • which for tool resolution. src/utils/resolveTool.ts:23 shells out to which. Add a Windows path (where, or PATH/PATHEXT scan). mise which fast path already works.
  • tar for archive extraction. src/bumblebee.ts and src/triage-sandbox.ts call tar. Use a cross-platform extractor (Node tar lib) or gate on availability.
  • Secret-file permissions rely on POSIX mode bits. 0600/0700 via chmod/writeFile({mode}) for ~/.kit/memory.db, elevation.key, materialized .env.local are no-ops on NTFS. Apply Windows ACLs (icacls) or document the gap + warn at runtime on native Windows.
  • Build script is POSIX (package.json: rm -rf dist && tsc && chmod +x dist/cli.js). Use rimraf/a JS build runner and drop the chmod on Windows.

Soft / follow-up

  • Bumblebee binaries are released for linux/darwin only (resolveTarget returns null for win32). Either ship Windows builds or keep the scanner gated off on native Windows.
  • Windows CI. Add a windows-latest job so native support doesn't regress once implemented.
  • manage-bde requires elevation — non-admin runs silently skip the disk-encryption check (acceptable, but note it).

Acceptance

kit init / check / setup / context check run end-to-end in PowerShell on a clean Windows box, with hooks installed and secret files protected by ACLs, verified by a windows-latest CI job.

Reference: docs/PLATFORM_SUPPORT.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg

Activity

  1. sandstream commented on Jun 24, 2026

    @sandstream
    OwnerAuthor

    Checked off which for tool resolution: resolveToolBin now uses where on win32, which elsewhere (1.28.1, #108). Remaining hard blockers (POSIX git hooks, tar extraction, secret-file ACLs, build-script rm/chmod) + a windows-latest CI job need a Windows runner to implement + verify — leaving open for a Windows-equipped session.

  2. sandstream commented on Jun 24, 2026

    @sandstream
    OwnerAuthor

    First real windows-latest probe run (CI workflow now valid + on main):

    • ✅ npm ci works
    • ✅ Build works on native Windows — the cross-platform build script (rimraf→fs.rmSync, chmod→win32-noop node script; 1.28.2) is verified. Build blocker cleared.
    • ❌ Unit tests fail (fast, at startup) — this is the next layer (runtime blockers: POSIX git hooks, tar, secret-file ACLs, path handling surfaced via the suite). The specific failures aren't capturable from gh's truncated CI logs — needs Windows-side diagnosis (a real box or richer log capture) to fix verify-driven without guessing.

    Shipped so far for #43: which→where tool resolution (1.28.1) + cross-platform build (1.28.2, Windows-verified) + the windows-latest probe workflow itself. The probe is the verify-loop foundation; the remaining runtime blockers need readable Windows test output to fix responsibly.

  3. sandstream commented on Jun 24, 2026

    @sandstream
    OwnerAuthor

    Windows status after 1.29.1: builds ✓, 1526/1542 unit tests pass (99%)

    Verify-loop built (windows-latest probe + downloadable test-log artifact). Fixed: which→where (1.28.1), cross-platform build (1.28.2), no-dep test runner + os.devNull (1.29.1). The suite now runs on Windows.

    Remaining 15 failures — categorized work-list

    A. POSIX-path / startsWith("/") assumptions (mostly TEST fixes, tractable):

    • resolveToolBin test — asserts paths start with / (Windows: D:\…)
    • mise-path helpers — miseShimsDir/activationLine assume POSIX ~/.local/share/...
    • memoryDirInsideRepo — path-prefix comparison with /
    • loadPluginAdapters — likely file:// URL / path separators
    • cloneRepository — .kit.toml presence / readable-dir path checks

    B. chmod / 0o600 permission semantics (needs a DECISION):

    • installHooks ("makes hook files executable"), memory hook installer, mcp-orchestrator token store ("token file is chmod 0o600"), ensureBumblebee sidecar
    • On NTFS, POSIX mode bits are no-ops. Decision: apply Windows ACLs (icacls) for the secret files (memory.db, elevation.key, tokens) or accept-and-warn the gap on native Windows. This is the substantive call — recommend documenting the gap + a runtime warning first, ACLs as a hardening follow-up.

    Category A is mechanical (platform-aware path handling/assertions). Category B is the real security-semantics decision. Both now have a real windows-latest runner to verify against.

  4. sandstream commented on Jun 24, 2026

    @sandstream
    OwnerAuthor

    Windows ACLs shipped (1.30.0) — perms half of #43 done

    secure-perms (icacls on win32) now protects memory.db, mcp-tokens, elevation.key, totp-secret. POSIX unchanged.

    Precise map of the remaining 15 (exact locations, categorized)

    Real path/handling fixes:

    • clone.test.js:70 (detect .kit.toml) + :156 (readable dir, ENOENT README) — clone path handling on Windows
    • memoryDirInsideRepo — path-prefix compare with /
    • mise-path helpers (miseShimsDir/activationLine) — POSIX ~/.local/share/... assumption
    • loadPluginAdapters — file:// URL / separators
    • resolveToolBin test — asserts paths start with /

    Accept-the-gap on Windows (feature genuinely unavailable → skip-on-win32):

    • bumblebee.test.js:196/207/218 — returns unsupported (no win32 bumblebee binary; resolveTarget is null for win32). Expected — skip these on win32 (or ship a win build).
    • check-disk-encryption.test.js:28 — BitLocker state on the runner; make platform-aware.

    Perm-test mode-bit assertions (now that ACLs are the win32 mechanism):

    • hooks.test.js:81 (executable bit — no-op on NTFS), mcp-orchestrator token store ("chmod 0o600"), memory hook installer — assert via the new secure-perms semantics on win32 instead of POSIX mode bits.

    Each is now pin-pointed + the windows-latest probe (+ test-log artifact) verifies fixes. This is a focused port with a couple of accept-the-gap judgment calls (bumblebee/BitLocker) — best done deliberately.

  5. sandstream commented on Jun 27, 2026

    @sandstream
    OwnerAuthor

    Status audit — most hard blockers are already resolved

    Re-checked each blocker against current main:

    Blocker Status
    Build script POSIX (rm -rf/chmod) ✅ resolved — build uses node scripts/clean-dist.mjs + scripts/chmod-cli.mjs (win32-guarded chmodSync)
    which for tool resolution ✅ resolved — resolveTool.ts: process.platform === "win32" ? "where" : "which"
    Secret-file POSIX mode bits ✅ resolved — src/utils/secure-perms.ts has an icacls /inheritance:r /grant:r branch for file (:F) and dir ((OI)(CI)F) on win32
    Bumblebee linux/darwin-only ✅ resolved — resolveTarget returns null on win32 (scanner gated off, not a crash)
    Windows CI ✅ present — .github/workflows/windows.yml (windows-latest) runs kit --version + kit check --category security

    Genuine remainders (need a real Windows runner to verify — won't blind-ship)

    • Git hooks are POSIX shell scripts (src/hooks.ts writes #!/bin/sh using date, stat -c/-f, rm). The real hard blocker. Needs a Node-based hook rewrite (or .ps1/.cmd emission) and a Windows job that actually installs + fires the hooks to verify — not safely doable from a Linux-only environment.
    • tar flags in triage-sandbox.ts use GNU-style --no-same-owner --no-same-permissions; Windows' bundled bsdtar (tar.exe) may reject them. Needs win32 verification (bumblebee's tar is already win32-gated off).

    Per kit's verify-before-claim discipline, I'm not rewriting the hooks blind — shipping unverifiable Windows hooks is worse than an honest open item. Narrowing this issue to the two remainders above; the acceptance criterion still stands (kit init/check/setup end-to-end in PowerShell, hooks installed, verified by the windows-latest job — which should be extended to exercise kit hooks once the rewrite lands).


    Generated by Claude Code

  6. sandstream commented on Jul 1, 2026

    @sandstream
    OwnerAuthor

    Native Windows shipped in 2.1 — PLATFORM_SUPPORT.md: build+test green on windows-latest. Residual graceful-degrade gaps tracked separately if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplatformwindows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions