Commit e673471
committed
test(archunit): pin args sub-package as a true leaf
Adds argsPackageIsALeaf to LlamaArchitectureTest: classes in
net.ladenthin.llama.args must not depend on the root API package or
the json parser package. Catches a future drift like an enum gaining
a "convenient" helper that pulls in JNI state or a JSON DTO.
The traditional 3-layer layeredArchitecture() rule (Args -> Json ->
Api) was attempted first and rejected on evidence: json parsers/
serializers genuinely depend on root-package DTOs (Pair, ChatMessage,
ContentPart) AND the root API genuinely depends on json parsers
(LlamaIterator, JsonParameters, LlamaModel, ModelParameters import
from json). json and api are peers in the public API layer, not a
stackable hierarchy. Splitting the DTOs into a dedicated
net.ladenthin.llama.value package would enable real layering, but
breaks published public-API FQNs (net.ladenthin.llama.Pair, etc.)
and is out of scope for an ArchUnit rule.
The argsPackageIsALeaf rule pins the only real layered invariant
that the current package design supports. noPackageCycles already
catches the looser "no cycles between subpackages" property.
Tests: 10 of 10 pass (was 9; +1 for the new leaf rule).1 parent 0a97ae7 commit e673471
1 file changed
Lines changed: 28 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
66 | 94 | | |
67 | 95 | | |
68 | 96 | | |
| |||
0 commit comments