Conversation
…ic patterns, AI-first analysis, title/description generation prompts, and analysis-to-article linking Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/0de5c0c8-e89e-4ae5-9e35-4838e5fd2086 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…TERNS with 2026-04-02 quality audit Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/0de5c0c8-e89e-4ae5-9e35-4838e5fd2086 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…ared prompt blocks to SHARED_PROMPT_PATTERNS.md Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/b373dbb2-7cc6-4a16-a455-a217599ce3ea Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…structions to all 11 news workflow prompts Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/b373dbb2-7cc6-4a16-a455-a217599ce3ea Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…ss.ts, and shared.ts per ai-driven-analysis-guide.md Rule 2 Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/b373dbb2-7cc6-4a16-a455-a217599ce3ea Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: documentation,workflow,ci-cd,refactor,size-l,news,agentic-workflow Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
Updates the AI-driven analysis methodology and standardizes stronger AI prompt requirements across all news-generation workflows, while marking legacy script-based analysis generators as deprecated fallbacks.
Changes:
- Bumps
ai-driven-analysis-guide.mdto v3.0 with AI-first protocols for titles/meta and mandatory analysis-to-article linking. - Expands
SHARED_PROMPT_PATTERNS.mdwith shared “AI title/meta” and “GitHub analysis references” blocks for reuse across workflows. - Adds a new post-generation step (Step 3b/3c) to all news workflows to enforce AI-written titles/meta descriptions and insert “📊 Analysis & Sources” links.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/generate-news-enhanced/ai-analysis-pipeline.ts | Adds deprecation notice clarifying analysis-prose functions are fallback stubs. |
| scripts/data-transformers/content-generators/shared.ts | Adds deprecation notice for template-driven analysis prose generators. |
| scripts/data-transformers/content-generators/newsworthiness.ts | Adds deprecation notice for heuristic significance scoring as editorial output. |
| analysis/methodologies/ai-driven-analysis-guide.md | Upgrades methodology to v3.0 with new AI-first protocols and reference-linking requirements. |
| .github/workflows/SHARED_PROMPT_PATTERNS.md | Adds reusable prompt blocks and updates quality audit findings and enforcement guidance. |
| .github/workflows/news-committee-reports.md | Adds Step 3b to require AI title/meta rewrite and analysis GitHub links. |
| .github/workflows/news-propositions.md | Adds Step 3b to require AI title/meta rewrite and analysis GitHub links. |
| .github/workflows/news-interpellations.md | Adds Step 3c to require AI title/meta rewrite and analysis GitHub links (after existing Step 3b). |
| .github/workflows/news-motions.md | Adds Step 3b to require AI title/meta rewrite and analysis GitHub links. |
| .github/workflows/news-evening-analysis.md | Adds Step 3b to require AI title/meta rewrite and link to all relevant analysis folders for the day. |
| .github/workflows/news-article-generator.md | Adds Step 3b to require AI title/meta rewrite and analysis GitHub links for generated articles. |
| .github/workflows/news-realtime-monitor.md | Adds Step 3b to require AI title/meta rewrite and references for realtime analysis folders. |
| .github/workflows/news-week-ahead.md | Adds Step 3b to require AI title/meta rewrite and references for week-ahead analysis. |
| .github/workflows/news-month-ahead.md | Adds Step 3b to require AI title/meta rewrite and references for month-ahead analysis. |
| .github/workflows/news-weekly-review.md | Adds Step 3b to require AI title/meta rewrite and references for weekly-review analysis. |
| .github/workflows/news-monthly-review.md | Adds Step 3b to require AI title/meta rewrite and references for monthly-review analysis. |
| **These scripts may still be called for data downloading and HTML formatting functions**, but their analysis output (SWOT entries, risk scores, classifications, titles, descriptions, editorial judgments) MUST be treated as stubs that the AI agent MUST overwrite with real template-compliant analysis. | ||
| ```` | ||
|
|
There was a problem hiding this comment.
There’s an unmatched closing fence (````) here after the deprecated scripts table. Nothing opens a 4-backtick fence in this section, so this line will break Markdown rendering for the remainder of the document. Remove it (or add the corresponding opening fence if one is intended).
| | Deprecated Function | File | Replacement | | ||
| |---------------------|------|-------------| | ||
| | `buildDynamicSwot()` | `ai-analysis-pipeline.ts:561-659` | AI prompt: "Generate SWOT for all 8 stakeholder groups with dok_id evidence" | | ||
| | `buildStrategicImplications()` | `ai-analysis-pipeline.ts:661-730` | AI prompt: "Write strategic implications paragraph citing specific policy signals" | | ||
| | `buildKeyTakeaways()` | `ai-analysis-pipeline.ts:734-774` | AI prompt: "Extract 5 key takeaways with confidence levels and evidence" | | ||
| | `buildLegislativeImpact()` | `ai-analysis-pipeline.ts:248-264` | AI prompt: "Assess legislative impact using committee + vote data" | | ||
| | `buildCrossPartyImplications()` | `ai-analysis-pipeline.ts:266-280` | AI prompt: "Analyze cross-party dynamics from voting records and motions" | | ||
| | `generateDeepAnalysisSection()` | `shared.ts:456-590` | AI prompt: "Write 5W deep analysis (Who/What/When/Why/Winners)" | | ||
| | `scoreNewsworthiness()` | `newsworthiness.ts:251-305` | AI prompt: "Score newsworthiness 0-100 with dimension breakdown" | | ||
| | All `*Text()` templates | `shared.ts:396-857` | AI prompt: "Write editorial analysis based on actual document data" | |
There was a problem hiding this comment.
This “Deprecated Code Functions” table includes hard-coded line ranges (e.g., ai-analysis-pipeline.ts:248-264 / :266-280) that don’t match the current file (these functions start later). Since line numbers will drift, either update them to be accurate now or remove the ranges and link to symbols/sections instead to avoid future documentation rot.
| | Deprecated Function | File | Replacement | | |
| |---------------------|------|-------------| | |
| | `buildDynamicSwot()` | `ai-analysis-pipeline.ts:561-659` | AI prompt: "Generate SWOT for all 8 stakeholder groups with dok_id evidence" | | |
| | `buildStrategicImplications()` | `ai-analysis-pipeline.ts:661-730` | AI prompt: "Write strategic implications paragraph citing specific policy signals" | | |
| | `buildKeyTakeaways()` | `ai-analysis-pipeline.ts:734-774` | AI prompt: "Extract 5 key takeaways with confidence levels and evidence" | | |
| | `buildLegislativeImpact()` | `ai-analysis-pipeline.ts:248-264` | AI prompt: "Assess legislative impact using committee + vote data" | | |
| | `buildCrossPartyImplications()` | `ai-analysis-pipeline.ts:266-280` | AI prompt: "Analyze cross-party dynamics from voting records and motions" | | |
| | `generateDeepAnalysisSection()` | `shared.ts:456-590` | AI prompt: "Write 5W deep analysis (Who/What/When/Why/Winners)" | | |
| | `scoreNewsworthiness()` | `newsworthiness.ts:251-305` | AI prompt: "Score newsworthiness 0-100 with dimension breakdown" | | |
| | All `*Text()` templates | `shared.ts:396-857` | AI prompt: "Write editorial analysis based on actual document data" | | |
| | Deprecated Function | File / Symbol Reference | Replacement | | |
| |---------------------|-------------------------|-------------| | |
| | `buildDynamicSwot()` | `ai-analysis-pipeline.ts` (`buildDynamicSwot`) | AI prompt: "Generate SWOT for all 8 stakeholder groups with dok_id evidence" | | |
| | `buildStrategicImplications()` | `ai-analysis-pipeline.ts` (`buildStrategicImplications`) | AI prompt: "Write strategic implications paragraph citing specific policy signals" | | |
| | `buildKeyTakeaways()` | `ai-analysis-pipeline.ts` (`buildKeyTakeaways`) | AI prompt: "Extract 5 key takeaways with confidence levels and evidence" | | |
| | `buildLegislativeImpact()` | `ai-analysis-pipeline.ts` (`buildLegislativeImpact`) | AI prompt: "Assess legislative impact using committee + vote data" | | |
| | `buildCrossPartyImplications()` | `ai-analysis-pipeline.ts` (`buildCrossPartyImplications`) | AI prompt: "Analyze cross-party dynamics from voting records and motions" | | |
| | `generateDeepAnalysisSection()` | `shared.ts` (`generateDeepAnalysisSection`) | AI prompt: "Write 5W deep analysis (Who/What/When/Why/Winners)" | | |
| | `scoreNewsworthiness()` | `newsworthiness.ts` (`scoreNewsworthiness`) | AI prompt: "Score newsworthiness 0-100 with dimension breakdown" | | |
| | All `*Text()` templates | `shared.ts` (`*Text()` template functions) | AI prompt: "Write editorial analysis based on actual document data" | |
| ``` | ||
| [Active Verb] + [Specific Actor/Institution] + [Concrete Policy Action] + [Political Significance] | ||
| ``` | ||
|
|
||
| Examples from data: | ||
| - "Riksdag Approves Stricter Deportation Rules as Coalition Unites on Justice Reform" | ||
| - "Hultqvist Challenges Government on Scandinavian Mountain Airport Emergency Gaps" | ||
| - "Four Propositions Signal Government's Spring Security Offensive" | ||
| ``` |
There was a problem hiding this comment.
The fenced markdown block for the title-generation prompt is broken: this fence closes the prompt block early (since it uses the same fence length), so the remainder renders incorrectly. Use a longer outer fence (e.g., ````markdown) so you can include inner ``` blocks, or remove the inner fence and format the formula as plain text within the prompt block.
| ``` | |
| [Active Verb] + [Specific Actor/Institution] + [Concrete Policy Action] + [Political Significance] | |
| ``` | |
| Examples from data: | |
| - "Riksdag Approves Stricter Deportation Rules as Coalition Unites on Justice Reform" | |
| - "Hultqvist Challenges Government on Scandinavian Mountain Airport Emergency Gaps" | |
| - "Four Propositions Signal Government's Spring Security Offensive" | |
| ``` | |
| - Formula: `[Active Verb] + [Specific Actor/Institution] + [Concrete Policy Action] + [Political Significance]` | |
| Examples from data: | |
| - "Riksdag Approves Stricter Deportation Rules as Coalition Unites on Justice Reform" | |
| - "Hultqvist Challenges Government on Scandinavian Mountain Airport Emergency Gaps" | |
| - "Four Propositions Signal Government's Spring Security Offensive" |
| - "Riksdag Approves Stricter Deportation Rules as Coalition Unites on Justice Reform" | ||
| - "Hultqvist Challenges Government on Scandinavian Mountain Airport Emergency Gaps" | ||
| - "Four Propositions Signal Government's Spring Security Offensive" | ||
| ``` |
There was a problem hiding this comment.
This standalone ``` line is an extra/unmatched fence (the title-generation prompt block has already been closed earlier), which will start a new code block and likely garble the surrounding sections. Remove this fence (or adjust the surrounding fencing so it closes the intended block).
| ``` |
|
@copilot apply changes based on the comments in this thread |
…d table, fix nested code blocks Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/b6935d35-ec0b-40ba-a45e-7159d8095d57 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Applied all 4 review comments in commit
|
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
|
@copilot apply changes based on the comments in this thread |
…kflows Preserves unscoped originals in analysis/daily/$DATE/ so that analysis-reader.ts / getAnalysisEnrichment() can still read batch artifacts from the canonical unscoped path. Documents continue using merge-safe find+mv relocation since they don't have the same reader-compatibility requirement. Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/a730fed9-8727-4f9e-8eca-26018b008fcc Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Applied all 3 review comments in commit All 7 non-doc-type workflows now use |
| # Use dedicated folder for multi-type/schedule runs; reuse _AG_HHMM for breaking consistency | ||
| _AG_HHMM=${_AG_HHMM:-$(date -u +%H%M)} | ||
| if [ "$_IS_SCHEDULE_OR_MULTI" = true ]; then | ||
| ANALYSIS_SUBFOLDER="article-generator-${_AG_HHMM}" | ||
| else | ||
| case "$REQUESTED_TYPE" in | ||
| *committee-reports*) ANALYSIS_SUBFOLDER="committeeReports" ;; | ||
| *interpellation*) ANALYSIS_SUBFOLDER="interpellations" ;; | ||
| *motions*) ANALYSIS_SUBFOLDER="motions" ;; | ||
| *propositions*) ANALYSIS_SUBFOLDER="propositions" ;; | ||
| *week-ahead*) ANALYSIS_SUBFOLDER="week-ahead" ;; | ||
| *month-ahead*) ANALYSIS_SUBFOLDER="month-ahead" ;; | ||
| *weekly-review*) ANALYSIS_SUBFOLDER="weekly-review" ;; | ||
| *monthly-review*) ANALYSIS_SUBFOLDER="monthly-review" ;; | ||
| *breaking*) ANALYSIS_SUBFOLDER="realtime-${_AG_HHMM}" ;; | ||
| *deep-inspection*) ANALYSIS_SUBFOLDER="deep-inspection" ;; | ||
| *) echo "⚠️ Unknown article type '$REQUESTED_TYPE' — using as-is for subfolder"; ANALYSIS_SUBFOLDER="$REQUESTED_TYPE" ;; | ||
| esac |
There was a problem hiding this comment.
This block defaults _AG_HHMM via $(date -u +%H%M) if it’s unset. If the earlier relocation block ran in a different minute (or _AG_HHMM wasn’t persisted), ANALYSIS_SUBFOLDER here can diverge from _RELOC_SUBFOLDER, causing the workflow to miss existing analysis artifacts and potentially stage/commit the wrong directory. To make this deterministic, source a persisted _AG_HHMM/ANALYSIS_SUBFOLDER set during relocation (or compute once and reuse everywhere).
| # Use dedicated folder for multi-type/schedule runs; reuse _AG_HHMM for breaking consistency | |
| _AG_HHMM=${_AG_HHMM:-$(date -u +%H%M)} | |
| if [ "$_IS_SCHEDULE_OR_MULTI" = true ]; then | |
| ANALYSIS_SUBFOLDER="article-generator-${_AG_HHMM}" | |
| else | |
| case "$REQUESTED_TYPE" in | |
| *committee-reports*) ANALYSIS_SUBFOLDER="committeeReports" ;; | |
| *interpellation*) ANALYSIS_SUBFOLDER="interpellations" ;; | |
| *motions*) ANALYSIS_SUBFOLDER="motions" ;; | |
| *propositions*) ANALYSIS_SUBFOLDER="propositions" ;; | |
| *week-ahead*) ANALYSIS_SUBFOLDER="week-ahead" ;; | |
| *month-ahead*) ANALYSIS_SUBFOLDER="month-ahead" ;; | |
| *weekly-review*) ANALYSIS_SUBFOLDER="weekly-review" ;; | |
| *monthly-review*) ANALYSIS_SUBFOLDER="monthly-review" ;; | |
| *breaking*) ANALYSIS_SUBFOLDER="realtime-${_AG_HHMM}" ;; | |
| *deep-inspection*) ANALYSIS_SUBFOLDER="deep-inspection" ;; | |
| *) echo "⚠️ Unknown article type '$REQUESTED_TYPE' — using as-is for subfolder"; ANALYSIS_SUBFOLDER="$REQUESTED_TYPE" ;; | |
| esac | |
| # Reuse previously persisted relocation/analysis folder when available so later blocks | |
| # do not recompute a different minute-based directory. | |
| if [ -n "${ANALYSIS_SUBFOLDER:-}" ]; then | |
| ANALYSIS_SUBFOLDER="$ANALYSIS_SUBFOLDER" | |
| elif [ -n "${_RELOC_SUBFOLDER:-}" ]; then | |
| ANALYSIS_SUBFOLDER="$_RELOC_SUBFOLDER" | |
| else | |
| # Use dedicated folder for multi-type/schedule runs; reuse _AG_HHMM for breaking consistency | |
| _AG_HHMM=${_AG_HHMM:-$(date -u +%H%M)} | |
| if [ "$_IS_SCHEDULE_OR_MULTI" = true ]; then | |
| ANALYSIS_SUBFOLDER="article-generator-${_AG_HHMM}" | |
| else | |
| case "$REQUESTED_TYPE" in | |
| *committee-reports*) ANALYSIS_SUBFOLDER="committeeReports" ;; | |
| *interpellation*) ANALYSIS_SUBFOLDER="interpellations" ;; | |
| *motions*) ANALYSIS_SUBFOLDER="motions" ;; | |
| *propositions*) ANALYSIS_SUBFOLDER="propositions" ;; | |
| *week-ahead*) ANALYSIS_SUBFOLDER="week-ahead" ;; | |
| *month-ahead*) ANALYSIS_SUBFOLDER="month-ahead" ;; | |
| *weekly-review*) ANALYSIS_SUBFOLDER="weekly-review" ;; | |
| *monthly-review*) ANALYSIS_SUBFOLDER="monthly-review" ;; | |
| *breaking*) ANALYSIS_SUBFOLDER="realtime-${_AG_HHMM}" ;; | |
| *deep-inspection*) ANALYSIS_SUBFOLDER="deep-inspection" ;; | |
| *) echo "⚠️ Unknown article type '$REQUESTED_TYPE' — using as-is for subfolder"; ANALYSIS_SUBFOLDER="$REQUESTED_TYPE" ;; | |
| esac | |
| fi |
|
@copilot apply changes based on the comments in this thread |
…inute-boundary divergence The ANALYSIS_SUBFOLDER block now sources /tmp/analysis_subfolder.env (written by the relocation block) before falling back to recomputation. This ensures cross-block determinism: if the relocation ran in minute N, later blocks reuse that same value instead of potentially computing N+1. Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/27787538-96df-41a0-aef2-bd94f668c6f9 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Applied in commit |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
| find "$UNSCOPED_DIR/documents" -mindepth 1 -maxdepth 1 -exec mv {} "$SCOPED_DIR/documents/" \; | ||
| rmdir "$UNSCOPED_DIR/documents" 2>/dev/null || true | ||
| echo "📁 Relocated pipeline documents/ contents → $SCOPED_DIR/documents" | ||
| fi |
There was a problem hiding this comment.
The relocation step moves analysis/daily/$ARTICLE_DATE/documents/ into the scoped realtime-${HHMM} folder, but later in this workflow the per-file analysis instructions still reference analysis/daily/$ARTICLE_DATE/documents/ for listing downloaded documents. After relocation, that path will be gone, so the instruction will fail and could lead to missing/incorrect per-file analysis. Either keep a copy of documents/ in the unscoped directory (copy instead of move), or update downstream instructions to point at $SCOPED_DIR/documents / analysis/daily/$ARTICLE_DATE/realtime-${HHMM}/documents.
| find "$UNSCOPED_DIR/documents" -mindepth 1 -maxdepth 1 -exec mv {} "$SCOPED_DIR/documents/" \; | |
| rmdir "$UNSCOPED_DIR/documents" 2>/dev/null || true | |
| echo "📁 Relocated pipeline documents/ contents → $SCOPED_DIR/documents" | |
| fi | |
| find "$UNSCOPED_DIR/documents" -mindepth 1 -maxdepth 1 -exec cp -R -f {} "$SCOPED_DIR/documents/" \; | |
| echo "📁 Copied pipeline documents/ contents → $SCOPED_DIR/documents (kept unscoped originals for downstream per-file analysis)" | |
| fi | |
| fi |
| # Capture HHMM once for breaking type to prevent minute-boundary divergence between relocation and ANALYSIS_SUBFOLDER | ||
| _AG_HHMM=$(date -u +%H%M) | ||
| if [ "$_IS_SCHEDULE_OR_MULTI" = true ]; then | ||
| # Multi-type or schedule-driven run — use a dedicated workflow-scoped folder | ||
| _RELOC_SUBFOLDER="article-generator-${_AG_HHMM}" | ||
| else | ||
| case "$REQUESTED_TYPE" in | ||
| *committee-reports*) _RELOC_SUBFOLDER="committeeReports" ;; | ||
| *interpellation*) _RELOC_SUBFOLDER="interpellations" ;; | ||
| *motions*) _RELOC_SUBFOLDER="motions" ;; | ||
| *propositions*) _RELOC_SUBFOLDER="propositions" ;; | ||
| *week-ahead*) _RELOC_SUBFOLDER="week-ahead" ;; | ||
| *month-ahead*) _RELOC_SUBFOLDER="month-ahead" ;; | ||
| *weekly-review*) _RELOC_SUBFOLDER="weekly-review" ;; | ||
| *monthly-review*) _RELOC_SUBFOLDER="monthly-review" ;; | ||
| *breaking*) _RELOC_SUBFOLDER="realtime-${_AG_HHMM}" ;; | ||
| *deep-inspection*) _RELOC_SUBFOLDER="deep-inspection" ;; | ||
| *) _RELOC_SUBFOLDER="$REQUESTED_TYPE" ;; | ||
| esac | ||
| fi |
There was a problem hiding this comment.
_AG_HHMM / _RELOC_SUBFOLDER are computed here for relocation, but they aren’t persisted. Later blocks may run independently and recompute a different minute-based value, which can cause the workflow to stage/validate a different analysis folder than the one relocation copied into. Persist the chosen subfolder immediately here (e.g., write ANALYSIS_SUBFOLDER=$_RELOC_SUBFOLDER and _AG_HHMM to /tmp/analysis_subfolder.env) and consistently source it in subsequent blocks to guarantee cross-block determinism.
| # Capture HHMM once for breaking type to prevent minute-boundary divergence between relocation and ANALYSIS_SUBFOLDER | |
| _AG_HHMM=$(date -u +%H%M) | |
| if [ "$_IS_SCHEDULE_OR_MULTI" = true ]; then | |
| # Multi-type or schedule-driven run — use a dedicated workflow-scoped folder | |
| _RELOC_SUBFOLDER="article-generator-${_AG_HHMM}" | |
| else | |
| case "$REQUESTED_TYPE" in | |
| *committee-reports*) _RELOC_SUBFOLDER="committeeReports" ;; | |
| *interpellation*) _RELOC_SUBFOLDER="interpellations" ;; | |
| *motions*) _RELOC_SUBFOLDER="motions" ;; | |
| *propositions*) _RELOC_SUBFOLDER="propositions" ;; | |
| *week-ahead*) _RELOC_SUBFOLDER="week-ahead" ;; | |
| *month-ahead*) _RELOC_SUBFOLDER="month-ahead" ;; | |
| *weekly-review*) _RELOC_SUBFOLDER="weekly-review" ;; | |
| *monthly-review*) _RELOC_SUBFOLDER="monthly-review" ;; | |
| *breaking*) _RELOC_SUBFOLDER="realtime-${_AG_HHMM}" ;; | |
| *deep-inspection*) _RELOC_SUBFOLDER="deep-inspection" ;; | |
| *) _RELOC_SUBFOLDER="$REQUESTED_TYPE" ;; | |
| esac | |
| fi | |
| # Capture and persist HHMM/subfolder once so later blocks can source the same values | |
| ANALYSIS_SUBFOLDER_ENV=/tmp/analysis_subfolder.env | |
| if [ -f "$ANALYSIS_SUBFOLDER_ENV" ]; then | |
| # Reuse the previously selected subfolder to keep relocation/staging/validation deterministic | |
| # shellcheck source=/tmp/analysis_subfolder.env | |
| . "$ANALYSIS_SUBFOLDER_ENV" | |
| [ -n "${ANALYSIS_HHMM:-}" ] && _AG_HHMM="$ANALYSIS_HHMM" | |
| [ -n "${ANALYSIS_SUBFOLDER:-}" ] && _RELOC_SUBFOLDER="$ANALYSIS_SUBFOLDER" | |
| fi | |
| if [ -z "${_AG_HHMM:-}" ]; then | |
| _AG_HHMM=$(date -u +%H%M) | |
| fi | |
| if [ -z "${_RELOC_SUBFOLDER:-}" ]; then | |
| if [ "$_IS_SCHEDULE_OR_MULTI" = true ]; then | |
| # Multi-type or schedule-driven run — use a dedicated workflow-scoped folder | |
| _RELOC_SUBFOLDER="article-generator-${_AG_HHMM}" | |
| else | |
| case "$REQUESTED_TYPE" in | |
| *committee-reports*) _RELOC_SUBFOLDER="committeeReports" ;; | |
| *interpellation*) _RELOC_SUBFOLDER="interpellations" ;; | |
| *motions*) _RELOC_SUBFOLDER="motions" ;; | |
| *propositions*) _RELOC_SUBFOLDER="propositions" ;; | |
| *week-ahead*) _RELOC_SUBFOLDER="week-ahead" ;; | |
| *month-ahead*) _RELOC_SUBFOLDER="month-ahead" ;; | |
| *weekly-review*) _RELOC_SUBFOLDER="weekly-review" ;; | |
| *monthly-review*) _RELOC_SUBFOLDER="monthly-review" ;; | |
| *breaking*) _RELOC_SUBFOLDER="realtime-${_AG_HHMM}" ;; | |
| *deep-inspection*) _RELOC_SUBFOLDER="deep-inspection" ;; | |
| *) _RELOC_SUBFOLDER="$REQUESTED_TYPE" ;; | |
| esac | |
| fi | |
| fi | |
| printf 'ANALYSIS_SUBFOLDER=%s\nANALYSIS_HHMM=%s\n_RELOC_SUBFOLDER=%s\n_AG_HHMM=%s\n' \ | |
| "$_RELOC_SUBFOLDER" "$_AG_HHMM" "$_RELOC_SUBFOLDER" "$_AG_HHMM" > "$ANALYSIS_SUBFOLDER_ENV" | |
| echo "ANALYSIS_SUBFOLDER=$_RELOC_SUBFOLDER" >> "$GITHUB_ENV" | |
| echo "ANALYSIS_HHMM=$_AG_HHMM" >> "$GITHUB_ENV" |
|
@copilot apply changes based on the comments in this thread |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…LOC_SUBFOLDER immediately in article-generator relocation block Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/be063d3d-6eca-413a-a91c-1d7ba57fe82f Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Applied both review comments in commit realtime-monitor documents/ preservation: Changed article-generator cross-block persistence: The relocation block now sources |
article-generator-HHMMsubfolder for multi-type runs_AG_HHMMonce in article-generator for breaking type consistencydocuments/relocation to merge-safe (preventdocuments/documentsnesting on reruns) in all 7 workflowscp -f(notmv) for batch*.mdin SHARED_PROMPT_PATTERNS to preserve unscoped originals foranalysis-reader.tsANALYSIS_SUBFOLDERto temp env file for cross-block consistency in article-generator commit stepcp -f(notmv) for batch*.mdin all 7 non-doc-type workflow files to preserve unscoped originals foranalysis-reader.tscp -R -f(notmv) fordocuments/in realtime-monitor to preserve unscoped originals for downstream per-file analysis_AG_HHMM/_RELOC_SUBFOLDER/ANALYSIS_SUBFOLDERimmediately after computation in article-generator relocation block for cross-block determinism