<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="386648" data-post-id="386648">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="yoavgeva" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/yoavgeva/120/39979_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  yoavgeva
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Compiler does catch circular dependencies like → mutal import, use, some struct references, etc.<br>
that create a compile order deadlock.</p>
<p>ArchTest catches with should_be_free_of_cycles →  Runtime call graph cycles, these are cases where module A calls a function in B, and B calls a function in A.<br>
Elixir compiles these just fine — there’s no compilation deadlock — but they represent tight architectural coupling you might want to prevent.</p>
<p>Example: <a href="https://github.com/yoavgeva/arch_test/tree/main/test/support/fixture_app/lib/fixture_app/domain" rel="noopener nofollow ugc">test fixture</a> and <a href="https://github.com/yoavgeva/arch_test/blob/main/test/arch_test/assertions_test.exs#L113-L125" rel="noopener nofollow ugc">assertion tests</a></p>
<p>ArchTest isn’t about catching things that won’t compile — it’s about enforcing the architectural rules your team has agreed on, so they don’t quietly erode over time. Things like “the Web layer<br>
should never call into Orders directly”, “no circular dependencies between bounded contexts”, or “no IO.puts left in production code”. The code will compile and run fine without these rules — but six months later you’ve got a ball of mud.<br>
ArchTest makes those rules fail the test suite, so they stay enforced as the codebase grows and new people join the team.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="386648" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/archtest-architecture-rules-as-tests-enforced-from-bytecode/74558/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-386648" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="386648"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="389274" data-post-id="389274">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="yoavgeva" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/yoavgeva/120/39979_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  yoavgeva
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Small update: ArchTest <code>0.3.x</code> is ready.</p>
<p>Main things added in <code>0.3.x</code>:</p>
<ul>
<li><code>use ArchTest, app: :my_app</code> for app-scoped architecture tests</li>
<li>empty rule subjects now fail by default, so typoed patterns dont silently pass</li>
<li><code>freeze: true</code> for easier gradual adoption</li>
<li><code>ArchTest.Collector.calls/2</code> for function-level call metadata</li>
<li><code>ArchTest.Rule</code> for reusable rules with ignore/freeze support</li>
<li><code>define_slices_by/2</code> for auto-discovering modulith slices</li>
<li><code>ArchTest.PlantUML.enforce/2</code> to check component diagrams against real dependencies</li>
<li>extra metrics like <code>afferent/2</code>, <code>efferent/2</code>, <code>fan_in/2</code>, <code>fan_out/2</code>, <code>dependency_depth/2</code></li>
<li>better Igniter generators with app scoping and safer defaults</li>
</ul>
<p><code>0.3.1</code> also includes executable examples against a real compiled fixture app, including PlantUML, call metadata, reusable rules, captured slices, and metrics. I added<br>
this becuase docs are nice, but seeing it run against real BEAM files is alot clearer.</p>
<p>Upgrade:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{:arch_test, "~&gt; 0.3", only: :test, runtime: false}
</code></pre>
<p>Migration guide from 0.2:<br>
<a href="https://hexdocs.pm/arch_test/migrating-to-0.3.html" rel="noopener nofollow ugc">https://hexdocs.pm/arch_test/migrating-to-0.3.html</a></p>
<p>Docs:<br>
<a href="https://hexdocs.pm/arch_test" class="inline-onebox" rel="noopener nofollow ugc">ArchTest v0.3.1 — Documentation</a></p>
<p>Hex:<br>
<a href="https://hex.pm/packages/arch_test" class="inline-onebox" rel="nofollow">arch_test | Hex</a></p>
<p>Thanks again for the feedback here, it helped shape this release quite a bit.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="389274" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/archtest-architecture-rules-as-tests-enforced-from-bytecode/74558/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-389274" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="389274"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>