Skip to content

fix: resolve TypeScript workspace imports and qualify graph metrics - #42

Draft
tuannx wants to merge 1 commit into
mainfrom
codex/fix-typescript-workspace-imports-41
Draft

fix: resolve TypeScript workspace imports and qualify graph metrics#42
tuannx wants to merge 1 commit into
mainfrom
codex/fix-typescript-workspace-imports-41

Conversation

@tuannx

@tuannx tuannx commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • resolve local TypeScript/JavaScript bare imports through inherited JSONC tsconfig/jsconfig baseUrl/paths configuration and npm workspace package manifests
  • classify each discovered import as resolved-local, unresolved-local, or external, then preserve bounded resolution/link coverage metadata through multi-language parsing, caching, filtering, metrics, and CI snapshots
  • visibly qualify graph-derived scores in HTML, architecture-diff, baseline-comment, step-summary, and evolution reports when discovered local dependencies remain unresolved or unlinked; numeric score formulas are unchanged
  • narrow the README support claim and record the parser-hardening rule and bug-catalog entry

Validation

  • ruff check src/ tests/
  • pytest -q — 549 passed
  • focused parser/cache/metric/report suite — 98 passed
  • generated 937,780-byte TypeScript source — 12,000 entities in 0.416s (~28.9k entities/s)
  • DeepSeek Harness dogfood (3,096 TypeScript/JavaScript files):
    • main: 16,811 entities, 179 edges
    • this branch: 16,811 entities, 8,352 edges
    • coverage: 5,254 resolved local, 1,422 unresolved local, 2,833 linked, 2,421 unlinked; metrics correctly marked qualified
    • parse-only wall time: ~10.0s on main, ~13.1s on this branch

Notes

  • No dependencies were added.
  • Compiler-equivalent support for dynamic import(), CommonJS require(), package-based config extends, custom resolver plugins, and every conditional-exports mode remains out of scope and is documented.
  • Strict project-wide mypy src/ still reports existing typing debt outside this change; the new resolver/parser introduce no file-local diagnostics (the focused check reaches the existing raw dict annotation in parsers/graph.py).

Fixes #41

@github-actions

Copy link
Copy Markdown
Contributor

Architecture Drift Report

Algorithm: PKG | Entities: 155 | Components: 11

Drift from Baseline

Metric Baseline Current Delta
Components 11 11 +0
Similarity 0.97
BalancedArchitectureScore 0.62 0.61 ⚪ -0.00
PrincipleAlignmentScore 0.85 0.85 ⚪ -0.00
RCI 0.56 0.55 🔴 -0.01
TurboMQ 2.68 2.60 🔴 -0.08
BasicMQ 0.24 0.24 🔴 -0.01
IntraConnectivity 0.02 0.01 ⚪ -0.00
InterConnectivity 0.05 0.05 ⚪ -0.00
TwoWayPairRatio 0.00 0.00 ⚪ +0.00
DependencyHealth 0.97 0.97 ⚪ +0.00
ComponentBalance 0.47 0.46 🔴 -0.01
HubBalance 0.50 0.50 ⚪ +0.00
BoundaryClarity 0.95 0.95 🔴 -0.01
DependencyDistribution 0.63 0.64 🟢 +0.01
SmellDiscipline 0.95 0.95 ⚪ +0.00

Architectural changes — baselinecurrent

No architectural changes since the baseline.

Components

Component Entities Responsibility
Algorithms 48 Entities in algorithms
Parsers 36 Entities in parsers
Tools 23 Entities in tools
Exporters 18 Entities in exporters
Serialization 8 Entities in serialization
Source 7 Entities in source
Ci 5 Entities in ci
Cache 4 Entities in cache
Budget 3 Entities in budget
Incremental 2 Entities in incremental
Display 1 Entities in display

Architecture Diagram

graph LR
    Algorithms["Algorithms"]
    Budget["Budget"]
    Cache["Cache"]
    Ci["Ci"]
    Display["Display"]
    Exporters["Exporters"]
    Incremental["Incremental"]
    Parsers["Parsers"]
    Serialization["Serialization"]
    Source["Source"]
    Tools["Tools"]
    Cache --> Serialization
    Ci --> Algorithms
    Ci --> Display
    Ci --> Exporters
    Ci --> Serialization
    Ci --> Tools
    Exporters --> Algorithms
    Serialization --> Algorithms
    Serialization --> Parsers
    Source --> Cache
    Source --> Parsers
    Tools --> Algorithms
    Tools --> Exporters
    Tools --> Source
Loading

Smells (1)

  • Concern Overload: Tools
    • 💡 Split the overloaded component into smaller, focused units. Consider extracting sub-packages or introducing an interface layer.

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: 1b3532b

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

Metric Baseline Current Change
BalancedArchitectureScore 0.6166 0.6119 🔴 ↓ (-0.0047)
📦 Components 11 11 → (no change)
🧩 Entities 143 155 🟡 ↑ (+12.0000)
🔗 Edges 145 150 🟡 ↑ (+5.0000)
🏷️ Classes 32 43 🟡 ↑ (+11.0000)
ƒ Functions 330 344 🟡 ↑ (+14.0000)
🔧 Methods 39 58 🟡 ↑ (+19.0000)
RCI 0.5586 0.5467 🔴 ↓ (-0.0119)
TurboMQ 2.6782 2.5997 🔴 ↓ (-0.0785)
BasicMQ 0.2435 0.2363 🔴 ↓ (-0.0072)
IntraConnectivity 0.0160 0.0130 🟡 ↓ (-0.0030)
InterConnectivity 0.0530 0.0490 🟢 ↓ (-0.0040)
TwoWayPairRatio 0.0000 0.0000 → (no change)
DependencyHealth 0.9708 0.9730 🟢 ↑ (+0.0022)
ComponentBalance 0.4723 0.4581 🔴 ↓ (-0.0142)
HubBalance 0.5000 0.5000 → (no change)
BoundaryClarity 0.9545 0.9455 🔴 ↓ (-0.0090)
DependencyDistribution 0.6294 0.6429 🟢 ↑ (+0.0135)
SmellDiscipline 0.9455 0.9455 → (no change)
PrincipleAlignmentScore 0.8511 0.8502 🔴 ↓ (-0.0009)

🏛️ Current Architecture

Metric Value
📦 Components 11
🧩 Entities 155
🔗 Edges 150
🏷️ Classes 43
ƒ Functions 344
🔧 Methods 58
Balanced Score 🟡 0.6119 (Fair)
Principle Alignment 0.8502
RCI 0.5467
TurboMQ 2.5997
BasicMQ 0.2363
IntraConnectivity 0.0130
InterConnectivity 0.0490
TwoWayPairRatio 0.0000
DependencyHealth 0.9730
ComponentBalance 0.4581
HubBalance 0.5000
BoundaryClarity 0.9455
DependencyDistribution 0.6429
SmellDiscipline 0.9455

🧭 Principle Signals

Signal Value
AcyclicDependencies 1.0000
LayeringHealth 0.9798
ResponsibilityFocus 0.9455
InterfaceSegregation 1.0000
ComponentBalance 0.4581
HubBalance 0.5000
BoundaryClarity 0.9455
DependencyDistribution 0.6429
SmellDiscipline 0.9455

🎯 Score Drivers

Biggest risks

  • ComponentBalance: gap=0.5419 (signal=0.4581)
  • HubBalance: gap=0.5000 (signal=0.5000)
  • DependencyDistribution: gap=0.3571 (signal=0.6429)

Strongest areas

  • AcyclicDependencies: gap=0.0000 (signal=1.0000)
  • InterfaceSegregation: gap=0.0000 (signal=1.0000)
  • LayeringHealth: gap=0.0202 (signal=0.9798)

🕸️ High-Level Design

graph TD
    Algorithms["Algorithms\n48 entities\n10 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"]
    Display["Display\n1 entities\n0 classes / 0 methods"]
    Exporters["Exporters\n18 entities\n2 classes / 0 methods"]
    Incremental["Incremental\n2 entities\n1 classes / 2 methods"]
    Parsers["Parsers\n36 entities\n26 classes / 51 methods"]
    Serialization["Serialization\n8 entities\n0 classes / 0 methods"]
    Source["Source\n7 entities\n1 classes / 1 methods"]
    Tools["Tools\n23 entities\n3 classes / 1 methods"]
    Cache --> Serialization
    Ci --> Algorithms
    Ci --> Display
    Ci --> Exporters
    Ci --> Serialization
    Ci --> Tools
    Exporters --> Algorithms
    Serialization --> Algorithms
    Serialization --> Parsers
    Source --> Cache
    Source --> Parsers
    Tools --> Algorithms
    Tools --> Exporters
    Tools --> Source
Loading
🏗️ Components breakdown
Component Entities Classes Methods
Algorithms 48 10 3
Parsers 36 26 51
Tools 23 3 1
Exporters 18 2 0
Serialization 8 0 0
Source 7 1 1
Ci 5 0 0
Cache 4 0 0
Budget 3 0 0
Incremental 2 1 2
Display 1 0 0

🚨 Architectural Smells

Severity Type Affected Components
🟡 medium Concern Overload Tools

📈 Evolution vs Baseline

Baseline commit: 1b3532b

Architecture-to-Architecture (A2A) Comparison

Metric Value
A2A Similarity 0.9678
Matched Components 11
Components Added 0
Components Removed 0
Component matching details

Matched:

Baseline Current Similarity
Budget Budget 1.0000
Cache Cache 1.0000
Ci Ci 1.0000
Display Display 1.0000
Incremental Incremental 1.0000
Serialization Serialization 1.0000
Source Source 1.0000
Tools Tools 1.0000
Algorithms Algorithms 0.9792
Exporters Exporters 0.9444
Parsers Parsers 0.7222
High-level component statistics
Status Baseline Current Similarity Entities Classes Methods
matched Algorithms Algorithms 0.9792 47 → 48 (+1) 10 → 10 (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 Display Display 1.0000 1 → 1 (0) 0 → 0 (0) 0 → 0 (0)
matched Exporters Exporters 0.9444 17 → 18 (+1) 1 → 2 (+1) 0 → 0 (0)
matched Incremental Incremental 1.0000 2 → 2 (0) 1 → 1 (0) 2 → 2 (0)
matched Parsers Parsers 0.7222 26 → 36 (+10) 16 → 26 (+10) 32 → 51 (+19)
matched Serialization Serialization 1.0000 8 → 8 (0) 0 → 0 (0) 0 → 0 (0)
matched Source Source 1.0000 7 → 7 (0) 1 → 1 (0) 1 → 1 (0)
matched Tools Tools 1.0000 23 → 23 (0) 3 → 3 (0) 1 → 1 (0)
Before/After Mermaid diagrams

Baseline

graph TD
    Algorithms["Algorithms\n47 entities\n10 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"]
    Display["Display\n1 entities\n0 classes / 0 methods"]
    Exporters["Exporters\n17 entities\n1 classes / 0 methods"]
    Incremental["Incremental\n2 entities\n1 classes / 2 methods"]
    Parsers["Parsers\n26 entities\n16 classes / 32 methods"]
    Serialization["Serialization\n8 entities\n0 classes / 0 methods"]
    Source["Source\n7 entities\n1 classes / 1 methods"]
    Tools["Tools\n23 entities\n3 classes / 1 methods"]
    Cache --> Serialization
    Ci --> Algorithms
    Ci --> Display
    Ci --> Exporters
    Ci --> Serialization
    Ci --> Tools
    Serialization --> Algorithms
    Serialization --> Parsers
    Source --> Cache
    Source --> Parsers
    Tools --> Algorithms
    Tools --> Exporters
    Tools --> Source
Loading

Current

graph TD
    Algorithms["Algorithms\n48 entities\n10 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"]
    Display["Display\n1 entities\n0 classes / 0 methods"]
    Exporters["Exporters\n18 entities\n2 classes / 0 methods"]
    Incremental["Incremental\n2 entities\n1 classes / 2 methods"]
    Parsers["Parsers\n36 entities\n26 classes / 51 methods"]
    Serialization["Serialization\n8 entities\n0 classes / 0 methods"]
    Source["Source\n7 entities\n1 classes / 1 methods"]
    Tools["Tools\n23 entities\n3 classes / 1 methods"]
    Cache --> Serialization
    Ci --> Algorithms
    Ci --> Display
    Ci --> Exporters
    Ci --> Serialization
    Ci --> Tools
    Exporters --> Algorithms
    Serialization --> Algorithms
    Serialization --> Parsers
    Source --> Cache
    Source --> Parsers
    Tools --> Algorithms
    Tools --> Exporters
    Tools --> Source
Loading
Component dependency delta
Status Source Target
added Exporters Algorithms

💡 CI/CD Insights

  • Quality Score: 🟡 Fair (BalancedArchitectureScore=0.6119)
  • Principle Alignment: 0.8502 (higher means cleaner layering, focus, and boundaries)
  • Top Risk Driver: ComponentBalance (signal=0.4581)
  • Trend: ➡️ Stable architectural quality
  • Architecture Stability: 🟢 High (A2A=0.9678)
  • Smells: ⚠️ 1 smell(s) — review suggested

📄 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.

TypeScript parser drops local bare imports and overstates graph quality

1 participant