{
  "name": "Daily Situation Report",
  "nodes": [
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "prompt",
              "value": "# DEEP RESEARCH PROMPT — IRAN WAR SITUATION REPORT\n\n**Last used:** March 8, 2026 (Day 9 of Operation Epic Fury)\n**Next use:** TBD — rerun as needed for updated SITREP\n\n---\n\n## Task\n\nProduce a comprehensive, real-time situation report (SITREP) on the current state of the war involving Iran. This is a living conflict analysis — prioritize the most recent information available, working backward chronologically. Do not rely on stale summaries.\n\n## Source Hierarchy (strictly enforce this order)\n\n1. **Arabic, Farsi, and Hebrew-language outlets** — translate key passages directly (Al Mayadeen, Al Jazeera Arabic, Iran International Farsi edition, Mehr News Agency Farsi, IRNA Farsi, Tasnim News Farsi, Ynet Hebrew, Walla Hebrew, Channel 12/13 Hebrew feeds)\n2. **Independent investigative journalists and conflict monitors** (Bellingcat, OSINT community on X/formerly Twitter — track accounts like @Nrg_OSINTeam, @YLandes, @Conflicts, @IntelCrab, @GeoConfirmed)\n3. **Regional English-language outlets** (Al Jazeera English, Middle East Eye, The Cradle, Arab News, Times of Israel, Haaretz English)\n4. **International wire services** (Reuters, AP, AFP) — use for corroboration only\n5. **Western government and US DoD statements** — treat as last resort, cross-verify everything, assume strategic messaging and information warfare framing\n\n## Core Research Questions to Answer\n\n### 1. FORCE MOVEMENTS & DISPOSITION\n\n- What military forces (ground, air, naval, proxy) are currently moving in the region and in what direction?\n- Identify specific units, brigades, or named groups where possible\n- Where are Iranian IRGC forces and affiliated militias (Hezbollah, Houthis/Ansar Allah, Hashd al-Shaabi, PIJ) currently positioned vs. 30/60/90 days ago — what has shifted?\n- Are there any confirmed or strongly rumored Israeli, US, or Gulf state force repositioning events?\n- What does satellite/OSINT imagery show about base activity, vehicle convoys, or naval movements?\n\n### 2. DEGRADED & WEAKENED DEFENSES\n\n- Which Iranian air defense systems have been struck, degraded, or confirmed destroyed? Map this geographically if possible (S-300 batteries, Bavar-373, Raad systems — what is operational vs. destroyed?)\n- Which command and control nodes, radar installations, or early warning systems are confirmed offline?\n- What has the cumulative effect of Israeli strikes been on Iran's layered air defense — what corridors are now open?\n- Which Hezbollah military infrastructure in Lebanon/Syria remains vs. what was destroyed?\n- What is the current status of Iranian-linked supply corridors (the \"land bridge\" through Iraq/Syria)?\n\n### 3. STRATEGIC INTENT — INFERRED REASONING\n\n- Based on force movements and targeting patterns, what offensive or defensive operation appears to be in preparation?\n- Are there indicators of an imminent major strike (Israel → Iran, Iran → Israel, US → Iran, or proxy escalation)?\n- What do Iranian state media and IRGC-affiliated channels signal about their posture — defiant/deterrent, or indicating vulnerability/repositioning?\n- What is the Houthi strategic calculus right now — are Red Sea operations intensifying, de-escalating, or shifting target sets?\n- What back-channel diplomatic signals (if any) are being reported by regional outlets that Western media is downplaying?\n\n### 4. NUCLEAR DIMENSION\n\n- What is the latest on Iranian nuclear site status — any confirmed activity changes at Fordow, Natanz, Isfahan?\n- Are there any reports of hardening, evacuation, or dispersal of nuclear-related assets?\n- What do IAEA reports or leaks say vs. what Iranian state media claims?\n\n### 5. HUMANITARIAN & CIVILIAN SITUATION\n\n- What is the civilian displacement picture inside Iran, Lebanon, Gaza, and Yemen right now?\n- Are there reports of internal Iranian unrest, protests, or dissent related to the war?\n\n## Output Format\n\nStructure the report as a professional SITREP with these sections:\n\n1. **EXECUTIVE SUMMARY** (3–5 sentences: the single most important thing happening right now)\n2. **FORCE DISPOSITION MAP** (narrative description of where forces are and direction of movement)\n3. **DEGRADED CAPABILITIES ASSESSMENT** (what's been broken, where the holes are)\n4. **INFERRED OPERATIONAL INTENT** (your best analytical read on what comes next and why)\n5. **NUCLEAR WATCH** (brief)\n6. **WILDCARDS & UNKNOWNS** (what you couldn't confirm, what feels like it's being suppressed)\n7. **SOURCE LOG** (every claim attributed to a specific outlet with date/time where possible)\n\n## Critical Instructions\n\n- Flag any claim made only by US government or Israeli government sources without independent corroboration as **[UNVERIFIED — SINGLE OFFICIAL SOURCE]**\n- When translating from Arabic/Farsi/Hebrew, provide the original outlet name and note it was translated\n- Do not sanitize or hedge findings to appear neutral — give your sharpest analytical read\n- If something significant happened in the last 24–72 hours, lead with it regardless of source\n- Note any information blackouts or gaps that themselves may be analytically significant\n\n## User Preferences (from March 8 session)\n\n- **Time horizon:** Last 24–72 hours (breaking developments), with 30–90 day context as needed\n- **Output format:** Conversational response in chat\n- **Trigger:** No specific trigger — want full picture"
            }
          ]
        }
      },
      "name": "Set Prompt",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        250,
        100
      ]
    },
    {
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "jsonParameters": true,
        "options": {
          "bodyContent": {
            "model": "openrouter/nvidia/nemotron-3-super-120b-a12b:free",
            "messages": [
              {
                "role": "system",
                "content": "You are a deep‑research assistant. Produce a thorough, well-sourced report on the user's requested topic for today, preserving all sources and citations."
              },
              {
                "role": "user",
                "content": "{{ $json[\"prompt\"] }}"
              }
            ],
            "temperature": 0.2,
            "max_tokens": 8000
          }
        }
      },
      "name": "Deep Research Prompt",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        500,
        200
      ]
    },
    {
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "jsonParameters": true,
        "options": {
          "bodyContent": {
            "model": "deepseek/deepseek-r1:free",
            "messages": [
              {
                "role": "system",
                "content": "You are a wartime intelligence fact-checker. Your job is to catch a specific class of error: CONDITIONAL COLLAPSE — where a threat, prediction, or stated intention has been written up as though it already happened.\n\nYou will receive a RESEARCH REPORT and SOURCE SNIPPETS collected during the research phase.\n\nFor EVERY factual claim in the report, classify it as one of:\n\n1. CONFIRMED EVENT — The source snippets contain direct evidence this thing happened (a strike occurred, a person was killed, a statement was made, a ship transited). Leave unchanged.\n\n2. CONDITIONAL COLLAPSE — The report states something happened, but the source snippets only show it was threatened, planned, expected, or assessed as likely. This is the critical error. Prepend: **[⚠ CONDITIONAL COLLAPSE — sources show threat/plan only, not confirmed event]**\n\n3. FABRICATED ATTRIBUTION — The report cites a specific outlet (e.g., 'ISW-CTP threads, March 17') but the source snippets from that outlet do not contain the claimed information. Prepend: **[⚠ FABRICATED ATTRIBUTION — cited source does not contain this claim]**\n\n4. NO SOURCE — The claim is not supported by ANY of the supplied source snippets. Prepend: **[⚠ UNVERIFIED — NO SOURCE IN COLLECTED DATA]**\n\n5. SINGLE OFFICIAL SOURCE — The claim relies exclusively on a US government or Israeli government statement with no independent corroboration in the source snippets. Prepend: **[⚠ UNVERIFIED — SINGLE OFFICIAL SOURCE]**\n\nPay EXTREME attention to:\n- Claims about Houthi/Ansar Allah ACTIONS vs. THREATS. If sources say 'threatened to resume' or 'vowed to attack,' that is NOT the same as 'conducted attacks' or 'continued operations.'\n- Claims about diplomatic channels being 'active' vs. 'collapsed' or 'rejected.'\n- Claims about military systems being 'degraded' vs. 'destroyed' — the degree matters.\n- Casualty figures — flag if the report uses a number not found in any source snippet.\n- Any claim where the report converts future tense or conditional language from a source into past tense or present tense.\n\nReturn the COMPLETE report with tags inserted. Do not remove, reword, or summarize any content. Only add tags where warranted.",
              },
              {
                "role": "user",
                "content": "RESEARCH REPORT:\n{{ $node['Deep Research Prompt'].json.choices[0].message.content }}\n\nSOURCE SNIPPETS:\n{{ $node['Deep Research Prompt'].json.sources }}\n"
              }
            ],
            "temperature": 0.0,
            "max_tokens": 16000
          }
        }
      },
      "name": "Verify Report — Stage 1: Binary Event Check",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        750,
        200
      ]
    },
    {
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "jsonParameters": true,
        "options": {
          "bodyContent": {
            "model": "deepseek/deepseek-r1:free",
            "messages": [
              {
                "role": "system",
                "content": "You are an intelligence report completeness auditor.\n\nYou will receive a research report about the Iran war. Your job is to identify SIGNIFICANT DEVELOPMENTS that are MISSING from the report.\n\nCheck whether the report covers each of the following categories. For each category, state whether it is COVERED, PARTIALLY COVERED, or MISSING:\n\n1. Latest decapitation strikes / senior officials killed (last 48 hours)\n2. Lebanon ground invasion status and scope\n3. Houthi activation status — CRITICAL: confirm whether report accurately states they have or have NOT attacked. If the report claims Houthi kinetic action occurred, flag this for immediate review.\n4. Strait of Hormuz status — open, closed, contested? Allied response to reopening requests?\n5. Interceptor / missile defense supply status for Israel and coalition\n6. Nuclear dimension — enriched uranium stockpile, facility status, IAEA access\n7. Diplomatic channels — active or collapsed? Who is mediating?\n8. Domestic US political developments related to the war (resignations, congressional action, public opinion)\n9. Humanitarian situation — casualty figures, displacement, civilian infrastructure damage\n10. Information environment — internet blackout status, OSINT gaps, disinformation\n11. Oil prices and economic impact\n12. Russia/China posture\n\nFor any category marked MISSING, write a 1-2 sentence summary of what should be included based on your knowledge, and flag it as: **[GAP — MISSING FROM REPORT: {category}]**\n\nReturn your audit as a structured checklist, then append any gap flags at the end.",
              },
              {
                "role": "user",
                "content": "RESEARCH REPORT TO AUDIT:\n{{ $node['Verify Report — Stage 1: Binary Event Check'].json.choices[0].message.content }}\n"
              }
            ],
            "temperature": 0.0,
            "max_tokens": 4000
          }
        }
      },
      "name": "Verify Report — Stage 2: Absence Check",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1000,
        200
      ]
    },
    {
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "jsonParameters": true,
        "options": {
          "bodyContent": {
            "model": "openrouter/nvidia/nemotron-3-super-120b-a12b:free",
            "messages": [
              {
                "role": "system",
                "content": "You are a conflict analyst producing a daily website update for Resident Liberal.\n\nYou will receive a VERIFIED RESEARCH REPORT (with any [UNVERIFIED] or [CONDITIONAL COLLAPSE] tags preserved from the verification step) AND an ABSENCE AUDIT listing any gaps.\n\nYour job is to produce a JSON object that fills the daily entry template. You must:\n1. Distill each finding into 2-3 line summaries\n2. Preserve source attribution as favicon HTML (format below)\n3. DROP any claim tagged [CONDITIONAL COLLAPSE] or [FABRICATED ATTRIBUTION] — do NOT include these\n4. Keep claims tagged [UNVERIFIED — SINGLE OFFICIAL SOURCE] but preserve the flag as: <span class=\"sr-flag\">⚠ UNVERIFIED — SINGLE OFFICIAL SOURCE</span>\n5. Fill EVERY field in the JSON — no nulls, no empty strings\n6. Note any [GAP] items from the absence audit in the Wildcards section\n\nSource favicon format — use this EXACT HTML inline at the end of each text block:\n<a class=\"sr-src\" href=\"FULL_URL\" target=\"_blank\" title=\"OUTLET_NAME\"><img src=\"https://www.google.com/s2/favicons?sz=32&amp;domain=DOMAIN\" alt=\"SHORT\"></a>\n\nReturn ONLY valid JSON. No markdown fences. No commentary. No text before or after the JSON.\n\n{\n \"day_number\": \"19\",\n \"day_label\": \"DAY 19\",\n \"headline\": \"Day 19: [Short punchy headline. Period-separated phrases.]\",\n \"date_long\": \"18 March 2026\",\n \"substack_url\": \"https://mrkmza.substack.com/p/[slug-or-hash]\",\n \"exec_summary\": \"3-5 sentence executive summary with inline source favicons at end.\",\n \"section_blocks\": [\n {\n \"heading\": \"🎯 Section Heading\",\n \"blocks\": [\n \"<strong>Bold lead sentence.</strong> Supporting detail 2-3 lines with favicons at end. <a class=\\\"sr-src\\\" ...></a>\",\n \"<strong>Second finding.</strong> Detail with favicons. <a class=\\\"sr-src\\\" ...></a>\"\n ]\n }\n ],\n \"watch_content\": \"<strong>Bold opening.</strong> Key variables separated by middots.\",\n \"footer_sources\": \"Day 19 compiled from [outlet list].<br>\\n All capability assessments provisional. Compiled 2359 UTC, [date].\",\n \"prev_date\": \"17 March 2026\",\n \"prev_day_label\": \"Day 18\",\n \"prev_headline\": \"[Previous day headline copied exactly from current site]\",\n \"prev_exec_summary\": \"[Previous day exec summary copied exactly from current site]\",\n \"ticker\": [\n {\"label\": \"DAY\", \"value\": \"19\", \"class\": \"crisis\"},\n {\"label\": \"EXAMPLE\", \"value\": \"VALUE\", \"class\": \"crisis\"}\n ]\n}\n\nSection heading emoji conventions:\n🎯 decapitation/leadership · 🇮🇷 Iran regime · 🇱🇧 Lebanon · 🇾🇪 Houthis · 🇮🇶 Iraqi militias · 🏴 Gulf states · 🛡️ interceptors · 🚢 Hormuz/maritime · ☢️ nuclear\n\nCRITICAL: NEVER invent a source URL. NEVER convert conditional/threatened actions into confirmed events. If verification flagged it, drop it."
 },
 {
 "role": "user",
 "content": "VERIFIED REPORT:\n{{ $node['Verify Report — Stage 1: Binary Event Check'].json.choices[0].message.content }}\n\nABSENCE AUDIT:\n{{ $node['Verify Report — Stage 2: Absence Check'].json.choices[0].message.content }}"
 }
 ],
 "temperature": 0.1,
 "max_tokens": 8000
 }
 }
 },
 "name": "Distill to JSON",
 "type": "n8n-nodes-base.httpRequest",
 "typeVersion": 2,
 "position": [
        1250,
        200
      ]
    },
    {
      "parameters": {
        "command": "echo '{{ $node[\"Distill to JSON\"].json.choices[0].message.content }}' > /tmp/sitrep_llm_output.json"
      },
      "name": "Save JSON to Disk",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        1500,
        200
      ]
    },
    {
      "parameters": {
        "command": "python3 /home/adminmrk/htdocs/claw/uploads/gen/fill_template.py --template /home/adminmrk/htdocs/claw/uploads/gen/daily_entry_template.html --json /tmp/sitrep_llm_output.json --output /tmp/sitrep_filled_entry.html --ticker-output /tmp/sitrep_ticker.json"
      },
      "name": "Fill HTML Template",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        1750,
        200
      ]
    },
    {
      "parameters": {
        "command": "python3 /home/adminmrk/htdocs/claw/uploads/gen/insert_daily_entry.py --html /home/adminmrk/htdocs/claw/uploads/index2.html --filled /tmp/sitrep_filled_entry.html --ticker /tmp/sitrep_ticker.json --day $(( ($(date +%s) - $(date -d '2026-02-28' +%s)) / 86400 )) --output /home/adminmrk/htdocs/claw/uploads/index2.html"
      },
      "name": "Insert into Live HTML",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        2000,
        200
      ]
    },
    {
      "parameters": {
        "command": "FILE='/home/adminmrk/htdocs/claw/uploads/index2.html' && SIZE=$(stat -c%s \"$FILE\") && if [ \"$SIZE\" -lt 5000 ]; then echo \"FAIL: file only $SIZE bytes\" >&2; exit 1; fi && if ! grep -q 'Daily Situation Report' \"$FILE\"; then echo 'FAIL: missing report header' >&2; exit 1; fi && echo \"OK: $SIZE bytes, structure intact\""
      },
      "name": "Validate Output",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        2250,
        200
      ]
    }
  ],
  "connections": {
    "Set Prompt": {
      "main": [
        [
          {
            "node": "Deep Research Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deep Research Prompt": {
      "main": [
        [
          {
            "node": "Verify Report — Stage 1: Binary Event Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Report — Stage 1: Binary Event Check": {
      "main": [
        [
          {
            "node": "Verify Report — Stage 2: Absence Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Report — Stage 2: Absence Check": {
      "main": [
        [
          {
            "node": "Distill to JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Distill to JSON": {
      "main": [
        [
          {
            "node": "Save JSON to Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save JSON to Disk": {
      "main": [
        [
          {
            "node": "Fill HTML Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fill HTML Template": {
      "main": [
        [
          {
            "node": "Insert into Live HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert into Live HTML": {
      "main": [
        [
          {
            "node": "Validate Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "1"
}