---
title: "The Tests Are Green. The Architecture Is Not: Why I Built Archfit"
url: https://daily.dev/posts/the-tests-are-green-the-architecture-is-not-why-i-built-archfit-t3jjujoib
source_url: https://itnext.io/the-tests-are-green-the-architecture-is-not-why-i-built-archfit-d871beb9dfcc
type: article
source: "ITNEXT"
published: 2026-08-24T22:26:08.759Z
updated: 2026-08-24T22:26:36.319Z
tags: ["architecture", "ai-agents", "cicd", "domain-driven-design"]
reading_time: 12
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Tests Are Green. The Architecture Is Not: Why I Built Archfit

**[ITNEXT](https://daily.dev/sources/itnext)** · 12 min read · 1 upvotes · 0 comments

## Summary

An open-source tool called Archfit addresses architecture erosion accelerated by AI coding agents, which can produce code that passes tests and linters while quietly violating module boundaries. Archfit reads declared architectural intent from a YAML config, checks it against actual code dependencies, and fails CI when violations occur, producing machine-readable repair tasks agents can act on. The approach draws on Vlad Khononov's Balanced Coupling model, scoring relationships by integration strength, distance, and volatility, and is framed as a structural sensor rather than a full architecture judge—it cannot detect business-logic issues, catch a misconfigured policy, or replace human decisions about when intent should change. It targets repositories with deliberate module boundaries and heavy agent-driven change, and is open source under Apache-2.0 on GitHub.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://itnext.io/the-tests-are-green-the-architecture-is-not-why-i-built-archfit-d871beb9dfcc>

## Questions this post answers

### How does Archfit detect architecture violations like forbidden module imports?

Archfit reads declared architectural intent from a .archfit.yaml file specifying module paths, public APIs, and internal boundaries, then uses language adapters to collect dependency evidence and an LLM-free decision layer to check it against the configured rules. A rule like public_api_only rejects cross-module access into internal paths, failing the archfit check command and CI when violated, with a machine-readable repair task generated for the agent.

_Developers hardening AI-agent workflows against architecture drift can track tools like this on daily.dev._

### How does Vlad Khononov's Balanced Coupling model score coupling between two components?

It scores a relationship using three ordinal dimensions: integration strength (how much knowledge crosses the boundary, anchored 1 for contract coupling to 10 for intrusive coupling), distance (2 for same module to 9 for separate deploy units), and volatility (anchors of 1, 3, and 10, with 6 as a documented midpoint for medium volatility). The balance score is max(|strength - distance|, 10 - volatility) + 1, ranging from 1 (critical) to 10 (well balanced).

_Teams weighing coupling tradeoffs in modular systems can follow this kind of architecture thinking on daily.dev._

### Why do AI coding agents tend to cause architecture erosion even when tests pass?

Coding agents make locally reasonable decisions within a small task context, such as importing directly from another module's internal persistence layer because the needed function was conveniently available there, and tests and linters do not check whether that dependency was architecturally allowed. Coverage confirms code executed, not that the boundary was respected, so the pull request looks clean while structural quality degrades one convenient import at a time.

_Developers relying on AI agents for feature work can keep up with architecture-governance practices on daily.dev._

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#ai-agents](https://daily.dev/tags/ai-agents), [#cicd](https://daily.dev/tags/cicd), [#domain-driven-design](https://daily.dev/tags/domain-driven-design)

[View this post on daily.dev](https://daily.dev/posts/the-tests-are-green-the-architecture-is-not-why-i-built-archfit-t3jjujoib)
