πŸŒ† Evening Analysis

July 23, 2026 Β· View on GitHub

Generates deep political intelligence analysis and renders the HTML article in all 14 supported languages for evening political intelligence aggregation (Tier-C aggregation β€” reads sibling analyses across the reporting window and applies period multipliers from ext/tier-c-aggregation.md) in one single agentic run. The dedicated news-translate workflow runs on a separate track and translates executive-brief.md markdown into 13 language siblings (executive-brief_<lang>.md)

What this workflow does

  • Article type: evening-analysis
  • Analysis subfolder: analysis/daily/$ARTICLE_DATE/evening-analysis/
  • Aggregated markdown: analysis/daily/$ARTICLE_DATE/evening-analysis/article.md (produced by scripts/aggregate-analysis.ts)
  • Rendered HTML: news/$ARTICLE_DATE-evening-analysis-{en,sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh}.html β€” always all 14 languages (produced by scripts/render-articles.ts)
  • Single-run model: one run does download β†’ analysis Pass 1 + 2 β†’ gate β†’ aggregate β†’ render (14 languages) β†’ ONE PR. There is no separate "article run" and no inter-workflow dispatch. The news-translate workflow runs on a separate track and handles only executive-brief markdown translations (executive-brief_<lang>.md); it does not back-fill article.<lang>.md.

Time budget

🟑 Plan to call safeoutputs___create_pull_request by agent minute 42 (hard deadline 45) to reserve job-level headroom for setup variance and the safe-outputs runner. See 00-base-contract.md §Session timing and 07-commit-and-pr.md §Deadline enforcement.

AI-FIRST within the 60-minute budget: Pass 2 is still mandatory. Scheduled runs should honor the configured analysis_depth=deep default instead of pre-emptively downgrading scope. Prefer scope compression over iteration skipping only if runtime risk emerges β€” reduce the download/manifest scope if needed, but maintain 1:1 per-document coverage and always perform a full read-back-and-improve Pass 2 on whatever artifacts exist. Reserve comprehensive for manual workflow_dispatch backfills.

Single run (produces all 23 analysis artifacts + aggregated article.md + 14 HTML files, target ~42 agent minutes in a 60-min job):

MinutesPhaseModule
0–3MCP pre-warm + pre-flight check02 / 03
3–6Download data + catalogue03
6–18Analysis Pass 1 (methodology read + per-doc analyses + all 23 artifacts: Family A 9 + B 2 + C 5 + D 7)04
18–36Analysis Pass 2 (read-back + improvements on all 22 text files; extended slot reclaims the 8 min freed by removing per-language Markdown translation β€” see TRANSLATION_GUIDE.md Β§News articles are translated out-of-band)04
36–38Analysis Gate (checks 1–11 + post-aggregate Check 12 below)05
38–40scripts/aggregate-analysis.ts β†’ article.md, then scripts/validate-article.ts (post-aggregate Check 12: banned phrases, citation density, economicProvenance ≀ 6 mo)06
40–42scripts/render-articles.ts --lang all β†’ all 14 HTML files06
42–43Stage analysis + article.md + news/*.html, commit, ONE safeoutputs___create_pull_request β€” HARD DEADLINE agent minute 4507

Use the full budget for AI-FIRST iteration (see .github/copilot-instructions.md Β§AI FIRST Quality Principle). One PR per run. If agent minute 42 arrives without staging, stop remaining work, run the aggregator + renderer on whatever artifacts exist, commit, and call safeoutputs___create_pull_request β€” a partial PR beats losing the run to Timer A. Translation under-coverage is acceptable: the renderer composes English article.md body with the localized executive-brief overlay.

Inputs

  • article_date β€” override date (defaults to today)
  • force_generation β€” regenerate even if today's content exists; also forces analysis re-run
  • analysis_depth β€” standard | deep (default) | comprehensive

Note: there is no languages input. Every run produces all 14 language HTML files. Translation depth-of-quality scales with the time budget (see the table above).

Run-mode selection

At the start of every run, the pre-flight check in 03-data-download.md detects whether analysis/daily/$ARTICLE_DATE/evening-analysis/ already contains all 23 required artifacts:

  • No analysis found β†’ run the full pipeline (download β†’ Pass 1 β†’ Pass 2 β†’ gate β†’ aggregate β†’ render β†’ PR).
  • Analysis found β†’ enter improvement-mode (see 04-analysis-pipeline.md Β§Improvement-mode path); extend existing artifacts, run Pass 2 + gate, then aggregate + render + PR.

Repeated runs for the same $ARTICLE_DATE always use the same analysis folder when force_generation=false.

File-write contract

πŸ›  Write every analysis artifact (analysis/daily/$DATE/$SUB/*.md, documents/*.md, JSON sidecars, methodology-reflection.md re-run deltas) with the edit tool. cat <<'QUOTED_EOF' > file is a Tier-2 fallback only β€” ASCII-only, no code fences / Mermaid / $ / backticks / EOF markers, < 200 lines, and only after edit has failed for a non-content reason. Banned for analysis/daily/** writes: python3, node -e, sed -i, echo … > file, tee file, unquoted heredocs (<<EOF) β€” sole exception: the pre-flight scaffold in 03-data-download.md (env-var refs and short literals only, no agent-generated content). The aggregator (scripts/aggregate-analysis.ts) and renderer (scripts/render-articles.ts) are the only writers for article.md and news/*.html. See 01-bash-and-shell-safety.md Β§File creation & overwrite strategy.

All other rules (bash format, AWF shell safety, MCP access, download pipeline, analysis methodology & gate, aggregate + render, commit & PR policy) live in the imported modules.