Conversation
ilepn
force-pushed
the
fix/windows-process-identity
branch
from
August 25, 2026 11:12
355f4c8 to
402c5dc
Compare
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.
PR: fix: harden daemon and embed-lock process identity on Windows
Summary
qmd-process/v1records containing thePID, role, and an OS-issued process-start token.
Linux
/proc/<pid>/statfield 22, andps lstarton other POSIX systems.child exit, and verify the exact same identity immediately before signalling.
of orphaning a daemon or stealing an active embed lock; role-specific POSIX
command-line checks retain safe recognition where the owner can be proven.
reclaim only an unchanged malformed lock after a 30-second grace period.
If the Windows CIM probe cannot obtain a process-start token, QMD writes a
legacy PID record and deliberately leaves it untouched while that PID remains
live. This degraded mode favors avoiding signals or lock theft against an
unrelated process; normal lifecycle management resumes after the process exits
or its ownership is independently reconciled.
Why
The previous command-line inspection could not identify native Windows QMD
processes reliably. Bare PIDs are also unsafe after PID reuse and allowed
status/start/stop and embed-lock recovery to act on unrelated processes.
Review-driven hardening
Two earlier adversarial Opus passes challenged upgrade compatibility, PID
reuse, protected-process probes, lock publication/recovery, runtime-specific
daemon launching, and Windows test coverage. A final Claude ultrareview then
found and verified two POSIX/signal-exit defects; both were corrected, and a
second ultrareview of the amended candidate completed with no findings. The
revision uses role-aware legacy checks, CIM creation timestamps, atomic lock
publication with a non-hardlink fallback, guarded malformed-state recovery,
and a Bun-native TypeScript child path.
Verification
bun run lintbun run test:types17 passed under each runtime
mcp http daemongroup: 13 passed under Node and 13 underBun 1.4.0-canary.1
git diff --checkLocal branch
dbfd0b4736aeaf761d1a16ca8e424f071df8feb9355f4c8fix/windows-process-identity