Skip to content

Modularize agentic workflow prompts; enforce one PR per run#1924

Merged
pethers merged 23 commits intomainfrom
copilot/cleanup-agentic-workflows
Apr 22, 2026
Merged

Modularize agentic workflow prompts; enforce one PR per run#1924
pethers merged 23 commits intomainfrom
copilot/cleanup-agentic-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

Documentation Excellence & Accuracy Pass — COMPLETE

Comprehensive audit and update of all top-level READMEs and structural docs. All counts reconciled with filesystem; all internal links validated.

New directory-level catalogs (single source of truth)

  • .github/agents/README.md — 24 agent files (14 persona + 9 workflow-specialist .agent.md + 1 shared developer.instructions.md); invocation patterns, 16 KB size limit, decision chart
  • .github/skills/README.md — 91 skills grouped by 12 functional categories with loading semantics
  • .github/workflows/README.md — 45 workflow files (21 standard .yml + 12 agentic .md + 12 compiled .lock.yml) with triggers Mermaid, prompt-import chain, universal security posture
  • .github/prompts/README.md — cross-links to the three new directory READMEs + analysis docs

Canonical deep-reference docs updated

  • WORKFLOWS.md bumped to v7.2 — added Stage 6.1: Agentic Workflow Structure & Prompt Imports (ASCII architecture, dependency graph, import-order contract, single-type vs Tier-C artifact contracts, MCP wiring, compilation lifecycle); skill-count fixed to 91
  • AGENTS.md — cross-linked to .github/agents/README.md; skill-count fixed to 91
  • SKILLS.md — numbered catalog now exactly in sync with filesystem (91/91 match, 0 missing, 0 extras). Added 4 previously-undocumented skills (business-model-canvas, mcp-gateway-configuration, mcp-gateway-security, seo-best-practices); category totals updated (Data Integration 4→6, Business & Marketing 2→3, Government & Regulatory 4→5)

Project-level docs updated

  • README.md — new "🔬 Political Intelligence Analysis & News Creation" section with end-to-end Mermaid + vital-document table; GitHub Copilot Integration section rewritten as directory-README index; Interpellations + Translate schedule rows added; stale "10 workflows" → 12 in two places; Phase 3 status row corrected
  • FUTURE_WORKFLOWS.md — stale agent/skill counts fixed (14 agents → "24 files"; 87 → 91 skills)
  • .github/copilot-instructions.md — workflow line now reflects 45 files (21 + 12 + 12); agent line clarified (14 persona + 9 .agent.md + 1); skills updated to 91

Analysis docs clarified

  • analysis/README.md — template count 8 → 23 (8 core + 15 extended); AI-read-all sentence expanded to name all 5 extra methodology files and all 15 extended templates
  • analysis/methodologies/README.md — template count 8 → 23
  • analysis/templates/README.md — explicit scope note clarifying "v2.3 common improvements for all 8 templates" refers to Family A (original cores); Families B–E inherit where applicable

Verification

Check Result
Filesystem agents 24
Persona agents 14
.agent.md specialists 9
Filesystem skills 91
SKILLS.md numbered-catalog sync with filesystem 91/91
Workflow files 45 (21+12+12) ✅
Agentic news workflows 12 (11 scheduled + 1 on-demand) ✅
Methodologies 11
Templates 23 (Family A:9, B:2, C:5, D:7) ✅
Stale "87 skill" / "10 workflow" / "14 Total" / "35 workflow" references across all READMEs 0
Broken internal links in new READMEs 0

Copilot AI and others added 4 commits April 21, 2026 22:42
…PT_PATTERNS.md, add CI enforcement

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/0756749a-4f26-43bd-b211-ca9f8d00d7a0

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…p; add agent-file rationale

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/56cf966e-03e9-4480-9333-d88493499f1d

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@pethers pethers marked this pull request as ready for review April 21, 2026 23:25
Copilot AI review requested due to automatic review settings April 21, 2026 23:25
@github-actions github-actions Bot added documentation Documentation updates workflow GitHub Actions workflows ci-cd CI/CD pipeline changes skill Skill configuration news News articles and content generation agentic-workflow Agentic workflow changes size-xl Extra large change (> 1000 lines) labels Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: documentation,workflow,ci-cd,skill,size-xl,news,agentic-workflow

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modularizes the agentic-news prompt surface into bounded .github/prompts/ modules and refactors workflows to enforce exactly one safeoutputs___create_pull_request per run, addressing dropped-commit data loss from the previous multi-PR “heartbeat” approach. It also adds CI enforcement for the new prompt/workflow architecture and updates documentation/skill references away from the deleted monolithic prompt file.

Changes:

  • Introduce a modular prompt library under .github/prompts/ (core modules + Tier-C extension + README catalogue).
  • Enforce single-PR runs and modular imports across generated news-*.lock.yml workflows; remove background keep-alive pingers.
  • Add compile-time CI checks to prevent regressions (module/workflow size caps, banned strings, create-pull-request.max: 1) and update docs/skills references.

Reviewed changes

Copilot reviewed 45 out of 46 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/adr/0002-modular-prompts-and-single-pr-runs.md Adds ADR documenting modular prompts + single-PR decision, risks, mitigations, and governance.
analysis/templates/synthesis-summary.md Updates template reference from old shared prompt file to .github/prompts/.
analysis/methodologies/ai-driven-analysis-guide.md Updates enforcement references to .github/prompts/ (but includes a malformed link needing fix).
analysis/imf/README.md Updates reference away from shared prompt file (but new path is incorrect and needs fix).
analysis/README.md Updates fallback mechanism reference to .github/prompts/.
.github/workflows/news-week-ahead.lock.yml Regenerated lock: runtime-import prompt modules; enforce single PR; remove keep-alive pinger.
.github/workflows/news-translate.lock.yml Regenerated lock: runtime-import minimal prompt set; enforce single PR; remove keep-alive pinger.
.github/workflows/news-realtime-monitor.lock.yml Regenerated lock: runtime-import prompt modules; enforce single PR; remove keep-alive pinger.
.github/workflows/news-propositions.lock.yml Regenerated lock: runtime-import prompt modules; enforce single PR; remove keep-alive pinger.
.github/workflows/news-motions.lock.yml Regenerated lock: runtime-import prompt modules; enforce single PR; remove keep-alive pinger.
.github/workflows/news-monthly-review.lock.yml Regenerated lock: runtime-import prompt modules + Tier-C; enforce single PR; remove keep-alive pinger.
.github/workflows/news-month-ahead.lock.yml Regenerated lock: runtime-import prompt modules + Tier-C; enforce single PR; remove keep-alive pinger.
.github/workflows/news-interpellations.lock.yml Regenerated lock: runtime-import prompt modules; enforce single PR; remove keep-alive pinger.
.github/workflows/news-evening-analysis.lock.yml Regenerated lock: runtime-import prompt modules + Tier-C; enforce single PR; remove keep-alive pinger.
.github/workflows/news-committee-reports.lock.yml Regenerated lock: runtime-import prompt modules; enforce single PR; remove keep-alive pinger.
.github/workflows/economic-context-audit.yml Updates comment reference to .github/prompts/ (minor punctuation issue to fix).
.github/workflows/compile-agentic-workflows.yml Adds CI enforcement for module size/workflow size/max=1/banned strings.
.github/skills/riksdag-regering-mcp/SKILL.md Updates reference to new .github/prompts/ catalogue for MCP tool reference.
.github/skills/github-agentic-workflows/SKILL.md Documents imports: semantics and points to .github/prompts/README.md.
.github/skills/gh-aw-workflow-authoring/SKILL.md Adds authoring guidance to use imports: and keep workflows small.
.github/skills/editorial-standards/SKILL.md Updates enforcement reference to methodology guide section instead of deleted shared prompt file.
.github/prompts/ext/tier-c-aggregation.md Adds Tier-C aggregation extension prompt module and extra gate checks.
.github/prompts/README.md Adds prompt library catalogue, dependency matrix, and import-style rationale.
.github/prompts/07-commit-and-pr.md Adds single-PR enforcement and staging/PR template guidance (includes a repo-memory staging issue to fix).
.github/prompts/06-article-generation.md Adds article generation rules and banned patterns module.
.github/prompts/05-analysis-gate.md Adds single blocking analysis gate module (canonical bash example currently doesn’t match stated checks).
.github/prompts/04-analysis-pipeline.md Adds analysis pipeline module (9 artifacts, pass requirements, evidence rules).
.github/prompts/03-data-download.md Adds data download module (subfolder naming, lookback fallback, manifest requirements).
.github/prompts/02-mcp-access.md Adds MCP surface inventory + in-prompt health gate module.
.github/prompts/01-bash-and-shell-safety.md Adds bash tool-call contract + shell hygiene + UTF-8 guidance module.
.github/prompts/00-base-contract.md Adds base contract module (role/ethics/AI-first/pipeline order).

| [SWOT.md](../../SWOT.md) | **Formatting exemplar** (platform SWOT) |
| [THREAT_MODEL.md](../../THREAT_MODEL.md) | **Formatting exemplar** (platform threat model) |
| [SHARED_PROMPT_PATTERNS.md](../../.github/workflows/SHARED_PROMPT_PATTERNS.md) | **Shared news workflow prompts** — quality enforcement |
| [.github/prompts/ (see README)](../../.github/workflows/.github/prompts/ (see README)) | **Shared news workflow prompts** — quality enforcement |
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The Markdown link target here is malformed (it includes .github/workflows/.github/prompts/ and spaces/parentheses inside the URL), so it won’t render as a clickable link. Update it to a valid relative link to the prompt library (e.g., the .github/prompts/README.md entry) without spaces in the URL.

Copilot uses AI. Check for mistakes.
Comment thread analysis/imf/README.md Outdated
- `analysis/imf/use-cases.md` — canonical article examples
- `.github/aw/ECONOMIC_DATA_CONTRACT.md` — v2.0 contract (data artefact shape, validator gates)
- `.github/aw/SHARED_PROMPT_PATTERNS.md` — "Economic Indicator Reference"
- `.github/aw/.github/prompts/ (see README)` — "Economic Indicator Reference"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

This reference path looks incorrect (.github/aw/.github/prompts/… doesn’t exist as a directory structure) and is not a valid link, so readers can’t navigate to the economic indicator reference anymore. Point this to the actual prompt library location (e.g. .github/prompts/README.md or the specific module) using a proper Markdown link.

Copilot uses AI. Check for mistakes.
# the one needed to open a maintenance issue. Follows the project
# workflow security standards (least privilege, step-security/harden-runner,
# SHA-pinned actions — see .github/aw/SHARED_PROMPT_PATTERNS.md).
# SHA-pinned actions — see .github/prompts/ and ISMS CI/CD security guidance).
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

There’s an extra closing parenthesis at the end of this comment, which makes the sentence read incorrectly. Remove the trailing ) so the reference sentence is properly punctuated.

Copilot uses AI. Check for mistakes.
Comment thread .github/prompts/05-analysis-gate.md Outdated
Comment on lines +26 to +38
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"
FAIL=0
for f in $REQ; do
[ -s "$ANALYSIS_DIR/$f" ] || { echo "❌ missing/empty: $f"; FAIL=1; }
done
grep -rIn -e 'AI_MUST_REPLACE' -e '\[REQUIRED\]' -e 'TODO:' -e 'Lorem ipsum' "$ANALYSIS_DIR" \
&& FAIL=1
grep -lE 'H[0-9]{3}[A-Za-z]{2,}[0-9]+' "$ANALYSIS_DIR/swot-analysis.md" >/dev/null \
|| { echo "❌ swot-analysis.md: no dok_id citation"; FAIL=1; }
grep -lE '^```mermaid' "$ANALYSIS_DIR/synthesis-summary.md" >/dev/null \
|| { echo "❌ synthesis-summary.md: missing Mermaid block"; FAIL=1; }
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The module lists 6 blocking checks, but the “Canonical shape” bash gate shown below only implements a subset (it doesn’t check per-document coverage, significance-scoring dok_id citations, Mermaid presence across every synthesis file, or the Pass-2/mtime rule). Either expand the canonical bash block to fully implement checks 1–6, or explicitly label it as a minimal example and point to the additional commands required for the remaining checks.

Suggested change
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"
FAIL=0
for f in $REQ; do
[ -s "$ANALYSIS_DIR/$f" ] || { echo "❌ missing/empty: $f"; FAIL=1; }
done
grep -rIn -e 'AI_MUST_REPLACE' -e '\[REQUIRED\]' -e 'TODO:' -e 'Lorem ipsum' "$ANALYSIS_DIR" \
&& FAIL=1
grep -lE 'H[0-9]{3}[A-Za-z]{2,}[0-9]+' "$ANALYSIS_DIR/swot-analysis.md" >/dev/null \
|| { echo "❌ swot-analysis.md: no dok_id citation"; FAIL=1; }
grep -lE '^```mermaid' "$ANALYSIS_DIR/synthesis-summary.md" >/dev/null \
|| { echo "❌ synthesis-summary.md: missing Mermaid block"; FAIL=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"
)
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"
)
DOK_ID_RE='H[0-9]{3}[A-Za-z]{2,}[0-9]+'
FAIL=0
# 1. Artifact existence
for f in "${REQ[@]}"; do
[ -s "$ANALYSIS_DIR/$f" ] || { echo "❌ missing/empty: $f"; FAIL=1; }
done
# 2. Per-document coverage
if [ -s "$ANALYSIS_DIR/data-download-manifest.md" ]; then
mapfile -t DOK_IDS < <(grep -oE "$DOK_ID_RE" "$ANALYSIS_DIR/data-download-manifest.md" | sort -u)
if [ "${#DOK_IDS[@]}" -eq 0 ]; then
echo "❌ data-download-manifest.md: no dok_id entries found"
FAIL=1
fi
for dok_id in "${DOK_IDS[@]}"; do
doc="$ANALYSIS_DIR/documents/$dok_id.md"
[ -s "$doc" ] || { echo "❌ documents/$dok_id.md missing/empty"; FAIL=1; }
done
fi
# 3. No stubs
if grep -rIn -e 'AI_MUST_REPLACE' -e '\[REQUIRED\]' -e 'TODO:' -e 'Lorem ipsum' "$ANALYSIS_DIR"; then
echo "❌ stub placeholder text detected"
FAIL=1
fi
# 4a. Evidence citations in SWOT — each bullet under each SWOT quadrant needs a dok_id
if [ -s "$ANALYSIS_DIR/swot-analysis.md" ]; then
awk -v re="$DOK_ID_RE" '
BEGIN { bad=0; section="" }
/^##[[:space:]]+(Strengths|Weaknesses|Opportunities|Threats)\b/ { section=$0; next }
section != "" && /^[[:space:]]*[-*][[:space:]]+/ {
if ($0 !~ re) {
printf "❌ swot-analysis.md: missing dok_id in %s -> %s\n", section, $0
bad=1
}
}
END { exit bad }
' "$ANALYSIS_DIR/swot-analysis.md" || FAIL=1
fi
# 4b. Evidence citations in significance scoring — each ranked item needs a dok_id
if [ -s "$ANALYSIS_DIR/significance-scoring.md" ]; then
awk -v re="$DOK_ID_RE" '
BEGIN { bad=0 }
/^[[:space:]]*([0-9]+\.[[:space:]]+|[-*][[:space:]]+)/ {
if ($0 !~ re) {
printf "❌ significance-scoring.md: ranked item missing dok_id -> %s\n", $0
bad=1
}
}
END { exit bad }
' "$ANALYSIS_DIR/significance-scoring.md" || FAIL=1
fi
# 5. Mermaid diagrams with colour-coded style directives in every synthesis file
for f in "${SYNTHESIS[@]}"; do
path="$ANALYSIS_DIR/$f"
[ -s "$path" ] || continue
grep -qE '^```mermaid' "$path" || { echo "❌ $f: missing Mermaid block"; FAIL=1; }
grep -qE '^[[:space:]]*style[[:space:]]+' "$path" || { echo "❌ $f: missing Mermaid style directive"; FAIL=1; }
done
# 6. Pass-2 done — mtime >= birth time + 180s, OR differing pass1 snapshot on disk
for f in "${REQ[@]}"; do
path="$ANALYSIS_DIR/$f"
[ -s "$path" ] || continue
pass2_ok=0
birth="$(stat -c %W "$path" 2>/dev/null || echo 0)"
mtime="$(stat -c %Y "$path" 2>/dev/null || echo 0)"
if [ "${birth:-0}" -gt 0 ] && [ "${mtime:-0}" -ge $((birth + 180)) ]; then
pass2_ok=1
fi
if [ -s "$ANALYSIS_DIR/pass1/$f" ] && ! cmp -s "$ANALYSIS_DIR/pass1/$f" "$path"; then
pass2_ok=1
fi
if [ "$pass2_ok" -ne 1 ]; then
echo "❌ $f: Pass-2 evidence missing (need mtime >= birth+180s or differing pass1 snapshot)"
FAIL=1
fi
done

Copilot uses AI. Check for mistakes.
Comment thread .github/prompts/07-commit-and-pr.md Outdated
Comment on lines +23 to +24
| Repo-memory | `memory/news-generation/*.json` (branch `memory/news-generation`) |

Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Staging memory/news-generation/*.json in the content PR seems incorrect: repo-memory persistence is handled via the workflow’s tools.repo-memory/safe-outputs push step to the memory/news-generation branch, and there’s no memory/ directory in the main working tree. Keeping this row may cause the agent to create and accidentally commit a new memory/ folder in the PR. Recommend removing this from the “Git path to stage” table and instead clarify that repo-memory is pushed separately (and should not be added to the content PR).

Suggested change
| Repo-memory | `memory/news-generation/*.json` (branch `memory/news-generation`) |
Repo-memory persistence is handled separately by the workflow tooling (`tools.repo-memory` / safe-outputs) and pushed to the `memory/news-generation` branch. **Do not** create, stage, commit, or add any `memory/news-generation/*.json` files to the content PR.

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 22, 2026

@copilot apply changes based on the comments in this thread and resolve merge conflicts

…te impl, drop memory row

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/e86fb72d-4de7-470b-ada1-a7ba9cc30b11

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 22, 2026

@copilot apply changes based on the comments in this thread and resolve merge conflicts

Done in 5107201:

  • Merge conflicts resolved — all 12 news-*.lock.yml files regenerated via gh aw compile (0 errors, 0 warnings).
  • Malformed Markdown links in ai-driven-analysis-guide.md and analysis/imf/README.md → valid ../../.github/prompts/README.md paths.
  • economic-context-audit.yml — reference moved outside the parenthetical so parens balance cleanly.
  • 05-analysis-gate.md — canonical bash now fully implements all 6 checks (per-document coverage via manifest dok_id enumeration, SWOT quadrant + significance-scoring citation awk checks, Mermaid + colour-coded style directive on every synthesis file, Pass-2 evidence via mtime≥birth+180s OR pass1/ snapshot diff). Complemented by a new pass1/ snapshot step in 04-analysis-pipeline.md and an exclusion rule in 07-commit-and-pr.md + .gitignore.
  • 07-commit-and-pr.md — repo-memory row removed from the staging table; clarified that tools.repo-memory pushes separately to memory/news-generation and must never appear in the content PR.

Copilot AI requested a review from pethers April 22, 2026 00:24
@pethers pethers requested a review from Copilot April 22, 2026 00:34
@pethers pethers requested review from Copilot and removed request for Copilot April 22, 2026 00:56
@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 22, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 22, 2026

@copilot apply changes based on the comments in this thread

Done in 64bd179:

  • 06-article-generation.md pre-flight table — corrected to check 1 (presence), check 2 (per-document coverage), check 4 (evidence, covering both SWOT and significance-scoring ranked items / tables / Mermaid nodes). Step 3's stale "gate in step 7" replaced with 05-analysis-gate.md check 3 (no stubs). Step 2 table: documents/<dok_id>.mddocuments/<dok_id>-analysis.md.
  • compile-agentic-workflows.yml lock-file validator — now strips backslashes before matching so both plain JSON ("create_pull_request") and the GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG env-var form (\"create_pull_request\") are seen. All 12 news-*.lock.yml pass (3 occurrences × max: 1 each).
  • analysis/templates/README.md and analysis/methodologies/README.md — enforcement-column check numbers re-aligned to the actual gate: per-doc coverage = check 2 (not 3); significance-scoring evidence = check 4 (not 6); cross-reference-map / risk / threat / stakeholder / classification = check 1 (presence); synthesis Mermaid = check 5.
  • .github/skills/editorial-standards/SKILL.md Gate 0 — re-framed as an editorial / human-review gate with only partial automation via analysis-gate checks 1 (presence of significance-scoring.md) and 2 (per-doc coverage backing DIW-weighted references); lead-story selection / lede discipline / coverage completeness are explicitly marked not machine-enforced.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 89 out of 92 changed files in this pull request and generated 2 comments.

Comment on lines +132 to +141
# Check 6 — Pass-2 evidence (mtime ≥ birth + 180s, OR differing pass1 snapshot on disk)
for f in "${REQ[@]}"; do
p="$ANALYSIS_DIR/$f"; [ -s "$p" ] || continue
ok=0
B=$(stat -c %W "$p" 2>/dev/null || echo 0)
M=$(stat -c %Y "$p" 2>/dev/null || echo 0)
[ "${B:-0}" -gt 0 ] && [ "${M:-0}" -ge $((B + 180)) ] && ok=1
[ -s "$ANALYSIS_DIR/pass1/$f" ] && ! cmp -s "$ANALYSIS_DIR/pass1/$f" "$p" && ok=1
[ "$ok" -eq 1 ] || { echo "❌ $f: Pass-2 evidence missing (mtime<birth+180s and no pass1/ snapshot)"; FAIL=1; }
done
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

In Check 6 (Pass-2 evidence), the loop runs over all REQ files, which includes data-download-manifest.md. That manifest is produced by the download step and may legitimately be unchanged during Pass 2, so the cmp fallback won’t trigger and the mtime ≥ birth + 180s heuristic can fail on fast runs (or when %W is 0), causing false gate failures. Consider excluding data-download-manifest.md from Check 6, or using a Pass-2 marker / separate evidence rule that doesn’t require the manifest to change.

Copilot uses AI. Check for mistakes.
Comment on lines +91 to +94
# ≥ 2 external country references in comparative-international.md
grep -cE '\b(Finland|Norway|Denmark|Germany|France|Netherlands|UK|USA|Estonia)\b' \
"$ANALYSIS_DIR/comparative-international.md" | awk '{exit ($1<2)}' \
|| { echo "❌ comparative-international.md: fewer than 2 countries"; FAIL=1; }
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The Tier‑C gate’s international-comparison check hardcodes a short country name allowlist. This can produce false failures if the comparative analysis uses other valid comparator jurisdictions (the template expects a broader comparator set) or uses demonyms/abbreviations (e.g. “United States”, “United Kingdom”, “EU”). Consider validating structure instead (e.g., require ≥2 comparator rows/flags in the comparison matrix or a populated “Comparator set” field) rather than grepping for specific country tokens.

Suggested change
# ≥ 2 external country references in comparative-international.md
grep -cE '\b(Finland|Norway|Denmark|Germany|France|Netherlands|UK|USA|Estonia)\b' \
"$ANALYSIS_DIR/comparative-international.md" | awk '{exit ($1<2)}' \
|| { echo "❌ comparative-international.md: fewer than 2 countries"; FAIL=1; }
# comparative-international.md must define a comparator set or include ≥ 2 comparator rows
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; }

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 22, 2026

@copilot apply changes based on the comments in this thread

…er-C comparator check

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/b4049d5c-4ffb-4c51-9d68-2258add51abf

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 22, 2026

@copilot apply changes based on the comments in this thread

Done in 464ebc1:

  • 05-analysis-gate.md Check 6 — introduced a PASS2_REQ array that omits data-download-manifest.md, since the manifest is produced by the download step and may legitimately be unchanged during Pass 2 (its Pass-2 correctness is already covered by check 2's per-document coverage against its dok_id list). The mtime ≥ birth + 180s / pass1/ snapshot heuristic now only runs over the 8 analysis artifacts that must be reread and improved.
  • ext/tier-c-aggregation.md — Tier-C international-comparison check rewritten as a structural awk validator: passes if Comparator set: … is populated or the comparator table contains ≥ 2 non-header / non-separator rows. No more hardcoded country allowlist, so "United States", "United Kingdom", "EU", or any other valid comparator jurisdiction no longer false-fail. Verified with three test cases (comparator-set populated; rows-only with non-allowlisted jurisdictions; empty file fails).

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

… 12 workflows, 24 agent files)

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/d975f4fc-62c1-4312-a704-486d93bb9fd6

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 86 out of 100 changed files in this pull request and generated 2 comments.

Comment thread analysis/README.md
@@ -153,9 +153,9 @@ flowchart LR
| Validate output format (quality gate) | Fill template sections with generated content |
| Move/rename files | Produce "placeholder" analysis that looks real |

**The AI agent reads all 6 methodology guides, reads all 8 templates, reads the actual data, and produces genuine analytical content based on evidence found in the documents.**
**The AI agent reads the 6 core methodology guides (of 11 total) and the 8 core output templates (of 23 total), reads the actual data, and produces genuine analytical content based on evidence found in the documents.** The remaining 5 methodology files (electoral-domain, political-style-guide, strategic-extensions, structural-metadata, ai-driven-analysis-guide) provide domain-specific and meta-methodology context; the remaining 15 templates cover Tier-C aggregation (scenario-analysis, executive-brief, coalition-mathematics, election-2026-analysis, historical-parallels, comparative-international, devils-advocate, forward-indicators, implementation-feasibility, intelligence-assessment, media-framing-analysis, methodology-reflection, voter-segmentation, data-download-manifest, cross-reference-map).
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The sentence says the agent reads “6 core methodology guides”, but the “remaining 5 methodology files” list includes ai-driven-analysis-guide, which is already one of the core guides and is also referenced earlier in this section. Please correct the core-vs-remaining split (either remove ai-driven-analysis-guide from the “remaining” list or update the core count/list) to avoid contradictory guidance.

Copilot uses AI. Check for mistakes.
Comment thread SKILLS.md
Comment on lines +1642 to +1644
**Last Updated**: 2026-04-22
**Total Skills**: 91
**New Skills (2026-02-20 → 2026-04-22)**: 18 skills added from Hack23 repos (security, development, governance, platform, design); +4 since 2026-02-20 (`seo-best-practices`, `global-government-analysis`, `investigative-journalism`, `myndigheter-monitoring` per catalog reconciliation)
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The “New Skills (2026-02-20 → 2026-04-22)” line says “+4 since 2026-02-20” but the listed skill names don’t match the four skills marked NEW in this PR section (business-model-canvas, mcp-gateway-configuration, mcp-gateway-security, seo-best-practices). Please reconcile this summary so the claimed delta matches the actual newly added/recognized skills.

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 22, 2026

@copilot apply changes based on the comments in this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Agent configuration agentic-workflow Agentic workflow changes ci-cd CI/CD pipeline changes documentation Documentation updates news News articles and content generation size-xl Extra large change (> 1000 lines) skill Skill configuration workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants