Module 5 — General Government Policy, Tariffs and Trade Restrictions

Normative specification. Module 5 detects official US government policy events (tariffs, trade restrictions, export controls, spending, subsidies, tax, regulation, antitrust, government shutdown) and scores their direct effect on sectors, industries, sub-industries and named companies on a −2…+2 scale. It authenticates the source, fixes the legal stage and dates, maps exposure, checks the market reaction, computes confidence and risk, and emits affected-scope trading restrictions. It does not select a stock/ETF, generate an entry/stop/target/order, close a position, or score the broad market — those belong to the sibling specialist modules, Output 2, and the trading bot. Its broad-market directional contribution is always 0.

Implementation target (not yet built): routes/module5.pysnapshots/module5.json (+ a stateful event store .data/module5_events.db), surfaced in a "Module 5" navbar view. It is the general-policy counterpart to Module 4 (Trump/executive actions); Module 4 owns any Trump-specific event and Module 5 assigns it 0 and stops.

Implementation note (v1 ceilings). The Part 4 scoring is pure arithmetic, but its inputs (source authentication, stage classification, provision separation, entity/exposure mapping, dedup) require NLP the spec assumes upstream. The intended split is an LLM extraction pass (agents/skills/module5_extract.md) that fills the Part 2 structured record, then a deterministic scorer (Parts 4/9) that turns it into points and restrictions with zero model calls. See Section Two — Implementation options and concerns below; that boundary is the whole design. The controlling official-source feeds (Federal Register, Congress.gov, USITC, USTR/CBP, BIS, CBO/JCT, USAspending, RegInfo/OIRA, DOJ/FTC — Part 3.1) are not integrated today, so v1 caps confidence low until they exist. Cross-module handoffs (Part 10) are placeholders until sibling modules exist.


Section One — Deterministic specification

Part 1 — Master calculation dependency

1.1 Run Control and Data Validation

1.2 Policy Ownership and Duplicate Control

1.3 Policy Stage and Date Classification

1.4 Provision Separation and Exposure Mapping

1.5A Tariff and Trade-Restriction Impact Engine

1.5B Spending, Tax, Subsidy and Industrial-Policy Engine

1.5C Regulation and Antitrust Engine

1.5D Government Shutdown Risk Engine

1.6 Structural and Announcement Impact Engine

1.7 Market-Reaction Confirmation Engine

1.8 Confidence, Risk and Permission Engine

1.9 Sector, Industry and Company Aggregation

Part 2 — Direct input parameters

2.1 Run-Control

CALCULATION_TIMESTAMP_UTC (ISO 8601 UTC); CURRENT_TIME_ET (with DST); RUN_TYPE (SCHEDULED | EVENT_TRIGGERED | MANUAL | RECALCULATION); CALCULATION_VERSION; GLOBAL_DATA_STATUS_IN (VALID | DEGRADED | INVALID); NEW_ENTRY_STATUS_IN (ALLOWED | RESTRICTED | PAUSED); ACTIVE_RESTRICTION_LIST_IN.

2.2 Event Identity and Ownership

POLICY_EVENT_ID; LEGAL_INSTRUMENT_ID (bill no. / Federal Register doc no. / docket / proclamation / tariff action no.); PROVISION_ID; SOURCE_DOCUMENT_ID; EVENT_OWNER_MODULE; TRUMP_SPECIFIC_EVENT_FLAG; POLICY_CATEGORY (GENERAL_TARIFF | COUNTRY_TARIFF | EXPORT_CONTROL | TECHNOLOGY_RESTRICTION | STEEL_TARIFF | ALUMINIUM_TARIFF | AUTO_TARIFF | RETAIL_IMPORT_RESTRICTION | ENERGY_POLICY | ENVIRONMENTAL_POLICY | DEFENCE_SPENDING | INFRASTRUCTURE_SPENDING | TAX_POLICY | SUBSIDY | INDUSTRIAL_POLICY | FISCAL_LEGISLATION | REGULATION | ANTITRUST | GOVERNMENT_SHUTDOWN); EVENT_LABEL_LIST.

2.3 Authority and Source

ISSUING_AUTHORITY; ISSUING_AGENCY; JURISDICTION_LEVEL (US_FEDERAL | US_STATE | US_LOCAL | FOREIGN); OFFICIAL_SOURCE_TYPE; OFFICIAL_SOURCE_URL; OFFICIAL_SOURCE_PUBLICATION_TIMESTAMP; OFFICIAL_DOCUMENT_STATUS; SOURCE_REVISION_NUMBER; SUPERSEDED_DOCUMENT_ID.

2.4 Policy-Date (store each separately, UTC; display ET)

ANNOUNCEMENT_TIMESTAMP; PUBLICATION_TIMESTAMP; INTRODUCTION_DATE; COMMITTEE_APPROVAL_DATE; HOUSE_PASSAGE_DATE; SENATE_PASSAGE_DATE; SIGNING_DATE; LEGAL_EFFECTIVE_DATE; COMPLIANCE_DATE; FUNDING_APPROVAL_DATE; FUNDING_RELEASE_DATE; ENFORCEMENT_DATE; EXEMPTION_DATE; REVIEW_DATE; EXPIRY_DATE; SUNSET_DATE; DELAY_DATE; SUSPENSION_DATE; COURT_DECISION_DATE; REPEAL_DATE; CANCELLATION_DATE.

2.5 Geographic and Product

AFFECTED_COUNTRY_LIST; RETALIATING_COUNTRY_LIST; HTS_CODE_LIST; ECCN_LIST; PRODUCT_CATEGORY_LIST; FINISHED_GOOD_FLAG; PRODUCTION_INPUT_FLAG; FORMAL_EXCLUSION_LIST; FORMAL_EXEMPTION_LIST; QUOTA_LIST.

2.6 Tariff and Trade

EXISTING_TARIFF_RATE_PCT; ADDITIONAL_TARIFF_RATE_PCT; FINAL_TARIFF_RATE_PCT; AFFECTED_IMPORT_VALUE_USD; AFFECTED_EXPORT_VALUE_USD; US_CONSUMPTION_VALUE_USD; DOMESTIC_PRODUCTION_VALUE_USD; REPLACEMENT_CAPACITY_12M_PCT; RETALIATION_REVENUE_SHARE_PCT; TARIFFED_INPUT_COST_SHARE_PCT; REVENUE_EXPOSURE_PCT; COST_EXPOSURE_PCT; IMPORT_EXPOSURE_PCT; EXPORT_EXPOSURE_PCT; PRODUCTION_CAPACITY_EXPOSURE_PCT; CRITICAL_DEPENDENCY_FLAG.

2.7 Spending, Subsidy and Fiscal

ANNOUNCED_AMOUNT_USD; AUTHORISED_AMOUNT_USD; APPROPRIATED_AMOUNT_USD; ALLOCATED_AMOUNT_USD; OBLIGATED_AMOUNT_USD; ACTUAL_AWARD_AMOUNT_USD; FIRST_12_MONTH_AMOUNT_USD; SPENDING_CUT_AMOUNT_USD; PROGRAMME_RECIPIENT_LIST; ELIGIBILITY_RULE_PUBLISHED_FLAG; AUTHORISATION_STATUS; APPROPRIATION_STATUS; ALLOCATION_STATUS; OBLIGATION_STATUS.

2.8 Tax-Policy

OFFICIAL_TAX_ESTIMATE_USD; FIRST_12_MONTH_TAX_EFFECT_USD; INDUSTRY_AFTER_TAX_EARNINGS_CHANGE_USD; TAX_CREDIT_AMOUNT_USD; TAX_DEDUCTION_AMOUNT_USD; TAX_PROVISION_SCOPE (INDUSTRY_SPECIFIC | BROAD); TAX_EFFECTIVE_DATE.

2.9 Regulation

REGULATORY_IDENTIFICATION_NUMBER; RULE_STAGE; ANNUAL_COMPLIANCE_COST_USD; ANNUAL_COST_SAVING_USD; ANNUAL_DIRECT_BENEFIT_USD; OFFICIAL_ECONOMIC_ANALYSIS_AVAILABLE_FLAG; OPERATING_LICENCE_AFFECTED_FLAG; MARKET_ACCESS_AFFECTED_FLAG; OIRA_REVIEW_STATUS; OIRA_ECONOMICALLY_SIGNIFICANT_FLAG.

2.10 Antitrust

ANTITRUST_CASE_ID; ANTITRUST_ACTION_STAGE; TARGET_COMPANY_LIST; TARGET_COMPANY_TICKER_LIST; TARGET_COMPANY_MARKET_SHARE_PCT; TARGET_COMPANY_INDUSTRY_REVENUE_SHARE_PCT; INDUSTRY_WIDE_PRACTICE_FLAG; FINAL_JUDGMENT_FLAG; STRUCTURAL_REMEDY_FLAG; PROHIBITED_PRACTICE_FLAG; COMPETITOR_MARKET_ACCESS_GAIN_PCT.

2.11 Shutdown

FUNDING_EXPIRY_TIMESTAMP; SAME_FUNDING_TEXT_PASSED_HOUSE_FLAG; SAME_FUNDING_TEXT_PASSED_SENATE_FLAG; FUNDING_ENACTED_FLAG; SHUTDOWN_START_TIMESTAMP; SHUTDOWN_END_TIMESTAMP; AFFECTED_AGENCY_LIST; INDUSTRY_FEDERAL_REVENUE_SHARE_PCT; CRITICAL_GOVERNMENT_SERVICE_DEPENDENCY_FLAG.

2.12 Sector, Industry and Company

SECTOR_ID; INDUSTRY_ID; SUB_INDUSTRY_ID; BUSINESS_ACTIVITY_ID; COMPANY_NAME; COMPANY_TICKER; INDUSTRY_TRAILING_12M_REVENUE_USD; INDUSTRY_ANNUAL_OUTPUT_USD; INDUSTRY_TRAILING_12M_EARNINGS_USD; COMPANY_TRAILING_12M_REVENUE_USD; COMPANY_POLICY_EXPOSURE_USD; DIRECT_EXPOSURE_REASON; EXPOSURE_DATA_TIMESTAMP.

2.13 Market-Reaction

REACTION_INSTRUMENT_ID; REACTION_INSTRUMENT_REFERENCE_PRICE; REACTION_INSTRUMENT_END_PRICE; SPY_REFERENCE_PRICE; SPY_END_PRICE; EVENT_WINDOW_VOLUME; PRIOR_20_SESSION_MEDIAN_SAME_WINDOW_VOLUME; REGULAR_SESSION_OPEN_TIMESTAMP; REGULAR_SESSION_CLOSE_TIMESTAMP.

Part 3 — Data definitions and validation

3.1 Official source hierarchy (controlling authority per field)

3.2 Source priority (stop at first legally controlling valid source)

  1. Most recent controlling statute, final rule, court order or tariff schedule.
  2. Most recent official amendment, postponement, exemption or repeal.
  3. Official agency implementation document.
  4. Official agency announcement identifying the controlling document.
  5. News report — alert only. A later legally effective document supersedes an earlier conflicting one.

3.3 Critical fields (when applicable)

POLICY_EVENT_ID; EVENT_OWNER_MODULE; TRUMP_SPECIFIC_EVENT_FLAG; OFFICIAL_SOURCE_URL or official doc identifier; POLICY_STAGE; LEGAL_STATUS; AFFECTED_PRODUCT/INDUSTRY/COMPANY; ECONOMIC_IMPLEMENTATION_DATE (when active); exposure numerator; exposure denominator; direction of the direct effect. Missing a critical field prevents the affected directional calculation.

3.4 Maximum data age

3.5 Provider consistency

One controlling provider per field. Do not average conflicting legal statuses; do not combine two tariff classifications for one product; do not mix incompatible accounting periods; do not mix industry denominators from different taxonomies in one calc. A legal source and an economic-data source may differ (they control different fields).

3.6 Missing-data treatment

Do not estimate legal status; do not invent exposure %; do not carry forward a stale tariff rate; do not substitute a classification; do not infer effectiveness because a date passed; do not infer distribution because funding was authorised. Preserve unaffected valid outputs; assign 0 to the incomplete calc; set affected confidence INVALID when the missing field is critical; pause affected new entries when the gap could materially change trading risk.

3.7 Duplicate treatment

Same event = same legal instrument + provision + issuing authority + covered products/activity + effective action. Different news reports / different labels do not create different events. A later amendment replaces only the affected provision (no extra score for superseded wording).

Part 4 — Deterministic calculations

4.1 Module ownership (stop at first match)

  1. TRUMP_SPECIFIC_EVENT_FLAG TRUE → exclusion TRUE.
  2. EVENT_OWNER_MODULE == 4 → exclusion TRUE.
  3. If excluded: MODULE_5_EVENT_ACCEPTED = FALSE; MODULE_5_EVENT_POINT = 0; COMPANY_SPECIFIC_POLICY_RISK_ALERT = NOT_PRODUCED_BY_MODULE_5; stop.
  4. Else MODULE_5_EVENT_ACCEPTED = TRUE; continue. (Module 5 never uses Module 4's score.)

4.2 Geographic scope (in order)

  1. US federal action → include. 2. Foreign retaliation directly responding to a US policy → include. 3. Unrelated foreign action → exclude and hand off. 4. State/local → include only if national industry-revenue, national production-capacity or national sales exposure ≥ 10%; else 0.

4.3 Policy-stage decision order (stop at first match)

  1. REPEALED / CANCELLED / WITHDRAWN / BLOCKED / STAYED / INDEFINITELY_DELAYED.
  2. EFFECTIVE, FUNDED and ENFORCEABLE.
  3. SIGNED_LAW_AWAITING_IMPLEMENTATION / PASSED_BOTH_CHAMBERS / FINAL_RULE_AWAITING_EFFECTIVE_DATE.
  4. FORMAL_PROPOSED_RULE / FORMAL_TARIFF_PROPOSAL / COMMITTEE_APPROVED_BILL / PASSED_ONE_CHAMBER.
  5. OFFICIAL_STUDY / OFFICIAL_REVIEW / OFFICIAL_INVESTIGATION / REGULATORY_AGENDA_ITEM / INTRODUCED_BILL.
  6. UNVERIFIED_REPORT / LEAKED_DRAFT.

4.4 Stage-based point treatment

4.5 Trading-relevant date list

Every applicable: announcement, publication, vote, signing, court decision, effective, funding, compliance, enforcement, exemption, review, expiry, delay, suspension, repeal, cancellation.

4.6 Economic implementation date (by policy type)

4.7 Provision separation

One POLICY_EVENT_ID per law; one PROVISION_ID per separately-funded/legally-distinct provision; calculate each provision only for its actual recipients; never score the whole law again after its provisions; attach labels without extra points.

4.8 Impact channels

Distinct economic mechanisms only: revenue loss/gain; input-cost increase/reduction; import-sourcing restriction; export-market restriction; production-capacity effect; government-funding effect; tax effect; compliance-cost effect; market-access effect. Same exposure base + mechanism counted once. EVENT_GROUP_RAW_POINT = sum of distinct channel points, capped −2…+2.

4.9 Tariff / trade-restriction exposure

Use the measure connected to the mechanism (export restriction → export/foreign-revenue share; input tariff → tariffed input-cost share; import restriction → sourcing/import share; production restriction → production-capacity share; finished-product tariff → imported-sales / competitive-import share). Thresholds (unrounded): < 10% → 0; 10–<20% → 1; ≥ 20% → 2. Loss of a required licence / principal product / critical market / irreplaceable input → −2 regardless of %.

4.10 Domestic tariff-beneficiary (max +1, all must be TRUE)

Tariff directly covers competing imports; affected imports ≥ 20% of US consumption; domestic producers can replace ≥ 10% of affected import volume within 12 months; tariffed imported inputs < 10% of domestic producer costs; foreign revenue exposed to retaliation < 10%. Any FALSE/missing → 0. Tariff protection alone cannot produce +2.

4.11 Semiconductor / technology restriction

BIS + controlling legal docs; use directly affected revenue/shipments/licences/capacity/sales. < 10% → 0; 10–<20% → −1; ≥ 20% → −2. Loss of critical licence / principal-product prohibition → −2 and CRITICAL_DEPENDENCY_FLAG TRUE. A domestic competitor gets no positive point merely because a foreign rival is restricted — a positive point needs a separate measurable subsidy, procurement award or market-access benefit.

4.12 Steel / aluminium / auto / retail-import

Primary steel/aluminium producers → max +1 under domestic-beneficiary conditions. Downstream metal users → 10%/20% cost-exposure thresholds. Auto makers combine finished-vehicle import exposure + imported-component exposure + retaliatory foreign-revenue exposure. HQ location does not determine domestic-production status. Retail/apparel use total sourcing exposure across all affected countries: < 10% → 0; 10–<20% → −1; ≥ 20% → −2.

4.13 Spending / subsidy / regulatory amount

DIRECT_POLICY_AMOUNT_PCT = FIRST_12_MONTH_DIRECT_POLICY_AMOUNT / (INDUSTRY_TRAILING_12M_REVENUE or INDUSTRY_ANNUAL_OUTPUT) × 100. Use revenue for revenue effects, output for production; don't switch denominators mid-calc. < 1% → 0; 1–<5% → ±1; ≥ 5% → ±2.

4.14 Spending stage

Proposed → 0. Authorised not appropriated → 0. Appropriated not allocated → compute, move one level toward zero. Enacted+funded+directed to identifiable recipients → full. Actual obligations/awards → confirm implementation. Cuts/rescissions → same thresholds, negative. A company-specific contract → company alert but normally 0 industry points unless the programme benefits multiple participants or total value ≥ 1% of annual industry revenue.

4.15 Tax policy

INDUSTRY_AFTER_TAX_EARNINGS_IMPACT_PCT = FIRST_12_MONTH_AFTER_TAX_EARNINGS_CHANGE / INDUSTRY_TRAILING_12M_EARNINGS × 100. |impact| < 2% → 0; 2–<5% → ±1; ≥ 5% → ±2. If industry earnings ≤ 0 → invalid %, assign 0, TAX_IMPACT_DATA_STATUS = INVALID. Credits/deductions acting as subsidies use the 1%/5% revenue thresholds. Broad, non-allocable provisions → 0 Module-5 points; pass raw effect to the specialist module.

4.16 Subsidy / industrial policy (positive point needs ALL)

Eligibility rules published; funding legally authorised; funding appropriated; amount measurable; recipient industry identifiable; implementation period known. Any fail → 0. Removal of an existing subsidy/credit/preference → same thresholds, negative.

4.17 Regulation / deregulation

REGULATORY_COST_BENEFIT_PCT = annual direct industry cost/saving/benefit / industry annual revenue × 100. < 1% → 0; 1–<5% → ±1; ≥ 5% → ±2. Loss of a critical operating licence / legal market access → −2 regardless of %. OIRA classification changes monitoring priority only (no directional point). "Deregulation" earns a positive point only with a measurable saving/benefit.

4.18 Antitrust (in order)

  1. Rumoured/confidential investigation → sector 0, industry 0.
  2. Official investigation/complaint vs one company → sector 0, industry 0, produce company alert.
  3. Industry-wide complaint/action affecting ≥ 20% of industry revenue/market share → industry −1.
  4. Final judgment / effective structural remedy / industry-wide prohibition affecting ≥ 20% → industry −2.
  5. Merger approval/prohibition → normally 0 industry points.
  6. Competitor benefit → max +1, requires official remedy + measurable new market access.

4.19 Company-specific policy-risk alert

Create for any official negative Module-5 action on a named company (antitrust, fine/penalty, export restriction, import ban, sanctions, contract cancellation, subsidy/tax-benefit loss, regulatory restriction, environmental enforcement, product prohibition, merger challenge, market-access loss). Risk: < 10% & no critical dependency → LOW; 10–<20% → MODERATE; ≥ 20% → HIGH; critical licence/principal product/essential market/irreplaceable input → CRITICAL; exposure unavailable → UNDETERMINED, LOW confidence. The alert does not create an automatic trade.

4.20 Government-shutdown status

DAYS_TO_FUNDING_EXPIRY = FUNDING_EXPIRY_DATE − CURRENT_DATE (calendar days). In order: 1. Expired & replacement not enacted → ACTIVE_SHUTDOWN. 2. 0–2 days pre-expiry & same text not passed both chambers → HIGH. 3. 3–7 days & same text not passed both chambers → ELEVATED. 4. 8–14 days & funding not enacted → WATCH. 5. > 14 days → NORMAL.

4.21 Shutdown impact and restrictions

4.22 Formal delay, stay, reversal

Formal delay ≥ 7 days → suspend future structural impact until the new date. Court/agency stay → structural 0 while active. Partial exemption → recompute remaining covered exposure. Full repeal/cancellation → remove structural impact. Reversal overlay → max opposite magnitude 1. Appeal → does not restore structural impact unless the action stays legally operative during appeal.

4.23 Structural impact

STRUCTURAL_POLICY_IMPACT_POINT = full direct point only when the policy is legally effective, funded (where applicable), enforceable, exposure data valid, and not stayed/blocked/repealed/ excluded. Otherwise use the stage-adjusted point.

4.24 Announcement-overlay duration (completed US trading sessions)

Formal proposal → max 3. Bill passage / final rule → max 5. New effective action → max 5. Formal delay/exemption → max 2. Full cancellation → max 3.

4.25 Combined event impact

COMBINED_EVENT_IMPACT_POINT = STRUCTURAL_POLICY_IMPACT_POINT + ADJUSTED_ANNOUNCEMENT_OVERLAY_POINT, capped −2…+2. A temporary opposite reaction may reduce the announcement point toward zero; it may not reverse the structural point without an official reversal.

4.26 Market reaction — regular hours (≥ 60 regular-market minutes remain)

SECTOR_RETURN_PCT = sectorETF_end/ref − 1 ×100; SPY_RETURN_PCT = SPY_end/ref − 1 ×100; RELATIVE_RETURN_PCT = SECTOR − SPY. EVENT_WINDOW_RVOL = event-window volume / median same-clock volume over prior 20 completed regular sessions. Confirming: |rel return| ≥ 1.00% in predicted direction and RVOL ≥ 1.50. Opposite: |rel return| ≥ 1.00% against and RVOL ≥ 1.50. Else NEUTRAL_OR_UNCONFIRMED.

4.27 Market reaction — outside regular hours

When event is < 09:30 ET, > 16:00 ET, or < 60 regular minutes remain: measure the first 30 regular-market minutes after the next open and the next regular-session close. Confirming: first-30-min rel return ≥ 1.00% in predicted direction + first-30-min RVOL ≥ 1.50 + closing rel return stays in direction. Opposite = equivalent inverse. All else neutral/conflicting.

4.28 Market-reaction effect

Confirming → REACTION_CONFIDENCE_SCORE = 100, add no policy points. Neutral/unavailable/mixed → 50, no change. Opposite → 0, move announcement overlay one level toward zero, do not change the structural point. (Direct sector-performance scoring stays outside Module 5.)

4.29 Confidence

4.30 Policy-risk classification (in order)

  1. CRITICAL — critical licence/principal product/essential market/irreplaceable input lost, or active shutdown ≥ 15 days.
  2. HIGH — final negative impact −2, or shutdown HIGH, or company exposure ≥ 20%.
  3. MODERATE — final negative impact −1, or shutdown ELEVATED, or exposure 10–<20%.
  4. LOW — watch-only, or exposure < 10%.
  5. NONE — no valid negative event.

4.31 Unexpected effective-action restriction (all TRUE)

Unexpected action; becomes effective during regular hours; |combined impact| == 2; sector/industry identifiable. → Pause new entries in the affected group 60 min; request cancel of unfilled entry orders; require verification of final legal details; require one completed 30-min regular bar; existing positions unchanged. Outside regular hours → no new entry in the group before 10:00 ET next regular day.

4.32 Multiple-event aggregation

Dedupe before scoring; one legal action's product/country labels stay one event; separate independent legal actions may combine. Sum independent active points per sub-industry, cap −2…+2; aggregate into industry, cap −2…+2. If an industry has both signs of non-zero sub-industry points → INDUSTRY_MIXED_FLAG TRUE, preserve separate points. If a sector has both signs of non-zero industry points → SECTOR_MIXED_FLAG TRUE, FINAL_SECTOR_POINT = 0. Only-positive → sum capped +2; only-negative → sum capped −2. Equal positive and negative totals → 0, MIXED_POLICY_STATUS TRUE (not NEUTRAL).

Part 5 — Descriptive bands

Part 6 — Helper conditions

IS_MODULE_4_EVENT (Trump flag TRUE or owner==4); IS_DUPLICATE_EVENT; IS_OFFICIAL_POLICY; IS_ACTIVE_POLICY (effective+funded+enforceable+not stayed); IS_CRITICAL_DEPENDENCY_LOSS; IS_FORMAL_PROPOSAL; IS_ENACTED_NOT_ACTIVE; IS_DIRECTLY_EXPOSED (exposure ≥ 10% or critical); IS_INDUSTRY_WIDE_ANTITRUST (≥ 20% revenue/share); IS_CONFIRMING_REACTION; IS_OPPOSITE_REACTION; IS_UNEXPECTED_EFFECTIVE_SHOCK (|impact|==2); IS_MIXED_INDUSTRY; IS_MIXED_SECTOR; HAS_EXISTING_PAUSE (NEW_ENTRY_STATUS_IN==PAUSED); HAS_CRITICAL_DATA_FAILURE.

Part 7 — Regime / decision order (stop at first match)

  1. Trump-specific event excluded. 2. Duplicate excluded. 3. Critical data invalid. 4. Policy repealed/cancelled/withdrawn/stayed/blocked. 5. Critical company/industry dependency loss. 6. Active unexpected policy shock. 7. Active shutdown. 8. High shutdown risk. 9. Effective full policy impact. 10. Enacted/final awaiting implementation. 11. Formal proposal / partial progress. 12. Official watch-only. 13. No measurable effect. Broad-market directional score stays 0 in every case.

Part 8 — Short-term / event overlays

Part 9 — Score / impact calculation

Part 10 — Handoffs and double-counting controls

Part 11 — Hard overrides (priority order)

  1. Existing pause — if NEW_ENTRY_STATUS_IN==PAUSED, preserve; Module 5 may extend, not cancel.
  2. Critical data failure (missing/stale critical field; irreconcilable source conflict; missing affected group or direction) → affected point 0, confidence INVALID, contribution PAUSED/NEUTRAL by safety, affected new entries paused when risk indeterminable.
  3. Trump-specific exclusion → point 0, no company alert, no recalculation.
  4. Legal stay/block → structural 0; announcement overlay may remain for the accepted period; recalc immediately on legal-status change.
  5. Unexpected effective shock (|impact|==2) → pause affected group 60 min, request cancel of unfilled entries, require verified legal details + one completed 30-min bar.
  6. Government shutdown (HIGH/ACTIVE) → apply local size + overnight-entry restrictions; preserve any stricter existing restriction. No hard override auto-closes/reverses a position, changes a price-based stop, or cancels another module's pause.

Part 12 — Execution order

1 read run-control → 2 preserve inherited pauses → 3 validate sources+economic data → 4 stop affected calcs on invalid critical data → 5 assign ownership → 6 exclude Module 4 → 7 remove duplicates → 8 separate provisions → 9 store trading-relevant dates → 10 stage+legal status → 11 economic implementation date → 12 map sectors/industries/sub-industries/companies → 13 tariff/trade exposure → 14 spending/subsidy/industrial → 15 tax → 16 regulation/antitrust → 17 shutdown risk → 18 raw points → 19 stage treatment → 20 structural impact → 21 announcement overlay → 22 market-reaction confirmation → 23 announcement reduction on conflict → 24 confidence → 25 policy risk → 26 sector restrictions → 27 company alerts → 28 aggregate sub-industry/industry → 29 mark mixed → 30 cap all −2…+2 → 31 broad-market contribution 0 → 32 handoff packets → 33 Output 1 → 34 final trade decision NOT_PRODUCED → 35 trade approved FALSE → 36 order generated FALSE.

Part 13 — Non-calculative constraints

Module 5 must not: select a stock; generate a long/short entry; place, close, reduce or reverse a position; change a price-based stop; set a stock target; decide final sector selection or portfolio size; cancel another module's pause; score inflation/growth/yields/commodities; count a Trump-specific action; count one policy twice via multiple labels; treat a media statement as proof of help/harm; treat an announcement as proof a policy is economically active.

Part 14 — Required Module 5 Output 1

Structured output with: identification (module no/name, version, UTC+ET timestamps, run type); event identification (IDs, category, labels, authority, jurisdiction, owner, exclusion/duplicate flags); source & reliability (source type/doc id/timestamp, DATA_STATUS, age, missing/stale/ conflict lists, failure reason, partial status); status & dates (stage, legal status, all key timestamps, court-stay/delay/repeal status, trading-relevant date list); coverage & exposure (countries, products, HTS/ECCN, sector/industry/sub-industry/business-activity/company lists + tickers, DIRECT_EXPOSURE_PCT + reason, critical-dependency flag); amounts (tariff rates, import/ export values, first-12-month spending/subsidy/tax/compliance, actual obligated/award); calculation outputs (raw channels, raw/stage-adjusted/structural/announcement/adjusted-announcement/combined points, relative return, RVOL, reaction status, the four sub-scores, confidence %); final market-group results (groups helped/harmed, final sector/industry/sub-industry/business-activity impact lists, mixed flags, MIXED_POLICY_STATUS, broad-market point = 0); company alerts (per company: name, ticker, action, activity, exposure %, risk, confidence, start, expected duration, industry-wide flag); risk & permission (policy risk, shutdown status/duration, hard-risk warning, new-entry status, restriction scope, max local size multiplier, leveraged-overnight status, unfilled- order action, restriction start/end, resumption condition, inherited-pause status); handoffs (per destination: raw/calculated/not-scored fields, status, missing fields, double-counting control, handed-off directional points = 0); trading-bot status (final trade decision NOT_PRODUCED_BY_MODULE_5, trade approved FALSE, order generated FALSE, stock selected FALSE, final sector selected FALSE, ready- for-Output-2 TRUE only when valid); audit (formula/threshold/source lists, excluded/superseded/ duplicate lists, revision + restriction history, next recalculation time).

Part 15 — Items not fully defined in the source (carry as named ceilings)

  1. Canonical sector/sub-industry taxonomy — not named. No valid mapping → output UNMAPPED, 0 broad-group points, preserve the raw event. (NOT DEFINED.)
  2. Approved market-reaction ETF map — not assigned per sub-industry. Missing instrument → market reaction UNAVAILABLE, reaction score 50, don't change points. (NOT DEFINED.)
  3. Overnight monitoring interval (20:00–07:00 ET) — not accepted. Use event-driven official-feed ingestion where available; else begin mandatory polling at 07:00 ET, treat overnight events as new premarket events. (NOT DEFINED.)
  4. Exact shutdown confidence reduction for ELEVATED/HIGH/ACTIVE — not supplied. Report shutdown confidence effect separately; enforce risk/permission rules; do not alter numerical policy confidence. (NOT DEFINED.)
  5. Company-alert duration — no fixed maximum. Keep the alert active until officially resolved/ expired/repealed/stayed or shown no longer to affect the company. (PROPOSED DETERMINISTIC RESOLUTION.)

Section Two — Implementation options and concerns

(This section is Beyond Markets engineering analysis, not part of the normative spec.)

How it relates to our system

Module 5 is a component of a different kind of system than the current Beyond Markets report pipeline: a deterministic, multi-module auto-trading engine (Module 4 = Trump events; siblings for inflation/growth/consumer/yield/energy/geopolitical/company-risk; an "Output 2" aggregator; a downstream trading bot that actually places orders). Overlap and gaps:

Module 5 concept Beyond Markets today Fit
Method: deterministic rules, fixed thresholds 11 LLM agents, prose reports opposite paradigm
Output: −2…+2 points + handoff packets Human-read markdown per request no scoring layer
Consumer: automated trading bot Swing pipeline (trade_db → Alpaca bracket) adjacent, not wired
Trading restrictions (PAUSED, size mult, shock pause) _position_cap, get_active_symbols, propose loop our gating is caps/dedup, not policy-driven
Market-reaction confirmation (sector ETF vs SPY, RVOL) Polygon aggregates exist; no engine buildable from current tools
Macro/policy backdrop snapshots/dashboard.md regime + geopolitical_risk agent same domain, softer form

It is the deterministic sibling of what the geopolitical_risk + macro_outlook/ market_brief reports do qualitatively today.

Deterministic vs LLM — the decision

The module does two different jobs, split exactly at the Part-2 parameter boundary:

Hard rule: a model must never emit the final score. The deterministic back-end exists so that a ±2 that pauses live trading is: - reproducible — same event → same score → unit-testable, diffable across revisions; - safe where the spec forbids inference — "don't infer effective because the date passed", "don't estimate missing legal status" are exactly where an LLM hallucinates; - cheap on the hot path — 2-minute freshness during market hours means constant re-scoring; deterministic is instant/free, LLM is slow and expensive per tick.

Making the whole module non-deterministic is more prompt work and a worse result, so it is not even the lazy option. This mirrors Module 4's own note: pure-arithmetic scoring behind an agents/skills/module4_extract.md NLP pass.

Primary concern — the data-source gap

Module 5's entire premise is authoritative official sources, and we integrate almost none: - Have: SEC EDGAR (get_sec_submissions), FRED, FMP, Polygon/Massive, Alpaca, news feeds. - Missing (every controlling source in Part 3.1): Federal Register, Congress.gov, USITC DataWeb, USTR/CBP, BIS Entity List, CBO/JCT, USAspending, RegInfo/OIRA, DOJ/FTC.

So even a perfect deterministic core can't run — there's no ingestion for the legal instruments it validates against. That is ~9 new government-API integrations, a large surface separate from the market-data vendor work. Until it exists, v1 caps OFFICIAL_SOURCE_SCORE / IMPLEMENTATION_CERTAINTY low and most events stay WATCH/INVALID.

Other concerns

Two build paths

Recommendation: LLM extraction → deterministic scoring (Path A now, Path B if/when the auto-trader and gov-source feeds are built). Start with the market-reaction slice + a chosen taxonomy/ETF map; keep every Part 15 item and every gov-source dependency as named ceilings.