Skip to content

feat: add Telegram mode - two-way captain phone chat through the phone-inbox bridge - #1

Merged
morris2spears merged 6 commits into
mainfrom
fm/telegram-relay-build
Jul 29, 2026
Merged

morris2spears merged 6 commits into
mainfrom
fm/telegram-relay-build

Conversation

@morris2spears

@morris2spears morris2spears commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Adds Telegram mode: two-way phone chat with firstmate through the existing phone-inbox bridge.

  • Inert by default: zero behavior change until a home creates the gitignored config/telegram-mode flag; a fresh clone behaves identically to today (tested).
  • Bootstrap arms/removes a byte-validated state/tg-watch.check.sh identity shim and a 30s watcher cadence config, the same contract as X mode; the watcher dispatches the trusted bin/fm-tg-poll.sh only on an exact byte match.
  • The poll reads only the local pending directory and wakes firstmate with note ids only - note bodies and text-derived filename slugs never reach poll output, wake payloads, or state artifact names (pinned by tests, including a real-watcher end-to-end run).
  • The fmtg-respond skill owns claim/classify/act/reply through phone-inbox's durable bridge, with bin/fm-tg-link.sh / bin/fm-tg-followup.sh for milestone and final follow-ups under a local cap and window.
  • Authority boundary: a Telegram message may dispatch work, answer questions, report status, and drive normal reversible task lifecycle; destructive, irreversible, and security-sensitive actions still require the captain in a trusted session.
  • No firstmate-side code reads the Telegram bot token or phone-inbox config.

Validated by no-mistakes (run 01KYQGGP1AAKACECPG45JRGVXM): review findings fixed and re-verified across two rounds, tests, documentation, and pinned ShellCheck 0.11.0 lint all green. Two review findings were deliberately accepted by decision: follow-up threads of already-linked tasks may finish after opt-out, and the reply bridge subcommands ship ahead of the separate phone-inbox deployment with a documented stop-and-report path until it lands.

Pipeline

Updates from git push no-mistakes run 01KYQGGP1AAKACECPG45JRGVXM: intent, rebase, review (2 rounds, all accepted findings fixed and re-verified), test, document, and lint completed; the validated pipeline push published head 815deb80572a50b9761d1d6f275c9ac47be3d010 to this branch. The pipeline's own PR-creation step failed while the repository migrated to this fork (it inferred the old upstream as base), so this PR record was completed manually against the same validated pushed head with no further commits.

…e-inbox bridge

Inert until a home opts in via the gitignored config/telegram-mode flag.
Bootstrap then arms a byte-validated tg-watch.check.sh identity shim and a
30s cadence config, exactly the X-mode contract; the watcher dispatches the
trusted bin/fm-tg-poll.sh, which surfaces pending phone-inbox note ids
(never bodies, never text-derived filename slugs) as tg-message wakes with
durable offer markers, pruning and a 30-minute re-offer. The fmtg-respond
skill owns claim/classify/act/reply through the phone-inbox durable bridge,
with fm-tg-link.sh and fm-tg-followup.sh carrying milestone and final
follow-ups under a local cap and window. Reversible lifecycle actions only:
destructive, irreversible, and security-sensitive actions still require the
captain in a trusted session. No firstmate-side code reads the bot token.
The lint meta-contract pins the exact set of interop tests allowed a
'# shellcheck source=bin/' directive; test files that source production
libs use 'source=/dev/null', the same idiom as the X security and
turn-end guard suites.
@morris2spears
morris2spears merged commit 284dcc4 into main Jul 29, 2026
10 checks passed
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