--- id: TAMQ-WP-0009 type: workplan title: "Interactive recipient-aware message composer" domain: communication repo: tmux-amq status: finished owner: codex topic_slug: coulomb-social planning_priority: P0 planning_order: 14 created: "2026-08-24" updated: "2026-08-24" state_hub_workstream_id: "8005dcc7-2433-5484-82e3-d528eaf6d967" --- # Interactive recipient-aware message composer Make bare `@` safe for ordinary unquoted prose while keeping the selected recipient visible and switchable. ## Required operator contract Running `@` without arguments opens an inline composer whose prompt is the selected repository, for example `@flex-auth: `. Plain text is read directly from the terminal, so apostrophes and other shell punctuation do not require quoting. Tab cycles through the other repository windows in the managed session, preserving the draft. Enter queues the message and Ctrl-C cancels it. The initial recipient is the latest durable inbound sender when available. If there is no message history, use the first other repository in the session. The existing `@ MESSAGE` shorthand remains a non-interactive fast path and retains normal shell quoting rules. ## Expose session recipients to the generic command ```task id: TAMQ-WP-0009-T01 status: done priority: high state_hub_task_id: "320e4c7c-9c44-5023-8c60-7b270a0276f5" ``` Encode the addressable repository list in the tamq-owned generic `@` shim, without changing shell configuration or trusting arbitrary repository names. Exclude the current repository from the interactive recipient cycle. ## Implement the terminal composer ```task id: TAMQ-WP-0009-T02 status: done priority: high state_hub_task_id: "6973e046-f8b3-50d1-958b-4216af656624" ``` Add a small terminal-local editor that displays `@recipient: `, accepts literal UTF-8 prose, handles backspace and Ctrl-U, cycles recipients on Tab without losing the draft, submits on Enter, and restores terminal settings on every exit path. Ctrl-C cancels without queuing a message. ## Prove and document the interaction ```task id: TAMQ-WP-0009-T03 status: done priority: high state_hub_task_id: "85b8bb9f-cf0d-5d95-9598-1cec8449ac17" ``` Cover recipient ordering, shim metadata, non-TTY rejection, punctuation, editing and cancellation with pseudo-terminal tests. Run the full checks, install the build, exercise the composer in the live two-window session, and update README and SCOPE. ## Completion evidence - `make check`: 109 tests passed, including pseudo-terminal coverage for literal apostrophes, recipient cycling with draft preservation, UTF-8-aware backspace, Ctrl-U, Ctrl-C, and terminal restoration. - Coverage: 76% overall and 76% for the new composer module. - `make install`: installed `tmux-amq==0.1.0` and refreshed the live session's tamq-owned command shims. - Live `flex-auth` composer: delivered `What's up? WP0009-live-smoke` without shell quoting, then retained `cycle-draft` while Tab changed the visible recipient from `@audit-core: ` to `@railiance-platform: `. Ctrl-C cancelled that draft. The controlled smoke message was acknowledged; existing user messages were not.