# Gemini-in-Sheets Handoff — v1 MIS Sheet Cleanup

**Generated:** Sun, May 3 2026 · 9:04 PM EDT (NY)
**Author:** Claude Code · Session 22 pt 2
**Target sheet:** `MIS_v7.1_gsheet_forclaudeedit` · Drive ID `1HEmRevZZZmpXEnjkkwxIw0VetEjFVe5ZxVYzu4hgo2c`
**Purpose:** Sheet-layer fixes Gemini can execute directly. Code-layer fixes are already pushed via clasp (separate, no Gemini action needed).

---

## How to use this doc

1. Open v1 sheet in Chrome desktop
2. Click the Gemini icon (sidebar, top right)
3. Paste each numbered task below into Gemini's prompt one at a time
4. If Gemini needs clarification or hits a missing column / unexpected formula, **stop and paste its question into this Claude Code session** — I'll resolve and give you the corrected instruction
5. After each task, verify the spot-check (column / cell / value)

---

## Task 1 — Fix SPY price showing `MISSING_PRICE`

**Where:** `Tickers` tab (or wherever live ticker prices feed from — could also be `LIVE_GUARD` or a master ticker tab)

**Prompt for Gemini:**

> Find the row for SPY in the Tickers tab. The price column currently shows `MISSING_PRICE` or is blank. The formula should be `=GOOGLEFINANCE("SPY","price")` for the live price column and `=GOOGLEFINANCE("SPY","changepct")` for the change% column. Verify the formula is intact and not returning #N/A or an error. If GOOGLEFINANCE fails for SPY specifically, try `=GOOGLEFINANCE("NYSEARCA:SPY","price")` instead. Also check that no manual override has been pasted into the cell as a literal "MISSING_PRICE" string. Report what you found and what you changed.

**Spot-check after:** SPY row in Tickers tab → price cell shows a number (~590-610 range as of May 2 close), not text.

---

## Task 2 — Fix Tape Breadth (Momentum Regime column)

**Where:** `Momentum_Engine` tab (also called `Snapshot` or `ME` — should have ~58 columns and one row per ticker)

**Background:** The email reports "🚀 Upward: 0 | 🐢 Downward: 0 | 🔥 High Volatility: 72". The Volatility Mode column works (72 high-vol detected). The Momentum Regime column is either blank or missing the values that classify each ticker as bullish/bearish/sideways.

**Prompt for Gemini:**

> In the Momentum_Engine tab, find the column titled "Momentum Regime" (around column Z, near "Trend Direction"). For most tickers, this column is currently showing 0 or blank. Look at the formula in row 2 (first data row) of that column. It should classify the ticker based on momentum indicators (e.g., 13W trend, 30D average, RSI, or composite score) into one of these labels: "🚀 Strong Up", "🐢 Strong Down", "Sideways", or "Mixed". 
>
> Tell me:
> 1. What is the current formula in the Momentum Regime column row 2?
> 2. Is the formula referencing columns that exist and have data? (Trend Direction, 30D %, 3D z-score, etc.)
> 3. If the formula is broken or evaluating to 0 because of empty inputs, propose a replacement formula that uses these columns: Trend Direction (col Y), 30D % (col K), 3D z-score (col AP). Suggest the rule: if 30D% > 5% AND Trend Direction contains "Up" → "🚀 Strong Up"; if 30D% < -5% AND Trend Direction contains "Down" → "🐢 Strong Down"; otherwise "Sideways".
>
> Do not write the new formula yet — just report the current state and propose the replacement. I'll confirm before you write.

**Spot-check after:** Momentum_Engine column "Momentum Regime" → 30+ rows show emoji-labeled values, not all 0. (Code-side I already made the breadth counter accept plain-text "Bullish"/"Bearish" too as a defensive fallback, so this only needs to populate with *something* meaningful.)

---

## Task 3 — Audit SACS_Upgrade_Log for MANUAL_NEEDED rows

**Where:** `SACS_Upgrade_Log` tab

**Prompt for Gemini:**

> In the SACS_Upgrade_Log tab, find any row where the Status column equals MANUAL_NEEDED (or is highlighted yellow). For each such row, tell me:
> 1. The "Fix" name (e.g., FIX_4_ZSCORE_RETURNS, FIX_6_CLOSE_VS_OPEN, FIX_7_EXP_DECAY, FIX_8_POOL_STARVATION)
> 2. The exact "Detail" message
> 3. Which column the script was looking for and could not find by canonical name
>
> Also report: in the Snapshot tab, list ALL column headers (row 1, columns A through BF) so I can map which existing column should match the missing canonical name.

**Spot-check after:** I'll receive the column header list and the canonical names — I'll patch `findCol_` aliases in `runSACSUpgrade.js` to wire up the 4 skipped fixes.

---

## Task 4 — Trade_Planner entry dates

**Where:** `Trade_Planner` tab

**You do this manually, not Gemini** (it's data entry):

1. Open Trade_Planner tab
2. Find rows for SPY, META, ASML, AVGO, and any other current holding
3. Find the column "Entry Date" (or similar)
4. Type the actual date you opened each position in YYYY-MM-DD format

**Why:** The email's "Trade Progress" section currently says "(no entry date in Trade_Planner)" for every holding. Once dates are populated, the time-since-entry math will work and show 1d/3d/7d performance correctly.

---

## Task 5 — Paste missing v2 tabs into v1 sheet

**Where:** v1 sheet `MIS_v7.1_gsheet_forclaudeedit` · ID `1HEmRev`

**Background:** v2 xlsx has 4 valuable tabs not yet in v1. CSVs already extracted to `MIS/audits/v2_extracts/`.

**Prompt for Gemini (paste each as new tab):**

> I need to add 4 new tabs to this sheet. For each, create a new tab with the exact name, then paste the CSV content into A1. Preserve formatting (the source CSVs use commas as delimiters; values are clean). After each, freeze row 1.
>
> 1. **Tab name: `Entry_Pad`** — single-screen trade ticket with ACTUAL vs IDEAL split. Source: `MIS/audits/v2_extracts/Entry_Pad.csv`. After paste, the formulas referencing other tabs (Snapshot, Tickers) need to be re-pointed to v1's tab names — please confirm the lookups work. Position: tab #4 (right after main engine tabs).
>
> 2. **Tab name: `EntryTracker`** — 47-col trade log scaffold. Source: `MIS/audits/v2_extracts/EntryTracker.csv`. Position: right after Entry_Pad.
>
> 3. **Tab name: `Blind_Side_Analysis`** — holder-bias check. Source: `MIS/audits/v2_extracts/Blind_Side_Analysis.csv`. After paste, replace the blank Setup/SACS/ActionFlag columns with VLOOKUP formulas pointing to v1's Snapshot tab.
>
> 4. **Tab name: `HANDOFF_2026-05-01`** — embedded session brief for any AI agent reading this sheet. Source: `MIS/audits/v2_extracts/HANDOFF_2026-05-01.csv`. Position: at end of tab list (reference doc).
>
> Report: tab names created, any formula breaks (Excel-Sheets translation issues), any prompts where you needed clarification.

**Spot-check after:** v1 sheet has 4 new tabs. Entry_Pad shows `⏸ Enter a ticker in C3 to begin`. Blind_Side_Analysis row 3 (SPY) shows actual SACS/ActionFlag values once VLOOKUPs land.

---

## Task 6 (DEFERRED — do not run tonight) — Macro feeds

**Status:** Macro shows blank `—` for Gold/BTC/ETH/USD-EUR in tonight's email. Code is correct (`emailDailySnapshot.js:4372-4374` uses `CURRENCY:XAUUSD`, `CURRENCY:BTCUSD`, `CURRENCY:ETHUSD`). 

**Likely cause:** GOOGLEFINANCE returns blank for those symbols outside US market hours / on weekends.

**Test:** Mon May 4 between 9:30 AM and 4:00 PM EDT — if still blank then, real bug. Don't waste cycles tonight.

---

## What's already fixed (no Gemini action)

These are **code-layer** changes I just pushed via clasp to v1 script `1yBMzt` at 9:04 PM EDT:

1. **Bug #1 (Gemini's diagnosis)** — HTML email's "💎 LEAN IN" section now correctly splits into "✅ ACTIONABLE TODAY" (Lean In + In Sync gate) vs "💎 LEAN IN SETUPS — INFORMATIONAL ONLY" (pattern only, no execution). Game Plan and Trade Actions will agree from next email forward.

2. **Breadth filter defensive** — `misBuildBreadth_` now matches emoji OR plain text ("Bullish"/"Bearish"/"Strong Up"/etc). Even if Task 2 above doesn't fix the sheet column, the email won't show 0/0 if the column has any meaningful labels.

3. **getUi safe wrapper** — `safeAlert_` from earlier session means alerts no longer crash from non-UI contexts.

4. **🧪 Test Power Hour menu item** — bypasses weekend + dedup, lets you fire test sends any time.

---

## Source trail

- **Code commits pending:** workspace `master` branch, `MIS-v1-script/emailDailySnapshot.js` modified, not yet committed
- **Working dir:** `C:\Users\ztrei\OneDrive\2. Hook Street\05. 2026 BH\`
- **clasp push at:** 9:04:25 PM EDT, May 3 2026
- **Local file:** `outputs/2026-05-03_21-04_action_gemini-sheet-handoff.md`
