Conversation
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: size-xs Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…flows Replace broad `git add news/ analysis/daily/ analysis/weekly/ analysis/data/` with date-scoped adds and file-count safety checks across all 12 news workflow .md files and SHARED_PROMPT_PATTERNS.md. Root cause: broad git add staged ALL accumulated analysis files across all dates, causing 644 files to exceed the safe-outputs 100-file limit. Fix: Scope analysis staging to current ARTICLE_DATE only, add STAGED_COUNT safety check that progressively prunes bulk data and weekly analysis if the count exceeds 90 files. Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/d464e6e9-4c02-430b-ba84-9bc6e598a2e5 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…orkflow conflicts
Doc-type workflows (committee-reports, motions, propositions, interpellations)
now scope git add to their article-type subdirectory instead of the parent
date directory. This prevents conflicts when multiple doc-type workflows
run concurrently on the same date.
Before: git add "analysis/daily/${ARTICLE_DATE}/" (all doc-types share)
After: git add "analysis/daily/${ARTICLE_DATE}/committeeReports/" (isolated)
Updated SHARED_PROMPT_PATTERNS.md with dual pattern documentation:
- Doc-type workflows: scope to analysis/daily/$DATE/{docType}/
- General workflows: scope to analysis/daily/$DATE/ (unchanged)
Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/28e0a4c0-d4f2-4825-b81e-a61f066b5810
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…review Add table mapping each doc-type workflow to its --doc-type value and DOC_TYPE variable. Clarify that --doc-type is a flag for pre-article-analysis.ts. Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/28e0a4c0-d4f2-4825-b81e-a61f066b5810 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
Updates agentic workflow instructions to stage artifacts more narrowly (per-date for general workflows; per-doc-type subdirectory for doc-type workflows) to avoid cross-workflow conflicts and prevent exceeding the safe-outputs 100-file PR limit.
Changes:
- Doc-type workflows: scope
git addtoanalysis/daily/$ARTICLE_DATE/{docType}/instead of the parent date directory. - General workflows: scope
git addtoanalysis/daily/$ARTICLE_DATE/and add staged-file-count pruning guidance to stay under the limit. - SHARED_PROMPT_PATTERNS.md: document the canonical scoping patterns and prohibitions.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/news-weekly-review.md | Scope staging of daily artifacts to the current ARTICLE_DATE directory. |
| .github/workflows/news-week-ahead.md | Scope staging of daily artifacts to the current ARTICLE_DATE directory. |
| .github/workflows/news-realtime-monitor.md | Add date-scoped staging + staged-count pruning guidance to avoid 100-file PR failures. |
| .github/workflows/news-propositions.md | Scope staging to analysis/daily/$ARTICLE_DATE/propositions/ to avoid same-date conflicts. |
| .github/workflows/news-motions.md | Scope staging to analysis/daily/$ARTICLE_DATE/motions/ to avoid same-date conflicts. |
| .github/workflows/news-monthly-review.md | Scope staging of daily artifacts to the current ARTICLE_DATE directory. |
| .github/workflows/news-month-ahead.md | Scope staging of daily artifacts to the current ARTICLE_DATE directory. |
| .github/workflows/news-interpellations.md | Scope staging to analysis/daily/$ARTICLE_DATE/interpellations/ to avoid same-date conflicts. |
| .github/workflows/news-evening-analysis.md | Add date-scoped staging + staged-count pruning guidance. |
| .github/workflows/news-committee-reports.md | Scope staging to analysis/daily/$ARTICLE_DATE/committeeReports/ to avoid same-date conflicts. |
| .github/workflows/news-article-generator.md | Add date-scoped staging + staged-count pruning guidance. |
| .github/workflows/SHARED_PROMPT_PATTERNS.md | Document canonical git staging patterns (doc-type vs general) and prohibit broad staging. |
| git add news/ || true | ||
| git add "analysis/daily/${ARTICLE_DATE:-$(date -u +%Y-%m-%d)}/" || true | ||
| git add analysis/weekly/ || true | ||
| git add analysis/data/ || true |
There was a problem hiding this comment.
These workflow instruction changes are in the .md source, but the corresponding compiled .lock.yml workflow files are what GitHub Actions actually runs. This PR doesn’t include updated .lock.yml outputs, so the runtime workflows will still use the old (broad) git add behavior. Re-run gh aw compile for the modified workflow .md files and commit the regenerated *.lock.yml files (or trigger the repo’s compile workflow) so the fix takes effect.
| git add analysis/data/ || true | |
| git add "analysis/data/${ARTICLE_DATE:-$(date -u +%Y-%m-%d)}/" || true |
| # Enforce safe-outputs 100-file PR limit | ||
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | ||
| if [ "$STAGED_COUNT" -gt 90 ]; then | ||
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing bulk data." | ||
| git reset HEAD -- analysis/data/ 2>/dev/null || true | ||
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | ||
| fi | ||
| if [ "$STAGED_COUNT" -gt 90 ]; then | ||
| echo "⚠️ Still $STAGED_COUNT files. Removing weekly analysis." |
There was a problem hiding this comment.
The prune threshold is STAGED_COUNT > 90, but the log message says the staged files "exceeds 100-file PR limit". With 91–100 staged files this message is inaccurate/misleading; either change the condition to > 100 (or >= 100) or update the message to reflect that 90 is a safety buffer (e.g., "approaching/exceeding the safe-outputs limit").
| # Enforce safe-outputs 100-file PR limit | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing bulk data." | |
| git reset HEAD -- analysis/data/ 2>/dev/null || true | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| fi | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Still $STAGED_COUNT files. Removing weekly analysis." | |
| # Enforce safe-outputs 100-file PR limit with 90-file safety buffer | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Staged $STAGED_COUNT files is approaching the 100-file safe-outputs limit (90-file safety buffer). Removing bulk data." | |
| git reset HEAD -- analysis/data/ 2>/dev/null || true | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| fi | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Still $STAGED_COUNT files, near the 100-file safe-outputs limit (90-file safety buffer). Removing weekly analysis." |
| 4. **Create/rewrite ALL 7 daily synthesis files** in `analysis/daily/$ARTICLE_DATE/` — each MUST follow its template EXACTLY (metadata header, Mermaid diagrams, evidence tables, confidence labels, no `[REQUIRED]` placeholders). | ||
|
|
||
| 5. **Commit data AND analysis together** — `git add analysis/data/ analysis/daily/` | ||
| 5. **Commit data AND analysis together** — stage scoped to current date: `git add analysis/data/ "analysis/daily/${ARTICLE_DATE:-$(date -u +%Y-%m-%d)}/"` (see Step 5 for full file-count safety pattern) |
There was a problem hiding this comment.
This line says “see Step 5 for full file-count safety pattern” but it is already Step 5 in this section, which makes the reference confusing. Consider pointing to the specific later subsection (e.g., “see the ‘Commit & Create PR’ snippet below”) or renumbering the reference.
| 5. **Commit data AND analysis together** — stage scoped to current date: `git add analysis/data/ "analysis/daily/${ARTICLE_DATE:-$(date -u +%Y-%m-%d)}/"` (see Step 5 for full file-count safety pattern) | |
| 5. **Commit data AND analysis together** — stage scoped to current date: `git add analysis/data/ "analysis/daily/${ARTICLE_DATE:-$(date -u +%Y-%m-%d)}/"` (see the "Commit & Create PR" snippet below for full file-count safety pattern) |
| # Enforce safe-outputs 100-file PR limit | ||
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | ||
| if [ "$STAGED_COUNT" -gt 90 ]; then | ||
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing weekly analysis." |
There was a problem hiding this comment.
The doc-type example prunes when STAGED_COUNT > 90, but the message claims the PR already “exceeds 100-file PR limit”. Either align the condition with the 100-file limit or adjust the message to clarify that 90 is an early safety cutoff.
| # Enforce safe-outputs 100-file PR limit | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing weekly analysis." | |
| # Enforce safe-outputs 100-file PR limit (90-file early cutoff for safety margin) | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Staged $STAGED_COUNT files approaching 100-file PR limit. Removing weekly analysis as safety margin." |
| # Stage analysis scoped to article type — avoids conflicts with other doc-type workflows on the same date | ||
| DOC_TYPE="committeeReports" # One of: committeeReports, motions, propositions, interpellations |
There was a problem hiding this comment.
Step 6 is titled “Commit Data AND Analysis Together”, but the doc-type workflow snippet stages only analysis/daily/.../${DOC_TYPE}/ and analysis/weekly/ (no analysis/data/). That conflicts with the later PROHIBITED rule about not committing analysis without downloaded data (unless pruned). Please clarify what “data” means for doc-type workflows (e.g., manifest-only vs raw analysis/data/), and align the snippet/commit message/rules accordingly to avoid agents doing the wrong thing.
| # Stage analysis scoped to article type — avoids conflicts with other doc-type workflows on the same date | |
| DOC_TYPE="committeeReports" # One of: committeeReports, motions, propositions, interpellations | |
| # Stage data + analysis scoped to article type — avoids conflicts with other doc-type workflows on the same date | |
| DOC_TYPE="committeeReports" # One of: committeeReports, motions, propositions, interpellations | |
| git add "analysis/data/daily/${ARTICLE_DATE:-$(date -u +%Y-%m-%d)}/${DOC_TYPE}/" || true |
| # Enforce safe-outputs 100-file PR limit | ||
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | ||
| if [ "$STAGED_COUNT" -gt 90 ]; then | ||
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing weekly analysis." |
There was a problem hiding this comment.
The prune threshold is STAGED_COUNT > 90, but the message says the staged files “exceeds 100-file PR limit”. Either adjust the condition to match the actual 100-file limit or reword the message to indicate this is an early safety cutoff.
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing weekly analysis." | |
| echo "⚠️ Staged $STAGED_COUNT files approaching 100-file PR limit (safety cutoff at 90). Removing weekly analysis." |
| # Enforce safe-outputs 100-file PR limit | ||
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | ||
| if [ "$STAGED_COUNT" -gt 90 ]; then | ||
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing weekly analysis." |
There was a problem hiding this comment.
The prune threshold is STAGED_COUNT > 90, but the message says the staged files “exceeds 100-file PR limit”. Either adjust the condition to match the actual 100-file limit or reword the message to indicate this is an early safety cutoff.
| # Enforce safe-outputs 100-file PR limit | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing weekly analysis." | |
| # Enforce safe-outputs 100-file PR limit (with 90-file safety threshold) | |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | |
| if [ "$STAGED_COUNT" -gt 90 ]; then | |
| echo "⚠️ Staged $STAGED_COUNT files exceeds 90-file safety threshold for 100-file PR limit. Removing weekly analysis." |
| STAGED_COUNT=$(git diff --cached --name-only | wc -l) | ||
| if [ "$STAGED_COUNT" -gt 90 ]; then | ||
| echo "⚠️ Staged $STAGED_COUNT files exceeds 100-file PR limit. Removing bulk data." | ||
| git reset HEAD -- analysis/data/ 2>/dev/null || true |
There was a problem hiding this comment.
The general-workflow prune condition triggers at STAGED_COUNT > 90, but the log line says it “exceeds 100-file PR limit”. With 91–100 files staged, that’s misleading; either tighten/loosen the numeric threshold to match the message or update the message to reflect that 90 is a safety buffer.
The
news-realtime-monitorworkflow failed withE003: Cannot create pull request with more than 100 files (received 644). Two layered problems:git add analysis/daily/ analysis/data/accumulated all historical files across datesanalysis/daily/$DATE/) is insufficient because committee-reports, motions, propositions, and interpellations all run concurrently on the same datepre-article-analysis.tsalready writes to doc-type subdirectories via--doc-type, but the workflow.mdfiles weren't matching that scoping.Doc-type workflows — scope to article-type subdirectory
committeeReports/motions/propositions/interpellations/General workflows — date-scoped with file-count safety
Realtime-monitor, evening-analysis, article-generator keep date-level scoping (no
--doc-type) with progressive pruning if staged count exceeds 90:SHARED_PROMPT_PATTERNS.md — canonical reference updated
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.