Spaces:
Sleeping
Sleeping
Commit History
-
test: strengthen langgraph entrypoint check, clarify blank-translation failure
Per review Ruling A-11: test_langgraph_json_entrypoint_resolves now also asserts the resolved symbol is callable and that every parameter carries a default (i.e. invocable with zero arguments), so a future required-arg regression on create_graph fails the suite instead of only breaking at Studio load time. The factory is deliberately never called (inspection only) — building a real graph costs seconds, the exact per-run cost Ruling A-2 declined to pay at import time. Also gives test_no_translation_is_blank the same descriptive failure message as its two sibling tests.f620717 -
fix: make langgraph.json's declared entrypoint resolvable
langgraph.json pointed at a module-level `graph` symbol in agent/graph.py that was never defined. This diverges from the brief: rather than adding `graph = create_graph()` at module scope (measured cost: ~7-17s per import, paid by every test run touching agent.graph and by app startup), repoint langgraph.json at the existing zero-argument factory `create_graph`, which LangGraph Studio accepts directly. agent/graph.py is untouched.e454a3d
-
feat: report which metrics passed the consensus gate, not just whether any did
_market_expectations_aligned returns True if EITHER revenue or eps aligns, and by design only revenue normally will: basis_mismatch is the documented, expected outcome for eps, because yfinance publishes adjusted estimates against this repo's GAAP reported figure. A future consumer reading the boolean and rendering an actual-versus-consensus EPS line would render a comparison the gate explicitly refused -- a false claim produced by a fail-closed gate working correctly. display_policy gains market_expectations_aligned_metrics: the list of metrics that actually passed, e.g. ["revenue"]. The boolean stays for backward compatibility and is documented as coarse -- "at least one metric aligned", not sufficient authority to render any particular comparison. The provider-flag branch it ORs with is payload-wide and names no metric, so it can set the boolean True over an empty list; the helper docstring says so. Both fail-closed sites gain the key as an empty list rather than leaving it absent…586fba9 -
feat: compute market_expectations_aligned from the consensus archive
4a70f17
-
fix: close 4 post-merge review gaps in continuity threads
Post-merge fix wave on the whole-branch review of continuity-threads: - Verification: continuity_threads now goes through the same fail-closed filtering (_filter_unverified_claims) and reliability recompute (_collect_facts) as earnings_quality_signals/ between_the_lines, so an unverified/hallucinated thread evidence item is dropped before it can be persisted to data/threads.db or shown on screen, and never keeps the LLM's self-assigned reliability. - storage/threads_db.py: mark_missed and continue_thread are now idempotent per period, so regenerating a brief for the same filing period (a normal Streamlit action) no longer double-counts a missed quarter or duplicates a history row. - Error isolation: continuity_node, the apply_continuity_threads call in synthesis_node, and continuity_view.render() now wrap their new threads_db I/O in try/except and fail gracefully, matching the established pattern elsewhere in the codebase (signals_node, _finalize_synthesis_pr…05863a5 -
feat: wire continuity_node into the LangGraph pipeline
Adds a deterministic continuity_node between profile_evidence and agent that loads open continuity threads for the ticker and injects them as an "== OPEN THREADS FROM PRIOR QUARTERS ==" context message. synthesis_node now persists the LLM's thread classifications via apply_continuity_threads right after attach_edge_signals, and retires threads the LLM didn't reference this run. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>131143b
-
fix: raise synthesis max_tokens to 64000 and surface truncation explicitly
The single-call synthesis (brief + company profile + per-fact evidence_ref, merged in 8727e56) needs 25-40K output tokens; the inherited 16384 cap (from the pre-merge two-call split) cut the JSON mid-object every time (stop_reason=max_tokens confirmed on a live AAPL run), failing parsing and producing an empty PARTIAL brief (verified: 0/0) regardless of data quality or freshness. This was the actual cause behind every "not enough verified evidence" report throughout this incident, including the original stale NVDA brief. 64000 is claude-haiku-4-5's output ceiling (verified live), with billing only for tokens actually generated. Also detect stop_reason/finish_reason == max_tokens/length on the stream and raise SynthesisTruncatedError, so a future truncation produces an explicit "truncated by the token limit" reason instead of a generic JSON-parse failure message. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>602548d -
fix: keep fail-closed per fact but stop zero-verified synthesis from emptying the whole brief
When no AI-generated claim passes deterministic evidence verification, the brief used to be replaced wholesale by an empty _partial_brief skeleton, discarding filing_date, company_name, what_to_watch, coverage, etc. even though those don't depend on LLM verification. Now only the per-fact filtering (unchanged, still fail-closed) empties individual sections, and a plain-language notice + data freshness banner (120-day staleness heuristic) tell the user what's missing instead of hiding the whole report. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>b419b7b
-
feat: merge Company Overview generation into single synthesis call
Company Primer (renamed Company Overview) was generated by a separate background LLM call, decoupled from the main brief synthesis. It now shares the same synthesis call via a deterministic profile-evidence node, dropping the standalone thread/job in app.py. Nav reordered for a PM/equity-analyst flow (Overview -> PM Flash -> Evidence & Deltas -> Financials -> Ask AI) and hardcoded nav labels now route through i18n. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>8727e56
-
feat: multi-provider LLM support, prominent chat, design pass, and new analytics
- Add agent/llm.py provider factory (Anthropic/OpenAI) with a sidebar model picker so visitors can paste their own API key instead of relying solely on the server's; thread the resulting config through generation, chat, and translation. - Promote Chat to primary nav (was buried under a secondary "Evidence tool" heading) with suggested-question chips and a "sources searched" line. - Fix a pre-existing bug where every nav/CTA color accent silently no-oped (Streamlit exposes st.button(key=...) as a `st-key-{key}` wrapper class, not a `key` attribute) and tighten the palette to three families (emerald brand, violet AI, semantic bull/bear). - Add a "Sources analyzed" provenance card, quarter/annual basis split on the financials grid, and cross-category signal dedup. - Add valuation + peer comparison, next-catalysts, brief-vs-brief delta, and one-page PDF export. - Rename the product from Primer to Amplegest across the app, docs, and the Hugging Face Space (old URL redire…7880373
-
chore: checkpoint sidebar nav + i18n work-in-progress before Decision Stack redesign
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>e6496c0
-
fix: harden _extract_json — use raw_decode to ignore trailing JSON objects and prose
Fixes 'Extra data' synthesis error when LLM outputs multiple JSON objects (e.g. when asked about 'NVDA AAPL' as a single ticker before the sidebar fix). json.JSONDecoder().raw_decode stops at the end of the first complete object, so a second object or closing commentary no longer breaks json.loads. Adds 5 unit tests covering: simple object, nested braces, two concatenated objects, trailing prose, and markdown code fence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>b002600
-
deploy: Primer app for HF Spaces — clean orphan history
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>35676b4