Windows support: full test suite, ConPTY, and cross-platform paths#13
Open
saadmanrafat wants to merge 1 commit into
Open
Windows support: full test suite, ConPTY, and cross-platform paths#13saadmanrafat wants to merge 1 commit into
saadmanrafat wants to merge 1 commit into
Conversation
Amends SRS §2.2 (Windows was build-only): the full test suite now runs on
windows-latest, and the CI matrix is {ubuntu, macos, windows} × {stable, MSRV}.
Path handling
- file_changes.path and file-change summaries are always /-separated
(rel_to_slash joins components), so recordings query and render
identically across platforms (DR-2). No production code hardcoded '/'
elsewhere; data-dir resolution already goes through `directories`
(Windows: %APPDATA%\halfhand\{data,config}).
- hh-core config test no longer assumes the platform data dir *ends* with
"halfhand" (on Windows it's ...\halfhand\data).
Permissions (NFR-4)
- 0600/0700 code was already #[cfg(unix)]-gated (blob.rs, store.rs); the
non-Unix store branch now propagates create_dir_all errors instead of
swallowing them, and docs/platforms.md documents the Windows ACL
reliance (%APPDATA% profile ACLs stand in for 0700).
ANSI
- hh enables Windows virtual terminal processing via
crossterm::ansi_support at recording start and gates colored output on
it (use_color/use_color_stderr), falling back to plain text where the
console can't do ANSI.
PTY / ConPTY tests
- fixture_agent gains behavior-identical .py and .ps1 variants; Windows
runs the Python variant through the shared end-to-end test plus a
dedicated PowerShell test, exercising portable-pty's ConPTY backend for
output capture, file-change capture, and exit-code propagation.
- New pty_probe.py + run_provides_a_real_conpty_to_the_child asserts the
child sees a real console geometry and ANSI passes through; the raw
stdin round-trip test stays Unix-only (ConPTY input semantics), tracked
in #12 and covered by a manual QA checklist.
- Platform helpers in tests: python()/python_available (python3 vs
python), true_argv() (no `true` on Windows).
Claude Code adapter
- slugify also maps ':' so C:\Users\me\proj → C--Users-me-proj (the
fallback cwd scan still catches any slug mismatch); unit tests use
typed PathBuf fixtures for Windows-style cwds, and projects_dir_under
makes the ~/.claude/projects shape testable without env mutation.
CI / MSRV
- test matrix: {ubuntu, macos, windows} × {stable, 1.75}; the MSRV leg is
a --locked build on exactly the Cargo.toml rust-version, with a guard
step that fails if the matrix pin and rust-version drift apart.
- Cargo.lock re-resolved MSRV-aware; lru held on 0.16 (0.17+ needs
edition-2024 tooling), ignore/globset/blake3/time and friends resolved
to 1.75-compatible releases. Verified locally: build clean on 1.75 for
Linux and Windows targets with -D warnings.
- clippy::result_large_err allowed at crate level (fires only on Windows
targets where error payloads cross the 128-byte budget).
Docs
- docs/platforms.md: per-platform support table, data-dir map, Windows
ACL note, honest ConPTY limitations with tracking issues #11 (resize
forwarding) and #12 (interactive stdin CI coverage); README, CHANGELOG,
and manual-qa updated to match.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QTAqG31TwmwyiGCixMsDPL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Elevates Windows from build-only to a fully supported platform (amends SRS §2.2). The full test suite now runs on Windows in CI, exercising portable-pty's ConPTY backend end-to-end. Recorded relative paths are now always
/-separated on every platform for cross-platform compatibility (DR-2). Adds comprehensive platform documentation and MSRV enforcement.Key Changes
Platform Support & CI
{ubuntu, macos, windows} × {stable, MSRV}with MSRV (1.75) enforced via a guard that prevents drift fromCargo.tomldocs/platforms.mddocumenting PTY backends, file locations, permission semantics, ConPTY limitations, and the Claude adapter's Windows behaviorCross-Platform Path Handling
file_changes.pathand event summaries now always use/separators on every platform via newrel_to_slash()function inhh-record/src/watcher.rspath LIKE 'target/%'works on Windows)slugify()now maps:to-for Windows drive letters (e.g.,C:\Users\me→C--Users-me)Windows PTY & Console
ansi_supported()check inhh/src/render.rsthat callscrossterm::ansi_support::supports_ansi()on Windows (enables virtual terminal processing as a side effect); Unix always returns true#[cfg(windows)]comment inhh-record/src/runner.rsexplaining ConPTY ANSI passthroughTest Fixtures & Helpers
hh/tests/cli.rs:python()→ returns"python"on Windows,"python3"on Unixtrue_argv()→ returns["cmd", "/C", "exit", "0"]on Windows,["true"]on Unixfixture_agent_argv()→ returns Python or PowerShell fixture on Windows, POSIX sh on Unixpython3_available()topython_available()for platform-agnostic namingfixture_agent.py— Python port offixture_agent.shfor Windows (terminal output + file write + exit 3)fixture_agent.ps1— PowerShell variant exercising ConPTY with a native Windows shellpty_probe.py— Proves ConPTY geometry visibility and ANSI passthrough (Windows counterpart tointeractive.sh)run_records_powershell_fixture_agent()(Windows-only) validating PowerShell fixture agentrun_provides_a_real_conpty_to_the_child()(Windows-only) validating ConPTY transparencyrun_provides_a_real_pty_to_the_child()now#[cfg(unix)]with clarified doc commentDependency & MSRV Management
Cargo.tomlworkspace now declaresrust-version = "1.75"with a comment explaining the policylruheld on 0.16 line (0.17+ requires edition-2024 tooling incompatible with MSRV)timeheld at 0.3.41 (0.3.47 fix for RUSTSEC-2026-0009 requires rustc 1.88); advisory ignored indeny.tomlwith exposure justification and revisit note tied to next MSRV bumpCargo.lockkept MSRV-compatiblehttps://claude.ai/code/session_01QTAqG31TwmwyiGCixMsDPL