Skip to content

feat(regulatory): seed-cross-source-signals.mjs — add REGULATORY_ACTION signal type #2494

@koala73

Description

@koala73

Context

Part of the Regulatory RSS pipeline. Depends on #2492 and #2493 (the seeder must be writing regulatory:actions:v1 before this is useful).

This is task 3/4.

What to change in scripts/seed-cross-source-signals.mjs

1. Add to SOURCE_KEYS array

'regulatory:actions:v1',

2. Add to TYPE_CATEGORY map

CROSS_SOURCE_SIGNAL_TYPE_REGULATORY_ACTION: 'policy',

3. Add to BASE_WEIGHT map

CROSS_SOURCE_SIGNAL_TYPE_REGULATORY_ACTION: 2.0,

4. Add extractor function

function extractRegulatoryAction(d) {
  const payload = d['regulatory:actions:v1'];
  if (!payload) return [];
  const cutoff = Date.now() - 48 * 3600 * 1000;
  const recent = (payload.actions || [])
    .filter(a => new Date(a.publishedAt).getTime() > cutoff && a.tier !== 'low');
  if (recent.length === 0) return [];
  return recent.slice(0, 3).map(a => {
    const tierMult = a.tier === 'high' ? 1.5 : 1.0;
    const score = BASE_WEIGHT['CROSS_SOURCE_SIGNAL_TYPE_REGULATORY_ACTION'] * tierMult;
    return {
      id: `regulatory:${a.id}`,
      type: 'CROSS_SOURCE_SIGNAL_TYPE_REGULATORY_ACTION',
      theater: 'Global Markets',
      summary: `${a.agency}: ${a.title}`,
      severity: scoreTier(score),
      severityScore: score,
      detectedAt: new Date(a.publishedAt).getTime(),
      contributingTypes: [],
      signalCount: 0,
    };
  });
}

5. Add to extractors[] array

extractRegulatoryAction,

Severity math

Tier Score scoreTier() result
high 2.0 × 1.5 = 3.0 HIGH
medium 2.0 × 1.0 = 2.0 MEDIUM
low filtered out not emitted

Composite escalation unlock

'policy' is a new category not currently in TYPE_CATEGORY. Adding it means REGULATORY_ACTION (policy) + VIX_SPIKE (financial) + COMMODITY_SHOCK (economic) = 3 distinct categories in Global MarketsdetectCompositeEscalation() fires. This compound scenario (regulatory action during market stress + commodity dislocation) was previously invisible.

Acceptance criteria

  • regulatory:actions:v1 appears in SOURCE_KEYS
  • extractRegulatoryAction added to extractor list
  • HIGH-tier actions produce severity HIGH signals
  • MEDIUM-tier actions produce severity MEDIUM signals
  • Missing key returns [] gracefully
  • Composite escalation fires in Global Markets when policy + financial + economic categories co-fire

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: AI/intelAI analysis, intelligence findings, summarizationarea: marketsMarkets, commodities, crypto, financeenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions