Skip to content

fix(bin): Cursor-Park unter Pi-Host ohne Cursor-Identität stilllegen - #3115

Merged
kunchenguid merged 4 commits into
kunchenguid:mainfrom
thelad-dev:fm/cursor-park-pi-standdown-20260826
Aug 26, 2026
Merged

kunchenguid merged 4 commits into
kunchenguid:mainfrom
thelad-dev:fm/cursor-park-pi-standdown-20260826

Conversation

@thelad-dev

@thelad-dev thelad-dev commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Ship the Cursor-park stand-down so Pi+pi-cursor-sdk sessions stop dual-watching. Stand-down only when PI_CODING_AGENT=true AND neither CURSOR_AGENT nor CURSOR_INVOKED_AS is set (Pi host with no Cursor identity). If either Cursor identity marker is present, park despite a leaked PI_CODING_AGENT (hand-started native cursor-agent). Keep regression: PI=true without Cursor identity is inert; PI=true with CURSOR_AGENT or CURSOR_INVOKED_AS still parks. fm-spawn clears PI; hand-started may inherit. Push only via fork/no-mistakes target never origin. PR against kunchenguid/firstmate. Gate agent stays pi + cursor/default (not agent: cursor).

What Changed

  • bin/fm-turnend-guard-cursor.sh legt den Cursor-Park still (Exit 0 ohne Arm), wenn PI_CODING_AGENT=true und weder CURSOR_AGENT noch CURSOR_INVOKED_AS gesetzt sind, damit Pi+pi-cursor-sdk-Sessions nicht gegen fm_watch_arm_pi dual-watchen.
  • Bei gesetzter Cursor-Identität bleibt der Park aktiv, auch wenn PI_CODING_AGENT durchsickert (handgestarteter cursor-agent).
  • Docs (turnend-guard, Cursor-Protokoll, Watcher-Kontinuität) und tests/fm-cursor-primary.test.sh decken Stand-down sowie Leak-mit-Identität ab und räumen PI_CODING_AGENT in bestehenden Park-Fixtures.

Risk Assessment

✅ Low: Bounded early exit matches the required PI-without-Cursor-identity stand-down and PI-with-Cursor-identity park carve-out, with behavioral regression coverage and no remaining source-verifiable dual-watch path under those criteria.

Testing

Ran the full Cursor primary suite plus a filtered Pi stand-down pair, then reproduced the four stop-hook env cases end-to-end (empty follow-up / no arm for Pi-only; watcher follow-up + arm when Cursor identity is present or PI is absent) and confirmed fm-spawn’s cursor launch clears PI_CODING_AGENT; all targeted checks passed.

Evidence: Full fm-cursor-primary suite log
ok - fm-turnend-guard: Cursor payload is inert without --cursor and blocks with it
ok - fm-turnend-guard: a non-Cursor payload keeps blocking
ok - fm-claude-stop-autoarm: inert on a Cursor-delivered payload
ok - fm-sessionstart-run: inert on a Cursor payload, unchanged otherwise
ok - fm-arm-pretool-check: Cursor duplicate allows, --cursor denies in Cursor's own shape
ok - fm-cd-pretool-check: Cursor duplicate allows, --cursor denies in Cursor's own shape
ok - cursor park: silent no-op when no supervision is needed
ok - cursor park: an actionable close is delivered as one watcher-kind follow-up
ok - cursor park: always exits 0, even when supervision is genuinely down
ok - cursor park: the repair nag is bounded and then goes quiet
ok - cursor park: a repair nag is emitted only after its budget persists
ok - cursor park: a delivered wake resets the bounded repair budget
ok - cursor park: the loop_count ceiling warns exactly once, then stops the loop
ok - cursor park: an older park stands down after a newer stop claim
ok - cursor park: the newest stop exclusively owns a concurrent commit
ok - cursor park: a superseded park cannot consume repair budget
ok - cursor park: inert while away mode is active
ok - cursor park: inert when PI_CODING_AGENT marks a Pi host session
ok - cursor park: parks when PI_CODING_AGENT leaks alongside Cursor identity
ok - cursor park: an away-mode transition wins before follow-up commit
ok - cursor park: inert when this session does not hold the home lock
ok - cursor park: session takeover stops polling without output or state mutation
ok - cursor park: inert inside a child crewmate worktree
ok - cursor park: malformed payloads fail open without arming
ok - fm-sessionstart-cursor: sessionStart injects context
ok - fm-sessionstart-cursor: silent inside a child crewmate worktree
ok - cursor registration: covers every primary event with a bounded stop loop
ok - cursor bounds nest: firstmate's default ceiling stops the loop before Cursor's loop_limit does
Evidence: Filtered Pi stand-down suite transcript

ok - cursor park: inert when PI_CODING_AGENT marks a Pi host session ok - cursor park: parks when PI_CODING_AGENT leaks alongside Cursor identity EXIT:0

=== Filtered suite: Pi stand-down park cases ===
ok - cursor park: inert when PI_CODING_AGENT marks a Pi host session
ok - cursor park: parks when PI_CODING_AGENT leaks alongside Cursor identity
EXIT:0
Evidence: Live stop-hook park matrix (A–D)
=== Cursor-park Pi stand-down live matrix ===
Each case starts from a clean env (PI/CURSOR markers unset), then applies overlay.
Ambient before clean: PI=true CURSOR_AGENT=1 CURSOR_INVOKED_AS=<unset>

CASE A-pi-host-standdown
  env overlay: PI_CODING_AGENT=true only
  exit: 0  arm-ran: no  followup_kind: none
  followup: (empty)
  lock: 114711

CASE B-pi-leak-CURSOR_AGENT-parks
  env overlay: PI_CODING_AGENT=true CURSOR_AGENT=1
  exit: 0  arm-ran: yes  followup_kind: v1 watcher
  followup: {   "followup_message": "⁣FIRSTMATE_OP: v1 watcher: firstmate watcher wake - one supervision event needs a handling turn now.\nstale: fixture-win needs a look\n\nRun bin/fm-wake-drain.sh first, handle the wake, then run its exact WAKE_ACK_REQUIRED --ack-through command. Until that post-handling ac
  lock: 114774

CASE C-pi-leak-CURSOR_INVOKED_AS-parks
  env overlay: PI_CODING_AGENT=true CURSOR_INVOKED_AS=cursor-agent
  exit: 0  arm-ran: yes  followup_kind: v1 watcher
  followup: {   "followup_message": "⁣FIRSTMATE_OP: v1 watcher: firstmate watcher wake - one supervision event needs a handling turn now.\nstale: fixture-win needs a look\n\nRun bin/fm-wake-drain.sh first, handle the wake, then run its exact WAKE_ACK_REQUIRED --ack-through command. Until that post-handling ac
  lock: 115424

CASE D-no-pi-baseline-parks
  env overlay: (no PI / Cursor identity markers)
  exit: 0  arm-ran: yes  followup_kind: v1 watcher
  followup: {   "followup_message": "⁣FIRSTMATE_OP: v1 watcher: firstmate watcher wake - one supervision event needs a handling turn now.\nstale: fixture-win needs a look\n\nRun bin/fm-wake-drain.sh first, handle the wake, then run its exact WAKE_ACK_REQUIRED --ack-through command. Until that post-handling ac
  lock: 116074

=== Expected ===
A arm=no empty followup (Pi host stand-down)
B arm=yes watcher followup (Cursor identity wins over PI leak)
C arm=yes watcher followup (CURSOR_INVOKED_AS wins over PI leak)
D arm=yes watcher followup (baseline park)
Evidence: fm-spawn cursor launch clears PI_CODING_AGENT

env -u CLAUDECODE -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS -u CURSOR_INVOKED_AS '.../cursor-agent' --trust --yolo ... PASS contains: -u PI_CODING_AGENT

=== fm-spawn cursor launch clears PI_CODING_AGENT ===
spawn exit: 0

--- captured launch command ---
env -u CLAUDECODE -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS -u CURSOR_INVOKED_AS '/tmp/fm-spawn-dispatch-profile.5vJkH3/profile-cursor-pi-clear/fake/fakebin/cursor-agent' --trust --yolo --model 'cursor-grok-4.5-high' --workspace '/tmp/fm-spawn-dispatch-profile.5vJkH3/profile-cursor-pi-clear/wt' "$('/home/ladwein/.no-mistakes/worktrees/0f2624469d68/01M0Z5MHSHNV9G4947T9V9NGHG/bin/fm-operational-input.sh' encode launch-brief < '/tmp/fm-spawn-dispatch-profile.5vJkH3/profile-cursor-pi-clear/home/data/profile-cursor-pi-clear/brief.md')"

--- marker clear checks ---
PASS contains: env -u CLAUDECODE
PASS contains: -u PI_CODING_AGENT
PASS contains: -u GROK_AGENT
PASS contains: -u FM_PI_HARNESS

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.

  • bash tests/fm-cursor-primary.test.sh
  • filtered runner invoking test_park_inert_under_pi_coding_agent and test_park_still_parks_with_pi_leak_and_cursor_identity
  • live stop-hook matrix A–D (Pi host stand-down, PI+CURSOR_AGENT park, PI+CURSOR_INVOKED_AS park, no-PI baseline park)
  • fm-spawn cursor ship spawn capturing launch command and asserting -u PI_CODING_AGENT
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

pi-cursor-sdk lädt .cursor/hooks.json in die Pi-Sitzung und parkte einen zweiten Watcher; das erzeugte rearm-resurface und brach laufende Rückfragen ab. Bei PI_CODING_AGENT=true beendet der Park sofort, native cursor-agent Primaries bleiben unverändert.
…gen.

Stand-down gilt nur bei PI_CODING_AGENT=true ohne CURSOR_AGENT und ohne CURSOR_INVOKED_AS. Handgestartete cursor-agent Primaries mit geerbtem PI-Marker parken weiter.
@greptile-apps

greptile-apps Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "fix(bin): no-mistakes-Mindestversion auf..." | Re-trigger Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Reviewed HEAD 9fa4a541e4ab23cac338d33c9ce201e96655b526 vs main 9ce69acf95b901cb6dc38dd5fa55f37a8038e16c. Whole thread read (Greptile success). Full diff reviewed: bin/fm-turnend-guard-cursor.sh, docs/supervision-protocols/cursor.md, docs/turnend-guard.md, docs/watcher-continuity.md, tests/fm-cursor-primary.test.sh. No .github/workflows/*. Not disguised security.

Class: corrective. Pi+pi-cursor-sdk was dual-watching against fm_watch_arm_pi; the park now stands down only when PI_CODING_AGENT=true and neither Cursor identity marker is set, and still parks when a Cursor identity is present despite a PI leak. That is a refusal/stand-down fix for a broken path, not a new default capability.

VISION (per rule, inspected evidence):

  • One captain, one interface — aligns. Stops rearm-resurface noise that aborts in-flight asks; captain-facing outcomes stay intact.
  • Authority is explicit — aligns. Narrow early-exit on an already-wrong dual-watch path; Cursor identity still parks.
  • Scripts own the mechanics — aligns. Deterministic env-marker gate in the park script; tests pin both stand-down and leak-with-identity.
  • A restart is a non-event — aligns. No durable-state contract change.
  • Delegation with a spine — aligns. Strengthens a refusal/stand-down path.
  • The fleet outlives any vendor — aligns. Keeps Pi and Cursor adapters from fighting; not a harness lock-in.
  • Scope — aligns. Command-layer continuity fix, not workshop growth.

First-time fork CI: after that full-diff review I approved workflow runs 32978722782 (CI) and 32978722931 (Require no-mistakes) for this HEAD. Forge behavior suites are green; Require no-mistakes failed — body has the no-mistakes signature prose but is missing no-mistakes-pipeline-attestation:v1 matching this HEAD.

Not merging. Waiting on the author for a matching structured pipeline attestation on HEAD 9fa4a541. Not with the captain.

Merge-eligible: NO.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Reviewed HEAD 9fa4a541e4ab23cac338d33c9ce201e96655b526 vs main 9ce69acf95b901cb6dc38dd5fa55f37a8038e16c. Whole thread read (Greptile success). Full diff reviewed: bin/fm-turnend-guard-cursor.sh, docs/turnend-guard.md, docs/supervision-protocols/cursor.md, docs/watcher-continuity.md, tests/fm-cursor-primary.test.sh. No .github/workflows/*. Not disguised security. thelad-dev is not blocked.

Class: corrective. Pi+pi-cursor-sdk loads project .cursor/hooks.json into the Pi process and the Cursor park was dual-watching against fm_watch_arm_pi, resurfacing rearm wakes and aborting in-flight asks. The park now exits 0 without arming only when PI_CODING_AGENT=true and neither CURSOR_AGENT nor CURSOR_INVOKED_AS is set. Cursor identity still parks despite a leaked PI_CODING_AGENT. Existing park fixtures now clear PI_CODING_AGENT so the suite cannot stand down by accident. This restores the intended single-owner continuity; it is not a new default and not an opt-in flag.

VISION (per rule, inspected evidence):

  • One captain, one interface — aligns. Dual-watch was hiding a live ask behind a rearm wake. Standing down the extra park keeps the honest single watcher.
  • Authority is explicit — aligns. No new capability and no assumed consent; the early exit is a defect repair on the existing park contract.
  • Scripts own the mechanics — aligns. Deterministic env-marker test in bin/fm-turnend-guard-cursor.sh.
  • A restart is a non-event — aligns. No durable-state contract change.
  • Delegation with a spine — aligns. Strengthens a refusal of a broken dual-watch path.
  • The fleet outlives any vendor — aligns. Uses existing Pi/Cursor identity markers; native Cursor still parks.
  • Scope — aligns. Adapter-boundary fix, not a new workshop layer.

Forge CI on this HEAD is green (Lint, coverage, portable parallel/serial, Herdr, macOS snapshot, repo invariants). Require-no-mistakes failed: the body has the no-mistakes signature line but no no-mistakes-pipeline-attestation:v1 matching this HEAD. First-time fork CI was already approved on the prior pass; no new HEAD is waiting, so I did not re-approve.

Waiting on the author, not the captain: add a matching no-mistakes-pipeline-attestation:v1 for HEAD 9fa4a541e4ab23cac338d33c9ce201e96655b526 (re-push via git push no-mistakes so the structured stamp lands). After that, this is otherwise merge-shaped as corrective.

Merge-eligible: NO.

Die PR-Attestierung verlangt ab 1.46.0 strukturierte Pipeline-Schritte; der Bootstrap-Floor blieb bei 1.31.2 und ließ zu alte Builds zu.

Co-authored-by: Cursor <[email protected]>
@kunchenguid
kunchenguid merged commit b0ca8f5 into kunchenguid:main Aug 26, 2026
15 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @thelad-dev — really appreciate you taking the time on this.

Reviewed HEAD ce07e7557c7abbbaf05ab9acf1b8c1f48656d1d0 vs main 9ce69acf95b901cb6dc38dd5fa55f37a8038e16c. Whole thread read (Greptile 5/5). Full diff reviewed: park stand-down in bin/fm-turnend-guard-cursor.sh plus the bootstrap floor alignment to the 1.46.0 attestation policy already on main CONTRIBUTING.md. No .github/workflows/*. Not disguised security.

Class: corrective. Pi-host park stands down only when PI_CODING_AGENT=true and neither Cursor identity marker is set; Cursor identity still parks despite a PI leak. The 1.46.0 floor is not a new default — it matches the contributor gate already landed on main.

VISION (per rule, inspected evidence):

  • One captain, one interface — aligns. Dual-watch was hiding a live ask behind a rearm wake.
  • Authority is explicit — aligns. Park early-exit is a defect repair; floor matches already-landed 1.46.0 policy.
  • Scripts own the mechanics — aligns. Deterministic env-marker test; tests pin both arms.
  • A restart is a non-event — aligns. No durable-state contract change.
  • Delegation with a spine — aligns. Strengthens a refusal of the broken dual-watch path.
  • The fleet outlives any vendor — aligns. Existing Pi/Cursor markers; native Cursor still parks.
  • Scope — aligns. Adapter-boundary fix, not a new workshop layer.

Forge CI green on this HEAD. no-mistakes-pipeline-attestation:v1 matches. First-time fork CI was already approved on the prior pass; I did not re-approve.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Re-triaged HEAD ce07e7557c7abbbaf05ab9acf1b8c1f48656d1d0 vs main 9ce69acf95b901cb6dc38dd5fa55f37a8038e16c (newer activity after prior waiting-author stamp). Whole thread read. Full diff reviewed: bin/fm-turnend-guard-cursor.sh (Pi-host stand-down), bin/fm-bootstrap.sh / bootstrap diagnostics + tests (no-mistakes floor 1.31.2→1.46.0 so structured pipeline attestation is actually written), docs, tests/fm-cursor-primary.test.sh. No .github/workflows/*. Not disguised security. thelad-dev is not blocked. Independent of same-author #3105 (German default-behavior, already with the captain) — decisions not mixed.

Class: corrective. Cursor park stands down only when PI_CODING_AGENT=true and neither Cursor identity marker is set, stopping Pi+pi-cursor-sdk dual-watch against fm_watch_arm_pi; Cursor identity still parks despite a PI leak. Bootstrap floor bump matches the already-enforced attestation gate (not a new default capability).

VISION (per rule, inspected evidence):

  • One captain, one interface — aligns. Dual-watch was hiding a live ask behind a rearm wake.
  • Authority is explicit — aligns. Narrow early-exit defect repair; no assumed consent.
  • Scripts own the mechanics — aligns. Deterministic env-marker gate in the park script.
  • A restart is a non-event — aligns. No durable-state contract change.
  • Delegation with a spine — aligns. Strengthens refusal of a broken dual-watch path.
  • The fleet outlives any vendor — aligns. Uses existing Pi/Cursor identity markers.
  • Scope — aligns. Adapter-boundary + bootstrap floor for an already-required gate.

First-time fork CI: after that full-diff review I approved workflow runs 32983119323 (CI), 32983511150 and 32983119192 (Require no-mistakes) for this HEAD. Forge CI green on all jobs; Require-no-mistakes success with no-mistakes-pipeline-attestation:v1 matching HEAD ce07e755….

Auto-merge gates met (corrective + green CI + matching attestation + safe review). Squash-merging.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @thelad-dev — really appreciate you taking the time on this.