Skip to content

fix(session-lock): resolve harness identity when ps is denied (port of #7609) - #7845

Closed
kunchenguid wants to merge 1 commit into
mainfrom
fm/port-7609
Closed

kunchenguid wants to merge 1 commit into
mainfrom
fm/port-7609

Conversation

@kunchenguid

@kunchenguid kunchenguid commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Last-resort port of #7609

Speaking as Kun's firstmate: this carries @kesslerio's change from #7609 ("fix(session-lock): resolve harness identity when ps is denied"), resolved against main after #7746 (7da4c362). All credit for the change goes to @kesslerio, who is credited as co-author on the commit. We opened this port only because #7609 conflicts with main and the merge can't be pushed to the contributor's fork from our side.

What it carries (unchanged from #7609 head a4479244):

  • A ps-free process identity provider (/proc on Linux, bin/fm-procinfo.py on macOS), used only when ps cannot execute, failing closed with one diagnostic.
  • Session-lock reclaim in bin/fm-lock.sh, bin/fm-claude-stop-autoarm.sh and bin/fm-turnend-guard-cursor.sh goes through fm_session_lock_pid_blocks_reclaim, so a live owner whose identity can't be read blocks reclaim, and tagged win:<pid> owners still reach the fm_win_untag_pid / fm_win_command verdict.
  • Tests: tests/fm-session-lock-ps-denied.test.sh (new) and additions to tests/fm-session-lock-ancestry.test.sh.

Conflict resolution: the only conflict was the session-lock bullet in docs/watcher-continuity.md. It takes #7609's reclaim-rule bullet and keeps #7746's "unusable lock" wording on the next bullet. Every other file's change is byte-identical to #7609's diff. No .github/ files are touched.

Local checks on this commit: tests/fm-session-lock-ps-denied.test.sh ALL PASS (macOS-only cases skipped), tests/fm-session-lock-windows-consumers.test.sh passes, bin/fm-lint.sh passes. tests/fm-session-lock-ancestry.test.sh passes every session-lock case and stops at the pty-host reparenting case, the same environment-only stop #7609's body reports.

Related: #5238 (the original report).

…#7609)

Last-resort port of #7609 by @kesslerio, resolved against main after
#7746. Adds a ps-free process identity provider (/proc on Linux,
bin/fm-procinfo.py on macOS) used only when ps cannot execute, routes
session-lock reclaim through fm_session_lock_pid_blocks_reclaim so a
live owner whose identity cannot be read blocks reclaim, keeps tagged
win:<pid> owners on the fm_win_untag_pid/fm_win_command verdict, and
adds coverage in tests/fm-session-lock-ps-denied.test.sh and
tests/fm-session-lock-ancestry.test.sh.

Conflict resolution: docs/watcher-continuity.md takes #7609's
session-lock reclaim bullet and keeps #7746's wording elsewhere.

Co-authored-by: kesslerio <2647990+kesslerio@users.noreply.github.com>
@kunchenguid

Copy link
Copy Markdown
Owner Author

Speaking as Kun's firstmate: closing this port for now. CI showed the remaining failures come from #7609's current head, not the conflict resolution, so the work continues on #7609 with @kesslerio (details there). We'll re-port or resolve the conflict ourselves once #7609's head is green.

@kunchenguid
kunchenguid deleted the fm/port-7609 branch October 27, 2026 07:17
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