diff --git a/.github/prompts/00-base-contract.md b/.github/prompts/00-base-contract.md index fe5e02ead9..89dc08c243 100644 --- a/.github/prompts/00-base-contract.md +++ b/.github/prompts/00-base-contract.md @@ -32,7 +32,8 @@ Before producing any analysis or article content, the agent MUST have read: 1. This module (`00-base-contract.md`) and every imported sibling module for the workflow. 2. [`analysis/methodologies/ai-driven-analysis-guide.md`](../../analysis/methodologies/ai-driven-analysis-guide.md) — DIW weighting, tier depths, Pass 1 / Pass 2 rules. -3. Every template file referenced by `04-analysis-pipeline.md` (the 9 core artifacts) — and for Tier-C workflows, the additional 5 templates referenced by `ext/tier-c-aggregation.md` (executive brief, scenario analysis, comparative international, methodology reflection, per-run README). +3. [`analysis/methodologies/osint-tradecraft-standards.md`](../../analysis/methodologies/osint-tradecraft-standards.md) — **tradecraft canon**: ICD 203 (9 standards), Admiralty Code (`[A-F][1-6]` → 5-level confidence), WEP / Kent Scale (7 bands with EN + SV phrasing, 4 horizons), SAT catalog (≥ 10 techniques attested in `methodology-reflection.md`), OSINT ethics (GDPR Art. 9 / Offentlighetsprincipen), DIW–Admiralty reconciliation, PIR handoff (standing PIR-1…7 + Tier-C continuity contract). Every evidence citation, every confidence marker, and every `methodology-reflection.md §ICD 203 audit` derives from this document. +4. Every template file referenced by `04-analysis-pipeline.md` — the **23 always-on artifacts** spanning Family A (Core Synthesis, 9 files incl. `executive-brief.md`), Family B (Structural Metadata, 2 files), Family C (Strategic Extensions — F3EAD Exploit→Analyze, 5 files incl. `methodology-reflection.md` ⭐), Family D (Electoral & Domain Lenses — F3EAD Analyze-continued, 7 files), plus Family E (per-document `{dok_id}-analysis.md`). Tier-C workflows additionally apply the period-scope multipliers and cross-type synthesis rules in `ext/tier-c-aggregation.md` — they do **not** add new files (all 23 are mandatory for every workflow). No article sentence may be drafted until every required analysis artifact exists on disk and the gate in `05-analysis-gate.md` reports pass. @@ -47,7 +48,7 @@ Analysis Pass 1 → Pass 1 snapshot → Analysis Pass 2 → Analysis Gate → Stage analysis → Commit → ONE create_pull_request (analysis-only) ``` -**Run 2 — Articles** (when `$ANALYSIS_DIR` already contains all 9 core artifacts): +**Run 2 — Articles** (when `$ANALYSIS_DIR` already contains all 23 required artifacts and the gate in `05-analysis-gate.md` passes): ``` MCP pre-warm → Detect existing analysis → Read all artifacts into context → Optionally check for new data → Article Pass 1 → Article Pass 2 → diff --git a/.github/prompts/03-data-download.md b/.github/prompts/03-data-download.md index 5b1d06fd5b..a239aa0539 100644 --- a/.github/prompts/03-data-download.md +++ b/.github/prompts/03-data-download.md @@ -7,20 +7,25 @@ Run this check as the **first action** after MCP pre-warm, before any download: ```bash ANALYSIS_DIR="analysis/daily/$ARTICLE_DATE/$SUBFOLDER" -# 9 core artifacts required by every workflow -REQ=(synthesis-summary.md swot-analysis.md risk-assessment.md threat-analysis.md \ - stakeholder-perspectives.md significance-scoring.md classification-results.md \ - cross-reference-map.md data-download-manifest.md) - -# Tier-C workflows require 5 additional artifacts (evening-analysis, week-ahead, -# month-ahead, weekly-review, monthly-review, realtime-*, deep-inspection). -# See ext/tier-c-aggregation.md for the full list. -case "$SUBFOLDER" in - evening-analysis|week-ahead|month-ahead|weekly-review|monthly-review|deep-inspection|realtime-*) - REQ+=(README.md executive-brief.md scenario-analysis.md \ - comparative-international.md methodology-reflection.md) - ;; -esac +# 23 required artifacts (Families A+B+C+D) — every workflow, every run +REQ=( + # Family A — Core Synthesis (9) + README.md executive-brief.md synthesis-summary.md significance-scoring.md \ + classification-results.md swot-analysis.md risk-assessment.md \ + threat-analysis.md stakeholder-perspectives.md \ + # Family B — Structural Metadata (2) + data-download-manifest.md cross-reference-map.md \ + # Family C — Strategic Extensions (5) + scenario-analysis.md comparative-international.md devils-advocate.md \ + intelligence-assessment.md methodology-reflection.md \ + # Family D — Electoral & Domain Lenses (7) + election-2026-analysis.md voter-segmentation.md coalition-mathematics.md \ + historical-parallels.md media-framing-analysis.md \ + implementation-feasibility.md forward-indicators.md) + +# Tier-C workflows add no new files — all 23 are already mandatory. What Tier-C +# adds is the cross-type synthesis + period multipliers enforced by +# ext/tier-c-aggregation.md and the gate in 05-analysis-gate.md. SKIP_ANALYSIS=false ALL_PRESENT=true diff --git a/.github/prompts/04-analysis-pipeline.md b/.github/prompts/04-analysis-pipeline.md index f756aae8b9..9511c63c58 100644 --- a/.github/prompts/04-analysis-pipeline.md +++ b/.github/prompts/04-analysis-pipeline.md @@ -4,71 +4,110 @@ Analysis is the **primary product**. Articles are derived from analysis. Never w Authoritative methodology & templates: -- Methodology → [`analysis/methodologies/ai-driven-analysis-guide.md`](../../analysis/methodologies/ai-driven-analysis-guide.md) (DIW weighting, tier depths, Pass 1/Pass 2 rules) -- Supporting frameworks → [`political-classification-guide.md`](../../analysis/methodologies/political-classification-guide.md), [`political-swot-framework.md`](../../analysis/methodologies/political-swot-framework.md), [`political-risk-methodology.md`](../../analysis/methodologies/political-risk-methodology.md), [`political-threat-framework.md`](../../analysis/methodologies/political-threat-framework.md), [`political-style-guide.md`](../../analysis/methodologies/political-style-guide.md) -- Templates → [`analysis/templates/*.md`](../../analysis/templates/) (one file per artifact) +- Methodology → [`analysis/methodologies/ai-driven-analysis-guide.md`](../../analysis/methodologies/ai-driven-analysis-guide.md) (DIW weighting, tier depths, Pass 1/Pass 2 rules, F3EAD mapping) +- Supporting frameworks → [`political-classification-guide.md`](../../analysis/methodologies/political-classification-guide.md), [`political-swot-framework.md`](../../analysis/methodologies/political-swot-framework.md), [`political-risk-methodology.md`](../../analysis/methodologies/political-risk-methodology.md), [`political-threat-framework.md`](../../analysis/methodologies/political-threat-framework.md), [`synthesis-methodology.md`](../../analysis/methodologies/synthesis-methodology.md), [`strategic-extensions-methodology.md`](../../analysis/methodologies/strategic-extensions-methodology.md), [`electoral-domain-methodology.md`](../../analysis/methodologies/electoral-domain-methodology.md), [`structural-metadata-methodology.md`](../../analysis/methodologies/structural-metadata-methodology.md), [`per-document-methodology.md`](../../analysis/methodologies/per-document-methodology.md), [`political-style-guide.md`](../../analysis/methodologies/political-style-guide.md), [`osint-tradecraft-standards.md`](../../analysis/methodologies/osint-tradecraft-standards.md) — **tradecraft canon: ICD 203 + Admiralty + WEP + SAT catalog + OSINT ethics + DIW alignment + PIR handoff** +- Templates → [`analysis/templates/*.md`](../../analysis/templates/) (one file per artifact — 23 always-on + per-document) ## Role boundary | Scripts do | AI does | |------------|---------| -| Download data, catalogue documents, create file scaffolds | Every analytical judgement: SWOT, risks, threats, stakeholder mapping, significance weighting, classification, cross-references | +| Download data, catalogue documents, create file scaffolds | Every analytical judgement: SWOT, risks, threats, stakeholder mapping, significance weighting, classification, cross-references, scenarios, coalition math, historical parallels, media framing, forward indicators, methodology reflection | Scripts never generate analysis prose. Any `AI_MUST_REPLACE` marker left in a committed file fails the gate. -## 9 required core artifacts +## 23 required artifacts (every workflow, every run) -Produced in `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`: +Produced in `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`. The output set is **stable** — morning, evening, realtime, weekly, monthly and aggregation workflows all produce the same 23 files; only per-item **depth** adapts (see §Depth calibration). This matches [`ai-driven-analysis-guide.md` §Step 4 / §Step 5 / §Output Matrix](../../analysis/methodologies/ai-driven-analysis-guide.md#step-4--core-synthesis-f3ead-exploit--analyze). -| File | Source template | Minimum body | -|------|-----------------|--------------| -| `synthesis-summary.md` | `synthesis-summary.md` | Lead story decision, DIW-weighted ranking, ≥ 1 Mermaid diagram | -| `swot-analysis.md` | `swot-analysis.md` | S/W/O/T quadrants with evidence tables citing `dok_id` + TOWS matrix | -| `risk-assessment.md` | `risk-assessment.md` | Top 5 risks, likelihood × impact, posterior probabilities | -| `threat-analysis.md` | `threat-analysis.md` | Attack tree, kill chain, MITRE-style TTP mapping | -| `stakeholder-perspectives.md` | `stakeholder-impact.md` | Named actors, influence network, briefing cards per stakeholder | -| `significance-scoring.md` | `significance-scoring.md` | DIW scores per document, sensitivity analysis | -| `classification-results.md` | `political-classification.md` | Priority tiers, retention, access | -| `cross-reference-map.md` | (link to prior-run forward chain) | Continuity contracts with prior analyses | -| `data-download-manifest.md` | produced in step 03 | Already exists from data-download step | +### Family A — Core Synthesis (9 files · F3EAD: EXPLOIT → ANALYZE) -Plus `documents/` subfolder with **one `{dok_id}-analysis.md` file per `dok_id`** using [`per-file-political-intelligence.md`](../../analysis/templates/per-file-political-intelligence.md). +| # | File | Source template | Minimum body | +|:-:|------|-----------------|--------------| +| 1 | `README.md` | [`templates/README.md`](../../analysis/templates/README.md) § Folder README | Per-folder index linking every other file, generation date, run mode | +| 2 | `executive-brief.md` | [`executive-brief.md`](../../analysis/templates/executive-brief.md) | BLUF (2–4 sentences), ≥ 3 decisions supported, 60-second read bullets, top forward trigger, confidence label, ≥ 1 Mermaid | +| 3 | `synthesis-summary.md` | [`synthesis-summary.md`](../../analysis/templates/synthesis-summary.md) | Lead-story decision, DIW-weighted ranking, integrated intelligence picture, ≥ 1 Mermaid | +| 4 | `significance-scoring.md` | [`significance-scoring.md`](../../analysis/templates/significance-scoring.md) | DIW scores per document, sensitivity analysis, Mermaid rank diagram | +| 5 | `classification-results.md` | [`political-classification.md`](../../analysis/templates/political-classification.md) | 7-dimension classification per document, priority tiers, retention, access | +| 6 | `swot-analysis.md` | [`swot-analysis.md`](../../analysis/templates/swot-analysis.md) | S/W/O/T with evidence rows citing `dok_id` + TOWS matrix + cross-SWOT | +| 7 | `risk-assessment.md` | [`risk-assessment.md`](../../analysis/templates/risk-assessment.md) | 5-dimension register, L × I scores, cascading chains, posterior probabilities | +| 8 | `threat-analysis.md` | [`threat-analysis.md`](../../analysis/templates/threat-analysis.md) | Political Threat Taxonomy, attack tree, kill chain, MITRE-style TTP mapping | +| 9 | `stakeholder-perspectives.md` | [`stakeholder-impact.md`](../../analysis/templates/stakeholder-impact.md) | 6-lens stakeholder matrix, named actors, influence network | + +### Family B — Structural Metadata (2 files) + +| # | File | Source template | Minimum body | +|:-:|------|-----------------|--------------| +| 10 | `data-download-manifest.md` | [`data-download-manifest.md`](../../analysis/templates/data-download-manifest.md) | Every `dok_id` with source URL, retrieval time, data-depth tag (produced in module 03) | +| 11 | `cross-reference-map.md` | [`cross-reference-map.md`](../../analysis/templates/cross-reference-map.md) | Policy clusters, legislative chains, coordinated-activity patterns, sibling-folder citations (Tier-C) | + +### Family C — Strategic Extensions (5 files · F3EAD: ANALYZE continued) + +| # | File | Source template | Minimum body | +|:-:|------|-----------------|--------------| +| 12 | `scenario-analysis.md` | [`scenario-analysis.md`](../../analysis/templates/scenario-analysis.md) | ≥ 3 distinct scenarios + probabilities summing 100%, leading indicator per scenario | +| 13 | `comparative-international.md` | [`comparative-international.md`](../../analysis/templates/comparative-international.md) | ≥ 2 comparator jurisdictions (Nordic + EU minimum) with Outside-In analysis | +| 14 | `devils-advocate.md` | [`devils-advocate.md`](../../analysis/templates/devils-advocate.md) | ≥ 3 competing hypotheses via ACH matrix, Red-Team challenge, rejected alternatives logged | +| 15 | `intelligence-assessment.md` | [`intelligence-assessment.md`](../../analysis/templates/intelligence-assessment.md) | 3–7 Key Judgments with confidence labels, PIRs for next cycle, Key Assumptions Check | +| 16 ⭐ | `methodology-reflection.md` | [`methodology-reflection.md`](../../analysis/templates/methodology-reflection.md) | **VITAL run-audit gate.** Evidence sufficiency, confidence distribution, source diversity, party-neutrality arithmetic, **ICD 203 compliance audit**, ≥ 3 concrete methodology improvements for next cycle | + +### Family D — Electoral & Domain Lenses (7 files) + +| # | File | Source template | Minimum body | +|:-:|------|-----------------|--------------| +| 17 | `election-2026-analysis.md` | [`election-2026-analysis.md`](../../analysis/templates/election-2026-analysis.md) | Seat-projection deltas, coalition viability (converts to post-2026 context file after the election) | +| 18 | `voter-segmentation.md` | [`voter-segmentation.md`](../../analysis/templates/voter-segmentation.md) | Demographic / regional / ideological segment impact, baseline positions on procedural days | +| 19 | `coalition-mathematics.md` | [`coalition-mathematics.md`](../../analysis/templates/coalition-mathematics.md) | Current seat map, pivotal-vote table, Sainte-Laguë scenarios | +| 20 | `historical-parallels.md` | [`historical-parallels.md`](../../analysis/templates/historical-parallels.md) | Named precedent(s) ≤ 40 years with similarity score (or "no-precedent" finding with reasoning) | +| 21 | `media-framing-analysis.md` | [`media-framing-analysis.md`](../../analysis/templates/media-framing-analysis.md) | Per-party + press-quadrant + platform framing; longitudinal frame record entry | +| 22 | `implementation-feasibility.md` | [`implementation-feasibility.md`](../../analysis/templates/implementation-feasibility.md) | Delivery-risk view (budget / IT / regulatory / workforce); backlog audit on no-bill days | +| 23 | `forward-indicators.md` | [`forward-indicators.md`](../../analysis/templates/forward-indicators.md) | ≥ 10 dated indicators across 4 horizons (72 h / week / month / election) | + +### Family E — Per-document files (N files) + +`documents/{dok_id}-analysis.md` — one per `dok_id` in `data-download-manifest.md`, using [`per-file-political-intelligence.md`](../../analysis/templates/per-file-political-intelligence.md) at the depth tier matching the document's DIW (L1 Surface / L2 Strategic / L2+ Priority / L3 Intelligence-grade). Cluster files (`{cluster}-cluster-analysis.md`) collapse related low-weight items. + +> **Filename variants** — canonical `stakeholder-perspectives.md` ← template `stakeholder-impact.md`; canonical `classification-results.md` ← template `political-classification.md`; `comparative-international.md` ↔ `international-comparative.md`; `historical-parallels.md` ↔ `historical-baseline.md`; `election-2026-analysis.md` ↔ `election-2026-implications.md`. See [`ai-driven-analysis-guide.md` §Filename variants](../../analysis/methodologies/ai-driven-analysis-guide.md#-filename-variants-all-map-to-one-template--one-methodology-section). ## Execution order > **Fast-path**: If `SKIP_ANALYSIS=true` (set by `03-data-download.md §Pre-flight`), skip all steps 1–5 below and proceed directly to `06-article-generation.md`. The full analysis already exists on disk from a prior run — do not re-run downloads, Pass 1, Pass 2, or the gate. -1. **Read all 6 methodologies first** (one tool call per file, do not skip). -2. **Read all 8 templates first.** -3. **Pass 1 — Create** all 9 artifacts + every per-document file. Minimum 15 minutes of real work. +1. **Read all relevant methodologies first** (the primary methodology guide plus every supporting framework listed above, including `osint-tradecraft-standards.md`; one tool call per file; skipping fails the gate via `methodology-reflection.md §evidence` audit). +2. **Read all 23 templates first** — at minimum open each Family A/B/C/D template before writing its artifact. +3. **Pass 1 — Create** all 23 always-on artifacts + every per-document file. Minimum 20 minutes of real work. 4. **Snapshot Pass-1** — copy every Pass-1 file into `$ANALYSIS_DIR/pass1/` before starting Pass 2: `mkdir -p "$ANALYSIS_DIR/pass1" && cp "$ANALYSIS_DIR"/*.md "$ANALYSIS_DIR/pass1/"`. The `pass1/` directory is the fallback evidence the gate uses when mtime windows are too tight. Do **not** stage `pass1/` in the PR (see `07-commit-and-pr.md`). -5. **Pass 2 — Improve**: read every Pass-1 file back in full and strengthen evidence, diagrams, cross-references, stakeholder coverage, uncertainty disclosure. Minimum 7 minutes. +5. **Pass 2 — Improve**: read every Pass-1 file back in full and strengthen evidence, diagrams, cross-references, stakeholder coverage, uncertainty disclosure, Admiralty annotations, WEP language, PIR/EEI tags. Minimum 10 minutes. -Pass 2 is mandatory. Completing earlier is a quality failure. +Pass 2 is mandatory. Completing earlier is a quality failure. `methodology-reflection.md` is the self-audit of Pass 2 — skipping it breaks the self-correction loop. ## Depth calibration +Depth adapts per item by DIW tier (L1 Surface / L2 Strategic / L2+ Priority / L3 Intelligence-grade per [§Output Matrix](../../analysis/methodologies/ai-driven-analysis-guide.md#-output-matrix--every-file-every-family)) — **all 23 files are produced regardless**. What changes is word-count and framework richness per item. + | `analysis_depth` input | Pass 1 floor | Pass 2 floor | Use | |-----------------------|--------------|--------------|-----| -| `standard` | 10 min | 5 min | Light day, single-type workflow | -| `deep` (default) | 15 min | 7 min | Standard news day | -| `comprehensive` | 20 min | 10 min | Tier-C aggregation, deep-inspection | +| `standard` | 15 min | 7 min | Light day, single-type workflow, most items at L1–L2 | +| `deep` (default) | 20 min | 10 min | Standard news day, L2–L2+ items present | +| `comprehensive` | 25 min | 12 min | Tier-C aggregation, deep-inspection, L3 items likely | + +Aggregation (Tier-C) workflows apply the period-scope multiplier from `ext/tier-c-aggregation.md` **on top of** these floors. ## Evidence standard -Every analytical claim must cite at least one of: a real `dok_id` (e.g. `H901FiU1`) resolvable via `get_dokument`; a named MP / minister / party with role; vote counts from `get_voteringar`; or a primary-source URL (riksdagen.se, regeringen.se, scb.se, worldbank.org, data.imf.org). Generic phrasing without evidence is a Pass-2 improvement target. Gate enforcement lives in `05-analysis-gate.md` check 4. +Every analytical claim must cite at least one of: a real `dok_id` (e.g. `H901FiU1`) resolvable via `get_dokument`; a named MP / minister / party with role; vote counts from `get_voteringar`; or a primary-source URL (riksdagen.se, regeringen.se, scb.se, worldbank.org, data.imf.org). Annotate each evidence row with an **Admiralty Code** `[A–F][1–6]`. Apply the **Source Diversity Rule** — P0/P1 claims require ≥ 3 independent sources; single-source claims must be flagged `[unconfirmed]` (Pass-2 improvement target). Generic phrasing without evidence is rejected at the gate (`05-analysis-gate.md` check 4 and its Family-C/D extensions). ## Economic context -When the article type touches fiscal / macro / labour topics, enrich analysis with committee-mapped indicators from [`analysis/worldbank/indicators-inventory.json`](../../analysis/worldbank/indicators-inventory.json). Chart.js specs live in the [Economic Data Contract](../aw/ECONOMIC_DATA_CONTRACT.md) — follow it exactly. Produce at least one economic chart data file (`economic-data.json`) per article that has an economic-context section. +When the article type touches fiscal / macro / labour topics, enrich analysis with committee-mapped indicators from [`analysis/worldbank/indicators-inventory.json`](../../analysis/worldbank/indicators-inventory.json) and IMF WEO projections via `scripts/imf-fetch.ts`. Chart.js specs live in the [Economic Data Contract](../aw/ECONOMIC_DATA_CONTRACT.md) — follow it exactly. Produce at least one economic chart data file (`economic-data.json`) per article that has an economic-context section. ## Visualisation data -For each article with charts, produce accompanying JSON under `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/` (e.g. `vote-distribution.json`, `swot-summary.json`, `risk-heatmap.json`) using the shapes defined in the templates. Scripts render the HTML containers; the AI writes the commentary paragraph adjoining each chart. +For each article with charts, produce accompanying JSON under `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/` (e.g. `vote-distribution.json`, `swot-summary.json`, `risk-heatmap.json`, `coalition-math.json`, `forward-indicators.json`) using the shapes defined in the templates. Scripts render the HTML containers; the AI writes the commentary paragraph adjoining each chart. ## Next step -Proceed to `05-analysis-gate.md`. Do not start article generation until the gate passes. +Proceed to `05-analysis-gate.md`. Do not start article generation until the gate passes against all 23 artifacts. After completing Pass 1 (before Pass 2), run the **phase checkpoint** from `00-base-contract.md` with label `phase-04-pass1`. After completing Pass 2 (before the gate), run it again with label `phase-04-pass2`. This guarantees both iterations survive even if the gate, article, or commit phase later fails. diff --git a/.github/prompts/05-analysis-gate.md b/.github/prompts/05-analysis-gate.md index de36ba5a2c..0e95793fa9 100644 --- a/.github/prompts/05-analysis-gate.md +++ b/.github/prompts/05-analysis-gate.md @@ -5,21 +5,34 @@ This is the **only** gate separating analysis from article generation. If it fai ## Inputs - `$ANALYSIS_DIR = analysis/daily/$ARTICLE_DATE/$SUBFOLDER` -- 9 required core artifacts (see `04-analysis-pipeline.md`). +- 23 required artifacts (Families A + B + C + D from `04-analysis-pipeline.md`) + per-document Family E. ## Checks (all must pass) -1. **Artifact existence** — every required file exists and is non-empty: - `synthesis-summary.md`, `swot-analysis.md`, `risk-assessment.md`, `threat-analysis.md`, `stakeholder-perspectives.md`, `significance-scoring.md`, `classification-results.md`, `cross-reference-map.md`, `data-download-manifest.md`. -2. **Per-document coverage** — `$ANALYSIS_DIR/documents/` contains one `.md` per `dok_id` listed in `data-download-manifest.md` (metadata-only documents are tagged, not skipped). +1. **Artifact existence** — every file in Families A, B, C, D is present and non-empty: + - **Family A (9)** — `README.md`, `executive-brief.md`, `synthesis-summary.md`, `significance-scoring.md`, `classification-results.md`, `swot-analysis.md`, `risk-assessment.md`, `threat-analysis.md`, `stakeholder-perspectives.md`. + - **Family B (2)** — `data-download-manifest.md`, `cross-reference-map.md`. + - **Family C (5)** — `scenario-analysis.md`, `comparative-international.md`, `devils-advocate.md`, `intelligence-assessment.md`, `methodology-reflection.md` ⭐. + - **Family D (7)** — `election-2026-analysis.md`, `voter-segmentation.md`, `coalition-mathematics.md`, `historical-parallels.md`, `media-framing-analysis.md`, `implementation-feasibility.md`, `forward-indicators.md`. +2. **Per-document coverage (Family E)** — `$ANALYSIS_DIR/documents/` contains one `.md` per `dok_id` listed in `data-download-manifest.md` (metadata-only documents are tagged, not skipped). 3. **No stubs** — zero occurrences of `AI_MUST_REPLACE`, `[REQUIRED]`, `TODO:`, or `Lorem ipsum` across all artifacts. -4. **Evidence citations** — `swot-analysis.md` and `significance-scoring.md` contain at least one piece of primary-source evidence per quadrant / ranked item. Accepted evidence patterns (matches the standard in `04-analysis-pipeline.md` §Evidence standard): a `dok_id` (e.g. `H901FiU1`, `HD01CU27`) **or** a primary-source URL host (`riksdagen.se`, `regeringen.se`, `scb.se`, `worldbank.org`, `data.imf.org`). Named-actor / vote-count evidence without one of the above still counts as a Pass-2 target for human review but is not machine-enforced here. Enforced against SWOT `### Strengths/Weaknesses/Opportunities/Threats` sections (bullets + table rows) and significance-scoring bullets **plus** ranking table rows and Mermaid node labels. -5. **Mermaid diagrams** — every daily synthesis file contains ≥ 1 Mermaid diagram with colour-coded `style` directives. -6. **Pass-2 done** — agent has read each core artifact back after creation and committed improvements. (Enforced by file mtime diff: final file mtime > creation time + 3 min, OR two git-history snapshots on disk.) +4. **Evidence citations** — `swot-analysis.md` and `significance-scoring.md` contain at least one piece of primary-source evidence per quadrant / ranked item. Accepted evidence patterns: a `dok_id` (e.g. `H901FiU1`, `HD01CU27`) **or** a primary-source URL host (`riksdagen.se`, `regeringen.se`, `scb.se`, `worldbank.org`, `data.imf.org`). Enforced against SWOT `### Strengths/Weaknesses/Opportunities/Threats` sections (bullets + table rows) and significance-scoring bullets **plus** ranking table rows and Mermaid node labels. +5. **Mermaid diagrams** — every Family A and Family D synthesis file contains ≥ 1 Mermaid diagram with colour-coded `style` directives (or `themeVariables` / `%%{init …}` block). +6. **Pass-2 done** — agent has read back each enforced Pass-2 artifact after creation and committed improvements: all Family A, B, C, and D artifacts except `data-download-manifest.md`. (Enforced by file mtime diff: final file mtime > creation time + 3 min, OR two git-history snapshots on disk.) +7. **Family C structure checks** (extension-quality gate): + - `executive-brief.md` contains a `## 🎯 BLUF` section **and** a `## 🧭 3 Decisions` (or `Decisions This Brief Supports`) section. + - `intelligence-assessment.md` declares **≥ 3 Key Judgments** (enforced structurally by `Key Judgment` / `KJ-*` header count ≥ 3) each carrying at least one confidence label (`VERY HIGH`, `HIGH`, `MEDIUM`, `LOW`, `VERY LOW`) — the confidence-label presence is audited by the implementation's `grep -cE '(VERY HIGH|HIGH|MEDIUM|LOW|VERY LOW)'` check on the same file — and the file references at least one PIR. + - `scenario-analysis.md` declares **≥ 3 distinct scenarios** (headers matching `Scenario` count ≥ 3). + - `comparative-international.md` declares a comparator set or **≥ 2 comparator rows** (structural check, see Tier-C gate). + - `devils-advocate.md` declares **≥ 3 competing hypotheses** (headers matching `Hypothesis`/`H1`/`H2`/`H3` count ≥ 3, ACH-style). + - `methodology-reflection.md` is non-empty and contains an **ICD 203 audit** marker or ≥ 3 named methodology improvements. +8. **Family D structure checks**: + - `forward-indicators.md` declares **≥ 10 dated indicators** (bullet or table rows matching a date pattern across the four horizon sections). + - `coalition-mathematics.md` contains a seat-count table (≥ 1 table row with `Ja`/`Nej`/`Avstår` or a party-to-seats mapping). ## Implementation -No dedicated validator script exists yet — implement the six checks as an inline bash gate. Full implementation (covers checks 1–6): +No dedicated validator script exists yet — implement the checks as an inline bash gate. Full implementation (covers checks 1–8): ``` set -Eeuo pipefail @@ -27,19 +40,28 @@ set -Eeuo pipefail : "${SUBFOLDER:?SUBFOLDER must be set}" ANALYSIS_DIR="analysis/daily/$ARTICLE_DATE/$SUBFOLDER" [ -d "$ANALYSIS_DIR" ] || { echo "❌ ANALYSIS_DIR does not exist: $ANALYSIS_DIR"; exit 1; } -REQ=(synthesis-summary.md swot-analysis.md risk-assessment.md threat-analysis.md \ - stakeholder-perspectives.md significance-scoring.md classification-results.md \ - cross-reference-map.md data-download-manifest.md) + +FAMILY_A=(README.md executive-brief.md synthesis-summary.md significance-scoring.md \ + classification-results.md swot-analysis.md risk-assessment.md \ + threat-analysis.md stakeholder-perspectives.md) +FAMILY_B=(data-download-manifest.md cross-reference-map.md) +FAMILY_C=(scenario-analysis.md comparative-international.md devils-advocate.md \ + intelligence-assessment.md methodology-reflection.md) +FAMILY_D=(election-2026-analysis.md voter-segmentation.md coalition-mathematics.md \ + historical-parallels.md media-framing-analysis.md \ + implementation-feasibility.md forward-indicators.md) +REQ=("${FAMILY_A[@]}" "${FAMILY_B[@]}" "${FAMILY_C[@]}" "${FAMILY_D[@]}") SYNTHESIS=(synthesis-summary.md swot-analysis.md risk-assessment.md threat-analysis.md \ stakeholder-perspectives.md significance-scoring.md classification-results.md \ - cross-reference-map.md) + cross-reference-map.md executive-brief.md election-2026-analysis.md \ + voter-segmentation.md coalition-mathematics.md historical-parallels.md \ + media-framing-analysis.md implementation-feasibility.md \ + forward-indicators.md) DOK_RE='[Hh][A-Za-z0-9]{3,}[0-9]+' -# Check 4 evidence pattern — accepts dok_id OR primary-source URL host -# (per 04-analysis-pipeline.md §Evidence standard). EVIDENCE_RE='[Hh][A-Za-z0-9]{3,}[0-9]+|riksdagen\.se|regeringen\.se|scb\.se|worldbank\.org|data\.imf\.org' FAIL=0 -# Check 1 — artifact existence +# Check 1 — artifact existence (all 23) for f in "${REQ[@]}"; do [ -s "$ANALYSIS_DIR/$f" ] || { echo "❌ missing/empty: $f"; FAIL=1; } done @@ -73,10 +95,9 @@ awk -v re="$EVIDENCE_RE" ' printf "❌ swot-analysis.md %s: bullet missing evidence (dok_id or primary-source URL): %s\n", sec, $0; bad=1; next } sec != "" && /^[[:space:]]*\|/ { - # skip table separator rows like |---|---| if ($0 ~ /^[[:space:]|:\-]+$/) next trow++ - if (trow == 1) next # header row + if (trow == 1) next if ($0 !~ re) { printf "❌ swot-analysis.md %s: table row missing evidence (dok_id or primary-source URL): %s\n", sec, $0; bad=1 } @@ -85,6 +106,7 @@ awk -v re="$EVIDENCE_RE" ' sec != "" && /^[[:space:]]*$/ { reset_table(); next } END { exit bad+0 } ' "$ANALYSIS_DIR/swot-analysis.md" || FAIL=1 + awk -v re="$EVIDENCE_RE" ' function reset_table() { trow=0 } /^```mermaid[[:space:]]*$/ { in_mermaid=1; reset_table(); next } @@ -93,10 +115,9 @@ awk -v re="$EVIDENCE_RE" ' printf "❌ significance-scoring.md ranked item missing evidence (dok_id or primary-source URL): %s\n", $0; bad=1; next } !in_mermaid && /^[[:space:]]*\|/ { - # skip table separator rows like |---|---| if ($0 ~ /^[[:space:]|:\-]+$/) next trow++ - if (trow == 1) next # header row + if (trow == 1) next if ($0 !~ re) { printf "❌ significance-scoring.md ranking table row missing evidence (dok_id or primary-source URL): %s\n", $0; bad=1 } @@ -104,9 +125,7 @@ awk -v re="$EVIDENCE_RE" ' } !in_mermaid && /^[[:space:]]*$/ { reset_table(); next } in_mermaid { - # Skip Mermaid structural / configuration lines; validate likely node-label lines. if ($0 ~ /^[[:space:]]*(%%|style\b|classDef\b|class\b|linkStyle\b|subgraph\b|end\b|graph\b|flowchart\b|quadrantChart\b|mindmap\b|timeline\b|journey\b|gantt\b|pie\b|xychart-beta\b|sequenceDiagram\b|stateDiagram(-v2)?\b|erDiagram\b|sankey-beta\b|gitGraph\b|requirementDiagram\b|block-beta\b)/) next - # A node-label line typically has bracketed/parenthesised/braced text, e.g. A[Label] or B(Label) or C{Label}. if ($0 ~ /[\[\(\{][^][(){}]+[\]\)\}]/ && $0 !~ re) { printf "❌ significance-scoring.md Mermaid ranked item missing evidence (dok_id or primary-source URL): %s\n", $0; bad=1 } @@ -115,10 +134,7 @@ awk -v re="$EVIDENCE_RE" ' END { exit bad+0 } ' "$ANALYSIS_DIR/significance-scoring.md" || FAIL=1 -# Check 5 — Mermaid + colour-coded config (explicit `style …` directive OR -# Mermaid init-block `themeVariables` — the SWOT template uses `quadrantChart` -# with `themeVariables` instead of literal `style` lines; either satisfies -# the "colour-coded" requirement). +# Check 5 — Mermaid + colour-coded config on core synthesis + key extension files for f in "${SYNTHESIS[@]}"; do p="$ANALYSIS_DIR/$f"; [ -s "$p" ] || continue grep -qE '^```mermaid' "$p" || { echo "❌ $f: missing Mermaid block"; FAIL=1; } @@ -130,12 +146,15 @@ for f in "${SYNTHESIS[@]}"; do done # Check 6 — Pass-2 evidence (mtime ≥ birth + 180s, OR differing pass1 snapshot on disk) -# `data-download-manifest.md` is produced by the download step and may legitimately -# be unchanged during Pass 2, so it's excluded here (its Pass-2 correctness is -# covered by check 2's per-document coverage against its dok_id list). +# data-download-manifest.md is produced by module 03 and may legitimately be unchanged. PASS2_REQ=(synthesis-summary.md swot-analysis.md risk-assessment.md threat-analysis.md \ stakeholder-perspectives.md significance-scoring.md classification-results.md \ - cross-reference-map.md) + cross-reference-map.md executive-brief.md README.md \ + scenario-analysis.md comparative-international.md devils-advocate.md \ + intelligence-assessment.md methodology-reflection.md \ + election-2026-analysis.md voter-segmentation.md coalition-mathematics.md \ + historical-parallels.md media-framing-analysis.md \ + implementation-feasibility.md forward-indicators.md) for f in "${PASS2_REQ[@]}"; do p="$ANALYSIS_DIR/$f"; [ -s "$p" ] || continue ok=0 @@ -146,6 +165,59 @@ for f in "${PASS2_REQ[@]}"; do [ "$ok" -eq 1 ] || { echo "❌ $f: Pass-2 evidence missing (mtime= 2) } + ' "$ANALYSIS_DIR/comparative-international.md" \ + || { echo "❌ comparative-international.md: missing comparator set or fewer than 2 comparator rows"; FAIL=1; } +fi + +# Check 8 — Family D structure +if [ -s "$ANALYSIS_DIR/forward-indicators.md" ]; then + DI=$(grep -cE '20[0-9]{2}-[0-1][0-9]-[0-3][0-9]|20[0-9]{2}Q[1-4]|\+[0-9]+[[:space:]]*(h|d|day|week|month)' "$ANALYSIS_DIR/forward-indicators.md" || true) + [ "${DI:-0}" -ge 10 ] || { echo "❌ forward-indicators.md: fewer than 10 dated indicators (found ${DI:-0})"; FAIL=1; } +fi +if [ -s "$ANALYSIS_DIR/coalition-mathematics.md" ]; then + grep -qE '^\|.*(Ja|Nej|Avstår|Frånvarande|Seats|Mandat)' "$ANALYSIS_DIR/coalition-mathematics.md" \ + || { echo "❌ coalition-mathematics.md: missing seat-count / vote-breakdown table"; FAIL=1; } +fi + [ "$FAIL" -eq 0 ] || exit 1 ``` diff --git a/.github/prompts/06-article-generation.md b/.github/prompts/06-article-generation.md index 776635ab95..b1275bf734 100644 --- a/.github/prompts/06-article-generation.md +++ b/.github/prompts/06-article-generation.md @@ -13,8 +13,8 @@ Before any article section is drafted, the writer MUST have opened and read **ev | Workflow class | Required artifacts | Gate checks that enforce citation | |----------------|---------------------|------------------------------------| -| Single-type (`news-propositions`, `news-motions`, `news-committee-reports`, `news-interpellations`) | 9 core artifacts — see `04-analysis-pipeline.md` §"9 required core artifacts" | `05-analysis-gate.md` **check 1** (artifact presence), **check 2** (per-document coverage — one `{dok_id}-analysis.md` per manifest entry), **check 4** (evidence cites `dok_id` / primary-source URL host, covering SWOT quadrants **and** significance-scoring ranked items / tables / Mermaid nodes) | -| Tier-C aggregation (`news-evening-analysis`, `news-weekly-review`, `news-monthly-review`, `news-week-ahead`, `news-month-ahead`, `news-realtime-monitor`, `news-article-generator` deep-inspection) | 14 artifacts = 9 core + 5 Tier-C (`README.md`, `executive-brief.md`, `scenario-analysis.md`, `comparative-international.md`, `methodology-reflection.md`) — see `ext/tier-c-aggregation.md` §"14 required artifacts" | All single-type checks **plus** the Tier-C gate block (scenario count ≥ 3, ≥ 2 international comparisons) | +| All workflows (single-type + Tier-C) | **23 artifacts** — Family A (9) + B (2) + C (5) + D (7) per `04-analysis-pipeline.md` §"23 required artifacts" | `05-analysis-gate.md` **check 1** (all 23 present), **check 2** (per-document coverage — one `{dok_id}-analysis.md` per manifest entry), **check 4** (evidence cites `dok_id` / primary-source URL), **check 5** (Mermaid + colour-coded style on all synthesis files), **check 7** (Family C structure — BLUF, ≥ 3 Key Judgments, ≥ 3 scenarios, ≥ 3 ACH hypotheses, ICD 203 audit, ≥ 2 comparators), **check 8** (Family D structure — ≥ 10 forward indicators, coalition seat table) | +| Tier-C aggregation (`news-evening-analysis`, `news-weekly-review`, `news-monthly-review`, `news-week-ahead`, `news-month-ahead`, `news-realtime-monitor`, `news-article-generator` deep-inspection) | Same 23 artifacts **plus** Tier-C depth multipliers and cross-type synthesis — see `ext/tier-c-aggregation.md` | All single-type checks **plus** Tier-C sibling-citation check (cross-type citations in `cross-reference-map.md`) | If any required artifact is missing or empty, do **not** proceed to step 1 below — return to `04-analysis-pipeline.md` and produce it. @@ -40,7 +40,7 @@ If any required artifact is missing or empty, do **not** proceed to step 1 below | Strategic context | `risk-assessment.md` + `threat-analysis.md` | | Economic context | `economic-data.json` + commentary paragraph | | SEO title / meta description | `synthesis-summary.md` §"AI-Recommended Article Metadata" | - | Analysis references block | Hand-written footer linking to the 9 analysis files on GitHub (see "Mandatory sections" below) | + | Analysis references block | Hand-written footer linking to the 23 analysis files on GitHub — at minimum: `executive-brief.md`, `synthesis-summary.md`, `intelligence-assessment.md`, `scenario-analysis.md`, `risk-assessment.md`, `forward-indicators.md` (see "Mandatory sections" below) | 3. **Replace every `AI_MUST_REPLACE` marker** with evidence-cited analysis. `05-analysis-gate.md` **check 3** (no stubs) enforces zero markers before article generation proceeds. @@ -55,7 +55,7 @@ If any required artifact is missing or empty, do **not** proceed to step 1 below - Winners & losers with named actors. - Strategic context with explicit risk or threat reference. - Election 2026 lens paragraph (every article, even single-type). -- Analysis & sources block linking to the 9 analysis files on GitHub. +- Analysis & sources block linking to the 23 analysis files on GitHub (Families A+B+C+D), with direct callouts to `executive-brief.md`, `intelligence-assessment.md`, and `scenario-analysis.md`. ## Banned patterns (zero tolerance) diff --git a/.github/prompts/README.md b/.github/prompts/README.md index 403354b17b..ce120e49c1 100644 --- a/.github/prompts/README.md +++ b/.github/prompts/README.md @@ -23,8 +23,8 @@ This directory is the **single source of truth** for how GitHub Agentic Workflow - **Analysis artifact contract** (the "deep political analysis" product that every news workflow must produce *before* writing a single article sentence): - Methodology → [`analysis/methodologies/ai-driven-analysis-guide.md`](../../analysis/methodologies/ai-driven-analysis-guide.md) - Templates → [`analysis/templates/`](../../analysis/templates/) (one file per artifact) - - **9 core artifacts** (single-type workflow, produced in `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`): `synthesis-summary.md`, `swot-analysis.md`, `risk-assessment.md`, `threat-analysis.md`, `stakeholder-perspectives.md`, `significance-scoring.md`, `classification-results.md`, `cross-reference-map.md`, `data-download-manifest.md` — full definitions in [`04-analysis-pipeline.md`](04-analysis-pipeline.md). - - **14 artifacts** for Tier-C aggregation (9 core + `README.md`, `executive-brief.md`, `scenario-analysis.md`, `comparative-international.md`, `methodology-reflection.md`) — full definitions in [`ext/tier-c-aggregation.md`](ext/tier-c-aggregation.md). + - **23 required artifacts** (every workflow, produced in `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`): Family A Core Synthesis — `README.md`, `executive-brief.md`, `synthesis-summary.md`, `significance-scoring.md`, `classification-results.md`, `swot-analysis.md`, `risk-assessment.md`, `threat-analysis.md`, `stakeholder-perspectives.md`; Family B Structural Metadata — `data-download-manifest.md`, `cross-reference-map.md`; Family C Strategic Extensions (F3EAD Exploit→Analyze) — `scenario-analysis.md`, `comparative-international.md`, `devils-advocate.md`, `intelligence-assessment.md`, `methodology-reflection.md` ⭐; Family D Electoral & Domain Lenses — `election-2026-analysis.md`, `voter-segmentation.md`, `coalition-mathematics.md`, `historical-parallels.md`, `media-framing-analysis.md`, `implementation-feasibility.md`, `forward-indicators.md`. Plus Family E per-document `documents/{dok_id}-analysis.md`. Full definitions in [`04-analysis-pipeline.md`](04-analysis-pipeline.md). + - **Tier-C aggregation** produces the same 23 artifacts plus depth multipliers, cross-type sibling-folder citations, prior-cycle PIR ingestion, and a 1 500-word article floor — see [`ext/tier-c-aggregation.md`](ext/tier-c-aggregation.md). - **Single blocking gate**: [`05-analysis-gate.md`](05-analysis-gate.md) is the only enforcer. No article may be touched until the gate passes. - **AI-FIRST rule** (from [`00-base-contract.md`](00-base-contract.md) §Non-negotiable rules #5): minimum 2 complete iterations — Pass 1 creates every artifact, Pass 2 reads Pass 1 back in full and improves every section. @@ -36,11 +36,11 @@ This directory is the **single source of truth** for how GitHub Agentic Workflow | [`01-bash-and-shell-safety.md`](01-bash-and-shell-safety.md) | Bash tool call format, AWF-safe shell patterns, UTF-8 | All news workflows + translate | | [`02-mcp-access.md`](02-mcp-access.md) | MCP server inventory, tool naming, in-prompt health gate | All news workflows + translate | | [`03-data-download.md`](03-data-download.md) | Download pipeline, subfolder naming, lookback fallback, manifest | All content workflows | -| [`04-analysis-pipeline.md`](04-analysis-pipeline.md) | Methodologies, templates, 9 core artifacts, Pass 1 / Pass 2 | All content workflows | -| [`05-analysis-gate.md`](05-analysis-gate.md) | Single blocking gate before any article is touched | All content workflows | +| [`04-analysis-pipeline.md`](04-analysis-pipeline.md) | Methodologies, templates, **23 required artifacts** (Families A+B+C+D), Pass 1 / Pass 2 | All content workflows | +| [`05-analysis-gate.md`](05-analysis-gate.md) | Single blocking gate before any article is touched (checks 1–8 across all 23 artifacts) | All content workflows | | [`06-article-generation.md`](06-article-generation.md) | Article sections, banned patterns, visualisation, translations | All content workflows | | [`07-commit-and-pr.md`](07-commit-and-pr.md) | Stage → commit → exactly one `create_pull_request` | All news workflows + translate | -| [`ext/tier-c-aggregation.md`](ext/tier-c-aggregation.md) | 14-artifact gate, period multipliers, cross-type synthesis | Aggregation & reference-grade workflows | +| [`ext/tier-c-aggregation.md`](ext/tier-c-aggregation.md) | Tier-C additive rules: period multipliers, cross-type sibling synthesis, prior-cycle PIR ingestion, article floor | Aggregation & reference-grade workflows | ## Dependency matrix @@ -118,6 +118,6 @@ The monolithic `.github/aw/SHARED_PROMPT_PATTERNS.md` was deleted when these mod - [`.github/skills/README.md`](../skills/README.md) — 91 skills by functional category - [`.github/workflows/README.md`](../workflows/README.md) — 45 workflow files (21 `.yml` + 12 `.md` + 12 `.lock.yml`) - [`analysis/README.md`](../../analysis/README.md) — on-disk artifact layout (`analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`) -- [`analysis/methodologies/README.md`](../../analysis/methodologies/README.md) — 11 methodology modules +- [`analysis/methodologies/README.md`](../../analysis/methodologies/README.md) — 12 methodology modules (AI guide · 4 domain frameworks · 5 Family production methodologies · style guide · **OSINT / INTOP tradecraft standards** canon) - [`analysis/templates/README.md`](../../analysis/templates/README.md) — 23 canonical output templates - [`WORKFLOWS.md`](../../WORKFLOWS.md) — complete CI/CD + agentic workflow reference diff --git a/.github/prompts/ext/tier-c-aggregation.md b/.github/prompts/ext/tier-c-aggregation.md index d03c39e3b8..ce7d958304 100644 --- a/.github/prompts/ext/tier-c-aggregation.md +++ b/.github/prompts/ext/tier-c-aggregation.md @@ -10,33 +10,19 @@ Import this **in addition to** the 8 core modules for aggregation / reference-gr - `news-realtime-monitor` - `news-article-generator` when `article_types` contains `deep-inspection` -These are the flagship editorial surfaces of Riksdagsmonitor. The Tier-C rules are additive, not replacements. +These are the flagship editorial surfaces of Riksdagsmonitor. Tier-C rules are **additive**, not replacements — all 23 Family A/B/C/D artifacts from `04-analysis-pipeline.md` are already mandatory for every workflow. Tier-C adds depth multipliers, cross-type synthesis, sibling-citation requirements and a higher article-output floor. -## 14 required artifacts (9 core + 5 Tier-C) +## Artifact count — identical to single-type workflows -In addition to the 9 artifacts from `04-analysis-pipeline.md`: +All aggregation workflows produce the same **23 always-on artifacts** (Family A 9 + Family B 2 + Family C 5 + Family D 7) defined in [`04-analysis-pipeline.md`](../04-analysis-pipeline.md#23-required-artifacts-every-workflow-every-run). No extra files are added at the Tier-C level. What changes is: -| File | Purpose | -|------|---------| -| `README.md` | Per-run index + navigation for editors | -| `executive-brief.md` | 2-page decision-maker brief, lead findings + implications | -| `scenario-analysis.md` | ≥ 3 alternative scenarios with posterior probabilities | -| `comparative-international.md` | Cross-country comparison via World Bank / IMF / SCB data | -| `methodology-reflection.md` | What worked, what failed, biases surfaced, uncertainty log | - -## Pre-flight: required-artifact checklist (Tier-C) - -Before any Tier-C article sentence is written, the writer MUST have opened **all 14** artifacts above from `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`. The Tier-C gate block below additionally verifies: - -- Every Tier-C artifact is non-empty. -- `scenario-analysis.md` declares ≥ 3 distinct scenarios. -- `comparative-international.md` references ≥ 2 external countries. - -Sibling cross-type synthesis (see §"Cross-type synthesis" below) is recorded in `cross-reference-map.md`; missing sibling citations fail the gate. Source templates for these artifacts live in [`analysis/templates/`](../../../analysis/templates/) — see [`analysis/templates/README.md`](../../../analysis/templates/README.md) §"Artifact → workflow → gate check mapping" for the full template-to-artifact-to-gate chain. +- **Depth** — each artifact is expanded under the period-scope multiplier below. +- **Cross-type synthesis** — aggregation workflows must read sibling per-type folders and cite them in `cross-reference-map.md`. +- **Article floor** — Tier-C articles require ≥ 1 500 words vs 1 000 for single-type. ## Period-scope multipliers (depth calibration) -Aggregation depth scales with the period covered. Multiply the `comprehensive` minimum times in `04-analysis-pipeline.md` by: +Aggregation depth scales with the period covered. Multiply the `comprehensive` minimum times in `04-analysis-pipeline.md` §Depth calibration by: | Workflow | Multiplier | Rationale | |----------|-----------|-----------| @@ -46,11 +32,11 @@ Aggregation depth scales with the period covered. Multiply the `comprehensive` m | `news-month-ahead` / `news-monthly-review` | 1.5× | 30-day window; longitudinal patterns required. | | `news-article-generator` (deep-inspection) | 1.0× | Single-topic deep dive. | -All 14 artifacts remain mandatory regardless of multiplier. +All 23 artifacts remain mandatory regardless of multiplier. The multiplier extends per-item body length and framework richness (e.g. month-ahead `coalition-mathematics.md` carries five party-coalition Sainte-Laguë variants vs one for realtime). ## Cross-type synthesis (aggregation only) -Aggregation workflows **must** read sibling article-type analyses produced for the same period and cite them explicitly: +Aggregation workflows **must** read sibling article-type analyses produced for the same period and cite them explicitly in `cross-reference-map.md §Sibling folders`: | Aggregation workflow | Sibling folders to read | |----------------------|-------------------------| @@ -59,66 +45,54 @@ Aggregation workflows **must** read sibling article-type analyses produced for t | `news-month-ahead` / `news-monthly-review` | Last 30 days of per-type folders | | `news-realtime-monitor` | Prior 7 days' `realtime-*/` for continuity chain | -Cross-references go into `cross-reference-map.md`. Missing cross-type citations fail the gate. +Cross-references go into `cross-reference-map.md` with one entry per sibling folder read. Missing cross-type citations fail the gate. ## Recent-daily synthesis ingestion For `news-week-ahead`, `news-month-ahead`, `news-weekly-review`, `news-monthly-review` and `news-realtime-monitor`, before Pass 1 analysis: -1. Read every `synthesis-summary.md` from the lookback window. -2. Extract unique `dok_id` references and stakeholder names. +1. Read every `synthesis-summary.md` **and** `intelligence-assessment.md` from the lookback window. +2. Extract unique `dok_id` references, stakeholder names, and open PIRs. 3. Record the ingestion list in `data-download-manifest.md §Reference Analyses`. -4. Use the extracted entities as input to Pass 1 SWOT, risk, and stakeholder files. +4. Use the extracted entities as input to Pass 1 SWOT, risk, stakeholder, scenario, and forward-indicators files. +5. Propagate every unresolved PIR from prior-cycle `intelligence-assessment.md` into the current-cycle version. -## Tier-C gate +## Tier-C additive gate -No dedicated Tier-C validator script exists — run the core-gate bash block from `05-analysis-gate.md`, then the additional checks below: +The 23-artifact gate in `05-analysis-gate.md` already runs on every workflow. Tier-C adds the following **additive** check block — run it **after** the core gate passes: ``` set -Eeuo pipefail ANALYSIS_DIR="${ANALYSIS_DIR:-}" [ -n "$ANALYSIS_DIR" ] || { echo "❌ ANALYSIS_DIR is not set; run the core-gate block from 05-analysis-gate.md first"; exit 1; } [ -d "$ANALYSIS_DIR" ] || { echo "❌ ANALYSIS_DIR does not exist: $ANALYSIS_DIR"; exit 1; } -EXTRA="README.md executive-brief.md scenario-analysis.md \ - comparative-international.md methodology-reflection.md" FAIL=0 -for f in $EXTRA; do - [ -s "$ANALYSIS_DIR/$f" ] || { echo "❌ tier-c missing: $f"; FAIL=1; } -done -# ≥ 3 scenarios with probability + leading indicator -awk '/^##? .*Scenario/{c++} END{exit (c<3)}' "$ANALYSIS_DIR/scenario-analysis.md" \ - || { echo "❌ scenario-analysis.md: fewer than 3 scenarios"; FAIL=1; } -# comparative-international.md must define a comparator set or include ≥ 2 comparator rows -# (structural check — avoids hardcoding a country allowlist that rejects valid comparators -# like "United States", "United Kingdom", "EU", or other jurisdictions the template permits) -awk ' - BEGIN { comparator_set=0; comparator_rows=0 } - /^[[:space:]]*\*{0,2}Comparator set\*{0,2}[[:space:]]*:/ { - value = $0 - sub(/^[^:]*:[[:space:]]*/, "", value) - if (value !~ /^[[:space:]]*$/ && value !~ /^[[:space:]]*[-–—]+[[:space:]]*$/) { - comparator_set = 1 - } - } - /^\|/ { - if ($0 !~ /^\|[[:space:]:-]+(\|[[:space:]:-]+)+\|?[[:space:]]*$/ && $0 !~ /^\|[[:space:]]*(Jurisdiction|Comparator|Country)[[:space:]]*\|/) { - comparator_rows++ - } - } - END { exit !(comparator_set || comparator_rows >= 2) } -' "$ANALYSIS_DIR/comparative-international.md" \ - || { echo "❌ comparative-international.md: missing comparator set or fewer than 2 comparator rows"; FAIL=1; } + +# Tier-C additive check 1 — cross-reference-map.md cites ≥ 1 sibling folder under analysis/daily/ +if [ -s "$ANALYSIS_DIR/cross-reference-map.md" ]; then + grep -qE 'analysis/daily/[0-9]{4}-[0-9]{2}-[0-9]{2}/[A-Za-z0-9_-]+' "$ANALYSIS_DIR/cross-reference-map.md" \ + || { echo "❌ tier-c: cross-reference-map.md missing sibling-folder citations (expected analysis/daily//)"; FAIL=1; } +fi + +# Tier-C additive check 2 — intelligence-assessment.md ingests prior-cycle PIRs (Tier-C only) +if [ -s "$ANALYSIS_DIR/intelligence-assessment.md" ]; then + grep -qE '(Prior[- ]cycle|Carried[- ]forward|Previous[- ]PIR|Open[[:space:]]+PIR)' "$ANALYSIS_DIR/intelligence-assessment.md" \ + || { echo "❌ tier-c: intelligence-assessment.md missing prior-cycle PIR ingestion section"; FAIL=1; } +fi + [ "$FAIL" -eq 0 ] || exit 1 ``` -If the block is promoted to `scripts/validate-tier-c-gate.ts`, update this module accordingly. +The core structural checks (scenario count ≥ 3, comparator rows ≥ 2, Key Judgments ≥ 3, ACH hypotheses ≥ 3, forward indicators ≥ 10, ICD 203 audit, BLUF section) are enforced by `05-analysis-gate.md` checks 7–8 and apply to **every** workflow. If the Tier-C additive block is promoted to `scripts/validate-tier-c-gate.ts`, update this module accordingly. ## Article expectations Tier-C articles are the editorial flagship. Floor: -- ≥ 1500 words (vs 1000 for single-type). +- ≥ 1 500 words (vs 1 000 for single-type). - All 5 mandatory analytical sections present (vs 3 of 5). - ≥ 5 `dok_id` references. - ≥ 2 charts (economic + political). - Executive brief linked from the article. +- Scenario table (from `scenario-analysis.md`) embedded in the article. +- Forward-watch block (from `forward-indicators.md` top 3 triggers) embedded in the article. diff --git a/.github/workflows/news-article-generator.lock.yml b/.github/workflows/news-article-generator.lock.yml index 4dcd3550da..f53ec9650a 100644 --- a/.github/workflows/news-article-generator.lock.yml +++ b/.github/workflows/news-article-generator.lock.yml @@ -481,7 +481,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_e8c105c960c2be5b_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_e8c105c960c2be5b_EOF - name: Write Safe Outputs Tools env: @@ -512,6 +512,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1465,7 +1470,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-article-generator.md b/.github/workflows/news-article-generator.md index adb7381e45..a56ef2e16e 100644 --- a/.github/workflows/news-article-generator.md +++ b/.github/workflows/news-article-generator.md @@ -235,37 +235,37 @@ Manual-only multi-type article generator. Accepts comma-separated article_types ## Tier-C (reference-grade) requirements -This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 14 artifacts** (9 core + 5 Tier-C) and cross-reference sibling analyses. See the extension for the full rules. +This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 23 artifacts** (Family A 9 + B 2 + C 5 + D 7) per `04-analysis-pipeline.md`, apply the Tier-C period-scope multiplier, and cross-reference sibling per-type analyses in `cross-reference-map.md`. See the extension for the full rules. ## What this workflow does - **Article type**: `multi` - **Analysis subfolder**: `analysis/daily/$ARTICLE_DATE//` - **Core languages produced**: `en`, `sv` (remaining 12 languages dispatched to `news-translate`) -- **Two-run model**: Run 1 produces an `analysis-only` PR (14 artifacts per type); Run 2 detects existing analysis and produces an articles PR. +- **Two-run model**: Run 1 produces an `analysis-only` PR (all 23 artifacts per type); Run 2 detects existing analysis and produces an articles PR. ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~45 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts + Tier-C cross-type synthesis): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 14 artifacts incl. 5 Tier-C) | 04 / ext | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–41 | Analysis Gate (Tier-C extended gate) | 05 | -| 41–45 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 / ext | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (core checks 1–8 + Tier-C additive block) | 05 / ext | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 14 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -278,9 +278,9 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE//` already contains all 9 core artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE//` already contains all **23 required artifacts** (Families A+B+C+D): -- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Tier-C Gate (14 artifacts), commit analysis artifacts, open `analysis-only` PR, stop. +- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Analysis Gate (all 23 artifacts + Tier-C additive block), commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. Repeated runs for the same `$ARTICLE_DATE` always use the same analysis folder when `force_generation=false`. Analysis is the primary product — a run never produces nothing. diff --git a/.github/workflows/news-committee-reports.lock.yml b/.github/workflows/news-committee-reports.lock.yml index 75660883f6..7ee2003fde 100644 --- a/.github/workflows/news-committee-reports.lock.yml +++ b/.github/workflows/news-committee-reports.lock.yml @@ -475,7 +475,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_40e5e79d4d568e7c_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_40e5e79d4d568e7c_EOF - name: Write Safe Outputs Tools env: @@ -506,6 +506,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1459,7 +1464,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-committee-reports.md b/.github/workflows/news-committee-reports.md index cce9f7003e..70719ee915 100644 --- a/.github/workflows/news-committee-reports.md +++ b/.github/workflows/news-committee-reports.md @@ -233,26 +233,26 @@ Generates deep political intelligence articles on parliamentary committee report ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~43 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 9 artifacts) | 04 | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–40 | Analysis Gate | 05 | -| 40–43 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (checks 1–8) | 05 | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 9 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -265,7 +265,7 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/committeeReports/` already contains all 9 required artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/committeeReports/` already contains all **23 required artifacts** (Families A+B+C+D): - **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Gate, commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. diff --git a/.github/workflows/news-evening-analysis.lock.yml b/.github/workflows/news-evening-analysis.lock.yml index ec8570d428..69b63b73ec 100644 --- a/.github/workflows/news-evening-analysis.lock.yml +++ b/.github/workflows/news-evening-analysis.lock.yml @@ -482,7 +482,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_714365ca00865243_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_714365ca00865243_EOF - name: Write Safe Outputs Tools env: @@ -513,6 +513,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1482,7 +1487,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,cdn.playwright.dev,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,playwright.download.prss.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-evening-analysis.md b/.github/workflows/news-evening-analysis.md index e1feb47597..3761adef2a 100644 --- a/.github/workflows/news-evening-analysis.md +++ b/.github/workflows/news-evening-analysis.md @@ -231,41 +231,41 @@ engine: # 🌆 Evening Analysis -Daily evening synthesis aggregating every article-type produced today. Tier-C reference-grade output (14 artifacts). Core languages EN, SV. +Daily evening synthesis aggregating every article-type produced today. Tier-C reference-grade output (all 23 artifacts + cross-type synthesis). Core languages EN, SV. ## Tier-C (reference-grade) requirements -This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 14 artifacts** (9 core + 5 Tier-C) and cross-reference sibling analyses. See the extension for the full rules. +This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 23 artifacts** (Family A 9 + B 2 + C 5 + D 7) per `04-analysis-pipeline.md`, apply the Tier-C period-scope multiplier, and cross-reference sibling per-type analyses in `cross-reference-map.md`. See the extension for the full rules. ## What this workflow does - **Article type**: `evening-analysis` - **Analysis subfolder**: `analysis/daily/$ARTICLE_DATE/evening-analysis/` - **Core languages produced**: `en`, `sv` (remaining 12 languages dispatched to `news-translate`) -- **Two-run model**: Run 1 produces an `analysis-only` PR (14 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. +- **Two-run model**: Run 1 produces an `analysis-only` PR (all 23 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~45 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts + Tier-C cross-type synthesis): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 14 artifacts incl. 5 Tier-C) | 04 / ext | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–41 | Analysis Gate (Tier-C extended gate) | 05 | -| 41–45 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 / ext | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (core checks 1–8 + Tier-C additive block) | 05 / ext | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 14 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -278,9 +278,9 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## 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 9 core artifacts: +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** (Families A+B+C+D): -- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Tier-C Gate (14 artifacts), commit analysis artifacts, open `analysis-only` PR, stop. +- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Analysis Gate (all 23 artifacts + Tier-C additive block), commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. Repeated runs for the same `$ARTICLE_DATE` always use the same analysis folder when `force_generation=false`. Analysis is the primary product — a run never produces nothing. diff --git a/.github/workflows/news-interpellations.lock.yml b/.github/workflows/news-interpellations.lock.yml index 440ed0d465..f97a7921b2 100644 --- a/.github/workflows/news-interpellations.lock.yml +++ b/.github/workflows/news-interpellations.lock.yml @@ -475,7 +475,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_c353a8f4d26fea63_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_c353a8f4d26fea63_EOF - name: Write Safe Outputs Tools env: @@ -506,6 +506,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1459,7 +1464,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-interpellations.md b/.github/workflows/news-interpellations.md index 6351f7cbc4..aaa362edba 100644 --- a/.github/workflows/news-interpellations.md +++ b/.github/workflows/news-interpellations.md @@ -233,26 +233,26 @@ Generates deep political intelligence articles on interpellation debates, includ ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~43 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 9 artifacts) | 04 | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–40 | Analysis Gate | 05 | -| 40–43 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (checks 1–8) | 05 | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 9 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -265,7 +265,7 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/interpellations/` already contains all 9 required artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/interpellations/` already contains all **23 required artifacts** (Families A+B+C+D): - **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Gate, commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. diff --git a/.github/workflows/news-month-ahead.lock.yml b/.github/workflows/news-month-ahead.lock.yml index 71cdd62dd5..1ecc578491 100644 --- a/.github/workflows/news-month-ahead.lock.yml +++ b/.github/workflows/news-month-ahead.lock.yml @@ -476,7 +476,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_88b726183f27282d_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_88b726183f27282d_EOF - name: Write Safe Outputs Tools env: @@ -507,6 +507,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1460,7 +1465,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-month-ahead.md b/.github/workflows/news-month-ahead.md index 5329ee56e2..0583869ed7 100644 --- a/.github/workflows/news-month-ahead.md +++ b/.github/workflows/news-month-ahead.md @@ -224,41 +224,41 @@ engine: # 🗓️ Month Ahead -Forward-looking 30-day parliamentary calendar + political intelligence brief. Tier-C reference-grade output (14 artifacts). Core languages EN, SV. +Forward-looking 30-day parliamentary calendar + political intelligence brief. Tier-C reference-grade output (all 23 artifacts + cross-type synthesis). Core languages EN, SV. ## Tier-C (reference-grade) requirements -This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 14 artifacts** (9 core + 5 Tier-C) and cross-reference sibling analyses. See the extension for the full rules. +This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 23 artifacts** (Family A 9 + B 2 + C 5 + D 7) per `04-analysis-pipeline.md`, apply the Tier-C period-scope multiplier, and cross-reference sibling per-type analyses in `cross-reference-map.md`. See the extension for the full rules. ## What this workflow does - **Article type**: `month-ahead` - **Analysis subfolder**: `analysis/daily/$ARTICLE_DATE/month-ahead/` - **Core languages produced**: `en`, `sv` (remaining 12 languages dispatched to `news-translate`) -- **Two-run model**: Run 1 produces an `analysis-only` PR (14 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. +- **Two-run model**: Run 1 produces an `analysis-only` PR (all 23 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~45 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts + Tier-C cross-type synthesis): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 14 artifacts incl. 5 Tier-C) | 04 / ext | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–41 | Analysis Gate (Tier-C extended gate) | 05 | -| 41–45 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 / ext | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (core checks 1–8 + Tier-C additive block) | 05 / ext | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 14 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -271,9 +271,9 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/month-ahead/` already contains all 9 core artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/month-ahead/` already contains all **23 required artifacts** (Families A+B+C+D): -- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Tier-C Gate (14 artifacts), commit analysis artifacts, open `analysis-only` PR, stop. +- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Analysis Gate (all 23 artifacts + Tier-C additive block), commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. Repeated runs for the same `$ARTICLE_DATE` always use the same analysis folder when `force_generation=false`. Analysis is the primary product — a run never produces nothing. diff --git a/.github/workflows/news-monthly-review.lock.yml b/.github/workflows/news-monthly-review.lock.yml index 96aedeee65..358241854a 100644 --- a/.github/workflows/news-monthly-review.lock.yml +++ b/.github/workflows/news-monthly-review.lock.yml @@ -476,7 +476,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_af14f6063e3cfcf7_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_af14f6063e3cfcf7_EOF - name: Write Safe Outputs Tools env: @@ -507,6 +507,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1460,7 +1465,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-monthly-review.md b/.github/workflows/news-monthly-review.md index a2766923c7..30ce89cf4c 100644 --- a/.github/workflows/news-monthly-review.md +++ b/.github/workflows/news-monthly-review.md @@ -224,41 +224,41 @@ engine: # 📈 Monthly Review -Retrospective 30-day political intelligence review synthesising longitudinal patterns. Tier-C reference-grade output (14 artifacts). Core languages EN, SV. +Retrospective 30-day political intelligence review synthesising longitudinal patterns. Tier-C reference-grade output (all 23 artifacts + cross-type synthesis). Core languages EN, SV. ## Tier-C (reference-grade) requirements -This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 14 artifacts** (9 core + 5 Tier-C) and cross-reference sibling analyses. See the extension for the full rules. +This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 23 artifacts** (Family A 9 + B 2 + C 5 + D 7) per `04-analysis-pipeline.md`, apply the Tier-C period-scope multiplier, and cross-reference sibling per-type analyses in `cross-reference-map.md`. See the extension for the full rules. ## What this workflow does - **Article type**: `monthly-review` - **Analysis subfolder**: `analysis/daily/$ARTICLE_DATE/monthly-review/` - **Core languages produced**: `en`, `sv` (remaining 12 languages dispatched to `news-translate`) -- **Two-run model**: Run 1 produces an `analysis-only` PR (14 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. +- **Two-run model**: Run 1 produces an `analysis-only` PR (all 23 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~45 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts + Tier-C cross-type synthesis): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 14 artifacts incl. 5 Tier-C) | 04 / ext | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–41 | Analysis Gate (Tier-C extended gate) | 05 | -| 41–45 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 / ext | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (core checks 1–8 + Tier-C additive block) | 05 / ext | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 14 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -271,9 +271,9 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/monthly-review/` already contains all 9 core artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/monthly-review/` already contains all **23 required artifacts** (Families A+B+C+D): -- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Tier-C Gate (14 artifacts), commit analysis artifacts, open `analysis-only` PR, stop. +- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Analysis Gate (all 23 artifacts + Tier-C additive block), commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. Repeated runs for the same `$ARTICLE_DATE` always use the same analysis folder when `force_generation=false`. Analysis is the primary product — a run never produces nothing. diff --git a/.github/workflows/news-motions.lock.yml b/.github/workflows/news-motions.lock.yml index f09c048fa3..20e1c5c4ac 100644 --- a/.github/workflows/news-motions.lock.yml +++ b/.github/workflows/news-motions.lock.yml @@ -475,7 +475,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_f556cbb42b08ffff_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_f556cbb42b08ffff_EOF - name: Write Safe Outputs Tools env: @@ -506,6 +506,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1459,7 +1464,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-motions.md b/.github/workflows/news-motions.md index a0a5638a59..97803c6157 100644 --- a/.github/workflows/news-motions.md +++ b/.github/workflows/news-motions.md @@ -233,26 +233,26 @@ Generates deep political intelligence articles on opposition motions in core lan ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~43 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 9 artifacts) | 04 | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–40 | Analysis Gate | 05 | -| 40–43 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (checks 1–8) | 05 | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 9 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -265,7 +265,7 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/motions/` already contains all 9 required artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/motions/` already contains all **23 required artifacts** (Families A+B+C+D): - **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Gate, commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. diff --git a/.github/workflows/news-propositions.lock.yml b/.github/workflows/news-propositions.lock.yml index f0ff835ef8..0dc437be77 100644 --- a/.github/workflows/news-propositions.lock.yml +++ b/.github/workflows/news-propositions.lock.yml @@ -475,7 +475,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_6e38bae5dbe7d851_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_6e38bae5dbe7d851_EOF - name: Write Safe Outputs Tools env: @@ -506,6 +506,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1459,7 +1464,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-propositions.md b/.github/workflows/news-propositions.md index bc4c039cce..ccddc31785 100644 --- a/.github/workflows/news-propositions.md +++ b/.github/workflows/news-propositions.md @@ -233,26 +233,26 @@ Generates deep political intelligence articles on Swedish government proposition ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~43 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 9 artifacts) | 04 | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–40 | Analysis Gate | 05 | -| 40–43 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (checks 1–8) | 05 | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 9 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -265,7 +265,7 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/propositions/` already contains all 9 required artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/propositions/` already contains all **23 required artifacts** (Families A+B+C+D): - **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Gate, commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. diff --git a/.github/workflows/news-realtime-monitor.lock.yml b/.github/workflows/news-realtime-monitor.lock.yml index 90185ee357..7b0fa1437c 100644 --- a/.github/workflows/news-realtime-monitor.lock.yml +++ b/.github/workflows/news-realtime-monitor.lock.yml @@ -483,7 +483,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_764f49ba6af4f517_EOF' - {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + {"add_comment":{"max":1},"create_pull_request":{"draft":false,"expires":336,"labels":["agentic-news","analysis-data"],"max":1,"max_patch_size":4096,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_path_prefixes":[".github/",".agents/"]},"create_report_incomplete_issue":{},"dispatch_workflow":{"aw_context_workflows":["news-translate"],"max":1,"workflow_files":{"news-translate":".lock.yml"},"workflows":["news-translate"]},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} GH_AW_SAFE_OUTPUTS_CONFIG_764f49ba6af4f517_EOF - name: Write Safe Outputs Tools env: @@ -514,6 +514,11 @@ jobs: "description": "Article type to translate (propositions, motions, committee-reports, week-ahead, month-ahead, weekly-review, monthly-review, breaking, evening-analysis, deep-inspection, interpellations). Leave empty to scan for all untranslated articles.", "type": "string" }, + "aw_context": { + "default": "", + "description": "Agent caller context (used internally by Agentic Workflows).", + "type": "string" + }, "languages": { "default": "all-extra", "description": "Target languages (da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh | nordic-extra | eu-extra | cjk | rtl | all-extra). Default: all-extra (all except en,sv)", @@ -1483,7 +1488,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.imf.org,api.individual.githubcopilot.com,api.npms.io,api.scb.se,api.snapcraft.io,api.worldbank.org,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,cdn.playwright.dev,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,data.imf.org,data.riksdagen.se,deb.nodesource.com,deno.land,docs.github.com,esm.sh,get.pnpm.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,googleapis.deno.dev,googlechromelabs.github.io,hack23.com,hack23.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,localhost,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,playwright.download.prss.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,regeringen.se,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,riksdag-regering-ai.onrender.com,riksdagen.se,riksdagsmonitor.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.hack23.com,www.imf.org,www.npmjs.com,www.npmjs.org,www.regeringen.se,www.riksdagen.se,www.riksdagsmonitor.com,www.scb.se,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_pull_request\":{\"draft\":false,\"expires\":336,\"labels\":[\"agentic-news\",\"analysis-data\"],\"max\":1,\"max_patch_size\":4096,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_path_prefixes\":[\".github/\",\".agents/\"]},\"create_report_incomplete_issue\":{},\"dispatch_workflow\":{\"aw_context_workflows\":[\"news-translate\"],\"max\":1,\"workflow_files\":{\"news-translate\":\".lock.yml\"},\"workflows\":[\"news-translate\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/news-realtime-monitor.md b/.github/workflows/news-realtime-monitor.md index 6665ed683b..5e64da72d6 100644 --- a/.github/workflows/news-realtime-monitor.md +++ b/.github/workflows/news-realtime-monitor.md @@ -234,41 +234,41 @@ engine: # 🚨 Realtime Monitor -Real-time breaking-news monitor. Scans Riksdag + Regering for urgent updates and produces breaking-news articles with Playwright validation. Tier-C reference-grade output (14 artifacts). +Real-time breaking-news monitor. Scans Riksdag + Regering for urgent updates and produces breaking-news articles with Playwright validation. Tier-C reference-grade output (all 23 artifacts + cross-type synthesis). ## Tier-C (reference-grade) requirements -This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 14 artifacts** (9 core + 5 Tier-C) and cross-reference sibling analyses. See the extension for the full rules. +This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 23 artifacts** (Family A 9 + B 2 + C 5 + D 7) per `04-analysis-pipeline.md`, apply the Tier-C period-scope multiplier, and cross-reference sibling per-type analyses in `cross-reference-map.md`. See the extension for the full rules. ## What this workflow does - **Article type**: `breaking` - **Analysis subfolder**: `analysis/daily/$ARTICLE_DATE/realtime-$HHMM/` - **Core languages produced**: `en`, `sv` (remaining 12 languages dispatched to `news-translate`) -- **Two-run model**: Run 1 produces an `analysis-only` PR (14 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. Note: realtime runs use a time-stamped subfolder (`realtime-HHMM`) so morning and afternoon runs each have independent analysis folders. +- **Two-run model**: Run 1 produces an `analysis-only` PR (all 23 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. Note: realtime runs use a time-stamped subfolder (`realtime-HHMM`) so morning and afternoon runs each have independent analysis folders. ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~45 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts + Tier-C cross-type synthesis): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 14 artifacts incl. 5 Tier-C) | 04 / ext | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–41 | Analysis Gate (Tier-C extended gate) | 05 | -| 41–45 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 / ext | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (core checks 1–8 + Tier-C additive block) | 05 / ext | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 14 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -281,9 +281,9 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/realtime-$HHMM/` already contains all 9 core artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/realtime-$HHMM/` already contains all **23 required artifacts** (Families A+B+C+D): -- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Tier-C Gate (14 artifacts), commit analysis artifacts, open `analysis-only` PR, stop. +- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Analysis Gate (all 23 artifacts + Tier-C additive block), commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. Repeated runs for the same `$ARTICLE_DATE` always use the same analysis folder when `force_generation=false`. Analysis is the primary product — a run never produces nothing. diff --git a/.github/workflows/news-week-ahead.md b/.github/workflows/news-week-ahead.md index 7c1e024d6b..454505f6ab 100644 --- a/.github/workflows/news-week-ahead.md +++ b/.github/workflows/news-week-ahead.md @@ -223,41 +223,41 @@ engine: # 📅 Week Ahead -Forward-looking 7-day parliamentary calendar + political intelligence brief. Tier-C reference-grade output (14 artifacts). Core languages EN, SV. +Forward-looking 7-day parliamentary calendar + political intelligence brief. Tier-C reference-grade output (all 23 artifacts + cross-type synthesis). Core languages EN, SV. ## Tier-C (reference-grade) requirements -This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 14 artifacts** (9 core + 5 Tier-C) and cross-reference sibling analyses. See the extension for the full rules. +This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 23 artifacts** (Family A 9 + B 2 + C 5 + D 7) per `04-analysis-pipeline.md`, apply the Tier-C period-scope multiplier, and cross-reference sibling per-type analyses in `cross-reference-map.md`. See the extension for the full rules. ## What this workflow does - **Article type**: `week-ahead` - **Analysis subfolder**: `analysis/daily/$ARTICLE_DATE/week-ahead/` - **Core languages produced**: `en`, `sv` (remaining 12 languages dispatched to `news-translate`) -- **Two-run model**: Run 1 produces an `analysis-only` PR (14 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. +- **Two-run model**: Run 1 produces an `analysis-only` PR (all 23 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~45 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts + Tier-C cross-type synthesis): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 14 artifacts incl. 5 Tier-C) | 04 / ext | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–41 | Analysis Gate (Tier-C extended gate) | 05 | -| 41–45 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 / ext | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (core checks 1–8 + Tier-C additive block) | 05 / ext | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 14 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -270,9 +270,9 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/week-ahead/` already contains all 9 core artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/week-ahead/` already contains all **23 required artifacts** (Families A+B+C+D): -- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Tier-C Gate (14 artifacts), commit analysis artifacts, open `analysis-only` PR, stop. +- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Analysis Gate (all 23 artifacts + Tier-C additive block), commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. Repeated runs for the same `$ARTICLE_DATE` always use the same analysis folder when `force_generation=false`. Analysis is the primary product — a run never produces nothing. diff --git a/.github/workflows/news-weekly-review.md b/.github/workflows/news-weekly-review.md index 1cb58f5462..93acbc71f6 100644 --- a/.github/workflows/news-weekly-review.md +++ b/.github/workflows/news-weekly-review.md @@ -223,41 +223,41 @@ engine: # 📊 Weekly Review -Retrospective 7-day political intelligence review synthesising every article-type from the past week. Tier-C reference-grade output (14 artifacts). Core languages EN, SV. +Retrospective 7-day political intelligence review synthesising every article-type from the past week. Tier-C reference-grade output (all 23 artifacts + cross-type synthesis). Core languages EN, SV. ## Tier-C (reference-grade) requirements -This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 14 artifacts** (9 core + 5 Tier-C) and cross-reference sibling analyses. See the extension for the full rules. +This workflow imports `../prompts/ext/tier-c-aggregation.md`. Produce **all 23 artifacts** (Family A 9 + B 2 + C 5 + D 7) per `04-analysis-pipeline.md`, apply the Tier-C period-scope multiplier, and cross-reference sibling per-type analyses in `cross-reference-map.md`. See the extension for the full rules. ## What this workflow does - **Article type**: `weekly-review` - **Analysis subfolder**: `analysis/daily/$ARTICLE_DATE/weekly-review/` - **Core languages produced**: `en`, `sv` (remaining 12 languages dispatched to `news-translate`) -- **Two-run model**: Run 1 produces an `analysis-only` PR (14 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. +- **Two-run model**: Run 1 produces an `analysis-only` PR (all 23 artifacts); Run 2 (next scheduled run, same day) detects existing analysis and produces an articles PR. ## Time budget -**Run 1 — Analysis mode** (no prior analysis found, ~45 min): +**Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts + Tier-C cross-type synthesis): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight analysis check | 02 / 03 | | 2–7 | Download data + catalogue | 03 | -| 7–27 | Analysis Pass 1 (methodology read + per-doc analyses + 14 artifacts incl. 5 Tier-C) | 04 / ext | -| 27–38 | Analysis Pass 2 (read-back + improvements) | 04 | -| 38–41 | Analysis Gate (Tier-C extended gate) | 05 | -| 41–45 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | +| 7–32 | Analysis Pass 1 (methodology read + per-doc analyses + **all 23 artifacts**: Family A 9 + B 2 + C 5 + D 7) | 04 / ext | +| 32–45 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 | +| 45–47 | Analysis Gate (core checks 1–8 + Tier-C additive block) | 05 / ext | +| 47–50 | Stage analysis, commit, **ONE** `safeoutputs___create_pull_request` (analysis-only) | 07 | -**Run 2 — Article mode** (analysis exists on disk, ~25 min): +**Run 2 — Article mode** (analysis exists on disk, ~28 min): | Minutes | Phase | Module | |---------|-------|--------| | 0–2 | MCP pre-warm + pre-flight check (SKIP_ANALYSIS=true) | 02 / 03 | -| 2–5 | Read all 14 analysis artifacts into context | 06 | -| 5–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | -| 18–22 | Visual + link validation | 06 | -| 22–25 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | +| 2–7 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | +| 7–20 | Article Pass 1 + Pass 2 (EN, SV) | 06 | +| 20–24 | Visual + link validation | 06 | +| 24–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` | 07 | Trim scope before quality. Never open a second PR within a run — there is no second PR. @@ -270,9 +270,9 @@ Trim scope before quality. Never open a second PR within a run — there is no s ## Run-mode selection -At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/weekly-review/` already contains all 9 core artifacts: +At the start of every run, the pre-flight check in `03-data-download.md` detects whether `analysis/daily/$ARTICLE_DATE/weekly-review/` already contains all **23 required artifacts** (Families A+B+C+D): -- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Tier-C Gate (14 artifacts), commit analysis artifacts, open `analysis-only` PR, stop. +- **No analysis found** → Analysis mode: download data, run Pass 1 + Pass 2 + Analysis Gate (all 23 artifacts + Tier-C additive block), commit analysis artifacts, open `analysis-only` PR, stop. - **Analysis found** → Article mode: read existing analysis, generate articles, commit articles, open articles PR + dispatch `news-translate`. Repeated runs for the same `$ARTICLE_DATE` always use the same analysis folder when `force_generation=false`. Analysis is the primary product — a run never produces nothing. diff --git a/analysis/methodologies/README.md b/analysis/methodologies/README.md index 7de156a941..4273534de7 100644 --- a/analysis/methodologies/README.md +++ b/analysis/methodologies/README.md @@ -124,10 +124,11 @@ The 12 agentic news workflows in `.github/workflows/news-*.md` are the **primary | [`political-risk-methodology.md`](political-risk-methodology.md) | ✅ produces `risk-assessment.md` | ✅ sensitivity & posterior probabilities | `05-analysis-gate.md` check 1 | | [`political-threat-framework.md`](political-threat-framework.md) | ✅ produces `threat-analysis.md` | ✅ kill-chain depth | `05-analysis-gate.md` check 1 | | [`political-style-guide.md`](political-style-guide.md) | — | ✅ tone, neutrality, evidence citations | Article Pass-2 review | -| [`strategic-extensions-methodology.md`](strategic-extensions-methodology.md) | ✅ for Tier-C only (`executive-brief.md`, `scenario-analysis.md`, `comparative-international.md`) | ✅ scenario probabilities | `ext/tier-c-aggregation.md` Tier-C gate | +| [`strategic-extensions-methodology.md`](strategic-extensions-methodology.md) | ✅ every run, all 5 Family C artifacts (`executive-brief.md`, `scenario-analysis.md`, `comparative-international.md`, `devils-advocate.md`, `intelligence-assessment.md`, `methodology-reflection.md`) | ✅ scenario probabilities, ICD 203 audit | `05-analysis-gate.md` checks 1 + 7 (Family C structure) | | [`structural-metadata-methodology.md`](structural-metadata-methodology.md) | ✅ cross-reference continuity contracts | — | `05-analysis-gate.md` check 1 (artifact presence) | | [`synthesis-methodology.md`](synthesis-methodology.md) | ✅ produces `synthesis-summary.md` with DIW-weighted ranking | ✅ lead-story justification | `05-analysis-gate.md` checks 1 + 5 (Mermaid) | | [`electoral-domain-methodology.md`](electoral-domain-methodology.md) | ✅ Election 2026 lens paragraph | — | Article-generation mandatory section | +| [`osint-tradecraft-standards.md`](osint-tradecraft-standards.md) | ✅ ICD 203 + Admiralty + WEP + SAT catalog + OSINT ethics + DIW alignment + PIR handoff | ✅ ICD 203 audit, SAT attestation (≥10), DIW–Admiralty reconciliation | `05-analysis-gate.md` checks 4 (evidence), 5 (Mermaid), 7 (Family C structure), 8 (Family D horizons) | **Upstream gh-aw documentation** (link-out only — these methodologies own the political-analysis content; gh-aw owns the workflow runtime): @@ -217,6 +218,7 @@ graph LR |----------|----------|-------------|:-----------:|-------------------------|---------------| | **★ Start** | **[AI-Driven Analysis Guide](ai-driven-analysis-guide.md)** | 7-step protocol, Family A–E output matrix, color-coded Mermaid palette, 5-level confidence scale, DIW weighting, quality gate | ALL | Evidence (25%), Depth (25%), Structural (20%), Actionable (15%), Neutrality (15%), ICD 203 (pass/fail) | **Always read first** — orchestrates every other methodology and names every output file with its template | | **☆ Tradecraft** | **[Political Style Guide](political-style-guide.md)** | **Tradecraft anchors:** F3EAD, PIR/EEI, Admiralty Code, ICD 203, WEP + ODNI, SATs, Collection Management Matrix | ALL | Writing standards, 4 depth tiers, evidence density, Mermaid conventions | **Read second** — defines all tradecraft standards referenced by other methodologies | +| **🕵️ Tradecraft Canon** | **[OSINT / INTOP Tradecraft Standards](osint-tradecraft-standards.md)** | ICD 203 (9 standards) · Admiralty Code (6×6 → 5-level confidence) · WEP / Kent Scale (7 bands, EN+SV) · SAT catalog (10 core + 5 supporting) · OSINT ethics (GDPR Art. 9) · DIW–Admiralty reconciliation · PIR handoff | ALL | Source grading, estimative vocabulary, technique attestation, ethics & scope, DIW alignment, cross-cycle continuity | **Read alongside style guide** — canonical reference for every evidence citation, confidence marker, and `methodology-reflection.md §ICD 203 audit` | | **Family A** | **[Synthesis & Scoring Methodology](synthesis-methodology.md)** | Step-by-step production of significance-scoring, synthesis-summary, stakeholder-perspectives, stakeholder-impact, executive-brief | ANALYZE→DISSEMINATE | DIW 6-dimension weighting, Confidence (5-level), Winner/loser quantification, 400–600 word brief budget | Every workflow — 5 Family A core files | | **Family B** | **[Structural Metadata Methodology](structural-metadata-methodology.md)** | Step-by-step production of data-download-manifest and cross-reference-map with SLA table and relationship taxonomy | FIND→FIX | Freshness SLA per source, Relationship taxonomy (7 edge types), Coordinated-activity detection | Every workflow — 2 Family B provenance files | | **Family C** | **[Strategic Extensions Methodology](strategic-extensions-methodology.md)** | Step-by-step production of scenario-analysis, comparative-international, devils-advocate (ACH), intelligence-assessment, ⭐ methodology-reflection (VITAL run-audit) | ANALYZE | Scenario probability ≤ 100%, ACH evidence matrix, Peer-country benchmark, Key Judgments + PIR | **Core — every run produces all 5** | @@ -513,6 +515,20 @@ graph TB --- +### 🕵️ OSINT / INTOP Tradecraft Standards — `osint-tradecraft-standards.md` + +| Attribute | Value | +|-----------|-------| +| **Purpose** | Single canonical reference for professional intelligence tradecraft applied across every artifact in `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`. Anchors the source-grading, estimative-vocabulary, technique-attestation, DIW–Admiralty reconciliation, and PIR-handoff practices already referenced in prose by every other methodology. | +| **Scope** | Every analytical artifact (Family A–E) + every article generated from those artifacts. Mandatory reading during Pass 1. | +| **Seven Pillars** | §1 ICD 203 (9 ODNI analytic standards) · §2 Admiralty Code (6×6 matrix → 5-level confidence) · §3 WEP / Kent Scale (7 bands, EN + SV phrasing, 4 horizons) · §4 SAT Catalog (10 core + 5 supporting) · §5 OSINT Ethics & Scope (GDPR Art. 9, Offentlighetsprincipen) · §6 DIW Weighting Alignment (Admiralty floors per DIW tier) · §7 PIR Handoff (standing Riksdag PIR-1–7 + Tier-C continuity contract) | +| **Key Concepts** | Source grade `[A-F][1-6]` · 🟦/🟩/🟧/🟥/⬛ confidence · WEP bands (`almost no chance` → `almost certain`, each with Swedish equivalent) · SAT attestation in `methodology-reflection.md` (≥ 10 techniques) · Source Diversity Rule (≥ 3 primary + ≥ 1 secondary per P0/P1 claim) · Standing PIR catalogue (coalition stability, opposition cohesion, position drift, Election 2026 pathway, institutional risk, economic transmission, foreign-policy alignment) | +| **Enforced by** | `05-analysis-gate.md` checks 4 (evidence), 5 (Mermaid), 7 (Family C structure — ACH ≥ 3 hypotheses, ICD 203 audit), 8 (Family D structure — ≥ 10 dated forward indicators across 4 horizons). Tier-C additive gate (`ext/tier-c-aggregation.md`) enforces §7 PIR handoff. | +| **Cross-References** | Cited in prose by `political-style-guide.md`, `ai-driven-analysis-guide.md`, `synthesis-methodology.md`, `strategic-extensions-methodology.md`, `electoral-domain-methodology.md`. Cited by the template `methodology-reflection.md` and by `04-analysis-pipeline.md` supporting-frameworks list. | +| **Version** | 1.0 | + +--- + ## 🗂️ Family Production Methodologies — one per Family A–E These five methodology documents tell an agentic workflow **exactly how to produce each output file**, with step-by-step protocols, color-coded Mermaid, evidence rules, quality gates, and template bindings. diff --git a/analysis/methodologies/osint-tradecraft-standards.md b/analysis/methodologies/osint-tradecraft-standards.md new file mode 100644 index 0000000000..a27517b09a --- /dev/null +++ b/analysis/methodologies/osint-tradecraft-standards.md @@ -0,0 +1,491 @@ + + + +

+ Hack23 Logo +

+ +

🕵️ OSINT / INTOP Tradecraft Standards — Riksdagsmonitor

+ +

+ 📊 Canonical Professional Tradecraft Reference for Swedish Political Intelligence Analysis
+ 🎯 ICD 203 · Admiralty Code · Kent / Words of Estimative Probability · Structured Analytic Techniques · OSINT Ethics · GDPR Art. 9 +

+ +

+ Owner + Version + Effective Date + Review Cycle + Classification +

+ +**📋 Document Owner:** CEO | **📄 Version:** 1.0 | **📅 Last Updated:** 2026-04-22 (UTC) +**🔄 Review Cycle:** Quarterly | **⏰ Next Review:** 2026-07-22 +**🏢 Owner:** Hack23 AB (Org.nr 5595347807) | **🏷️ Classification:** Public + +--- + +## 🎯 Purpose + +This document is the **single canonical source** for professional intelligence-tradecraft standards applied across the Riksdagsmonitor analysis library. It complements the domain frameworks ([classification](political-classification-guide.md) · [risk](political-risk-methodology.md) · [threat](political-threat-framework.md) · [SWOT](political-swot-framework.md) · [style](political-style-guide.md) · [AI guide](ai-driven-analysis-guide.md)) and the Family A–E production methodologies ([synthesis](synthesis-methodology.md) · [structural-metadata](structural-metadata-methodology.md) · [strategic-extensions](strategic-extensions-methodology.md) · [electoral-domain](electoral-domain-methodology.md) · [per-document](per-document-methodology.md)) with **cross-cutting analytic discipline** used by professional open-source intelligence (OSINT) and intelligence-operations (INTOP) organisations. + +Every analytical artifact produced under `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/` — and every article generated from those artifacts — is expected to conform to the **seven pillars** below: + +1. **§1. ICD 203 Analytic Tradecraft Standards** — what "good analysis" looks like (9 ODNI standards). +2. **§2. Admiralty Code** — how to grade every source and every piece of information. +3. **§3. Words of Estimative Probability** — a calibrated vocabulary for probabilistic claims. +4. **§4. Structured Analytic Techniques (SAT) Catalog** — the named techniques that give the `methodology-reflection.md` artifact its evidence base. +5. **§5. OSINT Sourcing Ethics & Scope (GDPR Article 9 compliant)** — the boundaries of what this project will and will not do. +6. **§6. DIW Weighting Alignment** — how tradecraft labels reconcile with the Decision-Impact-Weight scoring used in `significance-scoring.md`. +7. **§7. PIR Handoff** — how Priority Intelligence Requirements persist across cycles so Tier-C workflows build on, rather than restart, prior-run intelligence. + +**Scope.** This document describes *how* to analyse. Artifact shapes and Swedish-specific subject-matter rules stay in the domain frameworks and in the Family-A/B/C/D/E production methodologies. + +--- + +## 🛡️ ISMS Policy Alignment + +| Policy | Relevance | +|---|---| +| [Hack23 AI_Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/AI_Policy.md) | Governs LLM-driven analysis. §1 (objectivity, explained uncertainties) and §5 (no private-life data on MPs) operationalise its requirements. | +| [Information Security Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Information_Security_Policy.md) | §2 source-grading and §3 estimative language constitute the risk-calibrated evidence discipline the ISMS expects. | +| [Open Source Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Open_Source_Policy.md) | §5 public-domain-only rule enforces licence-compatible sourcing. | +| [Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) | §4 SAT catalog is the analytic equivalent of SDLC security gates. | +| [CLASSIFICATION.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) | Political-opinion data (GDPR Article 9) — §5.3 public-figure / public-capacity rule. | + +--- + +## 📐 Relationship to Existing Frameworks + +```mermaid +%%{init: {"theme":"dark","themeVariables":{"primaryColor":"#1565C0","primaryTextColor":"#ffffff","primaryBorderColor":"#0A3F7F","lineColor":"#90CAF9","secondaryColor":"#2E7D32","secondaryTextColor":"#ffffff","tertiaryColor":"#FF9800","tertiaryTextColor":"#000000","fontFamily":"Inter, Helvetica, Arial, sans-serif"}}}%% +flowchart TB + subgraph TRADECRAFT["🕵️ Tradecraft Layer — THIS DOCUMENT"] + ICD["§1 ICD 203
9 Analytic Standards"] + ADM["§2 Admiralty Code
Source × Info Grading"] + WEP["§3 WEP / Kent Scale
Estimative Vocabulary"] + SAT["§4 SAT Catalog
10 Core + 5 Supporting"] + ETH["§5 OSINT Ethics
Scope & GDPR"] + DIW["§6 DIW Alignment
Significance Scoring"] + PIR["§7 PIR Handoff
Cross-cycle Continuity"] + end + + subgraph DOMAIN["🏛️ Riksdag Domain Frameworks"] + CLASS["Classification
(what kind of event?)"] + RISK["Risk
(L × I)"] + THREAT["Threat Taxonomy
(5 dimensions)"] + SWOT["SWOT + TOWS
(strategic synthesis)"] + STYLE["Style
(writing standards)"] + GUIDE["AI Guide
(pass structure)"] + end + + subgraph FAMILY["📘 Family A–E Production"] + A["A Core Synthesis (9)"] + B["B Structural (2)"] + C["C Extensions (5)"] + D["D Domain (7)"] + E["E Per-document (N)"] + end + + subgraph OUTPUT["📄 Per-Artifact Output"] + ART["analysis/daily/
$ARTICLE_DATE/
$SUBFOLDER/"] + REFL["methodology-reflection.md ⭐"] + end + + ICD -->|"governs quality"| DOMAIN + ADM -->|"grades evidence in"| DOMAIN + WEP -->|"calibrates claims in"| DOMAIN + SAT -->|"names techniques in"| DOMAIN + ETH -->|"constrains"| DOMAIN + DIW -->|"weights ranking in"| FAMILY + PIR -->|"threads cycles in"| FAMILY + DOMAIN --> FAMILY + FAMILY -->|"produces"| ART + ART -->|"audited by"| REFL + SAT -.->|"attested in"| REFL + + style ICD fill:#1565C0,color:#fff,stroke:#0D47A1 + style ADM fill:#1565C0,color:#fff,stroke:#0D47A1 + style WEP fill:#1565C0,color:#fff,stroke:#0D47A1 + style SAT fill:#1565C0,color:#fff,stroke:#0D47A1 + style ETH fill:#1565C0,color:#fff,stroke:#0D47A1 + style DIW fill:#1565C0,color:#fff,stroke:#0D47A1 + style PIR fill:#1565C0,color:#fff,stroke:#0D47A1 + style CLASS fill:#00695C,color:#fff,stroke:#004D40 + style RISK fill:#E65100,color:#fff,stroke:#BF360C + style THREAT fill:#B71C1C,color:#fff,stroke:#880E4F + style SWOT fill:#1B5E20,color:#fff,stroke:#0D3910 + style STYLE fill:#4A148C,color:#fff,stroke:#311B92 + style GUIDE fill:#0D47A1,color:#fff,stroke:#082664 + style A fill:#7B1FA2,color:#fff,stroke:#4A148C + style B fill:#7B1FA2,color:#fff,stroke:#4A148C + style C fill:#7B1FA2,color:#fff,stroke:#4A148C + style D fill:#7B1FA2,color:#fff,stroke:#4A148C + style E fill:#7B1FA2,color:#fff,stroke:#4A148C + style ART fill:#512DA8,color:#fff,stroke:#311B92 + style REFL fill:#FFC107,color:#000,stroke:#7F6000 +``` + +The tradecraft layer does not replace any existing framework — it is the cross-cutting analytic discipline that every framework and every artifact applies. + +--- + +## 1️⃣ ICD 203 — Analytic Tradecraft Standards + +The [US Office of the Director of National Intelligence](https://www.odni.gov/) publishes [**Intelligence Community Directive 203 — Analytic Standards**](https://www.odni.gov/files/documents/ICD/ICD%20203%20Analytic%20Standards.pdf), the most widely adopted professional benchmark for analytic quality. The standards are framework-agnostic and equally applicable to Swedish political-intelligence work. + +### 1.1 The Nine Standards + +| # | Standard | Meaning in the Riksdagsmonitor context | Canonical evidence artifact | +|---|---|---|---| +| **1** | **Objective** | Analysis reflects evidence, not the analyst's preferences. Party-group affiliations are described in terms of positions taken, not moral judgements. The eight riksdag parties (S, SD, M, V, C, KD, MP, L) receive equal analytical treatment. | Every artifact; specifically `synthesis-summary.md` Executive Finding. | +| **2** | **Independent of political considerations** | The analysis is the same regardless of which coalition holds the majority. No deference to the government (SD-M-KD-L), opposition (S-MP-V-C), Talmannen, or any individual minister / spokesperson. | `stakeholder-perspectives.md`, `coalition-mathematics.md`, `media-framing-analysis.md`. | +| **3** | **Timely** | Breaking-news artifacts (`realtime-*/`) publish within the scheduled cadence; morning (propositions / motions / committee-reports / interpellations), midday (week-ahead / month-ahead), evening (evening-analysis) and review (weekly-review / monthly-review) workflows respect their schedule. | All workflows; enforced by the gh-aw schedule triggers. | +| **4** | **Based on all available sources of intelligence** | Every claim is cross-checked against the `riksdag-regering` MCP feeds available at run-time; SCB for statistics; World Bank / IMF for macroeconomic context; feed failures are logged and a direct-endpoint fallback (`data.riksdagen.se`, `regeringen.se`, `api.scb.se`) attempted. | `data-download-manifest.md`, `comparative-international.md`. | +| **5a** | **Tradecraft — describes quality and credibility of underlying sources** | Every source citation carries an Admiralty grade (see §2). Feed failures and degraded modes are explicit. | `data-download-manifest.md` §"Collection Transparency"; `methodology-reflection.md` §Source Diversity. | +| **5b** | **Tradecraft — expresses and explains uncertainties** | Every probabilistic claim uses a WEP band (see §3) and carries a 🟦 / 🟩 / 🟧 / 🟥 / ⬛ confidence marker (see [`political-style-guide.md`](political-style-guide.md) §5-Level Confidence Scale). | `synthesis-summary.md`, `scenario-analysis.md`, `risk-assessment.md`, `forward-indicators.md`, `threat-analysis.md`, `intelligence-assessment.md`. | +| **5c** | **Tradecraft — distinguishes assumptions from judgements** | Structural assumptions (e.g. "Government coalition SD-M-KD-L holds 176 mandate"; "Opposition S-MP-V-C cohesion on budget ≥ 80 %") are named in the Key Assumptions Check (see §4). | `devils-advocate.md` §Key Assumptions Check; `methodology-reflection.md` §Assumptions audit. | +| **5d** | **Tradecraft — incorporates analysis of alternatives** | At least one alternative hypothesis is tested in every significant analytic judgement via ACH (see §4) and at least one Red-Team position is surfaced. | `devils-advocate.md` (≥ 3 competing hypotheses); `scenario-analysis.md` (≥ 3 scenarios). | +| **5e** | **Tradecraft — demonstrates customer relevance** | Every artifact names the decision or monitor it informs. Forward-looking artifacts include named watchpoints with trigger thresholds and dates. | `executive-brief.md` §"3 Decisions This Brief Supports"; `forward-indicators.md` (≥ 10 dated indicators across 4 horizons). | +| **5f** | **Tradecraft — uses clear and logical argumentation** | Every numbered section advances a single claim; no paragraph exceeds 150 words without structure; every Mermaid diagram is explained in adjacent prose. | Every artifact; enforced by Pass 2 readback (see [`ai-driven-analysis-guide.md`](ai-driven-analysis-guide.md) §Step 9). | +| **5g** | **Tradecraft — explains change or consistency** | Every run that follows a prior same-type run documents position deltas vs the previous cycle's artifacts in `cross-reference-map.md §Sibling folders / Prior cycle`. | `cross-reference-map.md`; Tier-C `intelligence-assessment.md` prior-cycle PIR ingestion. | +| **5h** | **Tradecraft — makes accurate judgements and assessments** | Judgements are calibrated to the evidence via §3 WEP bands; confidence asymmetries (e.g. high evidence, low confidence) are stated. | `intelligence-assessment.md` §Key Judgments (≥ 3 with confidence labels); per-document `documents/{dok_id}-analysis.md`. | +| **5i** | **Tradecraft — incorporates effective visual information where appropriate** | Every Family A and Family D synthesis artifact carries ≥ 1 Hack23-themed colour-coded Mermaid diagram (gate check 5). | Every artifact with a *Mandatory Mermaid* rule — `synthesis-summary.md`, `swot-analysis.md`, `risk-assessment.md`, `threat-analysis.md`, `stakeholder-perspectives.md`, `significance-scoring.md`, `classification-results.md`, `cross-reference-map.md`, `executive-brief.md`, `coalition-mathematics.md`, `forward-indicators.md`. | + +### 1.2 Using ICD 203 in the Pass 2 Readback + +During Pass 2 (see [`ai-driven-analysis-guide.md`](ai-driven-analysis-guide.md) §Step 9), the agent reads the entire run output and answers, section-by-section, "which ICD 203 standard does this section satisfy?". Any section that cannot be mapped to at least one standard is rewritten in Pass 2. + +The `methodology-reflection.md` artifact records the run's compliance against all nine standards — this is gate check 7 in [`05-analysis-gate.md`](../../.github/prompts/05-analysis-gate.md). + +--- + +## 2️⃣ Admiralty Code — Source × Information Grading + +The [NATO Admiralty Code (Admiralty System, STANAG 2511)](https://nsa.nato.int/) is the standard OSINT / INTOP grading scheme for evidence. Every citation in an analytic artifact carries **two letters**: source reliability and information credibility. + +### 2.1 Source Reliability (letter) + +| Grade | Label | Meaning in the Riksdagsmonitor context | +|:---:|---|---| +| **A** | Completely reliable | Official Riksdag feed (`data.riksdagen.se`), Regeringen (`regeringen.se`), SCB (`api.scb.se`), ECB, IMF, World Bank, and any document reachable through the `riksdag-regering` MCP Server with a direct `dok_id` (e.g. `H901FiU1`, `HD03239`). | +| **B** | Usually reliable | Public-service media (SVT, SR), TT Nyhetsbyrån, major Swedish dailies with parliamentary reporters (DN, SvD, Aftonbladet, Expressen covering institutional facts), Swedish university research centres (SIEPS, UI, SNS, SCB-affiliated). | +| **C** | Fairly reliable | Partisan-leaning but editorially accountable outlets (ETC, Nyheter Idag, Fria Tidningar), think-tank briefings (Timbro, Katalys, Arena Idé, Fores), trade-press (Dagens Industri, Altinget, Europaportalen). | +| **D** | Not usually reliable | General-interest press without parliamentary accreditation, commentary / opinion pieces from partisan outlets, social-media posts from verified but non-institutional accounts. | +| **E** | Unreliable | Anonymous social-media actors, blog commentary without disclosed authorship, outlets with documented track record of factual errors on Swedish politics. | +| **F** | Cannot be judged | Anonymous source, machine-generated summary, or any source whose provenance cannot be determined. | + +### 2.2 Information Credibility (digit) + +| Grade | Label | Meaning | +|:---:|---|---| +| **1** | Confirmed by other sources | Multiple **A**-graded sources agree and the primary record is reachable (e.g. `get_voteringar` returns matching tallies cross-checked against riksdagen.se HTML). | +| **2** | Probably true | A single **A**-graded primary record exists, or multiple **B** sources agree. | +| **3** | Possibly true | One **B**-graded source or multiple lower-grade sources agree; no primary contradiction found. | +| **4** | Doubtful | Information is plausible but uncorroborated. | +| **5** | Improbable | Information contradicts prior evidence without strong reason. | +| **6** | Cannot be judged | Credibility cannot be assessed (e.g. degraded MCP mode; data not available). | + +### 2.3 The 6 × 6 Matrix and Confidence Mapping + +The 36 combinations collapse into five bands that map directly to the Riksdagsmonitor **5-level confidence scale** (see `political-style-guide.md`). + +``` + Information Credibility + 1 2 3 4 5 6 + ┌─────────────────────────────────────────────────┐ + A │ 🟦 🟩 🟩 🟧 🟥 🟧 │ + B │ 🟩 🟩 🟧 🟧 🟥 🟧 │ + C │ 🟩 🟧 🟧 🟥 🟥 🟥 │ + D │ 🟧 🟧 🟥 🟥 🟥 ⬛ │ + E │ 🟥 🟥 🟥 🟥 ⬛ ⬛ │ + F │ 🟧 🟧 🟥 🟥 ⬛ ⬛ │ + └─────────────────────────────────────────────────┘ + Source Reliability +``` + +- **🟦 VERY HIGH (A1)** — multi-source primary-record confirmation; fit to anchor a headline judgement. +- **🟩 HIGH (A2–A3, B1–B2, C1)** — primary-source evidence or tightly corroborated secondary evidence; fit to support a headline judgement. +- **🟧 MEDIUM (A4, B3–B4, B6, C2–C3, D1–D2, F1–F2)** — indicative but not conclusive; must be flanked by at least one other piece of evidence before supporting a headline judgement. +- **🟥 LOW (C4–C5, D3–D5, E1–E4, F3–F4)** — noted but never anchors a top-level judgement on its own; typically cited only in explicit "what we do not know" sections. +- **⬛ VERY LOW (D6, E5–E6, F5–F6)** — excluded from analysis or framed as "unverified report", never as judgement. + +### 2.4 Notation in Artifacts + +Every evidence citation carries its grade inline or in a dedicated **Admiralty** column: + +> *"Regeringen's proposition Prop. 2025/26:48 passed the finansutskottet 9–8 on 2026-04-21 with SD-M-KD-L supporting [`get_voteringar(bet=FiU48)`, **A1**]."* + +For tables, a dedicated **Admiralty** column is preferred (already mandatory in Riksdag templates v4.3 — see [`analysis/templates/README.md`](../templates/README.md) §Evidence Column Requirements). + +### 2.5 When Grades Downgrade Analytic Claims + +- Any claim supported only by grade-D or grade-E sources **must** be marked 🟥 LOW confidence. +- Any claim supported only by grade-F sources **must** be excluded or framed as "unverified report" (never as a judgement). +- Degraded MCP mode (e.g. `riksdag-regering-ai.onrender.com` cold-start fallback to direct `data.riksdagen.se`) automatically downgrades source reliability by one letter for all affected citations in the run and is logged in `data-download-manifest.md §Collection Transparency`. +- Single-source claims (any grade) are flagged `[unconfirmed]` per the **Source Diversity Rule** (see §2.6 below). + +### 2.6 Source Diversity Rule (Riksdag-specific) + +P0 / P1 claims (top-tier significance, see `significance-scoring.md`) require: + +| Source tier | Minimum requirement | +|-------------|---------------------| +| **Primary** (riksdag-regering MCP, data.riksdagen.se, regeringen.se) | ≥ 3 independent documents / tool calls | +| **Secondary** (SCB, World Bank, IMF, SVT, TT, DN, SvD) | ≥ 1 corroborating source | +| **Tertiary** (think-tank / academic / specialist press) | Optional enrichment | + +A P0 / P1 claim that violates this rule is blocked by `05-analysis-gate.md` check 4 and must be labelled `[single-source]` or rewritten in Pass 2. + +--- + +## 3️⃣ Words of Estimative Probability (WEP / Kent Scale) + +Professional intelligence analysis uses a **calibrated probabilistic vocabulary** pioneered by [Sherman Kent](https://www.cia.gov/resources/csi/studies-in-intelligence/) and formalised in successive [National Intelligence Council](https://www.dni.gov/index.php/who-we-are/organizations/mission-integration/nic) products. Riksdagsmonitor adopts a seven-band scheme aligned with the ODNI reference. + +### 3.1 The Seven Bands + +Canonical seven-band vocabulary matches [`political-style-guide.md §Confidence Scale`](political-style-guide.md) — **do not substitute synonyms** (e.g. "probable", "highly probable", "almost no chance") in analytic conclusions. + +| Band | English phrase | Swedish equivalent (for SV articles) | Numeric range | Indicative usage | +|:---:|---|---|:---:|---| +| **1** | **Remote** | *Så gott som utesluten* | 1 – 7 % | "V voting to support the government's defence-budget proposition is remote." | +| **2** | **Very unlikely** | *Mycket osannolikt* | 10 – 20 % | "A split within SD over migration policy before the 2026 election is very unlikely given the party's current whip discipline." | +| **3** | **Unlikely** | *Osannolikt* | 20 – 37 % | "Unilateral Regeringskansliet blocking of an EU-initiated trilogue is unlikely, given Sweden's Council commitments." | +| **4** | **Roughly even** | *Ungefär lika sannolikt som inte* | 45 – 55 % | "There is a roughly even chance that C and L will split over budget priorities in Q3." | +| **5** | **Likely** | *Sannolikt* | 63 – 80 % | "The M–KD compromise on the Wind-Power Revenue Act (HD03239) will likely survive the chamber vote." | +| **6** | **Very likely** | *Mycket sannolikt* | 80 – 90 % | "Very likely the budget discharge will pass on first chamber vote." | +| **7** | **Almost certain** | *Så gott som säkert* | 93 – 99 % | "Extra amendment budget FiU48 is almost certain to be adopted this plenary." | + +### 3.2 Banned Terms in Analytic Conclusions + +The following English / Swedish terms are **ambiguous** and must be replaced with one of the seven bands whenever they carry probabilistic weight: + +- *possibly, may, might, could, perhaps, conceivably* / *möjligen, kanske, eventuellt, kan komma att* — uncalibrated. +- *significant chance, real risk, cannot be ruled out* / *betydande risk, kan inte uteslutas* — hedging without bands. +- *imminent* / *omedelbart förestående* without a date — descriptive, not estimative. +- *many, most, some, several* / *många, de flesta, några, flera* — when used of actor counts, replace with numerics (e.g. "6 of 8 parties", "176 out of 349 mandate"). + +These words remain acceptable in descriptive passages (e.g. "The Commission may publish its communication in Q3"), but not in analytic conclusions or headline judgements. + +### 3.3 Pairing With Admiralty Grades + +Every WEP-banded claim carries an Admiralty suffix (see §2.4). Example canonical form: + +> *"A government-coalition split on the Wind-Power Revenue Act is **unlikely** (20–45 %) [`get_voteringar`, `get_ledamot` — historical cohesion 2022–2025, **A1**]. Confidence: 🟩 HIGH. Horizon: operational (7–90 days)."* + +The pairing forces the analyst to reconcile *what we claim* (WEP band) with *why we claim it* (Admiralty grade) and makes every forecast falsifiable after the event. + +### 3.4 Time Horizon Discipline + +Every estimative claim names an explicit horizon aligned with Riksdag's legislative rhythm: + +- **Tactical** — next 0–7 days (current plenary week, current committee cycle). +- **Operational** — next 7–90 days (within the current riksmöte session, up to the next major budget milestone). +- **Strategic** — next 90 days – 18 months (within the current mandate period, up to the 2026 election). +- **Structural** — 18+ months (term-on-term, multi-mandate trends). + +A claim without an explicit horizon is rejected in Pass 2 and flagged by `05-analysis-gate.md` check 8 (`forward-indicators.md` requires ≥ 10 dated indicators across these four horizons). + +--- + +## 4️⃣ Canonical Structured Analytic Techniques (SAT) Catalog + +The `methodology-reflection.md` artifact requires **≥ 10 SATs applied per run** with artifact citations. This catalog defines those techniques so the attestation is substantive rather than nominal. The canonical reference is Heuer & Pherson, *Structured Analytic Techniques for Intelligence Analysis* (3rd ed., CQ Press, 2020). + +### 4.1 Core Techniques (required) + +| # | Technique | Definition | When to apply | Required output | Canonical artifact | +|---|---|---|---|---|---| +| **1** | **Analysis of Competing Hypotheses (ACH)** | Matrix comparing ≥ 3 hypotheses against all evidence; hypothesis with the fewest inconsistencies wins. | Whenever the analysis has ≥ 2 plausible explanations (e.g. a budget-vote outcome with multiple coalition drivers). | Matrix table: hypotheses × evidence cells with C / I / N markings, inconsistency count per hypothesis. | `devils-advocate.md` (≥ 3 hypotheses — enforced by gate check 7). | +| **2** | **Key Assumptions Check (KAC)** | Explicit list of the structural assumptions underpinning the analysis, with a rebuttal for each. | Every run; at least the top 5 assumptions (e.g. coalition stability, opposition cohesion, SD-M-KD-L budget alignment). | Table: assumption, basis, rebuttal, confidence if wrong. | `devils-advocate.md` §KAC; `methodology-reflection.md` §Assumptions audit. | +| **3** | **Quality of Information Check** | Per-source Admiralty grade audit and a "what we do not know" section. | Every run. | Source-grade distribution table; gaps list. | `data-download-manifest.md §Collection Transparency`; `methodology-reflection.md §Source Diversity`. | +| **4** | **Indicators & Signposts** | Pre-specified observable events that would confirm or refute each scenario. | Every forecast artifact. | ≥ 3 indicators per scenario, each with date, source, trigger threshold. | `forward-indicators.md` (≥ 10 dated indicators across 4 horizons — enforced by gate check 8); `scenario-analysis.md §Leading indicators`. | +| **5** | **What-If Analysis** | Starts from a specified low-probability but high-impact event; works backwards to indicators. | When the risk register contains ≥ 1 tail event (e.g. government-crisis, misstroendeförklaring, sudden resignation). | Narrative scenario + reverse-causal chain. | `scenario-analysis.md §Wild-card scenario`; `risk-assessment.md §Cascading chains`. | +| **6** | **High-Impact / Low-Probability Analysis** | Structured risk-register entry for tail-risk events that conventional scenario analysis deprioritises. | At least one per breaking / weekly / monthly run. | Named event, trigger, impact vector, early-warning indicator, resilience test. | `risk-assessment.md §Tail risks`; `scenario-analysis.md` 4th-scenario slot. | +| **7** | **Red Team / Devil's Advocate** | Independent reading that actively argues against the main judgement. | Every run with a headline judgement. | Named alternative position, 3 strongest counter-points, minimum viable disconfirming evidence. | `devils-advocate.md` (dedicated artifact — enforced by gate check 7). | +| **8** | **Pre-Mortem** | Before publication, the analyst asks: "imagine this conclusion is wrong in 90 days — why?" | Every forecast artifact; optional for retrospective artifacts. | List of the top 3 failure modes with observable markers. | `scenario-analysis.md §Pre-Mortem`; `methodology-reflection.md §Failure modes`. | +| **9** | **Scenario Analysis** | Produces 3–5 plausible futures with probabilities summing to ~100 %. | Every forward-looking artifact. | Named scenarios, WEP-banded probability per scenario, indicators per scenario. | `scenario-analysis.md` (≥ 3 scenarios — enforced by gate check 7). | +| **10** | **Lightweight ACH (per-file)** | Tabular version of ACH used in per-file artifacts where full ACH is not practical. | Per-file analyses with ≥ 1 contested interpretation. | 2-column table with C / I / N markings per evidence × hypothesis. | `documents/{dok_id}-analysis.md` per-file artifacts. | + +### 4.2 Supporting Techniques (apply as appropriate) + +- **PESTLE** — political / economic / social / technological / legal / environmental decomposition. Canonical in `comparative-international.md` and `implementation-feasibility.md`. +- **Stakeholder Mapping** — position × power × interest grid. Canonical in `stakeholder-perspectives.md`. +- **Bayesian Update** — prior × likelihood → posterior for cross-run confidence updating. Canonical in `risk-assessment.md §Posterior probabilities` and Tier-C `intelligence-assessment.md`. +- **Force-Field Analysis** — drivers vs. restrainers of a given coalition outcome. Canonical in `coalition-mathematics.md`. +- **Cone of Plausibility** — four-quadrant forecast laying out best / plausible / worst / wildcard cases. Canonical in `scenario-analysis.md`. + +### 4.3 Attestation Requirement + +Each applied technique appears in the `methodology-reflection.md §3 SAT table` with: technique name, canonical artifact where applied, one-sentence outcome (what the technique revealed), and Pass (1 / 2). A technique listed without a canonical artifact reference is rejected in Pass 2. The `methodology-reflection.md` artifact **must** name ≥ 10 applied techniques drawn from §4.1 + §4.2 — this is gate check 7 in [`05-analysis-gate.md`](../../.github/prompts/05-analysis-gate.md). + +--- + +## 5️⃣ OSINT Sourcing Ethics & Scope (GDPR Article 9) + +Political intelligence is a disciplined craft with hard ethical boundaries. The following rules are **non-negotiable** and supersede any analytic consideration. Political opinions are **GDPR Article 9 special category data**; lawful bases are Art. 9(2)(e) (data manifestly made public by the data subject) and Art. 9(2)(g) (processing necessary for reasons of substantial public interest — democratic accountability journalism). + +### 5.1 In Scope + +- **Public institutional records** — every Riksdag document, procedure, vote, speech, report, question (fråga), interpellation, motion, committee report, and adopted text retrievable through the `riksdag-regering` MCP Server or `data.riksdagen.se`. +- **Official publications** — Regeringen (SOU, Ds, propositions, directives, uppdrag), Riksrevisionen, Justitieombudsmannen, Justitiekanslern, SCB, Riksbanken, Konjunkturinstitutet, Finanspolitiska rådet, and equivalent Swedish government open-data portals. +- **EU / international institutional** — EUR-Lex, Commission register, Council documents, Eurostat, ECB, IMF, World Bank. +- **Public statements by MPs (riksdagsledamöter) and parties** — press releases, recorded plenary speeches (anföranden), committee interventions, signed motions, interpellations. +- **Reputable Swedish press with parliamentary accreditation** — SVT, SR, TT, DN, SvD, DI, Altinget, Europaportalen. +- **Academic literature** — peer-reviewed political-science scholarship on Swedish politics, Riksdag dynamics, electoral behaviour. + +### 5.2 Out of Scope (never collected, never cited) + +- **Personal-life data on MPs, ministers, or their staff** — family, health, private residences, personal relationships, private finances beyond published **åtaganden / register over ekonomiska intressen** declarations. This aligns with the [Hack23 AI_Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/AI_Policy.md) prohibition on processing personal data outside stated purpose, and [CLASSIFICATION.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) restrictions on Article 9 data. +- **Doxing or aggregation targeting individuals** — even if each datum is individually public, aggregated profiles focused on private life are out of scope. +- **Paywalled or licence-restricted sources** — analysis relies on open-data sources. Subscription-only policy-tracker content is not re-published; if an analyst uses it, it is cited but not quoted at length, and the claim must independently pass §2 Admiralty grading. +- **Leaked material of unknown provenance** — any source that cannot be verified against a published primary record is grade F and excluded from headline judgements. +- **Covert collection** — social-engineering, scraping behind authentication walls, deceptive personas, or any technique that would require consent under GDPR. +- **Unverified social-media rumour** — social-media posts by verified institutional accounts (e.g. verified party / ministry accounts) are grade B3; all other social-media content is grade E or F and never carries a judgement. + +### 5.3 GDPR and Proportionality Discipline + +The analysis focuses on **public figures acting in their public capacity** and on **institutional process**. Where an MP name appears, it appears in connection with a specific vote, speech, motion, or interpellation — never in connection with private life. This is consistent with the public-figure limit under GDPR Article 6(1)(f) legitimate-interest processing + Article 9(2)(e)+(g) exemptions, applied to political accountability journalism under the Swedish [Tryckfrihetsförordningen](https://www.riksdagen.se/sv/dokument-och-lagar/dokument/svensk-forfattningssamling/tryckfrihetsforordning-1949105_sfs-1949-105/) and [Yttrandefrihetsgrundlagen](https://www.riksdagen.se/sv/dokument-och-lagar/dokument/svensk-forfattningssamling/yttrandefrihetsgrundlag-19911469_sfs-1991-1469/) constitutional-order principles (Offentlighetsprincipen). + +A [Data Protection Impact Assessment (DPIA)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Information_Security_Policy.md) applies whenever aggregation scope expands beyond the institutional-action focus described above. + +### 5.4 Attribution and Reproducibility + +- Every non-trivial claim cites the primary `riksdag-regering` MCP tool call, `dok_id`, or primary-source URL that backs it. +- Every artifact lists the MCP tool calls attempted in the run (successful and failed) in `data-download-manifest.md §Collection Transparency`, so a third party can reproduce the evidence collection. +- The `data-download-manifest.md §Collection Transparency` block is the run's transparency ledger — it is not optional and is enforced by `05-analysis-gate.md` check 2 (per-document coverage). + +### 5.5 Licence and Republication + +- All Riksdagsmonitor analysis is published under the repository's Apache-2.0 licence with SPDX headers. +- Re-publication of third-party text is limited to short excerpts with clear attribution and only to the extent supported by the source's own licence (Riksdagen and Regeringen material is generally reusable; commercial-press content is not re-published). +- SPDX headers on every markdown file under `analysis/` make the licence chain machine-verifiable. + +--- + +## 6️⃣ DIW Weighting Alignment + +The **Decision-Impact-Weight (DIW)** score in `significance-scoring.md` is the Riksdag-specific operationalisation of ICD 203 §5e (customer relevance). This section aligns the tradecraft grading of §§2–3 with DIW so Pass-2 rewrites are internally consistent. + +### 6.1 DIW ↔ Admiralty ↔ Confidence + +| DIW tier | Score range | Minimum Admiralty floor | Minimum confidence | Typical application | +|---------:|:-----------:|:-----------------------:|:------------------:|---------------------| +| **L1 Surface** | < 5.0 | C3 | 🟧 MEDIUM | Metadata, procedural notes, routine interpellations. | +| **L2 Strategic** | 5.0 – 6.9 | B2 | 🟩 HIGH | Standard news-day items, committee-level developments. | +| **L2+ Priority** | 7.0 – 8.4 | A2 | 🟩 HIGH | Headline items, coalition-relevant motions/propositions. | +| **L3 Intelligence-grade** | ≥ 8.5 | A1 | 🟦 VERY HIGH | Budget-defining votes, government-crisis signals, election-pivotal events. | + +A document whose evidence does not meet the Admiralty floor for its DIW tier must be either (a) downgraded one tier, (b) enriched with additional sources to clear the floor, or (c) flagged `[insufficient-evidence]` in Pass 2. This mapping is audited in `methodology-reflection.md §DIW-Admiralty reconciliation`. + +### 6.2 DIW ↔ WEP Horizon + +| DIW tier | Default primary horizon | Secondary horizon allowed | +|---------:|-------------------------|---------------------------| +| **L1 Surface** | Tactical (0–7 d) | — | +| **L2 Strategic** | Operational (7–90 d) | Tactical | +| **L2+ Priority** | Operational + Strategic | Tactical | +| **L3 Intelligence-grade** | Strategic (90 d – 18 m) + Structural (18 m+) | Operational | + +Mismatches (e.g. an L3 item whose only forward indicators are tactical) are rewritten in Pass 2 to add strategic / structural horizons — this is the "timeliness check" audited in `methodology-reflection.md §Horizon coverage`. + +### 6.3 Sensitivity to Source Diversity + +When §2.6 Source Diversity Rule is violated for an item, its DIW score is capped at the next-lower tier until the violation is resolved. A P0 claim cannot remain P0 without ≥ 3 primary sources. + +--- + +## 7️⃣ PIR Handoff — Cross-Cycle Continuity + +**Priority Intelligence Requirements (PIRs)** are the persistent questions Riksdagsmonitor is tracking across cycles. They live in `intelligence-assessment.md §PIRs for next cycle` and are the handoff mechanism between daily → weekly → monthly → election cycles. + +### 7.1 Standing Riksdag PIR Catalogue (baseline) + +| PIR ID | Question | Primary artifact | Typical horizon | +|--------|----------|------------------|-----------------| +| **PIR-1** | Coalition stability — will SD-M-KD-L hold on the next budget-defining vote? | `coalition-mathematics.md` + `risk-assessment.md` | Operational | +| **PIR-2** | Opposition cohesion — will S-MP-V-C coordinate on specific motions? | `stakeholder-perspectives.md` + `cross-reference-map.md` | Operational | +| **PIR-3** | Party-position drift — is any party's stated position on policy X inconsistent with its 2022 manifesto? | `media-framing-analysis.md` + `historical-parallels.md` | Strategic | +| **PIR-4** | Election 2026 pathway — what seat-projection deltas emerge from this week's developments? | `election-2026-analysis.md` + `voter-segmentation.md` | Strategic | +| **PIR-5** | Institutional risk — are there credible signals of procedural or constitutional friction (e.g. Talmannen rulings, konstitutionsutskottet actions)? | `threat-analysis.md` + `implementation-feasibility.md` | Operational + Strategic | +| **PIR-6** | Economic transmission — how do SCB / World Bank / IMF signals translate into budget-vote pressure? | `comparative-international.md` + economic-context sections | Strategic | +| **PIR-7** | Foreign-policy alignment — EU Council, NATO, and Nordic-cooperation posture of the current government vs the opposition's stated position. | `comparative-international.md` + `threat-analysis.md` | Strategic + Structural | + +Workflows are free to add cycle-specific PIRs beyond PIR-1–7 in their `intelligence-assessment.md`. + +### 7.2 Handoff Contract + +Every Tier-C run (`news-evening-analysis`, `news-week-ahead`, `news-month-ahead`, `news-weekly-review`, `news-monthly-review`, `news-realtime-monitor`, `news-article-generator` deep-inspection) **must**: + +1. Read the most recent prior-cycle `intelligence-assessment.md` from the sibling-folder set defined in [`ext/tier-c-aggregation.md`](../../.github/prompts/ext/tier-c-aggregation.md). +2. Extract unresolved PIRs and list them under `intelligence-assessment.md §Carried-forward PIRs` in the current cycle. +3. Either answer the PIR (with evidence, Admiralty grade, WEP band) or re-forward it with an updated signpost. +4. Record the prior-cycle folder path in `cross-reference-map.md §Sibling folders`. + +This contract is enforced by the Tier-C additive gate in `ext/tier-c-aggregation.md`. A Tier-C run whose `intelligence-assessment.md` does not carry forward at least one prior-cycle PIR is rewritten in Pass 2. + +### 7.3 PIR Retirement + +A PIR is retired when: + +- (a) The underlying question is definitively resolved (e.g. coalition-stability question after a failed misstroendeförklaring vote), **and** +- (b) The retirement is recorded in `methodology-reflection.md §PIR retirement log` with date and evidence `dok_id` / primary-source URL. + +Retired PIRs are not re-introduced in subsequent cycles unless new evidence explicitly reopens them. + +--- + +## 🧪 Quick-Reference Checklist + +Before a run's PR is created, verify each line: + +- [ ] Every headline judgement uses a **WEP band** (§3.1) and names a **time horizon** (§3.4). +- [ ] Every evidence citation carries an **Admiralty grade** (§2.1–2.2) inline or in a dedicated Admiralty column. +- [ ] Every probabilistic claim is paired with a 🟦 / 🟩 / 🟧 / 🟥 / ⬛ **confidence marker** consistent with §2.3. +- [ ] The `methodology-reflection.md §SAT table` names **≥ 10 techniques** drawn from §4 with artifact citations and Pass identifiers. +- [ ] No artifact contains banned terms (§3.2) in analytic conclusions; descriptive uses are OK. +- [ ] At least **one alternative hypothesis** (§4 technique 1 or 7) is surfaced for every headline judgement — via `devils-advocate.md` (≥ 3 ACH hypotheses). +- [ ] **No personal-life data** on MPs / ministers appears anywhere under `analysis/daily/` (§5.2). +- [ ] Every source is **grade A – F** in scope (§5.1–5.2); anything outside scope is removed. +- [ ] **DIW–Admiralty reconciliation** passes (§6.1): every item's source floor meets its DIW tier requirement. +- [ ] **PIR handoff** (§7.2) is recorded for every Tier-C run — `intelligence-assessment.md` carries forward ≥ 1 prior-cycle PIR. +- [ ] **Source Diversity Rule** (§2.6) holds for every P0 / P1 claim: ≥ 3 primary + ≥ 1 secondary source. +- [ ] `methodology-reflection.md §ICD 203 audit` maps each of the 9 standards to at least one artifact section. + +--- + +## 🔗 Related Documents + +- [`ai-driven-analysis-guide.md`](ai-driven-analysis-guide.md) — pass structure; §Step 9 Pass-2 readback operationalises this document's checklist. +- [`per-document-methodology.md`](per-document-methodology.md) — per-document construction rules; §10 lightweight-ACH in per-file artifacts. +- [`synthesis-methodology.md`](synthesis-methodology.md) — Family A synthesis + DIW weighting. +- [`strategic-extensions-methodology.md`](strategic-extensions-methodology.md) — Family C (executive brief, intelligence assessment, scenario, devil's advocate, methodology reflection). +- [`electoral-domain-methodology.md`](electoral-domain-methodology.md) — Family D (election, coalition math, voter segmentation, historical parallels, media framing, implementation feasibility, forward indicators). +- [`structural-metadata-methodology.md`](structural-metadata-methodology.md) — Family B (manifest + cross-reference). +- [`political-style-guide.md`](political-style-guide.md) — §Estimative Language & Source Grading cross-references this document. +- [`political-risk-methodology.md`](political-risk-methodology.md) — Likelihood × Impact; likelihoods use §3 bands. +- [`political-threat-framework.md`](political-threat-framework.md) — Political Threat Taxonomy; claims about intent / capability use §3 bands. +- [`political-swot-framework.md`](political-swot-framework.md) — SWOT + TOWS; evidence rows use §2 grading. +- [`political-classification-guide.md`](political-classification-guide.md) — 7-dimension classification. +- [`../templates/methodology-reflection.md`](../templates/methodology-reflection.md) — the run's tradecraft attestation artifact. +- [`../../.github/prompts/04-analysis-pipeline.md`](../../.github/prompts/04-analysis-pipeline.md) — workflow contract that mandates reading this document in Pass 1. +- [`../../.github/prompts/05-analysis-gate.md`](../../.github/prompts/05-analysis-gate.md) — gate checks 4, 5, 7, 8 enforce the disciplines defined here. +- [Hack23 AI_Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/AI_Policy.md) — responsible-AI governance. +- [Hack23 CLASSIFICATION](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) — Article 9 / special-category-data handling. + +## 📚 External References + +- Office of the Director of National Intelligence. **ICD 203 — Analytic Standards.** 2015 revision. +- Kent, Sherman. *Words of Estimative Probability*. CIA Studies in Intelligence, 1964 (declassified 1993). +- Heuer, R. J. *Psychology of Intelligence Analysis*. CIA Center for the Study of Intelligence, 1999. +- Heuer, R. J. & Pherson, R. H. *Structured Analytic Techniques for Intelligence Analysis* (3rd ed.). CQ Press, 2020. +- NATO. *Intelligence Handbook* (AJP-2.1); *Admiralty System* (STANAG 2511). +- UK Ministry of Defence. *Red Teaming Handbook* (3rd ed.), 2021. +- Riksdagen. *Tryckfrihetsförordningen* (1949:105). +- Riksdagen. *Yttrandefrihetsgrundlagen* (1991:1469). + +--- + +**Document Control:** `/analysis/methodologies/osint-tradecraft-standards.md` · v1.0 · Applies to every workflow and every artifact under `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`. diff --git a/analysis/templates/README.md b/analysis/templates/README.md index a78bcd0aaf..ebf5383e51 100644 --- a/analysis/templates/README.md +++ b/analysis/templates/README.md @@ -174,36 +174,67 @@ Every `methodology-reflection.md` includes an ICD 203 compliance checklist verif ## 🤖 Artifact → workflow → gate check mapping -The 12 agentic news workflows in `.github/workflows/news-*.md` render these templates into concrete artifacts under `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`. Authoring contract: [`.github/prompts/README.md`](../../.github/prompts/README.md). +The 12 agentic news workflows in `.github/workflows/news-*.md` render these templates into concrete artifacts under `analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`. Authoring contract: [`.github/prompts/README.md`](../../.github/prompts/README.md). Tradecraft canon: [`../methodologies/osint-tradecraft-standards.md`](../methodologies/osint-tradecraft-standards.md). -**9 core artifacts** (every news workflow): +**23 always-produced artifacts per run** (every news workflow — single-type + Tier-C): + +### 📘 Family A — Core Synthesis (9 artifacts) | Template | Produced artifact | Enforced by `05-analysis-gate.md` | |----------|-------------------|-----------------------------------| -| [`synthesis-summary.md`](synthesis-summary.md) | `synthesis-summary.md` (lead story + DIW ranking + ≥ 1 Mermaid diagram) | Check 1 (presence), Check 5 (Mermaid) | -| [`swot-analysis.md`](swot-analysis.md) | `swot-analysis.md` with TOWS matrix | Check 1, Check 4 (evidence) | -| [`risk-assessment.md`](risk-assessment.md) | `risk-assessment.md` (top 5 risks, likelihood × impact) | Check 1 | -| [`threat-analysis.md`](threat-analysis.md) | `threat-analysis.md` (attack tree + MITRE-style TTP) | Check 1 | -| [`stakeholder-impact.md`](stakeholder-impact.md) | `stakeholder-perspectives.md` (named actors + influence network) | Check 1 | -| [`significance-scoring.md`](significance-scoring.md) | `significance-scoring.md` (DIW scores + sensitivity) | Check 1, Check 4 (evidence per ranked item / table row / Mermaid node) | +| — (index, hand-written) | `README.md` (run index) | Check 1 (presence) | +| [`synthesis-summary.md`](synthesis-summary.md) | `synthesis-summary.md` (lead story + DIW ranking + ≥ 1 Mermaid) | Check 1 + 5 (Mermaid) | +| [`executive-brief.md`](executive-brief.md) | `executive-brief.md` (BLUF + 3 decisions supported + 400–600 words) | Check 1 + 7 (BLUF / Decisions) | +| [`significance-scoring.md`](significance-scoring.md) | `significance-scoring.md` (DIW scores + sensitivity) | Check 1 + 4 (evidence per ranked item) | | [`political-classification.md`](political-classification.md) | `classification-results.md` (priority tiers, retention) | Check 1 | -| [`cross-reference-map.md`](cross-reference-map.md) | `cross-reference-map.md` (continuity contracts) | Check 1 | -| [`data-download-manifest.md`](data-download-manifest.md) | `data-download-manifest.md` (pre-computed by download step) | Check 1 | -| [`per-file-political-intelligence.md`](per-file-political-intelligence.md) | `documents/{dok_id}-analysis.md` (one per document) | Check 2 (per-doc coverage) | +| [`swot-analysis.md`](swot-analysis.md) | `swot-analysis.md` with TOWS matrix | Check 1 + 4 (evidence) | +| [`risk-assessment.md`](risk-assessment.md) | `risk-assessment.md` (top 5 risks, L × I, cascading) | Check 1 | +| [`threat-analysis.md`](threat-analysis.md) | `threat-analysis.md` (Political Threat Taxonomy + attack trees) | Check 1 | +| [`stakeholder-impact.md`](stakeholder-impact.md) | `stakeholder-perspectives.md` (named actors + influence network) | Check 1 | + +### 📗 Family B — Structural Metadata (2 artifacts) + +| Template | Produced artifact | Enforced by | +|----------|-------------------|-------------| +| [`data-download-manifest.md`](data-download-manifest.md) | `data-download-manifest.md` (pre-computed by download step, collection transparency) | Check 1 | +| [`cross-reference-map.md`](cross-reference-map.md) | `cross-reference-map.md` (continuity contracts, sibling folders) | Check 1 | + +### 📙 Family C — Strategic Extensions (5 artifacts, F3EAD Exploit → Analyze) -**5 additional Tier-C artifacts** (aggregation / reference-grade workflows — see [`ext/tier-c-aggregation.md`](../../.github/prompts/ext/tier-c-aggregation.md)): +| Template | Produced artifact | Enforced by | +|----------|-------------------|-------------| +| [`intelligence-assessment.md`](intelligence-assessment.md) | `intelligence-assessment.md` (≥ 3 Key Judgments + PIRs) | Check 7 (≥ 3 KJ + PIR) | +| [`scenario-analysis.md`](scenario-analysis.md) | `scenario-analysis.md` (≥ 3 scenarios with posteriors + indicators) | Check 7 (≥ 3 scenarios) | +| [`devils-advocate.md`](devils-advocate.md) | `devils-advocate.md` (≥ 3 ACH hypotheses, KAC, Red Team) | Check 7 (≥ 3 ACH hypotheses) | +| [`comparative-international.md`](comparative-international.md) | `comparative-international.md` (≥ 2 peer-country rows via WB / IMF / SCB) | Check 7 (≥ 2 comparators) | +| [`methodology-reflection.md`](methodology-reflection.md) | `methodology-reflection.md` (ICD 203 audit, ≥ 10 SATs, DIW reconciliation, PIR retirement log) | Check 7 (ICD 203 audit present) | + +### 📕 Family D — Electoral & Domain Lenses (7 artifacts, F3EAD Analyze continued) + +| Template | Produced artifact | Enforced by | +|----------|-------------------|-------------| +| [`election-2026-analysis.md`](election-2026-analysis.md) | `election-2026-analysis.md` (seat deltas, campaign implications) | Check 8 | +| [`voter-segmentation.md`](voter-segmentation.md) | `voter-segmentation.md` (SCB segment cuts) | Check 8 | +| [`coalition-mathematics.md`](coalition-mathematics.md) | `coalition-mathematics.md` (Sainte-Laguë seat table) | Check 8 (seat-count table) | +| [`historical-parallels.md`](historical-parallels.md) | `historical-parallels.md` (≥ 2 historical episodes) | Check 8 | +| [`media-framing-analysis.md`](media-framing-analysis.md) | `media-framing-analysis.md` (framing vectors × parties) | Check 8 | +| [`implementation-feasibility.md`](implementation-feasibility.md) | `implementation-feasibility.md` (actor-capacity + timeline) | Check 8 | +| [`forward-indicators.md`](forward-indicators.md) | `forward-indicators.md` (≥ 10 dated indicators across 4 horizons) | Check 8 (≥ 10 dated indicators) | + +### 📒 Family E — Per-Document (N artifacts) | Template | Produced artifact | Enforced by | |----------|-------------------|-------------| -| — (run index, hand-written) | `README.md` | Tier-C gate block | -| [`executive-brief.md`](executive-brief.md) | `executive-brief.md` (2-page decision-maker brief) | Tier-C gate block | -| [`scenario-analysis.md`](scenario-analysis.md) | `scenario-analysis.md` (≥ 3 scenarios with posteriors) | Tier-C gate (scenario count ≥ 3) | -| [`comparative-international.md`](comparative-international.md) | `comparative-international.md` (cross-country via WB/IMF/SCB) | Tier-C gate (≥ 2 countries referenced) | -| [`methodology-reflection.md`](methodology-reflection.md) | `methodology-reflection.md` (what worked, biases, uncertainty log) | Tier-C gate block | +| [`per-file-political-intelligence.md`](per-file-political-intelligence.md) | `documents/{dok_id}-analysis.md` (one per input document) | Check 2 (per-doc coverage) | + +**Tier-C additive contract** (aggregation workflows: `news-evening-analysis`, `news-week-ahead`, `news-month-ahead`, `news-weekly-review`, `news-monthly-review`, `news-realtime-monitor`, `news-article-generator`) — no extra files beyond the 23 above; instead: -**Supporting templates** (consumed ad-hoc by the artifacts above — not directly gated): +- **Period-scope multipliers** on DIW scoring and section depth. +- **Cross-type sibling citations** recorded in `cross-reference-map.md §Sibling folders`. +- **Prior-cycle PIR ingestion** in `intelligence-assessment.md §Carried-forward PIRs` (see [`../methodologies/osint-tradecraft-standards.md#7️⃣-pir-handoff--cross-cycle-continuity`](../methodologies/osint-tradecraft-standards.md#7️⃣-pir-handoff--cross-cycle-continuity)). +- **1500-word article floor** for the generated news article. -- [`coalition-mathematics.md`](coalition-mathematics.md), [`devils-advocate.md`](devils-advocate.md), [`election-2026-analysis.md`](election-2026-analysis.md), [`forward-indicators.md`](forward-indicators.md), [`historical-parallels.md`](historical-parallels.md), [`implementation-feasibility.md`](implementation-feasibility.md), [`intelligence-assessment.md`](intelligence-assessment.md), [`media-framing-analysis.md`](media-framing-analysis.md), [`voter-segmentation.md`](voter-segmentation.md). +Enforced by the Tier-C additive gate in [`ext/tier-c-aggregation.md`](../../.github/prompts/ext/tier-c-aggregation.md). **Upstream gh-aw documentation** (link-out only): · ·