Spaces:
Running
Running
Commit History
Yesterday
-
fix(reeval): count limit on evaluated tickers instead of skipped micro-caps
03926bd -
fix: prevent reeval 60m timeouts, prioritize Flint for Skeptic, and clean docs
0ea8d95
5 days ago
-
fix(debate): ask the skeptic for three sentences and call ERNIE first
A longer ask left the message body empty. ERNIE wrote the bear case in that body on a hunt-sized bull case, with Super VL and Flint behind it. Co-authored-by: Cursor <cursoragent@cursor.com>527f69d -
fix(debate): use the free models that wrote a bear case on the VPS
Super VL, ERNIE, and Flint returned a real skeptical answer. Gemma, Lightning, and the router did not. Co-authored-by: Cursor <cursoragent@cursor.com>a0ccb41
6 days ago
-
fix(debate): start the skeptic on the free router instead of Gemma
Gemma's shared pool can refuse a whole hunt, so the skeptic now tries the router, then Lightning, then Gemma before the single-analyst fallback. Co-authored-by: Cursor <cursoragent@cursor.com>d406c40 -
fix(debate): take turns on the free tier instead of camping on one model
Four regions were calling Gemma together and then falling back onto the pitcher's model, so the skeptic and judge never ran. Co-authored-by: Cursor <cursoragent@cursor.com>9a0c3ef -
fix(ops): retry Finnhub 429s and reach the seen-ticker API over HTTPS
Insider calls were one-shot under the free-tier cap, and the seen-ticker client posted plain HTTP to the TLS port, so both fell back and the VPS ledger never updated. Co-authored-by: Cursor <cursoragent@cursor.com>39c4621 -
fix(langsmith): send session id with verdict feedback and query runs via SmithDB
Feedback now includes the project id SmithDB requires, and the golden-dataset script uses the run query that stays available after January 31, 2027. Co-authored-by: Cursor <cursoragent@cursor.com>16c007c -
fix(llm): read LangChain content blocks as text
A model refusal now arrives as a list of blocks. Treating that list as a string made the fallback chain skip a live model. Co-authored-by: Cursor <cursoragent@cursor.com>7d8c688
10 days ago
-
feat: attribution-weighted scoring, drawdown reeval, live free-model filter, and HF sync
e960af1 -
fix(gatekeeper): add fast_info and Finnhub fallback for marketCap
9d4d01f
28 days ago
-
improve(analyst): richer context for thin-coverage names
Cisco Ponce- Add instructions for handling sparse data (be honest about gaps, don't hallucinate) - Include full value snapshot in hunter context for better analysis - Emphasize triangulation and concrete bear case even with limited datafcb1d44 -
fix(uk): make UK hunt more resilient to thin markets
Cisco Ponce- Add region-specific liquidity adjustments for UK (lower dollar volume/avg volume thresholds) - For UK, be more lenient with seen-tickers and allow more retries - Filter Brave trending garbage for UK - Request more results from screener for UK - Remove seen_tickers.json that was causing issues03e8260
-
test(discovery): add logic tests + CI step; richer scout logging
Cisco Ponce- tests/test_discovery_improvements.py: no-network tests covering candidate filters, dynamic+seed merge dedupe, insider scoring, SEC submissions parsing and Form 4 parsing (32 assertions). - Run both logic suites in the hunter workflow before the hunt. - Log the winning candidate's source, dollar volume and score breakdown.0e36681 -
fix(sec): repair EDGAR ground-truth lookup and Form 4 feed
Cisco PonceBoth SEC paths were effectively broken: - sec_edgar searched EFTS with a tickers= filter that EDGAR ignores, so it silently returned unrelated companies, then read entity_id/accession_no fields that do not exist in the response (it returns ciks/adsh, and file_num is a list not a string). Resolve the ticker to a CIK via company_tickers.json and read the authoritative submissions API instead. - _extract_section grabbed the table-of-contents stub (page numbers) rather than the body; iterate matches and pick the first followed by prose. - insider_feed Form 4 parsing used the same non-existent fields and built malformed archive URLs; parse ciks/adsh and extract the ticker from display_names. The analyst prompt now receives real MD&A / Risk Factors text and working filing URLs instead of empty/incorrect context.6a7799d -
feat(scoring): fold insider buying into candidate ranking
Cisco PonceInsider buying is the strongest known alpha signal in micro-cap investing, and the insider feed already existed but was never used for discovery. Score candidates with a cached insider lookup (+20 net buying >=500k shares, +12 otherwise, -5 for net selling) plus a tradeable-liquidity bonus so genuinely liquid names out-rank harder-to-act-on ones. Cached per run to bound API calls.9772328 -
feat(discovery): dynamic whole-market micro-cap screener + liquidity gates
Cisco PonceDiscovery was limited to a hand-curated ~40-ticker seed pool, so the hunter could never surface a gem outside that list. Add a primary dynamic scan via the Yahoo screener (yfinance EquityQuery + screen) that pulls every equity in a region within the market-cap/price band, sorted by volume, then merges the seed pool as a fallback so coverage is never lost and a screener outage degrades gracefully. Every candidate now passes hard liquidity/quality gates before it can consume the region's analyst slot: min avg volume, min avg dollar volume, price floor, exchange allow-list, short-interest cap, and a pump/blow-off guard (large intraday spike on abnormal volume). Requires yfinance>=1.6 for the screener API; guarded so older versions fall back to the seed pool.b88be55
-
fix(logging): make get_logger INFO output actually visible
Cisco Ponceget_logger(__name__) returned logging.getLogger('src.whale_hunter'), which is NOT a child of the configured 'primogreedy' logger, so every INFO record had no handler and was silently dropped — only WARNING+ leaked to stderr via logging.lastResort. CI runs therefore never showed 'Sending analysis...' or 'Email sent to ...', making it impossible to confirm emails were sent. Namespace every caller under 'primogreedy' so they inherit the StreamHandler, and stop propagation to the root logger to avoid duplicate lines.2a7b815 -
feat(email): enrich hunter + reeval reports with real information
Cisco PonceReeval email was a bare Ticker|Old|New|Status table. Rebuild it as one rich card per ticker using the structured InvestmentVerdict: business summary, bear/base/bull valuation, fair-value range + margin of safety, bottom line, risks, invalidation facts and cited-source count, plus a summary header and a skipped/errors section. Hunter email gains a financial snapshot table (cap, price, sector, revenue, growth, margins, cash, debt, P/B, current ratio, short % float) before the analyst memo, and the no-candidates body is now HTML.b2f2a40 -
fix(email): never send a blank report body
Cisco PonceA failed/empty free-tier model completion made the verdict string empty, so the hunter email reduced to a bare <h1>/<h3> heading with no analysis. When the body is blank, send an explicit 'no analysis produced' notice instead so the recipient always sees why there is nothing to read.01f46a9 -
fix(analyses): coerce LLM next_review_at to YYYY-MM-DD or None
Cisco PonceFree-tier models return prose (e.g. "continuous monitoring advised") for next_review_at; the VPS DATE column rejected it and the whole POST /analyses 500'd, silently losing the analysis. Extract a date or drop it before sending.9ce57d2 -
feat(llm): allow STRUCTURED_MODEL env override (force strongest reasoner)
Cisco Ponce67a3878 -
fix(framework): populate proposal.md fields on the paths that actually run
Cisco PonceThe structured framework fields were being dropped on every common path: - reeval single-LLM branch returned no 'structured' key -> submit_analysis got structured=None -> sparse analysis (this is the branch debate falls back to, which the last CI run hit). - whale_hunter single-LLM branch used a legacy inline 5-section prompt instead of the shared Senior Broker prompt, so framework fields were never even requested. - the debate judge prompt asked for only 5 legacy keys, so USE_DEBATE=true (the CI default) produced verdicts with empty framework fields. Also add concurrency groups to both workflows: the VPS DuckDB is single-writer and free-tier model limits are shared, so overlapping runs (scheduled + manual, observed 2026-10-12) cause lock conflicts and 429 storms.136b0f2 -
feat(llm): pick best free-tier models + add structured fallback chain
Cisco PonceLive benchmark (2026-10-12) against the OpenRouter free tier showed the old config was actively broken: - nemotron-3.5-lightning (chain head + debate pitcher) returned empty/ truncated completions and rate-limited constantly. - inclusionai/ling-3.0-flash-sante:free was de-listed (404). - STRUCTURED_MODEL (dots-3-note) is token-hungry and truncated at low budget. Changes: - MODEL_CHAIN: ultra-550b, super-120b, dots-3-note, openrouter/free (strongest reasoners first; dead + broken entries removed). - STRUCTURED_MODEL -> super-120b (fastest schema-valid JSON). - add STRUCTURED_CHAIN + invoke_structured(); agent/reeval/whale_hunter now fall back across structured models instead of dropping to free text (and losing the proposal.md framework fields) when one model 429s. - debate: PITCHER default -> ultra-550b; fix fallback-equals-primary bug via _fallback_for(). - docs updated to match.f8615d8 -
fix(prompt): escape literal braces in framework sources example
Cisco PonceThe [{type,url,date,period}] example is consumed by str.format(); unescaped braces raised KeyError and would break every analyst call. Now escaped as {{type,url,date,period}} so formatting yields the literal text.d550354 -
feat(review-gate): stage analyses instead of auto-trading
Cisco PonceImplements the proposal.md 3-layer framework review gate: - InvestmentVerdict gains framework fields (scenarios, sources, data-quality flags, proposed action, review trigger) - Senior Broker prompt requests the structured framework output - portfolio_tracker: submit_analysis / get_pending_reviews / accept_decision / dismiss_decision against the VPS review gate - whale_hunter: discovery stages a watchlist analysis (INITIATE / PENDING / DISCARD) instead of recording a trade or hitting Alpaca - reeval: re-evals submit analyses; only MAINTAIN refreshes the ledger; INCREASE/REDUCE/CLOSE/INITIATE wait for explicit acceptance - vps/schema.sql: analyses + watchlist tables, paper_portfolio.analysis_id2c6cc1b
-
fix(debate): raise judge token cap + skip token-limited models
The free Dots3 Note judge model burned its 4096 completion-token cap on reasoning (3328 tokens) before emitting JSON, triggering a parse failure. - raise judge max_tokens to 8192 (structured + plain-JSON paths) - treat 'length limit' / parse failures as fatal for that model and jump to the next fallback instead of retrying the same exhausted model - trim judge prompt (bull/bear 2500, SEC 1500) to reduce token pressure5558ac2 -
fix(debate): stop judge verdict being dropped by LangGraph state schema
Root cause of the production 'NoneType' has no attribute 'verdict': judge_node always produced a valid InvestmentVerdict, but LangGraph silently dropped '_structured_result' because it was not declared in DebateState. whale_hunter/agent then crashed on result.verdict (None) and fell back to single-LLM, so the debate NEVER succeeded. - declare _structured_result in DebateState so the verdict flows through - harden judge: retry empty (None) structured output per model with backoff - judge walks a fallback chain of structured-capable models (3 distinct role models preserved: pitcher=Nemotron 3.5, skeptic=Nemotron Super, judge=Dots3 Note), then parses plain-LLM JSON as last resort - guard empty completions in pitcher/skeptic resilient calls - update README to reflect the real judge model (Dots3 Note)06bc648 -
fix(international): normalize UK per-share metrics + feed real value data to all regions
- P0: normalize UK EPS/book/price (pence->pounds) in analyst_node so the Graham number isn't inflated ~100x; also normalize 52W range in prompt - P0: inject currency-labelled value snapshot (revenue/cash/debt/ratio/EV) into analyst + debate prompts for ALL regions, not just US - P1: remove Finnhub '.'-guards; switch insider feed to global insider-transactions endpoint so non-US symbols get real data - P1: pre-validate Brave tickers (drop zero-cap) + expand seed pools - P2: gatekeeper market-cap size filter now converts native currency to USD - add 40-test suite covering all improvements7d2fdd1
-
fix(hunter): send failure email for UK (and all regions) on pipeline crash
The outer try/except in hunt_region swallowed pipeline crashes and returned success:False without ever reaching the email node, so UK failure emails were never sent. Now the except handler calls email_node directly with the crash detail, and email_node distinguishes a real pipeline crash (subject: 'Hunt Failed: <region> (Pipeline Crash)', with the error trace in the body) from a normal no-candidate run. Existing found/no-candidate email behavior is unchanged.38a6463 -
fix(llm): use non-reasoning Dots3 Note for structured verdict output
nemotron-3.5-lightning burns up to ~900 completion tokens on internal chain-of-thought before emitting the verdict, which can exceed strict max_tokens and break InvestmentVerdict JSON parsing. Dots3 Note is a non-reasoning model that handles tool calls + JSON cleanly and was verified to produce a valid verdict within budget.6db94fa -
fix(llm): update OpenRouter model chain to currently-available free models
All 5 previously configured free-tier models (stepfun/step-3.5-flash, z-ai/glm-4.5-air, arcee-ai/trinity-*, nvidia/nemotron-3-nano-30b-a3b, meta-llama/llama-3.3-70b-instruct) returned 404 — no longer on the free tier, silently breaking the analyst/structured-output pipeline. New chain (verified live via OpenRouter API 2026-09): - nvidia/nemotron-3.5-lightning:free (primary, clean tool-calling) - nvidia/nemotron-3-super-120b-a12b:free - dots-studio/dots-3-note-preview:free - inclusionai/ling-3.0-flash-sante:free - openrouter/free (resilient router catch-all) STRUCTURED_MODEL -> nemotron-3.5-lightning:free (reliable finish_reason=tool_calls for InvestmentVerdict structured output). Updated debate defaults, EVAL_MODEL, model benchmark list, and docs.8005d62
-
fix(llm): use verified free models to avoid Venice/Google rate limits
- Replaced OpenRouter models handled by Venice (Llama, Mistral, Qwen, Hermes) which hit 402 USD spend limits. - Replaced Google AI Studio models (Gemma) which hit global 429s. - Updated MODEL_CHAIN and debate defaults to use StepFun, GLM 4.5 Air, Trinity Large, Trinity Mini, and Nemotron which successfully passed live API tests.9b1451e -
fix(llm): replace failing free models with high-context alternatives
- Removed Mistral which was hitting 402 USD spend limits on Venice - Downgraded Gemma which was constantly hitting 429 limits - Added Hermes 3 405B, Qwen 3 Coder, and GLM 4.5 Air to fallback chain - Updated debate agents to use Qwen 3 (Pitcher) and Hermes 3 (Skeptic) by defaulta0243a3 -
fix(debate): exponential backoffs for 429 rate limits
The debate nodes were instantly retrying fallback models upon getting a 429 on the primary model, effectively flooding OpenRouter and tripping global rate limits. - Implemented _resilient_llm_call with 15s->30s->45s exponential backoff - Increased LangGraph judge node _debate_retry to start at 15.0s48954f1 -
fix: resolve rate limits and token exhaustion
- src/llm.py: Swapped Nemotron (reasoning) for Llama 3.3 as primary and STRUCTURED_MODEL - src/llm.py: Increased 429 backoff from 2s to 8s (8 req/min free tier) - src/agents/debate.py: Added 10s delay between debate nodes + Llama 3.3 fallbacks - src/reeval_portfolio.py: Increased inter-ticker delay from 2s to 15s28d9630 -
fix: reduce structured LLM max_tokens 65536→8192
SOPA hit the 65536-token ceiling — the model burned all tokens on reasoning before completing the JSON. 8192 is more than enough for the InvestmentVerdict schema (5 fields). On failure the pipeline still falls back to plain LLM.591e23a -
fix: cache analyst prompt + demote Hub 404 from warning to debug
The LangSmith Hub prompt pull was logging a noisy warning on every ticker. Now cached after first call and demoted to debug level.f55f5fc -
feat: portfolio re-evaluation GitHub Action + structured LLM timeout
- New src/reeval_portfolio.py: fetches US tickers from VPS DuckDB, runs gatekeeper+analyst, updates verdicts, routes BUY through Alpaca - New .github/workflows/reeval.yml: daily 14:00 UTC + manual dispatch - src/llm.py: add 120s request_timeout to get_structured_llm() - scripts/test_reeval_us_tickers.py: local test with --limit flagc602f24
-
feat: VPS dashboard + LangSmith online evaluators and prompt versioning
- Add GET /portfolio/summary (lightweight stats, no yFinance calls) - Add GET /dashboard serving a full Chart.js portfolio dashboard - Create src/core/online_eval.py with inline format_score and verdict_validity evaluators that post LangSmith feedback per run - Add tag_for_review() to annotate WATCH/fallback runs for human review - Support PROMPT_VERSION env var in senior_broker.py for Hub A/B testing Made-with: Cursorffc1e30 -
fix: VPS schema migration, EU noise word, global Pydantic warning filter
- Migrated VPS DuckDB: added position_size, order_id, fill_price, broker_status columns to paper_portfolio (was causing 500 errors) - Added EU, UK, UN, AI + other 2-letter abbreviations to noise filter - Moved Pydantic warning suppression to module-level (the context manager approach was too narrow — warning fired outside the block) Made-with: Cursor1358dec -
feat: increase max_tokens to 65536 + add project showcase HTML page
- Bump structured output max_tokens from 16384 to 65536 (free models) - Add docs/index.html — modern dark-theme showcase page covering: - Architecture diagrams (Hunter, Debate, Orchestrator) - Sample verdict output - All key modules through Sprint 9 - Sprint timeline (7→8→9) - Tech stack and LangGraph features used Made-with: Cursor195fc1b -
feat: widen market cap to $5M-$500M, dynamic amnesia, more noise words
- Expand screener + gatekeeper range from $10M-$300M to $5M-$500M to unlock hundreds of fresh tickers across all regions - Dynamic seen-ticker amnesia: AVOID/WATCH expire after 14 days, BUY/STRONG BUY locked for 30 days (via VPS LEFT JOIN on portfolio) - Add AEDT and 12 more common English words to noise filter - Deploy updated API to VPS (restarted and verified) Made-with: Cursora6f44ed -
fix: Kelly per-verdict caps, more noise words, higher token limit, Pydantic warning
- Cap Kelly per verdict: STRONG BUY 25%, BUY 15%, WATCH 5% (was flat 25%) - Cap raw Kelly fraction at 0.5 to prevent extreme values from small avg_loss - Add THING, TXTW, MRC, HERE and 20+ more common words to noise filter - Increase structured output max_tokens from 8192 to 16384 - Fix Pydantic warning filter to match by module instead of message string Made-with: Cursor73d6dae -
fix: bump structured output token limit to 8192 + add noise words
- Increase max_tokens from 4096 to 8192 to reduce fallback rate (reasoning models burn ~2000 tokens thinking before structured output) - Add FINRA, LISA, ATM, AMA, FDA, PHNX, IPG and other financial acronyms to the noise word filter Made-with: Cursorb329f6a -
feat: Sprint 9 — Execution & Quality Control
Pre-Sprint Bug Fixes: - Fix double-header in verdict reports (strip LLM-embedded headers) - Fix structured output token limit (get_structured_llm with max_tokens=4096) - Fix fallback path skipping Kelly (compute position sizing in except block) Epic 1 — Grading Engine: - scripts/build_golden_dataset.py: curate 50 LangSmith traces into Dataset - scripts/evaluators.py: 5 evaluators (catalyst grounding, company identity, format, verdict validity, Kelly math) - scripts/run_evals.py: evaluation runner for LangSmith Experiments Epic 2 — Alpaca Paper Trading: - src/broker/alpaca.py: order router, submission, status tracking - Wire Alpaca execution into portfolio_tracker.py - Update VPS schema + API with order_id, fill_price, broker_status Epic 3 — Intraday Catalyst Triggers: - vps/catalyst_poll.py: polling daemon (volume, price, insider triggers) - GitHub Actions repository_dispatch for catalyst-alert events - whale_hunter.py CATALYST_TICKER env var for single-ticker mode Epic 4 — Multi…645673f
-
fix: cron performance — stale seeds, Kelly cache, ticker noise, SEC timeouts
- Remove 18 dead tickers from seed pools (yFinance 404s), add 11 fresh Canadian micro-caps (pool went from 2 to 13 alive tickers) - Cache Kelly stats for 10 minutes so parallel analyst_node calls don't each trigger expensive live-price lookups for the entire portfolio - Fix missing return statement in get_kelly_stats (returned None when portfolio had >= 5 trades) - Add financial acronyms (ROCE, FTSE, DJIA, etc.) to noise word filter - Tighten SEC EDGAR timeouts (10s search, 10s index, 15s filing) and cap filing download at 2MB - Suppress Pydantic serialization warnings from with_structured_output Made-with: Cursor4438658 -
fix: Brave 429 rate limiting + garbage ticker extraction
Brave Search: - Add retry with exponential backoff (3 attempts) on HTTP 429 - Add random jitter (0-2s) before first request to spread out concurrent calls from parallel region fan-out via Send API Ticker Extraction: - Only match words that are ALREADY uppercase in source text instead of uppercasing everything (real tickers appear as "AAPL" in prose) - Comma-separated path now validates that entries are short before treating them as tickers, preventing sentence concatenation garbage - Add max length filter (8 chars) to reject non-ticker matches - Expand noise word list with common 2-3 letter English words Made-with: Cursor19d2204 -
feat: SEC EDGAR ground truth + Kelly Criterion position sizing (Epic 3 & 4)
Epic 3: Add SEC EDGAR integration that fetches 10-K/10-Q filings via the EFTS search API and extracts MD&A (Item 7) and Risk Factors (Item 1A) sections using BeautifulSoup. Wired into analyst_node for US equities. Epic 4: Implement Kelly Criterion position sizing with win-rate calculation from historical portfolio data. Verdict-based scaling (STRONG BUY 100%, BUY 70%, WATCH 30% of half-Kelly) clamped to 1-25% of portfolio. - New: src/sec_edgar.py (@tool + HTML parser) - New: src/models/kelly.py (KellyStats + calculate_position_size) - Updated: InvestmentVerdict with position_size, kelly_win_rate fields - Updated: record_paper_trade to store position_size - Updated: VPS schema + API to support position_size column Made-with: Cursore813ce3 -
feat: LangGraph best-practices refactor (Sprint 8 Epics 2-3-4)
- Fix state mutation anti-pattern: all 4 workflow agent nodes + debug wrappers now return partial dicts instead of mutating state - Add Annotated reducers (operator.add) to candidates/candidate_scores list fields in AgentState - Replace deprecated set_entry_point / set_conditional_entry_point with START edges across agent.py, whale_hunter.py, workflow.py - Refactor gatekeeper routing to Command pattern, removing separate check_status functions in agent.py and whale_hunter.py - Add InMemorySaver checkpointer to all 3 graph compile() calls with thread_id config on every invoke/ainvoke - Add RetryPolicy(max_attempts=3) to all graph nodes and recursion_limit=30 to all invoke calls - Add InvestmentVerdict Pydantic model (src/models/verdict.py) with structured output via with_structured_output, graceful fallback to plain LLM - Simplify portfolio_tracker verdict parsing when structured_verdict is provided - Clean up requirements.txt: LangChain 1.0 LTS range pinning, remove …d5ba3a3