fix: backfill symbol_demand for sidebar-added symbols + analyst ratings schema fix

- Add await ctx.cache.subscribe() to addSymbol mutation so symbols
  added via the sidebar get registered in symbol_demand and yfinance
  jobs are queued immediately
- Backfill PEP, WYNN, STZ, CELH into symbol_demand + adapter_queue
- Upgrade yahoo-finance2 3.15.3 -> 3.15.4 and pass validateResult:false
  to quoteSummary() to handle Yahoo schema drift
- Add error detail logging for analyst ratings schema failures
- Update .gitignore with common ignores
This commit is contained in:
Investor Flow Build
2026-07-23 18:02:24 -04:00
parent 5ef2b2f060
commit e262187c3c
204 changed files with 25014 additions and 2934 deletions
+17
View File
@@ -2,6 +2,8 @@
This file is the ubiquitous language for the Investor Flow project. It is a glossary, not a spec. Updated inline as terms are resolved during design (per the `domain-modeling` skill).
**Status of what is built vs pending** lives in `docs/FUNCTIONAL_DESIGN.md` and `docs/TECH_DESIGN.md` (audited 2026-07-18). Do not treat this glossary as a build checklist.
## Product
**Investor Flow** — A beginner-first, multi-tenant investment research terminal for retail investors with some stock experience, focused on conviction-based investing (not trading). Local-first: SPA + Bun/SQLite backend, Docker Compose deployment. Voice: convex in process, soft in presentation.
@@ -128,6 +130,8 @@ Screener output policy (both modules): symbol + "why matched" + one-tap "open in
**Stale-While-Revalidate** — The SPA reads from cache instantly and the backend silently schedules a background refresh if the row is past its staleness window — the user never blocks on a live fetch. Duplicate concurrent cache-misses for the same key collapse to ONE fetch (multi-tenant dedupe per ADR-0004).
**Rate-Limit-First Data Plane (ADR-0009)** — Every vendor (Yahoo, X, FRED, SEC, Reddit) has a short rate limit. Design for that: request path serves cache / static first; only `AdapterQueue` does outbound fetches; a 429 cools down the *entire source* for minutes (not a 2s job retry); demand set bounds work; stale UI beats empty UI that thrash-retries.
## P7 — Visualizations teach mechanics, never decorate outcomes
**P7** — Core UX principle (added alongside P6). Every visualization makes a mechanical relationship more *legible*, never more *exciting*. Visuals can teach or manipulate (Robinhood's confetti SEC fine is the cautionary tale). The four guardrails:
@@ -240,3 +244,16 @@ Each independently alertable; surfaces on M1 (L1), M10 portfolio dashboard (L2),
**Exit Strategy** — First-class field on `Strategy` (alongside Setup). Previously we specified entries but not exits. Now: Exit Strategy = the derisk + exit logic authored per-Strategy, sourced from the Derisking Strategy Library (6 primitives above, default per complexity).
**Two-Axis Derisking** — The app considers BOTH thesis-status AND price-momentum before suggesting. Winning + thesis intact → collar or scale-out; winning + thesis weakening → scale-out + tighter •••; losing → cut only (never average down or sell puts against a loser; those are trader-paths beginners lose on, not in our app). LLM Analyst Voice distinguishes: "Thesis still intact at A-STAR? The collar protects downside while keeping your winners. Thesis weakening? Scale out — don't insure a name you might not want."
+## Session Start Protocol (2026-07-08)
++**Problem:** The `session-context-loader` skill installed globally via `npx skills add` doesn't auto-trigger on OMP session start. Even though SKILL.md is in `~/.pi/agent/skills/session-start/SKILL.md`, OMP only loads AGENTS.md files from project directories into context — it doesn't scan and invoke installed skills automatically.
++**Investigation findings:**
+- Confirmed skill file exists at both `~/.pi/agent/skills/session-start/SKILL.md` (direct copy) and `~/.agents/skills/session-start/SKILL.md` (symlink target)
+- Verified frontmatter format matches working skills like anti-sleep (name + description fields identical)
+- Discovered Pi/Claude Code only loads ~45 of 60+ installed skills into available tools list — session-start is in the "not loaded" group along with ~15 others
+- OMP's context injection mechanism: reads AGENTS.md from project directory and injects it into `<context>` block automatically. Skills are separate — they're available as tools but not auto-triggered.
++**Resolution:** Manual skill invocation instead of inlining session-start logic into project-specific AGENTS.md files (which wouldn't be generic anyway). Updated `~/Documents/investor-flow/AGENTS.md` to remove conflicting instructions about reading wiki page directly, replaced with brief note that session-start skill handles context loading.
++**Key takeaway:** OMP loads AGENTS.md automatically for project-specific instructions, but does NOT auto-trigger skills from ~/.pi/agent/skills/ — requires manual invocation or explicit user request. npx skills add puts files in right place but doesn't change OMP's discovery behavior.