Repository navigation
Conversation
…ation in script header
…ate-20260919 feat: gate fresh CLAUDE.md pointer creation on Claude Code version >= 2.1.277
…tage 2) (#2) * feat(bin): complete stage 2 CLAUDE.md pointer removal * no-mistakes(review): Restore column-0 heredoc regression fixture with generic content * no-mistakes(review): Remove stale CLAUDE.md pointer claim from updatefirstmate skill --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
Prior commits on this branch regressed past stage2, restoring the unconditional CLAUDE.md pointer-write logic stage2 removed. Reset to fork/main (stage2's merged head) and redo stage3 correctly: delete the now-dead fm_version_at_least/claude_supports_native_agents_md functions and their header-comment reference, and drop the now-vestigial with_mock_claude/with_no_claude test helpers (the script no longer reads claude --version at all). Co-authored-by: irene <irene@ireneui-MacBookPro.local>
…eering skills (#4) * feat: add lazy specialist tool routing Expose ECC, paperthin, and ultrawork as captain-approved specialist paths while keeping Firstmate intake and lifecycle authority. Load only the selected skill or mode and keep ECC hooks, MCP, and legacy sync opt-in. * docs(agents): recover firstmate-layout and task-steering skills These two skills existed only on an orphaned local branch, never pushed. firstmate-layout is re-extracted from AGENTS.md section 2's current (much larger) layout tree rather than reusing the stale 2026-09-14 snapshot. task-steering's underlying AGENTS.md paragraph was byte-identical to the 2026-09-14 extraction, so it is reused as-is. Both get a one-line trigger in section 13 and a documentation-audiences.json entry, matching how specialist-tools (recovered earlier on this branch) is registered. --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
Co-authored-by: irene <irene@ireneui-MacBookPro.local>
.treehouse/ holds only runtime pool bookkeeping (treehouse-state.json, treehouse-state.lock), never captain work, but its absence from .gitignore makes it show up as an untracked dirty-tree blocker for bin/fm-update.sh's self-update fast-forward check. Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* fix(dispatch): expose AGY auth-required quota cause * no-mistakes(review): Guarded auth-required AGY ranking with regression coverage * no-mistakes(document): Document AGY auth-required resolver behavior * no-mistakes(review): Normalize auth errors; preserve unranked AGY dispatch safety * no-mistakes(review): Guard auth-required AGY from stale quota wake classification * no-mistakes(review): Guard auth-required AGY ranking and surface exact cause * no-mistakes(review): Preserve auth-required AGY floors as unverifiable * no-mistakes(document): Document AGY auth-required quota behavior * test(quota): keep unknown-row fixture malformed * no-mistakes(review): Remove unreachable AGY and unused auth-cause code * no-mistakes(document): Updated documentation for quota and terminal cleanup * no-mistakes(review): Remove stale AGY chooser documentation claim * no-mistakes(review): Restored migration trigger and terminal ledger reaping * no-mistakes(review): Removed stale memory path and redacted local evidence paths * no-mistakes(review): Updated stale chooser evidence and verified legacy migration --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
#9) * fix(bin): preserve Claude lock ownership after helper recycling (kunchenguid#4894) * fix(bin): let a background Claude session keep owning its session lock Session-lock ownership was decided by process ancestry alone. Under an unattended Claude session the model loop runs in a transient bg-spare bridged to the front-end by a shared daemon; when that bridge is recycled the contiguous claude-named ancestry from a hook to the recorded owner breaks while the owner pid stays alive, so the Stop auto-arm stood down as a foreign live owner, the turn-end guard ended every turn with its read-only diagnostic, and fm-lock.sh refused - a self-sustaining outage until restart. Ownership is now ancestry membership OR a trusted same-session id, never id-first: - fm-session-lock-lib.sh accepts CLAUDE_CODE_SESSION_ID only when CLAUDE_PID is a Claude-shaped member of the current contiguous run, compares it against the id recorded in state/.lock-session, and requires the recorded pid to still be a live harness. No id, no sidecar, an untrusted id, a different id, or a dead recorded pid leaves the ancestry verdict unchanged. Ids are never read from ps argv. - fm-lock.sh accepts a same-session holder at both refusal sites, writes, refreshes, and clears the sidecar only under its claim lock (including the early already-mine exit, skipped only while the deferred startup sweep leases that lock), keeps it byte-identical across a same-session confirmation, records CLAUDE_PID on lock line 1 for a session with a trusted id so a shared daemon or front-end that outlives the session never keeps a dead session's lock alive, never rewrites a live line 1 on a same-session confirmation, and names the recorded id in the live-owner refusal. - The .lock line-1 format is unchanged, so every reader that takes the whole first line as the pid keeps working; the guard's foreign-owner exit is unchanged and inherits the fix through the shared predicate. Tests: the ancestry suite drives the ancestry and id signals apart in a deterministic process table (asserting the divergence) and runs a real orphaned front-end/daemon/pty-host/spare tree through six phases with the real lock, auto-arm, and guard scripts; the foreign-owner repro keeps its negative control and adds a same-id positive control. Disclosure: no live unattended Claude background session ran on the verifying machine. The topology is documented by the real process listings in kunchenguid#3902, kunchenguid#2314, kunchenguid#3398, and kunchenguid#4066; coverage is the structural predicate plus the executable fixtures, not a live pass. Residual: bin/fm-sessionstart-nudge.sh keeps its own private ancestry walk (it only decides whether to print a nudge) and may nudge on a resume in the recycled case. Out of scope, deliberately: no structured lock format, no guard budget changes, no daemon-identity rejection, no fork lineage. * no-mistakes(review): Wait for claim lock; revert failed sidecars * no-mistakes(review): Revalidate ownership after wait; restore sidecars * no-mistakes(review): Roll back sidecar by publication phase * no-mistakes(review): Restore sidecar only if lock line is unchanged * no-mistakes(review): Trust session ids without a spelling allowlist * no-mistakes(review): Disarm sidecar rollback before backup cleanup * no-mistakes(document): Updated session-lock ownership documentation * feat: park main under the away posture on Pi (kunchenguid#4889) * feat: park main under the away posture on Pi While the away-posture record exists on a Pi primary, the supervision branch takes every actionable wake, no processing turn opens on main, captain rows accumulate for the return brief, and main's standing authority relocates to the branch through the existing guarded scripts. - lib/fm-branch-dispatch.ts: read the record at every routing decision; while it exists claim check, decision-owned, and heartbeat rows too, keeping the two broken-queue vetoes; expose checkSeqs so a claimed check row lifts task scoping. - fm-primary-pi-watch.ts: offer every actionable row under the record; a declined wake and every watcher-failure alarm still reach main. - fm-branch-supervision.ts: drop the legacy .afk decline; append a fixed POSTURE: AWAY tail carrying the record's read-back verbatim per wake; open no processing request while the record exists, re-checked immediately before a request would open and at every run boundary; present the accumulated rows at the first run boundary after archive. - fm-lease-lib.sh: fm_lease_forbid_branch passes the branch for opted-in actions only while fm-afk-contract.sh validate succeeds on a confirmed live record; PR merge, fresh spawn, and decision answer opt in, local landing never does. - fm-send.sh: a --resolve-key naming an open needs-decision or captain-held task is a decision answer and meets the partition; blocked: keys stay steering. - fm-spawn.sh: enforce the record's spend cap for a fresh ordinary spawn by either actor; relaunches and secondmates exempt. - fm-branch-prompt.sh: fixed Postures section and the verbatim ask-user-authority policy; the prefix stays byte-stable. - fm-afk-return.sh: count what the away session handled from the store. - docs, afk skill, AGENTS.md stub: main parked on Pi, green merge gate absolute while away. - tests: watcher and branch extension suites, fleet-record, merge, and decision-answer suites cover the relocation, the vetoes, the tail, the parked processing turn, the cancellation, the re-presentation, and the spend cap; dated live-guard evidence recorded. * no-mistakes(review): Refuse branch merge after preflight archive race * no-mistakes(review): Fix away wake, spawn, and processing races * no-mistakes(review): Suppress parked processing; narrow away-only rejection * no-mistakes(review): Abort dedicated processing; gate branch spawn once * no-mistakes(review): Stamp away-only on the dispatch offer * no-mistakes(review): Treat invalid away records as spend-cap absence * no-mistakes(review): Drop spawn test hook; abort processing-opened runs * no-mistakes(review): Bind abort to opening prompt; cap-read absence * no-mistakes(review): Limit away branch spawn to queued work only * no-mistakes(document): Correct AFK posture documentation * ci: standardize workflow timeouts into three tiers (kunchenguid#4910) * ci: simplify CI job timeouts to a three-tier policy Replace the scattered per-job timeout values (10m parallel, 25m lint, 30m serial, 10m macOS) with three readable tiers, each a hang tripwire with headroom rather than a packing estimate: - fast (5m): coverage guard, repo invariants, timing aggregate - normal (30m, one shared budget): lint partitions, portable parallel shards, portable serial shards, macOS stock Bash - heavy (Herdr only): 20m step tripwire on the family run so always() cleanup still runs, under a 75m job-level last-resort backstop The workflow's header comment states the policy and points at docs/fm-test-portable-shards.md "Timeouts", which now owns it, and each job names its tier beside timeout-minutes. tests/fm-ci-workflow.test.sh asserts the policy against the parsed workflow instead of the old per-job minute values: every job joins exactly one tier, exactly three distinct job-level values exist, the fast tier stays within 5-10 minutes, the normal budget stays at least double the modeled parallel lane sum reported by fm-test-run.sh --check-coverage, and the Herdr step tripwire stays below its job backstop with an always() cleanup after it. Concurrency supersession, shard counts, lane membership, and fail-fast settings are unchanged. * no-mistakes(review): Decouple the normal timeout from packing estimates * no-mistakes(review): Assert Herdr teardown follows the family run * no-mistakes(review): Pin Herdr family-run timeout to 20 minutes * no-mistakes(review): Ignore comments when identifying Herdr steps * no-mistakes(review): Identify Herdr steps by declarative ids * no-mistakes(document): Clarify authoritative three-tier timeout policy * fix(guard): allow root x-mode config paths * fix(tests): resolve timing race in remote backlog handoff test * no-mistakes(review): Fix conflict marker and Orca reaping; unrelated focused test failure * no-mistakes(review): Fix validated reaping, PR fallback, and config test mappings * no-mistakes(review): Restore active-home-only x-mode approval * no-mistakes(document): Correct layout reference ownership label --------- Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com> Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* fix(bin): preserve Claude lock ownership after helper recycling (kunchenguid#4894) * fix(bin): let a background Claude session keep owning its session lock Session-lock ownership was decided by process ancestry alone. Under an unattended Claude session the model loop runs in a transient bg-spare bridged to the front-end by a shared daemon; when that bridge is recycled the contiguous claude-named ancestry from a hook to the recorded owner breaks while the owner pid stays alive, so the Stop auto-arm stood down as a foreign live owner, the turn-end guard ended every turn with its read-only diagnostic, and fm-lock.sh refused - a self-sustaining outage until restart. Ownership is now ancestry membership OR a trusted same-session id, never id-first: - fm-session-lock-lib.sh accepts CLAUDE_CODE_SESSION_ID only when CLAUDE_PID is a Claude-shaped member of the current contiguous run, compares it against the id recorded in state/.lock-session, and requires the recorded pid to still be a live harness. No id, no sidecar, an untrusted id, a different id, or a dead recorded pid leaves the ancestry verdict unchanged. Ids are never read from ps argv. - fm-lock.sh accepts a same-session holder at both refusal sites, writes, refreshes, and clears the sidecar only under its claim lock (including the early already-mine exit, skipped only while the deferred startup sweep leases that lock), keeps it byte-identical across a same-session confirmation, records CLAUDE_PID on lock line 1 for a session with a trusted id so a shared daemon or front-end that outlives the session never keeps a dead session's lock alive, never rewrites a live line 1 on a same-session confirmation, and names the recorded id in the live-owner refusal. - The .lock line-1 format is unchanged, so every reader that takes the whole first line as the pid keeps working; the guard's foreign-owner exit is unchanged and inherits the fix through the shared predicate. Tests: the ancestry suite drives the ancestry and id signals apart in a deterministic process table (asserting the divergence) and runs a real orphaned front-end/daemon/pty-host/spare tree through six phases with the real lock, auto-arm, and guard scripts; the foreign-owner repro keeps its negative control and adds a same-id positive control. Disclosure: no live unattended Claude background session ran on the verifying machine. The topology is documented by the real process listings in kunchenguid#3902, kunchenguid#2314, kunchenguid#3398, and kunchenguid#4066; coverage is the structural predicate plus the executable fixtures, not a live pass. Residual: bin/fm-sessionstart-nudge.sh keeps its own private ancestry walk (it only decides whether to print a nudge) and may nudge on a resume in the recycled case. Out of scope, deliberately: no structured lock format, no guard budget changes, no daemon-identity rejection, no fork lineage. * no-mistakes(review): Wait for claim lock; revert failed sidecars * no-mistakes(review): Revalidate ownership after wait; restore sidecars * no-mistakes(review): Roll back sidecar by publication phase * no-mistakes(review): Restore sidecar only if lock line is unchanged * no-mistakes(review): Trust session ids without a spelling allowlist * no-mistakes(review): Disarm sidecar rollback before backup cleanup * no-mistakes(document): Updated session-lock ownership documentation * feat: park main under the away posture on Pi (kunchenguid#4889) * feat: park main under the away posture on Pi While the away-posture record exists on a Pi primary, the supervision branch takes every actionable wake, no processing turn opens on main, captain rows accumulate for the return brief, and main's standing authority relocates to the branch through the existing guarded scripts. - lib/fm-branch-dispatch.ts: read the record at every routing decision; while it exists claim check, decision-owned, and heartbeat rows too, keeping the two broken-queue vetoes; expose checkSeqs so a claimed check row lifts task scoping. - fm-primary-pi-watch.ts: offer every actionable row under the record; a declined wake and every watcher-failure alarm still reach main. - fm-branch-supervision.ts: drop the legacy .afk decline; append a fixed POSTURE: AWAY tail carrying the record's read-back verbatim per wake; open no processing request while the record exists, re-checked immediately before a request would open and at every run boundary; present the accumulated rows at the first run boundary after archive. - fm-lease-lib.sh: fm_lease_forbid_branch passes the branch for opted-in actions only while fm-afk-contract.sh validate succeeds on a confirmed live record; PR merge, fresh spawn, and decision answer opt in, local landing never does. - fm-send.sh: a --resolve-key naming an open needs-decision or captain-held task is a decision answer and meets the partition; blocked: keys stay steering. - fm-spawn.sh: enforce the record's spend cap for a fresh ordinary spawn by either actor; relaunches and secondmates exempt. - fm-branch-prompt.sh: fixed Postures section and the verbatim ask-user-authority policy; the prefix stays byte-stable. - fm-afk-return.sh: count what the away session handled from the store. - docs, afk skill, AGENTS.md stub: main parked on Pi, green merge gate absolute while away. - tests: watcher and branch extension suites, fleet-record, merge, and decision-answer suites cover the relocation, the vetoes, the tail, the parked processing turn, the cancellation, the re-presentation, and the spend cap; dated live-guard evidence recorded. * no-mistakes(review): Refuse branch merge after preflight archive race * no-mistakes(review): Fix away wake, spawn, and processing races * no-mistakes(review): Suppress parked processing; narrow away-only rejection * no-mistakes(review): Abort dedicated processing; gate branch spawn once * no-mistakes(review): Stamp away-only on the dispatch offer * no-mistakes(review): Treat invalid away records as spend-cap absence * no-mistakes(review): Drop spawn test hook; abort processing-opened runs * no-mistakes(review): Bind abort to opening prompt; cap-read absence * no-mistakes(review): Limit away branch spawn to queued work only * no-mistakes(document): Correct AFK posture documentation * ci: standardize workflow timeouts into three tiers (kunchenguid#4910) * ci: simplify CI job timeouts to a three-tier policy Replace the scattered per-job timeout values (10m parallel, 25m lint, 30m serial, 10m macOS) with three readable tiers, each a hang tripwire with headroom rather than a packing estimate: - fast (5m): coverage guard, repo invariants, timing aggregate - normal (30m, one shared budget): lint partitions, portable parallel shards, portable serial shards, macOS stock Bash - heavy (Herdr only): 20m step tripwire on the family run so always() cleanup still runs, under a 75m job-level last-resort backstop The workflow's header comment states the policy and points at docs/fm-test-portable-shards.md "Timeouts", which now owns it, and each job names its tier beside timeout-minutes. tests/fm-ci-workflow.test.sh asserts the policy against the parsed workflow instead of the old per-job minute values: every job joins exactly one tier, exactly three distinct job-level values exist, the fast tier stays within 5-10 minutes, the normal budget stays at least double the modeled parallel lane sum reported by fm-test-run.sh --check-coverage, and the Herdr step tripwire stays below its job backstop with an always() cleanup after it. Concurrency supersession, shard counts, lane membership, and fail-fast settings are unchanged. * no-mistakes(review): Decouple the normal timeout from packing estimates * no-mistakes(review): Assert Herdr teardown follows the family run * no-mistakes(review): Pin Herdr family-run timeout to 20 minutes * no-mistakes(review): Ignore comments when identifying Herdr steps * no-mistakes(review): Identify Herdr steps by declarative ids * no-mistakes(document): Clarify authoritative three-tier timeout policy * fix(bin): keep supervisor status closes from waking the same home (kunchenguid#4895) * fix(bin): keep supervisor status closes from waking the same home A drain that already folded OPEN DECISIONS has presented those bytes even when the watcher has no matching seen marker. Treat that fold, and the presentation cursor, as known so the bookkeeping close stays quiet while later worker lines still signal. * no-mistakes(review): Keep folded worker failures waking past supervisor closes * no-mistakes(review): Wake on unlisted folded worker lines; batch multi-key closes * no-mistakes(review): Stop folded worker resolved lines from counting as already read * no-mistakes(document): Correct self-announced close marker contract in docs * fix(bin): stop labeling Herdr as experimental (kunchenguid#4972) * Stop steering operators away from Herdr * no-mistakes(review): Neutralize remaining Herdr opt-out documentation wording * fix(bin): treat a live no-mistakes run as current after rebase (kunchenguid#4973) * fix(bin): treat a live no-mistakes run as current after rebase A running run on the task's branch is authoritative regardless of head. Matching only the local head made a rebased in-flight run look failed. * no-mistakes(review): restrict coarse live-any-head to foreign-branch answers * no-mistakes(review): reject gate-parked runs from the executing predicate * no-mistakes(review): hoist gate-marker patterns into single run-lib owner * no-mistakes(review): require live daemon for head-free run binding * no-mistakes(review): require answered daemon-down before unbinding live runs * no-mistakes(review): extend daemon guard to anchored continuation routes * no-mistakes(review): delete live-any-head; restore dead-daemon verdict * no-mistakes(review): keep parked gates parked; name dead daemon everywhere * no-mistakes(review): set dead-daemon verdict instead of emitting early * no-mistakes(review): align selected route with legacy dead-daemon handling * no-mistakes(review): drop unproven-record binds; narrow coarse gate reading * no-mistakes(review): narrow header, drop vestigial guard, retarget tests * no-mistakes(review): revert coarse gate override; require answered-down probe * no-mistakes(review): cache one daemon probe; stop duplicating run id * no-mistakes(review): restrict coarse dead-daemon verdict to moved-off rows * no-mistakes(review): delete coarse dead-daemon extension and gate note * no-mistakes(review): delete remaining coarse dead-daemon block and stale docs * no-mistakes(document): document rebase-safe live-run bind and unverified-record verdict * fix(bin): prevent long worker launch command truncation (kunchenguid#4994) * fix(bin): stage the launch command in a private file and type a short source line A long launch line typed while the fresh pane shell is still busy waits in the terminal's canonical line buffer, which drops input past about 1,024 bytes on macOS, so the pane was left at an unfinished command with no agent running. fm-spawn now writes the assembled command to the task's own temp root under umask 077 and types only a short line that sources it. Refs kunchenguid#4559 * fix(bin): keep the per-task temp root private before staging the launch command The root lives at a predictable path under /tmp and now holds the whole launch command. Create it with mode 0700, refuse one that already exists as anything but a directory owned by this user that nobody else can write, and tighten an owned one, so no other local user can plant or swap the staged file. Refs kunchenguid#4559 * fix(bin): enforce private staged launch file mode * test(spawn): cover long staged Claude launches * no-mistakes(review): Namespace launch files and prove truncation staging * no-mistakes(review): Use immutable per-spawn launch filenames * no-mistakes(document): Document staged launch delivery safeguards * no-mistakes(ci): Updated eight behavior tests/fakes to execute or inspect immutable staged launch files instead of expecting inline launch commands. This restores Muse, secondmate lifecycle/restart, remote trace/parent binding, compact-adviser, and Orca coverage. All affected tests, dispatch-profile regression, fixture tests, syntax checks, ShellCheck, and git diff checks pass --------- Co-authored-by: Vytautas Stankus <svycka@gmail.com> * test: authorize isolated Herdr lab validation (kunchenguid#4998) * Add isolated Herdr runbook to test instructions * no-mistakes(review): Drop substring matching from test.instructions contract * no-mistakes(review): Assert commands.test key absence in YAML * Drop unit-first sentence and instructions contract test Captain-scoped follow-up on the Herdr-lab test.instructions ship: keep the lab safety runbook only, and leave the no-mistakes contract test focused on commands.test absence. * docs(vision): accept vendor-semantics and 9k AGENTS ceiling (kunchenguid#4873) (kunchenguid#5001) * docs(vision): accept vendor-semantics and 9k contract-ceiling amendments (kunchenguid#4873) Replace the pixels-of-today's-UI rule with a quarantined, version-pinned surface-adapter exception recorded as standing debt. Cap the always-loaded contract at 9,000 words and require prune-or-trigger before a crossing change lands. Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> * docs(vision): restore accepted three-sentence vendor-semantics form (kunchenguid#4873) Replace the compressed paraphrase with the issue's accepted wording: a named quarantined version-pinned adapter, expected to break, recorded as standing debt that never hardens into a shared contract. Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> * feat(bin): defer the wedge escalation for a lane parked at a supervisor-owed gate (kunchenguid#4974) * fix(watch): recheck a gate awaiting a human instead of wedge-escalating it A lane whose validation run is parked at a gate waiting on a human decision is correctly quiet, but nothing in its status line says so: the evidence is the pipeline's own gate state rather than anything the worker wrote. The wedge timer read that silence as a suspected wedge and climbed the escalation ladder for as long as the wait lasted, and each escalation cost a supervising turn. The landed declared-wait consult does not reach it, because a live ordinary crewmate never reports a declared pause, and raising FM_STALE_ESCALATE_SECS would delay genuine wedge detection for every lane by the same amount. The threshold now reads a second, independent record when the status line accounts for nothing: whether the crew's current state is a gate whose answer is owed by a human. That is minted only from the gate's own findings table, by a row whose `action` column is exactly `ask-user`, located by position out of the table header the way nm_gate_step_row already reads its row - never searched for over the run payload, where a finding's free-text description or a branch name satisfies a search just as well. A gate awaiting the CREWMATE's own answer keeps the unchanged escalation schedule, reason and demand-deep-inspection wording, because a crewmate that goes quiet before answering its own gate is exactly the wedge the ladder exists to catch. Each kind of wait now carries the human it is on, the action that clears it, and whether that human is the captain as data alongside the verdict, rather than as wording chosen per branch where the recheck is written, so the deferral cannot word one kind of wait as another and a new kind cannot ship without deciding all of them. A parked gate has no written record of when its wait began, so its recheck publishes no wait age at all rather than one read from the quiet window this deferral resets on every pass, which would report the same small number for a gate of any age. Like every other captain-facing recheck here it is absorbed in silence while the away-posture record exists, arming no throttle, so the recheck is owed in full the moment the record is archived. The consult runs only in the at-threshold branch that was about to escalate, beside the worktree walk already there, and only for lanes whose status line explained nothing. Closes kunchenguid#3055 * no-mistakes(review): require an unanswered decision before deferring a parked gate * no-mistakes(review): reset the away-silenced timer, fail-safe findings parse, US-joined wait records * test(watch): pass the pane hash wedge_timer_check now takes Upstream gave wedge_timer_check a sixth <pane-hash> argument for its dead-record probe. The malformed-wait-record rounds drive the real function directly, so they pass one, and stub fm_backend_agent_state to a live agent so the probe that runs after a refused deferral keeps the unchanged ladder rather than reading a backend the child shell has none of. * no-mistakes(review): Bind parked-gate wait to its run, owe it firstmate * no-mistakes(document): correct wait-kind count, crew-state reader scope, gate-key coupling * feat(watch): make the parked-gate wait deferral opt-in The wedge timer deferring a lane parked at a validation gate is new supervision behaviour rather than a restored one, and it decides which lanes give up the escalation ladder, so it now ships as a default-off per-home option instead of changing every home on upgrade. config/wedge-defer-parked-gate arms it. The flag is read before the decision fold, so an unconfigured home spends no fold or current-state read, writes no record, and keeps the unchanged escalation schedule, reasons and demand-deep-inspection wording; a test counts the reader calls in both directions to pin that. It is not inherited by secondmate homes: each home supervises its own crew and owns that trade separately, the same reason config/turnend-churn-absorb is home-local. The away-posture absorb returns to leaving the idle timer alone, which it had restarted only because the costly consult could reach it. A parked-gate wait is owed to the supervisor rather than the captain, so it never enters that branch, and the recheck owed on return is again owed in full the moment the record is archived. * test(watch): pin that the away-silenced hold leaves the idle timer alone The absorb no longer restarts the timer, so the recheck owed on return is owed in full rather than a cadence into the return. Nothing asserted that, so a restart could be reintroduced silently. * no-mistakes(review): document away-silence rationale, pin captured gate component * no-mistakes(test): anchor gate row scan to the braced findings header * no-mistakes(document): pin same-block gate row invariant in crew-state comment * fix(bin): reclaim a task whose herdr endpoint was destroyed (kunchenguid#5007) * fix(control): let the owning seat reclaim a task whose endpoint is gone A destroyed pane or workspace made `missing` a terminal state. Relaunch accepted only `dead` and said to stop the agent first; exit refused `missing` and said to reconcile the task first; there is no reconcile verb. Each command named the other as its prerequisite, so a task whose terminal went away could not be reclaimed by anything, and a no-mistakes approval it was parked on had no seat left to answer it. `missing` is agent-free a fortiori: there is no endpoint, so there is no agent in it. Widen the existing guards rather than add a verb. - fm-spawn --relaunch accepts a positively proven `missing` and creates one fresh endpoint in the recorded worktree; the record it already republishes rebinds the task to it. A `dead` endpoint is still adopted in place. - fm-control exit reports `endpoint-gone` instead of dying, so the relaunch transaction's stop step no longer dead-ends, and re-resolves the endpoint from the record before verifying the replacement. The duplicate-agent refusal is untouched: both verdicts come from the same recovery-grade classifier, which claims `missing` only from positive absence, so `alive`, `ambiguous`, and `unreadable` all still refuse. The backends' own create paths refuse a live same-labeled endpoint as a second independent guard. The worktree, its branch, commits, uncommitted changes, armed poll and registration, record rows, and status log are all untouched - a reclaim is a recovery, never a teardown. A secondmate is excluded: its gone-endpoint recovery already has one owner in the session-start liveness sweep, so relaunch refuses and names it rather than becoming a second path to the same outcome. Tests reproduce both halves of the deadlock, the reclaim succeeding, unlanded work surviving it, and the refusals that still hold. * no-mistakes(review): prove endpoint absence per backend before reclaim rebinds * no-mistakes(review): give exit and relaunch one absence proof; pin herdr rebind session * no-mistakes(review): narrow endpoint reclaim to herdr; tmux refuses honestly * no-mistakes(review): stop refusals and docs asserting unestablished causes * no-mistakes(review): stop herdr fixture helper losing tmp-root registration * no-mistakes(review): document workspace drift and absence-probe server residue * no-mistakes(review): correct rebind limitation to its one reachable case * no-mistakes(review): stop claiming reclaim leaves instructions untouched * no-mistakes(document): scope fm-control-lib purity claim, note reclaim coverage * no-mistakes(rebase): read the staged launch file in the herdr fixture Rebasing onto main picked up kunchenguid#4994, which stages a long worker launch command into a script and delivers the short `. '<path>'` line instead of the literal command. The tmux fake and tests/fixtures.sh were updated for that; the herdr fake this branch adds was written before it and still keyed "an agent now exists on this pane" off the literal `encode launch-brief` text, so after the rebase it never marked the rebound pane live and the reclaim's alive-wait read `dead`. Dereference the staged file first, exactly as the tmux fake above does. Test-fixture only; no production path changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * no-mistakes(document): note reclaim placement in herdr and scripts inventories --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(bin): stamp status events with their emission time (kunchenguid#3764) * test(status): reproduce missing event emission time * wip(status): preserve optional event emission time * test(status): document indirect clock stub invocation * no-mistakes(review): Preserve historical status bytes during reply recovery * no-mistakes(test): Fix timestamped status assertions and remote fixture dependencies * no-mistakes(review): Preserve captain regex overrides for timestamped status events * no-mistakes(document): Clarify status event timing and publication contracts * no-mistakes(lint): Quote literal done to satisfy ShellCheck * no-mistakes(ci): Captain, updated .github/workflows/ci.yml to expect 19 snapshot tests instead of 18, matching the PR’s added regression. Reproduced the failure before the fix. Stock Bash 3.2.57 verification passed: parse sweep, 19 snapshot tests, 53 Bearings tests, and the public-followup regression. Workflow lint and diff checks passed * no-mistakes(test): Preserve terminal notifications with malformed timestamp tags * no-mistakes(test): Stamp Rovo spawn failures with emission time * no-mistakes(document): Verify status event documentation * no-mistakes(lint): Fix ShellCheck quoting in status emission-time tests * no-mistakes(ci): Captain, fixed four lifecycle assertions to accept emission timestamps while preserving publication and retry checks. Reproduced the CI failure before the fix. The lifecycle suite now passes with six Beads capability skips; syntax, targeted ShellCheck, and diff checks passed * no-mistakes(ci): Captain, fixed malformed timestamp colons hiding actionable events using shared normalization. Original bytes and unknown ages are preserved. Regression reproduced before the fix; classifier and remote-reply suites, targeted lint, syntax, and diff checks passed * no-mistakes(review): Stamp remote escalations at call sites, drop new flag * no-mistakes(review): Accept stamped escalation and close lines in test assertions * no-mistakes(review): Restore reserved-key answered-note guard for stamped closes * test(status): accept optional emission time in PR-provenance assertions The kunchenguid#4148 provenance test landed on main with exact unstamped greps. Parent-channel lines from this branch carry [at=<epoch>], so strip only that tag before the same exact match. No production change. * no-mistakes(review): Accept stamped ready signal in PR fallback scrape * no-mistakes(review): Drop relay flag, stamp parent events at call sites * no-mistakes(review): Stamp worker terminal-signal instructions, revert fm-on fixture * no-mistakes(review): Accept optional stamp in live cmux drift guard * no-mistakes(review): Restore original test invocation order in two suites * no-mistakes(review): Strip only well-formed numeric status time tags * no-mistakes(document): Drop stale unstamped PR-ready line spelling from channel doc * no-mistakes(review): Stamp agy spawn-failure status lines with event time * fix(bin): normalize status event times in-shell and freeze the budget test clock Two paths made a status event's emission time cost more than it should. The captain-relevance fallback piped every line through awk to drop a well-formed `[at=<epoch>]` tag before matching, so a supervisor sweep paid a fork per line just to prepare a regex match. Shell parameter expansion does the same strip with no fork, and the retry-dedup scan now reuses that one helper instead of carrying a second copy of the rule in awk. The copies had already drifted: the shell side stripped tags from lines with no colon, which the awk rule left whole, so a colonless line could be mistaken for one already recorded. One definition, checked against the awk rule it replaces over the edge cases and a 4000-line fuzz. tests/fm-contributions.test.sh froze its fixture clock only in exhaust mode. In hang mode the poll set DEADLINE to the real now plus a one-second budget, and when the second ticked before the first forge call the loop broke without ever calling gh: forge/calls was never written and the assertion failed reading a missing file. Freezing the clock in both modes removes the dependence on wall time; the bounded call is still cut by the real timeout, so the observation the test asserts still starts. Emission time stays optional on new status records, and legacy or malformed lines keep an unknown age. * no-mistakes(review): Stamp ask-user escalation line and fix Kimi status assertion * no-mistakes(document): Drop stale unstamped done-line spelling from watcher docs * test: fold emission-time snapshot coverage into the fixture case Drop the incidental ci.yml 18-to-19 count hunk so the PR no longer touches workflows. Keep every emission-time assertion by folding it into test_fixture_snapshot_json. * no-mistakes(review): replace brief date substitution with epoch placeholder; drop emitted_at_epoch * no-mistakes(review): align untimed normalizer with epoch parser; tolerate placeholder stamp in PR scrape * no-mistakes(review): strip undelimited at-tags; correct brief stamp header * no-mistakes(review): normalize stamps at both captain-regex sites; restore mtime freshness * no-mistakes(review): strip colon-bearing stamps for relevance; fix headers and test oracles * no-mistakes(review): narrow escalation match to stamp tolerance; pin note verb * no-mistakes(review): read note and key past colon-bearing stamps * test(status): keep inactive reconcile assertions stamp-tolerant These two oracles were made stamp-tolerant while resolving one of the branch's merges from main. The rebase drops merge commits, so that adaptation was lost and both assertions went back to matching an exact substring that a stamped line no longer contains: the tag lands before the colon, so "failed [key=k]: ..." is now "failed [key=k] [at=N]: ...". Strip a well-formed tag before matching, as the branch's other oracles do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * no-mistakes(review): unstamp fold colon tests; reserve stamp width in cap * no-mistakes(document): correct stale unstamped status-line spellings in docs * no-mistakes(document): quote brief-test literals for lint; correct stamp-helper contract comments * no-mistakes(ci): rename subshell-local epoch in delivery-race stub The serialization test overrides fm_pending_reply_mark_delivered inside a (..) subshell. Its `epoch` local collided with the same name in status_line_at_epoch/status_stamp_line, which this branch added and this suite now calls at top level, so ShellCheck 0.11.0 reported SC2030 and failed Lint 2. The stub already prefixes its other locals with `pending_` for the same reason; `epoch` was the leftover. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(discord): add self-hosted Discord connector ingestion and reply path * fix(discord): enforce DM flag, add poll cursor, add reply send progress - FM_DISCORD_ALLOW_DMS was exported but never checked in fm-discord-poll.js; DMs were ingested unconditionally. Now skipped when the flag is false. - The poller fetched only the newest 10 messages with no cursor, so a burst of 11+ messages between polls could permanently skip an older mention. Now persists a per-channel last-seen message id and polls with after=. - Multi-chunk replies in fm-discord-reply.js had no per-chunk progress, so a retry after a partial failure would repost already-delivered chunks. Now persists send progress per request id and resumes from the first unsent chunk, clearing the record on full completion. * no-mistakes(review): Fix Discord cursor, endpoint ownership, and poller regression coverage * no-mistakes(review): Pass expected labels through backend reaper kill dispatch * no-mistakes(review): Pass validated Zellij tab IDs through inactive reaper * no-mistakes(review): Add default Discord DM channel discovery * no-mistakes(review): Guard terminal reaping against endpoint reuse * fix(discord): silence SC2034 on cross-file token global, drop leaked .omo evidence files .omo/evidence/*.md were pipeline review artifacts accidentally committed; add .omo/ to .gitignore to stop recurrence. * fix(test): pin dismiss call to the scenario's mocked clock in fm-x-mode fm-x-dismiss.sh now sources fm-discord-lib.sh and calls fm_discord_is_selfhosted_request, which reads the context registry and triggers fmx_context_registry_prune as a side effect. The dismiss call in this test had no FMX_NOW_OVERRIDE, so prune ran against the real wall clock, saw the offer marker's FMX_NOW_OVERRIDE-stamped recorded_at as ~2.8 years old, and deleted it, causing a spurious re-offer. Give the dismiss call the same mocked clock as the surrounding poll calls. --------- Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com> Co-authored-by: Tiago <tiagop@hey.com> Co-authored-by: rovermike <mike@rovertown.com> Co-authored-by: Vytautas Stankus <svycka@gmail.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> Co-authored-by: Amin Roudaki <roudaky@gmail.com> Co-authored-by: Jon Roosevelt <rooseveltadvisors@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat: enable advisory Jev review assist * no-mistakes(review): Fix fail-closed cleanup and CLAUDE migration trigger * no-mistakes(review): Fix terminal cleanup proof and backend label regression * no-mistakes(review): Harden home-scoped Zellij and cmux cleanup proof * no-mistakes(review): Remove unmapped config and refresh cleanup contract * fix(docs): correct jev.review_assist as per-operator global config Verified against no-mistakes v1.79.0's own e2e tests and upstream PR kunchenguid#1120: jev.review_assist is global-only and has no effect when set in a repo's tracked .no-mistakes.yaml. Revert that no-op change and document the real activation path, data sent, and data-boundary guidance instead. * no-mistakes(document): Clarify Jev advisory configuration and data boundary * no-mistakes(document): Document cleanup, relaunch, and Jev contracts * no-mistakes(review): Enabled Jev opt-in and bounded cleanup; focused tests pass * no-mistakes(review): Correct Jev scope and review data-boundary documentation * no-mistakes(test): Fix changed-test mapping for committed review evidence * no-mistakes(document): Correct stale documentation and audience inventory * chore: gitignore .stow-notes.md * no-mistakes(review): Restore Jev opt-in and Herdr cleanup contract * no-mistakes(test): Fixed backend fixture; targeted test passes * no-mistakes(ci): Fixed the CI failure in tests/fm-secondmate-sync.test.sh by making the Herdr fixture provide session-lock metadata and model pane-close disappearance, allowing respawn metadata to rotate. Verified with the targeted sync test, fm-backend-herdr.test.sh, bash -n, and git diff --check --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* docs(fmx-respond): add optional SOUL/USER persona overlay for Discord/X replies Ports gajae-way's persona-loader pattern (SOUL.md/USER.md tone layer) as two optional, gitignored, captain-private config files that fmx-respond may consult when composing public replies - never overriding the address rule, public-safety limits, or conciseness already in force. 🤖 Generated with [Claude Code](https://claude.com/claude-code) * no-mistakes(document): Document Relay persona overlays --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat: apply response style across Firstmate invocations * no-mistakes(review): Apply full response style to worker progress reports --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat: show bounded session-start work overview * no-mistakes(test): Parse tasks-axi totals; bounded completion notice verified * no-mistakes(document): Document bounded session-start completion summary * no-mistakes(lint): Fix ShellCheck parsing of completed backlog listing --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat: make progress and recovery reporting evidence-led * no-mistakes(review): Add auditable follow-up counts and unchanged-attempt pivots * no-mistakes(review): Activate recovery after one unchanged bounded attempt * no-mistakes(document): Clarify progress and completion reporting contract --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* fix: require verbatim captain content in briefs, name per-lane runtime Two prose-only follow-ups from the 2026-09-24 session incident review: brief scaffolding did not say pasted/attached captain content must be copied verbatim rather than summarized, and parallel-lane status reports had no requirement to name which runtime each lane actually runs on. * no-mistakes(review): Clarify brief link-preservation contract --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* fix(teardown): accept archived backlog closures * no-mistakes(review): Corrected quote matching; archived teardown regression still fails * no-mistakes(test): Match escaped archived-Done errors in teardown fallback * no-mistakes(document): Document archived Done teardown behavior --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat: suggest ready work when quota has headroom * no-mistakes(review): Removed priority gating from quota proposals; regression test passes * no-mistakes(document): Document quota-aware autostart proposal --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat(bin): add Agenttrail Kitchen worktree helper * no-mistakes(review): Filter valid distinct worktrees before applying the cap * no-mistakes(review): Include secondmate child worktrees in dashboard selection * no-mistakes(review): Lift snapshot bounds before selecting supervised worktrees * no-mistakes(test): Bind snapshot paths in helper jq selection * no-mistakes(document): Document Agenttrail Kitchen helper --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
…pproved) (#24) * feat: adopt guarded Jev tools for Claude Code * feat(jev): harden safety gate and document cross-harness architecture (Codex-approved) --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat: push captain decisions to self-hosted Discord * no-mistakes(review): Restrict Discord decision replies to authorized user IDs * no-mistakes(review): Retry pending Discord decisions and sanitize hold answers * no-mistakes(review): Persist Discord notification intent before profile lookup * no-mistakes(review): Recover stranded Discord decision reply wakes * no-mistakes(document): Correct Discord decision documentation * no-mistakes(ci): Fixed the Lint 2 ShellCheck SC2034 failure by exporting the configured authorized-user ID output from `fm_discord_load_config`. This preserves the existing flow into `fm-discord-poll.sh` and the poller’s authorization check. `bin/fm-lint.sh --partition 2of2` and `git diff --check` passed * no-mistakes(document): Document Discord decision notifications and tools * no-mistakes(ci): Fixed both CI causes. Behavior: CI now installs uv for the portable serial test lane, resolving the Jev safety test’s `uv: command not found`; `docs/jev-tools-adoption.md` is classified as `maintainer-verification`, resolving the audience check. Lint: annotated the Jev test’s source path to the existing `tests/lib.sh`. Verified with the focused Jev test, documentation audience test and checker, ShellCheck, actionlint (3 workflows valid), and `git diff --check`; all passed --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* docs: record jev-review adoption decision * no-mistakes(document): Document Jev review evaluation and non-adoption --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat: add cost/cache/error telemetry, blocker columns, and unanswered-questions table to bearings board Extend fm-bearings-board.v1 with an optional metrics object (cost caps, cache hit rate, tool error rate, context-read misses, auto-continues, milestone task counts) and an optional underway blocker field. The board renders real values when present and an honest "no data" card when this fleet has no live source for a metric, rather than fabricating a number. Charted Next and Underway rows gain a labeled blocker column, and a new Unanswered Questions table reads directly off captains_call. * no-mistakes(review): Unify task table, add urgency, correct zero-call rate * no-mistakes(review): Unify task table and fix blocker coverage * no-mistakes(review): Disclose omitted tasks and restore warning alarms * no-mistakes(review): Filter blocker urgency to live dependents * no-mistakes(review): Clarify blocked rows and stabilize urgency tests * no-mistakes(review): Preserve legacy v1 blocker summary compatibility * no-mistakes(review): Preserve uncapped captain hold filing dates * no-mistakes(document): Align Bearings guidance with unified task table * no-mistakes(ci): Updated the Bearings test-count assertion in `.github/workflows/ci.yml` from 59 to 60, matching the CI run’s output. `/bin/bash tests/fm-bearings-snapshot.test.sh` passed locally; `git diff --check` passed. The edit hook reported `yaml-ls` is unavailable; no tool configuration was changed --------- Co-authored-by: irene <irene@ireneui-MacBookPro.local>
Co-authored-by: irene <irene@ireneui-MacBookPro.local>
* feat(discord): notify on task done/blocked/failed, not just pr-ready Captain asked for a Discord ping on every completed task plus failures and auth/approval blockers, not just the existing merge-ready notification. * no-mistakes(review): Update stale doc/comment, add tests for done/blocked/failed notify
…nel (#81) * feat(procevent): watch Claude mentions in Firstcrew channel * no-mistakes(review): Raise terminal error when MAX_PAGES cap hit before reaching cursor * no-mistakes(review): Add pagination-cap-exceeded to shell terminal classifier * no-mistakes(lint): fix(discord-mention): remove unreachable exit after usage call * no-mistakes(ci): Fixed 2 CI failure: Lint 2 missed `# shellcheck source=bin/fm-discord-lib.sh` directive before `source "$SCRIPT_DIR/fm-discord-lib.sh"` in bin/fm-procevent-discord-mention.sh:11, causing SC1091 "does not exist" since ShellCheck could not resolve path without hint (sibling scripts fm-discord-poll.sh, fm-discord-notify.sh, etc. all carry this directive). Behavior portable serial 3 failed because docs/plans/discord-mention-watch-adapter-20261002.md (added in PR) was tracked but missing from docs/documentation-audiences.json, failing tests/fm-documentation-audiences.test.sh's completeness check; classified it maintainer-architecture, matching sibling internal decision docs. Verified: shellcheck clean on changed file, fm-documentation-audiences.test.sh, fm-vendor-auth-probe.test.sh, fm-harness-adapter-references.test.sh, and fm-procevent-discord-mention.test.sh all pass
Prevents the no-key fallback test from sharing process.cwd() with other fast-jev tests via session.cwd(), the same isolation pattern already used by the with-key test.
…ript (#85) * feat(procevent): add other-tool-session-watch detector Record the unchanged executable script that is already armed and operating; this adds version control only. * no-mistakes(lint): Suppress SC2009 for intentional ps|grep in session watch script
* docs: define model dispatch rigor * no-mistakes(review): docs: drop fabricated ownership-check citation in model-dispatch-rigor.md * no-mistakes(document): docs: register model-dispatch-rigor.md in documentation-audiences inventory
… entry (#87) * feat(spawn): refuse opencode dispatch on unhealthy free-model catalog entry Checks the project's weekly-scanned opencode-free-models.json (IMAC AutomationSync knowledge, falling back to data/) after the existing models.dev zero-cost check, so a model that is still listed and free but already flagged early_termination_detected or non-active is caught before dispatch instead of mid-task. A missing or non-matching catalog warns and proceeds, since it is a secondary enrichment signal. * no-mistakes(review): docs: document mechanical fm-spawn.sh free-model gate and dual-path lookup * no-mistakes(document): docs: sync opencode harness ref with new health-catalog gate * fix(spawn): fix opencode mini detection regex, keep legacy interactive fallback, and support catalog override
…89) A Discord reply to one of the bot's own messages was dropped whenever the user did not also @mention the bot: the guild-channel poll filter required isMentioned or a literal bot mention. The captain answers a bot post by replying to it, and Discord adds no mention for that, so the command never reached firstmate. Treat a reply whose referenced message was authored by the bot as an inbound mention, and discover the bot's DM channels even when FM_DISCORD_CHANNEL_ID names a guild-channel allowlist. Carry the author id in the captured payload so firstmate can authorise before acting on it. Regression coverage: reply to a bot message with and without a mention, a reply to a member still ignored, and a DM command captured under a configured channel allowlist.
) fm_lock_try_acquire reacquired its own ".steal" mutex through a recursive call, so a stale steal lock (e.g. left by an interrupted recovery) made every recovery attempt nest one more ".steal" level until path names exceeded ENAMETOOLONG. Acquire the steal mutex without nesting its own steal recovery and reclaim at most one verified-dead, non-fresh steal level directly, preserving the PID-identity safety contract. Adds a focused regression covering a stale primary lock with a stale two-level .steal chain.
* feat(discord): clarify decision requests * no-mistakes(document): Document Discord decision notification details
…t hermeticity (#94) * Discord: send only captain-action requests and done outcomes Remove blocked/failed status notifications from Discord; keep done, pr-ready (yolo=off), captain-hold, and perm-ask paths. Add dedup marker for done messages to prevent duplicate posts across polling cycles. Update tests and docs. * no-mistakes(review): Write Discord completion markers only after successful delivery * no-mistakes(review): Suppress active PR monitoring completion alerts * no-mistakes(review): Keep unconfigured completion notifications silent and retryable * no-mistakes(review): Gate completion alerts on authoritative terminal state * no-mistakes(review): Suppress completion alerts for open PR decisions * no-mistakes(review): Publish completion markers as private JSON artifacts * fix(lint): quote the done literal in the Discord completion state check ShellCheck SC1010 reads an unquoted 'done' inside a test as the reserved word rather than a literal, so the comparison is quoted explicitly. * fix(discord): suppress routine progress notifications and enforce test hermeticity
The self-hosted Discord ingress is polled outside the watcher as well as inside it: a LaunchAgent or cron runner executes bin/fm-discord-poll.sh directly, so its stdout is a log file. The poll already enqueues every captured x-mention into the durable wake queue, which is what keeps such a mention from being consumed by its one-shot offered marker without ever reaching a session. Nothing locked that invariant in place, so a regression back to stdout-only wakes would silently return every out-of-band mention to the log. This adds the coverage that fails if it does.
* Serialise stale lock reclaim with a kernel-flock guard file - Replace unconditional check-then-remove with a persistent advisory lock (.reclaim-guard sidecar, a doc'd state artifact) covering the whole remove+create critical section of fm_lock_try_acquire. The guard is acquired by spawning perl flock on an inherited FD whose OFD persists until the shell closes it, so kernel releases it on process death and it can never itself go stale. Two slots bound nesting to primary (slot 9) and steal (slot 8) so no recursive self-deadlock. - allow_steal=no steal-mutex cleans one bounded stale level, inside the same guard, and never recurses, so the previous allow_steal=yes -> no chain in fm_lock_try_acquire cannot again grow .steal suffixes into ENAMETOOLONG. - Post-create re-verifies the new link actually points to the fresh owner before rc=0. - Regressions: stale .steal simlock chain smoke test, compare-and-remove stub probe (dead-vs-live) and a two-process concurrent-recovery test asserting exactly one winner and no suffix growth. * fix(wake): wrap exec fd close in compound command to prevent stderr silencing * no-mistakes(test): Reuse prior wake acknowledgement token after replay * no-mistakes(test): Stabilize wake acknowledgement and isolate guard fixtures * no-mistakes(document): Document bounded lock recovery and PID safety * no-mistakes(lint): Fix ShellCheck findings in wake queue tests * no-mistakes(test): Wait for drain PID ownership before interrupting replay test * no-mistakes(test): Wait for recovery handling state before interrupting drain * no-mistakes(lint): Resolve ShellCheck SC2015 with explicit control flow * fix(test): populate test default home dirs and satisfy lint * fix(test): neutralize credentials without exporting ambient FM_HOME * fix(test): keep FMX tokens unset rather than exporting empty strings * fix(test): unset Discord tokens instead of exporting empty strings The public-surface hermeticity suite asserts the shared test library leaves every public-surface credential genuinely unset. Exporting them as empty strings satisfied fm_discord_load_config's 'defined' check but reported an empty value rather than unset, and left the credential scrub looking effective when it was not. Pin FM_HOME to the synthetic credential-free home again so the .env fallback stays blocked without defining the tokens. * fix(test): scrub inherited Discord token alias * no-mistakes(review): Preserve caller descriptors and synchronize concurrent recovery test owners * no-mistakes(document): Clarify lock recovery and credential isolation documentation * no-mistakes(lint): Fix ShellCheck empty assignment and intentional subprocess quoting * no-mistakes(ci): Fixed fixture FM_HOME binding in Cursor and Grok adapter regressions. Reproduced both failures, then bound all sibling Grok fixture paths to their isolated case homes. Passed: `bin/fm-lint.sh tests/fm-cursor-primary.test.sh tests/fm-turnend-guard.test.sh`, `bash tests/fm-cursor-primary.test.sh`, `bash tests/fm-turnend-guard.test.sh`, and `git diff --check` * fix: drain harness list before returning * fix: drain harness list before support verdict
The captain decision message packed five labeled fields onto one line and joined the options with " / ", which is hard to scan. Split the fields with blank lines and put each option on its own numbered line, keeping the "필요한 결정:" and "권장안:" labels and the reply instruction. Drop the "(번호로 답장)" hint: nothing maps a numeric reply back to an option, so inviting one risked a resolution record that reads "answered: 2".
Record the thin read-path glue for an optional cross-session memory repo (agent-memory-repo skill): MEMORY.md index first, topic grep/links only as needed, advisory data and never a runtime dependency, volatile facts re-verified from Git, write only when asked. No startup injection, writer, or curator is added.
* feat(discord): captain command channel for mention-free requests Adds an explicit opt-in channel list where an authorized captain's plain message is an inbound Firstmate request, without typing @FIRST Crew (which forces a Korean/English IME round-trip on every call). - bin/fm-discord-lib.sh: resolve FM_DISCORD_COMMAND_CHANNELS (one place); a command channel that is also excluded is dropped with an explicit diagnostic (exclusion wins). - bin/fm-discord-poll.js: allow the mention-free path only when the polled channel is a command channel AND the author is authorized; bot messages and unauthorized authors are still ignored. - bin/fm-discord-poll.sh: export the resolved command channels to the poll. - docs/configuration.md: document the setting and how it differs from the polling allowlist. - tests: authorized+command-channel plain -> captured; unauthorized -> ignored; ordinary channel plain -> ignored; duplicate poll -> one inbox record; command/exclusion conflict -> fail-safe diagnostic. Preserves #89 (reply to bot), #93 (durable wake on capture), DM polling, and the existing @mention fallback; all inputs still normalize to the same discord-selfhosted x-inbox + durable-wake path. * no-mistakes(document): Document Discord command channel configuration * no-mistakes(lint): Replace ls/grep inbox count with glob loop
* fix(opencode): port firstmate plugins to v2 * no-mistakes(review): Normalize v2 event payloads for plugin handlers * no-mistakes(test): Cover v2 event payloads in plugin contract tests * no-mistakes(document): Document OpenCode v2 primary plugin contract
The session lock recorded a single harness pid, which on Codex and OpenCode resolves to the long-lived server every session shares: `codex app-server` or `opencode serve` outlives the session that recorded it, so a dead session's lock still read as live, two sessions of one server claimed the same ownership evidence, and pid reuse could never be told from a live owner. Identity now has three separable parts and every liveness question asks all three: the anchor pid plus its own start time, harness identity (a shared server is never a session), and session identity (Claude's session id, Codex's thread id, or the pane id a shared server passes down to its tool shells). The lock anchor skips shared servers and resolves the session's own process by pane identity when its ancestry holds only one, and refuses when it cannot resolve itself rather than anchoring on something that outlives it. The sidecar beside the lock records all three, so a pid the OS recycled reads as a dead owner. Regression coverage pins all four reported failures against the real daemon shapes across Claude, Codex, and OpenCode.
|
| listing=$(ps eww -A -o pid=,args= 2>/dev/null) | ||
| while IFS= read -r line; do | ||
| pid=${line%% *} | ||
| case "$pid" in '' | *[!0-9]*) continue ;; esac |
There was a problem hiding this comment.
Padded process rows break locks
fm_session_lock_pane_session_pid drops padded ps rows. With a row such as 610 /path/opencode ..., pid=${line%% *} produces an empty string, so the next check skips the process. A session whose tool shell descends only from a shared server then cannot find its pane's owner, and fm-lock.sh refuses acquisition. Trim leading whitespace before splitting the row, and cover padded output in the fixture.
Knowledge Base Used: Session orchestration
| const isMentioned = Array.isArray(msg.mentions) && msg.mentions.some((m) => m.id === botId); | ||
| const contentHasBotMention = msg.content && (msg.content.includes(`<@${botId}>`) || msg.content.includes(`<@!${botId}>`)); | ||
| const isReplyToBot = msg.referenced_message?.author?.id === botId; | ||
| const isCommandChannel = commandChannels.has(chId) && authorizedUserIds.has(msg.author?.id); | ||
|
|
||
| if (!isDM && !isMentioned && !contentHasBotMention && !isReplyToBot && !isCommandChannel) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Strangers can issue fleet requests
Ordinary mentions, DMs, and replies to the bot bypass authorizedUserIds. A user outside FM_DISCORD_AUTHORIZED_USER_IDS can mention the bot and have their text written to x-inbox. fmx-respond treats that text as a captain instruction and may file or dispatch work. Apply the author check to every inbound command path, not just bound decisions and mention-free command channels.
How this was verified: The ordinary-message branch accepts mentions without checking the author, writes them to the captain inbox, and the responder instructs Firstmate to act on that inbox as captain requests.
| local id=$1 meta=$2 status last previous state note pr mode yolo data incarnation fingerprint predecessor_head outcome_key line | ||
| status="$STATE/$id.status" | ||
| last=$(child_terminal_ledger_line "$status") || return 0 | ||
| reap_terminal_child_locked "$id" "$meta" || true |
There was a problem hiding this comment.
Old outcomes kill replacement workers
The ledger-first path now kills the endpoint whenever its latest event is done or failed, without checking whether the worker has restarted. Relaunch preserves the status history and only writes working: spawned when the file is empty. A relaunched Herdr worker still carrying its previous terminal event is therefore killed by the secondmate's next ledger scan before it reports a new event. Require current evidence tied to the worker's generation before closing its endpoint.
Knowledge Base Used: Session orchestration
| const referencedMessageId = msg.message_reference?.message_id; | ||
| const notification = referencedMessageId ? decisionNotifications.get(referencedMessageId) : undefined; | ||
| if (notification) { | ||
| if (!authorizedUserIds.has(msg.author?.id) || notification.record.channel_id !== msg.channel_id || notification.record.replied_to) continue; |
There was a problem hiding this comment.
Corrected decision replies disappear
persistDecisionReply marks the notification replied_to as soon as it captures a reply. The poll loop then ignores every later reply. If the captain's first permission answer is unclear, fmx-respond correctly leaves the request pending, but a corrected answer to the same message can never reach it. Keep reply capture separate from decision completion, and accept a new authorized answer while the decision remains pending.
| writeFileSync(inboxFile, JSON.stringify(payload, null, 2), { mode: 0o600 }); | ||
| writeFileSync(contextFile, JSON.stringify(contextRecord, null, 2), { mode: 0o600 }); | ||
| writeFileSync(offeredFile, JSON.stringify({ request_id: reqId, recorded_at: Math.floor(Date.now() / 1000) }), { mode: 0o600 }); | ||
|
|
||
| console.log(`x-mention ${reqId}`); |
There was a problem hiding this comment.
Captured requests lose their wake
The poll writes offeredFile before its wake reaches the durable queue. If the process exits between those steps, or fm_wake_append fails, the inbox survives but every later poll skips it because the offered marker already exists. The wrapper's promised retry cannot happen. Record wake delivery only after enqueue succeeds, or recover pending inbox entries independently of the Discord cursor and offered marker.
| env -u CLAUDE_CODE_SESSION_ID -u CLAUDE_PID \ | ||
| FM_HOME="$dir" FM_LOCK="$ROOT/bin/fm-lock.sh" PATH="$bin:$PATH" \ | ||
| "$NAMED_CLAUDE" -c 'CLAUDE_CODE_SESSION_ID=S1 CLAUDE_PID=$$ "$FM_LOCK" > "$FM_HOME/state/acquire.out" 2>&1; printf "%s\n" "$?" > "$FM_HOME/state/acquire.rc"' | ||
| expect_code 0 "$(tr -d '[:space:]' < "$dir/state/acquire.rc")" \ | ||
| "the session could not acquire its lock: $(cat "$dir/state/acquire.out")" | ||
| [ "$(wc -l < "$dir/state/.lock-session" | tr -d '[:space:]')" = 2 ] \ | ||
| || fail "an unreadable birth token was written as a sidecar line" |
There was a problem hiding this comment.
The new tests still assume every birth token comes from ps -o lstart. On Linux, fm_session_lock_birth_token reads /proc first. test_unreadable_birth_token_is_omitted therefore writes three sidecar lines despite its two-line assertion. The refreshed-sidecar check also compares a linux-starttime= token against an lstart date. Isolate fallback tests with FM_PROC_ROOT_OVERRIDE and make the refreshed-token assertion use the selected token format.
| local -a kitchen_args=(/Users/irene/.local/bin/agenttrail-kitchen "${project_args[@]}") | ||
| printf -v command_string '%q ' "${kitchen_args[@]}" | ||
| command_string=${command_string% } | ||
| printf '%s\n' "$command_string" | ||
| if [ "$mode" = run ]; then | ||
| /Users/irene/.local/bin/agenttrail-kitchen "${project_args[@]}" |
There was a problem hiding this comment.
Dashboard launch requires one account
fm-agenttrail-kitchen.sh executes /Users/irene/.local/bin/agenttrail-kitchen directly. A captain who installs the tool on PATH under another account cannot use --run, and the default preview prints an unusable command. Resolve the executable from PATH or a private configurable override. This violates the owner requirement to align with VISION.md, which says the shared surface must stay generic and captain-agnostic.
Context Used: If there is a VISION.md file at the root of the repo, the PR must not conflict / diverge / drift from it. If the PR description has an "Intent" section, respect that as the accepted user intent. - Do make comments if anything in the implementation ... (source)
| if [ -z "${FM_STATE_OVERRIDE:-}" ] \ | ||
| && [ "$(cd "$FM_HOME" && pwd -P)" = "$(cd "$FM_ROOT" && pwd -P)" ]; then | ||
| if ! FM_HOME="$FM_HOME" "$SCRIPT_DIR/fm-procevent-bot-manager.sh" ensure >/dev/null 2>&1; then | ||
| fm_wake_append check bot-manager-autofix-source \ | ||
| "check: Bot Manager issue source could not be armed; inspect its registration and adapter" || exit 1 |
There was a problem hiding this comment.
Unconfigured homes launch Notion polls
The watcher automatically registers bot-manager-issues in every primary home, even when its required ~/.claude/prompts/discord-bot.env does not exist. The poll then exits without a result, leaving the source armed for repeated launches. Gate registration on an explicit local opt-in and usable configuration. An unrelated fresh clone should not acquire this personal Notion source.
| const message = await priorMessage(record, botId); | ||
| if (message) { | ||
| saveRecord(recordPath, { ...record, state: "sent", message_id: message.id }); | ||
| return message.id; | ||
| } |
There was a problem hiding this comment.
Split reports lose their ending
Completion recovery treats the first posted chunk as the entire report. postPlain puts the nonce only on chunk one. If a later chunk fails, postCompletion finds chunk one on retry and marks the whole record sent, so the rest is never delivered. Track each chunk's progress or give each chunk its own stable identity before marking the report complete.
| const result = spawnSync("quota-axi", [ | ||
| "--provider", "claude", "--json", "--no-credential-refresh", | ||
| ], { encoding: "utf8", maxBuffer: 1024 * 1024 }); |
There was a problem hiding this comment.
The default board build waits for quota-axi, but the new spawnSync call has no timeout. A stuck quota read prevents the board from being published even though missing metrics already have a supported no-data display. Add a timeout to the quota read and a budget for the metrics pass, then fall back to missing metrics.
Intent
The per-home firstmate session lock anchored on a single harness pid, which on Codex and OpenCode resolves to the long-lived server every session shares, so a dead session's lock still read as live, two sessions of one server each claimed the same ownership evidence, and a pid the OS had recycled could never be told from a live owner. Make the lock's identity distinguish process identity (the anchor pid plus its own start time), harness identity (a shared server is never a session), and session identity (Claude's session id, Codex's thread id, or the pane id a shared server passes down to its tool shells), so that a session ended with its server still alive reads the lock as stale, two sessions sharing one server hold distinct ownership evidence, a live owner cannot be reclaimed, and a recycled pid does not pass as a new owner. Claude's model-loop identity is the reference implementation. Judge owner liveness from all three identity parts, never from pid existence alone, and never fix this by swapping the daemon pid for some other arbitrary pid.
What Changed
Risk Assessment
✅ Low: The target commit applies the recorded harness check to every identity path and clarifies the chosen ancestry rule; no defect found in those changes.
Testing
The focused session-lock regression exercised shared-daemon anchoring, distinct session evidence, live-owner protection, and recycled-PID rejection using deterministic fixtures. Live Codex validation could not run because the documented
bin/fm-lab-home.shhelper is absent; the temporary lab directory was removed. No screenshots were produced because no UI session was started.bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
.agents/skills/afk/SKILL.md- branch carries 91 commit(s) that exist on your local main branch but were never pushed to origin/main; these may be unintended bundled work (proposed PR changes 257 file(s)):Confirm these commits belong in this PR before approving, or manually separate the intended work onto origin/main before gating.
🔧 **Review** - 2 issues found → auto-fixed (7) ✅
bin/fm-session-lock-lib.sh:113---serviceand--managed-daemonare searched anywhere in flattened argv, including prompt text. A Codex session started withcodex --prompt "explain --service"can be misclassified as a shared server: it is excluded from liveness and anchoring, so lock acquisition can fail or another session can reclaim its lock. Check daemon flags only in their actual option positions. Related use:bin/fm-session-lock-lib.sh:125-126andbin/fm-session-lock-lib.sh:586-588.bin/fm-session-lock-lib.sh:543- The intent requires that “a recycled pid does not pass as a new owner.” This path treats a missing birth token as live based on PID and harness shape alone;publish_lock_sessionalso accepts an empty token whenpscannot provide one. A recycled PID can therefore pass as the recorded owner for legacy sidecars or newly written records with an unavailable token. Make missing birth identity stale or refuse to publish without it; the remedy changes legacy-lock handling and needs authorization. Related sites:bin/fm-session-lock-lib.sh:550-552andbin/fm-lock.sh:131-132.🔧 Fix applied.
3 errors still open:
bin/fm-session-lock-lib.sh:113---serviceand--managed-daemonare searched anywhere in flattened argv, including prompt text. A Codex session started withcodex --prompt "explain --service"can be misclassified as a shared server: it is excluded from liveness and anchoring, so lock acquisition can fail or another session can reclaim its lock. Check daemon flags only in their actual option positions. Related use:bin/fm-session-lock-lib.sh:125-126andbin/fm-session-lock-lib.sh:586-588.bin/fm-session-lock-lib.sh:543- The intent requires that “a recycled pid does not pass as a new owner.” This path treats a missing birth token as live based on PID and harness shape alone;publish_lock_sessionalso accepts an empty token whenpscannot provide one. A recycled PID can therefore pass as the recorded owner for legacy sidecars or newly written records with an unavailable token. Make missing birth identity stale or refuse to publish without it; the remedy changes legacy-lock handling and needs authorization. Related sites:bin/fm-session-lock-lib.sh:550-552andbin/fm-lock.sh:131-132.bin/fm-session-lock-lib.sh:117- The prior review fix truncates only at space-separated--promptand-p. A valid prompt supplied ascodex --prompt=explain --serviceis flattened bypsto include--service, so the Codex session is classified as a daemon and excluded from anchoring and liveness. This leaves the same prompt-text misclassification from review round 1 reachable. Parse the=forms too, or otherwise stop flag inspection at the prompt value. Related consumers:bin/fm-session-lock-lib.sh:355skips the process during pane lookup;bin/fm-session-lock-lib.sh:593-595skips it during ancestry anchoring.🔧 Fix applied.
4 issues (3 errors, 1 warning) still open:
bin/fm-session-lock-lib.sh:113---serviceand--managed-daemonare searched anywhere in flattened argv, including prompt text. A Codex session started withcodex --prompt "explain --service"can be misclassified as a shared server: it is excluded from liveness and anchoring, so lock acquisition can fail or another session can reclaim its lock. Check daemon flags only in their actual option positions. Related use:bin/fm-session-lock-lib.sh:125-126andbin/fm-session-lock-lib.sh:586-588.bin/fm-session-lock-lib.sh:543- The intent requires that “a recycled pid does not pass as a new owner.” This path treats a missing birth token as live based on PID and harness shape alone;publish_lock_sessionalso accepts an empty token whenpscannot provide one. A recycled PID can therefore pass as the recorded owner for legacy sidecars or newly written records with an unavailable token. Make missing birth identity stale or refuse to publish without it; the remedy changes legacy-lock handling and needs authorization. Related sites:bin/fm-session-lock-lib.sh:550-552andbin/fm-lock.sh:131-132.bin/fm-session-lock-lib.sh:117- The prior review fix truncates only at space-separated--promptand-p. A valid prompt supplied ascodex --prompt=explain --serviceis flattened bypsto include--service, so the Codex session is classified as a daemon and excluded from anchoring and liveness. This leaves the same prompt-text misclassification from review round 1 reachable. Parse the=forms too, or otherwise stop flag inspection at the prompt value. Related consumers:bin/fm-session-lock-lib.sh:355skips the process during pane lookup;bin/fm-session-lock-lib.sh:593-595skips it during ancestry anchoring.bin/fm-session-lock-lib.sh:354-ps ewwincludes both arguments and environment, but this filters the flattened listing withgrep -Fand never confirms the marker is in the process environment. A second Codex/OpenCode session whose prompt or arguments contain this pane marker can entercandidates; if it is the first outermost candidate,fm-lock.shrecords that other session’s PID and the lock can remain live after the claiming session ends. Read and match the pane variable specifically in each process environment before accepting its PID. Related shared path:bin/fm-session-lock-lib.sh:608uses this resolver for anchoring.🔧 Fix applied.
5 issues (3 errors, 2 warnings) still open:
bin/fm-session-lock-lib.sh:113---serviceand--managed-daemonare searched anywhere in flattened argv, including prompt text. A Codex session started withcodex --prompt "explain --service"can be misclassified as a shared server: it is excluded from liveness and anchoring, so lock acquisition can fail or another session can reclaim its lock. Check daemon flags only in their actual option positions. Related use:bin/fm-session-lock-lib.sh:125-126andbin/fm-session-lock-lib.sh:586-588.bin/fm-session-lock-lib.sh:543- The intent requires that “a recycled pid does not pass as a new owner.” This path treats a missing birth token as live based on PID and harness shape alone;publish_lock_sessionalso accepts an empty token whenpscannot provide one. A recycled PID can therefore pass as the recorded owner for legacy sidecars or newly written records with an unavailable token. Make missing birth identity stale or refuse to publish without it; the remedy changes legacy-lock handling and needs authorization. Related sites:bin/fm-session-lock-lib.sh:550-552andbin/fm-lock.sh:131-132.bin/fm-session-lock-lib.sh:117- The prior review fix truncates only at space-separated--promptand-p. A valid prompt supplied ascodex --prompt=explain --serviceis flattened bypsto include--service, so the Codex session is classified as a daemon and excluded from anchoring and liveness. This leaves the same prompt-text misclassification from review round 1 reachable. Parse the=forms too, or otherwise stop flag inspection at the prompt value. Related consumers:bin/fm-session-lock-lib.sh:355skips the process during pane lookup;bin/fm-session-lock-lib.sh:593-595skips it during ancestry anchoring.bin/fm-session-lock-lib.sh:354-ps ewwincludes both arguments and environment, but this filters the flattened listing withgrep -Fand never confirms the marker is in the process environment. A second Codex/OpenCode session whose prompt or arguments contain this pane marker can entercandidates; if it is the first outermost candidate,fm-lock.shrecords that other session’s PID and the lock can remain live after the claiming session ends. Read and match the pane variable specifically in each process environment before accepting its PID. Related shared path:bin/fm-session-lock-lib.sh:608uses this resolver for anchoring.bin/fm-session-lock-lib.sh:365- Fix round 3 added the argument-text exclusion. It rejects a process even when its own environment contains the pane marker: if a Codex or OpenCode prompt includes the exact marker, this resolver skips the session process and lock acquisition fails. Check the environment match first; reject argument-only matches. Related site:bin/fm-session-lock-lib.sh:366-369.🔧 Fix applied.
6 issues (4 errors, 2 warnings) still open:
bin/fm-session-lock-lib.sh:113---serviceand--managed-daemonare searched anywhere in flattened argv, including prompt text. A Codex session started withcodex --prompt "explain --service"can be misclassified as a shared server: it is excluded from liveness and anchoring, so lock acquisition can fail or another session can reclaim its lock. Check daemon flags only in their actual option positions. Related use:bin/fm-session-lock-lib.sh:125-126andbin/fm-session-lock-lib.sh:586-588.bin/fm-session-lock-lib.sh:543- The intent requires that “a recycled pid does not pass as a new owner.” This path treats a missing birth token as live based on PID and harness shape alone;publish_lock_sessionalso accepts an empty token whenpscannot provide one. A recycled PID can therefore pass as the recorded owner for legacy sidecars or newly written records with an unavailable token. Make missing birth identity stale or refuse to publish without it; the remedy changes legacy-lock handling and needs authorization. Related sites:bin/fm-session-lock-lib.sh:550-552andbin/fm-lock.sh:131-132.bin/fm-session-lock-lib.sh:117- The prior review fix truncates only at space-separated--promptand-p. A valid prompt supplied ascodex --prompt=explain --serviceis flattened bypsto include--service, so the Codex session is classified as a daemon and excluded from anchoring and liveness. This leaves the same prompt-text misclassification from review round 1 reachable. Parse the=forms too, or otherwise stop flag inspection at the prompt value. Related consumers:bin/fm-session-lock-lib.sh:355skips the process during pane lookup;bin/fm-session-lock-lib.sh:593-595skips it during ancestry anchoring.bin/fm-session-lock-lib.sh:354-ps ewwincludes both arguments and environment, but this filters the flattened listing withgrep -Fand never confirms the marker is in the process environment. A second Codex/OpenCode session whose prompt or arguments contain this pane marker can entercandidates; if it is the first outermost candidate,fm-lock.shrecords that other session’s PID and the lock can remain live after the claiming session ends. Read and match the pane variable specifically in each process environment before accepting its PID. Related shared path:bin/fm-session-lock-lib.sh:608uses this resolver for anchoring.bin/fm-session-lock-lib.sh:365- Fix round 3 added the argument-text exclusion. It rejects a process even when its own environment contains the pane marker: if a Codex or OpenCode prompt includes the exact marker, this resolver skips the session process and lock acquisition fails. Check the environment match first; reject argument-only matches. Related site:bin/fm-session-lock-lib.sh:366-369.bin/fm-session-lock-lib.sh:314- The start-time token usesps -o lstart, which has one-second precision. If a recorded harness exits and the OS reuses its PID for another live harness within that second, both tokens can match, so the recycled PID passes the required owner check. Use a process-start identity with finer resolution. Related sites:bin/fm-lock.sh:131records the token;bin/fm-session-lock-lib.sh:578compares it.🔧 Fix applied.
7 issues (5 errors, 2 warnings) still open:
bin/fm-session-lock-lib.sh:113---serviceand--managed-daemonare searched anywhere in flattened argv, including prompt text. A Codex session started withcodex --prompt "explain --service"can be misclassified as a shared server: it is excluded from liveness and anchoring, so lock acquisition can fail or another session can reclaim its lock. Check daemon flags only in their actual option positions. Related use:bin/fm-session-lock-lib.sh:125-126andbin/fm-session-lock-lib.sh:586-588.bin/fm-session-lock-lib.sh:543- The intent requires that “a recycled pid does not pass as a new owner.” This path treats a missing birth token as live based on PID and harness shape alone;publish_lock_sessionalso accepts an empty token whenpscannot provide one. A recycled PID can therefore pass as the recorded owner for legacy sidecars or newly written records with an unavailable token. Make missing birth identity stale or refuse to publish without it; the remedy changes legacy-lock handling and needs authorization. Related sites:bin/fm-session-lock-lib.sh:550-552andbin/fm-lock.sh:131-132.bin/fm-session-lock-lib.sh:117- The prior review fix truncates only at space-separated--promptand-p. A valid prompt supplied ascodex --prompt=explain --serviceis flattened bypsto include--service, so the Codex session is classified as a daemon and excluded from anchoring and liveness. This leaves the same prompt-text misclassification from review round 1 reachable. Parse the=forms too, or otherwise stop flag inspection at the prompt value. Related consumers:bin/fm-session-lock-lib.sh:355skips the process during pane lookup;bin/fm-session-lock-lib.sh:593-595skips it during ancestry anchoring.bin/fm-session-lock-lib.sh:354-ps ewwincludes both arguments and environment, but this filters the flattened listing withgrep -Fand never confirms the marker is in the process environment. A second Codex/OpenCode session whose prompt or arguments contain this pane marker can entercandidates; if it is the first outermost candidate,fm-lock.shrecords that other session’s PID and the lock can remain live after the claiming session ends. Read and match the pane variable specifically in each process environment before accepting its PID. Related shared path:bin/fm-session-lock-lib.sh:608uses this resolver for anchoring.bin/fm-session-lock-lib.sh:365- Fix round 3 added the argument-text exclusion. It rejects a process even when its own environment contains the pane marker: if a Codex or OpenCode prompt includes the exact marker, this resolver skips the session process and lock acquisition fails. Check the environment match first; reject argument-only matches. Related site:bin/fm-session-lock-lib.sh:366-369.bin/fm-session-lock-lib.sh:314- The start-time token usesps -o lstart, which has one-second precision. If a recorded harness exits and the OS reuses its PID for another live harness within that second, both tokens can match, so the recycled PID passes the required owner check. Use a process-start identity with finer resolution. Related sites:bin/fm-lock.sh:131records the token;bin/fm-session-lock-lib.sh:578compares it.bin/fm-session-lock-lib.sh:328- Round 6 adds cmdline bytes to the Linux birth token, but the existing comment atbin/fm-session-lock-lib.sh:312-313says harnesses rewrite argv as their title changes. After a live anchor changes its argv, the token recorded bybin/fm-lock.sh:131differs from the token read here, sofm_session_lock_recorded_owner_livereturns false and another session can reclaim a live owner’s lock. This contradicts the same function’s existing birth-only rationale. The remedy must preserve the user-directed tick-collision protection while handling mutable argv; that change needs authorization. Related sites:bin/fm-session-lock-lib.sh:602compares the current token;bin/fm-lock.sh:212,236,239uses that result to decide whether to refuse or reclaim the lock.🔧 Fix applied.
8 issues (6 errors, 2 warnings) still open:
bin/fm-session-lock-lib.sh:113---serviceand--managed-daemonare searched anywhere in flattened argv, including prompt text. A Codex session started withcodex --prompt "explain --service"can be misclassified as a shared server: it is excluded from liveness and anchoring, so lock acquisition can fail or another session can reclaim its lock. Check daemon flags only in their actual option positions. Related use:bin/fm-session-lock-lib.sh:125-126andbin/fm-session-lock-lib.sh:586-588.bin/fm-session-lock-lib.sh:543- The intent requires that “a recycled pid does not pass as a new owner.” This path treats a missing birth token as live based on PID and harness shape alone;publish_lock_sessionalso accepts an empty token whenpscannot provide one. A recycled PID can therefore pass as the recorded owner for legacy sidecars or newly written records with an unavailable token. Make missing birth identity stale or refuse to publish without it; the remedy changes legacy-lock handling and needs authorization. Related sites:bin/fm-session-lock-lib.sh:550-552andbin/fm-lock.sh:131-132.bin/fm-session-lock-lib.sh:117- The prior review fix truncates only at space-separated--promptand-p. A valid prompt supplied ascodex --prompt=explain --serviceis flattened bypsto include--service, so the Codex session is classified as a daemon and excluded from anchoring and liveness. This leaves the same prompt-text misclassification from review round 1 reachable. Parse the=forms too, or otherwise stop flag inspection at the prompt value. Related consumers:bin/fm-session-lock-lib.sh:355skips the process during pane lookup;bin/fm-session-lock-lib.sh:593-595skips it during ancestry anchoring.bin/fm-session-lock-lib.sh:354-ps ewwincludes both arguments and environment, but this filters the flattened listing withgrep -Fand never confirms the marker is in the process environment. A second Codex/OpenCode session whose prompt or arguments contain this pane marker can entercandidates; if it is the first outermost candidate,fm-lock.shrecords that other session’s PID and the lock can remain live after the claiming session ends. Read and match the pane variable specifically in each process environment before accepting its PID. Related shared path:bin/fm-session-lock-lib.sh:608uses this resolver for anchoring.bin/fm-session-lock-lib.sh:365- Fix round 3 added the argument-text exclusion. It rejects a process even when its own environment contains the pane marker: if a Codex or OpenCode prompt includes the exact marker, this resolver skips the session process and lock acquisition fails. Check the environment match first; reject argument-only matches. Related site:bin/fm-session-lock-lib.sh:366-369.bin/fm-session-lock-lib.sh:314- The start-time token usesps -o lstart, which has one-second precision. If a recorded harness exits and the OS reuses its PID for another live harness within that second, both tokens can match, so the recycled PID passes the required owner check. Use a process-start identity with finer resolution. Related sites:bin/fm-lock.sh:131records the token;bin/fm-session-lock-lib.sh:578compares it.bin/fm-session-lock-lib.sh:328- Round 6 adds cmdline bytes to the Linux birth token, but the existing comment atbin/fm-session-lock-lib.sh:312-313says harnesses rewrite argv as their title changes. After a live anchor changes its argv, the token recorded bybin/fm-lock.sh:131differs from the token read here, sofm_session_lock_recorded_owner_livereturns false and another session can reclaim a live owner’s lock. This contradicts the same function’s existing birth-only rationale. The remedy must preserve the user-directed tick-collision protection while handling mutable argv; that change needs authorization. Related sites:bin/fm-session-lock-lib.sh:602compares the current token;bin/fm-lock.sh:212,236,239uses that result to decide whether to refuse or reclaim the lock.bin/fm-session-lock-lib.sh:600- Round 7 removed mutable argv from the birth token, but also leaves the harness cross-check out of procfs-token records. The recorded PID can now pass liveness when it names a different harness with a matching start token, contrary to the recorded decision to keep that check and the intent to distinguish harness identity. The ancestry path atbin/fm-session-lock-lib.sh:680-685also accepts a matching PID without checking the recorded birth token or session identity. Check recorded harness and process identity before treating either path as live; preserve the documented tokenless legacy behavior. Related sites:bin/fm-session-lock-lib.sh:600-612skips harness comparison for procfs tokens;bin/fm-session-lock-lib.sh:680-690accepts ancestry membership directly.🔧 Fix applied.
✅ Re-checked - no issues remain.
bin/fm-lab-home.sh- Live validation could not start: the requiredbin/fm-lab-home.sh createhelper is absent from this worktree. Codex is installed, but the documented isolated-home setup could not be completed. Restore or provide the helper, then rerun the live scenarios.bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…bin/fm-lab-home.shis absent. The focused regression test passed, but it uses fixtures and does not prove live behavior. Provide the missing he…command -v codexAttempted documented lab setup withbin/fm-lab-home.sh create; helper was absent.bash tests/fm-session-lock-ancestry.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.