Skip to content

fix(reporting): keep comparison labels consistent in Mermaid graphs#22

Draft
tuannx wants to merge 1 commit into
mainfrom
codex/fix-comparison-mermaid-labels
Draft

fix(reporting): keep comparison labels consistent in Mermaid graphs#22
tuannx wants to merge 1 commit into
mainfrom
codex/fix-comparison-mermaid-labels

Conversation

@tuannx

@tuannx tuannx commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • use each component's normalized comparison_name for Mermaid node identifiers and labels
  • keep Mermaid node declarations aligned with normalized dependency endpoints
  • add a regression test covering generic component names that are relabeled for comparison

Root cause

Baseline comparison normalization already rewrote dependency endpoints to derived comparison labels, while build_snapshot_mermaid() still declared nodes with their original component names. That mismatch caused Mermaid to create a second implicit (ghost) node.

Reproduction

Reproduced with the Arcade baseline artifacts from NousResearch/hermes-agent#63373: the component declared as Default was compared as CliAiagent, so graph edges referenced CliAiagent while the explicit node remained Default.

After this change, the same artifacts declare and reference CliAiagent consistently, with no Default Mermaid node or edge endpoint.

Validation

  • pytest tests/test_tools/test_compare_baseline.py -q (15 passed)
  • ruff check src/arcade_agent/exporters/html.py tests/test_tools/test_compare_baseline.py
  • pytest -q (279 passed)
  • regenerated Markdown and HTML comparisons from the #63373 baseline/current JSON artifacts

Related: NousResearch/hermes-agent#63373

@github-actions

Copy link
Copy Markdown
Contributor

Architecture Drift Report

Algorithm: PKG | Entities: 657 | Components: 7

Drift from Baseline

Metric Baseline Current Delta
Components 7 7 +0
Similarity 1.00
BalancedArchitectureScore 0.68
PrincipleAlignmentScore 0.84
RCI 0.99
TurboMQ 0.24
BasicMQ 0.24
IntraConnectivity 0.00
InterConnectivity 0.01
TwoWayPairRatio 0.00
DependencyHealth 0.99
ComponentBalance 0.23
HubBalance 0.67
BoundaryClarity 1.00
DependencyDistribution 0.57
SmellDiscipline 0.91

Changes

  • 1 entity movement(s) between components

Smells (1)

  • Concern Overload: Tests

Generated by arcade-agent

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Architecture Analysis Summary

Powered by arcade-agent — automatic architectural self-analysis


📈 Metric Evolution

Baseline commit: 947794a

Legend: 🟢 better · 🔴 worse · 🟡 low impact · ⚪ no change

Metric Baseline Current Change
BalancedArchitectureScore 0.6329 0.6329 → (no change)
📦 Components 9 9 → (no change)
🧩 Entities 112 112 → (no change)
🔗 Edges 115 115 → (no change)
🏷️ Classes 20 20 → (no change)
ƒ Functions 268 268 → (no change)
🔧 Methods 33 33 → (no change)
RCI 0.5652 0.5652 → (no change)
TurboMQ 0.2493 0.2493 → (no change)
BasicMQ 0.2493 0.2493 → (no change)
IntraConnectivity 0.0182 0.0182 → (no change)
InterConnectivity 0.0345 0.0345 → (no change)
TwoWayPairRatio 0.0000 0.0000 → (no change)
DependencyHealth 0.9810 0.9810 → (no change)
ComponentBalance 0.5357 0.5357 → (no change)
HubBalance 0.5000 0.5000 → (no change)
BoundaryClarity 0.9444 0.9444 → (no change)
DependencyDistribution 0.6263 0.6263 → (no change)
SmellDiscipline 1.0000 1.0000 → (no change)
PrincipleAlignmentScore 0.8657 0.8657 → (no change)

🏛️ Current Architecture

Metric Value
📦 Components 9
🧩 Entities 112
🔗 Edges 115
🏷️ Classes 20
ƒ Functions 268
🔧 Methods 33
Balanced Score 🟡 0.6329 (Fair)
Principle Alignment 0.8657
RCI 0.5652
TurboMQ 0.2493
BasicMQ 0.2493
IntraConnectivity 0.0182
InterConnectivity 0.0345
TwoWayPairRatio 0.0000
DependencyHealth 0.9810
ComponentBalance 0.5357
HubBalance 0.5000
BoundaryClarity 0.9444
DependencyDistribution 0.6263
SmellDiscipline 1.0000

🧭 Principle Signals

Signal Value
AcyclicDependencies 1.0000
LayeringHealth 0.9858
ResponsibilityFocus 1.0000
InterfaceSegregation 1.0000
ComponentBalance 0.5357
HubBalance 0.5000
BoundaryClarity 0.9444
DependencyDistribution 0.6263
SmellDiscipline 1.0000

🎯 Score Drivers

Biggest risks

  • HubBalance: gap=0.5000 (signal=0.5000)
  • ComponentBalance: gap=0.4643 (signal=0.5357)
  • DependencyDistribution: gap=0.3737 (signal=0.6263)

Strongest areas

  • AcyclicDependencies: gap=0.0000 (signal=1.0000)
  • InterfaceSegregation: gap=0.0000 (signal=1.0000)
  • ResponsibilityFocus: gap=0.0000 (signal=1.0000)

🕸️ High-Level Design

graph TD
    Algorithms["Algorithms\n39 entities\n5 classes / 3 methods"]
    Budget["Budget\n3 entities\n0 classes / 0 methods"]
    Cache["Cache\n4 entities\n0 classes / 0 methods"]
    Ci["Ci\n5 entities\n0 classes / 0 methods"]
    Exporters["Exporters\n14 entities\n1 classes / 0 methods"]
    Incremental["Incremental\n2 entities\n1 classes / 2 methods"]
    Parsers["Parsers\n17 entities\n11 classes / 27 methods"]
    Serialization["Serialization\n8 entities\n0 classes / 0 methods"]
    Tools["Tools\n20 entities\n2 classes / 1 methods"]
    Cache --> Serialization
    Ci --> Algorithms
    Ci --> Exporters
    Ci --> Serialization
    Ci --> Tools
    Serialization --> Algorithms
    Serialization --> Parsers
    Tools --> Algorithms
    Tools --> Cache
    Tools --> Exporters
    Tools --> Parsers
Loading
🏗️ Components breakdown
Component Entities Classes Methods
Algorithms 39 5 3
Tools 20 2 1
Parsers 17 11 27
Exporters 14 1 0
Serialization 8 0 0
Ci 5 0 0
Cache 4 0 0
Budget 3 0 0
Incremental 2 1 2

🚨 Architectural Smells

✅ No architectural smells detected.

📈 Evolution vs Baseline

Baseline commit: 947794a

Architecture-to-Architecture (A2A) Comparison

Metric Value
A2A Similarity 1.0000
Matched Components 9
Components Added 0
Components Removed 0
Component matching details

Matched:

Baseline Current Similarity
Algorithms Algorithms 1.0000
Budget Budget 1.0000
Cache Cache 1.0000
Ci Ci 1.0000
Exporters Exporters 1.0000
Incremental Incremental 1.0000
Parsers Parsers 1.0000
Serialization Serialization 1.0000
Tools Tools 1.0000
High-level component statistics
Status Baseline Current Similarity Entities Classes Methods
matched Algorithms Algorithms 1.0000 39 → 39 (0) 5 → 5 (0) 3 → 3 (0)
matched Budget Budget 1.0000 3 → 3 (0) 0 → 0 (0) 0 → 0 (0)
matched Cache Cache 1.0000 4 → 4 (0) 0 → 0 (0) 0 → 0 (0)
matched Ci Ci 1.0000 5 → 5 (0) 0 → 0 (0) 0 → 0 (0)
matched Exporters Exporters 1.0000 14 → 14 (0) 1 → 1 (0) 0 → 0 (0)
matched Incremental Incremental 1.0000 2 → 2 (0) 1 → 1 (0) 2 → 2 (0)
matched Parsers Parsers 1.0000 17 → 17 (0) 11 → 11 (0) 27 → 27 (0)
matched Serialization Serialization 1.0000 8 → 8 (0) 0 → 0 (0) 0 → 0 (0)
matched Tools Tools 1.0000 20 → 20 (0) 2 → 2 (0) 1 → 1 (0)
Before/After Mermaid diagrams

Baseline

graph TD
    Algorithms["Algorithms\n39 entities\n5 classes / 3 methods"]
    Budget["Budget\n3 entities\n0 classes / 0 methods"]
    Cache["Cache\n4 entities\n0 classes / 0 methods"]
    Ci["Ci\n5 entities\n0 classes / 0 methods"]
    Exporters["Exporters\n14 entities\n1 classes / 0 methods"]
    Incremental["Incremental\n2 entities\n1 classes / 2 methods"]
    Parsers["Parsers\n17 entities\n11 classes / 27 methods"]
    Serialization["Serialization\n8 entities\n0 classes / 0 methods"]
    Tools["Tools\n20 entities\n2 classes / 1 methods"]
    Cache --> Serialization
    Ci --> Algorithms
    Ci --> Exporters
    Ci --> Serialization
    Ci --> Tools
    Serialization --> Algorithms
    Serialization --> Parsers
    Tools --> Algorithms
    Tools --> Cache
    Tools --> Exporters
    Tools --> Parsers
Loading

Current

graph TD
    Algorithms["Algorithms\n39 entities\n5 classes / 3 methods"]
    Budget["Budget\n3 entities\n0 classes / 0 methods"]
    Cache["Cache\n4 entities\n0 classes / 0 methods"]
    Ci["Ci\n5 entities\n0 classes / 0 methods"]
    Exporters["Exporters\n14 entities\n1 classes / 0 methods"]
    Incremental["Incremental\n2 entities\n1 classes / 2 methods"]
    Parsers["Parsers\n17 entities\n11 classes / 27 methods"]
    Serialization["Serialization\n8 entities\n0 classes / 0 methods"]
    Tools["Tools\n20 entities\n2 classes / 1 methods"]
    Cache --> Serialization
    Ci --> Algorithms
    Ci --> Exporters
    Ci --> Serialization
    Ci --> Tools
    Serialization --> Algorithms
    Serialization --> Parsers
    Tools --> Algorithms
    Tools --> Cache
    Tools --> Exporters
    Tools --> Parsers
Loading
Component dependency delta
Status Source Target
matched No dependency delta -

💡 CI/CD Insights

  • Quality Score: 🟡 Fair (BalancedArchitectureScore=0.6329)
  • Principle Alignment: 0.8657 (higher means cleaner layering, focus, and boundaries)
  • Top Risk Driver: HubBalance (signal=0.5000)
  • Trend: ➡️ Stable architectural quality
  • Architecture Stability: 🟢 High (A2A=1.0000)
  • Smells: ✅ Clean — no architectural smells

📄 View HTML reports and artifacts


This comment is auto-generated by the self-dogfooding CI job. It updates on every push to this PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant