Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/news-committee-reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,49 @@ Every generated article must include:

If the generated article lacks these analytical sections, manually add contextual analysis before committing.

## MANDATORY Quality Validation

After article generation, verify EACH article meets these minimum standards before committing.

### Required Sections (at least 3 of 5):
1. **Analytical Lede** (paragraph, not just document count)
2. **Thematic Analysis** (documents grouped by policy theme)
3. **Strategic Context** (why these documents matter politically)
4. **Stakeholder Impact** (who benefits, who loses)
5. **What Happens Next** (expected timeline and outcomes)

### Disqualifying Patterns:
- ❌ `"Filed by: Unknown (Unknown)"` — FIX author/party metadata before committing
- ❌ `data-translate="true"` spans in non-Swedish articles — TRANSLATE before committing
- ❌ Identical "Why It Matters" text for all entries — DIFFERENTIATE analysis per report
- ❌ Flat list of reports without grouping — GROUP by committee or policy theme
- ❌ Article under 500 words — EXPAND with analytical sections

### Bash Validation Commands:
```bash
# Check for unknown authors (should return 0)
grep -rl "Filed by: Unknown" news/ | grep "committee-reports" | wc -l || true

# Check for untranslated spans in English article (should return 0)
grep -c 'data-translate="true"' "news/$(date +%Y-%m-%d)-committee-reports-en.html" 2>/dev/null || true

# Check word count of English article text content (must be >= 500; HTML tags stripped)
FILE="news/$(date +%Y-%m-%d)-committee-reports-en.html"
if [ ! -f "$FILE" ]; then echo "ERROR: Expected article file not found: $FILE" >&2; exit 1; fi
WORD_COUNT="$(sed 's/<[^>]*>/ /g' "$FILE" | tr -s '[:space:]' '\n' | grep -c '[[:alnum:]]' 2>/dev/null || echo 0)"
echo "Content word count (HTML tags stripped): $WORD_COUNT"
if [ "$WORD_COUNT" -lt 500 ]; then echo "ERROR: Article content too short (must be at least 500 words)." >&2; exit 1; fi

# Check for duplicate "Why It Matters" content (should return empty)
grep -o 'Why It Matters[^<]*' "news/$(date +%Y-%m-%d)-committee-reports-en.html" 2>/dev/null | sort | uniq -d || true
```

### If Article Fails Quality Check:
1. Use bash to enhance the HTML with analytical sections
2. Replace generic "Why It Matters" with report-specific analysis
3. Add thematic grouping headers (e.g., by committee or policy domain)
4. Translate any remaining Swedish content

### Step 5: Regenerate Indexes
```bash
npx tsx scripts/generate-news-indexes.ts
Expand Down
45 changes: 44 additions & 1 deletion .github/workflows/news-motions.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,49 @@ Every generated article must include:

If the generated article lacks these analytical sections, manually add contextual analysis before committing.

## MANDATORY Quality Validation

After article generation, verify EACH article meets these minimum standards before committing.

### Required Sections (at least 3 of 5):
1. **Analytical Lede** (paragraph, not just document count)
2. **Thematic Analysis** (documents grouped by policy theme)
3. **Strategic Context** (why these documents matter politically)
4. **Stakeholder Impact** (who benefits, who loses)
5. **What Happens Next** (expected timeline and outcomes)

### Disqualifying Patterns:
- ❌ `"Filed by: Unknown (Unknown)"` — FIX author/party metadata before committing
- ❌ `data-translate="true"` spans in non-Swedish articles — TRANSLATE before committing
- ❌ Identical "Why It Matters" text for all entries — DIFFERENTIATE analysis per motion
- ❌ Flat list of motions without grouping — GROUP by policy theme or party
- ❌ Article under 500 words — EXPAND with analytical sections

### Bash Validation Commands:
```bash
# Check for unknown authors (should return 0)
grep -l "Filed by: Unknown" news/*-opposition-motions-*.html 2>/dev/null | wc -l || true
Comment on lines +214 to +217
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section uses the opposition-motions slug/filename pattern in its validation commands, but later in the workflow the "Article Naming Convention" still states YYYY-MM-DD-motions-{lang}.html. Update that naming convention section to the actual generator output (YYYY-MM-DD-opposition-motions-{lang}.html) so readers don’t validate the wrong filenames.

Copilot uses AI. Check for mistakes.

# Check for untranslated spans in English article (should return 0)
grep -c 'data-translate="true"' "news/$(date +%Y-%m-%d)-opposition-motions-en.html" 2>/dev/null || true

# Check word count of English article text content (must be >= 500; HTML tags stripped)
FILE="news/$(date +%Y-%m-%d)-opposition-motions-en.html"
if [ ! -f "$FILE" ]; then echo "ERROR: Expected article file not found: $FILE" >&2; exit 1; fi
WORD_COUNT="$(sed 's/<[^>]*>/ /g' "$FILE" | tr -s '[:space:]' '\n' | grep -c '[[:alnum:]]' 2>/dev/null || echo 0)"
echo "Content word count (HTML tags stripped): $WORD_COUNT"
if [ "$WORD_COUNT" -lt 500 ]; then echo "ERROR: Article content too short (must be at least 500 words)." >&2; exit 1; fi

# Check for duplicate "Why It Matters" content (should return empty)
grep -o 'Why It Matters[^<]*' "news/$(date +%Y-%m-%d)-opposition-motions-en.html" 2>/dev/null | sort | uniq -d || true
```

### If Article Fails Quality Check:
1. Use bash to enhance the HTML with analytical sections
2. Replace generic "Why It Matters" with motion-specific analysis
3. Add thematic grouping headers (e.g., by policy area or party)
4. Translate any remaining Swedish content

```bash
npx tsx scripts/generate-news-indexes.ts
```
Expand All @@ -203,4 +246,4 @@ npx tsx scripts/generate-news-indexes.ts
- ZERO TOLERANCE for language mixing

## Article Naming Convention
Files: `YYYY-MM-DD-motions-{lang}.html`
Files: `YYYY-MM-DD-opposition-motions-{lang}.html`
45 changes: 44 additions & 1 deletion .github/workflows/news-propositions.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,49 @@ Every generated article must include:

If the generated article lacks these analytical sections, manually add contextual analysis before committing.

## MANDATORY Quality Validation

After article generation, verify EACH article meets these minimum standards before committing.

### Required Sections (at least 3 of 5):
1. **Analytical Lede** (paragraph, not just document count)
2. **Thematic Analysis** (documents grouped by policy theme)
3. **Strategic Context** (why these documents matter politically)
4. **Stakeholder Impact** (who benefits, who loses)
5. **What Happens Next** (expected timeline and outcomes)

### Disqualifying Patterns:
- ❌ `"Filed by: Unknown (Unknown)"` — FIX author/party metadata before committing
- ❌ `data-translate="true"` spans in non-Swedish articles — TRANSLATE before committing
- ❌ Identical "Why It Matters" text for all entries — DIFFERENTIATE analysis per proposition
- ❌ Flat list of propositions without grouping — GROUP by policy theme or ministry
- ❌ Article under 500 words — EXPAND with analytical sections

### Bash Validation Commands:
```bash
# Check for unknown authors (should return 0)
grep -l "Filed by: Unknown" news/*-government-propositions-*.html 2>/dev/null | wc -l || true

# Check for untranslated spans in English article (should return 0)
grep -c 'data-translate="true"' "news/$(date +%Y-%m-%d)-government-propositions-en.html" 2>/dev/null || true
Comment on lines +218 to +222
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section uses the government-propositions slug/filename pattern in its validation commands, but later in the workflow the "Article Naming Convention" still states YYYY-MM-DD-propositions-{lang}.html. Update that naming convention section to the actual generator output (YYYY-MM-DD-government-propositions-{lang}.html) so readers don’t validate the wrong filenames.

Copilot uses AI. Check for mistakes.

# Check word count of English article text content (must be >= 500; HTML tags stripped)
FILE="news/$(date +%Y-%m-%d)-government-propositions-en.html"
if [ ! -f "$FILE" ]; then echo "ERROR: Expected article file not found: $FILE" >&2; exit 1; fi
WORD_COUNT="$(sed 's/<[^>]*>/ /g' "$FILE" | tr -s '[:space:]' '\n' | grep -c '[[:alnum:]]' 2>/dev/null || echo 0)"
echo "Content word count (HTML tags stripped): $WORD_COUNT"
if [ "$WORD_COUNT" -lt 500 ]; then echo "ERROR: Article content too short (must be at least 500 words)." >&2; exit 1; fi

# Check for duplicate "Why It Matters" content (should return empty)
grep -o 'Why It Matters[^<]*' "news/$(date +%Y-%m-%d)-government-propositions-en.html" 2>/dev/null | sort | uniq -d || true
```

### If Article Fails Quality Check:
1. Use bash to enhance the HTML with analytical sections
2. Replace generic "Why It Matters" with proposition-specific analysis
3. Add thematic grouping headers (e.g., by ministry or policy area)
4. Translate any remaining Swedish content

```bash
npx tsx scripts/generate-news-indexes.ts
```
Expand All @@ -206,4 +249,4 @@ npx tsx scripts/generate-news-indexes.ts
- ZERO TOLERANCE for language mixing

## Article Naming Convention
Files: `YYYY-MM-DD-propositions-{lang}.html`
Files: `YYYY-MM-DD-government-propositions-{lang}.html`
Loading
Loading