MIS Folder — Finalization

Every file by mtime · keep/archive/delete · Schwab keys migration · final state · what's done, what you do
Session 36 cont · finalization
Generated: Wed May 20 2026 · 2:30 PM EDT
Scope: entire MIS/ folder + clasp project state + Schwab/Finnhub key posture
State of clasp: auth working (Sam re-authed earlier), 4 pushes today landed cleanly

What you can do right now

Two new menu items live in MIS Tools: 🔑 Migrate Schwab/Finnhub Keys to Script Properties + 🧪 Verify Secrets Status. Run the verify first to see what's where, then migrate, then verify again. Then you can hand-clear the CONTROL tab plaintext rows for SCHWAB_CLIENT_ID/SECRET/REFRESH_TOKEN/ACCOUNT_HASH + EARNINGS_API_KEY. getControlValue_ now reads PropertiesService first for these keys.

EARNINGS_MASTER rate-limit fix is live — re-run "Refresh Earnings Master" and Finnhub will fill MSFT/INTC/LLY/NFLX/ORCL/PYPL/BIDU (which it was rate-limiting before).

Folder verdict: ~60% can move to archive. 32 files / 4 subdirectories are point-in-time artifacts from April-May audits; only ~12 files are operationally live. Section 4 below is the move plan.

1Code shipped to v1 today (4 clasp pushes)

TimePushWhat landed
1:58 PMPlanner alias cleanupemailDailySnapshot.js:51 — dropped 'test entry' pollution from MIS_CFG.aliases.planner. Was tripping fallback lookups.
2:00 PMSMS alert wiring3 new functions (misSendCommandCenterSMS, misSetSMSWebhook, misPostNotify_) + 2 menu items. Reads Command Center cells J3:N11 → posts to notify webhook → Twilio SMS. Same webhook your notify.ps1 uses.
2:26 PMFinnhub rate-limit fixCode.js:1162 — added Utilities.sleep(1100) between earnings API calls. Free tier caps 60/min; you were running ~184 calls in 60 sec → 120+ getting 429'd. Fix takes total ~3.4 min, well inside the 6-min Apps Script limit.
2:29 PMSchwab/Finnhub keys → PropertiesService2 new menu items (🔑 Migrate + 🧪 Verify Secrets Status). getControlValue_ now reads PropertiesService first for SCHWAB_*/EARNINGS_API_KEY. CONTROL cells can be cleared after migration verified.

v1 script (1yBMztL4…) is the only active production target. Old production script 1r9vWL… bound to 1cosuFr… sheet is dormant (triggers should be killed if any still fire). Sam confirmed in earlier session he killed them.

2Chronological inventory — every file, newest first

Compact ranking. Subdirectory contents covered in §3.

DateFileStatusWhy
5/20 1:55 PMcommand center Screenshot 2026-05-20 135453.pngKeepYou just sent it — proves SOSMS string exists at J3:N11. Reference for the SMS wiring.
5/20 1:22 PMSchwab, May 20.pngKeepToday's portfolio truth — Schwab side (ABNB/SLV/UNG)
5/20 1:20 PMFidelity accounts, May 20.pngKeepToday's portfolio truth — Fidelity (Invest n Save + Joint Brok)
5/19 8:59 AMREADME.mdKeepTop-level pointer. Mostly current. Worth a tune-up after this session (section header still says "v11.0g" — we're past that now).
5/14 5:13–5:16 PMFidelity 1.png / Fidelity 2.png / Schwab main_z.png / Schwab secondary.pngArchiveSuperseded by today's screenshots. Move to MIS/archive/screenshots-2026-05-14/.
5/12 3:46 PMdocs/GITHUB_ISSUES_TRIAGE_2026-05-12.mdKeepTriage of GH issues #3-#10 — reference doc. Stable.
5/12 3:16 PMFOLDER_INVENTORY.mdReview8 days stale; partly outdated. This briefing supersedes it. Either delete or pin a "see 2026-05-20 finalization" link.
5/07 5:49 PMdata/Trade_Log_Imported_22_positions.csvArchivePre-May-20 holdings. Today's reality = 21 positions, AFRM/BA/DAL closed. Superseded by outputs/2026-05-20_14-05_action_holdings-paste-may20-v3-formula-safe.md.
5/07 1:30 PMsrc/emailDailySnapshot.jsArchiveLegacy/orphaned old-production code (bound to dead script 1r9vWL). Not active. Keep for reference; never push.
5/07 1:26 PM2× Screenshot 2026-05-07 PM.pngArchiveOld portfolio snapshots
5/06 6:38 PMdocs/RUN_3PM_POWER_HOUR_MANUAL.mdKeepManual-fire runbook. Still relevant — you may still need it.
5/06 4:32 PMdocs/HOLDINGS_FIX_PASTE_INSTRUCTIONS.mdArchiveSuperseded by the May 20 v3 paste-block doc in outputs/.
5/06 4:32 PMdata/Trade_Planner_Replacement.csvArchiveOld 13-position list. Stale.
5/05 6:17 PMdocs/HOLDINGS_RECONCILIATION.mdArchivePoint-in-time reconciliation from broker CSVs. Historical artifact.
5/05 6:12 PMdata/holdings_reconciled.csv + trade_log_imported.csvArchiveSame — point-in-time.
5/05 6:12 PMscripts/build_holdings_reconciled.pyArchiveOne-time Python parser. Job done. Move to scripts/archive/ or delete.
5/05 10:32 AMHistory_for_Account_Z29720600.csv / Z29835692.csvArchiveFidelity raw exports from May 5. Stale; today's reality is 2 weeks later.
5/04 11:11–11:12 PMMIS_v7.1_audit_error_inventory.csv + audit_sheet_summary.csv + full_audit_report.md + best_effort_formula_repair.xlsx (2.7 MB)Archive5/04 deep audit (Sam ran). Useful as reference — but the .xlsx is huge. Move to MIS/archive/2026-05-04_v7.1-audit/.
5/04 7:31 PMrebuild mis claude excel build.xlsxArchiveExcel rebuild artifact, 470KB. Point-in-time.
5/04 7:28 PMscripts/build_owed_tabs.pyArchiveOne-time tab builder. Job done.
5/03 1:34 PMFINAL_STRUCTURE_RECOMMENDATION.mdArchiveSession 22 recommendation doc. Historical; recommendations have evolved.
5/03 1:30 PMaudits/v2_extracts/ (11 CSVs)Archivev2 .xlsx tab mining. One-time extraction. Useful as reference for what the broken v2 had; not actionable.
5/03 1:26 PMscripts/v11_microservices/Code.gs + appsscript.jsonArchiveExtracted V11 Microservices script. Old/dead. Reference only.
5/03 11:50 AMSCHWAB_898_TRADE_LOG_SEED.csvArchiveOld Schwab parse (AFRM 15 sh stale; AFRM is closed).
5/03 11:13 AMscripts/trigger_power_system.js + mobile_command_center.js + audits/SACS_ZScore_Analysis.docx + MIS_V11_Forensic_Teardown.mdKeepThe audits are good reference. The scripts can stay in scripts/ (they're paste-ready Apps Script tooling). Note: scripts/mobile_command_center.js is the SAME as the one in MIS-v1-script/ — but the active copy is in MIS-v1-script/.
5/03 11:37 AM.gitignoreKeepSound. Don't touch.
5/01 3:07 PMclaude_excel_# MIS Handoff Brief — 2026-05-01.txtArchiveSession 21 handoff. Historical.
5/01 3:05 PMgemini_Here is the full handoff brief form.txt + Metric Format Range.txtArchiveSister handoffs. Historical.
4/30 5:17 PMnotes mis.txt (2.1 MB)ReviewBig voice notes dump. Hard to use. Either grep it for specific topics or archive whole.
3/25docs/MIS v7.1 System Hardening.docx + v7.6 Script Audit.docxKeepBinary docs you commissioned. Reference. Have not parsed.
1/12 – 3/25python/ (v8 builders) + archive/ + docs/Trading_Engine_*.pdf + docs/3PM_*.pdf + Big Keillim TYH.pdfKeepPre-MIS-v1 reference. Not active. Don't touch.

3Subdirectory breakdown

MIS-v1-script/ Keep — this is THE clasp project

This folder is gitignored (per MIS/.gitignore); managed via clasp. All today's pushes landed here. Sole source of truth for v1 script behavior.

src/ Archive — dead production code

Old production clasp project bound to dormant script 1r9vWL…. Files match the v11.0f version from May 7. Not pushed since. Triggers on the old script killed weeks ago. Suggest renaming to src-legacy-v11.0f/ with a header note, OR move to archive/src-v11.0f-2026-05-07/.

scripts/ Review

audits/ Keep — all are good historical reference

data/ Mostly Archive

Three large .xlsx exports (MIS_live_export, MIS_v7.1_gsheet, MIS_v8_Mindblown) + four point-in-time CSVs. Archive everything older than 7 days.

docs/ Keep — mixed but useful

Mostly stable reference docs. GITHUB_ISSUES_TRIAGE_2026-05-12.md is the most recent active doc.

archive/ + files/ + python/ Already archived / dormant

screenshots/ Keep

14 PNGs from Apr 28 / Apr 30 / May 1 / May 6. Reference artifacts.

4The keep / archive / delete plan

Proposed moves (you confirm by reply, I execute)

I will NOT execute these moves without your explicit OK. The workspace policy is mv → archive/graveyard/YYYY-MM-DD_name/ — never rm -rf.

Top-level files to archive

FromTo
Fidelity 1.png + Fidelity 2.png + Schwab main_z.png + Schwab secondary.pngMIS/archive/2026-05-14_screenshots/
Screenshot 2026-05-07 at 1.26.37 PM.png + Screenshot 2026-05-07 at 1.26.54 PM.pngMIS/archive/2026-05-07_screenshots/
MIS_v7.1_audit_error_inventory.csv + MIS_v7.1_audit_sheet_summary.csv + MIS_v7.1_full_audit_report.md + MIS_v7.1_best_effort_formula_repair.xlsxMIS/archive/2026-05-04_v7.1-audit/
rebuild mis claude excel build.xlsxsame folder as above
History_for_Account_Z29720600.csv + History_for_Account_Z29835692.csvMIS/archive/2026-05-05_fidelity-history/
SCHWAB_898_TRADE_LOG_SEED.csvMIS/archive/2026-05-03_schwab-seed/
claude_excel_# MIS Handoff Brief — 2026-05-01.txt + gemini_Here is the full handoff brief form.txt + Metric Format Range.txtMIS/archive/2026-05-01_handoffs/
FINAL_STRUCTURE_RECOMMENDATION.mdMIS/archive/2026-05-03_structure-rec/
FOLDER_INVENTORY.mdMIS/archive/2026-05-12_inventory/ — this briefing supersedes
notes mis.txt (2.1MB)Your call — grep for keepers first, or archive whole

Subdirectory cleanup

FromTo
src/ (legacy old-production code)MIS/archive/2026-05-07_src-v11.0f-legacy/
scripts/v11_microservices/ + scripts/v11_excerpts_for_v1.gsMIS/archive/2026-05-03_v11-microservices/
scripts/mobile_command_center.js + scripts/runSACSUpgrade.js (duplicates of MIS-v1-script versions)delete after confirming MIS-v1-script versions are newer
scripts/build_owed_tabs.py + scripts/build_holdings_reconciled.pyMIS/archive/2026-05-04_one-time-builders/
audits/v2_extracts/ (11 CSVs)MIS/archive/2026-05-03_v2-extracts/
data/* (all 7 files older than 7 days)MIS/archive/2026-05-XX_data/
docs/HOLDINGS_FIX_PASTE_INSTRUCTIONS.md + docs/HOLDINGS_RECONCILIATION.mdMIS/archive/2026-05-XX_docs/

After moves: top-level MIS/ has ~10 files (README, .clasp files, today's 3 screenshots, this briefing reference, FOLDER_INVENTORY-link-to-this), plus 6 active subdirectories (MIS-v1-script · audits · docs · archive · screenshots · scripts-trimmed).

5Schwab + Finnhub keys → PropertiesService (the migration)

You asked: "if you want me to move the secret key for Schwab or anything, tell me how to do that, whatever I need to create. If it's the same way through script properties, I can hide my APIs and my keys."

Yes. Same pattern as the SMS webhook setup. Two-click migration shipped today.

What's in CONTROL tab today (plaintext)

KeyUsed for
SCHWAB_CLIENT_IDSchwab OAuth flow
SCHWAB_CLIENT_SECRETSchwab OAuth flow
SCHWAB_REFRESH_TOKENSchwab API auth refresh
SCHWAB_ACCOUNT_HASHSchwab positions endpoint
EARNINGS_API_KEYFinnhub API key
SCHWAB_CALLBACK_URL · SCHWAB_REDIRECT_RESULTOAuth callback handling

The runbook (3 minutes total)

Step 1 — Verify current state (30 sec)

MIS Tools → 🧪 Verify Secrets Status. Dialog shows each key with first-4 chars from CONTROL tab and from ScriptProperties side-by-side. Initially: CONTROL filled, ScriptProperties empty.

Step 2 — Migrate (30 sec)

MIS Tools → 🔑 Migrate Schwab/Finnhub Keys to Script Properties. Reads each key from CONTROL → writes the same value into ScriptProperties (same key name). Does NOT clear CONTROL — both copies exist transparently during the migration window.

Step 3 — Verify (30 sec)

MIS Tools → 🧪 Verify Secrets Status again. Dialog should now show first-4 chars in BOTH the CONTROL column AND the ScriptProperties column for every key. Both green = safe to clear CONTROL.

Step 4 — Test before clearing (60 sec)

Run MIS Tools → Test Schwab API Connection. If that returns OK, code is reading from ScriptProperties correctly via the updated getControlValue_ (which now checks Properties first). Then run Refresh Earnings Master to confirm Finnhub still works.

Step 5 — Clear CONTROL cells (manual, 30 sec)

Open CONTROL tab. For each of these rows, clear the VALUE cell (column B), leave the KEY cell (column A) intact:

Once cleared, the values exist only in ScriptProperties (bound to v1 script project). The sheet is private but ScriptProperties is one layer safer — no row/col reads ever surface them.

Step 6 — Spot-check (15 sec)

Re-run 🧪 Verify Secrets Status. CONTROL column should now read (empty) for the cleared keys, ScriptProperties column should still show first-4 chars. Run Send Morning Brief Now as a smoke test — if email fires cleanly, migration is done.

If anything breaks

Migration is reversible: re-paste the secret values back into CONTROL column B. Both code paths work — Properties first, CONTROL fallback.

Other APIs you mentioned ("see what else they can do for me")

Same Script Properties pattern works for any API. Worth considering for:

The rule: anything that looks like a secret → ScriptProperties. The CONTROL tab is for tuneable parameters (VIX bands, version stamp, last-run timestamps) — never credentials.

XWhat you do next

In order of fastest-to-meaningful:

  1. Re-paste v3 holdings block if not yet done — outputs/2026-05-20_14-05_action_holdings-paste-may20-v3-formula-safe.md. Then MIS Tools → Refresh Holdings Clean Only. ~5 min
  2. MIS Tools → 🧪 Verify Secrets Status — see baseline. ~30 sec
  3. MIS Tools → 🔑 Migrate Schwab/Finnhub Keys to Script Properties — moves all 5 secrets. ~30 sec
  4. MIS Tools → 🧪 Verify Secrets Status again — confirm both columns populated. ~30 sec
  5. MIS Tools → 🔐 Set SMS Webhook — if not yet done. URL + secret from command-inbox/.claude-notify.json. ~1 min
  6. MIS Tools → 📲 Send Command Center SMS Now — sanity test the SMS path. You'll get a text with the SOSMS string. ~10 sec
  7. MIS Tools → Refresh Earnings Master — re-run with the rate-limit fix. Will take ~3.4 min this time but Finnhub will return data for ~all stock tickers (MSFT/INTC/LLY/etc. should populate). ~3.5 min
  8. MIS Tools → Run Full Refresh Now — full pipeline, picks up new earnings data. ~2 min
  9. MIS Tools → Send Morning Brief Now — verify everything's flowing. Should show 21 holdings, ORCL Margin -38% as EXIT, AMZN +24% as REDUCE/lock-gains. ~1 min
  10. (Optional, when convenient) Clear CONTROL tab secret cells after confirming ScriptProperties side works.
  11. (Optional) Reply with the folder-move plan from §4 — I'll execute the mv commands to archive in a single commit.

Total active time: ~15 min. SMS me when each major step completes (or just at the end with "all done").