# Handoff — Morning-Brief Reply Handler (Phase 3) — fresh-session kickoff

**Generated:** 2026-05-26, 3:10 PM EDT (Session 39) · America/New_York
**Why this exists:** Session 39 got heavy (multiple briefs + audits + the dual-Gmail wiring). The next job — building the reply-handler that completes the morning-brief loop — deserves a clean session. Open a NEW Claude Code session, paste the prompt at the bottom. This doc is the brief.

## The ONE job (do not expand scope)

Make the morning brief a real **review → reply → re-shape** loop. Today the brief *fires* (Telegram, ~6:48 AM, enriched with calendar + flagged email) but **replying to it does nothing.** Build the piece that ingests Sam's reply and re-shapes his day. This is THE spine — per `outputs/2026-05-25_workflow-vision-reconstruction.md`, it's the single missing thing the whole vision hinges on.

**Acceptance test (Sam's words):** Sam gets the brief on his phone → replies by voice/text ("Q1 send to Mildred; skip the Eden chase; also call Asher before noon") → within a short window the system produces a "tweaked beginning of the day" reply (confirmations + revised plan) AND the changes land in the Action_Queue. The loop closes.

## What's already built (do NOT rebuild)

- **The bot fires the brief:** `command-inbox/start-here.gs` → `morningBriefing_()` (called by a ~6:48 AM trigger) → `buildMorningContext_()` (queue + Context tab + today's Calendar + flagged Gmail) → `callClaude_()` → `sendTelegram_()`.
- **The bot already routes free-form replies to Claude:** `command-inbox/Code.js` `doPost` → non-command Telegram messages go to `callClaude_(raw, buildClaudeContext_())`. So conversational reply plumbing EXISTS — it's just not wired to "re-shape the day / update the queue."
- **Commands exist:** routeCommand_ handles QUEUE/DONE/DEFER/DELEGATE/PROOF/GROCERY/STATE/REVIEW. The reply handler should *reuse* these, not reinvent.
- Action_Queue + Action_Events tabs are the system of record. Sheet ID `1U0-Ll_WDDiYPuzXRnkISGfUTWxOpWQgz3gprQvAcXNU`.

## The build (minimal path)

1. **Parse the reply with Claude, not regex.** A reply like "send Q1 to Mildred, skip Eden, also call Asher before noon" → Claude extracts intents: {answer a question, drop/defer a card, add a card}. Reuse `callClaude_` with a structured-extraction prompt that returns JSON of actions.
2. **Apply the actions via existing functions** — add card / defer / done via the same paths `routeCommand_` uses. Log to Action_Events. Do NOT build a parallel write path.
3. **Send the "tweaked day" reply** — one Telegram message: confirmations ("✓ added: call Asher; ✓ dropped Eden today") + the revised top-3. No questions, just the updated picture.
4. **Channel:** start on **Telegram** (the brief already lands there; conversational reply already routes through doPost). Email-reply is a later increment.

## Constraints / do-not (carry these in)

- **clasp push needs `--force`** in non-interactive mode (manifest confirmation). `clasp push --force` from `command-inbox/`.
- **ASCII-only in any `.ps1`** — Windows PowerShell 5.1 mangles em-dashes/smart-quotes (broke a script this session).
- **Don't break the live bot** — it texts Sam daily. Wrap new reads in try/catch; verify a clean `clasp push` (no syntax error) before declaring done. The `*/` inside a JS comment also breaks the parser — avoid.
- **Secrets via PropertiesService only** (ANTHROPIC_API_KEY, TELEGRAM_*, INBOX_SECRET already there). Never echo or commit them.
- **Parallel sessions:** Sam runs 2-3 at once. `git fetch origin master` + rebase before editing shared docs; re-fetch before push. The auto-index pre-commit hook rebuilds `outputs/index.html` automatically — don't hand-run build_index.py.
- **No scope creep.** Build the reply handler. Not money-in-the-brief, not the dashboard, not a 6th surface. One thing, finished to "Sam uses it tomorrow without it breaking."

## Running in parallel (Sam's hands, separate from this build)

Sam is doing the **MIS↔BOS trigger cleanup** himself (disable BOS v1 all; BOS v2 keep Sunday only; verify MIS `/src` orphan = 0 triggers). That's the fix for duplicate/noisy emails. It's independent of the reply-handler build — don't touch triggers.

## Read FIRST (receipts)

- `outputs/2026-05-26_14-40_strategy_the-one-place-honest-assessment.html` — the full current-state picture + critical path (reply handler is step #1).
- `outputs/2026-05-25_workflow-vision-reconstruction.md` — why this loop is THE spine.
- `command-inbox/start-here.gs` (morningBriefing_, buildMorningContext_, buildClaudeContext_, callClaude_, routeCommand_) + `command-inbox/Code.js` (doPost routing).
- `docs/daily-cadence-system/MORNING_BRIEF_TEMPLATE.md` (the reply contract Sam envisioned).

## Output + notify

- Deliver as a briefing in `outputs/`, commit + push (deploys to ops.hookstreetservices.com). The pre-commit hook rebuilds the index.
- Notify Sam via `powershell -File scripts/notify.ps1 -Message "..." -Title "..."` (the SMS channel) when there's something to test or a decision needed.

## PASTE-READY PROMPT for the new session

```
Use the hookstreet-session-operator skill. Read outputs/2026-05-26_15-10_handoff_reply-handler-build-kickoff.md
in full — it is your brief. Build the morning-brief reply handler (Phase 3): replying to the
Telegram morning brief should parse the reply with Claude, apply the actions via the existing
routeCommand_/queue functions, log to Action_Events, and send back a "tweaked day" confirmation +
revised top-3. Reuse what exists (doPost already routes free-form replies to callClaude_); do not
rebuild commands or add new surfaces. Read every file in the Read FIRST list before writing code.
Constraints: clasp push --force from command-inbox/; ASCII-only PS; don't break the live bot
(verify clean push); secrets via PropertiesService; pull-rebase before pushing (parallel sessions).
Commit + push; notify Sam via scripts/notify.ps1 when there's something to test. One thing, finished.
```

---
*Handoff by Claude Code · Session 39 · 2026-05-26. The reply handler is the last mile of the morning spine — the single highest-leverage build per the honest assessment.*
