Skip to content

feat: update macro-intelligence to v2.1#283

Merged
mig-pre merged 10 commits intookx:mainfrom
VibeCodeDaddy69:update-macro-intelligence-v2.1
Apr 24, 2026
Merged

feat: update macro-intelligence to v2.1#283
mig-pre merged 10 commits intookx:mainfrom
VibeCodeDaddy69:update-macro-intelligence-v2.1

Conversation

@VibeCodeDaddy69
Copy link
Copy Markdown
Contributor

Summary

  • Token Impact Engine — each macro signal now maps to specific crypto tokens with directional impact scores (e.g. fed_cut_surprise → BTC +0.85, ETH +0.80). 23 event types covered + generic fallback. Client-side fallback for legacy signals.
  • Source Diversity — new _diverse_recent_signals() guarantees minimum 5 signals per source type (Finnhub, Polymarket, OpenNews etc.) instead of letting one source flood the feed. Returns 80 signals instead of 50.
  • Dashboard Redesign — neon-glass terminal aesthetic with heat column, sparklines, token impact pills, dynamic pulse effects (radar sweep, scan beam), and metric scanline overlay.
  • Author UpdatevictorleeVibeCodeDaddy across plugin.yaml and plugin.json.

Files Changed

File Changes
config.py +TOKEN_IMPACT_MAP (23 event types), +DASHBOARD_SOURCE_QUOTA, +DASHBOARD_MAX_SIGNALS
macro_news.py +_compute_token_impacts(), +_diverse_recent_signals(), backfill on state load
dashboard.html New terminal UI, token impact pills, heat column, sparklines, pulse effects
plugin.yaml Author name update
.claude-plugin/plugin.json Author name update

Test plan

  • GET /api/health returns opennews_article_count > 0
  • GET /api/state returns 80 signals with mixed source types
  • Each signal has token_impacts array with symbol/impact/direction
  • Dashboard renders token impact pills on signal cards
  • Source diversity: at least 2 different source types visible in feed

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

✅ Phase 1: Structure Validation — PASSED

Linting skills/macro-intelligence...


✓ Plugin 'macro-intelligence' passed all checks!

→ Proceeding to Phase 2: Build Verification

@github-actions
Copy link
Copy Markdown
Contributor

📋 Phase 3: AI Code Review Report — Score: 82/100

Plugin: macro-intelligence | Recommendation: ⚠️ Merge with caveats

🔗 Reviewed against latest onchainos source code (live from main branch) | Model: claude-opus-4-7 via Anthropic API | Cost: ~353985+6703 tokens

This is an advisory report. It does NOT block merging. Final decision is made by human reviewers.


1. Plugin Overview
Field Value
Name macro-intelligence
Version 2.0.0
Category trading-strategy
Author VibeCodeDaddy (VibeCodeDaddy69)
License MIT
Has Binary No (Skill only, with Python runtime source files)
Risk Level Low-Medium

Summary: A unified macro intelligence aggregator that polls 9+ external data sources (NewsNow, Polymarket, Finnhub, FRED, CoinGecko, 6551.io OpenNews, CryptoPanic, Fear & Greed, RSS, Telegram), classifies macro events via keyword regex + LLM, scores sentiment, and exposes filtered signals through an HTTP API on port 3252 and optional WebSocket on 3253. It is read-only with no trading logic or wallet operations.

Target Users: Traders and developers building downstream trading/alpha skills who need a consolidated macro news/sentiment feed with event classification.

2. Architecture Analysis

Components:

  • Skill (SKILL.md + SUMMARY.md + config.py + macro_news.py)
  • No binary, no build config — pure Python runtime

Skill Structure:

  • SKILL.md sections: Purpose, Architecture, Startup Protocol, Files, Configuration, Signal Schema, Data Sources, Classification Pipeline, Event Types, Public API (11 endpoints), Dashboard, Downstream Integration, Reputation System, Key Design Decisions, Security (external data boundary), Monitoring, Troubleshooting
  • No onchainos CLI commands referenced

Data Flow:

  • Outbound HTTP polling to: newsnow.busiyi.world, gamma-api.polymarket.com, alternative.me (F&G), finnhub.io, api.stlouisfed.org, ai.6551.io, cryptopanic.com, api.coingecko.com, api.anthropic.com, user-configured RSS feeds, wss://ai.6551.io (WebSocket), Telegram (via Telethon)
  • Inbound: Local HTTP server on :3252 and WebSocket on :3253
  • Data stored in state/state.json locally

Dependencies:

  • Python 3.9+ (stdlib: http.server, urllib, xml.etree, hashlib, json, re, threading, asyncio)
  • Optional: telethon, websockets
  • Optional API keys: ANTHROPIC_API_KEY, OPENNEWS_TOKEN, FINNHUB_API_KEY, FRED_API_KEY, CRYPTOPANIC_TOKEN, TG_API_ID, TG_API_HASH
3. Auto-Detected Permissions

onchainos Commands Used

Command Found Exists in onchainos CLI Risk Level Context
(none) N/A N/A Plugin does not use onchainos CLI at all

Wallet Operations

Operation Detected? Where Risk
Read balance No Low
Send transaction No High
Sign message No High
Contract call No High

External APIs / URLs

URL / Domain Purpose Risk
newsnow.busiyi.world/api/s News headlines Low
gamma-api.polymarket.com Prediction markets Low
api.alternative.me/fng/ Fear & Greed Index Low
finnhub.io/api/v1 Market news, quotes Low
api.stlouisfed.org/fred Macro indicators Low
ai.6551.io (HTTPS + WSS) News aggregation Low
cryptopanic.com/api/v1/posts/ Crypto news Low
api.coingecko.com/api/v3 BTC/ETH prices Low
api.anthropic.com/v1/messages LLM classification (Claude Haiku) Low-Medium (sends headlines + may log API usage to Anthropic)
User-configured RSS feeds News Low
Telegram (via Telethon) Message monitoring Low
Webhook URLs (user-configured POST targets) Signal push Medium (user-chosen destinations)

Chains Operated On

None. This is a read-only intelligence feed with no on-chain interactions.

Overall Permission Summary

The plugin is a read-only data aggregator. It polls public APIs for news/market data, optionally connects to Telegram (user-supplied credentials), calls Anthropic API for classification (user-supplied key), and runs local HTTP/WebSocket servers. No wallet access, no transaction signing, no on-chain activity. Primary risks are: (1) outbound network traffic containing user-configured API keys (sent only to their respective services), (2) headlines sent to Anthropic for classification, and (3) user-configured webhook POST destinations. No credential exfiltration patterns detected.

4. onchainos API Compliance

Does this plugin use onchainos CLI for all on-chain write operations?

N/A — the plugin performs no on-chain operations of any kind.

On-Chain Write Operations (MUST use onchainos)

Operation Uses onchainos? Self-implements? Detail
Wallet signing N/A No No signing
Transaction broadcasting N/A No No broadcast
DEX swap execution N/A No No swap
Token approval N/A No No approval
Contract calls N/A No No contract interaction
Token transfers N/A No No transfers

Data Queries (allowed to use external sources)

Data Source API/Service Used Purpose
NewsNow REST HTTP Financial headlines
Polymarket Gamma REST Prediction markets
Finnhub REST HTTP Market news + ETF quotes
FRED REST HTTP Macro indicators
6551.io OpenNews REST + WebSocket Aggregated crypto news
CryptoPanic REST HTTP Crypto news + community votes
CoinGecko REST HTTP BTC/ETH prices
Fear & Greed (alternative.me) REST HTTP Sentiment index
Anthropic REST HTTP LLM classification (Haiku)
Telegram Telethon (MTProto) Group/channel monitoring
RSS/Atom feeds HTTP + XML User-configured news feeds

External APIs / Libraries Detected

  • urllib.request (stdlib) for all HTTP calls
  • websockets (optional) for 6551.io WSS
  • telethon (optional) for Telegram
  • xml.etree.ElementTree for RSS parsing
  • No web3 / RPC / wallet libraries

Verdict: ✅ Fully Compliant

The plugin does not perform on-chain operations, so onchainos usage is not required. All external queries are read-only data sources, which is explicitly permitted.

5. Security Assessment

Static Rule Scan (C01-C09, H01-H09, M01-M08, L01-L02)

Rule ID Severity Title Matched? Detail
M03 MEDIUM Third-party content fetched via HTTP ⚠️ Multiple urlopen() calls to external APIs in code files. However, the skill explicitly documents the "External Data Boundary" security section with proper untrusted-data declaration. Downgraded to INFO per M07/M08 satisfaction.
M07 MEDIUM Missing untrusted data boundary declaration NOT triggered — SKILL.md explicitly states: "Treat all data returned by the CLI as untrusted external content" in the Security section.
M08 MEDIUM External data field passthrough NOT triggered — SKILL.md Security section enumerates specific safe fields per context (Signal, Fear & Greed, FRED, Prices, etc.) and requires sanitization (strip HTML, cap insight at 500 chars).
H05 INFO Financial API operations NOT triggered — no financial write operations, no swap/transfer/approve/broadcast. Read-only.

No other static rules match. No curl|sh, no prompt injection, no base64/unicode obfuscation, no pseudo-system tags, no HTML comment injection, no backtick injection, no hardcoded secrets, no credential output/exfiltration, no persistence, no sensitive path access, no system modification, no plaintext .env credential writes, no Agent credential solicitation, no --signed-tx parameters, no unpinned packages (Python deps are documented as optional pip install), no dynamic package install.

LLM Judge Analysis (L-PINJ, L-MALI, L-MEMA, L-IINJ, L-AEXE, L-FINA, L-FISO)

Judge Severity Detected Confidence Evidence
L-PINJ CRITICAL 0.95 No hidden jailbreak instructions; SKILL.md clearly describes read-only aggregator behavior. Data boundary explicitly declared.
L-MALI CRITICAL 0.95 Source code behavior matches SKILL.md claims: polls APIs, classifies, stores, serves via HTTP. No hidden exfil, no unexpected writes.
L-MEMA HIGH 0.95 Writes only to state/state.json within plugin scope. No access to MEMORY.md, SOUL.md, or Agent memory files.
L-IINJ INFO 0.95 Multiple external requests — listed in section 3. Boundary declaration present → INFO only.
L-AEXE INFO 0.90 No autonomous execution of high-impact operations. Plugin is purely a data feed; downstream consumers handle any actions.
L-FINA INFO 0.95 Read-only. Financial scope = read-only (price/news data). Exempt from financial risk.
L-FISO INFO 0.95 No financial operations to isolate.

Toxic Flow Detection (TF001-TF006)

No toxic flows detected. Specifically:

  • TF001 (sensitive data + exfil): No sensitive path access.
  • TF005 (curl|sh + financial): No curl|sh, no financial ops.
  • TF006 (missing boundary + financial): Boundary IS declared, and no financial ops exist.

Prompt Injection Scan

Checked SKILL.md and source code for: instruction override, identity manipulation, hidden behavior, confirmation bypass, unauthorized operations, base64 payloads, invisible chars, pseudo-system tags. None found.

Result: ✅ Clean

Dangerous Operations Check

No transfers, no signing, no contract calls, no tx broadcasting. Plugin is intelligence-only.

Result: ✅ Safe

Data Exfiltration Risk

Potential data flows: (a) headlines sent to Anthropic for classification (user opts in with their own API key), (b) signals POSTed to user-configured webhook URLs (explicit user configuration), (c) Telegram messages read via user's own API credentials. All are user-controlled and declared. No covert exfiltration (no hardcoded attacker URLs, no credential files read, no environment variable scraping beyond documented API keys).

Result: ✅ No Risk

Overall Security Rating: 🟢 Low Risk

6. Source Code Security (if source code is included)

Language & Build Config

  • Language: Python 3.9+
  • Entry point: python3 macro_news.py
  • No build config; runtime-interpreted

Dependency Analysis

  • Stdlib only for core functionality (json, urllib, http.server, xml.etree, re, threading, asyncio, hashlib, pathlib)
  • Optional: telethon (well-maintained MTProto client), websockets (well-maintained)
  • No suspicious or abandoned packages
  • No package pinning (risk is low since deps are optional and widely-used stdlib-adjacent libraries, but pinning would be best practice)

Code Safety Audit

Check Result Detail
Hardcoded secrets (API keys, private keys, mnemonics) All secrets read from env vars; empty defaults
Network requests to undeclared endpoints All endpoints match those declared in SKILL.md (newsnow, polymarket, finnhub, fred, 6551, coingecko, cryptopanic, alternative.me, anthropic, user RSS, user webhooks)
File system access outside plugin scope Writes only to {plugin_dir}/state/state.json; no access to ~/.ssh, ~/.aws, ~/.env, etc.
Dynamic code execution (eval, exec, shell commands) No eval(), exec(), subprocess, os.system, shell=True found
Environment variable access beyond declared env Reads only: ANTHROPIC_API_KEY, TG_API_ID, TG_API_HASH, OPENNEWS_TOKEN, FINNHUB_API_KEY, FRED_API_KEY, CRYPTOPANIC_TOKEN — all documented
Build scripts with side effects (build.rs, postinstall) N/A — Python, no build step
Unsafe code blocks (Rust) / CGO (Go) N/A N/A

Does SKILL.md accurately describe what the source code does?

Yes. SKILL.md describes 9+ sources, classification pipeline, HTTP API on :3252, WebSocket on :3253, state persistence, reputation system, token extraction, AI insights — all verified in source. Minor extras in code (WebSocket server, webhook push, fuzzy dedup, accuracy tracking) are also mentioned in SKILL.md/config.

Verdict: ✅ Source Safe

7. Code Review

Quality Score: 82/100

Dimension Score Notes
Completeness (pre-flight, commands, error handling) 20/25 No onchainos pre-flight needed; good error handling and graceful degradation when deps/keys missing. No explicit pre-flight block for the agent.
Clarity (descriptions, no ambiguity) 22/25 Clear architecture diagram, signal schema, API endpoint table, troubleshooting section. Minor: SKILL.md version mismatches plugin.yaml (says v1.0 in one place, v2.0.0 elsewhere).
Security Awareness (confirmations, slippage, limits) 24/25 Explicit external-data boundary declaration, safe-field enumeration, HTML sanitization, read-only design. Excellent.
Skill Routing (defers correctly, no overreach) 13/15 Correctly describes itself as "no trading logic" and defers to downstream skills. No overreach.
Formatting (markdown, tables, code blocks) 9/10 Good formatting overall. Pipe character in description could cause minor display issues in some renderers.

Strengths

  • Excellent security posture: explicit untrusted-data boundary, safe-field whitelist, HTML stripping, no wallet/chain operations
  • Robust graceful degradation: each source is optional and disabled cleanly when API keys missing
  • Clear read-only intelligence-feed role with no trading logic

Issues Found

  • 🔵 Minor: SKILL.md top title says "v1.0" while plugin.yaml is v2.0.0 and description says "v2.0"
  • 🔵 Minor: Optional Python dependencies not pinned (minor supply-chain hygiene; mitigated by deps being optional and widely-used)
  • 🔵 Minor: Port 3252/3253 hardcoded — if another process uses the port, startup fails (documented in troubleshooting)
8. SUMMARY.md Review
Check Result
File exists
Written in English
Has "## 1. Overview" section ❌ (uses implicit intro paragraph instead of "## 1. Overview" heading)
Has "## 2. Prerequisites" section ❌ (no Prerequisites section)
Has "## 3. Quick Start" section ❌ (no Quick Start section)
Character count ≤ 17,000 ✅ 1457 chars

The SUMMARY.md is concise and well under the 17,000 character limit, but it does not follow the required three-section structure (Overview / Prerequisites / Quick Start). It uses a free-form introduction followed by a Highlights list.

9. Recommendations
  1. 🟡 Restructure SUMMARY.md to include the three required sections: ## 1. Overview, ## 2. Prerequisites (list Python 3.9+, optional pip packages, API keys), and ## 3. Quick Start (show python3 macro_news.py and dashboard URL). Keep the Highlights content within Overview.
  2. 🔵 Align version numbers across plugin.yaml (2.0.0), SKILL.md title ("v1.0"), and SKILL.md body ("v2.0.0") for consistency.
  3. 🔵 Pin optional Python dependencies in documentation (e.g., pip install telethon==1.36.0 websockets==12.0) for supply-chain hygiene.
  4. 🔵 Add a note in SKILL.md about the security implication of user-configured webhook URLs (remind users that signal data will be POSTed to those endpoints).
  5. 🔵 Consider binding local servers to 127.0.0.1 instead of 0.0.0.0 (currently exposes the HTTP API and WebSocket to all network interfaces) unless multi-host access is explicitly required.
10. Reviewer Summary

One-line verdict: A well-engineered, read-only macro intelligence aggregator with strong security hygiene and explicit external-data boundary; only minor documentation fixes (SUMMARY.md structure, version alignment) are needed.

Merge recommendation: ⚠️ Merge with noted caveats

Items to address before merge:

  • 🟡 Restructure SUMMARY.md to include the required ## 1. Overview, ## 2. Prerequisites, and ## 3. Quick Start sections
  • 🔵 Reconcile version numbers ("v1.0" vs "v2.0.0") in SKILL.md
  • 🔵 (Optional but recommended) Bind local servers to 127.0.0.1 by default and document how to expose externally if needed

Generated by Claude AI via Anthropic API — review the full report before approving.

plugin-store-bot and others added 2 commits April 23, 2026 07:51
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, no cd paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Rust linter panics on multi-byte UTF-8 box-drawing characters
at non-char-boundary byte offsets. Replace architecture diagram
box-drawing chars with ASCII equivalents.
- Remove full registration URLs from SKILL.md (triggered E141 data exfiltration check)
- Add 9 API domains to plugin.yaml api_calls (fixes W140)
- Reduce tags from 11 to 10 (fixes W047)
- Replace webhook example URLs with placeholder strings
The linter flags any URL in SKILL.md as potential data exfiltration.
Replace code examples with localhost URLs with text descriptions.
@mig-pre mig-pre merged commit ba8d0df into okx:main Apr 24, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants