LevSMS · Phase 2 plan
Upload pipeline · Phrases · Multi-area
Generated: Fri, May 29 2026 · 10:39 AM EDT (NY) · 13 Sivan 5786 · Parashas Nasso · Session 39 cont
Repo: hookstreet-workspace · LevSMS router @55 (Phase 1 pending clasp reauth)

You sent a big braindump. Phase 1 (Friday-tomorrow-is-Shabbos / next-Mincha-is-Kabbalat-Shabbos / Sat-morning-is-Shabbos-Shacharis) is coded and waiting on clasp reauth. Phase 2 is what's below. Each section ends with a tiny question for you so I'm not building speculatively. Tap one option per question and I'll start.

A · Upload pipeline

You drop a schedule. I parse, preview, you approve, sheet updates.

The folder. You said you'd upload to a folder you'll tell me about — recommend either:

  • Google Drive folder "LevSMS — Schedule Uploads" (Apps Script watches it natively, fires every 15-30 min)
  • OneDrive folder in this workspace at levsms/intake/incoming/ (Claude Code watches via a Windows scheduled task or a workspace Codex cron)

Recommended: Drive folder — Apps Script can poll it and write parsed results straight into APPROVED_RESPONSES without leaving Google. You drop from your phone, no upload friction.

What I'll accept:

  • PDF (shul weekly schedule, common)
  • JPG / PNG (you photograph a flyer)
  • Google Sheet (paste a tab in, I read it)
  • Plain text / .txt (you dictate or paste)

Parser → preview → approve flow:

  1. You drop file into the folder.
  2. Apps Script (or workspace cron) picks it up within 15 min.
  3. I parse — shul name, Shacharis/Mincha/Maariv times, weekday vs Shabbos vs Sunday split, area (NW / Five Towns / Lawrence / Brooklyn / etc.).
  4. I render the preview: exact SMS text we'd serve, character count + Twilio segment count (so you see "this is 1 segment / this is 3 segments"), and a diff against the current row.
  5. Preview goes to your Telegram with two buttons: APPROVE / EDIT. (Edit = you reply with corrections in text; I re-render and re-ping.)
  6. On APPROVE, I write to APPROVED_RESPONSES + log to a new UPLOAD_LOG tab (timestamp, filename, area, what changed, who approved).

Per your "test it with me first before you update the actual sheets" — every upload pauses at preview. Nothing writes to the live sheet without your tap.

Q1 — Folder choice?
(a) Google Drive folder "LevSMS — Schedule Uploads" (recommended — Apps Script native)
(b) OneDrive workspace folder levsms/intake/incoming/ (workspace cron — slower)
(c) Both — Drive primary, OneDrive mirror
B · Friday upload reminders

Telegram pings until you upload — and one when you do.

Schedule (every Friday, NY time):

  • 10:30 AM — soft nudge: "Friday — schedules ready? Drop in LevSMS — Schedule Uploads when you have them."
  • 11:00 AM — only if folder still empty.
  • 11:30 AM — only if folder still empty (slightly louder).
  • 12:00 PM — only if folder still empty: "Last call before I freeze last week's schedule for Erev Shabbos."
  • If you upload at any point → instant Telegram preview + nudges stop.

Per the NO Auto-Send to Named Humans rule we just locked, these only ping you, never anyone else.

Q2 — Reminder cadence?
(a) All four (10:30 / 11 / 11:30 / 12) (your stated default)
(b) Just two (10:30 + 12) less noisy
(c) Just one (11:30)
C · Phrases tab (tone in the sheet)

Move the tone language out of code into a tab you can tweak.

Your point: "those things shouldn't live in the code… it should live somewhere where I can see it… separated, that in the future I can add to, tweak it." Building it as a new PHRASES tab:

Key Window Frequency Phrase
erev_shabbos_closeFri, candles −60 min~15% of repliesGood Shabbos - enjoy family, yummy food, the quiet.
erev_shabbos_normalFri AM-noon~10%Have a great Shabbos.
motzei_shabbosSat after havdalah, 90 min~15%Gut voch.
weekday_morningMon-Thu 5-9 AM~5%Have a productive day.
yom_tov_eveerev Yom Tov~20%Chag sameach.

Columns: Key | Window | Frequency | Phrase | Enabled. You add rows freely; Enabled=FALSE disables one. Random selection within the active window (per your "acute way randomly here and there not always and not to all people").

Phrases append to the reply, never replace it. Never on STOP/HELP. Length-aware (skipped if the reply is already 1 segment from cap, so the phrase doesn't push us into a 2nd Twilio segment).

Q3 — Phrases tab now?
(a) Yes, build it with the 5 seed rows above; I'll edit/add freely (recommended)
(b) Yes, build empty — I'll seed the first phrases myself
(c) Not now — Phase 1 + uploads first
D · Multi-area + ZIP fallback

Five Towns / Lawrence / Far Rock / Brooklyn — and reasonable guesses elsewhere.

How it grows:

  1. New SCHEDULES tab keyed by area_code (NW, FT, LAW, FAR, BORO, FB...). One row per shul per area with weekday/Sunday/Shabbos times.
  2. Uploads parsed in section A flow into this tab tagged with the area I detected from the file (or you choose at preview).
  3. AREA_NAME_TO_ZIP already exists — extend it: "five towns" / "5 towns" / "lawrence" / "far rockaway" / "far rock" / "boro park" / "flatbush" / "fb" / "monsey" / "lakewood" → ZIPs.
  4. Acronyms inside reply bodies (KLA, KBH, NH, KO) stay shul-local; area-level acronyms (5T, NW, FR) get added to a small lookup.

ZIP fallback (your "no schedule but I know the ZIP" case):

  • Sunset + candle-lighting come from Hebcal for any US ZIP — already wired.
  • Approximate Friday-night Mincha = candle-lighting − 35 min (community average; flag as "approx").
  • Approximate Shabbos Shacharis = 8:30/8:45/9:00 (typical Orthodox range; flag as "approx").
  • Approximate weekday Mincha-Maariv = sunset − 15 min summer, sunset − 5 min winter (flag as "approx").
  • Every approx reply says "approx for {AREA} — confirm with your local shul" so we never claim certainty.
Q4 — Multi-area scope first?
(a) Five Towns + Lawrence first (geographically adjacent; recommended)
(b) Brooklyn (Flatbush + Boro Park) first
(c) All four (Five Towns / Lawrence / Far Rock / Brooklyn) simultaneously
E · Auto-learn + segments (later)

Pick up the weekly cadence + start differentiating per user.

  • Auto-learn: after 4 weeks of uploads per shul, infer the recurring pattern (weekday vs Shabbos vs Sun). If next Friday no upload by noon, fall back to the inferred schedule with a "previous weeks' pattern" note instead of stale data.
  • Per-user segments: CONTACTS tab gets a Segment column (NW_local / Visitor / OutOfArea / Family). Reply content can branch: NW_local gets full shul-level Mincha list, Visitor gets the area summary + "text SHUL <name> for that shul", OutOfArea gets ZIP-fallback approx.
  • The "good Shabbos" closer from section C ties into segments — Family segment gets warmer accents, NW_local gets the standard one, Visitor gets none.

Section E builds after A+C are live and we have 3+ weeks of upload + reply data to learn from. I'm not starting it speculatively.

Suggested build order
  1. Phase 1 ship — Friday/Shabbos transition fixes (waiting on clasp reauth, ~5 min after you run ! clasp login).
  2. Section A — Upload pipeline + Section B reminders. Build this week, test next Friday.
  3. Section C — Phrases tab + length-safe random appender. Same week.
  4. Section D — Multi-area (start with whichever area you pick in Q4) — build only after first uploads validate the parser.
  5. Section E — Auto-learn + per-user segments. After 3-4 weeks of section D data.
Source trail. outputs/2026-05-29_10-39_plan_levsms-phase-2-upload-pipeline-phrases-areas.html · workspace master · LevSMS router pending @55 (Phase 1).