<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Viswanath Maharam</title>
    <description>The latest articles on DEV Community by Viswanath Maharam (@viswanath2maharam).</description>
    <link>https://dev.to/viswanath2maharam</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png</url>
      <title>DEV Community: Viswanath Maharam</title>
      <link>https://dev.to/viswanath2maharam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/viswanath2maharam"/>
    <language>en</language>
    <item>
      <title>ArchGuard: The Visual Architecture Linter for Open-Source Repositories</title>
      <dc:creator>Viswanath Maharam</dc:creator>
      <pubDate>Thu, 08 Oct 2026 10:47:58 +0000</pubDate>
      <link>https://dev.to/viswanath2maharam/archguard-the-visual-architecture-linter-for-open-source-repositories-2m5k</link>
      <guid>https://dev.to/viswanath2maharam/archguard-the-visual-architecture-linter-for-open-source-repositories-2m5k</guid>
      <description>&lt;h1&gt;
  
  
  ArchGuard — Visual Architecture Conformance Engine
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The architecture diagram in your README is the contract. Undeclared code imports are drift.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Built for &lt;strong&gt;Hacktoberfest Hack Day Coimbatore 2026&lt;/strong&gt; (hosted by &lt;strong&gt;INIT Club × iDEA Club × MLH&lt;/strong&gt;).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/Raghu17012009/Quantum_Coders-Hacktober-" rel="noopener noreferrer"&gt;Quantum_Coders-Hacktober-&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team:&lt;/strong&gt; Quantum_Coders (Raghunathan B K, Kaevin P, Viswanath A G, Sanjay Siddhakumar)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Problem: Architecture Diagrams Are Dead Pixels
&lt;/h2&gt;

&lt;p&gt;In software engineering, architecture diagrams are drawn once and rarely updated. A team draws a clean 4-tier system in Figma or Excalidraw (&lt;code&gt;API Gateway → Orders → Inventory → Database&lt;/code&gt;), exports it as &lt;code&gt;architecture.png&lt;/code&gt;, and drops it into the &lt;code&gt;README.md&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Then features ship and pull requests merge. &lt;/p&gt;

&lt;p&gt;Inside &lt;code&gt;order_service/checkout.py&lt;/code&gt;, an engineer lazily writes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;database.connection&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;raw_sql_query&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The app still runs. The tests still pass. But the boundary is destroyed—Order Service is now talking directly to Database, bypassing Inventory. Nobody notices until the codebase rots into an undocumented monolith.&lt;/p&gt;

&lt;p&gt;Existing tools like &lt;strong&gt;Tach&lt;/strong&gt; and &lt;strong&gt;import-linter&lt;/strong&gt; exist, but they require developers to manually maintain tedious, 100-line YAML/TOML configuration files that almost nobody updates. &lt;strong&gt;The PNG diagram is the only contract the repository actually has.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What ArchGuard Does
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ArchGuard bridges the visual diagram and executable code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of letting documentation rot, ArchGuard turns your visual diagram into an automated, executable test in your CI/CD pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Multimodal Visual Extraction:&lt;/strong&gt; Google DeepMind's &lt;strong&gt;Gemma 4&lt;/strong&gt; inspects &lt;code&gt;architecture.png&lt;/code&gt; and extracts the declared directed dependency arrows into a structured graph schema.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic AST Import Scanner:&lt;/strong&gt; A Python standard library scanner parses actual cross-module imports across all files without executing code or needing virtualenvs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph Diff Engine:&lt;/strong&gt; Calculates &lt;code&gt;Undeclared Edges = Actual Imports − Declared Diagram Edges&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Actionable Diagnostics:&lt;/strong&gt; Flags the exact file and line of the violation, exits with code 1 in CI, and outputs an interactive Mermaid drift diagram with red dashed drift arrows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Skill Open Standard:&lt;/strong&gt; Fully packaged under &lt;code&gt;skills/archguard/SKILL.md&lt;/code&gt; compliant with the Agent Skill Open Standard for autonomous coding agents.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;architecture.png
      │
      ▼  Gemma 4 (multimodal visual extraction)
declared edges  (or --edges declared_edges.json offline)

Python source files
      │
      ▼  Python AST scanner (stdlib ast only)
actual imports  (file + line)

actual imports − declared edges
      │
      ▼
drift
      ├── terminal: file + line, exit 1 (drift) or exit 0 (clean)
      ├── drift_report.md   — Mermaid diagram (works offline in VS Code)
      └── drift_report.html — red/green visual summary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How It Works in Action (The Demo)
&lt;/h2&gt;

&lt;p&gt;We built a 4-service mock repository (&lt;code&gt;api_gateway&lt;/code&gt;, &lt;code&gt;order_service&lt;/code&gt;, &lt;code&gt;inventory_service&lt;/code&gt;, &lt;code&gt;database&lt;/code&gt;) with a single planted drift on line 2 of &lt;code&gt;checkout.py&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Running the Audit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; archguard.cli check &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--diagram&lt;/span&gt; demo_repo/architecture.png &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repo&lt;/span&gt; ./demo_repo &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--edges&lt;/span&gt; demo_repo/declared_edges.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Terminal Output (Exit Code 1):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;⚠️  Architectural drift detected: 1 undeclared edge(s)
   ! order_service -&amp;gt; database in order_service/checkout.py:2

Reports generated: drift_report.md, drift_report.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. The Generated Mermaid Drift Report
&lt;/h3&gt;

&lt;p&gt;ArchGuard dynamically renders the drift in VS Code Markdown Preview:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    api_gateway --&amp;gt; order_service
    order_service --&amp;gt; inventory_service
    inventory_service --&amp;gt; database
    order_service -.-&amp;gt;|DRIFT: line 2| database
    linkStyle 3 stroke:#ff0000,stroke-width:3px,stroke-dasharray: 5 5;&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  3. The Fix
&lt;/h3&gt;

&lt;p&gt;Comment out line 2 in &lt;code&gt;checkout.py&lt;/code&gt; and re-run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✅ 0 undeclared edges. Codebase conforms 100% to architecture.png.
(Exit Code: 0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Under the Hood &amp;amp; Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Language:&lt;/strong&gt; Python 3.11+&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vision Model:&lt;/strong&gt; Google DeepMind Gemma 4 (via Google GenAI SDK)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scanner:&lt;/strong&gt; Python standard library &lt;code&gt;ast&lt;/code&gt; module (zero external dependencies)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visuals:&lt;/strong&gt; Mermaid.js &amp;amp; Pillow&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standards:&lt;/strong&gt; Agent Skill Open Standard (&lt;code&gt;SKILL.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Suite:&lt;/strong&gt; 5 automated integration tests running in 0.108s (&lt;code&gt;test_archguard.py&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What We Learned
&lt;/h2&gt;

&lt;p&gt;We learned how to harness multimodal open-weights models like Gemma 4 for structured geometric reasoning rather than conversational text, how to extract cross-module package dependencies deterministically via ASTs, and how to build resilient developer tools with offline fallbacks.&lt;/p&gt;

&lt;p&gt;Check out our code and give it a star on GitHub:&lt;br&gt;&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://github.com/Raghu17012009/Quantum_Coders-Hacktober-" rel="noopener noreferrer"&gt;github.com/Raghu17012009/Quantum_Coders-Hacktober-&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
