Skip to content

Make ArchitectureTests read the resolved dependency graph - #71

Merged
brandonifco merged 1 commit into
mainfrom
tests/load-bearing-architecture-tests
Sep 15, 2026
Merged

brandonifco merged 1 commit into
mainfrom
tests/load-bearing-architecture-tests

Conversation

@brandonifco

Copy link
Copy Markdown
Owner

Closes #54.

ArchitectureTests in RulesKernel.Tests and RulesKernel.Randomness.Tests, and the no-randomness assertion in RegulatoryProbe.Tests, used Assembly.GetReferencedAssemblies(). The compiler omits references the code never uses, so while no kernel assembly calls another, those tests passed whatever the project graph said.

They now read the .deps.json the SDK writes beside each test assembly. It lists every project in the resolved graph with its declared dependencies, used or not.

  • RulesKernel depends on no RulesKernel* project.
  • RulesKernel.Randomness depends only on RulesKernel, and RulesKernel.Testing only on RulesKernel.Randomness.
  • RegulatoryProbe.Tests has RulesKernel in its graph and never RulesKernel.Randomness.

Verified they bite: with a ProjectReference from RulesKernel to RulesKernel.Analyzers, and another from the probe to RulesKernel.Randomness, all three fail. Nothing calls across either reference. The layering text check also flagged the injection, so the two nets agree. docs/architecture.md and the repo-checks docstring no longer call these tests vacuous.

🤖 Generated with Claude Code

They called GetReferencedAssemblies(), which omits references the code never
uses, so they passed vacuously (#54). They now read the test run's .deps.json,
which records every project's declared dependencies. Verified by injecting a
ProjectReference from RulesKernel to RulesKernel.Analyzers and one from
RegulatoryProbe to RulesKernel.Randomness: all three affected tests fail.

Closes #54

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@brandonifco
brandonifco merged commit c1ae084 into main Sep 15, 2026
1 check passed
@brandonifco
brandonifco deleted the tests/load-bearing-architecture-tests branch September 15, 2026 19:20
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.

ArchitectureTests pass vacuously until one kernel assembly consumes another

1 participant