Skip to main content
Glama
MarketTwits MCP

MarketTwits MCP

by yar822

MarketTwits MCP

Local SQLite archive and MCP search service for Telegram channels @markettwits (-1001203560567) and @marketfeed (-1001263412188).

Folder structure

What

Location

Accepted worldviews and evidence

worldview_create/results/<asset>/<id>/

Construction prompts and harness versions

worldview_create/versions/

Versioned judge prompts, criteria and harness

worldview_judge/versions/

New judge experiment inputs, checkpoints and outputs

worldview_judge/results/<asset>/<run>/

Historical experiments, benchmarks and reviews

research/

Published MCP worldview results

worldview_output/<dataset>/

MCP major datasets and associated experiments

research/major/

Shared LLM adapters, concurrency and backend settings

llm_backend/

Changelog and research progress

_journal/

New seven-field light judging research uses the unattended runner: one finite command freezes settings and input, processes the complete initial plan, recovers saved output locally, then corrects unresolved IDs using the configured batch/payload limits, worker count and correction budget. It checkpoints automatically and writes the final report and separate pending queues. Use python -m worldview_judge.job --help for prepare/run/resume/status. New jobs use current instrument settings; existing jobs resume their frozen runtime. Original accepted results, historical runners and published MCP datasets remain preserved. Corrective inference still requires an authorized processing task.

Raw Telegram messages remain in data/market_twits.sqlite3. See the research guide and path index for archive categories and relocated files. Experiments are published to MCP only as a separate requested step.

Related MCP server: telegram-mcp

What it stores

Use MCP get_message_by_id({"source":"marketfeed","message_id":855763}) to retrieve one original archived message by its exact source and numeric Telegram ID. Source keys come from list_channels (for example marketfeed, markettwits). The response preserves full text and gives UTC publication time, permalink and stored metadata. Missing IDs return found=false and message=null; the tool never fetches Telegram, invokes a model, filters digests or applies judgments. This raw lookup is separate from get_judged_messages. A manual server restart is required to load a newly added tool.

The read-only MCP tool get_judged_messages serves the manually digest-cleaned Gold light judgments for October 10, 2025–February 20, 2026: 10,643 valid judgments (394 High), plus 78 separate technical-pending messages. The authorized retrospective warm-up added 1,016 judgments (61 High) without changing existing results. It preserves original judge v2.8 provenance and supports exact grade/kind/topic/ID filters, UTC dates and snapshot-bound pagination. See usage and publication details. The running tool hot-loads the publication registry; restart pagination after a snapshot change.

Telegram text messages are stored in data/market_twits.sqlite3 with:

  • channel ID

  • UTC message datetime

  • Telegram message ID

  • text only

  • views count

  • extracted hashtags

  • outbound URLs, including hidden Telegram text-link destinations

The normalized message_hashtags table makes hashtag queries efficient. The sync_coverage_ranges table records successfully downloaded intervals, including empty ones, without concealing gaps between disjoint downloads.

Every Telegram fetch is appended to data/download_control.csv with:

channel_id,last_message_id,last_message_datetime,messages_requested,status,input_timestamp

Telegram credentials

  1. Sign in at https://my.telegram.org/apps and create an application.

  2. Copy .env.example to .env.

  3. Set TELEGRAM_API_ID, TELEGRAM_API_HASH, and TELEGRAM_PHONE.

Use a Telegram user account. Telegram bots generally cannot retrieve historical channel messages. On the first sync, Telethon asks for the login code and creates data/telegram_user.session. Later MCP calls reuse that authorized session.

Never commit .env or the session file; both are excluded by .gitignore.

Install and initial 2024-to-now download

cd C:\_tools\202607_tradingview_mcp\twits_mcp
Copy-Item .env.example .env
# Edit .env first.
uv sync
uv run twits-sync

The initial sync downloads from the selected channel's history_start in config.yaml through the current UTC time. It can be stopped and safely rerun: messages are upserted by (channel_id, message_id). A failed or interrupted partial range is not marked covered. Already committed batches and the final partial batch remain in SQLite, and the audit row reports the number committed during that attempt.

Multiple channels

telegram.default_channel is markettwits. Each entry under telegram.channels contains channel_id, channel_username, channel_title, history_start, and matching (hashtags or text). The former single-channel configuration is still accepted. Channel keys are exact configured names, not arbitrary Telegram usernames. Telegram resolves each configured username and verifies its numeric ID before downloading. One Telegram client/session serves both channels in the MCP process; messages, coverage, and audit entries remain isolated by channel ID.

The reviewed Market Feed backfill starts at September 21, 2025. The earliest permitted query is controlled separately by the channel's configured history_start; allowing an earlier date does not download it automatically. Backfill the configured history explicitly with:

uv run twits-sync --channel marketfeed

MCP queries also download missing intervals automatically. All text messages are stored before filtering, even without hashtags. Collection remains on demand; there is no background polling worker. Avoid running the CLI backfill and server against the same Telegram session simultaneously; use a bounded MCP request when the server is running.

The existing SQLite database is reused. Startup adds urls_json if absent, preserving archived rows. Previously archived rows start with an empty URL array; hidden links from old rows require a fresh Telegram download to recover. Raw text is retained in storage and returned as raw_text in structured output.

asset_twits accepts an optional channel parameter. Omitting it preserves the MarketTwits source and its existing hashtag matching:

list_channels()
asset_twits(instrument="NQ1!", channel="marketfeed", days=28, format="structured")
search_messages(channel="marketfeed", query="CoreWeave", days=28, limit=100)
search_messages(channel="marketfeed", query="", days=1, limit=100)

Market Feed constructs internal topic tags, then links those tags to instruments. It uses local rules without LLM calls or paid classification APIs. Generated tags are returned in topic_tags; Telegram's original hashtags and raw_text are preserved separately.

  • topic_rules.json defines shared signals (entities, events, phrases) and topics. A topic requires every listed signal within a bounded text span (220 characters by default). Matching is case-insensitive. Negated events remain relevant: "no Iran ceasefire agreement" still matches the conflict topic.

  • instrument_topics.csv links each topic to an instrument and relevance tier. The six supported instruments are BRN1!, MX1!, USDRUB, NQ1!, BTCUSD, and GC1!. Instrument normalization and the SI1! alias still apply.

Example links:

Topic

Example trigger

Instrument / tier

#iran_conflict

Iran plus attacks, blockade, troops, ceasefire, dialogue

BRN1! direct; GC1! macro

#hormuz_shipping

Hormuz plus tankers, passage, closure, explosions

BRN1! direct

#strategic_reserve_release

SPR / strategic oil reserves / IEA plus release

BRN1! direct

#russia_ukraine_peace

Russia/Ukraine plus peace or ceasefire context

MX1! direct; USDRUB macro

#russia_sanctions

Russia plus sanctions / frozen assets

MX1!, USDRUB direct; BRN1! macro

#ai_credit

CoreWeave / Oracle / AI infrastructure company plus debt / CDS / financing

NQ1! direct

#us_macro

US inflation, jobs, economic data

NQ1!, GC1!, BTCUSD macro

#iran_diplomacy

Iran plus a deal/talks and conflict-related diplomatic context

BRN1! direct; GC1! macro

#russia_diplomacy

Russia/Ukraine plus meetings/calls and Western counterparts

MX1!, USDRUB macro

#russia_fx_flows

Russian forex purchases/sales or intervention

USDRUB direct; MX1! macro

#russia_fiscal, #russia_macro

Russian budget, inflation, rates, economic activity

MX1!, USDRUB macro

#semiconductor_supply_chain

Semiconductor suppliers plus commercial developments

NQ1! direct

#us_trade_policy

US tariffs, trade agreements, export controls

NQ1!, GC1! macro

#us_rate_expectations

US rate futures, FedWatch, SOFR

NQ1!, GC1!, BTCUSD macro

asset_twits accepts min_relevance="direct", "macro" (default), or "weak". The threshold is inclusive: macro includes direct; weak includes all candidates. Weak references such as Iran without a market event are excluded by default. Routine Ukraine military headlines and generic petroleum-supply spillovers to Russian assets are also weak candidates. Russian energy-trade restrictions, critical infrastructure disruption, NATO incidents, fiscal/FX policy, diplomacy, and sanctions have their own more specific links. Food oils are excluded from petroleum tags; gold medals/cards and non-Fed uses of "fed up" are excluded. The threshold applies to Market Feed; MarketTwits retains its hashtag behavior. Use structured output for topic_matches with evidence phrases, match_reasons, and per-asset relevance (tier and matching topics). A message can match several assets. rule_version and classification_id identify the rules used. message_kind marks recognizable market wraps/digests as commentary; other messages are labeled headline, which does not assert that the information is new.

list_topics(instrument="BRN1!")
asset_twits(instrument="BRN1!", channel="marketfeed", days=7,
            min_relevance="direct", format="structured")
asset_twits(instrument="MX1!", channel="marketfeed", days=7,
            min_relevance="macro", format="structured")

Collection assigns topics after each successfully downloaded interval. SQLite stores classification metadata in message_classifications and indexed tags in message_topic_tags. Queries automatically classify older stored messages or refresh changed text/rules. A hash of the raw text detects edits, and a fingerprint of both configuration files invalidates stale classifications after rule or mapping changes. A cache check still scans the requested date window for stale hashes; cached messages do not rerun the regex classifier. No Telegram refetch is needed to classify text already in the archive.

To classify the existing local archive explicitly, without contacting Telegram or starting a service:

uv run python -m twits_mcp.topics_cli --channel marketfeed --start 2026-10-15T00:00:00Z --end 2026-10-19T23:59:59Z

Rules are heuristic candidate retrieval, not sentiment, causal influence, or a prediction of price direction. Nearby but unrelated phrases can still match; indirect references and unfamiliar names can be missed. Inspect the evidence and use raw search when completeness matters. Unsupported instruments return errors. The full-history review and validation scope are documented in docs/classification-review-2026-10-20.md. The archive-based regression cases are in tests/fixtures/marketfeed_relevance_review.json; these are curated examples, not an estimate of archive-wide precision or recall. instrument_text_rules.json is retained only for compatibility with an older server process until the user restarts it; the topic engine does not read it. After code changes the user must restart the MCP service manually. Agents must not start or restart it on the user's behalf (see AGENTS.md).

search_messages searches raw text with a literal, Unicode case-insensitive substring. An empty query returns every archived text message in the requested window. It ignores instrument mappings. Both date boundaries are inclusive; end defaults to now, and start defaults to end - days (five days by default). Results are newest first, ordered by timestamp and message ID. limit is 1–1000. Continue with next_cursor, retaining the same channel and query; omit dates to reuse the cursor's fixed window. count is the current page size, has_more and truncated indicate more pages, and the final next_cursor is null. Cursors are opaque pagination tokens, not authentication or permanent snapshots of edits.

Structured messages include the original id, ts, cleaned text, and hashtags, plus raw_text, channel, channel_id, permalink, urls, and match_reasons. These fields are additive for existing MarketTwits callers. Instrument results still return the complete bounded result without a cap. Sync metadata includes effective_start, effective_end, and requested_range_covered so requests before configured history or after now do not imply complete archive coverage. Successful covered intervals are cached; they are not periodically rescanned for edited/deleted Telegram posts.

Asset background for worldview creation

get_asset_background defaults to v3 for Gold (GC1!) on marketfeed, reading the pinned consolidated v6.2.1 evidence dataset. Other instrument/channel pairs default to v1 patterns. Explicit version="v1", "v2" and "v3" remain available. Every version reads existing local data without LLM calls or Telegram downloads. An omitted/null version selects the instrument-specific default:

{
  "instrument": "GC1!",
  "channel": "marketfeed",
  "start": "2026-07-24T00:00:00Z",
  "end": "2026-08-23T23:59:59.999999Z",
  "as_of": "2026-08-24T00:00:00Z"
}

V1 selects passages containing an asset mention, an observed price movement and a causal phrase (or a weaker connector plus a market catalyst). Digests and later explanations of earlier moves are eligible; price-only reports are excluded. Matching is bounded to sentences/lines and nearby text to reduce unrelated matches. Rules cover GC1!, BTCUSD, BRN1!, NQ1!, MX1! and USDRUB; SI1! aliases USDRUB and exchange prefixes are accepted. English and common Russian patterns are included. Patterns are heuristic: missed explanations and false positives remain possible.

start and end are inclusive publication boundaries; as_of is an exclusive publication cutoff. Explicit offsets normalize to UTC; offset-free values mean UTC. A retrospective explanation is eligible only once its own publication falls inside the requested window and before as_of. Historical message edits are not archived, so as_of does not reconstruct the exact text available at that historical time.

The structured response returns all matches newest first, without sampling or a result cap. Each retains full original text, source IDs and links. V1/v2 provide verbatim explanation_spans; v3 returns a saved reason marked llm_summary and empty explanation_spans, because no exact quotation was requested. These are reported explanations, not verified causality or independently counted events. coverage reports gaps within the effective publication window; missing data never triggers downloads. new_model_calls and telegram_fetches are always zero.

V3 returns only the 619 include decisions from the corrected immutable Gold v6.2.1 snapshot without digests. This is saved v6.2.1 inference plus user-authorized manual digest exclusions, not a v6.2.2 model rerun. The original snapshot and run artifacts remain intact. Explicit digest/market-roundup headings are also blocked at retrieval. The August24–30,2026 example now returns six non-digest sources instead of nine. Uncertain decisions remain separate counts, not accepted background or technical pending. Coverage is 1 March 2025 through 20 October 2026 at 11:44:14.977930 UTC, last day partial; later raw archive coverage does not extend classification. Rows retain actual selection_available_at_utc, execution/cache references and both original and consolidated provenance. as_of still filters publication, not judgment availability; saved judgments are retrospective. The version configuration pins the dataset manifest hash and checks required content hashes. Unsupported explicit v3 requests or changed data raise errors without fallback.

V1 implementation lives in worldview_create/background.py; rule revision asset-background-patterns-v1.2 fixes U.S./U.K. sentence boundaries, missing movement and causal wording (climbs, slumps, on, aided by, under pressure from), reverse/linked transmission wording, forecasts and non-price subjects such as Gold Fields, reserves, positions and ETF flows. It reduces cross-asset clause leakage, but remains heuristic and still misses some explanations.

For the saved updated-judge approach, use the same five inputs plus "version":"v2". V2 currently supports GC1!/marketfeed for August 24–30, 2026 only. It reads the existing partial GLM extraction through worldview_create/background_judge.py, validates pinned source hashes and exact quotation offsets, and returns original sources plus structured asset_background observations. It never runs a judge or falls back to patterns. Wider windows report coverage gaps. Missing metadata is in review_pending with eligible=null, not classified as price-only. All versions return background_version so their meanings are explicit.

V2 dataset.status=partial_stopped_on_failure preserves the original pilot's stopped state; 390/404 original source metadata records were validated offline, including 61/63 Gold-mention sources. Its 10 eligible explanations remain a research result, not a replacement for published materiality/direction classifications. Source publication as_of filtering does not establish historical availability of these later cached judgments; metadata availability/context cutoffs remain attached.

Saved version descriptors and byte-preserved implementation snapshots are under worldview_create/background_versions/: historical v1 baseline v1-patterns-r1, corrected v1 v1-patterns-r3, dispatch-only update v1-patterns-r4, cached judge v2-judge-r1, consolidated evidence v3-evidence-v621-r1 and the no-digest revision v3-evidence-v621-r2. Existing accepted worldviews, frozen judge bundles and published headline judgments are unchanged. Restart the MCP service manually to load the Gold v3 default and version schema.

Instrument mapping

Edit instrument_hashtags.csv. It uses one row per relationship:

instrument,hashtag
WBD,#WBD
PSKY,#PSKY
BRENT,#ормуз
BRENT,#нефть

Matching is case-insensitive. One instrument can have several hashtags, and the same hashtag can be mapped to several instruments. The tool does not guess links: an unmapped instrument returns an error.

The production mapping accepts either instrument,hashtag or instrument,hashtag,frequency; frequency is ignored by MCP queries. Mapping files must be UTF-8, with or without BOM. UTF-8 with BOM is recommended for reliable Cyrillic editing in Excel.

To regenerate a review file containing every stored hashtag and the number of distinct messages containing it, run:

uv run twits-tags

This writes tags/instrument_hashtags.draft.csv with the columns instrument,hashtag,frequency. Existing assignments in that output are preserved on later runs; frequencies are always recalculated from SQLite and new hashtags are added as UNMAPPED.

Run the MCP server

MCP now starts its selected Relay scheduler as a hidden child and stops it on exit. Use only the MCP command below; a separate Relay start is unnecessary. Stopping MCP drains LLM admissions for up to30seconds, then preserves unresolved delivery evidence and stops Relay. --relay-shutdown-timeout 120 extends that grace period. Client disconnection alone does not stop the scheduler. See MCP/Relay lifecycle.

Stdio:

uv run twits-mcp

HTTP:

uv run twits-mcp streamable-http --host 127.0.0.1 --port 8020

The HTTP endpoint is http://127.0.0.1:8020/mcp.

This project's pyproject.toml sets uv's cache to D:/PY/202607_algo_mcp/twits_mcp/.uv-cache, on the same drive as .venv, so uv can hardlink cached packages. The directory is ignored by Git. uv cache dir shows the effective location; an explicit --cache-dir or UV_CACHE_DIR overrides the project setting. This affects future uv invocations and does not move the old C: cache or restart a running service.

Press Ctrl+C once to stop HTTP serving. Connections have 10 seconds to drain; unfinished HTTP requests are then cancelled before normal MCP lifespan cleanup. Use --shutdown-timeout 30 to allow longer requests to finish. This is a connection-drain timeout, not a deadline for all application cleanup. Wait for Application shutdown complete and the PowerShell prompt before starting again. An interrupted history fetch may need to be requested again; committed cache data remains stored. Changes to this launcher take effect on your next manual restart; agents must not start or restart the service for you.

Codex registration:

codex mcp add market-twits --url http://127.0.0.1:8020/mcp

Tool

asset_twits(
  instrument="WBD",
  start="2026-07-20T19:00:00Z",
  end="2026-07-22T19:00:00Z",
  format="structured"
)

start and end are inclusive. Both accept ISO-8601 timestamps; values without an offset are interpreted as UTC and values with an offset are converted to UTC. end defaults to the current UTC time. If start is omitted, the legacy days parameter calculates start = end - days and defaults to five days. A request with start > end returns an error; equal values request that exact timestamp.

instrument accepts either a bare symbol or TradingView-style EXCHANGE:SYMBOL. The exchange prefix is discarded before mapping. Supported examples include CME_MINI:NQ1!, RUS:MX1!, ICEEUR:BRN1!, BITSTAMP:BTCUSD, and COMEX:GC1!. Both SI1! and RUS:SI1! are normalized to USDRUB. Instrument aliases are configured in instrument_aliases.json.

Before querying SQLite, the tool downloads any part of the requested date window not recorded in sync_coverage_ranges. Results are newest first. format="text" is the default and returns timestamp-prefixed strings. format="structured" returns message objects:

{
  "instrument": "WBD",
  "start": "2026-07-20T19:00:00Z",
  "end": "2026-07-22T19:00:00Z",
  "format": "structured",
  "count": 1,
  "truncated": false,
  "messages": [
    {
      "id": "-1001203560567:123456",
      "ts": "2026-07-22T18:27:00Z",
      "text": "ЕС одобрил слияние Warner Bros. и Paramount",
      "hashtags": ["#PSKY", "#WBD"]
    }
  ]
}

Structured IDs combine the Telegram channel and message IDs, so they remain stable across overlapping requests. Message bodies have country flags, promotional/legal footers, repeated whitespace, and inline hashtags removed; warning markers are retained and hashtags are returned in their own array. Structured timestamps and sync ranges use ISO-8601 UTC with Z notation. All MCP views use UTC, including publication times, classification availability, context cutoffs and query boundaries. Explicit offsets are converted once: 2026-10-17T01:25:50+03:00 becomes 2026-10-16T22:25:50Z. Already-UTC cache values are not shifted again. A Telegram client's display timezone does not change the underlying message time. Offset-free query dates are interpreted as UTC. This policy is announced in MCP instructions and the asset_twits/search_messages descriptions; existing history needs no reload.

Every bounded window is returned in full: there is no result cap or silent truncation, and truncated is therefore false. The response also reports how many Telegram messages were fetched during that call.

Notes

  • Telegram history is downloaded newest-first and written to SQLite in batches of 500 messages.

  • Requests earlier than history_start are clamped to that configured boundary.

  • Requests later than now fetch only through the current UTC time.

  • SQLite uses WAL mode and a 30-second busy timeout.

  • Concurrent calls in one MCP process share a synchronization lock, preventing duplicate downloads of the same missing interval.

Event grouping and importance pilot

asset_twits now accepts view="events" and min_materiality="all"|"medium"|"high". The default remains view="raw"; priority filtering requires the events view. Use format="structured" to inspect event facts, new_fact_indices for each update, first-seen and last-update times, source IDs and Telegram links. event_summary reports the raw-message count, group count, repeat-only message count and the low/medium/high distribution before priority filtering. count counts events in the events view, and messages in the raw view. Both service date boundaries remain inclusive.

Example MCP arguments for the completed UTC week:

{"instrument":"NQ1!","channel":"marketfeed","start":"2026-10-12T00:00:00Z","end":"2026-10-18T23:59:59.999999Z","format":"structured","view":"events","min_materiality":"medium"}

Groups are computed locally from the selected asset/channel/date window. No raw messages are deleted or rewritten, and no model API is called. Existing archive coverage and history fetching behavior are unchanged. Fixed windows group Fed speaker remarks (two hours), economic releases (one hour), and selected company event families (three hours). Other cases need conservative text overlap, rather than sharing an asset topic alone. These are event bundles, not proof that every post describes exactly the same fact. Unrecognized paraphrases remain separate facts. Event IDs and novelty are query-scoped; overlapping requests can produce different group boundaries. This is not a persistent cross-request alert ledger.

Low priority covers explicit recaps/promotions, incidental praise, and standalone price/order-flow reports. High priority uses financial mechanisms such as credit, earnings, economic values and monetary policy. Unknown cases remain medium. Rules include Nasdaq and Russian-market event families; high is potential importance, not verified price impact, source authenticity, or a directional trading signal. Priority filtering applies to whole events; all facts in retained events remain visible, including lower-priority context and later changes.

Reproduce the pilot without contacting Telegram or writing to the database:

.venv/Scripts/python.exe -m twits_mcp.event_pilot --channel marketfeed --instrument 'NQ1!' --start 2026-10-12T00:00:00Z --end 2026-10-19T00:00:00Z

The pilot end is exclusive, unlike the MCP tool. It requires complete cached coverage, re-evaluates current topic rules in memory, and writes the full event audit to research/major/newsflow_review/pilot_events.json. Daily event counts use the first-seen date. Run .venv/Scripts/python.exe -m pytest -q for regression checks, including real archive examples of CPI, PPI and CoreWeave updates.

The running MCP must be restarted by its owner to expose these new code/schema changes. Agents must not restart it themselves; see AGENTS.md.

MX and SI event rules (events-v2, topic rules v4)

SI1! resolves to USDRUB. Both instruments use bounded families for CBR rate decisions and forecasts, currency controls, FX intervention, fiscal/macroeconomic releases, Russian company developments, sanctions and frozen assets, negotiations, energy trade and OPEC output. Windows are one to three hours from the first post. Negotiation tracks distinguish territory, security guarantees, energy ceasefires, prisoners and named venues; general remarks use a named speaker where available. Sanctions use jurisdiction hints, package numbers and company/product targets; energy trade distinguishes explicit major counterparties. Mixed digests stay separate. These bundles can contain opposing views or several related decisions.

Grouping never treats a rejection as agreement, a forecast as a decision, or a changed number as a repeat. Original claim text, source links and first-seen times remain available; unrecognized paraphrases are retained conservatively. Specific regional policy developments receive high-priority reasons, while recaps and promotions keep their lower priority. Priority does not establish price impact.

Currency classification now recognizes Nabiullina/Zabotkin with nearby monetary or currency context, Central Bank of Russia, and domestic central-bank forecasts attributed to Sberbank/VTB. A Sberbank rate outlook can match both Russian equity news and direct SI policy relevance. Foreign central-bank forecasts and unrelated bank/crypto headlines do not trigger this implicit domestic-policy rule. Data-only topic rules reload on requests; code changes require an owner-managed MCP restart. Raw archive rows remain unchanged.

After local topic reclassification, reproduce weekly counts without fetching:

.venv/Scripts/python.exe -m twits_mcp.weekly_report --channel marketfeed --instruments 'MX1!' 'SI1!' --output research/major/newsflow_review/mx_si_weekly_v2.json --baseline research/major/newsflow_review/mx_si_weekly_v1.json

The optional baseline is the earlier report. Output includes weekly direct/macro counts, all/priority group counts, and separate files containing every matched message and event. Each matched source must occur exactly once per instrument and week. Edge weeks are partial, and groups restart at Monday boundaries.

Brent, Gold and BTC event rules (events-v3)

Use BRN1! for Brent, GC1! for Gold and BTCUSD for BTC. Gold is referred to as GD in the analysis request; no ambiguous GD trading-symbol alias is added. Asset-specific families apply only to these instruments, in addition to the existing Fed, economic-release and Russian-market families.

  • Brent: separate API/EIA petroleum releases, with crude, gasoline, distillate and Cushing facts retained inside each release; separate IEA/US strategic-reserve announcements; OPEC output and monthly outlooks; rig counts; Iran diplomacy, sanctions, Hormuz access and attributed or geographically identified incidents. Unidentified vessel incidents require wording evidence before grouping.

  • Gold: official central-bank purchases and separately attributed research estimates, country contributions, ETF flows, analyst targets and spot/futures prices. Reporting months, issuers and horizons distinguish separate releases. Shared rates, dollar, Treasury and geopolitical events remain macro candidates.

  • BTC: ETF flows versus applications/approvals, distinct tokens and ETF products, corporate treasury purchases, reserves, regulation, named-platform incidents, liquidations and prices. Analyst forecasts have their own families. Explicit reporting dates and monthly/quarterly/daily flow periods remain separate.

Fixed windows span one to three hours. Opposing claims and changing values remain updates. Deduplication protects publisher, component, asset, issuer, number, currency, scale (million/billion), quantity units, actual/forecast/previous roles, inflow/outflow, long/short, open/closed and regulatory stages. Conservative matching can retain paraphrases as separate facts. Event counts measure bundles, not the number of independent prints or verified market-moving developments.

The default raw view and asset-topic relevance mappings are unchanged. No raw messages are deleted, no model API is used and no collector or MCP is started. These code changes require an owner-managed MCP restart when ready.

.venv/Scripts/python.exe -m twits_mcp.weekly_report --channel marketfeed --instruments 'BRN1!' 'GC1!' 'BTCUSD' --output research/major/newsflow_review/oil_gold_btc_weekly_v3.json --baseline research/major/newsflow_review/oil_gold_btc_weekly_v2.json

This reads the full classified cache, checks source partitioning, and writes weekly counts plus original-message/event audits. Counts include direct and macro relevance; Gold and BTC have substantial macro coverage. Full audit files can be large. Topic rules are unchanged, so this upgrade requires no topic-cache rewrite.

Cached NQ major updates through MCP

Use asset_twits with instrument="NQ1!", channel="marketfeed", view="major" and major_source="batch20" (the default):

{"instrument":"NQ1!","channel":"marketfeed","view":"major","start":"2026-10-12T00:00:00Z","end":"2026-10-18T23:59:59.999999Z","format":"structured","major_limit":100}

Both boundaries are inclusive UTC publication times; explicit offsets are converted to UTC. Any cached period is supported, without the seven-day pilot restriction. The default dataset is research/major/nq_deepseek20_aug03_v5/, optionally overridden by NQ_MAJOR_BATCH_DATASET. The reader checks finalized export hashes, recipe identity, counts and row provenance before returning data. It never imports a live classification workflow, syncs Telegram, calls an LLM, rewrites judgments or recomputes event links. Missing/corrupt exports fail closed. NQ rejects major_source="single"; Oil's existing reader and single judge stay unchanged.

The full available period is August 3 through October 20, 2026, 11:44:14.977930 UTC: 263 major, 7,723 minor and 365 pending. October 12–18 has 13 major, 778 minor and 41 pending. Omitting end uses the classified cutoff; omitting start uses days (five by default). Requests outside coverage return explicit major_summary.coverage_gaps, without fetching missing history.

messages contains only the paginated major results. count describes that page; total_count and major_summary cover the entire requested period. Follow next_cursor as major_cursor with unchanged dates, format, relevance and limit. Cursors are bound to the NQ snapshot and query. min_relevance=direct is supported; the default macro includes direct. Weak relevance was not judged.

review_pending contains all pending rows for the requested period, separate from the major page, including validation failures and conservative review holds. They retain major=null, pending=true, classification_status="pending", pending/review reasons and original model provenance. Summary fields distinguish coverage_complete (the requested dates exist) from complete (also no pending judgments). truncated can indicate pending, gaps or more pages; use next_cursor for pagination. Empty covered windows are distinct from unclassified windows.

Publication times, recorded classification availability and context cutoffs are returned in UTC with Z. NQ preserves actual retrospective processing times where recorded; these are not historical real-time availability. Batch cutoffs include later visible headlines. Materiality remains separate from direction (not_assessed) and actionability (null). IDs, prompt/model hashes, provisional event IDs and novelty metadata are preserved in both major and pending records. Retrieval makes zero paid API calls and leaves Oil unchanged.

The running MCP must be restarted by its owner to load this code and its updated tool descriptions. No service is started or restarted by publication/verification.

Collected oil major updates through MCP

view="major" defaults to major_source="batch20": it reads the published DeepSeek-20 classifications without Telegram requests or paid LLM calls. The full collected period is supported; the seven-day restriction applies only to the explicit older major_source="single" judge.

{"instrument":"BRN1!","channel":"marketfeed","view":"major","start":"2026-08-03T00:00:00Z","format":"structured","major_limit":100}

Omitting end selects the latest classified cutoff, currently October 20, 2026 at 11:44:14.977930 UTC. Omitting start still uses the last days (default five), rather than automatically selecting all history. The current full-period snapshot contains 923 major, 7,185 minor and 15 pending updates. count is the page size; total_count and major_summary describe the entire requested window. Pass next_cursor back as major_cursor, keeping the same dates, format, relevance and limit, until next_cursor is null. Default page size is 100, maximum 500. Pending records are in review_pending, separate from the major-message page.

Check major_summary.coverage_complete, coverage_gaps and classified_through. An explicit request extending past the published cutoff returns available results with uncovered intervals, without silently classifying new messages. complete also requires no pending decisions. truncated can indicate pagination, coverage gaps or pending decisions; use next_cursor for pagination. Only direct+macro relevance was collected; direct filtering is supported, while weak requests require a separate classification backfill.

Structured messages preserve publication ts, evaluation_available_at, reasons, evidence and credibility. Window filtering and ordering use publication timestamps. classification_context_cutoff exposes the same latest visible input timestamp as legacy evaluation_available_at; neither is the actual classification completion time. classification_available_at=null and classification_availability_status=historical_completion_time_unknown make that limitation explicit. Cutoff gating is necessary but does not establish historical real-time availability (collection/inference delays are unknown). channel is normalized to the source marketfeed; the judge's supply/demand/ geopolitical category is exposed as impact_channel. Relevance is the frozen snapshot classification, without applying newer topic rules retroactively.

Cached metadata enrichment (oil-major-metadata-v1) makes no network or LLM calls and does not rewrite the frozen exports or judgments:

  • classification_status is major, minor, or pending. Pending retains major=null, pending=true, and pending_reason in review_pending.

  • major measures materiality only; direction=not_assessed, actionable=null.

  • Headline IDs, publication_time, model/prompt version/hash, original novelty, batch/request IDs and prior source IDs are preserved. Classification provenance aliases are null when not recorded (e.g. a local exact-repeat decision).

  • novelty_status maps cached meaningful_update to update, preserving new, repeat, none, and unknown for unresolved/absent labels. Pending status is independent of novelty. The major view still excludes minor/repeat decisions; enrichment does not reclassify or add them to the major list.

  • Provisional event_id values are derived from root headline IDs across the full snapshot before period filtering/pagination. Only earlier cached repeat links, exact text among supplied priors, or very close text for cached updates/repeats in the same topic family can link within 72h of the root. Different inventory issuers remain separate. Topic family alone never links events. Ambiguous/no matches stay separate with event_link_status=unresolved; linked rows report the parent ID and method. This intentionally under-groups events; singleton IDs do not prove independent evidence. IDs remain stable when later rows are appended; correcting/adding earlier history may change links. event_link_version records the rules used.

Structured output is the canonical metadata representation. Text output carries event/novelty/provenance and the distinction between cutoff and unknown actual availability; pending records remain structured in either output format.

The default dataset directory is research/major/oil_deepseek20_aug03; optionally set OIL_MAJOR_BATCH_DATASET to another absolute or project-relative published directory. The adapter reads summary.json and decisions.jsonl, checks counts and publication status, and refreshes its in-memory cache when those files change. An updated dataset invalidates old pagination cursors. Missing or inconsistent exports produce an error, never a paid fallback. Restart MCP yourself after installing this code/schema change; agents must not restart the service.

Oil per-message LLM pilot (explicit source)

asset_twits(..., channel="marketfeed", instrument="BRN1!", view="major", major_source="single") uses the requested OpenRouter model deepseek/deepseek-v4.1-flash-1017 on NEW information in each update. This is separate from rule-based event importance. It is opt-in, oil-only, limited to seven requested days, and can make paid API calls on cache misses. Leave min_materiality="all". Raw/events views make no LLM requests and keep their existing behavior.

Three tests must pass: plausible material consequence, novelty versus supplied prior information, and concrete specificity. Credibility/claim status are independent fields: a consequential unconfirmed report can be major, while an official routine statement can be minor. The app derives major from the three tests instead of trusting an inconsistent headline-level importance label. An explicit update type also excludes standalone forecasts, discussions, commentary and recaps. Quantified revisions to aggregate forecasts remain eligible; a standalone official estimate is not treated as an export decision. It returns new major updates, not complete event histories. Structured results contain a short reason, new information, current-update evidence, attribution, claim status, as-of timestamp, context source IDs, model and prompt fingerprint. The consequence must belong to the NEW delta: tactical details of an already reported tanker attack, another publisher quoting the same claim, export possibilities and routine airport-suspension extensions alone are minor. Actual new fires/losses, additional attacks, meaningful independent confirmations and concrete policy changes remain eligible. Merely considering military action is not an operational decision or an actionable ultimatum.

Pilot volume policy is explicit and not fitted to subsequent prices: physical interruptions/changes >=100,000 bpd or >=1 million barrels, or a consequential named major route/terminal even without quantity. Inventory-only cases require TOTAL crude surprise >=5 million barrels against explicit consensus, or total crude change >=10 million barrels when consensus is absent. Previous is not consensus. Cushing/gasoline/distillate prints alone are minor unless the update separately reports a consequential physical interruption. These are reviewable pilot conventions, not claims of measured market impact. Fully recognized standalone EIA/API prints use exact decimal arithmetic to enforce that policy. The model receives the computed policy, and a negative eligibility result cannot be overridden by qualitative intuition. Unknown formats and mixed posts remain with the model; the parser never assumes an unrecognized paragraph is only an inventory print. Original model assessments are preserved when this guard overrides them. Eligibility alone never makes an already-reported release major.

Only earlier messages are supplied as context, ordered by publication time and numeric source ID for ties. Context covers up to 72 hours with up to 12 related posts/10,000 characters; truncation is disclosed. Related families and shared named anchors retrieve previous claims, including rewordings across event-family boundaries. Observed benchmark-price clauses are removed from model input; price direction counterexamples are evaluated separately. No future event summaries, subsequent messages, prices, browsing or model tools are supplied. Historical Telegram edit versions are unavailable, so replay uses archived text snapshots and publication timestamps rather than guaranteed immutable as-published bodies.

Set OPENROUTER_API_KEY_FILE to a private key-file path, or use OPENROUTER_API_KEY when no file is configured. The configured file takes precedence, is read only for API calls, and its contents are never copied into the project or stored in judge inputs/results. OIL_MAJOR_MODEL must remain the specified Flash model during this cost-bounded pilot. Defaults cap each request at OIL_MAJOR_MAX_CALLS=1000 and OIL_MAJOR_MAX_COST_USD=1.0; set either to zero for cache-only operation. Four concurrent calls use temperature zero and a fixed seed, with schema and verbatim-evidence validation. See OpenRouter's structured-output documentation. OIL_MAJOR_CONCURRENCY can lower concurrency (1..8) if the provider is unstable.

data/oil_major.sqlite3 caches successful major AND minor judgments by current input, exact prior context, model, prompt/schema and generation parameters. Changing context or prompt invalidates reuse. Exact protected-text repeats are removed locally. A positive judgment with a near-identical earlier claim gets a second focused read against that claim, using the same model and a separately cached payload. Changed numbers, denials and reversals are never dropped on similarity alone. Disagreement or an unavailable verification goes to review; the initial assessment and focused result remain in the audit. Summaries report novelty checks and their cache hits separately from initial judgments. Spot-review flags can also withhold a particular cached judgment for review, without changing the original LLM result. Flags are tied to that exact cache key, with reviewer and reason recorded in oil_major_review_flags. The pilot flags four borderline inclusions found during the Codex spot-review; these appear in review_pending, not in the accepted major list. This is an audit decision, not a claim that another model's review establishes verified truth. Ambiguous judgments, invalid responses, network/auth failures and exhausted budgets remain in review_pending with major=null; they are never silently classified as minor. Check major_summary.complete; an incomplete major response also has truncated=true. The summary reports cache hits, new metered calls/cost, and unmetered failure reservations. Model confidence is not treated as verified source credibility.

Finite local validation/replay commands (never start MCP or a collector):

.venv/Scripts/python.exe -m twits_mcp.oil_major_eval --live --split all --repeats 2
.venv/Scripts/python.exe -m twits_mcp.oil_major_eval --live --fixture tests/fixtures/oil_major_development_v4.json --split all --repeats 2
.venv/Scripts/python.exe -m twits_mcp.oil_major_eval --live --fixture tests/fixtures/oil_major_holdout_v4.json --split holdout --repeats 2
.venv/Scripts/python.exe -m twits_mcp.oil_major_pilot --live --start 2026-10-12T00:00:00Z --end 2026-10-19T00:00:00Z

The pilot end is exclusive; the MCP end is inclusive. The news database is read only during these commands; only judge/audit files are written. Evaluation labels and descriptive case names are never sent to the model, and independent passes bypass the judgment cache. The 74-case development set includes initial cases, inventory regressions and errors found by manually reviewing the weekly replay. The additional 12 cases were held out from prompt tuning. Fixture filenames identify when a set was created; reports record the actual evaluated prompt. This is a small engineering validation, not an estimate of all-history classification accuracy. For excluded-message inspection, the pilot audit includes every major, minor and pending decision. Restart MCP yourself to expose the new view after reviewing the pilot; agents must not restart the running service.

The final oil-major-v7 judge matched the manual label on 174 successful calls covering 86 distinct cases, each with at least two successful passes. Two failed responses were retried; failures are retained in the evaluation audit. The 74 development cases informed prompt changes; 12 cases were held out from tuning. This does not establish precision on the full feed. Manual weekly spot-checks still identify borderline geopolitical warnings, retail discounts and recaps whose earlier details are missing from bounded context. The local research/major/newsflow_review/oil_major_manual_review_v7.json records these disagreements; importance labels remain pilot judgments rather than verified market effects.

Oil multi-message batch benchmark (experimental)

python -m twits_mcp.oil_batch_benchmark --live runs the frozen October 12–18, 2026 oil sample with 10 and 20 primary targets per call. It is a finite experiment, not an MCP view change. The news database is read-only; batch calls, results and isolated novelty checks use separate experiment databases. Existing production judgments and service processes are not changed. The 40 exact repeats are skipped in both arms, leaving 604 primary targets, or 61 and 31 primary batch requests. Every target keeps the original three-test rubric, evidence validation, inventory policy and prior-ID allowlist. Shared context text is sent once per batch.

The first benchmark recorded USD 0.090481 for batches of 10 and USD 0.085774 for batches of 20, including retries and isolated novelty checks, versus USD 0.161857 for the original single-message pilot. Final major/minor/pending counts were 91/548/5 and 82/557/5, versus 101/527/16. Respectively 34 and 36 baseline-major updates became minor; 24 and 17 baseline-minor updates became major. Total label disagreements were 69 and 64. These are comparisons to a reference classifier, not measured accuracy: some differences repair baseline overclassification of repeats, while others lose substantive updates. Routing and cache-hit rates also differed from the historical baseline.

Shared prompts physically expose later headlines even when the prompt instructs the model to obey per-target prior-ID allowlists. They do not provide the strict historical isolation of separate requests. --live --audit-lookahead runs selected singleton controls, removing extra past context as well as future context. --live --audit-future-only instead retains every earlier pool entry while removing later messages/targets. One of six selected future-only checks changed label; this small sample and changed request length/provider path do not establish causality or feed-wide error rates. These batch prompts remain experimental.

Audit files are under research/major/newsflow_review/: oil_batch_comparison.json, oil_batch_summary.json, oil_batch_lookahead_audit.json, and oil_batch_future_only_audit.json. The summary includes representative missed, retained and correctly deduplicated updates. Do not substitute experimental batch labels into the production cache without a separate reviewed change.

Qwen oil comparison (experimental)

python -m twits_mcp.oil_qwen_benchmark previews the frozen October 12–18, 2026 comparison. Add --live to authorize finite paid requests for qwen/qwen3.7-flash, with original single-message inputs and batches of 10/20. --live --limit 10 runs a smoke test; --sizes 1, --sizes 10, or --sizes 20 can run/resume individual arms. Completed requests are reused from private experiment databases under research/major/newsflow_review/qwen3_7_flash/. No MCP or collector process is managed, and production stays pinned to DeepSeek.

The comparison preserves the v7 semantic rubric, original per-message prior context, temperature 0, seed 42, disabled reasoning, evidence validation, inventory rules and frozen manual-review holds. Qwen uses JSON-object mode with the output schema appended to the system prompt, rather than DeepSeek's enforced JSON-schema response format. Invalid rows are retried once and then remain pending. Raw attempts and reported usage are retained, including invalid responses. Costs include the smoke test and retries; provider routing and cache hits differ from the historical DeepSeek run. Shared batch prompts retain the future-visibility limitation described above. comparison.json contains every decision, costs, disagreements against DeepSeek, and Qwen batch versus single comparisons. Reference agreement is not a measure of classification accuracy.

The initial Qwen comparison cost USD 0.091335 (single), 0.048631 (10) and 0.046241 (20), including retries and smoke checks. Final major/minor/pending counts were 111/485/48, 52/552/40 and 39/521/84. Against the 101 frozen DeepSeek single-message majors, Qwen retained 70, 37 and 26; respectively 26/47/57 became minor and 5/17/18 remained pending. Qwen single also promoted 40 baseline-minor updates. Of Qwen's 111 single-message majors, its batches retained only 42 (10) and 30 (20). This is a substantial batch-dependent change in judgments.

Qwen batch responses sometimes put actual rows inside JSON-schema metadata instead of the requested results envelope, or returned unexpected IDs. Evidence quotes also failed exact validation. These are output-format failures, not minor news judgments. Separately, valid judgments excluded newly published China trade data as historical and demanded quantified oil losses for some shipping attacks, despite the rubric allowing specific consequential disruption reports. Both issues require targeted validation before considering a production switch. The concise local qwen3_7_flash/summary.json includes costs, transition matrices, validation errors and manually reviewed examples. These Qwen caches are not consumed by MCP.

DeepSeek-20 August research backfill

python -m twits_mcp.oil_batch_backfill --live runs/resumes the finite oil backfill from August 3, 2026 to the frozen cutoff in research/major/oil_deepseek20_aug03/sync_snapshot.json. That snapshot records the latest archive refresh through the existing MCP service. It uses the same DeepSeek v7 rubric and 20-message batch adapter, with a shared USD 3 budget covering primary calls, retries and focused novelty checks. Recorded spending and conservative reservations for unknown failed-call charges survive resume. Use a new output directory for a different cutoff.

Each week has an immutable source snapshot and a checkpoint containing all major, minor and pending decisions. Identical October pilot batch requests are read from the earlier benchmark cache without changing or charging that cache. summary.json reports weekly counts and actual run spending; decisions.jsonl is the full downstream export. The backfill does not manage MCP processes or modify the per-message judgment cache. The collected-data adapter described above serves the published export through view="major" after an MCP restart. major.jsonl and pending.jsonl provide filtered exports. The offline --finalize-only command verifies source hashes, rebuilds exports and reconciles weekly API costs against the private attempt ledger without making API calls.

For downstream analysis, classification_context_cutoff (legacy evaluation_available_at) is the latest input headline timestamp in the original batch, not actual classification availability. publication_time is retained for reference. Earlier targets physically shared a prompt with later headlines; acting on their publication timestamps would expose the evaluation to later information. Actual classification_available_at is unknown in this historical dataset. The recorded cutoff still excludes collection/inference latency and historical edit versions. Importance labels alone do not predict direction or demonstrate trading value. Pending decisions are retained separately from minor decisions.

Per-instrument major-news pilot

twits_mcp.major_batch is a finite research workflow, separate from the running MCP and the preserved oil archive. major_profiles.py contains the versioned shared materiality/novelty/specificity rubric, batch instructions and output schema, plus independently versioned asset policies. The generic schema adds economic releases, policy decisions/proposals, earnings/guidance, credit events, flows and security incidents; the original oil schema and prompt remain intact. Only the NQ profile is currently enabled for a live pilot. MX, USD/RUB (SI alias), gold and BTC profiles are drafts requiring their own validation. Oil is rejected by this runner to prevent accidental reclassification.

NQ policy nq-major-v5 tightens financing materiality: financing size, proposed yield, investor name or speculative-grade rating alone is insufficient. Require an explicit consequential funding/spending change, credit-access constraint, funding gap or changed borrowing terms against a supplied baseline. Specific proposals with unclear consequences remain pending. Routine fundraising is minor; a consequential credible report can qualify before a transaction closes. New record CDS stress is distinct from generic concern or a repeated level.

The October 12–18 cached financing review is saved separately in research/major/nq_major_pilot_v5_financing_review_oct12_18/. It screened 832 messages, reviewed 61 broad financing/credit candidates and held three former major decisions pending: 1059481, 1059791 and 1059808. Totals are 33 major, 767 minor and 32 pending. These are qualitative review corrections, not new DeepSeek v5 results: each corrected row preserves its full previous judgment, original v4 prompt/model provenance and context cutoff, with separate review policy/version/availability metadata. No model calls or Telegram requests were made. Existing v4 source exports/ledger and Oil are preserved. This is the older offline pilot review; the subsequently completed v5 backfill is served through MCP as described above.

Reproduce the source-bound review into a new output directory:

python -m twits_mcp.major_cached_review --source research/major/nq_major_pilot_v4_reviewed_oct12_18/decisions.jsonl --annotations research/major/nq_financing_review_20261020.json --output research/major/nq_financing_review_copy

This finite command has no Telegram or model access and rejects non-NQ sources, source-hash mismatches and existing output directories.

The NQ August 3 backfill uses the same runner with explicit --backfill (a maximum 366-day window), primary batches of 20 and the v5 asset policy. Its frozen cache/coverage snapshot and isolated request ledger are in research/major/nq_deepseek20_aug03_v5/. Missing time after the last cached coverage endpoint is reported in coverage_snapshot.json; it never triggers a Telegram refresh. The October 20 run's endpoint is 11:44:14.977930 UTC.

python -m twits_mcp.major_batch --instrument NQ1! --start 2026-08-03T00:00:00Z --end 2026-10-20T11:44:14.977931Z --backfill --output research/major/nq_deepseek20_aug03_v5 --live --repair-errors --key-file D:\PY\202607_algo_mcp\twits_mcp\_secrets\openrouter_api.txt --max-cost 5 --max-calls 1600 --concurrency 4

The end is exclusive. Rerunning the identical command resumes from the frozen source and saved model responses; the cumulative budget includes previous attempts. Only failed rows receive bounded retry/repair requests, which may be smaller than 20. --cache-only instead of --live revalidates cached responses without new model calls. The finalized export is read by NQ's MCP archive, separate from the published Oil archive; it does not recalculate Oil or manage any service.

Completed v5 backfill: 8,351 cached candidates, including 167 local exact repeats; 8,184 model targets in 409 primary batches of 20 and one of four. There were 320 failed-row retries and 149 bounded repairs, for 879 paid requests and USD 2.100192062 reported cost (no unknown-charge reserve). After cached review, totals are 263 major, 7,723 minor, 365 pending. Pending consists of 236 unresolved model judgments, 114 validation failures and 15 explicit review holds. Holds cover financing materiality, repeated digest content, forecast-versus-actual CPI novelty and unresolved pilot cases; they are conservative holds, not manual promotions. The three disputed Anthropic financing messages are pending in the v5 model output itself.

backfill_report.json contains weekly counts, source coverage and costs; major.jsonl and pending.jsonl contain the effective reviewed exports. paid_* files preserve the original paid-run results, and review_flags.json records source/prompt-bound annotations. Re-exporting the annotations made zero additional API calls. All 8,351 candidate IDs were retained, and every nonduplicate candidate received a model attempt. Data after October 20, 11:44:14.977930 UTC was unavailable in the frozen cache and remains outside this run. Finalized NQ results are exposed through the read-only MCP archive; the original run metadata describes publication status at classification time.

Prepare the NQ October 12–18 pilot using cached direct+macro relevance only:

.\.venv\Scripts\python.exe -m twits_mcp.major_batch --instrument 'NQ1!' --output research/major/nq_major_pilot_v4_reviewed_oct12_18 --source-snapshot research/major/nq_major_pilot_v3_oct12_18/source_snapshot.json

Add --live --key-file <private-key-file> --max-cost 1 --max-calls 150 to allow paid calls. Without --live it only freezes the recipe/source and reports counts. --start/--end select a positive period up to seven days (end exclusive). Targets are batched per instrument, 20 at a time; exact protected-text repeats are local. At most 24 earlier context messages within 72h/20k characters are provided per target. Multi-topic compilations retrieve each release family, with ranked same-day/company matches rather than only the first matching topic. The read-only news loader requires complete, current topic cache coverage and never fetches Telegram or refreshes classification silently.

Each output directory freezes the recipe, source messages and relevance fingerprint. Cache keys include instrument, model, full prompt/schema, context, decoding settings and request phase. Validated response rows are retained; only failed rows receive one retry, then remain explicit pending. The workflow can also use --repair-errors for one additional bounded failed-row pass with the exact validation failure supplied as feedback, under the same rubric and shared call/cost cap. This is opt-in; it does not rejudge valid rows. The attempt ledger accounts for all calls across resumes, with conservative reservations for unknown charges. Missing metered cost uses the reservation rather than reporting zero. Recipes cannot be changed in place to reuse incompatible results. --cache-only revalidates and exports saved responses with a hard zero-call budget. Valid rows survive a malformed sibling ID; foreign/short IDs are never guessed or repaired. Missing/invalid rows remain pending. Raw attempts remain unchanged in the ledger for audit. --source-snapshot reuses a previous pilot's immutable instrument/period corpus; source/parent-recipe hashes and the exact requested period are verified. Keep this option unchanged on resume/replay. Recipes record context limits and source identity; export_manifest.json separately records validator/code/output hashes. The v3 pilot uses explicit short response keys (T01–T20) constrained by schema and mapped back to the original headline IDs using the request's exact mapping. This avoids dropped Telegram prefixes; no partial-ID inference is used. The prompt separates source credibility from specificity, individual official guidance from policy decisions, actual releases from nowcasts, and operating guidance from analyst price/rate targets. Earlier v1/v2 pilot outputs remain frozen comparisons; use new directories for new recipes. The v4 prompt uses explicit material/not_material/unclear and specific/generic/incomplete output categories, normalized to the existing bool/null metadata contract. Attribution uncertainty never implies incomplete text. Genuine fragments and unresolved scale remain pending. Updates/repeats must cite allowed earlier Pxxx lookup keys with a comparison; normalized full source IDs are returned in related_prior_ids. Explicit complete IDs and request aliases can be resolved without guessing suffixes. Self-citations are removed and recorded; they never constitute prior evidence. Future/foreign/disallowed references are rejected. New headlines may carry background references without being linked as updates. A clearly minor headline with unsupported novelty stays minor but explicitly reports unknown novelty. Long comparison previews are shortened while preserving comparison_full. Literal quantity checks prevent current summaries from borrowing later numbers. Word-for-word evidence with case/punctuation differences can be restored to an exact current-text span; signs, numbers and comparison operators must match. Original evidence and restoration flags are retained. Paraphrases stay invalid. After retry, a valid saved row with identical prompt/current/allowed earlier text can be recovered from the ledger even if the failed-row batch subset changed; conflicting saved judgments are not silently selected. No extra call is needed. The NQ profile also has a versioned negative-only local guard for unambiguous single-line equity-price moves with no stated fundamental catalyst. It never promotes uncertain news. Overrides preserve the original model judgment and report decision_source=local_policy; summaries include counts before the local policy. Pending metadata names unresolved fields explicitly, keeping the original judge reason separate. Prompt changes require a new recipe; local export policy versions are recorded separately and can be replayed from saved raw responses. Optional review_flags.json binds explicit review holds to exact prompt/source hashes. Holds preserve original model judgments and availability timestamps, add a review timestamp/reason, and set major=null rather than silently promoting/dismissing disputed news. Summary counts before review remain visible.

decisions.jsonl, major.jsonl, pending.jsonl and summary.json are offline pilot exports. novelty_pending.jsonl separately exposes unknown novelty, including clearly minor items with unresolved comparison; these counts overlap materiality states and must not be added to the message total. They are not automatically published through MCP. They preserve materiality separately from direction, exact current-text evidence, attribution, novelty and provisional event IDs. Compatible earlier model references and exact repeats can share an event ID; conflicting roots remain unresolved. Distinct material release components remain separate messages within that event. classification_context_cutoff is the latest batch input; classification_available_at is the actual recorded processing completion time today, not a reconstructed historical timestamp. Shared batches do not provide strict historical isolation. Event IDs intentionally under-group semantic repeats. This pilot makes no claim of predictive accuracy.

Cached NQ worldview view

asset_twits(view="worldview", instrument="NQ1!", channel="marketfeed") reads a separate, published, read-only snapshot of reviewed worldview judgments. It does not replace view="major", rerun keyword classification, reload Telegram or call an LLM. Only the October 12–18, 2026 pilot is currently published; requests outside coverage explicitly report gaps.

{
  "instrument": "NQ1!",
  "channel": "marketfeed",
  "view": "worldview",
  "classification": "high",
  "start": "2026-10-12T00:00:00Z",
  "end": "2026-10-18T23:59:59.999999Z",
  "format": "structured",
  "worldview_limit": 100
}

classification is a cumulative minimum:

Value

Completed messages returned

Full pilot total

high (default)

high

75

medium

high + medium

433

low

high + medium + low

1,059

The three pending judgments are returned separately in review_pending, with classification=null; they are never treated as low. upstream_pending_summary reports 137 unresolved selection decisions: 134 not judged and three also judged as earlier repeat representatives. These stage counts overlap and must not be added to the judged-message count. Unresolved dedup flags remain attached to their retained messages and appear in the period summary.

Use next_cursor as worldview_cursor, keeping dates, classification, format and worldview_limit unchanged. The maximum page size is 500. total_count and worldview_summary.classification_counts cover the entire requested period, not just the page. Pending judged rows remain separate on each page. Both time boundaries are inclusive. Offset-free dates are UTC; explicit offsets are converted once. Omitted end uses the published coverage cutoff; omitted start uses days (default five), ending at that cutoff. Use explicit dates for the complete week. Empty covered periods, pending periods, unavailable datasets and uncovered dates are distinguished; none trigger fetching or judging.

Structured rows include classification/original strength, impact_kind (fundamental, market_reaction, context, uncertain), direction, hypothesis relation, evidence, novelty/prior IDs, provisional event IDs and UTC provenance. The opening worldview hypotheses and source cutoff are announced in the summary. actionable stays null: importance does not establish a trading signal. High rows also contain their reviewed event/report group annotation. This is retrospective full-pilot grouping: its title/interpretation and total count can include later posts. A separate grouping_context_cutoff_utc and headline_count_in_requested_period expose that distinction. Group annotation availability time is unknown; it is not the original classification time.

Leave legacy min_relevance, min_materiality and major-specific options at their defaults for this view. Cross-asset oil/company news remains available through the cached worldview decisions without a new Nasdaq keyword gate.

To publish or refresh an export after an offline run:

.\.venv\Scripts\python.exe -m twits_mcp.worldview_archive `
  --source research/headline_judging/nq/nq_reconciled_fp8_oct12_18_v2 `
  --output worldview_output/nq_worldview_oct12_18_v2

NQ_WORLDVIEW_DATASET optionally changes the published folder, relative to the project root or absolute. The manifest is written last and validates file hashes, identity, counts, coverage, provenance and high-group membership. Readers reject partial/mismatched publication; cursors expire when the snapshot changes. The running MCP must be restarted by its owner to load the new tool schema/code. No process is started or restarted by the publisher.

The finite NQ backfill reuses the reviewed worldview and exact prompt texts:

.\.venv\Scripts\python.exe -m twits_mcp.nq_worldview_backfill `
  --output research/headline_judging/nq/nq_worldview_aug03_oct20_v1

It freezes cached Market Feed messages from August 3, 2026 through the latest cached publication and checkpoints each week. DeepSeek FP8 uses batches of 20 and four independent processes; completed October pilot results are reused when raw inputs match. No Telegram requests, database writes, Oil recalculation or service management occur. Resume with the identical command. The key is read from the authorized local key file; it is never placed in output artifacts.

The October-12 worldview is deliberately applied as a retrospective fixed rubric to August/September, with its actual source cutoff and classification availability preserved. Published metadata announces worldview_application="retrospective_fixed" and strict_historical_isolation=false. This is not an as-of historical simulation. Weekly rolling evidence resets; deduplication retains the tested seven-day raw warmup and existing cross-day repeat rules. The last hour may have partial cache coverage. No new Pro reconciliation or prompt calibration is performed.

After completion, finalize/audit the frozen backfill and publish it separately:

.\.venv\Scripts\python.exe -m twits_mcp.nq_worldview_backfill `
  --output research/headline_judging/nq/nq_worldview_aug03_oct20_v1 --finalize-only
.\.venv\Scripts\python.exe -m twits_mcp.worldview_archive `
  --source research/headline_judging/nq/nq_worldview_aug03_oct20_v1 `
  --output worldview_output/nq_worldview

On its next owner-managed restart, MCP prefers this canonical publication when its manifest exists, unless NQ_WORLDVIEW_DATASET explicitly overrides it. Otherwise it retains the October pilot fallback. Existing pilot exports and the dataset held by the currently running service are preserved. Full classification_context_cutoff_utc includes the frozen worldview cutoff; headline_context_cutoff_utc separately records the original headline/batch cutoff, so retrospective context is never presented as August availability.

The backfill records a separate transport_policy.json: bounded exponential backoff on the same FP8 provider, two-second minimum spacing per process, and a $4 main-stage guard including unknown-charge reserves. This explicitly overrides the legacy experiment recipe's $2 transport guard without changing its inference body or prompts. Recovery preserves completed decisions and the original batch checkpoint, retrying only unresolved targets after a terminal transport failure. Unknown-charge reserves remain separate from reported inference cost; OpenRouter notes possible billing exceptions for some failed requests.

Next-run worldview harness: one main pass, one failed-only review

Use python -m twits_mcp.worldview_harness for future asset pilots. The console entry point twits-worldview is declared for the next normal package installation; the module command works without reinstalling. The older NQ replay commands above remain archived, reproducible recipes; they retain their historical refinement behavior and are not the new harness. No existing NQ/Oil classifications or MCP publications are migrated or replaced by this runner.

The new runner has two workflow phases:

  1. Main: selection, deduplication, then worldview judgment across cached weeks.

  2. Review: one attempt to repair only failed requests or invalid schema, evidence or reference outputs. Successful decisions are immutable, including valid uncertainty. There is no financing re-review, discretionary materiality review, review-of-review or automatic retry of a completed pending decision.

Recovered upstream headlines can enter downstream stages for the first time during review. A failure there stays pending: it does not open a third phase. Failed judge reviews receive their original earlier context and only the failed IDs, without later headlines or newly assembled evidence. Completed decisions suppressed by a recovered deduplication result remain in the audit file with suppressed_after_dedup_review=true, and are excluded from the final list.

One shared 20-process maximum covers all weeks, stages and providers—not 20 processes per week. Batches contain up to 20 headlines. The dispatcher fairly interleaves weeks, enforces per-provider limits, reduces concurrency/cools down on transient failures and tries an alternate approved provider. Judge waves remain chronological within each week; one week alone may therefore use fewer than 20 simultaneous judge requests. Rolling evidence resets at week boundaries.

Transport is separate from classification review: each main/review request has at most two HTTP attempts, with no hidden provider/model fallback. Malformed or invalid model outputs go to the single review phase instead of a transport retry loop. Requests, delivery-unknown interruptions, replies, charges/reserves, providers, advertised quantization, input/context hashes and phase lineage are saved. An interrupted unacknowledged request is not blindly resent. Completed checkpoints resume without additional inference; changed inputs/policy require a new output directory. Existing non-harness output directories are rejected.

The compact wire format uses numeric target/topic aliases and short enum codes:

  • Selection: ID, action and topic indices; short reason only for uncertainty.

  • Deduplication: ID, novelty and earlier reference; quotes only to prove a repeat.

  • Judgment: ID, impact level, topic, direction, hypothesis relation, event kind, freshness, credibility and prior references. Only high/pending gets a short reason; only high gets a short verbatim evidence span. No generated analysis or explanations for completed medium/low decisions. Codes expand locally.

Materiality, direction, credibility and freshness stay separate; high is not automatically actionable. There is no future-price confirmation gate. The worldview and per-asset selection/dedup/judge criteria are supplied frozen; this harness neither constructs nor recalibrates an Oil worldview.

Execution policy: llm_backend/config/openrouter_deepseek_fp8.json. The candidate routes are InferenceNet FP8 (8 slots), Relace (6) and Wafer MXFP4 (6), with price ceilings of $0.20/M input and $0.60/M output tokens and a finite $10 whole-run budget including unknown-charge reserves. Relace does not report its quantization, so no FP8 filter or unsupported seed parameter is imposed on it. These profiles are configurable and have not been inference-benchmarked for the future Oil pilot. Provider tags/quantization were read from the public model endpoints API; provider capabilities/prices can change before the later test.

Input is one JSON file supplied by the future asset pilot:

{
  "instrument": "<instrument>",
  "channel": "marketfeed",
  "worldview": {
    "state_as_of_utc": "<UTC cutoff>",
    "topics": [{"id": "<driver>", "hypothesis": "<frozen hypothesis>"}]
  },
  "criteria": {
    "selection": "<asset selection criteria>",
    "dedup": "<asset novelty criteria>",
    "judge": "<asset materiality criteria and impact patterns>"
  },
  "weeks": [{
    "id": "<safe week label>",
    "start_utc": "<UTC start>",
    "end_exclusive_utc": "<UTC end>",
    "messages": [{"id": "<source ID>", "publication_time": "<UTC time>", "text": "<cached text>"}],
    "history": []
  }]
}

Weeks must not overlap and each covers at most seven days. history contains cached earlier context, not fetched data. Supplied earlier_ids (at most three, strictly earlier, present in the same week's records) preserve an asset-specific retrieval strategy; otherwise a deterministic lexical candidate matcher is used. Exact-text suppression retains the earlier cross-day behavior. Raw source files are unchanged, and input timestamps are normalized to UTC in the frozen copy.

For later preparation, --plan only validates/freezes files, reads no API key, starts no workers and makes zero LLM calls:

.\.venv\Scripts\python.exe -m twits_mcp.worldview_harness `
  --input <prepared-asset-input.json> --output <new-analysis-directory> `
  --policy llm_backend/config/openrouter_deepseek_fp8.json --plan

Future inference requires the explicit --execute flag instead of --plan and an explicit --key-file. No execution command, Oil worldview construction or classification benchmark was run as part of this harness update. Outputs are recipe.json, immutable inputs, request/batch checkpoints, per-week routes and decisions, judgments.jsonl, high.jsonl, pending.jsonl and summary.json. There are no database/Telegram operations, service changes or automatic MCP publication; a later evaluated Oil profile can add its publication adapter.

Cached Oil worldview publication

Oil now uses the same asset_twits worldview interface as NQ. Its separate, read-only publication is worldview_output/oil_worldview; optionally override it with OIL_WORLDVIEW_DATASET. Requests read published files only, without Telegram access, inference, or applying the legacy keyword relevance filter.

{
  "instrument": "BRN1!",
  "channel": "marketfeed",
  "view": "worldview",
  "start": "2026-10-12T00:00:00Z",
  "end": "2026-10-18T23:59:59.999999Z",
  "classification": "high",
  "format": "structured"
}

classification defaults to high; medium includes high+medium, and low includes high+medium+low. Dates and provenance are UTC; the end is inclusive. Omitting end uses the published coverage cutoff. Pagination uses worldview_limit (default 100, maximum 500) and next_cursor supplied back as worldview_cursor; keep the other query arguments unchanged. total_count describes all matching completed messages, rather than just the page.

The published August 3–October 20, 2026 snapshot covers through 11:41:37.999999 UTC on October 20: 138 high, 889 medium, 1,201 low and 971 pending judgments. October 12–18 contains 21 high and 71 pending judgments. review_pending contains pending rows with classification=null; judgment_pending_summary distinguishes processing failures from semantic uncertainty. upstream_pending_summary separately reports unresolved topic selection (2,798 over the full snapshot). The 294 retained dedup review flags overlap judged messages and are not extra messages. Coverage gaps remain explicit.

These cached classifications remain provisional. worldview_summary.quality preserves the audit of direction inconsistencies and residual same-event duplicates; prior_ids are provisional references, not validated event groups. The frozen October 12 worldview was applied retrospectively to earlier news; publication/classification availability must not be interpreted as historical real-time availability. Publication preserves successful judgments and enriches failed-row provenance from cached task outcomes without judging again.

The finite, file-only export command is:

.\.venv\Scripts\python.exe -m twits_mcp.oil_worldview_publish `
  --source research/headline_judging/oil/oil_worldview_aug03_oct20_harness_v1 `
  --output worldview_output/oil_worldview

Source checksums are verified and the export manifest is written last. NQ worldview and existing major publications remain separate. A running MCP needs the user to restart it to load the new Oil routing and tool descriptions; the exporter does not start or restart services.

MX cached worldview pilot

mx_worldview_pilot adapts the accepted MX construction artifact without using the construction prompts for incoming-news judging. The profile is config/worldview_judging/mx.json. Preparation opens the cache read-only and uses both MarketTwits and Market Feed, with source-qualified headline IDs, UTC publication times and at most three Unicode-aware own-earlier candidates. The harness accepts an optional selection_worldview: it must preserve the full worldview's topic order, mechanisms and cutoff. Only selection receives this compact projection; deduplication and judging receive the full impact patterns, exclusions and uncertainties. Existing profiles without the optional projection retain their previous behavior.

The October 12–18, 2026 pilot is saved under research/headline_judging/mx/mx_worldview_oct12_18_harness_v1. report.md and pilot_report.json show counts and cost; manual_audit.json records source review concerns without changing model decisions. hourly.jsonl exposes empty high-impact hours separately from hours with unresolved cases. Selection, deduplication, judgments, pending rows, request provenance and frozen inputs remain available for inspection. The MX pilot is provisional and is not an MCP publication; no Oil/NQ snapshots or services are changed.

The MX August 3 backfill is prepared with python -m twits_mcp.mx_worldview_backfill --root <new-analysis-directory> and processed with the existing finite worldview_harness using its backfill_inputs.json and <new-analysis-directory>/new_weeks output. Preparation reads one SQLite snapshot, preserves the completed pilot, and freezes the same reviewed worldview, compact selection cards and per-stage criteria. All new weeks share the global worker pool. The later-built October 12 framework is explicitly marked retrospective_fixed for earlier headlines.

After inference completes, python -m twits_mcp.mx_worldview_backfill --root <analysis-directory> --report verifies source/pilot checksums and combines cached pilot decisions with the new weeks. report.md contains weekly counts; combined/ contains all judgments, high headlines, judgment pending, selection pending, dedup review flags and the preserved pilot audit. The manifest and summary expose coverage gaps separately for MarketTwits and Market Feed. Publication to MCP is a separate action; this backfill does not modify existing exports or restart any service.

Cached MX worldview through MCP

MX uses the existing asset_twits tool with instrument="MX1!" and view="worldview". Its read-only publication is worldview_output/mx_worldview, optionally overridden by MX_WORLDVIEW_DATASET. Unlike the single-channel NQ/Oil publications, MX combines Market Feed and MarketTwits: omit channel or use channel="all" for the combined results. An explicit marketfeed or markettwits filters messages, pending cases and counts to that source. Each structured headline preserves its channel, channel ID, Telegram link, source headline ID and globally distinct <channel_id>:<message_id> ID.

{
  "instrument": "MX1!",
  "channel": "all",
  "view": "worldview",
  "start": "2026-10-12T00:00:00Z",
  "end": "2026-10-18T23:59:59.999999Z",
  "classification": "high",
  "format": "structured"
}

This period returns 8 high headlines and 15 separate pending judgments. Full published history starts August 3, 2026 and ends October 20 at 11:41:37.999999 UTC: 32 high, 679 medium, 2,583 low and 96 pending judgments. classification="high" is the default; medium returns high+medium (711 over full history), and low returns all completed levels (3,294). Pending never enters those totals: review_pending has classification=null, while judgment_pending_summary distinguishes processing failures from semantic uncertainty. upstream_pending_summary separately exposes unresolved selection (1,167 over full history). The 107 dedup review flags overlap retained rows.

Periods are UTC and end-inclusive; omitting end uses the publication cutoff. Pagination uses worldview_limit and worldview_cursor, with the cursor bound to the snapshot, source, dates, threshold, format and limit. Combined MX responses use channel="all", channel_id=null and a source_channels map. Inspect worldview_summary.source_coverage_gaps: MarketTwits is covered only through October 19 at 20:59:59 UTC, whereas Market Feed covers the full publication period. coverage_complete and sync.requested_range_covered become false when a requested source has a gap, even if some headlines exist.

The original provisional decisions, known high/medium inconsistencies, duplicates and retrospective framework caveats survive in worldview_summary.quality. References are not validated event groups. Failed row provenance is enriched from cached tasks without judging again; missing classification or coverage never triggers Telegram or paid inference.

The finite, file-only publisher is:

.\.venv\Scripts\python.exe -m twits_mcp.mx_worldview_publish `
  --source research/headline_judging/mx/mx_worldview_aug03_oct20_harness_v1 `
  --output worldview_output/mx_worldview

The user must restart their running MCP to load the MX routing and updated tool descriptions. The publisher does not restart services or alter Oil/NQ exports.

SI / USD-RUB cached worldview pilot

si_worldview_pilot prepares incoming-headline analysis from the accepted si_worldview_opening_20261012_compact_v4 artifact. SI's canonical underlying is USDRUB (RUB per USD), not silver or Russian equities: positive means USD/RUB up / ruble weaker; negative means USD/RUB down / ruble stronger. config/worldview_judging/si.json contains SI-specific selection, deduplication and judging criteria. Construction prompts are not used to judge headlines.

The October 12–18, 2026 pilot explicitly uses both cached channels. Its files are in research/headline_judging/si/si_worldview_oct12_18_harness_v1: frozen inputs and criteria, per-stage decisions, original requests, all retained judgments, high headlines, pending judgments, topic uncertainty and hourly no-high/incomplete status. report.md, pilot_report.json and manual_audit.json distinguish fundamentals from reported reactions and preserve source-review concerns without changing model classifications. pilot_artifacts.json records the final artifact hashes. This pilot is provisional and is not published to MCP.

Preparation uses python -m twits_mcp.si_worldview_pilot --output <new-input.json>; inference uses the existing finite worldview_harness. After inference, use python -m twits_mcp.si_worldview_pilot --output <harness-directory> --report to render the SI report. The reviewed worldview and existing NQ/Oil/MX publications remain unchanged; no collector or service is started or restarted.

The SI August 3 backfill uses python -m twits_mcp.si_worldview_backfill --root <new-analysis-directory>. It copies the SI pilot's frozen framework, compact selection cards, criteria and source conventions, reuses the completed October 12–18 pilot, and prepares only the other cached weekly windows. Run the existing worldview_harness on backfill_inputs.json with output <analysis-directory>/new_weeks; all weeks share the global process pool. Use python -m twits_mcp.si_worldview_backfill --root <analysis-directory> --report after the harness completes. Combined judgments, pending cases, weekly counts and the preserved pilot audit are saved in combined/. The October 12 framework is applied retrospectively to earlier dates; source coverage gaps remain explicit. This workflow does not publish SI to MCP or modify any existing instrument publication.

SI/USD-RUB cached worldview through MCP

asset_twits accepts instrument="SI1!" (also USDRUB or MOEX:SI1!) with view="worldview". The canonical response instrument is USDRUB. Omitted channel or channel="all" combines Market Feed and MarketTwits; either channel name filters the cached publication. The dataset defaults to worldview_output/si_worldview, overridden by SI_WORLDVIEW_DATASET.

{
  "instrument": "SI1!",
  "channel": "all",
  "view": "worldview",
  "start": "2026-10-12T00:00:00Z",
  "end": "2026-10-18T23:59:59.999999Z",
  "classification": "high",
  "format": "structured"
}

Classification thresholds are cumulative: high returns high only, medium returns high plus medium, and low returns all completed levels. Pending judgments remain separate in review_pending with classification=null; judgment_pending_summary separates processing failures from uncertainty. upstream_pending_summary reports unresolved topic selection separately. Pagination uses worldview_limit and worldview_cursor; counts cover the whole requested period, not just the current page. All times are UTC.

Positive direction means USD/RUB rises (ruble weakens); negative means USD/RUB falls (ruble strengthens). This convention is returned in worldview_summary.direction_convention. Cached labels are provisional: worldview_summary.quality preserves both pilot and backfill audits, including known direction and duplicate concerns. Event references are unverified. The fixed opening worldview was applied retrospectively; availability and context cutoff timestamps do not imply historical real-time availability.

The published August 3–October 20 cache contains 23 high, 269 medium, 2,401 low and 108 pending judgments. October 12–18 contains 3 high, 52 medium, 280 low and 9 pending. MarketTwits coverage ends October 19 at 20:59:59 UTC; inspect source_coverage_gaps for requests beyond that point. Publication and MCP reads perform no inference, Telegram requests or DB writes. To republish existing cached decisions with source hash verification:

.\.venv\Scripts\python.exe -m twits_mcp.si_worldview_publish `
  --source research/headline_judging/si/si_worldview_aug03_oct20_harness_v1 `
  --output worldview_output/si_worldview

Running MCP instances require a user-managed restart to load the SI routing and updated tool descriptions. The publisher does not restart services.

BTC Market Feed worldview pilot

btc_worldview_pilot adapts the accepted BTC construction artifact to the canonical BTCUSD judging instrument without changing its mechanisms or impact patterns. It requires Market Feed channel -1001263412188 only; MarketTwits is excluded from both current messages and earlier candidates. The full reviewed framework feeds judging; matching compact topic cards feed selection. The BTC criteria in config/worldview_judging/btc.json distinguish Bitcoin from Azeri BTC crude, crypto-wide liquidation totals, wrapped tokens, ETF AUM, holdings snapshots and treasury-company stock returns.

.\.venv\Scripts\python.exe -m twits_mcp.btc_worldview_pilot `
  --output research/headline_judging/btc/supporting_files/btc_worldview_oct12_18_inputs_v1.json
.\.venv\Scripts\python.exe -m twits_mcp.worldview_harness `
  --input research/headline_judging/btc/supporting_files/btc_worldview_oct12_18_inputs_v1.json `
  --output research/headline_judging/btc/btc_worldview_oct12_18_harness_v1 `
  --policy llm_backend/config/openrouter_deepseek_fp8.json --plan

Paid inference requires the harness's explicit --execute --key-file <path> options. A completed root returns its cached summary rather than rerunning. The finite run uses batches of 20, a shared pool of up to 20 worker processes, one main pass and one failed-only review. Selection/deduplication batches parallelize inside the week; judging uses earlier-only rolling waves of 80. Valid uncertainty is preserved, not retried. Existing exact-text suppression behavior is unchanged. This pilot does not publish BTC to MCP or reload any service. Build the report from saved outputs with:

.\.venv\Scripts\python.exe -m twits_mcp.btc_worldview_pilot `
  --output research/headline_judging/btc/btc_worldview_oct12_18_harness_v1 --report

BTC pilot v2 (research/headline_judging/btc/btc_worldview_oct12_18_harness_v2) reuses the exact v1 cached inputs with the unchanged opening worldview. Same-release and buyer history candidates improve earlier-reference retrieval. The opt-in judge target includes upstream dedup context; hypothesis relation tests the conditional mechanism independently of direction. btc_worldview_pilot --report applies conservative file-only numeric release compaction for these inputs, preserving raw model labels. Consume refined/judgments.jsonl or refined/high.jsonl for the compact lists; refined/release_duplicates.json records numeric equivalence and canonical IDs. Only structured same-day, same-country/family/reference-month prints with unchanged actual/forecast/prior values from one earlier high are compacted. New components, changed figures, free-form commentary and market reactions are not mechanically merged. comparison.md and manual_audit.json record before/after results and remaining review issues. This does not enable BTC publication through MCP.

BTC cached backfill from August 3

btc_worldview_backfill reads Market Feed only through its latest cached publication, freezes the reviewed BTC worldview and v2 pilot criteria, and reuses the completed October 12–18 pilot without paid calls. Earlier candidate retrieval uses the same release/buyer refinements; judging keeps upstream dedup context enabled. Every week passes the same local structured release compaction.

.\.venv\Scripts\python.exe -m twits_mcp.btc_worldview_backfill `
  --root research/headline_judging/btc/btc_worldview_aug03_latest_harness_v1
.\.venv\Scripts\python.exe -m twits_mcp.worldview_harness `
  --input research/headline_judging/btc/btc_worldview_aug03_latest_harness_v1/backfill_inputs.json `
  --output research/headline_judging/btc/btc_worldview_aug03_latest_harness_v1/new_weeks `
  --backend openrouter --policy llm_backend/config/openrouter_deepseek_fp8.json --execute --key-file <private-key-file>
.\.venv\Scripts\python.exe -m twits_mcp.btc_worldview_backfill `
  --root research/headline_judging/btc/btc_worldview_aug03_latest_harness_v1 --report

Preparation refuses to overwrite an existing nonempty root. The harness reuses saved checkpoints and verifies a completed run instead of rerunning it. Its finite process pool has a global 20-request cap shared across weeks; batches within each week also parallelize. One main pass and one failed-only review remain the maximum; semantic uncertainty stays explicit. combined/judgments.jsonl and combined/high.jsonl are the final compact files; combined/model_judgments.jsonl preserves uncompacted model rows, and combined/release_duplicates.json gives canonical IDs and numeric repeat proofs. Weekly totals separate model dedup from local release repeats. The opening October 12 framework is applied retrospectively to earlier data, not as an as-of trading simulation. No collector/server is started and no MCP publication is performed by this workflow.

BTC cached worldview through MCP

asset_twits(instrument="BTCUSD", view="worldview") reads the compact, preclassified BTC publication at worldview_output/btc_worldview, optionally overridden with BTC_WORLDVIEW_DATASET. For this view, omitted channel, channel="all" and channel="marketfeed" all use Market Feed only. Explicit channel="markettwits" is unsupported. Other asset views retain their existing channel behavior.

{
  "instrument": "BTCUSD",
  "channel": "marketfeed",
  "view": "worldview",
  "start": "2026-10-12T00:00:00Z",
  "end": "2026-10-18T23:59:59.999999Z",
  "classification": "high",
  "format": "structured"
}

Both date boundaries are inclusive; all output and unzoned inputs use UTC. high (default) returns high only; medium returns high+medium; low returns high+medium+low. Pending is never silently treated as low: review_pending contains classification=null, with processing failure versus uncertainty in judgment_pending_summary. upstream_pending_summary reports unresolved topic selection separately. Original IDs, publication/classification availability, context cutoffs, model and prompt provenance are preserved. Positive direction means BTC/USD up, negative means down; importance is separate from direction.

Use worldview_limit (1–500, default 100) and pass next_cursor back as worldview_cursor with the same filters to retrieve further pages. total_count and summary counts cover the whole requested period, not the page. Omitted end uses the published cutoff. Inspect coverage gaps for requests extending beyond October 20, 2026 at 11:41:37.999999 UTC.

The full snapshot has 175 high, 799 medium, 4441 low and 85 pending judgments; October 12–18 has 20 high, 64 medium, 367 low and 9 pending. worldview_summary.quality preserves both audits and the numeric CPI duplicate proof. Event references are provisional; headline counts are not independent event counts. The same October 12 opening framework is applied retrospectively, not an as-of simulation.

Publication and reads perform no classification, Telegram access or DB writes. To publish completed cached results only:

.\.venv\Scripts\python.exe -m twits_mcp.btc_worldview_publish `
  --source research/headline_judging/btc/btc_worldview_aug03_latest_harness_v1 `
  --output worldview_output/btc_worldview

A running MCP requires the user to restart it to load the BTC route and updated tool descriptions; the publisher does not start or restart services.

Gold / USD Market Feed worldview pilot

gold_worldview_pilot adapts the accepted GD construction artifact at research/worldview_construction/gold/gold_worldview_opening_20261012_marketfeed_v2 to GC1! without rebuilding its six mechanisms or impact patterns. Full patterns feed the judge; matching compact cards feed selection. Direction is USD gold, independent of RUB conversion or futures basis. The criteria in config/worldview_judging/gold.json retain competing haven and oil/inflation/rate channels, nominal versus real yields, physical purchases versus reserve valuation/custody, and overlapping/local ETF flows.

.\.venv\Scripts\python.exe -m twits_mcp.gold_worldview_pilot `
  --output research/headline_judging/gold/supporting_files/gold_worldview_oct12_18_inputs_v1.json
.\.venv\Scripts\python.exe -m twits_mcp.worldview_harness `
  --input research/headline_judging/gold/supporting_files/gold_worldview_oct12_18_inputs_v1.json `
  --output research/headline_judging/gold/gold_worldview_oct12_18_harness_v1 `
  --policy llm_backend/config/openrouter_deepseek_fp8.json --plan

Paid execution uses the harness's explicit --execute --key-file <private-key-file>. The finite runner uses DeepSeek batches of 20, up to 20 processes, one main pass and one failed-only review. Valid uncertainty stays pending. Preparation reads cached Market Feed only; the earlier week supplies own-prior candidates. Release retrieval and exact numeric CPI/PPI compaction reuse asset-neutral helpers; BTC buyer preferences are disabled. Original model judgments remain unchanged. Build the file report with python -m twits_mcp.gold_worldview_pilot --output <completed-root> --report. refined/ contains compact final records and duplicate proofs; hourly_refined.jsonl explicitly marks no-high hours and unresolved cases. The pilot does not publish Gold to MCP, reload Telegram or restart services.

Gold pilot v2 (research/headline_judging/gold/gold_worldview_oct12_18_harness_v2) reuses the exact first pilot's frozen headlines and reviewed worldview. The v2 Gold criteria and gold_worldview_rules provide structured CPI/PPI component deltas, distinguish reserve-program remainders from new/accelerated commitments, and separate analyst forecasts from new fundamental decisions. Gold-only source checks reject unsupported release-repeat and hypothesis-relation claims; they send failures to the existing single review rather than forcing replacement labels. Other instruments do not enable these guards.

gold_worldview_pilot --report may recover otherwise valid cached failed Gold judgments through gold_cached_repair: only numeric-string own aliases and whitespace-equivalent exact source evidence spans (at most 140 characters) are normalized. It does not guess missing references, paraphrase evidence, change materiality/direction/relation, make calls or backdate availability. Original responses and root outputs remain unchanged. refined/representation_repairs.json records response hashes, repairs and availability. refined/judgments.jsonl is the final list; raw harness counts can differ. comparison.md gives the source-reviewed before/after cases and limitations. No MCP publication/restart.

Gold's cached August 3 backfill uses python -m twits_mcp.gold_worldview_backfill --root <new-root> to prepare Market Feed-only weekly inputs, then the same worldview_harness --execute policy as the pilot (20 processes, batches of 20). After the finite harness completes under <new-root>/new_weeks, run python -m twits_mcp.gold_worldview_backfill --root <new-root> --report. The wrapper preserves the corrected v2 pilot, including its locally repaired CPI judgments and original repair availability. New failed responses receive the same representation-only cached recovery. combined/judgments.jsonl, combined/high.jsonl, combined/pending.jsonl and combined/weekly_counts.json are authoritative; raw model decisions remain in combined/model_judgments.jsonl. Topic uncertainty and retained deduplication flags are separate files. The fixed October opening worldview is applied retrospectively; it is not an as-of historical trading simulation. This command does not publish to MCP.

Gold's cached worldview is served as GC1! (USD gold / GD framework) from worldview_output/gold_worldview, optionally overridden by GOLD_WORLDVIEW_DATASET. Publish files only with python -m twits_mcp.gold_worldview_publish --source research/headline_judging/gold/gold_worldview_aug03_latest_harness_v1 --output worldview_output/gold_worldview. This verifies cached snapshots, preserves repaired judgment availability, and enriches failed judgments from cached task metadata without inference or Telegram. It leaves the analysis cache and other instrument exports unchanged.

Call asset_twits(instrument="GC1!", view="worldview", channel="marketfeed", start="2026-10-12T00:00:00Z", end="2026-10-18T23:59:59.999999Z", classification="high", format="structured"). Omitted channel or all also uses Market Feed only; MarketTwits is unsupported for this Gold dataset. high (default) returns high, medium high+medium, and low high+medium+low. worldview_limit / worldview_cursor paginate completed results. Pending judgments remain separate in review_pending, with classification=null; upstream_pending_summary reports unresolved topic selection. All times are UTC. Positive/negative direction refers to USD gold price, without RUB translation. The snapshot exposes quality limitations, including residual materiality issues. New Gold service routing requires the user to restart the existing MCP process; publishing the files does not start or restart it.

Reviewed Gold story-v2 MCP view

asset_twits(instrument="GC1!", view="worldview_v2", channel="marketfeed", start="2026-10-12T00:00:00Z", end="2026-10-18T23:59:59.999999Z", classification="high", format="structured") serves a separate reviewed snapshot. The initial October 12–18 pilot returns 4 high headlines in 2 reviewed event groups, with 8 judged pending rows (6 semantic, 2 freshness) and 2 upstream selection uncertainties kept explicit. Medium/low thresholds return 141/337 completed rows. Filtering uses effective classification; unresolved freshness does not erase original high materiality. Dates, cumulative thresholds and worldview_limit/worldview_cursor follow the existing worldview interface.

Dataset: worldview_output/gold_worldview_v2, optionally overridden by GOLD_WORLDVIEW_V2_DATASET. Publish with python -m twits_mcp.worldview_v2_archive --source research/headline_judging/gold/gold_story_v2_1_oct12_18_fp8_20261022 --output worldview_output/gold_worldview_v2. No query fetches or judges missing coverage. See Gold worldview v2 MCP usage for period, event grouping, pending, provenance and publication semantics. The owner must restart the running MCP to load the new view/schema; no service is started or restarted by the publisher or tests.

Updated grouped Gold: worldview_v2.2

The August 3–October 20, 2026 grouped Gold results have a separate publication at worldview_output/gold_worldview_v2_2 (override with GOLD_WORLDVIEW_V22_DATASET). Existing worldview_v2, worldview and major remain unchanged. The owner must restart MCP to activate the new schema/dispatch code; agents must not restart it.

{
  "instrument": "GC1!",
  "view": "worldview_v2.2",
  "start": "2026-08-03T00:00:00Z",
  "classification": "high",
  "format": "structured"
}

End defaults to the published cached cutoff. High returns 61 completed units; Medium cumulatively returns 1,035; Low returns 3,329. Use worldview_limit and next_cursor as worldview_cursor for completed-unit pagination. The 50 pending judgments and 76 upstream uncertainties are separate arrays with null classification; pending role/direction metadata has its own summary/array.

Units can be groups or headline singletons. Groups match a period when their latest member appeared; source_messages preserve exact individual UTC times, IDs and Telegram links. Earlier members are event context, not automatically headlines published inside the requested period. Importance is separate from direction and actionability. The MCP view label v2.2 uses the frozen v2.4 judge. Queries read immutable verified snapshots and never fetch Telegram or call an LLM. See grouped Gold design and validation.

Gold v2.2 also carries a targeted cached event/novelty review. canonical_event_id links reviewed summaries of the same episode, while model_novelty preserves the original dedup decision. novelty is the reviewed result and novelty_status is validated or unvalidated; baseline_status, exact novelty_evidence and the review reason show the basis. A reported forecast in a release is distinguished from a separately validated pre-event forecast. Reviews are local to identified episodes, not a claim of global event deduplication.

High materiality stays High even for a repeat. Consumers must not count a repeat as another independent shock or refresh persistent pressure when refreshes_driver_state=false. A true value permits consideration of an identified new fact only; it is not trading permission or proof of surprise. novelty_review_pending and novelty_summary cover all threshold-matching units in the requested period, across pages, separately from classification pending. Unreviewed units default to unvalidated novelty and no state refresh. The existing coverage/completeness flags describe classification coverage; novelty_validation_complete separately describes novelty validation.

publication_time remains the own packet-complete time; an earlier event_anchor_publication_time_utc never backdates a packet's full content. Original classification/context/model/prompt provenance is unchanged. reconciliation_available_at_utc records when the cached review became available; a historical replay cannot assume it was known at publication time. The adapter remains unchanged and must explicitly consume these fields to enforce the policy. Snapshot data is reloaded on manifest changes; updated MCP descriptions and summary code require the owner to restart the service.

The follow-up cached review covers every previously unvalidated High unit. novelty_detail distinguishes new_driver_change, incremental_update, same_event_repeat, reaffirmation, observation, and unresolved. A reaffirmation is a fresh statement supporting an existing driver; it keeps its own dated episode and does not refresh pressure. A same-event repeat links the earlier unit/source. Compound release summaries can carry canonical_event_ids for both PPI and retail sales without merging the two release families. Repeat chains resolve to the earlier anchor; each unit still retains its own packet-complete publication time.

driver_state_effect describes the novelty interpretation (changes_driver, reinforces_driver, observes_driver, or unresolved), without changing original materiality, Gold direction, evidence_role or state_scope. A validated new report of an attack need not mean independently confirmed damage. novelty_limits preserves source/identity/comparison limitations. Reviewed uncertainties remain unvalidated with no state refresh. Earlier validated reviews are retained; novelty_review_history and snapshot reconciliation history preserve superseded uncertainty decisions and review availability. Original missing-baseline flags describe the original model input; later cached source comparisons do not rewrite those packet baselines.

See Folder structure for current storage locations. data/analysis no longer exists; archived execution records retain their original paths, with relocation recorded in research/index.json.

MCP worldview content

get_worldview({"asset":"gold","as_of":"2026-02-20"}) returns the latest eligible saved Gold topics and conditional effects within the default construction/prompt version. as_of is required with asset; an explicit construction_version overrides the default. The default selects a prompt version, while the date selects its saved snapshot. Every asset/detail mode omits keyword and retrieval rules. Exact IDs remain supported. See publication contract.

Date lookup: get_worldview({"asset":"gold","as_of":"2025-11-20"}) selects the latest exclusive evidence cutoff at or before the requested UTC day start within the selected construction version. Optional construction_version overrides the configured default; missing and ambiguous snapshots are explicit. Actual construction availability remains separate.

Active workflow settings

Read config/active_workflows.json for current background, worldview construction and headline judge choices. Use the promotion and run snapshot commands before new work; each run freezes its own settings and selected resources. Promotions are recorded in _journal/WORKFLOW_SETTINGS_CHANGELOG.jsonl.

Instrument settings now use instruments.gold.workflows in active_workflows.json. Other instruments require explicit entries. File/instrument update and use timestamps are separate; offline preparation never counts as use. See scoped promotions and usage tracking.

Available Tools

1 tool
asset_twitsA

Return relevant MarketTwits messages, newest first.

Relevance is defined exclusively by the instrument-to-hashtag links in instrument_hashtags.csv. An optional exchange prefix is discarded, and SI1! is treated as USDRUB. Each returned message is formatted as [22-Jul-26 19:27 UTC] message text.

Inputs: instrument (required), days, datetime.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusing it with others. The purpose is clearly defined and unambiguous.

    Naming Consistency5/5

    The single tool name 'asset_twits' is clear and descriptive. With only one tool, there is no inconsistency in naming patterns.

    Tool Count3/5

    One tool feels thin for a server named 'MarketTwits MCP', which implies a broader scope. However, it could be appropriate if the intended use is narrowly focused on retrieving messages.

    Completeness2/5

    The tool covers only the retrieval of relevant messages. There are no tools for exploring assets, hashtags, or other common operations, leaving significant gaps in the surface.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Self-hosted financial data terminal for AI agents. Scrapes and serves SEC filings (full-text search), 13F institutional holdings, insider and congressional trades, FINRA short data, FRED economic indicators, CFTC futures positioning, VIX/put-call ratios, and daily stock prices over MCP.
      65
      248
      AGPL 3.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that connects to a Telegram group chat, persists messages to a local SQLite database, and exposes tools to search, retrieve, and send messages via SSE.
      -
    • A
      license
      A
      quality
      B
      maintenance
      Local-first, read-only MCP server for searching and retrieving cited evidence from archived Telegram chats, including transcripts and media metadata.
      5
      3
      MIT