Skip to content

2026-6752: feat(opencode): enforce free-model health checks - #6752

Closed
Ivory2024 wants to merge 95 commits into
kunchenguid:mainfrom
Ivory2024:fm/opencode-free-model-health-gate-namespace-20261007-w9
Closed

Ivory2024 wants to merge 95 commits into
kunchenguid:mainfrom
Ivory2024:fm/opencode-free-model-health-gate-namespace-20261007-w9

Conversation

@Ivory2024

Copy link
Copy Markdown

Intent

Reliability defect (P1 near-P0). The OpenCode free-model health gate silently fails open because of a namespace mismatch.

  • Catalog identity: opencode-free/<model>
  • Dispatch identity: opencode/<model>
  • Result: catalog lookup misses and fm-spawn prints cannot verify ... model not tracked, then proceeds.

If the gate exists to block dead/expired free models, not tracked must NOT be treated as a normal pass. A printed warning is not evidence the gate worked.

What Changed

  • Add OpenCode free-model health catalog checks and refuse dispatch when a model is missing or unhealthy.
  • Add Discord polling, notifications, replies, and mention event handling; expand runtime backend and session supervision support.
  • Add JEV safety tooling and update Firstmate skills, documentation, and regression coverage.

Risk Assessment

✅ Low: Canonical mapping now handles both supported dispatch namespaces, and missing or ambiguous catalog matches refuse before launch; the recent fix rounds remove the unneeded expiry refusal and alias path.

Testing

Ran the focused dispatch-profile scenario against fm-spawn with disposable test homes and harness fixtures. Canonical identity matching, untracked and unhealthy refusal, and expiring-soon allowance passed. No visual artifact applies to this CLI behavior; the test transcript records the observable outcomes. Worktree remained clean.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Dispatch an active free model through opencode/&lt;model&gt; and opencode-go/&lt;model&gt; identities; canonical catalog match permits spawn. ✅ pass live OpenCode health-gate behavior; bash tests/fm-spawn-dispatch-profile.test.sh
Dispatch an untracked model, then try inactive and early-terminated catalog entries; each refuses before launch. ✅ pass live OpenCode health-gate behavior; bash tests/fm-spawn-dispatch-profile.test.sh
Dispatch an active model marked is_expiring_soon; spawn remains allowed. ✅ pass live OpenCode health-gate behavior; bash tests/fm-spawn-dispatch-profile.test.sh
Evidence: OpenCode health-gate behavior
ok - OpenCode proceeds when the health catalog marks the model active
ok - OpenCode refuses dispatch when the health catalog flags early termination
ok - OpenCode refuses dispatch when the health catalog status is not active
ok - OpenCode refuses dispatch when the health catalog does not track the selected model
ok - OpenCode dispatch identity resolves to its canonical free-model health identity
ok - OpenCode allows active models marked is_expiring_soon
# all fm-spawn-dispatch-profile tests passed

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⚠️ **Rebase** - 1 warning

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 (2) ✅
  • 🚨 bin/fm-spawn.sh:1710 - The canonicalizer strips only the first namespace segment. For the existing dispatch identity opencode-go/space-bunny-free, it produces opencode-free/go/space-bunny-free, so an active catalog entry opencode-free/space-bunny-free fails lookup and dispatch is refused. This affects the changed active, terminated, inactive, stale, and fresh catalog cases at tests/fm-spawn-dispatch-profile.test.sh:867, :884, :903, :1034, and :1053. Normalize the supported provider namespace before constructing the canonical catalog identity.
  • ⚠️ bin/fm-spawn.sh:2279 - The new is_expiring_soon refusal exceeds the stated requirement to block dead or expired models. Existing guidance treated this flag as a reason to narrow the brief or choose a recommended default, not refuse dispatch; the changed documentation now describes refusal. Confirm whether this intentional product behavior is required. If not, remove this added refusal.

🔧 Fix applied.
3 issues (1 error, 2 warnings) still open:

  • 🚨 bin/fm-spawn.sh:1710 - The canonicalizer strips only the first namespace segment. For the existing dispatch identity opencode-go/space-bunny-free, it produces opencode-free/go/space-bunny-free, so an active catalog entry opencode-free/space-bunny-free fails lookup and dispatch is refused. This affects the changed active, terminated, inactive, stale, and fresh catalog cases at tests/fm-spawn-dispatch-profile.test.sh:867, :884, :903, :1034, and :1053. Normalize the supported provider namespace before constructing the canonical catalog identity.
  • ⚠️ bin/fm-spawn.sh:2279 - The new is_expiring_soon refusal exceeds the stated requirement to block dead or expired models. Existing guidance treated this flag as a reason to narrow the brief or choose a recommended default, not refuse dispatch; the changed documentation now describes refusal. Confirm whether this intentional product behavior is required. If not, remove this added refusal.
  • ⚠️ bin/fm-spawn.sh:2252 - The added catalog-alias matching path exceeds the stated fix: canonicalizing opencode/&lt;model&gt; and opencode-go/&lt;model&gt; already resolves the namespace mismatch. No intent requirement needs alias lookup; remove this path and its alias-specific documentation and tests.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Dispatch an active free model through opencode/&lt;model&gt; and opencode-go/&lt;model&gt; identities; canonical catalog match permits spawn. ✅ pass live OpenCode health-gate behavior; bash tests/fm-spawn-dispatch-profile.test.sh
Dispatch an untracked model, then try inactive and early-terminated catalog entries; each refuses before launch. ✅ pass live OpenCode health-gate behavior; bash tests/fm-spawn-dispatch-profile.test.sh
Dispatch an active model marked is_expiring_soon; spawn remains allowed. ✅ pass live OpenCode health-gate behavior; bash tests/fm-spawn-dispatch-profile.test.sh
  • bash tests/fm-spawn-dispatch-profile.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

irene and others added 30 commits September 19, 2026 08:04
…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>
* docs: add selective-parallelism policy for split work and preflight

Firstmate keeps one coordinator and gains narrow, on-demand help instead of
a standing fleet.

- Add .agents/skills/selective-parallelism as the single owner of the size
  and shape of delegated help for one task: one worker by default, a closed
  list of reasons for a second, per-task Code-Crew and Butler-Crew roles
  dispatched through the ordinary brief-then-spawn path, the 2-3 worker
  read-only hypothesis race ending in one implementation owner, and the
  pre-change scope and impact preflight.
- Add the always-loaded ceiling and safety rules to AGENTS.md section 7, and
  the section 13 load trigger.
- Point the crew dispatch profile section at role-based routing, so a rule's
  when condition can name a role without pinning a harness or model.
- Classify the new skill in the documentation audience inventory.

No runtime machinery, no new agent type, no secondmate change.

* no-mistakes(review): Enforce delegated coding and crew session lifecycle

* no-mistakes(review): Require Code-Crew TDD and gated session closure

* no-mistakes(review): Require separate authorization before race implementation

* no-mistakes(review): Remove out-of-scope tool-routing policy

* no-mistakes(review): Remove role-based dispatch profile guidance

* no-mistakes(document): Clarify selective-parallelism documentation ownership
* fix(pi): read the stock call header from Pi instead of restating it

Pi 0.99.0 changed the header it draws for a tool that supplies no call
renderer: the title now carries the call's arguments, as `key=value`
pairs when collapsed and one `key: value` line per argument when
expanded. The two branch supervision tools draw their own header, so a
title-only literal matched stock on 0.87.1 and silently diverged on
0.99.1. Because CI pins 0.87.1, the pinned lane stayed green the whole
time and the divergence only surfaced on a newer release.

Pi ships the formatter as an internal `formatToolCallWithArgs` that its
exports map does not publish, so restating the format here would just
move the drift to the next release. Ask a stock `ToolExecutionComponent`
for the header it builds instead, over the public
constructor/updateArgs/setExpanded/render surface only, and fall back to
the bare title if that ever throws. The probe definition takes
`renderShell: "self"` and no `renderCall`, so the header lands in a plain
container with no box framing or background and comes back verbatim.

The new case installs both pinned releases side by side and requires
byte-exact stock parity for both tools, collapsed and expanded, on each.
The previous case could only prove parity against whichever release
happened to be installed, which is why 0.87.1 alone never caught this.
Verified to fail on 0.99.1 with the fix reverted and pass with it, and
each case asserts a real stock header was produced so the comparison
cannot pass vacuously.

* no-mistakes(review): Check installed Pi pins before requiring npm

* no-mistakes(document): Document Pi stock header compatibility

* no-mistakes(lint): Fix ambiguous empty assignment in Pi compatibility test
* feat: route OpenCode permission asks to a captain decision

An OpenCode 2 permission ask renders as a modal inside the worker's own
TUI. The captain never sees it and firstmate has no record of it, so a
worker asking for a path outside its worktree simply blocks with no
visible decision anywhere.

bin/fm-opencode-permission.sh bridges one real request to the captain
through the existing Discord decision path and applies the keyed answer
back to exactly that request. The generated OpenCode plugin only forwards
permission.asked and decides nothing: a plugin that approved anything
would be the invisible grant this change exists to remove.

decide refuses unless the record names that exact task and request, is
still pending, carries the task's current busy generation, and the server
still reports it pending with the same id, session, and action. The
read-check-consume sequence is one critical section and the record becomes
consumed before the POST, so a replay or a concurrent second caller
refuses rather than granting twice.

A captured Discord reply now also enqueues its own durable wake. The
stdout contract only reaches a session when the watcher ran the poll, so
an operator-run or LaunchAgent-run ingress poll captured a reply whose
marker then made every later watcher poll suppress it. Capture is now the
wake; the stdout contract is unchanged for the watcher's own dispatch.

answer-one gains an optional occurrence guard, and the reply path passes
it. The decision key already carries the occurrence the captain was
actually asked at, so a reply arriving after a call was answered and
re-held would otherwise resolve the newer question they were never asked.

Every decision answer is then confirmed to the captain, after the keyed
command succeeds. An answer with no receipt is indistinguishable from a
lost reply.

* fix: retry a failed captain push and show every requested path

Two review findings, both real.

A notification that failed once was never retried. The existing-record
path in ask returned before the push, so a Discord outage left the
captain never asked while the worker stayed blocked. The push is
idempotent per (trigger, task, key), so it now runs on that path too, and
the captured record is still left untouched.

The question rendered only resources[0] and flattened the save list on
spaces. Approving a request grants every resource it names, so the
captain could approve scope he was never shown, and a path containing a
space lost its boundary. Both lists are now carried as compact JSON and
rendered whole.

Each is proven by a negative control: reverting the retry fails the
push-count assertion, and reverting the rendering fails the full-list
assertion.

* no-mistakes(document): Add missing opencode-permission state path to layout reference
…77)

* fix(spawn): verify the OpenCode model a worker will actually run

PR #70 validated an explicit `--model` for OpenCode launches, but only in
the launcher's own directory and only when a model was named. Two gaps
followed from that, both of which let a worker start on a model nobody
checked:

- An omitted or `--model default` launch validated nothing, and OpenCode
  then chose its own default from whatever config the worker directory
  holds. The gate was bypassed rather than failed.
- `opencode models` is project-scoped, so a model supplied by a provider
  the worktree config declares is listed in the worktree and not in the
  launcher. Validating an explicit model in the launcher's directory
  refuses a model the worker can actually run.

Both paths now resolve and validate in the settled task worktree, inside
the destination pane, under the same environment expression the launch
itself gets, so the binary, working directory, allowlisted credentials,
and OpenCode server route are the ones the worker will have.
`opencode debug config` is read as the source inventory it is (v2) or the
resolved object it is (v1), ranked by the documented precedence, and the
resulting root model is pinned on the launch. An unresolvable source, an
equal-precedence disagreement, or no root model at all fails closed rather
than deferring to OpenCode's default. Availability and zero cost are
checked the same way for both paths, and `opencode-go/space-bunny-free`
is not privileged: any model that clears the gate is accepted.

Two things the validation could not see before it saw them:

- `opencode models` prints only base ids, so it cannot confirm a
  `#variant`. The only declaring source is provider metadata in the
  resolved config, and an available base does not carry an arbitrary
  variant: the exact `base#variant` must be one the config SELECTS.
  Selectable variants are resolved through the same precedence order as
  the root model - union within one precedence step, replaced across steps,
  including by an empty set, which is how a higher-precedence document
  disabling every variant clears the model. Comparing declared sets alone
  would admit two same-step documents that both declare `low` and disagree
  on whether it is enabled.
- The raw-launch escape hatch classified on the executable it could name,
  so `command opencode`, `exec opencode`, a quoted executable, or a
  `sh -c opencode` all reached the worker with every model guard skipped.
  Commands whose whole job is running another program are now walked
  through to the executable they would run, and a command naming OpenCode
  anywhere outside the resolved executable position fails closed. A launch
  that merely mentions OpenCode in a prompt is still an unrelated launch,
  and `cd <dir> && ./probe` is still a legitimate raw command.

The shared spawn fixture executes the preflight the way a real pane does,
so a suite that spawns OpenCode no longer fails on a timeout instead of on
the behavior it means to test, and suites share one OpenCode preflight
stub rather than each writing its own.

Regression coverage spans the omitted and explicit paths, unavailable and
nonzero-cost metadata, declared, disabled-by-precedence, and
equal-precedence-conflicting variants, v1 and v2 config shapes, custom
config-location overrides, the wrapper and quoting forms above, and the
bounded preflight actually cutting off a hung catalog rather than only
passing the bound as an argument.

Verified against a live OpenCode 2.0.18: `debug config` is a source array
carrying `info.model` in object form, `OPENCODE_CONFIG_CONTENT` does not
register as a config source, and `opencode models` lists base ids with no
`#` forms.

* no-mistakes(test): Waiting on background test run before finalizing fix summary

* no-mistakes(document): docs: update OpenCode model validation to destination-pane config resolution
* 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
@Ivory2024 Ivory2024 changed the title feat(opencode): enforce free-model health checks 2026-6752: feat(opencode): enforce free-model health checks Oct 7, 2026
@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 1/5

[High risk] Modifies core agent skills and build configuration across 256 files.

Fix the Discord author boundary and broken message-handling paths before merging.

Reviews (1) · Last reviewed commit: "no-mistakes(review): Remove OpenCode hea..." · Reviewed by Greptile

Comment thread bin/fm-discord-poll.js
Comment on lines +262 to +269
const isDM = !msg.guild_id;
if (isDM && !allowDMs) continue;
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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Strangers can request work

General mentions, DMs, and replies to bot messages bypass authorizedUserIds. If Relay is also enabled, these messages reach fmx-respond, which treats the direct author as the captain and can dispatch work. Someone outside the trusted user list can therefore issue work requests. Check the author before writing any request to x-inbox.

How this was verified: Discord messages bypass the author check on the general intake path and enter a consumer that explicitly treats incoming requests as captain instructions.

Comment thread bin/fm-discord-poll.js
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Corrected approvals are ignored

The poll sets replied_to as soon as it captures a reply, before the decision succeeds. If the captain's first permission reply is unclear, fmx-respond must leave the request pending. A later reply selecting once is then discarded here, leaving the worker blocked. Mark the notification answered only after the decision succeeds, or allow a replacement reply while it remains pending.

Comment thread docs/configuration.md
Comment on lines +691 to +692
It produces and consumes the same local inbox and wake contract (`state/x-inbox/<request_id>.json`, `x-mention <request_id>`, and `fmx-respond`) as the hosted Relay.
It is off unless the firstmate home's gitignored `.env` contains a non-empty `FM_DISCORD_BOT_TOKEN`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Bot-only messages go unanswered

The new self-hosted connector routes messages to fmx-respond, but that skill says to do nothing unless FMX_PAIRING_TOKEN is configured. A home configured only with FM_DISCORD_BOT_TOKEN therefore captures messages and wakes Firstmate without a supported path to handle them. Update the skill's activation rule and the matching instructions in AGENTS.md to accept either connector.

On failure leave it for retry and report the exact error.

Every decision answer is applied and then confirmed, in that order.
Confirmation is what tells the captain their reply landed, and it is the only receipt they get: `bin/fm-discord-notify.sh --report <channel_id> "<outcome>"`, using `.channel_id` from the decision object and stating plainly which decision was applied and what it enabled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Decision confirmations fail

These instructions read .channel_id from .decision, but captured decisions contain that field only at the top level. Following the procedure supplies an empty channel to fm-discord-notify.sh --report, which refuses it after the answer has already been applied. Read the top-level .channel_id, or include it in .decision.

Comment on lines +97 to +102
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[@]}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Dashboard launch assumes one user

The helper launches /Users/irene/.local/bin/agenttrail-kitchen instead of finding agenttrail-kitchen on PATH. Its --run mode fails on other users' machines even when the tool is installed. Resolve the executable once and use it for both the printed command and launch.

@Ivory2024 Ivory2024 closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant