fix(bin): let process ancestry outrank inherited env markers in harness detection - #2677
Open
karanmrn wants to merge 7 commits into
Open
fix(bin): let process ancestry outrank inherited env markers in harness detection#2677karanmrn wants to merge 7 commits into
karanmrn wants to merge 7 commits into
Conversation
…ss detection A codex primary that inherits CURSOR_AGENT/CURSOR_INVOKED_AS from the context that launched it detected as cursor and received the wrong supervision protocol, so nothing re-armed the watcher (observed live 2026-08-20). Ancestry is positional truth; markers are inheritable. Detect by the parent-chain walk first and keep the verified markers as the fallback when no harness ancestor is visible, preserving the cursor-before-claude ordering and the pi-signed refinement inside that fallback. Add FM_HARNESS_ANCESTRY_BOUNDARY as a test seam so suite verdicts cannot depend on the harness that runs the suite, add a behavioral regression test for the precedence, pin the marker-fallback cases in the existing suites with that seam, and make the calm-pi follow-up pane assertion wait for the settled pane instead of one early capture.
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
CURSOR_AGENT/CURSOR_INVOKED_ASfrom its launch context detected ascursorand received the wrong supervision protocol, so the watcher was never re-armed (observed live 2026-08-20).bin/fm-harness.sh detect_ownnow resolves process ancestry first; verified environment markers remain the fallback when no harness ancestor is visible. The cursor-before-claude ordering and the pi-signed refinement are preserved. Ancestry matches only exact verified executable identities (includingcodex-aarch64-aandkimi-code); substring, interpreter-argument, and path-component shapes never classify.FM_HARNESS_ANCESTRY_BOUNDARY=<pid>is a test seam that stops the ancestry walk, so suite verdicts cannot depend on the harness hosting the suite. A leak into a real session only degrades detection to the marker fallback.tests/fm-harness-detect.test.shpins the precedence, the exact-identity boundaries, and the fallback. Existing kimi/muse expectations updated; cursor, secondmate, and turnend-guard suites pinned with the seam and marker hygiene at controlled invocations.Validation