Conversation
…SWOT S4, TRANSLATION_GUIDE Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/e216b4e1-c6b6-4164-a5ab-5d021d51bc6b Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
… 3, style rm-* chrome Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/abe2efae-8197-4f0c-8e2c-77f3cd132515 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…icle render + edge cases; extract constants.ts Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/13b12282-8808-4491-9c1d-380d43a7ad37 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…+ breadcrumb) + 3-col footer + secondary lang row; regen 48 articles Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/fbc5a985-5cec-4337-ac6b-3ac2f690fa1c Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pethers
April 24, 2026 15:37
View session
Contributor
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: documentation,html-css,i18n,translation,testing,refactor,size-xl,news Label Categories
For more information, see |
Contributor
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…rrel; +25 architecture tests; sync typedoc.json (5 new docs); update ARCHITECTURE Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/a314531c-c28b-449a-8fff-0d5dd0fa79c5 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Contributor
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 4 — Code architecture focus
A. Architectural split —
scripts/render-lib/monolith → 6 leaf modulesThe former
scripts/render-lib/index.ts(960 LOC) mixed four distinct responsibilities: aggregation, markdown→HTML, HTML chrome, and end-to-end article composition. Split into single-responsibility leaf modules linked by a thin barrel:render-lib/constants.ts— zero-dep leaf (unchanged, kept from Round 3)render-lib/url-helpers.ts— new zero-dep leaf:buildGithubBlobUrl/buildGithubTreeUrlrender-lib/aggregator.ts—AGGREGATION_ORDER,titleForArtifact, all private cleaners (stripPassTwoSection,stripLeadingAdminBylines,cleanArtifactBody,rewriteRelativeLinks),AggregationInput/AggregationResult,aggregateAnalysis,__test__escape hatch. Does not importunified/remark/rehype— tests that only touch aggregator logic now skip the ~40 ms remark/rehype cold-start cost.render-lib/markdown.ts—sanitizeSchema+renderMarkdownToHtml(the single trust boundary between AI markdown and user HTML)render-lib/chrome.ts—ChromeOptions,SiteChrome,renderChromeHead,buildChrome. Pure synchronous string builder, zero I/O, zero async.render-lib/article.ts—RenderArticleInput,renderArticleHtml. The only module that orchestrates aggregator + markdown + chrome; owns the Schema.orgNewsArticleJSON-LD shape.render-lib/index.ts— barrel re-export only (82 LOC, down from 960); no breaking changes for any downstream consumer (aggregate-analysis.ts,render-articles.ts,analysis-references.ts,tests/render-lib.test.ts).B. typedoc.json — sync with current codebase
Added 5 project documents that exist on disk but were missing from TypeDoc output:
AGENTS.md(Copilot agents catalogue)SKILLS.md(Copilot skills catalogue)LABELS.md(issue/PR label taxonomy)CODE_OF_CONDUCT.mdFUTURE_WORKFLOWS.mdsidebarLinks(🤖 Copilot Agents · 🛠 Copilot Skills · 🏷 Labels · 📜 Code of Conduct · 🔄 Future Workflows)projectDocumentsgrew from 26 → 31. TypeDoc builds with 0 errors and all 5 new HTML docs (AGENTS.html,SKILLS.html,LABELS.html,CODE_OF_CONDUCT.html,FUTURE_WORKFLOWS.html) appear underapi/documents/. NoentryPointschange needed — the existing"scripts"entry point withentryPointStrategy: "expand"auto-picks up the 4 new.tsfiles inscripts/render-lib/.C. ARCHITECTURE.md
aggregator·markdown·chrome·article·constants+url-helpersleaves) with colour-coded nodes.D. Test coverage expansion
New
tests/render-lib-architecture.test.ts(25 tests) — imports every leaf module directly by its real path (not via the barrel) to prove:url-helpers.tsis pure (no leading-slash corner-cases break it)aggregator.tsworks standalone (produces validAggregationResultshape)markdown.tssanitiser schema allowlists the mermaid<pre>wrapper and h1-h6idattributeschrome.tsis synchronous and deterministic (buildChromereturns identical output for identical inputs)article.tscomposes head + header + body + sources + footer and emits the correct Schema.orgNewsArticleJSON-LDFull suite: 1948 passed / 0 failed (was 1923 → +25 architecture tests)
npx htmlhint **/*.html— no errorsnpx typedoc— 0 errors, 52 warnings (all pre-existing, unrelated to this round)