Repository navigation
Conversation
|
Speaking as Kun's firstmate: thanks @avivl. That's a clear write-up of a nasty one. A shared broker pinning I compared head What I checked: CI: this is a fork contribution whose runs were waiting on approval. I reviewed the diff first ( Waiting on you, the author:
Contract-class: restore. The omp primary's session lock is an existing, specified default path. It's meant to record the session's own omp process, and the shared broker broke that. This makes it record only real sessions, and it changes nothing for other harnesses. VISION.md, rule by rule
Next step: waiting on you for the re-raise and the live omp evidence. Once the attested head is fully green, this is an auto-merge candidate. Nothing here is waiting on Kun. |
|
I re-ran the lock behavior against a real omp primary using Base was
This verifies the same behavior on 18.8.6, in addition to the previously documented 18.8.0 through 18.8.4 versions. This run did not test 18.8.5. The temporary homes and omp processes used for this run were removed after capture. The branch was re-raised through no-mistakes at head The cancelled Behavior portable serial 2 job also needs a rerun: https://github.com/kunchenguid/firstmate/actions/runs/37847030662/job/113779297467 |
|
Speaking as Kun's firstmate: thanks @avivl, and thank you for the real omp 18.8.6 run. All four rows (bug reproduced on main, named call refused with the new hint, plain call locks the real session pid, broker-pinned lock reclaimed) are exactly what I asked for. The live ask is cleared. What changed since my last stamp ( CI: I approved CI Waiting on you, the author (one small thing): the body's attestation is bound to |
|
Friendly ping: this branch is ready for review, and the fork workflow runs still need approval from a maintainer before CI can run. Thanks. |
|
Speaking as Kun's firstmate: thanks @avivl, and thanks for re-raising. The body's attestation is now bound to head Contract-class: restore (unchanged), and my VISION verdict from 2026-10-09 still stands. Once the no-mistakes check reports green on this head, this auto-merges. Nothing else is needed from you right now. |
omp's daemon broker (omp __omp_worker_daemon_broker) runs every bash call made with name, carries the bare process name omp, and is shared by every omp in one project directory, so it outlives sessions and its parent is whichever omp started it. A named bin/fm-session-start.sh call recorded the broker in state/.lock, which then pinned the home's lock: every later session saw another live firstmate session holding it and supervision never started (omp 18.8.0-18.8.4). The lock library now rejects omp __omp_worker_* processes as harnesses and stops its ancestry walk at one, so a worker-pinned lock reads stale and the session reclaims it, and a lock-taking script run under a worker refuses with a message naming the cause instead of recording the wrong pid. The omp protocol and harness reference say to run lock-taking scripts as ordinary bash calls.
…kunchenguid#7415) * fix(bin): re-anchor a Claude session's lock so /clear keeps ownership A same-session confirmation over a live lock line 1 outside the current harness ancestry now rewrites line 1 to the session's CLAUDE_PID anchor under the claim lock, so a later /clear re-key in the same process is still proven by ancestry instead of being refused as a foreign owner. Fixes kunchenguid#6820 * fix(bin): move task leases with a session-lock re-anchor A same-session re-anchor rewrote lock line 1 off a live pid while task leases still named that pid, so a lease held by main or the supervision branch read as stale and the other actor could claim the task. The re-anchor now takes the lease-command lock after the claim lock and, in the same critical section as the line-1 write, rewrites leases recorded against the old pid to the new anchor (fm_lease_rekey_holder). If the lease-command lock stays busy past a short bound, the confirmation keeps line 1 as before and a later acquisition re-anchors. The foreign-owner reproduction now asserts the re-anchor contract: the same trusted id from a live process outside the owner's ancestry moves line 1 onto that process's CLAUDE_PID, and a different id is refused against it afterwards. The ancestry membership loop is shared through one session-lock lib helper. The earlier commit dropped the ancestry suite's dead-front-end reclaim phase; that coverage lives in the existing reclaim tests (test_verified_reclaim_keeps_new_sidecar and the Stop auto-arm's test_reclaims_stale_session_lock_before_arming). * fix(bin): record the lock holder for a lease pinned before a re-anchor The supervision host pins FM_LEASE_HOLDER_PID to lock line 1 at the start of each engine turn. A same-session re-anchor inside that turn moved line 1 to a new pid while the pinned holder stayed alive, so a later claim or same-actor refresh in the turn recorded the old pid and the lease read stale, letting main claim the branch's task. A claim now records the live line 1 when the pinned holder is alive but is no longer line 1. Another session takes the lock only from a dead owner, so that state comes from a re-anchor; a dead pin is still recorded as before and its lease stays stale. * no-mistakes(review): Move auto-arm rewake session pid with lock re-anchor * no-mistakes(review): Align startup-network downgrade test and lock-rewrite comment * no-mistakes(review): Correct lock takeover and re-anchor signal-window comments * no-mistakes(review): Record re-anchor rewake and pinned-claim verification evidence * no-mistakes(document): Update network-checks diagnostic for re-anchored lock holder
omp's daemon broker (omp __omp_worker_daemon_broker) runs every bash call made with name, carries the bare process name omp, and is shared by every omp in one project directory, so it outlives sessions and its parent is whichever omp started it. A named bin/fm-session-start.sh call recorded the broker in state/.lock, which then pinned the home's lock: every later session saw another live firstmate session holding it and supervision never started (omp 18.8.0-18.8.4). The lock library now rejects omp __omp_worker_* processes as harnesses and stops its ancestry walk at one, so a worker-pinned lock reads stale and the session reclaims it, and a lock-taking script run under a worker refuses with a message naming the cause instead of recording the wrong pid. The omp protocol and harness reference say to run lock-taking scripts as ordinary bash calls.
e422605 to
4cac953
Compare
|
Friendly ping: the conflict with main is fixed on head 4cac953 (same 5 files, 0 behind main). The fork workflow runs on this head still need maintainer approval before CI can run, and the attestation needs a refresh. Thanks. |
|
Heads up: main took #6300 today and now conflicts with this branch in bin/fm-lock.sh and bin/fm-session-lock-lib.sh. I will rebase as soon as someone looks at it, so the rebase lands on the final state of main. The fork workflow runs on head 4cac953 are still waiting for maintainer approval. Thanks. |
Intent
Upstream pull request #6870 (fork branch avivl/omp-daemon-worker-lock on [email protected]:avivl/firstmate.git, current head e4226052196b6238c07b64f26e13459b63a96034) "fix(bin): exclude omp daemon workers from session lock anchoring" is approved by the upstream owner's reviewer and auto-merges once its checks are green, but it now conflicts with main. Main took #7415 ("re-anchor a Claude session's lock so /clear keeps ownership") on 2026-10-17, which edits the same test file, and a trial merge shows one conflict: tests/fm-session-lock-ancestry.test.sh. The branch is 3 commits ahead (one fix commit 79aaf0c4 plus two "Merge branch 'main'" commits) and 56 behind origin/main. The captain approved this one upstream push with the words: fix it, for pr://6870. The task is to resolve the conflict, keep every behavior and test of the PR and of main, and re-raise the PR through the no-mistakes pipeline once on the final head.
What Changed
bin/fm-session-lock-lib.sh: addedfm_omp_daemon_worker, which recognizes omp daemon worker processes (omp __omp_worker_*as the first argument).fm_harness_process_matchesnow never treats one as a harness, and the ancestry walk infm_harness_ancestry_pidsstops at one without a verdict. A newfm_harness_ancestry_under_omp_workerhelper reports whether the walk hit such a worker first. This keeps anamed omp bash call from recording the shared daemon broker as the session instate/.lock.bin/fm-lock.sh: when no harness can be found and the ancestry runs through an omp daemon worker, the error now says the command is running under anamed bash call and should be rerun withoutname. Other failures keep the original message.tests/fm-session-lock-ancestry.test.shand the omp docs (docs/supervision-protocols/omp.md,.agents/skills/harness-adapters/references/harness/omp.md): added ancestry tests for the daemon-worker cases and documented that session-lock commands must run as ordinary bash calls. The branch also resolves the conflict with fix(bin): re-anchor a Claude session's lock so /clear keeps ownership #7415 (re-anchoring a Claude session's lock so/clearkeeps ownership) in the test file, keeping the tests from both sides.Risk Assessment
✅ Low: The conflict resolution now has one definition and one call of each test from both main and the PR, and the lock-library change is narrowly scoped to excluding omp
__omp_worker_*processes from anchoring.Testing
I ran the merged session-lock ancestry suite, which drives real fm-lock.sh processes. All 20 tests passed, including main's re-anchor lease and auto-arm tests and the PR's omp daemon worker unit and e2e tests. There are no duplicate definitions or calls. I did not drive a live omp primary in a lab, because the existing e2e test already covers the omp daemon worker scenario.
Evidence: session-lock suite run
Source: session-lock suite run
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
tests/fm-session-lock-ancestry.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/avivl/omp-daemon-worker-lock🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Review** - 1 issue found → auto-fixed ✅
tests/fm-session-lock-ancestry.test.sh:1330- The conflict resolution in tests/fm-session-lock-ancestry.test.sh duplicated content. Main's test_reanchor_keeps_task_leases_live, autoarm_midturn_healthy and test_reanchor_keeps_autoarm_midturn_healthy (defined at lines 1115-1215) are defined a second time at lines 1330-1438. The PR's test_omp_daemon_worker_is_never_the_session and test_e2e_fm_lock_under_omp_daemon_worker are defined twice (1225/1289 and 1440/1504). The invocation list at the end (1559-1566) calls each of the four tests twice. The re-anchor tests use fixed dirs ($TMP_ROOT/reanchor-leases, reanchor-autoarm) and leave astate/stopfile behind. On the second run the stub loops exit immediately and the stale front-pid is dead, so thekill -0 "$front_pid"check fails with 'the front-end exited'. The suite should fail on the second invocation. Remove the second copy of the definitions (lines 1330-1566 region duplicates) and the four duplicate calls, keeping one definition and one call of each test.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-session-lock-ancestry.test.sh(run twice, exit 0, 20 ok, 0 not ok)Counted test definitions (20) against invocations (20) to confirm the duplicate blocks are gone✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.