Conversation
…edges The wedge alarm's off-pane notification channel (config/wedge-alarm) only fires when injection itself cannot be confirmed - a rare failure mode. A real, captain-relevant escalation (PR ready, ask-user decision, blocker) that is successfully injected into the supervisor pane has no way to reach an away captain who isn't looking at that pane. Add an independent escalation alert (config/escalation-alert), reusing the wedge alarm's channel syntax and safety machinery, that fires on every successful escalate_flush of a real escalation digest. Rate-limited only by the natural escalation batch window, since a distinct later escalation should still ping rather than being throttled the way the wedge alarm intentionally is.
…umentation-audiences inventory
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "docs(AGENTS): fix escalation-alert catal..." | Re-trigger Greptile |
|
Speaking as Kun's firstmate: first look on current main 038d0f7 (#2942). Never messaged the captain. class=opt-in. Code: absent config/escalation-alert and unset FM_ESCALATION_ALERT_CHANNEL emit off. Distinct from wedge-alarm default-on auto. Not auto: NM mismatch plus AGENTS.md catalog error. VISION.md: one-captain interface aligns; authority aligns as opt-in (absent=off); scripts align; restart aligns; spine aligns; vendor aligns; scope aligns. |
Matches implementation, tests, docs/configuration.md, docs/wedge-alarm.md, and the example file, which all already state absent means off.
Intent
Add an away-mode escalation alert to firstmate's supervise daemon. The wedge alarm (config/wedge-alarm) only pings an external channel (osascript/herdr/command:) when injection itself fails to confirm delivery into the supervisor pane - a rare failure mode. It never fires when a real, captain-relevant escalation (PR ready for review, ask-user decision, blocker) is successfully injected but the captain is away from the pane and never sees it, which is the far more common case for anyone using /afk. This adds a second, independent alert (config/escalation-alert, FM_ESCALATION_ALERT_CHANNEL, FM_ESCALATION_ALERT_EXEC) that fires on every successful escalate_flush of a genuine escalation digest, reusing the wedge alarm's channel directive syntax (off/auto/osascript/herdr/command:) and safety machinery (bounded process-group execution, argv-safe command dispatch, a dedicated test-seam distinct from FM_WEDGE_ALARM_EXEC so tests for one trigger can never fire the other's real notifier). Deliberately no additional rate limiting beyond the natural escalate_flush batch window (FM_ESCALATE_BATCH_SECS), unlike the wedge alarm's own throttle, since a distinct later escalation should still ping rather than being silently suppressed. Docs updated: docs/wedge-alarm.md (new section), docs/configuration.md (new config section + env var reference), docs/examples/escalation-alert (new copyable example), .agents/skills/afk/SKILL.md (mention), AGENTS.md (config file listing). Tests added to tests/fm-daemon.test.sh mirroring the existing wedge-alarm test patterns (library-mode discard default, successful-flush integration test, off-directive, osascript channel selection, command channel), plus a matching recorder seam added to tests/wake-helpers.sh. Verified locally: tests/fm-daemon.test.sh passes in full (all existing + new tests), and bin/fm-lint.sh's shellcheck pass is clean.
What Changed
config/escalation-alert,FM_ESCALATION_ALERT_CHANNEL,FM_ESCALATION_ALERT_EXEC) tobin/fm-supervise-daemon.shthat fires on every successfulescalate_flushof a genuine escalation digest, reusing the wedge alarm's channel directive syntax (off/auto/osascript/herdr/command:) and bounded process-group/argv-safe dispatch, with its own test-seam (FM_ESCALATION_ALERT_EXEC) kept separate fromFM_WEDGE_ALARM_EXEC.FM_ESCALATE_BATCH_SECSbatch window, so distinct later escalations still notify.docs/wedge-alarm.md,docs/configuration.md,docs/documentation-audiences.json, newdocs/examples/escalation-alert,.agents/skills/afk/SKILL.md,AGENTS.md) and added tests (tests/fm-daemon.test.sh,tests/wake-helpers.sh) covering library-mode discard default, successful-flush integration, off-directive, osascript channel selection, and command channel.Risk Assessment
✅ Low: The change is an additive, well-isolated feature that closely mirrors the existing, already-tested wedge-alarm implementation pattern (independent config file, env overrides, dedicated test-only exec seam, bounded process-group dispatch), with matching tests and docs, and no removal or contradiction of required/forbidden intent constraints.
Testing
Executed the targeted shell test suite tests/fm-daemon.test.sh end-to-end; it exercises the daemon's real escalate_flush/notify code paths (not source-grepping) via temp state dirs and recorder seams, and all tests passed cleanly with exit code 0, confirming the new escalation-alert channel selection, off-directive, and command/osascript dispatch behave as intended without regressing the existing wedge-alarm and escalation-classification tests.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-daemon.test.sh (full suite, exit 0, all ok)test_escalation_alert_library_mode_defaults_to_discardtest_escalation_alert_fires_on_successful_flushtest_escalation_alert_off_disables_alerttest_escalation_alert_osascript_channel_selectedtest_escalation_alert_command_channel_receives_summary✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Install actionlint so fm-lint.sh passes; no source changes needed
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.