feat(intelligence): add regulatory action cross-source signal#2568
Open
lspassos1 wants to merge 6 commits intokoala73:mainfrom
Open
feat(intelligence): add regulatory action cross-source signal#2568lspassos1 wants to merge 6 commits intokoala73:mainfrom
lspassos1 wants to merge 6 commits intokoala73:mainfrom
Conversation
Add a standalone seeder that fetches and normalizes SEC, CFTC, Federal Reserve, FDIC, and FINRA regulatory feeds without introducing new dependencies. The script stays import-safe, tolerates partial feed failure, and emits JSON for the fetch/parse-only phase of the pipeline. Unit tests cover RSS/Atom parsing, deduplication, ordering, and degraded-feed behavior. Refs koala73#2492 Refs koala73#2493 Refs koala73#2494 Refs koala73#2495
Build on the standalone RSS fetcher by adding keyword-based tier classification, aggregate payload counts, and runSeed integration for regulatory:actions:v1. The updated tests cover matched keywords, payload stats, and the runSeed wiring needed for Redis publication. Refs koala73#2493 Depends on koala73#2564
Add regulatory:actions:v1 as a new cross-source input, map regulatory actions into the policy category, and emit CROSS_SOURCE_SIGNAL_TYPE_REGULATORY_ACTION signals for recent high/medium items. The new test covers severity scoring and composite escalation when policy, financial, and economic signals co-fire in Global Markets. Refs koala73#2494 Depends on koala73#2567
|
@lspassos1 is attempting to deploy a commit to the Elie Team on Vercel. A member of the Team first needs to authorize it. |
lspassos1
added a commit
to lspassos1/worldmonitor
that referenced
this pull request
Mar 30, 2026
Extend the Railway seed-service sync script to enforce the expected cronSchedule for seed-regulatory-actions, while continuing to validate watch patterns and start commands. Add a focused test for the new cronSchedule path and fail fast when the required seed-regulatory-actions service is missing. Refs koala73#2495 Depends on koala73#2568
This was referenced Mar 30, 2026
Greptile SummaryThis PR wires the new Key observations:
Issues found:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Cron as Railway Cron
participant RegSeed as seed-regulatory-actions.mjs
participant Feeds as Regulatory Feeds<br/>(SEC, CFTC, Fed, FDIC, FINRA)
participant Redis as Upstash Redis
participant XSeed as seed-cross-source-signals.mjs
participant Client as API / Bootstrap Client
Cron->>RegSeed: trigger (every ~2h)
RegSeed->>Feeds: fetch RSS/Atom (parallel, Promise.allSettled)
Feeds-->>RegSeed: XML responses
RegSeed->>RegSeed: parseFeed → normalizeFeedItems → dedupeAndSortActions
RegSeed->>RegSeed: classifyAction (high / medium / low)
RegSeed->>Redis: SET regulatory:actions:v1 (TTL 7200s)
RegSeed->>Redis: SET seed-meta:regulatory:actions (via runSeed)
Cron->>XSeed: trigger (every ~15min)
XSeed->>Redis: pipeline GET SOURCE_KEYS (incl. regulatory:actions:v1)
Redis-->>XSeed: all source payloads
XSeed->>XSeed: extractRegulatoryAction → filter(48h, tier≠low) → slice(0,3)
XSeed->>XSeed: score: high→3.0 HIGH, medium→2.0 MEDIUM
XSeed->>XSeed: detectCompositeEscalation (policy + financial + economic → COMPOSITE)
XSeed->>Redis: SET intelligence:cross-source-signals:v1 (TTL 1800s)
Client->>Redis: GET intelligence:cross-source-signals:v1 (via bootstrap)
Redis-->>Client: signals incl. REGULATORY_ACTION + potential COMPOSITE_ESCALATION
Reviews (1): Last reviewed commit: "feat(intelligence): add regulatory actio..." | Re-trigger Greptile |
Use the repository-standard fetch wrapper in the seeder defaults, keep the documented FINRA HTTP exception in place, and include publish time in generated action ids to avoid same-day collisions. Validated with: node --test tests/regulatory-seed-unit.test.mjs; node scripts/seed-regulatory-actions.mjs | head -n 20
Clean up the leftover cherry-pick marker after carrying the shared seeder hardening changes onto this branch. Validated with: node --test tests/regulatory-seed-unit.test.mjs and a local fetchRegulatoryActionPayload smoke check.
Explicitly sort regulatory actions by publishedAt inside the cross-source extractor before applying the 3-item limit, and cover the behavior with an out-of-order payload test. Validated with: node --test tests/regulatory-seed-unit.test.mjs and node --test tests/cross-source-signals-regulatory.test.mjs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds
CROSS_SOURCE_SIGNAL_TYPE_REGULATORY_ACTIONtoseed-cross-source-signals.mjs, wiring the newregulatory:actions:v1feed into cross-source detection with policy categorization, severity scoring, and composite escalation support inGlobal Markets.Root cause
The regulatory seeder from #2567 can now publish classified actions, but the cross-source aggregator still ignored that key entirely, so market-moving regulatory actions could not participate in signal ranking or composite escalation.
Changes
regulatory:actions:v1toSOURCE_KEYSCROSS_SOURCE_SIGNAL_TYPE_REGULATORY_ACTIONto thepolicycategory and a base weight of2.0extractRegulatoryAction()to emit recent high/medium-tier signals from the regulatory payloadGlobal Marketsand compute severity as3.0 -> HIGHforhightier and2.0 -> MEDIUMformediumtests/cross-source-signals-regulatory.test.mjscovering source registration, extractor behavior, and composite escalation forpolicy + financial + economicValidation
node --test tests/cross-source-signals-regulatory.test.mjsRisk
Low risk. This is an additive signal source plus a focused unit test; existing extractors and severity logic stay unchanged.
Note
This branch is currently stacked on #2567, which itself depends on #2564. Until those PRs merge, this PR includes the parent commits in the diff.
Depends on #2567
Closes #2494
Refs #2495