Repository navigation
fix(bin): deliver Claude-bound operational input as a record-backed doorbell - #26
Merged
Merged
Conversation
…oorbell Claude Code 2.1.291 removes invisible characters, U+2063 included, from every submitted prompt, so a FM_OPERATIONAL_PREFIX-marked operational input reaches a Claude pane as plain text no consumer can tell apart from a captain message. An away-mode escalation then reads as the captain returning, and a launch brief loses its operational identity. This ports upstream kunchenguid/firstmate 1fe1a67 (PR 5664) rather than inventing a second design, adapted to this fork: its INJECT_LAST_FAILURE bookkeeping, AI-trailer launch prefix, unknown-wake acknowledgement tests and oversized-digest test belong to upstream commits this fork does not carry, so those hunks are dropped and the surrounding code keeps this tree's own shape. Marked operational input to a harness named in the owner's FM_OPERATIONAL_RECORD_HARNESSES now travels as a durable record plus a printable-ASCII doorbell naming it: the away daemon writes the envelope under state/operational-inbox and types only the doorbell, and a Claude launch brief is published into the receiving home's own state before launch, refusing the spawn rather than sending a marker that would be stripped. The doorbell text alone proves nothing - it counts as Firstmate input only when the record it names holds a current envelope - so a human still cannot produce an operational marker by accident. Marker-preserving harnesses keep the typed envelope unchanged. Reproduced first on the installed Claude Code 2.1.291: the launch-prompt argument (the vendor itself reports removing the character), typing through Firstmate's own submit primitive, and a bracketed paste all arrive bare, confirmed in both the UserPromptSubmit payload and the stored session transcript. A SessionStart hook's stdout keeps the marker, so the session-start nudge is untouched, and the steering doorbell was never marked, so fm-send's plane is unaffected. A new opt-in live guard proves both halves of the carrier selection against the real installed binaries and refuses a pass that checked nothing, with the dated 2.1.291 result recorded in docs/verification/runtime-backends.md.
…otes in Calm feasibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
We should fix the first mate invisible character thing.
Context: while validating the Calm activation-gate fix (PR on max-metaplanet/firstmate, branch fm/calm-flag-rename), the live test found that Claude Code 2.1.291's composer strips an invisible character from submitted input and asks for a second Enter; both
tmux send-keys -land a bracketedtmux paste-bufferlose the marker the same way.Firstmate marks operational input with FM_OPERATIONAL_PREFIX (U+2063 INVISIBLE SEPARATOR followed by
FIRSTMATE_OP:, see bin/fm-operational-input.sh), so marked operational input typed into a Claude pane - away-supervisor injections, launch briefs, and anything else that relies on the marker - can arrive unmarked.The risk: an unmarked away-mode injection could read as the captain returning, and a launch brief could lose its operational identity.
Make firstmate's operational-input marking survive this; check first whether upstream kunchenguid/firstmate already fixed it.
What Changed
bin/fm-operational-input.shnow has a record-backed carrier for the harnesses listed inFM_OPERATIONAL_RECORD_HARNESSES(currently justclaude). The full envelope is written atomically tostate/operational-inbox/<name>.msg(records older than about 7 days are pruned), and only a plain ASCII doorbell line naming that record is typed. This adds therecord,doorbell-kind, andopenCLI commands, plus helpers that verify a doorbell only when the record it names exists and holds a current envelope. One of these helpers also requires the record to sit in this home's own inbox.bin/fm-supervise-daemon.shand launch briefs frombin/fm-spawn.shnow go through the doorbell. The afk return check counts a doorbell backed by this home's record as internal input, so it no longer reads as the captain coming back.fm-afk-launch.shnow passesFM_DAEMON_PRIMARY_HARNESSto daemon terminals it creates. Iffm-spawn.shcan't publish the brief record, it stops the spawn instead of sending an unmarked brief. A secondmate's brief record goes into the secondmate's own state directory.calm-mode-feasibility,calm,configuration,architecture, runtime-backend verification, and the afk/ahoy skills) are updated. Unit, daemon, spawn, afk-launch, and Calm tests are extended, and a new live tmux/Claude e2e test (tests/fm-operational-marker-live-e2e.test.sh) is added.🤖 Generated with Claude Code
Risk Assessment
✅ Low: This ports upstream's record-backed doorbell. It covers the Claude-bound producers the intent names: away-supervisor injections, by passing the primary harness to daemon terminals, and crewmate and secondmate launch briefs, each published into the receiving home. Marker-preserving harnesses keep the typed envelope. The doorbell counts only when its record verifies. Spawns fail closed when a record cannot be published. Behavioral tests cover parity, home binding and refusal, and no reachable defect was found.
Testing
I ran the repo's opt-in live marker guard and my own live scenario script against the installed Claude Code 2.1.291 on a private tmux socket with throwaway labs. Both drove the real daemon
inject_msg, the submit primitive and the operational-input owner. I read the prompt Claude actually submitted from a UserPromptSubmit hook. The baseline step reproduced the reported bug: the old typed envelope arrives stripped and reads as the captain returning. With the fix, the doorbell arrives intact, stays internal, and the agent acts on the record. Four forged or plain captain inputs were all correctly read as the captain returning. A launch-brief doorbell kept its identity and was carried out. The targeted tests for the owner, the daemon end-to-end, spawn and the Calm mod all passed. The fm-spawn record-publishing scenario was covered only by a fixture test, not a live spawn, so it is marked untested here. No UI surface changed, so I took no screenshots; the evidence is CLI transcripts. A side effect:fm-claude-trust.shadded workspace-trust entries for the temporary lab directories to the seat's Claude config, the same way every fleet spawn does.Evidence: Live marker guard against real Claude Code 2.1.291
Source: Live marker guard against real Claude Code 2.1.291
ok - claude (2.1.291): strips the operational marker from submitted input, so the record-backed doorbell carrier is required ok - claude (2.1.291): a typed record-backed doorbell reaches the agent recognizably - it opened the record and carried out the operational inputEvidence: Live away-mode / adversarial / launch-brief scenarios transcript
Source: Live away-mode / adversarial / launch-brief scenarios transcript
Evidence: Live scenario driver script
Source: Live scenario driver script
Evidence: Daemon injection e2e log
Source: Daemon injection e2e log
Evidence: Spawn dispatch test log
Source: Spawn dispatch test log
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 4 issues found → auto-fixed ✅
README.md- merge conflict rebasing onto origin/maindocs/calm-mode-feasibility.md- merge conflict rebasing onto origin/maindocs/calm.md- merge conflict rebasing onto origin/maintests/fm-calm-claude-mod-live-e2e.test.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
FM_OPERATIONAL_MARKER_LIVE_E2E=1 tests/fm-operational-marker-live-e2e.test.sh(real claude 2.1.291, private tmux socket)FM_HOME=/nonexistent-nm bash ~/.no-mistakes/evidence/01M488P2AP1YFQA8C99CBKWB7T/live-scenarios.sh <worktree>: real daemoninject_msg+should_exit_afkagainst a real Claude pane, adversarial captain inputs, and a real launch-brief doorbell launchtests/fm-operational-input.test.shtests/fm-afk-inject-e2e.test.sh(real daemon process, Scenario D claude doorbell)tests/fm-spawn-dispatch-profile.test.shtests/fm-calm-claude-mod.test.sh(mod doorbell port agrees with the owner on all 28 cases)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.