r/scala • • 2d ago

Code Is Cheap, Bad Architecture Is Not: Introducing Wiremap

https://blog.pierre-ricadat.com/introducing-wiremap/

I just released Wiremap, a tool that keeps a model of your system's architecture in your repository. Your agent extracts it from the code, updates it with each change, and every edge points to the line of code it comes from. You can also add rules, and wiremap check fails when a PR breaks one.

It's not Scala-specific at all: it works on any stack since the agent does the reading. But the CLI is written in Scala 3 and compiled with GraalVM Native Image, which turned out to work really well. And the code is open source.

It's still new, so feedback is welcome!

60 Upvotes

5 comments sorted by

2

u/swoogles 19h ago

I am very excited about this! Are there ways to configure it to work across multiple repos? At my company, we have several services that are contained in separate repos, but I still would love to have this type of analysis performed against the code.

2

u/ghostdogpr 14h ago

Yes! Each repo gets its own model, and services from other repos appear in it as outside nodes. You can tell the agent in wiremap/conventions.md to look at the other repos for callers too. The evidence check runs on the code of the current repo, though, so it won't notice if a caller in another repo goes away. I’ll look into supporting this better!

4

u/Fun_Introduction9550 2d ago

Looks great - I’d like to add it to my “template” project.

It seems like we’ve had similar thinking, in that:

Project tools (agile boards, architecture, risk register, ADR, …) should be co-located with the code, and with their data models in a text format.

Check out project dashboard

It puts all those things under a “docs” folder in markdown, and can serve up a nice UI dashboard/edit tool for humans.

Rather than docs in confluence, tickets in jira, gantt schedule in some PM tool, everything (including the code) about a project live together in git history.

So when you mitigate a risk, or action a decision record, or prioritise a task which changes the project schedule, all that happens in one git commit/unit of work

Anyway - I didn’t mean to hijack your post.

Great work! 👍

1

u/rsx0806 2d ago

whats the difference between this and archify?

7

u/ghostdogpr 2d ago

Archify is probably nicer if you want a one-off diagram of your system. Wiremap is more about keeping an architecture model in the repo and treating it like code:

  • the model is a small text file committed next to the code, with only the architecture, updated with each change and reviewed in diffs (Archify has the concept of snapshots but they're big JSON files with layout and styling mixed up).
  • every edge points to the code it comes from, and wiremap check fails in CI when they no longer match. On the same repo, renaming a service or changing a call URL fails Wiremap's check, but Archify doesn't notice.
  • you can write rules like "no call to this service except from the gateway" that fail CI

So I'd say Wiremap is mostly about generating, maintaining and enforcing a model, with the visualization as the cherry on top.