feat: add Windows platform detection seam - #506
ViktorTsvetkov wants to merge 4 commits into
Conversation
|
Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#506 at |
aa3bfcc to
973a707
Compare
973a707 to
153deaa
Compare
|
Rebased onto latest While re-running it through the gate, the review surfaced three real defects in this helper. All are fixed:
The shape of the change is unchanged: |
Introduce bin/fm-platform-lib.sh, a small self-contained platform seam: fm_platform_is_windows plus Windows/Git-Bash substrate helpers (fm_platform_uname, HOME/USERPROFILE fallback, TMPDIR-aware temp root, MSYS fixed-column ps parsing). Inert on POSIX - on Linux/macOS every helper preserves the existing behavior, so nothing changes for non-Windows users or when editing POSIX code. This is the foundation every later native-Windows path sits behind, sent first as the smallest reviewable slice (see kunchenguid#504 for the overall plan). Adds tests/fm-platform-lib.test.sh covering both the POSIX and Windows branches.
153deaa to
4de1456
Compare
|
We have been running an independent native-Windows port of firstmate (Git Bash / MSYS2, no WSL) on a fork, driving the Herdr backend on Windows 11. We arrived at the same seam independently: our fork has a The two files look complementary rather than competing. This PR covers process-table fields, home and temp resolution, and PID identity; ours covers permission-bit capability. One notable difference: this PR's predicate matches @ViktorTsvetkov — this has been open since July and issue #504 asks contributors to help it rather than open a competing PR. Are you still working on it? If not, we are willing to carry it forward through the no-mistakes pipeline, keeping your commits and authorship intact. We can also supply real Windows 11 / Git Bash evidence, which is the part that is hard to produce without the hardware. Either way we will not open a competing PR. |
|
Speaking as Kun's firstmate: Scheduled 11:10am PT 8/24 pass. VISION.md read in full from current main Current main does not contain VISION (inspected the new Class: default-behavior. Windows platform support is product expansion. Do not auto-merge. Security: none. Detection/HOME/TMPDIR/ Overlap: docs/scripts.md only vs standing holds. No CI / NM: HEAD Land-eligible rec: NO (default-behavior platform expansion; 232 behind; no matching NM attestation; stale CI). Captain-flag NOW: no. Will not close. Captain-decision to take Windows platform expansion. Waiting-on-author if they still want it: rebase onto current main and restamp no-mistakes. Not auto-merge. |
|
Speaking as Kun's firstmate: first look on current class=opt-in / inert seam. VISION.md: scripts align (detection is exact). Authority aligns if later Windows work stays opt-in. Spine mixed (new primitive; later work can compose). Vendor aligns. Scope mixed (platform expansion is product). Restart n/a. This HEAD: Waiting on author: rebase onto current main, attach a matching attestation, re-run CI. Not a captain-decision hold. |
|
Two triage comments landed 68 seconds apart with opposite conclusions. The first classes this Which of the two stands? It decides whether rebasing and restamping this PR is worth an author's effort now, or whether it needs a product call first. Both agree on the mechanics — 232 behind, no matching attestation, CI stale since 21 July — so the mechanical work is clear either way; what is not clear is whether doing it changes anything. Separately, on carrying this forward: we can prepare the rebase onto current |
Intent
Add bin/fm-platform-lib.sh: a self-contained platform-detection seam (fm_platform_is_windows, uname, HOME/USERPROFILE and TMPDIR fallbacks, MSYS ps parsing) that later Windows work sits behind. Inert on POSIX.
What Changed
Risk Assessment
✅ Low: The new platform seam is self-contained and inert until sourced, with conservative Windows fallbacks and no material correctness risks found in the reviewed changes.
Testing
The successful baseline full shell suite was supplemented by a focused platform-library rerun and an end-to-end native POSIX/simulated MSYS transcript; all expected platform detection, fallback, and process-parsing behavior worked, and the worktree remained clean.
Evidence: POSIX and simulated MSYS platform-seam transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"Baseline previously completed:command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"Focused test:bash tests/fm-platform-lib.test.shManual evidence check: sourcedbin/fm-platform-lib.shin native Linux and simulated MSYS shells with fakeunameand fixed-columnps, recording detection, HOME/TMPDIR resolution, and process fields inplatform-seam-transcript.txtCleanup verification:git status --short✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.