chore(news): complete signals v2 cutover#117
Merged
Merged
Conversation
The transitional v1 `score` fallbacks were dead code the moment FinSearch #361 shipped: v2 is a hard rename (signals-v2.schema.json requires sentiment_score, additionalProperties:false) and AF normalizes at its API boundary, so `score` cannot reach the wire from either the latest read or ?as_of. Delete both — the adapter's and the panel's — so a producer break raises instead of rendering a plausible number. Fixtures were the third blind channel: hard-pinned to schema_version 1 with a `score` key, they stayed green while prod served v2. They failed when you fixed them and passed when you were wrong. Re-vendored verbatim from the producer (the golden fixture is already v2 upstream) rather than hand-edited, per the plan's own copy-don't-edit policy. The vendored schema turned out to be inert — nothing in the suite loaded it, which is exactly how it sat at v1 for a day after the producer moved to v2 with nothing red. jsonschema was already a dependency, so the fixture now validates against it and the vendored pair polices itself. Not touched: api/v2/models.py's NewsSentimentEntry.score. It validates the internal envelope, whose vocabulary is decoupled from the wire's by design; _project_entry still emits `score` deliberately. Also corrects this plan's Task 6, whose file list omitted app.py — the root cause of the /home-news-signals.js 404 that made the panel five empty boxes from 5d29d51 until #115. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pbs5wnQZhTi9CQ3pb14vDo
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- requirements.txt: jsonschema arrives as an mcp transitive but the fixture test now imports it directly. Comment the line so a future prune doesn't drop it. (Declared here, not pyproject: that's orchestration's package.) - test_news_sentiment_fixture.py: keep isinstance(..., float) rather than relaxing to (int, float). The schema's `number` admits ints, but the producer builds the value with float() + round(), so float is the real invariant — and since jsonschema.validate() only covers the on-disk fixture, this is the wire fixture's only type guard. Comment says so. - panel design spec: last `signals-v1` reference; de-versioned rather than bumped to v2 so it can't re-stale on the next bump. Suite 975 passed / 4 skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pbs5wnQZhTi9CQ3pb14vDo
This was referenced Jul 15, 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.
PR-2b. Closes out the FinSearch
score→sentiment_scorerename now that v2 is live end-to-end (FinSearch #361, ATL #115).Dead fallbacks deleted —
_project_entry'ssig["sentiment_score"] if ... else sig["score"]and the panel's?? s.score. v2 is a hard rename (schema requiressentiment_score,additionalProperties: false) and AF normalizes at its boundary, soscorecan't reach the wire via latest or?as_of. Tolerating it would only paint a plausible number over a real break.Fixtures were the third blind channel. Pinned to
schema_version: 1+score, they stayed green while prod served v2 — they failed when you fixed them and passed when you were wrong. Re-vendored verbatim from the producer (its golden fixture is already v2) rather than hand-edited, per the plan's own copy-don't-edit policy.signals-wire-fixture.jsonis regenerated by the documented transform; I verified the generator reproduces the committed v1 wire byte-for-byte from the v1 base first, so there's no incidental formatting churn.The vendored schema was inert — nothing loaded it, which is how it sat at v1 for a day after the producer moved to v2 with nothing red.
jsonschemawas already a dependency, so the fixture now validates against it and the pair polices itself. Verified it has teeth: fed the old v1 fixture it fails withFailed validating 'const' ... 2 was expected.Not touched:
api/v2/models.py'sNewsSentimentEntry.score— internal envelope, decoupled from the wire by design._project_entrystill emitsscoredeliberately; both docs now say so explicitly, since this keeps getting flagged as a missed rename.Also in here (same plan file, so splitting would only cause a conflict): plan Task 6's file list omitted
app.py— the root cause of the/home-news-signals.js404. Corrected, plus a routing step and acurl-the-asset check, because "open the page and look" is what let an empty panel pass review.One test dropped ("prefers sentiment_score when both present") — vacuous once the fallback is gone. Suite 975 passed / 4 skipped.
Stacked on #116 (backtest logging), which makes the new fail-loud actually observable rather than swallowed by the bare except. Independent files; either order merges.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Pbs5wnQZhTi9CQ3pb14vDo