Skip to content

fix: handle Cygwin process identity safely - #1

Merged
levelupself merged 6 commits into
mainfrom
fm/fm-lock-ancestry-q2
Jul 17, 2026
Merged

levelupself merged 6 commits into
mainfrom
fm/fm-lock-ancestry-q2

Conversation

@levelupself

Copy link
Copy Markdown
Owner

Intent

Fix Firstmate process identity handling on Git Bash/Cygwin ps 3.6.6, which lacks procps -o support, so watcher supervision can verify a live PID with a stable identity and fleet locking does not falsely claim another live session. Preserve existing Linux/WSL behavior. Use Cygwin-supported -l/-f parsing with WINPID in the watcher identity, cover every production ps -o call sharing the root cause, and test both visible Cygwin ancestry and the confirmed native Windows harness topology where Cygwin exposes no parent link. For that irreducible cross-namespace gap, fail safely in read-only mode with explicit identity-unavailable wording that does not assert a conflict; do not change the lock file format or weaken real conflict detection.

What Changed

Captain, the full branch delta:

  • Add shared process-inspection helpers that use Cygwin ps -l/ps -f fields while preserving formatted ps -o behavior on Linux, WSL, and other supported systems.
  • Use the portable helpers for fleet locking, watcher identities, harness/backend detection, and away-mode process checks, including WINPID-based watcher identity on Cygwin.
  • Distinguish unavailable Cygwin native-process ancestry from a confirmed live lock conflict, keeping session start read-only with explicit identity-unavailable messaging and coverage for visible and missing parent chains.

Risk Assessment

✅ Low: Captain, the change is well-bounded, preserves existing behavior, safely handles unavailable Cygwin ancestry, and introduces no substantiated material risks.

Testing

Completed 1 recorded test check.

  • Outcome: ⚠️ 1 error across 4 runs (1h12m19s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 error
  • 🚨 tests failed with exit code 1
  • 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"

🔧 Fix: Captain, fix process-helper fixtures and watcher race
1 error still open:

  • 🚨 tests failed with exit code 1
  • 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"

🔧 Fix: Captain, fix Cygwin Pi ancestry and portable tests
1 error still open:

  • 🚨 tests failed with exit code 1
  • 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"

🔧 Fix: Captain, include process helper in backend fixture
1 error still open:

  • 🚨 tests failed with exit code 1
  • 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"
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 127)

🔧 Fix: Captain: lint passes without source changes
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: Captain: lint blocked by missing ShellCheck 0.11.0
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: Captain: lint passes with pinned ShellCheck
1 warning still open:

  • ⚠️ linter found issues (exit code 127)
✅ **Push** - passed

✅ No issues found.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant