feat(news): panel feed prefers raw items endpoint#107
Merged
Conversation
…esentative feed Adds fetch_items/_feed_from_items against the new /api/news/items/ producer endpoint and wires a fail-closed chain into get_latest_panel_payload: prefer the richer multi-story items feed, fall back to the existing Phase-A representative feed (extracted to _representative_feed) on any items failure (404, transport error, unparseable body, missing 'items' list, or all-items-malformed). Wire shape is unchanged. Also stubs the test fixture's _http_get_items to a fast 404 by default so pre-Phase-B tests don't silently hit the live network now that the panel payload path calls fetch_items().
…ses)
body.get('items') would AttributeError on a valid-JSON but non-dict body
(e.g. a bare list from a misconfigured FINSEARCH_ITEMS_URL); the brief
required fetch_items to never raise. Guard body is a dict before .get so it
fails closed to None -> panel falls back to the representative feed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018rCr1NSRDG8kpsYtHPndmM
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
Follow-ups landed: (1) adapter + fixtures moved to the news-story v1 wire shape ( |
FlyM1ss
added a commit
that referenced
this pull request
Jul 14, 2026
Review follow-ups on the headline/url fix. The rename itself was silent in prod for hours because failing closed and failing visibly are different properties, and this seam only had the first. - get_latest_panel_payload: ERROR when a non-empty batch projects to zero usable entries. One bad story stays a per-item warning; wholesale drift is now loud. An empty batch is "no news", not drift. - items-wire-fixture.json: the items wire shape was previously only inline dicts inside individual tests, so it drifted with the adapter and stayed green. Record it once (key set verified against prod), drive the happy path from it, and guard it against the retired title/link vocabulary. The fixture reconciles with the signals fixtures' source_items/diagnostics, so the pair also shows the Phase-B breadth claim (6 stories -> 2 signals). - docs: status line said AF #359 was unmerged and named #107 as the consumer; AF is live and #107 shipped without the adapter half. Note that no consumer reads schema_version, record the known gap (mocked producer can't catch a rename), and add a postscript on why the rollout inverted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase B of the FinSearch news-signals integration (Phase A = #102). Upgrades the Home panel's feed (left column) to prefer FinSearch's new
GET /api/news/items/raw-items endpoint, falling back to the existing Phase-A representative-story feed on any failure — so the panel can never regress below Phase A.What it does
get_latest_panel_payloadnow fetches/api/news/items/first for the feed; on any failure (transport error, non-200, unparseable/non-dict body, empty, all-malformed) it falls back to the signals-derived representative feed.signals/status/overview/stalenessstill come from the signals artifact (unchanged).{headline, source, url, published, ticker}); the AF wire now speaks news-story v1 (headline/url+schema_version). Frontend: heading → "Latest news", null-ticker meta-line fix.FINSEARCH_ITEMS_URLenv (.env.exampleupdated);fetch_itemsis fully fail-closed (never raises).Tests: +9 offline cases in
test_news_sentiment_adapter.py(mapping correctness, each fallback trigger, signals-down-skips-items-fetch, non-dict body). Adapter file 30/30.Depends on: the FinSearch
/api/news/items/endpoint being deployed (separate PR in Agentic-FinSearch). Until then the feed transparently uses the Phase-A source.Note on CI: the one failing test (
test_agent_runs_metadata.py::test_engine_llm_run_metadata_snapshot) is pre-existing onmain, unrelated to this PR — introduced by #104 (_llm_run_metadatareadsself.prompt_adaptations, which the__new__-based test never sets). Tracked separately.🤖 Generated with Claude Code
https://claude.ai/code/session_018rCr1NSRDG8kpsYtHPndmM