fix: improve mermaid diagram rendering across all markdown files#8536
fix: improve mermaid diagram rendering across all markdown files#8536
Conversation
…, and SWOT quadrant colors Agent-Logs-Url: https://github.com/Hack23/cia/sessions/e574c177-17b8-42f1-83d0-327c4ec8831a Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
… flowchart parse error Agent-Logs-Url: https://github.com/Hack23/cia/sessions/e574c177-17b8-42f1-83d0-327c4ec8831a Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…T_MODEL.md Agent-Logs-Url: https://github.com/Hack23/cia/sessions/e574c177-17b8-42f1-83d0-327c4ec8831a Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Hack23/cia/sessions/e574c177-17b8-42f1-83d0-327c4ec8831a Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
📊 JSON Schema Validation ResultsValidation Summary:
Schema Status
📄 Full Report: See uploaded artifacts for detailed validation report ℹ️ Status: Field mismatches are documented and tracked. These represent differences between original projected schemas and actual implemented data. 📄 Data-Validated Schemas: See |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR standardizes and fixes Mermaid diagram syntax across the documentation set so diagrams reliably render on GitHub and align with the Hack23 ISMS styling approach.
Changes:
- Normalizes Mermaid
%%{init}%%blocks to use double-quoted values (GitHub renderer compatibility) and applies consistent"theme": "base". - Fixes multiple Mermaid syntax edge-cases (e.g.,
xychartunquoted x-axis labels, quadrant chart point label quoting, gantt date formats/durations). - Updates select flowcharts to prevent Mermaid mis-parsing (e.g.,
/api/...node labels rendered as shapes).
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| THREAT_MODEL.md | Updates init blocks and adds quadrant chart styling for the risk heat matrix. |
| FUTURE_THREAT_MODEL.md | Standardizes init blocks and adds quadrant chart styling/quoting for future-state matrices. |
| SWOT.md | Adds quadrant chart init styling and fixes gantt chart to use valid date/axis formats. |
| FUTURE_SWOT.md | Adds quadrant chart init styling and quotes point labels for reliable rendering. |
| DATA_ANALYSIS_INTOP_OSINT.md | Fixes Mermaid init quoting and x-axis label quoting for multiple xychart blocks; keeps diagrams renderable. |
| BUSINESS_PRODUCT_DOCUMENT.md | Standardizes init blocks and prevents /api/... labels from being parsed as parallelogram shapes. |
| CRA-ASSESSMENT.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| INTELLIGENCE_DATA_FLOW.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/README.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/IMPLEMENTATION_GUIDE.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/schemas/politician-schema.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/schemas/party-schema.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/schemas/ministry-schema.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/schemas/intelligence-schema.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/schemas/committee-schema.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/visualizations/top10-rising-stars.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-party-rebels.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-most-productive.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-most-influential.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-most-controversial.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-most-absent.md | Standardizes init blocks for GitHub rendering. |
| json-export-specs/visualizations/top10-media-presence.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-ethics-concerns.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-electoral-risk.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/top10-coalition-brokers.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/politician-career-analysis.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/visualizations/party-longitudinal-analysis.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/visualizations/intelligence-dashboard.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/government-cabinet.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| json-export-specs/visualizations/election-cycle-analysis.md | Standardizes Mermaid init blocks to GitHub-compatible quoting. |
| json-export-specs/visualizations/committee-network.md | Standardizes init blocks; adds quadrant chart styling and quotes point labels. |
| quadrantChart | ||
| title 🎯 CIA Platform Risk Heat Matrix | ||
| x-axis Low Likelihood --> High Likelihood |
There was a problem hiding this comment.
The quadrant assignments for this risk heat matrix look inconsistent with the axis directions and the plotted high-likelihood/high-impact points. E.g., "🌐 Web App Compromise" ([0.6, 0.9]) is high likelihood + high impact but will land in the top-right quadrant, while the quadrant labeling later in the chart marks quadrant-1 as "Monitor & Prepare" and quadrant-2 as "Immediate Action Required". Consider re-mapping the quadrant labels (and matching fill colors) so the high/high quadrant is the one marked as critical/immediate action.
|
@copilot apply changes based on the comments in this thread |
…t matrix Agent-Logs-Url: https://github.com/Hack23/cia/sessions/46193994-367a-4b9b-88fd-ad6f568ec5d9 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Fixed in 800af01. Swapped quadrant-1 and quadrant-2 labels and colors so the top-right quadrant (high likelihood + high impact) is now "Immediate Action Required" (Red #D32F2F) and the top-left quadrant (low likelihood + high impact) is "Monitor & Prepare" (Orange #FF9800). |
📊 JSON Schema Validation ResultsValidation Summary:
Schema Status
📄 Full Report: See uploaded artifacts for detailed validation report ℹ️ Status: Field mismatches are documented and tracked. These represent differences between original projected schemas and actual implemented data. 📄 Data-Validated Schemas: See |
| "quadrant1Fill": "#FF9800", | ||
| "quadrant2Fill": "#D32F2F", |
There was a problem hiding this comment.
In this risk matrix, quadrant-1 is labeled "Critical Risks" (top-right based on the axis directions), but the init block assigns quadrant1Fill="#FF9800" (orange) while quadrant2Fill="#D32F2F" (red). This makes the "Critical" quadrant render orange and "Strategic Concerns" red, which is inconsistent with the risk semantics used elsewhere (e.g., THREAT_MODEL.md heat matrix uses red for quadrant-1). Swap the quadrant1Fill/quadrant2Fill colors (or adjust the quadrant labels) so the critical/high-high quadrant renders red.
| "quadrant1Fill": "#FF9800", | |
| "quadrant2Fill": "#D32F2F", | |
| "quadrant1Fill": "#D32F2F", | |
| "quadrant2Fill": "#FF9800", |
FUTURE_THREAT_MODEL.md
Outdated
| "quadrant1Fill": "#FF9800", | ||
| "quadrant2Fill": "#D32F2F", |
There was a problem hiding this comment.
The heat matrix labels quadrant-1 as "Critical Risk", but the init block sets quadrant1Fill="#FF9800" (orange) and quadrant2Fill="#D32F2F" (red). Given quadrant-1 is the high-likelihood/high-impact quadrant (top-right), this will color "Critical Risk" orange and the adjacent quadrant red. Swap quadrant1Fill/quadrant2Fill (or update quadrant labels) so the critical quadrant renders red, consistent with THREAT_MODEL.md.
| "quadrant1Fill": "#FF9800", | |
| "quadrant2Fill": "#D32F2F", | |
| "quadrant1Fill": "#D32F2F", | |
| "quadrant2Fill": "#FF9800", |
| %%{init: { | ||
| "theme": "base", | ||
| "themeVariables": { | ||
| "quadrant1Fill": "#1565C0", | ||
| "quadrant2Fill": "#2E7D32", | ||
| "quadrant3Fill": "#D32F2F", | ||
| "quadrant4Fill": "#FF9800", |
There was a problem hiding this comment.
This SWOT quadrant chart uses an updated color mapping (Opportunities=blue, Strengths=green, Weaknesses=red, Threats=orange). Later in the same document, the accompanying legend + the alternative network visualization still describe/use a different palette (e.g., Weaknesses=yellow, Opportunities=purple, Threats=red). Please align the legend/alternative diagram styling with the quadrant chart so readers don’t get conflicting color semantics in one doc.
| "quadrant1Fill": "#1565C0", | ||
| "quadrant2Fill": "#2E7D32", | ||
| "quadrant3Fill": "#FF9800", | ||
| "quadrant4Fill": "#D32F2F", |
There was a problem hiding this comment.
In this quadrant chart, quadrant-1 is labeled "Critical Risk" (top-right given the axis directions), but the init block sets quadrant1Fill="#1565C0" (blue) and quadrant4Fill="#D32F2F" (red). This makes the "Critical Risk" quadrant render blue while "Moderate Risk" renders red. Adjust the quadrant fill assignments (or reorder the quadrant labels) so the critical quadrant uses the highest-severity color (typically red) and the lower-severity quadrants use less severe colors.
| "quadrant1Fill": "#1565C0", | |
| "quadrant2Fill": "#2E7D32", | |
| "quadrant3Fill": "#FF9800", | |
| "quadrant4Fill": "#D32F2F", | |
| "quadrant1Fill": "#D32F2F", | |
| "quadrant2Fill": "#FF9800", | |
| "quadrant3Fill": "#2E7D32", | |
| "quadrant4Fill": "#1565C0", |
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/Hack23/cia/sessions/3a825403-c105-43ec-ab7f-eb23873477f8 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Applied all 4 review fixes in 2648c83:
|
FUTURE_THREAT_MODEL.md
Outdated
| "quadrant1Fill": "#1565C0", | ||
| "quadrant2Fill": "#2E7D32", | ||
| "quadrant3Fill": "#FF9800", | ||
| "quadrant4Fill": "#D32F2F", |
There was a problem hiding this comment.
In this "Threat Agent Capability vs Motivation" quadrant chart, quadrant-1 is labeled "Critical Priority" but the init sets quadrant1Fill to blue and quadrant4Fill to red. This inverts the intended severity semantics (critical/highest severity should be red in quadrant-1/top-right). Update the quadrant fill assignments so quadrant-1 uses the critical color (e.g., #D32F2F) and lower-severity quadrants use the lower-severity colors.
| "quadrant1Fill": "#1565C0", | |
| "quadrant2Fill": "#2E7D32", | |
| "quadrant3Fill": "#FF9800", | |
| "quadrant4Fill": "#D32F2F", | |
| "quadrant1Fill": "#D32F2F", | |
| "quadrant2Fill": "#FF9800", | |
| "quadrant3Fill": "#2E7D32", | |
| "quadrant4Fill": "#1565C0", |
| @@ -125,17 +147,18 @@ quadrantChart | |||
| quadrant-3 Low Productivity | |||
| quadrant-4 High Efficiency | |||
There was a problem hiding this comment.
These quadrant labels don’t match the axis directions: with x=Low→High Volume and y=Low→High Success, quadrant-2 (top-left) is low volume/high success (high efficiency) and quadrant-4 (bottom-right) is high volume/low success (low efficiency). Swap the "High Efficiency" and "Low Efficiency" labels to avoid misclassifying the quadrants.
| "quadrant1Fill": "#D32F2F", | ||
| "quadrant2Fill": "#FF9800", | ||
| "quadrant3Fill": "#2E7D32", | ||
| "quadrant4Fill": "#1565C0", |
There was a problem hiding this comment.
This chart uses quadrant4Fill "#1565C0" (blue) for "Moderate Risk", but other risk heat matrices in this PR use amber (e.g., #FFC107) for the lowest-severity quadrant. Consider aligning quadrant-4’s fill color with the risk-matrix palette used elsewhere to keep severity colors consistent across docs.
| "quadrant4Fill": "#1565C0", | |
| "quadrant4Fill": "#FFC107", |
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/Hack23/cia/sessions/8e978305-bea8-4b20-91e6-7a4a9f650a3c Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
📊 JSON Schema Validation ResultsValidation Summary:
Schema Status
📄 Full Report: See uploaded artifacts for detailed validation report ℹ️ Status: Field mismatches are documented and tracked. These represent differences between original projected schemas and actual implemented data. 📄 Data-Validated Schemas: See |
Applied all 3 review fixes in 4da1f32:
|
| %%{init: { | ||
| "theme": "base", | ||
| "themeVariables": { | ||
| "quadrant1Fill": "#D32F2F", | ||
| "quadrant2Fill": "#FF9800", | ||
| "quadrant3Fill": "#2E7D32", | ||
| "quadrant4Fill": "#1565C0", | ||
| "quadrantTitleFill": "#ffffff", |
There was a problem hiding this comment.
In the "Threat Agent Capability vs Motivation" quadrant chart, quadrant-1 is labeled "Critical Priority" but the init themeVariables set quadrant1Fill to blue (#1565C0) and quadrant4Fill to red (#D32F2F). This inverts the repo’s risk/priority color convention where quadrant-1 (top-right, highest severity) should be red (see THREAT_MODEL.md risk heat matrix). Update the quadrant fill mapping here so the "Critical Priority" quadrant uses the red fill and the remaining quadrants follow the intended severity gradient.
|
@copilot apply changes based on the comments in this thread |
This was already fixed in 4da1f32. The "Threat Agent Capability vs Motivation" chart's quadrant1Fill was changed from blue (#1565C0) to red (#D32F2F) in that commit. The review comment was generated against the pre-fix state. Both quadrant charts in FUTURE_THREAT_MODEL.md now correctly use red (#D32F2F) for quadrant-1 (top-right, highest severity). |
BUSINESS_PRODUCT_DOCUMENT.md
Outdated
| POL_API["`/api/v1/politicians`"] | ||
| PARTY_API["`/api/v1/parties`"] | ||
| RISK_API["`/api/v1/risk-assessments`"] | ||
| DECISION_API["`/api/v1/decision-analytics`"] |
There was a problem hiding this comment.
Mermaid flowchart node labels don’t render Markdown, so the backticks will appear literally in the diagram. To keep the label readable while avoiding the /.../ shape parsing, use a quoted label without backticks (or escape the leading /) for these API nodes.
| POL_API["`/api/v1/politicians`"] | |
| PARTY_API["`/api/v1/parties`"] | |
| RISK_API["`/api/v1/risk-assessments`"] | |
| DECISION_API["`/api/v1/decision-analytics`"] | |
| POL_API["/api/v1/politicians"] | |
| PARTY_API["/api/v1/parties"] | |
| RISK_API["/api/v1/risk-assessments"] | |
| DECISION_API["/api/v1/decision-analytics"] |
FUTURE_THREAT_MODEL.md
Outdated
| "themeVariables": { | ||
| "quadrant1Fill": "#D32F2F", | ||
| "quadrant2Fill": "#FF9800", | ||
| "quadrant3Fill": "#4CAF50", |
There was a problem hiding this comment.
This file uses two different greens for the “low risk/low priority” quadrant (#2E7D32 in the Threat Agent chart vs #4CAF50 in the Risk Heat Matrix). To keep the ISMS palette consistent across diagrams, pick one green and use it consistently in both init blocks.
| "quadrant3Fill": "#4CAF50", | |
| "quadrant3Fill": "#2E7D32", |
|
@copilot apply changes based on the comments in this thread |
|
This was already fixed in 4da1f32 — the "Threat Agent Capability vs Motivation" quadrant fills were reordered so quadrant-1 ("Critical Priority", top-right) uses red (#D32F2F) and quadrant-4 uses blue (#1565C0). The reviewer comment was generated against the pre-fix state. |
…stency Agent-Logs-Url: https://github.com/Hack23/cia/sessions/b226dc5b-c984-4f59-9591-30f98cc04caa Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
📊 JSON Schema Validation ResultsValidation Summary:
Schema Status
📄 Full Report: See uploaded artifacts for detailed validation report ℹ️ Status: Field mismatches are documented and tracked. These represent differences between original projected schemas and actual implemented data. 📄 Data-Validated Schemas: See |
Applied in 32f73ef. Updated BUSINESS_PRODUCT_DOCUMENT.md to remove literal backticks from Mermaid API endpoint node labels, and updated FUTURE_THREAT_MODEL.md to use a consistent low-risk green ( |
|



Description
Fix and improve Mermaid diagrams across 31 markdown files to ensure they render correctly on GitHub and follow the Hack23 ISMS Style Guide.
Rendering Error Fixes
xychartblocks with unquoted x-axis items inDATA_ANALYSIS_INTOP_OSINT.mdSWOT.mdgantt chart with invalid quarterly date format (YYYY-Q1→YYYY-MM-DD)BUSINESS_PRODUCT_DOCUMENT.mdflowchart/API node labels:/api/...Mermaid shape parsing issues%%{init} Block Fixes (126 fixes across 29 files)
%%{init}blocks for GitHub compatibilityQuadrant Chart Styling (18 charts)
%%{init}blocks with ISMS Style Guide color coding to all quadrant chartsFUTURE_SWOT.mdQuadrant Label/Color Consistency (across all risk and SWOT charts)
THREAT_MODEL.mdrisk heat matrix: quadrant-1 (high likelihood + high impact) correctly labeled "Immediate Action Required" (Red)FUTURE_THREAT_MODEL.mdrisk heat matrix: quadrant-1 "Critical Risk" uses Red(#D32F2F) instead of OrangeFUTURE_THREAT_MODEL.md"Threat Agent Capability vs Motivation" chart: quadrant-1 "Critical Priority" uses Red(#D32F2F) instead of BlueFUTURE_THREAT_MODEL.mdlow-risk green in both quadrant charts to#2E7D32(replacing#4CAF50) for consistent palette usageintelligence-dashboard.mdrisk matrix: quadrant-1 "Critical Risks" uses Red(#D32F2F) instead of Orangetop10-electoral-risk.mddistrict vulnerability map: quadrant-1 "Critical Risk" uses Red(#D32F2F), quadrant-4 "Moderate Risk" uses Amber(#FFC107)top10-most-productive.mdproductivity matrix: swapped "High Efficiency"/"Low Efficiency" labels to match axis directionsSWOT.mdalternative network diagram classDef fills and legend to use exact ISMS palette hex valuesDark/Light Mode Compatibility
"theme": "base"for better dark/light mode renderingCode Review Fixes
%%{init}blocks inTHREAT_MODEL.mdandFUTURE_THREAT_MODEL.mdaxisFormatto a valid format stringValidation
mmdc) — 0 errorsmvn -q -DskipTests clean compile(success)Type of Change
Primary Changes
Political Analysis
Technical Changes
Impact Analysis
Political Analysis Impact
Technical Impact
Testing
mvn -q -DskipTests clean compilepasses after final review-driven updatesmmdc) — 0 errorsDocumentation
Screenshots
N/A — markdown/mermaid rendering changes are viewable on GitHub.
Related Issues
Checklist
Additional Notes
Files modified remain within the original scope (31 markdown files across root docs,
json-export-specs/, andjson-export-specs/visualizations/). Latest feedback fixes were limited to:BUSINESS_PRODUCT_DOCUMENT.mdFUTURE_THREAT_MODEL.mdSecurity Considerations
Release Notes
Fix Mermaid rendering and semantic consistency across documentation: normalized init block JSON quoting, corrected chart parse/render issues, aligned quadrant risk/SWOT color mappings to ISMS palette, corrected quadrant label semantics, removed literal backticks in API endpoint Mermaid node labels, and standardized low-risk green (
#2E7D32) acrossFUTURE_THREAT_MODEL.mdquadrant charts.